From: hickert ";
+ foreach($this->dns as $dn){
+ add_lock ($dn, $this->ui->dn);
+ $dns_names .= $dn."\n";
+ }
+ $dns_names .="
";
+
+ /* Lock the current entry, so nobody will edit it during deletion */
+ $smarty->assign("info", sprintf(_("You're about to delete the following blocklists(s) %s"), @LDAP::fix($dns_names)));
+ $smarty->assign("multiple", true);
+ return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+ }
+ }
+
+
+ /********************
+ Delete MULTIPLE entries confirmed
+ ********************/
+
+ /* Confirmation for deletion has been passed. Users should be deleted. */
+ if (isset($_POST['delete_multiple_blocklist_confirm'])){
+
+ /* Remove user by user and check acls before removeing them */
+ foreach($this->dns as $key => $dn){
+ $acl = $this->ui->get_permissions($dn, "blocklist/blocklist");
+ if (preg_match('/d/', $acl)){
+ $this->dn = $dn;
+ $this->remove_from_parent();
+ } else {
+ print_red (sprintf(_("You are not allowed to delete the blocklist '%s'!"),$dn));
+ }
+ /* Remove lock file after successfull deletion */
+ del_lock ($dn);
+ unset($this->dns[$key]);
+ }
+ $this->reload();
+ }
+
+
+ /********************
+ Delete MULTIPLE entries Canceled
+ ********************/
+
+ /* Remove lock */
+ if(isset($_POST['delete_multiple_blocklist_cancel'])){
+ foreach($this->dns as $key => $dn){
+ del_lock ($dn);
+ unset($this->dns[$key]);
+ }
+ }
+
+
/***************
Remove blocklist
***************/
@@ -165,6 +237,7 @@ class blocklist extends plugin
add_lock ($this->dn, $this->ui->dn);
$smarty->assign("info", sprintf(_("You're about to delete the blocklist '%s'."), $this->dn));
+ $smarty->assign("multiple", false);
return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
}
}
@@ -351,7 +424,7 @@ class blocklist extends plugin
/* Add departments if subsearch is disabled */
if(!$this->DivListBlocklist->SubSearch){
- $this->DivListBlocklist->AddDepartments($this->DivListBlocklist->selectedBase);
+ $this->DivListBlocklist->AddDepartments($this->DivListBlocklist->selectedBase,3,1);
}
$this->reload();
$this->DivListBlocklist->setEntries($this->blocklists);
@@ -360,6 +433,19 @@ class blocklist extends plugin
}
+ function list_get_selected_items()
+ {
+ $ids = array();
+ foreach($_POST as $name => $value){
+ if(preg_match("/^item_selected_[0-9]*$/",$name)){
+ $id = preg_replace("/^item_selected_/","",$name);
+ $ids[$id] = $id;
+ }
+ }
+ return($ids);
+ }
+
+
/* Return departments, that will be included within snapshot detection */
function get_used_snapshot_bases()
{
diff --git a/plugins/gofax/blocklists/class_divListBlocklists.inc b/plugins/gofax/blocklists/class_divListBlocklists.inc
index f96f64c43..02c616324 100755
--- a/plugins/gofax/blocklists/class_divListBlocklists.inc
+++ b/plugins/gofax/blocklists/class_divListBlocklists.inc
@@ -47,7 +47,12 @@ class divListBlocklist extends MultiSelectWindow
$action_col_size += 20;
}
+ /* Toggle all selected / deselected */
+ $chk = "";
+
/* set Page header */
+ $this->AddHeader(array("string"=> $chk, "attach"=>"style='width:20px;'"));
$this->AddHeader(array("string" => " ", "attach" => "style='text-align:center;width:20px;'"));
$this->AddHeader(array("string" => _("Blocklist name")." / "._("Department"), "attach" => "style=''"));
$this->AddHeader(array("string" => _("Actions"), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'" ));
@@ -114,8 +119,13 @@ class divListBlocklist extends MultiSelectWindow
/* Append department selector */
$listhead .= " "._("Base")." ".
" ".
- "";
+ title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'> ";
+
+ /* Multiple options */
+ $listhead .= " ";
+
+ $listhead .="";
$this->SetListHeader($listhead);
}
@@ -167,10 +177,15 @@ class divListBlocklist extends MultiSelectWindow
}else{
$display= $val["cn"][0];
}
+
+
+ /* Create each field */
+ $field0 = array("string" => "" ,
+ "attach" => "style='width:20px;'");
$field1 = array("string" => sprintf($blockimg,$val['dn']), "attach" => "style='text-align:center;width:20px;'");
$field2 = array("string" => sprintf($editlink,$key,$display), "attach" => "style='' title='".preg_replace('/ /', ' ', @LDAP::fix($val['dn']))."'");
$field3 = array("string" => preg_replace("/%KEY%/", "$key", $action), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
- $this->AddElement( array($field1,$field2,$field3));
+ $this->AddElement( array($field0,$field1,$field2,$field3));
}
}
diff --git a/plugins/gofax/blocklists/remove.tpl b/plugins/gofax/blocklists/remove.tpl
index 6784741a4..ebea1e3ca 100644
--- a/plugins/gofax/blocklists/remove.tpl
+++ b/plugins/gofax/blocklists/remove.tpl
@@ -11,8 +11,14 @@
- - - + {if $multiple} + + + + {else} + + + + {/if}