From 783257706ca6c20776efe59ea84852a04281adbc Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 2 Jul 2021 10:53:51 +0200 Subject: [PATCH 01/19] fix: payment ok should trigger PAYMENTONLINE_PAYMENT_OK even on custom object --- htdocs/public/payment/paymentok.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 60d763593fe..fb23e57d1ed 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -746,6 +746,12 @@ if ($ispaymentok) $result = $object->call_trigger('PAYMENTONLINE_PAYMENT_OK', $user); if ($result < 0) $error++; // End call triggers + } elseif (get_class($object)=='stdClass') { + //In some case $object is not instanciate (for paiement on custom object) We need to deal with payment + include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; + $paiement = new Paiement($db); + $result = $paiement->call_trigger('PAYMENTONLINE_PAYMENT_OK', $user); + if ($result < 0) $error++; } print $langs->trans("YourPaymentHasBeenRecorded")."
\n"; From 97938f489ef937662de07ddbe020c133e01eaeb4 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 2 Jul 2021 11:35:26 +0200 Subject: [PATCH 02/19] FIX: holiday: status filter parameter has been renamed but not in links it was used --- htdocs/core/menus/standard/eldy.lib.php | 10 +++++----- htdocs/holiday/class/holiday.class.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index ed835a3d4c0..76d51069885 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1755,11 +1755,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("New"), 1, $user->rights->holiday->write); $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->holiday->read); if ($usemenuhider || empty($leftmenu) || $leftmenu == "hrm") { - $newmenu->add("/holiday/list.php?search_statut=1&mainmenu=hrm&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read); - $newmenu->add("/holiday/list.php?search_statut=2&mainmenu=hrm&leftmenu=hrm", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read); - $newmenu->add("/holiday/list.php?search_statut=3&mainmenu=hrm&leftmenu=hrm", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read); - $newmenu->add("/holiday/list.php?search_statut=4&mainmenu=hrm&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read); - $newmenu->add("/holiday/list.php?search_statut=5&mainmenu=hrm&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=hrm", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=hrm", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read); } $newmenu->add("/holiday/define_holiday.php?mainmenu=hrm&action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->read); $newmenu->add("/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->readall); diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index f61c0a66ca8..717e9a07c58 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -2248,7 +2248,7 @@ class Holiday extends CommonObject $response->warning_delay = $conf->holiday->approve->warning_delay / 60 / 60 / 24; $response->label = $langs->trans("HolidaysToApprove"); $response->labelShort = $langs->trans("ToApprove"); - $response->url = DOL_URL_ROOT.'/holiday/list.php?search_statut=2&mainmenu=hrm&leftmenu=holiday'; + $response->url = DOL_URL_ROOT.'/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=holiday'; $response->img = img_object('', "holiday"); while ($obj = $this->db->fetch_object($resql)) From 8bade0e4e7c06d163670f533dd4e7dd7f69c0628 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Jul 2021 16:11:42 +0200 Subject: [PATCH 03/19] Fix add permission --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index e5700fca445..d92ec87ca29 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -112,7 +112,7 @@ if (!$sortfield) $sortfield = 'p.ref'; if (!$sortorder) $sortorder = 'DESC'; $permissiontoread = $user->rights->propal->lire; -$permissiontoadd = $user->rights->propal->write; +$permissiontoadd = $user->rights->propal->creer; $permissiontodelete = $user->rights->propal->supprimer; if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $permissiontoclose = $user->rights->propale->propal_advance->close; From 8bde61c2c63fb917633db414c684204dfd428d6e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 5 Jul 2021 06:58:10 +0200 Subject: [PATCH 04/19] FIX Accountancy - Link from admin --- htdocs/accountancy/admin/index.php | 2 +- htdocs/admin/accounting.php | 11 ++++++----- htdocs/core/modules/modAccounting.class.php | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 24d31acddd6..98320613bfc 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -259,7 +259,7 @@ llxHeader('', $title); $linkback = ''; //$linkback = '' . $langs->trans("BackToModuleList") . ''; -print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'accountancy'); +print load_fiche_titre($title, $linkback, 'accountancy'); print '
'; print ''; diff --git a/htdocs/admin/accounting.php b/htdocs/admin/accounting.php index e775f5bd8e3..ebe0712b03a 100644 --- a/htdocs/admin/accounting.php +++ b/htdocs/admin/accounting.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018-2021 Alexandre Spangaro * * 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 @@ -18,7 +18,7 @@ /** * \file htdocs/admin/accounting.php * \ingroup accounting - * \brief Setup page to configure accountanting module + * \brief Setup page to configure accounting module */ require '../main.inc.php'; @@ -32,7 +32,7 @@ $action = GETPOST('action', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'adminaccoutant'; // To manage different context of search // Load translation files required by the page -$langs->loadLangs(array('admin', 'companies')); +$langs->loadLangs(array('admin', 'companies', 'accountancy')); if (!$user->admin) { accessforbidden(); @@ -52,12 +52,13 @@ $error = 0; * View */ +$title = $langs->trans("ConfigAccountingExpert"); $help_url = ''; -llxHeader('', $langs->trans("ConfigAccountingExpert"), $help_url); +llxHeader('', $title, $help_url); $linkback = ''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ConfigAccountingExpert"), $linkback, 'title_setup'); +print load_fiche_titre($title, $linkback, 'title_setup'); print "
\n"; print ''.$langs->trans("AccountancySetupDoneFromAccountancyMenu", $langs->transnoentitiesnoconv("Accounting").' - '.$langs->transnoentitiesnoconv("Setup"))."
\n"; diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index d6127f65b83..e0bf3a9bbc5 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -60,7 +60,7 @@ class modAccounting extends DolibarrModules $this->dirs = array('/accounting/temp'); // Config pages - $this->config_page_url = array('accounting.php'); + $this->config_page_url = array('accounting.php?mainmenu=accountancy&leftmenu=accountancy_admin'); // Dependencies $this->depends = array("modFacture", "modBanque", "modTax"); // List of modules id that must be enabled if this module is enabled From cb2c10551b48d927df9c6a1f89cffc1957e128b3 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 5 Jul 2021 15:17:21 +0200 Subject: [PATCH 05/19] on goign --- .../class/conferenceorbooth.class.php | 3 +- htdocs/langs/en_US/eventorganization.lang | 4 + .../attendee_subscription.php | 154 +++++++++--------- htdocs/public/project/suggestbooth.php | 39 ++--- htdocs/public/project/suggestconference.php | 35 ++-- 5 files changed, 122 insertions(+), 113 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index ae35f3eb892..10ed5668c63 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -108,7 +108,7 @@ class ConferenceOrBooth extends ActionComm 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'1',), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty",), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1::eventorganization', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1,), - 'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1,), + 'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1, 'csslist'=>'small'), 'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1,), 'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'2',), 'datep2' => array('type'=>'datetime', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'3',), @@ -118,6 +118,7 @@ class ConferenceOrBooth extends ActionComm 'fk_user_mod' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>1, 'default'=>'0', 'index'=>1, 'arrayofkeyval'=>array('0'=>'EvntOrgDraft', '1'=>'EvntOrgSuggested', '2'=> 'EvntOrgConfirmed', '3' =>'EvntOrgNotQualified', '4' =>'EvntOrgDone', '9'=>'EvntOrgCancelled'),), + 'num_vote' => array('type'=>'smallint', 'label'=>'NbVotes', 'enabled'=>'1', 'position'=>1001, 'notnull'=>-1, 'visible'=>5, 'default'=>'0', 'index'=>0), ); public $rowid; public $id; diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 335c257b224..f361e6bc192 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -86,6 +86,7 @@ DownloadICSLink = Download ICS link EVENTORGANIZATION_SECUREKEY = Secure Key of the public registration link to a conference SERVICE_BOOTH_LOCATION = Service used for the invoice row about a booth location SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION = Service used for the invoice row about an attendee subscription to a conference +NbVotes=Number of votes # # Status # @@ -115,6 +116,9 @@ EvntOrgDuration = This conference starts on %s and ends on %s. ConferenceAttendeeFee = Conference attendee fee for the event : '%s' occurring from %s to %s. BoothLocationFee = Booth location for the event : '%s' occurring from %s to %s EventType = Event type +LabelOfBooth=Booth label +LabelOfconference=Conference label +ConferenceIsNotConfirmed=Subcription not available, conference is not confirmed yet # # Vote page diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 19bb2007bda..afdfdb9f806 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -205,7 +205,7 @@ if ($reshook < 0) { } // Action called when page is submitted -if (empty($reshook) && $action == 'add') { +if (empty($reshook) && $action == 'add' && $conference->status==2) { $error = 0; $urlback = ''; @@ -473,25 +473,27 @@ print $langs->trans("EvntOrgWelcomeMessage", $conference->label); print '
'; print $langs->trans("EvntOrgDuration", dol_print_date($conference->datep), dol_print_date($conference->datef)); print ''; - dol_htmloutput_errors($errmsg); -// Print form -print ''."\n"; -print ''; -print ''; -print ''; -print ''; -print ''; +if ($conference->status!=2) { + print $langs->trans("ConferenceIsNotConfirmed"); +} else { + // Print form + print '' . "\n"; + print ''; + print ''; + print ''; + print ''; + print ''; -print '
'; + print '
'; -print '
'.$langs->trans("FieldsWithAreMandatory", '*').'
'; -//print $langs->trans("FieldsWithIsForPublic",'**').'
'; + print '
' . $langs->trans("FieldsWithAreMandatory", '*') . '
'; + //print $langs->trans("FieldsWithIsForPublic",'**').'
'; -print dol_get_fiche_head(''); + print dol_get_fiche_head(''); -print ''; -print ''."\n"; + print '
' . "\n"; -// Email -print ''."\n"; -// Company -print ''."\n"; -// Address -print ''."\n"; -// Zip / Town -print ''; -// Country -print '' . "\n"; + // Company + print '' . "\n"; + // Address + print '' . "\n"; + // Zip / Town + print ''; + // Country + print ''; -// State -if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; + // State + if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; + } + + print "
'.$langs->trans("Email").'*
'.$langs->trans("Company"); -if (!empty(floatval($project->price_registration))) { - print '*'; -} -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').'*'; -$country_id = GETPOST('country_id'); -if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { - $country_id = getCountry($conf->global->MEMBER_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; + // Email + print '
' . $langs->trans("Email") . '*
' . $langs->trans("Company"); + if (!empty(floatval($project->price_registration))) { + print '*'; + } + 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') . '*'; + $country_id = GETPOST('country_id'); + if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->MEMBER_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); - } else { - print ''; - } + $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); + } else { + print ''; + } + print '
\n"; + + print dol_get_fiche_end(); + + // Save + print '
'; + print ''; + if (!empty($backtopage)) { + print '     '; + } + print '
'; + + + print "\n"; + print "
"; + print ''; } -print "\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/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 6329441778f..43a4b989687 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -405,6 +405,7 @@ if (empty($reshook) && $action == 'add') { $facture->paye = 0; $facture->date = dol_now(); $facture->cond_reglement_id = $contact->cond_reglement_id; + $facture->fk_project = $project->id; if (empty($facture->cond_reglement_id)) { $paymenttermstatic = new PaymentTerm($contact->db); @@ -569,7 +570,7 @@ jQuery(document).ready(function () { print ''."\n"; // Name -print ''; +print ''; print ''; print ''; // Email @@ -577,21 +578,6 @@ print ''."\n"; -// Type of event -print ''."\n"; -print ''; -// Label -print ''."\n"; -print ''."\n"; -// Note -print ''."\n"; -print ''."\n"; -// Start Date -print ''."\n"; -print ''."\n"; -// End Date -print ''."\n"; -print ''."\n"; // Address print ''."\n"; @@ -603,9 +589,8 @@ print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'se print ''; // Country print ''; } +// Type of event +print ''."\n"; +print ''; +// Label +print ''."\n"; +print ''."\n"; +// Note +print ''."\n"; +print ''."\n"; +// Start Date +print ''."\n"; +print ''."\n"; +// End Date +print ''."\n"; +print ''."\n"; + print "
lastname).'" autofocus="autofocus">
'.$langs->trans("Email").'*'.$langs->trans("Company").'*'; print '
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
'.$langs->trans("Label").'*
'.$langs->trans("Note").'*
'.$langs->trans("DateStart").'*
'.$langs->trans("DateEnd").'*
'.$langs->trans("Address").''."\n"; print '
'.$langs->trans('Country'); -if (!empty(floatval($project->price_booth))) { - print '*'; -} +print '*'; + print ''; $country_id = GETPOST('country_id'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { @@ -635,6 +620,22 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { } print '
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
'.$langs->trans("LabelOfBooth").'*
'.$langs->trans("Description").'*
'.$langs->trans("DateStart").'*
'.$langs->trans("DateEnd").'*
\n"; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 00b093ba215..d63f2d2d98d 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -508,11 +508,11 @@ jQuery(document).ready(function () { print ''."\n"; // Last Name -print ''; +print ''; print ''; print ''; // First Name -print ''; +print ''; print ''; print ''; // Email @@ -520,21 +520,6 @@ print ''."\n"; -// Type of event -print ''."\n"; -print ''; -// Label -print ''."\n"; -print ''."\n"; -// Note -print ''."\n"; -print ''."\n"; -// Start Date -print ''."\n"; -print ''."\n"; -// End Date -print ''."\n"; -print ''."\n"; // Address print ''."\n"; @@ -574,6 +559,22 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { } print ''; } +// Type of event +print ''."\n"; +print ''; +// Label +print ''."\n"; +print ''."\n"; +// Note +print ''."\n"; +print ''."\n"; +// Start Date +print ''."\n"; +print ''."\n"; +// End Date +print ''."\n"; +print ''."\n"; + print "
lastname).'" autofocus="autofocus">
firstname).'" autofocus="autofocus">
'.$langs->trans("Email").'*'.$langs->trans("Company").'*'; print '
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
'.$langs->trans("Label").'*
'.$langs->trans("Note").'*
'.$langs->trans("DateStart").'
'.$langs->trans("DateEnd").'
'.$langs->trans("Address").''."\n"; print '
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
'.$langs->trans("LabelOfconference").'*
'.$langs->trans("Description").'*
'.$langs->trans("DateStart").'
'.$langs->trans("DateEnd").'
\n"; From ca53abcef2abe690e5dbd1463e1294f3a210ae35 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 5 Jul 2021 15:35:05 +0200 Subject: [PATCH 06/19] fix email template type --- .../class/conferenceorbooth.class.php | 2 +- htdocs/install/mysql/data/llx_c_email_templates.sql | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 10ed5668c63..bb84bbe37bd 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -108,7 +108,7 @@ class ConferenceOrBooth extends ActionComm 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'1',), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty",), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1::eventorganization', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1,), - 'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1, 'csslist'=>'small'), + 'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1), 'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1,), 'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'2',), 'datep2' => array('type'=>'datetime', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'3',), diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql index acc09bad008..e2b1cd65077 100644 --- a/htdocs/install/mysql/data/llx_c_email_templates.sql +++ b/htdocs/install/mysql/data/llx_c_email_templates.sql @@ -35,9 +35,9 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,

\n\n__(YourCandidatureAnswerMessage)__
__ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); -- Event organization -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationEmailAskConf', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationEmailAskBooth', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationEmailSubsBooth', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__

__(Sincerely)__

__MYCOMPANY_NAME__
__USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationMassEmailAttendees', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__

__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__

__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationEmailAskConf', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationEmailAskBooth', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationEmailSubsBooth', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__

__(Sincerely)__

__MYCOMPANY_NAME__
__USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationMassEmailAttendees', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__

__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__

__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); From 03f8557aaf33e842199a413811eeba2b1bf9efc9 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 5 Jul 2021 15:36:41 +0200 Subject: [PATCH 07/19] fix template email --- htdocs/admin/eventorganization.php | 12 ++++++------ htdocs/public/project/suggestbooth.php | 2 +- htdocs/public/project/suggestconference.php | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index a57df57d782..53d27efeba2 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -54,12 +54,12 @@ $arrayofparameters = array( 'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), //'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), //'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1), - 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), - 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), - 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), - 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), - 'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), - 'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), + 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), + 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), + 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), + 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), + 'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), + 'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), 'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1), 'SERVICE_BOOTH_LOCATION'=>array('type'=>'product', 'enabled'=>1), 'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION'=>array('type'=>'product', 'enabled'=>1), diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 43a4b989687..3ab8e165c7e 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -470,7 +470,7 @@ if (empty($reshook) && $action == 'add') { $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH; if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, ''); } if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index d63f2d2d98d..399969bc80d 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -409,7 +409,7 @@ if (empty($reshook) && $action == 'add') { $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF; if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, ''); } if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { From eea90cef566b3cd234476f59eb8327b328d52c19 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Mon, 5 Jul 2021 16:31:33 +0200 Subject: [PATCH 08/19] FIX: holiday: balances not updated correctly with pgsql because of case sensitivity --- htdocs/holiday/class/holiday.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 2e61c014532..b7a8d41f699 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -2112,7 +2112,7 @@ class Holiday extends CommonObject { global $mysoc; - $sql = "SELECT rowid, code, label, affect, delay, newByMonth"; + $sql = "SELECT rowid, code, label, affect, delay, newbymonth"; $sql .= " FROM ".MAIN_DB_PREFIX."c_holiday_types"; $sql .= " WHERE (fk_country IS NULL OR fk_country = ".$mysoc->country_id.')'; if ($active >= 0) $sql .= " AND active = ".((int) $active); @@ -2126,7 +2126,7 @@ class Holiday extends CommonObject { while ($obj = $this->db->fetch_object($result)) { - $types[$obj->rowid] = array('rowid'=> $obj->rowid, 'code'=> $obj->code, 'label'=>$obj->label, 'affect'=>$obj->affect, 'delay'=>$obj->delay, 'newByMonth'=>$obj->newByMonth); + $types[$obj->rowid] = array('rowid'=> $obj->rowid, 'code'=> $obj->code, 'label'=>$obj->label, 'affect'=>$obj->affect, 'delay'=>$obj->delay, 'newByMonth'=>$obj->newbymonth); } return $types; From d414bcb572f4459a863dcdf05a88f68faedc3793 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Jul 2021 17:08:10 +0200 Subject: [PATCH 09/19] Fix phpcs --- htdocs/core/tpl/objectline_view.tpl.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 3463de14240..444d847e25a 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -314,8 +314,7 @@ if ($outputalsopricetotalwithtax) { $coldisplay++; } -if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') { - +if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlines') { $situationinvoicelinewithparent = 0; if ($line->fk_prev_id != null && in_array($object->element, array('facture', 'facturedet'))) { if ($object->type == $object::TYPE_SITUATION) { // The constant TYPE_SITUATION exists only for object invoice From 407ad4d84d10df206bd8bdf8865c7bb7c4ff93ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Jul 2021 02:15:52 +0200 Subject: [PATCH 10/19] Fix bad value --- htdocs/admin/system/security.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index c4140cfe416..032a23a68c8 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -354,10 +354,10 @@ print '
'; print 'MAIN_ALLOW_SVG_FILES_AS_IMAGES = '.(empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES) ? '0   ('.$langs->trans("Recommanded").': 0)' : $conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES)."
"; print '
'; -print 'MAIN_RESTRICTHTML_ONLY_VALID_HTML = '.(empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommanded").': 1)' : '')."
"; +print 'MAIN_RESTRICTHTML_ONLY_VALID_HTML = '.(empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommanded").': 1)' : $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)."
"; print '
'; -print 'MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommanded").': 1)' : '')."
"; +print 'MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommanded").': 1)' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."
"; print '
'; print 'MAIN_EXEC_USE_POPEN = '; From 61ed899608da89c79fe03536a626a8219bf24c81 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Jul 2021 03:53:42 +0200 Subject: [PATCH 11/19] Fix set discount on line in TakePos --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/takepos/index.php | 1 + htdocs/takepos/invoice.php | 62 ++++++++++++++++++++++--------- 3 files changed, 46 insertions(+), 19 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 93a33e5bd5f..5118392da9a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5497,7 +5497,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer = "", $thirdparty_sell } else { $sql .= " AND t.recuperableonly = '".$db->escape($vatnpr)."'"; } - dol_syslog("get_localtax", LOG_DEBUG); + $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index b182f37f787..7e2a2d5c1e1 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -72,6 +72,7 @@ if ($setterminal > 0) { if ($setcurrency != "") { $_SESSION["takeposcustomercurrency"] = $setcurrency; + // We will recalculate amount for foreign currency at next call of invoice.php when $_SESSION["takeposcustomercurrency"] differs from invoice->multicurrency_code. } $_SESSION["urlfrom"] = '/takepos/index.php'; diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 3f7e63d84cb..3246b24cc5c 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -163,6 +163,14 @@ if ($invoice->socid > 0) { * Actions */ +// Change the currency of invoice if it was modified +if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "") { + if ($invoice->multicurrency_code != $_SESSION["takeposcustomercurrency"]) { + $invoice->setMulticurrencyCode($_SESSION["takeposcustomercurrency"]); + } +} + + // Action to record a payment on a TakePOS invoice if ($action == 'valid' && $user->rights->facture->creer) { $bankaccount = 0; @@ -311,7 +319,7 @@ if ($action == 'valid' && $user->rights->facture->creer) { } } -if ($action == 'creditnote') { +if ($action == 'creditnote' && $user->rights->facture->creer) { $creditnote = new Facture($db); $creditnote->socid = $invoice->socid; $creditnote->date = dol_now(); @@ -459,10 +467,6 @@ if ($action == 'history' || $action == 'creditnote') { $invoice->fetch($placeid); } -if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "") { - $invoice->setMulticurrencyCode($_SESSION["takeposcustomercurrency"]); -} - if (($action == "addline" || $action == "freezone") && $placeid == 0) { $invoice->socid = $conf->global->$constforcompanyid; $invoice->date = dol_now(); @@ -631,8 +635,11 @@ if ($action == "delete") { if ($action == "updateqty") { foreach ($invoice->lines as $line) { if ($line->id == $idline) { - if (!$user->rights->takepos->editlines || (!$user->rights->takepos->editorderedlines && $line->special_code == "4")) dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos"), null, 1); - else $result = $invoice->updateline($line->id, $line->desc, $line->subprice, $number, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); + if (!$user->rights->takepos->editlines || (!$user->rights->takepos->editorderedlines && $line->special_code == "4")) { + dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos"), null, 1); + } else { + $result = $invoice->updateline($line->id, $line->desc, $line->subprice, $number, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); + } } } @@ -640,12 +647,13 @@ if ($action == "updateqty") { } if ($action == "updateprice") { + $customer = new Societe($db); + $customer->fetch($invoice->socid); + foreach ($invoice->lines as $line) { if ($line->id == $idline) { $prod = new Product($db); $prod->fetch($line->fk_product); - $customer = new Societe($db); - $customer->fetch($invoice->socid); $datapriceofproduct = $prod->getSellPrice($mysoc, $customer, 0); $price_min = $datapriceofproduct['price_min']; $usercanproductignorepricemin = ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)); @@ -654,35 +662,52 @@ if ($action == "updateprice") { if ($usercanproductignorepricemin && (!empty($price_min) && (price2num($pu_ht) * (1 - price2num($line->remise_percent) / 100) < price2num($price_min)))) { echo $langs->trans("CantBeLessThanMinPrice"); } else { - if (!$user->rights->takepos->editlines || (!$user->rights->takepos->editorderedlines && $line->special_code == "4")) dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos"), null, 1); - else $result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'TTC', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); + if (empty($user->rights->takepos->editlines) || (empty($user->rights->takepos->editorderedlines) && $line->special_code == "4")) { + dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos"), null, 1); + } else { + $result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'TTC', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); + } } } } + + // Reload data $invoice->fetch($placeid); } if ($action == "updatereduction") { + $customer = new Societe($db); + $customer->fetch($invoice->socid); + foreach ($invoice->lines as $line) { if ($line->id == $idline) { + dol_syslog("updatereduction Process line ".$line->id.' to apply discount of '.$number.'%'); + $prod = new Product($db); $prod->fetch($line->fk_product); - $customer = new Societe($db); - $customer->fetch($invoice->socid); + $datapriceofproduct = $prod->getSellPrice($mysoc, $customer, 0); $price_min = $datapriceofproduct['price_min']; $usercanproductignorepricemin = ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)); - $pu_ht = price2num($line->multicurrency_subprice / (1 + ($line->tva_tx / 100)), 'MU'); - //Check min price - if ($usercanproductignorepricemin && (!empty($price_min) && (price2num($line->multicurrency_subprice) * (1 - price2num($number) / 100) < price2num($price_min)))) { + + $pu_ht = price2num($line->subprice / (1 + ($line->tva_tx / 100)), 'MU'); + + // Check min price + if ($usercanproductignorepricemin && (!empty($price_min) && (price2num($line->subprice) * (1 - price2num($number) / 100) < price2num($price_min)))) { echo $langs->trans("CantBeLessThanMinPrice"); } else { - if (!$user->rights->takepos->editlines || (!$user->rights->takepos->editorderedlines && $line->special_code == "4")) dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos"), null, 1); - else $result = $invoice->updateline($line->id, $line->desc, $line->multicurrency_subprice, $line->qty, $number, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); + if (empty($user->rights->takepos->editlines) || (empty($user->rights->takepos->editorderedlines) && $line->special_code == "4")) { + dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos"), null, 1); + } else { + $result = $invoice->updateline($line->id, $line->desc, $line->subprice, $line->qty, $number, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); + } } } } + + // Reload data $invoice->fetch($placeid); + } elseif ($action == 'update_reduction_global') { foreach ($invoice->lines as $line) { $result = $invoice->updateline($line->id, $line->desc, $line->subprice, $line->qty, $number, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); @@ -709,6 +734,7 @@ if ($action == "order" and $placeid != 0) { $catsprinter1 = explode(';', $conf->global->TAKEPOS_PRINTED_CATEGORIES_1); $catsprinter2 = explode(';', $conf->global->TAKEPOS_PRINTED_CATEGORIES_2); $catsprinter3 = explode(';', $conf->global->TAKEPOS_PRINTED_CATEGORIES_3); + $linestoprint = 0; foreach ($invoice->lines as $line) { if ($line->special_code == "4") { continue; From 555f1c719bd6ea8ef8e700a4b7fdf7cdf7c837c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Jul 2021 04:29:25 +0200 Subject: [PATCH 12/19] Debug v14 --- htdocs/categories/card.php | 3 ++- htdocs/core/boxes/box_graph_nb_tickets_type.php | 13 ++----------- htdocs/core/lib/functions.lib.php | 2 +- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 734f2e89506..141e061ac20 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2017 Laurent Destailleur + * Copyright (C) 2006-2021 Laurent Destailleur * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2013 Florian Henry @@ -257,6 +257,7 @@ if ($user->rights->categorie->creer) { // Parent category print ''.$langs->trans("AddIn").''; + print img_picto($langs->trans("ParentCategory"), 'category', 'class="pictofixedwidth"'); print $form->select_all_categories($type, $catorigin, 'parent'); print ajax_combobox('parent'); print ''; diff --git a/htdocs/core/boxes/box_graph_nb_tickets_type.php b/htdocs/core/boxes/box_graph_nb_tickets_type.php index 86ea5e2a11c..2da54d84e7a 100644 --- a/htdocs/core/boxes/box_graph_nb_tickets_type.php +++ b/htdocs/core/boxes/box_graph_nb_tickets_type.php @@ -69,20 +69,11 @@ class box_graph_nb_tickets_type extends ModeleBoxes global $theme_datacolor, $badgeStatus8; require_once DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"; + require_once DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/theme_vars.inc.php"; - $badgeStatus0 = '#cbd3d3'; // draft - $badgeStatus1 = '#bc9526'; // validated - $badgeStatus1b = '#bc9526'; // validated - $badgeStatus2 = '#9c9c26'; // approved - $badgeStatus3 = '#bca52b'; - $badgeStatus4 = '#25a580'; // Color ok - $badgeStatus4b = '#25a580'; // Color ok - $badgeStatus5 = '#cad2d2'; - $badgeStatus6 = '#cad2d2'; - $badgeStatus7 = '#baa32b'; $badgeStatus8 = '#993013'; - $badgeStatus9 = '#e7f0f0'; + $text = $langs->trans("BoxTicketType"); $this->info_box_head = array( 'text' => $text, diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5118392da9a..44e235bea57 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3983,7 +3983,7 @@ function img_edit($titlealt = 'default', $float = 0, $other = '') * @param string $other Add more attributes on img * @return string Return tag img */ -function img_view($titlealt = 'default', $float = 0, $other = '') +function img_view($titlealt = 'default', $float = 0, $other = 'class="valignmiddle"') { global $langs; From 9a3d2f13a6291cd5d96554e9393b5c8310048b6b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Jul 2021 10:55:23 +0200 Subject: [PATCH 13/19] Fix graph per type of expense report --- htdocs/expensereport/index.php | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index 8198883e58f..4e01cfe7501 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2021 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2015 Alexandre Spangaro @@ -132,6 +132,30 @@ foreach ($listoftype as $code => $label) { $dataseries[] = array($label, (isset($somme[$code]) ? (int) $somme[$code] : 0)); } +// Sort array with most important first +$dataseries = dol_sort_array($dataseries, 1, 'desc'); + +// Merge all entrie after the $KEEPNFIRST one into one entry called "Other..." (to avoid to have too much entries in graphic). +$KEEPNFIRST = 7; // Keep first $KEEPNFIRST one + 1 with the remain +$i = 0; +if (count($dataseries) > ($KEEPNFIRST + 1)) { + foreach($dataseries as $key => $val) { + if ($i < $KEEPNFIRST) { + $i++; + continue; + } + // Here $key = $KEEPNFIRST + $dataseries[$KEEPNFIRST][0] = $langs->trans("Other").'...'; + if ($key == $KEEPNFIRST) { + $i++; + continue; + } + $dataseries[$KEEPNFIRST][1] += $dataseries[$key][1]; + unset($dataseries[$key]); + $i++; + } +} + if ($conf->use_javascript_ajax) { print ''; From 7dab4ef571d226598adf38dbc7f78d198b5c3c03 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Jul 2021 11:18:09 +0200 Subject: [PATCH 14/19] Debug v14 --- htdocs/expensereport/index.php | 8 ++++---- htdocs/hrm/index.php | 6 +++--- htdocs/langs/en_US/boxes.lang | 4 ++-- htdocs/recruitment/recruitmentindex.php | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index 4e01cfe7501..55818721de9 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -245,10 +245,10 @@ if ($result) { $userstatic->photo = $obj->photo; print ''; - print ''.$expensereportstatic->getNomUrl(1).''; - print ''.$userstatic->getNomUrl(-1).''; - print ''.price($obj->total_ht).''; - print ''.price($obj->total_ttc).''; + print ''.$expensereportstatic->getNomUrl(1).''; + print ''.$userstatic->getNomUrl(-1).''; + print ''.price($obj->total_ht).''; + print ''.price($obj->total_ttc).''; print ''.dol_print_date($db->jdate($obj->dm), 'day').''; print ''; print $expensereportstatic->getLibStatut(3); diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 23d0899cc18..fe2c42b0d1b 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -310,11 +310,11 @@ if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->lire) $userstatic->photo = $obj->photo; print ''; - print ''.$expensereportstatic->getNomUrl(1).''; + print ''.$expensereportstatic->getNomUrl(1).''; print ''.$userstatic->getNomUrl(-1).''; - print ''.price($obj->total_ttc).''; + print ''.price($obj->total_ttc).''; print ''.dol_print_date($db->jdate($obj->dm), 'day').''; - print ''.$expensereportstatic->LibStatut($obj->status, 3).''; + print ''.$expensereportstatic->LibStatut($obj->status, 3).''; print ''; $i++; diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index 0c9ea302fb8..710d49bfab6 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -91,8 +91,8 @@ BoxTitleLatestModifiedSupplierOrders=Vendor Orders: last %s modified BoxTitleLastModifiedCustomerBills=Customer Invoices: last %s modified BoxTitleLastModifiedCustomerOrders=Sales Orders: last %s modified BoxTitleLastModifiedPropals=Latest %s modified proposals -BoxTitleLatestModifiedJobPositions=Latest %s modified jobs -BoxTitleLatestModifiedCandidatures=Latest %s modified candidatures +BoxTitleLatestModifiedJobPositions=Latest %s modified job positions +BoxTitleLatestModifiedCandidatures=Latest %s modified job applications ForCustomersInvoices=Customers invoices ForCustomersOrders=Customers orders ForProposals=Proposals diff --git a/htdocs/recruitment/recruitmentindex.php b/htdocs/recruitment/recruitmentindex.php index d3f97e6f3d1..6e9ee616327 100644 --- a/htdocs/recruitment/recruitmentindex.php +++ b/htdocs/recruitment/recruitmentindex.php @@ -183,7 +183,7 @@ if ($conf->use_javascript_ajax) { print '
'; print ''; - print ''."\n"; + print ''."\n"; $listofstatus = array(0, 1, 3, 5, 8, 9); foreach ($listofstatus as $status) { $dataseries[] = array(dol_html_entity_decode($staticrecruitmentcandidature->LibStatut($status, 1), ENT_QUOTES | ENT_HTML5), (isset($vals[$status]) ? (int) $vals[$status] : 0)); From b4b939e1a9b742e30293decc891d6c110fe9663b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Jul 2021 11:54:32 +0200 Subject: [PATCH 15/19] Fix add migration of export/import profile when field name changes --- htdocs/install/default.css | 4 ++ htdocs/install/upgrade2.php | 81 +++++++++++++++++++++++++++++++++ htdocs/langs/en_US/install.lang | 1 + 3 files changed, 86 insertions(+) diff --git a/htdocs/install/default.css b/htdocs/install/default.css index fe85649844d..731ac4131b4 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -80,6 +80,10 @@ div.soustitre { text-align: right; } +.wordbreak { + word-break: break-word; +} + .minwidth100 { min-width: 100px; } .minwidth200 { min-width: 200px; } .minwidth300 { min-width: 300px; } diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index d0d1ae256b4..d69baad5a76 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -448,8 +448,17 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ migrate_contacts_socialnetworks(); migrate_thirdparties_socialnetworks(); } + + // Scripts for 14.0 + $afterversionarray = explode('.', '13.0.9'); + $beforeversionarray = explode('.', '14.0.9'); + if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + migrate_export_import_profiles('export'); + migrate_export_import_profiles('import'); + } } + // Code executed only if migration is LAST ONE. Must always be done. if (versioncompare($versiontoarray, $versionranarray) >= 0 || versioncompare($versiontoarray, $versionranarray) <= -3) { // Reload modules (this must be always done and only into last targeted version, because code to reload module may need table structure of last version) @@ -4904,3 +4913,75 @@ function migrate_thirdparties_socialnetworks() print ''.$langs->trans('MigrationFieldsSocialNetworks', 'Thirdparties')."
\n"; print ''; } + + +/** + * Migrate export and import profiles to fix field name that was renamed + * + * @param string $mode 'export' or 'import' + * @return void + */ +function migrate_export_import_profiles($mode = 'export') +{ + global $db, $langs; + + $error = 0; + $resultstring = ''; + + $db->begin(); + + print '
\n"; + $resqlupd = $db->query($sqlupd); + if (!$resqlupd) { + dol_print_error($db); + $error++; + } + } + } + } else { + $error++; + } + if (!$error) { + $db->commit(); + } else { + dol_print_error($db); + $db->rollback(); + } + print ''.$langs->trans('MigrationImportOrExportProfiles', $mode)."
\n"; + print ''; + + if ($resultstring) { + print $resultstring; + } else { + print '\n"; + } +} + diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang index 63947dad154..c1ffee936d7 100644 --- a/htdocs/langs/en_US/install.lang +++ b/htdocs/langs/en_US/install.lang @@ -206,6 +206,7 @@ MigrationUserPhotoPath=Migration of photo paths for users MigrationFieldsSocialNetworks=Migration of users fields social networks (%s) MigrationReloadModule=Reload module %s MigrationResetBlockedLog=Reset module BlockedLog for v7 algorithm +MigrationImportOrExportProfiles=Migration of import or export profiles (%s) ShowNotAvailableOptions=Show unavailable options HideNotAvailableOptions=Hide unavailable options ErrorFoundDuringMigration=Error(s) were reported during the migration process so next step is not available. To ignore errors, you can click here, but the application or some features may not work correctly until the errors are resolved. From ab14a070644252678ba845785bffa0e07bfc8622 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Jul 2021 11:58:05 +0200 Subject: [PATCH 16/19] Trans --- htdocs/expensereport/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index 55818721de9..c350f3ae2b4 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -145,7 +145,7 @@ if (count($dataseries) > ($KEEPNFIRST + 1)) { continue; } // Here $key = $KEEPNFIRST - $dataseries[$KEEPNFIRST][0] = $langs->trans("Other").'...'; + $dataseries[$KEEPNFIRST][0] = $langs->trans("Others").'...'; if ($key == $KEEPNFIRST) { $i++; continue; From 4c5bb786baf87b8f5fca024a8a3e6e90eff9be0f Mon Sep 17 00:00:00 2001 From: damien clochard Date: Sun, 4 Jul 2021 14:27:51 +0200 Subject: [PATCH 17/19] FIX #18085: Migration 13 to 14 : Explicit cast when changing the type of llx_c_ticket_category.pos --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index a01f589aa20..c10e4aa5282 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -428,6 +428,10 @@ create table llx_eventorganization_conferenceorboothattendee_extrafields ALTER TABLE llx_eventorganization_conferenceorboothattendee_extrafields ADD INDEX idx_conferenceorboothattendee_fk_object(fk_object); ALTER TABLE llx_c_ticket_category ADD COLUMN public integer DEFAULT 0; + +-- VPGSQL8.2 ALTER TABLE llx_c_ticket_category ALTER COLUMN pos TYPE INTEGER USING pos::INTEGER; +-- VPGSQL8.2 ALTER TABLE llx_c_ticket_category ALTER COLUMN pos SET NOT NULL; +-- VPGSQL8.2 ALTER TABLE llx_c_ticket_category ALTER COLUMN pos SET DEFAULT 0; ALTER TABLE llx_c_ticket_category MODIFY COLUMN pos integer DEFAULT 0 NOT NULL; From a2288b9039ebf4076a7ca309e14ffdc021eb3cb5 Mon Sep 17 00:00:00 2001 From: Lenin Rivas <53640168+leninrivas@users.noreply.github.com> Date: Sat, 3 Jul 2021 22:41:16 -0500 Subject: [PATCH 18/19] Update unicode and name of currency --- htdocs/install/mysql/data/llx_c_currencies.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_currencies.sql b/htdocs/install/mysql/data/llx_c_currencies.sql index 478c263af4c..df887d68be7 100644 --- a/htdocs/install/mysql/data/llx_c_currencies.sql +++ b/htdocs/install/mysql/data/llx_c_currencies.sql @@ -7,6 +7,7 @@ -- Copyright (C) 2007 Patrick Raguin -- Copyright (C) 2011 Juanjo Menent -- Copyright (C) 2020 Udo Tamm +-- Copyright (C) 2021 Lenin Rivas -- -- 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 @@ -50,7 +51,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BDT' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BYR', '[112,46]', 1, 'Belarus Ruble'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BZD', '[66,90,36]', 1, 'Belize Dollar'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BMD', '[36]', 1, 'Bermuda Dollar'); -INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BOB', '[36,98]', 1, 'Bolivia Boliviano'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BOB', '[66,115]', 1, 'Bolivia Boliviano'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BAM', '[75,77]', 1, 'Bosnia and Herzegovina Convertible Marka'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BWP', '[80]', 1, 'Botswana Pula'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BGN', '[1083,1074]', 1, 'Bulgaria Lev'); @@ -70,6 +71,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CZK' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'DKK', '[107,114]', 1, 'Denmark Krone'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'DOP', '[82,68,36]', 1, 'Dominican Republic Peso'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XCD', '[36]', 1, 'East Caribbean Dollar'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ECS', '[83,47,46]', 1, 'Ecuador Sucre'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'EGP', '[163]', 1, 'Egypt Pound'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'SVC', '[36]', 1, 'El Salvador Colon'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'EEK', '[107,114]', 1, 'Estonia Kroon'); @@ -126,7 +128,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'OMR' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PKR', '[8360]', 1, 'Pakistan Rupee'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PAB', '[66,47,46]', 1, 'Panama Balboa'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PYG', '[71,115]', 1, 'Paraguay Guarani'); -INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PEN', '[83,47,46]', 1, 'Peru Nuevo Sol'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PEN', '[83,47]', 1, 'PerĂº Sol'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PHP', '[8369]', 1, 'Philippines Peso'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PLN', '[122,322]', 1, 'Poland Zloty'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'QAR', '[65020]', 1, 'Qatar Riyal'); From 3c0e841877f6358f97752ccb3090317ddd603bd3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Jul 2021 15:55:43 +0200 Subject: [PATCH 19/19] Fix function not found --- htdocs/admin/dict.php | 6 +++--- htdocs/core/class/html.formadmin.class.php | 1 + htdocs/core/lib/functions.lib.php | 10 +++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 651f6f61611..a0790ba23fe 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -100,7 +100,7 @@ $hookmanager->initHooks(array('admin')); // Put here declaration of dictionaries properties // Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this. -$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 0, 29, 0, 33, 34, 32, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 15, 30, 0, 37, 42, 0, 43, 0, 25, 0); +$taborder = array(9, 15, 30, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 24, 0, 29, 0, 33, 34, 32, 28, 17, 35, 36, 0, 10, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 37, 42, 0, 43, 0, 25, 0); // Name of SQL tables of dictionaries $tabname = array(); @@ -568,8 +568,8 @@ $tabhelp[43] = array('code'=>$langs->trans("EnterAnyCode")); // Table to store complete informations (will replace all other table). Key is table name. $tabcomplete = array( 'c_forme_juridique'=>array('picto'=>'company'), - 'c_departements'=>array('picto'=>'country'), - 'c_regions'=>array('picto'=>'country'), + 'c_departements'=>array('picto'=>'state'), + 'c_regions'=>array('picto'=>'region'), 'c_country'=>array('picto'=>'country'), 'c_civility'=>array('picto'=>'contact'), 'c_actioncomm'=>array('picto'=>'action'), diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index d45f952d8b2..22af450b997 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -444,6 +444,7 @@ class FormAdmin } $out .= ''; + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; $out .= ajax_combobox($htmlname); return $out; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 44e235bea57..4a15fc26707 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3548,8 +3548,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'github', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies', 'generic', 'home', 'hrm', 'members', 'products', 'invoicing', - 'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'question', 'refresh', 'salary', 'shipment', - 'state', 'supplier_invoice', 'supplier_invoicea', 'supplier_invoicer', 'supplier_invoiced', + 'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'question', 'refresh', 'region', + 'salary', 'shipment', 'state', 'supplier_invoice', 'supplier_invoicea', 'supplier_invoicer', 'supplier_invoiced', 'technic', 'ticket', 'error', 'warning', 'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', @@ -3598,8 +3598,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'partnership'=>'handshake', 'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell', 'recent' => 'question', 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge', 'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature', - 'refresh'=>'redo', 'resource'=>'laptop-house', - 'state'=>'map-marked', 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', + 'refresh'=>'redo', 'region'=>'map-marked', 'resource'=>'laptop-house', + 'state'=>'map-marked-alt', 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', 'supplier'=>'building', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', @@ -3700,7 +3700,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'partnership'=>'#6c6aa8', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'reception'=>'#a69944', 'resize'=>'#444', 'rss'=>'#cba', //'shipment'=>'#a69944', 'security'=>'#999', 'stats'=>'#444', 'switch_off'=>'#999', 'technic'=>'#999', 'timespent'=>'#555', - 'uncheck'=>'#800', 'uparrow'=>'#555', 'user-cog'=>'#999', 'country'=>'#aaa', 'globe-americas'=>'#aaa', 'state'=>'#aaa', + 'uncheck'=>'#800', 'uparrow'=>'#555', 'user-cog'=>'#999', 'country'=>'#aaa', 'globe-americas'=>'#aaa', 'region'=>'#aaa', 'state'=>'#aaa', 'website'=>'#304', 'workstation'=>'#a69944' ); if (isset($arrayconvpictotocolor[$pictowithouttext])) {
'.$langs->trans("Statistics").' - '.$langs->trans("Candidatures").'
'.$langs->trans("Statistics").' - '.$langs->trans("RecruitmentCandidatures").'
'; + $sql = 'SELECT rowid, field'; + if ($mode == 'export') { + $sql .= ', filter'; + } + $sql .= ' FROM '.MAIN_DB_PREFIX.$mode.'_model WHERE'; + $sql .= " type LIKE 'propale_%' OR type LIKE 'commande_%' OR type LIKE 'facture_%'"; + //print $sql; + $resql = $db->query($sql); + if ($resql) { + while ($obj = $db->fetch_object($resql)) { + $oldfield = $obj->field; + $newfield = str_replace(array('f.facnumber,', 'f.total,', 'f.tva,'), array('f.ref,', 'f.total_ht,', 'f.total_tva,'), $oldfield); + + if ($mode == 'export') { + $oldfilter = $obj->filter; + $newfilter = str_replace(array('f.facnumber,', 'f.total,', 'f.tva,'), array('f.ref,', 'f.total_ht,', 'f.total_tva,'), $oldfilter); + } else { + $oldfilter = ''; + $newfilter = ''; + } + + if ($oldfield != $newfield || $oldfilter != $newfilter) { + $sqlupd = 'UPDATE '.MAIN_DB_PREFIX.$mode."_model SET field = '".$db->escape($newfield)."'"; + if ($mode == 'export') { + $sql .= ", filter = '".$db->escape($newfilter)."'"; + } + $sqlupd .= ' WHERE rowid='.$obj->rowid; + $resultstring .= '
'.$sqlupd."
'.$langs->trans("NothingToDo")."