From b7c0594ab73a51a872806c33b7848fa2a87ecdcf Mon Sep 17 00:00:00 2001 From: Florian Date: Thu, 21 Oct 2021 23:28:58 +0200 Subject: [PATCH 01/40] FIX ISSUE DB_ERROR_SYNTAX-#18921 --- htdocs/ticket/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 6991516ede8..0d0e97336cd 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -391,7 +391,7 @@ foreach ($search as $key => $val) { continue; } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if ($search[$key] != '') { + if ($search[$key] != '' && !empty($val)) { $sql .= natural_search($key, $search[$key], $mode_search); } } @@ -609,9 +609,9 @@ if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } foreach ($search as $key => $val) { - if (is_array($search[$key]) && count($search[$key])) { - foreach ($search[$key] as $skey) { - $param .= '&search_'.$key.'[]='.urlencode($skey); + if (is_array($val) && count($val)) { + foreach ($val as $skey) { + $param .= (!empty($val)) ? '&search_'.$key.'[]='.urlencode($skey) : ""; } } else { $param .= '&search_'.$key.'='.urlencode($search[$key]); From 763cb29c0c3a845d48ec8fa3b794d5b3926f6ac6 Mon Sep 17 00:00:00 2001 From: Florian Date: Sun, 24 Oct 2021 00:26:28 +0200 Subject: [PATCH 02/40] Check that the value is not an array --- htdocs/ticket/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 0d0e97336cd..4caffd173c3 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -391,7 +391,7 @@ foreach ($search as $key => $val) { continue; } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if ($search[$key] != '' && !empty($val)) { + if ($search[$key] != '' && !is_array($val)) { $sql .= natural_search($key, $search[$key], $mode_search); } } From fc36849093a7dc1ac5880069d1fb0709ad5f9902 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Feb 2022 17:31:55 +0100 Subject: [PATCH 03/40] css --- htdocs/theme/eldy/global.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index e1532b338b6..147cd2fe8f9 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -259,7 +259,8 @@ input:invalid, select:invalid, input.--error , select.--error { section.setupsection { padding: 20px; - background-color: var(--colorbacktitle1); + /* background-color: var(--colorbacktitle1); */ + background-color: #f0f0f0; border-radius: 5px; } From 664860863ee4463327a146a9095f9fad5b9de5c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= Date: Thu, 10 Feb 2022 17:59:12 +0100 Subject: [PATCH 04/40] correct warehouse document location --- htdocs/product/stock/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 440e082e8ff..80be3c923ec 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -944,7 +944,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') { $delallowed = $usercancreate; $modulepart = 'stock'; - print $formfile->showdocuments($modulepart, $object->ref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, '', 0, '', $object->default_lang, '', $object); + print $formfile->showdocuments($modulepart, $objectref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, '', 0, '', $object->default_lang, '', $object); $somethingshown = $formfile->numoffiles; print '
'; From 30d7f807e49a553673d3053b16ae759963129a2e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Feb 2022 21:03:10 +0100 Subject: [PATCH 05/40] Fix url --- htdocs/comm/propal/card.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 746075ab51e..45a4d2fdb57 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2543,7 +2543,7 @@ if ($action == 'create') { if (($object->statut == Propal::STATUS_DRAFT && $object->total_ttc >= 0 && count($object->lines) > 0) || ($object->statut == Propal::STATUS_DRAFT && !empty($conf->global->PROPAL_ENABLE_NEGATIVE) && count($object->lines) > 0)) { if ($usercanvalidate) { - print ''.$langs->trans('Validate').''; + print ''.$langs->trans('Validate').''; } else { print ''.$langs->trans('Validate').''; } @@ -2555,7 +2555,7 @@ if ($action == 'create') { }*/ // Edit if ($object->statut == Propal::STATUS_VALIDATED && $usercancreate) { - print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Modify').''; } // ReOpen @@ -2578,7 +2578,7 @@ if ($action == 'create') { // Create a sale order if (!empty($conf->commande->enabled) && $object->statut == Propal::STATUS_SIGNED) { if ($usercancreateorder) { - print ''.$langs->trans("AddOrder").''; + print ''.$langs->trans("AddOrder").''; } } @@ -2586,7 +2586,7 @@ if ($action == 'create') { if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_PROPOSAL)) { if ($object->statut == Propal::STATUS_SIGNED && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled))) { if ($usercancreatepurchaseorder) { - print ''.$langs->trans("AddPurchaseOrder").''; + print ''.$langs->trans("AddPurchaseOrder").''; } } } @@ -2595,7 +2595,7 @@ if ($action == 'create') { if (!empty($conf->service->enabled) && !empty($conf->ficheinter->enabled) && $object->statut == Propal::STATUS_SIGNED) { if ($usercancreateintervention) { $langs->load("interventions"); - print ''.$langs->trans("AddIntervention").''; + print ''.$langs->trans("AddIntervention").''; } } @@ -2604,14 +2604,14 @@ if ($action == 'create') { $langs->load("contracts"); if ($usercancreatecontract) { - print ''.$langs->trans('AddContract').''; + print ''.$langs->trans('AddContract').''; } } // Create an invoice and classify billed if ($object->statut == Propal::STATUS_SIGNED && empty($conf->global->PROPOSAL_ARE_NOT_BILLABLE)) { if (!empty($conf->facture->enabled) && $usercancreateinvoice) { - print ''.$langs->trans("CreateBill").''; + print ''.$langs->trans("CreateBill").''; } $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); From 27df3cc02c39de48dfa9be5ac505f38696712cab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Feb 2022 11:20:36 +0100 Subject: [PATCH 06/40] FIX events on several days may missing the last day in calendar view. FIX the drag and drop was not available on some events --- htdocs/comm/action/index.php | 55 ++++++++++++++++++++++++------- htdocs/core/db/DoliDB.class.php | 4 +-- htdocs/core/js/dst.js | 3 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/tpl/login.tpl.php | 2 +- 5 files changed, 49 insertions(+), 17 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 4d6a032492f..72e50d9292d 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -808,8 +808,18 @@ if ($resql) { $event->id = $obj->id; $event->ref = $event->id; - $event->datep = $db->jdate($obj->datep); // datep and datef are GMT date. Example: 1970-01-01 01:00:00, jdate will return 0 if TZ of PHP server is Europe/Berlin - $event->datef = $db->jdate($obj->datep2); + $event->fulldayevent = $obj->fulldayevent; + + // event->datep and event->datef must be GMT date. + if ($event->fulldayevent) { + // TODO... + $event->datep = $db->jdate($obj->datep); + $event->datef = $db->jdate($obj->datep2); + } else { + // Example: $obj->datep = '1970-01-01 01:00:00', jdate will return 0 if TZ of PHP server is Europe/Berlin (+1) + $event->datep = $db->jdate($obj->datep); + $event->datef = $db->jdate($obj->datep2); + } //$event->datep_formated_gmt = dol_print_date($event->datep, 'dayhour', 'gmt'); //var_dump($obj->datep); //var_dump($event->datep); @@ -829,7 +839,6 @@ if ($resql) { $event->fetch_userassigned(); // This load $event->userassigned $event->priority = $obj->priority; - $event->fulldayevent = $obj->fulldayevent; $event->location = $obj->location; $event->transparency = $obj->transparency; $event->fk_element = $obj->fk_element; @@ -869,25 +878,43 @@ if ($resql) { $annee = dol_print_date($daycursor, '%Y', 'tzuserrel'); $mois = dol_print_date($daycursor, '%m', 'tzuserrel'); $jour = dol_print_date($daycursor, '%d', 'tzuserrel'); + + $daycursorend = $event->date_end_in_calendar; + $anneeend = dol_print_date($daycursorend, '%Y', 'tzuserrel'); + $moisend = dol_print_date($daycursorend, '%m', 'tzuserrel'); + $jourend = dol_print_date($daycursorend, '%d', 'tzuserrel'); + //var_dump(dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt')); // Hour at greenwich //var_dump($annee.'-'.$mois.'-'.$jour); + //print 'annee='.$annee.' mois='.$mois.' jour='.$jour.'
'; // Loop on each day covered by action to prepare an index to show on calendar $loop = true; $j = 0; - $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt'); + $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt'); // $mois, $jour, $annee has been set for user tz + $daykeyend = dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend, 'gmt'); // $moisend, $jourend, $anneeend has been set for user tz + /* + print 'GMT '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt').'
'; + print 'TZSERVER '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzserver').'
'; + print 'TZUSERREL '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel').'
'; + print 'GMT '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'gmt').'
'; + print 'TZSERVER '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzserver').'
'; + print 'TZUSER '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel').'
'; + */ do { //if ($event->id==408) - //print 'daykey='.$daykey.' '.dol_print_date($daykey, 'dayhour', 'gmt').' '.$event->datep.' '.$event->datef.'
'; + //print 'daykey='.$daykey.' daykeyend='.$daykeyend.' '.dol_print_date($daykey, 'dayhour', 'gmt').' - '.dol_print_date($event->datep, 'dayhour', 'gmt').' '.dol_print_date($event->datef, 'dayhour', 'gmt').'
'; + //print 'daykey='.$daykey.' daykeyend='.$daykeyend.' '.dol_print_date($daykey, 'dayhour', 'tzuserrel').' - '.dol_print_date($event->datep, 'dayhour', 'tzuserrel').' '.dol_print_date($event->datef, 'dayhour', 'tzuserrel').'
'; $eventarray[$daykey][] = $event; $j++; $daykey += 60 * 60 * 24; - if ($daykey > $event->date_end_in_calendar) { + //if ($daykey > $event->date_end_in_calendar) { + if ($daykey > $daykeyend) { $loop = false; } } while ($loop); - + //var_dump($eventarray); //print 'Event '.$i.' id='.$event->id.' (start='.dol_print_date($event->datep).'-end='.dol_print_date($event->datef); //print ' startincalendar='.dol_print_date($event->date_start_in_calendar).'-endincalendar='.dol_print_date($event->date_end_in_calendar).') was added in '.$j.' different index key of array
'; } @@ -1816,12 +1843,16 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $cssclass .= " unmovable"; } elseif ($event->type_code == 'ICALEVENT') { $cssclass .= " unmovable"; - } elseif ($event->date_end_in_calendar && date('Ymd', $event->date_start_in_calendar) != date('Ymd', $event->date_end_in_calendar)) { - $tmpyearend = date('Y', $event->date_end_in_calendar); - $tmpmonthend = date('m', $event->date_end_in_calendar); - $tmpdayend = date('d', $event->date_end_in_calendar); + } elseif ($event->date_start_in_calendar && $event->date_end_in_calendar && date('Ymd', $event->date_start_in_calendar) != date('Ymd', $event->date_end_in_calendar)) { + // If the event is on several days + $tmpyearend = dol_print_date($event->date_start_in_calendar, '%Y', 'tzuserrel'); + $tmpmonthend = dol_print_date($event->date_start_in_calendar, '%m', 'tzuserrel'); + $tmpdayend = dol_print_date($event->date_start_in_calendar, '%d', 'tzuserrel'); + //var_dump($tmpyearend.' '.$tmpmonthend.' '.$tmpdayend); if ($tmpyearend != $annee || $tmpmonthend != $mois || $tmpdayend != $jour) { - $cssclass .= " unmovable"; + $cssclass .= " unmovable unmovable-mustusefirstdaytodrag"; + } else { + $cssclass .= ' movable cursormove'; } } else { if ($user->rights->agenda->allactions->create || diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 4476228d509..f23a66bbee4 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -302,8 +302,8 @@ abstract class DoliDB implements Database /** * Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true) - * 19700101020000 -> 3600 with TZ+1 and gmt=0 - * 19700101020000 -> 7200 whaterver is TZ if gmt=1 + * 19700101020000 -> 3600 with server TZ = +1 and $gm='tzserver' + * 19700101020000 -> 7200 whaterver is server TZ if $gm='gmt' * * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) * @param mixed $gm 'gmt'=Input informations are GMT values, 'tzserver'=Local to server TZ diff --git a/htdocs/core/js/dst.js b/htdocs/core/js/dst.js index 83d4abd5f08..8433ada72a9 100644 --- a/htdocs/core/js/dst.js +++ b/htdocs/core/js/dst.js @@ -26,7 +26,8 @@ $(document).ready(function () { var timezone = jstz.determine(); - + console.log("Timezone detected for user: "+timezone.name()); + // Detect and save TZ and DST var rightNow = new Date(); var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d89fd437a2d..fc163933b47 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2560,11 +2560,11 @@ function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = 'auto', { global $conf; //print "- ".$hour.",".$minute.",".$second.",".$month.",".$day.",".$year.",".$_SERVER["WINDIR"]." -"; - //print 'gm:'.$gm.' gm==auto:'.($gm == 'auto').'
'; if ($gm === 'auto') { $gm = (empty($conf) ? 'tzserver' : $conf->tzuserinputkey); } + //print 'gm:'.$gm.' gm === auto:'.($gm === 'auto').'
';exit; // Clean parameters if ($hour == -1 || empty($hour)) { diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 338d2bd1a19..a4d38166112 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -127,7 +127,7 @@ $(document).ready(function () { - + From b84fd3ec3df42e8df698797431d03c173aa148c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Feb 2022 12:46:45 +0100 Subject: [PATCH 07/40] Clean code --- htdocs/admin/agenda_xcal.php | 9 ++++++++ htdocs/comm/action/class/actioncomm.class.php | 6 ++--- htdocs/core/lib/xcal.lib.php | 22 +++++++++---------- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 0166769660a..ce36d97d06a 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -164,6 +164,9 @@ $urlvcal .= $urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentit $message .= img_picto('', 'globe').' '.str_replace('{url}', $urlvcal, ''.$langs->trans("WebCalUrlForVCalExport", 'vcal', '').''); $message .= ''; $message .= ajax_autoselect('onlinepaymenturl1'); $message .= '
'; @@ -173,6 +176,9 @@ $urlical .= $urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event $message .= img_picto('', 'globe').' '.str_replace('{url}', $urlical, ''.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', '').''); $message .= ''; $message .= ajax_autoselect('onlinepaymenturl2'); $message .= '
'; @@ -182,6 +188,9 @@ $urlrss .= $urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity. $message .= img_picto('', 'globe').' '.str_replace('{url}', $urlrss, ''.$langs->trans("WebCalUrlForVCalExport", 'rss', '').''); $message .= ''; $message .= ajax_autoselect('onlinepaymenturl3'); $message .= '
'; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 8dd0d9febbe..1e640f7afbe 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1952,14 +1952,14 @@ class ActionComm extends CommonObject $event = array(); $event['uid'] = 'dolibarragenda-'.$this->db->database_name.'-'.$obj->id."@".$_SERVER["SERVER_NAME"]; $event['type'] = $type; + $datestart = $this->db->jdate($obj->datep) - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600)); // fix for -> Warning: A non-numeric value encountered if (is_numeric($this->db->jdate($obj->datep2))) { - $dateend = $this->db->jdate($obj->datep2) - - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600)); + $dateend = $this->db->jdate($obj->datep2) - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600)); } else { - // use start date as fall-back to avoid import erros on empty end date + // use start date as fall-back to avoid pb with empty end date on ICS readers $dateend = $datestart; } diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index fcd1660985b..74b5f711da9 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -100,6 +100,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) $created = $event["created"]; $modified = $event["modified"]; $assignedUsers = $event["assignedUsers"]; + //print $fulldayevent.' '.dol_print_date($startdate, 'dayhour', 'gmt'); // Format $summary = format_cal($format, $summary); @@ -191,16 +192,16 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) // Date must be GMT dates // Current date - fwrite($calfileh, "DTSTAMP:".dol_print_date($now, "dayhourxcard", true)."\n"); + fwrite($calfileh, "DTSTAMP:".dol_print_date($now, "dayhourxcard", 'gmt')."\n"); // Start date $prefix = ""; - $startdatef = dol_print_date($startdate, "dayhourxcard", true); + $startdatef = dol_print_date($startdate, "dayhourxcard", 'gmt'); if ($fulldayevent) { // Local time $prefix = ";VALUE=DATE"; - $startdatef = dol_print_date($startdate, "dayxcard", false); + $startdatef = dol_print_date($startdate, "dayxcard", 'gmt'); } fwrite($calfileh, "DTSTART".$prefix.":".$startdatef."\n"); @@ -208,7 +209,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) // End date if ($fulldayevent) { if (empty($enddate)) { - $enddate = dol_time_plus_duree($startdate, 1, "d"); + $enddate = dol_time_plus_duree($startdate, 1, "d"); // We add 1 day needed for full day event (DTEND must be next day after event) } } else { if (empty($enddate)) { @@ -217,14 +218,11 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) } $prefix = ""; - $enddatef = dol_print_date($enddate, "dayhourxcard", true); + $enddatef = dol_print_date($enddate, "dayhourxcard", 'gmt'); if ($fulldayevent) { $prefix = ";VALUE=DATE"; - $enddatef = dol_print_date($enddate + 1, "dayxcard", false); - - // Local time - //$enddatef .= dol_print_date($enddate+1,"dayhourxcard",false); + $enddatef = dol_print_date($enddate + 1, "dayxcard", 'gmt'); // We add 1 second so we reach the +1 day needed for full day event (DTEND must be next day after event) } fwrite($calfileh, "DTEND".$prefix.":".$enddatef."\n"); @@ -256,11 +254,11 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) } if ($created) { - fwrite($calfileh, "CREATED:".dol_print_date($created, "dayhourxcard", true)."\n"); + fwrite($calfileh, "CREATED:".dol_print_date($created, "dayhourxcard", 'gmt')."\n"); } if ($modified) { - fwrite($calfileh, "LAST-MODIFIED:".dol_print_date($modified, "dayhourxcard", true)."\n"); + fwrite($calfileh, "LAST-MODIFIED:".dol_print_date($modified, "dayhourxcard", 'gmt')."\n"); } fwrite($calfileh, "SUMMARY:".$encoding.$summary."\n"); @@ -270,7 +268,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) fwrite($calfileh, "LOCATION:".$location."\n"); fwrite($calfileh, "TRANSP:OPAQUE\n"); fwrite($calfileh, "CLASS:CONFIDENTIAL\n"); - fwrite($calfileh, "DTSTAMP:".dol_print_date($startdatef, "dayhourxcard", true)."\n"); + fwrite($calfileh, "DTSTAMP:".dol_print_date($startdatef, "dayhourxcard", 'gmt')."\n"); fwrite($calfileh, "END:VJOURNAL\n"); } From 32af067e1e48bd94d5aaff32d1254cde44567213 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Feb 2022 13:01:29 +0100 Subject: [PATCH 08/40] Code comment --- htdocs/core/lib/xcal.lib.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 74b5f711da9..97ada3e3d4f 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -209,7 +209,10 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) // End date if ($fulldayevent) { if (empty($enddate)) { - $enddate = dol_time_plus_duree($startdate, 1, "d"); // We add 1 day needed for full day event (DTEND must be next day after event) + // We add 1 day needed for full day event (DTEND must be next day after event). + // This is mention in https://datatracker.ietf.org/doc/html/rfc5545: + // "The "DTEND" property for a "VEVENT" calendar component specifies the non-inclusive end of the event." + $enddate = dol_time_plus_duree($startdate, 1, "d"); } } else { if (empty($enddate)) { @@ -222,7 +225,10 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) if ($fulldayevent) { $prefix = ";VALUE=DATE"; - $enddatef = dol_print_date($enddate + 1, "dayxcard", 'gmt'); // We add 1 second so we reach the +1 day needed for full day event (DTEND must be next day after event) + // We add 1 second so we reach the +1 day needed for full day event (DTEND must be next day after event) + // This is mention in https://datatracker.ietf.org/doc/html/rfc5545: + // "The "DTEND" property for a "VEVENT" calendar component specifies the non-inclusive end of the event." + $enddatef = dol_print_date($enddate + 1, "dayxcard", 'gmt'); } fwrite($calfileh, "DTEND".$prefix.":".$enddatef."\n"); From 89ffe5baba701eecdc592e67f96935768faefdc9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Feb 2022 14:07:10 +0100 Subject: [PATCH 09/40] Clean code for param of dol_stringtotime() --- htdocs/core/lib/date.lib.php | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index d4028e2196b..237adc9447a 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -357,18 +357,18 @@ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $exclu * Convert a string date into a GM Timestamps date * Warning: YYYY-MM-DDTHH:MM:SS+02:00 (RFC3339) is not supported. If parameter gm is 1, we will use no TZ, if not we will use TZ of server, not the one inside string. * - * @param string $string Date in a string - * YYYYMMDD - * YYYYMMDDHHMMSS - * YYYYMMDDTHHMMSSZ - * YYYY-MM-DDTHH:MM:SSZ (RFC3339) - * DD/MM/YY or DD/MM/YYYY (deprecated) - * DD/MM/YY HH:MM:SS or DD/MM/YYYY HH:MM:SS (deprecated) - * @param int $gm 1 =Input date is GM date, - * 0 =Input date is local date using PHP server timezone - * @return int Date as a timestamp - * 19700101020000 -> 7200 with gm=1 - * 19700101000000 -> 0 with gm=1 + * @param string $string Date in a string + * YYYYMMDD + * YYYYMMDDHHMMSS + * YYYYMMDDTHHMMSSZ + * YYYY-MM-DDTHH:MM:SSZ (RFC3339) + * DD/MM/YY or DD/MM/YYYY (deprecated) + * DD/MM/YY HH:MM:SS or DD/MM/YYYY HH:MM:SS (deprecated) + * @param int|string $gm 'gmt' or 1 =Input date is GM date, + * 'tzserver' or 0 =Input date is date using PHP server timezone + * @return int Date as a timestamp + * 19700101020000 -> 7200 with gm=1 + * 19700101000000 -> 0 with gm=1 * * @see dol_print_date(), dol_mktime(), dol_getdate() */ @@ -408,7 +408,14 @@ function dol_stringtotime($string, $gm = 1) $string = preg_replace('/([^0-9])/i', '', $string); $tmp = $string.'000000'; - $date = dol_mktime(substr($tmp, 8, 2), substr($tmp, 10, 2), substr($tmp, 12, 2), substr($tmp, 4, 2), substr($tmp, 6, 2), substr($tmp, 0, 4), ($gm ? 1 : 0)); + // Clean $gm + if ($gm === 1) { + $gm = 'gmt'; + } elseif (empty($gm) || $gm === 'tzserver') { + $gm = 'tzserver'; + } + + $date = dol_mktime(substr($tmp, 8, 2), substr($tmp, 10, 2), substr($tmp, 12, 2), substr($tmp, 4, 2), substr($tmp, 6, 2), substr($tmp, 0, 4), $gm); return $date; } From 271e9da425bfa0b4c0d731339d12b3dd1b60ac72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Feb 2022 15:15:50 +0100 Subject: [PATCH 10/40] Add option MAIN_STORE_FULL_EVENT_IN_GMT to fix TZ pb with full day event --- htdocs/comm/action/card.php | 65 ++++++++++++++++++---------- htdocs/comm/action/document.php | 6 ++- htdocs/comm/action/index.php | 17 ++++---- htdocs/comm/action/list.php | 16 +++++-- htdocs/resource/element_resource.php | 6 ++- 5 files changed, 73 insertions(+), 37 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 627c2f0ce51..4a00894d26b 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -76,11 +76,14 @@ if ($complete == 'na' || $complete == -2) { } if ($fulldayevent) { - $datep = dol_mktime('00', '00', 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int')); - $datef = dol_mktime('23', '59', '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int')); + $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); + // For "full day" events, we must store date in GMT (It must be viewed as same moment everywhere) + $datep = dol_mktime('00', '00', 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $datef = dol_mktime('23', '59', '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); + //print $db->idate($datep); exit; } else { - $datep = dol_mktime($aphour, $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int')); - $datef = dol_mktime($p2hour, $p2min, '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int')); + $datep = dol_mktime($aphour, $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuserrel'); + $datef = dol_mktime($p2hour, $p2min, '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuserrel'); } // Security check @@ -252,8 +255,15 @@ if (empty($reshook) && $action == 'add') { $percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status // Clean parameters - $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser'); - $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser'); + if ($fulldayevent) { + $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); + // For "full day" events, we must store date in GMT (It must be viewed as same moment everywhere) + $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuser'); + $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), $tzforfullday ? $tzforfullday : 'tzuser'); + } else { + $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser'); + $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser'); + } // Check parameters if (!$datef && $percentage == 100) { @@ -513,8 +523,16 @@ if (empty($reshook) && $action == 'update') { $object->fetch_userassigned(); $object->oldcopy = clone $object; - $datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser'); - $datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser'); + // Clean parameters + if ($fulldayevent) { + $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); + // For "full day" events, we must store date in GMT (It must be viewed as same moment everywhere) + $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuser'); + $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), $tzforfullday ? $tzforfullday : 'tzuser'); + } else { + $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser'); + $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser'); + } $object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm'); $object->label = GETPOST("label", "alphanohtml"); @@ -1005,11 +1023,11 @@ if ($action == 'create') { $datep = ($datep ? $datep : (is_null($object->datep) ? '' : $object->datep)); if (GETPOST('datep', 'int', 1)) { - $datep = dol_stringtotime(GETPOST('datep', 'int', 1), 0); + $datep = dol_stringtotime(GETPOST('datep', 'int', 1), 'tzuser'); } $datef = ($datef ? $datef : $object->datef); if (GETPOST('datef', 'int', 1)) { - $datef = dol_stringtotime(GETPOST('datef', 'int', 1), 0); + $datef = dol_stringtotime(GETPOST('datef', 'int', 1), 'tzuser'); } if (empty($datef) && !empty($datep)) { if (GETPOST("actioncode", 'aZ09') == 'AC_RDV' || empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT)) { @@ -1024,16 +1042,16 @@ if ($action == 'create') { print ''.$langs->trans("DateActionEnd").''; print ''; if (GETPOST("afaire") == 1) { - print $form->selectDate($datep, 'ap', 1, 1, 0, "action", 1, 2, 0, 'fulldaystart'); // Empty value not allowed for start date and hours if "todo" + print $form->selectDate($datep, 'ap', 1, 1, 0, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); // Empty value not allowed for start date and hours if "todo" } else { - print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 2, 0, 'fulldaystart'); + print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); } print '     -     '; //print ' - '; if (GETPOST("afaire") == 1) { - print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend'); + print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel'); } else { - print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend'); + print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel'); } print ''; @@ -1518,20 +1536,21 @@ if ($id > 0) { // Date start - end print ''.$langs->trans("DateActionStart").' - '.$langs->trans("DateActionEnd").''; + $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); if (GETPOST("afaire") == 1) { - print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuser'); + print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser'); } elseif (GETPOST("afaire") == 2) { - print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuser'); + print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser'); } else { - print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuser'); + print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser'); } print ' - '; if (GETPOST("afaire") == 1) { - print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuser'); + print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser'); } elseif (GETPOST("afaire") == 2) { - print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuser'); + print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser'); } else { - print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuser'); + print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser'); } print ''; @@ -1972,7 +1991,8 @@ if ($id > 0) { if (empty($object->fulldayevent)) { print dol_print_date($object->datep, 'dayhour', 'tzuser'); } else { - print dol_print_date($object->datep, 'day', 'tzuser'); + $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); + print dol_print_date($object->datep, 'day', ($tzforfullday ? $tzforfullday : 'tzuser')); } if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) { print img_warning($langs->trans("Late")); @@ -1985,7 +2005,8 @@ if ($id > 0) { if (empty($object->fulldayevent)) { print dol_print_date($object->datef, 'dayhour', 'tzuser'); } else { - print dol_print_date($object->datef, 'day', 'tzuser'); + $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); + print dol_print_date($object->datef, 'day', ($tzforfullday ? $tzforfullday : 'tzuser')); } if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now - $delay_warning)) { print img_warning($langs->trans("Late")); diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index c69d396cf26..3de00e9cb6f 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -201,7 +201,8 @@ if ($object->id > 0) { if (empty($object->fulldayevent)) { print dol_print_date($object->datep, 'dayhour', 'tzuser'); } else { - print dol_print_date($object->datep, 'day', 'tzuser'); + $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); + print dol_print_date($object->datep, 'day', ($tzforfullday ? $tzforfullday : 'tzuser')); } if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) { print img_warning($langs->trans("Late")); @@ -214,7 +215,8 @@ if ($object->id > 0) { if (empty($object->fulldayevent)) { print dol_print_date($object->datef, 'dayhour', 'tzuser'); } else { - print dol_print_date($object->datef, 'day', 'tzuser'); + $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); + print dol_print_date($object->datef, 'day', ($tzforfullday ? $tzforfullday : 'tzuser')); } if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now - $delay_warning)) { print img_warning($langs->trans("Late")); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 72e50d9292d..81df122f1a9 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -545,7 +545,8 @@ if ($user->rights->agenda->myactions->create || $user->rights->agenda->allaction $newparam .= '&month='.((int) $month).'&year='.((int) $tmpforcreatebutton['year']).'&mode='.urlencode($mode); //$param='month='.$monthshown.'&year='.$year; - $hourminsec = '100000'; + $hourminsec = dol_print_date(dol_mktime(10, 0, 0, 1, 1, 1970, 'gmt'), '%H', 'gmt').'0000'; // Set $hourminsec to '100000' to auto set hour to 10:00 at creation + $newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''))); } @@ -812,17 +813,17 @@ if ($resql) { // event->datep and event->datef must be GMT date. if ($event->fulldayevent) { - // TODO... - $event->datep = $db->jdate($obj->datep); - $event->datef = $db->jdate($obj->datep2); + $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); + $event->datep = $db->jdate($obj->datep, $tzforfullday ? 'tzuser' : 'tzserver'); // If saved in $tzforfullday = gmt, we must invert date to be in user tz + $event->datef = $db->jdate($obj->datep2, $tzforfullday ? 'tzuser' : 'tzserver'); } else { // Example: $obj->datep = '1970-01-01 01:00:00', jdate will return 0 if TZ of PHP server is Europe/Berlin (+1) - $event->datep = $db->jdate($obj->datep); - $event->datef = $db->jdate($obj->datep2); + $event->datep = $db->jdate($obj->datep, 'tzserver'); + $event->datef = $db->jdate($obj->datep2, 'tzserver'); } //$event->datep_formated_gmt = dol_print_date($event->datep, 'dayhour', 'gmt'); - //var_dump($obj->datep); - //var_dump($event->datep); + //var_dump($obj->id.' '.$obj->datep.' '.dol_print_date($obj->datep, 'dayhour', 'gmt')); + //var_dump($obj->id.' '.$event->datep.' '.dol_print_date($event->datep, 'dayhour', 'gmt')); $event->type_code = $obj->type_code; $event->type_label = $obj->type_label; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index de961b5517e..e2b412e15db 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -693,7 +693,7 @@ $tmpforcreatebutton = dol_getdate(dol_now(), true); $newparam = '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; //$param='month='.$monthshown.'&year='.$year; -$hourminsec = '100000'; +$hourminsec = dol_print_date(dol_mktime(10, 0, 0, 1, 1, 1970, 'gmt'), '%H', 'gmt').'0000'; // Set $hourminsec to '100000' to auto set hour to 10:00 at creation $url = DOL_URL_ROOT.'/comm/action/card.php?action=create'; $url .= '&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec; @@ -953,7 +953,12 @@ while ($i < min($num, $limit)) { // Start date if (!empty($arrayfields['a.datep']['checked'])) { print ''; - print dol_print_date($db->jdate($obj->dp), $formatToUse, 'tzuser'); + if (empty($obj->fulldayevent)) { + print dol_print_date($db->jdate($obj->dp), $formatToUse, 'tzuser'); + } else { + $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); + print dol_print_date($db->jdate($obj->dp), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuser')); + } $late = 0; if ($actionstatic->hasDelay() && $actionstatic->percentage >= 0 && $actionstatic->percentage < 100 ) { $late = 1; @@ -967,7 +972,12 @@ while ($i < min($num, $limit)) { // End date if (!empty($arrayfields['a.datep2']['checked'])) { print ''; - print dol_print_date($db->jdate($obj->dp2), $formatToUse, 'tzuser'); + if (empty($obj->fulldayevent)) { + print dol_print_date($db->jdate($obj->dp2), $formatToUse, 'tzuser'); + } else { + $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); + print dol_print_date($db->jdate($obj->dp2), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuser')); + } print ''; } diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index d0ca6416390..068dba8c50a 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -383,7 +383,8 @@ if (!$ret) { if (empty($act->fulldayevent)) { print dol_print_date($act->datep, 'dayhour', 'tzuser'); } else { - print dol_print_date($act->datep, 'day', 'tzuser'); + $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); + print dol_print_date($act->datep, 'day', ($tzforfullday ? $tzforfullday : 'tzuser')); } if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) { print img_warning($langs->trans("Late")); @@ -396,7 +397,8 @@ if (!$ret) { if (empty($act->fulldayevent)) { print dol_print_date($act->datef, 'dayhour', 'tzuser'); } else { - print dol_print_date($act->datef, 'day', 'tzuser'); + $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); + print dol_print_date($act->datef, 'day', ($tzforfullday ? $tzforfullday : 'tzuser')); } if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now - $delay_warning)) { print img_warning($langs->trans("Late")); From b623b88674a6dab395d3397e467b3084ccfd0542 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Feb 2022 18:06:39 +0100 Subject: [PATCH 11/40] css --- htdocs/admin/confexped.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index b218a245c99..c2ca271e5ea 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -107,7 +107,7 @@ print ''.$langs->trans("SendingsAbility").''; print ''; print ''; print ''; -print $langs->trans("Required"); +print ''.img_picto($langs->trans("Required"), 'switch_on').''; /*if (empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { print ''.img_picto($langs->trans("Disabled"),'switch_off').''; From eff2fc1e9ef9a409022145f146e1128e4c4ad14f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Feb 2022 18:19:50 +0100 Subject: [PATCH 12/40] Complete option MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1e3e878dad5..692cf35c3b1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1106,13 +1106,13 @@ class Form } print '
'; $parameters = array(); From cafdcb72065092a4e6aef0949c492b1bbfed3d9a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 13 Feb 2022 16:13:38 +0100 Subject: [PATCH 15/40] Show translation value --- htdocs/admin/translation.php | 114 ++++++++++++++++++++--------------- 1 file changed, 67 insertions(+), 47 deletions(-) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 93f62337746..bb42808ebd4 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -254,6 +254,60 @@ $head = translation_prepare_head(); print dol_get_fiche_head($head, $mode, '', -1, ''); + +$langcode = GETPOSTISSET('langcode') ? GETPOST('langcode') : $langs->defaultlang; + +$newlang = new Translate('', $conf); +$newlang->setDefaultLang($langcode); + +$langsenfileonly = new Translate('', $conf); +$langsenfileonly->setDefaultLang('en_US'); + +$newlangfileonly = new Translate('', $conf); +$newlangfileonly->setDefaultLang($langcode); + +$recordtoshow = array(); + +// Search modules dirs +$modulesdir = dolGetModulesDirs(); + +$nbtotaloffiles = 0; + +// Search into dir of modules (the $modulesdir is already a list that loop on $conf->file->dol_document_root) +$i = 0; +foreach ($modulesdir as $keydir => $tmpsearchdir) { + $searchdir = $tmpsearchdir; // $searchdir can be '.../htdocs/core/modules/' or '.../htdocs/custom/mymodule/core/modules/' + + // Directory of translation files + $dir_lang = dirname(dirname($searchdir))."/langs/".$langcode; // The 2 dirname is to go up in dir for 2 levels + $dir_lang_osencoded = dol_osencode($dir_lang); + + $filearray = dol_dir_list($dir_lang_osencoded, 'files', 0, '', '', $sortfield, (strtolower($sortorder) == 'asc' ?SORT_ASC:SORT_DESC), 1); + foreach ($filearray as $file) { + $tmpfile = preg_replace('/.lang/i', '', basename($file['name'])); + $moduledirname = (basename(dirname(dirname($dir_lang)))); + + $langkey = $tmpfile; + if ($i > 0) { + $langkey .= '@'.$moduledirname; + } + //var_dump($i.' - '.$keydir.' - '.$dir_lang_osencoded.' -> '.$moduledirname . ' / ' . $tmpfile.' -> '.$langkey); + + $result = $newlang->load($langkey, 0, 0, '', 0); // Load translation files + database overwrite + $result = $newlangfileonly->load($langkey, 0, 0, '', 1); // Load translation files only + if ($result < 0) { + print 'Failed to load language file '.$tmpfile.'
'."\n"; + } else { + $nbtotaloffiles++; + } + //print 'After loading lang '.$langkey.', newlang has '.count($newlang->tab_translate).' records
'."\n"; + + $result = $langsenfileonly->load($langkey, 0, 0, '', 1); // Load translation files only + } + $i++; +} + + if ($mode == 'overwrite') { print ''; @@ -348,7 +402,14 @@ if ($mode == 'overwrite') { if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int')) { print ''; } else { + //print $obj->transkey.' '.$langsenfileonly->tab_translate[$obj->transkey]; + $titleforvalue = $langs->trans("Translation").' en_US for key '.$obj->transkey.':
'.($langsenfileonly->tab_translate[$obj->transkey] ? $langsenfileonly->trans($obj->transkey) : ''.$langs->trans("None").''); + /*if ($obj->lang != 'en_US') { + $titleforvalue .= '
'.$langs->trans("Translation").' '.$obj->lang.' '...; + }*/ + print ''; print dol_escape_htmltag($obj->transvalue); + print ''; } print ''; @@ -376,20 +437,6 @@ if ($mode == 'overwrite') { } if ($mode == 'searchkey') { - $langcode = GETPOSTISSET('langcode') ? GETPOST('langcode') : $langs->defaultlang; - - $newlang = new Translate('', $conf); - $newlang->setDefaultLang($langcode); - - $newlangfileonly = new Translate('', $conf); - $newlangfileonly->setDefaultLang($langcode); - - $recordtoshow = array(); - - // Search modules dirs - $modulesdir = dolGetModulesDirs(); - - $nbtotaloffiles = 0; $nbempty = 0; /*var_dump($langcode); var_dump($transkey); @@ -403,41 +450,10 @@ if ($mode == 'searchkey') { if (empty($transvalue)) { $nbempty++; } + if ($action == 'search' && ($nbempty > 999)) { // 999 to disable this setEventMessages($langs->trans("WarningAtLeastKeyOrTranslationRequired"), null, 'warnings'); } else { - // Search into dir of modules (the $modulesdir is already a list that loop on $conf->file->dol_document_root) - $i = 0; - foreach ($modulesdir as $keydir => $tmpsearchdir) { - $searchdir = $tmpsearchdir; // $searchdir can be '.../htdocs/core/modules/' or '.../htdocs/custom/mymodule/core/modules/' - - // Directory of translation files - $dir_lang = dirname(dirname($searchdir))."/langs/".$langcode; // The 2 dirname is to go up in dir for 2 levels - $dir_lang_osencoded = dol_osencode($dir_lang); - - $filearray = dol_dir_list($dir_lang_osencoded, 'files', 0, '', '', $sortfield, (strtolower($sortorder) == 'asc' ?SORT_ASC:SORT_DESC), 1); - foreach ($filearray as $file) { - $tmpfile = preg_replace('/.lang/i', '', basename($file['name'])); - $moduledirname = (basename(dirname(dirname($dir_lang)))); - - $langkey = $tmpfile; - if ($i > 0) { - $langkey .= '@'.$moduledirname; - } - //var_dump($i.' - '.$keydir.' - '.$dir_lang_osencoded.' -> '.$moduledirname . ' / ' . $tmpfile.' -> '.$langkey); - - $result = $newlang->load($langkey, 0, 0, '', 0); // Load translation files + database overwrite - $result = $newlangfileonly->load($langkey, 0, 0, '', 1); // Load translation files only - if ($result < 0) { - print 'Failed to load language file '.$tmpfile.'
'."\n"; - } else { - $nbtotaloffiles++; - } - //print 'After loading lang '.$langkey.', newlang has '.count($newlang->tab_translate).' records
'."\n"; - } - $i++; - } - // Now search into translation array foreach ($newlang->tab_translate as $key => $val) { if ($transkey && !preg_match('/'.preg_quote($transkey, '/').'/i', $key)) { @@ -532,8 +548,12 @@ if ($mode == 'searchkey') { break; } print ''.$langcode.''.$key.''; + $titleforvalue = $langs->trans("Translation").' en_US for key '.$key.':
'.($langsenfileonly->tab_translate[$key] ? $langsenfileonly->trans($key) : ''.$langs->trans("None").''); + print ''; print dol_escape_htmltag($val); - print ''; + print ''; + print ''; + print ''; if (!empty($newlangfileonly->tab_translate[$key])) { if ($val != $newlangfileonly->tab_translate[$key]) { // retrieve rowid From 1097111706fda094e6ee4adffb7f9cb509245d0a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 13 Feb 2022 16:37:08 +0100 Subject: [PATCH 16/40] Fix autofocus --- htdocs/admin/accountant.php | 2 +- htdocs/admin/openinghours.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index e0e01cab328..693170862e9 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -119,7 +119,7 @@ print ''.$langs-> // Name print ''; -print 'global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'>'."\n"; +print 'global->MAIN_INFO_ACCOUNTANT_NAME) ? ' autofocus="autofocus"' : '').'>'."\n"; // Address print ''; diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php index a0f02fe99ac..b18ebd0c05f 100644 --- a/htdocs/admin/openinghours.php +++ b/htdocs/admin/openinghours.php @@ -97,7 +97,7 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit') { print ''; print $form->textwithpicto($langs->trans("Monday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print 'global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'>'."\n"; + print 'global->MAIN_INFO_OPENINGHOURS_MONDAY) ? ' autofocus="autofocus"' : '').'>'."\n"; print ''; print $form->textwithpicto($langs->trans("Tuesday"), $langs->trans("OpeningHoursFormatDesc")); From d5e5e8d4363c0fb7bcfbaaac134e5ee098cc0f11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 13 Feb 2022 16:49:41 +0100 Subject: [PATCH 17/40] Debug v15 --- htdocs/admin/delais.php | 20 ++++++++++--------- htdocs/admin/pdf.php | 2 +- htdocs/admin/pdf_other.php | 2 +- htdocs/core/boxes/box_members_by_type.php | 1 + .../box_members_subscriptions_by_year.php | 1 + htdocs/langs/en_US/admin.lang | 5 +++-- htdocs/langs/en_US/boxes.lang | 2 +- htdocs/theme/eldy/global.inc.php | 1 + htdocs/theme/md/style.css.php | 4 ++++ 9 files changed, 24 insertions(+), 14 deletions(-) diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 229fb3e2291..2ae77b03d07 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -222,7 +222,8 @@ if ($action == 'edit') { print ''; print ''; - print ''; + print ''; + print ''; foreach ($modules as $module => $delays) { if (!empty($conf->$module->enabled)) { @@ -230,7 +231,7 @@ if ($action == 'edit') { $value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']}:0); print ''; print ''; - print ''; } } @@ -242,10 +243,10 @@ if ($action == 'edit') { // Show if meteo is enabled print '
'.$langs->trans("DelaysOfToleranceBeforeWarning").''.$langs->trans("Value").'
'.$langs->trans("DelaysOfToleranceBeforeWarning").''.$langs->trans("LateWarningAfter").'
'.img_object('', $delay['img']).''.$langs->trans('Delays_'.$delay['code']).''; + print ''.$langs->trans('Delays_'.$delay['code']).''; print ' '.$langs->trans("days").'
'; - print ''; + print ''; print ''; - print ''; @@ -256,7 +257,7 @@ if ($action == 'edit') { */ print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Option").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_METEO").''; + print ''.$langs->trans("MAIN_DISABLE_METEO").''; print $form->selectarray('MAIN_DISABLE_METEO', $labelmeteo, (empty($conf->global->MAIN_DISABLE_METEO) ? 0 : $conf->global->MAIN_DISABLE_METEO)); print '
'; - print ''; + print ''; foreach ($modules as $module => $delays) { if (!empty($conf->$module->enabled)) { @@ -276,7 +277,7 @@ if ($action == 'edit') { // Show if meteo is enabled print '
'.$langs->trans("DelaysOfToleranceBeforeWarning").''.$langs->trans("Value").'
'.$langs->trans("DelaysOfToleranceBeforeWarning").''.$langs->trans("Value").'
'; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; @@ -665,7 +665,7 @@ if ($result) { print ''; // VAT Num - print ''; + print ''; // Found accounts print ''; - print ''; + print ''; + print ''; // Found accounts print ''; - print ''; + print ''; print ''; // VAT Num - print ''; + print ''; // Found accounts print ''; - print ''; print ''; // VAT Num - print ''; + print ''; // Found accounts print ''; + $cursormonth = $j; + if ($cursormonth > 12) { + $cursormonth -= 12; + } + $cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y; + $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt'); + + print ''; } print ''; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 893f448bbf8..a44c819aa78 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -294,7 +294,7 @@ Balancing=Balancing FicheVentilation=Binding card GeneralLedgerIsWritten=Transactions are written in the Ledger GeneralLedgerSomeRecordWasNotRecorded=Some of the transactions could not be journalized. If there is no other error message, this is probably because they were already journalized. -NoNewRecordSaved=No more record to journalize +NoNewRecordSaved=No more record to transfer ListOfProductsWithoutAccountingAccount=List of products not bound to any accounting account ChangeBinding=Change the binding Accounted=Accounted in ledger From 9173eec8acb186c8683025307730fc1ea58922bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 14 Feb 2022 23:02:43 +0100 Subject: [PATCH 26/40] Fix input lost --- htdocs/product/fournisseurs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 98ab414a8c3..3bf563c82f7 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -612,7 +612,7 @@ if ($id > 0 || $ref) { $default_vat = $object->tva_tx; } } - $vattosuggest = (GETPOST("tva_tx") ?vatrate(GETPOST("tva_tx")) : ($default_vat != '' ?vatrate($default_vat) : '')); + $vattosuggest = (GETPOSTISSET("tva_tx") ? vatrate(GETPOST("tva_tx")) : ($default_vat != '' ?vatrate($default_vat) : '')); $vattosuggest = preg_replace('/\s*\(.*\)$/', '', $vattosuggest); print ''; print ''; From 0e664cc9694bd75af03641d148101e0d6ac011d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 15 Feb 2022 11:12:08 +0100 Subject: [PATCH 27/40] Fix API call from ajax --- htdocs/api/index.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/htdocs/api/index.php b/htdocs/api/index.php index d19754f9c35..869dacc5cc0 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -55,12 +55,27 @@ if (!empty($_SERVER['HTTP_DOLAPIENTITY'])) { define("DOLENTITY", (int) $_SERVER['HTTP_DOLAPIENTITY']); } +// Response for preflight requests (used by browser when into a CORS context) +if (!empty($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'OPTIONS' && !empty($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) { + header('Access-Control-Allow-Origin: *'); + header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE'); + header('Access-Control-Allow-Headers: Content-Type, Authorization, api_key, DOLAPIKEY'); + http_response_code(204); + exit; +} + // When we request url to get the json file, we accept Cross site so we can include the descriptor into an external tool. if (preg_match('/\/explorer\/swagger\.json/', $_SERVER["PHP_SELF"])) { header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE'); header('Access-Control-Allow-Headers: Content-Type, Authorization, api_key, DOLAPIKEY'); } +// When we request url to get an API, we accept Cross site so we can make js API call inside another website +if (preg_match('/\/api\/index\.php/', $_SERVER["PHP_SELF"])) { + header('Access-Control-Allow-Origin: *'); + header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE'); + header('Access-Control-Allow-Headers: Content-Type, Authorization, api_key, DOLAPIKEY'); +} $res = 0; if (!$res && file_exists("../main.inc.php")) { @@ -304,7 +319,7 @@ if (!empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' && foreach ($listofendpoints as $endpointrule) { $tmparray = explode(':', $endpointrule); - if ($classfile == $tmparray[0] && $tmparray[1] == 1) { + if (($classfile == $tmparray[0] || $classfile.'api' == $tmparray[0]) && $tmparray[1] == 1) { $endpointisallowed = true; break; } From 82b3d89923f1a78605dad5e83b32eda66670808b Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Tue, 15 Feb 2022 11:31:09 +0100 Subject: [PATCH 28/40] FIX wieght is loose if it's comma on combinations --- htdocs/variants/combinations.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 933d379e48a..0b08bd00758 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -235,7 +235,7 @@ if (($action == 'add' || $action == 'create') && empty($massaction) && !GETPOST( exit(); } - $prodcomb->variation_weight = $weight_impact; + $prodcomb->variation_weight = price2num($weight_impact); // for conf PRODUIT_MULTIPRICES if ($conf->global->PRODUIT_MULTIPRICES) { From 95c0e72956ef241d18d131b87205a05593c55aee Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Tue, 15 Feb 2022 11:37:24 +0100 Subject: [PATCH 29/40] Fix barcode viewimage regression on yogosha8628 --- htdocs/viewimage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index dee62999cf4..7f34bdb6a18 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -230,7 +230,7 @@ $original_file = str_replace('..\\', '/', $original_file); $refname = basename(dirname($original_file)."/"); // Check that file is allowed for view with viewimage.php -if (!dolIsAllowedForPreview($original_file)) { +if (!empty($original_file) && !dolIsAllowedForPreview($original_file)) { accessforbidden('This file is not qualified for preview', 0, 0, 1); } From 8b0280a9d2e656549f4164d3b857b515b4956f33 Mon Sep 17 00:00:00 2001 From: Alexis LAURIER Date: Wed, 16 Feb 2022 10:26:44 +0100 Subject: [PATCH 30/40] add missing entity check on list of withdraws on index of paymentbybanktransfert --- htdocs/compta/paymentbybanktransfer/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index 78425398017..1cb47d1c1dc 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -182,6 +182,7 @@ $limit = 5; $sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " WHERE p.type = 'bank-transfer'"; +$sql .= " AND p.entity IN (".getEntity('invoice').")"; $sql .= " ORDER BY datec DESC"; $sql .= $db->plimit($limit); From ff8dcdc4b7436d3ea206f471ab27aa9224462a67 Mon Sep 17 00:00:00 2001 From: Alexis LAURIER Date: Wed, 16 Feb 2022 10:52:20 +0100 Subject: [PATCH 31/40] manage details of prelevment line for bank transfer --- htdocs/compta/prelevement/line.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index ccb60486c76..3e3ecb8e0ba 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -268,12 +268,20 @@ if ($id) $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf"; - $sql .= " , ".MAIN_DB_PREFIX."facture as f"; + if ($type == 'bank-transfer') { + $sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f"; + } else { + $sql .= " , ".MAIN_DB_PREFIX."facture as f"; + } $sql .= " , ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE pf.fk_prelevement_lignes = pl.rowid"; $sql .= " AND pl.fk_prelevement_bons = p.rowid"; $sql .= " AND f.fk_soc = s.rowid"; - $sql .= " AND pf.fk_facture = f.rowid"; + if ($type == 'bank-transfer') { + $sql .= " AND pf.fk_facture_fourn = f.rowid"; + } else { + $sql .= " AND pf.fk_facture = f.rowid"; + } $sql .= " AND f.entity IN (".getEntity('invoice').")"; $sql .= " AND pl.rowid=".$id; if ($socid) $sql .= " AND s.rowid = ".$socid; From 98c50f531ce0e34e3b08cd467c8a9dcbc5ad1a24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= Date: Wed, 16 Feb 2022 15:57:39 +0100 Subject: [PATCH 32/40] translation string instead of error message text --- htdocs/langs/en_US/productbatch.lang | 2 ++ htdocs/langs/fr_FR/productbatch.lang | 1 + htdocs/product/stock/class/mouvementstock.class.php | 6 ++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index 763af20c6b4..a4215a1d7d4 100644 --- a/htdocs/langs/en_US/productbatch.lang +++ b/htdocs/langs/en_US/productbatch.lang @@ -41,3 +41,5 @@ QCFrequency=Quality control frequency (in days) #Traceability - qc status OutOfOrder=Out of order InWorkingOrder=In working order + +CantMoveNonExistantSerial=Error. You ask a move on a record for a serial that does not exists anymore. May be you take the same serial on same warehouse several times in same shipment or it was used by another shipment. Remove this shipment and prepare another one. diff --git a/htdocs/langs/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang index 40c8b0be477..e0a0749e927 100644 --- a/htdocs/langs/fr_FR/productbatch.lang +++ b/htdocs/langs/fr_FR/productbatch.lang @@ -42,3 +42,4 @@ HideLots=Masquer les lots #Traceability - qc status OutOfOrder=Hors d'usage InWorkingOrder=En état de marche +CantMoveNonExistantSerial=Erreur : Vous avez demandé un mouvement sur un numéro de série qui n’existe plus. Peut-être avez-vous requis le même numéro de série plusieurs fois dans une même expédition, ou il a déjà servi dans une autre expédition. Supprimez cette expédition et préparez-en une autre. diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 8a66e535ca2..4976530eb5e 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -842,7 +842,9 @@ class MouvementStock extends CommonObject */ private function createBatch($dluo, $qty) { - global $user; + global $user, $langs; + + $langs->load('productbatch'); $pdluo = new Productbatch($this->db); @@ -853,7 +855,7 @@ class MouvementStock extends CommonObject $result = $pdluo->fetch($dluo); if (empty($pdluo->id)) { // We didn't find the line. May be it was deleted before by a previous move in same transaction. - $this->error = 'Error. You ask a move on a record for a serial that does not exists anymore. May be you take the same serial on same warehouse several times in same shipment or it was used by another shipment. Remove this shipment and prepare another one.'; + $this->error = $langs->trans('CantMoveNonExistantSerial'); $this->errors[] = $this->error; $result = -2; } From 038298a638f88200d11688b1624cf987b5005de8 Mon Sep 17 00:00:00 2001 From: Atm-Gregr Date: Wed, 16 Feb 2022 16:10:48 +0100 Subject: [PATCH 33/40] change button and add title --- htdocs/hrm/job_agenda.php | 13 ++++--------- htdocs/langs/fr_FR/hrm.lang | 1 + 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index 6bfafcc1269..0685ccdba9a 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -189,18 +189,13 @@ if ($object->id > 0) { } - print '
'; - if (!empty($conf->agenda->enabled)) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { - print ''.$langs->trans("AddAction").''; - } else { - print ''.$langs->trans("AddAction").''; - } + $newcardbutton = ''; + $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); + } } - print '
'; - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $param = '&id='.$object->id.'&socid='.$socid; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { @@ -211,7 +206,7 @@ if ($object->id > 0) { } - //print load_fiche_titre($langs->trans("ActionsOnJob"), '', ''); + print load_fiche_titre($langs->trans("ActionsOnJob"), $newcardbutton, ''); // List of all actions $filters = array(); diff --git a/htdocs/langs/fr_FR/hrm.lang b/htdocs/langs/fr_FR/hrm.lang index d47596fe95e..cab3c7c11af 100644 --- a/htdocs/langs/fr_FR/hrm.lang +++ b/htdocs/langs/fr_FR/hrm.lang @@ -79,3 +79,4 @@ NoEval=Aucune évaluation effectuée pour cet employé HowManyUserWithThisMaxNote=Nombre d'employés avec ce niveau HighestRank=Plus haut niveau SkillComparison=Comparaison des compétences +ActionsOnJob=Événements sur cet emploi \ No newline at end of file From 1f2659d4114e6c715aa6ec0450c482bf77f5319d Mon Sep 17 00:00:00 2001 From: Atm-Gregr Date: Wed, 16 Feb 2022 16:26:57 +0100 Subject: [PATCH 34/40] insert precommit --- htdocs/hrm/job_agenda.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index 0685ccdba9a..08da46fadf8 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -217,6 +217,6 @@ if ($object->id > 0) { } } -// End of page +//End of page llxFooter(); $db->close(); From 5f09ac61b2df1ac06111affeb5406ff79ae831ef Mon Sep 17 00:00:00 2001 From: Atm-Gregr Date: Wed, 16 Feb 2022 16:27:47 +0100 Subject: [PATCH 35/40] insert precommit1 --- htdocs/hrm/job_agenda.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index 08da46fadf8..0685ccdba9a 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -217,6 +217,6 @@ if ($object->id > 0) { } } -//End of page +// End of page llxFooter(); $db->close(); From 7ed6ca6ec629cea1e545d1cffb81c119a63753a0 Mon Sep 17 00:00:00 2001 From: Florian Date: Thu, 21 Oct 2021 23:28:58 +0200 Subject: [PATCH 36/40] FIX ISSUE DB_ERROR_SYNTAX-#18921 --- htdocs/ticket/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 6991516ede8..0d0e97336cd 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -391,7 +391,7 @@ foreach ($search as $key => $val) { continue; } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if ($search[$key] != '') { + if ($search[$key] != '' && !empty($val)) { $sql .= natural_search($key, $search[$key], $mode_search); } } @@ -609,9 +609,9 @@ if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } foreach ($search as $key => $val) { - if (is_array($search[$key]) && count($search[$key])) { - foreach ($search[$key] as $skey) { - $param .= '&search_'.$key.'[]='.urlencode($skey); + if (is_array($val) && count($val)) { + foreach ($val as $skey) { + $param .= (!empty($val)) ? '&search_'.$key.'[]='.urlencode($skey) : ""; } } else { $param .= '&search_'.$key.'='.urlencode($search[$key]); From aa2a57ff95404990a6494ed2f185352c91140030 Mon Sep 17 00:00:00 2001 From: Florian Date: Sun, 24 Oct 2021 00:26:28 +0200 Subject: [PATCH 37/40] Check that the value is not an array --- htdocs/ticket/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 0d0e97336cd..4caffd173c3 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -391,7 +391,7 @@ foreach ($search as $key => $val) { continue; } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if ($search[$key] != '' && !empty($val)) { + if ($search[$key] != '' && !is_array($val)) { $sql .= natural_search($key, $search[$key], $mode_search); } } From 1ede8a30b2bc708caf3f1289cd3796b87d1cbf24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 16 Feb 2022 17:49:05 +0100 Subject: [PATCH 38/40] Missing NOSESSION --- htdocs/modulebuilder/template/myobject_card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 180ece04fa8..bacb2f988dc 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -42,6 +42,7 @@ //if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies //if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET //if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification +//if (! defined('NOSESSION')) define('NOSESSION', '1'); // Disable session // Load Dolibarr environment $res = 0; From 690a91d54666dcb1c7a99a224039b2c60e034af8 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Mon, 14 Feb 2022 18:07:18 +0100 Subject: [PATCH 39/40] NEW automatically set totally received status in reception --- htdocs/reception/class/reception.class.php | 97 +++++++++++++++++++++- 1 file changed, 93 insertions(+), 4 deletions(-) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 382cc5be9b6..7efcb2360dc 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -635,11 +635,15 @@ class Reception extends CommonObject } } - // Change status of order to "reception in process" - $ret = $this->setStatut(4, $this->origin_id, 'commande_fournisseur'); - - if (!$ret) { + // Change status of order to "reception in process" or "totally received" + $status = $this->getStatusDispatch(); + if ($status < 0) { $error++; + } else { + $ret = $this->setStatut($status, $this->origin_id, 'commande_fournisseur'); + if (!$ret) { + $error++; + } } if (!$error && !$notrigger) { @@ -707,7 +711,92 @@ class Reception extends CommonObject } } + /** + * Get status from all dispatched lines + * + * @return int <0 if KO, >0 if OK + */ + public function getStatusDispatch() + { + global $conf; + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; + + $status = CommandeFournisseur::STATUS_RECEIVED_PARTIALLY; + + if (!empty($this->origin) && $this->origin_id > 0 && ($this->origin == 'order_supplier' || $this->origin == 'commandeFournisseur')) { + if (empty($this->commandeFournisseur)) { + $this->commandeFournisseur = null; + $this->fetch_origin(); + if (empty($this->commandeFournisseur->lines)) { + $res = $this->commandeFournisseur->fetch_lines(); + if ($res < 0) return $res; + } + } + + $qty_received = array(); + $qty_wished = array(); + + $supplierorderdispatch = new CommandeFournisseurDispatch($this->db); + $filter = array('t.fk_commande'=>$this->origin_id); + if (!empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) { + $filter['t.status'] = 1; // Restrict to lines with status validated + } + + $ret = $supplierorderdispatch->fetchAll('', '', 0, 0, $filter); + if ($ret < 0) { + $this->error = $supplierorderdispatch->error; + $this->errors = $supplierorderdispatch->errors; + return $ret; + } else { + // build array with quantity received by product in all supplier orders (origin) + foreach ($supplierorderdispatch->lines as $dispatch_line) { + $qty_received[$dispatch_line->fk_product] += $dispatch_line->qty; + } + + // qty wished in order supplier (origin) + foreach ($this->commandeFournisseur->lines as $origin_line) { + // exclude lines not qualified for reception + if (empty($conf->global->STOCK_SUPPORTS_SERVICES) && $origin_line->product_type > 0) { + continue; + } + + $qty_wished[$origin_line->fk_product] += $origin_line->qty; + } + + // compare array + $diff_array = array_diff_assoc($qty_received, $qty_wished); // Warning: $diff_array is done only on common keys. + $keys_in_wished_not_in_received = array_diff(array_keys($qty_wished), array_keys($qty_received)); + $keys_in_received_not_in_wished = array_diff(array_keys($qty_received), array_keys($qty_wished)); + + if (count($diff_array) == 0 && count($keys_in_wished_not_in_received) == 0 && count($keys_in_received_not_in_wished) == 0) { // no diff => mean everything is received + $status = CommandeFournisseur::STATUS_RECEIVED_COMPLETELY; + } elseif (!empty($conf->global->SUPPLIER_ORDER_MORE_THAN_WISHED)) { + // set totally received if more products received than ordered + $close = 0; + + if (count($diff_array) > 0) { + // there are some difference between the two arrays + // scan the array of results + foreach ($diff_array as $key => $value) { + // if the quantity delivered is greater or equal to ordered quantity + if ($qty_received[$key] >= $qty_wished[$key]) { + $close++; + } + } + } + + if ($close == count($diff_array)) { + // all the products are received equal or more than the ordered quantity + $status = CommandeFournisseur::STATUS_RECEIVED_COMPLETELY; + } + } + } + } + + return $status; + } /** * Add an reception line. From 9b1d800311d3043552bedefbd3bc52186243e78a Mon Sep 17 00:00:00 2001 From: lvessiller Date: Tue, 15 Feb 2022 09:54:40 +0100 Subject: [PATCH 40/40] NEW add triiger and event on totally received status --- htdocs/reception/class/reception.class.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 7efcb2360dc..bb54a8164cd 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -640,9 +640,18 @@ class Reception extends CommonObject if ($status < 0) { $error++; } else { - $ret = $this->setStatut($status, $this->origin_id, 'commande_fournisseur'); - if (!$ret) { - $error++; + $trigger_key = ''; + if ($status == CommandeFournisseur::STATUS_RECEIVED_COMPLETELY) { + $ret = $this->commandeFournisseur->Livraison($user, dol_now(), 'tot', ''); + if ($ret < 0) { + $error++; + $this->errors = array_merge($this->errors, $this->commandeFournisseur->errors); + } + } else { + $ret = $this->setStatut($status, $this->origin_id, 'commande_fournisseur', $trigger_key); + if ($ret < 0) { + $error++; + } } }
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Option").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_METEO").''; @@ -301,7 +302,7 @@ if (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METE } else { $str_mode_enabled = $str_mode_percentage; } - print ''.$str_mode_enabled.''; + print '
'.$str_mode_enabled.''; print ''; print '

'; @@ -451,8 +452,9 @@ if ($action == 'edit') { print $form->buttonsSaveCancel("Save", ''); print ''; } else { - print '
'; + print '

'; + print ''.$langs->trans("Modify").''; + print '
'; } // End of page diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 18a4ca0825f..33f8f5b87f2 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -249,7 +249,7 @@ print load_fiche_titre($langs->trans("PDF"), '', 'title_setup'); $head = pdf_admin_prepare_head(); -print dol_get_fiche_head($head, 'general', $langs->trans("PDF"), -1, 'pdf'); +print dol_get_fiche_head($head, 'general', '', -1, ''); print ''.$form->textwithpicto($langs->trans("PDFDesc"), $s)."
\n"; print "
\n"; diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index f42c49a4bfe..72acf7fbf4f 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -84,7 +84,7 @@ print load_fiche_titre($langs->trans("PDF"), '', 'title_setup'); $head = pdf_admin_prepare_head(); -print dol_get_fiche_head($head, 'other', $langs->trans("other"), -1, 'pdf'); +print dol_get_fiche_head($head, 'other', '', -1, ''); $tooltiptext = ''; print ''.$form->textwithpicto($langs->trans("PDFOtherDesc"), $tooltiptext)."
\n"; diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index 0a5e4548e3f..d7ab444f2da 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -244,6 +244,7 @@ class box_members_by_type extends ModeleBoxes ); } else { $this->info_box_contents[$line][] = array( + 'tr' => 'class="liste_total"', 'td' => 'class="liste_total"', 'text' => $langs->trans("Total") ); diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php index e7bf916d236..479d2424f09 100644 --- a/htdocs/core/boxes/box_members_subscriptions_by_year.php +++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php @@ -196,6 +196,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes ); } else { $this->info_box_contents[$line][] = array( + 'tr' => 'class="liste_total"', 'td' => 'class="liste_total"', 'text' => $langs->trans("Total"), ); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 80e40c12a1b..3506f024eea 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1187,7 +1187,7 @@ BankModuleNotActive=Bank accounts module not enabled ShowBugTrackLink=Show the link "%s" ShowBugTrackLinkDesc=Keep empty to not display this link, use value 'github' for the link to the Dolibarr project or define directly an url 'https://...' Alerts=Alerts -DelaysOfToleranceBeforeWarning=Delay before displaying a warning alert for: +DelaysOfToleranceBeforeWarning=Displaying a warning alert for... DelaysOfToleranceDesc=Set the delay before an alert icon %s is shown onscreen for the late element. Delays_MAIN_DELAY_ACTIONS_TODO=Planned events (agenda events) not completed Delays_MAIN_DELAY_PROJECT_TO_CLOSE=Project not closed in time @@ -2217,4 +2217,5 @@ NoDeployedModulesFoundWithThisSearchCriteria=No modules found for these search c API_DISABLE_COMPRESSION=Disable compression of API responses EachTerminalHasItsOwnCounter=Each terminal use its own counter. FillAndSaveAccountIdAndSecret=Fill and save account ID and secret first -PreviousHash=Previous hash \ No newline at end of file +PreviousHash=Previous hash +LateWarningAfter="Late" warning after \ No newline at end of file diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index 710d49bfab6..2ace1eb97e1 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -23,7 +23,7 @@ BoxLastMembersSubscriptions=Latest member subscriptions BoxFicheInter=Latest interventions BoxCurrentAccounts=Open accounts balance BoxTitleMemberNextBirthdays=Birthdays of this month (members) -BoxTitleMembersByType=Members by type +BoxTitleMembersByType=Members by type and status BoxTitleMembersSubscriptionsByYear=Members Subscriptions by year BoxTitleLastRssInfos=Latest %s news from %s BoxTitleLastProducts=Products/Services: last %s modified diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 147cd2fe8f9..b7d12216c6a 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5886,6 +5886,7 @@ span#select2-taskid-container[title^='--'] { } span.select2.select2-container.select2-container--default { + text-align: initial; global->THEME_SHOW_BORDER_ON_INPUT)) { ?> border-left: none; border-top: none; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index a207e128cc1..37864c1562c 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -6039,6 +6039,10 @@ span#select2-boxbookmark-container, span#select2-boxcombo-container { overflow: hidden; } +span.select2.select2-container.select2-container--default { + text-align: initial; +} + /* ============================================================================== */ /* For categories */ From 5d90a0072823b43b9964d9a68a32c3b7871205f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 13 Feb 2022 19:26:16 +0100 Subject: [PATCH 18/40] Debug v15 --- htdocs/core/lib/company.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 2d46ee2a239..4bf8a0e7219 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -199,7 +199,7 @@ function societe_prepare_head(Societe $object) if (empty($conf->global->SOCIETE_DISABLE_BANKACCOUNT)) { $nbBankAccount = 0; $foundonexternalonlinesystem = 0; - $langs->load("banks"); + $langs->load("bills"); $title = $langs->trans("PaymentModes"); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index fc163933b47..9fed70a1fe1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3643,7 +3643,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if (empty($srconly) && in_array($pictowithouttext, array( '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', 'accountancy', 'accounting_account', 'account', 'accountline', 'action', 'add', 'address', 'angle-double-down', 'angle-double-up', 'asset', - 'bank_account', 'barcode', 'bank', 'bell', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'bug', 'building', + 'bank_account', 'barcode', 'bank', 'bell', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'briefcase-medical', 'bug', 'building', 'card', 'calendar', 'calendarmonth', 'calendarweek', 'calendarday', 'calendarperuser', 'calendarpertype', 'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'conversation', 'cron', 'cubes', 'multicurrency', @@ -3669,7 +3669,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', 'recurring', 'shapes', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda', - 'uncheck', 'user-cog', 'vat', 'website', 'workstation', + 'uncheck', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'conferenceorbooth', 'eventorganization' ))) { $fakey = $pictowithouttext; From dce996a53f53c2a095f2a32e28d477d36e26a518 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 13 Feb 2022 17:33:45 +0100 Subject: [PATCH 19/40] Reponsive --- htdocs/accountancy/customer/lines.php | 2 +- htdocs/accountancy/customer/list.php | 4 ++-- htdocs/accountancy/supplier/lines.php | 2 +- htdocs/accountancy/supplier/list.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 7f09e111a23..92997b7a0e6 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -516,7 +516,7 @@ if ($result) { } print '
'.$objp->tva_intra.''.dol_escape_htmltag($objp->tva_intra).''; print $accountingaccountstatic->getNomUrl(0, 1, 1, '', 1); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 56f904e79ef..ee591df5413 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -631,7 +631,7 @@ if ($result) { print $product_static->getNomUrl(1); } if ($product_static->label) { - print '
'.$product_static->label.''; + print '
'.dol_escape_htmltag($product_static->label).''; } print '
'.dol_escape_htmltag($objp->tva_intra).''.dol_escape_htmltag($objp->tva_intra).''; diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index b7d0a0423f3..ff52fd77bd6 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -521,7 +521,7 @@ if ($result) { } print ''.$objp->tva_intra.''.dol_escape_htmltag($objp->tva_intra).''.dol_escape_htmltag($objp->tva_intra).''; From ff17fe5ae73ca79c641fe2988c919bb68e4e2744 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 13 Feb 2022 18:03:29 +0100 Subject: [PATCH 20/40] Fix reponsive --- htdocs/accountancy/customer/lines.php | 2 +- htdocs/accountancy/customer/list.php | 2 +- htdocs/accountancy/supplier/lines.php | 2 +- htdocs/accountancy/supplier/list.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 92997b7a0e6..931b5e6420c 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -516,7 +516,7 @@ if ($result) { } print ''.dol_escape_htmltag($objp->tva_intra).''.dol_escape_htmltag($objp->tva_intra).''; print $accountingaccountstatic->getNomUrl(0, 1, 1, '', 1); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index ee591df5413..80b7bdf2217 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -665,7 +665,7 @@ if ($result) { print ''.dol_escape_htmltag($objp->tva_intra).''.dol_escape_htmltag($objp->tva_intra).''; diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index ff52fd77bd6..9f769ae13b4 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -521,7 +521,7 @@ if ($result) { } print ''.dol_escape_htmltag($objp->tva_intra).''; print $accountingaccountstatic->getNomUrl(0, 1, 1, '', 1); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 9faac9ee1c7..24d0ed08a0a 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -672,7 +672,7 @@ if ($result) { print ''.dol_escape_htmltag($objp->tva_intra).''.dol_escape_htmltag($objp->tva_intra).''; From 05bd37a9216688dc2d09830d00b006a83879a897 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Feb 2022 15:30:45 +0100 Subject: [PATCH 21/40] Fix menu "New" when using paranoiac MAIN_SECURITY_CSRF_WITH_TOKEN = 3 --- htdocs/barcode/printsheet.php | 10 +++++----- htdocs/main.inc.php | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 5128cd56164..8663d50e66a 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -374,24 +374,24 @@ jQuery(document).ready(function() { '; // Checkbox to select from free text -print ' '.$langs->trans("FillBarCodeTypeAndValueManually").'   '; +print ''; print '
'; if (!empty($user->rights->produit->lire) || !empty($user->rights->service->lire)) { - print ' '.$langs->trans("FillBarCodeTypeAndValueFromProduct").'   '; + print ''; print '
'; print '
'; $form->select_produits(GETPOST('productid', 'int'), 'productid', '', '', 0, -1, 2, '', 0, array(), 0, '1', 0, 'minwidth400imp', 1); - print '   '; + print '   '; print '
'; } if (!empty($user->rights->societe->lire)) { - print ' '.$langs->trans("FillBarCodeTypeAndValueFromThirdParty").'   '; + print ''; print '
'; print '
'; print $form->select_company(GETPOST('socid', 'int'), 'socid', '', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300'); - print '   '; + print '   '; print '
'; } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d3d18a3e1c1..287185515e2 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -475,7 +475,9 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt( $sensitiveget = false; if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) { // All GET actions and mass actions are processed as sensitive. - $sensitiveget = true; + if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'file_manager'))) { // We exclude the case action='create' and action='file_manager' that are legitimate + $sensitiveget = true; + } } elseif (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 2) { // Few GET actions coded with a &token into url are processed as sensitive. $arrayofactiontoforcetokencheck = array( From 3ebdb891339540d496498fb33a5d8c084df1d656 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 14 Feb 2022 15:11:26 +0100 Subject: [PATCH 22/40] fix pdf_mucadet --- .../doc/pdf_muscadet.modules.php | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 4a27b58f8ae..45df637fc51 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -1151,26 +1151,28 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetXY($this->marge_gauche, $posy); // Logo - $logo = $conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; - if ($this->emetteur->logo) - { - if (is_readable($logo)) - { - $height = pdf_getHeightForLogo($logo); - $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) + if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { + if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; + if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) { + $logo = $logodir . '/logos/thumbs/' . $this->emetteur->logo_small; + } else { + $logo = $logodir . '/logos/' . $this->emetteur->logo; + } + if (is_readable($logo)) { + $height = pdf_getHeightForLogo($logo); + $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) + } else { + $pdf->SetTextColor(200, 0, 0); + $pdf->SetFont('', 'B', $default_font_size - 2); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L'); + } + } else { + $text = $this->emetteur->name; + $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } - else - { - $pdf->SetTextColor(200, 0, 0); - $pdf->SetFont('', 'B', $default_font_size - 2); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L'); - } - } - else - { - $text = $this->emetteur->name; - $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } $pdf->SetFont('', 'B', $default_font_size + 3); From 96c7a9f77c912d493df09d0dd4f52070e4240521 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 14 Feb 2022 15:16:36 +0100 Subject: [PATCH 23/40] fix pdf_cornas --- .../supplier_order/doc/pdf_cornas.modules.php | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 657160a9a1b..b63708dfa40 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -1235,26 +1235,30 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetXY($this->marge_gauche, $posy); // Logo - $logo = $conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; - if ($this->emetteur->logo) - { - if (is_readable($logo)) - { - $height = pdf_getHeightForLogo($logo); - $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) + if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { + if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; + if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) + { + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo = $logodir.'/logos/'.$this->emetteur->logo; + } + if (is_readable($logo)) { + $height = pdf_getHeightForLogo($logo); + $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) + } else { + $pdf->SetTextColor(200, 0, 0); + $pdf->SetFont('', 'B', $default_font_size - 2); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L'); + } + } else { + $text = $this->emetteur->name; + $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } - else - { - $pdf->SetTextColor(200, 0, 0); - $pdf->SetFont('', 'B', $default_font_size - 2); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L'); - } - } - else - { - $text = $this->emetteur->name; - $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } $pdf->SetFont('', 'B', $default_font_size + 3); From b6879d795325848876a61c8c8975ba142b9af77a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 14 Feb 2022 22:38:45 +0100 Subject: [PATCH 24/40] css --- htdocs/accountancy/index.php | 2 +- htdocs/accountancy/journal/bankjournal.php | 2 +- .../accountancy/journal/expensereportsjournal.php | 2 +- htdocs/accountancy/journal/purchasesjournal.php | 2 +- htdocs/accountancy/journal/sellsjournal.php | 2 +- htdocs/langs/en_US/accountancy.lang | 14 +++++++------- htdocs/theme/eldy/global.inc.php | 3 +++ htdocs/theme/md/style.css.php | 3 +++ 8 files changed, 18 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 02c4d210496..925ab8c9ae3 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -171,7 +171,7 @@ if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_S print $s; print "
\n"; } - if (!empty($conf->expensereport->enabled)) { // TODO Move this in the default account page because this is only one accounting account per purpose, not several. + if (!empty($conf->expensereport->enabled)) { $step++; $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '{s}'); $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'', $s); diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 49d379802fb..2530454d056 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -1057,7 +1057,7 @@ if (empty($action) || $action == 'view') { } - print '
'; + print '
'; if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') { print ''; diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 96ab150dd24..c80586fa3d0 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -521,7 +521,7 @@ if (empty($action) || $action == 'view') { print $desc; print '
'; } - print '
'; + print '
'; if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') { print ''; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 34ba4ae6337..8b1ac0d3de3 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -774,7 +774,7 @@ if (empty($action) || $action == 'view') { print $desc; print '
'; } - print '
'; + print '
'; if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') { print ''; } diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index ad1b7501a91..884c56ee6f2 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -716,7 +716,7 @@ if (empty($action) || $action == 'view') { print $desc; print '
'; } - print '
'; + print '
'; if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') { print ''; } diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 8bc4b54a090..893f448bbf8 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -62,24 +62,24 @@ MainAccountForSubscriptionPaymentNotDefined=Main accounting account for subscrip AccountancyArea=Accounting area AccountancyAreaDescIntro=Usage of the accountancy module is done in several step: AccountancyAreaDescActionOnce=The following actions are usually executed one time only, or once per year... -AccountancyAreaDescActionOnceBis=Next steps should be done to save you time in future by suggesting you the correct default accounting account when making the journalization (writing record in Journals and General ledger) +AccountancyAreaDescActionOnceBis=Next steps should be done to save you time in future by suggesting you automaticaly the correct default accounting account when transferring data in accounting AccountancyAreaDescActionFreq=The following actions are usually executed every month, week or day for very large companies... -AccountancyAreaDescJournalSetup=STEP %s: Create or check content of your journal list from menu %s +AccountancyAreaDescJournalSetup=STEP %s: Check content of your journal list from menu %s AccountancyAreaDescChartModel=STEP %s: Check that a model of chart of account exists or create one from menu %s AccountancyAreaDescChart=STEP %s: Select and|or complete your chart of account from menu %s AccountancyAreaDescVat=STEP %s: Define accounting accounts for each VAT Rates. For this, use the menu entry %s. AccountancyAreaDescDefault=STEP %s: Define default accounting accounts. For this, use the menu entry %s. -AccountancyAreaDescExpenseReport=STEP %s: Define default accounting accounts for each type of expense report. For this, use the menu entry %s. +AccountancyAreaDescExpenseReport=STEP %s: Define default accounting accounts for each type of Expense report. For this, use the menu entry %s. AccountancyAreaDescSal=STEP %s: Define default accounting accounts for payment of salaries. For this, use the menu entry %s. -AccountancyAreaDescContrib=STEP %s: Define default accounting accounts for special expenses (miscellaneous taxes). For this, use the menu entry %s. +AccountancyAreaDescContrib=STEP %s: Define default accounting accounts for Taxes (special expenses). For this, use the menu entry %s. AccountancyAreaDescDonation=STEP %s: Define default accounting accounts for donation. For this, use the menu entry %s. AccountancyAreaDescSubscription=STEP %s: Define default accounting accounts for member subscription. For this, use the menu entry %s. AccountancyAreaDescMisc=STEP %s: Define mandatory default account and default accounting accounts for miscellaneous transactions. For this, use the menu entry %s. AccountancyAreaDescLoan=STEP %s: Define default accounting accounts for loans. For this, use the menu entry %s. AccountancyAreaDescBank=STEP %s: Define accounting accounts and journal code for each bank and financial accounts. For this, use the menu entry %s. -AccountancyAreaDescProd=STEP %s: Define accounting accounts on your products/services. For this, use the menu entry %s. +AccountancyAreaDescProd=STEP %s: Define accounting accounts on your Products/Services. For this, use the menu entry %s. AccountancyAreaDescBind=STEP %s: Check the binding between existing %s lines and accounting account is done, so application will be able to journalize transactions in Ledger in one click. Complete missing bindings. For this, use the menu entry %s. AccountancyAreaDescWriteRecords=STEP %s: Write transactions into the Ledger. For this, go into menu %s, and click into button %s. @@ -112,7 +112,7 @@ MenuAccountancyClosure=Closure MenuAccountancyValidationMovements=Validate movements ProductsBinding=Products accounts TransferInAccounting=Transfer in accounting -RegistrationInAccounting=Registration in accounting +RegistrationInAccounting=Recording in accounting Binding=Binding to accounts CustomersVentilation=Customer invoice binding SuppliersVentilation=Vendor invoice binding @@ -120,7 +120,7 @@ ExpenseReportsVentilation=Expense report binding CreateMvts=Create new transaction UpdateMvts=Modification of a transaction ValidTransaction=Validate transaction -WriteBookKeeping=Register transactions in accounting +WriteBookKeeping=Record transactions in accounting Bookkeeping=Ledger BookkeepingSubAccount=Subledger AccountBalance=Account balance diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index b7d12216c6a..7f4a12c888d 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -724,6 +724,9 @@ textarea.centpercent { text-align: center; margin: 0px auto; } +.centerimp { + text-align: center !important; +} .alignstart { text-align: start; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 37864c1562c..fa7676e8573 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -874,6 +874,9 @@ textarea.centpercent { text-align: center; margin: 0px auto; } +.centerimp { + text-align: center !important; +} .alignstart { text-align: start; } From 54bf8ed1edd1c66f0eba7f5a72ce92fa522ebb04 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 14 Feb 2022 22:53:24 +0100 Subject: [PATCH 25/40] Fix link --- htdocs/accountancy/expensereport/index.php | 20 +++++++++++++++++++- htdocs/langs/en_US/accountancy.lang | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index 37abd56a21d..93419ce3cc4 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -199,7 +199,25 @@ for ($i = 1; $i <= 12; $i++) { if ($j > 12) { $j -= 12; } - print '
'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).''; + if (!empty($tmp['mday'])) { + $param = 'search_date_startday=1&search_date_startmonth='.$cursormonth.'&search_date_startyear='.$cursoryear; + $param .= '&search_date_endday='.$tmp['mday'].'&search_date_endmonth='.$tmp['mon'].'&search_date_endyear='.$tmp['year']; + $param .= '&search_month='.$tmp['mon'].'&search_year='.$tmp['year']; + print ''; + } + print $langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)); + if (!empty($tmp['mday'])) { + print ''; + } + print ''.$langs->trans("Total").'