Beispiel #1
0
        case -1:
            G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
            G::header('location: ../login/login');
            die;
            break;
        case -2:
            G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
            G::header('location: ../login/login');
            die;
            break;
        default:
            G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
            G::header('location: ../login/login');
            die;
            break;
    }
}
if (($RBAC_Response = $RBAC->userCanAccess("PM_USERS")) != 1) {
    return $RBAC_Response;
}
G::LoadClass('groups');
$group = new Groupwf();
if (!isset($_POST['GRP_UID'])) {
    return;
}
$group->remove(urldecode($_POST['GRP_UID']));
require_once 'classes/model/TaskUser.php';
$oProcess = new TaskUser();
$oCriteria = new Criteria('workflow');
$oCriteria->add(TaskUserPeer::USR_UID, $_POST['GRP_UID']);
TaskUserPeer::doDelete($oCriteria);
Beispiel #2
0
    /**

     * Get Task User Rows from an array of data

     *

     * @param array $aTaskUser

     * @return array $aStepTrigger

     */

    public function createGroupRow ($aGroupwf)

    {

        foreach ($aGroupwf as $key => $row) {

            $oGroupwf = new Groupwf();

            if ($oGroupwf->GroupwfExists( $row['GRP_UID'] )) {

                $oGroupwf->remove( $row['GRP_UID'] );

            }

            $res = $oGroupwf->create( $row );

        }

    }
Beispiel #3
0
 /**
  * Delete Group
  *
  * @param string $groupUid Unique id of Group
  *
  * return void
  */
 public function delete($groupUid)
 {
     try {
         //Verify data
         $this->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
         $arrayTotalTasksByGroup = $this->getTotalTasksByGroup($groupUid);
         if (isset($arrayTotalTasksByGroup[$groupUid]) && $arrayTotalTasksByGroup[$groupUid] > 0) {
             throw new \Exception(\G::LoadTranslation("ID_GROUP_CANNOT_DELETE_WHILE_ASSIGNED_TO_TASK"));
         }
         //Delete
         $group = new \Groupwf();
         $result = $group->remove($groupUid);
         //Delete assignments of tasks
         $criteria = new \Criteria("workflow");
         $criteria->add(\TaskUserPeer::USR_UID, $groupUid);
         \TaskUserPeer::doDelete($criteria);
         //Delete permissions
         $criteria = new \Criteria("workflow");
         $criteria->add(\ObjectPermissionPeer::USR_UID, $groupUid);
         \ObjectPermissionPeer::doDelete($criteria);
         //Delete assignments of supervisors
         $criteria = new \Criteria("workflow");
         $criteria->add(\ProcessUserPeer::USR_UID, $groupUid);
         $criteria->add(\ProcessUserPeer::PU_TYPE, "GROUP_SUPERVISOR");
         \ProcessUserPeer::doDelete($criteria);
     } catch (\Exception $e) {
         throw $e;
     }
 }