|
@@ -322,10 +322,20 @@ EOF
|
|
|
*/
|
|
|
public function GetObjectCreationForm(WebPage $oPage)
|
|
|
{
|
|
|
+ // Set all the default values in an object and clone this "default" object
|
|
|
+ $oNewObj = MetaModel::NewObject($this->sTargetClass);
|
|
|
+
|
|
|
+ // 1st - set context values
|
|
|
+ $oAppContext = new ApplicationContext();
|
|
|
+ $oAppContext->InitObjectFromContext($oNewObj);
|
|
|
+
|
|
|
+ // 2nd - set values from the page argument 'default'
|
|
|
+ $oNewObj->UpdateObjectFromArg('default');
|
|
|
+
|
|
|
$sDialogTitle = addslashes($this->sTitle);
|
|
|
$oPage->add('<div id="ac_create_'.$this->iId.'"><div class="wizContainer" style="vertical-align:top;"><div id="dcr_'.$this->iId.'">');
|
|
|
$oPage->add("<h1>".MetaModel::GetClassIcon($this->sTargetClass)." ".Dict::Format('UI:CreationTitle_Class', MetaModel::GetName($this->sTargetClass))."</h1>\n");
|
|
|
- cmdbAbstractObject::DisplayCreationForm($oPage, $this->sTargetClass, null, array(), array('formPrefix' => $this->iId, 'noRelations' => true));
|
|
|
+ cmdbAbstractObject::DisplayCreationForm($oPage, $this->sTargetClass, $oNewObj, array(), array('formPrefix' => $this->iId, 'noRelations' => true));
|
|
|
$oPage->add('</div></div></div>');
|
|
|
// $oPage->add_ready_script("\$('#ac_create_$this->iId').dialog({ width: $(window).width()*0.8, height: 'auto', autoOpen: false, modal: true, title: '$sDialogTitle'});\n");
|
|
|
$oPage->add_ready_script("\$('#ac_create_$this->iId').dialog({ width: 'auto', height: 'auto', autoOpen: false, modal: true, title: '$sDialogTitle'});\n");
|