available_filters['main_fields']['type'] = 'dsi_bannette_type'; } protected function init_default_columns() { $this->columns = array(); $this->add_column_selection(); $this->add_column('name', 'dsi_ban_form_nom'); $this->add_column('send_last_date'); $this->add_column('number_records'); $this->add_column('number_subscribed'); } protected function _get_label_cell_header($name) { global $msg, $charset; switch ($name) { case 'dsi_ban_form_nom': return "".htmlentities($msg['dsi_ban_form_nom'],ENT_QUOTES, $charset)."
".htmlentities($msg['dsi_ban_form_com_public'],ENT_QUOTES, $charset); default: return "".parent::_get_label_cell_header($name).""; } } protected function get_cell_content($object, $property) { global $charset; $content = ''; switch($property) { case 'name': if ($object->proprio_bannette) { $nom_bannette = "".htmlentities($object->nom_bannette,ENT_QUOTES, $charset)."" ; } else { $nom_bannette = htmlentities($object->nom_bannette,ENT_QUOTES, $charset) ; } $content .= "".$nom_bannette."
(".htmlentities($object->comment_public,ENT_QUOTES, $charset).")"; break; case 'send_last_date': $content .= "".htmlentities($object->aff_date_last_envoi,ENT_QUOTES, $charset).""; if ($object->alert_diff) { $content .= "
(".htmlentities($object->aff_date_last_remplissage,ENT_QUOTES, $charset).")"; } else { $content .= "
(".htmlentities($object->aff_date_last_remplissage,ENT_QUOTES, $charset).")" ; } break; case 'number_records': $content .= "".$object->nb_notices.""; break; case 'number_subscribed': $content .= "".$object->nb_abonnes.""; break; default : $content .= parent::get_cell_content($object, $property); break; } return $content; } /** * Header de la liste */ public function get_display_header_list() { $display = " ".$this->_get_label_cell_header('dsi_ban_form_nom')." ".$this->_get_label_cell_header('dsi_ban_date_last_envoi')." ".$this->_get_label_cell_header('dsi_ban_nb_notices')." ".$this->_get_label_cell_header('dsi_ban_nb_abonnes')." "; return $display; } /** * Objet de la liste */ protected function get_display_content_object_list($object, $indice) { global $sub; $td_javascript=" onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='".($indice % 2 ? 'odd' : 'even')."'\" "; $display = " ".$this->get_cell_content($object, 'name')." ".$this->get_cell_content($object, 'send_last_date')." ".$this->get_cell_content($object, 'number_records')." ".$this->get_cell_content($object, 'number_subscribed')." "; return $display; } /** * Liste des objets */ public function get_display_content_list() { $display = ''; $id_check_list = ''; if(isset($this->applied_group[0]) && $this->applied_group[0]) { $grouped_objects = $this->get_grouped_objects(); foreach($grouped_objects as $group_label=>$objects) { $display .= " ".$group_label." "; foreach ($objects as $i=>$object) { $id_check="auto_".$object->id_bannette; if($id_check_list)$id_check_list.='|'; $id_check_list.=$id_check; $display .= $this->get_display_content_object_list($object, $i); } } } else { foreach ($this->objects as $i=>$object) { $id_check="auto_".$object->id_bannette; if($id_check_list)$id_check_list.='|'; $id_check_list.=$id_check; $display .= $this->get_display_content_object_list($object, $i); } } $display.=""; return $display; } protected function get_title() { global $msg; return "

".($this->filters['auto'] ?$msg['dsi_diff_ban_auto_found'] : $msg['dsi_diff_ban_manu_found'])."

"; } public function get_display_list() { global $msg; global $current_module; global $sub; $display = $this->get_title(); // Affichage du formulaire de recherche $display .= $this->get_display_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(); $display .= "

$msg[dsi_dif_act_ban_contenu]

"; //Affichage de la liste des objets $display .= ""; $display .= $this->get_display_header_list(); if(count($this->objects)) { $display .= $this->get_display_content_list(); } else { switch($sub) { case 'auto': $display .= $msg['dsi_no_ban_found']; break; case 'lancer': $display .= $msg['dsi_no_automatic_ban_found_ech']; break; } } $display .= "
"; $display .= $this->pager(); $display .= "
 
"; return $display; } protected function get_button_add() { return ""; } }