Merge remote-tracking branch 'origin/support/3.2' into develop

This commit is contained in:
Pierre Goiffon
2024-02-28 15:13:06 +01:00
4 changed files with 23 additions and 3 deletions

View File

@@ -33,7 +33,6 @@ ApplicationMenu::CheckMenuIdEnabled('UniversalSearchMenu');
$oAppContext = new ApplicationContext();
$oP = new iTopWebPage(Dict::S('UI:UniversalSearchTitle'));
$oP->add_linked_script("../js/json.js");
$oP->add_linked_script("../js/forms-json-utils.js");
$oP->add_linked_script("../js/wizardhelper.js");
$oP->add_linked_script("../js/wizard.utils.js");

View File

@@ -37,7 +37,6 @@ try
// Main program
//
$oP = new iTopWebPage(Dict::S('Menu:TagAdminMenu+'));
$oP->add_linked_script("../js/json.js");
$oP->add_linked_script("../js/forms-json-utils.js");
$oP->add_linked_script("../js/wizardhelper.js");
$oP->add_linked_script("../js/wizard.utils.js");

View File

@@ -781,7 +781,6 @@ JS;
public static function EnumRequiredForModificationJsFilesRelPaths(): array
{
return [
'js/json.js',
'js/forms-json-utils.js',
'js/wizardhelper.js',
'js/wizard.utils.js',

View File

@@ -1356,4 +1356,27 @@ class DBObjectTest extends ItopDataTestCase
$oOrganisation->SetTrim('name', $sName);
$this->assertEquals($sResult, $oOrganisation->Get('name'), 'SetTrim must limit string to 255 characters');
}
/**
* @covers DBObject::SetComputedDate
* @return void
*/
public function testSetComputedDateOnAttributeDate(){
$oObject = MetaModel::NewObject(\CustomerContract::class, ['name'=>'Test contract','org_id'=>'3','provider_id'=>'2']);
$oObject->Set('start_date',time());
$oObject->SetComputedDate('end_date', "+2 weeks", 'start_date');
$this->assertTrue(true,'No fatal error on computing date');
}
/**
* @covers DBObject::SetComputedDate
* @return void
*/
public function testSetComputedDateOnAttributeDateTime(){
$oObject = MetaModel::NewObject(\WorkOrder::class, ['name'=>'Test workorder','description'=>'Toto']);
$oObject->Set('start_date','2024-01-01 09:45:00');
$oObject->SetComputedDate('end_date', "+2 weeks", 'start_date');
$this->assertTrue(true,'No fatal error on computing date');
$this->assertEquals("2024-01-15 09:45:00", $oObject->Get('end_date'), 'SetComputedDate +2 weeks on a WorkOrder DateTimeAttribute');
}
}