Ejemplo n.º 1
0
 /**
  * Export data according to given parameters.
  *
  * @return void
  */
 public function toExcelAction()
 {
     $this->type = 'XLS';
     $this->filename = 'Produit.xls';
     $lines = new ProductsObject();
     $this->tables = array('Catalog_ProductsData' => $lines->getDataColumns(), 'Catalog_ProductsIndex' => $lines->getIndexColumns());
     $this->view->params = $this->_getAllParams();
     $this->fields = array_merge($lines->getIndexColumns(), $lines->getDataColumns());
     $this->filters = array();
     $pageID = $this->_getParam('pageID');
     $langId = $this->_registry->languageID;
     $this->select = $lines->getAll($langId, false);
     parent::toExcelAction();
 }
Ejemplo n.º 2
0
 /**
  * Export data according to given parameters.
  *
  * @return void
  */
 public function toExcelAction()
 {
     $this->type = 'CSV';
     $this->filename = $this->_actionKey . '.csv';
     $params = array();
     $actionName = $this->_actionKey . 'Action';
     $params = $this->{$actionName}(true);
     $oDataName = $this->_objectList[$this->_actionKey];
     $lines = new $oDataName();
     $constraint = $lines->getConstraint();
     $params['constraint'] = $constraint;
     $this->tables = array($lines->getDataTableName() => $lines->getDataColumns());
     $this->view->params = $this->_getAllParams();
     $columns = array_keys($params['columns']);
     $this->fields = array_combine($columns, $columns);
     $this->filters = array();
     $pageID = $this->_getParam('pageID');
     $langId = $this->_defaultEditLanguage;
     $select = $lines->getAll($langId, false);
     $select = $this->_addJoinQuery($select, $params);
     $this->select = $select;
     parent::toExcelAction();
 }
Ejemplo n.º 3
0
 public function categoriesToExcelAction()
 {
     if ($this->view->aclIsAllowed($this->view->current_module, 'edit')) {
         $this->filename = 'Categories.xlsx';
         $this->tables = array('Categories' => array('C_ID'), 'CategoriesIndex' => array('CI_Title', 'CI_WordingShowAllRecords'));
         $this->fields = array('CI_Title' => array('label' => $this->view->getCibleText("list_column_{$this->_moduleID}_CI_Title")), 'CI_WordingShowAllRecords' => array());
         $this->filters = array();
         $this->select = $this->_db->select()->from('Categories', $this->tables['Categories'])->joinInner('CategoriesIndex', 'Categories.C_ID = CategoriesIndex.CI_CategoryID', $this->tables['CategoriesIndex'])->where('Categories.C_ModuleID = ?', Cible_FunctionsModules::getModuleIDByName($this->view->current_module))->where('CategoriesIndex.CI_LanguageID = ?', $this->_currentInterfaceLanguage);
         parent::toExcelAction();
     }
 }