forked from Wavyzz/dolibarr
Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/comm/propal/class/propal.class.php htdocs/projet/tasks/time.php
This commit is contained in:
@@ -294,9 +294,9 @@ $nav .= ' <input type="submit" name="submitdateselect" class="button" value="'.$
|
|||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda|DE:Modul_Terminplanung';
|
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
|
||||||
$title = $langs->trans("Agenda");
|
$title = $langs->trans("Agenda");
|
||||||
llxHeader('', $title, $help_url, 0, 0, '', '', '', 'bodyforlist');
|
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist');
|
||||||
|
|
||||||
// Define list of all external calendars
|
// Define list of all external calendars
|
||||||
$listofextcals = array();
|
$listofextcals = array();
|
||||||
|
|||||||
@@ -1422,8 +1422,10 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// reset ref_client
|
// reset ref_client
|
||||||
$object->ref_client = '';
|
if (!getDolGlobalString('MAIN_KEEP_REF_CUSTOMER_ON_CLONING')) {
|
||||||
$object->ref_customer = '';
|
$object->ref_client = '';
|
||||||
|
$object->ref_customer = '';
|
||||||
|
}
|
||||||
|
|
||||||
// TODO Change product price if multi-prices
|
// TODO Change product price if multi-prices
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -8246,6 +8246,9 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = '
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clear ZERO WIDTH NO-BREAK SPACE, ZERO WIDTH SPACE, ZERO WIDTH JOINER
|
||||||
|
$out = preg_replace('/[\x{200B}-\x{200D}\x{FEFF}]/u', ' ', $out);
|
||||||
|
|
||||||
// Clean some html entities that are useless so text is cleaner
|
// Clean some html entities that are useless so text is cleaner
|
||||||
$out = preg_replace('/&(tab|newline);/i', ' ', $out);
|
$out = preg_replace('/&(tab|newline);/i', ' ', $out);
|
||||||
|
|
||||||
@@ -8356,6 +8359,7 @@ function dol_htmlentitiesbr($stringtoencode, $nl2brmode = 0, $pagecodefrom = 'UT
|
|||||||
if ($removelasteolbr) {
|
if ($removelasteolbr) {
|
||||||
$newstring = preg_replace('/<br>$/i', '', $newstring); // Remove last <br> (remove only last one)
|
$newstring = preg_replace('/<br>$/i', '', $newstring); // Remove last <br> (remove only last one)
|
||||||
}
|
}
|
||||||
|
$newstring = preg_replace('/[\x{200B}-\x{200D}\x{FEFF}]/u', ' ', $newstring);
|
||||||
$newstring = strtr($newstring, array('&' => '__and__', '<' => '__lt__', '>' => '__gt__', '"' => '__dquot__'));
|
$newstring = strtr($newstring, array('&' => '__and__', '<' => '__lt__', '>' => '__gt__', '"' => '__dquot__'));
|
||||||
$newstring = dol_htmlentities($newstring, ENT_COMPAT, $pagecodefrom); // Make entity encoding
|
$newstring = dol_htmlentities($newstring, ENT_COMPAT, $pagecodefrom); // Make entity encoding
|
||||||
$newstring = strtr($newstring, array('__and__' => '&', '__lt__' => '<', '__gt__' => '>', '__dquot__' => '"'));
|
$newstring = strtr($newstring, array('__and__' => '&', '__lt__' => '<', '__gt__' => '>', '__dquot__' => '"'));
|
||||||
|
|||||||
@@ -858,11 +858,11 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$object->volume_units = (float) $object->size_units * 3;
|
$object->volume_units = (float) $object->size_units * 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($totalWeight != '') {
|
if (!empty($totalWeight)) {
|
||||||
$totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs);
|
$totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs, -1, 'no', 1);
|
||||||
}
|
}
|
||||||
if ($totalVolume != '') {
|
if (!empty($totalVolume)) {
|
||||||
$totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs);
|
$totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1);
|
||||||
}
|
}
|
||||||
if (!empty($object->trueWeight)) {
|
if (!empty($object->trueWeight)) {
|
||||||
$totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);
|
$totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);
|
||||||
|
|||||||
@@ -750,11 +750,11 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$object->volume_units = (float) $object->size_units * 3;
|
$object->volume_units = (float) $object->size_units * 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($totalWeight != '') {
|
if (!empty($totalWeight)) {
|
||||||
$totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs);
|
$totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs, -1, 'no', 1);
|
||||||
}
|
}
|
||||||
if ($totalVolume != '') {
|
if (!empty($totalVolume)) {
|
||||||
$totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs);
|
$totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1);
|
||||||
}
|
}
|
||||||
if (!empty($object->trueWeight)) {
|
if (!empty($object->trueWeight)) {
|
||||||
$totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);
|
$totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);
|
||||||
|
|||||||
@@ -1572,8 +1572,8 @@ if (!function_exists("llxHeader")) {
|
|||||||
* Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage
|
* Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage
|
||||||
* For other external page: http://server/url
|
* For other external page: http://server/url
|
||||||
* @param string $target Target to use on links
|
* @param string $target Target to use on links
|
||||||
* @param int $disablejs More content into html header
|
* @param int<0,1> $disablejs More content into html header
|
||||||
* @param int $disablehead More content into html header
|
* @param int<0,1> $disablehead More content into html header
|
||||||
* @param array|string $arrayofjs Array of complementary js files
|
* @param array|string $arrayofjs Array of complementary js files
|
||||||
* @param array|string $arrayofcss Array of complementary css files
|
* @param array|string $arrayofcss Array of complementary css files
|
||||||
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
|
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
|
||||||
|
|||||||
@@ -1635,7 +1635,7 @@ class Project extends CommonObject
|
|||||||
* @param int $mode 0=All project I have permission on (assigned to me or public), 1=Projects assigned to me only, 2=Will return list of all projects with no test on contacts
|
* @param int $mode 0=All project I have permission on (assigned to me or public), 1=Projects assigned to me only, 2=Will return list of all projects with no test on contacts
|
||||||
* @param int $list 0=Return array, 1=Return string list
|
* @param int $list 0=Return array, 1=Return string list
|
||||||
* @param int $socid 0=No filter on third party, id of third party
|
* @param int $socid 0=No filter on third party, id of third party
|
||||||
* @param string $filter additional filter on project (statut, ref, ...)
|
* @param string $filter additional filter on project (statut, ref, ...). TODO Use USF syntax here.
|
||||||
* @return array|string Array of projects id, or string with projects id separated with "," if list is 1
|
* @return array|string Array of projects id, or string with projects id separated with "," if list is 1
|
||||||
*/
|
*/
|
||||||
public function getProjectsAuthorizedForUser($user, $mode = 0, $list = 0, $socid = 0, $filter = '')
|
public function getProjectsAuthorizedForUser($user, $mode = 0, $list = 0, $socid = 0, $filter = '')
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
* Copyright (C) 2023 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
* Copyright (C) 2023 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||||
* Copyright (C) 2024 Vincent de Grandpré <vincent@de-grandpre.quebec>
|
* Copyright (C) 2024 Vincent de Grandpré <vincent@de-grandpre.quebec>
|
||||||
|
* Copyright (C) 2024 Solution Libre SAS <contact@solution-libre.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -1599,6 +1600,13 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||||||
$sql .= $hookmanager->resPrint;
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql .= " WHERE elementtype = 'task'";
|
$sql .= " WHERE elementtype = 'task'";
|
||||||
$sql .= " AND p.entity IN (".getEntity('project').")";
|
$sql .= " AND p.entity IN (".getEntity('project').")";
|
||||||
|
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||||
|
// Get list of project id allowed to user (in a string list separated by comma)
|
||||||
|
// TODO This may generate performance trouble when list of project is very large. Solution can be to complete $filterproj with filters on project.
|
||||||
|
$filterproj = '';
|
||||||
|
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $user->socid > 0 ? $user->socid : 0, $filterproj);
|
||||||
|
$sql .= " AND p.rowid IN (".$db->sanitize($projectsListId).")"; // public and assigned to, or restricted to company for external users
|
||||||
|
}
|
||||||
if (empty($projectidforalltimes) && empty($allprojectforuser)) {
|
if (empty($projectidforalltimes) && empty($allprojectforuser)) {
|
||||||
// Limit on one task
|
// Limit on one task
|
||||||
$sql .= " AND t.fk_element =".((int) $object->id);
|
$sql .= " AND t.fk_element =".((int) $object->id);
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
// Search thirdparty and set it if found to the new created project
|
// Search thirdparty and set it if found to the new created project
|
||||||
$result = $thirdparty->fetch(0, '', '', '', '', '', '', '', '', '', $object->email);
|
$result = $thirdparty->fetch(0, '', '', '', '', '', '', '', '', '', GETPOST('email'));
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
$proj->socid = $thirdparty->id;
|
$proj->socid = $thirdparty->id;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
* \brief This file is a test suite to run all unit tests
|
* \brief This file is a test suite to run all unit tests
|
||||||
* \remarks To run this script as CLI: phpunit filename.php
|
* \remarks To run this script as CLI: phpunit filename.php
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print "PHP Version: ".phpversion()."\n";
|
print "PHP Version: ".phpversion()."\n";
|
||||||
print "Memory limit: ". ini_get('memory_limit')."\n";
|
print "Memory limit: ". ini_get('memory_limit')."\n";
|
||||||
|
|
||||||
@@ -32,6 +33,10 @@ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
|||||||
$_SERVER['PHP_SELF'] = "phpunit";
|
$_SERVER['PHP_SELF'] = "phpunit";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! defined('NOREQUIREUSER')) {
|
||||||
|
define('PHPUNIT_MODE', 1);
|
||||||
|
}
|
||||||
|
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
|
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
|
||||||
//require_once 'PHPUnit/Autoload.php';
|
//require_once 'PHPUnit/Autoload.php';
|
||||||
|
|||||||
@@ -24,7 +24,9 @@
|
|||||||
* \remarks To run this script as CLI: phpunit filename.php
|
* \remarks To run this script as CLI: phpunit filename.php
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('PHPUNIT_MODE', 1);
|
if (! defined('NOREQUIREUSER')) {
|
||||||
|
define('PHPUNIT_MODE', 1);
|
||||||
|
}
|
||||||
|
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
|
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
|
||||||
|
|||||||
Reference in New Issue
Block a user