From 3d68b05570b1340c37f66af0ebde952b293e23ad Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 20 Oct 2005 08:04:04 +0000 Subject: [PATCH] Removed Object_ from FAIscriptEntry attributes git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1631 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiScript.inc | 10 ++++--- plugins/admin/fai/class_faiScriptEntry.inc | 33 +++++++++++----------- plugins/admin/fai/faiScript.tpl | 1 + plugins/admin/fai/faiScriptEntry.tpl | 14 ++++----- 4 files changed, 30 insertions(+), 28 deletions(-) diff --git a/plugins/admin/fai/class_faiScript.inc b/plugins/admin/fai/class_faiScript.inc index 57de64876..e2825064e 100644 --- a/plugins/admin/fai/class_faiScript.inc +++ b/plugins/admin/fai/class_faiScript.inc @@ -195,10 +195,12 @@ class faiScript extends plugin */ function save_object() { - plugin::save_object(); - foreach($this->attributes as $attrs){ - if(isset($_POST[$attrs])){ - $this->$attrs = $_POST[$attrs]; + if(isset($_POST['FAIscript_posted'])){ + plugin::save_object(); + foreach($this->attributes as $attrs){ + if(isset($_POST[$attrs])){ + $this->$attrs = $_POST[$attrs]; + } } } } diff --git a/plugins/admin/fai/class_faiScriptEntry.inc b/plugins/admin/fai/class_faiScriptEntry.inc index 1fb0239d9..13d5bdb08 100644 --- a/plugins/admin/fai/class_faiScriptEntry.inc +++ b/plugins/admin/fai/class_faiScriptEntry.inc @@ -9,17 +9,17 @@ class faiScriptEntry extends plugin /* attribute list for save action */ var $ignore_account= TRUE; - var $attributes = array("Object_cn","Object_description","Object_FAIpriority","Object_FAIscript"); + var $attributes = array("cn","description","FAIpriority","FAIscript"); var $objectclasses= array(); var $orig_cn = ""; - var $Object_dn = ""; - var $Object_cn = ""; - var $Object_FAIpriority = ""; - var $Object_FAIscript = ""; - var $Object_description = ""; - var $Object_status = "new"; + var $dn = ""; + var $cn = ""; + var $FAIpriority = ""; + var $FAIscript = ""; + var $description = ""; + var $status = "new"; function faiScriptEntry ($config, $dn= NULL,$object=false) { @@ -28,11 +28,11 @@ class faiScriptEntry extends plugin $this->orig_cn= $object['cn']; $this->dn=$object['dn']; foreach($object as $name=>$value){ - $oname = "Object_".$name; + $oname = $name; $this->$oname=$value; } }else{ - $this->Object_status = "new"; + $this->status = "new"; $this->orig_cn = false; } } @@ -51,7 +51,7 @@ class faiScriptEntry extends plugin print_red(_("Selected file is empty.")); }else{ $str = utf8_encode(file_get_contents($_FILES['ImportFile']['tmp_name'])); - $this->Object_FAIscript = $str; + $this->FAIscript = $str; } } @@ -65,9 +65,9 @@ class faiScriptEntry extends plugin } for($i =0 ; $i < 100 ; $i++){ - $Object_FAIprioritys[$i]=$i; + $FAIprioritys[$i]=$i; } - $smarty->assign("Object_FAIprioritys",$Object_FAIprioritys); + $smarty->assign("FAIprioritys",$FAIprioritys); $display.= $smarty->fetch(get_template_path('faiScriptEntry.tpl', TRUE)); return($display); } @@ -91,11 +91,11 @@ class faiScriptEntry extends plugin { $message= array(); - if(empty($this->Object_cn)){ + if(empty($this->cn)){ $message[] = _("Please enter a name."); } - if(preg_match("/[^0-9a-z]/i",$this->Object_cn)){ + if(preg_match("/[^0-9a-z]/i",$this->cn)){ $message[] = _("Please enter a valid name. Only a-Z 0-9 are allowed."); } @@ -106,8 +106,7 @@ class faiScriptEntry extends plugin { $tmp=array(); foreach($this->attributes as $attrs){ - $attr = preg_replace("/^Object_/","",$attrs); - $tmp[$attr] = $this->$attrs; + $tmp[$attrs] = $this->$attrs; } if(($this->orig_cn)&&($tmp['cn']!=$this->orig_cn)){ @@ -116,7 +115,7 @@ class faiScriptEntry extends plugin } $tmp['dn'] = $this->dn; - $tmp['status'] = $this->Object_status; + $tmp['status'] = $this->status; return($tmp); } } diff --git a/plugins/admin/fai/faiScript.tpl b/plugins/admin/fai/faiScript.tpl index 7896626c7..b100327e9 100644 --- a/plugins/admin/fai/faiScript.tpl +++ b/plugins/admin/fai/faiScript.tpl @@ -49,3 +49,4 @@ + diff --git a/plugins/admin/fai/faiScriptEntry.tpl b/plugins/admin/fai/faiScriptEntry.tpl index 0017e6095..5652244ec 100644 --- a/plugins/admin/fai/faiScriptEntry.tpl +++ b/plugins/admin/fai/faiScriptEntry.tpl @@ -9,7 +9,7 @@ {t}Name{/t}{$must}  - + @@ -17,7 +17,7 @@ {t}Description{/t}  - + @@ -30,13 +30,13 @@ @@ -46,14 +46,14 @@
- - + {html_options values=$FAIprioritys output=$FAIprioritys selected=$FAIpriority}

 

  -

- +
-- 2.30.2