This commit is contained in:
Paula Quispe
2017-03-22 11:20:48 -04:00
parent 3ebf5eea42
commit 2933f58bf0
4 changed files with 34 additions and 8 deletions

View File

@@ -179,17 +179,23 @@ try {
case 'canDeleteUser':
G::LoadClass('case');
$oProcessMap = new Cases();
$USR_UID = $_POST['uUID'];
$userUid = $_POST['uUID'];
$total = 0;
$history = 0;
$c = $oProcessMap->getCriteriaUsersCases('TO_DO', $USR_UID);
$c = $oProcessMap->getCriteriaUsersCases('TO_DO', $userUid);
$total += ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases('DRAFT', $USR_UID);
$c = $oProcessMap->getCriteriaUsersCases('DRAFT', $userUid);
$total += ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases('COMPLETED', $USR_UID);
$c = $oProcessMap->getCriteriaUsersCases('COMPLETED', $userUid);
$history += ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $USR_UID);
$c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $userUid);
$history += ApplicationPeer::doCount($c);
//Check if the user is configured in Web Entry
if ($total === 0) {
$webEntry = new \ProcessMaker\BusinessModel\WebEntryEvent();
$total = $webEntry->getWebEntryRelatedToUser($userUid);
}
$response = '{success: true, candelete: ';
$response .= ($total > 0) ? 'false' : 'true';
$response .= ', hashistory: ';