From 62cf3cdab4cd1c926a9e243024eadbdc5144fe6c Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Wed, 13 Jul 2022 16:43:24 +0200 Subject: [PATCH 001/183] initializing public interface for user to book --- htdocs/public/bookcal/booking.php | 602 ++++++++++++++++++++++++++++++ htdocs/public/bookcal/index.php | 26 ++ 2 files changed, 628 insertions(+) create mode 100644 htdocs/public/bookcal/booking.php create mode 100644 htdocs/public/bookcal/index.php diff --git a/htdocs/public/bookcal/booking.php b/htdocs/public/bookcal/booking.php new file mode 100644 index 00000000000..3020799c91e --- /dev/null +++ b/htdocs/public/bookcal/booking.php @@ -0,0 +1,602 @@ + + * 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 + */ + +use Stripe\Event; + +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.'/partnership/class/partnership_type.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")); + + +// 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); + $event = new Event($db); + + + // We try to find the thirdparty or the member + if (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty') == 'thirdparty') { + $partnership->fk_member = 0; + } elseif (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty') == '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 (getDolGlobalString('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(getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')); + $from = getDolGlobalString('PARTNERSHIP_MAIL_FROM'); + $mailfile = new CMailFile( + '['.$appli.'] '.getDolGlobalString('PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL_SUBJECT', 'Partnership request'), + $to, + $from, + $partnership->makeSubstitution(getDolGlobalString('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); + +$extrafields->fetch_name_optionals_label($partnership->table_element); // fetch optionals attributes and labels + + +llxHeaderVierge($langs->trans("NewPartnershipRequest")); + + +print load_fiche_titre($langs->trans("NewPartnershipRequest"), '', '', 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("NewPartnershipRequestDesc", $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 ''; +} +*/ + +$partnershiptype = new PartnershipType($db); +$listofpartnershipobj = $partnershiptype->fetchAll('', '', 1000); +$listofpartnership = array(); +foreach ($listofpartnershipobj as $partnershipobj) { + $listofpartnership[$partnershipobj->id] = $partnershipobj->label; +} + +if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE)) { + print ''."\n"; +} else { + print $listofpartnership[$conf->global->PARTNERSHIP_NEWFORM_FORCETYPE]; + print ''; +} + +// Company +print ''."\n"; +// Lastname +print ''."\n"; +// Firstname +print ''."\n"; +// EMail +print ''."\n"; +// 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('PartnershipType').' *'."\n"; + print $form->selectarray("partnershiptype", $listofpartnership, GETPOSTISSET('partnershiptype') ? GETPOST('partnershiptype', 'int') : 'ifone', 1); + print '
'.$langs->trans("Company").' *'; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print '
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Email").' *'; +//print img_picto('', 'email', 'class="pictofixedwidth"'); +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/public/bookcal/index.php b/htdocs/public/bookcal/index.php new file mode 100644 index 00000000000..4071c62de1f --- /dev/null +++ b/htdocs/public/bookcal/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/members/index.php + * \ingroup core + * \brief A redirect page to an error + */ + +require '../../master.inc.php'; + +header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); From a8e6725bca50d1869d2f9f52fb908141626d2e08 Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Thu, 21 Jul 2022 14:21:22 +0200 Subject: [PATCH 002/183] bookcal loading ... --- htdocs/public/bookcal/booking.php | 847 ++++++++++++++++++------------ 1 file changed, 516 insertions(+), 331 deletions(-) diff --git a/htdocs/public/bookcal/booking.php b/htdocs/public/bookcal/booking.php index 3020799c91e..0d39ebb13ed 100644 --- a/htdocs/public/bookcal/booking.php +++ b/htdocs/public/bookcal/booking.php @@ -60,6 +60,22 @@ require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncommreminder.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Init vars $errmsg = ''; @@ -75,9 +91,15 @@ $langs->loadLangs(array("main", "members", "companies", "install", "other")); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('publicnewpartnershipcard', 'globalcard')); + +$object = new ActionComm($db); +$cactioncomm = new CActionComm($db); +$contact = new Contact($db); +$formfile = new FormFile($db); +$formactions = new FormActions($db); $extrafields = new ExtraFields($db); -$object = new Partnership($db); + $user->loadDefaultValues(); @@ -153,7 +175,6 @@ function llxFooterVierge() } - /* * Actions */ @@ -196,27 +217,27 @@ if (empty($reshook) && $action == 'add') { if (!$error) { //$partnership = new Partnership($db); - $event = new Event($db); + $events = new Events($db); // We try to find the thirdparty or the member if (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty') == 'thirdparty') { - $partnership->fk_member = 0; + $event->fk_member = 0; } elseif (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty') == 'member') { - $partnership->fk_soc = 0; + $event->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'); + $events->statut = -1; + $events->firstname = GETPOST('firstname'); + $events->lastname = GETPOST('lastname'); + $events->address = GETPOST('address'); + $events->zip = GETPOST('zipcode'); + $events->town = GETPOST('town'); + $events->email = GETPOST('email'); + $events->country_id = GETPOST('country_id', 'int'); + $events->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'); + $event->note_private = GETPOST('note_private'); // Fill array 'array_options' with data from add form $extrafields->fetch_name_optionals_label($partnership->table_element); @@ -225,186 +246,23 @@ if (empty($reshook) && $action == 'add') { $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 (getDolGlobalString('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(getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')); - $from = getDolGlobalString('PARTNERSHIP_MAIL_FROM'); - $mailfile = new CMailFile( - '['.$appli.'] '.getDolGlobalString('PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL_SUBJECT', 'Partnership request'), - $to, - $from, - $partnership->makeSubstitution(getDolGlobalString('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... + if (!$error) { + $result = $event->create($user); + if ($result > 0) { + $db->commit(); + $urlback = DOL_URL_ROOT.'/public/partnership/new.php?action=confirm&id='.$event->id; + header('Location: '.$urlback); + exit; } else { - $urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken(); + $db->rollback(); + $errmsg = $event->error; + $error++; } - - 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); + $errmsg .= join('
', $event->errors); } } - - if (!$error) { - $db->commit(); - - Header("Location: ".$urlback); - exit; - } else { - $db->rollback(); - } } // Action called after a submitted was send and member created successfully @@ -436,165 +294,492 @@ $formcompany = new FormCompany($db); $extrafields->fetch_name_optionals_label($partnership->table_element); // fetch optionals attributes and labels -llxHeaderVierge($langs->trans("NewPartnershipRequest")); +llxHeaderVierge($langs->trans("NewBookingRequest")); -print load_fiche_titre($langs->trans("NewPartnershipRequest"), '', '', 0, 0, 'center'); +print load_fiche_titre($langs->trans("NewBookingRequest"), '', '', 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("NewPartnershipRequestDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL)."
\n"; -} -print '
'; +// View -dol_htmloutput_errors($errmsg); +// Add new Events form +$contact = new Contact($db); -// 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 ''; -} -*/ - -$partnershiptype = new PartnershipType($db); -$listofpartnershipobj = $partnershiptype->fetchAll('', '', 1000); -$listofpartnership = array(); -foreach ($listofpartnershipobj as $partnershipobj) { - $listofpartnership[$partnershipobj->id] = $partnershipobj->label; -} - -if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE)) { - print ''."\n"; -} else { - print $listofpartnership[$conf->global->PARTNERSHIP_NEWFORM_FORCETYPE]; - print ''; -} - -// Company -print ''."\n"; -// Lastname -print ''."\n"; -// Firstname -print ''."\n"; -// EMail -print ''."\n"; -// Address -print ''."\n"; -// Zip / Town -print ''; -// Country -print ''; -// State -if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print 'global->AGENDA_USE_EVENT_TYPE) ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Label").''; -print dol_get_fiche_end(); + // Full day + print ''; } -print ''; + + print ''; + + $datep = ($datep ? $datep : (is_null($object->datep) ? '' : $object->datep)); +if (GETPOST('datep', 'int', 1)) { + $datep = dol_stringtotime(GETPOST('datep', 'int', 1), 'tzuser'); +} + $datef = ($datef ? $datef : $object->datef); +if (GETPOST('datef', 'int', 1)) { + $datef = dol_stringtotime(GETPOST('datef', 'int', 1), 'tzuser'); +} +if (empty($datef) && !empty($datep)) { + if (GETPOST("actioncode", 'aZ09') == 'AC_RDV' || empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT)) { + $datef = dol_time_plus_duree($datep, (empty($conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS) ? 1 : $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS), 'h'); + } +} + + // Date start + print ''; + + print ''; + + // Assigned to + print ''; + + // Done by +if (!empty($conf->global->AGENDA_ENABLE_DONEBY)) { + print ''; +} + + // Location +if (empty($conf->global->AGENDA_DISABLE_LOCATION)) { + print ''; +} + + // Status + print ''; + print ''; + +if (!empty($conf->categorie->enabled)) { + // Categories + print '"; +} + + print '
'.$langs->trans("Type").' *'; - print $form->selectarray("typeid", $partnershipt->liste_array(1), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty); - print '
'.$langs->trans('PartnershipType').' *'."\n"; - print $form->selectarray("partnershiptype", $listofpartnership, GETPOSTISSET('partnershiptype') ? GETPOST('partnershiptype', 'int') : 'ifone', 1); - print '
'.$langs->trans("Company").' *'; -print img_picto('', 'company', 'class="pictofixedwidth"'); -print '
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Email").' *'; -//print img_picto('', 'email', 'class="pictofixedwidth"'); -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; - } + $socpeopleassigned = GETPOST("socpeopleassigned", 'array'); +if (!empty($socpeopleassigned[0])) { + $result = $contact->fetch($socpeopleassigned[0]); + if ($result < 0) { + dol_print_error($db, $contact->error); } } -$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); - } + + dol_set_focus("#label"); + +if (!empty($conf->use_javascript_ajax)) { + print "\n".''."\n"; +} + print ''; + print ''; + print ''; + print ''; + print ''; +if ($backtopage) { + print ''; +} +if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { + print ''; +} + +if (GETPOST("actioncode", 'aZ09') == 'AC_RDV') { + print load_fiche_titre($langs->trans("AddActionRendezVous"), '', 'title_agenda'); +} else { + print load_fiche_titre($langs->trans("AddAnAction"), '', 'title_agenda'); +} + + print dol_get_fiche_head(); + + print ''; + + // Type of event +if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { + 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").''; + $default = (empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT) ? 'AC_RDV' : $conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT); + print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"'); + print $formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot print '
'.$langs->trans("URLPhoto").'
'.$langs->trans("Comments").'
\n"; + // Title + print '
'.$langs->trans("Date").''; -// Save -print '
'; -print ''; -if (!empty($backtopage)) { - print '     '; + // Recurring event + $userepeatevent = ($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0); +if ($userepeatevent) { + // Repeat + //print '
'; + print '        
'; + print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"'); + print ''; + $selectedrecurrulefreq = 'no'; + $selectedrecurrulebymonthday = ''; + $selectedrecurrulebyday = ''; + if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg)) { + $selectedrecurrulefreq = $reg[1]; + } + if ($object->recurrule && preg_match('/FREQ=MONTHLY.*BYMONTHDAY=(\d+)/i', $object->recurrule, $reg)) { + $selectedrecurrulebymonthday = $reg[1]; + } + if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i', $object->recurrule, $reg)) { + $selectedrecurrulebyday = $reg[1]; + } + print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq, 0, 0, 0, '', 0, 0, 0, '', 'marginrightonly'); + // If recurrulefreq is MONTHLY + print ''; + // If recurrulefreq is WEEKLY + print ''; + print ''; + print '
'; + //print '
'; + /* + print ''.$langs->trans("DateActionStart").''; + print ' - '; + print ''.$langs->trans("DateActionEnd").''; + */ + print ''; +if (GETPOST("afaire") == 1) { + print $form->selectDate($datep, 'ap', 1, 1, 0, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); // Empty value not allowed for start date and hours if "todo" +} else { + print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); +} + print '     -     '; +if (GETPOST("afaire") == 1) { + print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel'); +} else { + print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel'); +} + print '
 
'.$langs->trans("ActionAffectedTo").''; + $listofuserid = array(); + $listofcontactid = array(); + $listofotherid = array(); + +if (empty($donotclearsession)) { + $assignedtouser = GETPOST("assignedtouser") ?GETPOST("assignedtouser") : (!empty($object->userownerid) && $object->userownerid > 0 ? $object->userownerid : $user->id); + if ($assignedtouser) { + $listofuserid[$assignedtouser] = array('id'=>$assignedtouser, 'mandatory'=>0, 'transparency'=>$object->transparency); // Owner first + } + //$listofuserid[$user->id] = array('id'=>$user->id, 'mandatory'=>0, 'transparency'=>(GETPOSTISSET('transparency') ? GETPOST('transparency', 'alpha') : 1)); // 1 by default at first init + $listofuserid[$assignedtouser]['transparency'] = (GETPOSTISSET('transparency') ? GETPOST('transparency', 'alpha') : 1); // 1 by default at first init + $_SESSION['assignedtouser'] = json_encode($listofuserid); +} else { + if (!empty($_SESSION['assignedtouser'])) { + $listofuserid = json_decode($_SESSION['assignedtouser'], true); + } + $firstelem = reset($listofuserid); + if (isset($listofuserid[$firstelem['id']])) { + $listofuserid[$firstelem['id']]['transparency'] = (GETPOSTISSET('transparency') ? GETPOST('transparency', 'alpha') : 0); // 0 by default when refreshing + } +} + print '
'; + print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0', 1, $listofuserid, $listofcontactid, $listofotherid); + print '
'; + print '
'.$langs->trans("ActionDoneBy").''; + print $form->select_dolusers(GETPOSTISSET("doneby") ? GETPOST("doneby", 'int') : (!empty($object->userdoneid) && $percent == 100 ? $object->userdoneid : 0), 'doneby', 1); + print '
'.$langs->trans("Location").'
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + $percent = $complete !=='' ? $complete : -1; +if (GETPOSTISSET('status')) { + $percent = GETPOST('status'); +} elseif (GETPOSTISSET('percentage')) { + $percent = GETPOST('percentage', 'int'); +} else { + if ($complete == '0' || GETPOST("afaire") == 1) { + $percent = '0'; + } elseif ($complete == 100 || GETPOST("afaire") == 2) { + $percent = 100; + } +} + $formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200'); + print '
'.$langs->trans("Categories").''; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1); + print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'minwidth300 quatrevingtpercent widthcentpercentminusx', 0, 0); + print "
'; -print "
\n"; -print "
"; -print '
'; + print '


'; + + + print ''; + +if (!empty($conf->societe->enabled)) { + // Related company + print ''; + + // Related contact + print ''; +} + + // Project +if (!empty($conf->project->enabled)) { + $langs->load("projects"); + + $projectid = GETPOST('projectid', 'int'); + + print ''; + + print ''; +} + + // Object linked +if (!empty($origin) && !empty($originid)) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + + $hasPermissionOnLinkedObject = 0; + if ($user->hasRight($origin, 'read')) { + $hasPermissionOnLinkedObject = 1; + } + //var_dump('origin='.$origin.' originid='.$originid.' hasPermissionOnLinkedObject='.$hasPermissionOnLinkedObject); + + if (! in_array($origin, array('societe', 'project', 'task', 'user'))) { + // We do not use link for object that already contains a hard coded field to make links with agenda events + print ''; + print ''; + } +} + + $reg = array(); +if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/', GETPOST("datep"), $reg)) { + $object->datep = dol_mktime(0, 0, 0, $reg[2], $reg[3], $reg[1]); +} + + // Priority +if (!empty($conf->global->AGENDA_SUPPORT_PRIORITY_IN_EVENTS)) { + print ''; +} + + // Description + print ''; + + // Other attributes + $parameters = array(); + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; +if (empty($reshook)) { + print $object->showOptionals($extrafields, 'create', $parameters); +} + + print '
'.$langs->trans("ActionOnCompany").''; + if (GETPOST('socid', 'int') > 0) { + $societe = new Societe($db); + $societe->fetch(GETPOST('socid', 'int')); + print $societe->getNomUrl(1); + print ''; + } else { + $events = array(); + $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); + //For external user force the company to user company + if (!empty($user->socid)) { + print img_picto('', 'company', 'class="paddingrightonly"').$form->select_company($user->socid, 'socid', '', 1, 1, 0, $events, 0, 'minwidth300'); + } else { + print img_picto('', 'company', 'class="paddingrightonly"').$form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300'); + } + } + print '
'.$langs->trans("ActionOnContact").''; + $preselectedids = GETPOST('socpeopleassigned', 'array'); + if (GETPOST('contactid', 'int')) { + $preselectedids[GETPOST('contactid', 'int')] = GETPOST('contactid', 'int'); + } + if ($origin=='contact') $preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int'); + print img_picto('', 'contact', 'class="paddingrightonly"'); + print $form->selectcontacts(GETPOST('socid', 'int'), $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid'); + print '
'.$langs->trans("Project").''; + print img_picto('', 'project', 'class="pictofixedwidth"'); + print $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); + + print ' '; + print ''; + $urloption = '?action=create&donotclearsession=1'; + $url = dol_buildpath('comm/action/card.php', 2).$urloption; + + // update task list + print "\n".''."\n"; + + print '
'.$langs->trans("Task").''; + print img_picto('', 'projecttask', 'class="paddingrightonly"'); + $projectsListId = false; + if (!empty($projectid)) { + $projectsListId = $projectid; + } + + $tid = GETPOSTISSET("projecttaskid") ? GETPOST("projecttaskid", 'int') : (GETPOSTISSET("taskid") ? GETPOST("taskid", 'int') : ''); + + $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500', $projectsListId); + print '
'.$langs->trans("LinkedObject").''; + if ($hasPermissionOnLinkedObject) { + print dolGetElementUrl($originid, $origin, 1); + print ''; + print ''; + print ''; + print ''; + } else { + print ''; + } + print '
'.$langs->trans("Priority").''; + print ''; + print '
'.$langs->trans("Description").''; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor('note', (GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : $object->note_private), '', 120, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%'); + $doleditor->Create(); + print '
'; + + +if (getDolGlobalString('AGENDA_REMINDER_EMAIL') || getDolGlobalString('AGENDA_REMINDER_BROWSER')) { + //checkbox create reminder + print '
'; + print '
'; + print '

'; + + print ''; + + print "\n".''."\n"; +} + + print dol_get_fiche_end(); + + print $form->buttonsSaveCancel("Add"); + + print ""; llxFooterVierge(); From 1f864f5dd4782f9e5dee744a4886f24ad89ae414 Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Thu, 18 Aug 2022 08:38:54 +0200 Subject: [PATCH 003/183] template 01 corrected and re-exported --- .../websites/website_template-style01.jpg | Bin 0 -> 20970 bytes .../websites/website_template-style01.zip | Bin 0 -> 12929 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 htdocs/install/doctemplates/websites/website_template-style01.jpg create mode 100644 htdocs/install/doctemplates/websites/website_template-style01.zip diff --git a/htdocs/install/doctemplates/websites/website_template-style01.jpg b/htdocs/install/doctemplates/websites/website_template-style01.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5464bf5dd5d84809f8a943fa1f528290e1297537 GIT binary patch literal 20970 zcmeFZ1#o0bvKZQ895M5VS!&UUVZ=OQW@ct)W@e@lGcz+YGiyc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7z(FT~>ix zRefqN2`ouHPBFOAKCS*{@<~j9-Ps_W_Q@F>AfrJ-o%;b;@`jPxwsA~8`_64$3K~=| zwwx0VYd)T>b$z@X8cMl6Y-#@h-Y~F68Htid19o*`?WZ~3xZ8hAYNBx*qZ8y&$8Ak} z{pRvER4hm)*G@*^1y^J6H-uQMX@e_@twbMTUNIP>hV~$jAd0~#K%rKEQoo73=6cEX zbO0ONR&!LA48D@(fE!UctK`)@Gattb4o-?Ut5y5$le)2(FY%qvu*qFzHp6rCvE>aT zww;}6hu?VbsT}~ILILa&@<--7Jyo1ZbcC^G0SbOM{cyFSFV(-y-VtDrIA*yPLcXdu z?`v3+6bb<7rBB{=`}sNOdfTKzo_oc_?&s35DMzqRC&x~ddgE!*zI;#t7-Zfhfy$nK?UP7j{n0roZi jY0Yc;8LfXqHLvJqwfzj%zoDAf^f67dABXy5{{a8l8{Ci* literal 0 HcmV?d00001 diff --git a/htdocs/install/doctemplates/websites/website_template-style01.zip b/htdocs/install/doctemplates/websites/website_template-style01.zip new file mode 100644 index 0000000000000000000000000000000000000000..52a4501cb7aef1048b70a0f95a29cdb8380a89c8 GIT binary patch literal 12929 zcma)jb9kN0*LHSnyGi3VwryLDZQE?rpmEaJb{gBZ)7WNXf9VgWr#bKYUf=9%_Ot(3 z>mEI`X5DMnmX!bjg$DXn@&%BU{`KQOUofvveQPTRT~jMVJ9`@0{|G|(MXqfZ_kvvcssgzT|0B8?-J5)%yn+@hw$c8 zWbW#X9!?JnHeh2nNa`B~!m%}JvbdBh>k%7G76?+u@ua4utxD#%ury6*+<4+-%$zPJ2G&l%FXA8SQ>0XyEqpVB_(2Z>Lvn>#Do>)5Z^|&8dsU;&;ZP zd0rIwE=4iCP}Z~>;xS#5q)_u}Cdf7q0r8m?0>B|Ca1p(U(d**fnDXn?=-onlTf9@3 zmj_#259iy*mpcasPHS)=sfD^YBY_k0D`X7qGWoi7#nHS$a&{2j?w7#W<%Zzp0_jK% z=$T%UqDT*eM@|@%YuzF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eba55c074db3ba8014b9d Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Thu, 18 Aug 2022 08:41:53 +0200 Subject: [PATCH 004/183] removing useless push --- htdocs/public/bookcal/index.php | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 htdocs/public/bookcal/index.php diff --git a/htdocs/public/bookcal/index.php b/htdocs/public/bookcal/index.php deleted file mode 100644 index 4071c62de1f..00000000000 --- a/htdocs/public/bookcal/index.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * 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/members/index.php - * \ingroup core - * \brief A redirect page to an error - */ - -require '../../master.inc.php'; - -header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); From 2b4278ded2e0f01c15ac98495203198eac7dbac5 Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Thu, 18 Aug 2022 08:42:47 +0200 Subject: [PATCH 005/183] moving useless files --- htdocs/public/bookcal/booking.php | 787 ------------------------------ 1 file changed, 787 deletions(-) delete mode 100644 htdocs/public/bookcal/booking.php diff --git a/htdocs/public/bookcal/booking.php b/htdocs/public/bookcal/booking.php deleted file mode 100644 index 0d39ebb13ed..00000000000 --- a/htdocs/public/bookcal/booking.php +++ /dev/null @@ -1,787 +0,0 @@ - - * 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 - */ - -use Stripe\Event; - -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.'/partnership/class/partnership_type.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncommreminder.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.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")); - - -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('publicnewpartnershipcard', 'globalcard')); - - -$object = new ActionComm($db); -$cactioncomm = new CActionComm($db); -$contact = new Contact($db); -$formfile = new FormFile($db); -$formactions = new FormActions($db); -$extrafields = new ExtraFields($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); - $events = new Events($db); - - - // We try to find the thirdparty or the member - if (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty') == 'thirdparty') { - $event->fk_member = 0; - } elseif (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty') == 'member') { - $event->fk_soc = 0; - } - - $events->statut = -1; - $events->firstname = GETPOST('firstname'); - $events->lastname = GETPOST('lastname'); - $events->address = GETPOST('address'); - $events->zip = GETPOST('zipcode'); - $events->town = GETPOST('town'); - $events->email = GETPOST('email'); - $events->country_id = GETPOST('country_id', 'int'); - $events->state_id = GETPOST('state_id', 'int'); - //$partnership->typeid = $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE ? $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE : GETPOST('typeid', 'int'); - $event->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++; - } - - if (!$error) { - $result = $event->create($user); - if ($result > 0) { - $db->commit(); - $urlback = DOL_URL_ROOT.'/public/partnership/new.php?action=confirm&id='.$event->id; - header('Location: '.$urlback); - exit; - } else { - $db->rollback(); - $errmsg = $event->error; - $error++; - } - } else { - $error++; - $errmsg .= join('
', $event->errors); - } - } -} - -// 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); - -$extrafields->fetch_name_optionals_label($partnership->table_element); // fetch optionals attributes and labels - - -llxHeaderVierge($langs->trans("NewBookingRequest")); - - -print load_fiche_titre($langs->trans("NewBookingRequest"), '', '', 0, 0, 'center'); - - - -// View - -// Add new Events form -$contact = new Contact($db); - - $socpeopleassigned = GETPOST("socpeopleassigned", 'array'); -if (!empty($socpeopleassigned[0])) { - $result = $contact->fetch($socpeopleassigned[0]); - if ($result < 0) { - dol_print_error($db, $contact->error); - } -} - - dol_set_focus("#label"); - -if (!empty($conf->use_javascript_ajax)) { - print "\n".''."\n"; -} - print '
'; - print ''; - print ''; - print ''; - print ''; -if ($backtopage) { - print ''; -} -if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - print ''; -} - -if (GETPOST("actioncode", 'aZ09') == 'AC_RDV') { - print load_fiche_titre($langs->trans("AddActionRendezVous"), '', 'title_agenda'); -} else { - print load_fiche_titre($langs->trans("AddAnAction"), '', 'title_agenda'); -} - - print dol_get_fiche_head(); - - print ''; - - // Type of event -if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - print ''; -} - - // Title - print 'global->AGENDA_USE_EVENT_TYPE) ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Label").''; - - // Full day - print ''; -} - - print ''; - - $datep = ($datep ? $datep : (is_null($object->datep) ? '' : $object->datep)); -if (GETPOST('datep', 'int', 1)) { - $datep = dol_stringtotime(GETPOST('datep', 'int', 1), 'tzuser'); -} - $datef = ($datef ? $datef : $object->datef); -if (GETPOST('datef', 'int', 1)) { - $datef = dol_stringtotime(GETPOST('datef', 'int', 1), 'tzuser'); -} -if (empty($datef) && !empty($datep)) { - if (GETPOST("actioncode", 'aZ09') == 'AC_RDV' || empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT)) { - $datef = dol_time_plus_duree($datep, (empty($conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS) ? 1 : $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS), 'h'); - } -} - - // Date start - print ''; - - print ''; - - // Assigned to - print ''; - - // Done by -if (!empty($conf->global->AGENDA_ENABLE_DONEBY)) { - print ''; -} - - // Location -if (empty($conf->global->AGENDA_DISABLE_LOCATION)) { - print ''; -} - - // Status - print ''; - print ''; - -if (!empty($conf->categorie->enabled)) { - // Categories - print '"; -} - - print '
'.$langs->trans("Type").''; - $default = (empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT) ? 'AC_RDV' : $conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT); - print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"'); - print $formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot - print '
'.$langs->trans("Date").''; - - // Recurring event - $userepeatevent = ($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0); -if ($userepeatevent) { - // Repeat - //print '
'; - print '        
'; - print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"'); - print ''; - $selectedrecurrulefreq = 'no'; - $selectedrecurrulebymonthday = ''; - $selectedrecurrulebyday = ''; - if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg)) { - $selectedrecurrulefreq = $reg[1]; - } - if ($object->recurrule && preg_match('/FREQ=MONTHLY.*BYMONTHDAY=(\d+)/i', $object->recurrule, $reg)) { - $selectedrecurrulebymonthday = $reg[1]; - } - if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i', $object->recurrule, $reg)) { - $selectedrecurrulebyday = $reg[1]; - } - print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq, 0, 0, 0, '', 0, 0, 0, '', 'marginrightonly'); - // If recurrulefreq is MONTHLY - print ''; - // If recurrulefreq is WEEKLY - print ''; - print ''; - print '
'; - //print '
'; - /* - print ''.$langs->trans("DateActionStart").''; - print ' - '; - print ''.$langs->trans("DateActionEnd").''; - */ - print ''; -if (GETPOST("afaire") == 1) { - print $form->selectDate($datep, 'ap', 1, 1, 0, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); // Empty value not allowed for start date and hours if "todo" -} else { - print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); -} - print '     -     '; -if (GETPOST("afaire") == 1) { - print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel'); -} else { - print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel'); -} - print '
 
'.$langs->trans("ActionAffectedTo").''; - $listofuserid = array(); - $listofcontactid = array(); - $listofotherid = array(); - -if (empty($donotclearsession)) { - $assignedtouser = GETPOST("assignedtouser") ?GETPOST("assignedtouser") : (!empty($object->userownerid) && $object->userownerid > 0 ? $object->userownerid : $user->id); - if ($assignedtouser) { - $listofuserid[$assignedtouser] = array('id'=>$assignedtouser, 'mandatory'=>0, 'transparency'=>$object->transparency); // Owner first - } - //$listofuserid[$user->id] = array('id'=>$user->id, 'mandatory'=>0, 'transparency'=>(GETPOSTISSET('transparency') ? GETPOST('transparency', 'alpha') : 1)); // 1 by default at first init - $listofuserid[$assignedtouser]['transparency'] = (GETPOSTISSET('transparency') ? GETPOST('transparency', 'alpha') : 1); // 1 by default at first init - $_SESSION['assignedtouser'] = json_encode($listofuserid); -} else { - if (!empty($_SESSION['assignedtouser'])) { - $listofuserid = json_decode($_SESSION['assignedtouser'], true); - } - $firstelem = reset($listofuserid); - if (isset($listofuserid[$firstelem['id']])) { - $listofuserid[$firstelem['id']]['transparency'] = (GETPOSTISSET('transparency') ? GETPOST('transparency', 'alpha') : 0); // 0 by default when refreshing - } -} - print '
'; - print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0', 1, $listofuserid, $listofcontactid, $listofotherid); - print '
'; - print '
'.$langs->trans("ActionDoneBy").''; - print $form->select_dolusers(GETPOSTISSET("doneby") ? GETPOST("doneby", 'int') : (!empty($object->userdoneid) && $percent == 100 ? $object->userdoneid : 0), 'doneby', 1); - print '
'.$langs->trans("Location").'
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - $percent = $complete !=='' ? $complete : -1; -if (GETPOSTISSET('status')) { - $percent = GETPOST('status'); -} elseif (GETPOSTISSET('percentage')) { - $percent = GETPOST('percentage', 'int'); -} else { - if ($complete == '0' || GETPOST("afaire") == 1) { - $percent = '0'; - } elseif ($complete == 100 || GETPOST("afaire") == 2) { - $percent = 100; - } -} - $formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200'); - print '
'.$langs->trans("Categories").''; - $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1); - print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'minwidth300 quatrevingtpercent widthcentpercentminusx', 0, 0); - print "
'; - - - print '


'; - - - print ''; - -if (!empty($conf->societe->enabled)) { - // Related company - print ''; - - // Related contact - print ''; -} - - // Project -if (!empty($conf->project->enabled)) { - $langs->load("projects"); - - $projectid = GETPOST('projectid', 'int'); - - print ''; - - print ''; -} - - // Object linked -if (!empty($origin) && !empty($originid)) { - include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - - $hasPermissionOnLinkedObject = 0; - if ($user->hasRight($origin, 'read')) { - $hasPermissionOnLinkedObject = 1; - } - //var_dump('origin='.$origin.' originid='.$originid.' hasPermissionOnLinkedObject='.$hasPermissionOnLinkedObject); - - if (! in_array($origin, array('societe', 'project', 'task', 'user'))) { - // We do not use link for object that already contains a hard coded field to make links with agenda events - print ''; - print ''; - } -} - - $reg = array(); -if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/', GETPOST("datep"), $reg)) { - $object->datep = dol_mktime(0, 0, 0, $reg[2], $reg[3], $reg[1]); -} - - // Priority -if (!empty($conf->global->AGENDA_SUPPORT_PRIORITY_IN_EVENTS)) { - print ''; -} - - // Description - print ''; - - // Other attributes - $parameters = array(); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; -if (empty($reshook)) { - print $object->showOptionals($extrafields, 'create', $parameters); -} - - print '
'.$langs->trans("ActionOnCompany").''; - if (GETPOST('socid', 'int') > 0) { - $societe = new Societe($db); - $societe->fetch(GETPOST('socid', 'int')); - print $societe->getNomUrl(1); - print ''; - } else { - $events = array(); - $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); - //For external user force the company to user company - if (!empty($user->socid)) { - print img_picto('', 'company', 'class="paddingrightonly"').$form->select_company($user->socid, 'socid', '', 1, 1, 0, $events, 0, 'minwidth300'); - } else { - print img_picto('', 'company', 'class="paddingrightonly"').$form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300'); - } - } - print '
'.$langs->trans("ActionOnContact").''; - $preselectedids = GETPOST('socpeopleassigned', 'array'); - if (GETPOST('contactid', 'int')) { - $preselectedids[GETPOST('contactid', 'int')] = GETPOST('contactid', 'int'); - } - if ($origin=='contact') $preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int'); - print img_picto('', 'contact', 'class="paddingrightonly"'); - print $form->selectcontacts(GETPOST('socid', 'int'), $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid'); - print '
'.$langs->trans("Project").''; - print img_picto('', 'project', 'class="pictofixedwidth"'); - print $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); - - print ' '; - print ''; - $urloption = '?action=create&donotclearsession=1'; - $url = dol_buildpath('comm/action/card.php', 2).$urloption; - - // update task list - print "\n".''."\n"; - - print '
'.$langs->trans("Task").''; - print img_picto('', 'projecttask', 'class="paddingrightonly"'); - $projectsListId = false; - if (!empty($projectid)) { - $projectsListId = $projectid; - } - - $tid = GETPOSTISSET("projecttaskid") ? GETPOST("projecttaskid", 'int') : (GETPOSTISSET("taskid") ? GETPOST("taskid", 'int') : ''); - - $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500', $projectsListId); - print '
'.$langs->trans("LinkedObject").''; - if ($hasPermissionOnLinkedObject) { - print dolGetElementUrl($originid, $origin, 1); - print ''; - print ''; - print ''; - print ''; - } else { - print ''; - } - print '
'.$langs->trans("Priority").''; - print ''; - print '
'.$langs->trans("Description").''; - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note', (GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : $object->note_private), '', 120, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%'); - $doleditor->Create(); - print '
'; - - -if (getDolGlobalString('AGENDA_REMINDER_EMAIL') || getDolGlobalString('AGENDA_REMINDER_BROWSER')) { - //checkbox create reminder - print '
'; - print '
'; - print '

'; - - print ''; - - print "\n".''."\n"; -} - - print dol_get_fiche_end(); - - print $form->buttonsSaveCancel("Add"); - - print "
"; - - -llxFooterVierge(); - -$db->close(); From 8da9d58b9f630aed68be98e771209bb2dc6db4e5 Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Mon, 22 Aug 2022 15:48:12 +0200 Subject: [PATCH 006/183] sending mail is now managed in template 01 --- .../websites/website_template-style01.zip | Bin 12929 -> 13388 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/htdocs/install/doctemplates/websites/website_template-style01.zip b/htdocs/install/doctemplates/websites/website_template-style01.zip index 52a4501cb7aef1048b70a0f95a29cdb8380a89c8..7bca0dd1e21ef3ae5e6a4a6c0ba02f2808c961e9 100644 GIT binary patch delta 7077 zcmZ8m1yG#LvR&L|(M5v0EKYC>K^KQb76=|RxCa&qPOyc9AVCw{Ex`%y?(Pl&0t86l zCER!4fA5>BsWV;E)7{@!)m7(I2U`!>;%Ta)pkf35uKobBL_8LhzaXsj7pkI9@QD7P z9{+FyDHsO;_$3VhPyi54U@G`AY~5{9nCSk=@YWMe)6YpSA^i0S!MEJI#xT1jWye{l z-|W|>aTz8i1{N$bKv`jC>m4^BiGevK|Mk}|nLySmCBi0yqmzavruMv9wpN1Z0q0cTq`EfaG8xY?yfAgKl z?t0lJj3RnTppr5%_5mJShr){n+l-sF-L6yXmCD;cI)FYpw}Sx+&R9{^Qv zuL#8BMQ)fsWyBgB0jD_OuKsV|Y%!`6g;-Y{iliC3`eU@nnbQ&7 zV)`VvmHB33Lh9hkh&e_+rEvy(N$zZKW}b`!J+`aFF^s8R7X=dsE}b-xKs`CfniXg4 zJ}w#^+0}=`OD=y^rmKGR9=bxU^kGh=wW)Qx${@*L!R;d52!oh7-N0jPRjJFn0B z$BU`rYNXwdd?)XF;U*L+4i<)$DW+0Dnu4f&u5wFZX1;X;e$xYwp7y0w_uA{X7gN6W zo4i=O2kghu`sL#3!_?A;8@y7>hEK$s?o`&_-ZIbdWTlNzu3-C#@*i*NCTP8}6r-0z z&er^9$E9`6mVd^*!E^+>F~LF0fZV=Ie=0(Y7L$_2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@>8T~QW8L#et%?>6hdZJ$iSu&{+dLfq@y7mWU zleLRwYOoaz!beR3R;UG;blXUWBLe)cFnZcI{-1kk&#Geb%O8TRfEE8_4mr;p)I})B?P;hpDiZh5v*DAT*ydpmI2+ zFzXt2gPqLitS)i%s~?*%c|(U=%Ire~)+Cu|(%|n4ZDVoj_8*XU-zSt=(lQ*n5+auo zPvLkB@?N5|yraDlqOu~5eQJTx(&tuEPH)g$Hg*8{$PsVm6jrF&mR~(*iFTiBIY{r7 zY*5ZI9PXk_-T7Tp_Dj;GQWH-lGoX1h`Fu2s*zs&xvS_j>$U9sD>v|RnO#Mz4eevm_axMNh#gu^=?=sx%z%p=T2B_wun+?? zrD+}QcV0ZXx%G+kRcE;cLamj&u^kC) z-xO(==aw0^tW1Gl2R9BnCy4B_!T8^J!O`?H$qd|SL7(yZ)wMQWam$UiLpNLXGAoq( zse6geUs1%f5eE*~as9YIe;O???@6bf**&ior=!FEk+O~0ozT0776)2eE>wu9zVYK! ztEb+5@})=?vbs`t*nI>7^lBj7$4*9kk?1pY0L9-j5#A9T@MHprtcN@HVq#2;+j zk9f~U_lVEfxgJrEo%azF*+m|4l3nbd699S+0h&LG3Ud4vj^RN`(LWf$gZ;HCNnij6 zOq0AkY)ihYs*x$?S5F!z+-%=E$g6R2AUh2|$155s$s2Caot^)6~Q6`9t4G z`hUYg`{Xcyf*j_+iTQXC+rL{R2F{|6qSl9|~LIeELXw z_Uui#-ot<62P1s2zg7Va>?zmN$19TKB8TIHng8!Dl8YRk3IZ#GP}%h!%hC8iv{ uZ%juluuSg95fH4Gn_Tc2>wlPRT>dM~U$^roAr)2_HP18Tz=v=U=zjnSKRu=Z From 2b9350cd098a4259ae4b30c04fead80a547f1731 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 7 Sep 2022 20:51:13 +0200 Subject: [PATCH 007/183] Update productcustomerprice.class.php fetchAll --- htdocs/product/class/productcustomerprice.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index ed003d85667..ff000462567 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -356,7 +356,7 @@ class Productcustomerprice extends CommonObject * @param array $filter Filter for select * @return int <0 if KO, >0 if OK */ - public function fetch_all($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array()) + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array()) { // phpcs:enable global $langs; @@ -421,7 +421,7 @@ class Productcustomerprice extends CommonObject $sql .= $this->db->plimit($limit + 1, $offset); } - dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG); + dol_syslog(get_class($this)."::fetchAll", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $this->lines = array(); @@ -832,7 +832,7 @@ class Productcustomerprice extends CommonObject 't.fk_product' => $this->fk_product, 't.fk_soc' => $obj->rowid ); - $result = $prodsocprice->fetch_all('', '', 0, 0, $filter); + $result = $prodsocprice->fetchAll('', '', 0, 0, $filter); if ($result < 0) { $error++; $this->error = $prodsocprice->error; From e96eee56b0e3cc2c50408072fd7c1c4d4d496acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 10 Sep 2022 13:55:40 +0200 Subject: [PATCH 008/183] sample deprecated function --- htdocs/commande/card.php | 2 +- htdocs/core/class/commonobject.class.php | 2 -- .../class/productcustomerprice.class.php | 22 ++++++++++++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index d6a4aead2ec..adc4b5b04aa 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -789,7 +789,7 @@ if (empty($reshook)) { $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $object->thirdparty->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result >= 0) { if (count($prodcustprice->lines) > 0) { $pu_ht = price($prodcustprice->lines[0]->price); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8be014b8959..05a828417b8 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1534,7 +1534,6 @@ abstract class CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return array with list of possible values for type of contacts * @@ -1548,7 +1547,6 @@ abstract class CommonObject */ public function listeTypeContacts($source = 'internal', $option = 0, $activeonly = 0, $code = '', $element = '', $excludeelement = '') { - // phpcs:enable global $langs, $conf; $langs->loadLangs(array('bills', 'contracts', 'interventions', 'orders', 'projects', 'propal', 'ticket', 'agenda')); diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index ff000462567..197816f48ca 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -354,11 +354,31 @@ class Productcustomerprice extends CommonObject * @param int $limit page * @param int $offset offset * @param array $filter Filter for select + * @deprecated since dolibarr v17 use fetchAll * @return int <0 if KO, >0 if OK */ + public function fetch_all($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array()) + { + // phpcs:enable + + dol_syslog(get_class($this)."::fetch_all is deprecated, use fetchAll instead", LOG_NOTICE); + + return $this->fetchAll($sortorder, $sortfield, $limit, $offset, $filter); + } + + /** + * Load all customer prices in memory from database + * + * @param string $sortorder order + * @param string $sortfield field + * @param int $limit page + * @param int $offset offset + * @param array $filter Filter for select + * @return int <0 if KO, >0 if OK + * @since dolibarr v17 + */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array()) { - // phpcs:enable global $langs; if (empty($sortfield)) { From 705b436494fcd84f5ee3480fbeee6d0a17b76a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 10 Sep 2022 14:03:47 +0200 Subject: [PATCH 009/183] replace other deprecated --- htdocs/comm/propal/card.php | 2 +- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/contrat/card.php | 2 +- htdocs/core/lib/pdf.lib.php | 2 +- htdocs/cron/class/cronjob.class.php | 2 +- htdocs/product/ajax/products.php | 2 +- htdocs/product/card.php | 2 +- htdocs/product/class/api_products.class.php | 2 +- htdocs/product/class/product.class.php | 2 +- htdocs/product/price.php | 4 ++-- htdocs/resource/class/dolresource.class.php | 2 +- htdocs/resource/list.php | 2 +- htdocs/societe/price.php | 4 ++-- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index c4f620f6686..7b491e71a23 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1027,7 +1027,7 @@ if (empty($reshook)) { $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $object->thirdparty->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { // If there is some prices specific to the customer if (count($prodcustprice->lines) > 0) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 4c4a0a6c19a..8101177f412 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1412,7 +1412,7 @@ class Propal extends CommonObject } elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { $prodcustprice = new Productcustomerprice($this->db); $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $objsoc->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { // If there is some prices specific to the customer if (count($prodcustprice->lines) > 0) { diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 9cbe8b5c686..6dbc879d4e3 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -498,7 +498,7 @@ if (empty($reshook)) { $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $object->thirdparty->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { $pu_ht = price($prodcustprice->lines[0]->price); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 3b0c2250c49..016d9ea99e3 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1567,7 +1567,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $productCustomerPriceStatic = new Productcustomerprice($db); $filter = array('fk_product' => $idprod, 'fk_soc' => $object->socid); - $nbCustomerPrices = $productCustomerPriceStatic->fetch_all('', '', 1, 0, $filter); + $nbCustomerPrices = $productCustomerPriceStatic->fetchAll('', '', 1, 0, $filter); if ($nbCustomerPrices > 0) { $productCustomerPrice = $productCustomerPriceStatic->lines[0]; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 033e6512bd8..7fb3539eb91 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -576,7 +576,7 @@ class Cronjob extends CommonObject $sql .= " WHERE ".implode(' AND ', $sqlwhere); } - dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG); + dol_syslog(get_class($this)."::fetchAll", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 0e606932ce2..e2768ba8ccb 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -190,7 +190,7 @@ if ($action == 'fetch' && !empty($id)) { $filter = array('t.fk_product' => $object->id, 't.fk_soc' => $socid); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { $found = true; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 17387e3948d..7d542316ccc 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1035,7 +1035,7 @@ if (empty($reshook)) { $filter = array('t.fk_product' => $object->id, 't.fk_soc' => $soc->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { $pu_ht = price($prodcustprice->lines [0]->price); diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 1c17deae602..91a55b4ca30 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -670,7 +670,7 @@ class Products extends DolibarrApi if ($thirdparty_id) { $filter['t.fk_soc'] .= $thirdparty_id; } - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); } if (empty($prodcustprice->lines)) { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 360709dc5a0..925ac9dbbce 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1850,7 +1850,7 @@ class Product extends CommonObject $filter = array('t.fk_product' => $this->id, 't.fk_soc' => $thirdparty_buyer->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { $pu_ht = price($prodcustprice->lines[0]->price); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 341b8a56e62..19d2f388ce6 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -2213,10 +2213,10 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { // Count total nb of records $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $nbtotalofrecords = $prodcustprice->fetch_all($sortorder, $sortfield, 0, 0, $filter); + $nbtotalofrecords = $prodcustprice->fetchAll($sortorder, $sortfield, 0, 0, $filter); } - $result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); + $result = $prodcustprice->fetchAll($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); if ($result < 0) { setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors'); } diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 46371fead0f..3e1a2615cd9 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -527,7 +527,7 @@ class Dolresource extends CommonObject if ($limit) { $sql .= $this->db->plimit($limit, $offset); } - dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG); + dol_syslog(get_class($this)."::fetchAll", LOG_DEBUG); $this->lines = array(); $resql = $this->db->query($sql); diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 1ef64555133..d67f55f51f2 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -168,7 +168,7 @@ if ($search_type != '') { } // Including the previous script generate the correct SQL filter for all the extrafields -// we are playing with the behaviour of the Dolresource::fetch_all() by generating a fake +// we are playing with the behaviour of the Dolresource::fetchAll() by generating a fake // extrafields filter key to make it works $filter['ef.resource'] = $sql; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index a9f17f4b50a..12d7a7d62fb 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -532,10 +532,10 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { // Count total nb of records $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $nbtotalofrecords = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $nbtotalofrecords = $prodcustprice->fetchAll('', '', 0, 0, $filter); } - $result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); + $result = $prodcustprice->fetchAll($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); if ($result < 0) { setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors'); } From edef39bed984a9c01848593e3a5e0d03dffff9fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 14 Sep 2022 09:01:56 +0200 Subject: [PATCH 010/183] strftime is deprecated in php8.1 --- .../prelevement/class/bonprelevement.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index d87317e2420..9a1789dd49b 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -419,8 +419,8 @@ class BonPrelevement extends CommonObject } else { $paiement = new Paiement($this->db); } - $paiement->datepaye = $date; - $paiement->amounts = $cursoramounts; // Array with detail of dispatching of payments for each invoice + $paiement->datepaye = $date; + $paiement->amounts = $cursoramounts; // Array with detail of dispatching of payments for each invoice if ($this->type == 'bank-transfer') { $paiement->paiementid = 2; @@ -766,8 +766,8 @@ class BonPrelevement extends CommonObject $datetimeprev = $executiondate; } - $month = strftime("%m", $datetimeprev); - $year = strftime("%Y", $datetimeprev); + $month = date("%m", $datetimeprev); + $year = date("%Y", $datetimeprev); $this->invoice_in_error = array(); $this->thirdparty_in_error = array(); @@ -1746,8 +1746,8 @@ class BonPrelevement extends CommonObject // Date d'echeance C1 fputs($this->file, " "); - fputs($this->file, strftime("%d%m", $this->date_echeance)); - fputs($this->file, substr(strftime("%y", $this->date_echeance), 1)); + fputs($this->file, date("%d%m", $this->date_echeance)); + fputs($this->file, substr(date("%y", $this->date_echeance), 1)); // Raison Sociale Destinataire C2 @@ -1972,8 +1972,8 @@ class BonPrelevement extends CommonObject // Date d'echeance C1 fputs($this->file, " "); - fputs($this->file, strftime("%d%m", $this->date_echeance)); - fputs($this->file, substr(strftime("%y", $this->date_echeance), 1)); + fputs($this->file, date("%d%m", $this->date_echeance)); + fputs($this->file, substr(date("%y", $this->date_echeance), 1)); // Raison Sociale C2 From 9f7c17333b62af9e07360472b59591716e0686ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Sep 2022 08:44:15 +0200 Subject: [PATCH 011/183] Update bonprelevement.class.php --- .../prelevement/class/bonprelevement.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 9a1789dd49b..464051926f2 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -22,9 +22,9 @@ */ /** - * \file htdocs/compta/prelevement/class/bonprelevement.class.php - * \ingroup prelevement - * \brief File of withdrawal receipts class + * \file htdocs/compta/prelevement/class/bonprelevement.class.php + * \ingroup prelevement + * \brief File of withdrawal receipts class */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; @@ -760,14 +760,14 @@ class BonPrelevement extends CommonObject $error = 0; - $datetimeprev = time(); + $datetimeprev = dol_now('gmt'); //Choice the date of the execution direct debit if (!empty($executiondate)) { $datetimeprev = $executiondate; } - $month = date("%m", $datetimeprev); - $year = date("%Y", $datetimeprev); + $month = dol_print_date("%m", $datetimeprev, 'gmt'); + $year = dol_print_date("%Y", $datetimeprev, 'gmt'); $this->invoice_in_error = array(); $this->thirdparty_in_error = array(); From 744d1b0218f3fc318f51d4bdfaba0644fb67a619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Sep 2022 21:52:39 +0200 Subject: [PATCH 012/183] Update bonprelevement.class.php --- htdocs/compta/prelevement/class/bonprelevement.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 464051926f2..a0beccfaff1 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1746,8 +1746,8 @@ class BonPrelevement extends CommonObject // Date d'echeance C1 fputs($this->file, " "); - fputs($this->file, date("%d%m", $this->date_echeance)); - fputs($this->file, substr(date("%y", $this->date_echeance), 1)); + fputs($this->file, dol_print_date("%d%m", $this->date_echeance, 'gmt')); + fputs($this->file, substr(dol_print_date("%y", $this->date_echeance, 'gmt'), 1)); // Raison Sociale Destinataire C2 @@ -1972,8 +1972,8 @@ class BonPrelevement extends CommonObject // Date d'echeance C1 fputs($this->file, " "); - fputs($this->file, date("%d%m", $this->date_echeance)); - fputs($this->file, substr(date("%y", $this->date_echeance), 1)); + fputs($this->file, dol_print_date("%d%m", $this->date_echeance, 'gmt')); + fputs($this->file, substr(dol_print_date("%y", $this->date_echeance, 'gmt'), 1)); // Raison Sociale C2 From 1ab58434c2198713f6b2eafc1c2dfc013e736ae7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 25 Sep 2022 17:41:42 +0200 Subject: [PATCH 013/183] update code toward php8 compliance --- htdocs/accountancy/admin/fiscalyear_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index d798b6baa5f..89ed7b538ba 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -35,7 +35,7 @@ $langs->loadLangs(array("admin", "compta")); if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->fiscalyear->write)) { +if (!$user->hasRight('accounting', 'fiscalyear', 'write')) { accessforbidden(); } From 608dda677aa77865ff617256bc077b931c8b27e2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 25 Sep 2022 17:44:29 +0200 Subject: [PATCH 014/183] update code toward php8 compliance --- htdocs/accountancy/admin/fiscalyear.php | 2 +- htdocs/accountancy/admin/fiscalyear_info.php | 2 +- htdocs/accountancy/admin/productaccount.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 301a3def70e..27226d388f6 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -53,7 +53,7 @@ $langs->loadLangs(array("admin", "compta")); if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->fiscalyear->write)) { // If we can read accounting records, we should be able to see fiscal year. +if (!$user->hasRight('accounting', 'fiscalyear', 'write')) { // If we can read accounting records, we should be able to see fiscal year. accessforbidden(); } diff --git a/htdocs/accountancy/admin/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php index 1cc6fcba958..bb265c89ecf 100644 --- a/htdocs/accountancy/admin/fiscalyear_info.php +++ b/htdocs/accountancy/admin/fiscalyear_info.php @@ -34,7 +34,7 @@ $langs->loadLangs(array("admin", "compta")); if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->fiscalyear->write)) { +if (!$user->hasRight('accounting', 'fiscalyear', 'write')) { accessforbidden(); } diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 9f86922aa5c..018a0cfd5e8 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -45,7 +45,7 @@ $langs->loadLangs(array("companies", "compta", "accountancy", "products")); if (!isModEnabled('accounting')) { accessforbidden(); } -if (empty($user->rights->accounting->bind->write)) { +if (!$user->hasRight('accounting', 'bind', 'write')) { accessforbidden(); } From c0ca27547027c7c5f9f963fe339cb6165bf88d59 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 25 Sep 2022 17:51:43 +0200 Subject: [PATCH 015/183] update code toward php8 compliance --- htdocs/accountancy/bookkeeping/balance.php | 2 +- htdocs/accountancy/bookkeeping/card.php | 2 +- htdocs/accountancy/bookkeeping/list.php | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index cb479a1dc59..d2b1aaa3348 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -150,7 +150,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index e120606b927..692d70f4b68 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -86,7 +86,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index c374f5ba9fe..442a70600e5 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -155,7 +155,7 @@ $hookmanager->initHooks(array('bookkeepinglist')); $formaccounting = new FormAccounting($db); $form = new Form($db); -if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->rights->accounting->mouvements->export) { +if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->hasRight('accounting', 'mouvements', 'export')) { if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values') && !GETPOST('search_accountancy_code_start')) { $query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; $query .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."' limit 1"; @@ -221,7 +221,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } @@ -434,7 +434,7 @@ if (empty($reshook)) { $param .= '&search_import_key='.urlencode($search_import_key); } - //if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouvements->supprimer_tous) { + //if ($action == 'delbookkeepingyearconfirm' && !$user->hasRight('accounting', 'mouvements', 'supprimer_tous')) { // $delmonth = GETPOST('delmonth', 'int'); // $delyear = GETPOST('delyear', 'int'); // if ($delyear == -1) { @@ -486,7 +486,7 @@ if (empty($reshook)) { $uploaddir = $conf->societe->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; - if (!$error && $action == 'deletebookkeepingwriting' && $confirm == "yes" && $user->rights->accounting->mouvements->supprimer) { + if (!$error && $action == 'deletebookkeepingwriting' && $confirm == "yes" && $user->hasRight('accounting', 'mouvements', 'supprimer')) { $nbok = 0; foreach ($toselect as $toselectid) { $result = $object->fetch($toselectid); @@ -522,7 +522,7 @@ if (empty($reshook)) { } // others mass actions - if (!$error && getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->rights->accounting->mouvements->creer) { + if (!$error && getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) { if ($massaction == 'lettering') { $lettering = new Lettering($db); $nb_lettering = $lettering->bookkeepingLetteringAll($toselect); @@ -652,7 +652,7 @@ if (!empty($sortfield)) { // Export into a file with format defined into setup (FEC, CSV, ...) // Must be after definition of $sql -if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->export) { +if ($action == 'export_fileconfirm' && $user->hasRight('accounting', 'mouvements', 'export')) { // TODO Replace the fetchAll to get all ->line followed by call to ->export(). It consumes too much memory on large export. // Replace this with the query($sql) and loop on each line to export them. $result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1)); @@ -852,7 +852,7 @@ if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->rights->accounting- $arrayofmassactions['preunlettering'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('Unlettering'); } */ -if ($user->rights->accounting->mouvements->supprimer) { +if ($user->hasRight('accounting', 'mouvements', 'supprimer')) { $arrayofmassactions['predeletebookkeepingwriting'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('preunlettering', 'predeletebookkeepingwriting'))) { @@ -888,8 +888,8 @@ if (empty($reshook)) { } $newcardbutton .= ''.$langs->trans("IncludeDocsAlreadyExported").''; - if (!empty($user->rights->accounting->mouvements->export)) { - $newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file&token='.newToken().($param ? '&'.$param : ''), $user->rights->accounting->mouvements->export); + if ($user->hasRight('accounting', 'mouvements', 'export')) { + $newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file&token='.newToken().($param ? '&'.$param : ''), $user->hasRight('accounting', 'mouvements', 'export')); } $newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); @@ -900,7 +900,7 @@ if (empty($reshook)) { if (!empty($socid)) { $url .= '&socid='.$socid; } - $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', $url, '', $user->rights->accounting->mouvements->creer); + $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', $url, '', $user->hasRight('accounting', 'mouvements', 'creer')); } print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1); From 7d018797d07466baae7d35a23eef81bb7d87d438 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 25 Sep 2022 17:55:06 +0200 Subject: [PATCH 016/183] update code toward php8 compliance --- htdocs/accountancy/bookkeeping/listbyaccount.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index e417f21832c..063f5e95ba8 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -194,7 +194,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } @@ -401,7 +401,7 @@ if (empty($reshook)) { $uploaddir = $conf->societe->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; - if (!$error && $action == 'deletebookkeepingwriting' && $confirm == "yes" && $user->rights->accounting->mouvements->supprimer) { + if (!$error && $action == 'deletebookkeepingwriting' && $confirm == "yes" && !$user->hasRight('accounting', 'mouvements', 'supprimer')) { $nbok = 0; foreach ($toselect as $toselectid) { $result = $object->fetch($toselectid); @@ -437,7 +437,7 @@ if (empty($reshook)) { } // others mass actions - if (!$error && getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->rights->accounting->mouvements->creer) { + if (!$error && getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) { if ($massaction == 'lettering') { $lettering = new Lettering($db); $nb_lettering = $lettering->bookkeepingLetteringAll($toselect); @@ -579,11 +579,11 @@ print $formconfirm; // List of mass actions available $arrayofmassactions = array(); -if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->rights->accounting->mouvements->creer) { +if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) { $arrayofmassactions['lettering'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('Lettering'); $arrayofmassactions['preunlettering'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('Unlettering'); } -if ($user->rights->accounting->mouvements->supprimer) { +if ($user->hasRight('accounting', 'mouvements', 'supprimer')) { $arrayofmassactions['predeletebookkeepingwriting'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('preunlettering', 'predeletebookkeepingwriting'))) { From 7732fabd80c706802b7cf7035754f1e5cc480f06 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 25 Sep 2022 18:00:07 +0200 Subject: [PATCH 017/183] update code toward php8 compliance --- htdocs/accountancy/closure/index.php | 2 +- htdocs/accountancy/customer/card.php | 4 ++-- htdocs/accountancy/customer/index.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php index da4f5eecd25..c1dc454b675 100644 --- a/htdocs/accountancy/closure/index.php +++ b/htdocs/accountancy/closure/index.php @@ -64,7 +64,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->fiscalyear->write)) { +if (!$user->hasRight('accounting', 'fiscalyear', 'write')) { accessforbidden(); } diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 0b3435ecb92..e867070ed2d 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -44,7 +44,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } @@ -54,7 +54,7 @@ if (empty($user->rights->accounting->mouvements->lire)) { * Actions */ -if ($action == 'ventil' && $user->rights->accounting->bind->write) { +if ($action == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) { if (!$cancel) { if ($codeventil < 0) { $codeventil = 0; diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 472dce11e37..13aa7883222 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -47,7 +47,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->bind->write)) { +if ($user->hasRight('accounting', 'bind', 'write')) { accessforbidden(); } @@ -84,7 +84,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } @@ -93,7 +93,7 @@ if (empty($user->rights->accounting->mouvements->lire)) { * Actions */ -if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accounting->bind->write) { +if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('accounting', 'bind', 'write')) { // Clean database by removing binding done on non existing or no more existing accounts $db->begin(); $sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet as fd"; From f2e7e0b2100a8afdac23137cfab555b60fff0d08 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 25 Sep 2022 18:02:48 +0200 Subject: [PATCH 018/183] update code toward php8 compliance --- htdocs/accountancy/customer/lines.php | 4 ++-- htdocs/accountancy/customer/list.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 469f29ad3c7..65d7ee0bbeb 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -91,7 +91,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } @@ -126,7 +126,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_tvaintra = ''; } -if (is_array($changeaccount) && count($changeaccount) > 0 && $user->rights->accounting->bind->write) { +if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('accounting', 'bind', 'write')) { $error = 0; if (!(GETPOST('account_parent', 'int') >= 0)) { diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 4038bb4b5bc..9dfd94d5729 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -110,7 +110,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } From 52b973209ec2ac5c989f25aea572db433840ada3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 25 Sep 2022 19:06:55 +0200 Subject: [PATCH 019/183] fix Test differs --- 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 13aa7883222..079e05c406b 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -47,7 +47,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if ($user->hasRight('accounting', 'bind', 'write')) { +if (!$user->hasRight('accounting', 'bind', 'write')) { accessforbidden(); } From 9772bbeff3107d6dc0ab89629f97a8865056f4cf Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 21:58:40 +0200 Subject: [PATCH 020/183] Use isModEnabled --- htdocs/comm/mailing/card.php | 8 ++++---- htdocs/compta/facture/card.php | 2 +- htdocs/core/class/html.formmail.class.php | 6 +++--- htdocs/core/lib/oauth.lib.php | 2 +- htdocs/core/lib/payments.lib.php | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index e59389a87b7..2372f24a929 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -227,13 +227,13 @@ if (empty($reshook)) { $substitutionarray['__UNSUBSCRIBE_URL__'] = DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.urlencode($obj->tag).'&unsuscrib=1&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'&email='.urlencode($obj->email).'&mtid='.$obj->rowid; $onlinepaymentenabled = 0; - if (!empty($conf->paypal->enabled)) { + if (isModEnabled('paypal')) { $onlinepaymentenabled++; } - if (!empty($conf->paybox->enabled)) { + if (isModEnabled('paybox')) { $onlinepaymentenabled++; } - if (!empty($conf->stripe->enabled)) { + if (isModEnabled('stripe')) { $onlinepaymentenabled++; } if ($onlinepaymentenabled && !empty($conf->global->PAYMENT_SECURITY_TOKEN)) { @@ -263,7 +263,7 @@ if (empty($reshook)) { $substitutionarray['__PUBLICLINK_NEWMEMBERFORM__'] = ''.$langs->trans('BlankSubscriptionForm'). ''; } /* For backward compatibility, deprecated */ - if (!empty($conf->paypal->enabled) && !empty($conf->global->PAYPAL_SECURITY_TOKEN)) { + if (isModEnabled('paypal') && !empty($conf->global->PAYPAL_SECURITY_TOKEN)) { $substitutionarray['__SECUREKEYPAYPAL__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2); if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 0fe82b9e7f1..1465b60b2f6 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5802,7 +5802,7 @@ if ($action == 'create') { // Show online payment link - $useonlinepayment = (!empty($conf->paypal->enabled) || !empty($conf->stripe->enabled) || !empty($conf->paybox->enabled)); + $useonlinepayment = (isModEnabled('paypal') || isModEnabled('stripe') || isModEnabled('paybox')); if ($object->statut != Facture::STATUS_DRAFT && $useonlinepayment) { print '
'."\n"; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index a2abdbb7cc6..ad25db01fa6 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1619,13 +1619,13 @@ class FormMail extends Form //,'__PERSONALIZED__' => 'Personalized' // Hidden because not used yet in mass emailing $onlinepaymentenabled = 0; - if (!empty($conf->paypal->enabled)) { + if (isModEnabled('paypal')) { $onlinepaymentenabled++; } - if (!empty($conf->paybox->enabled)) { + if (isModEnabled('paybox')) { $onlinepaymentenabled++; } - if (!empty($conf->stripe->enabled)) { + if (isModEnabled('stripe')) { $onlinepaymentenabled++; } if ($onlinepaymentenabled && !empty($conf->global->PAYMENT_SECURITY_TOKEN)) { diff --git a/htdocs/core/lib/oauth.lib.php b/htdocs/core/lib/oauth.lib.php index d48775fe84e..83359ef1c65 100644 --- a/htdocs/core/lib/oauth.lib.php +++ b/htdocs/core/lib/oauth.lib.php @@ -27,7 +27,7 @@ $supportedoauth2array = array( 'OAUTH_GOOGLE_NAME'=>array('callbackfile' => 'google', 'picto' => 'google', 'urlforapp' => 'OAUTH_GOOGLE_DESC', 'name'=>'Google', 'urlforcredentials'=>'https://console.developers.google.com/', 'availablescopes'=> 'userinfo_email,userinfo_profile,openid,email,profile,cloud_print,admin_directory_user,gmail_full'), ); -if (!empty($conf->stripe->enabled)) { +if (isModEnabled('stripe')) { $supportedoauth2array['OAUTH_STRIPE_TEST_NAME'] = array('callbackfile' => 'stripetest', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeTest', 'urlforcredentials'=>'', 'availablescopes'=>'read_write'); $supportedoauth2array['OAUTH_STRIPE_LIVE_NAME'] = array('callbackfile' => 'stripelive', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeLive', 'urlforcredentials'=>'', 'availablescopes'=>'read_write'); } diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 19a251d1b38..44691f7c2c4 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -150,15 +150,15 @@ function getValidOnlinePaymentMethods($paymentmethod = '') $validpaymentmethod = array(); - if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled)) { + if ((empty($paymentmethod) || $paymentmethod == 'paypal') && isModEnabled('paypal')) { $langs->load("paypal"); $validpaymentmethod['paypal'] = 'valid'; } - if ((empty($paymentmethod) || $paymentmethod == 'paybox') && !empty($conf->paybox->enabled)) { + if ((empty($paymentmethod) || $paymentmethod == 'paybox') && isModEnabled('paybox')) { $langs->load("paybox"); $validpaymentmethod['paybox'] = 'valid'; } - if ((empty($paymentmethod) || $paymentmethod == 'stripe') && !empty($conf->stripe->enabled)) { + if ((empty($paymentmethod) || $paymentmethod == 'stripe') && isModEnabled('stripe')) { $langs->load("stripe"); $validpaymentmethod['stripe'] = 'valid'; } From da55ed782c1faed7bd3eac12402728fdcf1f107d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 21:58:56 +0200 Subject: [PATCH 021/183] Use isModEnabled --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 6 +++--- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 6 +++--- htdocs/don/card.php | 2 +- htdocs/partnership/admin/website.php | 6 +++--- htdocs/public/eventorganization/subscriptionok.php | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index ee4e43bb444..168e293cc90 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1180,13 +1180,13 @@ class pdf_crabe extends ModelePDFFactures if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CB' || $object->mode_reglement_code == 'VAD') { $useonlinepayment = 0; if (!empty($conf->global->PDF_SHOW_LINK_TO_ONLINE_PAYMENT)) { - if (!empty($conf->paypal->enabled)) { + if (isModEnabled('paypal')) { $useonlinepayment++; } - if (!empty($conf->stripe->enabled)) { + if (isModEnabled('stripe')) { $useonlinepayment++; } - if (!empty($conf->paybox->enabled)) { + if (isModEnabled('paybox')) { $useonlinepayment++; } } diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 1efca9070d0..5da53c41121 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1290,13 +1290,13 @@ class pdf_sponge extends ModelePDFFactures if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CB' || $object->mode_reglement_code == 'VAD') { $useonlinepayment = 0; if (!empty($conf->global->PDF_SHOW_LINK_TO_ONLINE_PAYMENT)) { - if (!empty($conf->paypal->enabled)) { + if (isModEnabled('paypal')) { $useonlinepayment++; } - if (!empty($conf->stripe->enabled)) { + if (isModEnabled('stripe')) { $useonlinepayment++; } - if (!empty($conf->paybox->enabled)) { + if (isModEnabled('paybox')) { $useonlinepayment++; } } diff --git a/htdocs/don/card.php b/htdocs/don/card.php index ae73fdfd15a..7c18073907e 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -914,7 +914,7 @@ if (!empty($id) && $action != 'edit') { $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); // Show online payment link - $useonlinepayment = (!empty($conf->paypal->enabled) || !empty($conf->stripe->enabled) || !empty($conf->paybox->enabled)); + $useonlinepayment = (isModEnabled('paypal') || isModEnabled('stripe') || isModEnabled('paybox')); if ($useonlinepayment) { //$object->statut != Facture::STATUS_DRAFT && print '
'."\n"; diff --git a/htdocs/partnership/admin/website.php b/htdocs/partnership/admin/website.php index b3bccf9fa00..bb86f95269b 100644 --- a/htdocs/partnership/admin/website.php +++ b/htdocs/partnership/admin/website.php @@ -189,13 +189,13 @@ if (!empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) { $listofval = array(); $listofval['-1'] = $langs->trans('No'); $listofval['all'] = $langs->trans('Yes').' ('.$langs->trans("VisitorCanChooseItsPaymentMode").')'; - if (!empty($conf->paybox->enabled)) { + if (isModEnabled('paybox')) { $listofval['paybox'] = 'Paybox'; } - if (!empty($conf->paypal->enabled)) { + if (isModEnabled('paypal')) { $listofval['paypal'] = 'PayPal'; } - if (!empty($conf->stripe->enabled)) { + if (isModEnabled('stripe')) { $listofval['stripe'] = 'Stripe'; } print $form->selectarray("PARTNERSHIP_NEWFORM_PAYONLINE", $listofval, (!empty($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE) ? $conf->global->PARTNERSHIP_NEWFORM_PAYONLINE : ''), 0); diff --git a/htdocs/public/eventorganization/subscriptionok.php b/htdocs/public/eventorganization/subscriptionok.php index 745c9885647..043e0e8d021 100644 --- a/htdocs/public/eventorganization/subscriptionok.php +++ b/htdocs/public/eventorganization/subscriptionok.php @@ -53,7 +53,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; -if (!empty($conf->paypal->enabled)) { +if (isModEnabled('paypal')) { require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php'; } From a7a39cba97b278314dabdbc6abfe7b1cdd1428bb Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 21:59:46 +0200 Subject: [PATCH 022/183] Use isModEnabled --- htdocs/public/payment/newpayment.php | 24 ++++++++++++------------ htdocs/public/payment/paymentko.php | 14 +++++++------- htdocs/public/payment/paymentok.php | 16 ++++++++-------- htdocs/societe/paymentmodes.php | 18 +++++++++--------- htdocs/stripe/admin/stripe.php | 2 +- 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 9d5fb5f122f..d3b08e9672b 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -247,7 +247,7 @@ $urlko = preg_replace('/&$/', '', $urlko); // Remove last & // Make special controls -if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled)) { +if ((empty($paymentmethod) || $paymentmethod == 'paypal') && isModEnabled('paypal')) { require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php'; @@ -273,10 +273,10 @@ if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypa return -1; } } -if ((empty($paymentmethod) || $paymentmethod == 'paybox') && !empty($conf->paybox->enabled)) { +if ((empty($paymentmethod) || $paymentmethod == 'paybox') && isModEnabled('paybox')) { // No specific test for the moment } -if ((empty($paymentmethod) || $paymentmethod == 'stripe') && !empty($conf->stripe->enabled)) { +if ((empty($paymentmethod) || $paymentmethod == 'stripe') && isModEnabled('stripe')) { require_once DOL_DOCUMENT_ROOT.'/stripe/config.php'; // This include also /stripe/lib/stripe.lib.php, /includes/stripe/stripe-php/init.php, ... } @@ -481,7 +481,7 @@ if ($action == 'dopayment') { // Called when choosing Stripe mode. // When using the old Charge API architecture, this code is called after clicking the 'dopayment' with the Charge API architecture. // When using the PaymentIntent API architecture, the Stripe customer was already created when creating PaymentIntent when showing payment page, and the payment is already ok when action=charge. -if ($action == 'charge' && !empty($conf->stripe->enabled)) { +if ($action == 'charge' && isModEnabled('stripe')) { $amountstripe = $amount; // Correct the amount according to unit of currency @@ -844,10 +844,10 @@ if ($source && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_r // Show sandbox warning -if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled) && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'int'))) { // We can force sand box with param 'forcesandbox' +if ((empty($paymentmethod) || $paymentmethod == 'paypal') && isModEnabled('paypal') && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'int'))) { // We can force sand box with param 'forcesandbox' dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Paypal'), '', 'warning'); } -if ((empty($paymentmethod) || $paymentmethod == 'stripe') && !empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'int'))) { +if ((empty($paymentmethod) || $paymentmethod == 'stripe') && isModEnabled('stripe') && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'int'))) { dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); } @@ -911,14 +911,14 @@ if (!empty($conf->global->MAIN_IMAGE_PUBLIC_PAYMENT)) { print ''."\n"; print ''."\n"; // Additionnal information for each payment system -if (!empty($conf->paypal->enabled)) { +if (isModEnabled('paypal')) { print ''."\n"; print ''."\n"; } -if (!empty($conf->paybox->enabled)) { +if (isModEnabled('paybox')) { print ''."\n"; } -if (!empty($conf->stripe->enabled)) { +if (isModEnabled('stripe')) { print ''."\n"; } print ''."\n"; @@ -2043,7 +2043,7 @@ if ($action != 'dopayment') { 'paymentmethod' => $paymentmethod ]; $reshook = $hookmanager->executeHooks('doAddButton', $parameters, $object, $action); - if ((empty($paymentmethod) || $paymentmethod == 'paybox') && !empty($conf->paybox->enabled)) { + if ((empty($paymentmethod) || $paymentmethod == 'paybox') && isModEnabled('paybox')) { print '
'; print '
'; print ''.$langs->trans("CreditOrDebitCard").''; @@ -2062,7 +2062,7 @@ if ($action != 'dopayment') { '; } - if ((empty($paymentmethod) || $paymentmethod == 'stripe') && !empty($conf->stripe->enabled)) { + if ((empty($paymentmethod) || $paymentmethod == 'stripe') && isModEnabled('stripe')) { print '
'; print ''; print '
'; @@ -2083,7 +2083,7 @@ if ($action != 'dopayment') { '; } - if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled)) { + if ((empty($paymentmethod) || $paymentmethod == 'paypal') && isModEnabled('paypal')) { if (empty($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY)) { $conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY = 'integral'; } diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 5bf9b6115ed..29adb2947d0 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -51,14 +51,14 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; -if (!empty($conf->paypal->enabled)) { +if (isModEnabled('paypal')) { require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php'; } $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe")); -if (!empty($conf->paypal->enabled)) { +if (isModEnabled('paypal')) { $PAYPALTOKEN = GETPOST('TOKEN'); if (empty($PAYPALTOKEN)) { $PAYPALTOKEN = GETPOST('token'); @@ -68,9 +68,9 @@ if (!empty($conf->paypal->enabled)) { $PAYPALPAYERID = GETPOST('PayerID'); } } -if (!empty($conf->paybox->enabled)) { +if (isModEnabled('paybox')) { } -if (!empty($conf->stripe->enabled)) { +if (isModEnabled('stripe')) { } $FULLTAG = GETPOST('FULLTAG'); @@ -96,13 +96,13 @@ if (empty($paymentmethod)) { $validpaymentmethod = array(); -if (!empty($conf->paypal->enabled)) { +if (isModEnabled('paypal')) { $validpaymentmethod['paypal'] = 'paypal'; } -if (!empty($conf->paybox->enabled)) { +if (isModEnabled('paybox')) { $validpaymentmethod['paybox'] = 'paybox'; } -if (!empty($conf->stripe->enabled)) { +if (isModEnabled('stripe')) { $validpaymentmethod['stripe'] = 'stripe'; } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index b8e4e9d4e19..4d1336351b3 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -57,7 +57,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; -if (!empty($conf->paypal->enabled)) { +if (isModEnabled('paypal')) { require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php'; } @@ -65,7 +65,7 @@ if (!empty($conf->paypal->enabled)) { $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal")); // Clean parameters -if (!empty($conf->paypal->enabled)) { +if (isModEnabled('paypal')) { $PAYPAL_API_USER = ""; if (!empty($conf->global->PAYPAL_API_USER)) { $PAYPAL_API_USER = $conf->global->PAYPAL_API_USER; @@ -127,13 +127,13 @@ dol_syslog("***** paymentok.php is called paymentmethod=".$paymentmethod." FULLT $validpaymentmethod = array(); -if (!empty($conf->paypal->enabled)) { +if (isModEnabled('paypal')) { $validpaymentmethod['paypal'] = 'paypal'; } -if (!empty($conf->paybox->enabled)) { +if (isModEnabled('paybox')) { $validpaymentmethod['paybox'] = 'paybox'; } -if (!empty($conf->stripe->enabled)) { +if (isModEnabled('stripe')) { $validpaymentmethod['stripe'] = 'stripe'; } @@ -236,7 +236,7 @@ if (!empty($conf->global->MAIN_IMAGE_PUBLIC_PAYMENT)) { print '


'; -if (!empty($conf->paypal->enabled)) { +if (isModEnabled('paypal')) { if ($paymentmethod == 'paypal') { // We call this page only if payment is ok on payment system if ($PAYPALTOKEN) { // Get on url call @@ -316,14 +316,14 @@ if (!empty($conf->paypal->enabled)) { } } -if (!empty($conf->paybox->enabled)) { +if (isModEnabled('paybox')) { if ($paymentmethod == 'paybox') { // TODO Add a check to validate that payment is ok. $ispaymentok = true; // We call this page only if payment is ok on payment system } } -if (!empty($conf->stripe->enabled)) { +if (isModEnabled('stripe')) { if ($paymentmethod == 'stripe') { // TODO Add a check to validate that payment is ok. We can request Stripe with payment_intent and payment_intent_client_secret $ispaymentok = true; // We call this page only if payment is ok on payment system diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 6110fc7a5e5..2ba271cd936 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -84,7 +84,7 @@ $permissiontoadd = $user->rights->societe->creer; // Used by the include of acti $permissiontoaddupdatepaymentinformation = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $permissiontoadd) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->societe->thirdparty_paymentinformation_advance->write))); -if (!empty($conf->stripe->enabled)) { +if (isModEnabled('stripe')) { $service = 'StripeTest'; $servicestatus = 0; if (!empty($conf->global->STRIPE_LIVE) && !GETPOST('forcesandbox', 'alpha')) { @@ -493,7 +493,7 @@ if (empty($reshook)) { $id = $savid; // Action for stripe - if (!empty($conf->stripe->enabled) && class_exists('Stripe')) { + if (isModEnabled('stripe') && class_exists('Stripe')) { if ($action == 'synccustomertostripe') { if ($object->client == 0) { $error++; @@ -782,11 +782,11 @@ llxHeader('', $title, $help_url); $head = societe_prepare_head($object); // Show sandbox warning -/*if (!empty($conf->paypal->enabled) && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox','alpha'))) // We can force sand box with param 'forcesandbox' +/*if (isModEnabled('paypal') && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox','alpha'))) // We can force sand box with param 'forcesandbox' { dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode','Paypal'),'','warning'); }*/ -if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { +if (isModEnabled('stripe') && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); } @@ -885,13 +885,13 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } - if (!empty($conf->stripe->enabled)) { + if (isModEnabled('stripe')) { // Stripe customer key 'cu_....' stored into llx_societe_account print ''; print $form->editfieldkey("StripeCustomerId", 'key_account', $stripecu, $object, $permissiontoaddupdatepaymentinformation, 'string', '', 0, 2, 'socid'); print ''; print $form->editfieldval("StripeCustomerId", 'key_account', $stripecu, $object, $permissiontoaddupdatepaymentinformation, 'string', '', null, null, '', 2, '', 'socid'); - if (!empty($conf->stripe->enabled) && $stripecu && $action != 'editkey_account') { + if (isModEnabled('stripe') && $stripecu && $action != 'editkey_account') { $connect = ''; if (!empty($stripeacc)) { $connect = $stripeacc.'/'; @@ -947,7 +947,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' } } - if (!empty($conf->stripe->enabled) && !empty($conf->stripeconnect->enabled) && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { + if (isModEnabled('stripe') && !empty($conf->stripeconnect->enabled) && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { $stripesupplieracc = $stripe->getStripeAccount($service, $object->id); // Get Stripe OAuth connect account (no network access here) // Stripe customer key 'cu_....' stored into llx_societe_account @@ -955,7 +955,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print $form->editfieldkey("StripeConnectAccount", 'key_account_supplier', $stripesupplieracc, $object, $permissiontoaddupdatepaymentinformation, 'string', '', 0, 2, 'socid'); print ''; print $form->editfieldval("StripeConnectAccount", 'key_account_supplier', $stripesupplieracc, $object, $permissiontoaddupdatepaymentinformation, 'string', '', null, null, '', 2, '', 'socid'); - if (!empty($conf->stripe->enabled) && $stripesupplieracc && $action != 'editkey_account_supplier') { + if (isModEnabled('stripe') && $stripesupplieracc && $action != 'editkey_account_supplier') { $connect = ''; $url = 'https://dashboard.stripe.com/test/connect/accounts/'.$stripesupplieracc; @@ -1338,7 +1338,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' } // List of Stripe connect accounts - if (!empty($conf->stripe->enabled) && !empty($conf->stripeconnect->enabled) && !empty($stripesupplieracc)) { + if (isModEnabled('stripe') && !empty($conf->stripeconnect->enabled) && !empty($stripesupplieracc)) { print load_fiche_titre($langs->trans('StripeBalance').($stripesupplieracc ? ' (Stripe connection with StripeConnect account '.$stripesupplieracc.')' : ' (Stripe connection with keys from Stripe module setup)'), $morehtmlright, 'stripe-s'); $balance = \Stripe\Balance::retrieve(array("stripe_account" => $stripesupplieracc)); print ''."\n"; diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 33536271115..6cbefc14185 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -399,7 +399,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // TODO Not used by current code if (!empty($site_account)) { \Stripe\Stripe::setApiKey($site_account); } - if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { + if (isModEnabled('stripe') && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { $service = 'StripeTest'; $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); From abcd68071e52ab5d8a9528cb0acc3831401bdf10 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 22:00:20 +0200 Subject: [PATCH 023/183] Use isModEnabled --- htdocs/stripe/charge.php | 4 ++-- htdocs/stripe/class/actions_stripe.class.php | 2 +- htdocs/stripe/payout.php | 2 +- htdocs/stripe/transaction.php | 2 +- htdocs/takepos/admin/terminal.php | 6 +++--- htdocs/takepos/pay.php | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 522445334eb..f598275177e 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -68,7 +68,7 @@ $stripe = new Stripe($db); llxHeader('', $langs->trans("StripeChargeList")); -if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { +if (isModEnabled('stripe') && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { $service = 'StripeTest'; $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); @@ -225,7 +225,7 @@ if (!$rowid) { // Stripe customer print "'; - if (!empty($conf->stripe->enabled) && !empty($conf->global->STRIPE_CARD_PRESENT)) { + if (isModEnabled('stripe') && !empty($conf->global->STRIPE_CARD_PRESENT)) { print ''; // Force Stripe Terminal print '
"; - if (!empty($conf->stripe->enabled) && !empty($stripeacc)) { + if (isModEnabled('stripe') && !empty($stripeacc)) { $connect = $stripeacc.'/'; } $url = 'https://dashboard.stripe.com/'.$connect.'test/customers/'.$charge->customer; diff --git a/htdocs/stripe/class/actions_stripe.class.php b/htdocs/stripe/class/actions_stripe.class.php index 0d8b5e03435..8e5cd833a71 100644 --- a/htdocs/stripe/class/actions_stripe.class.php +++ b/htdocs/stripe/class/actions_stripe.class.php @@ -71,7 +71,7 @@ class ActionsStripeconnect { global $db, $conf, $user, $langs, $form; - if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { + if (isModEnabled('stripe') && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { $service = 'StripeTest'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); } else { diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php index 81baa5db4ac..1965c8ab73d 100644 --- a/htdocs/stripe/payout.php +++ b/htdocs/stripe/payout.php @@ -72,7 +72,7 @@ $stripe = new Stripe($db); llxHeader('', $langs->trans("StripePayoutList")); -if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { +if (isModEnabled('stripe') && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { $service = 'StripeTest'; $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php index c36c061b91e..29eec246af8 100644 --- a/htdocs/stripe/transaction.php +++ b/htdocs/stripe/transaction.php @@ -71,7 +71,7 @@ $stripe = new Stripe($db); llxHeader('', $langs->trans("StripeTransactionList")); -if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { +if (isModEnabled('stripe') && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { $service = 'StripeTest'; $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index eb43455216c..9cd1a5fd5f0 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -79,7 +79,7 @@ if (GETPOST('action', 'alpha') == 'set') { $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CHEQUE".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CB".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); - if (!empty($conf->stripe->enabled) && !empty($conf->global->STRIPE_CARD_PRESENT)) { + if (isModEnabled('stripe') && !empty($conf->global->STRIPE_CARD_PRESENT)) { $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL".$terminaltouse, GETPOST('CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL'.$terminaltouse, 'alpha'), 'chaine', 0, '', $conf->entity); } if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) { @@ -189,7 +189,7 @@ if (isModEnabled("banque")) { } print '
'.$langs->trans("CashDeskBankAccountForStripeTerminal").''; $service = 'StripeTest'; @@ -201,7 +201,7 @@ if (isModEnabled("banque")) { global $stripearrayofkeysbyenv; $site_account = $stripearrayofkeysbyenv[$servicestatus]['secret_key']; \Stripe\Stripe::setApiKey($site_account); - if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { + if (isModEnabled('stripe') && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { $service = 'StripeTest'; $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 1222ccd1786..affcfaa50de 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -80,7 +80,7 @@ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); stripe->enabled)) { +if (isModEnabled('stripe')) { $service = 'StripeTest'; $servicestatus = 0; if (!empty($conf->global->STRIPE_LIVE) && !GETPOST('forcesandbox', 'alpha')) { @@ -130,7 +130,7 @@ function fetchConnectionToken() { stripe->enabled) && isset($keyforstripeterminalbank) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { +if (isModEnabled('stripe') && isset($keyforstripeterminalbank) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning', 1); } @@ -535,7 +535,7 @@ $action_buttons = array( ), ); $numpad = $conf->global->TAKEPOS_NUMPAD; -if (!empty($conf->stripe->enabled) && isset($keyforstripeterminalbank) && !empty($conf->global->STRIPE_CARD_PRESENT)) { +if (isModEnabled('stripe') && isset($keyforstripeterminalbank) && !empty($conf->global->STRIPE_CARD_PRESENT)) { print ''; dol_htmloutput_mesg($langs->trans('ConnectingToStripeTerminal', 'Stripe'), '', 'warning', 1); print ''; @@ -646,7 +646,7 @@ while ($i < count($arrayOfValidPaymentModes)) { $i = $i + 1; } -if (!empty($conf->stripe->enabled) && isset($keyforstripeterminalbank) && !empty($conf->global->STRIPE_CARD_PRESENT)) { +if (isModEnabled('stripe') && isset($keyforstripeterminalbank) && !empty($conf->global->STRIPE_CARD_PRESENT)) { $keyforstripeterminalbank = "CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL".$_SESSION["takeposterminal"]; print ''; if (!empty($conf->global->$keyforstripeterminalbank)) { From ef94f2af70a40e8d5d3f4c059a20ade6b75ef8fd Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 22:45:10 +0200 Subject: [PATCH 024/183] Use isModEnabled --- htdocs/comm/propal/card.php | 4 ++-- htdocs/comm/propal/list.php | 4 ++-- htdocs/commande/list.php | 14 +++++++------- htdocs/compta/facture/list.php | 8 ++++---- htdocs/contrat/card.php | 10 +++++----- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 3c478ff5a2c..44f7e00bdce 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -64,7 +64,7 @@ $langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'pro if (!empty($conf->incoterm->enabled)) { $langs->load('incoterm'); } -if (!empty($conf->margin->enabled)) { +if (isModEnabled('margin')) { $langs->load('margins'); } @@ -2737,7 +2737,7 @@ if ($action == 'create') { print '
'; // Margin Infos - if (!empty($conf->margin->enabled)) { + if (isModEnabled('margin')) { $formmargin->displayMarginInfos($object); } diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 5b678a0f7ac..76c4a42ddce 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -536,7 +536,7 @@ $formother = new FormOther($db); $formfile = new FormFile($db); $formpropal = new FormPropal($db); $formmargin = null; -if (!empty($conf->margin->enabled)) { +if (isModEnabled('margin')) { $formmargin = new FormMargin($db); } $companystatic = new Societe($db); @@ -1573,7 +1573,7 @@ if ($resql) { $typenArray = null; $with_margin_info = false; - if (!empty($conf->margin->enabled) && ( + if (isModEnabled('margin') && ( !empty($arrayfields['total_pa']['checked']) || !empty($arrayfields['total_margin']['checked']) || !empty($arrayfields['total_margin_rate']['checked']) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 5cde78cd09f..58a6ce70f0f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->margin->enabled)) { +if (isModEnabled('margin')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php'; } require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; @@ -199,10 +199,10 @@ $arrayfields = array( 'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>110), 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>115), 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>116), - 'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)), - 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)), - 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)), - 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), + 'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous ? 0 : 1)), + 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous ? 0 : 1)), + 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)), + 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), 'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>120), 'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>125), 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), @@ -778,7 +778,7 @@ $form = new Form($db); $formother = new FormOther($db); $formfile = new FormFile($db); $formmargin = null; -if (!empty($conf->margin->enabled)) { +if (isModEnabled('margin')) { $formmargin = new FormMargin($db); } $companystatic = new Societe($db); @@ -1850,7 +1850,7 @@ if ($resql) { $i = 0; $with_margin_info = false; - if (!empty($conf->margin->enabled) && ( + if (isModEnabled('margin') && ( !empty($arrayfields['total_pa']['checked']) || !empty($arrayfields['total_margin']['checked']) || !empty($arrayfields['total_margin_rate']['checked']) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index ddfe7e5429f..1d6dbd9f03b 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -245,10 +245,10 @@ $arrayfields = array( 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>292), 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>295), 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>296), // Not enabled by default because slow - 'total_pa' => array('label' => ((isset($conf->global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == '1') ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) ? 0 : 1)), - 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) ? 0 : 1)), - 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)), - 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), + 'total_pa' => array('label' => ((isset($conf->global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == '1') ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) ? 0 : 1)), + 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) ? 0 : 1)), + 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)), + 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>502), 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 3509134c70f..b452b20154a 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1476,7 +1476,7 @@ if ($action == 'create') { $productstatic = new Product($db); $usemargins = 0; - if (!empty($conf->margin->enabled) && !empty($object->element) && in_array($object->element, array('facture', 'propal', 'commande'))) { + if (isModEnabled('margin') && !empty($object->element) && in_array($object->element, array('facture', 'propal', 'commande'))) { $usemargins = 1; } @@ -1522,7 +1522,7 @@ if ($action == 'create') { print ''.$langs->trans("Unit").''; } print ''.$langs->trans("ReductionShort").''; - if (!empty($conf->margin->enabled) && !empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) { + if (isModEnabled('margin') && !empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) { print ''.$langs->trans("BuyingPrice").''; } print ' '; @@ -1592,7 +1592,7 @@ if ($action == 'create') { } // Margin - if (!empty($conf->margin->enabled) && !empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) { + if (isModEnabled('margin') && !empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) { print ''.price($objp->pa_ht).''; } @@ -1749,7 +1749,7 @@ if ($action == 'create') { print ''; $colspan = 6; - if (!empty($conf->margin->enabled) && !empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) { + if (isModEnabled('margin') && !empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) { $colspan++; } if (!empty($conf->global->PRODUCT_USE_UNITS)) { @@ -2237,7 +2237,7 @@ $db->close(); ?> margin->enabled) && $action == 'editline') { +if (isModEnabled('margin') && $action == 'editline') { // TODO Why this ? To manage margin on contracts ? ?>