示例#1
0
 /**
  * Establecer variables comunes del formulario para todos los interfaces
  */
 private function setCommonData()
 {
     if ($this->isGotData()) {
         //            $this->view->assign('accountParentId', $this->getAccount()->getAccountParentId());
         $this->view->assign('accountIsHistory', $this->getAccount()->getAccountIsHistory());
         $this->view->assign('accountOtherUsers', $this->getAccount()->getAccountUsersId());
         $this->view->assign('accountOtherUsersName', UserAccounts::getUsersNameForAccount($this->getId()));
         $this->view->assign('accountOtherGroups', $this->getAccount()->getAccountUserGroupsId());
         $this->view->assign('accountOtherGroupsName', \SP\Groups::getGroupsNameForAccount($this->getId()));
         $this->view->assign('changesHash', $this->getAccount()->calcChangesHash());
         $this->view->assign('chkUserEdit', $this->view->accountData->account_otherUserEdit ? 'checked' : '');
         $this->view->assign('chkGroupEdit', $this->view->accountData->account_otherGroupEdit ? 'checked' : '');
         $this->view->assign('historyData', \SP\AccountHistory::getAccountList($this->getAccount()->getAccountParentId()));
         $this->view->assign('isModified', $this->view->accountData->account_dateEdit && $this->view->accountData->account_dateEdit != '0000-00-00 00:00:00');
         $this->view->assign('maxFileSize', round(\SP\Config::getValue('files_allowed_size') / 1024, 1));
         $this->view->assign('filesAllowedExts', \SP\Config::getValue('files_allowed_exts'));
         $this->view->assign('filesDelete', $this->_action == Acl::ACTION_ACC_EDIT ? 1 : 0);
     }
     $this->view->assign('accountParentId', Session::getLastAcountId());
     $this->view->assign('categories', \SP\DB::getValuesForSelect('categories', 'category_id', 'category_name'));
     $this->view->assign('customers', \SP\DB::getValuesForSelect('customers', 'customer_id', 'customer_name'));
     $this->view->assign('otherUsers', \SP\DB::getValuesForSelect('usrData', 'user_id', 'user_name'));
     $this->view->assign('otherGroups', \SP\DB::getValuesForSelect('usrGroups', 'usergroup_id', 'usergroup_name'));
     $this->getCustomFieldsForItem();
 }
示例#2
0
 /**
  * Obtener la pestaña de LDAP
  * @return bool
  */
 public function getLdapTab()
 {
     $this->setAction(self::ACTION_CFG_LDAP);
     if (!$this->checkAccess(self::ACTION_CFG_GENERAL)) {
         return;
     }
     $this->view->addTemplate('ldap');
     $this->view->assign('chkLdap', \SP\Config::getValue('ldap_enabled') ? 'checked="checked"' : '');
     $this->view->assign('chkLdapADS', \SP\Config::getValue('ldap_ads') ? 'checked="checked"' : '');
     $this->view->assign('ldapIsAvailable', \SP\Util::ldapIsAvailable());
     $this->view->assign('ldapServer', \SP\Config::getValue('ldap_server'));
     $this->view->assign('ldapBindUser', \SP\Config::getValue('ldap_binduser'));
     $this->view->assign('ldapBindPass', \SP\Config::getValue('ldap_bindpass'));
     $this->view->assign('ldapBase', \SP\Config::getValue('ldap_base'));
     $this->view->assign('ldapGroup', \SP\Config::getValue('ldap_group'));
     $this->view->assign('groups', \SP\DB::getValuesForSelect('usrGroups', 'usergroup_id', 'usergroup_name'));
     $this->view->assign('profiles', \SP\DB::getValuesForSelect('usrProfiles', 'userprofile_id', 'userprofile_name'));
     $this->view->assign('ldapDefaultGroup', \SP\Config::getValue('ldap_defaultgroup'));
     $this->view->assign('ldapDefaultProfile', \SP\Config::getValue('ldap_defaultprofile'));
     $this->view->assign('actionId', $this->getAction(), 'ldap');
     $this->view->append('tabs', array('title' => _('LDAP')));
     $this->view->assign('tabIndex', $this->getTabIndex(), 'ldap');
 }
示例#3
0
 /**
  * Obtener los datos para la ficha de tokens de API
  */
 public function getToken()
 {
     $this->view->addTemplate('tokens');
     $token = \SP\ApiTokens::getTokens($this->view->itemId, true);
     $this->view->assign('users', \SP\DB::getValuesForSelect('usrData', 'user_id', 'user_name'));
     $this->view->assign('actions', \SP\ApiTokens::getTokenActions());
     $this->view->assign('token', $token);
     $this->view->assign('gotData', is_object($token));
     if ($this->view->isView === true) {
         $msg = sprintf('%s ;;Usuario: %s', _('Token de autorización visualizado'), $token->user_login);
         Log::writeNewLogAndEmail(_('Autorizaciones'), $msg);
     }
 }
示例#4
0
 /**
  * Obtener los datos para la caja de búsqueda
  */
 public function getSearchBox()
 {
     $this->view->addTemplate('searchbox');
     $this->view->assign('customers', \SP\DB::getValuesForSelect('customers', 'customer_id', 'customer_name'));
     $this->view->assign('categories', \SP\DB::getValuesForSelect('categories', 'category_id', 'category_name'));
 }