DirectorObjectForm: add and use isNew helper
This commit is contained in:
parent
8ce323bde1
commit
0119e0f4a2
|
@ -396,9 +396,14 @@ abstract class DirectorObjectForm extends QuickForm
|
|||
}
|
||||
}
|
||||
|
||||
protected function isNew()
|
||||
{
|
||||
return $this->object === null || ! $this->object->hasBeenLoadedFromDb();
|
||||
}
|
||||
|
||||
protected function setButtons()
|
||||
{
|
||||
if ($this->object === null || ! $this->object->hasBeenLoadedFromDb()) {
|
||||
if ($this->isNew()) {
|
||||
$this->setSubmitLabel(
|
||||
$this->translate('Add')
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue