Show node id in edit mode (#382)

ref #308
This commit is contained in:
Sukhwinder Dhillon 2023-07-20 13:31:46 +02:00 committed by GitHub
parent 83194e4942
commit cbb6b018da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(
'<h2>' . $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(