From cbb6b018da37540fc8655071afea484a4401759c Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon <54990055+sukhwinder33445@users.noreply.github.com> Date: Thu, 20 Jul 2023 13:31:46 +0200 Subject: [PATCH] Show node id in edit mode (#382) ref #308 --- application/forms/ProcessForm.php | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/application/forms/ProcessForm.php b/application/forms/ProcessForm.php index 604b774..cbc4466 100644 --- a/application/forms/ProcessForm.php +++ b/application/forms/ProcessForm.php @@ -23,24 +23,12 @@ class ProcessForm extends QuickForm /** @var BpNode */ protected $node; - protected $objectList = array(); - - protected $processList = array(); - /** @var SessionNamespace */ protected $session; public function setup() { - if ($this->node === null) { - $this->addElement('text', 'name', array( - 'label' => $this->translate('ID'), - 'required' => true, - 'description' => $this->translate( - 'This is the unique identifier of this process' - ), - )); - } else { + if ($this->node !== null) { $this->addHtml( '

' . $this->getView()->escape( sprintf($this->translate('Modify "%s"'), $this->node->getAlias()) @@ -48,6 +36,14 @@ class ProcessForm extends QuickForm ); } + $this->addElement('text', 'name', [ + 'label' => $this->translate('ID'), + 'value' => (string) $this->node, + 'required' => true, + 'readonly' => $this->node ? true : null, + 'description' => $this->translate('This is the unique identifier of this process') + ]); + $this->addElement('text', 'alias', array( 'label' => $this->translate('Display Name'), 'description' => $this->translate(