Example #1
0
 /**
  * Establecer las variables necesarias para las plantillas
  */
 private function setVars()
 {
     $this->view->assign('isAdmin', \SP\Session::getUserIsAdminApp() || \SP\Session::getUserIsAdminAcc());
     $this->view->assign('showGlobalSearch', \SP\Config::getValue('globalsearch', false));
     // Comprobar si está creado el objeto de búsqueda en la sesión
     if (!is_object(\SP\Session::getSearchFilters())) {
         \SP\Session::setSearchFilters(new \SP\AccountSearch());
     }
     // Obtener el filtro de búsqueda desde la sesión
     $filters = \SP\Session::getSearchFilters();
     // Valores POST
     $this->view->assign('searchKey', \SP\Request::analyze('skey', $filters->getSortKey()));
     $this->view->assign('searchOrder', \SP\Request::analyze('sorder', $filters->getSortOrder()));
     $this->view->assign('searchCustomer', \SP\Request::analyze('customer', $filters->getCustomerId()));
     $this->view->assign('searchCategory', \SP\Request::analyze('category', $filters->getCategoryId()));
     $this->view->assign('searchTxt', \SP\Request::analyze('search', $filters->getTxtSearch()));
     $this->view->assign('searchGlobal', \SP\Request::analyze('gsearch', $filters->getGlobalSearch()));
     $this->view->assign('limitStart', \SP\Request::analyze('start', $filters->getLimitStart()));
     $this->view->assign('limitCount', \SP\Request::analyze('rpp', $filters->getLimitCount()));
 }