From e74043d48e8cec111fb052506bc9621f107b8f1d Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Wed, 22 Sep 2021 17:56:31 +0200 Subject: [PATCH 01/64] Close: #18801 Jan-30 + 1m IS NOT Mar-2 Close: #18801 related to avoid this behaviour https://bugs.php.net/bug.php?id=74013 --- htdocs/core/lib/date.lib.php | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index fe21071901a..21a8835a229 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -166,7 +166,33 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit) } else { $date->add($interval); } - + //Change the behavior of PHP over data-interval when the result of this function is Feb 29 (non-leap years), 30 or Feb 31 (php returns March 1, 2 or 3 respectively) + if ($conf->global->MAIN_DATE_CHANGE_PHP_DATEINTERVAL_RESULT_FEBRUARY && $duration_unit == 'm') { + + $timeyear = dol_print_date($time, '%Y'); + $timemonth = dol_print_date($time, '%m'); + $timetotalmonths = (($timeyear * 12) + $timemonth); + + $monthsexpected = ($timetotalmonths + $duration_value); + + $newtime = $date->getTimestamp(); + + $newtimeyear = dol_print_date($newtime, '%Y'); + $newtimemonth = dol_print_date($newtime, '%m'); + $newtimetotalmonths = (($newtimeyear * 12) + $newtimemonth); + + if ($monthsexpected < $newtimetotalmonths) { + + $newtimehours = dol_print_date($newtime, '%m'); + $newtimemins = dol_print_date($newtime, '%m'); + $newtimesecs = dol_print_date($newtime, '%m'); + + $datelim = dol_mktime($newtimehours, $newtimemins, $newtimesecs, $newtimemonth, 1, $newtimeyear); + $datelim -= (3600 * 24); + + $date->setTimestamp($datelim); + } + } return $date->getTimestamp(); } From e5cff0ede117553c11b269a2a529fbac41eee8fb Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 22 Sep 2021 16:07:36 +0000 Subject: [PATCH 02/64] Fixing style errors. --- htdocs/core/lib/date.lib.php | 46 +++++++++++++++++------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 21a8835a229..cff6d22518f 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -168,30 +168,28 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit) } //Change the behavior of PHP over data-interval when the result of this function is Feb 29 (non-leap years), 30 or Feb 31 (php returns March 1, 2 or 3 respectively) if ($conf->global->MAIN_DATE_CHANGE_PHP_DATEINTERVAL_RESULT_FEBRUARY && $duration_unit == 'm') { - - $timeyear = dol_print_date($time, '%Y'); - $timemonth = dol_print_date($time, '%m'); - $timetotalmonths = (($timeyear * 12) + $timemonth); - - $monthsexpected = ($timetotalmonths + $duration_value); - - $newtime = $date->getTimestamp(); - - $newtimeyear = dol_print_date($newtime, '%Y'); - $newtimemonth = dol_print_date($newtime, '%m'); - $newtimetotalmonths = (($newtimeyear * 12) + $newtimemonth); - - if ($monthsexpected < $newtimetotalmonths) { - - $newtimehours = dol_print_date($newtime, '%m'); - $newtimemins = dol_print_date($newtime, '%m'); - $newtimesecs = dol_print_date($newtime, '%m'); - - $datelim = dol_mktime($newtimehours, $newtimemins, $newtimesecs, $newtimemonth, 1, $newtimeyear); - $datelim -= (3600 * 24); - - $date->setTimestamp($datelim); - } + $timeyear = dol_print_date($time, '%Y'); + $timemonth = dol_print_date($time, '%m'); + $timetotalmonths = (($timeyear * 12) + $timemonth); + + $monthsexpected = ($timetotalmonths + $duration_value); + + $newtime = $date->getTimestamp(); + + $newtimeyear = dol_print_date($newtime, '%Y'); + $newtimemonth = dol_print_date($newtime, '%m'); + $newtimetotalmonths = (($newtimeyear * 12) + $newtimemonth); + + if ($monthsexpected < $newtimetotalmonths) { + $newtimehours = dol_print_date($newtime, '%m'); + $newtimemins = dol_print_date($newtime, '%m'); + $newtimesecs = dol_print_date($newtime, '%m'); + + $datelim = dol_mktime($newtimehours, $newtimemins, $newtimesecs, $newtimemonth, 1, $newtimeyear); + $datelim -= (3600 * 24); + + $date->setTimestamp($datelim); + } } return $date->getTimestamp(); } From c4f1eb0c46fdaa81cc335e906177d752e8bb829e Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Mon, 27 Sep 2021 14:32:03 +0200 Subject: [PATCH 03/64] Update date.lib.php Fix my error --- htdocs/core/lib/date.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index cff6d22518f..b17c0c9d56d 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -181,9 +181,9 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit) $newtimetotalmonths = (($newtimeyear * 12) + $newtimemonth); if ($monthsexpected < $newtimetotalmonths) { - $newtimehours = dol_print_date($newtime, '%m'); - $newtimemins = dol_print_date($newtime, '%m'); - $newtimesecs = dol_print_date($newtime, '%m'); + $newtimehours = dol_print_date($newtime, '%h'); + $newtimemins = dol_print_date($newtime, '%i'); + $newtimesecs = dol_print_date($newtime, '%s'); $datelim = dol_mktime($newtimehours, $newtimemins, $newtimesecs, $newtimemonth, 1, $newtimeyear); $datelim -= (3600 * 24); From 11723c2cd08fb15ffac8a51e8526fb9fec5c287a Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Mon, 27 Sep 2021 14:49:22 +0200 Subject: [PATCH 04/64] Update date.lib.php Without words, sorry --- htdocs/core/lib/date.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index b17c0c9d56d..613533a443a 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -181,9 +181,9 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit) $newtimetotalmonths = (($newtimeyear * 12) + $newtimemonth); if ($monthsexpected < $newtimetotalmonths) { - $newtimehours = dol_print_date($newtime, '%h'); - $newtimemins = dol_print_date($newtime, '%i'); - $newtimesecs = dol_print_date($newtime, '%s'); + $newtimehours = dol_print_date($newtime, '%H'); + $newtimemins = dol_print_date($newtime, '%M'); + $newtimesecs = dol_print_date($newtime, '%S'); $datelim = dol_mktime($newtimehours, $newtimemins, $newtimesecs, $newtimemonth, 1, $newtimeyear); $datelim -= (3600 * 24); From 0865916fe2c65db05c02926d38e3fec635fa662d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Oct 2021 10:01:07 +0200 Subject: [PATCH 05/64] Init page for public subscription --- htdocs/partnership/admin/website.php | 258 ++++++++ .../partnership/class/partnership.class.php | 4 +- htdocs/partnership/lib/partnership.lib.php | 5 + htdocs/public/partnership/index.php | 26 + htdocs/public/partnership/new.php | 620 ++++++++++++++++++ htdocs/theme/eldy/btn.inc.php | 2 +- 6 files changed, 912 insertions(+), 3 deletions(-) create mode 100644 htdocs/partnership/admin/website.php create mode 100644 htdocs/public/partnership/index.php create mode 100644 htdocs/public/partnership/new.php diff --git a/htdocs/partnership/admin/website.php b/htdocs/partnership/admin/website.php new file mode 100644 index 00000000000..96ebb4ba6e9 --- /dev/null +++ b/htdocs/partnership/admin/website.php @@ -0,0 +1,258 @@ + + * Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2006-2012 Regis Houssin + * Copyright (C) 2011 Juanjo Menent + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/partnership/admin/website.php + * \ingroup partnership + * \brief File of main public page for partnership module + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array("admin", "partnership")); + +$action = GETPOST('action', 'aZ09'); + +if (!$user->admin) { + accessforbidden(); +} + +$error = 0; + + +/* + * Actions + */ + +if ($action == 'setPARTNERSHIP_ENABLE_PUBLIC') { + if (GETPOST('value')) { + dolibarr_set_const($db, 'PARTNERSHIP_ENABLE_PUBLIC', 1, 'chaine', 0, '', $conf->entity); + } else { + dolibarr_set_const($db, 'PARTNERSHIP_ENABLE_PUBLIC', 0, 'chaine', 0, '', $conf->entity); + } +} + +if ($action == 'update') { + $public = GETPOST('PARTNERSHIP_ENABLE_PUBLIC'); + + $res = dolibarr_set_const($db, "PARTNERSHIP_ENABLE_PUBLIC", $public, 'chaine', 0, '', $conf->entity); + + if (!($res > 0)) { + $error++; + } + + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + + +/* + * View + */ + +$form = new Form($db); + +//$help_url = 'EN:Module_Partnership|FR:Module_Adhérents|ES:Módulo_Miembros'; +llxHeader('', $langs->trans("PartnershipsSetup"), $help_url); + + +$linkback = ''.$langs->trans("BackToModuleList").''; +print load_fiche_titre($langs->trans("PartnershipsSetup"), $linkback, 'title_setup'); + +$head = partnershipAdminPrepareHead(); + + + +print '
'; +print ''; +print ''; + +print dol_get_fiche_head($head, 'website', $langs->trans("Partnerships"), -1, 'user'); + +if ($conf->use_javascript_ajax) { + print "\n".''."\n"; +} + + +print ''.$langs->trans("BlankSubscriptionFormDesc").'

'; + +$param = ''; + +$enabledisablehtml = $langs->trans("EnablePublicSubscriptionForm").' '; +if (empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) { + // Button off, click to enable + $enabledisablehtml .= ''; + $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); + $enabledisablehtml .= ''; +} else { + // Button on, click to disable + $enabledisablehtml .= ''; + $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); + $enabledisablehtml .= ''; +} +print $enabledisablehtml; +print ''; + + +print '
'; + +if (!empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) { + print '
'; + + print '
'; + print ''; + + print ''; + print ''; + print ''; + print "\n"; + + // Force Type + $adht = new AdherentType($db); + print '\n"; + + // Force nature of member (mor/phy) + $morphys["phy"] = $langs->trans("Physical"); + $morphys["mor"] = $langs->trans("Moral"); + print '\n"; + + // Amount + print '\n"; + + // Can edit + print '\n"; + + // Jump to an online payment page + print '\n"; + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print $langs->trans("ForceMemberType"); + print ''; + $listofval = array(); + $listofval += $adht->liste_array(1); + $forcetype = empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE) ? -1 : $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE; + print $form->selectarray("PARTNERSHIP_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listofval) > 1 ? 1 : 0); + print "
'; + print $langs->trans("ForceMemberNature"); + print ''; + $forcenature = empty($conf->global->PARTNERSHIP_NEWFORM_FORCEMORPHY) ? 0 : $conf->global->PARTNERSHIP_NEWFORM_FORCEMORPHY; + print $form->selectarray("PARTNERSHIP_NEWFORM_FORCEMORPHY", $morphys, $forcenature, 1); + print "
'; + print $langs->trans("DefaultAmount"); + print ''; + print ''; + print "
'; + print $langs->trans("CanEditAmount"); + print ''; + print $form->selectyesno("PARTNERSHIP_NEWFORM_EDITAMOUNT", (!empty($conf->global->PARTNERSHIP_NEWFORM_EDITAMOUNT) ? $conf->global->PARTNERSHIP_NEWFORM_EDITAMOUNT : 0), 1); + print "
'; + print $langs->trans("PARTNERSHIP_NEWFORM_PAYONLINE"); + print ''; + $listofval = array(); + $listofval['-1'] = $langs->trans('No'); + $listofval['all'] = $langs->trans('Yes').' ('.$langs->trans("VisitorCanChooseItsPaymentMode").')'; + if (!empty($conf->paybox->enabled)) { + $listofval['paybox'] = 'Paybox'; + } + if (!empty($conf->paypal->enabled)) { + $listofval['paypal'] = 'PayPal'; + } + if (!empty($conf->stripe->enabled)) { + $listofval['stripe'] = 'Stripe'; + } + print $form->selectarray("PARTNERSHIP_NEWFORM_PAYONLINE", $listofval, (!empty($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE) ? $conf->global->PARTNERSHIP_NEWFORM_PAYONLINE : ''), 0); + print "
'; + print '
'; + + print '
'; + print ''; + print '
'; +} + + +print dol_get_fiche_end(); + +print '
'; + + +if (!empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) { + print '
'; + //print $langs->trans('FollowingLinksArePublic').'
'; + print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').'
'; + if (!empty($conf->multicompany->enabled)) { + $entity_qr = '?entity='.$conf->entity; + } else { + $entity_qr = ''; + } + + // Define $urlwithroot + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + + print ''; + print ajax_autoselect('publicurlmember'); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index f40b771b34d..1e3d3cebab1 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -131,14 +131,14 @@ class Partnership extends CommonObject */ public $rowid; - public $fk_soc; + public $fk_soc; // Link to thirdparty + public $fk_member; // Link to member public $tms; public $fk_user_creat; public $fk_user_modif; public $status; - public $fk_member; public $date_partnership_start; public $date_partnership_end; public $count_last_url_check_error; diff --git a/htdocs/partnership/lib/partnership.lib.php b/htdocs/partnership/lib/partnership.lib.php index 5305f86132e..23b5a2901fb 100644 --- a/htdocs/partnership/lib/partnership.lib.php +++ b/htdocs/partnership/lib/partnership.lib.php @@ -46,6 +46,11 @@ function partnershipAdminPrepareHead() $head[$h][2] = 'partnership_extrafields'; $h++; + $head[$h][0] = dol_buildpath("/partnership/admin/website.php", 1); + $head[$h][1] = $langs->trans("BlankSubscriptionForm"); + $head[$h][2] = 'website'; + $h++; + /* $head[$h][0] = dol_buildpath("/partnership/admin/about.php", 1); $head[$h][1] = $langs->trans("About"); diff --git a/htdocs/public/partnership/index.php b/htdocs/public/partnership/index.php new file mode 100644 index 00000000000..6a9a6f8a557 --- /dev/null +++ b/htdocs/public/partnership/index.php @@ -0,0 +1,26 @@ + + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/partnership/index.php + * \ingroup core + * \brief A redirect page to an error + */ + +require '../../master.inc.php'; + +header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); diff --git a/htdocs/public/partnership/new.php b/htdocs/public/partnership/new.php new file mode 100644 index 00000000000..a46488ab5f9 --- /dev/null +++ b/htdocs/public/partnership/new.php @@ -0,0 +1,620 @@ + + * Copyright (C) 2001-2002 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2021 Waël Almoman + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/partnership/new.php + * \ingroup member + * \brief Example of form to add a new member + */ + +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); // This means this output page does not require to be logged. +} +if (!defined('NOCSRFCHECK')) { + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} + +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retrieve from object ref and not from url. +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_numeric($entity)) { + define("DOLENTITY", $entity); +} + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + +// Init vars +$errmsg = ''; +$num = 0; +$error = 0; +$backtopage = GETPOST('backtopage', 'alpha'); +$action = GETPOST('action', 'aZ09'); + +// Load translation files +$langs->loadLangs(array("main", "members", "companies", "install", "other")); + +// Security check +if (empty($conf->partnership->enabled)) { + accessforbidden('', 0, 0, 1); +} + +if (empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) { + print $langs->trans("Auto subscription form for public visitors has not been enabled"); + exit; +} + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('publicnewpartnershipcard', 'globalcard')); + +$extrafields = new ExtraFields($db); + +$object = new Partnership($db); + +$user->loadDefaultValues(); + + +/** + * Show header for new partnership + * + * @param string $title Title + * @param string $head Head array + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files + * @return void + */ +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +{ + global $user, $conf, $langs, $mysoc; + + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers + + print ''; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
'; + + // Output html code for logo + if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; + } + + if (!empty($conf->global->PARTNERSHIP_IMAGE_PUBLIC_REGISTRATION)) { + print '
'; + print ''; + print '
'; + } + + print '
'; + + print '
'; +} + +/** + * Show footer for new member + * + * @return void + */ +function llxFooterVierge() +{ + print '
'; + + printCommonFooter('public'); + + print "\n"; + print "\n"; +} + + + +/* + * Actions + */ +$parameters = array(); +// Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +// Action called when page is submitted +if (empty($reshook) && $action == 'add') { + $error = 0; + $urlback = ''; + + $db->begin(); + + /*if (GETPOST('typeid') <= 0) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"))."
\n"; + }*/ + if (!GETPOST('lastname')) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n"; + } + if (!GETPOST('firstname')) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n"; + } + if (empty(GETPOST('email'))) { + $error++; + $errmsg .= $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Email'))."
\n"; + } elseif (GETPOST("email") && !isValidEmail(GETPOST("email"))) { + $langs->load('errors'); + $error++; + $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; + } + + $public = GETPOSTISSET('public') ? 1 : 0; + + if (!$error) { + $partnership = new Partnership($db); + + // We try to find the thirdparty or the member + if (empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) || $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'thirdparty') { + + + $partnership->fk_member = 0; + } elseif ($conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') { + + + $partnership->fk_soc = 0; + } + + $partnership->statut = -1; + $partnership->firstname = GETPOST('firstname'); + $partnership->lastname = GETPOST('lastname'); + $partnership->address = GETPOST('address'); + $partnership->zip = GETPOST('zipcode'); + $partnership->town = GETPOST('town'); + $partnership->email = GETPOST('email'); + $partnership->country_id = GETPOST('country_id', 'int'); + $partnership->state_id = GETPOST('state_id', 'int'); + //$partnership->typeid = $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE ? $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE : GETPOST('typeid', 'int'); + $partnership->note_private = GETPOST('note_private'); + + // Fill array 'array_options' with data from add form + $extrafields->fetch_name_optionals_label($partnership->table_element); + $ret = $extrafields->setOptionalsFromPost(null, $partnership); + if ($ret < 0) { + $error++; + } + + $result = $partnership->create($user); + if ($result > 0) { + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $object = $partnership; + + /* + $partnershipt = new PartnershipType($db); + $partnershipt->fetch($object->typeid); + + if ($object->email) { + $subject = ''; + $msg = ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + $labeltouse = $conf->global->PARTNERSHIP_EMAIL_TEMPLATE_AUTOREGISTER; + + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $partnershipt->getMailOnValid()), $substitutionarray, $outputlangs); + + if ($subjecttosend && $texttosend) { + $moreinheader = 'X-Dolibarr-Info: send_an_email by public/members/new.php'."\r\n"; + + $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader); + } + } + */ + + // Send email to the foundation to say a new member subscribed with autosubscribe form + if (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) && !empty($conf->global->PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL_SUBJECT) && + !empty($conf->global->PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL)) { + // Define link to login card + $appli = constant('DOL_APPLICATION_TITLE'); + if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { + $appli = $conf->global->MAIN_APPLICATION_TITLE; + if (preg_match('/\d\.\d/', $appli)) { + if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) { + $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core + } + } else { + $appli .= " ".DOL_VERSION; + } + } else { + $appli .= " ".DOL_VERSION; + } + + $to = $partnership->makeSubstitution($conf->global->MAIN_INFO_SOCIETE_MAIL); + $from = $conf->global->PARTNERSHIP_MAIL_FROM; + $mailfile = new CMailFile( + '['.$appli.'] '.$conf->global->PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL_SUBJECT, + $to, + $from, + $partnership->makeSubstitution($conf->global->PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL), + array(), + array(), + array(), + "", + "", + 0, + -1 + ); + + if (!$mailfile->sendfile()) { + dol_syslog($langs->trans("ErrorFailedToSendMail", $from, $to), LOG_ERR); + } + } + + if (!empty($backtopage)) { + $urlback = $backtopage; + } elseif (!empty($conf->global->PARTNERSHIP_URL_REDIRECT_SUBSCRIPTION)) { + $urlback = $conf->global->PARTNERSHIP_URL_REDIRECT_SUBSCRIPTION; + // TODO Make replacement of __AMOUNT__, etc... + } else { + $urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken(); + } + + if (!empty($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE) && $conf->global->PARTNERSHIP_NEWFORM_PAYONLINE != '-1') { + if ($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE == 'all') { + $urlback = DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?from=partnershipnewform&source=membersubscription&ref='.urlencode($partnership->ref); + if (price2num(GETPOST('amount', 'alpha'))) { + $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); + } + if (GETPOST('email')) { + $urlback .= '&email='.urlencode(GETPOST('email')); + } + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$partnership->ref, 2)); + } else { + $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } elseif ($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE == 'paybox') { + $urlback = DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=partnershipnewform&source=membersubscription&ref='.urlencode($partnership->ref); + if (price2num(GETPOST('amount', 'alpha'))) { + $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); + } + if (GETPOST('email')) { + $urlback .= '&email='.urlencode(GETPOST('email')); + } + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$partnership->ref, 2)); + } else { + $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } elseif ($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE == 'paypal') { + $urlback = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?from=partnershipnewform&source=membersubscription&ref='.urlencode($partnership->ref); + if (price2num(GETPOST('amount', 'alpha'))) { + $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); + } + if (GETPOST('email')) { + $urlback .= '&email='.urlencode(GETPOST('email')); + } + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$partnership->ref, 2)); + } else { + $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } elseif ($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE == 'stripe') { + $urlback = DOL_MAIN_URL_ROOT.'/public/stripe/newpayment.php?from=partnershipnewform&source=membersubscription&ref='.$partnership->ref; + if (price2num(GETPOST('amount', 'alpha'))) { + $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); + } + if (GETPOST('email')) { + $urlback .= '&email='.urlencode(GETPOST('email')); + } + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$partnership->ref, 2)); + } else { + $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } else { + dol_print_error('', "Autosubscribe form is setup to ask an online payment for a not managed online payment"); + exit; + } + } + + if (!empty($entity)) { + $urlback .= '&entity='.$entity; + } + dol_syslog("partnership ".$partnership->ref." was created, we redirect to ".$urlback); + } else { + $error++; + $errmsg .= join('
', $partnership->errors); + } + } + + if (!$error) { + $db->commit(); + + Header("Location: ".$urlback); + exit; + } else { + $db->rollback(); + } +} + +// Action called after a submitted was send and member created successfully +// If PARTNERSHIP_URL_REDIRECT_SUBSCRIPTION is set to url we never go here because a redirect was done to this url. +// backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url. +if (empty($reshook) && $action == 'added') { + llxHeaderVierge($langs->trans("NewPartnershipForm")); + + // Si on a pas ete redirige + print '
'; + print '
'; + print $langs->trans("NewPartnershipbyWeb"); + print '
'; + + llxFooterVierge(); + exit; +} + + + +/* + * View + */ + +$form = new Form($db); +$formcompany = new FormCompany($db); +$partnershipt = new AdherentType($db); +$extrafields->fetch_name_optionals_label('partnership'); // fetch optionals attributes and labels + + +llxHeaderVierge($langs->trans("NewSubscription")); + + +print load_fiche_titre($langs->trans("NewSubscription"), '', '', 0, 0, 'center'); + + +print '
'; +print '
'; + +print '
'; +if (!empty($conf->global->PARTNERSHIP_NEWFORM_TEXT)) { + print $langs->trans($conf->global->PARTNERSHIP_NEWFORM_TEXT)."
\n"; +} else { + print $langs->trans("NewSubscriptionDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL)."
\n"; +} +print '
'; + +dol_htmloutput_errors($errmsg); + +// Print form +print '
'."\n"; +print ''; +print ''; +print ''; + +print '
'; + +print '
'.$langs->trans("FieldsWithAreMandatory", '*').'
'; +//print $langs->trans("FieldsWithIsForPublic",'**').'
'; + +print dol_get_fiche_head(''); + +print ''; + + +print ''."\n"; + +// Type +/* +if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE)) { + $listoftype = $partnershipt->liste_array(); + $tmp = array_keys($listoftype); + $defaulttype = ''; + $isempty = 1; + if (count($listoftype) == 1) { + $defaulttype = $tmp[0]; + $isempty = 0; + } + print ''."\n"; +} else { + $partnershipt->fetch($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE); + print ''; +} +*/ + +// Moral/Physic attribute +$morphys["phy"] = $langs->trans("Physical"); +$morphys["mor"] = $langs->trans("Moral"); +if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCEMORPHY)) { + print ''."\n"; +} else { + print $morphys[$conf->global->PARTNERSHIP_NEWFORM_FORCEMORPHY]; + print ''; +} + +// Company +print ''."\n"; +// Title +print ''."\n"; +// Lastname +print ''."\n"; +// Firstname +print ''."\n"; +// EMail +print ''."\n"; +// Login +if (empty($conf->global->PARTNERSHIP_LOGIN_NOT_REQUIRED)) { + print ''."\n"; + print ''."\n"; + print ''."\n"; +} +// Gender +print ''; +print ''; +// Address +print ''."\n"; +// Zip / Town +print ''; +// Country +print ''; +// State +if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; +} +// Logo +//print ''."\n"; +// Other attributes +$tpl_context = 'public'; // define template context to public +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; +// Comments +print ''; +print ''; +print ''; +print ''."\n"; + +print "
'.$langs->trans("Type").' *'; + print $form->selectarray("typeid", $partnershipt->liste_array(1), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty); + print '
'.$langs->trans('MemberNature').' *'."\n"; + print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); + print '
'.$langs->trans("Company").''; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print '
'.$langs->trans('UserTitle').''; +print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Email").($conf->global->PARTNERSHIP_MAIL_REQUIRED ? ' *' : '').''; +//print img_picto('', 'email', 'class="pictofixedwidth"'); +print '
'.$langs->trans("Login").' *
'.$langs->trans("Password").' *
'.$langs->trans("PasswordAgain").' *
'.$langs->trans("Gender").''; +$arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); +print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); +print '
'.$langs->trans("Address").''."\n"; +print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); +print ' / '; +print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); +print '
'.$langs->trans('Country').''; +print img_picto('', 'country', 'class="pictofixedwidth"'); +$country_id = GETPOST('country_id', 'int'); +if (!$country_id && !empty($conf->global->PARTNERSHIP_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->PARTNERSHIP_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); +} +if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; + } + } +} +$country_code = getCountry($country_id, 2, $db, $langs); +print $form->select_country($country_id, 'country_id'); +print '
'.$langs->trans('State').''; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); + } + print '
'.$langs->trans("URLPhoto").'
'.$langs->trans("Comments").'
\n"; + +print dol_get_fiche_end(); + +// Save +print '
'; +print ''; +if (!empty($backtopage)) { + print '     '; +} +print '
'; + + +print "
\n"; +print "
"; +print '
'; + + +llxFooterVierge(); + +$db->close(); diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index 7122c252cbe..a844fc52071 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -277,7 +277,7 @@ a.btnTitle.btnTitleSelected { } .btnTitle>.fa { - font-size: 20px; + font-size: 2em; display: block; } From 2ca0a1facf2e82fc76983d6613238badbb4f0b57 Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Wed, 20 Oct 2021 00:36:24 +0200 Subject: [PATCH 06/64] Update date.lib.php --- htdocs/core/lib/date.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 613533a443a..ac91ea3065e 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -117,7 +117,7 @@ function getServerTimeZoneInt($refgmtdate = 'now') * @param int $duration_unit Unit of added delay (d, m, y, w, h, i) * @return int New timestamp */ -function dol_time_plus_duree($time, $duration_value, $duration_unit) +function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth = 0) { global $conf; @@ -167,7 +167,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit) $date->add($interval); } //Change the behavior of PHP over data-interval when the result of this function is Feb 29 (non-leap years), 30 or Feb 31 (php returns March 1, 2 or 3 respectively) - if ($conf->global->MAIN_DATE_CHANGE_PHP_DATEINTERVAL_RESULT_FEBRUARY && $duration_unit == 'm') { + if ($ruleforendofmonth == 1 && $duration_unit == 'm') { $timeyear = dol_print_date($time, '%Y'); $timemonth = dol_print_date($time, '%m'); $timetotalmonths = (($timeyear * 12) + $timemonth); From 054388be0101b73225c75040c679cf0d593bf501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:45:36 +0200 Subject: [PATCH 07/64] doxygen --- htdocs/admin/hrm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index 2bcd4977716..8eb2f93c13c 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -20,7 +20,7 @@ */ /** - * \file hrm/admin/setup.php + * \file htdocs/admin/hrm.php * \ingroup hrm * \brief HrmTest setup page. */ From 197818684bfc7bb5fd5ba0ff1f3d502e59580484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:47:32 +0200 Subject: [PATCH 08/64] doxygen --- htdocs/core/boxes/box_graph_new_vs_close_ticket.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php index a4bf2d6990f..4b4f205bce8 100644 --- a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php +++ b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php @@ -2,7 +2,7 @@ /* Module descriptor for ticket system * Copyright (C) 2013-2016 Jean-François FERRY * 2016 Christophe Battarel - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2021 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 @@ -19,7 +19,7 @@ */ /** - * \file core/boxes/box_nb_ticket_last_x_days.php + * \file hydocs/core/boxes/box_graph_new_vs_close_ticket.php * \ingroup ticket * \brief This box shows the number of new daily tickets the last X days */ From d41c1393ba98e27336c2b3cd1d8533887fea04d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:48:20 +0200 Subject: [PATCH 09/64] Update box_graph_new_vs_close_ticket.php --- htdocs/core/boxes/box_graph_new_vs_close_ticket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php index 4b4f205bce8..ce8d7ab0078 100644 --- a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php +++ b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php @@ -19,7 +19,7 @@ */ /** - * \file hydocs/core/boxes/box_graph_new_vs_close_ticket.php + * \file htdocs/core/boxes/box_graph_new_vs_close_ticket.php * \ingroup ticket * \brief This box shows the number of new daily tickets the last X days */ From bca3bcf8c936205f2a13221a3b4ae31e00eaa2ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:49:24 +0200 Subject: [PATCH 10/64] doxygen --- htdocs/core/boxes/box_graph_ticket_by_severity.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_graph_ticket_by_severity.php b/htdocs/core/boxes/box_graph_ticket_by_severity.php index 13cd0c40c86..5e69a49e88e 100644 --- a/htdocs/core/boxes/box_graph_ticket_by_severity.php +++ b/htdocs/core/boxes/box_graph_ticket_by_severity.php @@ -2,7 +2,7 @@ /* Module descriptor for ticket system * Copyright (C) 2013-2016 Jean-François FERRY * 2016 Christophe Battarel - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2021 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 @@ -19,7 +19,7 @@ */ /** - * \file core/boxes/box_ticket_by_severity.php + * \file htdocs/core/boxes/box_graph_ticket_by_severity.php * \ingroup ticket * \brief This box shows open tickets by severity */ From 82b9dc6c87857fe4d1de90e6c2fa7623bd6fed9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:50:48 +0200 Subject: [PATCH 11/64] doxygen --- htdocs/core/modules/modEventOrganization.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php index 8a3fb3d80cf..6ab1c8acb89 100644 --- a/htdocs/core/modules/modEventOrganization.class.php +++ b/htdocs/core/modules/modEventOrganization.class.php @@ -19,7 +19,7 @@ * \defgroup eventorganization Module EventOrganization * \brief EventOrganization module descriptor. * - * \file htdocs/eventorganization/core/modules/modEventOrganization.class.php + * \file htdocs/core/modules/modEventOrganization.class.php * \ingroup eventorganization * \brief Description and activation file for the EventOrganization */ From a528f8e98b9a6edcfce0bcb689cb091c67e3a1ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:52:18 +0200 Subject: [PATCH 12/64] doxygen --- htdocs/core/modules/modKnowledgeManagement.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modKnowledgeManagement.class.php b/htdocs/core/modules/modKnowledgeManagement.class.php index d4f0187432a..b3fb24aa7b3 100644 --- a/htdocs/core/modules/modKnowledgeManagement.class.php +++ b/htdocs/core/modules/modKnowledgeManagement.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * Copyright (C) 2021 SuperAdmin * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ * \defgroup knowledgemanagement Module KnowledgeManagement * \brief KnowledgeManagement module descriptor. * - * \file htdocs/knowledgemanagement/core/modules/modKnowledgeManagement.class.php + * \file htdocs/core/modules/modKnowledgeManagement.class.php * \ingroup knowledgemanagement * \brief Description and activation file for module KnowledgeManagement */ From a4555d6304d7e9382886282c3951ab2e52f78d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:53:17 +0200 Subject: [PATCH 13/64] doxygen --- htdocs/core/modules/modPartnership.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php index a036613fcec..87ce98abb4a 100644 --- a/htdocs/core/modules/modPartnership.class.php +++ b/htdocs/core/modules/modPartnership.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * Copyright (C) 2021 Dorian Laurent * Copyright (C) 2021 NextGestion * @@ -23,7 +23,7 @@ * \defgroup partnership Module Partnership * \brief Partnership module descriptor. * - * \file htdocs/partnership/core/modules/modPartnership.class.php + * \file htdocs/core/modules/modPartnership.class.php * \ingroup partnership * \brief Description and activation file for module Partnership */ From a082dc65040480c7d397420db743cd4a67e24be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:54:15 +0200 Subject: [PATCH 14/64] doxygen --- htdocs/core/modules/modRecruitment.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modRecruitment.class.php b/htdocs/core/modules/modRecruitment.class.php index 02e7cdfbf4c..239c48135d7 100644 --- a/htdocs/core/modules/modRecruitment.class.php +++ b/htdocs/core/modules/modRecruitment.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2021 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 @@ -21,7 +21,7 @@ * \defgroup recruitment Module Recruitment * \brief Recruitment module descriptor. * - * \file htdocs/recruitment/core/modules/modRecruitment.class.php + * \file htdocs/core/modules/modRecruitment.class.php * \ingroup recruitment * \brief Description and activation file for the module Recruitment */ From d83485cc7b5db9c2afec77a826c33ef906a2616f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:55:24 +0200 Subject: [PATCH 15/64] doxygen --- htdocs/core/modules/modWorkstation.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modWorkstation.class.php b/htdocs/core/modules/modWorkstation.class.php index 3069be8ced5..38c5222401c 100755 --- a/htdocs/core/modules/modWorkstation.class.php +++ b/htdocs/core/modules/modWorkstation.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * Copyright (C) 2020 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ * \defgroup workstation Module Workstation * \brief Workstation module descriptor. * - * \file htdocs/workstation/core/modules/modWorkstation.class.php + * \file htdocs/core/modules/modWorkstation.class.php * \ingroup workstation * \brief Description and activation file for the module Workstation */ From 89f4066eadbe54b12551b6ed54d0c524234d0028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:57:02 +0200 Subject: [PATCH 16/64] doxygen --- htdocs/core/modules/mrp/doc/pdf_vinci.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index 5f6a03f2caa..d116976eb88 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -5,8 +5,8 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018 Frédéric France - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 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 * the Free Software Foundation; either version 3 of the License, or @@ -23,7 +23,7 @@ */ /** - * \file htdocs/core/modules/mrp/doc/pdf_vinci.php + * \file htdocs/core/modules/mrp/doc/pdf_vinci.modules.php * \ingroup mrp * \brief File of class to generate MO document from vinci model */ From c161eb198ef77cf9ff2fdd2c8ff7c645d47114b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:58:21 +0200 Subject: [PATCH 17/64] doxygen --- htdocs/intracommreport/admin/intracommreport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/intracommreport/admin/intracommreport.php b/htdocs/intracommreport/admin/intracommreport.php index c696dddcabd..13231c43af2 100644 --- a/htdocs/intracommreport/admin/intracommreport.php +++ b/htdocs/intracommreport/admin/intracommreport.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/admin/intracommreport.php + * \file htdocs/intracommreport/admin/intracommreport.php * \ingroup intracommreport * \brief Page to setup the module intracomm report */ From c3e8f6d8b16351a5e71de5b106d6a681c5d8398b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:00:18 +0200 Subject: [PATCH 18/64] doxygen --- .../knowledgemanagement/mod_knowledgerecord_advanced.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php index 70cda7254c8..8cdbee53395 100644 --- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php +++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2021 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 @@ -21,7 +21,7 @@ */ /** - * \file htdocs/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php + * \file htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php * \ingroup knowledgemanagement * \brief File containing class for advanced numbering model of KnowledgeRecord */ From e42287ec2c67e7ea847d3098c1bf601d6a3d1a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:01:36 +0200 Subject: [PATCH 19/64] doxygen --- .../knowledgemanagement/mod_knowledgerecord_standard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php index 9833fa9bfb7..ba5a3c3b391 100644 --- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php +++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php + * \file htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php * \ingroup knowledgemanagement * \brief File of class to manage KnowledgeRecord numbering rules standard */ From 14a355ebbabc190ad63268ba975ba12f300b8130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:03:26 +0200 Subject: [PATCH 20/64] doxygen --- .../modules/knowledgemanagement/modules_knowledgerecord.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php index 58def153c4b..edfe6beff62 100644 --- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php +++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php @@ -23,7 +23,7 @@ */ /** - * \file htdocs/core/modules/knowledgemanagement/modules_knowledgerecord.php + * \file htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php * \ingroup knowledgemanagement * \brief File that contains parent class for knowledgerecords document models and parent class for knowledgerecords numbering models */ From e61b2070749f55371dd2370f950de6089b2c95e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:07:06 +0200 Subject: [PATCH 21/64] doxygen --- .../lib/knowledgemanagement_knowledgerecord.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php b/htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php index e70b4654d19..e77439970ba 100644 --- a/htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php +++ b/htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php @@ -1,5 +1,5 @@ * * 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 @@ -16,7 +16,7 @@ */ /** - * \file htdocs/knowledgemanagementlib/knowledgemanagement_knowledgerecord.lib.php + * \file htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php * \ingroup knowledgemanagement * \brief Library files with common functions for KnowledgeRecord */ From 3579d2f4b120f7cec5e2d4d102ccd05e9c6c8b44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:25:46 +0200 Subject: [PATCH 22/64] doxygen --- scripts/website/regenerate-pages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/website/regenerate-pages.php b/scripts/website/regenerate-pages.php index b37e17bf78a..8e4b1279532 100755 --- a/scripts/website/regenerate-pages.php +++ b/scripts/website/regenerate-pages.php @@ -17,7 +17,7 @@ */ /** - * \file scripts/website/regenerate_pages.php + * \file scripts/website/regenerate-pages.php * \ingroup scripts * \brief Regenerate all pages of a web site */ From 8778296784649a480cb776d9debc9e5eae08db01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:29:27 +0200 Subject: [PATCH 23/64] fix doxygen nested comment --- htdocs/core/lib/import.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/import.lib.php b/htdocs/core/lib/import.lib.php index a9663795988..54e6d232871 100644 --- a/htdocs/core/lib/import.lib.php +++ b/htdocs/core/lib/import.lib.php @@ -3,7 +3,7 @@ * Copyright (C) 2007 Rodolphe Quiedeville * Copyright (C) 2010 Regis Houssin * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 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 @@ -24,6 +24,7 @@ * \file htdocs/core/lib/import.lib.php * \brief Ensemble de fonctions de base pour le module import * \ingroup import + */ /** * Function to return list of tabs for import pages From 2eb524cc31baf02070070db545125aff3c7c06a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:31:08 +0200 Subject: [PATCH 24/64] fix doxygen nested comment --- htdocs/core/tpl/originproductline.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/originproductline.tpl.php b/htdocs/core/tpl/originproductline.tpl.php index d4943ac454d..7e56611a282 100644 --- a/htdocs/core/tpl/originproductline.tpl.php +++ b/htdocs/core/tpl/originproductline.tpl.php @@ -1,6 +1,6 @@ -/* Copyright (C) 2017 Charlie Benke + * Copyright (C) 2017 Charlie Benke * * 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 From 1157d7edfb8a3dee822c7ebf6e6273ef6b1dc070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:32:28 +0200 Subject: [PATCH 25/64] fix doxygen nested comment --- htdocs/product/dynamic_price/class/price_expression.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/dynamic_price/class/price_expression.class.php b/htdocs/product/dynamic_price/class/price_expression.class.php index 2a7f35a436b..564c2448e58 100644 --- a/htdocs/product/dynamic_price/class/price_expression.class.php +++ b/htdocs/product/dynamic_price/class/price_expression.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2014 Juanjo Menent -/* Copyright (C) 2015 Ion Agorria + * Copyright (C) 2015 Ion Agorria * * 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 From 3d5d2f0558fccd8ca3760b44f5c4b67bc64aca2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:33:17 +0200 Subject: [PATCH 26/64] fix doxygen nested comment --- .../product/dynamic_price/class/price_global_variable.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php index 217ab25463a..a7b22f2ef13 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2014 Juanjo Menent -/* Copyright (C) 2015 Ion Agorria + * Copyright (C) 2015 Ion Agorria * * 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 From 49d8f85ae74534bce37a43ea5763b690065a8d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:33:48 +0200 Subject: [PATCH 27/64] fix doxygen nested comment --- .../dynamic_price/class/price_global_variable_updater.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index e24ff2c6769..8a9c1197a7f 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2014 Juanjo Menent -/* Copyright (C) 2015 Ion Agorria + * Copyright (C) 2015 Ion Agorria * * 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 From d71d33939b097a98161db888339070079ce1e6f3 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Thu, 21 Oct 2021 14:17:23 +0200 Subject: [PATCH 28/64] NEW max terminals number on cash desk setup --- htdocs/takepos/admin/setup.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index db3b28d0948..870fe1844ad 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -256,8 +256,7 @@ print "\n"; print ''; print $langs->trans("NumberOfTerminals"); print ''; -$array = array(1=>"1", 2=>"2", 3=>"3", 4=>"4", 5=>"5", 6=>"6", 7=>"7", 8=>"8", 9=>"9"); -print $form->selectarray('TAKEPOS_NUM_TERMINALS', $array, (empty($conf->global->TAKEPOS_NUM_TERMINALS) ? '0' : $conf->global->TAKEPOS_NUM_TERMINALS), 0); +print ''; print "\n"; // Services From f783dd56a4c3f73e85d1db40c9ef9e0c40225308 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 15:54:23 +0200 Subject: [PATCH 29/64] fix: scrutinizer --- htdocs/accountancy/customer/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 7c3cc2cf0e2..aa1abde5fa5 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -214,7 +214,7 @@ if ($action == 'validatehistory') { $facture_static->ref = $objp->ref; $facture_static->id = $objp->facid; $facture_static->type = $objp->ftype; - $facture_static->datef = $objp->datef; + $facture_static->date = $objp->datef; $facture_static_det->id = $objp->rowid; $facture_static_det->total_ht = $objp->total_ht; From 0589c9c3caefc581227028950bdfd15fbb391d00 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 15:55:11 +0200 Subject: [PATCH 30/64] fix: scrutinizer --- htdocs/accountancy/customer/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 9a942bc3eaa..97a885f97b9 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -559,7 +559,7 @@ if ($result) { $facture_static->ref = $objp->ref; $facture_static->id = $objp->facid; $facture_static->type = $objp->ftype; - $facture_static->datef = $objp->datef; + $facture_static->date = $objp->datef; $facture_static_det->id = $objp->rowid; $facture_static_det->total_ht = $objp->total_ht; From 2e260d75d92a40f0c0baea4913ee2a66e371d3a7 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 15:57:54 +0200 Subject: [PATCH 31/64] fix: scrutinizer --- htdocs/categories/viewcat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 8ebb9f43b1e..7ccd80eb4bd 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -770,7 +770,7 @@ if ($type == Categorie::TYPE_CONTACT) { print ''."\n"; print ''."\n"; - if (count($contacts) > 0) { + if (is_array($contacts) && count($contacts) > 0) { $i = 0; foreach ($contacts as $key => $contact) { $i++; From 258d0c3a6906ab59670a7edf7aaed0222d838b2e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 16:05:37 +0200 Subject: [PATCH 32/64] fix: scrutinizer --- htdocs/commande/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index decabedc2e8..6cb9441b31b 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1494,13 +1494,13 @@ if ($action == 'create' && $usercancreate) { $cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0)); // TODO maybe add default value option $mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0)); $fk_account = (!empty($objectsrc->fk_account) ? $objectsrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0)); - $availability_id = (!empty($objectsrc->availability_id) ? $objectsrc->availability_id : (!empty($soc->availability_id) ? $soc->availability_id : 0)); + $availability_id = (!empty($objectsrc->availability_id) ? $objectsrc->availability_id : 0); $shipping_method_id = (!empty($objectsrc->shipping_method_id) ? $objectsrc->shipping_method_id : (!empty($soc->shipping_method_id) ? $soc->shipping_method_id : 0)); $warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0)); $demand_reason_id = (!empty($objectsrc->demand_reason_id) ? $objectsrc->demand_reason_id : (!empty($soc->demand_reason_id) ? $soc->demand_reason_id : 0)); $remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0)); $remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); - $dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER) ?-1 : ''; + $dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER) ? -1 : ''; $date_delivery = (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : ''); if (empty($date_delivery)) { @@ -1526,7 +1526,7 @@ if ($action == 'create' && $usercancreate) { $cond_reglement_id = $soc->cond_reglement_id; $mode_reglement_id = $soc->mode_reglement_id; $fk_account = $soc->fk_account; - $availability_id = $soc->availability_id; + $availability_id = 0; $shipping_method_id = $soc->shipping_method_id; $warehouse_id = $soc->warehouse_id; $demand_reason_id = $soc->demand_reason_id; From 3a48fe2d6627e14d381443c32a25e76b6a1b33b7 Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Thu, 21 Oct 2021 16:02:47 +0200 Subject: [PATCH 33/64] Allow hook 'checkSecureAccess' to change original_file --- htdocs/core/lib/files.lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 2175de373ef..2ff2f0ef5ba 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2867,6 +2867,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if ($fuser->admin) { $accessallowed = 1; // If user is admin } + $tmpmodulepart = explode('-', $modulepart); if (!empty($tmpmodulepart[1])) { $modulepart = $tmpmodulepart[0]; @@ -2946,6 +2947,9 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, ); $reshook = $hookmanager->executeHooks('checkSecureAccess', $parameters, $object); if ($reshook > 0) { + if (!empty($hookmanager->resArray['original_file'])) { + $original_file = $hookmanager->resArray['original_file']; + } if (!empty($hookmanager->resArray['accessallowed'])) { $accessallowed = $hookmanager->resArray['accessallowed']; } From 10a518749d42380b1e6eb2b193b3728fc45bb6ba Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 16:46:04 +0200 Subject: [PATCH 34/64] fix: scrutinizer --- htdocs/compta/facture/class/facture-rec.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 92615658a58..4888656b9c7 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -303,8 +303,8 @@ class FactureRec extends CommonInvoice $sql .= ", ".((int) $facsrc->socid); $sql .= ", ".((int) $conf->entity); $sql .= ", '".$this->db->idate($now)."'"; - $sql .= ", ".(!empty($facsrc->amount) ? ((float) $facsrc->amount) : '0'); - $sql .= ", ".(!empty($facsrc->remise) ? ((float) $this->remise) : '0'); + $sql .= ", ".(!empty($facsrc->total_ttc) ? ((float) $facsrc->total_ttc) : '0'); + $sql .= ", ".(!empty($facsrc->remise_absolue) ? ((float) $this->remise_absolue) : '0'); $sql .= ", ".(!empty($this->note_private) ? ("'".$this->db->escape($this->note_private)."'") : "NULL"); $sql .= ", ".(!empty($this->note_public) ? ("'".$this->db->escape($this->note_public)."'") : "NULL"); $sql .= ", ".(!empty($this->model_pdf) ? ("'".$this->db->escape($this->model_pdf)."'") : "NULL"); From e9fe668725229fe25e075562509cf8eedba87f66 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 16:48:04 +0200 Subject: [PATCH 35/64] fix: scrutinizer --- htdocs/core/class/commonobjectline.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 40bcf3aa529..2856b535a3e 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -51,6 +51,11 @@ abstract class CommonObjectLine extends CommonObject */ public $fk_unit; + public $date_debut_prevue; + public $date_debut_reel; + public $date_fin_prevue; + public $date_fin_reel; + /** * Constructor From 4795190a75739a79c28c0fb75d4c3cdd8fdab10d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 17:09:48 +0200 Subject: [PATCH 36/64] fix: scrutinizer --- htdocs/core/class/commonobject.class.php | 6 +++--- htdocs/core/class/extrafields.class.php | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 37083cdf5f8..abb9f05baa8 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6488,7 +6488,7 @@ abstract class CommonObject $out = ''; $type = ''; - $isDependList=0; + $isDependList = 0; $param = array(); $param['options'] = array(); $reg = array(); @@ -6796,7 +6796,7 @@ abstract class CommonObject if (!empty($InfoFieldList[3]) && $parentField) { $parent = $parentName.':'.$obj->{$parentField}; - $isDependList=1; + $isDependList = 1; } $out .= '
'.$langs->trans("Ref").'
'; - } - - if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1); - } - - // Form to add new line - if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { - if ($action != 'editline') { - // Add products/services form - - $parameters = array(); - $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - if (empty($reshook)) - $object->formAddObjectLine(1, $mysoc, $soc); - } - } - - if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { - print '
'; - } - print ''; - - print "\n"; - } - - // Buttons for actions if ($action != 'presend' && $action != 'editline') { From b1be1ceff1660b686f73edc15e8783d95ca4b0aa Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 18:07:02 +0200 Subject: [PATCH 42/64] fix scrutinizer --- .../lib/eventorganization_conferenceorbooth.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php index 3951cc25df7..c26a0f8611c 100644 --- a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php +++ b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php @@ -127,6 +127,7 @@ function conferenceorboothProjectPrepareHead($object) $head[$h][2] = 'conferenceorbooth'; // Enable caching of conf or booth count attendees $nbAttendees = 0; + $nbConferenceOrBooth= 0; require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; $cachekey = 'count_conferenceorbooth_project_'.$object->id; $dataretrieved = dol_getcache($cachekey); From 85ec2c408c55f95b88eea408fb9bca5286642355 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 18:15:15 +0200 Subject: [PATCH 43/64] fix scrutinizer --- htdocs/core/class/html.formmail.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 823e90fcac3..a375a7223a3 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -157,6 +157,8 @@ class FormMail extends Form public $lines_model; + public $withoptiononeemailperrecipient; + /** * Constructor From d4690ddbdd3d45c0620de163faac990a7f1c8c91 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 18:20:07 +0200 Subject: [PATCH 44/64] fix scrutinizer --- htdocs/product/class/productcustomerprice.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 61cba58c374..d3c23b17c4a 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -871,7 +871,7 @@ class Productcustomerprice extends CommonObject $resultupd = $prodsocpricenew->create($user, 0, $forceupdateaffiliate); if ($result < 0) { $error++; - $this->error = $prodsocpriceupd->error; + $this->error = $prodsocpricenew->error; } } } From 24cc74cd3abff12d84de22e810fbe4370e7cdc06 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 19:00:48 +0200 Subject: [PATCH 45/64] fix scrutinizer --- htdocs/projet/class/project.class.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 368fb3c2982..5d56f6a295d 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1601,17 +1601,18 @@ class Project extends CommonObject foreach (array('internal', 'external') as $source) { $tab = $origin_project->liste_contact(-1, $source); - - foreach ($tab as $contacttoadd) { - $clone_project->add_contact($contacttoadd['id'], $contacttoadd['code'], $contacttoadd['source'], $notrigger); - if ($clone_project->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { - $langs->load("errors"); - $this->error .= $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); - $error++; - } else { - if ($clone_project->error != '') { - $this->error .= $clone_project->error; + if (is_array($tab) && count($tab)>0) { + foreach ($tab as $contacttoadd) { + $clone_project->add_contact($contacttoadd['id'], $contacttoadd['code'], $contacttoadd['source'], $notrigger); + if ($clone_project->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $langs->load("errors"); + $this->error .= $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); $error++; + } else { + if ($clone_project->error != '') { + $this->error .= $clone_project->error; + $error++; + } } } } @@ -1660,7 +1661,7 @@ class Project extends CommonObject foreach ($tasksarray as $tasktoclone) { $result_clone = $taskstatic->createFromClone($user, $tasktoclone->id, $clone_project_id, $tasktoclone->fk_parent, $move_date, true, false, $clone_task_file, true, false); if ($result_clone <= 0) { - $this->error .= $result_clone->error; + $this->error .= $taskstatic->error; $error++; } else { $new_task_id = $result_clone; @@ -1714,6 +1715,7 @@ class Project extends CommonObject global $user, $langs, $conf; $error = 0; + $result = 0; $taskstatic = new Task($this->db); From 2780f30d58e491d8fc657a1c4047d7f230cd4222 Mon Sep 17 00:00:00 2001 From: Theo Date: Thu, 21 Oct 2021 19:05:13 +0200 Subject: [PATCH 46/64] fix: ticket tags/categories edit --- htdocs/langs/fr_FR/categories.lang | 1 + htdocs/ticket/card.php | 52 +++++++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index cf549eb8670..62bb2267283 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -89,6 +89,7 @@ CategorieRecursiv=Lier automatiquement avec le(a) tag/catégorie parent(e) CategorieRecursivHelp=Si l'option est activé, quand un produit est ajouté dans une sous-catégorie, le produit sera ajouté aussi dans la catégorie parente. AddProductServiceIntoCategory=Ajouter le produit/service suivant AddCustomerIntoCategory=Assigner cette catégorie au client +AddTicketIntoCategory=Assigner cette catégorie au ticket AddSupplierIntoCategory=Assigner cette catégorie au fournisseur ShowCategory=Afficher tag/catégorie ByDefaultInList=Par défaut dans la liste diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 4f0ddb962ca..67c4aaf2ed6 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -532,6 +532,16 @@ if (empty($reshook)) { } } + if ($action == 'set_categories' && $user->rights->ticket->write) { + if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { + $result = $object->setCategories(GETPOST('categories', 'array')); + + $url = 'card.php?action=view&track_id='.$object->track_id; + header("Location: ".$url); + exit(); + } + } + if ($action == 'setsubject' && $user->rights->ticket->write) { if ($object->fetch(GETPOST('id', 'int'))) { if ($action == 'setsubject') { @@ -787,7 +797,7 @@ if ($action == 'create' || $action == 'presend') { print $form->buttonsSaveCancel(); print ''; */ -} elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'presend' || $action == 'presend_addmessage' || $action == 'close' || $action == 'abandon' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen' +} elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'presend' || $action == 'presend_addmessage' || $action == 'close' || $action == 'abandon' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'categories' || $action == 'reopen' || $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') { if ($res > 0) { // or for unauthorized internals users @@ -1101,9 +1111,43 @@ if ($action == 'create' || $action == 'presend') { // Categories if ($conf->categorie->enabled) { - print ''.$langs->trans("Categories").''; - print $form->showCategories($object->id, Categorie::TYPE_TICKET, 1); - print ""; + print ''; + print ''; + print ''; + } + print '
'; + print $langs->trans("Categories"); + if ($action != 'categories' && !$user->socid) { + print ''.img_edit($langs->trans('Modify')).'
'; + print ''; + + if ($user->rights->ticket->write && $action == 'categories') { + $cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1); + if (count($cate_arbo)) { + // Categories + print ''; + print '
'; + print ''; + print ''; + print ''; + + $category = new Categorie($db); + $cats = $category->containing($object->id, 'ticket'); + $arrayselected = array(); + foreach ($cats as $cat) { + $arrayselected[] = $cat->id; + } + + print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); + print ''; + print '
'; + print ""; + } + } else { + print ''; + print $form->showCategories($object->id, Categorie::TYPE_TICKET, 1); + print ""; + } } // Other attributes From ac27532d62448c55b9a149ced2bad37cdc9499e5 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 19:06:40 +0200 Subject: [PATCH 47/64] fix scrutinzer --- htdocs/projet/contact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 1af3488bf5c..ce9674dfd0a 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -94,7 +94,7 @@ if ($action == 'addcontact') { foreach ($task_array as $task) { $task_already_affected=false; $personsLinked = $task->liste_contact(-1, $source); - if (!is_array($personsLinked) && coun($personsLinked) < 0) { + if (!is_array($personsLinked) && count($personsLinked) < 0) { setEventMessage($object->error, 'errors'); } else { foreach ($personsLinked as $person) { From 3bdec20364ceeaf41bb295787ee65dce38c5e184 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 19:09:13 +0200 Subject: [PATCH 48/64] fix scrutinzer --- htdocs/projet/tasks/task.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 2ae9bb7cc80..54e238ab0c7 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -403,8 +403,8 @@ if ($id > 0 || !empty($ref)) { // Third party print ''.$langs->trans("ThirdParty").''; - if ($projectstatic->societe->id) { - print $projectstatic->societe->getNomUrl(1); + if ($projectstatic->thirdparty->id) { + print $projectstatic->thirdparty->getNomUrl(1); } else { print ' '; } From 96722d55efa2395bff07d808f9b2eea05dca2083 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 19:13:05 +0200 Subject: [PATCH 49/64] fix scrutinzer --- htdocs/categories/class/categorie.class.php | 6 ++++-- htdocs/core/class/commonobject.class.php | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index d5c135279bf..e7c361322bc 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -728,8 +728,6 @@ class Categorie extends CommonObject } } - - // Call trigger $this->context = array('linkto'=>$obj); // Save object we want to link category to into category instance to provide information to trigger $result = $this->call_trigger('CATEGORY_LINK', $user); @@ -755,6 +753,8 @@ class Categorie extends CommonObject } return -1; } + + return 0; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -810,6 +810,8 @@ class Categorie extends CommonObject $this->error = $this->db->lasterror(); return -1; } + + return 0; } /** diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index abb9f05baa8..9383759fb8e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9461,7 +9461,7 @@ abstract class CommonObject } $error = 0; - $ok=0; + $ok = 0; // Process foreach ($to_del as $del) { @@ -9473,7 +9473,7 @@ abstract class CommonObject $this->errors = $c->errors; break; } else { - $ok+=$result; + $ok += $result; } } } @@ -9486,7 +9486,7 @@ abstract class CommonObject $this->errors = $c->errors; break; } else { - $ok+=$result; + $ok += $result; } } } From df25880d5560dc8b27f437e4e9df18066d6640f2 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 19:18:01 +0200 Subject: [PATCH 50/64] fix scrutinzer --- htdocs/societe/price.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index bf19fc0385b..a24b6a4776c 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -326,22 +326,14 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { $text = $langs->trans('SellingPrice'); print $form->textwithpicto($text, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1); print ''; - if ($object->price_base_type == 'TTC') { - print ''; - } else { - print ''; - } + print ''; print ''; // Price minimum print ''; $text = $langs->trans('MinPrice'); print $form->textwithpicto($text, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1); - if ($object->price_base_type == 'TTC') { - print ''; - } else { - print ''; - } + print ''; print ''; // Update all child soc From 7970f4ba5c0f1bbe94f8ce27fa155d4bcab67a2e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 22:24:35 +0200 Subject: [PATCH 51/64] fix scrutinzer --- htdocs/projet/class/project.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 5d56f6a295d..622098240c8 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1615,6 +1615,9 @@ class Project extends CommonObject } } } + } elseif ($tab < 0) { + $this->error .= $origin_project->error; + $error++; } } } From db6c7930447cecd8065a6f3259334e6891b725eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Oct 2021 22:31:51 +0200 Subject: [PATCH 52/64] Text in english --- htdocs/core/modules/modUser.class.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index e54ac7bd440..292fc227db5 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -90,7 +90,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 251; - $this->rights[$r][1] = 'Consulter les autres utilisateurs'; + $this->rights[$r][1] = 'Read information of other users'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'user'; @@ -98,7 +98,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 252; - $this->rights[$r][1] = 'Consulter les permissions des autres utilisateurs'; + $this->rights[$r][1] = 'Read permissions of other users'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'user_advance'; @@ -106,7 +106,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 253; - $this->rights[$r][1] = 'Creer/modifier utilisateurs internes et externes'; + $this->rights[$r][1] = 'Create/modify internal and external users'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'user'; @@ -114,7 +114,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 254; - $this->rights[$r][1] = 'Creer/modifier utilisateurs externes seulement'; + $this->rights[$r][1] = 'Create/modify external users only'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'user_advance'; @@ -122,7 +122,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 255; - $this->rights[$r][1] = 'Modifier le mot de passe des autres utilisateurs'; + $this->rights[$r][1] = 'Modify the password of other users'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'user'; @@ -130,7 +130,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 256; - $this->rights[$r][1] = 'Supprimer ou desactiver les autres utilisateurs'; + $this->rights[$r][1] = 'Delete or disable other users'; $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'user'; @@ -138,7 +138,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 341; - $this->rights[$r][1] = 'Consulter ses propres permissions'; + $this->rights[$r][1] = 'Read its own permissions'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'self_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on @@ -146,7 +146,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 342; - $this->rights[$r][1] = 'Creer/modifier ses propres infos utilisateur'; + $this->rights[$r][1] = 'Create/modify of its own user'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'self'; @@ -154,7 +154,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 343; - $this->rights[$r][1] = 'Modifier son propre mot de passe'; + $this->rights[$r][1] = 'Modify its own password'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'self'; @@ -162,7 +162,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 344; - $this->rights[$r][1] = 'Modifier ses propres permissions'; + $this->rights[$r][1] = 'Modify its own permissions'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'self_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on @@ -202,7 +202,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 358; - $this->rights[$r][1] = 'Exporter les utilisateurs'; + $this->rights[$r][1] = 'Export all users'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'user'; From 09c8b9669639628203a3b29c30ae9fbcab0b93e4 Mon Sep 17 00:00:00 2001 From: Nicolas SILOBRE <45969285+ns-info90@users.noreply.github.com> Date: Thu, 21 Oct 2021 22:44:57 +0200 Subject: [PATCH 53/64] Fix can't generate pdf last_main_doc --- htdocs/install/mysql/tables/llx_mrp_mo.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_mrp_mo.sql b/htdocs/install/mysql/tables/llx_mrp_mo.sql index 185ea1583c9..88dc5d42789 100644 --- a/htdocs/install/mysql/tables/llx_mrp_mo.sql +++ b/htdocs/install/mysql/tables/llx_mrp_mo.sql @@ -39,6 +39,7 @@ CREATE TABLE llx_mrp_mo( date_start_planned datetime, date_end_planned datetime, fk_bom integer, - fk_project integer + fk_project integer, + last_main_doc varchar(255) -- END MODULEBUILDER FIELDS -) ENGINE=innodb; \ No newline at end of file +) ENGINE=innodb; From 9630b07b42fe9f136d22e2a1c6f4b5bb0349e082 Mon Sep 17 00:00:00 2001 From: Nicolas SILOBRE <45969285+ns-info90@users.noreply.github.com> Date: Thu, 21 Oct 2021 22:49:02 +0200 Subject: [PATCH 54/64] Update 14.0.0-15.0.0.sql --- htdocs/install/mysql/migration/14.0.0-15.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 34e8859596a..46f0963c371 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -59,7 +59,7 @@ ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD UNIQUE INDEX uk_ -- VMYSQL4.3 ALTER TABLE llx_eventorganization_conferenceorboothattendee MODIFY COLUMN fk_actioncomm integer NULL; -- VPGSQL8.2 ALTER TABLE llx_eventorganization_conferenceorboothattendee ALTER COLUMN fk_actioncomm DROP NOT NULL; - +ALTER TABLE llx_mrp_mo ADD COLUMN last_main_doc varchar(255); UPDATE llx_extrafields SET elementtype = 'salary' WHERE elementtype = 'payment_salary'; ALTER TABLE llx_payment_salary_extrafields RENAME TO llx_salary_extrafields; From ae6cae0313a1dc196aea26e73053ce08711dcb2d Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 21 Oct 2021 22:57:50 +0200 Subject: [PATCH 55/64] Fix MAIN_USE_EXPENSE_RULE is now stable --- htdocs/core/lib/expensereport.lib.php | 10 ++++------ htdocs/expensereport/card.php | 17 +++++++++++++++-- .../expensereport/class/expensereport.class.php | 16 +++++++++------- .../class/expensereport_ik.class.php | 2 +- 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php index 8e27ef12466..3287227a05d 100644 --- a/htdocs/core/lib/expensereport.lib.php +++ b/htdocs/core/lib/expensereport.lib.php @@ -140,12 +140,10 @@ function expensereport_admin_prepare_head() $head[$h][2] = 'expensereport'; $h++; - if (!empty($conf->global->MAIN_USE_EXPENSE_RULE)) { - $head[$h][0] = DOL_URL_ROOT."/admin/expensereport_rules.php"; - $head[$h][1] = $langs->trans("ExpenseReportsRules"); - $head[$h][2] = 'expenserules'; - $h++; - } + $head[$h][0] = DOL_URL_ROOT."/admin/expensereport_rules.php"; + $head[$h][1] = $langs->trans("ExpenseReportsRules"); + $head[$h][2] = 'expenserules'; + $h++; if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { $head[$h][0] = DOL_URL_ROOT."/admin/expensereport_ik.php"; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 5a4f7c57b61..736acf5683d 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2050,6 +2050,11 @@ if ($action == 'create') { // Picture print ''; print ''; + + // Information if theres a rule restriction + print ''; + print ''; + // Ajout des boutons de modification/suppression if (($object->status < 2 || $object->status == 99) && $user->rights->expensereport->creer) { print ''; @@ -2190,6 +2195,10 @@ if ($action == 'create') { } print ''; + print ''; + print !empty($line->rule_warning_message) ? img_info(html_entity_decode($line->rule_warning_message)) : ' '; + print ''; + // Ajout des boutons de modification/suppression if (($object->status < ExpenseReport::STATUS_VALIDATED || $object->status == ExpenseReport::STATUS_REFUSED) && $user->rights->expensereport->creer) { print ''; @@ -2209,7 +2218,7 @@ if ($action == 'create') { if ($action == 'editline' && $line->rowid == GETPOST('rowid', 'int')) { // Add line with link to add new file or attach line to an existing file - $colspan = 10; + $colspan = 11; if (!empty($conf->projet->enabled)) { $colspan++; } @@ -2336,6 +2345,9 @@ if ($action == 'create') { print ''; //print $line->fk_ecm_files; print ''; + // Information if theres a rule restriction + print ''; + print ''; print ''; print ''; @@ -2351,7 +2363,7 @@ if ($action == 'create') { // Add a new line if (($object->status == ExpenseReport::STATUS_DRAFT || $object->status == ExpenseReport::STATUS_REFUSED) && $action != 'editline' && $user->rights->expensereport->creer) { - $colspan = 11; + $colspan = 12; if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { $colspan++; } @@ -2448,6 +2460,7 @@ if ($action == 'create') { print ''; print ''; print ''; + print ''; print ''; print ''; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 64034c10a3f..b58a478f3c0 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -998,7 +998,7 @@ class ExpenseReport extends CommonObject $sql .= ' de.localtax1_tx, de.localtax2_tx, de.localtax1_type, de.localtax2_type,'; $sql .= ' de.fk_ecm_files,'; $sql .= ' de.total_ht, de.total_tva, de.total_ttc,'; - $sql .= ' de.total_localtax1, de.total_localtax2,'; + $sql .= ' de.total_localtax1, de.total_localtax2, de.rule_warning_message,'; $sql .= ' ctf.code as code_type_fees, ctf.label as libelle_type_fees,'; $sql .= ' p.ref as ref_projet, p.title as title_projet'; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as de'; @@ -1055,6 +1055,8 @@ class ExpenseReport extends CommonObject $deplig->projet_ref = $objp->ref_projet; $deplig->projet_title = $objp->title_projet; + $deplig->rule_warning_message = $objp->rule_warning_message; + $deplig->rang = $objp->rang; $this->lines[$i] = $deplig; @@ -1874,10 +1876,6 @@ class ExpenseReport extends CommonObject $langs->load('trips'); - if (empty($conf->global->MAIN_USE_EXPENSE_RULE)) { - return true; // if don't use rules - } - // We don't know seller and buyer for expense reports if (!is_object($seller)) { $seller = $mysoc; // We use same than current company (expense report are often done in same country) @@ -1975,7 +1973,7 @@ class ExpenseReport extends CommonObject } //$buyer = new Societe($this->db); - $expenseik = new ExpenseReportIk($db); + $expenseik = new ExpenseReportIk($this->db); $range = $expenseik->getRangeByUser($userauthor, $this->line->fk_c_exp_tax_cat); if (empty($range)) { @@ -2603,6 +2601,8 @@ class ExpenseReportLine */ public $fk_ecm_files; + public $rule_warning_message; + /** * Constructor @@ -2624,7 +2624,7 @@ class ExpenseReportLine { $sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_c_exp_tax_cat, fde.fk_projet as fk_project, fde.date,'; $sql .= ' fde.tva_tx as vatrate, fde.vat_src_code, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc, fde.fk_ecm_files,'; - $sql .= ' fde.localtax1_tx, fde.localtax2_tx, fde.localtax1_type, fde.localtax2_type, fde.total_localtax1, fde.total_localtax2,'; + $sql .= ' fde.localtax1_tx, fde.localtax2_tx, fde.localtax1_type, fde.localtax2_type, fde.total_localtax1, fde.total_localtax2, fde.rule_warning_message,'; $sql .= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,'; $sql .= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref'; $sql .= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde'; @@ -2670,6 +2670,8 @@ class ExpenseReportLine $this->fk_ecm_files = $objp->fk_ecm_files; + $this->rule_warning_message = $objp->rule_warning_message; + $this->db->free($result); } else { dol_print_error($this->db); diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php index da2312bdcb1..53cf3695b12 100644 --- a/htdocs/expensereport/class/expensereport_ik.class.php +++ b/htdocs/expensereport/class/expensereport_ik.class.php @@ -165,7 +165,7 @@ class ExpenseReportIk extends CoreObject $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'c_exp_tax_cat c ON (r.fk_c_exp_tax_cat = c.rowid)'; } $sql .= ' WHERE r.fk_c_exp_tax_cat = '.((int) $fk_c_exp_tax_cat); - $sql .= " AND entity IN(0, ".getEntity($this->element).")"; + $sql .= " AND r.entity IN(0, ".getEntity($this->element).")"; if ($active) { $sql .= ' AND r.active = 1 AND c.active = 1'; } From 15dd0f7ab3e2ecbd85c63a32c62f2a65dbd686d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Oct 2021 23:34:25 +0200 Subject: [PATCH 56/64] New feature --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 2d957f1dbb2..3f5fad835f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ For users: --------------- NEW: Online proposal signature +NEW: Can define some max limit on expense report (per period, per type or expense, ...) NEW: Allow the use of __NEWREF__ to get for example the new reference a draft order will get after validation. NEW: #18326 Workflow: Close order on shipment closing. NEW: #18401 Add __NEWREF__ subtitute to get new object reference. From 860fb21d2db049835e8e12c58b564703c275ba15 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 21 Oct 2021 23:50:20 +0200 Subject: [PATCH 57/64] Fix expense report warning display + translations --- htdocs/expensereport/card.php | 2 +- htdocs/expensereport/class/expensereport.class.php | 4 ++-- htdocs/langs/en_US/trips.lang | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 736acf5683d..2942358545b 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2196,7 +2196,7 @@ if ($action == 'create') { print ''; print ''; - print !empty($line->rule_warning_message) ? img_info(html_entity_decode($line->rule_warning_message)) : ' '; + print !empty($line->rule_warning_message) ? img_warning(html_entity_decode($line->rule_warning_message)) : ' '; print ''; // Ajout des boutons de modification/suppression diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index b58a478f3c0..877a7c79ade 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1912,12 +1912,12 @@ class ExpenseReport extends CommonObject $this->errors[] = $this->error; $new_current_total_ttc -= $amount_to_test - $rule->amount; // ex, entered 16€, limit 12€, subtracts 4€; - $rule_warning_message_tab[] = $langs->trans('ExpenseReportConstraintViolationError', $rule->id, price($amount_to_test, 0, $langs, 1, -1, -1, $conf->currency), price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency), $langs->trans('by'.$rule->code_expense_rules_type, price($new_current_total_ttc, 0, $langs, 1, -1, -1, $conf->currency))); + $rule_warning_message_tab[] = $langs->trans('ExpenseReportConstraintViolationError', $rule->id, price($amount_to_test, 0, $langs, 1, -1, -1, $conf->currency), price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency)); } else { $this->error = 'ExpenseReportConstraintViolationWarning'; $this->errors[] = $this->error; - $rule_warning_message_tab[] = $langs->trans('ExpenseReportConstraintViolationWarning', $rule->id, price($amount_to_test, 0, $langs, 1, -1, -1, $conf->currency), price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency), $langs->trans('nolimitby'.$rule->code_expense_rules_type)); + $rule_warning_message_tab[] = $langs->trans('ExpenseReportConstraintViolationWarning', $rule->id, price($amount_to_test, 0, $langs, 1, -1, -1, $conf->currency), price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency)); } // No break, we sould test if another rule is violated diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang index c9a6c792077..9210ede360c 100644 --- a/htdocs/langs/en_US/trips.lang +++ b/htdocs/langs/en_US/trips.lang @@ -112,7 +112,7 @@ ConfirmCloneExpenseReport=Are you sure you want to clone this expense report ? ExpenseReportsIk=Configuration of mileage charges ExpenseReportsRules=Expense report rules ExpenseReportIkDesc=You can modify the calculation of kilometers expense by category and range who they are previously defined. d is the distance in kilometers -ExpenseReportRulesDesc=You can create or update any rules of calculation. This part will be used when user will create a new expense report +ExpenseReportRulesDesc=You can define max amount rules for expense reports. These rules will be applied when a new expense is added to an expense report expenseReportOffset=Offset expenseReportCoef=Coefficient expenseReportTotalForFive=Example with d = 5 @@ -127,19 +127,19 @@ ExpenseReportDomain=Domain to apply ExpenseReportLimitOn=Limit on ExpenseReportDateStart=Date start ExpenseReportDateEnd=Date end -ExpenseReportLimitAmount=Limite amount -ExpenseReportRestrictive=Restrictive +ExpenseReportLimitAmount=Max amount +ExpenseReportRestrictive=Exceeding forbidden AllExpenseReport=All type of expense report OnExpense=Expense line ExpenseReportRuleSave=Expense report rule saved ExpenseReportRuleErrorOnSave=Error: %s RangeNum=Range %d -ExpenseReportConstraintViolationError=Constraint violation id [%s]: %s is superior to %s %s +ExpenseReportConstraintViolationError=Max amount exceeded (rule %s): %s is higher than %s (Exceeding forbidden) byEX_DAY=by day (limitation to %s) byEX_MON=by month (limitation to %s) byEX_YEA=by year (limitation to %s) byEX_EXP=by line (limitation to %s) -ExpenseReportConstraintViolationWarning=Constraint violation id [%s]: %s is superior to %s %s +ExpenseReportConstraintViolationWarning=Max amount exceeded (rule %s): %s is higher than %s (Exceeding authorized) nolimitbyEX_DAY=by day (no limitation) nolimitbyEX_MON=by month (no limitation) nolimitbyEX_YEA=by year (no limitation) From d1c9877c411640022079aa3b4d34bcd3b08cfba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 07:02:44 +0200 Subject: [PATCH 58/64] fix missing code comment --- htdocs/core/lib/date.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 8514ab56554..e7ab98ca3b6 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -115,6 +115,7 @@ function getServerTimeZoneInt($refgmtdate = 'now') * @param int $time Date timestamp (or string with format YYYY-MM-DD) * @param int $duration_value Value of delay to add * @param int $duration_unit Unit of added delay (d, m, y, w, h, i) + * @param int $ruleforendofmonth Change the behavior of PHP over data-interval, 0 or 1 * @return int New timestamp */ function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth = 0) From 0adb910e56586115e2329b6395a910304562c916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 07:27:10 +0200 Subject: [PATCH 59/64] fix sql error --- htdocs/eventorganization/conferenceorbooth_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index d6266ec241e..c02306ba6be 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -487,7 +487,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks From e2e3e8ef7b1a561a3700d7edf8b3844a08f354e8 Mon Sep 17 00:00:00 2001 From: Dennis Priskorn <68460690+dpriskorn@users.noreply.github.com> Date: Fri, 22 Oct 2021 10:18:23 +0200 Subject: [PATCH 60/64] Update api_supplier_invoices.class.php Add 2 examples --- htdocs/fourn/class/api_supplier_invoices.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index df1bf36b723..4c2b66caa96 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -201,6 +201,10 @@ class SupplierInvoices extends DolibarrApi /** * Create supplier invoice object * + * Note: soc_id = dolibarr_order_id + * + * Example: {'ref': 'auto', 'ref_supplier': '7985630', 'socid': 1, 'note': 'Inserted with Python', 'order_supplier': 1, 'date': '2021-07-28'} + * * @param array $request_data Request datas * * @return int ID of supplier invoice @@ -525,6 +529,10 @@ class SupplierInvoices extends DolibarrApi /** * Add a line to given supplier invoice * + * Note: socid = dolibarr_order_id, pu_ht = net price, remise = discount + * + * Example: {'socid': 1, 'qty': 1, 'pu_ht': 21.0, 'tva_tx': 25.0, 'fk_product': '1189', 'product_type': 0, 'remise_percent': 1.0, 'vat_src_code': None} + * * @param int $id Id of supplier invoice to update * @param array $request_data supplier invoice line data * From 4d63586e2a5de90a10c3ec932f70f645407db4e7 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 22 Oct 2021 08:22:23 +0000 Subject: [PATCH 61/64] Fixing style errors. --- htdocs/fourn/class/api_supplier_invoices.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 4c2b66caa96..51cd2673b0b 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -204,7 +204,7 @@ class SupplierInvoices extends DolibarrApi * Note: soc_id = dolibarr_order_id * * Example: {'ref': 'auto', 'ref_supplier': '7985630', 'socid': 1, 'note': 'Inserted with Python', 'order_supplier': 1, 'date': '2021-07-28'} - * + * * @param array $request_data Request datas * * @return int ID of supplier invoice From c789b12715052f3aa875edc2746fc0be2bea72a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 11:07:38 +0200 Subject: [PATCH 62/64] fix more than one extrafield cause bug sql --- htdocs/compta/cashcontrol/cashcontrol_list.php | 2 +- htdocs/eventorganization/conferenceorboothattendee_list.php | 2 +- htdocs/hrm/evaluation_list.php | 2 +- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/position_list.php | 2 +- htdocs/hrm/skill_list.php | 2 +- htdocs/product/inventory/list.php | 2 +- htdocs/recruitment/recruitmentjobposition_list.php | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 21a6c56689e..b46ff9433e3 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -223,7 +223,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 3fe20e3c814..12d62e0ab76 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -266,7 +266,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 54c4d547ffe..a713b37ca48 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -268,7 +268,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 0c169616f5a..ebd4535e6e7 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -268,7 +268,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index 60e69bfac3f..3877a6ea14d 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -268,7 +268,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index c0af4e28edc..fc2998d046a 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -268,7 +268,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 44726bb489c..41e43fdf433 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -205,7 +205,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 26a3a81e998..29fde993e25 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -246,7 +246,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks From 0d868aa0d9eb3cc670c3f536aace6176a3662958 Mon Sep 17 00:00:00 2001 From: Theo Date: Fri, 22 Oct 2021 11:14:04 +0200 Subject: [PATCH 63/64] Fix: can't delete categories when linked to some objects --- htdocs/categories/class/categorie.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index d5c135279bf..7547d04e2e4 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -626,12 +626,18 @@ class Categorie extends CommonObject } $arraydelete = array( - 'categorie_societe' => 'fk_categorie', - 'categorie_fournisseur' => 'fk_categorie', 'categorie_product' => 'fk_categorie', + 'categorie_fournisseur' => 'fk_categorie', + 'categorie_societe' => 'fk_categorie', 'categorie_member' => 'fk_categorie', 'categorie_contact' => 'fk_categorie', + 'categorie_user' => 'fk_categorie', + 'categorie_project' => 'fk_categorie', 'categorie_account' => 'fk_categorie', + 'categorie_website_page' => 'fk_categorie', + 'categorie_warehouse' => 'fk_categorie', + 'categorie_actioncomm' => 'fk_categorie', + 'categorie_ticket' => 'fk_categorie', 'bank_class' => 'fk_categ', 'categorie_lang' => 'fk_category', 'categorie' => 'rowid', From f354427b3cfc8478383126f70d2f0595c8697aa4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Oct 2021 11:58:00 +0200 Subject: [PATCH 64/64] Fix warning --- htdocs/core/class/extrafields.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 4f9b9c470d9..cb2cb892adf 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1653,10 +1653,14 @@ class ExtraFields $showsize = 0; if ($type == 'date') { $showsize = 10; - $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output + if ($value !== '') { + $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output + } } elseif ($type == 'datetime') { $showsize = 19; - $value = dol_print_date($value, 'dayhour', 'tzuserrel'); + if ($value !== '') { + $value = dol_print_date($value, 'dayhour', 'tzuserrel'); + } } elseif ($type == 'int') { $showsize = 10; } elseif ($type == 'double') {