From: hickert Date: Mon, 17 Sep 2007 07:40:01 +0000 (+0000) Subject: Added edit link to list entries in fai-template/hooks X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8ab3d7d602e571c19e2307287c8421f34d0c76c9;p=gosa.git Added edit link to list entries in fai-template/hooks git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7302 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/class_faiHook.inc b/plugins/admin/fai/class_faiHook.inc index 48b560c1b..fb8fa4e53 100644 --- a/plugins/admin/fai/class_faiHook.inc +++ b/plugins/admin/fai/class_faiHook.inc @@ -198,6 +198,22 @@ class faiHook extends plugin } } } + + /* Edit entries via GET */ + if(isset($_GET['act']) && isset($_GET['id'])){ + if($_GET['act'] == "edit" && isset($this->SubObjects[$_GET['id']])){ + $obj = $this->SubObjects[$_GET['id']]; + if($obj['status'] == "FreshLoaded"){ + $obj = $this->get_object_attributes($obj,$this->sub_Load_Later); + } + $this->dialog= new $this->subClassName($this->config,$this->dn,$obj); + $this->dialog->acl = $this->acl; + $_SESSION['objectinfo'] = $obj['dn']; + $this->dialog->parent = &$this; + $this->is_dialog=true; + } + } + ///// Ende new list handling /* Add new sub object */ @@ -318,7 +334,9 @@ class faiHook extends plugin /* Check if we are allowed to view the object */ $s_acl = $this->ui->get_permissions($dn,"fai/faiHookEntry","cn") ; if(preg_match("/r/",$s_acl)){ - $divlist->AddEntry(array( array("string"=>$name['name']), + + $edit_link = "".$name['name'].""; + $divlist->AddEntry(array( array("string"=>$edit_link), array("string"=>$down , "attach" => "style='width:20px;'"), array("string"=>str_replace("%s",base64_encode($key),$act), "attach"=>"style='border-right: 0px;width:50px;text-align:right;'"))); diff --git a/plugins/admin/fai/class_faiTemplate.inc b/plugins/admin/fai/class_faiTemplate.inc index 21efe27d0..a57c7c084 100644 --- a/plugins/admin/fai/class_faiTemplate.inc +++ b/plugins/admin/fai/class_faiTemplate.inc @@ -177,6 +177,21 @@ class faiTemplate extends plugin } } + /* Edit entries via GET */ + if(isset($_GET['act']) && isset($_GET['id'])){ + if($_GET['act'] == "edit" && isset($this->SubObjects[$_GET['id']])){ + $obj = $this->SubObjects[$_GET['id']]; + if($obj['status'] == "FreshLoaded"){ + $obj = $this->get_object_attributes($obj,$this->sub_Load_Later); + } + $this->dialog= new $this->subClassName($this->config,$this->dn,$obj); + $this->dialog->acl = $this->acl; + $_SESSION['objectinfo'] = $obj['dn']; + $this->dialog->parent = &$this; + $this->is_dialog=true; + } + } + /* Add new sub object */ if(isset($_POST['AddSubObject'])){ $acl_dn = "cn=dummy,".$this->acl_base_for_current_object($this->dn); @@ -296,7 +311,9 @@ class faiTemplate extends plugin /* Check if we are allowed to view this object */ $s_acl = $this->ui->get_permissions($dn,"fai/faiTemplateEntry","cn") ; if(preg_match("/r/",$s_acl)){ - $divlist->AddEntry(array( array("string"=> $tmp[$key] ), + + $edit_link = "".$tmp[$key].""; + $divlist->AddEntry(array( array("string"=> $edit_link), array("string"=>$down , "attach" => "style='width:20px;'"), array("string"=>str_replace("%s",base64_encode($key),$act), "attach"=>"style='border-right: 0px;width:50px;text-align:right;'")));