public function getDashletsInstances($start = null, $limit = null)
 {
     try {
         $dashletsInstances = array();
         $criteria = new Criteria('workflow');
         $criteria->addSelectColumn('*');
         $criteria->addJoin(DashletInstancePeer::DAS_UID, DashletPeer::DAS_UID, Criteria::INNER_JOIN);
         if (!is_null($start)) {
             $criteria->setOffset($start);
         }
         if (!is_null($limit)) {
             $criteria->setLimit($limit);
         }
         $dataset = DashletInstancePeer::doSelectRS($criteria);
         $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $dataset->next();
         while ($row = $dataset->getRow()) {
             $arrayField = unserialize($row["DAS_INS_ADDITIONAL_PROPERTIES"]);
             $row['DAS_INS_STATUS_LABEL'] = $row['DAS_INS_STATUS'] == '1' ? G::LoadTranslation('ID_ACTIVE') : G::LoadTranslation('ID_INACTIVE');
             $row['DAS_INS_TITLE'] = isset($arrayField['DAS_INS_TITLE']) && !empty($arrayField['DAS_INS_TITLE']) ? $arrayField['DAS_INS_TITLE'] : '';
             if (!class_exists($row['DAS_CLASS'])) {
                 self::setIncludePath();
                 require_once 'classes' . PATH_SEP . 'class.' . $row['DAS_CLASS'] . '.php';
             }
             eval("\$row['DAS_VERSION'] = defined('" . $row['DAS_CLASS'] . "::version') ? " . $row['DAS_CLASS'] . "::version : \$row['DAS_VERSION'];");
             switch ($row['DAS_INS_OWNER_TYPE']) {
                 case 'EVERYBODY':
                     $row['DAS_INS_OWNER_TITLE'] = G::LoadTranslation('ID_ALL_USERS');
                     break;
                 case 'USER':
                     require_once 'classes/model/Users.php';
                     $userInstance = new Users();
                     try {
                         $user = $userInstance->load($row['DAS_INS_OWNER_UID']);
                         $row['DAS_INS_OWNER_TITLE'] = $user['USR_FIRSTNAME'] . ' ' . $user['USR_LASTNAME'];
                     } catch (Exception $error) {
                         $this->remove($row['DAS_INS_UID']);
                         $row['DAS_INS_UID'] = '';
                     }
                     break;
                 case 'DEPARTMENT':
                     require_once 'classes/model/Department.php';
                     $departmentInstance = new Department();
                     try {
                         $department = $departmentInstance->load($row['DAS_INS_OWNER_UID']);
                         $row['DAS_INS_OWNER_TITLE'] = $department['DEPO_TITLE'];
                     } catch (Exception $error) {
                         $this->remove($row['DAS_INS_UID']);
                         $row['DAS_INS_UID'] = '';
                     }
                     break;
                 case 'GROUP':
                     require_once 'classes/model/Groupwf.php';
                     $groupInstance = new Groupwf();
                     try {
                         $group = $groupInstance->load($row['DAS_INS_OWNER_UID']);
                         $row['DAS_INS_OWNER_TITLE'] = $group['GRP_TITLE'];
                     } catch (Exception $error) {
                         $this->remove($row['DAS_INS_UID']);
                         $row['DAS_INS_UID'] = '';
                     }
                     break;
                 default:
                     $row['DAS_INS_OWNER_TITLE'] = $row['DAS_INS_OWNER_TYPE'];
                     break;
             }
             if ($row['DAS_INS_UID'] != '') {
                 $dashletsInstances[] = $row;
             }
             $dataset->next();
         }
         return $dashletsInstances;
     } catch (Exception $error) {
         throw $error;
     }
 }
        }
        $rows[] = $depto;
    }
    return $rows;
}
if (($RBAC_Response = $RBAC->userCanAccess("PM_USERS")) != 1) {
    return $RBAC_Response;
}
G::LoadInclude('ajax');
$_POST['action'] = get_ajax_value('action');
require_once 'classes/model/Department.php';
switch ($_POST['action']) {
    case 'showUsers':
        global $G_PUBLISH;
        $oDept = new Department();
        $aFields = $oDept->load($_POST['sDptoUID']);
        $G_PUBLISH = new Publisher();
        $G_PUBLISH->AddContent('xmlform', 'xmlform', 'departments/departments_Edit', '', $aFields, '');
        $criteria = $oDept->getUsersFromDepartment($_POST['sDptoUID'], $aFields['DEP_MANAGER']);
        $G_PUBLISH->AddContent('propeltable', 'departments/paged-table2', 'departments/departments_UsersList', $criteria, $aFields);
        //$G_PUBLISH->AddContent('propeltable', 'paged-table', 'departments/departments_UsersList', $criteria, $aFields);
        $oHeadPublisher =& headPublisher::getSingleton();
        $oHeadPublisher->addScriptCode("groupname='{$aFields["DEPO_TITLE"]}';");
        $oHeadPublisher->addScriptCode("depUid='{$aFields["DEP_UID"]}';");
        G::RenderPage('publish', 'raw');
        break;
    case 'assignAllUsers':
        $aUsers = explode(',', $_POST['aUsers']);
        $oDept = new Department();
        $depUid = $_POST['DEP_UID'];
        $cant = $oDept->cantUsersInDepartment($depUid);
 */
require_once 'classes/class.xmlfield_InputPM.php';
require_once 'classes/model/Department.php';
$access = $RBAC->userCanAccess('PM_USERS');
if ($access != 1) {
    switch ($access) {
        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;
}
$oDept = new Department();
$aFields = $oDept->load($_GET['UID']);
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('propeltable', 'departments/paged-table', 'departments/departments_AvailableUsers', $oDept->getAvailableUsersCriteria($_GET['UID']));
G::RenderPage('publish', 'raw');
Exemple #4
0
 $aFields['START_DATE'] = date('Y-m-d');
 $aFields['END_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 5));
 $G_MAIN_MENU = 'processmaker';
 $G_SUB_MENU = 'users';
 $G_ID_MENU_SELECTED = 'USERS';
 $G_ID_SUB_MENU_SELECTED = 'USERS';
 $G_PUBLISH = new Publisher();
 //getting the user and department
 $oDepInfo = new Department();
 $oUser = UsersPeer::retrieveByPk($aFields['USR_REPORTS_TO']);
 if ($oUser != '') {
     if (get_class($oUser) == 'Users') {
         $userFields = $oUser->toArray(BasePeer::TYPE_FIELDNAME);
         $aFields['USR_REPORTS_TO'] = $userFields['USR_FIRSTNAME'] . ' ' . $userFields['USR_LASTNAME'];
         try {
             $depFields = $oDepInfo->load($userFields['DEP_UID']);
             $aFields['USR_REPORTS_TO'] .= " (" . $depFields['DEPO_TITLE'] . ")";
         } catch (Exception $e) {
         }
     } else {
         $aFields['USR_REPORTS_TO'] = ' ';
     }
 }
 try {
     $depFields = $oDepInfo->load($aFields['DEP_UID']);
     $aFields['USR_DEPARTMENT'] = $depFields['DEPO_TITLE'];
 } catch (Exception $e) {
     $oUser = UsersPeer::retrieveByPk($_GET['USR_UID']);
     $oUser->setDepUid('');
     $oUser->save();
 }