diff --git a/.travis.yml b/.travis.yml
index 1f4fc328a49..ee378d191dd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -53,6 +53,10 @@ addons:
- php8.1-mysqli
- php8.1-xml
- php8.1-intl
+ - php8.2-pgsql
+ - php8.2-mysqli
+ - php8.2-xml
+ - php8.2-intl
env:
global:
@@ -73,8 +77,8 @@ jobs:
php: '8.1'
env: DB=mysql
- stage: PHP Dev
- if: type = push AND branch = 17.0
- php: nightly
+ if: type = push AND branch = develop
+ php: '8.2'
env: DB=mysql
notifications:
@@ -120,7 +124,7 @@ install:
squizlabs/php_codesniffer ^3
fi
# phpunit 9 is required for php 8
- if [ "$TRAVIS_PHP_VERSION" = '8.0' ] || [ "$TRAVIS_PHP_VERSION" = '8.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
+ if [ "$TRAVIS_PHP_VERSION" = '8.0' ] || [ "$TRAVIS_PHP_VERSION" = '8.1' ] || [ "$TRAVIS_PHP_VERSION" = '8.2' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
composer self-update 2.4.4
composer -n require --ignore-platform-reqs phpunit/phpunit ^8 \
php-parallel-lint/php-parallel-lint ^1.2 \
@@ -260,7 +264,7 @@ before_script:
# enable php-fpm
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- |
- if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '8.0' ] || [ "$TRAVIS_PHP_VERSION" = '8.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
+ if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '8.0' ] || [ "$TRAVIS_PHP_VERSION" = '8.1' ] || [ "$TRAVIS_PHP_VERSION" = '8.2' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
# Copy the included pool
sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf
fi
diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index 68bec8431a7..a0e741a290f 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -231,7 +231,7 @@ if ($action == 'install') {
if (!$error) {
@dol_delete_dir_recursive($dirins.'/'.$modulenameval); // delete the target directory
$submodulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulenameval;
- if (!dol_is_dir($modulenamedir)) {
+ if (!dol_is_dir($submodulenamedir)) {
$submodulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulenameval;
}
dol_syslog("We copy now directory ".$submodulenamedir." into target dir ".$dirins.'/'.$modulenameval);
@@ -476,7 +476,7 @@ foreach ($modulesdir as $dir) {
dol_syslog("Module ".get_class($objMod)." not qualified");
}
} else {
- print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)
";
+ print "admin/modules.php Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)
";
}
} catch (Exception $e) {
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php
index 7a7e49a3129..9c8473f5f7f 100644
--- a/htdocs/admin/stock.php
+++ b/htdocs/admin/stock.php
@@ -181,16 +181,25 @@ $formproduct = new FormProduct($db);
$disabled = '';
if (isModEnabled('productbatch')) {
+ // If module lot/serial enabled, we force the inc/dec mode to STOCK_CALCULATE_ON_SHIPMENT_CLOSE and STOCK_CALCULATE_ON_RECEPTION_CLOSE
$langs->load("productbatch");
$disabled = ' disabled';
- print info_admin($langs->trans("WhenProductBatchModuleOnOptionAreForced"));
+
+ // STOCK_CALCULATE_ON_SHIPMENT_CLOSE
+ $descmode = $langs->trans('DeStockOnShipmentOnClosing');
+ if (!isModEnabled('reception')) {
+ // STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER
+ $incmode = $langs->trans('ReStockOnDispatchOrder');
+ } else {
+ // STOCK_CALCULATE_ON_RECEPTION_CLOSE
+ $incmode = $langs->trans('StockOnReceptionOnClosing');
+ }
+ print info_admin($langs->trans("WhenProductBatchModuleOnOptionAreForced", $descmode, $incmode));
}
-//if (!empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT))
-//{
+
print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule"));
print '
';
-//}
print '
'."\n";
// Add number of product when there is a filter on period
if (count($arrayofuniqueproduct) == 1 && !empty($year) && is_numeric($year)) {
@@ -1527,7 +1628,7 @@ if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $n
$genallowed = $permissiontoread;
$delallowed = $permissiontoadd;
- print $formfile->showdocuments('massfilesarea_mymodule', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
+ print $formfile->showdocuments('massfilesarea_'.$object->module, '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
}
// End of page
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 42833785c09..2b0ffd51b43 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -1159,11 +1159,14 @@ if ($action == 'create' && $user->rights->projet->creer) {
print $form->selectDate($object->date_start ? $object->date_start : -1, 'projectstart', 0, 0, 0, '', 1, 0);
print ' '.$langs->trans("to").' ';
print $form->selectDate($object->date_end ? $object->date_end : -1, 'projectend', 0, 0, 0, '', 1, 0);
- print ' getLinesArray(null, 0);
+ if (!empty($object->usage_task) && !empty($object->lines)) {
+ print ' ';
}
- print '/>';
print '';
if (isModEnabled('eventorganization')) {
@@ -1385,6 +1388,11 @@ if ($action == 'create' && $user->rights->projet->creer) {
jQuery("#usage_task").prop("checked", true);
}
});
+
+ jQuery("#projectstart").change(function() {
+ console.log("We modify the start date");
+ jQuery("#divreportdate").show();
+ });
});
';
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 0b8f48c90e3..8e51f44c6c3 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -291,7 +291,7 @@ class Project extends CommonObject
'date_close' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>0, 'position'=>105),
'fk_user_close' =>array('type'=>'integer', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>0, 'position'=>110),
'opp_amount' =>array('type'=>'double(24,8)', 'label'=>'OpportunityAmountShort', 'enabled'=>1, 'visible'=>'getDolGlobalString("PROJECT_USE_OPPORTUNITIES")', 'position'=>115),
- 'budget_amount' =>array('type'=>'double(24,8)', 'label'=>'Budget', 'enabled'=>1, 'visible'=>1, 'position'=>119),
+ 'budget_amount' =>array('type'=>'double(24,8)', 'label'=>'Budget', 'enabled'=>1, 'visible'=>-1, 'position'=>119),
'usage_bill_time' =>array('type'=>'integer', 'label'=>'UsageBillTimeShort', 'enabled'=>1, 'visible'=>-1, 'position'=>130),
'usage_opportunity' =>array('type'=>'integer', 'label'=>'UsageOpportunity', 'enabled'=>1, 'visible'=>-1, 'position'=>135),
'usage_task' =>array('type'=>'integer', 'label'=>'UsageTasks', 'enabled'=>1, 'visible'=>-1, 'position'=>140),
@@ -2344,11 +2344,11 @@ class Project extends CommonObject
/**
- * Create an array of tasks of current project
+ * Create an array of tasks of current project
*
- * @param User $user Object user we want project allowed to
+ * @param User $user Object user we want project allowed to
* @param int $loadRoleMode 1= will test Roles on task; 0 used in delete project action
- * @return int >0 if OK, <0 if KO
+ * @return int >0 if OK, <0 if KO
*/
public function getLinesArray($user, $loadRoleMode = 1)
{
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 26119927fda..e7e8cc40b68 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -1858,8 +1858,8 @@ while ($i < $imaxinloop) {
}
// Email MsgID
if (!empty($arrayfields['p.email_msgid']['checked'])) {
- print '';
- print $obj->email_msgid;
+ print ' | ';
+ print dol_escape_htmltag($obj->email_msgid);
print ' | ';
if (!$i) $totalarray['nbfield']++;
}
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 0cd2eb6de5e..fbec220b671 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -1797,7 +1797,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
if ($projectstatic->public) {
$contactsofproject = array();
}
- print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth250');
+ print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth200');
} else {
if ($nboftasks) {
print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime');
@@ -1830,8 +1830,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
print '';
if ($conf->service->enabled && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) {
- print '';
- print $form->select_produits('', 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500');
+ print ' | ';
+ print img_picto('', 'product');
+ print $form->select_produits('', 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1);
print ' | ';
}
}
@@ -1843,7 +1844,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
print '';
$form->buttonsSaveCancel();
- print '';
+ print '';
print '';
print ' | ';
@@ -2149,7 +2150,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// Thirdparty
if (!empty($arrayfields['p.fk_soc']['checked'])) {
- print '';
+ print ' | ';
if ($task_time->fk_soc > 0) {
if (empty($conf->cache['thridparty'][$task_time->fk_soc])) {
$tmpsociete = new Societe($db);
@@ -2331,9 +2332,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
}
}
- //Product
+ // Product
if (!empty($arrayfields['t.fk_product']['checked'])) {
- print ' | ';
+ print ' | ';
if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) {
$form->select_produits($task_time->fk_product, 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500');
} elseif (!empty($task_time->fk_product)) {
@@ -2432,9 +2433,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
print ' | ';
if (($action == 'editline' || $action == 'splitline') && GETPOST('lineid', 'int') == $task_time->rowid) {
print '';
- print '';
+ print '';
print ' ';
- print '';
+ print '';
} elseif ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer')) { // Read project and enter time consumed on assigned tasks
if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) {
@@ -2474,6 +2475,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// Add line to split
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
+ print '';
print ' | ';
// Date
@@ -2491,6 +2493,18 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
print '';
}
+ // Thirdparty
+ if (!empty($arrayfields['p.fk_soc']['checked'])) {
+ print '| ';
+ print ' | ';
+ }
+
+ // Thirdparty alias
+ if (!empty($arrayfields['s.name_alias']['checked'])) {
+ print '';
+ print ' | ';
+ }
+
// Project ref
if (!empty($allprojectforuser)) {
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
@@ -2522,7 +2536,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// User
if (!empty($arrayfields['author']['checked'])) {
- print '';
+ print ' | ';
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
if (empty($object->id)) {
$object->fetch($id);
@@ -2573,6 +2587,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
print ' | ';
}
+ // Product
+ if (!empty($arrayfields['t.fk_product']['checked'])) {
+ print '';
+ print ' | ';
+ }
+
// Value spent
if (!empty($arrayfields['value']['checked'])) {
print '';
@@ -2612,7 +2632,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// Line for second dispatching
- print ' |
';
+ print '
';
// Date
if (!empty($arrayfields['t.element_date']['checked'])) {
@@ -2629,6 +2649,18 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
print '';
}
+ // Thirdparty
+ if (!empty($arrayfields['p.fk_soc']['checked'])) {
+ print '| ';
+ print ' | ';
+ }
+
+ // Thirdparty alias
+ if (!empty($arrayfields['s.name_alias']['checked'])) {
+ print '';
+ print ' | ';
+ }
+
// Project ref
if (!empty($allprojectforuser)) {
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
@@ -2653,14 +2685,14 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
if (!empty($arrayfields['t.element_label']['checked'])) {
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
print '';
- print $task_time->label;
+ print dol_escape_htmltag($task_time->label);
print ' | ';
}
}
// User
if (!empty($arrayfields['author']['checked'])) {
- print '';
+ print ' | ';
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
if (empty($object->id)) {
$object->fetch($id);
@@ -2711,6 +2743,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
print ' | ';
}
+ // Product
+ if (!empty($arrayfields['t.fk_product']['checked'])) {
+ print '';
+ print ' | ';
+ }
+
// Value spent
if (!empty($arrayfields['value']['checked'])) {
print '';
diff --git a/test/phpunit/AllTests.php b/test/phpunit/AllTests.php
index ba4d743f603..84ea7a42a6e 100644
--- a/test/phpunit/AllTests.php
+++ b/test/phpunit/AllTests.php
@@ -24,7 +24,7 @@
* \remarks To run this script as CLI: phpunit filename.php
*/
print "PHP Version: ".phpversion()."\n";
-print "Memory: ". ini_get('memory_limit')."\n";
+print "Memory limit: ". ini_get('memory_limit')."\n";
global $conf,$user,$langs,$db;
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
diff --git a/test/phpunit/CategorieTest.php b/test/phpunit/CategorieTest.php
index 3bd870914e3..1faab723bb2 100644
--- a/test/phpunit/CategorieTest.php
+++ b/test/phpunit/CategorieTest.php
@@ -259,11 +259,12 @@ class CategorieTest extends PHPUnit\Framework\TestCase
$langs=$this->savlangs;
$db=$this->savdb;
- $localobject->note='New note after update';
+ $localobject->note_private ='New note after update';
$result=$localobject->update($user);
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertGreaterThan(0, $result);
+
return $localobject;
}
@@ -288,8 +289,6 @@ class CategorieTest extends PHPUnit\Framework\TestCase
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0);
*/
- $localobject2=new Categorie($db);
- $localobject2->initAsSpecimen();
$retarray=$localobject->liste_photos('/');
print __METHOD__." retarray size=".count($retarray)."\n";
diff --git a/test/phpunit/MouvementStockTest.php b/test/phpunit/MouvementStockTest.php
index a781ea78e12..d084f50d6e0 100644
--- a/test/phpunit/MouvementStockTest.php
+++ b/test/phpunit/MouvementStockTest.php
@@ -146,41 +146,44 @@ class MouvementStockTest extends PHPUnit\Framework\TestCase
// We create a product for tests
$product0=new Product($db);
$product0->initAsSpecimen();
- $product0->ref.=' 0';
- $product0->label.=' 0';
+ $product0->ref.=' phpunit 0';
+ $product0->label.=' phpunit 0';
$product0->status_batch = 1;
$product0id=$product0->create($user);
+ print __METHOD__." product0id=".$product0id."\n";
+ $this->assertGreaterThan(0, $product0id, 'Failed to create product');
+
$product1=new Product($db);
$product1->initAsSpecimen();
- $product1->ref.=' 1';
- $product1->label.=' 1';
+ $product1->ref.=' phpunit 1';
+ $product1->label.=' phpunit 1';
$product1id=$product1->create($user);
$product2=new Product($db);
$product2->initAsSpecimen();
- $product2->ref.=' 2';
- $product2->label.=' 2';
+ $product2->ref.=' phpunit 2';
+ $product2->label.=' phpunit 2';
$product2id=$product2->create($user);
// We create a product for tests
$warehouse0=new Entrepot($db);
$warehouse0->initAsSpecimen();
- $warehouse0->label.=' 0';
- $warehouse0->description.=' 0';
+ $warehouse0->label.=' phpunit 0';
+ $warehouse0->description.=' phpunit 0';
$warehouse0->statut = 0;
$warehouse0id=$warehouse0->create($user);
$warehouse1=new Entrepot($db);
$warehouse1->initAsSpecimen();
- $warehouse1->label.=' 1';
- $warehouse1->description.=' 1';
+ $warehouse1->label.=' phpunit 1';
+ $warehouse1->description.=' phpunit 1';
$warehouse1id=$warehouse1->create($user);
$warehouse2=new Entrepot($db);
$warehouse2->initAsSpecimen();
- $warehouse2->label.=' 2';
- $warehouse2->description.=' 2';
+ $warehouse2->label.=' phpunit 2';
+ $warehouse2->description.=' phpunit 2';
$warehouse2id=$warehouse2->create($user);
$localobject=new MouvementStock($this->savdb);
@@ -188,10 +191,10 @@ class MouvementStockTest extends PHPUnit\Framework\TestCase
$datetest1 = dol_mktime(0, 0, 0, 1, 1, 2000);
$datetest2 = dol_mktime(0, 0, 0, 1, 2, 2000);
- // Create an input movement movement (type = 3) with value for eatby date and a lot
+ // Create an input movement movement (type = 3) with value for eatby date and a lot $datetest1
$result=$localobject->reception($user, $product0id, $warehouse0id, 5, 999, 'Movement for unit test with batch', $datetest1, $datetest1, 'anotyetuselotnumberA', '', 0, 'Inventory Code Test with batch');
print __METHOD__." result=".$result."\n";
- $this->assertGreaterThan(0, $result, 'Failed to create a movement with a lot number of product with status_batch=1');
+ $this->assertGreaterThan(0, $result, 'Failed to create a movement with a lot number '.$datetest1.' for product id='.$product0id.' with status_batch=1');
$result=$localobject->reception($user, $product0id, $warehouse0id, 5, 999, 'Movement for unit test with batch', $datetest1, $datetest1, 'anotyetuselotnumberB', '', 0, 'Inventory Code Test with batch');
print __METHOD__." result=".$result."\n";
@@ -250,12 +253,12 @@ class MouvementStockTest extends PHPUnit\Framework\TestCase
// Create an output movement (type = 1) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8
$result=$localobject->_create($user, $product1id, $warehouse2id, 1, 0, 0, 'Input from transfer wh 2', 'Transfert X 2');
print __METHOD__." result=".$result."\n";
- $this->assertGreaterThan(0, $result);
+ $this->assertGreaterThan(0, $result, 'Test create A');
// Create an output movement (type = 1) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8
$result=$localobject->_create($user, $product1id, $warehouse2id, -2, 1, 0, 'Output from transfer wh 2', 'Transfert Y 2');
print __METHOD__." result=".$result."\n";
- $this->assertGreaterThan(0, $result);
+ $this->assertGreaterThan(0, $result, 'Test create B');
return $localobject;
}
|