summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2a0a191)
raw | patch | inline | side by side (parent: 2a0a191)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 11 Nov 2005 09:05:46 +0000 (09:05 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 11 Nov 2005 09:05:46 +0000 (09:05 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1918 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/gofax/faxaccount/class_gofaxAccount.inc | patch | blob | history |
diff --git a/plugins/gofax/faxaccount/class_gofaxAccount.inc b/plugins/gofax/faxaccount/class_gofaxAccount.inc
index 70cbdf9ba7d83cd07ca92f3a5615cde7bb8d21b3..790525849ac010fbb32b9d1cb323d9ea7977b7c0 100644 (file)
var $cli_description= "Some longer text\nfor help";
var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
+
+ /* Department list shown in the divSelectList*/
var $departments;
/* Fax attributes */
/* General initialization */
plugin::plugin ($config, $dn);
+
+ /* Hickert : 11.11.05
+ * Added to be able to handle department selection in divSelelect
+ */
if(!isset($_SESSION["Fax_Filter"])){
$_SESSION['Fax_Filter']['depselect'] = $this->config->current['BASE'];
}
function execute()
{
- /* Call parent execute */
- plugin::execute();
-
- if((isset($_GET['act']))&&($_GET['act']=="dep_open")){
+ /* Call parent execute */
+ plugin::execute();
+ /* Hickert : 11.11.05
+ * Added to be able to handle department selection in divSelelect
+ */
+ if((isset($_GET['act']))&&($_GET['act']=="dep_open")){
- if(strlen(base64_decode($_GET['dep_id']))>= strlen($this->config->current['BASE'])){
- $_SESSION['Fax_Filter']['depselect']= base64_decode($_GET['dep_id']);
- }else{
- $_SESSION['Fax_Filter']['depselect']= $this->config->current['BASE'];
- }
+ if(strlen(base64_decode($_GET['dep_id']))>= strlen($this->config->current['BASE'])){
+ $_SESSION['Fax_Filter']['depselect']= base64_decode($_GET['dep_id']);
+ }else{
+ $_SESSION['Fax_Filter']['depselect']= $this->config->current['BASE'];
}
+ }
/* Load smarty stuff */
$smarty= get_smarty();
}
}
+ /* 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){
$this->current_blocklist= array_unique($this->current_blocklist);
sort($this->current_blocklist);
reset($this->current_blocklist);
-
}
/* Add list to blocklist */
}
- /* Blocklist edit finished */
+ /* Blocklist edit finished */
if (isset($_POST['edit_blocklists_finish'])){
/* Incoming or outgoing? */
$display.= $smarty->fetch (get_template_path('locals.tpl', TRUE, dirname(__FILE__)));
return ($display);
}
-
-
+
+
/* 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.
+ */
$base = $_SESSION['Fax_Filter']['depselect'];
$ldap->cd($base);
+ /* Ge all Blocklists */
$ldap->search ("(objectClass=goFaxRBlock)",array("cn","description"));
while ($attrs= $ldap->fetch()){
+
+ /* Generate list depending on description */
if(isset($attrs['description'][0])){
$list[$attrs['cn'][0]]=
$attrs['description'][0].
}
}
+ /* Create our divselect box */
$divSel = new divSelectBox("divSelectPredefined");
$divSel->setHeight(300);
$divSel->setWidth(350);
* We also need to search for the departments
* So we are able to navigate like in konquerer
*/
-
- $tmp = array();
$this->departments= array();
+
+ /* Get all departments within the current department */
$base = $_SESSION['Fax_Filter']['depselect'];
$ldap->ls("(objectClass=gosaDepartment)",$base);
+ /* Base back is used to go one department up in our ldap tree */
$base_back = preg_replace("/^[^,]+,/","",$base);
-
+
+ /* Only show base_back if it is needed */
if((strlen($base_back)>= strlen($this->config->current['BASE']))&&($base!=$this->config->current['BASE'])){
$this->departments[preg_replace("/^[^,]+,/","",$base)] = ".. - ["._("back")."]";
}
+
+ /* Fetch all returned departments an add them to our divlist */
while($value = $ldap->fetch()){
if($value["description"][0]!=".."){
$this->departments[$value['dn']]=convert_department_dn($value['dn'])." - [".$value["description"][0]."]";
/* END NEW LIST MANAGMENT
*/
- // Defining Links
+ // This links specifies the department open link
$linkopen = "<a href='?plug=".$_GET['plug']."&act=dep_open&dep_id=%s'>%s</a>";
- /* Insert departments in divlist*/
+ /* Insert departments in divsel */
foreach($this->departments as $key=> $val){
-
if(!isset($this->config->departments[trim($key)])){
$this->config->departments[trim($key)]="";
}
-
$field1 = array("string" => "<img src='images/folder.png' alt='department'>","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));
}
+ /* 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;'")
- ));
+ array("string"=>"<input type='checkbox' value='".base64_encode($entry)."' name='ADDLIST_".base64_encode($entry)."'>"),
+ array("string"=>$value,"attach"=>"style='border:0px;'")
+ ));
}
/* Show dialog */
$smarty->assign("goFaxBlockListACL", chkacl($this->acl, "goFaxBlockList"));
$smarty->assign("departments", $this->config->idepartments);
$smarty->assign("divSelectPredefined", $divSel->DrawList());
-
- if (isset($_POST['department'])){
- $smarty->assign("department", $_POST['department']);
- } else {
- $smarty->assign("department", "");
- }
-
$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.
+ */
$base = $_SESSION['Fax_Filter']['depselect'];
$ldap->cd($base);
+ /* Ge all Blocklists */
$ldap->search ("(objectClass=goFaxSBlock)",array("cn","description"));
while ($attrs= $ldap->fetch()){
if(isset($attrs['description'][0])){
}
}
+ /*Create DivSel*/
$divSel = new divSelectBox("divSelectPredefined");
$divSel->setHeight(300);
$divSel->setWidth(350);
* We also need to search for the departments
* So we are able to navigate like in konquerer
*/
- $tmp = array();
$this->departments= array();
$ldap->ls("(objectClass=gosaDepartment)",$base);
+ /* Generate Back url, and append if it is needed */
$base_back = preg_replace("/^[^,]+,/","",$base);
-
if((strlen($base_back)>= strlen($this->config->current['BASE']))&&($base!=$this->config->current['BASE'])){
$this->departments[preg_replace("/^[^,]+,/","",$base)] = ".. - ["._("back")."]";
}
+
+ /* Get all departments */
while($value = $ldap->fetch()){
if(isset($value["description"][0])){
$this->departments[$value['dn']]=convert_department_dn($value['dn'])." - [".$value["description"][0]."]";
$divSel->AddEntry(array($field1,$field2));
}
+ /* Append Blocklits */
foreach($list as $entry => $value){
$divSel->AddEntry(array(
array("string"=>"<input type='checkbox' value='".base64_encode($entry)."' name='ADDLIST_".base64_encode($entry)."'>"),
));
}
-
/* Show dialog */
$smarty->assign("cblocklist", $this->current_blocklist);
$smarty->assign("goFaxBlockListACL", chkacl($this->acl, "goFaxBlockList"));
$smarty->assign("departments", $this->config->idepartments);
$smarty->assign("divSelectPredefined", $divSel->DrawList());
- if (isset($_POST['department'])){
- $smarty->assign("department", $_POST['department']);
- } else {
- $smarty->assign("department", "");
- }
-
-
$display.= $smarty->fetch (get_template_path('lists.tpl', TRUE, dirname(__FILE__)));
return ($display);
}
$message[]= _("The mail address you've entered is invalid.");
}
}
-
+
// IE Fix, IE lets you choose disabled option, stupid browser ...
if((empty($this->goFaxPrinter))&&($this->goFaxDeliveryMode & 64)){
$message[]= _("Deliver fax to printer, is only possible if valid printer is given. Please correct your choice.");
/* Write to object */
if (chkacl ($this->acl, "goFaxDeliveryMode") == ""){
if ($tmp != $this->goFaxDeliveryMode){
- $this->is_modified= TRUE;
+ $this->is_modified= TRUE;
}
$this->goFaxDeliveryMode= "$tmp";
}