-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
69 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
* Copyright (C) 2021 Anthony Berton <[email protected]> | ||
* Copyright (C) 2021 Frédéric France <[email protected]> | ||
* Copyright (C) 2022 Josep Lluís Amador <[email protected]> | ||
* Copyright (C) 2024 William Mead <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -72,6 +73,7 @@ | |
$cancel = GETPOST('cancel', 'alpha'); | ||
$toselect = GETPOST('toselect', 'array'); | ||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'proposallist'; | ||
$optioncss = GETPOST('optioncss', 'alpha'); | ||
$mode = GETPOST('mode', 'alpha'); | ||
|
||
// Search Fields | ||
|
@@ -143,6 +145,12 @@ | |
$optioncss = GETPOST('optioncss', 'alpha'); | ||
$object_statut = GETPOST('search_statut', 'alpha'); | ||
|
||
$search_option = GETPOST('search_option', 'alpha'); | ||
if ($search_option == 'late') { | ||
$search_status = '1'; | ||
$object_statut = '1'; | ||
} | ||
|
||
// Pagination | ||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; | ||
$sortfield = GETPOST('sortfield', 'aZ09comma'); | ||
|
@@ -254,27 +262,27 @@ | |
|
||
// List of fields to search into when doing a "search in all" | ||
/*$fieldstosearchall = array(); | ||
foreach ($object->fields as $key => $val) { | ||
if (!empty($val['searchall'])) { | ||
$fieldstosearchall['t.'.$key] = $val['label']; | ||
} | ||
}*/ | ||
foreach ($object->fields as $key => $val) { | ||
if (!empty($val['searchall'])) { | ||
$fieldstosearchall['t.'.$key] = $val['label']; | ||
} | ||
}*/ | ||
|
||
// Definition of array of fields for columns | ||
/*$arrayfields = array(); | ||
foreach ($object->fields as $key => $val) { | ||
// If $val['visible']==0, then we never show the field | ||
if (!empty($val['visible'])) { | ||
$visible = (int) dol_eval($val['visible'], 1); | ||
$arrayfields['t.'.$key] = array( | ||
'label'=>$val['label'], | ||
'checked'=>(($visible < 0) ? 0 : 1), | ||
'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), | ||
'position'=>$val['position'], | ||
'help'=> isset($val['help']) ? $val['help'] : '' | ||
); | ||
} | ||
}*/ | ||
foreach ($object->fields as $key => $val) { | ||
// If $val['visible']==0, then we never show the field | ||
if (!empty($val['visible'])) { | ||
$visible = (int) dol_eval($val['visible'], 1); | ||
$arrayfields['t.'.$key] = array( | ||
'label'=>$val['label'], | ||
'checked'=>(($visible < 0) ? 0 : 1), | ||
'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), | ||
'position'=>$val['position'], | ||
'help'=> isset($val['help']) ? $val['help'] : '' | ||
); | ||
} | ||
}*/ | ||
|
||
if (!$user->hasRight('societe', 'client', 'voir')) { | ||
$search_sale = $user->id; | ||
|
@@ -372,6 +380,7 @@ | |
$search_date_delivery_start = ''; | ||
$search_date_delivery_end = ''; | ||
$search_availability = ''; | ||
$search_option = ''; | ||
$search_status = ''; | ||
$object_statut = ''; | ||
$search_categ_cus = 0; | ||
|
@@ -800,6 +809,9 @@ | |
} | ||
} | ||
} | ||
if ($search_option == 'late') { | ||
$sql .= " AND p.fin_validite < '".$db->idate(dol_now() - $conf->propal->cloture->warning_delay)."'"; | ||
} | ||
// Add where from extra fields | ||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; | ||
//print $sql; | ||
|
@@ -848,8 +860,8 @@ | |
exit; | ||
} | ||
|
||
$objectstatic = new Propal($db); | ||
$userstatic = new User($db); | ||
$objectstatic = new Propal($db); | ||
$userstatic = new User($db); | ||
|
||
if ($socid > 0) { | ||
$soc = new Societe($db); | ||
|
@@ -862,9 +874,9 @@ | |
$title = $langs->trans('Proposals'); | ||
} | ||
|
||
$num = $db->num_rows($resql); | ||
$num = $db->num_rows($resql); | ||
|
||
$arrayofselected = is_array($toselect) ? $toselect : array(); | ||
$arrayofselected = is_array($toselect) ? $toselect : array(); | ||
|
||
if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all) { | ||
$obj = $db->fetch_object($resql); | ||
|
@@ -875,10 +887,10 @@ | |
exit; | ||
} | ||
|
||
$help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'; | ||
llxHeader('', $title, $help_url); | ||
$help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'; | ||
llxHeader('', $title, $help_url); | ||
|
||
$param = '&search_status='.urlencode($search_status); | ||
$param = '&search_status='.urlencode($search_status); | ||
if (!empty($mode)) { | ||
$param .= '&mode='.urlencode($mode); | ||
} | ||
|
@@ -1531,27 +1543,27 @@ | |
$totalarray['nbfield']++; | ||
} | ||
if (!empty($arrayfields['country.code_iso']['checked'])) { | ||
print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'class="center"', $sortfield, $sortorder); | ||
print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'class="center"', $sortfield, $sortorder, 'center '); | ||
$totalarray['nbfield']++; | ||
} | ||
if (!empty($arrayfields['typent.code']['checked'])) { | ||
print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'class="center"', $sortfield, $sortorder); | ||
$totalarray['nbfield']++; | ||
} | ||
if (!empty($arrayfields['p.date']['checked'])) { | ||
print_liste_field_titre($arrayfields['p.date']['label'], $_SERVER["PHP_SELF"], 'p.datep', '', $param, 'class="center"', $sortfield, $sortorder); | ||
print_liste_field_titre($arrayfields['p.date']['label'], $_SERVER["PHP_SELF"], 'p.datep', '', $param, 'class="center"', $sortfield, $sortorder, 'center '); | ||
$totalarray['nbfield']++; | ||
} | ||
if (!empty($arrayfields['p.fin_validite']['checked'])) { | ||
print_liste_field_titre($arrayfields['p.fin_validite']['label'], $_SERVER["PHP_SELF"], 'dfv', '', $param, 'class="center"', $sortfield, $sortorder); | ||
print_liste_field_titre($arrayfields['p.fin_validite']['label'], $_SERVER["PHP_SELF"], 'dfv', '', $param, 'class="center"', $sortfield, $sortorder, 'center '); | ||
$totalarray['nbfield']++; | ||
} | ||
if (!empty($arrayfields['p.date_livraison']['checked'])) { | ||
print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'p.date_livraison', '', $param, 'class="center"', $sortfield, $sortorder); | ||
print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'p.date_livraison', '', $param, 'class="center"', $sortfield, $sortorder, 'center '); | ||
$totalarray['nbfield']++; | ||
} | ||
if (!empty($arrayfields['p.date_signature']['checked'])) { | ||
print_liste_field_titre($arrayfields['p.date_signature']['label'], $_SERVER["PHP_SELF"], 'p.date_signature', '', $param, 'class="center"', $sortfield, $sortorder); | ||
print_liste_field_titre($arrayfields['p.date_signature']['label'], $_SERVER["PHP_SELF"], 'p.date_signature', '', $param, 'class="center"', $sortfield, $sortorder, 'center '); | ||
$totalarray['nbfield']++; | ||
} | ||
if (!empty($arrayfields['ava.rowid']['checked'])) { | ||
|
@@ -1701,10 +1713,11 @@ | |
|| !empty($arrayfields['total_margin']['checked']) | ||
|| !empty($arrayfields['total_margin_rate']['checked']) | ||
|| !empty($arrayfields['total_mark_rate']['checked']) | ||
) | ||
) { | ||
$with_margin_info = true; | ||
) | ||
) { | ||
$with_margin_info = true; | ||
} | ||
|
||
$total_ht = 0; | ||
$total_margin = 0; | ||
|
||
|
@@ -1718,6 +1731,9 @@ | |
if (empty($obj)) { | ||
break; // Should not happen | ||
} | ||
if ($search_option) { | ||
$param .= "&search_option=".urlencode($search_option); | ||
} | ||
|
||
$objectstatic->id = $obj->rowid; | ||
$objectstatic->ref = $obj->ref; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
* Copyright (C) 2016-2022 Ferran Marcet <[email protected]> | ||
* Copyright (C) 2021-2023 Frédéric France <[email protected]> | ||
* Copyright (C) 2022 Gauthier VERDOL <[email protected]> | ||
* Copyright (C) 2024 William Mead <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -3604,10 +3605,12 @@ public function load_board($user, $mode) | |
} | ||
|
||
$response = new WorkboardResponse(); | ||
|
||
$response->warning_delay = $delay_warning; | ||
$response->label = $label; | ||
$response->labelShort = $labelShort; | ||
$response->url = $url; | ||
$response->url_late = DOL_URL_ROOT.'/commande/list.php?search_option=late&mainmenu=commercial&leftmenu=orders'; | ||
$response->img = img_object('', "order"); | ||
|
||
$generic_commande = new Commande($this->db); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
* Copyright (C) 2016-2023 Ferran Marcet <[email protected]> | ||
* Copyright (C) 2018-2023 Charlene Benke <[email protected]> | ||
* Copyright (C) 2021 Anthony Berton <[email protected]> | ||
* Copyright (C) 2024 William Mead <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -115,6 +116,10 @@ | |
$search_fk_shipping_method = GETPOST('search_fk_shipping_method', 'int'); | ||
$search_fk_mode_reglement = GETPOST('search_fk_mode_reglement', 'int'); | ||
$search_fk_input_reason = GETPOST('search_fk_input_reason', 'int'); | ||
$search_option = GETPOST('search_option', 'alpha'); | ||
if ($search_option == 'late') { | ||
$search_status = '-2'; | ||
} | ||
|
||
$diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id; | ||
|
||
|
@@ -294,6 +299,7 @@ | |
$search_fk_shipping_method = ''; | ||
$search_fk_mode_reglement = ''; | ||
$search_fk_input_reason = ''; | ||
$search_option = ''; | ||
} | ||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') | ||
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { | ||
|
@@ -609,6 +615,9 @@ | |
if ($search_status != '') { | ||
$param .= '&search_status='.urlencode($search_status); | ||
} | ||
if ($search_option) { | ||
$param .= "&search_option=".urlencode($search_option); | ||
} | ||
if ($search_orderday) { | ||
$param .= '&search_orderday='.urlencode($search_orderday); | ||
} | ||
|
@@ -899,7 +908,9 @@ | |
$sql .= ' AND (c.fk_statut IN (1,2,3))'; // validated, in process or closed | ||
} | ||
} | ||
|
||
if ($search_option == 'late') { | ||
$sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->commande->client->warning_delay)."'"; | ||
} | ||
if ($search_datecloture_start) { | ||
$sql .= " AND c.date_cloture >= '".$db->idate($search_datecloture_start)."'"; | ||
} | ||
|
@@ -1183,6 +1194,9 @@ | |
if ($search_status != '') { | ||
$param .= '&search_status='.urlencode($search_status); | ||
} | ||
if ($search_option) { | ||
$param .= "&search_option=".urlencode($search_option); | ||
} | ||
if ($search_datecloture_start) { | ||
$param .= '&search_datecloture_startday='.dol_print_date($search_datecloture_start, '%d').'&search_datecloture_startmonth='.dol_print_date($search_datecloture_start, '%m').'&search_datecloture_startyear='.dol_print_date($search_datecloture_start, '%Y'); | ||
} | ||
|
@@ -1481,6 +1495,7 @@ | |
$moreforfilter .= img_picto($tmptitle, 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', 1, 0, 0, $tmptitle, 0, 0, array(), 'maxwidth250 widthcentpercentminusx'); | ||
$moreforfilter .= '</div>'; | ||
} | ||
|
||
$parameters = array(); | ||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook | ||
if (empty($reshook)) { | ||
|