Skip to content

Commit

Permalink
assign approver fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Jul 22, 2017
1 parent 8be84b9 commit 12b1060
Showing 1 changed file with 9 additions and 8 deletions.
Expand Up @@ -55,6 +55,7 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType;
import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.OnChangeAjaxBehavior;
import org.apache.wicket.ajax.markup.html.AjaxLink;
Expand Down Expand Up @@ -164,15 +165,15 @@ private MainObjectListPanel<FocusType> getMemberTable() {
protected AssignmentType createMemberAssignmentToModify(QName relation) throws SchemaException {
AssignmentType assignmentToModify = createAssignmentToModify(relation);

DropDownChoice<OrgType> tenantChoice = (DropDownChoice<OrgType>) get(ID_TENANT);
OrgType tenant = tenantChoice.getModelObject();
if (tenant != null) {
assignmentToModify.setTenantRef(ObjectTypeUtil.createObjectRef(tenant.getOid(), ObjectTypes.ORG));
ChooseTypePanel<OrgType> tenantChoice = (ChooseTypePanel) get(createComponentPath(ID_TENANT));
ObjectViewDto<OrgType> tenant = tenantChoice.getModelObject();
if (tenant != null && tenant.getObjectType() != null) {
assignmentToModify.setTenantRef(ObjectTypeUtil.createObjectRef(tenant.getObjectType().getOid(), ObjectTypes.ORG));
}
DropDownChoice<OrgType> projectChoice = (DropDownChoice<OrgType>) get(ID_PROJECT);
OrgType project = projectChoice.getModelObject();
if (project != null) {
assignmentToModify.setOrgRef(ObjectTypeUtil.createObjectRef(project.getOid(), ObjectTypes.ORG));
ChooseTypePanel<OrgType> projectChoice = (ChooseTypePanel) get(createComponentPath(ID_PROJECT));
ObjectViewDto<OrgType> project = projectChoice.getModelObject();
if (project != null && project.getObjectType() != null) {
assignmentToModify.setOrgRef(ObjectTypeUtil.createObjectRef(project.getObjectType().getOid(), ObjectTypes.ORG));
}

return assignmentToModify;
Expand Down

0 comments on commit 12b1060

Please sign in to comment.