Code

Updated fai lists to support 'edit' via clicking a list entry
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 17 Sep 2007 07:11:33 +0000 (07:11 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 17 Sep 2007 07:11:33 +0000 (07:11 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7301 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index c850ff63de4696e056cedb8cb6974d244758d2d9..0ad7dba9e40936965dea554b0fca6810835db848 100644 (file)
@@ -172,6 +172,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 */
@@ -280,7 +296,9 @@ class faiHook extends plugin
           </a>";
       }
 
-      $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),$img_edit.$img_remo),
               "attach"=>"style='border-right: 0px;width:50px;text-align:right;'")));
index 62dab484c23cbaceeb9c0a59f0f6925559a1acbe..bb552443cfa8a9690ec4711ccc25f151abc6d5e8 100644 (file)
@@ -160,6 +160,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'])){
       $this->dialog= new $this->subClassName($this->config,"new");
@@ -258,7 +273,9 @@ class faiTemplate extends plugin
           </a>";
       }
 
-      $divlist->AddEntry(array( array("string"=>$name),
+      $edit_link = "<a href='?plug=".$_GET['plug']."&act=edit&id=".$key."'>".$name."</a>";
+
+      $divlist->AddEntry(array( array("string"=> $edit_link),
             array("string"=>$down , "attach" => "style='width:20px;'"),
             array("string"=>str_replace("%s",base64_encode($key),$img_edit.$img_remo),
               "attach"=>"style='border-right: 0px;width:50px;text-align:right;'")));