summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e8a7e1b)
raw | patch | inline | side by side (parent: e8a7e1b)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 1 Dec 2005 09:34:25 +0000 (09:34 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 1 Dec 2005 09:34:25 +0000 (09:34 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2169 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/gofax/faxreports/class_faxreport.inc | patch | blob | history | |
plugins/gofax/faxreports/main.inc | patch | blob | history |
diff --git a/plugins/gofax/faxreports/class_faxreport.inc b/plugins/gofax/faxreports/class_faxreport.inc
index 32e98614fff84868b79546bbbdacbbc572488403..9d1adcf071e4c26595257295a5ed35297a5729ae 100644 (file)
var $fields= array("uid", "queuing_time", "status", "sender_id", "receiver_id", "pages");
/* attribute list for save action */
- var $attributes= array();
+ var $attributes= array("search_for","search_base","month","year");
var $objectclasses= array();
function faxreport ($config, $ui)
"search_base" => $base,
"search_for" => "*");
register_global("faxreportfilter", $faxfilter);
- }
+ $this->year = date("Y");
+ $this->month = date("m");
+ $this->search_base = $base;
+ $this->search_for = "*";
+ }else{
+ $this->year = $_SESSION['faxreportfilter']['year'];
+ $this->month = $_SESSION['faxreportfilter']['month'];
+ $this->search_base = $_SESSION['faxreportfilter']['search_base'];
+ $this->search_for = $_SESSION['faxreportfilter']['search_for'];
+ }
}
function execute()
$years[]= $y;
}
+ /* Get template engine */
+ $faxfilter= get_global("faxreportfilter");
+ foreach( array("year", "month", "search_for", "search_base") as $type){
+ if (isset($_POST[$type])){
+ $faxfilter[$type]= $_POST[$type];
+ }
+ $this->$type= $faxfilter[$type];
+ }
+ register_global("faxreportfilter", $faxfilter);
$smarty= get_smarty();
$smarty->assign("launchimage" , get_template_path('images/launch.png'));
$smarty->assign("search_image" , get_template_path('images/search.png'));
print_red(_("Can't select fax database for report generation!"));
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}
+
+ if (! mysql_query("SELECT * FROM faxlog;")){
+ print_red(_("Can't select fax database for report generation!"));
+ return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
+ }
}
if(isset($_POST['EntriesPerPage'])){
$this->range = $_POST['EntriesPerPage'];
}
- /* Get template engine */
- $faxfilter= get_global("faxreportfilter");
- foreach( array("year", "month", "search_for", "search_base") as $type){
- if (isset($_POST[$type])){
- $faxfilter[$type]= $_POST[$type];
- }
- $this->$type= $faxfilter[$type];
- }
- register_global("faxreportfilter", $faxfilter);
/* Adapt sorting */
if (isset($_GET['sort'])){
if (!preg_match ("/'".$line["uid"]."'/", $this->userfilter)){
print_red (_("You have no permission to retrieve informations about this fax id!"));
- return;
+ return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}
$parts= array( "id", "uid", "queuing_time", "status", "sender_id", "sender_msn",
$fax_users= array();
while ($attrs= $ldap->fetch()){
- $acl= get_permissions ($ldap->getDN(), $this->ui->subtreeACL);
- $acl= get_module_permission($acl, "fax", $ldap->getDN());
- if (chkacl ($acl, "faxReport") == ""){
+ if (chkacl ($this->acl, "faxreport") == ""){
$fax_users[]= $attrs["uid"][0];
}
}
$this->userfilter= preg_replace("/OR $/", "", $this->userfilter);
}
-
/* Perform SQL query */
if ($this->userfilter){
if ($this->sort_direction == "down"){
}
}
-
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
index cfa7de0739425332e238784ce84038acf0711810..24beb48aa8953208b2e25acb8e8a3ffd11a6521c 100644 (file)
if (!$remove_lock){
/* Page header*/
- $display= print_header(get_template_path('images/reports.png'), _("FAX reports"));
+ $display= print_header(get_template_path('images/reports.png'), _("FAX reports"));
- /* Create faxreport object on demand */
- if (!isset($_SESSION['faxreport']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){
- $_SESSION['faxreport']= new faxreport ($config, $ui);
- }
- $faxreport= $_SESSION['faxreport'];
+ /* Create faxreport object on demand */
+ if (!isset($_SESSION['faxreport']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){
+ $_SESSION['faxreport']= new faxreport ($config, $ui);
+ }
+ $faxreport= $_SESSION['faxreport'];
- /* Execute formular */
+ /* set permissions */
+ $acl= get_permissions ($ui->dn, $ui->subtreeACL);
+ $faxreport->acl= get_module_permission($acl, "faxreport", $ui->dn);
+
+ /* Execute formular */
$display.= $faxreport->execute ();
$display.= "<input type=\"hidden\" name=\"ignore\">\n";