Code

Updated Fax Reports
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 1 Apr 2010 09:00:29 +0000 (09:00 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 1 Apr 2010 09:00:29 +0000 (09:00 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17455 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/gofax/gofax/faxreports/class_faxreport.inc
gosa-plugins/gofax/gofax/faxreports/contents.tpl
gosa-plugins/gofax/gofax/faxreports/detail.tpl
gosa-plugins/gofax/gofax/faxreports/main.inc

index 0a67ff00063e52a61ac01cfc46e2ad7aa99e713d..6bef88124c8b3efa37c83d2c78181ac103aebd36 100644 (file)
@@ -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 = "<img class='center' src='images/lists/locked.png' 
-                    title='"._("Insufficient permissions to view this attribute")."' alt='"._("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 = "<td class='list0'>".$line["uid"]."</td>";
+        $str.= "<td class='list0'>".$str_date."</td>";
 
-        if(preg_match("/r/",$detailedViewACL)){
-          $str = "<td class=\"phonelist\">
-            <a href=\"main.php?plug=".validate($_GET['plug'])."&amp;detail=".$line["id"]."\">
-            <img class='center' alt=\"\" align=\"middle\" border=0 src=\"".get_template_path('images/info_small.png')."\">
-            &nbsp;".$line["uid"].
-            "</a>
-            </td>
-            <td>$str_date</td>";
-        }else{
-          $str = "<td>
-            <img class='center' alt=\"\" align=\"middle\" border=0 src=\"".get_template_path('images/info_small.png')."\">
-            &nbsp;".$line["uid"]."</td>
-            <td>$str_date</td>";
-        }
-        
         /* Add Status td */
         if(preg_match("/r/",$statusACL)){
-          $str.="<td>".$this->status[$line["status"]]."</td>";
+          $str.="<td class='list0'>".$this->status[$line["status"]]."</td>";
         }else{
-          $str.="<td>".$no_acl."</td>";
+          $str.="<td class='list0'>".$no_acl."</td>";
         }
 
         /* Add sender_id td */
         if(preg_match("/r/",$senderidACL)){
-          $str.="<td>".$line["sender_id"]."</td>";
+          $str.="<td class='list0'>".$line["sender_id"]."</td>";
         }else{
-          $str.="<td>".$no_acl."</td>";
+          $str.="<td class='list0'>".$no_acl."</td>";
         }
 
         /* Add receiver_id td */
         if(preg_match("/r/",$receiveridACL)){
-          $str.="<td>".$line["receiver_id"]."</td>";
+          $str.="<td class='list0'>".$line["receiver_id"]."</td>";
         }else{
-          $str.="<td>".$no_acl."</td>";
+          $str.="<td class='list0'>".$no_acl."</td>";
         }
 
         /* Add receiver_id td */
         if(preg_match("/r/",$pagesACL)){
-          $str.="<td>".$line["pages"]."</td>";
+          $str.="<td class='list0'>".$line["pages"]."</td>";
+        }else{
+          $str.="<td class='list0'>".$no_acl."</td>";
+        }
+        /* Create entry html str */
+        if(preg_match("/r/",$detailedViewACL)){
+          $str.= "<td class='list0'>".image('images/info_small.png', 'detail_'.postEncode($line["id"]))."</td>";
         }else{
-          $str.="<td>".$no_acl."</td>";
+          $str.= "<td class='list0'>&nbsp;</td>";
         }
-      $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, "<img alt=\"\" src=\"images/sort_".$this->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)));
   }
 
index efd21740de15c0c8dfba486004406e1c5b692f74..51f19bb9d57913ae71be3e9023570a11c99fded3 100644 (file)
@@ -1,53 +1,71 @@
-<div class="contentboxh">
- <p class="contentboxh">{image path="{$launchimage}" align="right"}{t}Filter{/t}
-</p>
-</div>
-<div class="contentboxb">
- <p class="contentboxb" style="border-top:1px solid #B0B0B0; padding-top:5px;">
- {image path="{$search_image}"}&nbsp;{t}Search for{/t}
-
- <input type='text' name="search_for" size=25 maxlength=60 value="{$search_for}" title="{t}Enter user name to search for{/t}" onChange="mainform.submit()">
- {t}in{/t}
- <select size="1" name="search_base" title="{t}Select subtree to base search on{/t}" onChange="mainform.submit()">
-  {html_options options=$bases selected=$base_select}
- </select>
- {t}during{/t}
- <select size="1" name="month" onChange="mainform.submit()">
-  {html_options options=$months selected=$month_select}
- </select>
- {t}in{/t} 
- <select size="1" name="year" onChange="mainform.submit()">
-  {html_options values=$years output=$years selected=$year_select}
- </select>
- &nbsp;
- <button type='submit' name='search'>{t}Search{/t}</button>
-
-</p>
+<div id="mainlist">
+ <div class="mainlist-header">
+  <p>{t}Fax reports{/t}</p>
+
+  <div class="mainlist-nav">
+   <table summary="{t}Filter{/t}" style="width: 100%;"
+      id="t_scrolltable" cellpadding="0" cellspacing="0">
+    <tr>
+     <td>{t}Date{/t}
+      <select size="1" name="month" onChange="mainform.submit()">
+       {html_options options=$months selected=$month_select}
+      </select>
+      <select size="1" name="year" onChange="mainform.submit()">
+       {html_options values=$years output=$years selected=$year_select}
+      </select>
+     </td>
+     <td>{t}Search for{/t}
+      <input type='text' name="search_for" size=25 maxlength=60
+        value="{$search_for}" title="{t}Enter user name to search for{/t}"
+        onChange="mainform.submit()">
+     </td>
+     <td>
+      <button type='submit' name='search'>{t}Search{/t}</button>
+     </td>
+    </tr>
+   </table>
+
+  </div>
+ </div>
 </div>
 
 <br>
 
 {if $search_result ne ""}
- <table style='width:100%; ' summary="{t}Entry list{/t}">
-
-  <tr style="background-color: #E8E8E8; height:26px; font-weight:bold">
-   <td><a href="main.php{$plug}&amp;sort=0">{t}User{/t} {$mode0}</a></td>
-   <td><a href="main.php{$plug}&amp;sort=1">{t}Date{/t} {$mode1}</a></td>
-   <td><a href="main.php{$plug}&amp;sort=2">{t}Status{/t} {$mode2}</a></td>
-   <td><a href="main.php{$plug}&amp;sort=3">{t}Sender{/t} {$mode3}</a></td>
-   <td><a href="main.php{$plug}&amp;sort=4">{t}Receiver{/t} {$mode4}</a></td>
-   <td><a href="main.php{$plug}&amp;sort=5">{t}# pages{/t} {$mode5}</a></td>
-  </tr>
-  {$search_result}
- </table>
-
- <table style='width:100%; text-align:center;' summary="{t}Page selector{/t}">
-
-  <tr>
-   <td>{$range_selector}</td>
-  </tr>
- </table>
-<hr>
+ <div class="listContainer" id="d_scrollbody" style="min-height: 475px; height: 444px;">
+  <table summary="{t}Phone reports{/t}" style="width:100%;" cellpadding="0" cellspacing="0">
+   <thead class="fixedListHeader listHeaderFormat">
+    <tr>
+     <td class='listheader'><a href="main.php{$plug}&amp;sort=0">{t}User{/t}</a> {$mode0}</td>
+     <td class='listheader'><a href="main.php{$plug}&amp;sort=1">{t}Date{/t}</a> {$mode1}</td>
+     <td class='listheader'><a href="main.php{$plug}&amp;sort=2">{t}Status{/t}</a> {$mode2}</td>
+     <td class='listheader'><a href="main.php{$plug}&amp;sort=3">{t}Sender{/t}</a> {$mode3}</td>
+     <td class='listheader'><a href="main.php{$plug}&amp;sort=4">{t}Receiver{/t}</a> {$mode4}</td>
+     <td class='listheader'><a href="main.php{$plug}&amp;sort=5">{t}# pages{/t}</a> {$mode5}</td>
+     <td class='listheader'>&nbsp;</td>
+    </tr>
+   </thead>
+   <tbody class="listScrollContent listBodyFormat" id="t_nscrollbody">
+    {$search_result}
+    <tr>
+     <td class="list0">&nbsp;</td>
+     <td class="list0">&nbsp;</td>
+     <td class="list0">&nbsp;</td>
+     <td class="list0">&nbsp;</td>
+     <td class="list0">&nbsp;</td>
+     <td class="list0">&nbsp;</td>
+     <td class="list0">&nbsp;</td>
+    </tr>
+   </tbody>
+  </table>
+
+  <table style='width:100%; text-align:center;' summary="{t}Page selector{/t}">
+   <tr>
+    <td>{$range_selector}</td>
+   </tr>
+  </table>
+ </div>
+ <hr>
 
 {else}
   <b>{t}Search returned no results...{/t}</b>
index a633213edb8919d1f99e75aed104df465805c595..feaa386c0ff71dc3d20922896d9e2e5fe11500e4 100644 (file)
@@ -2,12 +2,9 @@
  <tr>
   <td> 
    <a href="plugins/gofax/getfax.php?id={$detail}&amp;download=1">
-     {image path="plugins/gofax/getfax.php?id={$detail}" align="bottom"}
-
+     <img src='plugins/gofax/getfax.php?id={$detail}' align="bottom" alt="{t}Click on fax to download{/t}">
+     <br> {t}Click on fax to download{/t}
    </a>
-   <p style="margin-top-width:0px; text-align:center;">
-    {t}Click on fax to download{/t}
-   </p>
   </td>
   <td style="width:20px;">
     &nbsp;
index ac1ffc359d5fbbfd16fb4b798afe4e2c260a21fc..a4c48d8b765d4e69cfd5f603c0567e0086075730 100644 (file)
@@ -16,7 +16,6 @@ if ( $cleanup ){
        $faxreport->save_object();
        $display= $faxreport->execute ();
        $display.= "<input type=\"hidden\" name=\"ignore\">\n";
-       $display= print_header(get_template_path($faxreport->plIcon), _("FAX reports")).$display;
 
        /* Store changes  in session */
        session::set('faxreport',$faxreport);