From 9d234a854158f979f88b4e5119569dc8ca6c9ff3 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 3 Aug 2021 18:32:22 +0200 Subject: [PATCH 01/93] FIX: multicurrency: fields in discount unitialized when creating deposit --- htdocs/compta/facture/card.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index fe5d5c3ab0a..9501d34277e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1668,6 +1668,11 @@ if (empty($reshook)) $discount->tva_tx = $lines[$i]->tva_tx; $discount->fk_user = $user->id; $discount->description = $desc; + $discount->multicurrency_subprice = abs($lines[$i]->multicurrency_subprice); + $discount->multicurrency_amount_ht = abs($lines[$i]->multicurrency_total_ht); + $discount->multicurrency_amount_tva = abs($lines[$i]->multicurrency_total_tva); + $discount->multicurrency_amount_ttc = abs($lines[$i]->multicurrency_total_ttc); + $discountid = $discount->create($user); if ($discountid > 0) { $result = $object->insert_discount($discountid); // This include link_to_invoice From 58b28d3d7db0bfcaf3652f4182d5c9555114739e Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller Date: Sat, 23 Oct 2021 22:32:03 +0200 Subject: [PATCH 02/93] Fix: fix php 8.0 warnings project --- htdocs/core/tpl/list_print_total.tpl.php | 2 +- htdocs/eventorganization/conferenceorbooth_list.php | 11 ++++++----- htdocs/projet/activity/perday.php | 9 +++++++-- htdocs/projet/activity/perweek.php | 7 ++++++- htdocs/projet/tasks/list.php | 8 +++++--- 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php index 543bb939850..ec60dc36679 100644 --- a/htdocs/core/tpl/list_print_total.tpl.php +++ b/htdocs/core/tpl/list_print_total.tpl.php @@ -13,7 +13,7 @@ if (isset($totalarray['pos'])) { while ($i < $totalarray['nbfield']) { $i++; if (!empty($totalarray['pos'][$i])) { - print ''.price($totalarray['val'][$totalarray['pos'][$i]]).''; + print ''.price(!empty($totalarray['val'][$totalarray['pos'][$i]])?:0).''; } else { if ($i == 1) { if (is_null($limit) || $num < $limit) { diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 0deb1707cfc..a82b39c1a76 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -494,7 +494,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.id = ef.fk_object)"; } $sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as cact ON cact.id=t.fk_action AND cact.module LIKE '%@eventorganization'"; @@ -710,11 +710,11 @@ foreach ($object->fields as $key => $val) { if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { - print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], !empty($search[$key])?:'', $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) { - print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth125', 1); + print $object->showInputField($val, $key, !empty($search[$key])?:'', '', '', 'search_', 'maxwidth125', 1); } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - print ''; + print ''; } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { print '
'; print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); @@ -772,7 +772,7 @@ print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine = 0; -if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { +if (!empty($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object @@ -796,6 +796,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Show here line of result print ''; + $totalarray['nbfield'] = 0; foreach ($object->fields as $key => $val) { $cssforfield = (empty($val['css']) ? '' : $val['css']); if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 29a3c40209c..06ae3a018a6 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -77,6 +77,9 @@ $search_project_ref = GETPOST('search_project_ref', 'alpha'); $search_thirdparty = GETPOST('search_thirdparty', 'alpha'); $search_declared_progress = GETPOST('search_declared_progress', 'alpha'); +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); + $monthofday = GETPOST('addtimemonth'); $dayofday = GETPOST('addtimeday'); $yearofday = GETPOST('addtimeyear'); @@ -127,7 +130,7 @@ $arrayfields['timeconsumed'] = array('label'=>'TimeConsumed', 'checked'=>1, 'ena ); */ // Extra fields -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { +if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) { $arrayfields["efpt.".$key] = array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs((int) $extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key])); @@ -612,6 +615,8 @@ print ''.$langs->trans("HourStart").''; // By default, we can edit only tasks we are assigned to $restrictviewformytask = ((!isset($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED)) ? 2 : $conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED); +$numendworkingday = 0; +$numstartworkingday = 0; // Get if user is available or not for each day $isavailable = array(); if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS)) { @@ -776,7 +781,7 @@ print '
'; print ''."\n"; print '
'; -print ''; +print ''; print '
'; print ''; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 08304cecaab..d529cadeb02 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -77,6 +77,9 @@ $search_project_ref = GETPOST('search_project_ref', 'alpha'); $search_thirdparty = GETPOST('search_thirdparty', 'alpha'); $search_declared_progress = GETPOST('search_declared_progress', 'alpha'); +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); + $startdayarray = dol_get_first_day_week($day, $month, $year); $prev = $startdayarray; @@ -135,7 +138,7 @@ $arrayfields['timeconsumed'] = array('label'=>'TimeConsumed', 'checked'=>1, 'ena }*/ // Definition of fields for list // Extra fields -if (is_array($extrafields->attributes['projet_task']['label']) && count($extrafields->attributes['projet_task']['label']) > 0) { +if (!empty($extrafields->attributes['projet_task']['label']) && is_array($extrafields->attributes['projet_task']['label']) && count($extrafields->attributes['projet_task']['label']) > 0) { foreach ($extrafields->attributes['projet_task']['label'] as $key => $val) { if (!empty($extrafields->attributes['projet_task']['list'][$key])) { $arrayfields["efpt.".$key] = array('label'=>$extrafields->attributes['projet_task']['label'][$key], 'checked'=>(($extrafields->attributes['projet_task']['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes['projet_task']['pos'][$key], 'enabled'=>(abs((int) $extrafields->attributes['projet_task']['list'][$key]) != 3 && $extrafields->attributes['projet_task']['perms'][$key])); @@ -501,6 +504,8 @@ print '
'; $startday = dol_mktime(12, 0, 0, $startdayarray['first_month'], $startdayarray['first_day'], $startdayarray['first_year']); +$numendworkingday = 0; +$numstartworkingday = 0; // Get if user is available or not for each day $isavailable = array(); if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS)) { diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index e1ed162f9c2..6e44b8352ad 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -67,11 +67,13 @@ $search_task_user = GETPOST('search_task_user', 'int'); $search_task_progress = GETPOST('search_task_progress'); $search_task_budget_amount = GETPOST('search_task_budget_amount'); $search_societe = GETPOST('search_societe'); +$search_opp_status = GETPOST('$search_projectstatus'); -$mine = $_REQUEST['mode'] == 'mine' ? 1 : 0; +$mine = (!empty($_REQUEST['mode']) && $_REQUEST['mode'] == 'mine') ? 1 : 0; if ($mine) { $search_task_user = $user->id; $mine = 0; } +$type = GETPOST('type'); $search_date_startday = GETPOST('search_date_startday', 'int'); $search_date_startmonth = GETPOST('search_date_startmonth', 'int'); @@ -346,7 +348,7 @@ $sql .= ", ".MAIN_DB_PREFIX."projet_task as t"; if (!empty($arrayfields['t.tobill']['checked']) || !empty($arrayfields['t.billed']['checked'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task_time as tt ON tt.fk_task = t.rowid"; } -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } if ($search_project_user > 0) { @@ -634,7 +636,7 @@ if ($search_all) { print '
'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
'; } -$morehtmlfilter = ''; +$moreforfilter = ''; // Filter on categories if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { From 051f6ca7170ce0886570740b8486934a5445777d Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller Date: Sat, 23 Oct 2021 23:12:42 +0200 Subject: [PATCH 03/93] Fix: php 8.0 warning commercial part --- htdocs/comm/propal/card.php | 9 +++++---- htdocs/comm/propal/index.php | 2 +- htdocs/comm/propal/list.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/commande/list.php | 2 +- htdocs/contrat/list.php | 3 ++- htdocs/contrat/services_list.php | 3 ++- htdocs/fourn/commande/list.php | 2 +- 8 files changed, 14 insertions(+), 11 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 222f6ab8a87..7aa4ac02e00 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1442,7 +1442,7 @@ if (empty($reshook)) { } // Actions to build doc - $upload_dir = $conf->propal->multidir_output[$object->entity]; + $upload_dir = !empty($conf->propal->multidir_output[$object->entity])?:$conf->propal->dir_output; $permissiontoadd = $usercancreate; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } @@ -1584,6 +1584,7 @@ if ($action == 'create') { // Third party print ''; print ''.$langs->trans('Customer').''; + $shipping_method_id = 0; if ($socid > 0) { print ''; print $soc->getNomUrl(1); @@ -1700,7 +1701,7 @@ if ($action == 'create') { // Delivery date (or manufacturing) print ''.$langs->trans("DeliveryDate").''; print ''; - if ($conf->global->DATE_LIVRAISON_WEEK_DELAY != "") { + if (!empty($conf->global->DATE_LIVRAISON_WEEK_DELAY)) { $tmpdte = time() + ((7 * $conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); $syear = date("Y", $tmpdte); $smonth = date("m", $tmpdte); @@ -1737,7 +1738,7 @@ if ($action == 'create') { print ''; print img_picto('', 'pdf').' '; $liste = ModelePDFPropales::liste_modeles($db); - $preselected = ($conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT ? $conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT : $conf->global->PROPALE_ADDON_PDF); + $preselected = (!empty($conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT) ? $conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT : getDolGlobalString("PROPALE_ADDON_PDF")); print $form->selectarray('model', $liste, $preselected, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth200 widthcentpercentminusx', 1); print ""; @@ -1754,7 +1755,7 @@ if ($action == 'create') { print ''; print ''.$langs->trans('NotePublic').''; print ''; - $note_public = $object->getDefaultCreateValueFor('note_public', (is_object($objectsrc) ? $objectsrc->note_public : null)); + $note_public = $object->getDefaultCreateValueFor('note_public', (!empty($objectsrc) ? $objectsrc->note_public : null)); $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%'); print $doleditor->Create(1); diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index e170f873961..9f020bc1613 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -100,8 +100,8 @@ if (!empty($conf->propal->enabled)) { $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD)); startSimpleTable("DraftPropals", "comm/propal/list.php", "search_status=".Propal::STATUS_DRAFT, 2, $num); + $total = 0; if ($num) { - $total = 0; $i = 0; while ($i < $nbofloop) { diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 3535ae0cde1..347954cc711 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -534,7 +534,7 @@ if (!empty($search_categ_cus) && $search_categ_cus != '-1') { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ } $sql .= ', '.MAIN_DB_PREFIX.'propal as p'; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (p.rowid = ef.fk_object)"; } if ($sall || $search_product_category > 0) { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index cb62cf0094f..23a32e5796e 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1355,7 +1355,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; // Actions to build doc - $upload_dir = $conf->commande->multidir_output[$object->entity]; + $upload_dir = !empty($conf->propal->multidir_output[$object->entity])?:$conf->propal->dir_output; $permissiontoadd = $usercancreate; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 503c125b59c..6c14b57ef35 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -452,7 +452,7 @@ if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ } $sql .= ', '.MAIN_DB_PREFIX.'commande as c'; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande_extrafields as ef on (c.rowid = ef.fk_object)"; } if ($sall || $search_product_category > 0) { diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index cee0faf95aa..08c85bc620a 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -229,6 +229,7 @@ $formother = new FormOther($db); $socstatic = new Societe($db); $formcompany = new FormCompany($db); $contracttmp = new Contrat($db); +$title = ""; $sql = 'SELECT'; $sql .= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_update, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public, c.entity,"; @@ -259,7 +260,7 @@ if ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ", ".MAIN_DB_PREFIX."contrat as c"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (c.rowid = ef.fk_object)"; } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat"; diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 5bd98ded8c4..07cad07d2dd 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -37,6 +37,7 @@ $langs->loadLangs(array('products', 'contracts', 'companies')); $optioncss = GETPOST('optioncss', 'aZ09'); +$massaction = GETPOST('massaction', 'alpha'); $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); @@ -248,7 +249,7 @@ if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,"; } $sql .= " ".MAIN_DB_PREFIX."contratdet as cd"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (cd.rowid = ef.fk_object)"; } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 419e75b55aa..c96de8c2aec 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -765,7 +765,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (cf.rowid = ef.fk_object)"; } if ($sall || $search_product_category > 0) { From 3bcafb548a4379ce56a2872eeea22d2b682fe008 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 19 Nov 2021 14:01:37 +0100 Subject: [PATCH 04/93] fix errors --- htdocs/comm/propal/card.php | 2 +- htdocs/commande/card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 7aa4ac02e00..36ebc1e1246 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1442,7 +1442,7 @@ if (empty($reshook)) { } // Actions to build doc - $upload_dir = !empty($conf->propal->multidir_output[$object->entity])?:$conf->propal->dir_output; + $upload_dir = !empty($conf->propal->multidir_output[$object->entity])?$conf->propal->multidir_output[$object->entity]:$conf->propal->dir_output; $permissiontoadd = $usercancreate; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 23a32e5796e..89e671c7784 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1355,7 +1355,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; // Actions to build doc - $upload_dir = !empty($conf->propal->multidir_output[$object->entity])?:$conf->propal->dir_output; + $upload_dir = !empty($conf->propal->multidir_output[$object->entity])?$conf->propal->multidir_output[$object->entity]:$conf->propal->dir_output; $permissiontoadd = $usercancreate; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; From be44e5b0ca7c455b7887872bb201357f4e5e91fe Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 19 Nov 2021 14:27:29 +0100 Subject: [PATCH 05/93] NEW: for developper select_dictionnry can now deal with label translated --- htdocs/core/class/html.formother.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 99ee1b6af9b..8a77367bc25 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1382,12 +1382,12 @@ class FormOther while ($i < $num) { $obj = $this->db->fetch_object($result); - if ($selected == $obj->rowid || $selected == $obj->$keyfield) { - print ''; $i++; } From c90082925cae2b5ab07d5649c6eb262a4b7bfe72 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 19 Nov 2021 14:30:33 +0100 Subject: [PATCH 06/93] fix --- htdocs/core/class/html.formother.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index cef9795ef9b..a93d744cbaf 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1387,6 +1387,7 @@ class FormOther print ''; $i++; } From 00369a5269956303f6fa656bec47039952deed76 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 19 Nov 2021 14:32:40 +0100 Subject: [PATCH 07/93] fix errors --- htdocs/core/tpl/list_print_total.tpl.php | 2 +- htdocs/projet/tasks/list.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php index ec60dc36679..929ea2df50f 100644 --- a/htdocs/core/tpl/list_print_total.tpl.php +++ b/htdocs/core/tpl/list_print_total.tpl.php @@ -13,7 +13,7 @@ if (isset($totalarray['pos'])) { while ($i < $totalarray['nbfield']) { $i++; if (!empty($totalarray['pos'][$i])) { - print ''.price(!empty($totalarray['val'][$totalarray['pos'][$i]])?:0).''; + print ''.price(!empty($totalarray['val'][$totalarray['pos'][$i]])?$totalarray['val'][$totalarray['pos'][$i]]:0).''; } else { if ($i == 1) { if (is_null($limit) || $num < $limit) { diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 4e94eb37990..1553c58683f 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -349,7 +349,6 @@ $sql .= ", ".MAIN_DB_PREFIX."projet_task as t"; if (!empty($arrayfields['t.tobill']['checked']) || !empty($arrayfields['t.billed']['checked'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task_time as tt ON tt.fk_task = t.rowid"; } - if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } From 4fcac5b53c61c966830553140cd6fcd2faf9e2fc Mon Sep 17 00:00:00 2001 From: Martin Neubauer Date: Fri, 19 Nov 2021 16:38:41 +0100 Subject: [PATCH 08/93] Fix check for non-custom modules The check turned out to be true even for custom modules, causing the copying of the language file to fail. This attempts to bring the code behaviour in line with the code explaining it. --- htdocs/modulebuilder/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 1ab03743747..f490788f291 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -742,9 +742,9 @@ if ($dirins && $action == 'addlanguage' && !empty($module)) { // Dir for module $diroflang = dol_buildpath($modulelowercase, 0); - if ($diroflang == $dirread.'/'.$modulelowercase) { + if ($diroflang == $dolibarr_main_document_root.'/'.$modulelowercase) { // This is not a custom module, we force diroflang to htdocs root - $diroflang = $dirread; + $diroflang = $dolibarr_main_document_root; $srcfile = $diroflang.'/langs/en_US/'.$modulelowercase.'.lang'; $destfile = $diroflang.'/langs/'.$newlangcode.'/'.$modulelowercase.'.lang'; From bf8008a320c44a379c3ed781f3963f60299fc42e Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sat, 20 Nov 2021 09:55:04 +0100 Subject: [PATCH 09/93] TakePOS Direct Payment (Cash) Button doesn't work --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 8bd1c4dbca9..e5dda0110f2 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -789,7 +789,7 @@ function ModalBox(ModalID) function DirectPayment(){ console.log("DirectPayment"); - $("#poslines").load("invoice.php?place="+place+"&action=valid&pay=trans("cash"); ?>", function() { + $("#poslines").load("invoice.php?place="+place+"&action=valid&pay=LIQ", function() { }); } From bc6f38c556b43c167239e60da90ef4a4adcf22f8 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sat, 20 Nov 2021 15:25:51 +0100 Subject: [PATCH 10/93] TakePOS Direct Payment (Cash) Button doesn't work --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index dc6a0cd82e9..1956166cf60 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -768,7 +768,7 @@ function ModalBox(ModalID) function DirectPayment(){ console.log("DirectPayment"); - $("#poslines").load("invoice.php?place="+place+"&action=valid&pay=trans("cash"); ?>", function() { + $("#poslines").load("invoice.php?place="+place+"&action=valid&pay=LIQ", function() { }); } From eb76ff75052d9184ba1aaa7b4c7e0cb1acae2287 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Mon, 22 Nov 2021 11:52:25 +0100 Subject: [PATCH 11/93] NEW hidden configuration to modify the link to return on dolibarr. Used for externalaccess --- htdocs/user/class/user.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 18cfb950619..318c50d70a7 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2264,6 +2264,8 @@ class User extends CommonObject if (!$changelater) { $url = $urlwithroot.'/'; + if(!empty($conf->global->URL_REDIRECTION_AFTER_CHANGEPASSWORD)) + $url = $conf->global->URL_REDIRECTION_AFTER_CHANGEPASSWORD; $mesg .= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived").".\n"; $mesg .= $outputlangs->transnoentitiesnoconv("NewKeyIs")." :\n\n"; $mesg .= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n"; From 690466506ec9ad98d06ec5f927cff1f6d2b127e6 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Mon, 22 Nov 2021 12:01:20 +0100 Subject: [PATCH 12/93] NEW new hidden option to change the link of authentication in the mail after changing password --- htdocs/user/class/user.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 318c50d70a7..1fad896633b 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -11,7 +11,7 @@ * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2015 Marcos García * Copyright (C) 2018 charlene Benke - * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018-2021 Nicolas ZABOURI * Copyright (C) 2019-2020 Frédéric France * Copyright (C) 2019 Abbes Bahfir * From 0388a12a4bbf7b0a95447e95f02d9b33ce3af84d Mon Sep 17 00:00:00 2001 From: Nicolas Date: Mon, 22 Nov 2021 13:07:05 +0100 Subject: [PATCH 13/93] Stickler --- htdocs/user/class/user.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 1fad896633b..1780c73fc69 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2264,7 +2264,7 @@ class User extends CommonObject if (!$changelater) { $url = $urlwithroot.'/'; - if(!empty($conf->global->URL_REDIRECTION_AFTER_CHANGEPASSWORD)) + if (!empty($conf->global->URL_REDIRECTION_AFTER_CHANGEPASSWORD)) $url = $conf->global->URL_REDIRECTION_AFTER_CHANGEPASSWORD; $mesg .= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived").".\n"; $mesg .= $outputlangs->transnoentitiesnoconv("NewKeyIs")." :\n\n"; From a3315e8e160b4a94b9187d0518ebc8fb0b2fbfc4 Mon Sep 17 00:00:00 2001 From: bomuux Date: Mon, 22 Nov 2021 16:17:49 +0100 Subject: [PATCH 14/93] contact/note.php always restricted for external users Case of external user : 1- restrictedArea always block the access, 2- if this weren't the case, the following code is obviously wrong : fetching a Contact from a Societe id... --- htdocs/contact/note.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php index 1cb76b5336e..6ced85a5735 100644 --- a/htdocs/contact/note.php +++ b/htdocs/contact/note.php @@ -36,9 +36,9 @@ $langs->load("companies"); // Security check $id = GETPOST('id', 'int'); -if ($user->socid) { - $id = $user->socid; -} +//if ($user->socid) { +// $id = $user->socid; +//} $result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); $object = new Contact($db); From b28b12f93af7dfe16ef2787fcc191b2029631b7a Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 22 Nov 2021 16:19:01 +0100 Subject: [PATCH 15/93] FIX Accountancy - SQL error on subledger account search in journal --- htdocs/accountancy/bookkeeping/list.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index ec01d9c697c..52ac288856b 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -333,10 +333,6 @@ if (empty($reshook)) { $filter['t.numero_compte<='] = $search_accountancy_code_end; $param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end); } - if (!empty($search_accountancy_aux_code)) { - $filter['t.subledger_account'] = $search_accountancy_aux_code; - $param .= '&search_accountancy_aux_code='.urlencode($search_accountancy_aux_code); - } if (!empty($search_accountancy_aux_code_start)) { $filter['t.subledger_account>='] = $search_accountancy_aux_code_start; $param .= '&search_accountancy_aux_code_start='.urlencode($search_accountancy_aux_code_start); @@ -533,14 +529,12 @@ if (count($filter) > 0) { $sqlwhere[] = $key.'=\''.$db->idate($value).'\''; } elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') { $sqlwhere[] = $key.'\''.$db->idate($value).'\''; - } elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=') { + } elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=' || $key == 't.subledger_account>=' || $key == 't.subledger_account<=') { $sqlwhere[] = $key.'\''.$db->escape($value).'\''; } elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') { $sqlwhere[] = $key.'='.$value; - } elseif ($key == 't.numero_compte') { + } elseif ($key == 't.subledger_account' || $key == 't.numero_compte') { $sqlwhere[] = $key.' LIKE \''.$db->escape($value).'%\''; - } elseif ($key == 't.subledger_account') { - $sqlwhere[] = natural_search($key, $value, 0, 1); } elseif ($key == 't.date_creation>=' || $key == 't.date_creation<=') { $sqlwhere[] = $key.'\''.$db->idate($value).'\''; } elseif ($key == 't.tms>=' || $key == 't.tms<=') { From 955eb9bc4a4b6b54d12700f5cfb1ce7b91cd2479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 23 Nov 2021 00:22:43 +0100 Subject: [PATCH 16/93] fix #19374 --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 7f141d684b7..c14298d0142 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -944,7 +944,7 @@ class FormFile $out .= '">'.img_picto($langs->trans("Delete"), 'delete').''; } if ($printer) { - $out .= ''.img_picto($langs->trans("PrintFile", $relativepath), 'printer.png').''; } From bc4ce6725a6d67f21187e32182106a70b7ba46ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 23 Nov 2021 22:14:25 +0100 Subject: [PATCH 17/93] fix undefined variable $result --- htdocs/supplier_proposal/class/supplier_proposal.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 9c84e2c2e89..f609befc076 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -13,7 +13,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * Copyright (C) 2020 Tobias Sekan * * This program is free software; you can redistribute it and/or modify @@ -3200,7 +3200,8 @@ class SupplierProposalLine extends CommonObjectLine // if buy price not defined, define buyprice as configured in margin admin if ($this->pa_ht == 0) { - if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) { + $result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product); + if ($result < 0) { return $result; } else { $this->pa_ht = $result; From 5e2dcf322cf0b2a0a59c4c810b0e4303449bd013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 23 Nov 2021 22:17:05 +0100 Subject: [PATCH 18/93] Update supplier_proposal.class.php --- htdocs/supplier_proposal/class/supplier_proposal.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index f609befc076..ea10b4d7137 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2998,7 +2998,8 @@ class SupplierProposalLine extends CommonObjectLine // if buy price not defined, define buyprice as configured in margin admin if ($this->pa_ht == 0) { - if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) { + $result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product); + if ($result < 0) { return $result; } else { $this->pa_ht = $result; From e6af0facdd6c50d766ebd8ea3b91edaaba1d4389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 23 Nov 2021 23:27:07 +0100 Subject: [PATCH 19/93] keep info on latest activation version of module --- htdocs/admin/modulehelp.php | 5 +++++ htdocs/core/modules/DolibarrModules.class.php | 15 +++++++++++++-- htdocs/langs/en_US/admin.lang | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index a3c7c3d5c08..4ef01ab29af 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -262,6 +262,11 @@ if ($ip) { $text .= '
'.$langs->trans("LastActivationIP").': '; $text .= $ip; } +$lastactivationversion = $tmp['lastactivationversion']; +if ($lastactivationversion) { + $text .= '
'.$langs->trans("LastActivationVersion").': '; + $text .= $lastactivationversion; +} $moreinfo = $text; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 50171253938..9ecb73234de 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -957,7 +957,12 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $tmp = json_decode($obj->note, true); } if ($obj) { - return array('authorid'=>$tmp['authorid'], 'ip'=>$tmp['ip'], 'lastactivationdate'=>$this->db->jdate($obj->tms)); + return array( + 'authorid' => $tmp['authorid'], + 'ip' => $tmp['ip'], + 'lastactivationdate' => $this->db->jdate($obj->tms), + 'lastactivationversion' => (!empty($tmp['lastactivationversion']) ? $tmp['lastactivationversion'] : 'unknown'), + ); } } @@ -991,7 +996,13 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $err++; } - $note = json_encode(array('authorid'=>(is_object($user) ? $user->id : 0), 'ip'=>(empty($_SERVER['REMOTE_ADDR']) ? '' : $_SERVER['REMOTE_ADDR']))); + $note = json_encode( + array( + 'authorid' => (is_object($user) ? $user->id : 0), + 'ip' => (empty($_SERVER['REMOTE_ADDR']) ? '' : $_SERVER['REMOTE_ADDR']), + 'lastactivationversion' => $this->version, + ) + ); $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name, value, visible, entity, note) VALUES"; $sql .= " (".$this->db->encrypt($this->const_name); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4601f2c15b9..5b936c49291 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -353,6 +353,7 @@ LastStableVersion=Latest stable version LastActivationDate=Latest activation date LastActivationAuthor=Latest activation author LastActivationIP=Latest activation IP +LastActivationVersion=Latest activation version UpdateServerOffline=Update server offline WithCounter=Manage a counter GenericMaskCodes=You may enter any numbering mask. In this mask, the following tags can be used:
{000000} corresponds to a number which will be incremented on each %s. Enter as many zeros as the desired length of the counter. The counter will be completed by zeros from the left in order to have as many zeros as the mask.
{000000+000} same as the previous one but an offset corresponding to the number to the right of the + sign is applied starting on the first %s.
{000000@x} same as the previous one but the counter is reset to zero when month x is reached (x between 1 and 12, or 0 to use the early months of fiscal year defined in your configuration, or 99 to reset to zero every month). If this option is used and x is 2 or higher, then the sequence {yy}{mm} or {yyyy}{mm} is also required.
{dd} day (01 to 31).
{mm} month (01 to 12).
{yy}, {yyyy} or {y} year over 2, 4 or 1 numbers.
From 0b871ea0fb463890f5142c2d958a128736c8c178 Mon Sep 17 00:00:00 2001 From: Klaas Oldenburger Date: Wed, 24 Nov 2021 08:06:56 +0100 Subject: [PATCH 20/93] Update main.lang Changing date format the Dutch way --- htdocs/langs/nl_NL/main.lang | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/langs/nl_NL/main.lang b/htdocs/langs/nl_NL/main.lang index 3043bba6410..ab495070879 100644 --- a/htdocs/langs/nl_NL/main.lang +++ b/htdocs/langs/nl_NL/main.lang @@ -8,12 +8,12 @@ FONTFORPDF=helvetica FONTSIZEFORPDF=10 SeparatorDecimal=, SeparatorThousand=Space -FormatDateShort=%m/%d/%Y -FormatDateShortInput=%m/%d/%Y -FormatDateShortJava=MM/dd/yyyy -FormatDateShortJavaInput=MM/dd/yyyy -FormatDateShortJQuery=mm/dd/yy -FormatDateShortJQueryInput=mm/dd/yy +FormatDateShort=%d-%m-%Y +FormatDateShortInput=%d-%m-%Y +FormatDateShortJava=dd-MM-yyyy +FormatDateShortJavaInput=dd-MM-yyyy +FormatDateShortJQuery=dd-mm-yy +FormatDateShortJQueryInput=dd-mm-yy FormatHourShortJQuery=HH:MI FormatHourShort=%I:%M %p FormatHourShortDuration=%H:%M From c97083f596a9e4baf2f01664e2b2834bce19c55a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Hahn?= Date: Wed, 24 Nov 2021 09:43:46 +0100 Subject: [PATCH 21/93] Better wording Use "Modify" instead of "Update" "Modify" is more like "I want to change something" "Update" is more like "I want to confirm my changes" --- htdocs/product/traduction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 2bd92f40e78..cff6ee0dd09 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -233,7 +233,7 @@ if (empty($reshook)) { if ($user->rights->produit->creer || $user->rights->service->creer) { print '' . $langs->trans("Add") . ''; if ($cnt_trans > 0) { - print '' . $langs->trans("Update") . ''; + print '' . $langs->trans("Modify") . ''; } } } From 632147ad889c2ea7c73eec0c90e2cf8e781b2310 Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Wed, 24 Nov 2021 12:04:18 +0100 Subject: [PATCH 22/93] object->id is always empty --- htdocs/compta/facture/contact.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 60fdeaf3e64..c340d68242e 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -118,14 +118,6 @@ elseif ($action == 'deletecontact' && $user->rights->facture->creer) * View */ -if (empty($object->id)) { - llxHeader(); - $langs->load('errors'); - echo '
'.$langs->trans("ErrorRecordNotFound").'
'; - llxFooter(); - exit; -} - $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('ContactsAddresses'); $helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; llxHeader('', $title, $helpurl); From c33205d564061f72d93fce964517d86b07fdcb9a Mon Sep 17 00:00:00 2001 From: Maximilian Stein Date: Tue, 16 Nov 2021 19:09:14 +0100 Subject: [PATCH 23/93] NEW: Show sum of holidays in holiday list Show a footer in the holidays list with the sum of all holidays currently visible. --- htdocs/holiday/list.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 953f5eabb2f..c49d1f4b600 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -736,6 +736,7 @@ if ($resql) { $i = 0; $totalarray = array(); $totalarray['nbfield'] = 0; + $totalduration = 0; while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); @@ -805,6 +806,7 @@ if ($resql) { if (!empty($arrayfields['duration']['checked'])) { print ''; $nbopenedday = num_open_day($db->jdate($obj->date_debut, 1), $db->jdate($obj->date_fin, 1), 0, 1, $obj->halfday); // user jdate(..., 1) because num_open_day need UTC dates + $totalduration += $nbopenedday; print $nbopenedday.' '.$langs->trans('DurationDays'); print ''; if (!$i) { @@ -887,6 +889,20 @@ if ($resql) { $i++; } + + if (!empty($arrayfields['duration']['checked'])) { + print ''; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + if($key == 'duration') { + print ''.$totalduration.' '.$langs->trans('DurationDays').''; + } else { + print ''; + } + } + } + print ''; + } } // Si il n'y a pas d'enregistrement suite à une recherche From b212778da0f72f370f0170a9f4d1d47eacdca67f Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 24 Nov 2021 17:09:11 +0000 Subject: [PATCH 24/93] Fixing style errors. --- htdocs/holiday/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index c49d1f4b600..0ecdcb2dd69 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -894,7 +894,7 @@ if ($resql) { print ''; foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) { - if($key == 'duration') { + if ($key == 'duration') { print ''.$totalduration.' '.$langs->trans('DurationDays').''; } else { print ''; From 124e7f9b8823e4c509b7d11bd69b9e9294a119f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 24 Nov 2021 23:07:06 +0100 Subject: [PATCH 25/93] enable societe.class.php in coding test --- htdocs/societe/class/societe.class.php | 12 ++++++------ test/phpunit/CodingPhpTest.php | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 22276cc7bee..84f551bbd93 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -4752,12 +4752,12 @@ class Societe extends CommonObject * Function used to replace a thirdparty id with another one. * It must be used within a transaction to avoid trouble * - * @param DoliDB $db Database handler + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test * @param int $origin_id Old thirdparty id (will be removed) * @param int $dest_id New thirdparty id * @return bool True if success, False if error */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { if ($origin_id == $dest_id) { dol_syslog('Error: Try to merge a thirdparty into itself'); @@ -4774,9 +4774,9 @@ class Societe extends CommonObject $sql .= ' FROM '.MAIN_DB_PREFIX.'societe_commerciaux '; $sql .= ' WHERE fk_soc = '.(int) $origin_id.') '; - $resql = $db->query($sql); - while ($obj = $db->fetch_object($resql)) { - $db->query('DELETE FROM '.MAIN_DB_PREFIX.'societe_commerciaux WHERE rowid = '.((int) $obj->rowid)); + $resql = $dbs->query($sql); + while ($obj = $dbs->fetch_object($resql)) { + $dbs->query('DELETE FROM '.MAIN_DB_PREFIX.'societe_commerciaux WHERE rowid = '.((int) $obj->rowid)); } /** @@ -4792,7 +4792,7 @@ class Societe extends CommonObject 'societe_rib' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index 383c37e95e5..b069140f420 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -213,12 +213,11 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase 'multicurrency.class.php', 'productbatch.class.php', 'reception.class.php', - 'societe.class.php' ))) { - // Must not found $db-> + // Must not find $db-> $ok=true; $matches=array(); - // Check string $db-> inside a class.php file (it should be $this->db-> insto such classes) + // Check string $db-> inside a class.php file (it should be $this->db-> into such classes) preg_match_all('/'.preg_quote('$db->', '/').'/', $filecontent, $matches, PREG_SET_ORDER); foreach ($matches as $key => $val) { $ok=false; From f66f3e73554f8678adc1a80981e42ee7aa3c019d Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Thu, 25 Nov 2021 15:25:17 +0100 Subject: [PATCH 26/93] FIX #19476 --- htdocs/ticket/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 16fdaf315f1..ab2c2794e38 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -568,7 +568,7 @@ if (empty($reshook)) { if ($ret > 0) { $log_action = $langs->trans('TicketInitialMessageModified')." \n"; // include the Diff class - dol_include_once('/ticket/class/utils_diff.class.php'); + dol_include_once('/core/class/utils_diff.class.php'); // output the result of comparing two files as plain text $log_action .= Diff::toString(Diff::compare(strip_tags($oldvalue_message), strip_tags($object->message))); From 9d2fb782fafb8207f56204f0dda5efbf3ead0ceb Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 25 Nov 2021 15:41:28 +0100 Subject: [PATCH 27/93] FIX Option MAIN_DIRECT_STATUS_UPDATE broken. Ajax on/off not saving value in DB after updating to version >=12 --- htdocs/core/ajax/objectonoff.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/ajax/objectonoff.php b/htdocs/core/ajax/objectonoff.php index f7bf1d6299c..20256da94d7 100644 --- a/htdocs/core/ajax/objectonoff.php +++ b/htdocs/core/ajax/objectonoff.php @@ -80,5 +80,9 @@ if (($action == 'set') && !empty($id)) { $format = 'int'; + $object->table_element = $tablename; + $object->id = $id; + $object->fields[$field] = array('type' => $format, 'enabled' => 1); + $object->setValueFrom($field, $value, $tablename, $id, $format, '', $user, $triggerkey); } From 6e68eaaef4e7e6bb1062dede5e46f60ca789c882 Mon Sep 17 00:00:00 2001 From: "moreauf@theobald-groupe.com" Date: Thu, 25 Nov 2021 16:36:18 +0100 Subject: [PATCH 28/93] card Modif --- htdocs/product/stock/movement_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index ebf655c77e5..b46eb9e0112 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -459,7 +459,7 @@ if ($action == "transfert_stock" && !$cancel) { } } } -}m.lalanne +} /* From 1361abffe515722631dafbfba68ff0c20f553a10 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 26 Nov 2021 18:22:31 +0100 Subject: [PATCH 29/93] FIX: holiday list: only mass delete if leave request is not in draft, canceled or refused, like in card --- htdocs/core/actions_massactions.inc.php | 6 ++++++ htdocs/langs/en_US/holiday.lang | 1 + 2 files changed, 7 insertions(+) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index abcdd690d5c..0c84b2d3781 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1280,6 +1280,12 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' continue; } + if ($objectclass == 'Holiday' && ! in_array($objecttmp->statut, array(Holiday::STATUS_DRAFT, Holiday::STATUS_CANCELED, Holiday::STATUS_REFUSED))) { + $nbignored++; + setEventMessage($langs->trans('ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted', $objecttmp->ref)); + continue; + } + if ($objectclass == "Task" && $objecttmp->hasChildren() > 0) { $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET fk_task_parent = 0 WHERE fk_task_parent = ".$objecttmp->id; diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index eb2cd89adf1..ef96e72cc9d 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -132,3 +132,4 @@ FreeLegalTextOnHolidays=Free text on PDF WatermarkOnDraftHolidayCards=Watermarks on draft leave requests HolidaysToApprove=Holidays to approve NobodyHasPermissionToValidateHolidays=Nobody has permission to validate holidays +ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted=Leave request %s must be draft, canceled or refused to be deleted From f5343c55c39791f4351afedc6669bf7483db6957 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 26 Nov 2021 18:23:31 +0100 Subject: [PATCH 30/93] FIX: holiday mass deletion: correct return of record deleted --- htdocs/core/actions_massactions.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 0c84b2d3781..2ce94cad8ed 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1320,7 +1320,8 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' if (!$error) { if ($nbok > 1) setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs'); - else setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs'); + elseif ($nbok > 0) setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs'); + else setEventMessages($langs->trans("NoRecordDeleted"), null, 'mesgs'); $db->commit(); } else From 72493a5663cc6011395d694fbc59abbbd8b29342 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Nov 2021 15:13:36 +0100 Subject: [PATCH 31/93] Fix typo --- test/phpunit/SecurityTest.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 81eff830b49..6bece069cc9 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -594,7 +594,7 @@ class SecurityTest extends PHPUnit\Framework\TestCase print __METHOD__." login=".$login."\n"; $this->assertEquals($login, 'admin', 'The test to check if pass of user "admin" is "admin" has failed'); - $login=checkLoginPassEntity('admin', 'admin', 1, array('http','dolibarr')); // Should work because of second authetntication method + $login=checkLoginPassEntity('admin', 'admin', 1, array('http','dolibarr')); // Should work because of second authentication method print __METHOD__." login=".$login."\n"; $this->assertEquals($login, 'admin'); @@ -749,42 +749,42 @@ class SecurityTest extends PHPUnit\Framework\TestCase $url = 'https://www.dolibarr.fr'; // This is a redirect 301 page $tmp = getURLContent($url, 'GET', '', 0); // We do NOT follow print __METHOD__." url=".$url."\n"; - $this->assertEquals(301, $tmp['http_code'], 'GET url 301 without following -> 301'); + $this->assertEquals(301, $tmp['http_code'], 'Should GET url 301 without following -> 301'); $url = 'https://www.dolibarr.fr'; // This is a redirect 301 page - $tmp = getURLContent($url); // We DO follow + $tmp = getURLContent($url); // We DO follow a page with return 300 so result should be 200 print __METHOD__." url=".$url."\n"; - $this->assertEquals(200, $tmp['http_code'], 'GET url 301 with following -> 200'); // Test error if return does not contains 'not supported' + $this->assertEquals(200, $tmp['http_code'], 'Should GET url 301 with following -> 200 but we get '.$tmp['http_code']); $url = 'http://localhost'; $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL print __METHOD__." url=".$url."\n"; - $this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that resolves to a local URL'); // Test we receive an error because localtest.me is not an external URL + $this->assertEquals(400, $tmp['http_code'], 'Should GET url to '.$url.' that resolves to a local URL'); // Test we receive an error because localtest.me is not an external URL $url = 'http://127.0.0.1'; $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL print __METHOD__." url=".$url."\n"; - $this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that is a local URL'); // Test we receive an error because 127.0.0.1 is not an external URL + $this->assertEquals(400, $tmp['http_code'], 'Should GET url to '.$url.' that is a local URL'); // Test we receive an error because 127.0.0.1 is not an external URL $url = 'http://127.0.2.1'; $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL print __METHOD__." url=".$url."\n"; - $this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that is a local URL'); // Test we receive an error because 127.0.2.1 is not an external URL + $this->assertEquals(400, $tmp['http_code'], 'Should GET url to '.$url.' that is a local URL'); // Test we receive an error because 127.0.2.1 is not an external URL $url = 'https://169.254.0.1'; $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL print __METHOD__." url=".$url."\n"; - $this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that is a local URL'); // Test we receive an error because 169.254.0.1 is not an external URL + $this->assertEquals(400, $tmp['http_code'], 'Should GET url to '.$url.' that is a local URL'); // Test we receive an error because 169.254.0.1 is not an external URL $url = 'http://[::1]'; $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL print __METHOD__." url=".$url."\n"; - $this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that is a local URL'); // Test we receive an error because [::1] is not an external URL + $this->assertEquals(400, $tmp['http_code'], 'Should GET url to '.$url.' that is a local URL'); // Test we receive an error because [::1] is not an external URL /*$url = 'localtest.me'; $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL print __METHOD__." url=".$url."\n"; - $this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that resolves to a local URL'); // Test we receive an error because localtest.me is not an external URL + $this->assertEquals(400, $tmp['http_code'], 'Should GET url to '.$url.' that resolves to a local URL'); // Test we receive an error because localtest.me is not an external URL */ return 0; From 2030d55c67b68144e9844c27aded4a899ba4726e Mon Sep 17 00:00:00 2001 From: Klaas Oldenburger Date: Sat, 27 Nov 2021 16:42:53 +0100 Subject: [PATCH 32/93] Update main.lang Did not complete earlier work. --- htdocs/langs/nl_NL/main.lang | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/langs/nl_NL/main.lang b/htdocs/langs/nl_NL/main.lang index 3043bba6410..1afc7f49fb7 100644 --- a/htdocs/langs/nl_NL/main.lang +++ b/htdocs/langs/nl_NL/main.lang @@ -17,12 +17,12 @@ FormatDateShortJQueryInput=mm/dd/yy FormatHourShortJQuery=HH:MI FormatHourShort=%I:%M %p FormatHourShortDuration=%H:%M -FormatDateTextShort=%b %d, %Y -FormatDateText=%B %d, %Y -FormatDateHourShort=%m/%d/%Y %I:%M %p -FormatDateHourSecShort=%m/%d/%Y %I:%M:%S %p -FormatDateHourTextShort=%b %d, %Y, %I:%M %p -FormatDateHourText=%B %d, %Y, %I:%M %p +FormatDateTextShort=%d %b %Y +FormatDateText=%d %B %Y +FormatDateHourShort=%d-%m-%Y %I:%M %p +FormatDateHourSecShort=%d-%m-%Y %I:%M:%S %p +FormatDateHourTextShort=%d %b %Y, %I:%M %p +FormatDateHourText=%d %B %Y, %I:%M %p DatabaseConnection=Databaseverbinding NoTemplateDefined=Geen sjabloon beschikbaar voor dit e-mailtype AvailableVariables=Beschikbare substitutievariabelen From 5bb21a93a1fba9ac222b9062c471ac51751ca750 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Sat, 27 Nov 2021 18:25:38 +0100 Subject: [PATCH 33/93] FIX fatal error on cron list. --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/cron/list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 03366e9bae1..9a5ab68f898 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8082,7 +8082,7 @@ function verifCond($strRights) //print $strRights."
\n"; $rights = true; - if ($strRights !== '') { + if (isset($strRights) && $strRights !== '') { $str = 'if(!('.$strRights.')) { $rights = false; }'; dol_eval($str); // The dol_eval must contains all the global $xxx used into a condition } diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 4d829258b2b..686bb8a52a9 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -478,7 +478,7 @@ if ($num > 0) { if (empty($obj)) { break; } - if (!verifCond($obj->test)) { + if (isset($obj->test) && !verifCond($obj->test)) { continue; // Discard line with test = false } From f08adef1e8d6eef6910eb8cd7803e3537216c138 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 28 Nov 2021 12:12:16 +0100 Subject: [PATCH 34/93] Fix ExpenseReport define template Can use template for expense report notification but not define it :/ --- htdocs/admin/mails_templates.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 7d8bc2f22b1..0adc526d69e 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -225,6 +225,9 @@ if (!empty($conf->contrat->enabled) && !empty($user->rights->contrat->lire)) { if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) { $elementList['ticket_send'] = img_picto('', 'ticket', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToTicket')); } +if (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire)) { + $elementList['expensereport_send'] = img_picto('', 'trip', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToTExpenseReport')); +} if (!empty($conf->agenda->enabled)) { $elementList['actioncomm_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventPush')); } From 5a165ae2bfd5d66e6b895120de4bb7acb1b1a3e8 Mon Sep 17 00:00:00 2001 From: fr69400 <82267780+fr69400@users.noreply.github.com> Date: Sun, 28 Nov 2021 14:40:15 +0100 Subject: [PATCH 35/93] FIX PDF_NOLD_PRODUCT_LABEL --- htdocs/admin/pdf.php | 23 +++++++++++++++++++++++ htdocs/core/lib/pdf.lib.php | 19 ++++++++++++++----- htdocs/langs/en_US/admin.lang | 2 ++ htdocs/langs/fr_FR/admin.lang | 2 ++ 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index c22d365d932..c4ae5d59225 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -170,6 +170,13 @@ if ($action == 'update') { dolibarr_set_const($db, "PDF_USE_A", GETPOST('PDF_USE_A', 'alpha'), 'chaine', 0, '', $conf->entity); } + if (GETPOSTISSET('PDF_BOLD_PRODUCT_LABEL')) { + dolibarr_set_const($db, "PDF_BOLD_PRODUCT_LABEL", GETPOST('PDF_BOLD_PRODUCT_LABEL', 'alpha'), 'chaine', 0, '', $conf->entity); + } + if (GETPOSTISSET('PDF_BOLD_PRODUCT_REF_AND_PERIOD')){ + dolibarr_set_const($db, "PDF_BOLD_PRODUCT_REF_AND_PERIOD", GETPOST('PDF_BOLD_PRODUCT_REF_AND_PERIOD', 'alpha'), 'chaine', 0, '', $conf->entity); + } + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -499,6 +506,22 @@ if ($conf->use_javascript_ajax) { } print ''; +print ''.$langs->trans("BoldLabelOnPDF").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PDF_BOLD_PRODUCT_LABEL'); +} else { + print $form->selectyesno('PDF_BOLD_PRODUCT_LABEL', (!empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) ? $conf->global->PDF_BOLD_PRODUCT_LABEL : 0, 1); +} +print ''; + +print ''.$langs->trans("BoldRefAndPeriodOnPDF").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PDF_BOLD_PRODUCT_REF_AND_PERIOD'); +} else { + print $form->selectyesno('PDF_BOLD_PRODUCT_REF_AND_PERIOD', (!empty($conf->global->PDF_BOLD_PRODUCT_REF_AND_PERIOD)) ? $conf->global->PDF_BOLD_PRODUCT_REF_AND_PERIOD : 0, 1); +} +print ''; + // Desc print ''.$langs->trans("HideDescOnPDF").''; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 5121506087c..7a78db5a14e 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1363,7 +1363,9 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, // Description short of product line $libelleproduitservice = $label; if (!empty($libelleproduitservice) && !empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) { - // This part of code is bugged. It introduces a HTML tag making the label a html string but without converting \n into br if it was a full text non html string before. + if (!dol_textishtml($libelleproduitservice)){ + $libelleproduitservice = str_replace("\n", '__N__', $libelleproduitservice); + } $libelleproduitservice = ''.$libelleproduitservice.''; } } @@ -1375,7 +1377,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, if (!empty($prodser->sousprods) && is_array($prodser->sousprods) && count($prodser->sousprods)) { $tmparrayofsubproducts = reset($prodser->sousprods); foreach ($tmparrayofsubproducts as $subprodval) { - $libelleproduitservice .= "\n * ".$subprodval[5].(($subprodval[5] && $subprodval[3]) ? ' - ' : '').$subprodval[3].' ('.$subprodval[1].')'; + $libelleproduitservice .= "__N__ * ".$subprodval[5].(($subprodval[5] && $subprodval[3]) ? ' - ' : '').$subprodval[3].' ('.$subprodval[1].')'; } } } @@ -1419,7 +1421,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, } if (empty($hidedesc)) { if (!empty($conf->global->MAIN_DOCUMENTS_DESCRIPTION_FIRST)) { - $libelleproduitservice = $desc."\n".$libelleproduitservice; + $libelleproduitservice = $desc."__N__".$libelleproduitservice; } else { if (!empty($conf->global->HIDE_LABEL_VARIANT_PDF) && $prodser->isVariant()) { $libelleproduitservice = $desc; @@ -1493,10 +1495,14 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, } if (!empty($ref_prodserv) && !empty($conf->global->PDF_BOLD_PRODUCT_REF_AND_PERIOD)) { + if (!dol_textishtml($libelleproduitservice)){ + $libelleproduitservice = str_replace("\n", '__N__', $libelleproduitservice); + } $ref_prodserv = ''.$ref_prodserv.''; - } + // $prefix_prodserv and $ref_prodser are not HTML var + } $libelleproduitservice = $prefix_prodserv.$ref_prodserv.$libelleproduitservice; - + // Add an additional description for the category products if (!empty($conf->global->CATEGORY_ADD_DESC_INTO_DOC) && $idprod && !empty($conf->categorie->enabled)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; @@ -1527,6 +1533,9 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, } //print '>'.$outputlangs->charset_output.','.$period; if (!empty($conf->global->PDF_BOLD_PRODUCT_REF_AND_PERIOD)) { + if (!dol_textishtml($libelleproduitservice)){ + $libelleproduitservice = str_replace("\n", '__N__', $libelleproduitservice); + } $libelleproduitservice .= ''."__N__ ".$period.''; } else { $libelleproduitservice .= "__N__".$period; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index c258df38441..c36f29fa0d7 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1,4 +1,6 @@ # Dolibarr language file - Source file is en_US - admin +BoldRefAndPeriodOnPDF=Bold reference and period in PDF +BoldLabelOnPDF=Bold label in PDF Foundation=Foundation Version=Version Publisher=Publisher diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 0b4d7aa4f10..9d2de4d5ca8 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1,4 +1,6 @@ # Dolibarr language file - Source file is en_US - admin +BoldRefAndPeriodOnPDF=Mettre en gras la référence et la période dans les PDF +BoldLabelOnPDF=Mettre en gras le label des produits dans les PDF Foundation=Association Version=Version Publisher=Editeur From a933793b8a43903fb6c514ae89da9df96690f9af Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 28 Nov 2021 13:42:25 +0000 Subject: [PATCH 36/93] Fixing style errors. --- htdocs/admin/pdf.php | 2 +- htdocs/core/lib/pdf.lib.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index c4ae5d59225..18a4ca0825f 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -173,7 +173,7 @@ if ($action == 'update') { if (GETPOSTISSET('PDF_BOLD_PRODUCT_LABEL')) { dolibarr_set_const($db, "PDF_BOLD_PRODUCT_LABEL", GETPOST('PDF_BOLD_PRODUCT_LABEL', 'alpha'), 'chaine', 0, '', $conf->entity); } - if (GETPOSTISSET('PDF_BOLD_PRODUCT_REF_AND_PERIOD')){ + if (GETPOSTISSET('PDF_BOLD_PRODUCT_REF_AND_PERIOD')) { dolibarr_set_const($db, "PDF_BOLD_PRODUCT_REF_AND_PERIOD", GETPOST('PDF_BOLD_PRODUCT_REF_AND_PERIOD', 'alpha'), 'chaine', 0, '', $conf->entity); } diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 7a78db5a14e..2d8ce3b2996 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1363,7 +1363,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, // Description short of product line $libelleproduitservice = $label; if (!empty($libelleproduitservice) && !empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) { - if (!dol_textishtml($libelleproduitservice)){ + if (!dol_textishtml($libelleproduitservice)) { $libelleproduitservice = str_replace("\n", '__N__', $libelleproduitservice); } $libelleproduitservice = ''.$libelleproduitservice.''; @@ -1495,14 +1495,14 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, } if (!empty($ref_prodserv) && !empty($conf->global->PDF_BOLD_PRODUCT_REF_AND_PERIOD)) { - if (!dol_textishtml($libelleproduitservice)){ + if (!dol_textishtml($libelleproduitservice)) { $libelleproduitservice = str_replace("\n", '__N__', $libelleproduitservice); } $ref_prodserv = ''.$ref_prodserv.''; // $prefix_prodserv and $ref_prodser are not HTML var - } + } $libelleproduitservice = $prefix_prodserv.$ref_prodserv.$libelleproduitservice; - + // Add an additional description for the category products if (!empty($conf->global->CATEGORY_ADD_DESC_INTO_DOC) && $idprod && !empty($conf->categorie->enabled)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; @@ -1533,7 +1533,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, } //print '>'.$outputlangs->charset_output.','.$period; if (!empty($conf->global->PDF_BOLD_PRODUCT_REF_AND_PERIOD)) { - if (!dol_textishtml($libelleproduitservice)){ + if (!dol_textishtml($libelleproduitservice)) { $libelleproduitservice = str_replace("\n", '__N__', $libelleproduitservice); } $libelleproduitservice .= ''."__N__ ".$period.''; From ce651fae587669831f88ca3ac64ba31d10800299 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Nov 2021 15:34:08 +0100 Subject: [PATCH 37/93] Fix php compatibility --- htdocs/core/lib/memory.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/memory.lib.php b/htdocs/core/lib/memory.lib.php index 1300c1b771f..b3fd7109343 100644 --- a/htdocs/core/lib/memory.lib.php +++ b/htdocs/core/lib/memory.lib.php @@ -93,7 +93,7 @@ function dol_setcache($memoryid, $data, $expire = 0) $dolmemcache->add($memoryid, $data, $expire); // This fails if key already exists $rescode = $dolmemcache->getResultCode(); if ($rescode == 0) { - return is_countable($data) ? count($data) : 0; + return is_array($data) ? count($data) : 0; } else { return -$rescode; } @@ -113,7 +113,7 @@ function dol_setcache($memoryid, $data, $expire = 0) //$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false); $result = $dolmemcache->add($memoryid, $data, false, $expire); // This fails if key already exists if ($result) { - return is_countable($data) ? count($data) : 0; + return is_array($data) ? count($data) : 0; } else { return -1; } From ca11dcae22ff60af1bed4464ba5ac22e6d1c1596 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Nov 2021 15:41:19 +0100 Subject: [PATCH 38/93] Fix php compatibility --- htdocs/core/lib/memory.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/memory.lib.php b/htdocs/core/lib/memory.lib.php index b3fd7109343..94884ea302d 100644 --- a/htdocs/core/lib/memory.lib.php +++ b/htdocs/core/lib/memory.lib.php @@ -93,7 +93,7 @@ function dol_setcache($memoryid, $data, $expire = 0) $dolmemcache->add($memoryid, $data, $expire); // This fails if key already exists $rescode = $dolmemcache->getResultCode(); if ($rescode == 0) { - return is_array($data) ? count($data) : 0; + return is_array($data) ? count($data) : (is_scalar($data) ? strlen($data) : 0); } else { return -$rescode; } @@ -113,7 +113,7 @@ function dol_setcache($memoryid, $data, $expire = 0) //$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false); $result = $dolmemcache->add($memoryid, $data, false, $expire); // This fails if key already exists if ($result) { - return is_array($data) ? count($data) : 0; + return is_array($data) ? count($data) : (is_scalar($data) ? strlen($data) : 0); } else { return -1; } From c41578a3c360560b18f6af20d442306c03135ef8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Nov 2021 15:43:22 +0100 Subject: [PATCH 39/93] Fix php compatibility --- htdocs/categories/index.php | 2 +- htdocs/categories/viewcat.php | 2 +- htdocs/core/class/commonobject.class.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 708fb3a3e83..c585217dfda 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -186,7 +186,7 @@ foreach ($fulltree as $key => $val) { ? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account" : $categstatic->getObjectsInCateg($type, 1); - $counter = "".(is_countable($elements) ? count($elements) : '0').""; + $counter = "".(is_array($elements) ? count($elements) : '0').""; } $color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"'; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index eeca990ef28..a1f63b997e8 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -378,7 +378,7 @@ if ($cats < 0) { ? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account" : $categstatic->getObjectsInCateg($type, 1); - $counter = "".(is_countable($elements) ? count($elements) : '0').""; + $counter = "".(is_array($elements) ? count($elements) : '0').""; } $color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"'; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e8a8eb2843e..85987c8a3cf 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -860,7 +860,7 @@ abstract class CommonObject if (!empty($conf->socialnetworks->enabled)) { $outsocialnetwork = ''; - if (!empty($this->socialnetworks) && is_countable($this->socialnetworks) && count($this->socialnetworks) > 0) { + if (!empty($this->socialnetworks) && is_array($this->socialnetworks) && count($this->socialnetworks) > 0) { $socialnetworksdict = getArrayOfSocialNetworks(); foreach ($this->socialnetworks as $key => $value) { if ($value) { From 2ba5f1369fe1e37a434835f055b6e0df4bfec229 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Nov 2021 15:53:55 +0100 Subject: [PATCH 40/93] Fix alternate --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index f40c21778f5..0e192ff0212 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2366,7 +2366,7 @@ if ($action == 'generatesitemaps' && $usercanedit) { } if ($tmpshortlangcode != $shortlangcode) { $xhtmllink = $domtree->createElement('xhtml:link', ''); - $xhtmllink->setAttribute("rel", "alternante"); + $xhtmllink->setAttribute("rel", "alternate"); $xhtmllink->setAttribute("hreflang", $tmpshortlangcode); $xhtmllink->setAttribute("href", $domainname.($objp->fk_default_home == $tmppage->id ? '/' : (($tmpshortlangcode != substr($object->lang, 0, 2)) ? '/'.$tmpshortlangcode : '').'/'.$tmppage->pageurl.'.php')); $url->appendChild($xhtmllink); From 36eb79c14d49469deb17fbc03b7bffc6557a599d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Nov 2021 16:49:13 +0100 Subject: [PATCH 41/93] Fix filter on "Refuse emailing" --- htdocs/contact/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index dc8c77d0e1e..695d4ead3cc 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -76,7 +76,7 @@ $search_phone_mobile = GETPOST("search_phone_mobile", 'alpha'); $search_fax = GETPOST("search_fax", 'alpha'); $search_email = GETPOST("search_email", 'alpha'); if (!empty($conf->mailing->enabled)) { - $search_no_email = GETPOST("search_no_email", 'int'); + $search_no_email = GETPOSTISSET("search_no_email") ? GETPOST("search_no_email", 'int') : -1; } else { $search_no_email = -1; } From 5473dbd3f055ea10e218d60b3dd3928912172b6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 28 Nov 2021 20:55:17 +0100 Subject: [PATCH 42/93] add direct print for contracts --- htdocs/contrat/card.php | 2 ++ htdocs/core/class/html.formfile.class.php | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 31405545dbb..c52b57e305f 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -916,6 +916,8 @@ if (empty($reshook)) { } } + // Actions when printing a doc from card + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; // Actions to build doc $upload_dir = $conf->contrat->multidir_output[$object->entity]; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 7f141d684b7..e30f35758d1 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -442,7 +442,8 @@ class FormFile } $printer = 0; - if (in_array($modulepart, array('facture', 'supplier_proposal', 'propal', 'proposal', 'order', 'commande', 'expedition', 'commande_fournisseur', 'expensereport', 'delivery', 'ticket'))) { // The direct print feature is implemented only for such elements + // The direct print feature is implemented only for such elements + if (in_array($modulepart, array('contract', 'facture', 'supplier_proposal', 'propal', 'proposal', 'order', 'commande', 'expedition', 'commande_fournisseur', 'expensereport', 'delivery', 'ticket'))) { $printer = (!empty($user->rights->printing->read) && !empty($conf->printing->enabled)) ?true:false; } @@ -944,7 +945,7 @@ class FormFile $out .= '">'.img_picto($langs->trans("Delete"), 'delete').''; } if ($printer) { - $out .= ''.img_picto($langs->trans("PrintFile", $relativepath), 'printer.png').''; } From 5bdaab8dcb6f35ee79f7f8e50f53d90f1536900e Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Mon, 29 Nov 2021 14:30:04 +0100 Subject: [PATCH 43/93] Fix duplicated code --- htdocs/core/class/commonobject.class.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 040d3c519d9..cc74c30c191 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4872,13 +4872,9 @@ abstract class CommonObject $reshook = 0; //if (is_object($hookmanager) && (($line->product_type == 9 && !empty($line->special_code)) || !empty($line->fk_parent_line))) { if (is_object($hookmanager)) { // Old code is commented on preceding line. - if (empty($line->fk_parent_line)) { - $parameters = array('line'=>$line, 'i'=>$i, 'restrictlist'=>$restrictlist, 'selectedLines'=> $selectedLines); - $reshook = $hookmanager->executeHooks('printOriginObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - } else { - $parameters = array('line'=>$line, 'i'=>$i, 'restrictlist'=>$restrictlist, 'selectedLines'=> $selectedLines, 'fk_parent_line'=>$line->fk_parent_line); - $reshook = $hookmanager->executeHooks('printOriginObjectSubLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - } + $parameters = array('line'=>$line, 'i'=>$i, 'restrictlist'=>$restrictlist, 'selectedLines'=> $selectedLines); + if (!empty($line->fk_parent_line)) { $parameters['fk_parent_line'] = $line->fk_parent_line; } + $reshook = $hookmanager->executeHooks('printOriginObjectSubLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks } if (empty($reshook)) { $this->printOriginLine($line, '', $restrictlist, '/core/tpl', $selectedLines); From 819a76e16a8dd33479a906cf674c4cadb1c111b5 Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Fri, 27 Aug 2021 15:31:31 +0200 Subject: [PATCH 44/93] remove some deprecated html attributes https://developer.mozilla.org/en-US/docs/web/html/element/td#attr-align --- htdocs/bom/tpl/linkedobjectblock.tpl.php | 4 ++-- htdocs/commande/tpl/linkedobjectblock.tpl.php | 4 ++-- htdocs/reception/tpl/linkedobjectblock.tpl.php | 4 ++-- htdocs/theme/md/style.css.php | 4 ++++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/bom/tpl/linkedobjectblock.tpl.php b/htdocs/bom/tpl/linkedobjectblock.tpl.php index c42da9bdb19..2737b425c9c 100644 --- a/htdocs/bom/tpl/linkedobjectblock.tpl.php +++ b/htdocs/bom/tpl/linkedobjectblock.tpl.php @@ -54,7 +54,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { echo ''; echo ''.$objectlink->getNomUrl(1).''; - echo ''; + echo ''; $result = $product_static->fetch($objectlink->fk_product); if ($result < 0) { setEventMessage($product_static->error, 'errors'); @@ -62,7 +62,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { $product_static->getNomUrl(1); } print ''; - echo ''.dol_print_date($objectlink->date_creation, 'day').''; + echo ''.dol_print_date($objectlink->date_creation, 'day').''; echo ''; if ($user->rights->commande->lire) { $total = $total + $objectlink->total_ht; diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index aba881a63c6..2a6140aaeed 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -52,8 +52,8 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } echo ''; echo ''.$objectlink->getNomUrl(1).''; - echo ''.$objectlink->ref_client.''; - echo ''.dol_print_date($objectlink->date, 'day').''; + echo ''.$objectlink->ref_client.''; + echo ''.dol_print_date($objectlink->date, 'day').''; echo ''; if ($user->rights->commande->lire) { $total = $total + $objectlink->total_ht; diff --git a/htdocs/reception/tpl/linkedobjectblock.tpl.php b/htdocs/reception/tpl/linkedobjectblock.tpl.php index bb6777c0639..c8ff1196c0f 100644 --- a/htdocs/reception/tpl/linkedobjectblock.tpl.php +++ b/htdocs/reception/tpl/linkedobjectblock.tpl.php @@ -56,8 +56,8 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } ?> getNomUrl(1); ?> - - date_delivery, 'day'); ?> + + date_delivery, 'day'); ?> rights->reception->lire) { $total = $total + $objectlink->total_ht; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 10768184b1b..f8ff67ae8ce 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1444,6 +1444,10 @@ table[summary="list_of_modules"] .fa-cog { min-width: 100px; } +.linkedcol-date { + text-align: center; +} + .img-skinthumb { width: 160px; height: 100px; From 6608f5f0d8f62ce290bf47a53b151c31699089f9 Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Mon, 29 Nov 2021 15:09:18 +0100 Subject: [PATCH 45/93] update all script tags to be uniform. `language="javascript"` removed https://developer.mozilla.org/en-US/docs/web/html/element/script#attr-language --- htdocs/accountancy/admin/export.php | 2 +- htdocs/accountancy/admin/productaccount.php | 2 +- htdocs/accountancy/bookkeeping/balance.php | 2 +- htdocs/accountancy/customer/list.php | 2 +- htdocs/accountancy/expensereport/list.php | 2 +- htdocs/accountancy/index.php | 2 +- htdocs/accountancy/supplier/list.php | 2 +- htdocs/adherents/admin/website.php | 2 +- .../canvas/actions_adherentcard_common.class.php | 2 +- htdocs/adherents/card.php | 4 ++-- htdocs/adherents/subscription.php | 2 +- htdocs/admin/accountant.php | 2 +- htdocs/admin/company.php | 2 +- htdocs/admin/fckeditor.php | 2 +- htdocs/admin/mails.php | 2 +- htdocs/admin/mails_emailing.php | 2 +- htdocs/admin/mails_ticket.php | 2 +- htdocs/admin/menus/edit.php | 2 +- htdocs/admin/proxy.php | 2 +- htdocs/admin/system/perf.php | 2 +- htdocs/barcode/codeinit.php | 2 +- htdocs/barcode/printsheet.php | 2 +- htdocs/comm/action/card.php | 4 ++-- htdocs/comm/action/pertype.php | 2 +- htdocs/comm/action/peruser.php | 2 +- htdocs/comm/mailing/card.php | 2 +- htdocs/compta/bank/card.php | 4 ++-- htdocs/compta/bank/various_payment/card.php | 2 +- htdocs/compta/facture/card.php | 10 +++++----- htdocs/compta/paiement.php | 2 +- htdocs/compta/paiement/cheque/card.php | 2 +- htdocs/compta/paiement_charge.php | 2 +- htdocs/compta/paiement_vat.php | 2 +- htdocs/compta/tva/card.php | 2 +- .../canvas/actions_contactcard_common.class.php | 2 +- htdocs/contact/card.php | 8 ++++---- htdocs/core/ajax/ajaxdirtree.php | 2 +- htdocs/core/boxes/box_graph_invoices_permonth.php | 2 +- .../boxes/box_graph_invoices_supplier_permonth.php | 2 +- htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php | 2 +- htdocs/core/boxes/box_graph_orders_permonth.php | 2 +- .../core/boxes/box_graph_orders_supplier_permonth.php | 2 +- htdocs/core/boxes/box_graph_product_distribution.php | 2 +- htdocs/core/boxes/box_graph_propales_permonth.php | 2 +- htdocs/core/boxes/box_task.php | 2 +- htdocs/core/class/doleditor.class.php | 4 ++-- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formbarcode.class.php | 2 +- htdocs/core/class/html.formmail.class.php | 4 ++-- htdocs/core/class/html.formother.class.php | 2 +- htdocs/core/class/html.formsms.class.php | 2 +- htdocs/core/class/html.formticket.class.php | 6 +++--- htdocs/core/class/openid.class.php | 2 +- htdocs/core/customreports.php | 2 +- htdocs/core/lib/admin.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/core/lib/treeview.lib.php | 2 +- htdocs/core/photos_resize.php | 2 +- htdocs/cron/card.php | 2 +- htdocs/don/payment/payment.php | 2 +- htdocs/expedition/card.php | 2 +- htdocs/expensereport/card.php | 4 ++-- htdocs/expensereport/payment/payment.php | 2 +- htdocs/fourn/facture/card.php | 6 +++--- htdocs/fourn/facture/paiement.php | 4 ++-- htdocs/imports/import.php | 2 +- htdocs/includes/nusoap/lib/class.wsdl.php | 2 +- htdocs/includes/nusoap/lib/nusoap.php | 2 +- htdocs/install/upgrade2.php | 2 +- htdocs/loan/schedule.php | 2 +- htdocs/modulebuilder/template/myobject_card.php | 2 +- htdocs/modulebuilder/template/myobject_list.php | 2 +- htdocs/paybox/lib/paybox.lib.php | 2 +- htdocs/product/inventory/inventory.php | 4 ++-- htdocs/product/stock/product.php | 2 +- htdocs/product/stock/tpl/stockcorrection.tpl.php | 2 +- htdocs/projet/card.php | 4 ++-- htdocs/public/payment/newpayment.php | 2 +- htdocs/public/test/test_arrays.php | 2 +- htdocs/reception/card.php | 2 +- htdocs/salaries/card.php | 2 +- htdocs/salaries/paiement_salary.php | 2 +- htdocs/societe/canvas/actions_card_common.class.php | 4 ++-- .../canvas/company/actions_card_company.class.php | 2 +- htdocs/societe/card.php | 6 +++--- htdocs/takepos/index.php | 2 +- htdocs/takepos/invoice.php | 4 ++-- htdocs/takepos/phone.php | 2 +- htdocs/ticket/index.php | 2 +- htdocs/user/hierarchy.php | 2 +- htdocs/user/param_ihm.php | 2 +- htdocs/website/index.php | 8 ++++---- htdocs/workstation/workstation_card.php | 2 +- 93 files changed, 121 insertions(+), 121 deletions(-) diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 9e393beeacd..8cef3a05cf4 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -142,7 +142,7 @@ $linkback = ''; print load_fiche_titre($langs->trans('ExportOptions'), $linkback, 'accountancy'); -print "\n".''; // This ajax service is called only when a directory $selecteddir is opened but not when closed. - //print ''; } diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 65498ab6362..8179e134bcf 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -227,7 +227,7 @@ class box_graph_invoices_permonth extends ModeleBoxes if (!$mesg) { $stringtoshow = ''; - $stringtoshow .= ''; } else { // Default Header Redirect diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index b7f01de0aeb..1cede60f892 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -351,7 +351,7 @@ print $form->selectarray('objecttype', $newarrayoftype, $objecttype, 0, 0, 0, '' if (empty($conf->use_javascript_ajax)) { print ''; } else { - print ' -'; + $sectionwithinvoicelink .= ''; } } @@ -905,7 +905,7 @@ if ($action == "valid" || $action == "history" || $action == 'creditnote') { $form = new Form($db); ?> -