mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°1194 Portal: Support for MUST_CHANGE flag on CaseLog attributes in transitions.
SVN:trunk[5199]
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
// Copyright (C) 2010-2017 Combodo SARL
|
||||
// Copyright (C) 2010-2018Combodo SARL
|
||||
//
|
||||
// This file is part of iTop.
|
||||
//
|
||||
@@ -49,6 +49,7 @@ use \Combodo\iTop\Portal\Helper\ApplicationHelper;
|
||||
* Description of objectformmanager
|
||||
*
|
||||
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
|
||||
* @since iTop 2.3.0
|
||||
*/
|
||||
class ObjectFormManager extends FormManager
|
||||
{
|
||||
@@ -611,13 +612,14 @@ class ObjectFormManager extends FormManager
|
||||
// - Else if it's must change (transition), we force it as not readonly and not hidden
|
||||
elseif (($iFieldFlags & OPT_ATT_MUSTCHANGE) === OPT_ATT_MUSTCHANGE && $this->IsTransitionForm())
|
||||
{
|
||||
$oField->SetReadOnly(false);
|
||||
$oField->SetMustChange(true);
|
||||
$oField->SetReadOnly(false);
|
||||
$oField->SetHidden(false);
|
||||
}
|
||||
// - Else if it's must prompt (transition), we force it as not readonly and not hidden
|
||||
// - Else if it's must prompt (transition), we force it as mustchange, not readonly and not hidden
|
||||
elseif (($iFieldFlags & OPT_ATT_MUSTPROMPT) === OPT_ATT_MUSTPROMPT && $this->IsTransitionForm())
|
||||
{
|
||||
$oField->SetReadOnly(false);
|
||||
$oField->SetReadOnly(false);
|
||||
$oField->SetHidden(false);
|
||||
}
|
||||
// - Else if it wasn't mandatory or already had a value, and it's hidden, we force it as hidden
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
// Copyright (C) 2010-2016 Combodo SARL
|
||||
// Copyright (C) 2010-2018 Combodo SARL
|
||||
//
|
||||
// This file is part of iTop.
|
||||
//
|
||||
@@ -19,19 +19,26 @@
|
||||
|
||||
namespace Combodo\iTop\Form\Field;
|
||||
|
||||
use \Closure;
|
||||
use \DBObject;
|
||||
use \Combodo\iTop\Form\Field\TextAreaField;
|
||||
|
||||
/**
|
||||
* Description of CaseLogField
|
||||
*
|
||||
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
|
||||
* @since iTop 2.3.0
|
||||
*/
|
||||
class CaseLogField extends TextAreaField
|
||||
{
|
||||
protected $aEntries;
|
||||
|
||||
/**
|
||||
* @param bool $bMustChange
|
||||
* @return $this
|
||||
*/
|
||||
public function SetMustChange($bMustChange)
|
||||
{
|
||||
$this->SetMandatory($bMustChange);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return array
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
// Copyright (C) 2010-2017 Combodo SARL
|
||||
// Copyright (C) 2010-2018 Combodo SARL
|
||||
//
|
||||
// This file is part of iTop.
|
||||
//
|
||||
@@ -27,6 +27,7 @@ use \Combodo\iTop\Form\Validator\MandatoryValidator;
|
||||
* Description of Field
|
||||
*
|
||||
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
|
||||
* @since iTop 2.3.0
|
||||
*/
|
||||
abstract class Field
|
||||
{
|
||||
@@ -134,6 +135,18 @@ abstract class Field
|
||||
return $this->bReadOnly;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: This not implemented yet! Just a pre-conception for CaseLogField
|
||||
*
|
||||
* @todo Implement
|
||||
* @return boolean
|
||||
*/
|
||||
public function GetMustChange()
|
||||
{
|
||||
// TODO
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return boolean
|
||||
@@ -272,6 +285,20 @@ abstract class Field
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets if the field is must change or not.
|
||||
* Note: This not implemented yet! Just a pre-conception for CaseLogField
|
||||
*
|
||||
* @todo Implement
|
||||
* @param boolean $bMustChange
|
||||
* @return \Combodo\iTop\Form\Field\Field
|
||||
*/
|
||||
public function SetMustChange($bMustChange)
|
||||
{
|
||||
// TODO.
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param $sDisplayMode
|
||||
|
||||
Reference in New Issue
Block a user