string $module name of the module where the page is ['page_name'] => string $page_name the calling page ['page_title'] => string $page_title title of the pag to be displayed over the list ['bool_show_listletters'] => boolean $bool_show_listletters true : show list letters, search on the elements of the list by alphabetical filter ['bool_show_searchbox'] => boolean $bool_show_searchbox true : show search box, search on the elements of the list possible ['searchbox_autoCompletionArray'] => array $searchbox_autoCompletionArray array of autocompletion values in search box ['bool_view_document'] => boolean $bool_view_document boolean to view document or not ['bool_detail'] => boolean $bool_detail boolean to show the detail page link or not ['bool_sort'] => boolean $bool_sort boolean to show the order icons or not ['table_css'] => string $table_css css used in the list ['height'] => string $height height of the list ['bool_list_is_ajax'] => boolean $bool_list_is_ajax true if the list is generated using ajax ['div_list_ajax'] => string $div_list_ajax the name of the Div where the list is showed with ajax ['bool_legend'] => boolean $legend show the legend icon and tips ['legend_title'] => string $legend_title the title of the legend (in box legend)) ['legend'] => string $legend the legend ['what_search'] => string $what_search search expression ['nb_total'] => integer $nb_total total number of documents ['bool_check_form'] => boolean $bool_check_form true : add checkbox to select row (checkbox name : field[]) ['bool_radio_form'] => boolean $bool_radio_form true : add radio button to select row ['bool_button_form'] => boolean $bool_button_form true : add button to list ['name_form'] => string $name_form name of the form ['class_form'] => string $class_form class of the form ['method_form'] => string $method_form method of the select form ['action_form'] => string $action_form action of the select form ['disabled_form_field'] => string $disabled_form_field name of the database field used to disabled checkbox or radio input of the list ['disabled_form_rule'] => string rule to verify to disabled form element (must return boolean) Use generic @disabled_field parameter ['hidden_fields_form'] => string $hidden_fields_form hidden fields in the form ['actions_json_form'] => string $actions_json_form json action array in string format ['id_action'] => string $id_action id of the action ['do_action'] => boolean $do_action if action on list .False by default ['link_on_line'] => boolean $link_on_line if the click on the line open link. False by default ['link_on_line_destination'] => string $link_on_line_destination link to open, completed with the key of the current line($link_on_line_destination?id=key) ['actions_combo'] => array $actions_combo list of the elements of the actions combo list ) * @param array $actions Actions in the list ( ['href]' => string $href link for action ['tooltip]' => string $tooltip tooltip for actiontooltip ['class'] => string $class css style for action link ['icon'] => string $icon icon for action link ['label'] => string $label label of the link ['alert'] => boolean $alert If alert before action ['alert_text'] => string $alert_text text displayed in the alert box. Can use generic @alert_field parameter ['alert_field'] => string $alert_field field used in alert box ['disabled_field'] => string $field used in disabled rule ['disabled_rule'] => string $rule to desabled action link (must return boolean). Use generic @disabled_field parameter ) */ public function extended_list($result, $key, $parameters = array(), $actions=array() ) { //Default values if (!isset($parameters['bool_show_listletters'])){ $parameters['bool_show_listletters'] = false; } if (!isset($parameters['name_form'])){ $parameters['name_form']= 'list_form'; } if (!isset($parameters['method_form'])){ $parameters['method_form']= 'GET'; } if (!isset($parameters['class_form'])){ $parameters['class_form']= 'forms'; } if (!isset($parameters['bool_check_form'])){ $parameters['bool_check_form']= false; } if (!isset($parameters['bool_radio_form'])){ $parameters['bool_radio_form']= false; } if (!isset($parameters['bool_button_form'])){ $parameters['bool_button_form']= false; } if (!isset($parameters['$do_action'])){ $parameters['$do_action'] = false; } if (!isset($parameters['link_on_line'])){ $parameters['link_on_line']= false; } if (!isset($parameters['show_searchbox'])){ $parameters['show_searchbox']= false; } if (!isset($parameters['bool_add_button'])){ $parameters['bool_add_button']= false; } if (!isset($parameters['bool_view_document'])){ $parameters['bool_view_document']= false; } if (!isset($parameters['bool_detail'])){ $parameters['bool_detail']= false; } if (!isset($parameters['bool_sort'])){ $parameters['bool_sort']= false; } if (!isset($parameters['bool_legend'])){ $parameters['bool_legend']= false; } if (!isset($parameters['bool_page_in_module'])){ $parameters['bool_page_in_module']= false; } if (!isset($parameters['bool_list_is_ajax'])){ $parameters['bool_list_is_ajax']= false; } if (!isset($parameters['table_css'])){ $parameters['table_css'] = 'listing spec'; } if (!isset($parameters['actions_json_form'])){ $parameters['actions_json_form'] = '{}'; } if (!isset($parameters['div_list_ajax'])){ $parameters['div_list_ajax'] = ''; } if (!isset($parameters['bool_show_searchbox'])){ $parameters['bool_show_searchbox'] = true; } if (!isset($parameters['searchbox_autoCompletionArray'])){ $parameters['searchbox_autoCompletionArray'] = array(); } //$this->show_array($parameters); //show the document list in result of the search $link=""; $what = ""; $count_td = 0; //$listvalue = array(); $listcolumn = array(); $listshow = array(); $listformat = array(); $ordercol = array(); // put in tab the different label of the column for ($j=0;$jshow_array($listcolumn); //$this->show_array($listshow); //$this->show_array($ordercol); //$this->show_array($result); $func = new functions(); //Page page_name if (isset($parameters['page_name'])) { //If page is called in a module by index page if ($parameters['bool_page_in_module'] && isset($parameters['module'])) { $link = $_SESSION['config']['businessappurl'].'index.php?page='.$parameters['page_name']."&module=".$parameters['module'].$parameters['page_parameters']; } elseif(isset($parameters['module'])) //Else if page is called inside the module { //$link = $_SESSION['urltomodules'].$parameters['module']."/".$parameters['page_name'].".php?page=none".$parameters['page_parameters']; $link = $_SESSION['config']['businessappurl']."index.php?display=true&module=".$parameters['module']."&page=".$parameters['page_name']."&".$parameters['page_parameters']; } else //Default link (anchor) to prevent error in link if no page_name or module name { $link = "#"; } } else { $link = "#"; } //String searched in list if(isset($parameters['what_search'])) { $link.= '&search='.$parameters['what_search']; } //What to search in list if(isset($_REQUEST['what'])) { $link .= "&what=".strip_tags($_REQUEST['what']); $what = strip_tags($_REQUEST['what']); } //Start valu for list if(isset($_REQUEST['start']) && !empty($_REQUEST['start'])) { $start = strip_tags($_REQUEST['start']); } else { $start = 0; } //Order direction value if(isset($_GET['order'])) { $orderby = strip_tags($_GET['order']); } else { $orderby = 'asc'; } //Order database field value if(isset($_GET['order_field'])) { $orderfield = strip_tags($_GET['order_field']); } else { $orderfield = ''; } //Number of line to show in the list (config value) $nb_show = $_SESSION['config']['nblinetoshow']; if(isset($parameters['nb_total']) && is_int($parameters['nb_total'])) { $nb_total = $parameters['nb_total']; } else{ $nb_total = 0; } $nb_pages = ceil($nb_total/$nb_show); $end = $start + $nb_show; if($end > $nb_total) { $end = $nb_total; } // if they are more than 1 page we do pagination if($nb_pages > 1) { $next_start = 0; $page_dropdown_form = "
"; //If Ajax link, call javascript redirection function if($parameters['bool_list_is_ajax'] && !empty($parameters['div_list_ajax'])) { $page_dropdown_form .= _GO_TO_PAGE." "; } //Option content $lastpage = 0; for($i = 0;$i <> $nb_pages; $i++) { $the_line = $i + 1; if($start == $next_start) { $page_dropdown_form .= ""; } else { $page_dropdown_form .= ""; } $next_start = $next_start + $nb_show; $lastpage = $next_start; } $page_dropdown_form .= "
" ; $lastpage = $lastpage - $nb_show; $previous = " "; $next = ""; if($start > 0) { $start_prev = $start - $nb_show; //If Ajax link, call javascript redirection function if($parameters['bool_list_is_ajax'] && !empty($parameters['div_list_ajax'])) { $previous = "< "._PREVIOUS." "; } else //Put normal href link { $previous = "< "._PREVIOUS." "; } } if($start <> $lastpage) { $start_next = $start + $nb_show; //If Ajax link, call javascript redirection function if($parameters['bool_list_is_ajax'] && !empty($parameters['div_list_ajax'])) { $next = " "; } else //Put normal href link { $next = " "; } } $navigation_link = '
'.$previous."
".$page_dropdown_form."
".$next."
"; } //Page title if(isset($parameters['page_title'])) { echo ''.$parameters['page_title'].''; } //Listletter for alphabetical filter if($parameters['bool_show_listletters']) { //$this->extended_listletters($link, $parameters['bool_show_searchbox']); $this->extended_listletters($link, $parameters['bool_show_searchbox'], $parameters['searchbox_autoCompletionArray']); } //Navigation link echo $navigation_link; echo '
'; //$func->show_array($actions); $withForm = false; //c'est ici qu'il faut faire le test sur l'ensemble des paramètres qui ont besoin du formulaire if((isset($parameters['bool_check_form']) && $parameters['bool_check_form']) || (isset($parameters['bool_radio_form']) && $parameters['bool_radio_form']) || (isset($parameters['bool_button_form']) && $parameters['bool_button_form']) || (isset($parameters['id_action']) && $parameters['$do_action']) ) { $withForm = true; $formName = $parameters['name_form']; $formAction = $parameters['action_form']; $formMethod = $parameters['method_form']; $formClass = $parameters['class_form']; ?>
cellspacing="0" > >
   

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>
   
value="" />
value="" />
>show($this->extended_thisword($result[$theline][$count_column]['value'], $what)); ?> >show($this->extended_thisword($result[$theline][$count_column]['value'], $what)); ?> >show($this->extended_thisword($result[$theline][$count_column]['value'], $what)); ?> '; if($result[$theline][$value]['column'] == $actions[$i]['disabled_field']) { $disabled_field_value = addslashes($result[$theline][$value]['value']); break; } } //Disabled fields //if (!empty($disabled_field_value)) //{ $str_disabled_field = str_replace("@disabled_field", "'".$disabled_field_value."'", $actions[$i]['disabled_rule']); $rule = "return($str_disabled_field);"; //echo $str_disabled_field; if(eval($rule)) { $disabled_action = true; } //} } if (!$disabled_action) { //Init $href = $key_pos = $key_str = $key_len = $the_key = ''; //If you want to use different key for action link if (strpos($actions[$i]['href'], "@key") !== false) { $tab_key = array(); //Position of the @key string $key_pos = strpos($actions[$i]['href'], "@key"); //Extract part of the url after @key= to the end $key_str = substr($actions[$i]['href'], $key_pos + 5); //Length of the key $key_len = $key_pos + strpos($key_str, "$"); //The exact string key $the_key = substr($key_str, 0, strpos($key_str, "$")); $tab_key = explode(";", $the_key); $tab_subkey = array(); //Init $label = $val_key = $new_href =''; foreach ($tab_key as $value) { $tab_subkey = explode("|", $value); $label = $tab_subkey[0]; $val_key = $tab_subkey[1]; //Get the value foreach(array_keys($result[$theline]) as $value2) { if($result[$theline][$value2]['column'] == $val_key) { if($new_href == ''){ $new_href.= $label.'='.$result[$theline][$value2]['value']; } else{ $new_href.= '&'.$label.'='.$result[$theline][$value2]['value']; } } } } $href = substr_replace($actions[$i]['href'], $new_href, $key_pos, $key_len); //echo $href; exit; } else { $href = $actions[$i]['href']."&id=".$result[$theline][0][$key]; } //If open link in popup widow if(isset($actions[$i]['popup']) && $actions[$i]['popup'] === true) { //Init $popup_name = $popup_arguments = ''; if(isset($actions[$i]['popup_name'])) { $popup_name =$actions[$i]['popup_name']; } if(isset($actions[$i]['popup_arguments'])) { $popup_arguments = $actions[$i]['popup_arguments']; } ?> );" title="" onclick="return(confirm(''));" "; } if(isset($actions[$i]['label'])) { echo $actions[$i]['label']; } if(isset($actions[$i]['icon'])) { echo $actions[$i]['icon']; } ?>  

0) { ?> : onclick="javascript: " />

 <?php echo _LEGEND; ?>

3) { $ar_need = explode(" ", $need); for($i = 0; $i < count($ar_need); $i++) { $save_ar_need = ""; $pos = stripos($words, $ar_need[$i]); if($pos !== false) { $save_ar_need = substr($words, $pos, strlen($ar_need[$i])); } //$words = str_ireplace($ar_need[$i],"".$ar_need[$i]."",$words); $words = preg_replace("/(".$ar_need[$i].")/i","".$save_ar_need."",$words); } } } return $words; } /* * * show the alphabetical filter in list * * @param string $link url of the page where the function is used * @param boolean $show_searchbox to show the search input box * @param array $autoCompletionArray array of autocompletion values */ public function extended_listletters($link, $show_searchbox = true, $autoCompletionArray = array()) { //$link = preg_replace("&what=[A-Z]", "", $link); ?>
: -
0)) { ?>
show_array($actions); // Browses the actions array to build the jason string that will be used to display the actions in the list $param_list['actions_json_form'] = '{'; if(count($actions) > 0) { for($i=0; $i $actions[$i]['ID'], 'LABEL' => addslashes($actions[$i]['LABEL']))); } } $param_list['actions_json_form'] = preg_replace('/, $/', '}', $param_list['actions_json_form']); if($param_list['actions_json_form'] == '{') { $param_list['actions_json_form'] = '{}'; } } if(count($param_list['actions_combo']) > 0) { $param_list['action_form'] = $_SESSION['config']['businessappurl']."index.php?display=true&page=manage_action&module=core"; $param_list['bool_check_form'] = true; $param_list['method_form'] = 'get'; } if(!empty($_SESSION['current_basket']['default_action'])) { $param_list['do_action'] = true; } $list = new extended_list_show(); if(!isset( $param_list['link_in_line'])) { $param_list['link_in_line'] = false; } // Displays the list using list_doc method from class_list_shows* $this->extended_list($values, $key, $param_list, $action_buttons); // Displays the text line if needed if(count($values) > 0 && ($param_list['link_in_line'] || $param_list['do_action'] ) ) { echo "".$line_txt.""; } } public function extended_define_order($order, $field) { // configure the sql argument order by $orderby = ""; if(isset($field) && !empty($field) && (empty($order) || $order == 'asc' || $order == 'desc')) { $orderby = "order by ".$field." ".$order; } return $orderby; } } ?>