diff --git a/inc/Html.class.php b/inc/Html.class.php index b9437cf6..063fdd36 100644 --- a/inc/Html.class.php +++ b/inc/Html.class.php @@ -32,54 +32,6 @@ defined('APP_ROOT') || die(_('No es posible acceder directamente a este archivo' */ class Html { - /** - * Crear un elemento del tipo SELECT. - * Esta función genera un elemento SELECT con las propiedades y valores pasados. - * - * @param array $values con los valores del select - * @param array $properties con las propiedades del select - * @param bool $useValue para usar el Id como valor - */ - public static function printSelect($values, $properties, $useValue = true) - { - - if (!is_array($properties)) { - return; - } - - $attribs = (is_array($properties['attribs'])) ? implode(' ', $properties['attribs']) : ''; - $cssClass = ($properties['class']) ? 'class="' . $properties['class'] . '"' : ''; - - if (!is_array($values)) { - echo ''; - echo ''; - return; - } - - if ($properties['label']) { - echo ''; - } - - echo ''; - } - /** * Limpia los datos recibidos de un formulario. * diff --git a/inc/tpl/config.inc b/inc/tpl/config.inc index 38704d2f..27d2aab3 100644 --- a/inc/tpl/config.inc +++ b/inc/tpl/config.inc @@ -249,7 +249,12 @@ - + @@ -258,7 +263,12 @@ - + diff --git a/inc/tpl/users.inc b/inc/tpl/users.inc index 09ea8277..4cc933d3 100644 --- a/inc/tpl/users.inc +++ b/inc/tpl/users.inc @@ -1,8 +1,5 @@
-

+

@@ -39,14 +36,24 @@ @@ -94,7 +101,7 @@
- +
- +
- + view->assign('filesAllowedExts', \SP\Config::getValue('files_allowed_exts')); $this->view->assign('filesAllowedSize', \SP\Config::getValue('files_allowed_size')); - $this->view->assign('groupsSelData', \SP\DB::getValuesForSelect('usrGroups', 'usergroup_id', 'usergroup_name')); - $this->view->assign('groupsSelProp', - array('name' => 'ldap_defaultgroup', - 'id' => 'ldap_defaultgroup', - 'class' => '', - 'size' => 1, - 'label' => '', - 'selected' => \SP\Config::getValue('ldap_defaultgroup'), - 'default' => '', - 'js' => '', - 'attribs' => array('required', $this->view->isDisabled)) - ); - $this->view->assign('profilesSelData', \SP\DB::getValuesForSelect('usrProfiles', 'userprofile_id', 'userprofile_name')); - $this->view->assign('profilesSelProp', - array('name' => 'ldap_defaultprofile', - 'id' => 'ldap_defaultprofile', - 'class' => '', - 'size' => 1, - 'label' => '', - 'selected' => \SP\Config::getValue('ldap_defaultprofile'), - 'default' => '', - 'js' => '', - 'attribs' => array('required', $this->view->isDisabled)) - ); + $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('currentLang', \SP\Config::getValue('sitelang')); $this->view->assign('sessionTimeout', \SP\Config::getValue('session_timeout')); $this->view->assign('accountCount', \SP\Config::getValue('account_count')); diff --git a/web/SearchC.class.php b/web/SearchC.class.php index 4a390c8f..0143e29f 100644 --- a/web/SearchC.class.php +++ b/web/SearchC.class.php @@ -25,9 +25,6 @@ namespace SP\Controller; -use SP\AccountSearch; -use SP\Session; - defined('APP_ROOT') || die(_('No es posible acceder directamente a este archivo')); /** @@ -59,12 +56,12 @@ class SearchC extends Controller implements ActionsInterface $this->view->assign('globalSearch', \SP\Config::getValue('globalsearch', 0)); // Comprobar si está creado el objeto de búsqueda en la sesión - if (!is_object(Session::getSearchFilters())) { - Session::setSearchFilters(new AccountSearch()); + if (!is_object(\SP\Session::getSearchFilters())) { + \SP\Session::setSearchFilters(new \SP\AccountSearch()); } // Obtener el filtro de búsqueda desde la sesión - $filters = Session::getSearchFilters(); + $filters = \SP\Session::getSearchFilters(); // Valores POST $this->view->assign('searchKey', \SP\Common::parseParams('p', 'skey', $filters->getSortKey())); @@ -94,7 +91,7 @@ class SearchC extends Controller implements ActionsInterface $this->view->assign('queryTimeStart', microtime()); - $search = new AccountSearch(); + $search = new \SP\AccountSearch(); $search->setGlobalSearch($this->view->globalSearch); $search->setTxtSearch($this->view->searchTxt); @@ -126,11 +123,11 @@ class SearchC extends Controller implements ActionsInterface // Variables para la barra de navegación $this->view->assign('firstPage', ceil(($this->view->limitStart + 1) / $this->view->limitCount)); - $this->view->assign('lastPage', ceil(AccountSearch::$queryNumRows / $this->view->limitCount)); - $this->view->assign('totalRows', AccountSearch::$queryNumRows); + $this->view->assign('lastPage', ceil(\SP\AccountSearch::$queryNumRows / $this->view->limitCount)); + $this->view->assign('totalRows', \SP\AccountSearch::$queryNumRows); $this->view->assign('filterOn', ($this->view->searchKey > 1 || $this->view->searchCustomer || $this->view->searchCategory || $this->view->searchTxt) ? true : false); - $limitLast = ((AccountSearch::$queryNumRows % $this->view->limitCount) == 0) ? AccountSearch::$queryNumRows - $this->view->limitCount : floor(AccountSearch::$queryNumRows / $this->view->limitCount) * $this->view->limitCount; + $limitLast = ((\SP\AccountSearch::$queryNumRows % $this->view->limitCount) == 0) ? \SP\AccountSearch::$queryNumRows - $this->view->limitCount : floor(\SP\AccountSearch::$queryNumRows / $this->view->limitCount) * $this->view->limitCount; $this->view->assign('pagerOnnClick', array( 'first' => 'searchSort(' . $this->view->searchKey . ', 0,1)', @@ -259,34 +256,34 @@ class SearchC extends Controller implements ActionsInterface { $this->view->assign('sortFields', array( array( - 'key' => AccountSearch::SORT_CUSTOMER, + 'key' => \SP\AccountSearch::SORT_CUSTOMER, 'title' => _('Ordenar por Cliente'), 'name' => _('Cliente'), - 'function' => 'searchSort(' . AccountSearch::SORT_CUSTOMER . ',' . $this->view->limitStart . ')' + 'function' => 'searchSort(' . \SP\AccountSearch::SORT_CUSTOMER . ',' . $this->view->limitStart . ')' ), array( - 'key' => AccountSearch::SORT_NAME, + 'key' => \SP\AccountSearch::SORT_NAME, 'title' => _('Ordenar por Nombre'), 'name' => _('Nombre'), - 'function' => 'searchSort(' . AccountSearch::SORT_NAME . ',' . $this->view->limitStart . ')' + 'function' => 'searchSort(' . \SP\AccountSearch::SORT_NAME . ',' . $this->view->limitStart . ')' ), array( - 'key' => AccountSearch::SORT_CATEGORY, + 'key' => \SP\AccountSearch::SORT_CATEGORY, 'title' => _('Ordenar por Categoría'), 'name' => _('Categoría'), - 'function' => 'searchSort(' . AccountSearch::SORT_CATEGORY . ',' . $this->view->limitStart . ')' + 'function' => 'searchSort(' . \SP\AccountSearch::SORT_CATEGORY . ',' . $this->view->limitStart . ')' ), array( - 'key' => AccountSearch::SORT_LOGIN, + 'key' => \SP\AccountSearch::SORT_LOGIN, 'title' => _('Ordenar por Usuario'), 'name' => _('Usuario'), - 'function' => 'searchSort(' . AccountSearch::SORT_LOGIN . ',' . $this->view->limitStart . ')' + 'function' => 'searchSort(' . \SP\AccountSearch::SORT_LOGIN . ',' . $this->view->limitStart . ')' ), array( - 'key' => AccountSearch::SORT_URL, + 'key' => \SP\AccountSearch::SORT_URL, 'title' => _('Ordenar por URL / IP'), 'name' => _('URL / IP'), - 'function' => 'searchSort(' . AccountSearch::SORT_URL . ',' . $this->view->limitStart . ')' + 'function' => 'searchSort(' . \SP\AccountSearch::SORT_URL . ',' . $this->view->limitStart . ')' ) )); } diff --git a/web/UsersMgmtC.class.php b/web/UsersMgmtC.class.php index 793f31fe..ce900cee 100644 --- a/web/UsersMgmtC.class.php +++ b/web/UsersMgmtC.class.php @@ -277,31 +277,8 @@ class UsersMgmtC extends Controller implements ActionsInterface $this->view->assign('isDisabled', ($this->view->isDemo || $this->view->actionId === self::ACTION_USR_USERS_VIEW) ? 'disabled' : ''); $this->view->assign('user', \SP\Users::getUserData($this->view->itemId)); - - $this->view->assign( - 'profilesSelProp', array('name' => 'profileid', - 'id' => 'selProfile', - 'class' => '', - 'size' => 1, - 'label' => '', - 'selected' => $this->view->user['user_profileId'], - 'default' => '', - 'js' => '', - 'attribs' => array('required', $this->view->isDisabled)) - ); - - $this->view->assign( - 'groupsSelProp', array('name' => 'groupid', - 'id' => 'selGroup', - 'class' => '', - 'size' => 1, - 'label' => '', - 'selected' => $this->view->user['user_groupId'], - 'default' => '', - 'js' => '', - 'attribs' => array('required', $this->view->isDisabled)) - ); - + $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('ro', ($this->view->user['checks']['user_isLdap']) ? 'READONLY' : ''); }