Skip to content

Commit

Permalink
Merge branch 'develop' into dev_addrecursupinvoice
Browse files Browse the repository at this point in the history
  • Loading branch information
FHenry authored Sep 16, 2024
2 parents 251e4ff + b180beb commit 2fd663b
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 21 deletions.
13 changes: 8 additions & 5 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,18 @@ WARNING:
--------

The following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Ldap class methods connect_bind() & dump_content() have been renamed
* More class properties (with old name in french) are now deprecated in favor of the property name in english.
* If a filter is defined into and extrafields "Select from a table", this filter MUST use the Universai Search Filter syntax (field:=:value) instead of field=value.
See https://wiki.dolibarr.org/index.php?title=Universal_Search_Filter_Syntax
* The parameter $filter of methods fetchAll() does not accept array of SQL commands but must be a string of an Universal Search Filter syntax.
See https://wiki.dolibarr.org/index.php?title=Universal_Search_Filter_Syntax
* The use of 'customurl' into $filter has been removed. Must use the USF syntax.
* Some API HTTP return code were moved from 401 to 403 to better follow REST specification.
* More class properties (with old name in french) are now deprecated in favor of the property name in english.
* dolibarrtriggers class VERSION_XXX constants have been deprecated. Please use array dictionary VERSIONS['XXX'].
* Properties ->date_update and ->date_modification were merged into date_modification.
* All CLI tools (into /scripts) return a positive value to the shell if error (0 remains success) for a better
cross platform compatibility. On linux the exit(-1) was caught as 255, it may be now exit(1) so will be caught as 1.
* The parameter $filter of method fetchAll does not accept array of SQL but must be a string of an Universal Search Filter syntax.
* Remove use of customurl into $filter. Must use the USF syntax.
* Ldap class methods connect_bind() & dump_content() have been renamed
* Use of dol_eval with parameter $returnvalue=0 is deprecated.
* The signature for all ->delete() method has been modified to match the modulebuilder template (so first param is now always $user), except
the delete for thirdparty (still accept the id of thirdparty to delete as first parameter). Will probably be modified into another version.
Expand All @@ -314,7 +317,7 @@ The following changes may create regressions for some external modules, but were
* Removed trigger BILLREC_CREATEBILL. This trigger was not a CRUD event. If you used it, you can already use the trigger BILL_CREATE and
test that ($object->fac_rec > 0) to know if creation trigger is from a recurring invoice or not. Also this old trigger was never enabled
into table llx_c_action_trigger.
* Renamings in expedition line table and class, fk_origin_line is now fk_elementdet in table and class.
* Renaming into expedition line table and class: fk_origin_line is now fk_elementdet in table and class.
* The signature of method fetch() of class CompanyBankAccount has been modified to match the signature of method Account->fetch()


Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/propal/class/propal.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3442,7 +3442,7 @@ public function load_board($user, $mode)
$response->label = $label;
$response->labelShort = $labelShort;
$response->url = DOL_URL_ROOT.'/comm/propal/list.php?search_status='.$status.'&mainmenu=commercial&leftmenu=propals';
$response->url_late = DOL_URL_ROOT.'/comm/propal/list.php?search_status='.$status.'&mainmenu=commercial&leftmenu=propals&sortfield=p.datep&sortorder=asc';
$response->url_late = DOL_URL_ROOT.'/comm/propal/list.php?search_option=late&mainmenu=commercial&leftmenu=propals&sortfield=p.datep&sortorder=asc';
$response->img = img_object('', "propal");

// This assignment in condition is not a bug. It allows walking the results.
Expand Down
31 changes: 23 additions & 8 deletions htdocs/comm/propal/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* Copyright (C) 2021-2024 Frédéric France <[email protected]>
* Copyright (C) 2022 Josep Lluís Amador <[email protected]>
* Copyright (C) 2024 MDW <[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
Expand Down Expand Up @@ -146,6 +147,12 @@
$search_status = GETPOST('search_status', 'alpha');
$search_note_public = GETPOST('search_note_public', 'alpha');

$search_option = GETPOST('search_option', 'alpha');
if ($search_option == 'late') {
$search_status = '1';
$object_statut = '1';
}

// Pagination
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
Expand Down Expand Up @@ -257,11 +264,11 @@

// 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();
Expand Down Expand Up @@ -375,6 +382,7 @@
$search_date_delivery_start = '';
$search_date_delivery_end = '';
$search_availability = '';
$search_option = '';
$search_status = '';
$search_categ_cus = 0;
$search_fk_cond_reglement = '';
Expand Down Expand Up @@ -813,6 +821,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;
Expand Down Expand Up @@ -1716,10 +1727,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;

Expand All @@ -1733,6 +1745,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;
Expand Down
9 changes: 6 additions & 3 deletions htdocs/commande/class/commande.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
* Copyright (C) 2014-2015 Marcos García <[email protected]>
* Copyright (C) 2018 Nicolas ZABOURI <[email protected]>
* Copyright (C) 2016-2022 Ferran Marcet <[email protected]>
* Copyright (C) 2021-2024 Frédéric France <[email protected]>
* Copyright (C) 2022 Gauthier VERDOL <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2021-2024 Frédéric France <[email protected]>
* Copyright (C) 2022 Gauthier VERDOL <[email protected]>
* Copyright (C) 2024 MDW <[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
Expand Down Expand Up @@ -3632,10 +3633,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);
Expand Down
18 changes: 17 additions & 1 deletion htdocs/commande/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* Copyright (C) 2024 Noé Cendrier <[email protected]>
* Copyright (C) 2024 Benjamin Falière <[email protected]>
* Copyright (C) 2024 Alexandre Spangaro <[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
Expand Down Expand Up @@ -126,6 +127,11 @@
$search_fk_mode_reglement = GETPOST('search_fk_mode_reglement', 'intcomma');
$search_fk_input_reason = GETPOST('search_fk_input_reason', 'intcomma');

$search_option = GETPOST('search_option', 'alpha');
if ($search_option == 'late') {
$search_status = '-2';
}

$diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id;

// Load variable for pagination
Expand Down Expand Up @@ -316,6 +322,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')) {
Expand Down Expand Up @@ -653,6 +660,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);
}
Expand Down Expand Up @@ -950,7 +960,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)."'";
}
Expand Down Expand Up @@ -1240,6 +1252,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');
}
Expand Down Expand Up @@ -1541,6 +1556,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)) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/tpl/admin_extrafields_add.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function init_typeoffields(type)
</td><td>
<span id="helpselect" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?></span>
<span id="helpsellist" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?></span>
<span id="helpchkbxlst" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"), 1, 0, '', 0, 2, 'helpvalue3')?></span>
<span id="helpchkbxlst" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue3')?></span>
<span id="helplink" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelplink").'<br><br>'.$langs->trans("Examples").':<br>'.$listofexamplesforlink, 1, 0, '', 0, 2, 'helpvalue4')?></span>
<span id="helppassword" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?></span>
<span id="helpseparate" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpSeparator"), 1, 0, '', 0, 2, 'helpvalue6')?></span>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/tpl/admin_extrafields_edit.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ function init_typeoffields(type)
</td><td>
<span id="helpselect" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?></span>
<span id="helpsellist" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?></span>
<span id="helpchkbxlst" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"), 1, 0, '', 0, 2, 'helpvalue3')?></span>
<span id="helpchkbxlst" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue3')?></span>
<span id="helplink" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelplink").'<br><br>'.$langs->trans("Examples").':<br>'.$listofexamplesforlink, 1, 0, '', 0, 2, 'helpvalue4')?></span>
<span id="helppassword" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?></span>
<span id="helpseparate" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpSeparator"), 1, 0, '', 0, 2, 'helpvalue6')?></span>
Expand Down
1 change: 0 additions & 1 deletion htdocs/langs/en_US/admin.lang
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ ExtrafieldParamHelpselect=List of values must be lines with format key,value (wh
ExtrafieldParamHelpcheckbox=List of values must be lines with format key,value (where key can't be '0')<br><br> for example: <br>1,value1<br>2,value2<br>3,value3<br>...
ExtrafieldParamHelpradio=List of values must be lines with format key,value (where key can't be '0')<br><br> for example: <br>1,value1<br>2,value2<br>3,value3<br>...
ExtrafieldParamHelpsellist=List of values comes from a table<br>Syntax: table_name:label_field:id_field::filtersql<br>Example: c_typent:libelle:id::filtersql<br><br>- id_field is necessarily a primary int key<br>- filtersql is a condition. It must use the USF syntax. Example: (active:=:1) to display only active value<br>You can also use $ID$ in filter which is the current id of current object<br>If you want to filter on extrafields use syntax extra.fieldcode=... (where fieldcode is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list:<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
ExtrafieldParamHelpchkbxlst=List of values comes from a table<br>Syntax: table_name:label_field:id_field::filtersql<br>Example: c_typent:libelle:id::filtersql<br><br>filter can be a simple test (eg active=1 to display only active value)<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list:<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath<br>Syntax: ObjectName:Classpath
ExtrafieldParamHelpSeparator=Keep empty for a simple separator<br>Set this to 1 for a collapsing separator (open by default for new session, then status is kept for each user session)<br>Set this to 2 for a collapsing separator (collapsed by default for new session, then status is kept fore each user session)
LibraryToBuildPDF=Library used for PDF generation
Expand Down

0 comments on commit 2fd663b

Please sign in to comment.