Exemple #1
0
 public function listAllAction()
 {
     if ($this->view->aclIsAllowed('newsletter', 'manage', true)) {
         $tables = array('Newsletter_Releases' => array('NR_ID', 'NR_Title', 'NR_Date', 'NR_Online', 'NR_Status'), 'CategoriesIndex' => array('CI_Title'), 'Status' => array('S_Code'));
         $field_list = array('NR_Title' => array(), 'NR_Date' => array('width' => '120px'), 'CI_Title' => array('width' => '100px'), 'S_Code' => array('width' => '80px', 'postProcess' => array('type' => 'dictionnary', 'prefix' => 'status_')), 'NR_Status' => array('width' => '80px', 'postProcess' => array('type' => 'dictionnary', 'prefix' => 'send_')));
         //get all releases
         $releasesSelect = new NewsletterReleases();
         $select = $releasesSelect->select()->setIntegrityCheck(false);
         $select->from('Newsletter_Releases')->join('CategoriesIndex', 'CI_CategoryID = NR_CategoryID')->join('Status', 'Newsletter_Releases.NR_Online = Status.S_ID')->where('CI_LanguageID = ?', Zend_Registry::get("languageID"));
         //->order('NR_Title');
         $releasesData = $releasesSelect->fetchAll($select);
         $options = array('commands' => array($this->view->link($this->view->url(array('controller' => 'index', 'action' => 'add')), $this->view->getCibleText('button_add_newsletter'), array('class' => 'action_submit add'))), 'disable-export-to-excel' => 'true', 'filters' => array('newsletter-category-filter' => array('label' => 'Filtre 1', 'default_value' => null, 'associatedTo' => 'NR_CategoryID', 'choices' => Cible_FunctionsCategories::getFilterCategories($this->_moduleID)), 'newsletter-code-filter' => array('label' => 'Filtre 1', 'default_value' => null, 'associatedTo' => 'S_Code', 'choices' => array('' => $this->view->getCibleText('filter_empty_diffusion'), 'online' => $this->view->getCibleText('status_online'), 'offline' => $this->view->getCibleText('status_offline'))), 'newsletter-status-filter' => array('label' => 'Filtre 2', 'default_value' => null, 'associatedTo' => 'NR_Status', 'choices' => array('' => $this->view->getCibleText('filter_empty_status'), 1 => $this->view->getCibleText('send_1'), 0 => $this->view->getCibleText('send_2')))), 'action_panel' => array('width' => '50', 'actions' => array('edit' => array('label' => $this->view->getCibleText('button_edit'), 'url' => "{$this->view->baseUrl()}/newsletter/index/edit/newsletterID/%ID%/", 'findReplace' => array('search' => '%ID%', 'replace' => 'NR_ID')), 'delete' => array('label' => $this->view->getCibleText('button_delete'), 'url' => "{$this->view->baseUrl()}/newsletter/index/delete/newsletterID/%ID%/", 'findReplace' => array('search' => '%ID%', 'replace' => 'NR_ID')))));
         $options['filters']['newsletter-category-filter']['choices'][''] = $this->view->getCibleText('filter_empty_category');
         $mylist = new Cible_Paginator($select, $tables, $field_list, $options);
         $this->view->assign('mylist', $mylist);
     }
 }
Exemple #2
0
 public function listAllAction()
 {
     if ($this->view->aclIsAllowed('events', 'edit', true)) {
         // NEW LIST GENERATOR CODE //
         $tables = array('EventsData' => array('ED_ID', 'ED_CategoryID'), 'EventsIndex' => array('EI_EventsDataID', 'EI_LanguageID', 'EI_Title', 'EI_Status'), 'Status' => array('S_Code'), 'CategoriesIndex' => array('CI_Title'));
         $field_list = array('EI_Title' => array('width' => '300px'), 'CI_Title' => array(), 'S_Code' => array('width' => '80px', 'postProcess' => array('type' => 'dictionnary', 'prefix' => 'status_')));
         $events = new EventsData();
         $select = $events->select()->from('EventsData')->setIntegrityCheck(false)->join('EventsIndex', 'EventsData.ED_ID = EventsIndex.EI_EventsDataID')->join('Status', 'EventsIndex.EI_Status = Status.S_ID')->joinRight('CategoriesIndex', 'EventsData.ED_CategoryID = CategoriesIndex.CI_CategoryID')->joinRight('Categories', 'EventsData.ED_CategoryID = Categories.C_ID')->joinRight('Languages', 'Languages.L_ID = EventsIndex.EI_LanguageID')->where('EI_LanguageID = ?', $this->_defaultEditLanguage)->where('EventsIndex.EI_LanguageID = CategoriesIndex.CI_LanguageID')->where('C_ModuleID = ?', $this->_moduleID);
         //->order('EI_Title');
         $options = array('commands' => array($this->view->link($this->view->url(array('controller' => 'index', 'action' => 'add')), $this->view->getCibleText('button_add_events'), array('class' => 'action_submit add'))), 'filters' => array('events-category-filter' => array('default_value' => null, 'associatedTo' => 'ED_CategoryID', 'choices' => Cible_FunctionsCategories::getFilterCategories($this->_moduleID)), 'events-status-filter' => array('label' => 'Filtre 2', 'default_value' => null, 'associatedTo' => 'S_Code', 'choices' => array('' => $this->view->getCibleText('filter_empty_status'), 'online' => $this->view->getCibleText('status_online'), 'offline' => $this->view->getCibleText('status_offline')))), 'action_panel' => array('width' => '50', 'actions' => array('edit' => array('label' => $this->view->getCibleText('button_edit'), 'url' => "{$this->view->baseUrl()}/events/index/edit/eventID/%ID%/lang/%LANG%/return/list-all/", 'findReplace' => array(array('search' => '%ID%', 'replace' => 'ED_ID'), array('search' => '%LANG%', 'replace' => 'L_Suffix'))), 'delete' => array('label' => $this->view->getCibleText('button_delete'), 'url' => "{$this->view->baseUrl()}/events/index/delete/eventID/%ID%/return/list-all/", 'findReplace' => array('search' => '%ID%', 'replace' => 'ED_ID')))));
         $mylist = new Cible_Paginator($select, $tables, $field_list, $options);
         $this->view->assign('mylist', $mylist);
     }
 }
Exemple #3
0
 public function listApprobationRequestAction()
 {
     if ($this->view->aclIsAllowed('news', 'publish')) {
         $tables = array('NewsData' => array('ND_ID', 'ND_CategoryID', 'ND_ReleaseDate'), 'NewsIndex' => array('NI_NewsDataID', 'NI_LanguageID', 'NI_Title', 'NI_Status'), 'CategoriesIndex' => array('CI_Title'));
         $field_list = array('NI_Title' => array('width' => '400px'), 'CI_Title' => array(), 'ND_ReleaseDate' => array('width' => '120px'));
         $news = new NewsData();
         $select = $news->select()->from('NewsData')->setIntegrityCheck(false)->join('NewsIndex', 'NewsData.ND_ID = NewsIndex.NI_NewsDataID')->joinRight('CategoriesIndex', 'NewsData.ND_CategoryID = CategoriesIndex.CI_CategoryID')->joinRight('Languages', 'Languages.L_ID = NewsIndex.NI_LanguageID')->where('NewsData.ND_ToApprove = ?', 1)->where('NewsIndex.NI_LanguageID = CategoriesIndex.CI_LanguageID')->order('NI_Title');
         $options = array('disable-export-to-excel' => 'true', 'filters' => array('filter_1' => array('default_value' => null, 'associatedTo' => 'CI_Title', 'choices' => Cible_FunctionsCategories::getFilterCategories($this->_moduleID)), 'filter_2' => array('default_value' => null, 'associatedTo' => 'CI_LanguageID', 'choices' => Cible_FunctionsGeneral::getFilterLanguages())), 'action_panel' => array('width' => '50', 'actions' => array('edit' => array('label' => $this->view->getCibleText('button_edit'), 'url' => "{$this->view->baseUrl()}/news/index/edit/newsID/%ID%/lang/%LANG%/approbation/true", 'findReplace' => array(array('search' => '%ID%', 'replace' => 'ND_ID'), array('search' => '%LANG%', 'replace' => 'L_Suffix'))))));
         $mylist = new Cible_Paginator($select, $tables, $field_list, $options);
         $this->view->assign('mylist', $mylist);
     }
 }