summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9c909d3)
raw | patch | inline | side by side (parent: 9c909d3)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 12 Apr 2010 09:40:22 +0000 (09:40 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 12 Apr 2010 09:40:22 +0000 (09:40 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17584 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc | patch | blob | history | |
gosa-plugins/gofax/gofax/faxaccount/lists.tpl | patch | blob | history |
diff --git a/gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc b/gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc
index 59f474343d712c3ee5653f0012633c578377430b..9739357560012de065d14857b6449dd070b2c703 100644 (file)
var $plDescription= "This does something";
var $plIcon = "plugins/gofax/images/plugin.png";
- /* Department list shown in the divSelectList*/
var $departments;
/* Fax attributes */
}
/* Hickert : 11.11.05
- * Added to be able to handle department selection in divSelelect
*/
if(!session::is_set("Fax_Filter")){
$Fax_Filter = array();
$this->printerList[$this->goFaxPrinter] = "[".$this->goFaxPrinter."]";
}
- /* Get global filter config */
- if (!session::is_set("faxfilter")){
- $ui= get_userinfo();
- $base= get_base_from_people($ui->dn);
- $faxfilter= array( "depselect" => $base,
- "fuser" => "*",
- "regex" => "");
- session::set("faxfilter", $faxfilter);
- }
+ // Prepare lists
+ $this->predefinedList = new sortableListing();
+ $this->predefinedList->setDeleteable(false);
+ $this->predefinedList->setEditable(false);
+ $this->predefinedList->setWidth("100%");
+ $this->predefinedList->setHeight("300px");
+ $this->predefinedList->setColspecs(array('20px','*'));
+ $this->predefinedList->setHeader(array("~",_("Name")));
+ $this->predefinedList->setDefaultSortColumn(1);
}
function execute()
new log("view","users/".get_class($this),$this->dn);
}
- /* Hickert : 11.11.05
- * Added to be able to handle department selection in divSelelect
+ /* Department selection handling
*/
if((isset($_GET['act']))&&($_GET['act']=="dep_open")){
-
$Fax_Filter = session::get('Fax_Filter');
if(strlen(base64_decode($_GET['dep_id']))>= strlen($this->config->current['BASE'])){
$Fax_Filter['depselect']= base64_decode($_GET['dep_id']);
}
}
- /* Hickert : 11.11.05
- * Add selection from divSelelect to our Blocklist
- */
/* Add list to blocklist */
if (isset($_POST['add_blocklist'])){
foreach($_POST as $name => $value){
/* Manage incoming blocklists */
if ($this->in_blocklist_dialog){
- /* This handles the divSelectBox */
-
/* The base specifies the current position in the ldap tree
* The current base was specified by $_GET['dep_id'] before. Or contains the default value.
*/
}
}
- /* Create our divselect box */
- $divSel = new divSelectBox("divSelectPredefined");
- $divSel->setHeight(296);
-
/* NEW LIST MANAGMENT
* We also need to search for the departments
* So we are able to navigate like in konquerer
$linkopen = "<a href='?plug=".$_GET['plug']."&act=dep_open&dep_id=%s'>%s</a>";
/* Insert departments in divsel */
+ $data = $lData = array();
foreach($this->departments as $key=> $val){
if(!isset($this->config->departments[trim($key)])){
$this->config->departments[trim($key)]="";
}
- $field1 = array("string" => image("images/lists/folder.png"),"attach"=>"style='width:16px; text-align:center;'");
- $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val),"attach"=>" style='border:none'");
- $divSel->AddEntry(array($field1,$field2));
+ $img = image('images/lists/folder.png');
+ $val = sprintf( $linkopen, postEncode($key), $val);
+ $data[] = array('TYPE' => 'DEP', 'ID' => $key);
+ $lData[] = array('data' => array($img,$val));
}
+
/* Append predefined Blocklists */
foreach($list as $entry => $value){
- $divSel->AddEntry(array(
- array("string"=>"<input type='checkbox' value='".base64_encode($entry)."' name='ADDLIST_".base64_encode($entry)."'>"),
- array("string"=>$value,"attach"=>"style='border:0px;'")
- ));
+ $chk = "<input type='checkbox' value='".base64_encode($entry)."'
+ name='ADDLIST_".base64_encode($entry)."'>";
+ $data[] = array('TYPE' => 'ENTRY', 'ID' => $key);
+ $lData[] = array('data' => array($chk,$value));
}
+ $this->predefinedList->setAcl('rwcdm');
+ $this->predefinedList->setListData($data,$lData);
+ $this->predefinedList->update();
+
+
/* Show dialog */
$smarty->assign("cblocklist", $this->current_blocklist);
$smarty->assign("departments", $this->config->idepartments);
- $smarty->assign("divSelectPredefined", $divSel->DrawList());
+ $smarty->assign("predefinedList", $this->predefinedList->render());
$display.= $smarty->fetch (get_template_path('lists.tpl', TRUE, dirname(__FILE__)));
return ($display);
}
if ($this->out_blocklist_dialog){
- /* This handles the divSelectBox */
-
/* The base specifies the current position in the ldap tree
* The current base was specified by $_GET['dep_id'] before. Or contains the default value.
*/
}
}
- /*Create DivSel*/
- $divSel = new divSelectBox("divSelectPredefined");
- $divSel->setHeight(296);
-
/* NEW LIST MANAGMENT
* We also need to search for the departments
* So we are able to navigate like in konquerer
/* END NEW LIST MANAGMENT
*/
- // Defining Links
+ /* Insert departments in divsel */
$linkopen = "<a href='?plug=".$_GET['plug']."&act=dep_open&dep_id=%s'>%s</a>";
-
- /* Insert departments in divlist*/
+ $data = $lData = array();
foreach($this->departments as $key=> $val){
if(!isset($this->config->departments[trim($key)])){
$this->config->departments[trim($key)]="";
}
-
- $field1 = array("string" => image("images/lists/folder.png"),"attach"=>"style='width:16px; text-align:center;'");
- $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val),"attach"=>" style='border:none'");
- $divSel->AddEntry(array($field1,$field2));
+ $img = image('images/lists/folder.png');
+ $val = sprintf( $linkopen, postEncode($key), $val);
+ $data[] = array('TYPE' => 'DEP', 'ID' => $key);
+ $lData[] = array('data' => array($img,$val));
}
- /* Append Blocklits */
+
+ /* Append predefined Blocklists */
foreach($list as $entry => $value){
- $divSel->AddEntry(array(
- array("string"=>"<input type='checkbox' value='".base64_encode($entry)."' name='ADDLIST_".base64_encode($entry)."'>"),
- array("string"=>$value,"attach"=>"style='border:0px;'")
- ));
+ $chk = "<input type='checkbox' value='".base64_encode($entry)."'
+ name='ADDLIST_".base64_encode($entry)."'>";
+ $data[] = array('TYPE' => 'ENTRY', 'ID' => $key);
+ $lData[] = array('data' => array($chk,$value));
}
+ $this->predefinedList->setAcl('rwcdm');
+ $this->predefinedList->setListData($data,$lData);
+ $this->predefinedList->update();
+
/* Show dialog */
$smarty->assign("cblocklist", $this->current_blocklist);
$smarty->assign("departments", $this->config->idepartments);
- $smarty->assign("divSelectPredefined", $divSel->DrawList());
+ $smarty->assign("predefinedList", $this->predefinedList->render());
$display.= $smarty->fetch (get_template_path('lists.tpl', TRUE, dirname(__FILE__)));
return ($display);
}
diff --git a/gosa-plugins/gofax/gofax/faxaccount/lists.tpl b/gosa-plugins/gofax/gofax/faxaccount/lists.tpl
index 6d6a755e549742f169a64748a3464ab04abc0c37..35d3a350a137020d9002ce1e4fd7cb05913ba111 100644 (file)
<table style="width:100%;height:300px;" summary="{t}List of blocked numbers{/t}">
<tr>
<td valign="top">
- {$divSelectPredefined}
+ {$predefinedList}
</td>
</tr>
</table>