Skip to content

Commit

Permalink
fix(change + problem): adding readonly on fields when object is not e…
Browse files Browse the repository at this point in the history
…ditable
  • Loading branch information
Rom1-B authored and trasher committed Jan 16, 2024
1 parent fa65eda commit 16bee80
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/CommonITILObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -9911,4 +9911,27 @@ public static function getMessageReferenceEvent(string $event): ?string
// All actions should be attached to thread instanciated by `new` event
return 'new';
}

/**
* Is the current user have right to update the current ITIL object ?
*
* @return boolean
**/
public function canUpdateItem()
{
if (!$this->checkEntity()) {
return false;
}

return self::canUpdate();
}

public function canDeleteItem()
{

if (!$this->checkEntity()) {
return false;
}
return self::canDelete();
}
}
2 changes: 2 additions & 0 deletions src/Dropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,7 @@ public static function showTimeStamp($myname, $options = [])
$params['width'] = '';
$params['class'] = 'form-select';
$params['allow_max_change'] = true;
$params['disabled'] = false;

if (is_array($options) && count($options)) {
foreach ($options as $key => $val) {
Expand Down Expand Up @@ -2014,6 +2015,7 @@ public static function showTimeStamp($myname, $options = [])
'rand' => $params['rand'],
'emptylabel' => $params['emptylabel'],
'class' => $params['class'],
'disabled' => $params['disabled'],
]);
}

Expand Down

0 comments on commit 16bee80

Please sign in to comment.