. */ /** * @brief Search result list * * @file list_results_invoices.php * @author Claire Figueras * @author Loïc Vinet * @date $date$ * @version $Revision$ * @ingroup indexing_searching_mlb */ require_once ("core" . DIRECTORY_SEPARATOR . "class" . DIRECTORY_SEPARATOR . "class_request.php"); require_once ("core" . DIRECTORY_SEPARATOR . "class" . DIRECTORY_SEPARATOR . "class_security.php"); require_once ("core" . DIRECTORY_SEPARATOR . "class" . DIRECTORY_SEPARATOR . "class_manage_status.php"); require_once ("apps" . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id'] . DIRECTORY_SEPARATOR . "class" . DIRECTORY_SEPARATOR . 'class_list_show.php'); require_once ("apps" . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id'] . DIRECTORY_SEPARATOR . "class" . DIRECTORY_SEPARATOR . 'class_contacts.php'); include_once ('apps' . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id'] . DIRECTORY_SEPARATOR . 'definition_mail_categories.php'); $status_obj = new manage_status(); $core_tools = new core_tools(); $core_tools->test_user(); $core_tools->load_lang(); $sec = new security(); $status_obj = new manage_status(); $contact = new contacts(); $mode = 'normal'; if (isset ($_REQUEST['mode']) && !empty ($_REQUEST['mode'])) { $mode = $core_tools->wash($_REQUEST['mode'], "alphanum", _MODE); } if ($mode == 'normal') { /****************Management of the location bar ************/ $init = false; if (isset ($_REQUEST['reinit']) && $_REQUEST['reinit'] == "true") { $init = true; } $level = ""; if (isset ($_REQUEST['level']) && ($_REQUEST['level'] == 2 || $_REQUEST['level'] == 3 || $_REQUEST['level'] == 4 || $_REQUEST['level'] == 1)) { $level = $_REQUEST['level']; } if (!isset($order)) { $order = ''; } if (!isset($field)) { $field = ''; } if (!isset($start)) { $start = ''; } $page_path = $_SESSION['config']['businessappurl'] . 'index.php?page=list_results_invoices&dir=indexing_searching&order=' . $order . '&order_field=' . $field . '&start=' . $start; $page_label = _RESULTS; $page_id = "search_adv_result_invoices"; $core_tools->manage_location_bar($page_path, $page_label, $page_id, $init, $level); /***********************************************************/ } elseif ($mode == 'popup' || $mode == 'frame') { $core_tools->load_html(); $core_tools->load_header('', true, false); $time = $core_tools->get_session_time_expire(); ?>
retrieve_view_from_coll_id($_SESSION['collection_id_choice']); $select = array (); //$select[$_SESSION['searching']['coll_view']]= array(); $select[$view] = array (); $where_request = $_SESSION['searching']['where_request']; array_push($select[$view], "res_id", "status", "doc_custom_t1", "doc_custom_t4", "doc_custom_t2", "doc_custom_t3", "doc_custom_t5", "title", "creation_date"); $status = $status_obj->get_not_searchable_status(); $status_str = ''; for ($i = 0; $i < count($status); $i++) { $status_str .= "'" . $status[$i]['ID'] . "',"; } $status_str = preg_replace('/,$/', '', $status_str); $where_request .= " status not in (" . $status_str . ") "; if (isset ($_SESSION['searching']['comp_query']) && trim($_SESSION['searching']['comp_query']) <> '') { $add_security = false; $where_clause = $sec->get_where_clause_from_coll_id($_SESSION['collection_id_choice']); if (trim($where_request) <> '') { $where_request = '(' . $where_request . ') and ((' . $where_clause . ') or (' . $_SESSION['searching']['comp_query'] . '))'; } else { $where_request = '(' . $where_clause . ' or ' . $_SESSION['searching']['comp_query'] . ')'; } } else { $add_security = true; } $where_request = str_replace(" ()", "(1=-1)", $where_request); $where_request = str_replace("and ()", "", $where_request); $list = new list_show(); $order = ''; if (isset ($_REQUEST['order']) && !empty ($_REQUEST['order'])) { $order = trim($_REQUEST['order']); } $field = ''; if (isset ($_REQUEST['order_field']) && !empty ($_REQUEST['order_field'])) { $field = trim($_REQUEST['order_field']); } $orderstr = $list->define_order($order, $field); if (isset($_REQUEST['template']) && (($_REQUEST['template'] == 'group_case') && ($core_tools->is_module_loaded('cases')))) { unset ($select); $select = array (); $select[$_SESSION['tablename']['cases']] = array (); $select[$view] = array (); array_push($select[$_SESSION['tablename']['cases']], "case_id", "case_label", "case_description", "case_typist", "case_creation_date"); $where = " " . $_SESSION['tablename']['cases'] . ".case_id = " . $view . ".case_id and "; $request = new request(); $tab = $request->select($select, $where . $where_request, $orderstr, $_SESSION['config']['databasetype'], "default", false, "", "", "", true, false, true); } else { $request = new request(); $tab = $request->select($select, $where_request, $orderstr, $_SESSION['config']['databasetype'], "default", false, "", "", "", $add_security); //$request->show(); } //$request->show(); //exit(); $_SESSION['error_page'] = ''; //Manage of template list //################### //Defines template allowed for this list $template_list = array (); array_push($template_list, array ( "name" => "search_adv", "img" => "extend_list.gif", "label" => _ACCESS_LIST_EXTEND )); if ($core_tools->is_module_loaded('cases')) { array_push($template_list, array ( "name" => "group_case", "img" => "case_list.gif", "label" => _ACCESS_LIST_CASE )); } if(!isset($_REQUEST['template'])) { $_REQUEST['template'] = false; } if (!$_REQUEST['template']) $template_to_use = $template_list[0]["name"]; if (isset ($_REQUEST['template']) && empty ($_REQUEST['template'])) $template_to_use = ''; if ($_REQUEST['template']) $template_to_use = $_REQUEST['template']; //For status icon $extension_icon = ''; if ($template_to_use <> '') $extension_icon = "_big"; //################### //######################### //build the tab with right format for list_doc function //$request->show_array($tab); if (count($tab) > 0) { //Specific View for group_case_template, we don' need to load the standard list_result_mlb //######################### if (($_REQUEST['template'] == 'group_case') && ($core_tools->is_module_loaded('cases'))) { include ("modules" . DIRECTORY_SEPARATOR . "cases" . DIRECTORY_SEPARATOR . 'mlb_list_group_case_addon.php'); } else { for ($i = 0; $i < count($tab); $i++) { for ($j = 0; $j < count($tab[$i]); $j++) { foreach (array_keys($tab[$i][$j]) as $value) { if ($tab[$i][$j][$value] == 'res_id') { $tab[$i][$j]['res_id'] = $tab[$i][$j]['value']; $tab[$i][$j]["label"] = _GED_NUM; $tab[$i][$j]["size"] = "4"; $tab[$i][$j]["label_align"] = "left"; $tab[$i][$j]["align"] = "center"; $tab[$i][$j]["valign"] = "bottom"; $tab[$i][$j]["show"] = true; $tab[$i][$j]["order"] = 'res_id'; $_SESSION['mlb_search_current_res_id'] = $tab[$i][$j]['value']; } if ($tab[$i][$j][$value] == "doc_custom_t1") { $tab[$i][$j]["label"] = _IDENTIFIER; $tab[$i][$j]['value'] = $request->show_string($tab[$i][$j]['value']); $tab[$i][$j]["size"] = "15"; $tab[$i][$j]["label_align"] = "left"; $tab[$i][$j]["align"] = "left"; $tab[$i][$j]["valign"] = "bottom"; $tab[$i][$j]["show"] = true; $tab[$i][$j]["order"] = "doc_custom_t1"; } if ($tab[$i][$j][$value] == "doc_custom_t2") { $tab[$i][$j]["label"] = _CONTACT_NAME; $tab[$i][$j]['value'] = $request->show_string($tab[$i][$j]['value']); $tab[$i][$j]["size"] = "15"; $tab[$i][$j]["label_align"] = "left"; $tab[$i][$j]["align"] = "left"; $tab[$i][$j]["valign"] = "bottom"; $tab[$i][$j]["show"] = true; $tab[$i][$j]["order"] = "doc_custom_t2"; } if ($tab[$i][$j][$value] == "doc_custom_t3") { $tab[$i][$j]["label"] = _COUNTRY; $tab[$i][$j]['value'] = $request->show_string($tab[$i][$j]['value']); $tab[$i][$j]["size"] = "15"; $tab[$i][$j]["label_align"] = "left"; $tab[$i][$j]["align"] = "left"; $tab[$i][$j]["valign"] = "bottom"; $tab[$i][$j]["show"] = true; $tab[$i][$j]["order"] = "doc_custom_t3"; } if ($tab[$i][$j][$value] == "doc_custom_t4") { $tab[$i][$j]["label"] = _CUSTOMER; $tab[$i][$j]['value'] = $request->show_string($tab[$i][$j]['value']); $tab[$i][$j]["size"] = "15"; $tab[$i][$j]["label_align"] = "left"; $tab[$i][$j]["align"] = "left"; $tab[$i][$j]["valign"] = "bottom"; $tab[$i][$j]["show"] = true; $tab[$i][$j]["order"] = "doc_custom_t4"; } if ($tab[$i][$j][$value] == "doc_custom_t5") { $tab[$i][$j]["label"] = _PO_NUMBER; $tab[$i][$j]['value'] = $tab[$i][$j]['value']; $tab[$i][$j]["size"] = "15"; $tab[$i][$j]["label_align"] = "left"; $tab[$i][$j]["align"] = "left"; $tab[$i][$j]["valign"] = "bottom"; $tab[$i][$j]["show"] = false; $tab[$i][$j]["order"] = "doc_custom_t5"; } if ($tab[$i][$j][$value] == "title") { $tab[$i][$j]["label"] = _TITLE; $tab[$i][$j]['value'] = $request->show_string($tab[$i][$j]['value']); $tab[$i][$j]["size"] = "15"; $tab[$i][$j]["label_align"] = "left"; $tab[$i][$j]["align"] = "left"; $tab[$i][$j]["valign"] = "bottom"; $tab[$i][$j]["show"] = true; $tab[$i][$j]["order"] = "title"; } if($tab[$i][$j][$value]=="creation_date") { $tab[$i][$j]["label"]=_REG_DATE; $tab[$i][$j]["size"]="10"; $tab[$i][$j]["label_align"]="left"; $tab[$i][$j]["align"]="left"; $tab[$i][$j]["valign"]="bottom"; $tab[$i][$j]["show"]=true; $tab[$i][$j]["value"] = $request->format_date_db($tab[$i][$j]['value'], false); $tab[$i][$j]["order"]="creation_date"; } if ($tab[$i][$j][$value] == "status") { $tab[$i][$j]["label"] = _STATUS; $res_status = $status_obj->get_status_data($tab[$i][$j]['value'], $extension_icon); $tab[$i][$j]['value'] = "" . $res_status["; $tab[$i][$j]["size"] = "5"; $tab[$i][$j]["label_align"] = "left"; $tab[$i][$j]["align"] = "left"; $tab[$i][$j]["valign"] = "bottom"; $tab[$i][$j]["show"] = true; $tab[$i][$j]["order"] = "status"; } } } } } if ($_REQUEST['template'] == "group_case") $found_type = _FOUND_CASE; else $found_type = _FOUND_DOC; ?>

" alt="" />

'; if (isset ($_REQUEST['modulename']) && !empty ($_REQUEST['modulename'])) { //$action = $_SESSION['urltomodules'].$_REQUEST['module'].'/'.$_REQUEST['action_form'].'.php'; $action = $_SESSION['config']['businessappurl'] . "index.php?display=true&page=" . $_REQUEST['action_form'] . "&module=" . $_REQUEST['modulename']; $hidden_fields .= ''; } else { //$action = $_SESSION['config']['businessappurl'].$_REQUEST['action_form'].'.php'; $action = $_SESSION['config']['businessappurl'] . "index.php?display=true&page=" . $_REQUEST['action_form']; } } if ($mode == 'popup') { $show_close = true; } else { $show_close = false; } if (isset ($_REQUEST['nodetails'])) { $show_details = false; } else { $show_details = true; } if ($mode == 'frame') { $export = false; $save_mode = false; $use_template = false; $special = true; //$name = $_SESSION['config']['businessappurl'].'indexing_searching/list_results_invoices'; $name = $_SESSION['config']['businessappurl'] . 'index.php?display=true&dir=indexing_searching&page=list_results_invoices'; } elseif ($mode == 'popup') { $export = false; $save_mode = false; $use_template = false; $special = true; $name = 'list_results_invoices&dir=indexing_searching&action_form=' . $_REQUEST['action_form'] . '&modulename=' . $_REQUEST['modulename']; $bool_radio_form = true; $method = 'get'; $button_label = _VALIDATE; $hidden_fields = ''; if (isset ($_REQUEST['modulename']) && !empty ($_REQUEST['modulename'])) { //$action = $_SESSION['urltomodules'].$_REQUEST['module'].'/'.$_REQUEST['action_form'].'.php'; $action = $_SESSION['config']['businessappurl'] . "index.php?display=true&page=" . $_REQUEST['action_form'] . "&module=" . $_REQUEST['modulename']; $hidden_fields .= ''; } else { //$action = $_SESSION['config']['businessappurl'].$_REQUEST['action_form'].'.php'; $action = $_SESSION['config']['businessappurl'] . "index.php?display=true&page=" . $_REQUEST['action_form']; } } else { $export = true; $save_mode = true; $special = false; $name = 'list_results_invoices&dir=indexing_searching'; $use_template = false; } $comp_link = '&mode=' . $mode; $list->list_doc($tab, $i, '', 'res_id', $name, 'res_id', 'details_invoices&dir=indexing_searching', true, $bool_radio_form, $method, $action, $button_label, $show_details, true, $special, $export, $show_close, false, true, false, '', '', false, '', '', 'listing spec', $comp_link, false, false, array (), $hidden_fields, '{}', false, '', true, array (), $use_template, $template_list, $template_to_use); ?>

' . _NO_RESULTS . '



' . _MAKE_NEW_SEARCH . '
'; ?>
' . _NO_RESULTS . '



' . _MAKE_NEW_SEARCH . '
'; ?> load_js(); } ?> '; echo ''; }