Skip to content

Commit

Permalink
Merge branch 'develop' into mailing
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic34 authored Nov 13, 2024
2 parents f2aa552 + b1e3830 commit e346bc0
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 26 deletions.
10 changes: 5 additions & 5 deletions htdocs/bookmarks/list.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2005-2022 Laurent Destailleur <[email protected]>
* Copyright (C) 2024 Alexandre Spangaro <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
*
* 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
Expand Down Expand Up @@ -415,12 +415,12 @@
$candelete = $permissiontodelete;

// Title
print '<td class="tdoverflowmax200" alt="'.dol_escape_htmltag($title).'">';
print '<td class="tdoverflowmax250" alt="'.dol_escape_htmltag($title).'">';
print dol_escape_htmltag($title);
print "</td>\n";

// Url
print '<td class="tdoverflowmax200">';
print '<td class="tdoverflowmax250">';
if (empty($linkintern)) {
print img_picto('', 'url', 'class="pictofixedwidth"');
print '<a class="" href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
Expand All @@ -433,7 +433,7 @@
print "</td>\n";

// Target
print '<td class="tdoverflowmax100 center">';
print '<td class="tdoverflowmax125 center">';
if ($obj->target == 0) {
print $langs->trans("BookmarkTargetReplaceWindowShort");
}
Expand All @@ -443,7 +443,7 @@
print "</td>\n";

// Author
print '<td class="tdoverflowmax100 center">';
print '<td class="tdoverflowmax125 center">';
if ($obj->fk_user > 0) {
if (empty($conf->cache['users'][$obj->fk_user])) {
$tmpuser = new User($db);
Expand Down
3 changes: 2 additions & 1 deletion htdocs/compta/facture/class/facture.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,8 @@ public function create(User $user, $notrigger = 0, $forceduedate = 0)

$this->note_private = (isset($this->note_private) ? trim($this->note_private) : '');
$this->note = (isset($this->note) ? trim($this->note) : $this->note_private); // deprecated
$this->note_public = trim($this->note_public);
$this->note_public = (isset($this->note_public) ? trim($this->note_public) : '');

Check failure on line 498 in htdocs/compta/facture/class/facture.class.php

View workflow job for this annotation

GitHub Actions / phpstan

Ignored error pattern #^Property CommonObject\:\:\$note_public \(string\) in isset\(\) is not nullable\.$# (isset.property) in path /home/runner/work/dolibarr/dolibarr/htdocs/compta/facture/class/facture.class.php is expected to occur 2 times, but occurred 3 times.

Check failure on line 498 in htdocs/compta/facture/class/facture.class.php

View workflow job for this annotation

GitHub Actions / phpstan / php-stan (8.2)

Ignored error pattern #^Property CommonObject\:\:\$note_public \(string\) in isset\(\) is not nullable\.$# (isset.property) in path /home/runner/work/dolibarr/dolibarr/htdocs/compta/facture/class/facture.class.php is expected to occur 2 times, but occurred 3 times.

if (!$this->cond_reglement_id) {
$this->cond_reglement_id = 0;
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/class/html.formfile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ public function form_attach_new_file($url, $title = '', $addcancel = 0, $section
$menudolibarrsetupmax = $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Security");

$tooltiptext = $langs->trans("ThisLimitIsDefinedInSetupAt", $menudolibarrsetupmax, $max, $maxphptoshowparam, $maxphptoshow);
if (getDolGlobalString('MAIN_USE_FULL_TEXT_INDEXATION')) {
$tooltiptext .= '<br><br>Option to extract the file content in text to save it in database is ON <span class="opacitymedium">('.getDolGlobalString('MAIN_USE_FULL_TEXT_INDEXATION').')</span>';
if (getDolGlobalString('MAIN_SAVE_FILE_CONTENT_AS_TEXT')) {
$tooltiptext .= '<br><br>Option to extract the file content in text to save it in database is ON <span class="opacitymedium">('.getDolGlobalString('MAIN_SAVE_FILE_CONTENT_AS_TEXT').')</span>';
}

$out .= ' ';
Expand Down
10 changes: 5 additions & 5 deletions htdocs/core/lib/files.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2181,11 +2181,11 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo
}

// Use a convertisser Doc to Text
$useFullTextIndexation = getDolGlobalString('MAIN_USE_FULL_TEXT_INDEXATION');
$useFullTextIndexation = getDolGlobalString('MAIN_SAVE_FILE_CONTENT_AS_TEXT');
if (empty($useFullTextIndexation) && $forceFullTextIndexation == '1') {
if (getDolGlobalString('MAIN_USE_FULL_TEXT_INDEXATION_PDFTOTEXT')) {
if (getDolGlobalString('MAIN_SAVE_FILE_CONTENT_AS_TEXT_PDFTOTEXT')) {
$useFullTextIndexation = 'pdftotext';
} elseif (getDolGlobalString('MAIN_USE_FULL_TEXT_INDEXATION_DOCLING')) {
} elseif (getDolGlobalString('MAIN_SAVE_FILE_CONTENT_AS_TEXT_DOCLING')) {
$useFullTextIndexation = 'docling';
}
}
Expand Down Expand Up @@ -2213,7 +2213,7 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo

// We also exclude '/temp/' dir and 'documents/admin/documents'
// We make escapement here and call executeCLI without escapement because we don't want to have the '*.log' escaped.
$cmd = getDolGlobalString('MAIN_USE_FULL_TEXT_INDEXATION_PDFTOTEXT', 'pdftotext')." -htmlmeta '".escapeshellcmd($filetoprocess)."' - ";
$cmd = getDolGlobalString('MAIN_SAVE_FILE_CONTENT_AS_TEXT_PDFTOTEXT', 'pdftotext')." -htmlmeta '".escapeshellcmd($filetoprocess)."' - ";
$resultexec = $utils->executeCLI($cmd, $outputfile, 0, null, 1);

if (!$resultexec['error']) {
Expand All @@ -2239,7 +2239,7 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo

// We also exclude '/temp/' dir and 'documents/admin/documents'
// We make escapement here and call executeCLI without escapement because we don't want to have the '*.log' escaped.
$cmd = getDolGlobalString('MAIN_USE_FULL_TEXT_INDEXATION_DOCLING', 'docling')." --from pdf --to text '".escapeshellcmd($filetoprocess)."'";
$cmd = getDolGlobalString('MAIN_SAVE_FILE_CONTENT_AS_TEXT_DOCLING', 'docling')." --from pdf --to text '".escapeshellcmd($filetoprocess)."'";
$resultexec = $utils->executeCLI($cmd, $outputfile, 0, null, 1);

if (!$resultexec['error']) {
Expand Down
16 changes: 8 additions & 8 deletions htdocs/ecm/class/ecmfiles.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class EcmFiles extends CommonObject
'fullpath_orig' => array('type' => 'varchar(750)', 'label' => 'FullPathOrig', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,'comment' => "full path of original filename, when file is uploaded from a local computer"),
'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'visible' => 0, 'position' => 110),
'keywords' => array('type' => 'varchar(750)', 'label' => 'Keywords', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,'comment' => "list of keywords, separated with comma. Must be limited to most important keywords."),
'content' => array('type' => 'html', 'label' => 'Content', 'enabled' => 'getDolGlobalString("MAIN_USE_FULL_TEXT_INDEXATION")', 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax200', 'help' => "Text content of file", 'showoncombobox' => 2, 'validate' => 1,'comment' => "Text content if option to store txt content was set."),
'content' => array('type' => 'html', 'label' => 'Content', 'enabled' => 'getDolGlobalString("MAIN_SAVE_FILE_CONTENT_AS_TEXT")', 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax200', 'help' => "Text content of file", 'showoncombobox' => 2, 'validate' => 1,'comment' => "Text content if option to store txt content was set."),
'cover' => array('type' => 'text', 'label' => 'Cover', 'enabled' => 1, 'visible' => 0, 'position' => 130, 'comment' => "is this file a file to use for a cover"),
'position' => array('type' => 'integer', 'label' => 'Position', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 140, 'index' => 1, 'comment' => "position of file among others"),
'gen_or_uploaded' => array('type' => 'varchar(12)', 'label' => 'GenOrUpload', 'enabled' => 1, 'position' => 150, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,'comment' => "'generated' or 'uploaded'"),
Expand Down Expand Up @@ -317,7 +317,7 @@ public function create(User $user, $notrigger = 0)
$sql .= 'fullpath_orig,';
$sql .= 'description,';
$sql .= 'keywords,';
if (getDolGlobalString("MAIN_USE_FULL_TEXT_INDEXATION")) {
if (getDolGlobalString("MAIN_SAVE_FILE_CONTENT_AS_TEXT")) {
$sql .= 'content,';
}
$sql .= 'cover,';
Expand All @@ -341,7 +341,7 @@ public function create(User $user, $notrigger = 0)
$sql .= ' '.(!isset($this->fullpath_orig) ? 'NULL' : "'".$this->db->escape($this->fullpath_orig)."'").',';
$sql .= ' '.(!isset($this->description) ? 'NULL' : "'".$this->db->escape($this->description)."'").',';
$sql .= ' '.(!isset($this->keywords) ? 'NULL' : "'".$this->db->escape($this->keywords)."'").',';
if (getDolGlobalString("MAIN_USE_FULL_TEXT_INDEXATION")) {
if (getDolGlobalString("MAIN_SAVE_FILE_CONTENT_AS_TEXT")) {
$sql .= ' '.(!isset($this->content) ? 'NULL' : "'".$this->db->escape($this->content)."'").',';
}
$sql .= ' '.(!isset($this->cover) ? 'NULL' : "'".$this->db->escape($this->cover)."'").',';
Expand Down Expand Up @@ -426,7 +426,7 @@ public function fetch($id, $ref = '', $relativepath = '', $hashoffile = '', $has
$sql .= " t.fullpath_orig,";
$sql .= " t.description,";
$sql .= " t.keywords,";
if (getDolGlobalString("MAIN_USE_FULL_TEXT_INDEXATION")) {
if (getDolGlobalString("MAIN_SAVE_FILE_CONTENT_AS_TEXT")) {
$sql .= " t.content,";
}
$sql .= " t.cover,";
Expand Down Expand Up @@ -507,7 +507,7 @@ public function fetch($id, $ref = '', $relativepath = '', $hashoffile = '', $has
$this->fullpath_orig = $obj->fullpath_orig;
$this->description = $obj->description;
$this->keywords = $obj->keywords;
if (getDolGlobalString("MAIN_USE_FULL_TEXT_INDEXATION")) {
if (getDolGlobalString("MAIN_SAVE_FILE_CONTENT_AS_TEXT")) {
$this->content = $obj->content;
}
$this->cover = $obj->cover;
Expand Down Expand Up @@ -571,7 +571,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset =
$sql .= " t.fullpath_orig,";
$sql .= " t.description,";
$sql .= " t.keywords,";
if (getDolGlobalString("MAIN_USE_FULL_TEXT_INDEXATION")) {
if (getDolGlobalString("MAIN_SAVE_FILE_CONTENT_AS_TEXT")) {
$sql .= " t.content,";
}
$sql .= " t.cover,";
Expand Down Expand Up @@ -646,7 +646,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset =
$line->fullpath_orig = $obj->fullpath_orig;
$line->description = $obj->description;
$line->keywords = $obj->keywords;
if (getDolGlobalString("MAIN_USE_FULL_TEXT_INDEXATION")) {
if (getDolGlobalString("MAIN_SAVE_FILE_CONTENT_AS_TEXT")) {
$line->content = $obj->content;
}
$line->cover = $obj->cover;
Expand Down Expand Up @@ -751,7 +751,7 @@ public function update(User $user, $notrigger = 0)
$sql .= ' fullpath_orig = '.(isset($this->fullpath_orig) ? "'".$this->db->escape($this->fullpath_orig)."'" : "null").',';
$sql .= ' description = '.(isset($this->description) ? "'".$this->db->escape($this->description)."'" : "null").',';
$sql .= ' keywords = '.(isset($this->keywords) ? "'".$this->db->escape($this->keywords)."'" : "null").',';
if (getDolGlobalString("MAIN_USE_FULL_TEXT_INDEXATION")) {
if (getDolGlobalString("MAIN_SAVE_FILE_CONTENT_AS_TEXT")) {
$sql .= ' content = '.(isset($this->content) ? "'".$this->db->escape($this->content)."'" : "null").',';
}
$sql .= ' cover = '.(isset($this->cover) ? "'".$this->db->escape($this->cover)."'" : "null").',';
Expand Down
6 changes: 5 additions & 1 deletion htdocs/expedition/class/expedition.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2482,7 +2482,11 @@ private function manageStockMvtOnEvt($user, $labelmovement = 'ShipmentClassifyCl
$error++;
}

return $error;
if (!$error) {
return 1;
} else {
return -1;
}
}

/**
Expand Down
8 changes: 7 additions & 1 deletion htdocs/fourn/class/fournisseur.facture.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (C) 2004 Christophe Combelles <[email protected]>
* Copyright (C) 2005 Marc Barilley <[email protected]>
* Copyright (C) 2005-2012 Regis Houssin <[email protected]>
* Copyright (C) 2010-2020 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2023 Juanjo Menent <jmenent@simnandez.es>
* Copyright (C) 2013-2019 Philippe Grand <[email protected]>
* Copyright (C) 2013 Florian Henry <[email protected]>
* Copyright (C) 2014-2016 Marcos García <[email protected]>
Expand Down Expand Up @@ -1197,6 +1197,12 @@ public function update($user = null, $notrigger = 0)
if (empty($this->total_tva)) {
$this->total_tva = 0;
}
if (empty($this->total_localtax1)) {
$this->total_localtax1 = 0;
}
if (empty($this->total_localtax2)) {
$this->total_localtax2 = 0;
}
if (isset($this->total_ttc)) {
$this->total_ttc = (float) $this->total_ttc;
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/fourn/facture/card-rec.php
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@
$special_code = 3;
}

$remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$remise_percent = price2num(GETPOST('remise_percent'), '', 2) ?: 0;

// Check minimum price
$productid = GETPOSTINT('productid');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/fourn/facture/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (C) 2004 Christophe Combelles <[email protected]>
* Copyright (C) 2005 Marc Barilley <[email protected]>
* Copyright (C) 2005-2013 Regis Houssin <[email protected]>
* Copyright (C) 2010-2019 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2023 Juanjo Menent <jmenent@simnandez.es>
* Copyright (C) 2013-2022 Philippe Grand <[email protected]>
* Copyright (C) 2013 Florian Henry <[email protected]>
* Copyright (C) 2014-2016 Marcos García <[email protected]>
Expand Down
3 changes: 2 additions & 1 deletion htdocs/societe/class/societe.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,7 @@ public function create(User $user, $notrigger = 0)
$this->name = $this->name ? trim($this->name) : trim((string) $this->nom);
$this->setUpperOrLowerCase();
$this->nom = $this->name; // For backward compatibility

if (empty($this->client)) {
$this->client = 0;
}
Expand Down Expand Up @@ -1459,7 +1460,7 @@ public function update($id, User $user, $call_trigger = 1, $allowmodcodeclient =
$this->address = trim((string) $this->address);
$this->zip = trim((string) $this->zip);
$this->town = trim((string) $this->town);
$this->state_id = (is_numeric($this->state_id)) ? (int) trim((string) $this->state_id) : 0;
$this->state_id = (is_numeric($this->state_id)) ? (int) $this->state_id : 0;
$this->country_id = ($this->country_id > 0) ? $this->country_id : 0;
$this->phone = trim((string) $this->phone);
$this->phone = preg_replace("/\s/", "", $this->phone);
Expand Down

0 comments on commit e346bc0

Please sign in to comment.