public function listAction() { // web page title $this->view->title = "Partenaires"; if ($this->view->aclIsAllowed($this->_moduleTitle, 'edit', true)) { $generic = new GenericProfilesObject(); $generic->setOrderBy('GP_LastName'); $profile = new PartnersProfilesObject(); $select = $generic->getAll(null, false); $select->columns(array('lastName' => 'GP_LastName', 'firstName' => 'GP_FirstName', 'email' => 'GP_Email', 'member_id' => 'GP_MemberID')); $select->joinRight($profile->getDataTableName(), $profile->getDataId() . ' = ' . $generic->getDataId()); $tables = array('GenericProfiles' => array('GP_LastName', 'GP_FirstName', 'GP_Email'), 'MemberProfiles' => array('PP_GenericProfileId')); $field_list = array('firstName' => array('width' => '250px'), 'lastName' => array('width' => '250px'), 'email' => array('width' => '250px')); $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' => 'users', 'controller' => 'index', 'action' => 'general', 'actionKey' => 'add', 'returnModule' => $this->_moduleTitle, 'returnAction' => 'list')), $this->view->getCibleText('button_add_profile'), array('class' => 'action_submit add'))), 'enable-print' => false, 'disable-export-to-excel' => '', 'filters' => array(), 'action_panel' => array('width' => '50', 'actions' => array('edit' => array('label' => $this->view->getCibleText('menu_submenu_action_edit'), 'url' => $this->view->url(array('module' => 'users', 'action' => 'general', 'actionKey' => 'edit', $this->_ID => "-ID-", 'returnModule' => $this->_moduleTitle, 'returnAction' => 'list')), 'findReplace' => array('search' => '-ID-', 'replace' => 'member_id')), 'delete' => array('label' => $this->view->getCibleText('menu_submenu_action_delete'), 'url' => $this->view->url(array('module' => 'users', 'action' => 'general', 'actionKey' => 'delete', $this->_ID => "-ID-", 'returnModule' => $this->_moduleTitle, 'returnAction' => 'list')), 'findReplace' => array('search' => '-ID-', 'replace' => 'member_id'))))); $mylist = new Cible_Paginator($select, $tables, $field_list, $options); $this->view->assign('mylist', $mylist); } }
public function toExcelAction() { $this->filename = 'membersList.xls'; $this->type = 'Excel5'; $profile = new GenericProfilesObject(); $profile->setOrderBy('GP_LastName'); $member = new MemberProfilesObject(); $oRef = new ReferencesObject(); $oAddr = new AddressObject(); $oParent = new ParentProfilesObject(); $oParent = new ParentProfilesObject(); $this->select = $profile->getAll(null, false); $this->select->columns(array('lastName' => 'GP_LastName', 'firstName' => 'GP_FirstName', 'email' => 'GP_Email', 'member_id' => 'GP_MemberID')); $this->select->joinRight($member->getDataTableName(), $member->getDataId() . ' = ' . $profile->getDataId()); $this->select->joinLeft($oRef->getDataTableName(), $oRef->getDataId() . ' = MP_Section', array('R_TypeRef')); $this->select->joinLeft($oRef->getIndexTableName(), $oRef->getIndexId() . ' = ' . $oRef->getDataId(), array('section' => 'RI_Value')); $this->select->joinLeft($oParent->getDataTableName(), $oParent->getDataId() . ' = MP_FirstParent OR ' . $oParent->getDataId() . ' = MP_SecondParent'); // $this->select->joinLeft( // $oParent->getDataTableName(), // $oParent->getDataId() . ' = MP_SecondParent' // ); $this->select->joinLeft($oAddr->getDataTableName(), $oAddr->getDataId() . ' = PP_AddressId'); $this->select->joinLeft($oAddr->getIndexTableName(), $oAddr->getIndexId() . ' = ' . $oAddr->getDataId()); $this->select->joinLeft('CountriesIndex', 'CountriesIndex.CI_CountryID = A_CountryId', 'CI_Name'); $this->select->joinLeft('StatesIndex', 'SI_StateID = A_StateId', 'SI_Name'); $this->select->where('MP_Category in (45,46)'); $this->select->where('MP_YearsParticipate like "%' . date('Y', time()) . '%"'); $this->tables = array('GenericProfiles' => array('GP_LastName', 'GP_FirstName', 'GP_Email'), 'MemberProfiles' => array('MP_GenericProfileId', 'MP_Section'), $oRef->getDataTableName() => array('R_TypeRef'), $oRef->getIndexTableName() => array('RI_Value')); $this->fields = array('section' => array('width' => '250px'), 'CI_Name' => 'CI_Name', 'SI_Name' => 'SI_Name'); $this->fields = array_merge($this->fields, $profile->getDataColumns(), $member->getDataColumns(), $oAddr->getDataColumns(), $oAddr->getIndexColumns(), $oParent->getDataColumns(), $oRef->getIndexColumns()); unset($this->fields[$oRef->getDataId()]); unset($this->fields[$member->getDataId()]); unset($this->fields[$profile->getDataId()]); unset($this->fields['PP_AssuSocNum']); $this->filters = array(); parent::toExcelAction(); }