mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-04 23:25:16 +01:00
Merge branch 'develop' into patch-10
This commit is contained in:
@@ -3066,18 +3066,6 @@ parameters:
|
||||
count: 8
|
||||
path: ../../htdocs/bom/tpl/objectline_view.tpl.php
|
||||
|
||||
-
|
||||
message: '#^If condition is always false\.$#'
|
||||
identifier: if.alwaysFalse
|
||||
count: 1
|
||||
path: ../../htdocs/bookcal/availabilities_agenda.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always false\.$#'
|
||||
identifier: booleanNot.alwaysFalse
|
||||
count: 1
|
||||
path: ../../htdocs/bookcal/availabilities_agenda.php
|
||||
|
||||
-
|
||||
message: '#^If condition is always false\.$#'
|
||||
identifier: if.alwaysFalse
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2022 Alice Adminson <aadminson@example.com>
|
||||
/* Copyright (C) 2017-2024 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -93,16 +92,8 @@ if ($id > 0 || !empty($ref)) {
|
||||
$upload_dir = $conf->bookcal->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
|
||||
}
|
||||
|
||||
// There is several ways to check permission.
|
||||
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||
$enablepermissioncheck = 0;
|
||||
if ($enablepermissioncheck) {
|
||||
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
|
||||
$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write');
|
||||
} else {
|
||||
$permissiontoread = 1;
|
||||
$permissiontoadd = 1;
|
||||
}
|
||||
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
|
||||
$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write');
|
||||
|
||||
// Security check (enable the most restrictive one)
|
||||
//if ($user->socid > 0) accessforbidden();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2022 Alice Adminson <aadminson@example.com>
|
||||
/* Copyright (C) 2007-2024 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -58,16 +57,8 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||
|
||||
// There is several ways to check permission.
|
||||
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||
$enablepermissioncheck = 0;
|
||||
if ($enablepermissioncheck) {
|
||||
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
|
||||
$permission = $user->hasRight('bookcal', 'availabilities', 'write');
|
||||
} else {
|
||||
$permissiontoread = 1;
|
||||
$permission = 1;
|
||||
}
|
||||
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
|
||||
$permission = $user->hasRight('bookcal', 'availabilities', 'write');
|
||||
|
||||
// Security check (enable the most restrictive one)
|
||||
//if ($user->socid > 0) accessforbidden();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2022 Alice Adminson <aadminson@example.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
/* Copyright (C) 2007-2024 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -85,16 +84,8 @@ if ($id > 0 || !empty($ref)) {
|
||||
$upload_dir = $conf->bookcal->multidir_output[$object->entity ? $object->entity : $conf->entity]."/availabilities/".get_exdir(0, 0, 0, 1, $object);
|
||||
}
|
||||
|
||||
// There is several ways to check permission.
|
||||
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||
$enablepermissioncheck = 0;
|
||||
if ($enablepermissioncheck) {
|
||||
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
|
||||
$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
|
||||
} else {
|
||||
$permissiontoread = 1;
|
||||
$permissiontoadd = 1;
|
||||
}
|
||||
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
|
||||
$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
|
||||
|
||||
// Security check (enable the most restrictive one)
|
||||
//if ($user->socid > 0) accessforbidden();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2022 Alice Adminson <aadminson@example.com>
|
||||
/* Copyright (C) 2007-2024 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -60,19 +59,9 @@ if ($id > 0 || !empty($ref)) {
|
||||
$upload_dir = $conf->bookcal->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
|
||||
}
|
||||
|
||||
|
||||
// There is several ways to check permission.
|
||||
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||
$enablepermissioncheck = 0;
|
||||
if ($enablepermissioncheck) {
|
||||
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
|
||||
$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write');
|
||||
$permissionnote = $user->hasRight('bookcal', 'availabilities', 'write'); // Used by the include of actions_setnotes.inc.php
|
||||
} else {
|
||||
$permissiontoread = 1;
|
||||
$permissiontoadd = 1;
|
||||
$permissionnote = 1;
|
||||
}
|
||||
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
|
||||
$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write');
|
||||
$permissionnote = $user->hasRight('bookcal', 'availabilities', 'write'); // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
// Security check (enable the most restrictive one)
|
||||
//if ($user->socid > 0) accessforbidden();
|
||||
|
||||
@@ -915,7 +915,7 @@ if ($object->fetch($id) >= 0) {
|
||||
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="center">';
|
||||
print '<td class="center nowraponall">';
|
||||
print '<!-- ID mailing_cibles = '.$obj->rowid.' -->';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
@@ -926,7 +926,7 @@ if ($object->fetch($id) >= 0) {
|
||||
}
|
||||
if ($obj->status == $object::STATUS_DRAFT) { // Not sent yet
|
||||
if ($user->hasRight('mailing', 'creer')) {
|
||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&rowid='.((int) $obj->rowid).$param.'">'.img_delete($langs->trans("RemoveRecipient")).'</a>';
|
||||
print '<a class="reposition marginleftonly" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&rowid='.((int) $obj->rowid).$param.'">'.img_delete($langs->trans("RemoveRecipient")).'</a>';
|
||||
}
|
||||
}
|
||||
/*if ($obj->status == -1) // Sent with error
|
||||
@@ -977,14 +977,14 @@ if ($object->fetch($id) >= 0) {
|
||||
|
||||
// Date last update
|
||||
print '<td class="center nowraponall">';
|
||||
print dol_print_date(dol_stringtotime($obj->tms), 'dayhour');
|
||||
print dol_print_date($db->jdate($obj->tms), 'dayhour', 'tzuserrel');
|
||||
print '</td>';
|
||||
|
||||
// Date sent
|
||||
print '<td class="center nowraponall">';
|
||||
if ($obj->status != $object::STATUS_DRAFT) { // If status of target line is not draft
|
||||
// Date sent
|
||||
print $obj->date_envoi; // @TODO Must store date in date format
|
||||
print dol_print_date($db->jdate($obj->date_envoi), 'dayhour', 'tzuserrel'); // @TODO Must store date in date format
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@@ -999,11 +999,11 @@ if ($object->fetch($id) >= 0) {
|
||||
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="center">';
|
||||
print '<td class="center nowraponall">';
|
||||
print '<!-- ID mailing_cibles = '.$obj->rowid.' -->';
|
||||
if ($obj->status == $object::STATUS_DRAFT) { // If status of target line is not sent yet
|
||||
if ($user->hasRight('mailing', 'creer')) {
|
||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&rowid='.((int) $obj->rowid).$param.'">'.img_delete($langs->trans("RemoveRecipient")).'</a>';
|
||||
print '<a class="reposition marginleftonly" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&rowid='.((int) $obj->rowid).$param.'">'.img_delete($langs->trans("RemoveRecipient")).'</a>';
|
||||
}
|
||||
}
|
||||
/*if ($obj->status == -1) // Sent with error
|
||||
|
||||
@@ -204,8 +204,8 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
|
||||
$sql .= " AND tva.entity = " . $conf->entity;
|
||||
if ($year > 0) {
|
||||
$sql .= " AND (";
|
||||
// Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance,
|
||||
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
|
||||
// We'll use the specified period as the date filter, unless it's missing, in which case we'll use the due date.
|
||||
// This is to handle situations where the period was optional.
|
||||
$sql .= " (tva.datev IS NOT NULL AND tva.datev between '" . $db->idate(dol_get_first_day($year)) . "' AND '" . $db->idate(dol_get_last_day($year)) . "')";
|
||||
$sql .= " OR (tva.datev IS NULL AND tva.datev between '" . $db->idate(dol_get_first_day($year)) . "' AND '" . $db->idate(dol_get_last_day($year)) . "')";
|
||||
$sql .= ")";
|
||||
|
||||
@@ -1960,11 +1960,14 @@ class CMailFile
|
||||
// Check response from Server
|
||||
if ($_retVal = $this->server_parse($socket, "220")) {
|
||||
$_retVal = $socket;
|
||||
} else {
|
||||
$this->error = ($this->error ? $this->error." - " : "")."Succeed in opening socket but answer 220 not received";
|
||||
}
|
||||
} else {
|
||||
$this->error = utf8_check('Error '.$errno.' - '.$errstr) ? 'Error '.$errno.' - '.$errstr : mb_convert_encoding('Error '.$errno.' - '.$errstr, 'UTF-8', 'ISO-8859-1');
|
||||
}
|
||||
}
|
||||
|
||||
return $_retVal;
|
||||
}
|
||||
|
||||
|
||||
@@ -1500,9 +1500,9 @@ class ExtraFields
|
||||
$sqlwhere .= ' AND entity = '.((int) $conf->entity);
|
||||
}
|
||||
$sql .= $sqlwhere;
|
||||
//print $sql;
|
||||
|
||||
$sql .= $this->db->order(implode(',', $fields_label));
|
||||
//print $sql;
|
||||
|
||||
dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
Reference in New Issue
Block a user