Der Typ einer Assoziation zwischen einer generischen Organisation (GenericOrganizationalUnit) und einem Kontakt (GenericContact) kann jetzt nachträglich geändert
werden. git-svn-id: https://svn.libreccm.org/ccm/trunk@763 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
d50306851d
commit
dd645e695c
|
|
@ -1066,3 +1066,4 @@ cms.ui.workflow.approve_this_content=Approve
|
||||||
cms.ui.unknownRole=Unknown role
|
cms.ui.unknownRole=Unknown role
|
||||||
cms.ui.unknownStatus=Unknown status
|
cms.ui.unknownStatus=Unknown status
|
||||||
cms.contenttypes.ui.genericorgaunit.persons.status=Status
|
cms.contenttypes.ui.genericorgaunit.persons.status=Status
|
||||||
|
cms.ui.edit_assoc=Edit association
|
||||||
|
|
|
||||||
|
|
@ -1057,3 +1057,4 @@ cms.ui.workflow.approve_this_content=Aktzeptieren
|
||||||
cms.ui.unknownRole=Unbekannte Rolle
|
cms.ui.unknownRole=Unbekannte Rolle
|
||||||
cms.ui.unknownStatus=Unbekannter status
|
cms.ui.unknownStatus=Unbekannter status
|
||||||
cms.contenttypes.ui.genericorgaunit.persons.status=Status
|
cms.contenttypes.ui.genericorgaunit.persons.status=Status
|
||||||
|
cms.ui.edit_assoc=Verkn\u00fcpfung bearbeiten
|
||||||
|
|
|
||||||
|
|
@ -5,3 +5,4 @@ cms.ui.unknownRole=
|
||||||
cms.ui.unknownStatus=Unknown status
|
cms.ui.unknownStatus=Unknown status
|
||||||
cms.contenttypes.ui.genericorgaunit.persons.status=Status
|
cms.contenttypes.ui.genericorgaunit.persons.status=Status
|
||||||
cms.contenttypes.shared.basic_properties.title=
|
cms.contenttypes.shared.basic_properties.title=
|
||||||
|
cms.ui.edit_assoc=
|
||||||
|
|
|
||||||
|
|
@ -536,3 +536,4 @@ cms.contenttypes.ui.address.uri=URL (TRANSLATE THIS cms.contenttypes.ui.address.
|
||||||
cms.contenttypes.ui.address.email.desc=Means of contacting someone at this address (TRANSLATE THIS cms.contenttypes.ui.address.email.desc)
|
cms.contenttypes.ui.address.email.desc=Means of contacting someone at this address (TRANSLATE THIS cms.contenttypes.ui.address.email.desc)
|
||||||
cms.contenttypes.ui.address.uri.desc=A URL to find more information about this Address (TRANSLATE THIS cms.contenttypes.ui.address.uri.desc)
|
cms.contenttypes.ui.address.uri.desc=A URL to find more information about this Address (TRANSLATE THIS cms.contenttypes.ui.address.uri.desc)
|
||||||
cms.contenttypes.shared.basic_properties.title=
|
cms.contenttypes.shared.basic_properties.title=
|
||||||
|
cms.ui.edit_assoc=
|
||||||
|
|
|
||||||
|
|
@ -132,3 +132,4 @@ cms.contenttypes.ui.person.contact.del=Delete
|
||||||
"cms.contenttypes.ui.genericorgaunit.contacts.none=No contacts associated yet
|
"cms.contenttypes.ui.genericorgaunit.contacts.none=No contacts associated yet
|
||||||
cms.contenttypes.ui.genericorgaunit.contact.up=Up
|
cms.contenttypes.ui.genericorgaunit.contact.up=Up
|
||||||
cms.contenttypes.ui.genericorgaunit.contact.down=Down
|
cms.contenttypes.ui.genericorgaunit.contact.down=Down
|
||||||
|
cms.contenttypes.ui.genericorgaunit.contact.edit=Edit association
|
||||||
|
|
|
||||||
|
|
@ -143,3 +143,4 @@ cms.contenttypes.ui.person.contact.del=L\u00f6schen
|
||||||
"cms.contenttypes.ui.genericorgaunit.contacts.none=Derzeit sind keine Kontakte verkn\u00fcpft
|
"cms.contenttypes.ui.genericorgaunit.contacts.none=Derzeit sind keine Kontakte verkn\u00fcpft
|
||||||
cms.contenttypes.ui.genericorgaunit.contact.up=Hoch
|
cms.contenttypes.ui.genericorgaunit.contact.up=Hoch
|
||||||
cms.contenttypes.ui.genericorgaunit.contact.down=Runter
|
cms.contenttypes.ui.genericorgaunit.contact.down=Runter
|
||||||
|
cms.contenttypes.ui.genericorgaunit.contact.edit=Verkn\u00fcpfung bearbeiten
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ package com.arsdigita.cms.contenttypes;
|
||||||
import com.arsdigita.domain.DomainCollection;
|
import com.arsdigita.domain.DomainCollection;
|
||||||
import com.arsdigita.persistence.DataCollection;
|
import com.arsdigita.persistence.DataCollection;
|
||||||
import com.arsdigita.persistence.DataObject;
|
import com.arsdigita.persistence.DataObject;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -34,30 +33,38 @@ public class GenericOrganizationalUnitContactCollection extends DomainCollection
|
||||||
private final static Logger s_log =
|
private final static Logger s_log =
|
||||||
Logger.getLogger(
|
Logger.getLogger(
|
||||||
GenericOrganizationalUnitContactCollection.class);
|
GenericOrganizationalUnitContactCollection.class);
|
||||||
public static final String CONTACT_ORDER = "link.contact_order";
|
public static final String LINK_CONTACT_ORDER = "link.contact_order";
|
||||||
public static final String CONTACT_TYPE = "link.contact_type";
|
public static final String LINK_CONTACT_TYPE = "link.contact_type";
|
||||||
|
public static final String CONTACT_ORDER = "contact_order";
|
||||||
|
public static final String CONTACT_TYPE = "contact_type";
|
||||||
|
|
||||||
public GenericOrganizationalUnitContactCollection(
|
public GenericOrganizationalUnitContactCollection(
|
||||||
DataCollection dataCollection) {
|
DataCollection dataCollection) {
|
||||||
super(dataCollection);
|
super(dataCollection);
|
||||||
|
|
||||||
m_dataCollection.addOrder(CONTACT_ORDER);
|
m_dataCollection.addOrder(LINK_CONTACT_ORDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the contact type of the link
|
// Get the contact type of the link
|
||||||
public String getContactType() {
|
public String getContactType() {
|
||||||
return (String) m_dataCollection.get(CONTACT_TYPE);
|
return (String) m_dataCollection.get(LINK_CONTACT_TYPE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContactType(final String contactType) {
|
||||||
|
DataObject link = (DataObject) this.get("link");
|
||||||
|
|
||||||
|
link.set(CONTACT_TYPE, contactType);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the contact order of the link
|
// Get the contact order of the link
|
||||||
public Integer getContactOrder() {
|
public Integer getContactOrder() {
|
||||||
return (Integer) m_dataCollection.get(CONTACT_ORDER);
|
return (Integer) m_dataCollection.get(LINK_CONTACT_ORDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setContactOrder(Integer order) {
|
public void setContactOrder(Integer order) {
|
||||||
DataObject link = (DataObject) this.get("link");
|
DataObject link = (DataObject) this.get("link");
|
||||||
|
|
||||||
link.set(CONTACT_ORDER, order);
|
link.set(LINK_CONTACT_ORDER, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -57,10 +57,14 @@ public class GenericOrganizationalUnitContactAddForm extends BasicItemForm {
|
||||||
private SaveCancelSection m_saveCancelSection;
|
private SaveCancelSection m_saveCancelSection;
|
||||||
private final String ITEM_SEARCH = "personAddress";
|
private final String ITEM_SEARCH = "personAddress";
|
||||||
private ItemSelectionModel m_itemModel;
|
private ItemSelectionModel m_itemModel;
|
||||||
|
private GenericOrganizationalUnitContactPropertiesStep editStep;
|
||||||
|
private Label selectedContactLabel;
|
||||||
|
|
||||||
public GenericOrganizationalUnitContactAddForm(ItemSelectionModel itemModel) {
|
public GenericOrganizationalUnitContactAddForm(ItemSelectionModel itemModel,
|
||||||
|
GenericOrganizationalUnitContactPropertiesStep editStep) {
|
||||||
super("ContactEntryAddForm", itemModel);
|
super("ContactEntryAddForm", itemModel);
|
||||||
m_itemModel = itemModel;
|
m_itemModel = itemModel;
|
||||||
|
this.editStep = editStep;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -71,6 +75,9 @@ public class GenericOrganizationalUnitContactAddForm extends BasicItemForm {
|
||||||
findByAssociatedObjectType(GenericContact.class.getName()));
|
findByAssociatedObjectType(GenericContact.class.getName()));
|
||||||
add(m_itemSearch);
|
add(m_itemSearch);
|
||||||
|
|
||||||
|
selectedContactLabel = new Label("");
|
||||||
|
add(selectedContactLabel);
|
||||||
|
|
||||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.contact.type")));
|
"cms.contenttypes.ui.genericorgaunit.contact.type")));
|
||||||
ParameterModel contactTypeParam = new StringParameter(
|
ParameterModel contactTypeParam = new StringParameter(
|
||||||
|
|
@ -95,8 +102,24 @@ public class GenericOrganizationalUnitContactAddForm extends BasicItemForm {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(FormSectionEvent fse) throws FormProcessException {
|
public void init(FormSectionEvent fse) throws FormProcessException {
|
||||||
|
FormData data = fse.getFormData();
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
|
|
||||||
|
GenericContact selectedContact = editStep.getSelectedContact();
|
||||||
|
String selectedContactType = editStep.getSelectedContactType();
|
||||||
|
|
||||||
|
if (selectedContact == null) {
|
||||||
|
selectedContactLabel.setVisible(state, false);
|
||||||
|
} else {
|
||||||
|
data.put(ITEM_SEARCH, selectedContact);
|
||||||
|
data.put(GenericOrganizationalUnitContactCollection.CONTACT_TYPE,
|
||||||
|
selectedContactType);
|
||||||
|
|
||||||
|
m_itemSearch.setVisible(state, false);
|
||||||
|
selectedContactLabel.setLabel(selectedContact.getTitle(), state);
|
||||||
|
selectedContactLabel.setVisible(state, true);
|
||||||
|
}
|
||||||
|
|
||||||
setVisible(state, true);
|
setVisible(state, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,12 +130,36 @@ public class GenericOrganizationalUnitContactAddForm extends BasicItemForm {
|
||||||
GenericOrganizationalUnit orgaunit = (GenericOrganizationalUnit) getItemSelectionModel().
|
GenericOrganizationalUnit orgaunit = (GenericOrganizationalUnit) getItemSelectionModel().
|
||||||
getSelectedObject(state);
|
getSelectedObject(state);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||||
orgaunit.addContact((GenericContact) data.get(ITEM_SEARCH),
|
GenericContact selectedContact;
|
||||||
(String) data.get(
|
selectedContact = editStep.getSelectedContact();
|
||||||
GenericOrganizationalUnit.CONTACT_TYPE));
|
|
||||||
|
if (selectedContact == null) {
|
||||||
|
orgaunit.addContact((GenericContact) data.get(ITEM_SEARCH),
|
||||||
|
(String) data.get(
|
||||||
|
GenericOrganizationalUnit.CONTACT_TYPE));
|
||||||
|
} else {
|
||||||
|
GenericOrganizationalUnitContactCollection contacts;
|
||||||
|
|
||||||
|
contacts = orgaunit.getContacts();
|
||||||
|
|
||||||
|
while (contacts.next()) {
|
||||||
|
if (contacts.getContact().equals(selectedContact)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
contacts.setContactType((String) data.get(
|
||||||
|
GenericOrganizationalUnitContactCollection.CONTACT_TYPE));
|
||||||
|
|
||||||
|
editStep.setSelectedContact(null);
|
||||||
|
editStep.setSelectedContactType(null);
|
||||||
|
contacts.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//init(fse);
|
init(fse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||||
|
|
@ -34,7 +35,9 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
public class GenericOrganizationalUnitContactPropertiesStep
|
public class GenericOrganizationalUnitContactPropertiesStep
|
||||||
extends SimpleEditStep {
|
extends SimpleEditStep {
|
||||||
|
|
||||||
private static String ADD_CONTACT_SHEET_NAME = "addContact";
|
public static final String ADD_CONTACT_SHEET_NAME = "addContact";
|
||||||
|
private GenericContact selectedContact;
|
||||||
|
private String selectedContactType;
|
||||||
|
|
||||||
public GenericOrganizationalUnitContactPropertiesStep(
|
public GenericOrganizationalUnitContactPropertiesStep(
|
||||||
ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||||
|
|
@ -43,12 +46,12 @@ public class GenericOrganizationalUnitContactPropertiesStep
|
||||||
|
|
||||||
public GenericOrganizationalUnitContactPropertiesStep(
|
public GenericOrganizationalUnitContactPropertiesStep(
|
||||||
ItemSelectionModel itemModel, AuthoringKitWizard parent,
|
ItemSelectionModel itemModel, AuthoringKitWizard parent,
|
||||||
String prefix) {
|
String prefix) {
|
||||||
super(itemModel, parent, prefix);
|
super(itemModel, parent, prefix);
|
||||||
|
|
||||||
BasicItemForm addContactSheet =
|
BasicItemForm addContactSheet =
|
||||||
new GenericOrganizationalUnitContactAddForm(
|
new GenericOrganizationalUnitContactAddForm(itemModel,
|
||||||
itemModel);
|
this);
|
||||||
add(ADD_CONTACT_SHEET_NAME,
|
add(ADD_CONTACT_SHEET_NAME,
|
||||||
(String) ContenttypesGlobalizationUtil.globalize(
|
(String) ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.add_contact").localize(),
|
"cms.contenttypes.ui.genericorgaunit.add_contact").localize(),
|
||||||
|
|
@ -56,7 +59,23 @@ public class GenericOrganizationalUnitContactPropertiesStep
|
||||||
addContactSheet.getSaveCancelSection().getCancelButton());
|
addContactSheet.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
GenericOrganizationalUnitContactTable contactsTable = new GenericOrganizationalUnitContactTable(
|
GenericOrganizationalUnitContactTable contactsTable = new GenericOrganizationalUnitContactTable(
|
||||||
itemModel);
|
itemModel, this);
|
||||||
setDisplayComponent(contactsTable);
|
setDisplayComponent(contactsTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GenericContact getSelectedContact() {
|
||||||
|
return selectedContact;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelectedContact(final GenericContact selectedContact) {
|
||||||
|
this.selectedContact = selectedContact;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSelectedContactType() {
|
||||||
|
return selectedContactType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelectedContactType(final String selectedContactType) {
|
||||||
|
this.selectedContactType = selectedContactType;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,9 +45,14 @@ import com.arsdigita.cms.dispatcher.ItemResolver;
|
||||||
import com.arsdigita.cms.dispatcher.Utilities;
|
import com.arsdigita.cms.dispatcher.Utilities;
|
||||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.cms.util.GlobalizationUtil;;
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
import com.arsdigita.util.LockableImpl;
|
import com.arsdigita.util.LockableImpl;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -61,15 +66,19 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
||||||
private final static Logger s_log = Logger.getLogger(
|
private final static Logger s_log = Logger.getLogger(
|
||||||
GenericOrganizationalUnitContactTable.class);
|
GenericOrganizationalUnitContactTable.class);
|
||||||
private final static String TABLE_COL_EDIT = "table_col_edit";
|
private final static String TABLE_COL_EDIT = "table_col_edit";
|
||||||
|
private final static String TABLE_COL_EDIT_ASSOC = "table_col_edit_assoc";
|
||||||
private final static String TABLE_COL_DEL = "table_col_del";
|
private final static String TABLE_COL_DEL = "table_col_del";
|
||||||
private final static String TABLE_COL_UP = "table_col_up";
|
private final static String TABLE_COL_UP = "table_col_up";
|
||||||
private final static String TABLE_COL_DOWN = "table_col_down";
|
private final static String TABLE_COL_DOWN = "table_col_down";
|
||||||
private ItemSelectionModel m_itemModel;
|
private ItemSelectionModel m_itemModel;
|
||||||
|
private GenericOrganizationalUnitContactPropertiesStep editStep;
|
||||||
|
|
||||||
public GenericOrganizationalUnitContactTable(
|
public GenericOrganizationalUnitContactTable(
|
||||||
final ItemSelectionModel itemModel) {
|
final ItemSelectionModel itemModel,
|
||||||
|
final GenericOrganizationalUnitContactPropertiesStep editStep) {
|
||||||
super();
|
super();
|
||||||
this.m_itemModel = itemModel;
|
this.m_itemModel = itemModel;
|
||||||
|
this.editStep = editStep;
|
||||||
|
|
||||||
setEmptyView(new Label(ContenttypesGlobalizationUtil.globalize(
|
setEmptyView(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.contacts.none")));
|
"cms.contenttypes.ui.genericorgaunit.contacts.none")));
|
||||||
|
|
@ -87,15 +96,20 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
||||||
tabModel.add(new TableColumn(
|
tabModel.add(new TableColumn(
|
||||||
2,
|
2,
|
||||||
ContenttypesGlobalizationUtil.globalize(
|
ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.genericorgaunit.contact.edit").localize(),
|
||||||
|
TABLE_COL_EDIT_ASSOC));
|
||||||
|
tabModel.add(new TableColumn(
|
||||||
|
3,
|
||||||
|
ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.contact.action").localize(),
|
"cms.contenttypes.ui.genericorgaunit.contact.action").localize(),
|
||||||
TABLE_COL_DEL));
|
TABLE_COL_DEL));
|
||||||
tabModel.add(new TableColumn(
|
tabModel.add(new TableColumn(
|
||||||
3,
|
4,
|
||||||
ContenttypesGlobalizationUtil.globalize(
|
ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.contact.up").localize(),
|
"cms.contenttypes.ui.genericorgaunit.contact.up").localize(),
|
||||||
TABLE_COL_UP));
|
TABLE_COL_UP));
|
||||||
tabModel.add(new TableColumn(
|
tabModel.add(new TableColumn(
|
||||||
4,
|
5,
|
||||||
ContenttypesGlobalizationUtil.globalize(
|
ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.contact.down").localize(),
|
"cms.contenttypes.ui.genericorgaunit.contact.down").localize(),
|
||||||
TABLE_COL_DOWN));
|
TABLE_COL_DOWN));
|
||||||
|
|
@ -104,9 +118,10 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
||||||
new GenericOrganizationalUnitTableModelBuilder(itemModel));
|
new GenericOrganizationalUnitTableModelBuilder(itemModel));
|
||||||
|
|
||||||
tabModel.get(1).setCellRenderer(new EditCellRenderer());
|
tabModel.get(1).setCellRenderer(new EditCellRenderer());
|
||||||
tabModel.get(2).setCellRenderer(new DeleteCellRenderer());
|
tabModel.get(2).setCellRenderer(new EditAssocCellRenderer());
|
||||||
tabModel.get(3).setCellRenderer(new UpCellRenderer());
|
tabModel.get(3).setCellRenderer(new DeleteCellRenderer());
|
||||||
tabModel.get(4).setCellRenderer(new DownCellRenderer());
|
tabModel.get(4).setCellRenderer(new UpCellRenderer());
|
||||||
|
tabModel.get(5).setCellRenderer(new DownCellRenderer());
|
||||||
|
|
||||||
addTableActionListener(this);
|
addTableActionListener(this);
|
||||||
}
|
}
|
||||||
|
|
@ -179,9 +194,10 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
||||||
getLanguage();
|
getLanguage();
|
||||||
if (m_contacttypes.size() <= 0) {
|
if (m_contacttypes.size() <= 0) {
|
||||||
s_log.warn(String.format("No matching relation "
|
s_log.warn(String.format("No matching relation "
|
||||||
+ "attributes for contact type '%s' found. "
|
+ "attributes for contact type '%s' found. "
|
||||||
+ "Using key as fallback.",
|
+ "Using key as fallback.",
|
||||||
m_contactCollection.getContactType()));
|
m_contactCollection.
|
||||||
|
getContactType()));
|
||||||
return m_contactCollection.getContactType();
|
return m_contactCollection.getContactType();
|
||||||
}
|
}
|
||||||
if (m_contacttypes.getRelationAttribute(m_contactCollection.
|
if (m_contacttypes.getRelationAttribute(m_contactCollection.
|
||||||
|
|
@ -189,9 +205,8 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
||||||
s_log.debug(String.format(
|
s_log.debug(String.format(
|
||||||
"No human readable name "
|
"No human readable name "
|
||||||
+ "found for '%s' for language '%s' Using key.",
|
+ "found for '%s' for language '%s' Using key.",
|
||||||
m_contactCollection.
|
m_contactCollection.getContactType(),
|
||||||
getContactType(),
|
lang));
|
||||||
lang));
|
|
||||||
return m_contactCollection.getContactType();
|
return m_contactCollection.getContactType();
|
||||||
} else {
|
} else {
|
||||||
s_log.debug(String.format(
|
s_log.debug(String.format(
|
||||||
|
|
@ -208,6 +223,9 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
||||||
case 1:
|
case 1:
|
||||||
return m_contact.getTitle();
|
return m_contact.getTitle();
|
||||||
case 2:
|
case 2:
|
||||||
|
return GlobalizationUtil.globalize("cms.ui.edit_assoc").
|
||||||
|
localize();
|
||||||
|
case 3:
|
||||||
return GlobalizationUtil.globalize("cms.ui.delete").localize();
|
return GlobalizationUtil.globalize("cms.ui.delete").localize();
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -262,6 +280,36 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class EditAssocCellRenderer
|
||||||
|
extends LockableImpl
|
||||||
|
implements TableCellRenderer {
|
||||||
|
|
||||||
|
public Component getComponent(
|
||||||
|
Table table,
|
||||||
|
PageState state,
|
||||||
|
Object value,
|
||||||
|
boolean isSelected,
|
||||||
|
Object key,
|
||||||
|
int row,
|
||||||
|
int col) {
|
||||||
|
SecurityManager securityManager =
|
||||||
|
Utilities.getSecurityManager(state);
|
||||||
|
GenericOrganizationalUnit orgaunit =
|
||||||
|
(GenericOrganizationalUnit) m_itemModel.
|
||||||
|
getSelectedObject(state);
|
||||||
|
|
||||||
|
boolean canEdit = securityManager.canAccess(state.getRequest(),
|
||||||
|
SecurityManager.EDIT_ITEM,
|
||||||
|
orgaunit);
|
||||||
|
if (canEdit) {
|
||||||
|
ControlLink link = new ControlLink(value.toString());
|
||||||
|
return link;
|
||||||
|
} else {
|
||||||
|
return new Label(value.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private class DeleteCellRenderer
|
private class DeleteCellRenderer
|
||||||
extends LockableImpl
|
extends LockableImpl
|
||||||
implements TableCellRenderer {
|
implements TableCellRenderer {
|
||||||
|
|
@ -368,6 +416,21 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
||||||
TableColumn column = getColumnModel().get(event.getColumn().intValue());
|
TableColumn column = getColumnModel().get(event.getColumn().intValue());
|
||||||
|
|
||||||
if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) {
|
if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) {
|
||||||
|
} else if (column.getHeaderKey().toString().equals(
|
||||||
|
TABLE_COL_EDIT_ASSOC)) {
|
||||||
|
while (contacts.next()) {
|
||||||
|
if (contacts.getContact().equals(contact)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
editStep.setSelectedContact(contact);
|
||||||
|
editStep.setSelectedContactType(contacts.getContactType());
|
||||||
|
|
||||||
|
contacts.close();
|
||||||
|
|
||||||
|
editStep.showComponent(state,
|
||||||
|
GenericOrganizationalUnitContactPropertiesStep.ADD_CONTACT_SHEET_NAME);
|
||||||
} else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) {
|
} else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) {
|
||||||
orgaunit.removeContact(contact);
|
orgaunit.removeContact(contact);
|
||||||
} else if (column.getHeaderKey().toString().equals(TABLE_COL_UP)) {
|
} else if (column.getHeaderKey().toString().equals(TABLE_COL_UP)) {
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ public class SeriesEditshipAddForm extends BasicItemForm {
|
||||||
if (!(this.getSaveCancelSection().
|
if (!(this.getSaveCancelSection().
|
||||||
getCancelButton().isSelected(state))) {
|
getCancelButton().isSelected(state))) {
|
||||||
GenericPerson editor;
|
GenericPerson editor;
|
||||||
editor = ((SeriesEditshipStep) editStep).getSelectedEditor();
|
editor = editStep.getSelectedEditor();
|
||||||
|
|
||||||
if (editor == null) {
|
if (editor == null) {
|
||||||
series.addEditor((GenericPerson) data.get(ITEM_SEARCH),
|
series.addEditor((GenericPerson) data.get(ITEM_SEARCH),
|
||||||
|
|
@ -154,6 +154,7 @@ public class SeriesEditshipAddForm extends BasicItemForm {
|
||||||
editStep.setSelectedEditor(null);
|
editStep.setSelectedEditor(null);
|
||||||
editStep.setSelectedEditorDateFrom(null);
|
editStep.setSelectedEditorDateFrom(null);
|
||||||
editStep.setSelectedEditorDateTo(null);
|
editStep.setSelectedEditorDateTo(null);
|
||||||
|
editors.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -377,6 +377,8 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
|
||||||
((SeriesEditshipStep)editStep).setSelectedEditorDateFrom(editors.getFrom());
|
((SeriesEditshipStep)editStep).setSelectedEditorDateFrom(editors.getFrom());
|
||||||
((SeriesEditshipStep)editStep).setSelectedEditorDateTo(editors.getTo());
|
((SeriesEditshipStep)editStep).setSelectedEditorDateTo(editors.getTo());
|
||||||
|
|
||||||
|
editors.close();
|
||||||
|
|
||||||
editStep.showComponent(state, SeriesEditshipStep.ADD_EDITOR_SHEET_NAME);
|
editStep.showComponent(state, SeriesEditshipStep.ADD_EDITOR_SHEET_NAME);
|
||||||
} else if (TABLE_COL_DEL.equals(column.getHeaderKey().toString())) {
|
} else if (TABLE_COL_DEL.equals(column.getHeaderKey().toString())) {
|
||||||
series.removeEditor(editor);
|
series.removeEditor(editor);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue