From 4449c6d2a7e692265ab8366f2db925ca38c35912 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Fri, 8 Nov 2019 16:34:20 +0100 Subject: [PATCH 01/42] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 85 ++++++++++++++++++++++--------- 1 file changed, 61 insertions(+), 24 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 740093ba801..c62a9ff68fc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5954,16 +5954,27 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__THIRDPARTY_EMAIL__'] = '__THIRDPARTY_EMAIL__'; $substitutionarray['__THIRDPARTY_PHONE__'] = '__THIRDPARTY_PHONE__'; $substitutionarray['__THIRDPARTY_FAX__'] = '__THIRDPARTY_FAX__'; - $substitutionarray['__THIRDPARTY_ADRESSE__'] = '__THIRDPARTY_ADRESSE__'; + $substitutionarray['__THIRDPARTY_ADDRESS__'] = '__THIRDPARTY_ADDRESS__'; $substitutionarray['__THIRDPARTY_ZIP__'] = '__THIRDPARTY_ZIP__'; $substitutionarray['__THIRDPARTY_TOWN__'] = '__THIRDPARTY_TOWN__'; - $substitutionarray['__THIRDPARTY_SIREN__'] = '__THIRDPARTY_SIREN__'; - $substitutionarray['__THIRDPARTY_SIRET__'] = '__THIRDPARTY_SIRET__'; - $substitutionarray['__THIRDPARTY_APE__'] = '__THIRDPARTY_APE__'; - $substitutionarray['__THIRDPARTY_RCSRM__'] = '__THIRDPARTY_RCSRM__'; + $substitutionarray['__THIRDPARTY_IDPROF1__'] = '__THIRDPARTY_IDPROF1__'; + $substitutionarray['__THIRDPARTY_IDPROF2__'] = '__THIRDPARTY_IDPROF2__'; + $substitutionarray['__THIRDPARTY_IDPROF3__'] = '__THIRDPARTY_IDPROF3__'; + $substitutionarray['__THIRDPARTY_IDPROF4__'] = '__THIRDPARTY_IDPROF4__'; + $substitutionarray['__THIRDPARTY_IDPROF5__'] = '__THIRDPARTY_IDPROF5__'; + $substitutionarray['__THIRDPARTY_IDPROF6__'] = '__THIRDPARTY_IDPROF6__'; $substitutionarray['__THIRDPARTY_TVAINTRA__'] = '__THIRDPARTY_TVAINTRA__'; - /*$substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__'; - $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__';*/ + $substitutionarray['__THIRDPARTY_SKYPE__'] = '__THIRDPARTY_SKYPE__'; + $substitutionarray['__THIRDPARTY_TWITTER__'] = '__THIRDPARTY_TWITTER__'; + $substitutionarray['__THIRDPARTY_FACEBOOK__'] = '__THIRDPARTY_FACEBOOK__'; + $substitutionarray['__THIRDPARTY_INSTAGRAM__'] = '__THIRDPARTY_INSTAGRAM__'; + $substitutionarray['__THIRDPARTY_SNAPCHAT__'] = '__THIRDPARTY_SNAPCHAT__'; + $substitutionarray['__THIRDPARTY_GOOGLEPLUS__'] = '__THIRDPARTY_GOOGLEPLUS__'; + $substitutionarray['__THIRDPARTY_YOUTUBE__'] = '__THIRDPARTY_YOUTUBE__'; + $substitutionarray['__THIRDPARTY_WHATSAPP__'] = '__THIRDPARTY_WHATSAPP__'; + $substitutionarray['__THIRDPARTY_LINKEDIN__'] = '__THIRDPARTY_LINKEDIN__'; + $substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__'; + $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__'; } if (! empty($conf->adherent->enabled)) { @@ -6064,15 +6075,28 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__THIRDPARTY_CODE_FOURNISSEUR__'] = (is_object($object)?$object->code_fournisseur:''); $substitutionarray['__THIRDPARTY_EMAIL__'] = (is_object($object)?$object->email:''); $substitutionarray['__THIRDPARTY_PHONE__'] = (is_object($object)?$object->phone:''); - $substitutionarray['__THIRDPARTY_FAX__'] = (is_object($object)?$object->name_fax:''); - $substitutionarray['__THIRDPARTY_ADRESSE__'] = (is_object($object)?$object->address:''); + $substitutionarray['__THIRDPARTY_FAX__'] = (is_object($object)?$object->fax:''); + $substitutionarray['__THIRDPARTY_ADDRESS__'] = (is_object($object)?$object->address:''); $substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object)?$object->zip:''); $substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object)?$object->town:''); - $substitutionarray['__THIRDPARTY_SIREN__'] = (is_object($object)?$object->idprof1:''); - $substitutionarray['__THIRDPARTY_SIRET__'] = (is_object($object)?$object->idprof2:''); - $substitutionarray['__THIRDPARTY_APE__'] = (is_object($object)?$object->idprof3:''); - $substitutionarray['__THIRDPARTY_RCSRM__'] = (is_object($object)?$object->idprof4:''); + $substitutionarray['__THIRDPARTY_IDPROF1__'] = (is_object($object)?$object->idprof1:''); + $substitutionarray['__THIRDPARTY_IDPROF2__'] = (is_object($object)?$object->idprof2:''); + $substitutionarray['__THIRDPARTY_IDPROF3__'] = (is_object($object)?$object->idprof3:''); + $substitutionarray['__THIRDPARTY_IDPROF4__'] = (is_object($object)?$object->idprof4:''); + $substitutionarray['__THIRDPARTY_IDPROF5__'] = (is_object($object)?$object->idprof5:''); + $substitutionarray['__THIRDPARTY_IDPROF6__'] = (is_object($object)?$object->idprof6:''); $substitutionarray['__THIRDPARTY_TVAINTRA__'] = (is_object($object)?$object->tva_intra:''); + $substitutionarray['__THIRDPARTY_SKYPE__'] = (is_object($object)?$object->skype:''); + $substitutionarray['__THIRDPARTY_TWITTER__'] = (is_object($object)?$object->twitter:''); + $substitutionarray['__THIRDPARTY_FACEBOOK__'] = (is_object($object)?$object->facebook:''); + $substitutionarray['__THIRDPARTY_INSTAGRAM__'] = (is_object($object)?$object->instagram:''); + $substitutionarray['__THIRDPARTY_SNAPCHAT__'] = (is_object($object)?$object->snapchat:''); + $substitutionarray['__THIRDPARTY_GOOGLEPLUS__'] = (is_object($object)?$object->googleplus:''); + $substitutionarray['__THIRDPARTY_YOUTUBE__'] = (is_object($object)?$object->youtube:''); + $substitutionarray['__THIRDPARTY_WHATSAPP__'] = (is_object($object)?$object->watsapp:''); + $substitutionarray['__THIRDPARTY_LINKEDIN__'] = (is_object($object)?$object->linkedin:''); + $substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = (is_object($object)?dol_htmlentitiesbr($object->note_public):''); + $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = (is_object($object)?dol_htmlentitiesbr($object->note_private):''); } elseif (is_object($object->thirdparty) && $object->thirdparty->id > 0) { @@ -6080,18 +6104,31 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__THIRDPARTY_NAME__'] = (is_object($object->thirdparty)?$object->thirdparty->name:''); $substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = (is_object($object->thirdparty)?$object->thirdparty->name_alias:''); $substitutionarray['__THIRDPARTY_CODE_CLIENT__'] = (is_object($object->thirdparty)?$object->thirdparty->code_client:''); - $substitutionarray['__THIRDPARTY_CODE_FOURNISSEUR__'] = (is_object($object->thirdparty)?$object->thirdparty->code_fournisseur:''); + $substitutionarray['__THIRDPARTY_CODE_FOURNISSEUR__'] = (is_object($object->thirdparty)?$object->thirdparty->code_fournisseur:''); $substitutionarray['__THIRDPARTY_EMAIL__'] = (is_object($object->thirdparty)?$object->thirdparty->email:''); - $substitutionarray['__THIRDPARTY_PHONE__'] = (is_object($object->thirdparty)?$object->phone:''); - $substitutionarray['__THIRDPARTY_FAX__'] = (is_object($object->thirdparty)?$object->name_fax:''); - $substitutionarray['__THIRDPARTY_ADRESSE__'] = (is_object($object->thirdparty)?$object->address:''); - $substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object->thirdparty)?$object->zip:''); - $substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object->thirdparty)?$object->town:''); - $substitutionarray['__THIRDPARTY_SIREN__'] = (is_object($object->thirdparty)?$object->idprof1:''); - $substitutionarray['__THIRDPARTY_SIRET__'] = (is_object($object->thirdparty)?$object->idprof2:''); - $substitutionarray['__THIRDPARTY_APE__'] = (is_object($object->thirdparty)?$object->idprof3:''); - $substitutionarray['__THIRDPARTY_RCSRM__'] = (is_object($object->thirdparty)?$object->idprof4:''); - $substitutionarray['__THIRDPARTY_TVAINTRA__'] = (is_object($object->thirdparty)?$object->tva_intra:''); + $substitutionarray['__THIRDPARTY_PHONE__'] = (is_object($object->thirdparty)?$object->thirdparty->phone:''); + $substitutionarray['__THIRDPARTY_FAX__'] = (is_object($object->thirdparty)?$object->thirdparty->fax:''); + $substitutionarray['__THIRDPARTY_ADDRESS__'] = (is_object($object->thirdparty)?$object->thirdparty->address:''); + $substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object->thirdparty)?$object->thirdparty->zip:''); + $substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object->thirdparty)?$object->thirdparty->town:''); + $substitutionarray['__THIRDPARTY_IDPROF1__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof1:''); + $substitutionarray['__THIRDPARTY_IDPROF2__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof2:''); + $substitutionarray['__THIRDPARTY_IDPROF3__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof3:''); + $substitutionarray['__THIRDPARTY_IDPROF4__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof4:''); + $substitutionarray['__THIRDPARTY_IDPROF5__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof5:''); + $substitutionarray['__THIRDPARTY_IDPROF6__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof6:''); + $substitutionarray['__THIRDPARTY_TVAINTRA__'] = (is_object($object->thirdparty)?$object->thirdparty->tva_intra:''); + $substitutionarray['__THIRDPARTY_SKYPE__'] = (is_object($object->thirdparty)?$object->thirdparty->skype:''); + $substitutionarray['__THIRDPARTY_TWITTER__'] = (is_object($object->thirdparty)?$object->thirdparty->twitter:''); + $substitutionarray['__THIRDPARTY_FACEBOOK__'] = (is_object($object->thirdparty)?$object->thirdparty->facebook:''); + $substitutionarray['__THIRDPARTY_INSTAGRAM__'] = (is_object($object->thirdparty)?$object->thirdparty->instagram:''); + $substitutionarray['__THIRDPARTY_SNAPCHAT__'] = (is_object($object->thirdparty)?$object->thirdparty->snapchat:''); + $substitutionarray['__THIRDPARTY_GOOGLEPLUS__'] = (is_object($object->thirdparty)?$object->thirdparty->googleplus:''); + $substitutionarray['__THIRDPARTY_YOUTUBE__'] = (is_object($object->thirdparty)?$object->thirdparty->youtube:''); + $substitutionarray['__THIRDPARTY_WHATSAPP__'] = (is_object($object->thirdparty)?$object->thirdparty->watsapp:''); + $substitutionarray['__THIRDPARTY_LINKEDIN__'] = (is_object($object->thirdparty)?$object->thirdparty->linkedin:''); + $substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = (is_object($object->thirdparty)?dol_htmlentitiesbr($object->thirdparty->note_public):''); + $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = (is_object($object->thirdparty)?dol_htmlentitiesbr($object->thirdparty->note_private):''); } if (is_object($object->project) && $object->project->id > 0) From e1f36ae107777ec3ade5300b3f6621909a071734 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Sat, 16 Nov 2019 17:37:18 +0100 Subject: [PATCH 02/42] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c62a9ff68fc..770a8234d06 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6104,7 +6104,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__THIRDPARTY_NAME__'] = (is_object($object->thirdparty)?$object->thirdparty->name:''); $substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = (is_object($object->thirdparty)?$object->thirdparty->name_alias:''); $substitutionarray['__THIRDPARTY_CODE_CLIENT__'] = (is_object($object->thirdparty)?$object->thirdparty->code_client:''); - $substitutionarray['__THIRDPARTY_CODE_FOURNISSEUR__'] = (is_object($object->thirdparty)?$object->thirdparty->code_fournisseur:''); + $substitutionarray['__THIRDPARTY_CODE_FOURNISSEUR__'] = (is_object($object->thirdparty)?$object->thirdparty->code_fournisseur:''); $substitutionarray['__THIRDPARTY_EMAIL__'] = (is_object($object->thirdparty)?$object->thirdparty->email:''); $substitutionarray['__THIRDPARTY_PHONE__'] = (is_object($object->thirdparty)?$object->thirdparty->phone:''); $substitutionarray['__THIRDPARTY_FAX__'] = (is_object($object->thirdparty)?$object->thirdparty->fax:''); From 496aa0c065a97d9ed9687e2641883c0664864300 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 21 Nov 2019 10:38:59 +0100 Subject: [PATCH 03/42] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index df15088aec7..a36514059e9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5966,15 +5966,6 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__THIRDPARTY_IDPROF5__'] = '__THIRDPARTY_IDPROF5__'; $substitutionarray['__THIRDPARTY_IDPROF6__'] = '__THIRDPARTY_IDPROF6__'; $substitutionarray['__THIRDPARTY_TVAINTRA__'] = '__THIRDPARTY_TVAINTRA__'; - $substitutionarray['__THIRDPARTY_SKYPE__'] = '__THIRDPARTY_SKYPE__'; - $substitutionarray['__THIRDPARTY_TWITTER__'] = '__THIRDPARTY_TWITTER__'; - $substitutionarray['__THIRDPARTY_FACEBOOK__'] = '__THIRDPARTY_FACEBOOK__'; - $substitutionarray['__THIRDPARTY_INSTAGRAM__'] = '__THIRDPARTY_INSTAGRAM__'; - $substitutionarray['__THIRDPARTY_SNAPCHAT__'] = '__THIRDPARTY_SNAPCHAT__'; - $substitutionarray['__THIRDPARTY_GOOGLEPLUS__'] = '__THIRDPARTY_GOOGLEPLUS__'; - $substitutionarray['__THIRDPARTY_YOUTUBE__'] = '__THIRDPARTY_YOUTUBE__'; - $substitutionarray['__THIRDPARTY_WHATSAPP__'] = '__THIRDPARTY_WHATSAPP__'; - $substitutionarray['__THIRDPARTY_LINKEDIN__'] = '__THIRDPARTY_LINKEDIN__'; $substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__'; $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__'; } @@ -6088,15 +6079,6 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__THIRDPARTY_IDPROF5__'] = (is_object($object)?$object->idprof5:''); $substitutionarray['__THIRDPARTY_IDPROF6__'] = (is_object($object)?$object->idprof6:''); $substitutionarray['__THIRDPARTY_TVAINTRA__'] = (is_object($object)?$object->tva_intra:''); - $substitutionarray['__THIRDPARTY_SKYPE__'] = (is_object($object)?$object->skype:''); - $substitutionarray['__THIRDPARTY_TWITTER__'] = (is_object($object)?$object->twitter:''); - $substitutionarray['__THIRDPARTY_FACEBOOK__'] = (is_object($object)?$object->facebook:''); - $substitutionarray['__THIRDPARTY_INSTAGRAM__'] = (is_object($object)?$object->instagram:''); - $substitutionarray['__THIRDPARTY_SNAPCHAT__'] = (is_object($object)?$object->snapchat:''); - $substitutionarray['__THIRDPARTY_GOOGLEPLUS__'] = (is_object($object)?$object->googleplus:''); - $substitutionarray['__THIRDPARTY_YOUTUBE__'] = (is_object($object)?$object->youtube:''); - $substitutionarray['__THIRDPARTY_WHATSAPP__'] = (is_object($object)?$object->watsapp:''); - $substitutionarray['__THIRDPARTY_LINKEDIN__'] = (is_object($object)?$object->linkedin:''); $substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = (is_object($object)?dol_htmlentitiesbr($object->note_public):''); $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = (is_object($object)?dol_htmlentitiesbr($object->note_private):''); } @@ -6120,15 +6102,6 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__THIRDPARTY_IDPROF5__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof5:''); $substitutionarray['__THIRDPARTY_IDPROF6__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof6:''); $substitutionarray['__THIRDPARTY_TVAINTRA__'] = (is_object($object->thirdparty)?$object->thirdparty->tva_intra:''); - $substitutionarray['__THIRDPARTY_SKYPE__'] = (is_object($object->thirdparty)?$object->thirdparty->skype:''); - $substitutionarray['__THIRDPARTY_TWITTER__'] = (is_object($object->thirdparty)?$object->thirdparty->twitter:''); - $substitutionarray['__THIRDPARTY_FACEBOOK__'] = (is_object($object->thirdparty)?$object->thirdparty->facebook:''); - $substitutionarray['__THIRDPARTY_INSTAGRAM__'] = (is_object($object->thirdparty)?$object->thirdparty->instagram:''); - $substitutionarray['__THIRDPARTY_SNAPCHAT__'] = (is_object($object->thirdparty)?$object->thirdparty->snapchat:''); - $substitutionarray['__THIRDPARTY_GOOGLEPLUS__'] = (is_object($object->thirdparty)?$object->thirdparty->googleplus:''); - $substitutionarray['__THIRDPARTY_YOUTUBE__'] = (is_object($object->thirdparty)?$object->thirdparty->youtube:''); - $substitutionarray['__THIRDPARTY_WHATSAPP__'] = (is_object($object->thirdparty)?$object->thirdparty->watsapp:''); - $substitutionarray['__THIRDPARTY_LINKEDIN__'] = (is_object($object->thirdparty)?$object->thirdparty->linkedin:''); $substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = (is_object($object->thirdparty)?dol_htmlentitiesbr($object->thirdparty->note_public):''); $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = (is_object($object->thirdparty)?dol_htmlentitiesbr($object->thirdparty->note_private):''); } From 1a43b58f8ab3cfda3a7dd4d2c779e993c0fbd64d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 25 Nov 2019 10:03:35 +0100 Subject: [PATCH 04/42] FIX compatibility with Multicompany --- htdocs/public/ticket/create_ticket.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index b2434e7d826..a6d18937da4 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -53,7 +53,6 @@ $object = new Ticket($db); $extrafields = new ExtraFields($db); $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - /* * Actions */ @@ -359,7 +358,7 @@ if ($action != "infos_success") { $formticket->withfile = 2; $formticket->action = 'create_ticket'; - $formticket->param = array('returnurl' => $_SERVER['PHP_SELF']); + $formticket->param = array('returnurl' => $_SERVER['PHP_SELF'].($conf->entity > 1 ? '?entity='.$conf->entity : '')); if (empty($defaultref)) { $defaultref = ''; From b2e995279e3d95c31f37b1e7b793673b332ce746 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Mon, 25 Nov 2019 19:29:07 +0100 Subject: [PATCH 05/42] Fix takepos.lib.php to add Receipt tab and delete unnecessary takepos.lib.php --- htdocs/core/lib/takepos.lib.php | 8 ++++ htdocs/takepos/lib/takepos.lib.php | 60 ------------------------------ 2 files changed, 8 insertions(+), 60 deletions(-) delete mode 100644 htdocs/takepos/lib/takepos.lib.php diff --git a/htdocs/core/lib/takepos.lib.php b/htdocs/core/lib/takepos.lib.php index e3a80e5d1df..8967f4b7d27 100644 --- a/htdocs/core/lib/takepos.lib.php +++ b/htdocs/core/lib/takepos.lib.php @@ -37,6 +37,14 @@ function takepos_prepare_head() $head[$h][1] = $langs->trans("Parameters"); $head[$h][2] = 'setup'; $h++; + + if ($conf->global->TAKEPOS_CUSTOM_RECEIPT) + { + $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/receipt.php'; + $head[$h][1] = $langs->trans("Receipt"); + $head[$h][2] = 'receipt'; + $h++; + } $numterminals = max(1, $conf->global->TAKEPOS_NUM_TERMINALS); for ($i = 1; $i <= $numterminals; $i++) diff --git a/htdocs/takepos/lib/takepos.lib.php b/htdocs/takepos/lib/takepos.lib.php deleted file mode 100644 index af1ea6aa100..00000000000 --- a/htdocs/takepos/lib/takepos.lib.php +++ /dev/null @@ -1,60 +0,0 @@ -. - */ - -/** - * \file takepos/lib/takepos.lib.php - * \ingroup takepos - * \brief Library files with common functions for TakePos - */ - -/** - * Prepare admin pages header - * - * @return array - */ -function takeposAdminPrepareHead() -{ - global $langs, $conf; - - $langs->load("cashdesk"); - - $h = 0; - $head = array(); - - $head[$h][0] = dol_buildpath("/takepos/admin/setup.php", 1); - $head[$h][1] = $langs->trans("Settings"); - $head[$h][2] = 'settings'; - $h++; - $head[$h][0] = dol_buildpath("/takepos/admin/about.php", 1); - $head[$h][1] = $langs->trans("About"); - $head[$h][2] = 'about'; - $h++; - - // Show more tabs from modules - // Entries must be declared in modules descriptor with line - //$this->tabs = array( - // 'entity:+tabname:Title:@takepos:/takepos/mypage.php?id=__ID__' - //); // to add new tab - //$this->tabs = array( - // 'entity:-tabname:Title:@takepos:/takepos/mypage.php?id=__ID__' - //); // to remove a tab - complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos'); - - complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos', 'remove'); - - return $head; -} From 4056848483103c23b60cab98a22305184202298e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 25 Nov 2019 20:07:29 +0100 Subject: [PATCH 06/42] do not evaluate count at each iteration --- htdocs/emailcollector/class/emailcollector.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 6556590c076..711249576a1 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1136,7 +1136,8 @@ class EmailCollector extends CommonObject $elements = imap_mime_header_decode($overview[0]->subject); $newstring = ''; if (! empty($elements)) { - for ($i = 0; $i < count($elements); $i++) { + $num = count($elements); + for ($i = 0; $i < $num; $i++) { $newstring .= ($newstring ? ' ' : '').$elements[$i]->text; } $overview[0]->subject = $newstring; From d280eef1e0d19be7fa87523ae245eca4894a34ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 25 Nov 2019 20:12:51 +0100 Subject: [PATCH 07/42] Update expensereport_rules.php --- htdocs/admin/expensereport_rules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index 610bd875c4f..6a719c25b5f 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2012 Mikael Carlavan * Copyright (C) 2017 ATM Consulting * Copyright (C) 2017 Pierre-Henry Favre - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,8 +44,8 @@ $action = GETPOST('action', 'alpha'); $id = GETPOST('id', 'int'); $apply_to = GETPOST('apply_to'); -$fk_user = GETPOST('fk_user'); -$fk_usergroup = GETPOST('fk_usergroup'); +$fk_user = GETPOST('fk_user', 'int'); +$fk_usergroup = GETPOST('fk_usergroup', 'int'); $fk_c_type_fees = GETPOST('fk_c_type_fees'); $code_expense_rules_type = GETPOST('code_expense_rules_type'); @@ -97,11 +97,11 @@ if ($action == 'save') $object->setValues($_POST); if($apply_to=='U'){ - $object->fk_user=$fk_user; + $object->fk_user = (int) $fk_user; $object->fk_usergroup=0; $object->is_for_all=0; }elseif($apply_to=='G'){ - $object->fk_usergroup=$fk_usergroup; + $object->fk_usergroup = (int) $fk_usergroup; $object->fk_user=0; $object->is_for_all=0; }elseif($apply_to=='A'){ From 9eafc8f5500dcacbfea55b92ccdca9227f50d2d7 Mon Sep 17 00:00:00 2001 From: Daniel Seichter Date: Mon, 25 Nov 2019 23:13:31 +0100 Subject: [PATCH 08/42] fix small css issues --- htdocs/core/class/commonobject.class.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8aa24819efd..fc3336fdcbb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7010,7 +7010,7 @@ abstract class CommonObject if ($nbbyrow > 0) { - if ($nbphoto == 1) $return .= ''; + if ($nbphoto == 1) $return .= '
'; if ($nbphoto % $nbbyrow == 1) $return .= ''; $return .= '\n"; +// Sumup options +if ($conf->global->TAKEPOS_ENABLE_SUMUP) { + print '\n"; + print '\n"; +} + // Custom Receipt print ''; + if ($conf->global->TAKEPOS_ENABLE_SUMUP) { + print ''; + print ''; + } foreach($paiements as $modep) { if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue; // Already managed before diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 42ebe2fa85a..5074e08df9c 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -176,6 +176,35 @@ else print "var received=0;"; else location.reload(); }); } + + function ValidateSumup() { + + var invoiceid = 0 ? $invoiceid : 0); ?>; + var amountpayed = $("#change1").val(); + if (amountpayed > total_ttc; ?>) { + amountpayed = total_ttc; ?>; + } + + // Starting sumup app + window.open('sumupmerchant://pay/1.0?affiliate-key=&app-id=&total=' + amountpayed + '¤cy=EUR&title=' + invoiceid + '&callback=/takepos/smpcb.php'); + + var loop = window.setInterval(function () { + $.ajax('/takepos/smpcb.php?status').done(function (data) { + console.log(data); + if (data === "SUCCESS") { + parent.$("#poslines").load("invoice.php?place=&action=valid&pay=CB&amount=" + amountpayed + "&invoiceid=" + invoiceid, function () { + //parent.$("#poslines").scrollTop(parent.$("#poslines")[0].scrollHeight); + parent.$.colorbox.close(); + //parent.setFocusOnSearchField(); // This does not have effect + }); + clearInterval(loop); + } else if (data === "FAILED") { + parent.$.colorbox.close(); + clearInterval(loop); + } + }); + }, 2500); + }
@@ -269,6 +298,13 @@ while($i < count($paiements)){ global->TAKEPOS_ENABLE_SUMUP && !empty(dolibarr_get_const($db,"CASHDESK_ID_BANKACCOUNT_SUMUP".$_SESSION["takeposterminal"]))) { + ?> + + + + + + The HTML5 Herald + + + + + + + +'; + $_SESSION['SMP_CURRENT_PAYMENT'] = $_GET['smp-status']; + + print ''; + + print "Transaction status registered, you can close this"; + + die(''); + } + + print 'NOOP'; +?> \ No newline at end of file From 9ee0dc75f3f48503266b76abf7e4910bca61cb47 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 25 Nov 2019 22:19:50 +0000 Subject: [PATCH 10/42] Fixing style errors. --- htdocs/takepos/pay.php | 2 +- htdocs/takepos/smpcb.php | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 5074e08df9c..5e5a07b3625 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -299,7 +299,7 @@ while($i < count($paiements)){ $i=$i+1; } -if($conf->global->TAKEPOS_ENABLE_SUMUP && !empty(dolibarr_get_const($db,"CASHDESK_ID_BANKACCOUNT_SUMUP".$_SESSION["takeposterminal"]))) { +if($conf->global->TAKEPOS_ENABLE_SUMUP && !empty(dolibarr_get_const($db, "CASHDESK_ID_BANKACCOUNT_SUMUP".$_SESSION["takeposterminal"]))) { ?> +if($_GET['smp-status']) { + print ' @@ -19,18 +19,17 @@ '; - $_SESSION['SMP_CURRENT_PAYMENT'] = $_GET['smp-status']; + $_SESSION['SMP_CURRENT_PAYMENT'] = $_GET['smp-status']; - print ''; - print "Transaction status registered, you can close this"; + print "Transaction status registered, you can close this"; - die(''); - } + die(''); +} print 'NOOP'; -?> \ No newline at end of file From 6baa1c8d4a1d99a5c0a8cd9a132cec541cc2cab4 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Mon, 25 Nov 2019 23:32:40 +0100 Subject: [PATCH 11/42] Fix travis --- htdocs/core/lib/takepos.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/takepos.lib.php b/htdocs/core/lib/takepos.lib.php index 8967f4b7d27..dc86853859e 100644 --- a/htdocs/core/lib/takepos.lib.php +++ b/htdocs/core/lib/takepos.lib.php @@ -37,7 +37,7 @@ function takepos_prepare_head() $head[$h][1] = $langs->trans("Parameters"); $head[$h][2] = 'setup'; $h++; - + if ($conf->global->TAKEPOS_CUSTOM_RECEIPT) { $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/receipt.php'; From 5d9d542cd75c8060fcea8a6001652ad2948e0d8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 25 Nov 2019 23:57:10 +0100 Subject: [PATCH 12/42] Update photos.php --- htdocs/categories/photos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 2556c2d2084..ed6091e3568 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -167,7 +167,7 @@ if ($object->id) print "
'; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 792d93dbcf6..e6faa703e2d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2049,7 +2049,7 @@ form#login { border-radius: 4px; border:solid 1px rgba(80,80,80,.4); - border-top:solid 1px f8f8f8; + border-top:solid 1px #f8f8f8; } .login_table input#username, .login_table input#password, .login_table input#securitycode{ border: none; From fb069d248a95f953fe6165526b2eac23316d704f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastien=20Vid=C3=A9?= Date: Mon, 25 Nov 2019 23:15:39 +0100 Subject: [PATCH 09/42] Added SumUp payment to TakePOS --- htdocs/takepos/admin/setup.php | 16 ++++++++++++++ htdocs/takepos/admin/terminal.php | 8 +++++++ htdocs/takepos/pay.php | 36 +++++++++++++++++++++++++++++++ htdocs/takepos/smpcb.php | 36 +++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+) create mode 100644 htdocs/takepos/smpcb.php diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 5995489184d..63bb8fbd23b 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -81,6 +81,8 @@ if (GETPOST('action', 'alpha') == 'set') $res = dolibarr_set_const($db, "TAKEPOS_DIRECT_PAYMENT", GETPOST('TAKEPOS_DIRECT_PAYMENT', 'int'), 'int', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_CUSTOM_RECEIPT", GETPOST('TAKEPOS_CUSTOM_RECEIPT', 'int'), 'int', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_EMAIL_TEMPLATE_INVOICE", GETPOST('TAKEPOS_EMAIL_TEMPLATE_INVOICE', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_SUMUP_AFFILIATE", GETPOST('TAKEPOS_SUMUP_AFFILIATE', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_SUMUP_APPID", GETPOST('TAKEPOS_SUMUP_APPID', 'alpha'), 'chaine', 0, '', $conf->entity); if ($conf->global->TAKEPOS_ORDER_NOTES == 1) { @@ -241,6 +243,20 @@ print ''; print $form->selectyesno("TAKEPOS_DIRECT_PAYMENT", $conf->global->TAKEPOS_DIRECT_PAYMENT, 1); print "
'; + print $langs->trans("SumupAffiliate"); + print ''; + print ''; + print "
'; + print $langs->trans("SumupAppId"); + print ''; + print ''; + print "
'; print $langs->trans('CustomReceipt'); diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 4696426aaf8..95af20fd4b8 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -74,6 +74,7 @@ if (GETPOST('action', 'alpha') == 'set') $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CHEQUE".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CB".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_SUMUP".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); foreach($paiements as $modep) { if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue; $name="CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminaltouse; @@ -151,6 +152,13 @@ if (! empty($conf->banque->enabled)) $form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 0, "courant=1", 1); if (! empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse})) $atleastonefound++; print '
' . $langs->trans("CashDeskBankAccountForSumup") . ''; + $form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_SUMUP' . $terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_SUMUP' . $terminaltouse, 0, "courant=1", 1); + if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_SUMUP' . $terminaltouse})) $atleastonefound++; + print '
\n"; print ''; - print dol_fiche_end(); + dol_fiche_end(); From 84e1e6ccf1be2db2eff09804f89e6b96a8029141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 25 Nov 2019 23:58:14 +0100 Subject: [PATCH 13/42] Update document.php --- htdocs/commande/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 8d5afb985a3..6714e25ddeb 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -174,7 +174,7 @@ if ($id > 0 || !empty($ref)) print "\n"; - print dol_fiche_end(); + dol_fiche_end(); $modulepart = 'commande'; $permission = $user->rights->commande->creer; From aa12ec1f67f6752734a1a5a986ed6525264017ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 25 Nov 2019 23:58:53 +0100 Subject: [PATCH 14/42] Update agenda.php --- htdocs/contact/agenda.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 515e5308903..24d49040c13 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -231,7 +231,7 @@ else print ''; - print dol_fiche_end(); + dol_fiche_end(); // Actions buttons From 2dbe3260a1542e257c9c655723761eed9f561673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 25 Nov 2019 23:59:32 +0100 Subject: [PATCH 15/42] Update document.php --- htdocs/expedition/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index c12bd6decf3..e434bc524e2 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -168,7 +168,7 @@ if ($id > 0 || !empty($ref)) { print "\n"; - print dol_fiche_end(); + dol_fiche_end(); $modulepart = 'expedition'; $permission = $user->rights->expedition->creer; From 18e08420f429ad4f341fcae5948fa6b060c11302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 26 Nov 2019 00:01:06 +0100 Subject: [PATCH 16/42] Update combinations.php --- htdocs/variants/combinations.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index f8a8b9cc9e5..c3f2b198301 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -394,7 +394,7 @@ if (! empty($id) || ! empty($ref)) } } $listofvariantselected .= ''; - //print dol_fiche_end(); + //dol_fiche_end(); } else { $title = $langs->trans('EditProductCombination'); } @@ -602,7 +602,7 @@ if (! empty($id) || ! empty($ref)) print ''; } - print dol_fiche_end(); + dol_fiche_end(); ?>
From 3edac06fae42f64c1c14327daf38ee72c9d8c729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 26 Nov 2019 00:06:57 +0100 Subject: [PATCH 17/42] Form selectAvailabilityDelay returns void --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 4a38ff4096a..1a44efa45ec 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -628,7 +628,7 @@ if ($resql) if (!empty($arrayfields['ava.rowid']['checked'])) { print ''; - print $form->selectAvailabilityDelay($search_availability, 'search_availability', '', 1); + $form->selectAvailabilityDelay($search_availability, 'search_availability', '', 1); print ajax_combobox('search_availability'); print ''; } From f3f308fc1bef665610b5e06d92b4dfb1996de705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 26 Nov 2019 00:11:02 +0100 Subject: [PATCH 18/42] Update graph.php --- htdocs/compta/bank/graph.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 15f6a1236d5..0f0c3d11386 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -107,7 +107,7 @@ else { dol_print_error($db); } - if (empty($min)) $min = dol_now - 3600 * 24; + if (empty($min)) $min = dol_now() - 3600 * 24; $log="graph.php: min=".$min." max=".$max; dol_syslog($log); From 77a300c9ae877c2b0eb209d3fddeec1162cc21ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 26 Nov 2019 00:20:40 +0100 Subject: [PATCH 19/42] doxygen --- htdocs/core/class/events.class.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 4c728256413..f6537bf6528 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -53,7 +53,14 @@ class Events // extends CommonObject */ public $error=''; + /** + * @var int timestamp + */ public $tms; + + /** + * @var string Type + */ public $type; /** @@ -63,8 +70,14 @@ class Events // extends CommonObject public $dateevent; + /** + * @var string IP + */ public $ip; + /** + * @var string User agent + */ public $user_agent; /** @@ -179,7 +192,7 @@ class Events // extends CommonObject public function update($user = null, $notrigger = 0) { // Clean parameters - $this->id=trim($this->id); + $this->id = (int) $this->id; $this->type=trim($this->type); $this->description=trim($this->description); @@ -234,7 +247,7 @@ class Events // extends CommonObject { $obj = $this->db->fetch_object($resql); - $this->id = $obj->rowid; + $this->id = $obj->rowid; $this->tms = $this->db->jdate($obj->tms); $this->type = $obj->type; $this->entity = $obj->entity; From a142c0050e3699b95e5795bde7663691e4d85c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 26 Nov 2019 00:24:00 +0100 Subject: [PATCH 20/42] $out does not seem to be defined for all execution paths --- htdocs/core/class/html.formcron.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php index 0277630ae78..2a2a6c97078 100644 --- a/htdocs/core/class/html.formcron.class.php +++ b/htdocs/core/class/html.formcron.class.php @@ -64,6 +64,7 @@ class FormCron extends Form global $langs; $langs->load('cron@cron'); + $out = ''; if (!empty($readonly)) { if ($selected=='command') { $out= $langs->trans('CronType_command'); From 1ccf0808d0757c099f825bdeb084dc3bce9911ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 26 Nov 2019 00:28:26 +0100 Subject: [PATCH 21/42] doxygen --- htdocs/core/lib/ajax.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 8991e1ad23b..d2626414ba6 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -326,7 +326,7 @@ function ajax_multiautocompleter($htmlname, $fields, $url, $option = '', $minLen * @param string $message Message of dialog box * @param int $w Width of dialog box * @param int $h height of dialog box - * @return void + * @return string */ function ajax_dialog($title, $message, $w = 350, $h = 150) { From 60f19d134c0794ae4a78d703e7d9bc2dd5fcc48c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 26 Nov 2019 03:58:01 +0100 Subject: [PATCH 22/42] Fix Ticket - Align language type with datas for translation --- htdocs/langs/en_US/ticket.lang | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 70bd8220af0..f0e0ff8b726 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -33,8 +33,9 @@ TicketDictSeverity=Ticket - Severities TicketTypeShortBUGSOFT=Dysfonctionnement logiciel TicketTypeShortBUGHARD=Dysfonctionnement matériel TicketTypeShortCOM=Commercial question -TicketTypeShortINCIDENT=Request for assistance -TicketTypeShortPROJET=Project +TicketTypeShortISSUE=Request for assistance +TicketTypeShortREQUEST=Change or enhancement request +TicketTypeShortPROJECT=Project TicketTypeShortOTHER=Other TicketSeverityShortLOW=Low From 6cc61fef9c3001da486b5bc6a03c243c7b5664f5 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 26 Nov 2019 04:32:38 +0100 Subject: [PATCH 23/42] Fix Ticket - Deprecated
--- htdocs/core/class/html.formticket.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 747b2dbdf8b..1e51d54f37e 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -419,14 +419,14 @@ class FormTicket if ($withdolfichehead) dol_fiche_end(); - print '
'; + print '
'; print ''; if ($this->withcancel) { - print "     "; + print "      "; print "trans("Cancel") . "\">"; } - print "
\n"; + print '
'; print "\n"; print "\n"; From b440f2b1f4c5414aa6ce6b69551e91f8158c151a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Nov 2019 08:53:54 +0100 Subject: [PATCH 24/42] Fix a ref is not null --- htdocs/install/mysql/migration/10.0.0-11.0.0.sql | 4 ++++ htdocs/install/mysql/tables/llx_holiday.sql | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 96ac938883c..d9ea8c01a62 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -59,6 +59,10 @@ ALTER TABLE llx_emailcollector_emailcollectoraction ADD COLUMN position integer -- For v11 +UPDATE llx_holiday SET ref = rowid WHERE ref IS NULL; +-- VMYSQL4.3 ALTER TABLE llx_holiday MODIFY COLUMN ref varchar(30) NOT NULL; +-- VPGSQL8.2 ALTER TABLE llx_holiday ALTER COLUMN ref SET NOT NULL; + ALTER TABLE llx_c_email_senderprofile MODIFY COLUMN active tinyint DEFAULT 1 NOT NULL; insert into llx_c_type_container (code,label,module,active) values ('menu', 'Menu', 'system', 1); diff --git a/htdocs/install/mysql/tables/llx_holiday.sql b/htdocs/install/mysql/tables/llx_holiday.sql index ce8383fe94d..e8116c477a8 100644 --- a/htdocs/install/mysql/tables/llx_holiday.sql +++ b/htdocs/install/mysql/tables/llx_holiday.sql @@ -19,7 +19,7 @@ CREATE TABLE llx_holiday ( rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, -ref varchar(30) NULL, -- number +ref varchar(30) NOT NULL, ref_ext varchar(255), entity integer DEFAULT 1 NOT NULL, -- Multi company id fk_user integer NOT NULL, From 9d2a5e6c429fadd26d247b5713fd160baade5e45 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Nov 2019 09:08:32 +0100 Subject: [PATCH 25/42] Trans --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 096a710bee8..d93b5930fed 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -625,7 +625,7 @@ Module5000Desc=Allows you to manage multiple companies Module6000Name=Workflow Module6000Desc=Workflow management (automatic creation of object and/or automatic status change) Module10000Name=Websites -Module10000Desc=Create websites (public) with a WYSIWYG editor. Just setup your web server (Apache, Nginx, ...) to point to the dedicated Dolibarr directory to have it online on the internet with your own domain name. +Module10000Desc=Create websites (public) with a WYSIWYG editor. This is a webmaster or developer oriented CMS (it is better to know HTML and CSS language). Just setup your web server (Apache, Nginx, ...) to point to the dedicated Dolibarr directory to have it online on the internet with your own domain name. Module20000Name=Leave Request Management Module20000Desc=Define and track employee leave requests Module39000Name=Product Lots From b0b579bdbf8f4d984f83e3e53f9832dc7136a30a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Nov 2019 09:13:35 +0100 Subject: [PATCH 26/42] Fix phpcs --- htdocs/core/modules/modHoliday.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index 917da8fec25..642c233c200 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -302,11 +302,12 @@ class modHoliday extends DolibarrModules return 0; } } + */ $sql = array( - "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'holiday' AND entity = ".$conf->entity, - "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','holiday',".$conf->entity.")" - );*/ + // "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'holiday' AND entity = ".$conf->entity, + // "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','holiday',".$conf->entity.")" + ); return $this->_init($sql, $options); } From cd6e81c46fae2747de9043a53a140efcb660191f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Nov 2019 09:34:42 +0100 Subject: [PATCH 27/42] Choice of a parameter is lost when saving --- htdocs/stripe/admin/stripe.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 1ccb1631a31..9033a787cfa 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -111,11 +111,15 @@ if ($action == 'setvalue' && $user->admin) // Payment token for URL $result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN", GETPOST('PAYMENT_SECURITY_TOKEN', 'alpha'), 'chaine', 0, '', $conf->entity); - if (!$result > 0) - $error++; - $result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN_UNIQUE", GETPOST('PAYMENT_SECURITY_TOKEN_UNIQUE', 'alpha'), 'chaine', 0, '', $conf->entity); - if (!$result > 0) + if (!$result > 0) { $error++; + } + if (empty($conf->use_javascript_ajax)) { + $result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN_UNIQUE", GETPOST('PAYMENT_SECURITY_TOKEN_UNIQUE', 'alpha'), 'chaine', 0, '', $conf->entity); + if (!$result > 0) { + $error++; + } + } if (!$error) { $db->commit(); From 953ba8e3231314f200e9c4e3b27f73261636c842 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Nov 2019 09:36:32 +0100 Subject: [PATCH 28/42] Trans --- htdocs/stripe/admin/stripe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 9033a787cfa..407140831d3 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -456,7 +456,7 @@ print ''; dol_fiche_end(); -print '
'; +print '
'; print ''; From 01ca5d8251567c2eff231b518c999fdd0845b326 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Nov 2019 09:46:47 +0100 Subject: [PATCH 29/42] Update setup.php --- htdocs/takepos/admin/setup.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 63bb8fbd23b..b5944e914ae 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -81,9 +81,10 @@ if (GETPOST('action', 'alpha') == 'set') $res = dolibarr_set_const($db, "TAKEPOS_DIRECT_PAYMENT", GETPOST('TAKEPOS_DIRECT_PAYMENT', 'int'), 'int', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_CUSTOM_RECEIPT", GETPOST('TAKEPOS_CUSTOM_RECEIPT', 'int'), 'int', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_EMAIL_TEMPLATE_INVOICE", GETPOST('TAKEPOS_EMAIL_TEMPLATE_INVOICE', 'alpha'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_SUMUP_AFFILIATE", GETPOST('TAKEPOS_SUMUP_AFFILIATE', 'alpha'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_SUMUP_APPID", GETPOST('TAKEPOS_SUMUP_APPID', 'alpha'), 'chaine', 0, '', $conf->entity); - + if (! empty($conf->global->TAKEPOS_ENABLE_SUMUP)) { + $res = dolibarr_set_const($db, "TAKEPOS_SUMUP_AFFILIATE", GETPOST('TAKEPOS_SUMUP_AFFILIATE', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_SUMUP_APPID", GETPOST('TAKEPOS_SUMUP_APPID', 'alpha'), 'chaine', 0, '', $conf->entity); + } if ($conf->global->TAKEPOS_ORDER_NOTES == 1) { $extrafields = new ExtraFields($db); From 357af16ce1c36be76487a7272de20b6532f172b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Nov 2019 09:47:56 +0100 Subject: [PATCH 30/42] Update terminal.php --- htdocs/takepos/admin/terminal.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 95af20fd4b8..e2839901a77 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -74,8 +74,10 @@ if (GETPOST('action', 'alpha') == 'set') $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CHEQUE".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CB".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_SUMUP".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); - foreach($paiements as $modep) { + if (! empty($conf->global->TAKEPOS_ENABLE_SUMUP)) { + $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_SUMUP".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); + } + foreach($paiements as $modep) { if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue; $name="CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminaltouse; $res = dolibarr_set_const($db, $name, (GETPOST($name, 'alpha') > 0 ? GETPOST($name, 'alpha') : ''), 'chaine', 0, '', $conf->entity); From 5eb24ba240533f87bfd0657b9b38b01990646673 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Nov 2019 11:55:34 +0100 Subject: [PATCH 31/42] Fix phpcs --- htdocs/stripe/admin/stripe.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 407140831d3..688b71bb68e 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -115,10 +115,10 @@ if ($action == 'setvalue' && $user->admin) $error++; } if (empty($conf->use_javascript_ajax)) { - $result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN_UNIQUE", GETPOST('PAYMENT_SECURITY_TOKEN_UNIQUE', 'alpha'), 'chaine', 0, '', $conf->entity); - if (!$result > 0) { - $error++; - } + $result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN_UNIQUE", GETPOST('PAYMENT_SECURITY_TOKEN_UNIQUE', 'alpha'), 'chaine', 0, '', $conf->entity); + if (!$result > 0) { + $error++; + } } if (!$error) { From b06c2811784d46c68016f7b994ce19a67da3d400 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Nov 2019 12:39:31 +0100 Subject: [PATCH 32/42] Fix error with postgresql --- htdocs/holiday/class/holiday.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index e1ba230fe38..4c4a5212abd 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -267,6 +267,7 @@ class Holiday extends CommonObject // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday("; + $sql .= "ref,"; $sql .= "fk_user,"; $sql .= "date_create,"; $sql .= "description,"; @@ -279,6 +280,7 @@ class Holiday extends CommonObject $sql .= "fk_user_create,"; $sql .= "entity"; $sql .= ") VALUES ("; + $sql .= "'(PROV)',"; $sql .= "'".$this->db->escape($this->fk_user)."',"; $sql .= " '".$this->db->idate($now)."',"; $sql .= " '".$this->db->escape($this->description)."',"; From cb352407eb41fb36edbb023b4204ad8332588908 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Nov 2019 12:46:40 +0100 Subject: [PATCH 33/42] Add submit --- htdocs/langs/en_US/main.lang | 1 + htdocs/public/members/new.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 6e3ba31d36c..b177abf75fd 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -847,6 +847,7 @@ Progress=Progress ProgressShort=Progr. FrontOffice=Front office BackOffice=Back office +Submit=Submit View=View Export=Export Exports=Exports diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 4c1e8b0e62e..a6e06dfb5ff 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -729,7 +729,7 @@ dol_fiche_end(); // Save print '
'; -print ''; +print ''; if (!empty($backtopage)) { print '     '; From 30ea48a7150b3d99b9f529cfc53c51908585b0f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Nov 2019 12:58:41 +0100 Subject: [PATCH 34/42] Fix api for deletion of attributes --- htdocs/product/class/api_products.class.php | 24 +++++++++---------- .../variants/class/ProductAttribute.class.php | 5 ++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 37c950e9956..05d5818b3ff 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -965,8 +965,8 @@ class Products extends DolibarrApi /** * Delete attributes by id. * - * @param int $id ID of Attribute - * @return int + * @param int $id ID of Attribute + * @return int Result of deletion * * @throws RestException * @throws 401 @@ -981,12 +981,13 @@ class Products extends DolibarrApi $prodattr = new ProductAttribute($this->db); $prodattr->id = (int) $id; - $result = $prodattr->delete(); + $result = $prodattr->delete(DolibarrApiAccess::$user); - if ($result > 0) { - return 1; + if ($result <= 0) { + throw new RestException(500, "Error deleting attribute"); } - throw new RestException(500, "Error deleting attribute"); + + return $result; } /** @@ -1485,8 +1486,8 @@ class Products extends DolibarrApi /** * Delete product variants. * - * @param int $id ID of Variant - * @return int + * @param int $id ID of Variant + * @return int Result of deletion * * @throws RestException * @throws 401 @@ -1502,12 +1503,11 @@ class Products extends DolibarrApi $prodcomb = new ProductCombination($this->db); $prodcomb->id = (int) $id; $result = $prodcomb->delete(DolibarrApiAccess::$user); - return $result; - if ($result > 0) + if ($result <= 0) { - return 1; + throw new RestException(500, "Error deleting variant"); } - throw new RestException(500, "Error deleting variant"); + return $result; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore diff --git a/htdocs/variants/class/ProductAttribute.class.php b/htdocs/variants/class/ProductAttribute.class.php index 1172d08f74d..3ccdb6dbf03 100644 --- a/htdocs/variants/class/ProductAttribute.class.php +++ b/htdocs/variants/class/ProductAttribute.class.php @@ -174,9 +174,10 @@ class ProductAttribute /** * Deletes a product attribute * - * @return int <0 KO, >0 OK + * @param User $user Object user + * @return int <0 KO, >0 OK */ - public function delete() + public function delete($user = null) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_attribute WHERE rowid = ".(int) $this->id; From 3a687b1daea90777cd21d60de9290273af098273 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Nov 2019 17:44:21 +0100 Subject: [PATCH 35/42] Fix box of task hidden if tasks are not used --- htdocs/core/boxes/box_task.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 193bcdae2d6..0f5a5e35225 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -56,7 +56,7 @@ class box_task extends ModeleBoxes */ public function __construct($db, $param = '') { - global $user, $langs; + global $conf, $user, $langs; // Load translation files required by the page $langs->loadLangs(array('boxes', 'projects')); @@ -64,7 +64,7 @@ class box_task extends ModeleBoxes $this->boxlabel = "Tasks"; $this->db = $db; - $this->hidden = !($user->rights->projet->lire); + $this->hidden = (!empty($conf->global->PROJECT_HIDE_TASKS) || !($user->rights->projet->lire)); } /** From c7e8194df9acd9f77123b33441033f450412a2fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 26 Nov 2019 18:28:44 +0100 Subject: [PATCH 36/42] dol_print_error returns void --- htdocs/core/class/extrafields.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 889a38efddb..8479db591d9 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -557,7 +557,7 @@ class ExtraFields } else { - print dol_print_error($this->db); + dol_print_error($this->db); return -1; } } @@ -813,7 +813,7 @@ class ExtraFields else { $this->db->rollback(); - print dol_print_error($this->db); + dol_print_error($this->db); return -1; } } From b104133f7a8776e15e955e15785645eb2542d946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 26 Nov 2019 18:29:52 +0100 Subject: [PATCH 37/42] Update orderstoinvoice.php --- htdocs/fourn/commande/orderstoinvoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 098b6b93710..2a1cf24b3b7 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -630,7 +630,7 @@ if (($action != 'create' && $action != 'add') && !$error) { $db->free($resql); } else { - print dol_print_error($db); + dol_print_error($db); } } From 757d05e907c8b5e974e038d05b75b3eb7dafa1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 26 Nov 2019 18:59:26 +0100 Subject: [PATCH 38/42] fix doxygen --- htdocs/core/lib/project.lib.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 875705cd8c3..58a46aef0ec 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1990,11 +1990,11 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks } /** - * @param task $task Task the task object - * @param label $label bool|string true = auto, false = dont display, string = replace output - * @param progressNumber $progressNumber bool|string true = auto, false = dont display, string = replace output - * @param hideOnProgressNull $hideOnProgressNull bool hide if progress is null - * @param spaced $spaced bool used to add space at bottom (made by css) + * @param Task $task the task object + * @param bool|string $label true = auto, false = dont display, string = replace output + * @param bool|string $progressNumber true = auto, false = dont display, string = replace output + * @param bool $hideOnProgressNull hide if progress is null + * @param bool $spaced used to add space at bottom (made by css) * @return string * @see getTaskProgressBadge() */ @@ -2113,10 +2113,10 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide return $out; } /** - * @param task $task Task the task object - * @param label $label string empty = auto (progress), string = replace output - * @param tooltip $tooltip string empty = auto , string = replace output - * @return string + * @param Task $task the task object + * @param string $label empty = auto (progress), string = replace output + * @param string $tooltip empty = auto , string = replace output + * @return string * @see getTaskProgressView() */ function getTaskProgressBadge($task, $label = '', $tooltip = '') From d77ad7dcbf82355649fbaf4a4ed57cd6cd6dc1a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 26 Nov 2019 19:46:56 +0100 Subject: [PATCH 39/42] fix urlsource line 767: $reception->id = $obj->rowid; --- htdocs/reception/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index beadddc6397..eaf4f14bbe6 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -781,7 +781,7 @@ if ($resql) print $reception->getNomUrl(1); $filename = dol_sanitizeFileName($reception->ref); $filedir = $conf->reception->dir_output.'/'.dol_sanitizeFileName($reception->ref); - $urlsource = $_SERVER['PHP_SELF'].'?id='.$reception->rowid; + $urlsource = $_SERVER['PHP_SELF'].'?id='.$reception->id; print $formfile->getDocumentsLink($reception->element, $filename, $filedir); print "\n"; From 9a9a43fc4dbb800bc57da0080a55485be23ccc4b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Nov 2019 11:34:10 +0100 Subject: [PATCH 40/42] Return OS with ping --- htdocs/core/lib/functions2.lib.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 12d9b06fee6..cd636d02e9c 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1564,11 +1564,13 @@ function dol_print_reduction($reduction, $langs) * Return OS version. * Note that PHP_OS returns only OS (not version) and OS PHP was built on, not necessarly OS PHP runs on. * - * @return string OS version + * @param string $option Option string + * @return string OS version */ -function version_os() +function version_os($option = '') { - $osversion = php_uname(); + if ($option) $osversion = php_uname($option); + else $osversion = php_uname(); return $osversion; } From c22fea52e54f29b43c9c683f20ef00eef9d38296 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Nov 2019 11:38:30 +0100 Subject: [PATCH 41/42] Fix do not ping name of server --- htdocs/admin/system/os.php | 4 ++-- htdocs/core/lib/functions2.lib.php | 2 +- htdocs/main.inc.php | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/system/os.php b/htdocs/admin/system/os.php index 7399a218e9c..d171fcaa2ec 100644 --- a/htdocs/admin/system/os.php +++ b/htdocs/admin/system/os.php @@ -42,11 +42,11 @@ print ''.$langs->trans("Parameter").''.$lan print "\n"; // Recupere l'OS au sens PHP -print "".$langs->trans("PHP_OS")."".PHP_OS."\n"; +print ''.$langs->trans("PHP_OS")."".PHP_OS."\n"; // Recupere la version de l'OS $osversion=version_os(); -print "".$langs->trans("Version")."".$osversion."\n"; +print ''.$langs->trans("Version")."".$osversion."\n"; print ''; // End of page diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index cd636d02e9c..0356ecc8b23 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1569,7 +1569,7 @@ function dol_print_reduction($reduction, $langs) */ function version_os($option = '') { - if ($option) $osversion = php_uname($option); + if ($option == 'smr') $osversion = php_uname('s').' '.php_uname('m').' '.php_uname('r'); else $osversion = php_uname(); return $osversion; } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6b17bb6f947..938f4411b57 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2551,6 +2551,7 @@ if (!function_exists("llxFooter")) print ''."\n"; // Add code for the asynchronous anonymous first ping (for telemetry) + // You can use &forceping=1 in parameters to force the ping. if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || GETPOST('forceping', 'alpha')) { //print ''; @@ -2560,6 +2561,8 @@ if (!function_exists("llxFooter")) { if (empty($_COOKIE['DOLINSTALLNOPING_'.md5($conf->file->instance_unique_id)])) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + print "\n".''."\n"; print "\n\n"; $hash_unique_id = md5('dolibarr'.$conf->file->instance_unique_id); @@ -2580,7 +2583,8 @@ if (!function_exists("llxFooter")) entity: "entity; ?>", dbtype: "type); ?>", country_code: "country_code); ?>", - php_version: "" + php_version: "", + os_version: "" }, success: function (data, status, xhr) { // success callback function (data contains body of response) console.log("Ping ok"); From 723222ec8f30245b26fcad96c2ec47dd6aa324de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Nov 2019 13:58:24 +0100 Subject: [PATCH 42/42] Prepare v11 - Add CHANGELOG --- ChangeLog | 179 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 178 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6fdbcfcd899..6258b36e084 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,9 +6,184 @@ English Dolibarr ChangeLog ***** ChangeLog for 11.0.0 compared to 10.0.0 ***** For Users: +NEW: Module BOM is now stable (Module MO - Manufacturing Order is still in development). +NEW: A nicer dashboard for opened elements on Home page. +NEW: Add task widget and add task progress bar +NEW: Accountancy - Can add specific widget in this accountancy area. +NEW: Accountancy - Add export model LDCompta V9 & higher +NEW: Accountancy - Add permission on export, delete operations in ledger +NEW: Add 2 hidden options to set the default sorting (sort and order) on document page. +NEW: add ability to edit price without tax before adding a line of a predefined product. +NEW: Add a tab to setup "Opening hours" of company (information only). +NEW: Add attendee to ical export + cleanup. +NEW: Add bank data of users into the expense report exports. +NEW: add clone customers prices in clone product or service. +NEW: Add column of module source and POS terminal in the invoice list. +NEW: Add column last modification date into the table of targets for emailing. +NEW: Add column VAT rate in product list +NEW: add constant DISPATCH_FORCE_QTY_INPUT +NEW: Add constant MAIN_DISABLE_GLOBAL_WORKBOARD to disable workboard in home page +NEW: add country code in import product model +NEW: Add 'Direct Cash Payment' button in TakePOS +NEW: Add odt support to supplier orders +NEW: Add experimental SumUp payment to TakePOS (need to set a hidden constant) +NEW: Add feature to search a string into website containers +NEW: Add GET and POST /supplierinvoices/payments REST API endpoints. +NEW: Show progress bar for declared progression of tasks. +NEW: Add hidden option to update supplier buying price during receptions. +NEW: Add hidden option PROPOSAL_SHOW_INVOICED_AMOUNT (not reliable if one invoice is done on several order or several proposal) +NEW: Add hidden option SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT for add possibility to update supplier buying price in the reception on a supplier order +NEW: Add hidden option THIRDPARTY_PROPAGATE_EXTRAFIELDS_TO_ORDER to copy extrafields from third party to order. +NEW: Add hidden options to send by email even for object with draft status. +NEW: Add last change date in page "Other setup". Can sort page on name/date. +NEW: Add link to export targets of an emailings into a CSV file. +NEW: Add link to the public interface on the ticket card. +NEW: Add location into event tooltip. Use full day for fullday events +NEW: add MAIN_LANGUAGES_ALLOWED constant to limit languages displayed. +NEW: add MAIN_SHOW_COMPANY_NAME_IN_BANNER_ADDRESS constant. +NEW: add mass actions in shipment list. +NEW: add minimum stock filter in load warehoues for product form. +NEW: add name_alias in fields to search all +NEW: add new rule fetchidfromcodeandlabel for categories import +NEW: add office phone for salespresentatives +NEW: add office phone & job on user tooltips +NEW: Add option MAIN_PDF_FORCE_FONT_SIZE +NEW: Add option MEMBER_CAN_CONVERT_CUSTOMERS_TO_MEMBERS +NEW: Add option multiselect for developers on the selector of language. +NEW: Add option WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_PROPOSAL +NEW: Add pagination on list of object of a category +NEW: add parent category id or label in import category module +NEW: add parent id or ref column in warehouse import +NEW: Can set the Address/Contact by default on third parties. +NEW: Add search into template +NEW: Add shipment widget +NEW: add socialnetworks dictionary +NEW: Add statistics on product into contracts +NEW: Add status of warehouse in tooltip of a warehouse. +NEW: add supplier's product list +NEW: add units fields in buying price tab of product card +NEW: Add units in select products lines +NEW: Add upload document on account statement +NEW: Add widgets for BOMs and MOs +NEW: Amount invoiced column in proposal list +NEW: Ask the new label and new dates in confirm popup when cloning tax +NEW: auto set closing date and user on invoice +NEW: Avoid wrap between picto and text on getNomUrl +NEW: Balance Stripe connect account for supplier +NEW: Bank Add an option for colorize background color of debit or credit movement +NEW: Beautify the select box of warehouses +NEW: birthday widget for member +NEW: Widgets uses fiscal year +NEW: Can change supplier when cloning a Purchase Order +NEW: can choose lines while creating order from origin +NEW: Can crop/resize image attached on a bank record +NEW: Can defined a position of numbering submodules for thirdparties +NEW: Can edit date or RUM mandate. +NEW: Can edit link to the translation page in website module +NEW: Can edit the price of predefined product during adding in documents +NEW: Can enter price tax incl on vendor proposal and purchase orders +NEW: Can filter on description on bank account transaction lists. +NEW: Can filter on label on invoice in accounting vendor binding pages +NEW: Can load multilang translation in same step than fetch_lines +NEW: Can restrict access using DAV module to some host IPs only +NEW: Can restrict API usage to some IP only +NEW: Can select website templates from available default templates with a preview. +NEW: Can set a filter on object linked in modulebuilder. +NEW: Can set a squarred icon on your company setup +NEW: can specify hour start end for selectDate and step for minutes +NEW: Categories/Tags are also available on warehouses +NEW: Check if a resource is in use in an event +NEW: Code for extrafields uses the new array $extrafields->attributes +NEW: Compute column value from others columns in import module +NEW: Copy linked categories on product clone process. +NEW: Default for Stripe is STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION +NEW: Digitaria model for numbering accountancy thirdparty +NEW: Display membership in takepos if member linked to the thirdparty +NEW: Display supplier in objectline if defined +NEW: Add default duration of subscriptions on members type +NEW: Email template for Takepos (to send invoice) +NEW: Expense request and holiday validator fields +NEW: Export ledger table in Charlemagne format +NEW: Export livre Charlemagne +NEW: Extend option ORDER_ADD_ORDERS_WITH_PARENT_PROD_IF_INCDEC for all virtual product stats (renamed into PRODUCT_STATS_WITH_PARENT_PROD_IF_INCDEC) +NEW: FCKeditor setup for tickets +NEW: GeoIP v2 support is natively provided -> So IPv6 is supported +NEW: List by closing date on order list and proposal list +NEW: Look and feel v11: Some setup pages are by default direclty in edit mode. +NEW: Management of retained warranty on situation invoices +NEW: Mass email action on invoice list use billing contact if exists +NEW: more living colors for charts and option for "color bind" people +NEW: Supports multiple payments in a TakePOS sale +NEW: multiselect with checkbox in categories/tags search for product list +NEW: Option to allow to create members from third-party +NEW: Platform compliance with Stripe Connect +NEW: print / send email form in TakePOS +NEW: Public holidays are now in a dictionary table (no more hard coded per country) +NEW: Better performance by reducing the $companystatic calls on some pages. +NEW: Replace the "info" tab on contract with the more complete "agenda" tab. +NEW: Save user of last modification in donation record. +NEW: Show html combo list instead input text for extrafields typed as list. +NEW: Show POS application and the terminal used on invoice card. +NEW: Add categories/tags for stocks. +NEW: Support Net Measure in product's card.php +NEW: Extrafields separator can be collapsed or not +NEW: Extrafields support on Leave requests. +NEW: Extrafields support on Salaries. +NEW: Extrafields support in Product supplier prices. +NEW: Add extrafields for warehouses +NEW: Add extrafields in export of expense report (and holiday) +NEW: The integrity checker now show also the expected size of files. +NEW: The order method in purchase order is now mandatory when recording an order. +NEW: update / delete stripe account for supplier +NEW: Use the gender of member for picto in member lists. +NEW: Use the squarre logo as favicon of pages +NEW: VAT list - Add date start & date end in filters +NEW: widget box for supplier orders awaiting reception +NEW: Update translations +NEW: #4301 -For Developers: +For Developers or integrators: +NEW: Add a manifest.json.php file for web app. +NEW: Removed deprecated code that create linked object from ->origin +NEW: experimental zapier for dolibarr +NEW: Accountancy - Add hook bookkeepinglist on general ledger +NEW: Can update product type with the update method. +NEW: add API shipment mode dictionnary +NEW: Add API to get Country by code and iso +NEW: Add API to get objects by ref, ref_ext, ... +NEW: Add anonymous telemetry +NEW: Add a category to a contact in API +NEW: Add fk projet on stock movement +NEW: Add hidden option to set fields for the quick search on products. +NEW: add hook on commongeneratedocument +NEW: Add hook on fileupload.class.php to enable modules to override… +NEW: Add hooks on index pages +NEW: adding 'formObjectOptions' hooks loading at card.php of adherents module +NEW: Add method getStructuredData for website +NEW: Add payments GET and POST REST API endpoints for supplierinvoices. +NEW: Add POST /bankaccounts/transfer REST API endpoint. +NEW: add "printBucktrackInfo" hook, an external module can add info +NEW: Add trigger DIRECT_DEBIT_ORDER_CREATE on widthdraw is missing +NEW: API to post documents for "product" and Delete document +NEW: add new function "setEntity()" and better compatibility with Multicompany +NEW: Can add a button "Create" after combo of object with modulebuilder. +NEW: contacts type dictionnary in api_setup.class.php +NEW: Look and feel v11: Introduce CSS "trforbreak" +NEW: list of measuring units API +NEW: get social networks dictionary by API +NEW: Get thirdparty's salesrepresentatives by API +NEW: get user connected informations in REST API +NEW: mode for list thirdparty API (add easy filter for supplier only) +NEW: purchase_prices API +NEW: Provides more complete demo data +NEW: Module builder can generate CSS of JS file. +NEW: Use a dedicated css for the pencil to edit a field. +NEW: multilangs in fetch_lines +NEW: Add more complete info for triggers actioncom +NEW: add multicurrency rate at currency list API +NEW: Update jquery library to 3.4.1 +NEW: Upgrade ACE editor to v1.4.6 WARNING: @@ -31,6 +206,8 @@ Following changes may create regressions for some external modules, but were nec * Renamed property of thirdparty "statut_commercial" into "status_prospect_label" * The jquery plugin/dependency multiselect has been removed. It was not used by Dolibarr core. + + ***** ChangeLog for 10.0.3 compared to 10.0.2 ***** IMPORTANT : This version fixes a serious bug in saving the units of weight, size, surface and volume on product card. The unit were not saved correctly in database making calculation on shipments wrong.