From f9c7ce5ad292179f0a70abb4254cea53b3c9497a Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 1 Apr 2010 09:00:29 +0000 Subject: [PATCH] Updated Fax Reports git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17455 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../gofax/faxreports/class_faxreport.inc | 74 ++++++------ .../gofax/gofax/faxreports/contents.tpl | 108 ++++++++++-------- .../gofax/gofax/faxreports/detail.tpl | 7 +- gosa-plugins/gofax/gofax/faxreports/main.inc | 1 - 4 files changed, 98 insertions(+), 92 deletions(-) diff --git a/gosa-plugins/gofax/gofax/faxreports/class_faxreport.inc b/gosa-plugins/gofax/gofax/faxreports/class_faxreport.inc index 0a67ff000..6bef88124 100644 --- a/gosa-plugins/gofax/gofax/faxreports/class_faxreport.inc +++ b/gosa-plugins/gofax/gofax/faxreports/class_faxreport.inc @@ -39,7 +39,7 @@ class faxreport extends plugin /* Include config object */ $this->config = $config; $this->ui = &$ui; - $this->search_base = get_base_from_people($ui->dn); + $this->search_base = $this->config->current['BASE']; $this->year = date("Y"); $this->month = date("m"); @@ -95,17 +95,12 @@ class faxreport extends plugin ************/ $smarty= get_smarty(); - $smarty->assign("launchimage" , get_template_path('images/launch.png')); - $smarty->assign("search_image" , get_template_path('images/lists/search.png')); $smarty->assign("search_for" , $this->search_for); - $smarty->assign("bases" , $this->config->idepartments); - $smarty->assign("base_select" , $this->search_base); $smarty->assign("months" , $months); $smarty->assign("month_select" , $this->month); $smarty->assign("years" , $years); $smarty->assign("year_select" , $this->year); $smarty->assign("search_result" , ""); - /************ Check database accessibility @@ -142,12 +137,19 @@ class faxreport extends plugin Perform a deatil view ************/ + $detail = -1; + foreach($_POST as $name => $desc){ + if(preg_match("/^detail_/", $name)){ + $detail = postDecode(preg_replace("/^detail_/","",$name)); + } + } + /* Do detail view? */ - if (isset($_GET['detail'])){ + if ($detail != -1){ /* Create query */ $query = "SELECT id,uid,date_format(queuing_time, '%Y%m%d%H%i%s') as queuing_time,status,sender_id,sender_msn,receiver_id,". - "receiver_msn,pages,status_message,transfer_time FROM faxlog WHERE id=".$_GET['detail'].";"; + "receiver_msn,pages,status_message,transfer_time FROM faxlog WHERE id=".$detail.";"; /* Connecting, selecting database */ $cfg= $this->config->data['SERVERS']['FAX']; @@ -203,7 +205,7 @@ class faxreport extends plugin Don't forget to check getfax.php if you change somthing here */ session::set('fuserfilter',$this->userfilter); $smarty->assign("plug", "?plug=".validate($_GET['plug'])); - $smarty->assign("detail", validate($_GET['detail'])); + $smarty->assign("detail", validate($detail)); $format= _("Y-M-D"); $date= preg_replace("/Y/", substr($queuing_time,0,4), $format); @@ -222,6 +224,7 @@ class faxreport extends plugin ************/ /* Search button has been pressed */ + $fax_users= array(); if ($this->search_for != ""){ if (is_integer (strpos($this->search_for, "*"))){ @@ -234,16 +237,14 @@ class faxreport extends plugin /* Perform ldap search for potential users */ $filter= "(&(objectClass=gosaAccount)(!(objectClass=gosaUserTemplate))". - "(objectClass=goFaxAccount)". "(|(uid=$s)(l=$s)(homePhone=$s)". "(telephoneNumber=$s)(facsimileTelephoneNumber=$s)(mobile=$s)". "(pager=$s)(cn=$s)(givenName=$s)(sn=$s)(personalTitle=$s)". "(title=$s)))"; - $res = get_list($filter, "users", $this->search_base, array("uid"), GL_SUBSEARCH ); + $res = get_list($filter, "users/user", $this->search_base, array("uid"), GL_SUBSEARCH ); /* Check if we are allowed to collect fax data */ - $fax_users= array(); foreach($res as $attrs){ $acl = $this->ui->get_permissions($attrs['dn'],"users/user","uid"); if(preg_match("/r/",$acl)){ @@ -319,8 +320,7 @@ class faxreport extends plugin } /* Restricted attributes will not be displayed, this will be displayed instead */ - $no_acl = ""._("Insufficient permissions").""; + $no_acl = image('images/lists/locked.png','',_("Insufficient permissions to view this attribute")); /* Create date */ if((!empty($line["queuing_time"])) && preg_match("/r/",$queuingtimeACL)){ @@ -334,52 +334,45 @@ class faxreport extends plugin }else{ $str_date = $no_acl; } - + /* Create entry html str */ + $str = "".$line["uid"].""; + $str.= "".$str_date.""; - if(preg_match("/r/",$detailedViewACL)){ - $str = " - - \"\" -  ".$line["uid"]. - " - - $str_date"; - }else{ - $str = " - \"\" -  ".$line["uid"]." - $str_date"; - } - /* Add Status td */ if(preg_match("/r/",$statusACL)){ - $str.="".$this->status[$line["status"]].""; + $str.="".$this->status[$line["status"]].""; }else{ - $str.="".$no_acl.""; + $str.="".$no_acl.""; } /* Add sender_id td */ if(preg_match("/r/",$senderidACL)){ - $str.="".$line["sender_id"].""; + $str.="".$line["sender_id"].""; }else{ - $str.="".$no_acl.""; + $str.="".$no_acl.""; } /* Add receiver_id td */ if(preg_match("/r/",$receiveridACL)){ - $str.="".$line["receiver_id"].""; + $str.="".$line["receiver_id"].""; }else{ - $str.="".$no_acl.""; + $str.="".$no_acl.""; } /* Add receiver_id td */ if(preg_match("/r/",$pagesACL)){ - $str.="".$line["pages"].""; + $str.="".$line["pages"].""; + }else{ + $str.="".$no_acl.""; + } + /* Create entry html str */ + if(preg_match("/r/",$detailedViewACL)){ + $str.= "".image('images/info_small.png', 'detail_'.postEncode($line["id"])).""; }else{ - $str.="".$no_acl.""; + $str.= " "; } - $this->report_list[] = $str; + $this->report_list[] = $str; } mysql_close($link); @@ -426,8 +419,7 @@ class faxreport extends plugin for($i= 0; $i<7; $i++){ $smarty->assign("mode$i", ""); } - $smarty->assign("mode".$this->sort, "\"\"sort_direction. - ".png\" border=0 align=middle>"); + $smarty->assign("mode".$this->sort, image("images/lists/sort-".$this->sort_direction.".png")); return($smarty->fetch(get_template_path('contents.tpl', TRUE))); } diff --git a/gosa-plugins/gofax/gofax/faxreports/contents.tpl b/gosa-plugins/gofax/gofax/faxreports/contents.tpl index efd21740d..51f19bb9d 100644 --- a/gosa-plugins/gofax/gofax/faxreports/contents.tpl +++ b/gosa-plugins/gofax/gofax/faxreports/contents.tpl @@ -1,53 +1,71 @@ -
-

{image path="{$launchimage}" align="right"}{t}Filter{/t} -

-
-
-

- {image path="{$search_image}"} {t}Search for{/t} - - - {t}in{/t} - - {t}during{/t} - - {t}in{/t} - -   - - -

+
+
+

{t}Fax reports{/t}

+ +
+ + + + + + +
{t}Date{/t} + + + {t}Search for{/t} + + + +
+ +
+

{if $search_result ne ""} - - - - - - - - - - - {$search_result} -
{t}User{/t} {$mode0}{t}Date{/t} {$mode1}{t}Status{/t} {$mode2}{t}Sender{/t} {$mode3}{t}Receiver{/t} {$mode4}{t}# pages{/t} {$mode5}
- - - - - - -
{$range_selector}
-
+
+ + + + + + + + + + + + + + {$search_result} + + + + + + + + + + +
{t}User{/t} {$mode0}{t}Date{/t} {$mode1}{t}Status{/t} {$mode2}{t}Sender{/t} {$mode3}{t}Receiver{/t} {$mode4}{t}# pages{/t} {$mode5} 
       
+ + + + + +
{$range_selector}
+
+
{else} {t}Search returned no results...{/t} diff --git a/gosa-plugins/gofax/gofax/faxreports/detail.tpl b/gosa-plugins/gofax/gofax/faxreports/detail.tpl index a633213ed..feaa386c0 100644 --- a/gosa-plugins/gofax/gofax/faxreports/detail.tpl +++ b/gosa-plugins/gofax/gofax/faxreports/detail.tpl @@ -2,12 +2,9 @@ - {image path="plugins/gofax/getfax.php?id={$detail}" align="bottom"} - + {t}Click on fax to download{/t} +
{t}Click on fax to download{/t}
-

- {t}Click on fax to download{/t} -

  diff --git a/gosa-plugins/gofax/gofax/faxreports/main.inc b/gosa-plugins/gofax/gofax/faxreports/main.inc index ac1ffc359..a4c48d8b7 100644 --- a/gosa-plugins/gofax/gofax/faxreports/main.inc +++ b/gosa-plugins/gofax/gofax/faxreports/main.inc @@ -16,7 +16,6 @@ if ( $cleanup ){ $faxreport->save_object(); $display= $faxreport->execute (); $display.= "\n"; - $display= print_header(get_template_path($faxreport->plIcon), _("FAX reports")).$display; /* Store changes in session */ session::set('faxreport',$faxreport); -- 2.30.2