";
return $display;
}
/**
* Liste des objets
*/
public function get_display_content_list() {
$display = '';
foreach ($this->objects as $i=>$object) {
$display .= "
";
}
return $display;
}
/**
* Affiche la recherche + la liste
*/
public function get_display_list() {
global $msg, $charset;
global $base_path;
$display = $this->get_title();
// Affichage du formulaire de recherche
$display .= $this->get_search_form();
// Affichage de la human_query
$display .= $this->_get_query_human();
//Récupération du script JS de tris
$display .= $this->get_js_sort_script_sort();
//Affichage de la liste des objets
$display .= "
";
}
protected function _get_query_human() {
return '';
}
public function get_export_icons() {
global $base_path;
global $msg;
return "
";
}
protected function get_display_spreadsheet_title() {
}
/**
* Header de la liste du tableur
*/
protected function get_display_spreadsheet_header_list() {
$j=0;
foreach ($this->columns as $column) {
$this->spreadsheet->write_string(2,$j++,$this->_get_label_cell_header($column['label']));
}
}
protected function get_display_spreadsheet_cell($object, $property, $row, $col) {
$this->spreadsheet->write_string($row,$col, strip_tags($this->get_cell_content($object, $property)));
}
/**
* Liste des objets du tableur
*/
public function get_display_spreadsheet_content_list() {
$ligne=3;
foreach ($this->objects as $object) {
$j=0;
foreach ($this->columns as $column) {
$this->get_display_spreadsheet_cell($object, $column['property'], $ligne, $j++);
}
$ligne++;
}
}
public function get_display_spreadsheet_list() {
$this->spreadsheet = new spreadsheet();
$this->get_display_spreadsheet_title();
$this->get_display_spreadsheet_header_list();
if(count($this->objects)) {
$this->get_display_spreadsheet_content_list();
}
// $worksheet->set_column(0, $j, 18);
$this->spreadsheet->download('edition.xls');
}
protected function get_html_title() {
return '';
}
/**
* Header de la liste du tableau
*/
protected function get_display_html_header_list() {
$display = '
';
foreach ($this->columns as $column) {
$display .= "
";
return $display;
}
/**
* Liste des objets du tableau HTML
*/
public function get_display_html_content_list() {
$display = '';
foreach ($this->objects as $i=>$object) {
$display .= "
";
}
return $display;
}
public function get_display_html_list() {
global $msg, $charset;
global $base_path;
$display = $this->get_html_title();
// Affichage de la human_query
$display .= $this->_get_query_human();
//Affichage de la liste des objets
$display .= "
";
return $display;
}
/**
* Sauvegarde des filtres en session
*/
public function set_filter_in_session() {
foreach ($this->filters as $name=>$filter) {
$_SESSION['list_'.$this->objects_type.'_filter'][$name] = $filter;
}
}
/**
* Sauvegarde de la pagination en session
*/
public function set_pager_in_session() {
$_SESSION['list_'.$this->objects_type.'_pager']['nb_per_page'] = $this->pager['nb_per_page'];
}
/**
* Sauvegarde du tri appliqué en session
*/
public function set_applied_sort_in_session() {
foreach ($this->applied_sort as $name=>$applied_sort) {
$_SESSION['list_'.$this->objects_type.'_applied_sort'][$name] = $applied_sort;
}
}
/**
* Sauvegarde des colonnes en session
*/
public function set_columns_in_session() {
foreach ($this->columns as $name=>$column) {
$_SESSION['list_'.$this->objects_type.'_columns'][$name] = $column;
}
}
public function get_objects_type() {
return $this->objects_type;
}
public function get_objects() {
return $this->objects;
}
public function get_applied_sort() {
return $this->applied_sort;
}
public function get_filters() {
return $this->filters;
}
public function get_messages() {
return $this->messages;
}
public function set_objects_type($objects_type) {
$this->objects_type = $objects_type;
}
public function set_objects($objects) {
$this->objects = $objects;
}
public function set_applied_sort($applied_sort) {
$this->applied_sort = $applied_sort;
}
public function set_filters($filters) {
$this->filters = $filters;
}
public function set_messages($messages) {
$this->messages = $messages;
}
public static function unset_filters(){
if(isset($_SESSION['list_'.str_replace('list_', '', get_called_class()).'_filter'])) {
unset($_SESSION['list_'.str_replace('list_', '', get_called_class()).'_filter']);
}
}
}