Merge branch 'main' into logAndException
commit
5ff10c4f8d
|
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.checkerframework.common.util.report.qual.ReportCall;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
|
|
|
|||
|
|
@ -116,14 +116,22 @@ public class Change {
|
|||
.filter(peopleFullName::equals)
|
||||
.isPresent());
|
||||
|
||||
var state = getValue(entry, "State").getIntValue();
|
||||
var inApproval = inApprovalList(api.getUser(), getValueStringByID(entry, "ChangeNr"));
|
||||
// var state = getValue(entry, "State").getIntValue();
|
||||
// var inApproval = inApprovalList(api.getUser(), getValueStringByID(entry,
|
||||
// "ChangeNr"));
|
||||
|
||||
change.setFlagPermit(flagPermit(state));
|
||||
change.setFlagApprove(flagApproval(inApproval, state));
|
||||
change.setFlagReject(flagApproval(inApproval, state));
|
||||
change.setFlagCancel(flagCancel(getValueStringByID(entry, "SupportGroupId"), state));
|
||||
// change.setFlagPermit(flagPermit(state));
|
||||
// change.setFlagApprove(flagApproval(inApproval, state));
|
||||
// change.setFlagReject(flagApproval(inApproval, state));
|
||||
// change.setFlagCancel(flagCancel(getValueStringByID(entry, "SupportGroupId"),
|
||||
// state));
|
||||
|
||||
try {
|
||||
change.setPackageName(
|
||||
queryPackageName(getValueStringByID(entry, "PackageType").toString()));
|
||||
} catch (ARException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
changes.add(change);
|
||||
}
|
||||
|
||||
|
|
@ -157,74 +165,92 @@ public class Change {
|
|||
return peopleInfos.get(0).get(queryPerson.getFieldId("FullName")).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the change item can be approved based on the approval status
|
||||
* and the current state.
|
||||
*
|
||||
* @param approval The flag indicating whether the change item has been
|
||||
* approved.
|
||||
* @param state The current state of the change item.
|
||||
* @return {@code true} if the change item can be approved, {@code false}
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean flagApproval(boolean approval, int state) {
|
||||
boolean approvableState = (state == 1 || state == 10);
|
||||
return approval && approvableState;
|
||||
}
|
||||
// /**
|
||||
// * Determines if the change item can be approved based on the approval status
|
||||
// * and the current state.
|
||||
// *
|
||||
// * @param approval The flag indicating whether the change item has been
|
||||
// * approved.
|
||||
// * @param state The current state of the change item.
|
||||
// * @return {@code true} if the change item can be approved, {@code false}
|
||||
// * otherwise.
|
||||
// */
|
||||
// public boolean flagApproval(boolean approval, int state) {
|
||||
// boolean approvableState = (state == 1 || state == 10);
|
||||
// return approval && approvableState;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Determines if the change item can be canceled based on the support group ID
|
||||
* and the current state.
|
||||
*
|
||||
* @param supportGroupId The ID of the support group associated with the change
|
||||
* item
|
||||
* @param state The current state of the change item
|
||||
* @return {@code true} if the change item can be canceled, {@code false}
|
||||
* otherwise.
|
||||
* @throws ARException if an error occurs during the operation
|
||||
*/
|
||||
public boolean flagCancel(String supportGroupId, int state) throws ARException {
|
||||
var queryRoles = new Query.QueryBuilder("CTM:SupportGroupFuncRoleLookUp").addFieldId("Role", 1000000014)
|
||||
.build();
|
||||
var role = api.queryFieldsById("\'Support Group ID\' = \"" + supportGroupId + "\"",
|
||||
queryRoles.getFieldIds(), queryRoles.getFormName(), null, 0, 0)
|
||||
.get(0).get(queryRoles.getFieldId("Role")).toString();
|
||||
// /**
|
||||
// * Determines if the change item can be canceled based on the support group ID
|
||||
// * and the current state.
|
||||
// *
|
||||
// * @param supportGroupId The ID of the support group associated with the
|
||||
// change item
|
||||
// * @param state The current state of the change item
|
||||
// * @return {@code true} if the change item can be canceled, {@code false}
|
||||
// otherwise.
|
||||
// * @throws ARException if an error occurs during the operation
|
||||
// */
|
||||
// public boolean flagCancel(String supportGroupId, int state) throws
|
||||
// ARException {
|
||||
// var queryRoles = new
|
||||
// Query.QueryBuilder("CTM:SupportGroupFuncRoleLookUp").addFieldId("Role",
|
||||
// 1000000014)
|
||||
// .build();
|
||||
// var role = api.queryFieldsById("\'Support Group ID\' = \"" + supportGroupId +
|
||||
// "\"",
|
||||
// queryRoles.getFieldIds(), queryRoles.getFormName(), null, 0, 0)
|
||||
// .get(0).get(queryRoles.getFieldId("Role")).toString();
|
||||
|
||||
boolean approvableState = state == 1;
|
||||
boolean isChangeManager = role.equals("Change Manager");
|
||||
// boolean approvableState = state == 1;
|
||||
// boolean isChangeManager = role.equals("Change Manager");
|
||||
|
||||
return approvableState && isChangeManager;
|
||||
}
|
||||
// return approvableState && isChangeManager;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Determines if the change item has a permit based on the current state.
|
||||
*
|
||||
* @param state The current state of the change item.
|
||||
* @return {@code true} if the change item has a permit, {@code false}
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean flagPermit(int state) {
|
||||
return state == 0;
|
||||
}
|
||||
// /**
|
||||
// * Determines if the change item has a permit based on the current state.
|
||||
// *
|
||||
// * @param state The current state of the change item.
|
||||
// * @return {@code true} if the change item has a permit, {@code false}
|
||||
// otherwise.
|
||||
// */
|
||||
// public boolean flagPermit(int state) {
|
||||
// return state == 0;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Checks if the logged in user is in the approval list for the specified change
|
||||
* item.
|
||||
*
|
||||
* @param user The username of the user to check
|
||||
* @param changeNr The change number of the change item
|
||||
* @return {@code true} if the user is in the approval list, {@code false}
|
||||
* otherwise.
|
||||
* @throws ARException if an error occurs during the operation
|
||||
*/
|
||||
public boolean inApprovalList(String user, String changeNr) throws ARException {
|
||||
var queryApprovalList = new Query.QueryBuilder("ASF:OverviewConsole_TicketsJoinAPDetailSignature")
|
||||
.addFieldId("Approvers", 13207).build();
|
||||
var approversOI = api.queryFieldsById("\'Ticketnumber\' = \"" + changeNr + "\"",
|
||||
queryApprovalList.getFieldIds(), queryApprovalList.getFormName(), null, 0, 0);
|
||||
var approvers = approversOI.isEmpty() ? null
|
||||
: approversOI.get(0).get(queryApprovalList.getFieldId("Approvers")).toString();
|
||||
return approvers != null ? approvers.contains(user) : false;
|
||||
// /**
|
||||
// * Checks if the logged in user is in the approval list for the specified
|
||||
// change item.
|
||||
// *
|
||||
// * @param user The username of the user to check
|
||||
// * @param changeNr The change number of the change item
|
||||
// * @return {@code true} if the user is in the approval list, {@code false}
|
||||
// otherwise.
|
||||
// * @throws ARException if an error occurs during the operation
|
||||
// */
|
||||
// public boolean inApprovalList(String user, String changeNr) throws
|
||||
// ARException {
|
||||
// var queryApprovalList = new
|
||||
// Query.QueryBuilder("ASF:OverviewConsole_TicketsJoinAPDetailSignature")
|
||||
// .addFieldId("Approvers", 13207).build();
|
||||
// var approversOI = api.queryFieldsById("\'Ticketnumber\' = \"" + changeNr +
|
||||
// "\"",
|
||||
// queryApprovalList.getFieldIds(), queryApprovalList.getFormName(), null, 0,
|
||||
// 0);
|
||||
// var approvers = approversOI.isEmpty() ? null
|
||||
// :
|
||||
// approversOI.get(0).get(queryApprovalList.getFieldId("Approvers")).toString();
|
||||
// return approvers != null ? approvers.contains(user) : false;
|
||||
// }
|
||||
private String queryPackageName(String packageType) throws ARException {
|
||||
var queryPackage = new Query.QueryBuilder("CTR:GenericContractJoinCFG_Package")
|
||||
.addFieldId("PackageName", 200000020).build();
|
||||
var packageName = api
|
||||
.queryFieldsById("\'InstanceId_Package\' = \"" + packageType + "\"",
|
||||
queryPackage.getFieldIds(), queryPackage.getFormName(), null, 0, 0)
|
||||
.get(0);
|
||||
return packageName.get(queryPackage.getFieldId("PackageName")).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -27,14 +27,15 @@ public class ChangeItem {
|
|||
private String changeImplementerPersonId;
|
||||
private boolean implementerEdit;
|
||||
private String packageType;
|
||||
private String packageName;
|
||||
private Date D1;
|
||||
private Date D2;
|
||||
private Date D3;
|
||||
private Date D4;
|
||||
private boolean flagPermit;
|
||||
private boolean flagApprove;
|
||||
private boolean flagReject;
|
||||
private boolean flagCancel;
|
||||
// private boolean flagPermit;
|
||||
// private boolean flagApprove;
|
||||
// private boolean flagReject;
|
||||
// private boolean flagCancel;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -160,84 +161,92 @@ public class ChangeItem {
|
|||
this.changeImplementerPersonId = changeImplementerPersonId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the flag indicating whether the change item has a permit.
|
||||
*
|
||||
* @return {@code true} if the change item has a permit, {@code false}
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean getFlagPermit() {
|
||||
return this.flagPermit;
|
||||
// /**
|
||||
// * Retrieves the flag indicating whether the change item has a permit.
|
||||
// *
|
||||
// * @return {@code true} if the change item has a permit, {@code false}
|
||||
// * otherwise.
|
||||
// */
|
||||
// public boolean getFlagPermit() {
|
||||
// return this.flagPermit;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Sets the flag indicating whether the change item has a permit.
|
||||
// *
|
||||
// * @param flagPermit {@code true} if the change item has a permit, {@code false}
|
||||
// * otherwise.
|
||||
// */
|
||||
// public void setFlagPermit(boolean flagPermit) {
|
||||
// this.flagPermit = flagPermit;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Retrieves the flag indicating whether the change item has been approved.
|
||||
// *
|
||||
// * @return {@code true} if the change item has been approved, {@code false}
|
||||
// * otherwise.
|
||||
// */
|
||||
// public boolean getFlagApprove() {
|
||||
// return this.flagApprove;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Sets the flag indicating whether the change item has been approved.
|
||||
// *
|
||||
// * @param flagApprove {@code true} if the change item has been approved,
|
||||
// * {@code false} otherwise.
|
||||
// */
|
||||
// public void setFlagApprove(boolean flagApprove) {
|
||||
// this.flagApprove = flagApprove;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Retrieves the flag indicating whether the change item has been rejected.
|
||||
// *
|
||||
// * @return {@code true} if the change item has been rejected, {@code false}
|
||||
// * otherwise.
|
||||
// */
|
||||
// public boolean getFlagReject() {
|
||||
// return this.flagReject;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Sets the flag indicating whether the change item has been rejected.
|
||||
// *
|
||||
// * @param flagReject {@code true} if the change item has been rejected,
|
||||
// * {@code false} otherwise.
|
||||
// */
|
||||
// public void setFlagReject(boolean flagReject) {
|
||||
// this.flagReject = flagReject;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Retrieves the flag indicating whether the change item has been canceled.
|
||||
// *
|
||||
// * @return {@code true} if the change item has been canceled, {@code false}
|
||||
// * otherwise.
|
||||
// */
|
||||
// public boolean getFlagCancel() {
|
||||
// return this.flagCancel;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Sets the flag indicating whether the change item has been canceled.
|
||||
// *
|
||||
// * @param flagCancel {@code true} if the change item has been canceled,
|
||||
// * {@code false} otherwise.
|
||||
// */
|
||||
// public void setFlagCancel(boolean flagCancel) {
|
||||
// this.flagCancel = flagCancel;
|
||||
// }
|
||||
|
||||
public String getPackageName() {
|
||||
return this.packageName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the flag indicating whether the change item has a permit.
|
||||
*
|
||||
* @param flagPermit {@code true} if the change item has a permit, {@code false}
|
||||
* otherwise.
|
||||
*/
|
||||
public void setFlagPermit(boolean flagPermit) {
|
||||
this.flagPermit = flagPermit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the flag indicating whether the change item has been approved.
|
||||
*
|
||||
* @return {@code true} if the change item has been approved, {@code false}
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean getFlagApprove() {
|
||||
return this.flagApprove;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the flag indicating whether the change item has been approved.
|
||||
*
|
||||
* @param flagApprove {@code true} if the change item has been approved,
|
||||
* {@code false} otherwise.
|
||||
*/
|
||||
public void setFlagApprove(boolean flagApprove) {
|
||||
this.flagApprove = flagApprove;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the flag indicating whether the change item has been rejected.
|
||||
*
|
||||
* @return {@code true} if the change item has been rejected, {@code false}
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean getFlagReject() {
|
||||
return this.flagReject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the flag indicating whether the change item has been rejected.
|
||||
*
|
||||
* @param flagReject {@code true} if the change item has been rejected,
|
||||
* {@code false} otherwise.
|
||||
*/
|
||||
public void setFlagReject(boolean flagReject) {
|
||||
this.flagReject = flagReject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the flag indicating whether the change item has been canceled.
|
||||
*
|
||||
* @return {@code true} if the change item has been canceled, {@code false}
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean getFlagCancel() {
|
||||
return this.flagCancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the flag indicating whether the change item has been canceled.
|
||||
*
|
||||
* @param flagCancel {@code true} if the change item has been canceled,
|
||||
* {@code false} otherwise.
|
||||
*/
|
||||
public void setFlagCancel(boolean flagCancel) {
|
||||
this.flagCancel = flagCancel;
|
||||
public void setPackageName(String packageName) {
|
||||
this.packageName = packageName;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -71,19 +71,22 @@ public class SupportGroup {
|
|||
* @throws ARException if an error occurs during the query
|
||||
*/
|
||||
public void queryUserSupportGroup(RemedyJavaAPI api) throws ARException {
|
||||
var querySupportGroups = new Query.QueryBuilder("CTM:Support Group Association")
|
||||
.addFieldId("SupportGroup", 1000000017)
|
||||
.addFieldId("SupportGroupId", 1000000079)
|
||||
.build();
|
||||
|
||||
api.impersonateUser("ext_StanzPa");
|
||||
var supportGroupUser = api.queryFieldsById("\'Login ID\' = \"" + api.getUser() + "\"",
|
||||
querySupportGroups.getFieldIds(), querySupportGroups.getFormName(), null, 0, 0);
|
||||
|
||||
var result = supportGroupUser.isEmpty() ? null : supportGroupUser.get(0);
|
||||
if (result != null) {
|
||||
String supportGroupName = result.get(querySupportGroups.getFieldId("SupportGroup")).toString();
|
||||
String supportGroupId = result.get(querySupportGroups.getFieldId("SupportGroupId")).toString();
|
||||
var querySupportGroups = new Query.QueryBuilder("CTM:Support Group Association")
|
||||
.addFieldId("SupportGroupId", 1000000079).build();
|
||||
var supportGroupIdOfUser = api.queryFieldsById("\'Login ID\' = \"" + api.getUser() + "\"",
|
||||
querySupportGroups.getFieldIds(), querySupportGroups.getFormName(), null, 0, 0);
|
||||
var id = supportGroupIdOfUser.isEmpty() ? null : supportGroupIdOfUser.get(0);
|
||||
|
||||
if (id != null) {
|
||||
var supportGroupId = id.get(querySupportGroups.getFieldId("SupportGroupId")).toString();
|
||||
var querySupportGroupName = new Query.QueryBuilder(formName).addFieldId("SupportGroupName", 1000000015)
|
||||
.build();
|
||||
var supportGroupNameOfUser = api.queryFieldsById("\'Support Group ID\' = \"" + supportGroupId + "\"",
|
||||
querySupportGroupName.getFieldIds(), querySupportGroupName.getFormName(), null, 0, 0);
|
||||
var supportGroupName = supportGroupNameOfUser.get(0)
|
||||
.get(querySupportGroupName.getFieldId("SupportGroupName")).toString();
|
||||
this.userSupportGroup = new SupportGroupGetResponse(supportGroupName, supportGroupId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -275,12 +275,29 @@ export class DataService {
|
|||
);
|
||||
}
|
||||
|
||||
res.push({resourceId: resp.resourceId, approvalStatus: this.validateApproval(resp.approvalStatus), statusReason: resp.statusReason,
|
||||
changeNr: resp.changeNr, resourceName: resp.resourceName,
|
||||
vertrag: resp.contract, vertragName: this.getContractName(resp.contract), isExpand: false,
|
||||
isRes: true, state: resp.state, stateName: this.getStateNameById(resp.state),
|
||||
supportGroup: resp.supportGroup, tasks: tasks, supportGroupId: resp.supportGroupId,
|
||||
implementerEdit: resp.implementerEdit, flagApprove: resp.flagApprove, flagCancel: resp.flagChancel, flagPermit: resp.flagPermit, flagReject: resp.flagReject
|
||||
res.push({
|
||||
resourceId: resp.resourceId,
|
||||
approvalStatus: this.validateApproval(resp.approvalStatus),
|
||||
statusReason: resp.statusReason,
|
||||
changeNr: resp.changeNr,
|
||||
resourceName: resp.resourceName,
|
||||
vertrag: resp.contract,
|
||||
vertragName: this.getContractName(resp.contract),
|
||||
isExpand: false,
|
||||
isRes: true,
|
||||
state: resp.state,
|
||||
stateName: this.getStateNameById(resp.state),
|
||||
supportGroup: resp.supportGroup,
|
||||
tasks: tasks,
|
||||
supportGroupId: resp.supportGroupId,
|
||||
implementerEdit: resp.implementerEdit,
|
||||
flagApprove: resp.flagApprove,
|
||||
flagCancel: resp.flagChancel,
|
||||
flagPermit: resp.flagPermit,
|
||||
flagReject: resp.flagReject,
|
||||
changeImplementerLogin: resp.changeImplementerLogin,
|
||||
packageName: resp.packageName,
|
||||
coordinatorSg: resp.coordinatorSg
|
||||
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -115,16 +115,19 @@
|
|||
<td style="padding:3px">{{lMap.get('tooltipState')}}: {{dataService.getStateNameById(data.taskData.resources[0].state)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:3px">{{lMap.get('tooltipPaketType')}}: {{data.taskData.resources[0].paketType}}</td>
|
||||
<td style="padding:3px">{{lMap.get('tooltipPaketType')}}: {{data.taskData.resources[0].packageName}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:3px">{{lMap.get('tooltipContract')}}: {{data.taskData.resources[0].vertragName}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:3px"> {{lMap.get('tooltipSupportGroup')}}: {{data.taskData.resources[0].supportGroup}}</td>
|
||||
<td style="padding:3px">{{lMap.get('tooltipSupportGroupKv')}}: {{data.taskData.resources[0].supportGroup}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:3px"> {{lMap.get('tooltipDate')}}: {{data.taskData.resources[0].tasks[1].StartDate | date:'dd.MM.yyyy'}}</td>
|
||||
<td style="padding:3px">{{lMap.get('tooltipSupportGroupIh')}}: {{data.taskData.resources[0].coordinatorSg}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:3px">{{lMap.get('tooltipDate')}}: {{data.taskData.resources[0].tasks[1].StartDate | date:'dd.MM.yyyy'}}</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td style="padding:3px"> Date: {{data.TaskID}}</td>
|
||||
|
|
|
|||
|
|
@ -162,11 +162,15 @@ export class NttGanttComponent implements OnInit {
|
|||
this.enMap.set('tooltipPaketType', 'Package Type');
|
||||
this.deMap.set('tooltipContract', 'Vertrag / Provider Cluster');
|
||||
this.enMap.set('tooltipContract', 'Contract / Provider Cluster');
|
||||
this.deMap.set('tooltipSupportGroup', 'Support Gruppe (IH/KV)');
|
||||
this.enMap.set('tooltipSupportGroup', 'Support Group (IH/KV)');
|
||||
this.deMap.set('tooltipSupportGroupKv', 'KV SG');
|
||||
this.enMap.set('tooltipSupportGroupKv', 'KV SG');
|
||||
this.deMap.set('tooltipSupportGroupIh', 'IH SG');
|
||||
this.enMap.set('tooltipSupportGroupIh', 'IH SG');
|
||||
this.deMap.set('tooltipDate', 'Geplantes Start Datum');
|
||||
this.enMap.set('tooltipDate', 'Planned Start Date');
|
||||
|
||||
this.deMap.set('permit', 'Zur Genehmigung');
|
||||
this.enMap.set('permit', 'Permit');
|
||||
this.deMap.set('genehmigen', 'Genehmigen');
|
||||
this.enMap.set('genehmigen', 'Approve');
|
||||
this.deMap.set('ablehnen', 'Ablehnen');
|
||||
|
|
@ -222,14 +226,11 @@ export class NttGanttComponent implements OnInit {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public logg(args){
|
||||
console.log(args);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The function ngOnInit sets values which are required for rendering the gantt Chart. Furthermore it trims the resources (Changes Array) and sets the paginator to the first page.
|
||||
*/
|
||||
|
|
@ -609,6 +610,11 @@ public logg(args){
|
|||
this.selRecs = this.selectedrecords;
|
||||
}
|
||||
let allStates: boolean = true;
|
||||
let allPermit: boolean = true;
|
||||
let allApprove: boolean = true;
|
||||
let allReject: boolean = true;
|
||||
let allCancel: boolean = true;
|
||||
let allImplementer: boolean = true;
|
||||
this.selectedRescourceIds = [];
|
||||
for (const change of this.selRecs) {
|
||||
if(change.taskData.approvalStatus == 1){
|
||||
|
|
@ -622,23 +628,54 @@ public logg(args){
|
|||
}else{
|
||||
allStates = false;
|
||||
}
|
||||
|
||||
if(change.taskData.flagPermit == true && allPermit == true){
|
||||
allPermit = true;
|
||||
}else{
|
||||
allPermit = false;
|
||||
}
|
||||
if(change.taskData.flagApproval == true && allApprove == true){
|
||||
allApprove = true;
|
||||
}else{
|
||||
allApprove = false;
|
||||
}
|
||||
if(change.taskData.flagReject == true && allCancel == true){
|
||||
allReject = true;
|
||||
}else{
|
||||
allReject = false;
|
||||
}
|
||||
if(change.taskData.flagCancel == true && allCancel == true){
|
||||
allCancel = true;
|
||||
}else{
|
||||
allCancel = false;
|
||||
}
|
||||
if(change.taskData.implementerEdit == true && allImplementer == true){
|
||||
allImplementer = true;
|
||||
}else{
|
||||
allImplementer = false;
|
||||
}
|
||||
}
|
||||
if(allStates){
|
||||
if(this.approvalPending == true){
|
||||
this.toolbar = ['Cancel',{text: this.lMap.get("genehmigen"), id: "7"},{text:this.lMap.get("ablehnen"), id: "8"}];
|
||||
this.toolbar = [];
|
||||
this.toolbar.push({text:this.lMap.get("stateChange"), id: "6"});
|
||||
if(allPermit){
|
||||
this.toolbar.push({text: this.lMap.get("permit"), id: "5"});
|
||||
}
|
||||
else{
|
||||
if(this.selRecs[0].taskData.state > 0 &&this.selRecs[0].taskData.state < 4){
|
||||
this.toolbar = ['Cancel',{text: this.lMap.get("stateChange"), id: "6"} ,{text: this.lMap.get("implementer"), id: "10"}];
|
||||
if(allApprove){
|
||||
this.toolbar.push({text: this.lMap.get("genehmigen"), id: "7"});
|
||||
}
|
||||
if(allReject){
|
||||
this.toolbar.push({text: this.lMap.get("ablehnen"), id: "8"});
|
||||
}
|
||||
if(allCancel){
|
||||
this.toolbar.push({text: this.lMap.get("stornieren"), id: "11"});
|
||||
}
|
||||
if(allImplementer){
|
||||
this.toolbar.push({text: this.lMap.get("implementer"), id: "10"});
|
||||
}
|
||||
|
||||
}else{
|
||||
this.toolbar = ['Cancel',{text: this.lMap.get("stateChange"), id: "6"}];
|
||||
if(this.selRecs[0].taskData.state == 0){
|
||||
this.toolbar = [{text: this.lMap.get("stornieren"), id: "11"},{text:this.lMap.get("stateChange"), id: "6"} ,{text: this.lMap.get("implementer"), id: "10"}];
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
this.toolbar = ['Cancel'];
|
||||
this.toolbar = [];
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -672,6 +709,11 @@ public logg(args){
|
|||
this.selRecs = this.selectedrecords;
|
||||
}
|
||||
let allStates: boolean = true;
|
||||
let allPermit: boolean = true;
|
||||
let allApprove: boolean = true;
|
||||
let allReject: boolean = true;
|
||||
let allCancel: boolean = true;
|
||||
let allImplementer: boolean = true;
|
||||
this.selectedRescourceIds = [];
|
||||
for (const change of this.selRecs) {
|
||||
if(change.taskData.state == this.selRecs[0].taskData.state){
|
||||
|
|
@ -685,23 +727,56 @@ public logg(args){
|
|||
}else{
|
||||
allStates = false;
|
||||
}
|
||||
|
||||
|
||||
if(change.taskData.flagPermit == true && allPermit == true){
|
||||
allPermit = true;
|
||||
}else{
|
||||
allPermit = false;
|
||||
}
|
||||
if(change.taskData.flagApproval == true && allApprove == true){
|
||||
allApprove = true;
|
||||
}else{
|
||||
allApprove = false;
|
||||
}
|
||||
if(change.taskData.flagReject == true && allReject == true){
|
||||
allReject = true;
|
||||
}else{
|
||||
allReject = false;
|
||||
}
|
||||
if(change.taskData.flagCancel == true && allCancel == true){
|
||||
allCancel = true;
|
||||
}else{
|
||||
allCancel = false;
|
||||
}
|
||||
if(change.taskData.implementerEdit == true && allImplementer == true){
|
||||
allImplementer = true;
|
||||
}else{
|
||||
allImplementer = false;
|
||||
}
|
||||
|
||||
}
|
||||
if(allStates){
|
||||
if(this.approvalPending == true){
|
||||
this.toolbar = ['Cancel',{text: this.lMap.get("genehmigen"), id: "7"},{text: this.lMap.get("ablehnen"), id: "8"}];
|
||||
this.toolbar = [];
|
||||
this.toolbar.push({text:this.lMap.get("stateChange"), id: "6"});
|
||||
if(allPermit){
|
||||
this.toolbar.push({text: this.lMap.get("permit"), id: "5"});
|
||||
}
|
||||
else{
|
||||
if(this.selRecs[0].taskData.state > 0 &&this.selRecs[0].taskData.state < 4){
|
||||
this.toolbar = ['Cancel',{text: this.lMap.get("stateChange"), id: "6"} ,{text: this.lMap.get("implementer"), id: "10"}];
|
||||
if(allApprove){
|
||||
this.toolbar.push({text: this.lMap.get("genehmigen"), id: "7"});
|
||||
}
|
||||
if(allReject){
|
||||
this.toolbar.push({text: this.lMap.get("ablehnen"), id: "8"});
|
||||
}
|
||||
if(allCancel){
|
||||
this.toolbar.push({text: this.lMap.get("stornieren"), id: "11"});
|
||||
}
|
||||
if(allImplementer){
|
||||
this.toolbar.push({text: this.lMap.get("implementer"), id: "10"});
|
||||
}
|
||||
|
||||
}else{
|
||||
this.toolbar = ['Cancel',{text: this.lMap.get("stateChange"), id: "6"}];
|
||||
if(this.selRecs[0].taskData.state == 0){
|
||||
this.toolbar = [{text: this.lMap.get("stornieren"), id: "11"},{text: this.lMap.get("stateChange"), id: "6"} ,{text: this.lMap.get("implementer"), id: "10"}];
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
this.toolbar = ['Cancel'];
|
||||
this.toolbar = [];
|
||||
}
|
||||
this.selRecs = [];
|
||||
this.selectedrecords = [];
|
||||
|
|
|
|||
Loading…
Reference in New Issue