示例#1
0
 public function listClientsAction()
 {
     // web page title
     $this->view->title = "Clients";
     if ($this->view->aclIsAllowed($this->_moduleTitle, 'edit', true)) {
         $profile = new GenericProfile();
         $member = new MemberProfile();
         $oRetailer = new RetailersObject();
         $selectRetailer = $oRetailer->getAll(null, false);
         $selectRetailer->joinRight($profile->getGenericTable(), 'R_GenericProfileId = GP_MemberID', array('lastName' => 'GP_LastName', 'firstName' => 'GP_FirstName', 'email' => 'GP_Email'));
         $select = $selectRetailer->joinRight($member->getTable(), 'GP_MemberID = MP_GenericProfileMemberID', array('member_id' => 'MP_GenericProfileMemberID', 'company' => 'MP_CompanyName', 'MP_Status' => 'MP_Status'));
         $tables = array('GenericProfiles' => array('GP_LastName', 'GP_FirstName', 'GP_Email'), 'RetailersData' => array('R_ID', 'R_GenericProfileID', 'R_AddressId', 'R_Status'));
         $field_list = array('company' => array('width' => '250px'), 'lastName' => array('width' => '250px'), 'firstName' => array('width' => '250px'));
         $tables = array('GenericProfiles' => array('GP_lastName', 'GP_firstName'), 'MemberProfiles' => array('MP_CompanyName'));
         $this->view->params = $this->_getAllParams();
         $pageID = $this->_getParam('pageID');
         $langId = $this->_registry->languageID;
         $options = array('commands' => array($this->view->link($this->view->url(array('module' => 'profile', 'controller' => 'index', 'action' => 'add', 'returnModule' => $this->_moduleTitle, 'returnAction' => 'list-clients')), $this->view->getCibleText('button_add_profile'), array('class' => 'action_submit add'))), 'excludedColums' => array('Nom'), 'disable-export-to-excel' => '', 'to-excel-action' => 'clients-to-excel', 'filters' => array('filter_1' => array('label' => 'Liste des détaillants', 'default_value' => null, 'associatedTo' => 'GP_MemberID', 'equalTo' => 'R_GenericProfileId', 'choices' => array('' => 'Liste des détaillants', '1' => "--> Affichés sur le site")), 'filter_2' => array('label' => 'Liste des détaillants', 'default_value' => null, 'associatedTo' => 'MP_Status', 'choices' => array('' => 'Filtrer par statut', '-1' => 'Désactivé', '0' => 'Email non validé', '1' => 'À valider', '2' => 'Activé'))), 'action_panel' => array('width' => '50', 'actions' => array('edit' => array('label' => $this->view->getCibleText('menu_submenu_action_edit'), 'url' => $this->view->url(array('module' => 'profile', 'action' => 'edit', 'ID' => "-ID-", 'returnModule' => $this->_moduleTitle, 'returnAction' => 'list-clients')), 'findReplace' => array('search' => '-ID-', 'replace' => 'member_id')), 'delete' => array('label' => $this->view->getCibleText('menu_submenu_action_delete'), 'url' => $this->view->url(array('module' => 'profile', 'action' => 'delete', 'ID' => "-ID-", 'returnModule' => $this->_moduleTitle, 'returnAction' => 'list-clients')), 'findReplace' => array('search' => '-ID-', 'replace' => 'member_id')))));
         $mylist = new Cible_Paginator($select, $tables, $field_list, $options);
         $this->view->assign('mylist', $mylist);
     }
 }