From 3d50c454c154d979bff50044d53f02a45d26a7a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Sep 2018 17:05:44 +0200 Subject: [PATCH 01/40] Code comment --- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/commande/class/commande.class.php | 5 +++-- htdocs/compta/facture/class/facture.class.php | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index cf7610a218e..dc1997315f3 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -4188,7 +4188,7 @@ class PropaleLigne extends CommonObjectLine * Update DB line fields total_xxx * Used by migration * - * @return int <0 if ko, >0 if ok + * @return int <0 if KO, >0 if OK */ function update_total() { diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index ecd2be95d7a..11fd6ac83ba 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -4253,9 +4253,10 @@ class OrderLine extends CommonOrderLine } /** - * Update totals of order into database + * Update DB line fields total_xxx + * Used by migration * - * @return int <0 if ko, >0 if ok + * @return int <0 if KO, >0 if OK */ function update_total() { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 2329b1caeb0..de623645357 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4784,8 +4784,8 @@ class FactureLigne extends CommonInvoiceLine } /** - * Mise a jour en base des champs total_xxx de ligne de facture - * TODO What is goal of this method ? + * Update DB line fields total_xxx + * Used by migration * * @return int <0 if KO, >0 if OK */ From e285b42a185c4394b123832c377b9eeb7d995c64 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Mon, 3 Sep 2018 17:55:24 +0200 Subject: [PATCH 02/40] FIX: PDF address: handle when contact thirdparty different from document thirdparty --- htdocs/core/lib/pdf.lib.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 234c0cc7e34..b47bfbc79e6 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -432,8 +432,15 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target if (!empty($targetcontact->address)) { $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n"; - }else { - $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany))."\n"; + } else { + $companytouse = $targetcompany; + + if($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) { // Contact thirdparty different from document thirdparty + $targetcontact->fetch_thirparty(); + $companytouse = $targetcontact->thirdparty; + } + + $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($companytouse))."\n"; } // Country if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) { From 392f31abbdf6973a84dd574dcb69db95502be519 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 00:21:48 +0200 Subject: [PATCH 03/40] FIX invert mime type and name --- htdocs/public/payment/paymentok.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 47e22e12c8b..a5b6b38ea35 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -534,7 +534,7 @@ if ($ispaymentok) $listofmimes=array(dol_mimetype($file)); } - $result=$object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofnames, $listofmimes, "", "", 0, -1); + $result=$object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofmimes, $listofnames, "", "", 0, -1); if ($result < 0) { @@ -546,6 +546,8 @@ if ($ispaymentok) { if ($file) $postactionmessages[] = 'Email sent to member (with invoice document attached)'; else $postactionmessages[] = 'Email sent to member (without any attached document)'; + + // TODO Add actioncomm event } } } From 6ce37e588d15c3e015e6a124af4fe32d7aa3e97c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 00:22:14 +0200 Subject: [PATCH 04/40] Prepare 8.0.2 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 173f631c45c..a13100038ac 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','8.0.1'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','8.0.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From 94c05fbd848e60edf467770dc1910a01360bf37e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 00:29:31 +0200 Subject: [PATCH 05/40] Look and feel v8 --- htdocs/cron/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index cc3b8e879ed..eb326673d25 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -355,7 +355,7 @@ else print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_setup', 0, $newcardbutton, '', $limit); -print $langs->trans('CronInfo').'
'; +print ''.$langs->trans('CronInfo').'
'; $text =$langs->trans("HoursOnThisPageAreOnServerTZ").' '.$stringcurrentdate.'
'; if (! empty($conf->global->CRON_WARNING_DELAY_HOURS)) $text.=$langs->trans("WarningCronDelayed", $conf->global->CRON_WARNING_DELAY_HOURS); From db6f80e2ffa91d86fad1a6c0b761004fa1e2c603 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 00:42:15 +0200 Subject: [PATCH 06/40] FIX invoice popup hide localtax2 and 3 if not defined --- htdocs/compta/facture/class/facture.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index de623645357..7f26f3cdb53 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1185,9 +1185,9 @@ class Facture extends CommonInvoice $label.= '
' . $langs->trans('AmountHT') . ': ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); if (! empty($this->total_tva)) $label.= '
' . $langs->trans('VAT') . ': ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); - if (! empty($this->total_localtax1)) - $label.= '
' . $langs->trans('LT1') . ': ' . price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency); - if (! empty($this->total_localtax2)) + if (! empty($this->total_localtax1) && $this->total_localtax1 != 0) // We keep test != 0 because $this->total_localtax1 can be '0.00000000' + $label.= '
eee' . $langs->trans('LT1') . ': ' . price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency); + if (! empty($this->total_localtax2) && $this->total_localtax2 != 0) $label.= '
' . $langs->trans('LT2') . ': ' . price($this->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency); if (! empty($this->total_ttc)) $label.= '
' . $langs->trans('AmountTTC') . ': ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); From cdc1e1fc76097090eb09e9f45c3f4ae0494e7f47 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 09:37:51 +0200 Subject: [PATCH 07/40] Fix responsive --- htdocs/hrm/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 365d40cca96..e2b6acaec4f 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -221,7 +221,7 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) $userstatic->statut=$obj->statut; print ''; - print ''.$holidaystatic->getNomUrl(1).''; + print ''.$holidaystatic->getNomUrl(1).''; print ''.$userstatic->getNomUrl(-1, 'leave').''; print ''.$typeleaves[$obj->fk_type]['label'].''; @@ -300,7 +300,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) $userstatic->photo=$obj->photo; print ''; - print ''.$deplacementstatic->getNomUrl(1).''; + print ''.$deplacementstatic->getNomUrl(1).''; print ''.$userstatic->getNomUrl(-1).''; print ''.$obj->km.''; print ''.dol_print_date($db->jdate($obj->dm),'day').''; @@ -373,7 +373,7 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire $userstatic->photo=$obj->photo; print ''; - print ''.$expensereportstatic->getNomUrl(1).''; + print ''.$expensereportstatic->getNomUrl(1).''; print ''.$userstatic->getNomUrl(-1).''; print ''.price($obj->total_ttc).''; print ''.dol_print_date($db->jdate($obj->dm),'day').''; From 739c2822afbe1e0fbce3bca2b53ee97682c6a420 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 09:42:28 +0200 Subject: [PATCH 08/40] Fix look and feel v8 --- htdocs/expensereport/class/expensereport.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index b7c81c4d33a..7ec20f00b61 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -139,7 +139,7 @@ class ExpenseReport extends CommonObject // List of language codes for status $this->statuts_short = array(0 => 'Draft', 2 => 'Validated', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused'); $this->statuts = array(0 => 'Draft', 2 => 'ValidatedWaitingApproval', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused'); - $this->statuts_logo = array(0 => 'statut0', 2 => 'statut1', 4 => 'statut5', 5 => 'statut3', 6 => 'statut6', 99 => 'statut8'); + $this->statuts_logo = array(0 => 'statut0', 2 => 'statut1', 4 => 'statut5', 5 => 'statut3', 6 => 'statut6', 99 => 'statut5'); return 1; } From 4a7bec2c04c12f0ef696b243438137b11791c903 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 09:48:30 +0200 Subject: [PATCH 09/40] Fix fax not required as visible by default on list --- 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 30b7c5158ba..848535ce424 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -154,7 +154,7 @@ $arrayfields=array( 'p.phone'=>array('label'=>"Phone", 'checked'=>1), 'p.phone_perso'=>array('label'=>"PhonePerso", 'checked'=>0), 'p.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1), - 'p.fax'=>array('label'=>"Fax", 'checked'=>1), + 'p.fax'=>array('label'=>"Fax", 'checked'=>0), 'p.email'=>array('label'=>"EMail", 'checked'=>1), 'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->skype->enabled))), 'p.thirdparty'=>array('label'=>"ThirdParty", 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)), From 252335318fcaaf03a9543f81d6083625090c878c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 09:57:01 +0200 Subject: [PATCH 10/40] Update pdf.lib.php --- htdocs/core/lib/pdf.lib.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index b47bfbc79e6..66caf2ea23a 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -433,14 +433,16 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target if (!empty($targetcontact->address)) { $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n"; } else { - $companytouse = $targetcompany; + $companytouseforaddress = $targetcompany; - if($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) { // Contact thirdparty different from document thirdparty + // Contact on a thirdparty that is a different thirdparty than the thirdparty of object + if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) + { $targetcontact->fetch_thirparty(); - $companytouse = $targetcontact->thirdparty; + $companytouseforaddress = $targetcontact->thirdparty; } - $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($companytouse))."\n"; + $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress))."\n"; } // Country if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) { From c59b0f95e6821317244c1effa64410e64285ee5b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 10:10:47 +0200 Subject: [PATCH 11/40] FIX #9403 --- htdocs/core/class/conf.class.php | 3 +++ htdocs/core/class/html.formcompany.class.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 3b33b1f16f1..dde348cd723 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -519,6 +519,9 @@ class Conf // By default, we open card if one found if (! isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE=1; + // By default, we show state code in combo list + if (! isset($this->global->MAIN_SHOW_STATE_CODE)) $this->global->MAIN_SHOW_STATE_CODE=1; + // Define list of limited modules (value must be key found for "name" property of module, so for example 'supplierproposal' for Module "Supplier Proposal" if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,agenda,resource,adherent,blockedlog'; // '' means 'all'. Note that contact is added here as it should be a module later. if (! empty($this->modules_parts['moduleforexternal'])) // Module part to include an external module into the MAIN_MODULES_FOR_EXTERNAL list diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index f04cfad54bc..4c7c1891a7a 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -266,7 +266,7 @@ class FormCompany } // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut - if(!empty($conf->global->MAIN_SHOW_STATE_CODE) && + if (!empty($conf->global->MAIN_SHOW_STATE_CODE) && ($conf->global->MAIN_SHOW_STATE_CODE == 1 || $conf->global->MAIN_SHOW_STATE_CODE == 2 || $conf->global->MAIN_SHOW_STATE_CODE === 'all')) { if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1) { $out.= $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->name!='-'?$obj->name:'')); From 6b3ccddb6579430f2cce5dabf9714c18b8628ab3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 10:14:45 +0200 Subject: [PATCH 12/40] FIX #9396 --- htdocs/install/mysql/migration/7.0.0-8.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index f5520b6f232..18b6440f45b 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -60,7 +60,7 @@ DROP TABLE llx_c_accountancy_category; DROP TABLE llx_c_accountingaccount; -- drop old postgresql unique key --- VPGSQL8.2 DROP INDEX llx_usergroup_rights_fk_usergroup_fk_id_key +-- VPGSQL8.2 DROP INDEX llx_usergroup_rights_fk_usergroup_fk_id_key; update llx_propal set fk_statut = 1 where fk_statut = -1; From 15b3fa73f49c0c8bff644ae9b33142f45220fd9e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 10:16:16 +0200 Subject: [PATCH 13/40] FIX #9394 --- htdocs/holiday/month_report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index 1e72122c2be..6a4da422ea3 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -81,7 +81,7 @@ print ''; $sql = "SELECT cp.rowid, cp.fk_user, cp.date_debut, cp.date_fin, ct.label, cp.description, cp.halfday"; $sql .= " FROM ".MAIN_DB_PREFIX."holiday cp"; -$sql .= " LEFT JOIN llx_user u ON cp.fk_user = u.rowid"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_holiday_types ct ON cp.fk_type = ct.rowid"; $sql .= " WHERE cp.rowid > 0"; $sql .= " AND cp.statut = 3"; // Approved From 38c8d9d0083bb995c6b6860af3fe0fecc463eb23 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 10:37:29 +0200 Subject: [PATCH 14/40] FIX inconsistency behaviour on option FACTURE_ENABLE_NEGATIVE_LINES --- htdocs/compta/facture/card.php | 68 +++++++++++++++++++++++----------- htdocs/langs/en_US/errors.lang | 1 + 2 files changed, 47 insertions(+), 22 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 20d279c5113..d5cd566360c 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -513,7 +513,7 @@ if (empty($reshook)) if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) { if (! $idwarehouse || $idwarehouse == - 1) { - $error ++; + $error++; setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $action = ''; } @@ -573,7 +573,7 @@ if (empty($reshook)) if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) { if (! $idwarehouse || $idwarehouse == - 1) { - $error ++; + $error++; setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $action = ''; } @@ -832,7 +832,7 @@ if (empty($reshook)) } if (! ($_POST['fac_replacement'] > 0)) { - $error ++; + $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), null, 'errors'); } @@ -878,14 +878,14 @@ if (empty($reshook)) $sourceinvoice = GETPOST('fac_avoir'); if (! ($sourceinvoice > 0) && empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE)) { - $error ++; + $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CorrectInvoice")), null, 'errors'); } $dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); if (empty($dateinvoice)) { - $error ++; + $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors'); } @@ -1109,7 +1109,7 @@ if (empty($reshook)) { if (GETPOST('socid', 'int') < 1) { - $error ++; + $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors'); } @@ -1279,7 +1279,7 @@ if (empty($reshook)) } } else { setEventMessages($srcobject->error, $srcobject->errors, 'errors'); - $error ++; + $error++; } } @@ -1373,7 +1373,7 @@ if (empty($reshook)) $result = $object->insert_discount($discountid); // This include link_to_invoice } else { setEventMessages($discount->error, $discount->errors, 'errors'); - $error ++; + $error++; break; } } else { @@ -1429,7 +1429,7 @@ if (empty($reshook)) $lineid = $result; } else { $lineid = 0; - $error ++; + $error++; break; } @@ -1441,7 +1441,7 @@ if (empty($reshook)) } } else { setEventMessages($srcobject->error, $srcobject->errors, 'errors'); - $error ++; + $error++; } } @@ -1665,37 +1665,46 @@ if (empty($reshook)) if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) { setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors'); - $error ++; + $error++; } if (!$prod_entry_mode) { if (GETPOST('type') < 0 && ! GETPOST('search_idprod')) { setEventMessages($langs->trans('ErrorChooseBetweenFreeEntryOrPredefinedProduct'), null, 'errors'); - $error ++; + $error++; } } if ($prod_entry_mode == 'free' && empty($idprod) && GETPOST('type') < 0) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); - $error ++; + $error++; } if ($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not '' { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); - $error ++; + if ($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) + { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); + $error++; + } + else + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); + $error++; + } } if ($qty == '') { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); - $error ++; + $error++; } if ($prod_entry_mode == 'free' && empty($idprod) && empty($product_desc)) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors'); - $error ++; + $error++; } if ($qty < 0) { $langs->load("errors"); setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors'); - $error ++; + $error++; } if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { @@ -1707,7 +1716,7 @@ if (empty($reshook)) $idprod = $res->fk_product_child; } else { setEventMessage($langs->trans('ErrorProductCombinationNotFound'), 'errors'); - $error ++; + $error++; } } } @@ -2113,7 +2122,7 @@ if (empty($reshook)) // Check price is not lower than minimum (check is done only for standard or replacement invoices) if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); - $error ++; + $error++; } } else { $type = GETPOST('type'); @@ -2122,14 +2131,29 @@ if (empty($reshook)) // Check parameters if (GETPOST('type') < 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); - $error ++; + $error++; } } if ($qty < 0) { $langs->load("errors"); setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors'); - $error ++; + $error++; } + if (empty($productid) && (($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $pu_ht == '') && $pu_ht_devise == '') // Unit price can be 0 but not '' + { + if ($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) + { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); + $error++; + } + else + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); + $error++; + } + } + // Update line if (! $error) { diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 646414c2fc5..45c1426556e 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -115,6 +115,7 @@ ErrorLoginDoesNotExists=User with login %s could not be found. ErrorLoginHasNoEmail=This user has no email address. Process aborted. ErrorBadValueForCode=Bad value for security code. Try again with new value... ErrorBothFieldCantBeNegative=Fields %s and %s can't be both negative +ErrorFieldCantBeNegativeOnInvoice=Field %s can't be negative on such type of invoice. If you want to add a discount line, just create the discount first with link %s on screen and apply it to invoice. You can also ask your admin to set option FACTURE_ENABLE_NEGATIVE_LINES to 1 to restore old behaviour. ErrorQtyForCustomerInvoiceCantBeNegative=Quantity for line into customer invoices can't be negative ErrorWebServerUserHasNotPermission=User account %s used to execute web server has no permission for that ErrorNoActivatedBarcode=No barcode type activated From 9697bdf3b031400a86a9e74d8cfd8ef6a3274444 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 10:37:29 +0200 Subject: [PATCH 15/40] FIX #9393 inconsistency behaviour. option FACTURE_ENABLE_NEGATIVE_LINES --- htdocs/compta/facture/card.php | 68 +++++++++++++++++++++++----------- htdocs/langs/en_US/errors.lang | 1 + 2 files changed, 47 insertions(+), 22 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 20d279c5113..d5cd566360c 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -513,7 +513,7 @@ if (empty($reshook)) if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) { if (! $idwarehouse || $idwarehouse == - 1) { - $error ++; + $error++; setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $action = ''; } @@ -573,7 +573,7 @@ if (empty($reshook)) if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) { if (! $idwarehouse || $idwarehouse == - 1) { - $error ++; + $error++; setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $action = ''; } @@ -832,7 +832,7 @@ if (empty($reshook)) } if (! ($_POST['fac_replacement'] > 0)) { - $error ++; + $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), null, 'errors'); } @@ -878,14 +878,14 @@ if (empty($reshook)) $sourceinvoice = GETPOST('fac_avoir'); if (! ($sourceinvoice > 0) && empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE)) { - $error ++; + $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CorrectInvoice")), null, 'errors'); } $dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); if (empty($dateinvoice)) { - $error ++; + $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors'); } @@ -1109,7 +1109,7 @@ if (empty($reshook)) { if (GETPOST('socid', 'int') < 1) { - $error ++; + $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors'); } @@ -1279,7 +1279,7 @@ if (empty($reshook)) } } else { setEventMessages($srcobject->error, $srcobject->errors, 'errors'); - $error ++; + $error++; } } @@ -1373,7 +1373,7 @@ if (empty($reshook)) $result = $object->insert_discount($discountid); // This include link_to_invoice } else { setEventMessages($discount->error, $discount->errors, 'errors'); - $error ++; + $error++; break; } } else { @@ -1429,7 +1429,7 @@ if (empty($reshook)) $lineid = $result; } else { $lineid = 0; - $error ++; + $error++; break; } @@ -1441,7 +1441,7 @@ if (empty($reshook)) } } else { setEventMessages($srcobject->error, $srcobject->errors, 'errors'); - $error ++; + $error++; } } @@ -1665,37 +1665,46 @@ if (empty($reshook)) if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) { setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors'); - $error ++; + $error++; } if (!$prod_entry_mode) { if (GETPOST('type') < 0 && ! GETPOST('search_idprod')) { setEventMessages($langs->trans('ErrorChooseBetweenFreeEntryOrPredefinedProduct'), null, 'errors'); - $error ++; + $error++; } } if ($prod_entry_mode == 'free' && empty($idprod) && GETPOST('type') < 0) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); - $error ++; + $error++; } if ($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not '' { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); - $error ++; + if ($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) + { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); + $error++; + } + else + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); + $error++; + } } if ($qty == '') { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); - $error ++; + $error++; } if ($prod_entry_mode == 'free' && empty($idprod) && empty($product_desc)) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors'); - $error ++; + $error++; } if ($qty < 0) { $langs->load("errors"); setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors'); - $error ++; + $error++; } if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { @@ -1707,7 +1716,7 @@ if (empty($reshook)) $idprod = $res->fk_product_child; } else { setEventMessage($langs->trans('ErrorProductCombinationNotFound'), 'errors'); - $error ++; + $error++; } } } @@ -2113,7 +2122,7 @@ if (empty($reshook)) // Check price is not lower than minimum (check is done only for standard or replacement invoices) if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); - $error ++; + $error++; } } else { $type = GETPOST('type'); @@ -2122,14 +2131,29 @@ if (empty($reshook)) // Check parameters if (GETPOST('type') < 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); - $error ++; + $error++; } } if ($qty < 0) { $langs->load("errors"); setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors'); - $error ++; + $error++; } + if (empty($productid) && (($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $pu_ht == '') && $pu_ht_devise == '') // Unit price can be 0 but not '' + { + if ($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) + { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); + $error++; + } + else + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); + $error++; + } + } + // Update line if (! $error) { diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 646414c2fc5..45c1426556e 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -115,6 +115,7 @@ ErrorLoginDoesNotExists=User with login %s could not be found. ErrorLoginHasNoEmail=This user has no email address. Process aborted. ErrorBadValueForCode=Bad value for security code. Try again with new value... ErrorBothFieldCantBeNegative=Fields %s and %s can't be both negative +ErrorFieldCantBeNegativeOnInvoice=Field %s can't be negative on such type of invoice. If you want to add a discount line, just create the discount first with link %s on screen and apply it to invoice. You can also ask your admin to set option FACTURE_ENABLE_NEGATIVE_LINES to 1 to restore old behaviour. ErrorQtyForCustomerInvoiceCantBeNegative=Quantity for line into customer invoices can't be negative ErrorWebServerUserHasNotPermission=User account %s used to execute web server has no permission for that ErrorNoActivatedBarcode=No barcode type activated From 76703972ed7e4da734c5c0626172677a178d6591 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 10:53:42 +0200 Subject: [PATCH 16/40] FIX #9355 --- htdocs/imports/import.php | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 10747ed0212..c57a4207782 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -548,8 +548,8 @@ if ($step == 3 && $datatoimport) print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''.$langs->trans("ChooseFileToImport",img_picto('','filenew')).'

'; @@ -648,7 +648,8 @@ if ($step == 4 && $datatoimport) $classname = "Import".ucfirst($model); require_once $dir.$file; $obj = new $classname($db,$datatoimport); - if ($model == 'csv') { + if ($model == 'csv') + { $obj->separator = $separator; $obj->enclosure = $enclosure; } @@ -796,9 +797,9 @@ if ($step == 4 && $datatoimport) print ''; print ''; print $langs->trans("Separator").' : '; - print ''; + print ''; print '    '.$langs->trans("Enclosure").' : '; - print ''; + print ''; print ''; print ''; print ''; @@ -833,8 +834,8 @@ if ($step == 4 && $datatoimport) print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; } From e3339f5f956d031f3415cfdb779e6f8877107ca1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 19:00:26 +0200 Subject: [PATCH 38/40] Fix trad --- htdocs/langs/en_US/cron.lang | 2 +- htdocs/langs/fr_FR/cron.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index a476a09d677..704b852e138 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -79,5 +79,5 @@ CronCannotLoadObject=Class file %s was loaded, but object %s was not found into UseMenuModuleToolsToAddCronJobs=Go into menu "Home - Admin tools - Scheduled jobs" to see and edit scheduled jobs. JobDisabled=Job disabled MakeLocalDatabaseDumpShort=Local database backup -MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql' or 'pgsql'), 1, 'auto' or filename to build, number of backup files to keep +MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql', 'pgsql', 'auto'), 1, 'auto' or filename to build, number of backup files to keep WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of enabled jobs, your jobs may be delayed to a maximum of %s hours, before being run. diff --git a/htdocs/langs/fr_FR/cron.lang b/htdocs/langs/fr_FR/cron.lang index d707a0cc313..5e50c173fe7 100644 --- a/htdocs/langs/fr_FR/cron.lang +++ b/htdocs/langs/fr_FR/cron.lang @@ -79,5 +79,5 @@ CronCannotLoadObject=Le fichier de classe %s a été chargé, mais l'objet %s n' UseMenuModuleToolsToAddCronJobs=Aller à la page "Accueil - Outils administration - Travaux planifiées" pour voir la listes des travaux programmées et les modifier. JobDisabled=Travail désactivé MakeLocalDatabaseDumpShort=Sauvegarde locale de base -MakeLocalDatabaseDump=Créez un fichier dump de base local. Les paramètres sont: compression ('gz' ou 'bz' ou 'none'), type de sauvegarde ('mysql' ou 'pgsql'), 1, 'auto' ou nom du fichier à générer, nb de fichiers de sauvegarde à garder +MakeLocalDatabaseDump=Créez un fichier dump de base local. Les paramètres sont: compression ('gz' ou 'bz' ou 'none'), type de sauvegarde ('mysql', 'pgsql', 'auto'), 1, 'auto' ou nom du fichier à générer, nb de fichiers de sauvegarde à garder WarningCronDelayed=Attention, à des fins de performance, quelle que soit la prochaine date d'exécution des travaux activés, vos travaux peuvent être retardés jusqu'à %s heures avant d'être exécutés. From f7c87a9ad3e02611141dfedf9baaa1e158184dc6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 22:46:08 +0200 Subject: [PATCH 39/40] Clean cron init --- htdocs/core/modules/modAdherent.class.php | 3 +++ htdocs/core/modules/modAgenda.class.php | 4 ++-- htdocs/core/modules/modAsset.class.php | 6 +++--- htdocs/core/modules/modDav.class.php | 4 ++-- htdocs/core/modules/modFacture.class.php | 13 +++++++------ 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 4c22f4b31b4..4339e2cac8d 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -347,6 +347,8 @@ class modAdherent extends DolibarrModules ); // Cronjobs + $arraydate=dol_getdate(dol_now()); + $datestart=dol_mktime(22, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']); $this->cronjobs = array( 0=>array( 'label'=>'SendReminderForExpiredSubscriptionTitle', @@ -360,6 +362,7 @@ class modAdherent extends DolibarrModules 'priority'=>50, 'status'=>0, 'test'=>true, + 'datestart'=>$datestart ), ); } diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 525c27488a7..15a6b361079 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -113,9 +113,9 @@ class modAgenda extends DolibarrModules // Cronjobs //------------ + $datestart=dol_now(); $this->cronjobs = array( - 0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>10, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'1'), - // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24) + 0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>10, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'1', 'datestart'=>$datestart), ); // Permissions diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php index e0ad2db49b7..840db44daab 100644 --- a/htdocs/core/modules/modAsset.class.php +++ b/htdocs/core/modules/modAsset.class.php @@ -174,9 +174,9 @@ class modAsset extends DolibarrModules // Cronjobs (List of cron jobs entries to add when module is enabled) // unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week - $this->cronjobs = array( - 0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/asset/class/asset.class.php', 'objectname'=>'Asset', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true) - ); + //$this->cronjobs = array( + // 0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/asset/class/asset.class.php', 'objectname'=>'Asset', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true) + //); // Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true), // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true) // ); diff --git a/htdocs/core/modules/modDav.class.php b/htdocs/core/modules/modDav.class.php index 5ef202cda86..88a81ab51f5 100644 --- a/htdocs/core/modules/modDav.class.php +++ b/htdocs/core/modules/modDav.class.php @@ -173,9 +173,9 @@ class modDav extends DolibarrModules // Cronjobs (List of cron jobs entries to add when module is enabled) // unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week - $this->cronjobs = array( + //$this->cronjobs = array( //0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/dav/class/myobject.class.php', 'objectname'=>'MyObject', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true) - ); + //); // Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true), // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true) // ); diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 41ef5e26051..5d8efb7d70b 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -114,13 +114,14 @@ class modFacture extends DolibarrModules 2=>array('file'=>'box_graph_invoices_permonth.php', 'enabledbydefaulton'=>'Home') ); - // Cronjobs - $this->cronjobs = array( - 0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>1, 'test'=>true), - // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600) - ); + // Cronjobs + $arraydate=dol_getdate(dol_now()); + $datestart=dol_mktime(23, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']); + $this->cronjobs = array( + 0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>1, 'test'=>true, 'datestart'=>$datestart), + ); - // Permissions + // Permissions $this->rights = array(); $this->rights_class = 'facture'; $r = 0; From c5695db3e42c3e3769446e15c691b0107037f79e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Sep 2018 11:09:51 +0200 Subject: [PATCH 40/40] NEW Can disable meteo on smartphone only --- htdocs/admin/delais.php | 16 +++++++++++++--- htdocs/index.php | 4 ++-- htdocs/langs/en_US/admin.lang | 1 + 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 14dfb9922f6..19fa67abcff 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -122,6 +122,13 @@ $modules=array( ), ); +$labelmeteo = array(0=>$langs->trans("No"), 1=>$langs->trans("Yes"), 2=>$langs->trans("OnMobileOnly")); + + +/* + * Actions + */ + if ($action == 'update') { foreach($modules as $module => $delays) @@ -201,9 +208,10 @@ if ($action == 'edit') print '
'; print $langs->trans("SelectImportFields",img_picto('','grip_title','')).' '; $htmlother->select_import_model($importmodelid,'importmodelid',$datatoimport,1); @@ -1117,8 +1118,8 @@ if ($step == 4 && $datatoimport) print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; @@ -1263,10 +1264,8 @@ if ($step == 5 && $datatoimport) if ($model == 'csv') { print ''; print ''; } From f2ec94e9fdc87d8e069921e90507dcf4281ed720 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 11:13:54 +0200 Subject: [PATCH 17/40] FIX #9353 Bug: html error - div inside span on graphs --- htdocs/core/class/dolgraph.class.php | 4 ++-- htdocs/install/mysql/tables/llx_commande.key.sql | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index f40d30f389e..b002c96f081 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -924,7 +924,7 @@ class DolGraph var percent=Math.round(series.percent); var number=series.data[0][1]; return \''; - $this->stringtoshow.='\'; + $this->stringtoshow.='\'; }, background: { opacity: 0.0, diff --git a/htdocs/install/mysql/tables/llx_commande.key.sql b/htdocs/install/mysql/tables/llx_commande.key.sql index 9652079846e..9134092195b 100644 --- a/htdocs/install/mysql/tables/llx_commande.key.sql +++ b/htdocs/install/mysql/tables/llx_commande.key.sql @@ -18,7 +18,7 @@ -- ============================================================================ --- Supprimme orphelins pour permettre montee de la cle +-- Delete orphans -- V4 DELETE llx_commande FROM llx_commande LEFT JOIN llx_societe ON llx_commande.fk_soc = llx_societe.rowid WHERE llx_societe.rowid IS NULL; ALTER TABLE llx_commande ADD UNIQUE INDEX uk_commande_ref (ref, entity); From e7d2bcc34c77dbfe5024aa672e067883a31bf6bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 11:17:08 +0200 Subject: [PATCH 18/40] FIX #9316 Error when listing invoices --- htdocs/compta/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 6c39c0cd0a9..7f1d5baa924 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -509,7 +509,7 @@ if (! $sall) $sql.= ' typent.code,'; $sql.= ' state.code_departement, state.nom,'; $sql.= ' country.code,'; - $sql.= " p.rowid, p.ref"; + $sql.= " p.rowid, p.ref, p.title"; foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by { From 9042d341f0f07a6302c9d69441133c7a6b0cf968 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 11:19:31 +0200 Subject: [PATCH 19/40] FIX #9316 Error when listing invoices --- htdocs/compta/facture/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 7f1d5baa924..d45939bb29c 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -510,7 +510,8 @@ if (! $sall) $sql.= ' state.code_departement, state.nom,'; $sql.= ' country.code,'; $sql.= " p.rowid, p.ref, p.title"; - + if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc"; + // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by { $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : ''); From 8c2eac4c937d1947c192a76de1972a45df0cd9ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 11:34:23 +0200 Subject: [PATCH 20/40] FIX #9317 --- htdocs/projet/element.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 98877689c4c..5afee3f7dc9 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -290,7 +290,7 @@ $listofreferent=array( 'class'=>'SupplierProposal', 'table'=>'supplier_proposal', 'datefieldname'=>'date', - 'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object 'lang'=>'supplier_proposal', 'buttonnew'=>'AddSupplierProposal', 'testnew'=>$user->rights->supplier_proposal->creer, @@ -550,8 +550,6 @@ print ''; print ''; print ''; -$var = false; - foreach ($listofreferent as $key => $value) { $name=$langs->trans($value['name']); From 203c925c5b6942e1139f7753c46ddd8b61f9bf67 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 12:03:21 +0200 Subject: [PATCH 21/40] Fix look and feel v8 --- htdocs/projet/element.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 5afee3f7dc9..88ab25acb1e 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -741,9 +741,9 @@ foreach ($listofreferent as $key => $value) if (empty($conf->global->PROJECT_CREATE_ON_OVERVIEW_DISABLED) && $urlnew) { $addform.='
'; - if ($testnew) $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).''; + if ($testnew) $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).' '; elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { - $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).''; + $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).' '; } $addform.='
'; } From 42565e722e6c682a978514e98233093042eedd80 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 4 Sep 2018 13:37:00 +0200 Subject: [PATCH 22/40] Standardize and update code --- htdocs/asset/class/asset.class.php | 6 +++++- htdocs/core/class/discount.class.php | 4 ++++ htdocs/product/class/productcustomerprice.class.php | 7 ++++++- htdocs/societe/class/companypaymentmode.class.php | 6 +++++- htdocs/societe/class/societeaccount.class.php | 7 ++++++- htdocs/stripe/class/stripe.class.php | 5 ++++- htdocs/ticket/class/actions_ticket.class.php | 4 ++++ htdocs/ticket/class/ticket.class.php | 4 ++-- 8 files changed, 36 insertions(+), 7 deletions(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 3ca85a4015f..3f82a6aca98 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -114,7 +114,11 @@ class Asset extends CommonObject public $label; public $amount; - public $fk_soc; + + /** + * @var int Thirdparty ID + */ + public $fk_soc; /** * @var string description diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 78f713232d4..6a91384a2f2 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -48,7 +48,11 @@ class DiscountAbsolute */ public $id; + /** + * @var int Thirdparty ID + */ public $fk_soc; + public $discount_type; // 0 => customer discount, 1 => supplier discount public $amount_ht; // public $amount_tva; // diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 35ba8621ae8..29327293723 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -974,7 +974,12 @@ class PriceByCustomerLine public $datec = ''; public $tms = ''; public $fk_product; - public $fk_soc; + + /** + * @var int Thirdparty ID + */ + public $fk_soc; + public $price; public $price_ttc; public $price_min; diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index ae405ac6249..cbe8a111985 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -124,7 +124,11 @@ class CompanyPaymentMode extends CommonObject */ public $rowid; - public $fk_soc; + /** + * @var int Thirdparty ID + */ + public $fk_soc; + public $label; public $bank; public $code_banque; diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 03fa94c0dd0..b5cd4d8e8ff 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -111,7 +111,12 @@ class SocieteAccount extends CommonObject public $pass_encoding; public $pass_crypted; public $pass_temp; - public $fk_soc; + + /** + * @var int Thirdparty ID + */ + public $fk_soc; + public $site; public $date_last_login; public $date_previous_login; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 9ef6b60977e..4264ae984b0 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -33,7 +33,10 @@ class Stripe extends CommonObject */ public $rowid; - public $fk_soc; + /** + * @var int Thirdparty ID + */ + public $fk_soc; public $fk_key; diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index fc45740863b..17df0bb8265 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -68,6 +68,10 @@ class ActionsTicket public $description; public $fk_statut; + + /** + * @var int Thirdparty ID + */ public $fk_soc; /** diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index e73e0bf95ef..310d4b02207 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2502,8 +2502,8 @@ class TicketsLine public $track_id; /** - * Thirdparty ID - */ + * @var int Thirdparty ID + */ public $fk_soc; /** From 47b6374abcf517bc35d70cb7c5abd1ef7e916d56 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 4 Sep 2018 13:45:20 +0200 Subject: [PATCH 23/40] Standardize and update code --- htdocs/adherents/class/adherent.class.php | 89 ++++++++++--------- .../class/productcustomerprice.class.php | 39 ++++---- 2 files changed, 68 insertions(+), 60 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index f9a02252387..fdb0a03aa00 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -53,66 +53,69 @@ class Adherent extends CommonObject public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - var $mesgs; + public $mesgs; - var $login; + public $login; //! Clear password in memory - var $pass; + public $pass; //! Clear password in database (defined if DATABASE_PWD_ENCRYPTED=0) - var $pass_indatabase; + public $pass_indatabase; //! Encrypted password in database (always defined) - var $pass_indatabase_crypted; + public $pass_indatabase_crypted; - var $societe; - var $company; - var $address; - var $zip; - var $town; + public $societe; + public $company; + public $address; + public $zip; + public $town; - var $state_id; // Id of department - var $state_code; // Code of department - var $state; // Label of department + public $state_id; // Id of department + public $state_code; // Code of department + public $state; // Label of department - var $email; - var $skype; - var $phone; - var $phone_perso; - var $phone_mobile; + public $email; + public $skype; + public $phone; + public $phone_perso; + public $phone_mobile; - var $morphy; - var $public; - var $statut; // -1:brouillon, 0:resilie, >=1:valide,paye - var $photo; + public $morphy; + public $public; + public $statut; // -1:brouillon, 0:resilie, >=1:valide,paye + public $photo; - var $datec; - var $datem; - var $datefin; - var $datevalid; - var $birth; + public $datec; + public $datem; + public $datefin; + public $datevalid; + public $birth; - var $note_public; - var $note_private; + public $note_public; + public $note_private; - var $typeid; // Id type adherent - var $type; // Libelle type adherent - var $need_subscription; + public $typeid; // Id type adherent + public $type; // Libelle type adherent + public $need_subscription; - var $user_id; - var $user_login; + public $user_id; + public $user_login; - var $fk_soc; + /** + * @var int Thirdparty ID + */ + public $fk_soc; // Fields loaded by fetch_subscriptions() - var $first_subscription_date; - var $first_subscription_amount; - var $last_subscription_date; - var $last_subscription_date_start; - var $last_subscription_date_end; - var $last_subscription_amount; - var $subscriptions=array(); + public $first_subscription_date; + public $first_subscription_amount; + public $last_subscription_date; + public $last_subscription_date_start; + public $last_subscription_date_end; + public $last_subscription_amount; + public $subscriptions=array(); - var $oldcopy; // To contains a clone of this when we need to save old properties of object + public $oldcopy; // To contains a clone of this when we need to save old properties of object /** * @var int Entity diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 29327293723..667e63b3ecc 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -38,29 +38,34 @@ class Productcustomerprice extends CommonObject */ public $table_element = 'product_customer_price'; - var $entity; - var $datec = ''; - var $tms = ''; - var $fk_product; - var $fk_soc; - var $price; - var $price_ttc; - var $price_min; - var $price_min_ttc; - var $price_base_type; - var $tva_tx; - var $recuperableonly; - var $localtax1_type; - var $localtax1_tx; - var $localtax2_type; - var $localtax2_tx; + public $entity; + public $datec = ''; + public $tms = ''; + public $fk_product; + + /** + * @var int Thirdparty ID + */ + public $fk_soc; + + public $price; + public $price_ttc; + public $price_min; + public $price_min_ttc; + public $price_base_type; + public $tva_tx; + public $recuperableonly; + public $localtax1_type; + public $localtax1_tx; + public $localtax2_type; + public $localtax2_tx; /** * @var int User ID */ public $fk_user; - var $lines = array (); + public $lines = array (); /** * Constructor From d3570317194c7e6275121117fd2eaaa4e2cc58da Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 4 Sep 2018 14:46:10 +0200 Subject: [PATCH 24/40] fix merge --- .../class/accountingaccount.class.php | 3 ++ .../class/accountingjournal.class.php | 4 ++ .../adherents/class/adherent_type.class.php | 14 +++++- htdocs/adherents/class/subscription.class.php | 23 +++++----- htdocs/asset/class/asset_type.class.php | 13 +++++- htdocs/bookmarks/class/bookmark.class.php | 18 +++++--- htdocs/categories/class/categorie.class.php | 5 ++- htdocs/comm/action/class/actioncomm.class.php | 6 ++- .../comm/action/class/cactioncomm.class.php | 6 ++- htdocs/comm/mailing/class/mailing.class.php | 45 ++++++++++--------- htdocs/comm/propal/class/propal.class.php | 3 ++ 11 files changed, 95 insertions(+), 45 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index c2da46c6911..ba6f53e3785 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -37,6 +37,9 @@ class AccountingAccount extends CommonObject */ public $table_element='accounting_account'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'billr'; /** diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 852a70d38c2..dc34d0adf40 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -42,6 +42,10 @@ class AccountingJournal extends CommonObject public $fk_element = ''; public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'generic'; /** diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index b7d510a3e0f..ba2f2306092 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -36,13 +36,17 @@ class AdherentType extends CommonObject * @var string Name of table without prefix where object is stored */ public $table_element = 'adherent_type'; - + /** * @var string ID to identify managed object */ public $element = 'adherent_type'; - + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'group'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe /** @@ -51,19 +55,25 @@ class AdherentType extends CommonObject * @see label */ public $libelle; + /** @var string Label */ public $label; + /** * @var int Subsription required (0 or 1) * @since 5.0 */ public $subscription; + /** @var string Public note */ public $note; + /** @var integer Can vote */ public $vote; + /** @var string Email sent during validation */ public $mail_valid; + /** @var array Array of members */ public $members=array(); diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 90452816be8..85b024a1582 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -36,21 +36,24 @@ class Subscription extends CommonObject * @var string ID to identify managed object */ public $element='subscription'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='subscription'; - - public $picto='payment'; - var $datec; // Date creation - var $datem; // Date modification - var $dateh; // Subscription start date (date subscription) - var $datef; // Subscription end date - var $fk_adherent; - var $amount; - var $fk_bank; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto='payment'; + + public $datec; // Date creation + public $datem; // Date modification + public $dateh; // Subscription start date (date subscription) + public $datef; // Subscription end date + public $fk_adherent; + public $amount; + public $fk_bank; /** diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index e6b95d7ad37..5df411ef129 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -33,25 +33,34 @@ class AssetType extends CommonObject * @var string Name of table without prefix where object is stored */ public $table_element = 'asset_type'; - + /** * @var string ID to identify managed object */ public $element = 'asset_type'; - + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'group'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe /** @var string Label */ public $label; + /** @var string Accountancy code asset */ public $accountancy_code_asset; + /** @var string Accountancy code depreciation asset */ public $accountancy_code_depreciation_asset; + /** @var string Accountancy code depreciation expense */ public $accountancy_code_depreciation_expense; + /** @var string Public note */ public $note; + /** @var array Array of asset */ public $asset=array(); diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index f0942b18a82..7f3b2c58300 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -39,7 +39,11 @@ class Bookmark extends CommonObject public $table_element='bookmark'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - public $picto = 'bookmark'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'bookmark'; /** * @var DoliDB Database handler. @@ -56,12 +60,12 @@ class Bookmark extends CommonObject */ public $fk_user; - var $datec; - var $url; - var $target; // 0=replace, 1=new window - var $title; - var $position; - var $favicon; + public $datec; + public $url; + public $target; // 0=replace, 1=new window + public $title; + public $position; + public $favicon; /** diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 94e42ee4334..cddf26e343d 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -51,8 +51,11 @@ class Categorie extends CommonObject const TYPE_USER = 'user'; const TYPE_PROJECT = 'project'; const TYPE_ACCOUNT = 'bank_account'; - const TYPE_BANK_LINE = 'bank_line'; + const TYPE_BANK_LINE = 'bank_line'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'category'; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index fd620ef2fce..f2983a190c9 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -45,7 +45,11 @@ class ActionComm extends CommonObject public $table_element = 'actioncomm'; public $table_rowid = 'id'; - public $picto='action'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto='action'; /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index f339e79d6a2..4f0a824007a 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -54,7 +54,11 @@ class CActionComm public $active; public $color; - public $picto; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto; public $type_actions=array(); diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index fa7a9a1bc9e..43087b2ea53 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -35,39 +35,42 @@ class Mailing extends CommonObject * @var string ID to identify managed object */ public $element='mailing'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='mailing'; - + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='email'; - var $titre; - var $sujet; - var $body; - var $nbemail; - var $bgcolor; - var $bgimage; + public $titre; + public $sujet; + public $body; + public $nbemail; + public $bgcolor; + public $bgimage; - var $statut; // Status 0=Draft, 1=Validated, 2=Sent partially, 3=Sent completely + public $statut; // Status 0=Draft, 1=Validated, 2=Sent partially, 3=Sent completely - var $email_from; - var $email_replyto; - var $email_errorsto; + public $email_from; + public $email_replyto; + public $email_errorsto; - var $joined_file1; - var $joined_file2; - var $joined_file3; - var $joined_file4; + public $joined_file1; + public $joined_file2; + public $joined_file3; + public $joined_file4; - var $user_creat; - var $user_valid; + public $user_creat; + public $user_valid; - var $date_creat; - var $date_valid; + public $date_creat; + public $date_valid; - var $extraparams=array(); + public $extraparams=array(); public $statut_dest=array(); public $statuts=array(); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index a3e1ec42bf7..e1f7736cbc3 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -65,6 +65,9 @@ class Propal extends CommonObject */ public $fk_element ='fk_propal'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='propal'; /** From 707f8b731217f3923167052b038f582c6b70ae78 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 4 Sep 2018 14:46:10 +0200 Subject: [PATCH 25/40] fix merge --- .../class/accountingaccount.class.php | 3 ++ .../class/accountingjournal.class.php | 4 ++ .../adherents/class/adherent_type.class.php | 14 +++++- htdocs/adherents/class/subscription.class.php | 23 +++++----- htdocs/asset/class/asset_type.class.php | 13 +++++- htdocs/bookmarks/class/bookmark.class.php | 18 +++++--- htdocs/categories/class/categorie.class.php | 5 ++- htdocs/comm/action/class/actioncomm.class.php | 6 ++- .../comm/action/class/cactioncomm.class.php | 6 ++- htdocs/comm/mailing/class/mailing.class.php | 45 ++++++++++--------- htdocs/comm/propal/class/propal.class.php | 3 ++ 11 files changed, 95 insertions(+), 45 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index c2da46c6911..ba6f53e3785 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -37,6 +37,9 @@ class AccountingAccount extends CommonObject */ public $table_element='accounting_account'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'billr'; /** diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 852a70d38c2..dc34d0adf40 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -42,6 +42,10 @@ class AccountingJournal extends CommonObject public $fk_element = ''; public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'generic'; /** diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index b7d510a3e0f..ba2f2306092 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -36,13 +36,17 @@ class AdherentType extends CommonObject * @var string Name of table without prefix where object is stored */ public $table_element = 'adherent_type'; - + /** * @var string ID to identify managed object */ public $element = 'adherent_type'; - + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'group'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe /** @@ -51,19 +55,25 @@ class AdherentType extends CommonObject * @see label */ public $libelle; + /** @var string Label */ public $label; + /** * @var int Subsription required (0 or 1) * @since 5.0 */ public $subscription; + /** @var string Public note */ public $note; + /** @var integer Can vote */ public $vote; + /** @var string Email sent during validation */ public $mail_valid; + /** @var array Array of members */ public $members=array(); diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 90452816be8..85b024a1582 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -36,21 +36,24 @@ class Subscription extends CommonObject * @var string ID to identify managed object */ public $element='subscription'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='subscription'; - - public $picto='payment'; - var $datec; // Date creation - var $datem; // Date modification - var $dateh; // Subscription start date (date subscription) - var $datef; // Subscription end date - var $fk_adherent; - var $amount; - var $fk_bank; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto='payment'; + + public $datec; // Date creation + public $datem; // Date modification + public $dateh; // Subscription start date (date subscription) + public $datef; // Subscription end date + public $fk_adherent; + public $amount; + public $fk_bank; /** diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index e6b95d7ad37..5df411ef129 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -33,25 +33,34 @@ class AssetType extends CommonObject * @var string Name of table without prefix where object is stored */ public $table_element = 'asset_type'; - + /** * @var string ID to identify managed object */ public $element = 'asset_type'; - + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'group'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe /** @var string Label */ public $label; + /** @var string Accountancy code asset */ public $accountancy_code_asset; + /** @var string Accountancy code depreciation asset */ public $accountancy_code_depreciation_asset; + /** @var string Accountancy code depreciation expense */ public $accountancy_code_depreciation_expense; + /** @var string Public note */ public $note; + /** @var array Array of asset */ public $asset=array(); diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index f0942b18a82..7f3b2c58300 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -39,7 +39,11 @@ class Bookmark extends CommonObject public $table_element='bookmark'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - public $picto = 'bookmark'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'bookmark'; /** * @var DoliDB Database handler. @@ -56,12 +60,12 @@ class Bookmark extends CommonObject */ public $fk_user; - var $datec; - var $url; - var $target; // 0=replace, 1=new window - var $title; - var $position; - var $favicon; + public $datec; + public $url; + public $target; // 0=replace, 1=new window + public $title; + public $position; + public $favicon; /** diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 94e42ee4334..cddf26e343d 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -51,8 +51,11 @@ class Categorie extends CommonObject const TYPE_USER = 'user'; const TYPE_PROJECT = 'project'; const TYPE_ACCOUNT = 'bank_account'; - const TYPE_BANK_LINE = 'bank_line'; + const TYPE_BANK_LINE = 'bank_line'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'category'; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index fd620ef2fce..f2983a190c9 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -45,7 +45,11 @@ class ActionComm extends CommonObject public $table_element = 'actioncomm'; public $table_rowid = 'id'; - public $picto='action'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto='action'; /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index f339e79d6a2..4f0a824007a 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -54,7 +54,11 @@ class CActionComm public $active; public $color; - public $picto; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto; public $type_actions=array(); diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index fa7a9a1bc9e..43087b2ea53 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -35,39 +35,42 @@ class Mailing extends CommonObject * @var string ID to identify managed object */ public $element='mailing'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='mailing'; - + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='email'; - var $titre; - var $sujet; - var $body; - var $nbemail; - var $bgcolor; - var $bgimage; + public $titre; + public $sujet; + public $body; + public $nbemail; + public $bgcolor; + public $bgimage; - var $statut; // Status 0=Draft, 1=Validated, 2=Sent partially, 3=Sent completely + public $statut; // Status 0=Draft, 1=Validated, 2=Sent partially, 3=Sent completely - var $email_from; - var $email_replyto; - var $email_errorsto; + public $email_from; + public $email_replyto; + public $email_errorsto; - var $joined_file1; - var $joined_file2; - var $joined_file3; - var $joined_file4; + public $joined_file1; + public $joined_file2; + public $joined_file3; + public $joined_file4; - var $user_creat; - var $user_valid; + public $user_creat; + public $user_valid; - var $date_creat; - var $date_valid; + public $date_creat; + public $date_valid; - var $extraparams=array(); + public $extraparams=array(); public $statut_dest=array(); public $statuts=array(); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index a3e1ec42bf7..e1f7736cbc3 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -65,6 +65,9 @@ class Propal extends CommonObject */ public $fk_element ='fk_propal'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='propal'; /** From 154e44e7619d745232c91a4e09b23ddbd6b29561 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 19:57:20 +0200 Subject: [PATCH 26/40] Fix responsive --- htdocs/societe/list.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 8eb6bf447d6..1adb3ab2c15 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -711,48 +711,48 @@ if (! empty($arrayfields['s.nom']['checked'])) { print '
'; } if (! empty($arrayfields['s.name_alias']['checked'])) { print ''; } // Barcode if (! empty($arrayfields['s.barcode']['checked'])) { print ''; } // Customer code if (! empty($arrayfields['s.code_client']['checked'])) { print ''; } // Supplier code if (! empty($arrayfields['s.code_fournisseur']['checked'])) { print ''; } // Account Customer code if (! empty($arrayfields['s.code_compta']['checked'])) { print ''; } // Account Supplier code if (! empty($arrayfields['s.code_compta_fournisseur']['checked'])) { print ''; } // Town From aec0d4022b0560551eee28f06b3911e50528d29d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 19:59:20 +0200 Subject: [PATCH 27/40] Fix responsive --- htdocs/societe/list.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 1adb3ab2c15..72071919a9b 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -766,21 +766,21 @@ if (! empty($arrayfields['s.town']['checked'])) if (! empty($arrayfields['s.zip']['checked'])) { print ''; } // State if (! empty($arrayfields['state.nom']['checked'])) { print ''; } // Region if (! empty($arrayfields['region.nom']['checked'])) { print ''; } // Country @@ -801,14 +801,14 @@ if (! empty($arrayfields['s.email']['checked'])) { // Email print ''; } if (! empty($arrayfields['s.phone']['checked'])) { // Phone print ''; } if (! empty($arrayfields['s.fax']['checked'])) @@ -822,14 +822,14 @@ if (! empty($arrayfields['s.url']['checked'])) { // Url print ''; } if (! empty($arrayfields['s.siren']['checked'])) { // IdProf1 print ''; } if (! empty($arrayfields['s.siret']['checked'])) @@ -850,28 +850,28 @@ if (! empty($arrayfields['s.idprof4']['checked'])) { // IdProf4 print ''; } if (! empty($arrayfields['s.idprof5']['checked'])) { // IdProf5 print ''; } if (! empty($arrayfields['s.idprof6']['checked'])) { // IdProf6 print ''; } if (! empty($arrayfields['s.tva_intra']['checked'])) { // Vat number print ''; } @@ -958,7 +958,7 @@ if (! empty($arrayfields['s.status']['checked'])) if (! empty($arrayfields['s.import_key']['checked'])) { print ''; } // Action column From e4afd4af0084c6d0599f58fd44154ffa45665e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 4 Sep 2018 22:05:06 +0200 Subject: [PATCH 28/40] Create index.html --- htdocs/product/dynamic_price/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/product/dynamic_price/index.html diff --git a/htdocs/product/dynamic_price/index.html b/htdocs/product/dynamic_price/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/product/dynamic_price/index.html @@ -0,0 +1 @@ + From 2015268b7e0e0fb66311cd153cefddaa51657d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 4 Sep 2018 22:06:24 +0200 Subject: [PATCH 29/40] Create index.html --- htdocs/product/dynamic_price/class/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/product/dynamic_price/class/index.html diff --git a/htdocs/product/dynamic_price/class/index.html b/htdocs/product/dynamic_price/class/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/product/dynamic_price/class/index.html @@ -0,0 +1 @@ + From aa74d2ac38cb398ce9ae3ea3ded9a1ea037035f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 4 Sep 2018 23:53:37 +0200 Subject: [PATCH 30/40] Update api_agendaevents.class.php --- htdocs/comm/action/class/api_agendaevents.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index dedc515f61c..677e477cd89 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -219,7 +219,7 @@ class AgendaEvents extends DolibarrApi /** - * Update Agenda Event general fields (won't touch lines of expensereport) + * Update Agenda Event general fields * * @param int $id Id of Agenda Event to update * @param array $request_data Datas @@ -236,20 +236,20 @@ class AgendaEvents extends DolibarrApi throw new RestException(401, "Insuffisant rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); } - $result = $this->expensereport->fetch($id); + $result = $this->actioncomm->fetch($id); if ( ! $result ) { - throw new RestException(404, 'expensereport not found'); + throw new RestException(404, 'actioncomm not found'); } - if ( ! DolibarrApi::_checkAccessToResource('expensereport',$this->expensereport->id)) { + if ( ! DolibarrApi::_checkAccessToResource('actioncomm',$this->actioncomm->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } foreach($request_data as $field => $value) { if ($field == 'id') continue; - $this->expensereport->$field = $value; + $this->actioncomm->$field = $value; } - if ($this->expensereport->update($id, DolibarrApiAccess::$user,1,'','','update')) + if ($this->actioncomm->update($id, DolibarrApiAccess::$user,1,'','','update')) return $this->get($id); return false; From 57be6a752e3c1a0682adfde92d7add31a081e9da Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 5 Sep 2018 10:00:33 +0200 Subject: [PATCH 31/40] Fix: Expedition not showing extrafields on creation --- htdocs/expedition/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 56744c08e44..26b2d729f82 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -9,7 +9,7 @@ * Copyright (C) 2014 Cedric GROSS * Copyright (C) 2014-2017 Francis Appels * Copyright (C) 2015 Claudio Aschieri - * Copyright (C) 2016 Ferran Marcet + * Copyright (C) 2016-2018 Ferran Marcet * Copyright (C) 2016 Yasser Carreón * * This program is free software; you can redistribute it and/or modify @@ -1041,7 +1041,7 @@ if ($action == 'create') if ($object->fetch_optionals() > 0) { $expe->array_options = array_merge($expe->array_options, $object->array_options); } - print $object->showOptionals($extrafields, 'edit'); + print $expe->showOptionals($extrafields, 'edit'); } From 51901108ad35879c0577537c88de969bc24d4a24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 14:26:12 +0200 Subject: [PATCH 32/40] FIX #9412 --- 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 848535ce424..b60fdd8886b 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -307,7 +307,7 @@ if ($search_societe) $sql.= natural_search('s.nom', $search_socie if ($search_country) $sql .= " AND p.fk_pays IN (".$search_country.')'; if (strlen($search_poste)) $sql.= natural_search('p.poste', $search_poste); if (strlen($search_phone_perso)) $sql.= natural_search('p.phone_perso', $search_phone_perso); -if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone); +if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone_pro); if (strlen($search_phone_mobile)) $sql.= natural_search('p.phone_mobile', $search_phone_mobile); if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax); if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype); From 19431a94bafa4b31f1f9f0ad6e6c37e9cac07071 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 14:37:44 +0200 Subject: [PATCH 33/40] Code style --- htdocs/product/reassort.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 2e8dfcb36fa..7fd7ba813de 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -319,11 +319,12 @@ if ($resql) { $objp = $db->fetch_object($resql); - print ''; - print ''; + print ''; @@ -360,15 +361,13 @@ if ($resql) } } - - // Virtual stock if ($virtualdiffersfromphysical) { - print ''; + print $product->stock_theorique; + print ''; } print ''; print ''; From f1cb13634bb97d14582adcc3b1681fe87647a531 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 14:55:45 +0200 Subject: [PATCH 34/40] FIX Entering negative price on order --- htdocs/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 0fe49cf9f12..c10591b4e45 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -679,7 +679,7 @@ if (empty($reshook)) setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); $error++; } - if ($prod_entry_mode == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '') && (! ($price_ht_devise >= 0) || $price_ht_devise == '')) // Unit price can be 0 but not '' + if ($prod_entry_mode == 'free' && empty($idprod) && $price_ht == '' && $price_ht_devise == '') // Unit price can be 0 but not ''. Also price can be negative for order. { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); $error++; From 3650dc3ec9562478446ae743713b1975723c74d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 15:25:47 +0200 Subject: [PATCH 35/40] FIX #8452 --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 3 +-- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 4 ++-- .../core/modules/supplier_invoice/pdf/pdf_canelle.modules.php | 2 +- .../core/modules/supplier_order/pdf/pdf_muscadet.modules.php | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index b19c35435e6..53327aa94cb 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -849,7 +849,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0), 0, $outputlangs), 0, 'R', 1); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index ab2c5120501..d258c6db4a2 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1079,7 +1079,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1); @@ -1304,7 +1304,6 @@ class pdf_crabe extends ModelePDFFactures } $pdf->SetTextColor(0,0,0); - $creditnoteamount=$object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received $depositsamount=$object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); //print "x".$creditnoteamount."-".$depositsamount;exit; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 53b79864063..ca463b9e3fc 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -68,7 +68,7 @@ class pdf_azur extends ModelePDFPropales function __construct($db) { global $conf,$langs,$mysoc; - + // Translations $langs->loadLangs(array("main", "bills")); @@ -1002,7 +1002,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0), 0, $outputlangs), 0, 'R', 1); diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 37e0cf64f15..ab89756de38 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -591,7 +591,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + $object->remise), 0, 'R', 1); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 9c99fb7f478..1645d649c23 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -763,7 +763,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1); From cb89942bfbf267d7bbb93759d089eec4b156164b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 16:03:10 +0200 Subject: [PATCH 36/40] Add option capture on input file for photo --- htdocs/core/class/html.form.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 550ecea4867..27d7fe521fe 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6674,16 +6674,17 @@ class Form * @param string $imagesize 'mini', 'small' or '' (original) * @param int $addlinktofullsize Add link to fullsize image * @param int $cache 1=Accept to use image in cache + * @param string $forcecapture Force parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if empty. * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0) + static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0, $forcecapture='') { global $conf,$langs; $entity = (! empty($object->entity) ? $object->entity : $conf->entity); $id = (! empty($object->id) ? $object->id : $object->rowid); - $ret='';$dir='';$file='';$originalfile='';$altfile='';$email=''; + $ret='';$dir='';$file='';$originalfile='';$altfile='';$email='';$capture=''; if ($modulepart=='societe') { $dir=$conf->societe->multidir_output[$entity]; @@ -6707,6 +6708,7 @@ class Form $originalfile=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo; } $email=$object->email; + $capture='user'; } else if ($modulepart=='userphoto') { @@ -6720,6 +6722,7 @@ class Form } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; + $capture='user'; } else if ($modulepart=='memberphoto') { @@ -6733,6 +6736,7 @@ class Form } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; + $capture='user'; } else { @@ -6749,6 +6753,8 @@ class Form $email=$object->email; } + if ($forcecapture) $capture = $forcecapture; + if ($dir) { if ($file && file_exists($dir."/".$file)) @@ -6805,7 +6811,7 @@ class Form if ($object->photo) $ret.="
\n"; $ret.='
'.$langs->trans("CsvOptions").''; - print $langs->trans("Separator").' : '; - print htmlentities($separator); - print '    '.$langs->trans("Enclosure").' : '; - print htmlentities($enclosure); + print $langs->trans("Separator").' : '.dol_escape_htmltag($separator); + print '    '.$langs->trans("Enclosure").' : '.dol_escape_htmltag($enclosure); print '
'.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").'
'; if (! empty($search_nom_only) && empty($search_nom)) $search_nom=$search_nom_only; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print '
'; $product=new Product($db); $product->fetch($objp->rowid); $product->load_stock(); + + print '
'; print $product->getNomUrl(1,'',16); //if ($objp->stock_theorique < $objp->seuil_stock_alerte) print ' '.img_warning($langs->trans("StockTooLow")); print ''; + print ''; if ($objp->seuil_stock_alerte != '' && ($product->stock_theorique < $objp->seuil_stock_alerte)) print img_warning($langs->trans("StockTooLow")).' '; - print $product->stock_theorique; - print ''.$langs->trans("Movements").''.$product->LibStatut($objp->statut,5,0).'
'; if ($object->photo) $ret.=''; - $ret.=''; + $ret.=''; $ret.='
'.$langs->trans("Delete").'

'; } From 0bd4bc39dd028ce060bfa80ae55f7b2d5e0f91a1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 16:03:43 +0200 Subject: [PATCH 37/40] Fix responsive --- htdocs/user/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index c1faacb14ef..6e1e80223f6 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1005,7 +1005,7 @@ if ($action == 'create' || $action == 'adduserldap') } else { - print ''; + print ''; } print '
'; print ''; - $var=false; print ''; - print ''; + print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_METEO").'' .$form->selectyesno('MAIN_DISABLE_METEO',(empty($conf->global->MAIN_DISABLE_METEO)?0:1),1) . '
'.$langs->trans("MAIN_DISABLE_METEO").''; + print $form->selectarray('MAIN_DISABLE_METEO', $labelmeteo, (empty($conf->global->MAIN_DISABLE_METEO)?0:$conf->global->MAIN_DISABLE_METEO)); + print '
'; } @@ -241,7 +249,9 @@ else print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; print ''; - print ''.$langs->trans("MAIN_DISABLE_METEO").'' . yn($conf->global->MAIN_DISABLE_METEO) . ''; + print ''.$langs->trans("MAIN_DISABLE_METEO").''; + print $labelmeteo[$conf->global->MAIN_DISABLE_METEO]; + print ''; print ''; diff --git a/htdocs/index.php b/htdocs/index.php index bbdac41aad6..e8162dc95ea 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -358,7 +358,7 @@ print '
'; /* * Dolibarr Working Board with weather */ -$showweather=empty($conf->global->MAIN_DISABLE_METEO)?1:0; +$showweather=(empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO == 2) ? 1 : 0; //Array that contains all WorkboardResponse classes to process them $dashboardlines=array(); @@ -536,7 +536,7 @@ $boxwork.=''."\n"; if ($showweather) { $boxwork.=''; - $boxwork.=''; + $boxwork.=''; $text=''; if ($totallate > 0) $text=$langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate",$totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')).')'; else $text=$langs->transnoentitiesnoconv("NoItemLate"); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 16ca7cc7201..e9fd709f6dc 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1809,3 +1809,4 @@ UseSearchToSelectResource=Use a search form to choose a resource (rather than a DisabledResourceLinkUser=Disable feature to link a resource to users DisabledResourceLinkContact=Disable feature to link a resource to contacts ConfirmUnactivation=Confirm module reset +OnMobileOnly=On small screen (smartphone) only \ No newline at end of file