Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2024-02-29 15:48:50 +01:00
commit 4d10fe3bba
13 changed files with 23 additions and 36 deletions

View File

@ -371,7 +371,7 @@ if ($rowid && $action != 'edit') {
// Delete
if ($user->hasRight('adherent', 'cotisation', 'creer')) {
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"]."?rowid=".$object->id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete")."</a></div>\n";
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"]."?rowid=".((int) $object->id).'&action=delete&token='.newToken().'">'.$langs->trans("Delete")."</a></div>\n";
}
print '</div>';

View File

@ -178,7 +178,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
$description = $langs->trans("RulesAmountOnInOutBookkeepingRecord");
$description .= ' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->trans("Chartofaccounts")).')';
$description .= ' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->transnoentitiesnoconv("Chartofaccounts")).')';
$builddate = dol_now();
//$exportlink=$langs->trans("NotYetAvailable");
}

View File

@ -302,7 +302,7 @@ class FormAccounting extends Form
$out .= '</select>';
//if ($user->admin && $help) $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
} else {
$out = $langs->trans("ErrorNoAccountingCategoryForThisCountry", $mysoc->country_code, $langs->trans("Accounting"), $langs->trans("Setup"), $langs->trans("AccountingCategories"));
$out = $langs->trans("ErrorNoAccountingCategoryForThisCountry", $mysoc->country_code, $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("AccountingCategories"));
}
} else {
dol_print_error($this->db);

View File

@ -62,9 +62,9 @@ class modWebhook extends DolibarrModules
$this->name = preg_replace('/^mod/i', '', get_class($this));
// Module description, used if translation string 'ModuleWebhookDesc' not found (Webhook is name of module).
$this->description = "WebhookDescription";
$this->description = "WebHook";
// Used only if file README.md and README-LL.md not found.
$this->descriptionlong = "WebhookDescription";
$this->descriptionlong = "Interface to catch dolibarr triggers and send data of the event to an external URL";
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
$this->version = 'dolibarr';

View File

@ -250,13 +250,15 @@ class InterfaceTicketEmail extends DolibarrTriggers
$linked_contacts = array_merge($linked_contacts, $object->listeContact(-1, 'internal'));
if (empty($linked_contacts) && getDolGlobalString('TICKET_NOTIFY_AT_CLOSING') && !empty($object->fk_soc)) {
$object->fetch_thirdparty();
$linked_contacts[] = $object->thirdparty->email;
$linked_contacts[]['email'] = $object->thirdparty->email;
}
$contactid = empty($object->context['contactid']) ? 0 : $object->context['contactid'];
$res = 0;
if ($contactid > 0) {
// TODO This security test has no sens. We must check that $contactid is inside $linked_contacts[]['id'] when $linked_contacts[]['source'] = 'external' or 'thirdparty'
// Refuse email if not
$contact = new Contact($this->db);
$res = $contact->fetch($contactid);
if (! in_array($contact, $linked_contacts)) {

View File

@ -602,6 +602,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$total = 0;
$total_ttc = 0;
$totalrecu = 0;
$totalrecucreditnote = 0; // PHP Warning: Undefined variable $totalrecucreditnote
$totalrecudeposits = 0; // PHP Warning: Undefined variable $totalrecudeposits
while ($i < $num) {
$objp = $db->fetch_object($resql);

View File

@ -761,7 +761,7 @@ if (!defined('NOLOGIN')) {
// If in demo mode, we check we go to home page through the public/demo/index.php page
if (!empty($dolibarr_main_demo) && $_SERVER['PHP_SELF'] == DOL_URL_ROOT.'/index.php') { // We ask index page
if (empty($_SERVER['HTTP_REFERER']) || !preg_match('/public/', $_SERVER['HTTP_REFERER'])) {
dol_syslog("Call index page from another url than demo page (call is done from page ".$_SERVER['HTTP_REFERER'].")");
dol_syslog("Call index page from another url than demo page (call is done from page ".(empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFER']).")");
$url = '';
$url .= ($url ? '&' : '').($dol_hide_topmenu ? 'dol_hide_topmenu='.$dol_hide_topmenu : '');
$url .= ($url ? '&' : '').($dol_hide_leftmenu ? 'dol_hide_leftmenu='.$dol_hide_leftmenu : '');

View File

@ -1,17 +0,0 @@
--
-- Uncomment and run the script to declare triggers to be used by the agenda module for automatic logging of events into agenda (table llx_actioncomm).
--
-- For example
-- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_DRAFT', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000');
-- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_CREATE', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000');
-- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_VALIDATE', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000');
-- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_MODIFY', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000');
-- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_ACCEPT', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000');
-- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_DENIED', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000');
-- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_REOPEN', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000');
-- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_UNVALIDATE', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000');
-- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_SENTBYMAIL', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000');
--
--ADD Call trigger IN TABLE

View File

@ -4918,8 +4918,8 @@ class Product extends CommonObject
// les prix de fournisseurs.
$sql = "INSERT ".$this->db->prefix()."product_fournisseur_price (";
$sql .= " datec, fk_product, fk_soc, price, quantity, fk_user)";
$sql .= " SELECT '".$this->db->idate($now)."', ".((int) $toId).", fk_soc, price, quantity, fk_user";
$sql .= " datec, fk_product, fk_soc, price, quantity, fk_user, tva_tx)";
$sql .= " SELECT '".$this->db->idate($now)."', ".((int) $toId).", fk_soc, price, quantity, fk_user, tva_tx";
$sql .= " FROM ".$this->db->prefix()."product_fournisseur_price";
$sql .= " WHERE fk_product = ".((int) $fromId);

View File

@ -279,11 +279,11 @@ if ($resql) {
// Label
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->title).'">';
print $projectstatic->title;
print dol_escape_htmltag($projectstatic->title);
print '</td>';
// Thirdparty
print '<td class="nowrap">';
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($companystatic->name).'">';
if ($companystatic->id > 0) {
print $companystatic->getNomUrl(1, 'company', 16);
}
@ -346,7 +346,7 @@ if ($resql) {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print_liste_field_titre("OpenedProjectsByThirdparties", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder);
print_liste_field_titre("NbOfProjects", $_SERVER["PHP_SELF"], "nb", "", "", '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Number", $_SERVER["PHP_SELF"], "nb", "", "", '', $sortfield, $sortorder, 'right ');
print "</tr>\n";
}

View File

@ -1469,8 +1469,8 @@ class Ticket extends CommonObject
// phpcs:enable
global $langs, $hookmanager;
$labelStatus = !empty($status) ? $this->labelStatus[$status] : '';
$labelStatusShort = !empty($status) ? $this->labelStatusShort[$status] : '';
$labelStatus = (isset($status) && !empty($this->labelStatus[$status])) ? $this->labelStatus[$status] : '';
$labelStatusShort = (isset($status) && !empty($this->labelStatusShort[$status]))? $this->labelStatusShort[$status] : '';
switch ($status) {
case self::STATUS_NOT_READ: // Not read

View File

@ -2570,7 +2570,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print '<tr><td class="tdoverflow">'.$form->editfieldkey('State', 'state_id', '', $object, 0).'</td><td>';
if ($caneditfield) {
print img_picto('', 'state', 'class="pictofixedwidth"');
print $formcompany->select_state($object->state_id, $object->country_code, 'state_id');
print $formcompany->select_state_ajax('country_id', $object->state_id, $object->country_id, 'state_id');
} else {
print $object->state;
}

View File

@ -422,11 +422,11 @@ function getSupplierInvoicesForThirdParty($authentication, $idthirdparty)
'ref'=>$invoice->ref,
'ref_supplier'=>$invoice->ref_supplier,
'ref_ext'=>$invoice->ref_ext,
'fk_user_author' => $invoice->fk_user_author,
'fk_user_valid' => $invoice->fk_user_valid,
'fk_thirdparty' => $invoice->fk_soc,
'fk_user_author' => $invoice->user_creation_id,
'fk_user_valid' => $invoice->user_validation_id,
'fk_thirdparty' => $invoice->socid,
'type'=>$invoice->type,
'status'=>$invoice->statut,
'status'=>$invoice->status,
'total_net'=>$invoice->total_ht,
'total_vat'=>$invoice->total_tva,
'total'=>$invoice->total_ttc,