diff --git a/ChangeLog b/ChangeLog index 18e2b1cdc72..3c92aa71c1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -32,6 +32,48 @@ Following changes may create regressions for some external modules, but were nec * Tables llx_prelevement_facture and llx_prelevement_facture_demande have been renamed into llx_prelevement and llx_prelevement_demande. + +***** ChangeLog for 16.0.2 compared to 16.0.1 ***** + +FIX: 16.0 - computed extrafields are not displayed if the object has no other extrafields +FIX: #22538 +FIX: Accountancy - Review of Winfic - eWinfic - Winsis compta export format +FIX: add loadRoleMode on getlinearray +FIX: Autosearch on takepos was broken +FIX: avoid access forbidden with numeric ref +FIX: avoid error, check of product fetch is already check before +FIX: avoid error, fetch of product is mandatory (by id or by ref) +FIX: avoid unnecessary multiple calculation (#22637) +FIX: bug on selected value for select_bom() function +FIX: can not set prospect status "Do not contact" +FIX: change in the communication status of the prospect +FIX: check $id, already checked before +FIX: closed warehouse for shipping +FIX: extrafields_add tpl for stock movement +FIX: the request SQL for transversal user, the join on usergroup table must be with getEntity('usergroup') +FIX: Import of contact when there is duplicate thirdparties +FIX: Import of socialnetwork field +FIX: input selector is wrong with PRODUCT_LOAD_EXTRAFIELD_INTO_OBJECTLINES usage +FIX: install wizard error management +FIX: just add integer +FIX: Missing $object for online signature link build +FIX: missing quote +FIX: only modify hidden checkbox/multislected extrafields on update if they are provided in request +FIX: php doc +FIX: private message ticket become public if edit action +FIX: remove > 0 and -1 +FIX: remove db object to avoid error with postgresql +FIX: Search ambigous field on MO list +FIX: Search on social networks +FIX: Subscription must be stopped when max of attendees reached. +FIX: supplier price update: missing error reporting +FIX: travis & stickler feedbacks +FIX: we must be able to select only bom of a specific product + several fixes on select_bom() function +FIX: wrong perm check +FIX: wrong typo, remove quote +FIX: wrong var typo + + ***** ChangeLog for 16.0.1 compared to 16.0.0 ***** FIX: #16476 on massaction the pdf generation is not using the t… diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 8236b83eb3d..385c105451e 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -247,6 +247,20 @@ if ($action == 'setdisablebindingonexpensereports') { } } +if ($action == 'setenablelettering') { + $setenablelettering = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_LETTERING", $setenablelettering, 'yesno', 0, '', $conf->entity); + if (!($res > 0)) { + $error++; + } + + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'mesgs'); + } +} + /* * View @@ -466,6 +480,27 @@ print ''; print ''; +// Lettering params +print ''; +print ''; +print ''; +print "\n"; + +print ''; +print ''; +if (!empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) { + print ''; +} else { + print ''; +} +print ''; + +print '
'.$langs->trans('Options').' '.$langs->trans('Lettering').'
'.$langs->trans("ACCOUNTING_ENABLE_LETTERING").''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print '
'; + print '
'; print ''; diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index bd7d6273848..628dceafd12 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -113,15 +113,17 @@ if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_S '; } - print load_fiche_titre($langs->trans("AccountancyArea"), $resultboxes['selectboxlist'], 'accountancy', 0, '', '', $showtutorial); + if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_SITUATION == 1) { + print info_admin($langs->trans("SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices")); + print "
"; + } + print '
'; // hideobject is to start hidden print "
\n"; print ''.$langs->trans("AccountancyAreaDescIntro")."
\n"; if ($user->hasRight('accounting', 'chartofaccount')) { - print "
\n"; print "
\n"; - print load_fiche_titre(' '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n"; print '
'; print "
\n"; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 5c099922af4..3a2f4c40750 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -1034,7 +1034,7 @@ if (empty($action) || $action == 'view') { $title = $langs->trans("GenerationOfAccountingEntries").' - '.$accountingjournalstatic->getNomUrl(0, 2, 1, '', 1); - llxHeader('', $title); + llxHeader('', dol_string_nohtmltag($title)); $nom = $title; $builddate = dol_now(); diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 7db2df72979..68e7ebda6ae 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -498,7 +498,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! if (empty($action) || $action == 'view') { $title = $langs->trans("GenerationOfAccountingEntries").' - '.$accountingjournalstatic->getNomUrl(0, 2, 1, '', 1); - llxHeader('', $title); + llxHeader('', dol_string_nohtmltag($title)); $nom = $title; $nomlink = ''; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index c3592b8c9de..248b0e41267 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -758,7 +758,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! if (empty($action) || $action == 'view') { $title = $langs->trans("GenerationOfAccountingEntries").' - '.$accountingjournalstatic->getNomUrl(0, 2, 1, '', 1); - llxHeader('', $title); + llxHeader('', dol_string_nohtmltag($title)); $nom = $title; $nomlink = ''; diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 7ae8b3ca1c0..624b5a22335 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -701,7 +701,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! if (empty($action) || $action == 'view') { $title = $langs->trans("GenerationOfAccountingEntries").' - '.$accountingjournalstatic->getNomUrl(0, 2, 1, '', 1); - llxHeader('', $title); + llxHeader('', dol_string_nohtmltag($title)); $nom = $title; $nomlink = ''; diff --git a/htdocs/accountancy/journal/variousjournal.php b/htdocs/accountancy/journal/variousjournal.php index f822daa540c..b58953043ff 100644 --- a/htdocs/accountancy/journal/variousjournal.php +++ b/htdocs/accountancy/journal/variousjournal.php @@ -187,7 +187,7 @@ if ($object->nature == 2) { $title = $langs->trans("GenerationOfAccountingEntries") . ' - ' . $object->getNomUrl(0, 2, 1, '', 1); -llxHeader('', $title); +llxHeader('', dol_string_nohtmltag($title)); $nom = $title; $nomlink = ''; diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index ccdbedc1f89..d903bc2d32f 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -1,9 +1,9 @@ - * Copyright (C) 2004-2008 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2015-2018 Alexandre Spangaro +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2011-2013 Juanjo Menent + * Copyright (C) 2015-2022 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 @@ -22,7 +22,7 @@ /** * \file htdocs/admin/taxes.php * \ingroup tax - * \brief Page de configuration du module tax + * \brief Page to setup module tax */ // Load Dolibarr environment @@ -116,6 +116,8 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_INFO_VAT_RETURN", GETPOST("MAIN_INFO_VAT_RETURN", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_TVA_DAY_DEADLINE_SUBMISSION", GETPOST("deadline_day_vat", 'int'), 'chaine', 0, '', $conf->entity); + if (!$error) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); @@ -179,6 +181,10 @@ if (empty($mysoc->tva_assuj)) { } print ''; + print ''; + print ''; + print ''; + print ''; print '
'; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index f4b7f1b2bfb..a133e3cc314 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1317,7 +1317,7 @@ class ActionComm extends CommonObject dol_syslog(get_class()."::getActions", LOG_DEBUG); require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; - $hookmanager = new HookManager($db); + $hookmanager = new HookManager($this->db); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('agendadao')); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index d9b7147fefa..68e078bd5ef 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3347,7 +3347,7 @@ class Propal extends CommonObject public function LibStatut($status, $mode = 1) { // phpcs:enable - global $conf; + global $conf, $hookmanager; // Init/load array of translation of status if (empty($this->labelStatus) || empty($this->labelStatusShort)) { @@ -3378,6 +3378,14 @@ class Propal extends CommonObject $statusType = 'status6'; } + + $parameters = array('status' => $status, 'mode' => $mode); + $reshook = $hookmanager->executeHooks('LibStatut', $parameters, $this); // Note that $action and $object may have been modified by hook + + if ($reshook > 0) { + return $hookmanager->resPrint; + } + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index d3fbe41312c..99a8e31521c 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3626,7 +3626,7 @@ class Commande extends CommonOrder public function LibStatut($status, $billed, $mode, $donotshowbilled = 0) { // phpcs:enable - global $langs, $conf; + global $langs, $conf, $hookmanager; $billedtext = ''; if (empty($donotshowbilled)) { @@ -3674,6 +3674,19 @@ class Commande extends CommonOrder $mode = 0; } + $parameters = array( + 'status' => $status, + 'mode' => $mode, + 'billed' => $billed, + 'donotshowbilled' => $donotshowbilled + ); + + $reshook = $hookmanager->executeHooks('LibStatut', $parameters, $this); // Note that $action and $object may have been modified by hook + + if ($reshook > 0) { + return $hookmanager->resPrint; + } + return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode, '', array('tooltip' => $labelTooltip)); } diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 02d4215b963..b83c30d15b6 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1323,6 +1323,60 @@ if (!$error && ($action == 'setsupervisor' && $confirm == 'yes') && $permissiont } } +if (!$error && ($action == 'affectuser' && $confirm == 'yes') && $permissiontoadd) { + $db->begin(); + + $usertoaffect=GETPOST('usertoaffect'); + $projectrole=GETPOST('projectrole'); + $tasksrole=GETPOST('tasksrole'); + if (!empty($usertoaffect)) { + foreach ($toselect as $toselectid) { + $result = $object->fetch($toselectid); + //var_dump($contcats);exit; + if ($result > 0) { + $res = $object->add_contact($usertoaffect, $projectrole, 'internal'); + if ($res >= 0) { + $taskstatic = new Task($db); + $task_array = $taskstatic->getTasksArray(0, 0, $object->id, 0, 0); + + foreach ($task_array as $task) { + $tasksToAffect = new Task($db); + $result = $tasksToAffect->fetch($task->id); + if ($result > 0) { + $res = $tasksToAffect->add_contact($usertoaffect, $tasksrole, 'internal'); + if ($res < 0) { + setEventMessages($tasksToAffect->error, $tasksToAffect->errors, 'errors'); + } + } + } + $nbok++; + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + } else { + setEventMessages($object->error, $object->errors, 'errors'); + $error++; + break; + } + } + } else { + setEventMessage('UserNotFound', 'errors'); + $error++; + } + + if (!$error) { + if ($nbok > 1) { + setEventMessages($langs->trans("RecordsModified", $nbok), null); + } else { + setEventMessages($langs->trans("RecordsModified", $nbok), null); + } + $db->commit(); + $toselect=array(); + } else { + $db->rollback(); + } +} + if (!$error && ($massaction == 'enable' || ($action == 'enable' && $confirm == 'yes')) && $permissiontoadd) { $db->begin(); diff --git a/htdocs/core/ajax/check_notifications.php b/htdocs/core/ajax/check_notifications.php index f48cb9bffe5..344a2b19229 100644 --- a/htdocs/core/ajax/check_notifications.php +++ b/htdocs/core/ajax/check_notifications.php @@ -128,7 +128,7 @@ if (empty($_SESSION['auto_check_events_not_before']) || $time >= $_SESSION['auto $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_reminder as ar ON a.id = ar.fk_actioncomm AND ar.fk_user = '.((int) $user->id); $sql .= ' WHERE a.code <> "AC_OTH_AUTO"'; $sql .= ' AND ('; - $sql .= " (ar.typeremind = 'browser' AND ar.dateremind < '".$db->idate(dol_now())."' AND ar.status = 0 AND ar.entity = ".$conf->entity; + $sql .= " ar.typeremind = 'browser' AND ar.dateremind < '".$db->idate(dol_now())."' AND ar.status = 0 AND ar.entity = ".$conf->entity; $sql .= ' )'; } else { $sql .= ' JOIN '.MAIN_DB_PREFIX.'actioncomm_reminder as ar ON a.id = ar.fk_actioncomm AND ar.fk_user = '.((int) $user->id); diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 6fa218d4970..b586c69d464 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -584,7 +584,7 @@ abstract class CommonInvoice extends CommonObject public function LibStatut($paye, $status, $mode = 0, $alreadypaid = -1, $type = -1) { // phpcs:enable - global $langs; + global $langs, $hookmanager; $langs->load('bills'); if ($type == -1) { @@ -634,6 +634,22 @@ abstract class CommonInvoice extends CommonObject } } + $parameters = array( + 'status' => $status, + 'mode' => $mode, + 'paye' => $paye, + 'alreadypaid' => $alreadypaid, + 'type' => $type + ); + + $reshook = $hookmanager->executeHooks('LibStatut', $parameters, $this); // Note that $action and $object may have been modified by hook + + if ($reshook > 0) { + return $hookmanager->resPrint; + } + + + return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode); } diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index f43faf02c6c..1d7af10ef14 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1270,7 +1270,7 @@ class FormTicket // Define output language $outputlangs = $langs; $newlang = ''; - if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($this->param['langsmodels'])) { $newlang = $this->param['langsmodels']; } if (!empty($newlang)) { @@ -1281,7 +1281,7 @@ class FormTicket // Get message template for $this->param["models"] into c_email_templates $arraydefaultmessage = -1; - if ($this->param['models'] != 'none') { + if (isset($this->param['models']) && $this->param['models'] != 'none') { $model_id = 0; if (array_key_exists('models_id', $this->param)) { $model_id = (int) $this->param["models_id"]; @@ -1323,7 +1323,7 @@ class FormTicket // Define output language $outputlangs = $langs; $newlang = ''; - if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($this->param['langsmodels'])) { $newlang = $this->param['langsmodels']; } if (!empty($newlang)) { @@ -1380,7 +1380,12 @@ class FormTicket print ''; print ''; print ''; - print ''; + if (!empty($this->trackid)) { + print ''; + } else { + print ''; + $keytoavoidconflict = empty($this->track_id) ? '' : '-'.$this->track_id; // track_id instead of trackid + } foreach ($this->param as $key => $value) { print ''; } @@ -1392,7 +1397,7 @@ class FormTicket $arraydefaultmessage = $formmail->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs, $model_id); } - $result = $formmail->fetchAllEMailTemplate($this->param["models"], $user, $outputlangs); + $result = $formmail->fetchAllEMailTemplate(!empty($this->param["models"]) ? $this->param["models"] : "", $user, $outputlangs); if ($result < 0) { setEventMessages($this->error, $this->errors, 'errors'); } @@ -1404,7 +1409,7 @@ class FormTicket print ''; // External users can't send message email - if ($user->rights->ticket->write && !$user->socid) { + if ($user->hasRight("ticket", "write") && !$user->socid) { $ticketstat = new Ticket($this->db); $res = $ticketstat->fetch('', '', $this->track_id); @@ -1559,7 +1564,7 @@ class FormTicket // Deal with format differences between message and signature (text / HTML) if (dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__USER_SIGNATURE__'])) { $this->substit['__USER_SIGNATURE__'] = dol_nl2br($this->substit['__USER_SIGNATURE__']); - } elseif (!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__USER_SIGNATURE__'])) { + } elseif (!dol_textishtml($defaultmessage) && isset($this->substit['__USER_SIGNATURE__']) && dol_textishtml($this->substit['__USER_SIGNATURE__'])) { $defaultmessage = dol_nl2br($defaultmessage); } if (GETPOSTISSET("message") && !GETPOST('modelselected')) { @@ -1572,7 +1577,7 @@ class FormTicket } print ''; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 3a6adeb6c20..6c195c16704 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1666,7 +1666,7 @@ class Ticket extends CommonObject */ public function loadCacheMsgsTicket() { - if (is_array($this->cache_msgs_ticket) && count($this->cache_msgs_ticket)) { + if (!empty($this->cache_msgs_ticket) && is_array($this->cache_msgs_ticket) && count($this->cache_msgs_ticket)) { return 0; } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 6e21c91d810..d49f810f915 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -717,6 +717,7 @@ class User extends CommonObject 'shipping' => 'expedition', 'task' => 'task@projet', 'fichinter' => 'ficheinter', + 'propale' => 'propal', 'inventory' => 'stock', 'invoice' => 'facture', 'invoice_supplier' => 'fournisseur',
'; print $langs->trans("InitialMessage"); print ''; - if ($user->rights->ticket->manage) { + if ($user->hasRight("ticket", "manage")) { print ''.img_edit($langs->trans('Modify')).''; } print '