From 35653bb855a4749d3f69e8e4646ba82fbf45750a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 15 Nov 2020 23:45:13 +0100 Subject: [PATCH 01/39] fix dir for member photo in odt tag --- htdocs/core/class/commondocgenerator.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 26debedc9a7..5dfdddbaecc 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Marcos García * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2020 Frédéric France * Copyright (C) 2020 Josep Lluís Amador * * This program is free software; you can redistribute it and/or modify @@ -120,7 +120,7 @@ abstract class CommonDocGenerator { global $conf, $extrafields; - $logotouse = $conf->adherent->dir_output.'/'.get_exdir($member->id, 2, 0, 1, $member, 'user').'/'.$member->photo; + $logotouse = $conf->adherent->dir_output.'/'.$member->id.'/photos/'.$member->photo; $array_member = array( 'mymember_lastname' => $member->lastname, From d114c5667267abd7a5350bf8864178bbd61d8ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 15 Nov 2020 23:49:16 +0100 Subject: [PATCH 02/39] add a tag which list all other tags in odt user --- .../core/modules/user/doc/doc_generic_user_odt.modules.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 771231e6041..a6aac58182a 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -364,6 +364,12 @@ class doc_generic_user_odt extends ModelePDFUser $tmparray = array_merge($array_user, $array_soc, $array_thirdparty, $array_other, $array_thirdparty_contact); complete_substitutions_array($tmparray, $outputlangs, $object); + // to list all tags in odt template + $tags = ''; + foreach ($tmparray as $key => $value) { + $tags .= '{' . $key . '} => ' . $value ."\n"; + } + $tmparray = array_merge($tmparray, array('__ALL_TAGS__' => $tags)); $object->fetch_optionals(); // Call the ODTSubstitution hook $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); From 8cff0222cd9aba2d9bc1d652ec9337b4bfce7b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 15 Nov 2020 23:58:35 +0100 Subject: [PATCH 03/39] Update commondocgenerator.class.php --- htdocs/core/class/commondocgenerator.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 5dfdddbaecc..607982ee062 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -120,7 +120,11 @@ abstract class CommonDocGenerator { global $conf, $extrafields; - $logotouse = $conf->adherent->dir_output.'/'.$member->id.'/photos/'.$member->photo; + if ($member->photo) { + $logotouse = $conf->adherent->dir_output.'/'.$member->id.'/photos/'.$member->photo; + } else { + $logotouse = DOL_DOCUMENT_ROOT . '/public/theme/common/nophoto.png'; + } $array_member = array( 'mymember_lastname' => $member->lastname, From 4a1f61d759a0f6fccb9329e98fdaba20039b156c Mon Sep 17 00:00:00 2001 From: Tim Otte Date: Mon, 16 Nov 2020 11:12:43 +0100 Subject: [PATCH 04/39] Fix for #15423 --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index b2f8905aba9..e68ef5420de 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2025,7 +2025,7 @@ class ExtraFields $value_arr = GETPOST("options_".$key, 'alpha'); $value_key = price2num($value_arr); } elseif (in_array($key_type, array('html'))) { - $value_key = GETPOST("options_".$key, 'alpha'); + $value_key = GETPOST("options_".$key, 'none'); } elseif (in_array($key_type, array('text'))) { $value_key = GETPOST("options_".$key, 'alphanohtml'); } else { From 65144f4d5ad7dc80167e810144bcf39e507e3c17 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Nov 2020 11:37:28 +0100 Subject: [PATCH 05/39] fix warning --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 26debedc9a7..67232bc9da1 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1296,7 +1296,7 @@ abstract class CommonDocGenerator $html = ''; $fields = array(); - if (is_array($extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]['label'])) { + if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) { // Enable extrafield ? From 6c42535eb25acf550d9f69d5fc2ad424a651fa8c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Nov 2020 12:20:18 +0100 Subject: [PATCH 06/39] Maxi debug v13 --- htdocs/comm/propal/card.php | 26 ++++++++------ htdocs/comm/propal/class/propal.class.php | 31 ++++++++++------ htdocs/commande/card.php | 20 ++++++----- htdocs/commande/class/commande.class.php | 16 +++++---- htdocs/commande/list.php | 2 +- htdocs/compta/facture/class/facture.class.php | 4 +-- ...box_supplier_orders_awaiting_reception.php | 1 - .../commande/doc/pdf_einstein.modules.php | 4 +-- .../commande/doc/pdf_eratosthene.modules.php | 4 +-- .../modules/delivery/mod_delivery_saphir.php | 2 +- .../modules/propale/doc/pdf_azur.modules.php | 4 +-- .../modules/propale/doc/pdf_cyan.modules.php | 4 +-- .../supplier_order/doc/pdf_cornas.modules.php | 4 +-- .../doc/pdf_muscadet.modules.php | 4 +-- .../doc/pdf_aurore.modules.php | 8 ++--- htdocs/expedition/card.php | 7 ++-- htdocs/expedition/list.php | 5 +-- htdocs/expedition/shipment.php | 8 ++--- .../class/fournisseur.commande.class.php | 35 ++++++++++++------- htdocs/fourn/commande/card.php | 13 +++---- htdocs/install/upgrade2.php | 10 +++--- htdocs/reception/card.php | 7 ++-- htdocs/reception/list.php | 34 +++++++++--------- htdocs/supplier_proposal/card.php | 6 ++-- .../class/supplier_proposal.class.php | 16 ++++++--- 25 files changed, 157 insertions(+), 118 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 8613828f632..3a80ae22306 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -171,13 +171,14 @@ if (empty($reshook)) GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int') ); - if (!empty($object->date_livraison) && !empty($date_delivery)) + $date_delivery_old = (empty($object->delivery_date) ? $object->date_livraison : $object->delivery_date); + if (!empty($date_delivery_old) && !empty($date_delivery)) { //Attempt to get the date without possible hour rounding errors $old_date_delivery = dol_mktime(12, 0, 0, - dol_print_date($object->date_livraison, '%m'), - dol_print_date($object->date_livraison, '%d'), - dol_print_date($object->date_livraison, '%Y') + dol_print_date($date_delivery_old, '%m'), + dol_print_date($date_delivery_old, '%d'), + dol_print_date($date_delivery_old, '%Y') ); //Calculate the difference and apply if necessary $difference = $date_delivery - $old_date_delivery; @@ -341,7 +342,9 @@ if (empty($reshook)) if ($object->fetch(GETPOST('copie_propal', 'int')) > 0) { $object->ref = GETPOST('ref'); $object->datep = $datep; - $object->date_livraison = $date_delivery; + $object->date = $datep; + $object->date_livraison = $date_delivery; // deprecated + $object->delivery_date = $date_delivery; $object->availability_id = GETPOST('availability_id'); $object->demand_reason_id = GETPOST('demand_reason_id'); $object->fk_delivery_address = GETPOST('fk_address', 'int'); @@ -355,8 +358,9 @@ if (empty($reshook)) $object->socid = GETPOST('socid', 'int'); $object->contact_id = GETPOST('contactid', 'int'); $object->fk_project = GETPOST('projectid', 'int'); - $object->model_pdf = GETPOST('model'); + $object->model_pdf = GETPOST('model', 'alphanohtml'); $object->author = $user->id; // deprecated + $object->user_author_id = $user->id; $object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml'); $object->statut = Propal::STATUS_DRAFT; @@ -372,7 +376,9 @@ if (empty($reshook)) $object->ref = GETPOST('ref'); $object->ref_client = GETPOST('ref_client'); $object->datep = $datep; + $object->date = $datep; $object->date_livraison = $date_delivery; + $object->delivery_date = $date_delivery; $object->availability_id = GETPOST('availability_id', 'int'); $object->demand_reason_id = GETPOST('demand_reason_id', 'int'); $object->fk_delivery_address = GETPOST('fk_address', 'int'); @@ -1823,8 +1829,8 @@ if ($action == 'create') // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=2 OR s.client=3)')) ); - if (!empty($conf->global->PROPAL_CLONE_DATE_DELIVERY) && !empty($object->date_livraison)) { - $formquestion[] = array('type' => 'date', 'name' => 'date_delivery', 'label' => $langs->trans("DeliveryDate"), 'value' => $object->date_livraison); + if (!empty($conf->global->PROPAL_CLONE_DATE_DELIVERY) && !empty($object->delivery_date)) { + $formquestion[] = array('type' => 'date', 'name' => 'date_delivery', 'label' => $langs->trans("DeliveryDate"), 'value' => $object->delivery_date); } // Incomplete payment. We ask if reason = discount or other $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); @@ -2048,9 +2054,9 @@ if ($action == 'create') // Delivery date $langs->load('deliveries'); print ''; - print $form->editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->date_livraison, $object, $usercancreate, 'datepicker'); + print $form->editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate, 'datepicker'); print ''; - print $form->editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->date_livraison, $object, $usercancreate, 'datepicker'); + print $form->editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate, 'datepicker'); print ''; print ''; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 27f57569c3a..4f2159a200e 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -991,6 +991,9 @@ class Propal extends CommonObject $this->multicurrency_tx = 1; } + // Set tmp vars + $delivery_date = empty($this->delivery_date) ? $this->date_livraison : $this->delivery_date; + dol_syslog(get_class($this)."::create"); // Check parameters @@ -1078,7 +1081,7 @@ class Propal extends CommonObject $sql .= ", ".($this->mode_reglement_id > 0 ? $this->mode_reglement_id : 'NULL'); $sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL'); $sql .= ", '".$this->db->escape($this->ref_client)."'"; - $sql .= ", ".($this->date_livraison != '' ? "'".$this->db->idate($this->date_livraison)."'" : "NULL"); + $sql .= ", ".(empty($delivery_date) ? "NULL" : "'".$this->db->idate($delivery_date)."'"); $sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL'); $sql .= ", ".$this->availability_id; $sql .= ", ".$this->demand_reason_id; @@ -1441,7 +1444,7 @@ class Propal extends CommonObject $sql .= ", p.date_valid as datev"; $sql .= ", p.datep as dp"; $sql .= ", p.fin_validite as dfv"; - $sql .= ", p.date_livraison as date_livraison"; + $sql .= ", p.date_livraison as delivery_date"; $sql .= ", p.model_pdf, p.last_main_doc, p.ref_client, p.extraparams"; $sql .= ", p.note_private, p.note_public"; $sql .= ", p.fk_projet as fk_project, p.fk_statut"; @@ -1523,8 +1526,8 @@ class Propal extends CommonObject $this->date = $this->db->jdate($obj->dp); // Proposal date $this->datep = $this->db->jdate($obj->dp); // deprecated $this->fin_validite = $this->db->jdate($obj->dfv); - $this->date_livraison = $this->db->jdate($obj->date_livraison); - $this->delivery_date = $this->db->jdate($obj->date_livraison); + $this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated + $this->delivery_date = $this->db->jdate($obj->delivery_date); $this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null; $this->availability_id = $obj->fk_availability; $this->availability_code = $obj->availability_code; @@ -2111,7 +2114,7 @@ class Propal extends CommonObject { $this->oldcopy = clone $this; $this->date_livraison = $delivery_date; - $this->date_delivery = $delivery_date; + $this->delivery_date = $delivery_date; } if (!$notrigger && empty($error)) @@ -3574,16 +3577,24 @@ class Propal extends CommonObject if (isset($this->statut)) { $label .= ' '.$this->getLibStatut(5); } - if (!empty($this->ref)) + if (!empty($this->ref)) { $label .= '
'.$langs->trans('Ref').': '.$this->ref; - if (!empty($this->ref_client)) + } + if (!empty($this->ref_client)) { $label .= '
'.$langs->trans('RefCustomer').': '.$this->ref_client; - if (!empty($this->total_ht)) + } + if (!empty($this->total_ht)) { $label .= '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); - if (!empty($this->total_tva)) + } + if (!empty($this->total_tva)) { $label .= '
'.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); - if (!empty($this->total_ttc)) + } + if (!empty($this->total_ttc)) { $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); + } + if (!empty($this->delivery_date)) { + $label .= '
'.$langs->trans('DeliveryDate').': '.dol_print_date($this->delivery_date, 'dayhour'); + } if ($option == '') { $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id.$get_params; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index fd4c895caec..cb629e2c1f9 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -120,6 +120,8 @@ if (!empty($conf->expedition->enabled) && !empty($conf->global->WAREHOUSE_ASK_WA $error = 0; +$date_delivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); + /* * Actions @@ -274,7 +276,7 @@ if (empty($reshook)) $object->fk_account = GETPOST('fk_account', 'int'); $object->availability_id = GETPOST('availability_id'); $object->demand_reason_id = GETPOST('demand_reason_id'); - $object->date_livraison = $datelivraison; + $object->date_livraison = $datelivraison; // deprecated $object->delivery_date = $datelivraison; $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); $object->warehouse_id = GETPOST('warehouse_id', 'int'); @@ -539,10 +541,10 @@ if (empty($reshook)) } } elseif ($action == 'setdate_livraison' && $usercancreate) { // print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; - $datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); + $date_delivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); $object->fetch($id); - $result = $object->setDeliveryDate($user, $datedelivery); + $result = $object->setDeliveryDate($user, $date_delivery); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -1507,7 +1509,8 @@ if ($action == 'create' && $usercancreate) $remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); $dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER) ?-1 : ''; - $datedelivery = (!empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : ''); + $date_delivery = (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : ''); + if (empty($date_delivery)) $date_delivery = (!empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : ''); if (!empty($conf->multicurrency->enabled)) { @@ -1620,8 +1623,7 @@ if ($action == 'create' && $usercancreate) // Date delivery planned print ''.$langs->trans("DateDeliveryPlanned").''; print ''; - //print dol_print_date($object->date_livraison, "day"); // date_livraison come from order and will be stored into date_delivery planed. - $date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST + $date_delivery = ($date_delivery ? $date_delivery : $object->date_delivery); print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); print "\n"; print ''; @@ -2138,12 +2140,12 @@ if ($action == 'create' && $usercancreate) print '
'; print ''; print ''; - print $form->selectDate($object->date_livraison ? $object->date_livraison : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0); + print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0); print ''; print '
'; } else { - print $object->date_livraison ? dol_print_date($object->date_livraison, 'dayhour') : ' '; - if ($object->hasDelay() && !empty($object->date_livraison)) { + print $object->delivery_date ? dol_print_date($object->delivery_date, 'dayhour') : ' '; + if ($object->hasDelay() && !empty($object->delivery_date)) { print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 5c341ac0ffb..b77f7712f90 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -886,8 +886,9 @@ class Commande extends CommonOrder // Clean parameters $this->brouillon = 1; // set command as draft - // $date_commande is deprecated + // Set tmp vars $date = ($this->date_commande ? $this->date_commande : $this->date); + $delivery_date = empty($this->delivery_date) ? $this->date_livraison : $this->delivery_date; // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate) if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date); @@ -960,7 +961,7 @@ class Commande extends CommonOrder $sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL'); $sql .= ", ".($this->availability_id > 0 ? $this->availability_id : "null"); $sql .= ", ".($this->demand_reason_id > 0 ? $this->demand_reason_id : "null"); - $sql .= ", ".($this->date_livraison ? "'".$this->db->idate($this->date_livraison)."'" : "null"); + $sql .= ", ".($this->$delivery_date ? "'".$this->db->idate($this->$delivery_date)."'" : "null"); $sql .= ", ".($this->fk_delivery_address > 0 ? $this->fk_delivery_address : 'NULL'); $sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL'); $sql .= ", ".($this->warehouse_id > 0 ? $this->warehouse_id : 'NULL'); @@ -1359,7 +1360,7 @@ class Commande extends CommonOrder $this->fk_account = $object->fk_account; $this->availability_id = $object->availability_id; $this->demand_reason_id = $object->demand_reason_id; - $this->date_livraison = $object->date_livraison; + $this->date_livraison = $object->date_livraison; // deprecated $this->delivery_date = $object->date_livraison; $this->shipping_method_id = $object->shipping_method_id; $this->warehouse_id = $object->warehouse_id; @@ -1784,7 +1785,7 @@ class Commande extends CommonOrder $sql .= ', c.amount_ht, c.total_ht, c.total_ttc, c.tva as total_tva, c.localtax1 as total_localtax1, c.localtax2 as total_localtax2, c.fk_cond_reglement, c.fk_mode_reglement, c.fk_availability, c.fk_input_reason'; $sql .= ', c.fk_account'; $sql .= ', c.date_commande, c.date_valid, c.tms'; - $sql .= ', c.date_livraison'; + $sql .= ', c.date_livraison as delivery_date'; $sql .= ', c.fk_shipping_method'; $sql .= ', c.fk_warehouse'; $sql .= ', c.fk_projet as fk_project, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as billed'; @@ -1870,8 +1871,8 @@ class Commande extends CommonOrder $this->availability = $obj->availability_label; $this->demand_reason_id = $obj->fk_input_reason; $this->demand_reason_code = $obj->demand_reason_code; - $this->date_livraison = $this->db->jdate($obj->date_livraison); - $this->delivery_date = $this->db->jdate($obj->date_livraison); + $this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated + $this->delivery_date = $this->db->jdate($obj->delivery_date); $this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null; $this->warehouse_id = ($obj->fk_warehouse > 0) ? $obj->fk_warehouse : null; $this->fk_delivery_address = $obj->fk_delivery_address; @@ -3660,6 +3661,9 @@ class Commande extends CommonOrder if (!empty($this->total_ttc)) { $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); } + if (!empty($this->delivery_date)) { + $label .= '
'.$langs->trans('DeliveryDate').': '.dol_print_date($this->delivery_date, 'dayhour'); + } } $linkclose = ''; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 1c9cffcdacd..3e7a8d416cf 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -931,7 +931,7 @@ if ($resql) $generic_commande->statut = $obj->fk_statut; $generic_commande->billed = $obj->billed; $generic_commande->date = $db->jdate($obj->date_commande); - $generic_commande->date_livraison = $db->jdate($obj->date_delivery); + $generic_commande->date_livraison = $db->jdate($obj->date_delivery); // deprecated $generic_commande->delivery_date = $db->jdate($obj->date_delivery); $generic_commande->ref_client = $obj->ref_client; $generic_commande->total_ht = $obj->total_ht; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 9c78fa6acb9..51051625db6 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1338,8 +1338,8 @@ class Facture extends CommonInvoice $this->mode_reglement_id = $object->mode_reglement_id; $this->availability_id = $object->availability_id; $this->demand_reason_id = $object->demand_reason_id; - $this->date_livraison = $object->date_livraison; - $this->delivery_date = $object->date_livraison; + $this->delivery_date = (empty($object->delivery_date) ? $object->date_livraison : $object->delivery_date); + $this->date_livraison = $object->delivery_date; // deprecated $this->fk_delivery_address = $object->fk_delivery_address; // deprecated $this->contact_id = $object->contact_id; $this->ref_client = $object->ref_client; diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index 57656915d62..9aeba738caf 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -115,7 +115,6 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes $delivery_date = $this->db->jdate($objp->delivery_date); $datem = $this->db->jdate($objp->tms); - $supplierorderstatic->date_livraison = $delivery_date; $supplierorderstatic->delivery_date = $delivery_date; $supplierorderstatic->statut = $objp->fk_statut; diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 9a618053ff2..114a3906392 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -741,7 +741,7 @@ class pdf_einstein extends ModelePDFCommandes }*/ // Show planed date of delivery - if (!empty($object->date_livraison)) + if (!empty($object->delivery_date)) { $outputlangs->load("sendings"); $pdf->SetFont('', 'B', $default_font_size - 2); @@ -750,7 +750,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $dlp = dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true); + $dlp = dol_print_date($object->delivery_date, "daytext", false, $outputlangs, true); $pdf->MultiCell(80, 4, $dlp, 0, 'L'); $posy = $pdf->GetY() + 1; diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 28c255e973b..1f266851a0c 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -958,7 +958,7 @@ class pdf_eratosthene extends ModelePDFCommandes }*/ // Show planed date of delivery - if (!empty($object->date_livraison)) + if (!empty($object->delivery_date)) { $outputlangs->load("sendings"); $pdf->SetFont('', 'B', $default_font_size - 2); @@ -967,7 +967,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $dlp = dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true); + $dlp = dol_print_date($object->delivery_date, "daytext", false, $outputlangs, true); $pdf->MultiCell(80, 4, $dlp, 0, 'L'); $posy = $pdf->GetY() + 1; diff --git a/htdocs/core/modules/delivery/mod_delivery_saphir.php b/htdocs/core/modules/delivery/mod_delivery_saphir.php index df1a15598b1..ca0de68a670 100644 --- a/htdocs/core/modules/delivery/mod_delivery_saphir.php +++ b/htdocs/core/modules/delivery/mod_delivery_saphir.php @@ -139,7 +139,7 @@ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder return 0; } - $numFinal = get_next_value($db, $mask, 'delivery', 'ref', '', $objsoc, $object->date_livraison); + $numFinal = get_next_value($db, $mask, 'delivery', 'ref', '', $objsoc, $object->delivery_date); return $numFinal; } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index aff0e7c4457..3405b6a2774 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -870,7 +870,7 @@ class pdf_azur extends ModelePDFPropales $posxval = 52; // Show shipping date - if (!empty($object->date_livraison)) + if (!empty($object->delivery_date)) { $outputlangs->load("sendings"); $pdf->SetFont('', 'B', $default_font_size - 2); @@ -879,7 +879,7 @@ class pdf_azur extends ModelePDFPropales $pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $dlp = dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true); + $dlp = dol_print_date($object->delivery_date, "daytext", false, $outputlangs, true); $pdf->MultiCell(80, 4, $dlp, 0, 'L'); $posy = $pdf->GetY() + 1; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 9be74e97fb9..8199f3ac11e 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1006,7 +1006,7 @@ class pdf_cyan extends ModelePDFPropales $posxval = 52; // Show shipping date - if (!empty($object->date_livraison)) + if (!empty($object->delivery_date)) { $outputlangs->load("sendings"); $pdf->SetFont('', 'B', $default_font_size - 2); @@ -1015,7 +1015,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $dlp = dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true); + $dlp = dol_print_date($object->delivery_date, "daytext", false, $outputlangs, true); $pdf->MultiCell(80, 4, $dlp, 0, 'L'); $posy = $pdf->GetY() + 1; 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 0d7cfcdb90d..681b5316682 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -1276,11 +1276,11 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetTextColor(0, 0, 60); $usehourmin = 'day'; if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin = 'dayhour'; - if (!empty($object->date_livraison)) + if (!empty($object->delivery_date)) { $posy += 4; $pdf->SetXY($posx - 90, $posy); - $pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_livraison, $usehourmin, false, $outputlangs, true), '', 'R'); + $pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->delivery_date, $usehourmin, false, $outputlangs, true), '', 'R'); } if ($object->thirdparty->code_fournisseur) 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 a496bd8ba87..13111da6fa9 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -1190,11 +1190,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetTextColor(0, 0, 60); $usehourmin = 'day'; if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin = 'dayhour'; - if (!empty($object->date_livraison)) + if (!empty($object->delivery_date)) { $posy += 4; $pdf->SetXY($posx - 90, $posy); - $pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_livraison, $usehourmin, false, $outputlangs, true), '', 'R'); + $pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->delivery_date, $usehourmin, false, $outputlangs, true), '', 'R'); } if ($object->thirdparty->code_fournisseur) diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index f6dc1d789f0..8a3880dc93e 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -724,7 +724,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $posxval = 52; // Show shipping date - if (!empty($object->date_livraison)) + if (!empty($object->delivery_date)) { $outputlangs->load("sendings"); $pdf->SetFont('', 'B', $default_font_size - 2); @@ -733,7 +733,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $dlp = dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true); + $dlp = dol_print_date($object->delivery_date, "daytext", false, $outputlangs, true); $pdf->MultiCell(80, 4, $dlp, 0, 'L'); $posy = $pdf->GetY() + 1; @@ -745,7 +745,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - //$dlp=dol_print_date($object->date_livraison,"daytext",false,$outputlangs,true); + //$dlp=dol_print_date($object->delivery_date,"daytext",false,$outputlangs,true); $pdf->MultiCell(80, 4, '', 0, 'L'); $posy = $pdf->GetY() + 1; @@ -1325,7 +1325,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $posy+=4; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierProposalDate")." : " . dol_print_date($object->date_livraison, "day", false, $outputlangs, true), '', 'R'); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierProposalDate")." : " . dol_print_date($object->delivery_date, "day", false, $outputlangs, true), '', 'R'); */ if ($object->thirdparty->code_fournisseur) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 77e25704a6b..5fa0ebe26ea 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -105,6 +105,8 @@ $hookmanager->initHooks(array('expeditioncard', 'globalcard')); $permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php //var_dump($object->lines[0]->detail_batch); +$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int')); + /* * Actions @@ -201,8 +203,6 @@ if (empty($reshook)) $object->size_units = GETPOST('size_units', 'int'); $object->weight_units = GETPOST('weight_units', 'int'); - $date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int')); - // We will loop on each line of the original document to complete the shipping object with various info and quantity to deliver $classname = ucfirst($object->origin); $objectsrc = new $classname($db); @@ -936,8 +936,7 @@ if ($action == 'create') // Date delivery planned print ''.$langs->trans("DateDeliveryPlanned").''; print ''; - //print dol_print_date($object->date_livraison, "day"); // date_livraison come from order and will be stored into date_delivery planed. - $date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST + $date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date); // $date_delivery comes from GETPOST print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); print "\n"; print ''; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 09cec584c43..77a62bf8561 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -212,7 +212,7 @@ llxHeader('', $langs->trans('ListOfSendings'), $helpurl); $sql = 'SELECT'; if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT'; -$sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as date_livraison, l.date_delivery as date_reception, e.fk_statut, e.billed, e.tracking_number,"; +$sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as delivery_date, l.date_delivery as date_reception, e.fk_statut, e.billed, e.tracking_number,"; $sql .= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, "; $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; @@ -618,6 +618,7 @@ if ($resql) $object = new Expedition($db); $object->fetch($obj->rowid); + print ''; // Ref @@ -705,7 +706,7 @@ if ($resql) if (!empty($arrayfields['e.date_delivery']['checked'])) { print ''; - print dol_print_date($db->jdate($obj->date_livraison), "dayhour"); + print dol_print_date($db->jdate($obj->delivery_date), "dayhour"); /*$now = time(); if ( ($now - $db->jdate($obj->date_expedition)) > $conf->warnings->lim && $obj->statutid == 1 ) { diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 62e6181abcf..39772360227 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -354,7 +354,7 @@ if ($id > 0 || !empty($ref)) print ''.$langs->trans('Date').''; print ''; print dol_print_date($object->date, 'day'); - if ($object->hasDelay() && empty($object->date_livraison)) { + if ($object->hasDelay() && empty($object->delivery_date)) { print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } print ''; @@ -374,12 +374,12 @@ if ($id > 0 || !empty($ref)) print '
'; print ''; print ''; - print $form->selectDate($object->date_livraison ? $object->date_livraison : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0); + print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0); print ''; print '
'; } else { - print dol_print_date($object->date_livraison, 'dayhour'); - if ($object->hasDelay() && !empty($object->date_livraison)) { + print dol_print_date($object->delivery_date, 'dayhour'); + if ($object->hasDelay() && !empty($object->delivery_date)) { print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } } diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 2bc539ea07e..5f2771594de 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -375,7 +375,7 @@ class CommandeFournisseur extends CommonOrder $this->date_approve = $this->db->jdate($obj->date_approve); $this->date_approve2 = $this->db->jdate($obj->date_approve2); $this->date_commande = $this->db->jdate($obj->date_commande); // date we make the order to supplier - $this->date_livraison = $this->db->jdate($obj->delivery_date); + $this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated $this->delivery_date = $this->db->jdate($obj->delivery_date); $this->remise_percent = $obj->remise_percent; $this->methode_commande_id = $obj->fk_input_method; @@ -778,16 +778,24 @@ class CommandeFournisseur extends CommonOrder if (isset($this->statut)) { $label .= ' '.$this->getLibStatut(5); } - if (!empty($this->ref)) + if (!empty($this->ref)) { $label .= '
'.$langs->trans('Ref').': '.$this->ref; - if (!empty($this->ref_supplier)) + } + if (!empty($this->ref_supplier)) { $label .= '
'.$langs->trans('RefSupplier').': '.$this->ref_supplier; - if (!empty($this->total_ht)) + } + if (!empty($this->total_ht)) { $label .= '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); - if (!empty($this->total_tva)) + } + if (!empty($this->total_tva)) { $label .= '
'.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); - if (!empty($this->total_ttc)) + } + if (!empty($this->total_ttc)) { $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); + } + if (!empty($this->delivery_date)) { + $label .= '
'.$langs->trans('DeliveryDate').': '.dol_print_date($this->delivery_date, 'dayhour'); + } } $picto = 'order'; @@ -1257,9 +1265,10 @@ class CommandeFournisseur extends CommonOrder $error = 0; $now = dol_now(); - // $date_commande is deprecated + // set tmp vars $date = ($this->date_commande ? $this->date_commande : $this->date); // in case of date is set if (empty($date)) $date = $now; + $delivery_date = empty($this->delivery_date) ? $this->date_livraison : $this->delivery_date; // Clean parameters if (empty($this->source)) $this->source = 0; @@ -1308,7 +1317,7 @@ class CommandeFournisseur extends CommonOrder $sql .= ", ".$this->socid; $sql .= ", ".($this->fk_project > 0 ? $this->fk_project : "null"); $sql .= ", '".$this->db->idate($date)."'"; - $sql .= ", ".($this->date_livraison ? "'".$this->db->idate($this->date_livraison)."'" : "null"); + $sql .= ", ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : "null"); $sql .= ", ".$user->id; $sql .= ", ".self::STATUS_DRAFT; $sql .= ", ".$this->db->escape($this->source); @@ -2925,7 +2934,7 @@ class CommandeFournisseur extends CommonOrder { $response->nbtodo++; - $commandestatic->date_livraison = $this->db->jdate($obj->delivery_date); + $commandestatic->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated $commandestatic->delivery_date = $this->db->jdate($obj->delivery_date); $commandestatic->date_commande = $this->db->jdate($obj->date_commande); $commandestatic->statut = $obj->fk_statut; @@ -3079,10 +3088,10 @@ class CommandeFournisseur extends CommonOrder { global $conf; - if (empty($this->date_delivery) && !empty($this->date_livraison)) $this->date_delivery = $this->date_livraison; // For backward compatibility + if (empty($this->delivery_date) && !empty($this->date_livraison)) $this->delivery_date = $this->date_livraison; // For backward compatibility $now = dol_now(); - $date_to_test = empty($this->date_delivery) ? $this->date_commande : $this->date_delivery; + $date_to_test = empty($this->delivery_date) ? $this->date_commande : $this->delivery_date; return ($this->statut > 0 && $this->statut < 5) && $date_to_test && $date_to_test < ($now - $conf->commande->fournisseur->warning_delay); } @@ -3096,9 +3105,9 @@ class CommandeFournisseur extends CommonOrder { global $conf, $langs; - if (empty($this->date_delivery) && !empty($this->date_livraison)) $this->date_delivery = $this->date_livraison; // For backward compatibility + if (empty($this->delivery_date) && !empty($this->date_livraison)) $this->delivery_date = $this->date_livraison; // For backward compatibility - if (empty($this->date_delivery)) $text = $langs->trans("OrderDate").' '.dol_print_date($this->date_commande, 'day'); + if (empty($this->delivery_date)) $text = $langs->trans("OrderDate").' '.dol_print_date($this->date_commande, 'day'); else $text = $text = $langs->trans("DeliveryDate").' '.dol_print_date($this->date_delivery, 'day'); $text .= ' '.($conf->commande->fournisseur->warning_delay > 0 ? '+' : '-').' '.round(abs($conf->commande->fournisseur->warning_delay) / 3600 / 24, 1).' '.$langs->trans("days").' < '.$langs->trans("Today"); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index ad4662a156c..b4f3570ff34 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1145,7 +1145,7 @@ if (empty($reshook)) $object->fk_account = GETPOST('fk_account', 'int'); $object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml'); - $object->date_livraison = $datelivraison; + $object->date_livraison = $datelivraison; // deprecated $object->delivery_date = $datelivraison; $object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); @@ -1200,7 +1200,8 @@ if (empty($reshook)) $result = $srcobject->fetch($object->origin_id); if ($result > 0) { - $object->setDeliveryDate($user, $srcobject->date_livraison); + $tmpdate = ($srcobject->delivery_date ? $srcobject->delivery_date : $srcobject->date_livraison); + $object->setDeliveryDate($user, $tmpdate); $object->set_id_projet($user, $srcobject->fk_project); $lines = $srcobject->lines; @@ -1552,7 +1553,7 @@ if ($action == 'create') $remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : ''; - $datedelivery = (!empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : ''); + $datedelivery = (!empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : '')); if (!empty($conf->multicurrency->enabled)) { @@ -2161,14 +2162,14 @@ if ($action == 'create') print ''; $usehourmin = 0; if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin = 1; - print $form->selectDate($object->date_livraison ? $object->date_livraison : -1, 'liv_', $usehourmin, $usehourmin, '', "setdate_livraison"); + print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', $usehourmin, $usehourmin, '', "setdate_livraison"); print ''; print ''; } else { $usehourmin = 'day'; if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin = 'dayhour'; - print $object->date_livraison ? dol_print_date($object->date_livraison, $usehourmin) : ' '; - if ($object->hasDelay() && !empty($object->date_livraison)) { + print $object->delivery_date ? dol_print_date($object->delivery_date, $usehourmin) : ' '; + if ($object->hasDelay() && !empty($object->delivery_date)) { print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } } diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 7b41e7030b1..a77606abb3f 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -2068,8 +2068,8 @@ function migrate_commande_livraison($db, $langs, $conf) $db->begin(); - $sql = "SELECT l.rowid, l.fk_commande"; - $sql .= ", c.ref_client, c.date_livraison"; + $sql = "SELECT l.rowid, l.fk_commande,"; + $sql .= " c.ref_client, c.date_livraison as delivery_date"; $sql .= " FROM ".MAIN_DB_PREFIX."livraison as l, ".MAIN_DB_PREFIX."commande as c"; $sql .= " WHERE c.rowid = l.fk_commande"; $resql = $db->query($sql); @@ -2090,7 +2090,7 @@ function migrate_commande_livraison($db, $langs, $conf) if ($resql2) { - $delivery_date = $db->jdate($obj->date_livraison); + $delivery_date = $db->jdate($obj->delivery_date); $sqlu = "UPDATE ".MAIN_DB_PREFIX."livraison SET"; $sqlu .= " ref_client='".$db->escape($obj->ref_client)."'"; @@ -3007,7 +3007,7 @@ function migrate_customerorder_shipping($db, $langs, $conf) if ($db->query($sqlAdd1) && $db->query($sqlAdd2)) { - $sqlSelect = "SELECT e.rowid as shipping_id, c.ref_client, c.date_livraison"; + $sqlSelect = "SELECT e.rowid as shipping_id, c.ref_client, c.date_livraison as delivery_date"; $sqlSelect .= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sqlSelect .= ", ".MAIN_DB_PREFIX."element_element as el"; $sqlSelect .= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON c.rowid = el.fk_source AND el.sourcetype = 'commande'"; @@ -3028,7 +3028,7 @@ function migrate_customerorder_shipping($db, $langs, $conf) $sqlUpdate = "UPDATE ".MAIN_DB_PREFIX."expedition SET"; $sqlUpdate .= " ref_customer = '".$db->escape($obj->ref_client)."'"; - $sqlUpdate .= ", date_delivery = '".$db->escape($obj->date_livraison ? $obj->date_livraison : 'null')."'"; + $sqlUpdate .= ", date_delivery = '".$db->escape($obj->delivery_date ? $obj->delivery_date : 'null')."'"; $sqlUpdate .= " WHERE rowid = ".$obj->shipping_id; $result = $db->query($sqlUpdate); diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 62fc287fba3..169ffd327ad 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -111,6 +111,8 @@ $hookmanager->initHooks(array('receptioncard', 'globalcard')); $permissiondellink = $user->rights->reception->creer; // Used by the include of actions_dellink.inc.php //var_dump($object->lines[0]->detail_batch); +$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int')); + /* * Actions @@ -226,8 +228,6 @@ if (empty($reshook)) $object->size_units = GETPOST('size_units', 'int'); $object->weight_units = GETPOST('weight_units', 'int'); - $date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int')); - // On va boucler sur chaque ligne du document d'origine pour completer objet reception // avec info diverses + qte a livrer @@ -777,8 +777,7 @@ if ($action == 'create') // Date delivery planned print ''.$langs->trans("DateDeliveryPlanned").''; print ''; - //print dol_print_date($object->date_livraison,"day"); // date_livraison come from order and will be stored into date_delivery planed. - $date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST + $date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date); // $date_delivery comes from GETPOST print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); print "\n"; print ''; diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index b99ba707251..4df73cce925 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -409,7 +409,7 @@ $formfile = new FormFile($db); $helpurl = 'EN:Module_Receptions|FR:Module_Receptions|ES:Módulo_Receptiones'; llxHeader('', $langs->trans('ListOfReceptions'), $helpurl); -$sql = "SELECT e.rowid, e.ref, e.ref_supplier, e.date_reception as date_reception, e.date_delivery as date_livraison, l.date_delivery as date_reception, e.fk_statut, e.billed,"; +$sql = "SELECT e.rowid, e.ref, e.ref_supplier, e.date_reception as date_reception, e.date_delivery as delivery_date, l.date_delivery as date_reception2, e.fk_statut, e.billed,"; $sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, '; $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; @@ -499,21 +499,21 @@ if ($resql) $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; - if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage; - if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit; - if ($sall) $param .= "&sall=".$sall; - if ($search_ref_rcp) $param .= "&search_ref_rcp=".$search_ref_rcp; - if ($search_ref_liv) $param .= "&search_ref_liv=".$search_ref_liv; - if ($search_company) $param .= "&search_company=".$search_company; - if ($optioncss != '') $param .= '&optioncss='.$optioncss; - if ($search_billed != '' && $search_billed >= 0)$param .= "&search_billed=".$search_billed; - if ($search_town) $param .= "&search_town=".$search_town; - if ($search_zip) $param .= "&search_zip=".$search_zip; - if ($search_state) $param .= "&search_state=".$search_state; - if ($search_status) $param .= "&search_status=".$search_status; - if ($search_country) $param .= "&search_country=".$search_country; - if ($search_type_thirdparty) $param .= "&search_type_thirdparty=".$search_type_thirdparty; - if ($search_ref_supplier) $param .= "&search_ref_supplier=".$search_ref_supplier; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); + if ($sall) $param .= "&sall=".urlencode($sall); + if ($search_ref_rcp) $param .= "&search_ref_rcp=".urlencode($search_ref_rcp); + if ($search_ref_liv) $param .= "&search_ref_liv=".urlencode($search_ref_liv); + if ($search_company) $param .= "&search_company=".urlencode($search_company); + if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); + if ($search_billed != '' && $search_billed >= 0) $param .= "&search_billed=".urlencode($search_billed); + if ($search_town) $param .= "&search_town=".urlencode($search_town); + if ($search_zip) $param .= "&search_zip=".urlencode($search_zip); + if ($search_state) $param .= "&search_state=".urlencode($search_state); + if ($search_status) $param .= "&search_status=".urlencode($search_status); + if ($search_country) $param .= "&search_country=".urlencode($search_country); + if ($search_type_thirdparty) $param .= "&search_type_thirdparty=".urlencode($search_type_thirdparty); + if ($search_ref_supplier) $param .= "&search_ref_supplier=".urlencode($search_ref_supplier); // Add $param from extra fields foreach ($search_array_options as $key => $val) { @@ -838,7 +838,7 @@ if ($resql) if (!empty($arrayfields['e.date_delivery']['checked'])) { print ''; - print dol_print_date($db->jdate($obj->date_livraison), "day"); + print dol_print_date($db->jdate($obj->delivery_date), "day"); /*$now = time(); if ( ($now - $db->jdate($obj->date_reception)) > $conf->warnings->lim && $obj->statutid == 1 ) { diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 5a5e73a1927..eb918d8b3b4 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -257,7 +257,7 @@ if (empty($reshook)) { if ($object->fetch(GETPOST('copie_supplier_proposal')) > 0) { $object->ref = GETPOST('ref'); - $object->date_livraison = $date_delivery; + $object->date_livraison = $date_delivery; // deprecated $object->delivery_date = $date_delivery; $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); $object->cond_reglement_id = GETPOST('cond_reglement_id'); @@ -1565,11 +1565,11 @@ if ($action == 'create') print '
'; print ''; print ''; - print $form->selectDate($object->date_livraison, 'liv_', '', '', '', "editdate_livraison"); + print $form->selectDate($object->delivery_date, 'liv_', '', '', '', "editdate_livraison"); print ''; print '
'; } else { - print dol_print_date($object->date_livraison, 'daytext'); + print dol_print_date($object->delivery_date, 'daytext'); } print ''; print ''; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 59305cf7548..74bbf1afa7e 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -109,6 +109,12 @@ class SupplierProposal extends CommonObject */ public $date; + /** + * @var integer|string date_livraison + * @deprecated + */ + public $date_livraison; + /** * @var integer|string date_livraison */ @@ -855,8 +861,6 @@ class SupplierProposal extends CommonObject dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); return -3; } - - // Check parameters if (!empty($this->ref)) // We check that ref is not already used { $result = self::isExistingObject($this->element, 0, $this->ref); // Check ref is not yet used @@ -869,6 +873,9 @@ class SupplierProposal extends CommonObject } } + // Set tmp vars + $delivery_date = empty($this->delivery_date) ? $this->date_livraison : $this->delivery_date; + // Multicurrency if (!empty($this->multicurrency_code)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $now); if (empty($this->fk_multicurrency)) @@ -923,7 +930,7 @@ class SupplierProposal extends CommonObject $sql .= ", ".($this->cond_reglement_id > 0 ? $this->cond_reglement_id : 'NULL'); $sql .= ", ".($this->mode_reglement_id > 0 ? $this->mode_reglement_id : 'NULL'); $sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL'); - $sql .= ", ".($this->date_livraison != '' ? "'".$this->db->idate($this->date_livraison)."'" : "null"); + $sql .= ", ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : "null"); $sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL'); $sql .= ", ".($this->fk_project ? $this->fk_project : "null"); $sql .= ", ".$conf->entity; @@ -1256,7 +1263,7 @@ class SupplierProposal extends CommonObject $this->datev = $this->db->jdate($obj->datev); // TODO deprecated $this->date_creation = $this->db->jdate($obj->datec); //Creation date $this->date_validation = $this->db->jdate($obj->datev); //Validation date - $this->date_livraison = $this->db->jdate($obj->delivery_date); + $this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated $this->delivery_date = $this->db->jdate($obj->delivery_date); $this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null; @@ -1538,6 +1545,7 @@ class SupplierProposal extends CommonObject if ($this->db->query($sql)) { $this->date_livraison = $delivery_date; + $this->delivery_date = $delivery_date; return 1; } else { $this->error = $this->db->error(); From 928330c44b74f73b38b0b3b4c267891306807a93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Nov 2020 12:42:59 +0100 Subject: [PATCH 07/39] Fix link to reconciliation page --- htdocs/compta/bank/bankentries_list.php | 2 +- htdocs/compta/bank/list.php | 18 +++++++++--------- htdocs/langs/en_US/compta.lang | 2 +- htdocs/langs/en_US/main.lang | 1 + 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 437516df50b..f8b978ca4c8 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1093,7 +1093,7 @@ if ($resql) } print ''; - print ''; + print ''; print ' '; $formconfirm .= "\n"; } else { - $formconfirm .= "\n\n"; + $formconfirm .= "\n\n"; if (empty($disableformtag)) $formconfirm .= '
'."\n"; @@ -4415,7 +4415,7 @@ class Form $formconfirm .= ''; $formconfirm .= $this->selectyesno("confirm", $newselectedchoice); $formconfirm .= ''; - $formconfirm .= ''; + $formconfirm .= ''; $formconfirm .= ''."\n"; $formconfirm .= ''."\n"; @@ -4423,6 +4423,23 @@ class Form if (empty($disableformtag)) $formconfirm .= "
\n"; $formconfirm .= '
'; + if (empty($conf->use_javascript_ajax)) { + $formconfirm .= ''; + $formconfirm .= ''."\n"; + } + $formconfirm .= "\n"; } From 73b35f334e1bbf31e512937fa0d55ea8ccf89ebd Mon Sep 17 00:00:00 2001 From: kamel Date: Wed, 18 Nov 2020 09:41:42 +0100 Subject: [PATCH 28/39] NEW: Add new option for displaying Contact email (or phones if not defined) and town info list (select list or combobox) Contacts will appear with a name format of "Dupond Durand - dupond.durand@email.com - Paris" or "Dupond Durand - 06 07 59 65 66 - Paris" instead of "Dupond Durand". --- htdocs/core/class/html.form.class.php | 31 ++++++++++++++++++++++---- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + htdocs/societe/admin/societe.php | 32 +++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 092216e531f..cac64ea14ad 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1464,9 +1464,10 @@ class Form // We search third parties $sql = "SELECT sp.rowid, sp.lastname, sp.statut, sp.firstname, sp.poste"; + if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) $sql.= ", sp.email, sp.phone, sp.phone_perso, sp.phone_mobile, sp.town AS contact_town, s.town AS company_town"; if ($showsoc > 0) $sql .= " , s.nom as company"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - if ($showsoc > 0) $sql .= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=sp.fk_soc"; + if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) $sql .= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=sp.fk_soc"; $sql .= " WHERE sp.entity IN (".getEntity('socpeople').")"; if ($socid > 0 || $socid == -1) $sql .= " AND sp.fk_soc=".$socid; if (!empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) $sql .= " AND sp.statut <> 0"; @@ -1499,6 +1500,28 @@ class Form { $obj = $this->db->fetch_object($resql); + // Set email (or phones) and town extended infos + $extendedInfos = ''; + if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) { + $extendedInfos = array(); + $email = trim($obj->email); + if (!empty($email)) $extendedInfos[] = $email; + else { + $phone = trim($obj->phone); + $phone_perso = trim($obj->phone_perso); + $phone_mobile = trim($obj->phone_mobile); + if (!empty($phone)) $extendedInfos[] = $phone; + if (!empty($phone_perso)) $extendedInfos[] = $phone_perso; + if (!empty($phone_mobile)) $extendedInfos[] = $phone_mobile; + } + $contact_town = trim($obj->contact_town); + $company_town = trim($obj->company_town); + if (!empty($contact_town)) $extendedInfos[] = $contact_town; + elseif (!empty($company_town)) $extendedInfos[] = $company_town; + $extendedInfos = implode(' - ', $extendedInfos); + if (!empty($extendedInfos)) $extendedInfos = ' - ' . $extendedInfos; + } + $contactstatic->id = $obj->rowid; $contactstatic->lastname = $obj->lastname; $contactstatic->firstname = $obj->firstname; @@ -1513,7 +1536,7 @@ class Form $out .= ''; @@ -1521,7 +1544,7 @@ class Form $out .= ''; @@ -1529,7 +1552,7 @@ class Form } else { if (in_array($obj->rowid, $selected)) { - $out .= $contactstatic->getFullName($langs); + $out .= $contactstatic->getFullName($langs) . $extendedInfos; if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')'; if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')'; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ac3fb07e796..dd8e6fe6538 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1314,6 +1314,7 @@ PHPModuleLoaded=PHP component %s is loaded PreloadOPCode=Preloaded OPCode is used AddRefInList=Display Customer/Vendor ref. info list (select list or combobox) and most of hyperlink.
Third Parties will appear with a name format of "CC12345 - SC45678 - The Big Company corp." instead of "The Big Company corp". AddAdressInList=Display Customer/Vendor adress info list (select list or combobox)
Third Parties will appear with a name format of "The Big Company corp. - 21 jump street 123456 Big town - USA" instead of "The Big Company corp". +AddEmailPhoneTownInContactList=Display Contact email (or phones if not defined) and town info list (select list or combobox)
Contacts will appear with a name format of "Dupond Durand - dupond.durand@email.com - Paris" or "Dupond Durand - 06 07 59 65 66 - Paris" instead of "Dupond Durand". AskForPreferredShippingMethod=Ask for preferred shipping method for Third Parties. FieldEdition=Edition of field %s FillThisOnlyIfRequired=Example: +2 (fill only if timezone offset problems are experienced) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index d7842084c17..ffe9e6992b2 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1276,6 +1276,7 @@ PHPModuleLoaded=Le composant PHP %s est chargé PreloadOPCode=Le code OP préchargé est utilisé AddRefInList=Afficher les références client/fournisseur dans les listes (listes déroulantes ou à autocomplétion) et les libellés des liens clicables.
Les tiers apparaîtront alors sous la forme "CC12345 - SC45678 - La big company coorp", au lieu de "La big company coorp". AddAdressInList=Affiche les informations sur l’adresse du client/fournisseur (liste de sélection ou liste déroulante)
Les tiers apparaîtront avec le format de nom suivant: "The Big Company corp. - 21, rue du saut 123456 Big town - USA" au lieu de "The Big Company corp". +AddEmailPhoneTownInContactList=Affiche les informations sur l’email (ou les telephones si non définie) et la ville du contact (liste de sélection ou liste déroulante)
Les contacts apparaîtront avec le format de nom suivant: "Dupond Durand - dupond.durand@email.com - Paris" ou "Dupond Durand - 06 07 59 65 66 - Paris" au lieu de "Dupond Durand". AskForPreferredShippingMethod=Demander la méthode d'expédition préférée pour les Tiers FieldEdition=Édition du champ %s FillThisOnlyIfRequired=Exemple: +2 (ne remplir que si un décalage d'heure est constaté dans l'export) diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 4a9c40acd11..73f75ac4698 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -198,6 +198,21 @@ if ($action == "setaddadressinlist") { } } +//Activate Set email phone town in contact list +if ($action=="setaddemailphonetownincontactlist") { + $val = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST", $val, 'yesno', 0, '', $conf->entity); + if (! $res > 0) $error++; + if (! $error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + //Activate Ask For Preferred Shipping Method if ($action == "setaskforshippingmet") { $setaskforshippingmet = GETPOST('value', 'int'); @@ -800,6 +815,23 @@ if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) print ''; print ''; +print ''; +print ''.$langs->trans("AddEmailPhoneTownInContactList").''; +print ' '; +print ''; +if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) +{ + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); +} +else +{ + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); +} +print ''; +print ''; + if (!empty($conf->expedition->enabled)) { if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { // Visible on experimental only because seems to not be implemented everywhere (only on proposal) print ''; From 709822635cc38021fc18b5478fae7e58cbd384d0 Mon Sep 17 00:00:00 2001 From: kamel Date: Wed, 18 Nov 2020 09:46:23 +0100 Subject: [PATCH 29/39] Correction Stickler CI --- htdocs/societe/admin/societe.php | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 73f75ac4698..84c53494ce9 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -199,16 +199,13 @@ if ($action == "setaddadressinlist") { } //Activate Set email phone town in contact list -if ($action=="setaddemailphonetownincontactlist") { +if ($action == "setaddemailphonetownincontactlist") { $val = GETPOST('value', 'int'); $res = dolibarr_set_const($db, "CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST", $val, 'yesno', 0, '', $conf->entity); - if (! $res > 0) $error++; - if (! $error) - { + if (!$res > 0) $error++; + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else - { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -816,17 +813,14 @@ print ''; print ''; print ''; -print ''.$langs->trans("AddEmailPhoneTownInContactList").''; +print '' . $langs->trans("AddEmailPhoneTownInContactList") . ''; print ' '; print ''; -if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) -{ - print ''; +if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) { + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); -} -else -{ - print ''; +} else { + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } print ''; From 889a5d0be16606132207ec712b2e0b0a3e48ba7e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Nov 2020 12:04:41 +0100 Subject: [PATCH 30/39] Update commondocgenerator.class.php --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 607982ee062..221bd103d19 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -121,7 +121,7 @@ abstract class CommonDocGenerator global $conf, $extrafields; if ($member->photo) { - $logotouse = $conf->adherent->dir_output.'/'.$member->id.'/photos/'.$member->photo; + $logotouse = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $member, 'user').'/photos/'.$member->photo; } else { $logotouse = DOL_DOCUMENT_ROOT . '/public/theme/common/nophoto.png'; } From 2529448f1b49c334c4dc84a242b94168724da6c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Nov 2020 12:37:18 +0100 Subject: [PATCH 31/39] Fix path to files --- htdocs/bom/bom_document.php | 3 +- htdocs/core/lib/functions.lib.php | 34 +++++++++---------- htdocs/holiday/document.php | 2 +- .../template/myobject_document.php | 3 +- htdocs/mrp/mo_document.php | 3 +- .../recruitmentcandidature_document.php | 2 +- .../recruitmentjobposition_document.php | 2 +- 7 files changed, 23 insertions(+), 26 deletions(-) diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index 92423977be8..cf752878605 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -69,8 +69,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals -//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->bom->multidir_output[$object->entity?$object->entity:1] . "/bom/" . dol_sanitizeFileName($object->id); -if ($id > 0 || !empty($ref)) $upload_dir = $conf->bom->multidir_output[$object->entity ? $object->entity : 1]."/bom/".dol_sanitizeFileName($object->ref); +if ($id > 0 || !empty($ref)) $upload_dir = $conf->bom->multidir_output[$object->entity ? $object->entity : 1]."/bom/".get_exdir(0, 0, 0, 1, $object); /* diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4aa46784ad4..995ee525d7a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5525,23 +5525,25 @@ function yn($yesno, $case = 1, $color = 0) /** * Return a path to have a the directory according to object where files are stored. - * New usage: $conf->module->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, $modulepart) - * or: $conf->module->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, $modulepart) if multidir_output not defined. + * New usage: $conf->module->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, '') + * or: $conf->module->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, '') if multidir_output not defined. * Example our with new usage: $object is invoice -> 'INYYMM-ABCD' * Example our with old usage: '015' with level 3->"0/1/5/", '015' with level 1->"5/", 'ABC-1' with level 3 ->"0/0/1/" * - * @param string $num Id of object (deprecated, $object will be used in future) - * @param int $level Level of subdirs to return (1, 2 or 3 levels). (deprecated, global option will be used in future) - * @param int $alpha 0=Keep number only to forge path, 1=Use alpha part afer the - (By default, use 0). (deprecated, global option will be used in future) - * @param int $withoutslash 0=With slash at end (except if '/', we return ''), 1=without slash at end - * @param Object $object Object - * @param string $modulepart Type of object ('invoice_supplier, 'donation', 'invoice', ...') - * @return string Dir to use ending. Example '' or '1/' or '1/2/' + * @param string|int $num Id of object (deprecated, $object will be used in future) + * @param int $level Level of subdirs to return (1, 2 or 3 levels). (deprecated, global option will be used in future) + * @param int $alpha 0=Keep number only to forge path, 1=Use alpha part afer the - (By default, use 0). (deprecated, global option will be used in future) + * @param int $withoutslash 0=With slash at end (except if '/', we return ''), 1=without slash at end + * @param Object $object Object to use to get ref to forge the path. + * @param string $modulepart Type of object ('invoice_supplier, 'donation', 'invoice', ...'). Use '' for autodetect from $object. + * @return string Dir to use ending. Example '' or '1/' or '1/2/' */ -function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart) +function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '') { global $conf; + if (empty($modulepart) && !empty($object->module)) $modulepart = $object->module; + $path = ''; $arrayforoldpath = array('cheque', 'user', 'category', 'holiday', 'supplier_invoice', 'invoice_supplier', 'mailing', 'supplier_payment'); @@ -5556,14 +5558,12 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart) if ($level == 2) $path = substr($num, 1, 1).'/'.substr($num, 0, 1); if ($level == 3) $path = substr($num, 2, 1).'/'.substr($num, 1, 1).'/'.substr($num, 0, 1); } else { - // TODO - // We will enhance here a common way of forging path for document storage - // Here, object->id, object->ref and modulepart are required. + // We will enhance here a common way of forging path for document storage. + // In a future, we may distribut directories on several levels depending on setup and object. + // Here, $object->id, $object->ref and $modulepart are required. //var_dump($modulepart); - if (in_array($modulepart, array('thirdparty', 'contact', 'member', 'propal', 'proposal', 'commande', 'order', 'facture', 'invoice', - 'supplier_order', 'supplier_proposal', 'shipment', 'contract', 'expensereport', 'ficheinter'))) - { - $path = ($object->ref ? $object->ref : $object->id); + if (! in_array($modulepart, array('product'))) { // Test to remove + $path = dol_sanitizeFileName(empty($object->ref) ? $object->id : $object->ref); } } diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index 192c7d24e33..f366bb50c85 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -64,7 +64,7 @@ if (!$sortfield) $sortfield = "position_name"; $object = new Holiday($db); $object->fetch($id, $ref); -$upload_dir = $conf->holiday->dir_output.'/'.get_exdir($object->id, 0, 0, 0, $object, 'holiday').dol_sanitizeFileName($object->ref); +$upload_dir = $conf->holiday->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, ''); $modulepart = 'holiday'; diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index b2158ac34ad..7399fa6fb09 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -98,8 +98,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals -//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity?$object->entity:$conf->entity] . "/myobject/" . dol_sanitizeFileName($object->id); -if ($id > 0 || !empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity ? $object->entity : $conf->entity]."/myobject/".dol_sanitizeFileName($object->ref); +if ($id > 0 || !empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity ? $object->entity : $conf->entity]."/myobject/".get_exdir(0, 0, 0, 1, $object); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php index 7ddf92c5cd1..01131b9ffa2 100644 --- a/htdocs/mrp/mo_document.php +++ b/htdocs/mrp/mo_document.php @@ -67,8 +67,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals -//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mrp->multidir_output[$object->entity?$object->entity:$conf->entity] . "/mo/" . dol_sanitizeFileName($object->id); -if ($id > 0 || !empty($ref)) $upload_dir = $conf->mrp->multidir_output[$object->entity ? $object->entity : $conf->entity]."/mo/".dol_sanitizeFileName($object->ref); +if ($id > 0 || !empty($ref)) $upload_dir = $conf->mrp->multidir_output[$object->entity ? $object->entity : $conf->entity]."/mo/".get_exdir(0, 0, 0, 1, $object); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); diff --git a/htdocs/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php index cd8e24118fc..1c801f27fd4 100644 --- a/htdocs/recruitment/recruitmentcandidature_document.php +++ b/htdocs/recruitment/recruitmentcandidature_document.php @@ -77,7 +77,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals -if ($id > 0 || !empty($ref)) $upload_dir = $conf->recruitment->multidir_output[$object->entity ? $object->entity : $conf->entity]."/recruitmentcandidature/".dol_sanitizeFileName($object->ref); +if ($id > 0 || !empty($ref)) $upload_dir = $conf->recruitment->multidir_output[$object->entity ? $object->entity : $conf->entity]."/recruitmentcandidature/".get_exdir(0, 0, 0, 1, $object); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php index a9c06f57b95..3005b4cc1be 100644 --- a/htdocs/recruitment/recruitmentjobposition_document.php +++ b/htdocs/recruitment/recruitmentjobposition_document.php @@ -77,7 +77,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals -if ($id > 0 || !empty($ref)) $upload_dir = $conf->recruitment->multidir_output[$object->entity ? $object->entity : $conf->entity]."/recruitmentjobposition/".dol_sanitizeFileName($object->ref); +if ($id > 0 || !empty($ref)) $upload_dir = $conf->recruitment->multidir_output[$object->entity ? $object->entity : $conf->entity]."/recruitmentjobposition/".get_exdir(0, 0, 0, 1, $object); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); From 780b8a6fb21b1b83ccf4aab39c85cceabf545386 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Nov 2020 12:40:21 +0100 Subject: [PATCH 32/39] Fix navigation between members --- htdocs/adherents/document.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index f9c14b91ac3..969bf3a8906 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -37,7 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; $langs->loadLangs(array("companies", "members", "other")); -$id = GETPOST('id', 'int'); +$id = GETPOSTISSET('id') ? GETPOST('id', 'int') : GETPOST('rowid', 'int'); +$ref = GETPOST('ref', 'alphanohtml'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -60,7 +61,7 @@ if (!$sortfield) $sortfield = "name"; $form = new Form($db); $object = new Adherent($db); $membert = new AdherentType($db); -$result = $object->fetch($id); +$result = $object->fetch($id, $ref); if ($result < 0) { dol_print_error($db); exit; From 1a21ace02d646a5c37962d4f431d54a35b014aea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Nov 2020 12:42:33 +0100 Subject: [PATCH 33/39] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 229bf0f0c08..6ac872d7555 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3100,7 +3100,7 @@ class CommandeFournisseur extends CommonOrder if (empty($this->delivery_date)) { $text = $langs->trans("OrderDate").' '.dol_print_date($this->date_commande, 'day'); } else { - $text = $text = $langs->trans("DeliveryDate").' '.dol_print_date($this->delivery_date, 'day'); + $text = $langs->trans("DeliveryDate").' '.dol_print_date($this->delivery_date, 'day'); } $text .= ' '.($conf->commande->fournisseur->warning_delay > 0 ? '+' : '-').' '.round(abs($conf->commande->fournisseur->warning_delay) / 3600 / 24, 1).' '.$langs->trans("days").' < '.$langs->trans("Today"); From a5a7197506f86df76a1a6e082023db2b5bf582a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Nov 2020 12:45:37 +0100 Subject: [PATCH 34/39] Update extrafields.class.php --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index e68ef5420de..60ec9c6f6b4 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2025,7 +2025,7 @@ class ExtraFields $value_arr = GETPOST("options_".$key, 'alpha'); $value_key = price2num($value_arr); } elseif (in_array($key_type, array('html'))) { - $value_key = GETPOST("options_".$key, 'none'); + $value_key = GETPOST("options_".$key, 'restricthtml'); } elseif (in_array($key_type, array('text'))) { $value_key = GETPOST("options_".$key, 'alphanohtml'); } else { From 8d8f0026c292436f7656959b681deac83865f7b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Nov 2020 13:06:30 +0100 Subject: [PATCH 35/39] Fix switch date to datetime --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 2 +- htdocs/core/tpl/admin_extrafields_edit.tpl.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 05d0ffebc41..367faa630ba 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -153,7 +153,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con trans("AttributeCode"); ?> (trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>) trans("Type"); ?> -selectarray('type', $type2label, GETPOST('type', 'alpha')); ?> +selectarray('type', $type2label, GETPOST('type', 'alpha'), 0, 0, 0, '', 0, 0, 0, '', '', 1); ?> trans("Size"); ?> diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 61971945183..5c1680d9ecb 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -205,7 +205,8 @@ $typewecanchangeinto = array( 'mail'=>array('varchar', 'phone', 'mail', 'url', 'select'), 'url'=>array('varchar', 'phone', 'mail', 'url', 'select'), 'phone'=>array('varchar', 'phone', 'mail', 'url', 'select'), - 'select'=>array('varchar', 'phone', 'mail', 'url', 'select') + 'select'=>array('varchar', 'phone', 'mail', 'url', 'select'), + 'date'=>array('date', 'datetime') ); /* Disabled because text is text on several lines, when varchar is text on 1 line, we should not be able to convert if ($size <= 255 && in_array($type, array('text', 'html'))) { @@ -224,6 +225,7 @@ if (in_array($type, array_keys($typewecanchangeinto))) else print ''; } print ''; + print ajax_combobox('type'); } else { print $type2label[$type]; print ''; From e78b9a421d9b5e139510efc958d9d75dc899eeca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Nov 2020 13:14:29 +0100 Subject: [PATCH 36/39] Fix sql --- htdocs/core/class/html.form.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cac64ea14ad..cbe356ed169 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1463,9 +1463,8 @@ class Form } // We search third parties - $sql = "SELECT sp.rowid, sp.lastname, sp.statut, sp.firstname, sp.poste"; - if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) $sql.= ", sp.email, sp.phone, sp.phone_perso, sp.phone_mobile, sp.town AS contact_town, s.town AS company_town"; - if ($showsoc > 0) $sql .= " , s.nom as company"; + $sql = "SELECT sp.rowid, sp.lastname, sp.statut, sp.firstname, sp.poste, sp.email, sp.phone, sp.phone_perso, sp.phone_mobile, sp.town AS contact_town"; + if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) $sql .= ", s.nom as company, s.town AS company_town"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) $sql .= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=sp.fk_soc"; $sql .= " WHERE sp.entity IN (".getEntity('socpeople').")"; From c5929a62b76a4e7572b040d0bee2f860cacbcf6b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Nov 2020 13:17:53 +0100 Subject: [PATCH 37/39] Fix token --- htdocs/societe/admin/societe.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 84c53494ce9..463f6c26aeb 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -395,7 +395,7 @@ foreach ($arrayofmodules as $file => $modCodeTiers) } else { $disabled = (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? true : false); print ''; - if (!$disabled) print ''; + if (!$disabled) print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); if (!$disabled) print ''; print ''; @@ -571,7 +571,7 @@ foreach ($dirsociete as $dirroot) print "\n"; //if ($conf->global->COMPANY_ADDON_PDF != "$name") //{ - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; //} @@ -583,12 +583,12 @@ foreach ($dirsociete as $dirroot) } else { if (versioncompare($module->phpmin, versionphparray()) > 0) { - print "\n"; + print ''."\n"; print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion", join('.', $module->phpmin))), 'switch_off'); print ""; } else { - print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''."\n"; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } } @@ -611,7 +611,7 @@ foreach ($dirsociete as $dirroot) print ''; if ($module->type == 'pdf') { - $linkspec = ''.img_object($langs->trans("Preview"), 'bill').''; + $linkspec = ''.img_object($langs->trans("Preview"), 'bill').''; } else { $linkspec = img_object($langs->trans("PreviewNotAvailable"), 'generic'); } From 2cbb1c09d53c47a42b549ff4cdb50bdab80048e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Nov 2020 13:18:47 +0100 Subject: [PATCH 38/39] Add missing token --- htdocs/societe/admin/societe.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 463f6c26aeb..ac26eed537a 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -817,10 +817,10 @@ print '' . $langs->trans("AddEmailPhoneTownInContactList") . ' '; print ''; if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } print ''; From cfee518338802a8eedad5d67ea9c087f81709612 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Nov 2020 14:03:44 +0100 Subject: [PATCH 39/39] Fix trans --- htdocs/langs/en_US/intracommreport.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/intracommreport.lang b/htdocs/langs/en_US/intracommreport.lang index 3060300b974..93c46f112bb 100644 --- a/htdocs/langs/en_US/intracommreport.lang +++ b/htdocs/langs/en_US/intracommreport.lang @@ -32,7 +32,7 @@ IntracommReportTitle=Preparation of an XML file in ProDouane format # List IntracommReportList=List of generated declarations IntracommReportNumber=Numero of declaration -IntracommReportPeriod=Period of nalysis +IntracommReportPeriod=Period of analysis IntracommReportTypeDeclaration=Type of declaration IntracommReportDownload=download XML file