diff --git a/gosa-plugins/gofax/gofax/faxreports/class_faxreport.inc b/gosa-plugins/gofax/gofax/faxreports/class_faxreport.inc
index 1292b1abad401384511c12135944f2fa659a1a89..f02aef2adf8d17becd895a68d7e8d4da4fa5eccb 100644 (file)
/* 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 >= $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)));
}