diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc
index e390ea36d6b62473f72047c650f3c47f0cd6f82e..6f3630e6e54c2b8768198af0294f2bce6530a997 100644 (file)
$this->is_new =TRUE;
}
ksort($this->disks);
+
+ // Prepare lists
+ $this->diskList = new sortableListing();
+ $this->diskList->setDeleteable(true);
+ $this->diskList->setEditable(true);
+ $this->diskList->setWidth("100%");
+ $this->diskList->setHeight("400px");
+ $this->diskList->setColspecs(array('20px','*','*','40px'));
+ $this->diskList->setHeader(array(("?"),_("Name"),_("Description"),"#"));
+ $this->diskList->setDefaultSortColumn(1);
+
}
}
}
- /* New Listhandling */
- foreach($_POST as $name => $value){
- if(preg_match("/^edit_[^_]*_/",$name)){
- $s_entry = preg_replace("/^edit_/","",$name);
- $s_entry = base64_decode(preg_replace("/_.*/","",$s_entry));
- $s_action = "edit";
- break;
- }
- if (!preg_match("/freeze/i", $this->FAIstate) && preg_match("/^delete_[^_]*_/",$name)){
- $s_entry = preg_replace("/^delete_/","",$name);
- $s_entry = base64_decode(preg_replace("/_.*/","",$s_entry));
- $s_action = "remove";
- break;
- }
+ $this->diskList->save_object();
+ $action = $this->diskList->getAction();
+ if($action['action'] == 'edit'){
+ $s_entry = $this->diskList->getKey($action['targets'][0]);
+ $s_action ="edit";
+ }
+ if($action['action'] == 'delete'){
+ $s_entry = $this->diskList->getKey($action['targets'][0]);
+ $s_action ="remove";
}
-
/* Disk remove was requested.
* Now check if the disk is still in use, in this case
$smarty->assign("addraid", "");
}
- /* Divlist containing disks */
- $divlist = new divSelectBox("FAItemplates");
- $divlist->setHeight(400);
+ $dn = $this->acl_base_for_current_object($this->dn);
+ $acl = $this->ui->get_permissions($dn,"fai/faiPartitionTableEntry");
+ $this->diskList->setAcl($acl);
+ $data = $lData = array();
foreach($this->disks as $key => $disk){
$act = "";
$dn = $this->acl_base_for_current_object($dn);
$acl = $this->ui->get_permissions($dn,"fai/faiPartitionTableEntry");
if(preg_match("/(r|w)/",$acl)) {
-
- $act .= "<input type='image' src='images/lists/edit.png' name='edit_%s' title='"._("edit")."' alt='"._("edit")."'>";
- if(preg_match("/d/",$acl) && !preg_match("/freeze/", $this->FAIstate)){
- $act .="<input type='image' src='images/lists/trash.png' name='delete_%s' title='"._("delete")."' alt='"._("delete")."'>";
- }
-
$cnt= count($disk['partitions']);
-
- $edit_link = "<a href='?plug=".$_GET['plug']."&act=edit&id=".$key."'>".$key."</a>";
- $types= array("old" => "plugins/fai/images/fai_partitionTable.png", "disk" => "plugins/fai/images/fai_partitionTable.png",
+ $types= array(
+ "old" => "plugins/fai/images/fai_partitionTable.png",
+ "disk" => "plugins/fai/images/fai_partitionTable.png",
"raid" => "plugins/fai/images/raid.png", "lvm" => "plugins/ogroups/images/list_ogroup.png");
$type = isset($disk['FAIdiskType'])?$types[$disk['FAIdiskType']]:$types['old'];
- $divlist->AddEntry(array(
- array("string"=> "<img border='0' src='".$type."'>", "attach"=>"style='width:16px'"),
- array("string"=> $edit_link, "attach"=>"style='width:100px'"),
- array("string"=> $disk['description']),
- array("string"=> $cnt, "attach"=>"style='width:16px'"),
- array("string"=>str_replace("%s",base64_encode($key),$act),
- "attach"=>"style='border-right: 0px;width:50px;text-align:right;'")));
+ $data[$key] = $key;
+ $lData[$key] = array('data' => array(image($type),$key,$disk['description'],$cnt));
}
}
- $smarty->assign("Entry_divlist",$divlist->DrawList());
+ $this->diskList->setListData($data,$lData);
+ $this->diskList->update();
+ $smarty->assign("Entry_listing",$this->diskList->render());
$display.= $smarty->fetch(get_template_path('faiPartitionTable.tpl', TRUE));
return($display);
*/
if($this->is_new){
$release = $this->parent->parent->fai_release;
- $new_dn= 'cn='.$this->cn.",".get_ou('faiPartitionRDN').get_ou('faiBaseRDN').$release;
+ $new_dn= 'cn='.$this->cn.",".get_ou("faiPartitionTable", "faiPartitionRDN").get_ou('faiBaseRDN').$release;
$res = faiManagement::check_class_name("FAIpartitionTable",$this->cn,$new_dn);
if(isset($res[$this->cn])){
$message[] = msgPool::duplicated(_("Name"));
"plPriority" => 26,
"plSection" => array("administration"),
"plCategory" => array("fai"),
+ "plProperties" =>
+ array(
+ array(
+ "name" => "faiPartitionRDN",
+ "type" => "rdn",
+ "default" => "ou=disk,",
+ "description" => "The 'faiPartitionRDN' statement defines the location where new fai-partitions will be created. The default is 'ou=disk,'.",
+ "check" => "gosaProperty::isRdn",
+ "migrate" => "",
+ "group" => "plugin",
+ "mandatory" => FALSE)),
+
"plProvidedAcls" => array(
"cn" => _("Name")." ("._("Read only").")",
"description" => _("Description"))