Code

Added edit link to list entries in fai-template/hooks
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 17 Sep 2007 07:40:01 +0000 (07:40 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 17 Sep 2007 07:40:01 +0000 (07:40 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7302 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiHook.inc
plugins/admin/fai/class_faiTemplate.inc

index 48b560c1b2e388e604a99862b8daf159b4cda166..fb8fa4e531e0aa2a9f6be41bfd6654b3df23c722 100644 (file)
@@ -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 = "<a href='?plug=".$_GET['plug']."&act=edit&id=".$key."'>".$name['name']."</a>";
+        $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;'")));
index 21efe27d04f55a178710c01f446864c59a750142..a57c7c084353edf7a68604a4b46356b986a046f4 100644 (file)
@@ -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 = "<a href='?plug=".$_GET['plug']."&act=edit&id=".$key."'>".$tmp[$key]."</a>";
+        $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;'")));