Merge branch 'develop' into 20_css_1

This commit is contained in:
Alexandre SPANGARO 2023-12-18 05:04:01 +01:00
commit 148ab759d3
48 changed files with 168 additions and 82 deletions

View file

@ -254,6 +254,44 @@ The following changes may create regressions for some external modules, but were
* A very high number of class properties (with old name in french) are now deprecated in favor of the property name in english.
***** ChangeLog for 18.0.4 compared to 18.0.3 *****
FIX: $this->newref already exists and could have been modified by trigger but we still use a local variable for the filesystem-based renaming
FIX: 16.0 only, backport fix for SQL error on global search product
FIX: #25399 (#26694)
FIX: #25458 intervention localizations (backport v17) (#26757)
FIX: #26518
FIX: #26536 Accountancy - Balance - Not divided lines by label & account, only by account (#26547)
FIX: #26553 Supplier invoice - Do not display the delete button for reconciled payment (#26554)
FIX: #26735
FIX: #26994
FIX: Accountancy - Possibility to write in bookkeeping expense report operation with some line not bound (#26545)
FIX: add display of an error when attempting to delete a committed transaction (#26573)
FIX: avoid warning : Cannot use a scalar value as an array (#26437)
FIX: backport SQL error on global search product
FIX: # Bug Estimated Stock at date value in V14 (#26479)
FIX: commande context (#26497)
FIX: delivery note disappear after generation
FIX: double hook and paging search param in product list (#26767)
FIX: Email reminder template must not be visible when option is off
FIX: escape HTML tags in return value of getFullName() (#26735)
FIX: Fix set private note (#26610)
FIX: Fix when options FAC_FORCE_DATE_VALIDATION and INVOICE_CHECK_POSTERIOR_DATE enabled. The date is forced after the test and not before
FIX: menu auguria
FIX: pagination parameters on save and cancel buttons (#26605)
FIX: pdf cornas page head multicell width (backport v17)
FIX: php8 fatal on edit supplier order when multicurrency is activated (#26758)
FIX: possible inconsistency between llx_ecm_files and file system when BILL_SUPPLIER_VALIDATES changes ref
FIX: regression on planned bank entries (#26556)
FIX: Social contribution - Payment list - Wrong information in type column (#26561)
FIX: special_code update line keep old value. (#26819)
FIX: substitute project variables in invoice documents (#26445)
FIX: Test on permission for holiday tooltips
FIX: v17: Param $notrigger in $societe->create() causes method to return true regardless of actual result of database functions (#26499)
FIX: v18 SQL error in llx_c_forme_juridique.sql when installing
FIX: Warehouse Global Amounts not displayed (#26478)
FIX: warning param $lineID getSpecialCode is negatif (#26826)
FIX: warning php8.2 undefined_array_key (#26830)
***** ChangeLog for 18.0.3 compared to 18.0.2 *****
FIX: #25793 Cannot add time spent (#26405)
FIX: #26100 Ticket - On edit, list of closed project must be excluded (#26223)

View file

@ -148,8 +148,8 @@ $sqls=array(
"DELETE FROM ".MAIN_DB_PREFIX."product where datec < '__DATE__'",
),
'project'=>array(
// TODO set fk_project to null on object that refer to project
"DELETE FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_task IN (select rowid FROM ".MAIN_DB_PREFIX."projet_task WHERE fk_projet IN (select rowid FROM ".MAIN_DB_PREFIX."projet where datec < '__DATE__'))",
// TODO set fk_project to null on all objects/tables that refer to project
"DELETE FROM ".MAIN_DB_PREFIX."element_time WHERE elementtype = 'task' AND fk_element IN (select rowid FROM ".MAIN_DB_PREFIX."projet_task WHERE fk_projet IN (select rowid FROM ".MAIN_DB_PREFIX."projet where datec < '__DATE__'))",
"DELETE FROM ".MAIN_DB_PREFIX."projet_task WHERE fk_projet IN (select rowid FROM ".MAIN_DB_PREFIX."projet where datec < '__DATE__')",
"DELETE FROM ".MAIN_DB_PREFIX."projet where datec < '__DATE__'",
),

View file

@ -103,6 +103,7 @@ class GlobalToFunction extends AbstractRector
if ($node instanceof FuncCall) {
$tmpfunctionname = $this->getName($node);
// If function is ok(we must avoid a lot of cases like isset, empty)
if (in_array($tmpfunctionname, array('dol_escape_htmltag', 'make_substitutions', 'min', 'max', 'explode'))) {
$args = $node->getArgs();
$nbofparam = count($args);

View file

@ -533,8 +533,6 @@ class AccountingJournal extends CommonObject
$element_link = $element_static->getNomUrl(1, 'with_label');
$element_name_formatted_0 = dol_trunc($element_static->label, 16);
$element_name_formatted_1 = utf8_decode(dol_trunc($element_static->label, 32));
$element_name_formatted_2 = utf8_decode(dol_trunc($element_static->label, 16));
$label_operation = $element_static->getNomUrl(0, 'label', 16);
$element = array(

View file

@ -75,8 +75,13 @@ if ($reshook < 0) {
if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|| ($action == 'updateedit')) {
$tmparray = getCountry(GETPOST('country_id', 'int'), 'all', $db, $langs, 0);
$tmparray = getCountry(GETPOSTINT('country_id'), 'all', $db, $langs, 0);
if (!empty($tmparray['id'])) {
if ($tmparray['code'] == 'FR' && $tmparray['id'] != $mysoc->country_id) {
// For FR, default value of option to show profid SIREN is on by default
$res = dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", 1, 'chaine', 0, '', $conf->entity);
}
$mysoc->country_id = $tmparray['id'];
$mysoc->country_code = $tmparray['code'];
$mysoc->country_label = $tmparray['label'];

View file

@ -559,7 +559,7 @@ class Boms extends DolibarrApi
*
* @return void
*/
private function checkRefNumbering(): void
private function checkRefNumbering()
{
$ref = substr($this->bom->ref, 1, 4);
if ($this->bom->status > 0 && $ref == 'PROV') {

View file

@ -62,7 +62,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
$product_static->getNomUrl(1);
}
print '</td>';
echo '<td class="linkedcol-date">'.dol_print_date($objectlink->date_creation, 'day').'</td>';
echo '<td class="linkedcol-date center">'.dol_print_date($objectlink->date_creation, 'day').'</td>';
echo '<td class="linkedcol-amount right">';
if ($user->hasRight('commande', 'lire')) {
$total = $total + $objectlink->total_ht;

View file

@ -138,7 +138,7 @@ print '</div><div class="fichetwothirdright">';
$NBMAX = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT
// Last modified myobject

View file

@ -7,7 +7,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify

View file

@ -575,6 +575,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
/* The fast and low memory method to get and count full list converts the sql into a sql count */
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
$resql = $db->query($sqlforcount);
if ($resql) {
$objforcount = $db->fetch_object($resql);

View file

@ -64,7 +64,7 @@ if (isset($user->socid) && $user->socid > 0) {
}
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
$maxofloop = (!getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
$now = dol_now();

View file

@ -206,11 +206,18 @@ if (empty($reshook)) {
} elseif ($action == 'reopen' && $usercancreate) {
// Reopen a closed order
if ($object->statut == Commande::STATUS_CANCELED || $object->statut == Commande::STATUS_CLOSED) {
$result = $object->set_reopen($user);
if ($result > 0) {
setEventMessages($langs->trans('OrderReopened', $object->ref), null);
if (dolGetGlobalInt('ORDER_REOPEN_TO_DRAFT')) {
$result = $object->setDraft($user, $idwarehouse);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
} else {
setEventMessages($object->error, $object->errors, 'errors');
$result = $object->set_reopen($user);
if ($result > 0) {
setEventMessages($langs->trans('OrderReopened', $object->ref), null);
} else {
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
} elseif ($action == 'confirm_delete' && $confirm == 'yes' && $usercandelete) {

View file

@ -56,7 +56,7 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
// Maximum elements of the tables
$maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;

View file

@ -701,6 +701,15 @@ class Account extends CommonObject
}
// Load librairies to check BAN
$balance = $this->balance;
if (empty($balance) && !empty($this->solde)) {
$balance = $this->solde;
}
if (empty($balance)) {
$balance = 0;
}
// Load the library to validate/check a BAN account
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
$now = dol_now();
@ -779,7 +788,7 @@ class Account extends CommonObject
$accline = new AccountLine($this->db);
$accline->datec = $now;
$accline->label = '('.$langs->trans("InitialBankBalance").')';
$accline->amount = price2num($this->solde);
$accline->amount = price2num($balance);
$accline->fk_user_author = $user->id;
$accline->fk_account = $this->id;
$accline->datev = $this->date_solde;

View file

@ -41,7 +41,7 @@ if (isset($user->socid) && $user->socid > 0) {
$socid = $user->socid;
}
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
// Maximum elements of the tables
$maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? $max : $conf->global->MAIN_MAXLIST_OVERLOAD;

View file

@ -925,6 +925,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
/* The fast and low memory method to get and count full list converts the sql into a sql count */
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
$resql = $db->query($sqlforcount);
if ($resql) {
$objforcount = $db->fetch_object($resql);

View file

@ -67,7 +67,7 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
// Maximum elements of the tables
$maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;

View file

@ -102,6 +102,7 @@ class box_funnel_of_prospection extends ModeleBoxes
$sql .= " FROM ".MAIN_DB_PREFIX."c_lead_status as cls";
$sql .= " WHERE active=1";
$sql .= " AND cls.code <> 'LOST'";
$sql .= " AND cls.code <> 'WON'";
$sql .= $this->db->order('cls.rowid', 'ASC');
$resql = $this->db->query($sql);
if ($resql) {
@ -126,9 +127,6 @@ class box_funnel_of_prospection extends ModeleBoxes
case 'NEGO':
$colorseriesstat[$objp->rowid] = $badgeStatus4;
break;
case 'WON':
$colorseriesstat[$objp->rowid] = $badgeStatus6;
break;
default:
break;
}
@ -152,7 +150,7 @@ class box_funnel_of_prospection extends ModeleBoxes
$sql .= " WHERE p.entity IN (".getEntity('project').")";
$sql .= " AND p.fk_opp_status = cls.rowid";
$sql .= " AND p.fk_statut = 1"; // Opend projects only
$sql .= " AND cls.code NOT IN ('LOST')";
$sql .= " AND cls.code NOT IN ('LOST', 'WON')";
$sql .= " GROUP BY p.fk_opp_status, cls.code";
$resql = $this->db->query($sql);
@ -236,6 +234,7 @@ class box_funnel_of_prospection extends ModeleBoxes
$dolgraph->setShowPercent(1);
$dolgraph->setMirrorGraphValues(true);
$dolgraph->setBorderWidth(2);
$dolgraph->setBorderSkip('false');
$dolgraph->SetType(array('horizontalbars'));
$dolgraph->SetHeight('200');
$dolgraph->SetWidth('600');

View file

@ -167,8 +167,9 @@ abstract class CommonObject
* @var CommonObject To store a cloned copy of object before to edit it and keep track of old properties
*/
public $oldcopy;
/**
* @var CommonObject To store old value of a modified ref
* @var string To store old value of a modified ref
*/
public $oldref;

View file

@ -94,6 +94,7 @@ class DolGraph
public $bgcolorgrid = array(255, 255, 255); // array(R,G,B)
public $datacolor; // array(array(R,G,B),...)
public $borderwidth = 1;
public $borderskip = 'start';
private $stringtoshow; // To store string to output graph into HTML page
@ -311,6 +312,18 @@ class DolGraph
$this->borderwidth = $borderwidth;
}
/**
* Set border skip
*
* @param int $borderskip Can be 'start' to skip start border, 'end' to skip end border, 'middle' to skip middle border,
* 'false' to not skip any border, 'true' to skip all border
* @return void
*/
public function setBorderSkip($borderskip)
{
$this->borderskip = $borderskip;
}
/**
* Set tooltips labels of the graph
*
@ -1483,6 +1496,7 @@ class DolGraph
$this->stringtoshow .= 'borderWidth: \''.$this->borderwidth.'\', ';
}
$this->stringtoshow .= 'borderColor: \'' . $bordercolor . '\', ';
$this->stringtoshow .= 'borderSkipped: \'' . $this->borderskip . '\', ';
$this->stringtoshow .= 'backgroundColor: \'' . $color . '\', ';
if (!empty($arrayofgroupslegend) && !empty($arrayofgroupslegend[$i])) {
$this->stringtoshow .= 'stack: \'' . $arrayofgroupslegend[$i]['stacknum'] . '\', ';

View file

@ -1532,7 +1532,7 @@ class FormTicket
$ticketstat->socid = $ticketstat->fk_soc;
$ticketstat->fetch_thirdparty();
if (is_array($ticketstat->thirdparty->email) && !in_array($ticketstat->thirdparty->email, $sendto)) {
if (!empty($ticketstat->thirdparty->email) && !in_array($ticketstat->thirdparty->email, $sendto)) {
$sendto[] = $ticketstat->thirdparty->email.' <small class="opacitymedium">('.$langs->trans('Customer').')</small>';
}
}

View file

@ -1584,7 +1584,7 @@ function show_actions_todo($conf, $langs, $db, $filterobj, $objcon = '', $noprin
* @param mixed $filterobj Filter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket... to list events linked to an object
* @param Contact $objcon Filter on object contact to filter events on a contact
* @param int $noprint Return string but does not output it
* @param string $actioncode Filter on actioncode
* @param string|string[] $actioncode Filter on actioncode
* @param string $donetodo Filter on event 'done' or 'todo' or ''=nofilter (all).
* @param array $filters Filter on other fields
* @param string $sortfield Sort field
@ -1810,13 +1810,10 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$sql .= ' AND (';
foreach ($actioncode as $key => $code) {
if ($key != 0) {
$sql .= "OR (";
$sql .= " OR ";
}
if (!empty($code)) {
addEventTypeSQL($sql, $code);
}
if ($key != 0) {
$sql .= ")";
addEventTypeSQL($sql, $code, "");
}
}
$sql .= ')';
@ -2284,7 +2281,7 @@ function show_subsidiaries($conf, $langs, $db, $object)
$socstatic->name_alias = $obj->name_alias;
$socstatic->email = $obj->email;
$socstatic->code_client = $obj->code_client;
$socstatic->code_fournisseur = $obj->code_client;
$socstatic->code_fournisseur = $obj->code_fournisseur;
$socstatic->code_compta = $obj->code_compta;
$socstatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
$socstatic->email = $obj->email;
@ -2334,19 +2331,19 @@ function addEventTypeSQL(&$sql, $actioncode, $sqlANDOR = "AND")
if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
if ($actioncode == 'AC_NON_AUTO') {
$sql .= " $sqlANDOR c.type != 'systemauto'";
$sql .= " $sqlANDOR c.type <> 'systemauto'";
} elseif ($actioncode == 'AC_ALL_AUTO') {
$sql .= " $sqlANDOR c.type = 'systemauto'";
} else {
if ($actioncode == 'AC_OTH') {
$sql .= " $sqlANDOR c.type != 'systemauto'";
$sql .= " $sqlANDOR c.type <> 'systemauto'";
} elseif ($actioncode == 'AC_OTH_AUTO') {
$sql .= " $sqlANDOR c.type = 'systemauto'";
}
}
} else {
if ($actioncode == 'AC_NON_AUTO') {
$sql .= " $sqlANDOR c.type != 'systemauto'";
$sql .= " $sqlANDOR c.type <> 'systemauto'";
} elseif ($actioncode == 'AC_ALL_AUTO') {
$sql .= " $sqlANDOR c.type = 'systemauto'";
} else {

View file

@ -6,6 +6,7 @@
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2023 William Mead <william.mead@manchenumerique.fr>
*
* 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
@ -1197,9 +1198,9 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$pdf->SetTextColor(0, 0, 60);
$pdf->SetFont('', 'B', $default_font_size + 3);
$w = 100;
$w = 110;
$posx = $this->page_largeur - $this->marge_droite - 100;
$posx = $this->page_largeur - $this->marge_droite - $w;
$posy = $this->marge_haute;
$pdf->SetXY($this->marge_gauche, $posy);

View file

@ -148,7 +148,7 @@ print '</div><div class="fichetwothirdright">';
$NBMAX = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT
// Last modified myobject

View file

@ -638,7 +638,7 @@ if (empty($reshook)) {
$emailTo = $destinataire->email;
// CC
$emailCC = $conf->global->NDF_CC_EMAILS;
$emailCC = getDolGlobalString('NDF_CC_EMAILS');
if (empty($emailTo)) {
$emailTo = $emailCC;
}
@ -646,7 +646,7 @@ if (empty($reshook)) {
// FROM
$expediteur = new User($db);
$expediteur->fetch($object->fk_user_approve > 0 ? $object->fk_user_approve : $object->fk_user_validator);
$emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
$emailFrom = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
if ($emailFrom && $emailTo) {
$filename = array();
@ -654,9 +654,9 @@ if (empty($reshook)) {
$mimetype = array();
// SUBJECT
$societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
$societeName = getDolGlobalString('MAIN_INFO_SOCIETE_NOM');
if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
$societeName = $conf->global->MAIN_APPLICATION_TITLE;
$societeName = getDolGlobalString('MAIN_APPLICATION_TITLE');
}
$subject = $societeName." - ".$langs->transnoentities("ExpenseReportApproved");

View file

@ -235,7 +235,7 @@ class SupplierInvoices extends DolibarrApi
}
if ($this->invoice->create(DolibarrApiAccess::$user) < 0) {
throw new RestException(500, "Error creating order", array_merge(array($this->invoice->error), $this->invoice->errors));
throw new RestException(500, "Error creating invoice ", array_merge(array($this->invoice->error), $this->invoice->errors));
}
return $this->invoice->id;
}

View file

@ -1916,19 +1916,18 @@ class FactureFournisseur extends CommonInvoice
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
$oldref = dol_sanitizeFileName($this->ref);
$newref = dol_sanitizeFileName($num);
$dirsource = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id, 2, 0, 0, $this, 'invoice_supplier').$oldref;
$dirdest = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id, 2, 0, 0, $this, 'invoice_supplier').$newref;
$dirdest = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id, 2, 0, 0, $this, 'invoice_supplier').$this->newref;
if (!$error && file_exists($dirsource)) {
dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest);
if (@rename($dirsource, $dirdest)) {
dol_syslog("Rename ok");
// Rename docs starting with $oldref with $newref
$listoffiles = dol_dir_list($conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id, 2, 0, 0, $this, 'invoice_supplier').$newref, 'files', 1, '^'.preg_quote($oldref, '/'));
// Rename docs starting with $oldref with $this->newref
$listoffiles = dol_dir_list($conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id, 2, 0, 0, $this, 'invoice_supplier').$this->newref, 'files', 1, '^'.preg_quote($oldref, '/'));
foreach ($listoffiles as $fileentry) {
$dirsource = $fileentry['name'];
$dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource);
$dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $this->newref, $dirsource);
$dirsource = $fileentry['path'].'/'.$dirsource;
$dirdest = $fileentry['path'].'/'.$dirdest;
@rename($dirsource, $dirdest);

View file

@ -38,7 +38,7 @@ if (isset($user->socid) && $user->socid > 0) {
$socid = $user->socid;
}
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
// Maximum elements of the tables
$maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;

View file

@ -20,7 +20,7 @@
*/
/**
* \file class/skill.class.php
* \file htdocs/hrm/class/skill.class.php
* \ingroup hrm
* \brief This file is a CRUD class file for Skill (Create/Read/Update/Delete)
*/
@ -244,14 +244,14 @@ class Skill extends CommonObject
* createSkills
*
* @param int $i Rank from which we want to create skilldets (level $i to HRM_MAXRANK wil be created)
* @return null
* @return int Return integer <0 if KO, Id of created object if OK
*/
public function createSkills($i = 1)
{
global $conf, $user, $langs;
$MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : self::DEFAULT_MAX_RANK_PER_SKILL;
$defaultSkillDesc = getDolGlobalString('HRM_DEFAULT_SKILL_DESCRIPTION') ? $conf->global->HRM_DEFAULT_SKILL_DESCRIPTION : $langs->trans("NoDescription");
$MaxNumberSkill = getDolGlobalInt('HRM_MAXRANK', self::DEFAULT_MAX_RANK_PER_SKILL);
$defaultSkillDesc = getDolGlobalString('HRM_DEFAULT_SKILL_DESCRIPTION', $langs->trans("NoDescription"));
$error = 0;

View file

@ -72,7 +72,7 @@ if (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') || !getDolGlobalString('MAIN_IN
$setupcompanynotcomplete = 1;
}
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
/*
@ -90,6 +90,8 @@ if (isModEnabled('holiday') && !empty($setupcompanynotcomplete)) {
* View
*/
$listofsearchfields = array();
$childids = $user->getAllChildIds();
$childids[] = $user->id;
@ -187,7 +189,7 @@ print '</div><div class="fichetwothirdright">';
// Latest leave requests
// Latest modified leave requests
if (isModEnabled('holiday') && $user->hasRight('holiday', 'read')) {
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.photo, u.statut as user_status,";
$sql .= " x.rowid, x.ref, x.fk_type, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.tms as dm, x.statut as status";
@ -271,7 +273,7 @@ if (isModEnabled('holiday') && $user->hasRight('holiday', 'read')) {
}
// Latest expense report
// Latest modified expense report
if (isModEnabled('expensereport') && $user->hasRight('expensereport', 'read')) {
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.statut as user_status, u.photo,";
$sql .= " x.rowid, x.ref, x.date_debut as date, x.tms as dm, x.total_ttc, x.fk_statut as status";
@ -406,7 +408,7 @@ if (isModEnabled('recruitment') && $user->hasRight('recruitment', 'recruitmentjo
$db->free($resql);
} else {
print '<tr class="oddeven"><td colspan="4" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
print '<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
}
print "</table>";
print "</div>";

View file

@ -110,7 +110,7 @@ insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '229', 'VS
-- France: Catégories niveau II - Extrait de https://www.insee.fr/fr/information/2028129 - Dernière mise à jour Septembre 2022
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'00','Organisme de placement collectif en valeurs mobilières sans personnalité morale');
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'09','Organisme de placement collectif en valeurs mobilières sans personnalité morale');
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'10','Entrepreneur individuel');
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'21','Indivision');
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'22','Société créée de fait');

View file

@ -79,3 +79,4 @@ WeAreRecruiting=We are recruiting. This is a list of open positions to be filled
NoPositionOpen=No positions open at the moment
ConfirmClose=Confirm cancellation
ConfirmCloseAsk=Are you sure you want to cancel this recruitment candidature
recruitment=Recruitment

View file

@ -219,10 +219,6 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) {
// For DE, we need to invert our address with customer address
$conf->global->MAIN_INVERT_SENDER_RECIPIENT = 1;
}
if ($mysoc->country_code == 'FR' && !isset($conf->global->MAIN_PROFID1_IN_ADDRESS)) {
// For FR, default value of option to show profid SIRET is on by default. Decret n°2099-1299 2022-10-07
$conf->global->MAIN_PROFID1_IN_ADDRESS = 1;
}
if ($mysoc->country_code == 'FR' && !isset($conf->global->INVOICE_CATEGORY_OF_OPERATION)) {
// For FR, default value of option to show category of operations is on by default. Decret n°2099-1299 2022-10-07
$conf->global->INVOICE_CATEGORY_OF_OPERATION = 1;
@ -249,6 +245,7 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) {
// Invoice subtype is a requirement for Greece.
$conf->global->INVOICE_SUBTYPE_ENABLED = 1;
}
if (($mysoc->localtax1_assuj || $mysoc->localtax2_assuj) && !isset($conf->global->MAIN_NO_INPUT_PRICE_WITH_TAX)) {
// For countries using the 2nd or 3rd tax, we disable input/edit of lines using the price including tax (because 2nb and 3rd tax not yet taken into account).
// Work In Progress to support all taxes into unit price entry when MAIN_UNIT_PRICE_WITH_TAX_IS_FOR_ALL_TAXES is set.

View file

@ -299,7 +299,6 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql = preg_replace('/,\s*$/', '', $sql);
//$sql .= ", COUNT(rc.rowid) as anotherfield";
$sqlfields = $sql; // $sql fields to remove for count total
@ -388,6 +387,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
/* The fast and low memory method to get and count full list converts the sql into a sql count */
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
$resql = $db->query($sqlforcount);
if ($resql) {
$objforcount = $db->fetch_object($resql);

View file

@ -4788,8 +4788,8 @@ class Product extends CommonObject
// phpcs:enable
$this->db->begin();
$sql = 'INSERT INTO '.$this->db->prefix().'product_association (fk_product_pere, fk_product_fils, qty)';
$sql .= " SELECT ".$toId.", fk_product_fils, qty FROM ".$this->db->prefix()."product_association";
$sql = 'INSERT INTO '.$this->db->prefix().'product_association (fk_product_pere, fk_product_fils, qty, incdec)';
$sql .= " SELECT ".$toId.", fk_product_fils, qty, incdec FROM ".$this->db->prefix()."product_association";
$sql .= " WHERE fk_product_pere = ".((int) $fromId);
dol_syslog(get_class($this).'::clone_association', LOG_DEBUG);

View file

@ -47,7 +47,7 @@ class Inventory extends CommonObject
public $table_element = 'inventory';
/**
* @var array Does inventory support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
* @var int Does inventory support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
public $ismultientitymanaged = 1;
@ -789,7 +789,7 @@ class InventoryLine extends CommonObjectLine
public $table_element = 'inventorydet';
/**
* @var array Does inventory support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
* @var int Does inventory support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
public $ismultientitymanaged = 0;

View file

@ -229,6 +229,9 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql = preg_replace('/,\s*$/', '', $sql);
$sqlfields = $sql;
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
@ -317,7 +320,9 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
}
}*/
/* The fast and low memory method to get and count full list converts the sql into a sql count */
$sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql);
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
$resql = $db->query($sqlforcount);
if ($resql) {
$objforcount = $db->fetch_object($resql);

View file

@ -158,6 +158,11 @@ if (empty($reshook)) {
// Add new contact
if ($action == 'addcontact_confirm' && $user->hasRight('projet', 'creer')) {
if (GETPOST('confirm', 'alpha') == 'no') {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
$contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));

View file

@ -60,7 +60,7 @@ if (!$user->hasRight('projet', 'lire')) {
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
/*

View file

@ -86,7 +86,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$object = new ActionComm($db);
// Not older than
if (!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) {
if (empty($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) {
$conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY = 100; // default limit
}

View file

@ -330,7 +330,7 @@ print '</div><div class="fichetwothirdright">';
$NBMAX = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
// Last modified job position
if (isModEnabled('recruitment') && $user->hasRight('recruitment', 'recruitmentjobposition', 'read')) {
@ -393,7 +393,7 @@ if (isModEnabled('recruitment') && $user->hasRight('recruitment', 'recruitmentjo
$db->free($resql);
} else {
print '<tr class="oddeven"><td colspan="4" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
print '<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
}
print "</table>";
print "</div>";
@ -459,7 +459,7 @@ if (isModEnabled('recruitment') && $user->hasRight('recruitment', 'recruitmentjo
$db->free($resql);
} else {
print '<tr class="oddeven"><td colspan="4" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
print '<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
}
print "</table>";
print "</div>";

View file

@ -1775,7 +1775,7 @@ class Societe extends CommonObject
global $langs;
global $conf;
if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($barcode) && empty($idprof1) && empty($idprof2) && empty($idprof3) && empty($idprof4) && empty($idprof5) && empty($idprof6) && empty($email)) {
if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($barcode) && empty($idprof1) && empty($idprof2) && empty($idprof3) && empty($idprof4) && empty($idprof5) && empty($idprof6) && empty($email) && empty($ref_alias)) {
return -1;
}

View file

@ -266,12 +266,12 @@ if (empty($reshook)) {
$object->login = GETPOST("login", 'alphanohtml');
$object->api_key = GETPOST("api_key", 'alphanohtml');
$object->gender = GETPOST("gender", 'aZ09');
$object->admin = GETPOST("admin", 'int');
$object->admin = GETPOSTINT("admin");
$object->address = GETPOST('address', 'alphanohtml');
$object->zip = GETPOST('zipcode', 'alphanohtml');
$object->town = GETPOST('town', 'alphanohtml');
$object->country_id = GETPOST('country_id', 'int');
$object->state_id = GETPOST('state_id', 'int');
$object->country_id = GETPOSTINT('country_id');
$object->state_id = GETPOSTINT('state_id');
$object->office_phone = GETPOST("office_phone", 'alphanohtml');
$object->office_fax = GETPOST("office_fax", 'alphanohtml');
$object->user_mobile = GETPOST("user_mobile", 'alphanohtml');
@ -314,7 +314,7 @@ if (empty($reshook)) {
$object->dateendvalidity = $dateendvalidity;
$object->birth = $dateofbirth;
$object->fk_warehouse = GETPOST('fk_warehouse', 'int');
$object->fk_warehouse = GETPOSTINT('fk_warehouse');
$object->lang = GETPOST('default_lang', 'aZ09');

View file

@ -81,6 +81,11 @@ class User extends CommonObject
public $id = 0;
/**
* @var User old copy of User
*/
public $oldcopy;
/**
* @var int
* @deprecated

View file

@ -315,7 +315,7 @@ class UserBankAccount extends Account
$country_code_in_EEC = getCountriesInEEC();
return in_array($this->country_code, $country_code_in_EEC);
} else {
return -1;
return false;
}
}
}

View file

@ -144,7 +144,7 @@ print '</div><div class="fichetwothirdright">';
$NBMAX = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT
// Last modified myobject

View file

@ -868,7 +868,7 @@ class WebsitePage extends CommonObject
$now = dol_now();
$this->fk_website = '';
$this->fk_website = 0;
$this->type_container = 'page';
$this->pageurl = 'specimen';
$this->aliasalt = 'specimenalt';
@ -879,7 +879,7 @@ class WebsitePage extends CommonObject
$this->allowed_in_frames = 1;
$this->htmlheader = '';
$this->content = '<html><body>This is a html content</body></html>';
$this->status = '';
$this->status = self::STATUS_DRAFT;
$this->grabbed_from = '';
$this->date_creation = $now - (24 * 30 * 3600);
$this->date_modification = $now - (24 * 7 * 3600);

View file

@ -4808,7 +4808,7 @@ if ($mode == 'replacesite' || $massaction == 'replace') {
print '</td>';
// Categories - Tags
print '<td>';
print '<td class="center">';
if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) {
// Get current categories
$existing = $c->containing($answerrecord->id, Categorie::TYPE_WEBSITE_PAGE, 'object');