diff --git a/gosa-plugins/gofax/gofax/faxreports/class_faxreport.inc b/gosa-plugins/gofax/gofax/faxreports/class_faxreport.inc
index 41e0fc47160179a046cf8865be4222448fb46e5b..f02aef2adf8d17becd895a68d7e8d4da4fa5eccb 100644 (file)
/* Get global filter config and set class vars ,
or create a filter */
- if (!is_global("faxreportfilter")){
+ if (!session::is_set("faxreportfilter")){
$faxreportfilter = array();
foreach($this->attributes_SO as $name){
$faxreportfilter[$name] = $this->$name;
}
- register_global("faxreportfilter",$faxreportfilter);
+ session::set("faxreportfilter",$faxreportfilter);
}else{
- $faxreportfilter = get_global("faxreportfilter");
+ $faxreportfilter = session::get("faxreportfilter");
foreach($this->attributes_SO as $name){
$this->$name = $faxreportfilter[$name];
}
/* Some checks */
if(!isset($this->config->data['SERVERS']['FAX'])){
- print_red(_("No fax extension defined in your server configuration, no reports can be shown!"));
+ msg_dialog::display(_("Error"), _("No fax server found!"), ERROR_DIALOG);
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}elseif(!is_callable("mysql_connect")){
- print_red(_("There is no mysql extension available, please check your php setup."));
+ msg_dialog::display(_("Configuration error"), sprintf(_("Missing %s PHP extension!"), "mysql"), WARNING_DIALOG);
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}else{
/* Connecting, selecting database */
$cfg = $this->config->data['SERVERS']['FAX'];
$link = @mysql_pconnect($cfg['SERVER'], $cfg['LOGIN'], $cfg['PASSWORD']);
if ($link === FALSE){
- print_red(_("Can't connect to fax database, no reports can be shown!"));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot connect to %s database!"), "GOfax"), ERROR_DIALOG);
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}
if (! @mysql_select_db("gofax")){
- print_red(_("Can't select fax database for report generation!"));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot select %s database!"), "GOfax"), ERROR_DIALOG);
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}
if (! mysql_query("SELECT * FROM faxlog;")){
- print_red(_("Can't query fax table 'faxlog' for report generation!"));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot query %s database!"), "GOfax"), ERROR_DIALOG);
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}
}
/* Check if everything went ok*/
$result = @mysql_query($query);
if ($result === false){
- print_red(_("Query for fax database failed!"));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot query %s database!"), "GOfax"), ERROR_DIALOG);
@DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query failed");
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}
mysql_close($link);
if (!preg_match ("/'".$line["uid"]."'/", $this->userfilter)){
- print_red (_("You have no permission to retrieve informations about this fax id!"));
+ msg_dialog::display(_("Permission error"), _("You have no permission to view this fax id!"), ERROR_DIALOG);
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}
$dn = $fax_uids[$uid];
$acls = $this->ui->get_permissions($dn,"faxreport/faxreport");
if(!preg_match("/r/",$acls)){
- print_red (_("You have no permission to retrieve informations about this fax id!"));
+ msg_dialog::display(_("Permission error"), _("You have no permission to view this fax id!"), ERROR_DIALOG);
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}
$queuing_time= $line['queuing_time'];
/* The user is allowed to download all fax images from those users
- that are listed in $_SESSION['fuserfilter']
+ that are listed in session::get('fuserfilter')
Don't forget to check getfax.php if you change somthing here */
- $_SESSION['fuserfilter']= $this->userfilter;
+ session::set('fuserfilter',$this->userfilter);
$smarty->assign("plug", "?plug=".validate($_GET['plug']));
$smarty->assign("detail", validate($_GET['detail']));
"queuing_time >= $start ORDER BY ".$this->fields[$this->sort]." $desc;";
if(!is_callable("mysql_connect")){
- print_red("There is no mysql extension configured in your php setup.");
+ msg_dialog::display(_("Configuration error"), sprintf(_("Missing %s PHP extension!"), "mysql"), WARNING_DIALOG);
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}
@DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query");
$result = @mysql_query($query);
if ($result === false){
- print_red(_("Query for fax database failed!"));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot query %s database!"), "GOfax"), ERROR_DIALOG);
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}
}
- /* Save ui input, and store it in $_SESSION
+ /* Save ui input, and store it in session::get()
to remember last search next time*/
function save_object()
{
- $faxreportfilter = get_global("faxreportfilter");
+ $faxreportfilter = session::get("faxreportfilter");
if(isset($_POST['EntriesPerPage'])){
$this->range = $_POST['EntriesPerPage'];
}
foreach($this->attributes_SO as $name){
$faxreportfilter[$name] = $this->$name;
}
- register_global("faxreportfilter",$faxreportfilter);
+ session::set("faxreportfilter",$faxreportfilter);
}