mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
DirectorObjectForm: hidden id field, start...
...fading it out - don't want to see this here
This commit is contained in:
parent
2e069ef127
commit
c994610031
@ -19,17 +19,11 @@ class DatafieldController extends ActionController
|
|||||||
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$edit = false;
|
|
||||||
|
|
||||||
if ($id = $this->params->get('id')) {
|
|
||||||
$edit = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$form = DirectorDatafieldForm::load()
|
$form = DirectorDatafieldForm::load()
|
||||||
->setDb($this->db());
|
->setDb($this->db());
|
||||||
|
|
||||||
if ($edit) {
|
if ($id = $this->params->get('id')) {
|
||||||
$form->loadObject($id);
|
$form->loadObject((int) $id);
|
||||||
$this->addTitle(
|
$this->addTitle(
|
||||||
$this->translate('Modify %s'),
|
$this->translate('Modify %s'),
|
||||||
$form->getObject()->varname
|
$form->getObject()->varname
|
||||||
|
@ -284,7 +284,7 @@ class ImportsourceController extends ActionController
|
|||||||
. (int) $source->get('id');
|
. (int) $source->get('id');
|
||||||
$this->content()->prepend(
|
$this->content()->prepend(
|
||||||
ImportRowModifierForm::load()->setDb($this->db())
|
ImportRowModifierForm::load()->setDb($this->db())
|
||||||
->loadObject($this->params->getRequired('id'))
|
->loadObject((int) $this->params->getRequired('id'))
|
||||||
->setListUrl($listUrl)
|
->setListUrl($listUrl)
|
||||||
->setSource($source)
|
->setSource($source)
|
||||||
->handleRequest()
|
->handleRequest()
|
||||||
|
@ -1080,14 +1080,13 @@ abstract class DirectorObjectForm extends DirectorForm
|
|||||||
$class = $this->getObjectClassname();
|
$class = $this->getObjectClassname();
|
||||||
if (is_int($id)) {
|
if (is_int($id)) {
|
||||||
$this->object = $class::loadWithAutoIncId($id, $this->db);
|
$this->object = $class::loadWithAutoIncId($id, $this->db);
|
||||||
|
if ($this->object->getKeyName() === 'id') {
|
||||||
|
$this->addHidden('id', $id);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->object = $class::load($id, $this->db);
|
$this->object = $class::load($id, $this->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: hmmmm...
|
|
||||||
if (! is_array($id) && $this->object->getKeyName() === 'id') {
|
|
||||||
$this->addHidden('id', $id);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user