예제 #1
0
파일: index.php 프로젝트: bqq1986/efront
             if ($configuration['supervisor_mail_activation'] == 1 && $options['supervisor']['description'] != "") {
                 $userProfileFields[] = $field['name'] . '_supervisors';
                 if ($options['supervisor']['hidden'] == 1) {
                     $form->addElement('select', $field['name'] . '_supervisors', "", array("" => _PLEASESELECT . " " . $options['name']), 'class="inputSelect" id= "' . $field['name'] . '_supervisors" style="display:none"');
                 } else {
                     $form->addElement('select', $field['name'] . '_supervisors', $options['supervisor']['description'], array("" => _PLEASESELECT . " " . $options['name']), 'class="inputSelect" id= "' . $field['name'] . '_supervisors" ');
                 }
             }
         }
     }
     #cpp#endif
 } else {
     if (G_VERSIONTYPE == 'enterprise') {
         #cpp#ifdef ENTERPRISE
         $options = unserialize($field['options']);
         $allGroups = EfrontGroup::getGroups(false);
         $groups = array();
         foreach ($allGroups as $value) {
             if ($value['self_enroll']) {
                 $groups[$value['id']] = $value['name'];
             }
         }
         if (!empty($groups)) {
             $groups = array(0 => '') + $groups;
             $userProfileFields[] = $field['name'] . '_groups';
             $form->addElement('select', $field['name'] . '_groups', $options['name'], $groups, 'class = "inputSelect"');
             if ($field['mandatory']) {
                 $form->addRule($field['name'] . '_groups', _THEFIELD . ' ' . $options['name'] . ' ' . _ISMANDATORY, 'required', null, 'client');
             }
         }
     }
예제 #2
0
        $flag = 1;
        foreach ($jobs_array as $value) {
            $flag = $flag && eF_checkParameter($value, 'id');
        }
        if ($flag) {
            $result = eF_getTableDataFlat("module_hcd_job_description", "job_description_ID,branch_ID", " description IN (SELECT description FROM module_hcd_job_description WHERE job_description_ID IN (" . implode(",", $jobs_array) . "))");
            $jobs_array = $result['job_description_ID'];
            $stats_filters[] = array("table" => "module_hcd_employee_has_job_description as filter_ej", "joinField" => "filter_ej.users_login", "condition" => "(filter_ej.job_description_ID in (" . implode(",", $jobs_array) . "))");
        }
    }
}
#cpp#endif
if (!isset($_GET['ajax'])) {
    if ($_SESSION['s_type'] == 'administrator') {
        //supervisors don't see groups
        $groups = EfrontGroup::getGroups();
        $smarty->assign("T_GROUPS", $groups);
    } else {
        $groups = $currentUser->getGroups();
        // Changed for 3.6.15 to show only professor's groups
        $smarty->assign("T_GROUPS", $groups);
    }
    if (G_VERSIONTYPE == 'enterprise') {
        #cpp#ifdef ENTERPRISE
        // Create the branches select
        require_once $path . "module_hcd_tools.php";
        eF_getRights();
        $company_branches = eF_getTableData("module_hcd_branch", "branch_ID, name, father_branch_ID", "", "father_branch_ID ASC,branch_ID ASC");
        if ($_SESSION['s_type'] != 'administrator' && $currentEmployee->isSupervisor()) {
            //this applies to supervisors only
            foreach ($company_branches as $key => $value) {
예제 #3
0
 protected function getGroupByName($group_name)
 {
     if (!$groupNamesToIds) {
         $groups = EfrontGroup::getGroups();
         foreach ($groups as $group) {
             if (!isset($groupNamesToIds[$group['name']])) {
                 $groupNamesToIds[$group['name']] = array($group['id']);
             } else {
                 $groupNamesToIds[$group['name']][] = $group['id'];
             }
         }
     }
     return $groupNamesToIds[$group_name];
 }
 private function doUnenrollUsers()
 {
     $smarty = $this->getSmartyVar();
     $currentUser = $this->getCurrentUser();
     if ($_GET['type'] == 'job') {
         foreach (EfrontJob::getAllJobs() as $key => $value) {
             $entities[$value['job_description_ID']] = $value['description'];
         }
         if ($_GET['entry']) {
             $entity = new EfrontJob($_GET['entry']);
             $courses = $entity->getJobCourses(array('archive' => false));
             $users = $entity->getEmployees();
         }
     } elseif ($_GET['type'] == 'branch') {
         foreach (EfrontBranch::getAllBranches() as $key => $value) {
             $entities[$value['branch_ID']] = $value['name'];
         }
         if ($_GET['entry']) {
             $entity = new EfrontBranch($_GET['entry']);
             $courses = $entity->getBranchCourses(array('archive' => false));
             $users = $entity->getEmployees();
         }
     } elseif ($_GET['type'] == 'group') {
         foreach (EfrontGroup::getGroups() as $key => $value) {
             $entities[$value['id']] = $value['name'];
         }
         if ($_GET['entry']) {
             $entity = new EfrontGroup($_GET['entry']);
             $courses = $entity->getGroupCourses(array('archive' => false));
             $users = $entity->getGroupUsers();
         }
     }
     if ($_GET['ajax'] && $_GET['remove_users_from_courses']) {
         try {
             foreach ($courses as $course) {
                 $course->removeUsers($users);
             }
             exit;
         } catch (Exception $e) {
             handleAjaxExceptions($e);
         }
     }
     $smarty->assign("T_ENTITIES_LIST", $entities);
 }
예제 #5
0
            EfrontSystem::switchLessonReportingMode($values['time_reports']);
        }
        unset($values['reset_license_note']);
        //Unset it, since we don't need to store this value to the database
        unset($values['submit']);
        foreach ($values as $key => $value) {
            EfrontConfiguration::setValue($key, $value);
        }
        eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=system_config&op=user&tab=main&message=" . urlencode(_SUCCESFULLYUPDATECONFIGURATION) . "&message_type=success");
    }
}
$smarty->assign("T_USER_MAIN_FORM", $userMainForm->toArray());
$userMultipleLoginsForm = new HTML_QuickForm("user_multiple_logins_form", "post", basename($_SERVER['PHP_SELF']) . "?ctg=system_config&op=user&tab=multiple_logins", "", null, true);
$userMultipleLoginsForm->registerRule('checkParameter', 'callback', 'eF_checkParameter');
$groups = array();
foreach (EfrontGroup::getGroups() as $value) {
    $groups[$value['id']] = $value['name'];
}
$userMultipleLoginsForm->addElement("select", "global", _ALLOWMULTIPLELOGINSGLOBALLY, array(0 => _NO, 1 => _YES));
$userMultipleLoginsForm->addElement("select", "user_types", _EXCEPTFORTHEROLES, EfrontUser::getRoles(true), "multiple");
if (sizeof($groups) > 0) {
    $userMultipleLoginsForm->addElement("select", "groups", _EXCEPTFORTHEGROUPS, $groups, "multiple");
}
$userMultipleLoginsForm->addElement("static", "", _HOLDDOWNCTRLFORMULTIPLESELECT);
$userMultipleLoginsForm->setDefaults(unserialize($GLOBALS['configuration']['multiple_logins']));
if (isset($currentUser->coreAccess['configuration']) && $currentUser->coreAccess['configuration'] != 'change') {
    $userMultipleLoginsForm->freeze();
} else {
    $userMultipleLoginsForm->addElement("submit", "submit", _SAVE, 'class = "flatButton"');
    if ($userMultipleLoginsForm->isSubmitted() && $userMultipleLoginsForm->validate()) {
        $values = $userMultipleLoginsForm->exportValues();
예제 #6
0
         echo "<message>Invalid token</message>";
         echo "</xml>";
     }
     break;
 case 'group_info':
     if (isset($_GET['token']) && checkToken($_GET['token'])) {
         if (isset($_GET['group'])) {
             if (eF_checkParameter($_GET['group'], 'id') == false) {
                 echo "<xml>";
                 echo "<status>error</status>";
                 echo "<message>Invalid group id</message>";
                 echo "</xml>";
                 exit;
             }
             try {
                 $groups = EfrontGroup::getGroups(true, true);
                 $group = $groups[$_GET['group']];
                 if (!empty($group)) {
                     echo "<xml>";
                     echo "<id>" . $group->group['id'] . "</id>";
                     echo "<name>" . $group->group['name'] . "</name>";
                     echo "<description>" . $group->group['description'] . "</description>";
                     echo "<active>" . $group->group['active'] . "</active>";
                     echo "<user_types_ID>" . $group->group['user_types_ID'] . "</user_types_ID>";
                     echo "<language>" . $group->group['languages_NAME'] . "</language>";
                     echo "<users_active>" . $group->group['users_active'] . "</users_active>";
                     echo "<assign_profile_to_new>" . $group->group['assign_profile_to_new'] . "</assign_profile_to_new>";
                     echo "<unique_key>" . $group->group['unique_key'] . "</unique_key>";
                     echo "<is_default>" . $group->group['is_default'] . "</is_default>";
                     echo "<key_max_usage>" . $group->group['key_max_usage'] . "</key_max_usage>";
                     echo "<key_current_usage>" . $group->group['key_current_usage'] . "</key_current_usage>";
예제 #7
0
        //pr($user_profile_dates);
        $smarty->assign("T_USER_PROFILE_DATES", $user_profile_dates);
    }
}
#cpp#endif
$smarty->assign("T_DATES_SEARCH_CRITERIA", implode(",", $datesFields));
$renderer = new HTML_QuickForm_Renderer_ArraySmarty($smarty);
$renderer->setRequiredTemplate('{$html}{if $required}
                &nbsp;<span class = "formRequired">*</span>
            {/if}');
// Management of the 'send email to all found' link icon on the top right of the table
// During page load create the item
$mass_operations = array(array('id' => 'groupUsersId', 'text' => _SETFOUNDEMPLOYEESINTOGROUP, 'image' => "16x16/users.png", 'href' => "javascript:void(0);", "onclick" => "eF_js_showDivPopup(event, '" . _SETFOUNDEMPLOYEESINTOGROUP . "', 0, 'insert_into_group')", 'target' => 'POPUP_FRAME'), array('id' => 'sendToAllId', 'text' => _SENDMESSAGETOALLFOUNDEMPLOYEES, 'image' => "16x16/mail.png", 'href' => "javascript:void(0);", "onclick" => "var recipient = '&recipient='+document.getElementById('usersFound').value;this.href='" . $currentUser->getType() . ".php?ctg=messages&add=1&popup=1'+recipient;eF_js_showDivPopup(event, '" . _SENDMESSAGE . "', 2)", 'target' => 'POPUP_FRAME'));
$smarty->assign("T_SENDALLMAIL_LINK", $mass_operations);
$form->setJsWarnings(_BEFOREJAVASCRIPTERROR, _AFTERJAVASCRIPTERROR);
$form->setRequiredNote(_REQUIREDNOTE);
$form->accept($renderer);
$smarty->assign('T_REPORT_FORM', $renderer->toArray());
// Popup to set to custom group form
$group_form = new HTML_QuickForm("insert_into_groups_form", "post", $_SESSION['s_type'] . ".php?ctg=search_users&search=1&branch_ID=" . $_GET['branch_ID'] . "&job_description_ID=" . $_GET['job_description_ID'], "", null, true);
$groups = array("0" => _INSERTINTONEWGROUP);
$groupsResult = EfrontGroup::getGroups();
foreach ($groupsResult as $group) {
    $groups[$group['id']] = $group['name'];
}
$group_form->addElement('select', 'existing_group', _INSERTINTOEXISTINGGROUP, $groups, 'id = "existing_group_id" class = "inputSelectMed" onchange="javascript:updateNewGroup(this, \'new_group_id\')"');
$group_form->addElement('text', 'new_group', _NEWGROUPNAME, 'class = "inputText" id="new_group_id" onChange="javascript:$(\'existing_group_id\').value = 0;"');
$group_form->setJsWarnings(_BEFOREJAVASCRIPTERROR, _AFTERJAVASCRIPTERROR);
$group_form->setRequiredNote(_REQUIREDNOTE);
$group_form->accept($renderer);
$smarty->assign('T_INSERT_INTO_GROUP_POPUP_FORM', $renderer->toArray());