mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-06 09:34:13 +01:00
Merge remote-tracking branch 'origin/support/3.1' into develop
This commit is contained in:
@@ -791,7 +791,7 @@ abstract class AttributeDefinition
|
||||
public function HasAValue($proposedValue): bool
|
||||
{
|
||||
// Default implementation, we don't really know what type $proposedValue will be
|
||||
return is_null($proposedValue);
|
||||
return !(is_null($proposedValue));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -206,7 +206,7 @@ abstract class AbstractBlockLinkSetViewTable extends UIContentBlock
|
||||
*/
|
||||
private function InitIsAttEditable(): void
|
||||
{
|
||||
$iFlags = 0;
|
||||
$iFlags = OPT_ATT_NORMAL;
|
||||
|
||||
if ($this->oDbObject->IsNew())
|
||||
{
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
namespace Combodo\iTop\Test\UnitTest\Core;
|
||||
|
||||
use Change;
|
||||
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
|
||||
use MetaModel;
|
||||
use UserRequest;
|
||||
|
||||
class AttributeDefinitionTest extends ItopDataTestCase {
|
||||
const CREATE_TEST_ORG = true;
|
||||
@@ -55,6 +57,23 @@ class AttributeDefinitionTest extends ItopDataTestCase {
|
||||
{
|
||||
// Note: This is test is not great as we are datamodel dependent and don't have a class with all the attribute types
|
||||
return [
|
||||
'AttributeDateTime' => [
|
||||
Change::class,
|
||||
'start_date', // no default value on this field
|
||||
<<<PHP
|
||||
\$oObject->Set('start_date', '2023-09-06 12:26:00');
|
||||
PHP
|
||||
,
|
||||
false,
|
||||
true,
|
||||
],
|
||||
'AttributeFrienlyName' => [
|
||||
UserRequest::class,
|
||||
'friendlyname',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
],
|
||||
'AttributeDashboard' => [
|
||||
'Organization',
|
||||
'overview',
|
||||
@@ -158,9 +177,9 @@ PHP
|
||||
'AttributeSubItem' => [
|
||||
'UserRequest',
|
||||
'tto_escalation_deadline',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
'', // read-only attribute
|
||||
false,
|
||||
false,
|
||||
],
|
||||
'AttributeOneWayPassword' => [
|
||||
'UserLocal',
|
||||
|
||||
Reference in New Issue
Block a user