diff --git a/j-lawyer-client/src/com/jdimension/jlawyer/client/bea/SendBeaMessageDialog.java b/j-lawyer-client/src/com/jdimension/jlawyer/client/bea/SendBeaMessageDialog.java index c43b19bf1..a0b0b0bf3 100755 --- a/j-lawyer-client/src/com/jdimension/jlawyer/client/bea/SendBeaMessageDialog.java +++ b/j-lawyer-client/src/com/jdimension/jlawyer/client/bea/SendBeaMessageDialog.java @@ -1899,28 +1899,6 @@ private void cmdSendActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST log.error("Unable to unarchive case " + this.contextArchiveFile.getFileNumber(), ex); } - BeaListItem priority=null; - if(this.cmbPriorities.getSelectedItem() instanceof BeaListItem) - // first index is a string (no priority selected) - priority=(BeaListItem)this.cmbPriorities.getSelectedItem(); - - if (this.chkSaveAsDocument.isSelected()) { - a = new SendBeaMessageAction(dlg, this, messageType, fromSafeId, attachmentMetadata, this.cu, this.chkEeb.isSelected(), this.authority, recipients, this.txtSubject.getText(), ed.getText(), priority, this.contextArchiveFile, createDocumentTag, this.txtAzSender.getText(), this.cmbAzRecipient.getEditor().getItem().toString(), folder); - } else { - a = new SendBeaMessageAction(dlg, this, messageType, fromSafeId, attachmentMetadata, this.cu, this.chkEeb.isSelected(), this.authority, recipients, this.txtSubject.getText(), ed.getText(), priority, createDocumentTag, this.txtAzSender.getText(), this.cmbAzRecipient.getEditor().getItem().toString()); - } - a.start(); - - - UserSettings uset = UserSettings.getInstance(); - if (fromSafeId != null) { - uset.setSetting(UserSettings.CONF_BEA_LASTUSEDMAILBOX, fromSafeId); - } - - if (this.cmbTemplates.getSelectedItem() != null) { - uset.setSetting(UserSettings.CONF_BEA_LASTUSEDTEMPLATE, this.cmbTemplates.getSelectedItem().toString()); - } - if (!(this.radioReviewTypeNone.isSelected()) && this.contextArchiveFile != null) { if (this.txtReviewDateField.getText().length() != 10) { JOptionPane.showMessageDialog(this, "Wiedervorlagedatum ungültig", "beA-Nachricht senden", JOptionPane.INFORMATION_MESSAGE); @@ -1948,7 +1926,7 @@ private void cmdSendActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST if (CalendarUtils.checkForConflicts(this, reviewDto)) { try { - CalendarUtils.getInstance().storeCalendarEntry(reviewDto, this.contextArchiveFile.getId(), (CalendarEntryTemplate) this.cmbReviewReason.getItemAt(this.cmbReviewReason.getSelectedIndex())); + CalendarUtils.getInstance().storeCalendarEntry(reviewDto, this.contextArchiveFile, (CalendarEntryTemplate) this.cmbReviewReason.getItemAt(this.cmbReviewReason.getSelectedIndex()), this); } catch (Exception ex) { log.error("Error adding review", ex); JOptionPane.showMessageDialog(this, "Fehler beim Speichern des Kalendereintrages: " + ex.getMessage(), com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE); @@ -1957,6 +1935,30 @@ private void cmdSendActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST } } + + BeaListItem priority=null; + if(this.cmbPriorities.getSelectedItem() instanceof BeaListItem) + // first index is a string (no priority selected) + priority=(BeaListItem)this.cmbPriorities.getSelectedItem(); + + if (this.chkSaveAsDocument.isSelected()) { + a = new SendBeaMessageAction(dlg, this, messageType, fromSafeId, attachmentMetadata, this.cu, this.chkEeb.isSelected(), this.authority, recipients, this.txtSubject.getText(), ed.getText(), priority, this.contextArchiveFile, createDocumentTag, this.txtAzSender.getText(), this.cmbAzRecipient.getEditor().getItem().toString(), folder); + } else { + a = new SendBeaMessageAction(dlg, this, messageType, fromSafeId, attachmentMetadata, this.cu, this.chkEeb.isSelected(), this.authority, recipients, this.txtSubject.getText(), ed.getText(), priority, createDocumentTag, this.txtAzSender.getText(), this.cmbAzRecipient.getEditor().getItem().toString()); + } + a.start(); + + + UserSettings uset = UserSettings.getInstance(); + if (fromSafeId != null) { + uset.setSetting(UserSettings.CONF_BEA_LASTUSEDMAILBOX, fromSafeId); + } + + if (this.cmbTemplates.getSelectedItem() != null) { + uset.setSetting(UserSettings.CONF_BEA_LASTUSEDTEMPLATE, this.cmbTemplates.getSelectedItem().toString()); + } + + }//GEN-LAST:event_cmdSendActionPerformed @@ -2291,13 +2293,6 @@ private void cmdSaveDraftActionPerformed(java.awt.event.ActionEvent evt) {//GEN- log.error("Unable to unarchive case " + this.contextArchiveFile.getFileNumber(), ex); } - if (this.chkSaveAsDocument.isSelected()) { - a = new SaveBeaMessageAction(dlg, this, fromSafeId, attachmentMetadata, this.cu, this.chkEeb.isSelected(), this.authority, recipient, this.txtSubject.getText(), ed.getText(), this.contextArchiveFile, createDocumentTag, this.txtAzSender.getText(), this.cmbAzRecipient.getEditor().getItem().toString(), folder, priority); - } else { - a = new SaveBeaMessageAction(dlg, this, fromSafeId, attachmentMetadata, this.cu, this.chkEeb.isSelected(), this.authority, recipient, this.txtSubject.getText(), ed.getText(), createDocumentTag, this.txtAzSender.getText(), this.cmbAzRecipient.getEditor().getItem().toString(), priority); - } - a.start(); - if (!(this.radioReviewTypeNone.isSelected()) && this.contextArchiveFile != null) { if (this.txtReviewDateField.getText().length() != 10) { JOptionPane.showMessageDialog(this, "Wiedervorlagedatum ungültig", "beA-Nachricht als Entwurf speichern", JOptionPane.INFORMATION_MESSAGE); @@ -2325,7 +2320,7 @@ private void cmdSaveDraftActionPerformed(java.awt.event.ActionEvent evt) {//GEN- if (CalendarUtils.checkForConflicts(this, reviewDto)) { try { - CalendarUtils.getInstance().storeCalendarEntry(reviewDto, this.contextArchiveFile.getId(), (CalendarEntryTemplate) this.cmbReviewReason.getItemAt(this.cmbReviewReason.getSelectedIndex())); + CalendarUtils.getInstance().storeCalendarEntry(reviewDto, this.contextArchiveFile, (CalendarEntryTemplate) this.cmbReviewReason.getItemAt(this.cmbReviewReason.getSelectedIndex()), this); } catch (Exception ex) { log.error("Error adding review", ex); JOptionPane.showMessageDialog(this, "Fehler beim Speichern des Kalendereintrages: " + ex.getMessage(), com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE); @@ -2333,6 +2328,15 @@ private void cmdSaveDraftActionPerformed(java.awt.event.ActionEvent evt) {//GEN- } } + + if (this.chkSaveAsDocument.isSelected()) { + a = new SaveBeaMessageAction(dlg, this, fromSafeId, attachmentMetadata, this.cu, this.chkEeb.isSelected(), this.authority, recipient, this.txtSubject.getText(), ed.getText(), this.contextArchiveFile, createDocumentTag, this.txtAzSender.getText(), this.cmbAzRecipient.getEditor().getItem().toString(), folder, priority); + } else { + a = new SaveBeaMessageAction(dlg, this, fromSafeId, attachmentMetadata, this.cu, this.chkEeb.isSelected(), this.authority, recipient, this.txtSubject.getText(), ed.getText(), createDocumentTag, this.txtAzSender.getText(), this.cmbAzRecipient.getEditor().getItem().toString(), priority); + } + a.start(); + + }//GEN-LAST:event_cmdSaveDraftActionPerformed private void tblAttachmentsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblAttachmentsMouseClicked diff --git a/j-lawyer-client/src/com/jdimension/jlawyer/client/calendar/CalendarUtils.java b/j-lawyer-client/src/com/jdimension/jlawyer/client/calendar/CalendarUtils.java index d628404ff..ef8abc951 100755 --- a/j-lawyer-client/src/com/jdimension/jlawyer/client/calendar/CalendarUtils.java +++ b/j-lawyer-client/src/com/jdimension/jlawyer/client/calendar/CalendarUtils.java @@ -674,11 +674,16 @@ import com.jdimension.jlawyer.client.settings.ClientSettings; import com.jdimension.jlawyer.client.settings.ServerSettings; import com.jdimension.jlawyer.client.utils.FrameUtils; +import com.jdimension.jlawyer.persistence.ArchiveFileBean; import com.jdimension.jlawyer.persistence.ArchiveFileReviewsBean; import com.jdimension.jlawyer.persistence.CalendarEntryTemplate; import com.jdimension.jlawyer.services.CalendarServiceRemote; import com.jdimension.jlawyer.services.JLawyerServiceLocator; +import de.costache.calendar.NewEventEntryDialog; +import java.awt.Dialog; +import java.awt.Window; import java.util.ArrayList; +import java.util.Calendar; import java.util.Collections; import java.util.Date; import java.util.List; @@ -901,7 +906,7 @@ public static void populateCalendarEntryTemplatesList(JList list) { list.setModel(listMod); } - public ArchiveFileReviewsBean storeCalendarEntry(ArchiveFileReviewsBean entry, String caseId, CalendarEntryTemplate template) throws Exception { + public ArchiveFileReviewsBean storeCalendarEntry(ArchiveFileReviewsBean entry, ArchiveFileBean entryCase, CalendarEntryTemplate template, Window parent) throws Exception { EditorsRegistry.getInstance().updateStatus("Wiedervorlage/Frist wird gespeichert..."); try { ClientSettings settings = ClientSettings.getInstance(); @@ -909,11 +914,37 @@ public ArchiveFileReviewsBean storeCalendarEntry(ArchiveFileReviewsBean entry, S JLawyerServiceLocator locator = JLawyerServiceLocator.getInstance(settings.getLookupProperties()); CalendarServiceRemote calService = locator.lookupCalendarServiceRemote(); - entry = calService.addReview(caseId, entry); + entry = calService.addReview(entryCase.getId(), entry); EventBroker eb = EventBroker.getInstance(); eb.publishEvent(new ReviewAddedEvent(entry)); eb.publishEvent(new CasesChangedEvent()); + + if(template!=null && template.isRelated()) { + NewEventEntryDialog relatedEventDlg = new NewEventEntryDialog(null, parent, Dialog.ModalityType.APPLICATION_MODAL, entryCase, true); + relatedEventDlg.setTitle("weiterer Eintrag mit " + template.getRelatedOffsetDays() + " Tagen Versatz"); + relatedEventDlg.setEventType(entry.getEventType()); + relatedEventDlg.setSummary(template.getRelatedName()); + relatedEventDlg.setDescription(template.getRelatedDescription()); + relatedEventDlg.setReviewAssignee(entry.getAssignee()); + + Calendar c = Calendar.getInstance(); + c.setTime(entry.getBeginDate()); + c.add(Calendar.DAY_OF_YEAR, template.getRelatedOffsetDays()); + relatedEventDlg.setBeginDate(c.getTime()); + + Calendar c2=Calendar.getInstance(); + c2.setTime(entry.getEndDate()); + c2.add(Calendar.DAY_OF_YEAR, template.getRelatedOffsetDays()); + relatedEventDlg.setEndDate(c2.getTime()); + + relatedEventDlg.setEndDate(c2.getTime()); + + FrameUtils.centerDialog(relatedEventDlg, parent); + relatedEventDlg.setVisible(true); + } + + return entry; } finally { EditorsRegistry.getInstance().clearStatus(); diff --git a/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/AddDocumentFromTemplateDialog.java b/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/AddDocumentFromTemplateDialog.java index 5003ca54c..8d3f68bc3 100755 --- a/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/AddDocumentFromTemplateDialog.java +++ b/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/AddDocumentFromTemplateDialog.java @@ -1511,7 +1511,7 @@ private void addAndOpen(boolean openAfterAdd) { if (CalendarUtils.checkForConflicts(this, reviewDto)) { try { - CalendarUtils.getInstance().storeCalendarEntry(reviewDto, this.aFile.getId(), (CalendarEntryTemplate) this.cmbReviewReason.getItemAt(this.cmbReviewReason.getSelectedIndex())); + CalendarUtils.getInstance().storeCalendarEntry(reviewDto, this.aFile, (CalendarEntryTemplate) this.cmbReviewReason.getItemAt(this.cmbReviewReason.getSelectedIndex()), this); } catch (Exception ex) { log.error("Error adding review", ex); JOptionPane.showMessageDialog(this, "Fehler beim Speichern des Kalendereintrages: " + ex.getMessage(), com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE); diff --git a/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/AddNoteDialog.java b/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/AddNoteDialog.java index 28f32d619..18725f50b 100755 --- a/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/AddNoteDialog.java +++ b/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/AddNoteDialog.java @@ -1145,7 +1145,7 @@ private void cmdAddDocumentActionPerformed(java.awt.event.ActionEvent evt) {//GE if (CalendarUtils.checkForConflicts(this, reviewDto)) { try { - CalendarUtils.getInstance().storeCalendarEntry(reviewDto, this.aFile.getId(), (CalendarEntryTemplate) this.cmbReviewReason.getItemAt(this.cmbReviewReason.getSelectedIndex())); + CalendarUtils.getInstance().storeCalendarEntry(reviewDto, this.aFile, (CalendarEntryTemplate) this.cmbReviewReason.getItemAt(this.cmbReviewReason.getSelectedIndex()), this); } catch (Exception ex) { log.error("Error adding review", ex); JOptionPane.showMessageDialog(this, "Fehler beim Speichern des Kalendereintrages: " + ex.getMessage(), com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE); diff --git a/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/ArchiveFilePanel.java b/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/ArchiveFilePanel.java index 13937c097..c5037744e 100755 --- a/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/ArchiveFilePanel.java +++ b/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/ArchiveFilePanel.java @@ -1054,7 +1054,6 @@ public Component getTableCellRendererComponent(JTable table, Object value, boole ingo.populateMenu(this.mnuAssistant, capabilities2, (AssistantInputAdapter)this); } catch (Exception ex) { log.error(ex); - JOptionPane.showMessageDialog(this, "Assistent Ingo aktuell nicht erreichbar: " + ex.getMessage(), com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE); } EventBroker b = EventBroker.getInstance(); @@ -4216,7 +4215,7 @@ public void addReview(CalendarEntryTemplate template, int eventType, String reas reviewDto.setLocation(location); reviewDto.setCalendarSetup(calSetup); - reviewDto = CalendarUtils.getInstance().storeCalendarEntry(reviewDto, this.dto.getId(), template); + reviewDto = CalendarUtils.getInstance().storeCalendarEntry(reviewDto, this.dto, template, EditorsRegistry.getInstance().getMainWindow()); if (this.chkArchived.isSelected()) { this.chkArchived.setSelected(false); diff --git a/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/EditOrDuplicateEventDialog.java b/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/EditOrDuplicateEventDialog.java index 784dcd4fc..c87bade0f 100755 --- a/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/EditOrDuplicateEventDialog.java +++ b/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/EditOrDuplicateEventDialog.java @@ -1058,7 +1058,7 @@ private void cmdOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:e CalendarServiceRemote calService = locator.lookupCalendarServiceRemote(); if (this.mode == MODE_DUPLICATE) { // when duplicating, do not pass in the template because we do not want to handle adding related events - targetReview = CalendarUtils.getInstance().storeCalendarEntry(targetReview, this.caseDto.getId(), null); + targetReview = CalendarUtils.getInstance().storeCalendarEntry(targetReview, this.caseDto, null, this); } else if (this.mode == MODE_EDIT) { targetReview = calService.updateReview(this.caseDto.getId(), targetReview); EventBroker eb = EventBroker.getInstance(); diff --git a/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/NewEventPanel.java b/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/NewEventPanel.java index ea5c6ea2e..71bbff9b4 100644 --- a/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/NewEventPanel.java +++ b/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/files/NewEventPanel.java @@ -724,18 +724,22 @@ public void mouseClicked(MouseEvent event) { list.repaint(list.getCellBounds(index, index)); int selectionCount = 0; - String selectedItemText = ""; + String selectedItemSummary = ""; + String selectedItemDescription = ""; for (int i = 0; i < list.getModel().getSize(); i++) { CalendarEntryTemplateListItem cli = (CalendarEntryTemplateListItem) list.getModel().getElementAt(i); if (cli.isSelected()) { selectionCount++; - selectedItemText = cli.toString(); + selectedItemSummary = cli.toString(); + selectedItemDescription = cli.getEntry().getDescription(); } } if (selectionCount == 1) { - txtReviewReason.setText(selectedItemText); + txtReviewReason.setText(selectedItemSummary); + taEventDescription.setText(selectedItemDescription); } else { txtReviewReason.setText(""); + taEventDescription.setText(""); } } }); @@ -1272,7 +1276,7 @@ public void setReviewAssignee(String assignee) { } } } - + public void setBeginDate(Date d) { this.txtEventBeginDateField.setText(dateFormat.format(d)); @@ -1286,6 +1290,14 @@ public void setEndDate(Date d) { this.cmbEventEndTime.setSelectedItem(timeFormat.format(d)); } + + public void setSummary(String summary) { + this.txtReviewReason.setText(summary); + } + + public void setDescription(String description) { + this.taEventDescription.setText(description); + } public void setEventType(int eventType) { this.radioEventTypeFollowUp.setSelected(true); diff --git a/j-lawyer-client/src/com/jdimension/jlawyer/client/mail/SendEmailDialog.java b/j-lawyer-client/src/com/jdimension/jlawyer/client/mail/SendEmailDialog.java index 21ebdb7ab..f29306a6d 100755 --- a/j-lawyer-client/src/com/jdimension/jlawyer/client/mail/SendEmailDialog.java +++ b/j-lawyer-client/src/com/jdimension/jlawyer/client/mail/SendEmailDialog.java @@ -1844,6 +1844,42 @@ private void cmdSendActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST } } } + + if (!(this.radioReviewTypeNone.isSelected()) && this.contextArchiveFile != null) { + if (this.txtReviewDateField.getText().length() != 10) { + JOptionPane.showMessageDialog(this, "Wiedervorlagedatum ungültig", "E-Mail senden", JOptionPane.INFORMATION_MESSAGE); + return; + } + Date d = null; + try { + SimpleDateFormat df = new SimpleDateFormat("dd.MM.yyyy"); + d = df.parse(this.txtReviewDateField.getText()); + } catch (Throwable t) { + JOptionPane.showMessageDialog(this, "Wiedervorlagedatum ungültig", "E-Mail senden", JOptionPane.INFORMATION_MESSAGE); + return; + } + + ArchiveFileReviewsBean reviewDto = new ArchiveFileReviewsBean(); + reviewDto.setEventType(ArchiveFileReviewsBean.EVENTTYPE_FOLLOWUP); + if (this.radioReviewTypeRespite.isSelected()) { + reviewDto.setEventType(ArchiveFileReviewsBean.EVENTTYPE_RESPITE); + } + reviewDto.setDone(false); + reviewDto.setBeginDate(d); + reviewDto.setAssignee(this.cmbReviewAssignee.getSelectedItem().toString()); + reviewDto.setSummary(this.cmbReviewReason.getEditor().getItem().toString()); + reviewDto.setCalendarSetup(this.calendarSelectionButton1.getSelectedSetup()); + + if (CalendarUtils.checkForConflicts(this, reviewDto)) { + try { + CalendarUtils.getInstance().storeCalendarEntry(reviewDto, this.contextArchiveFile, (CalendarEntryTemplate) this.cmbReviewReason.getItemAt(this.cmbReviewReason.getSelectedIndex()), this); + } catch (Exception ex) { + log.error("Error adding review", ex); + JOptionPane.showMessageDialog(this, "Fehler beim Speichern des Kalendereintrages: " + ex.getMessage(), com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE); + } + } + + } ProgressableAction a = null; if (this.chkSaveAsDocument.isSelected()) { @@ -1904,41 +1940,7 @@ private void cmdSendActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST uset.setSetting(UserSettings.CONF_MAIL_LASTUSEDTEMPLATE, this.cmbTemplates.getSelectedItem().toString()); } - if (!(this.radioReviewTypeNone.isSelected()) && this.contextArchiveFile != null) { - if (this.txtReviewDateField.getText().length() != 10) { - JOptionPane.showMessageDialog(this, "Wiedervorlagedatum ungültig", "E-Mail senden", JOptionPane.INFORMATION_MESSAGE); - return; - } - Date d = null; - try { - SimpleDateFormat df = new SimpleDateFormat("dd.MM.yyyy"); - d = df.parse(this.txtReviewDateField.getText()); - } catch (Throwable t) { - JOptionPane.showMessageDialog(this, "Wiedervorlagedatum ungültig", "E-Mail senden", JOptionPane.INFORMATION_MESSAGE); - return; - } - - ArchiveFileReviewsBean reviewDto = new ArchiveFileReviewsBean(); - reviewDto.setEventType(ArchiveFileReviewsBean.EVENTTYPE_FOLLOWUP); - if (this.radioReviewTypeRespite.isSelected()) { - reviewDto.setEventType(ArchiveFileReviewsBean.EVENTTYPE_RESPITE); - } - reviewDto.setDone(false); - reviewDto.setBeginDate(d); - reviewDto.setAssignee(this.cmbReviewAssignee.getSelectedItem().toString()); - reviewDto.setSummary(this.cmbReviewReason.getEditor().getItem().toString()); - reviewDto.setCalendarSetup(this.calendarSelectionButton1.getSelectedSetup()); - - if (CalendarUtils.checkForConflicts(this, reviewDto)) { - try { - CalendarUtils.getInstance().storeCalendarEntry(reviewDto, this.contextArchiveFile.getId(), (CalendarEntryTemplate) this.cmbReviewReason.getItemAt(this.cmbReviewReason.getSelectedIndex())); - } catch (Exception ex) { - log.error("Error adding review", ex); - JOptionPane.showMessageDialog(this, "Fehler beim Speichern des Kalendereintrages: " + ex.getMessage(), com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE); - } - } - - } + }//GEN-LAST:event_cmdSendActionPerformed diff --git a/j-lawyer-client/src/com/jdimension/jlawyer/client/mail/sidebar/ConfirmationStep.java b/j-lawyer-client/src/com/jdimension/jlawyer/client/mail/sidebar/ConfirmationStep.java index a097edbae..7314aa1a1 100644 --- a/j-lawyer-client/src/com/jdimension/jlawyer/client/mail/sidebar/ConfirmationStep.java +++ b/j-lawyer-client/src/com/jdimension/jlawyer/client/mail/sidebar/ConfirmationStep.java @@ -667,6 +667,7 @@ import com.jdimension.jlawyer.client.events.CasesChangedEvent; import com.jdimension.jlawyer.client.events.EventBroker; import com.jdimension.jlawyer.client.settings.ClientSettings; +import com.jdimension.jlawyer.client.utils.FrameUtils; import com.jdimension.jlawyer.client.wizard.*; import com.jdimension.jlawyer.persistence.AddressBean; import com.jdimension.jlawyer.persistence.ArchiveFileAddressesBean; @@ -682,6 +683,7 @@ import javax.swing.JLabel; import javax.swing.JOptionPane; import org.apache.log4j.Logger; +import org.jdesktop.swingx.util.WindowUtils; /** * @@ -861,7 +863,7 @@ public void display() { if(newEvent!=null) { newEvent.setArchiveFileKey(newCase); try { - CalendarUtils.getInstance().storeCalendarEntry(newEvent, newCase.getId(), newEventTpl); + CalendarUtils.getInstance().storeCalendarEntry(newEvent, newCase, newEventTpl, WindowUtils.findWindow(this)); } catch (Exception ex) { log.error("Error adding review", ex); JOptionPane.showMessageDialog(this, "Fehler beim Speichern des Kalendereintrages: " + ex.getMessage(), com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE); diff --git a/j-lawyer-client/src/de/costache/calendar/CalendarPanel.java b/j-lawyer-client/src/de/costache/calendar/CalendarPanel.java index ae71acbb5..11408004b 100644 --- a/j-lawyer-client/src/de/costache/calendar/CalendarPanel.java +++ b/j-lawyer-client/src/de/costache/calendar/CalendarPanel.java @@ -688,6 +688,7 @@ You should also get your employer (if you work as a programmer) or school, import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; +import java.awt.Dialog; import java.awt.Dimension; import java.awt.Image; import java.awt.event.ActionEvent; @@ -1194,7 +1195,7 @@ public void eventAdded(final ModelChangedEvent event) { return; } - NewEventEntryDialog dlg2 = new NewEventEntryDialog(this, EditorsRegistry.getInstance().getMainWindow(), true, sel); + NewEventEntryDialog dlg2 = new NewEventEntryDialog(this, EditorsRegistry.getInstance().getMainWindow(), Dialog.ModalityType.APPLICATION_MODAL, sel, false); dlg2.setEventType(ArchiveFileReviewsBean.EVENTTYPE_EVENT); dlg2.setBeginDate(event.getIntervalStart()); dlg2.setEndDate(event.getIntervalEnd()); diff --git a/j-lawyer-client/src/de/costache/calendar/NewEventEntryDialog.java b/j-lawyer-client/src/de/costache/calendar/NewEventEntryDialog.java index c497d6711..f1348652a 100644 --- a/j-lawyer-client/src/de/costache/calendar/NewEventEntryDialog.java +++ b/j-lawyer-client/src/de/costache/calendar/NewEventEntryDialog.java @@ -683,18 +683,20 @@ public class NewEventEntryDialog extends javax.swing.JDialog implements NewEvent private CalendarPanel calendarPanel = null; private ArchiveFileBean eventCase = null; + private boolean preventRelatedEvents=true; /** * Creates new form NewEventEntryDialog * * @param calPanel * @param parent - * @param modal + * @param modalityType * @param eventCase */ - public NewEventEntryDialog(CalendarPanel calPanel, java.awt.Frame parent, boolean modal, ArchiveFileBean eventCase) { - super(parent, modal); + public NewEventEntryDialog(CalendarPanel calPanel, java.awt.Window parent, java.awt.Dialog.ModalityType modalityType, ArchiveFileBean eventCase, boolean preventRelatedEvents) { + super(parent, modalityType); initComponents(); + this.preventRelatedEvents=preventRelatedEvents; this.eventCase = eventCase; this.calendarPanel = calPanel; this.newEventPanel.setNewEventListener(this); @@ -716,6 +718,14 @@ public void setEventType(int eventType) { public void setReviewAssignee(String assignee) { this.newEventPanel.setReviewAssignee(assignee); } + + public void setSummary(String summary) { + this.newEventPanel.setSummary(summary); + } + + public void setDescription(String description) { + this.newEventPanel.setDescription(description); + } /** * This method is called from within the constructor to initialize the form. @@ -776,7 +786,7 @@ public static void main(String args[]) { /* Create and display the dialog */ java.awt.EventQueue.invokeLater(() -> { - NewEventEntryDialog dialog = new NewEventEntryDialog(null, new javax.swing.JFrame(), true, null); + NewEventEntryDialog dialog = new NewEventEntryDialog(null, new javax.swing.JFrame(), ModalityType.APPLICATION_MODAL, null, true); dialog.addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent e) { @@ -806,14 +816,19 @@ public void addReview(CalendarEntryTemplate template, int eventType, String reas ev.setCalendarSetup(calSetup); try { - ev = CalendarUtils.getInstance().storeCalendarEntry(ev, this.eventCase.getId(), template); + if(this.preventRelatedEvents) + ev = CalendarUtils.getInstance().storeCalendarEntry(ev, this.eventCase, null, this); + else + ev = CalendarUtils.getInstance().storeCalendarEntry(ev, this.eventCase, template, this); } catch (Exception ex) { log.error("Error adding review", ex); JOptionPane.showMessageDialog(this, "Fehler beim Speichern des Kalendereintrages: " + ex.getMessage(), com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE); return; } - this.calendarPanel.addCalendarEvent(ev); + if(this.calendarPanel!=null) { + this.calendarPanel.addCalendarEvent(ev); + } } @Override diff --git a/j-lawyer-proprietary/libs/j-lawyer-bea-wrapper.jar b/j-lawyer-proprietary/libs/j-lawyer-bea-wrapper.jar index 7436a4159..7deb675aa 100644 Binary files a/j-lawyer-proprietary/libs/j-lawyer-bea-wrapper.jar and b/j-lawyer-proprietary/libs/j-lawyer-bea-wrapper.jar differ