Merged in bugfix/HOR-2858 (pull request #5555)

HOR-2858

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Paula Quispe
2017-05-03 20:25:24 +00:00
committed by Julio Cesar Laura Avendaño
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: ';