From b27dce8b0c43c73a52c85320e3a2086828b43af3 Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 28 Feb 2008 10:26:23 +0000 Subject: [PATCH] print_red replacements, translation updates git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9182 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../dfs/addons/godfs/class_dfsgeneric.inc | 4 -- .../services/dhcp/class_dhcpAdvanced.inc | 4 +- .../services/dhcp/class_dhcpNetwork.inc | 2 +- .../systems/services/dhcp/class_servDHCP.inc | 10 ++--- .../systems/services/dns/class_servDNS.inc | 9 +--- .../services/dns/class_servDNSeditZone.inc | 35 +++++++-------- .../dns/class_servDNSeditZoneEntries.inc | 23 +++++----- .../fai/admin/fai/class_askClassName.inc | 5 --- gosa-plugins/fai/admin/fai/class_faiHook.inc | 13 ++---- .../fai/admin/fai/class_faiHookEntry.inc | 18 +++----- .../fai/admin/fai/class_faiManagement.inc | 45 +++++++++---------- .../fai/admin/fai/class_faiPackage.inc | 13 ++---- .../fai/class_faiPackageConfiguration.inc | 5 --- .../fai/admin/fai/class_faiPackageEntry.inc | 11 ++--- .../fai/admin/fai/class_faiPartitionTable.inc | 7 +-- .../fai/class_faiPartitionTableEntry.inc | 5 --- .../fai/admin/fai/class_faiProfile.inc | 13 ++---- .../fai/admin/fai/class_faiProfileEntry.inc | 5 --- .../fai/admin/fai/class_faiScript.inc | 7 +-- .../fai/admin/fai/class_faiScriptEntry.inc | 19 +++----- .../fai/admin/fai/class_faiSummaryTab.inc | 2 +- .../fai/admin/fai/class_faiTemplate.inc | 7 +-- .../fai/admin/fai/class_faiTemplateEntry.inc | 5 --- .../fai/admin/fai/class_faiVariable.inc | 7 +-- .../fai/admin/fai/class_faiVariableEntry.inc | 5 --- gosa-plugins/fai/admin/fai/tabsHook.inc | 2 +- gosa-plugins/fai/admin/fai/tabsPackage.inc | 2 +- gosa-plugins/fai/admin/fai/tabsPartition.inc | 2 +- gosa-plugins/fai/admin/fai/tabsProfile.inc | 2 +- gosa-plugins/fai/admin/fai/tabsScript.inc | 2 +- gosa-plugins/fai/admin/fai/tabsTemplate.inc | 2 +- gosa-plugins/fai/admin/fai/tabsVariable.inc | 2 +- .../blocklists/class_blocklistGeneric.inc | 8 ++-- .../blocklists/class_blocklistManagement.inc | 4 +- .../gofax/faxaccount/class_gofaxAccount.inc | 18 +++----- .../gofax/faxreports/class_faxreport.inc | 20 ++++----- 36 files changed, 120 insertions(+), 223 deletions(-) diff --git a/gosa-plugins/dfs/addons/godfs/class_dfsgeneric.inc b/gosa-plugins/dfs/addons/godfs/class_dfsgeneric.inc index 78156392a..eb3bd4cec 100644 --- a/gosa-plugins/dfs/addons/godfs/class_dfsgeneric.inc +++ b/gosa-plugins/dfs/addons/godfs/class_dfsgeneric.inc @@ -1,10 +1,6 @@ "Eins ist toll", "zwei" => "Zwei ist noch besser"); /* Needed values and lists */ var $base = ""; diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpAdvanced.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpAdvanced.inc index 43f583152..3e2be402e 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpAdvanced.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpAdvanced.inc @@ -50,7 +50,7 @@ class dhcpAdvanced extends plugin if (isset($_POST['delete_statement']) && isset($_POST['dhcpstatements'])){ $key= preg_replace('/([a-z0-9-]+)\s(.*)$/', '\\1', get_post('dhcpstatements')); if (in_array($key, $this->autoStatements)){ - print_red(_("Can't delete automatic statements. Please use the fields above.")); + msg_dialog::display(_("Error"), _("Cannot delete automatic statements!"), ERROR_DIALOG); } else { unset($this->statements[$key]); } @@ -63,7 +63,7 @@ class dhcpAdvanced extends plugin if (isset($_POST['delete_option']) && isset($_POST['dhcpoptions'])){ $key= preg_replace('/([a-z0-9-]+)\s(.*)$/', '\\1', get_post('dhcpoptions')); if (in_array($key, $this->autoOptions)){ - print_red(_("Can't delete automatic options. Please use the fields above.")); + msg_dialog::display(_("Error"), _("Cannot delete automatic statements!"), ERROR_DIALOG); } else { unset($this->options[$key]); } diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc index 146b0e21b..47cd48750 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc @@ -39,7 +39,7 @@ class dhcpNetwork extends plugin /* Check for iteraction */ if (isset($_POST['add_dns']) && $_POST['addserver'] != ""){ if (!preg_match('/^[0-9a-z.-]+$/', get_post('addserver'))){ - print_red(_("The name of the DNS server your're going to add is not valid!")); + msg_dialog::display(_("Error"), sprintf(_("'%s' is not a valid DNS server name!"), htmlentities(get_post('addserver'))), ERROR_DIALOG); } else { $servers= array(); if (isset($this->options['domain-name-servers'])){ diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc index e9f28da6e..6fa4628ca 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc @@ -100,12 +100,12 @@ class servdhcp extends goService $this->dialog = FALSE; $id = $this->take_over_id; $smarty->assign("dns_take_over",TRUE); - $warning = sprintf(_("You are going to migrate the DHCP setup from server '%s'."), + $warning = sprintf(_("You have requested a migration of the DHCP setup from server '%s' to the current one."), $this->dhcp_server_list['ENTRIES'][$id]['cn'][0]); - $warning.= " "._("The migration will be started when you save this system. To cancel this action, use the cancel button below."); + $warning.= " "._("The migration will be started when you save this system."); if($this->display_warning){ - print_red($warning); + msg_dialog::display(_("Warning"), $warning, WARNING_DIALOG); $this->display_warning = FALSE; } return($smarty->fetch(get_template_path('servdhcp.tpl', TRUE, dirname(__FILE__)))); @@ -218,7 +218,7 @@ class servdhcp extends goService } } } else { - print_red(_("You're not allowed to remove DHCP sections!")); + msg_dialog::display(_("Permission error"), _("You have no permission to remove DHCP sections!"), ERROR_DIALOG); } $this->dialog= FALSE; } @@ -671,7 +671,7 @@ class servdhcp extends goService /* That should not happen... */ if ($type == ""){ - print_red(_("DHCP configuration set is unknown. Please contact your system administrator.")); + msg_dialog::display(_("Error"), _("The DHCP configuration set is unkown. Please contact your system administrator."), ERROR_DIALOG); } return ($type); diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc index dfddd446a..cddac417d 100644 --- a/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc +++ b/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc @@ -2,11 +2,6 @@ class servdns extends goService { - /* CLI vars */ - var $cli_summary= "Manage server basic objects"; - var $cli_description= "Some longer text\nfor help"; - var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account = FALSE; var $attributes = array(); @@ -186,7 +181,7 @@ class servdns extends goService */ if(count($this->dialog->check())){ foreach($this->dialog->check() as $msgs){ - print_red($msgs); + msg_dialog::display(_("Error"), $msgs, ERROR_DIALOG); } }else{ /* add new/edited zone @@ -344,7 +339,7 @@ class servdns extends goService if(count($used)> 2) { $str .=" ... "; } - print_red(sprintf(_("Can't delete the selected zone, because it is still in use by these entry/entries '%s'"),trim($str))); + msg_dialog::display(_("Error"), sprintf(_("Cannot delete the selected zone. It is still in use by '%s'"), trim($str)), ERROR_DIALOG); return(false); }else{ unset($this->Zones[$id]); diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc index bb7053e70..8b90877f9 100644 --- a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc +++ b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc @@ -2,11 +2,6 @@ class servdnseditZone extends plugin { - /* CLI vars */ - var $cli_summary= "Manage server basic objects"; - var $cli_description= "Some longer text\nfor help"; - var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account= TRUE; var $attributes = array("zoneName","ReverseZone","dNSClass", @@ -242,7 +237,7 @@ class servdnseditZone extends plugin if(count($this->dialog->check())){ $msgs = $this->dialog->check(); foreach($msgs as $msg){ - print_red($msg); + msg_dialog::display(_("Error"), $msg , ERROR_DIALOG); } }else{ $this->zoneEditor = clone $this->dialog; @@ -418,41 +413,41 @@ class servdnseditZone extends plugin } if(empty($this->zoneName)){ - $message[] =sprintf(_("Please choose a valid zone name.")); + $message[] =sprintf(_("The zone name is not valid!")); } if(empty($this->ReverseZone)){ - $message[] =sprintf(_("Please choose a valid reverse zone name.")); + $message[] =sprintf(_("The reverse zone is not valid!")); } if($this->zoneName != strtolower($this->zoneName)){ - $message[] = _("Only lowercase strings are allowed as zone name."); + $message[] = _("Only lowercase characters are allowed in zone names!"); } if(!is_numeric($this->sOAserial)){ - $message[] = _("Please specify a numeric value for serial number."); + $message[] = sprintf(_("'%s' is not numeric!"), _("Serial")); } if(!is_numeric($this->sOArefresh)){ - $message[] = _("Please specify a numeric value for refresh."); + $message[] = sprintf(_("'%s' is not numeric!"), _("Refresh")); } if(!is_numeric($this->sOAttl)){ - $message[] = _("Please specify a numeric value for ttl."); + $message[] = sprintf(_("'%s' is not numeric!"), _("TTL")); } if(!is_numeric($this->sOAexpire)){ - $message[] = _("Please specify a numeric value for expire."); + $message[] = sprintf(_("'%s' is not numeric!"), _("Expire")); } if(!is_numeric($this->sOAretry)){ - $message[] = _("Please specify a numeric value for retry."); + $message[] = sprintf(_("'%s' is not numeric!"), _("Retry")); } foreach($this->Records as $name => $values){ /* only lower-case is allowed in record entries ... */ if($values['value'] != strtolower($values['value'])){ - $message[] = sprintf(_("Only lowercase is allowed, please check your '%ss'."),$values['type']); + $message[] = sprintf(_("Only lowercase records are allowed for '%s'!"),$values['type']); } } @@ -461,30 +456,30 @@ class servdnseditZone extends plugin /* Check for valid&complete IP address */ if(!tests::is_ip($addr)){ - $message[] = _("The given network address is not a valid, please specify a valid IP address."); + $message[] = _("Network address is not valid!"); } /* Check if given address matches selected network class */ switch($this->NetworkClass){ case 'A': { if(!preg_match("/^[0-9]*\.0\.0\.0$/",$addr)){ - $message[] = sprintf(_("The specified network address is not matching with the specified zone class, try it this way x.0.0.0")); + $message[] = sprintf(_("The specified network address and the network class (%s/%s) do not match!"), $this->NetworkClass, "255.0.0.0"); } } break; case 'B': { if(!preg_match("/^[0-9]*\.[0-9]*\.0\.0$/",$addr)){ - $message[] = sprintf(_("The specified network address is not matching with the specified zone class, try it this way x.x.0.0")); + $message[] = sprintf(_("The specified network address and the network class (%s/%s) do not match!"), $this->NetworkClass, "255.255.0.0"); } } break; case 'C': { if(!preg_match("/^[0-9]*\.[0-9]*\.[0-9]*\.0$/",$addr)){ - $message[] = sprintf(_("The specified network address is not matching with the specified zone class, try it this way x.x.x.0")); + $message[] = sprintf(_("The specified network address and the network class (%s/%s) do not match!"), $this->NetworkClass, "255.255.255.0"); } } break; - default : $message[] =sprintf(_("The given network class '%s' is not valid."),$this->NetworkClass); + default : $message[] =sprintf(_("The network class '%s' is not valid!"),$this->NetworkClass); } return ($message); diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc index 21f761db9..922e7af25 100644 --- a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc +++ b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc @@ -2,11 +2,6 @@ class servDNSeditZoneEntries extends plugin { - /* CLI vars */ - var $cli_summary= "Manage server basic objects"; - var $cli_description= "Some longer text\nfor help"; - var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account = TRUE; var $attributes = array(); @@ -21,6 +16,7 @@ class servDNSeditZoneEntries extends plugin var $disableDialog = false; // Dialog will be disabled, if this zone is new + function servDNSeditZoneEntries (&$config,$dn, &$zoneObject) { plugin::plugin ($config, $dn); @@ -219,7 +215,7 @@ class servDNSeditZoneEntries extends plugin if((isset($this->Devices[$Name])) && ($Name != $value)){ if(isset($this->Devices[$value])){ - print_red(sprintf(_("Can't rename '%s' to '%s' there is already an entry with the same name in our zone editing dialog."),$Name,$value)); + msg_dialog::display(_("Error"), sprintf(_("Cannot rename '%s' to '%s'. Name is already in use!"), $Name, $value), ERROR_DIALOG); }else{ $this->Devices[$value] = $this->Devices[$Name]; unset($this->Devices[$Name]); @@ -249,7 +245,7 @@ class servDNSeditZoneEntries extends plugin /* Checking entry name */ if(!preg_match("/^[a-z0-9_\.-]+$/i", $DevName) || (empty($DevName))){ - $message[] = sprintf(_("Entry name '%s' contains invalid characters."), $DevName); + $message[] = _("Entry name contains invalid characters."); } /* Renaming check for existing devices @@ -258,13 +254,13 @@ class servDNSeditZoneEntries extends plugin $ldap->cd($this->config->current['BASE']); $ldap->search("(relativeDomainName=".$DevName.")",array("relativeDomainName")); if($ldap->count()){ - $message[] = sprintf(_("Can not rename '%s' to '%s',the destination name already exists."),$device['OrigCn'],$DevName); + $message[] = sprintf(_("Cannot rename '%s' to '%s'. Entry is already in use."),$device['OrigCn'],$DevName); } }elseif(!isset($device['OrigCn'])){ $ldap->cd($this->config->current['BASE']); $ldap->search("(relativeDomainName=".$DevName.")",array("relativeDomainName")); if($ldap->count()){ - $message[] = sprintf(_("Can not create '%s',the destination name already exists."),$DevName); + $message[] = sprintf(_("Cannot create '%s'. Entry is already in use."),$DevName); } } @@ -273,7 +269,7 @@ class servDNSeditZoneEntries extends plugin if(!isset($names[$DevName])){ $names[$DevName] = ""; }else{ - $message[] = sprintf(_("The name '%s' is used more than once."),$DevName); + $message[] = sprintf(_("Entry '%s' is used more than once."),$DevName); } /* Names should be written in lowercase @@ -296,14 +292,14 @@ class servDNSeditZoneEntries extends plugin if(!isset($tmp[$Rec['type']])){ $tmp[$Rec['type']] = ""; }else{ - $message[] = sprintf(_("The record type '%s' is a unique type and can't be defined twice."),$Rec['type']); + $message[] = sprintf(_("%s records cannot be used more than once."),$Rec['type']); } } /* Check for empty / duplicate entries in record array */ if(empty($Rec['value'])){ - $message[] = sprintf(_("There is an empty '%s' for host '%s'."),$Rec['type'],$DevName); + $message[] = sprintf(_("Please fix the empty %s record for entry '%s'."),$Rec['type'],$DevName); } /* Check for duplicate record entries @@ -311,13 +307,14 @@ class servDNSeditZoneEntries extends plugin if(!isset($tmp[$Rec['type']][$Rec['value']])){ $tmp[$Rec['type']][$Rec['value']] = ""; }else{ - $message[] = sprintf(_("There is a duplicate entry in '%s' for '%s'."),$Rec['type'],$DevName); + $message[] = sprintf(_("Please fix the duplicate %s record for entry '%s'."),$Rec['type'],$DevName); } } } return ($message); } + function save() { if($this->disableDialog) return; diff --git a/gosa-plugins/fai/admin/fai/class_askClassName.inc b/gosa-plugins/fai/admin/fai/class_askClassName.inc index c7e38adb5..2a40c6366 100644 --- a/gosa-plugins/fai/admin/fai/class_askClassName.inc +++ b/gosa-plugins/fai/admin/fai/class_askClassName.inc @@ -2,11 +2,6 @@ class askClassName extends plugin { - /* CLI vars */ - var $cli_summary = "Manage server basic objects"; - var $cli_description = "Some longer text\nfor help"; - var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account = TRUE; var $attributes = array(); diff --git a/gosa-plugins/fai/admin/fai/class_faiHook.inc b/gosa-plugins/fai/admin/fai/class_faiHook.inc index 6067bfb9b..069cf0d57 100644 --- a/gosa-plugins/fai/admin/fai/class_faiHook.inc +++ b/gosa-plugins/fai/admin/fai/class_faiHook.inc @@ -2,11 +2,6 @@ class faiHook extends plugin { - /* CLI vars */ - var $cli_summary = "Manage server basic objects"; - var $cli_description = "Some longer text\nfor help"; - var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account = TRUE; @@ -248,7 +243,7 @@ class faiHook extends plugin /* print errors */ if(count($msgs)>0){ foreach($msgs as $msg){ - print_red($msg); + msg_dialog::display(_("Error"), $msg, ERROR_DIALOG); } }else{ @@ -321,11 +316,11 @@ class faiHook extends plugin /* Check if this object is freezed, in this case hide the delete icon */ if($this->FAIstate == "freeze"){ - $act .= ""; + $act .= ""; }else{ - $act .= ""; + $act .= ""; if(preg_match("/d/",$acl)){ - $act .=""; + $act .=""; } } diff --git a/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc b/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc index 282dbcf90..668e12cf7 100644 --- a/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc @@ -2,10 +2,6 @@ class faiHookEntry extends plugin { - /* CLI vars */ - var $cli_summary= "Manage server basic objects"; - var $cli_description= "Some longer text\nfor help"; - var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); /* attribute list for save action */ var $ignore_account= TRUE; @@ -59,8 +55,8 @@ class faiHookEntry extends plugin function execute() { - /* Call parent execute */ - plugin::execute(); + /* Call parent execute */ + plugin::execute(); /* Fill templating stuff */ $smarty = get_smarty(); @@ -68,10 +64,10 @@ class faiHookEntry extends plugin if(isset($_POST['ImportUpload'])){ if(($_FILES['ImportFile']['error']!=0)){ - print_red(_("Please select a valid file.")); + msg_dialog::display(_("Error"), _("Upload failed!"), ERROR_DIALOG); }else if(($_FILES['ImportFile']['size']==0)){ - print_red(_("Selected file is empty.")); + msg_dialog::display(_("Error"), _("Uploaded file is empty!"), ERROR_DIALOG); }else{ $str = utf8_encode(file_get_contents($_FILES['ImportFile']['tmp_name'])); $this->FAIscript = $str; @@ -153,15 +149,15 @@ class faiHookEntry extends plugin $message= plugin::check(); if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){ - $message[] =_("There is already a hook with the given name."); + $message[] =_("Name is already in use!"); } if(empty($this->FAIscript)) { - $message[]=_("Please enter a value for script."); + $message[]=_("Please enter a script!"); } if(empty($this->cn)){ - $message[] = _("Please enter a name."); + $message[] = _("Name is empty!"); } return ($message); diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc index 64b10d5b8..bd68129ad 100644 --- a/gosa-plugins/fai/admin/fai/class_faiManagement.inc +++ b/gosa-plugins/fai/admin/fai/class_faiManagement.inc @@ -25,12 +25,6 @@ class faiManagement extends plugin var $plHeadline = "FAI"; var $plDescription = "Fully Automatic Installation - management"; - /* CLI vars */ - var $cli_summary = "Handling of FAI entries"; - var $cli_description = "This plugin represents a management tool\n - which allows us to manage all needed attributes for fully automatic installations (FAI)"; - var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* Headpage attributes */ var $lock_type = ""; // should be branch/freeze var $lock_name = ""; @@ -215,9 +209,8 @@ class faiManagement extends plugin return($smarty->fetch(get_template_path('remove.tpl', TRUE))); } else { - /* Obviously the user isn't allowed to delete. Show message and - clean session. */ - print_red (_("You are not allowed to delete this component!")); + /* Obviously the user isn't allowed to delete. Show message and clean session. */ + msg_dialog::display(_("Permission error"), _("You have no permission to delete this entry!"), ERROR_DIALOG); } } @@ -309,7 +302,7 @@ class faiManagement extends plugin /* Normally this shouldn't be reached, send some extra logs to notify the administrator */ - print_red (_("You are not allowed to delete this component!")); + msg_dialog::display(_("Permission error"), _("You have no permission to delete this entry!"), ERROR_DIALOG); new log("security","fai/".get_class($this),$dn,array(),"Tried to trick deletion."); } @@ -380,12 +373,12 @@ class faiManagement extends plugin /* Normally this shouldn't be reached, send some extra logs to notify the administrator */ - print_red (_("You are not allowed to delete this component!")); + msg_dialog::display(_("Permission error"), _("You have no permission to delete this entry!"), ERROR_DIALOG); new log("security","fai/".get_class($this),$dn,array(),"Tried to trick deletion."); } }else{ - print_red(sprintf(_("Object could not be deleted '%s', object does not exist."),$this->dn)); + msg_dialog::display(_("Error"), sprintf(_("Cannot delete '%s': object does not exist!"), $this->dn) , ERROR_DIALOG); } /* Remove lock file after successfull deletion */ del_lock ($this->dn); @@ -442,7 +435,7 @@ class faiManagement extends plugin $smarty->assign("info", sprintf(_("You're about to delete a fai branch / freeze '%s'."), $this->DivListFai->selectedBranch)); return($smarty->fetch(get_template_path('remove_branch.tpl',TRUE))); } else { - print_red (_("You are not allowed to delete this release!")); + msg_dialog::display(_("Permission error"), _("You have no permission to delete this release!"), ERROR_DIALOG); } } } @@ -507,16 +500,16 @@ class faiManagement extends plugin /* Check used characters */ if(preg_match("/[^0-9a-z \ö\ä\ü\.-_:,]/i",$name)){ if($type == "branch"){ - print_red(_("Specified branch name is invalid.")); + msg_dialog::display(_("Error"), _("Branch name is not valid!"), ERROR_DIALOG); }else{ - print_red(_("Specified freeze name is invalid.")); + msg_dialog::display(_("Error"), _("Freeze name is not valid!"), ERROR_DIALOG); } $is_ok = false; } /* Check if this name is already in use */ if(!$this->CheckNewBranchName($_POST['BranchName'],$this->DivListFai->selectedBranch)){ - print_red(_("This name is already in use.")); + msg_dialog::display(_("Error"), _("Name is already in use!"), ERROR_DIALOG); $is_ok = false; } @@ -545,7 +538,7 @@ class faiManagement extends plugin if(isset($_GET['PerformBranch'])){ if(!$this->acl_is_createable()){ - print_red(_("You are not allowed to create a new branch.")); + msg_dialog::display(_("Permission error"), _("You have no permission to create a new branch!"), ERROR_DIALOG); }else{ /* Create it know */ @@ -679,7 +672,7 @@ class faiManagement extends plugin if("" != $this->config->search("faiManagement", "POSTCREATE",array('menu','tabs'))){ if(($s_action == "branch_branch")||($this->dispNewBranch)){ if(!$this->acl_is_createable()){ - print_red(_("You are not allowed to create a new branch.")); + msg_dialog::display(_("Permission error"), _("You have no permission to create a new branch!"), ERROR_DIALOG); }else{ $this->dispNewBranch=true; $smarty->assign("iframe",false); @@ -700,7 +693,7 @@ class faiManagement extends plugin if("" != $this->config->search("faiManagement", "POSTCREATE",array('menu','tabs'))){ if(($s_action == "freeze_branch")||($this->dispNewFreeze)){ if(!$this->acl_is_createable()){ - print_red(_("You are not allowed to create a new branch.")); + msg_dialog::display(_("Permission error"), _("You have no permission to create a new branch!"), ERROR_DIALOG); }else{ $this->dispNewFreeze = true; $smarty->assign("iframe",false); @@ -721,13 +714,19 @@ class faiManagement extends plugin "new_variable" => "FAIvariable", "new_template" => "FAItemplate", "new_package" => "FAIpackageList"); + $types_i18n = array( "new_partition" => _("partition table"), + "new_script" => _("script"), + "new_hook" => _("hook"), + "new_variable" => _("variable"), + "new_template" => _("template"), + "new_package" => _("package list")); if(isset($types[$s_action])){ $acl = $this->ui->get_permissions($this->DivListFai->selectedBase,"fai/".$type_acl_mapping[$types[$s_action]]); if(preg_match("/c/",$acl)){ $this->dialog = new askClassName($this->config,$this->dn,$this->ui,$types[$s_action]); }else{ - print_red(sprintf(_("You are not allowed to create a new '%s' object."),$types[$s_action])); + msg_dialog::display(_("Permission error"), sprintf(_("You have no permission to create a new %s!"), $types_i18n[$s_action]), ERROR_DIALOG); } } @@ -743,7 +742,7 @@ class faiManagement extends plugin $this->is_dialog = false; }else{ - print_red(sprintf(_("You are not allowed to create a new '%s' object."),"FAIprofile")); + msg_dialog::display(_("Permission error"), sprintf(_("You have no permission to create a new %s!"), _("profile")), ERROR_DIALOG); } } @@ -756,7 +755,7 @@ class faiManagement extends plugin $this->dialog->save_object(); if(count($this->dialog->check())!=0){ foreach($this->dialog->check() as $msg){ - print_red($msg); + msg_dialog::display(_("Error"), $msg, ERROR_DIALOG); } }elseif(isset($this->dialog->objectClass)){ $this->dn = "new" ; @@ -799,7 +798,7 @@ class faiManagement extends plugin $msgs= $this->dialog->check(); if(count($msgs)!=0){ foreach($msgs as $msg){ - print_red($msg); + msg_dialog::display(_("Error"), $msg, ERROR_DIALOG); } }else{ $this->dialog->save(); diff --git a/gosa-plugins/fai/admin/fai/class_faiPackage.inc b/gosa-plugins/fai/admin/fai/class_faiPackage.inc index c1b4b3f61..9ae6b8e7c 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPackage.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPackage.inc @@ -2,11 +2,6 @@ class faiPackage extends plugin { - /* CLI vars */ - var $cli_summary = "Manage server basic objects"; - var $cli_description = "Some longer text\nfor help"; - var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account = TRUE; @@ -243,7 +238,7 @@ class faiPackage extends plugin $this->dialog->save_object(); if(count($this->dialog->check())){ foreach($this->dialog->check() as $msgs){ - print_red($msgs); + msg_dialog::display(_("Error"), $msgs, ERROR_DIALOG); } }else{ $use = $this->dialog->save(); @@ -376,11 +371,11 @@ class faiPackage extends plugin $message= plugin::check(); if(count($this->usedPackages)==0){ - $message[]=_("Please select a least one Package."); + $message[]=_("Please select a least one package!"); } if((empty($this->FAIdebianRelease))||(empty($this->FAIdebianSection))){ - $message[]=_("Please choose a valid combination for your repository setup."); + $message[]=_("Please choose a valid release/section combination for your repository setup!"); } return ($message); @@ -436,7 +431,7 @@ class faiPackage extends plugin $strID= CONFIG_DIR."/fai/".$this->FAIdebianRelease."/".$sec; if(!is_file($strID)){ - print_red(sprintf(_("Package file '%s' does not exist."),$strID)); + msg_dialog::display(_("Error"), sprintf(_("Package file '%s' does not exist!"), $strID), ERROR_DIALOG); unset($this->buffer); return(array()); } diff --git a/gosa-plugins/fai/admin/fai/class_faiPackageConfiguration.inc b/gosa-plugins/fai/admin/fai/class_faiPackageConfiguration.inc index 18f3e2b6c..0a371a8e8 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPackageConfiguration.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPackageConfiguration.inc @@ -2,11 +2,6 @@ class faiPackageConfiguration extends plugin { - /* CLI vars */ - var $cli_summary = "Manage server basic objects"; - var $cli_description = "Some longer text\nfor help"; - var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account = TRUE; var $attributes = array(); diff --git a/gosa-plugins/fai/admin/fai/class_faiPackageEntry.inc b/gosa-plugins/fai/admin/fai/class_faiPackageEntry.inc index 3670a3af0..c72eea51e 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPackageEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPackageEntry.inc @@ -2,11 +2,6 @@ class faiPackageEntry extends plugin { - /* CLI vars */ - var $cli_summary= "Manage server basic objects"; - var $cli_description= "Some longer text\nfor help"; - var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account= TRUE; var $attributes = array(); @@ -37,8 +32,8 @@ class faiPackageEntry extends plugin function execute() { - /* Call parent execute */ - plugin::execute(); + /* Call parent execute */ + plugin::execute(); /* Fill templating stuff */ $smarty = get_smarty(); @@ -125,7 +120,7 @@ $CHKS = " 200) { - print_red(sprintf(_("Your specified search string '%s' returned too many results. Only the first 200 entries are shown, to keep the memory usage low."),$this->searchStrPKG)); + msg_dialog::display(_("Error"), _("Search returned too many reults - showing the first 200 matches, only!"), ERROR_DIALOG); break; } if((preg_match("/^".$search_str."/i",$pkg[0]))|| diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc index d463f2a22..21a4dab5f 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc @@ -2,11 +2,6 @@ class faiPartitionTable extends plugin { - /* CLI vars */ - var $cli_summary= "Manage server basic objects"; - var $cli_description= "Some longer text\nfor help"; - var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account = TRUE; var $attributes = array("cn","description"); @@ -202,7 +197,7 @@ class faiPartitionTable extends plugin $this->dialog->save_object(); if(count($this->dialog->check())){ foreach($this->dialog->check() as $msg){ - print_red($msg); + msg_dialog::display(_("Error"), $msg, ERROR_DIALOG); } }else{ $disk = $this->dialog->save(); diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTableEntry.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTableEntry.inc index d72ec5149..a49dad40e 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPartitionTableEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPartitionTableEntry.inc @@ -2,11 +2,6 @@ class faiPartitionTableEntry extends plugin { - /* CLI vars */ - var $cli_summary= "Manage server basic objects"; - var $cli_description= "Some longer text\nfor help"; - var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account= TRUE; var $attributes = array("DISKcn","DISKdescription"); diff --git a/gosa-plugins/fai/admin/fai/class_faiProfile.inc b/gosa-plugins/fai/admin/fai/class_faiProfile.inc index 3eaa08b5e..5383da68a 100644 --- a/gosa-plugins/fai/admin/fai/class_faiProfile.inc +++ b/gosa-plugins/fai/admin/fai/class_faiProfile.inc @@ -2,11 +2,6 @@ class faiProfile extends plugin { - /* CLI vars */ - var $cli_summary = "Manage server basic objects"; - var $cli_description = "Some longer text\nfor help"; - var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account = TRUE; @@ -267,7 +262,7 @@ class faiProfile extends plugin $this->dialog->save_object(); $msgs= $this->dialog->check(); if(count($msgs)){ - print_red($msgs); + msg_dialog::display(_("Error"), $msgs, ERROR_DIALOG); }else{ $ret = $this->dialog->save(); foreach($ret as $class){ @@ -396,11 +391,11 @@ class faiProfile extends plugin $message= plugin::check(); if(count($this->FAIclasses) == 0){ - $message[]=_("Please assign at least one class to this profile."); + $message[]=_("No class specified for this profile!"); } if(empty($this->cn)){ - $message[]=_("Please enter a valid name."); + $message[]=_("'Name' is not valid!"); } $ldap = $this->config->get_ldap_link(); @@ -419,7 +414,7 @@ class faiProfile extends plugin } if($ldap->count() || isset($this->FAIAllclasses[$this->cn])){ - $message[]=_("There is already a FAI object with this class name defined."); + $message[]=_("Name is already in use!"); } return ($message); diff --git a/gosa-plugins/fai/admin/fai/class_faiProfileEntry.inc b/gosa-plugins/fai/admin/fai/class_faiProfileEntry.inc index 8963973e3..1f811af8b 100644 --- a/gosa-plugins/fai/admin/fai/class_faiProfileEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiProfileEntry.inc @@ -2,11 +2,6 @@ class faiProfileEntry extends plugin { - /* CLI vars */ - var $cli_summary= "Manage server basic objects"; - var $cli_description= "Some longer text\nfor help"; - var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account= TRUE; var $attributes = array(); diff --git a/gosa-plugins/fai/admin/fai/class_faiScript.inc b/gosa-plugins/fai/admin/fai/class_faiScript.inc index 87592976c..c117220a6 100644 --- a/gosa-plugins/fai/admin/fai/class_faiScript.inc +++ b/gosa-plugins/fai/admin/fai/class_faiScript.inc @@ -2,11 +2,6 @@ class faiScript extends plugin { - /* CLI vars */ - var $cli_summary = "Manage server basic objects"; - var $cli_description = "Some longer text\nfor help"; - var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account = TRUE; @@ -242,7 +237,7 @@ class faiScript extends plugin $msgs = $this->dialog->check(); if(count($msgs)>0){ foreach($msgs as $msg){ - print_red($msg); + msg_dialog::display(_("Error"), $msg, ERROR_DIALOG); } }else{ diff --git a/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc b/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc index ab3b589f1..143d6f506 100644 --- a/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc @@ -2,11 +2,6 @@ class faiScriptEntry extends plugin { - /* CLI vars */ - var $cli_summary= "Manage server basic objects"; - var $cli_description= "Some longer text\nfor help"; - var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account= TRUE; var $attributes = array("cn","description","FAIpriority","FAIscript"); @@ -56,8 +51,8 @@ class faiScriptEntry extends plugin function execute() { - /* Call parent execute */ - plugin::execute(); + /* Call parent execute */ + plugin::execute(); /* Fill templating stuff */ $smarty = get_smarty(); @@ -65,10 +60,10 @@ class faiScriptEntry extends plugin if(isset($_POST['ImportUpload']) && $this->acl_is_writeable("FAIscript")){ if(($_FILES['ImportFile']['error']!=0)){ - print_red(_("Please select a valid file.")); + msg_dialog::display(_("Error"), _("Upload failed!"), ERROR_DIALOG); }else if(($_FILES['ImportFile']['size']==0)){ - print_red(_("Selected file is empty.")); + msg_dialog::display(_("Error"), _("Uploaded file is empty!"), ERROR_DIALOG); }else{ $str = utf8_encode(addslashes(file_get_contents($_FILES['ImportFile']['tmp_name']))); $this->FAIscript = $str; @@ -143,15 +138,15 @@ class faiScriptEntry extends plugin $message= plugin::check(); if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){ - $message[] =_("There is already a script with the given name."); + $message[] =_("Name is already in use!"); } if(empty($this->cn)){ - $message[] = _("Please enter a name."); + $message[] = _("Name is empty!"); } if(empty($this->FAIscript)){ - $message[]=_("Please enter a script."); + $message[]=_("Please enter a script!"); } return ($message); diff --git a/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc b/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc index f2bdd51f1..f9b4e40eb 100644 --- a/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc +++ b/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc @@ -84,7 +84,7 @@ class faiSummaryTab extends plugin{ }elseif(isset($this->parent->by_object['servgeneric'])){ $this->base = $this->parent->by_object['servgeneric']->base; }else{ - print_red(_("Unknown type of FAI source information. This is not a profile, workstation nor a ogroup.")); + msg_dialog::display(_("Error"), _("Unkonwn FAI information source!"), ERROR_DIALOG); } /* Append workstation class && LAST */ diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc index 863ee2b3e..9c1dd0c98 100644 --- a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc +++ b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc @@ -2,11 +2,6 @@ class faiTemplate extends plugin { - /* CLI vars */ - var $cli_summary = "Manage server basic objects"; - var $cli_description = "Some longer text\nfor help"; - var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account = TRUE; @@ -224,7 +219,7 @@ class faiTemplate extends plugin $msgs = $this->dialog->check(); if(count($msgs)>0){ foreach($msgs as $msg){ - print_red($msg); + msg_dialog::display(_("Error"), $msg, ERROR_DIALOG); } }else{ /* Get return object */ diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc b/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc index 869cb1f0b..d7066e181 100644 --- a/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc @@ -2,11 +2,6 @@ class faiTemplateEntry extends plugin { - /* CLI vars */ - var $cli_summary= "Manage server basic objects"; - var $cli_description= "Some longer text\nfor help"; - var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account= TRUE; var $attributes = array("cn","description","FAItemplateFile","FAItemplatePath","FAImode","user","group","binary","FAIowner"); diff --git a/gosa-plugins/fai/admin/fai/class_faiVariable.inc b/gosa-plugins/fai/admin/fai/class_faiVariable.inc index aea362f05..ddd1b1b47 100644 --- a/gosa-plugins/fai/admin/fai/class_faiVariable.inc +++ b/gosa-plugins/fai/admin/fai/class_faiVariable.inc @@ -2,11 +2,6 @@ class faiVariable extends plugin { - /* CLI vars */ - var $cli_summary = "Manage server basic objects"; - var $cli_description = "Some longer text\nfor help"; - var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account = TRUE; @@ -167,7 +162,7 @@ class faiVariable extends plugin $msgs = $this->dialog->check(); if(count($msgs)>0){ foreach($msgs as $msg){ - print_red($msg); + msg_dialog::display(_("Error"), $msg, ERROR_DIALOG); } }else{ $obj = $this->dialog->save(); diff --git a/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc b/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc index 5fc6ef01e..21d7bc0f0 100644 --- a/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc @@ -2,11 +2,6 @@ class faiVariableEntry extends plugin { - /* CLI vars */ - var $cli_summary= "Manage server basic objects"; - var $cli_description= "Some longer text\nfor help"; - var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account= TRUE; var $attributes = array("cn","description","FAIvariableContent"); diff --git a/gosa-plugins/fai/admin/fai/tabsHook.inc b/gosa-plugins/fai/admin/fai/tabsHook.inc index ed61e1fc8..bf4709073 100644 --- a/gosa-plugins/fai/admin/fai/tabsHook.inc +++ b/gosa-plugins/fai/admin/fai/tabsHook.inc @@ -33,7 +33,7 @@ class tabsHook extends tabs $cnt1 = count(split(",",$this->dn)); $cnt2 = count(split(",",$new_dn)); if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){ - print_red(_("Try to move tree failed. Destination tree is subtree of source tree.")); + msg_dialog::display(_("Error"), _("Moving the tree failed. Destination tree is subtree of source tree."), ERROR_DIALOG); }else{ // $baseobject->recursive_move($this->dn, $new_dn); } diff --git a/gosa-plugins/fai/admin/fai/tabsPackage.inc b/gosa-plugins/fai/admin/fai/tabsPackage.inc index e678a835e..94dca4e20 100644 --- a/gosa-plugins/fai/admin/fai/tabsPackage.inc +++ b/gosa-plugins/fai/admin/fai/tabsPackage.inc @@ -36,7 +36,7 @@ class tabsPackage extends tabs $cnt1 = count(split(",",$this->dn)); $cnt2 = count(split(",",$new_dn)); if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){ - print_red(_("Try to move tree failed. Destination tree is subtree of source tree.")); + msg_dialog::display(_("Error"), _("Moving the tree failed. Destination tree is subtree of source tree."), ERROR_DIALOG); }else{ // $baseobject->recursive_move($this->dn, $new_dn); } diff --git a/gosa-plugins/fai/admin/fai/tabsPartition.inc b/gosa-plugins/fai/admin/fai/tabsPartition.inc index 308d50b8a..9d409e6c7 100644 --- a/gosa-plugins/fai/admin/fai/tabsPartition.inc +++ b/gosa-plugins/fai/admin/fai/tabsPartition.inc @@ -35,7 +35,7 @@ class tabsPartition extends tabs $cnt1 = count(split(",",$this->dn)); $cnt2 = count(split(",",$new_dn)); if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){ - print_red(_("Try to move tree failed. Destination tree is subtree of source tree.")); + msg_dialog::display(_("Error"), _("Moving the tree failed. Destination tree is subtree of source tree."), ERROR_DIALOG); }else{ // $baseobject->recursive_move($this->dn, $new_dn); } diff --git a/gosa-plugins/fai/admin/fai/tabsProfile.inc b/gosa-plugins/fai/admin/fai/tabsProfile.inc index ccac199c2..f67b22c0c 100644 --- a/gosa-plugins/fai/admin/fai/tabsProfile.inc +++ b/gosa-plugins/fai/admin/fai/tabsProfile.inc @@ -35,7 +35,7 @@ class tabsProfile extends tabs $cnt1 = count(split(",",$this->dn)); $cnt2 = count(split(",",$new_dn)); if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){ - print_red(_("Try to move tree failed. Destination tree is subtree of source tree.")); + msg_dialog::display(_("Error"), _("Moving the tree failed. Destination tree is subtree of source tree."), ERROR_DIALOG); }else{ // $baseobject->recursive_move($this->dn, $new_dn); } diff --git a/gosa-plugins/fai/admin/fai/tabsScript.inc b/gosa-plugins/fai/admin/fai/tabsScript.inc index 094fbb405..eb283a2c6 100644 --- a/gosa-plugins/fai/admin/fai/tabsScript.inc +++ b/gosa-plugins/fai/admin/fai/tabsScript.inc @@ -36,7 +36,7 @@ class tabsScript extends tabs $cnt1 = count(split(",",$this->dn)); $cnt2 = count(split(",",$new_dn)); if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){ - print_red(_("Try to move tree failed. Destination tree is subtree of source tree.")); + msg_dialog::display(_("Error"), _("Moving the tree failed. Destination tree is subtree of source tree."), ERROR_DIALOG); }else{ // $baseobject->recursive_move($this->dn, $new_dn); } diff --git a/gosa-plugins/fai/admin/fai/tabsTemplate.inc b/gosa-plugins/fai/admin/fai/tabsTemplate.inc index 5f7f8ab4c..8b1af36e3 100644 --- a/gosa-plugins/fai/admin/fai/tabsTemplate.inc +++ b/gosa-plugins/fai/admin/fai/tabsTemplate.inc @@ -35,7 +35,7 @@ class tabsTemplate extends tabs $cnt1 = count(split(",",$this->dn)); $cnt2 = count(split(",",$new_dn)); if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){ - print_red(_("Try to move tree failed. Destination tree is subtree of source tree.")); + msg_dialog::display(_("Error"), _("Moving the tree failed. Destination tree is subtree of source tree."), ERROR_DIALOG); }else{ // $baseobject->recursive_move($this->dn, $new_dn); } diff --git a/gosa-plugins/fai/admin/fai/tabsVariable.inc b/gosa-plugins/fai/admin/fai/tabsVariable.inc index 11694b1d1..c0476577e 100644 --- a/gosa-plugins/fai/admin/fai/tabsVariable.inc +++ b/gosa-plugins/fai/admin/fai/tabsVariable.inc @@ -36,7 +36,7 @@ class tabsVariable extends tabs $cnt1 = count(split(",",$this->dn)); $cnt2 = count(split(",",$new_dn)); if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){ - print_red(_("Try to move tree failed. Destination tree is subtree of source tree.")); + msg_dialog::display(_("Error"), _("Moving the tree failed. Destination tree is subtree of source tree."), ERROR_DIALOG); }else{ // $baseobject->recursive_move($this->dn, $new_dn); } diff --git a/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc b/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc index a6dab5936..7545ee273 100644 --- a/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc +++ b/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc @@ -119,7 +119,7 @@ class blocklistGeneric extends plugin if (tests::is_phone_nr($_POST['number']) || preg_match ("/^[\/0-9 ()\^\.\$+*-]+$/",$_POST['number'])){ $this->addNumber ($_POST['number']); } else { - print_red (_("Please specify a valid phone number.")); + msg_dialog::display(_("Error"), _("Phone number is not valid!"), ERROR_DIALOG); } } @@ -202,17 +202,17 @@ class blocklistGeneric extends plugin /* check syntax: must cn */ if ($this->cn == ""){ - $message[]= _("Required field 'Name' is not set."); + $message[]= _("Name is empty!"); } else { if (!tests::is_uid($this->cn)){ - $message[]= _("Required field 'Name' contains invalid characters"); + $message[]= _("Name contains invalid characters!"); } if ($this->dn == 'new'){ $ldap= $this->config->get_ldap_link(); $ldap->cd (get_ou('blocklistou').$this->config->current["BASE"]); $ldap->search ("(&(|(objectClass=goFaxSBlock)(objectClass=goFaxRBlock))(cn=".$this->cn."))", array("cn")); if ($ldap->count() != 0){ - $message[]= _("Specified name is already used."); + $message[]= _("Name is already in use!"); } } } diff --git a/gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc b/gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc index 8c68cc421..e1499259c 100644 --- a/gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc +++ b/gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc @@ -244,7 +244,7 @@ class blocklist extends plugin $this->dialog->delete(); $this->dialog = NULL; } else { - print_red (sprintf(_("You are not allowed to delete the blocklist '%s'!"),$dn)); + msg_dialog::display(_("Permission error"), sprintf(_("You have not permission to delete '%s'!"), $dn), ERROR_DIALOG); } /* Remove lock file after successfull deletion */ del_lock ($dn); @@ -302,7 +302,7 @@ class blocklist extends plugin $this->dialog = NULL; del_lock ($this->dn); } else { - print_red (_("You have no permission to remove this blocklist.")); + msg_dialog::display(_("Permission error"), _("You have not permission to delete this entry!"), ERROR_DIALOG); } } diff --git a/gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc b/gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc index 63f22cee6..67a15aab0 100644 --- a/gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc +++ b/gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc @@ -6,12 +6,6 @@ class gofaxAccount extends plugin var $plHeadline= "FAX"; var $plDescription= "This does something"; - /* CLI vars */ - var $cli_summary= "Manage users fax account"; - var $cli_description= "Some longer text\nfor help"; - var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - - /* Department list shown in the divSelectList*/ var $departments; @@ -244,7 +238,7 @@ class gofaxAccount extends plugin /* Add number to blocklist (dialog) */ if (isset($_POST['add_blocklist_number']) && $_POST['block_number'] != ""){ if (!tests::is_phone_nr($_POST['block_number'])){ - print_red (_("You're trying to add an invalid phone number.")); + msg_dialog::display(_("Error"), _("Phone number is not valid!"), ERROR_DIALOG); } else { array_push($this->current_blocklist, $_POST['block_number']); $this->current_blocklist= array_unique($this->current_blocklist); @@ -675,11 +669,11 @@ class gofaxAccount extends plugin /* must: facsimileTelephoneNumber */ if ($this->facsimileTelephoneNumber == ""){ - $message[]= _("The required field 'Fax' is not set."); + $message[]= _("Fax is empty!"); } if (!tests::is_phone_nr($this->facsimileTelephoneNumber)){ - $message[]= _("Please enter a valid telephone number in the 'Fax' field."); + $message[]= _("Fax number is not valid!"); } /* IF mail is specified (which is only the case if there's no mail account @@ -687,15 +681,15 @@ class gofaxAccount extends plugin if (@isset($this->parent->by_object['mailAccount']) && $this->goFaxDeliveryMode & 32){ if ($this->mail == ""){ - $message[]= _("Mail delivery is checked, but no address has been specified."); + $message[]= _("Mail delivery is requested without target address!"); } elseif (!tests::is_email($this->mail)){ - $message[]= _("The mail address you've entered is invalid."); + $message[]= _("Mail address is invalid!"); } } // IE Fix, IE lets you choose disabled option, stupid browser ... if((empty($this->goFaxPrinter))&&($this->goFaxDeliveryMode & 64)){ - $message[]= _("Deliver fax to printer, is only possible if valid printer is given. Please correct your choice."); + $message[]= _("Printing is requested without a target printer!"); } return ($message); diff --git a/gosa-plugins/gofax/gofax/faxreports/class_faxreport.inc b/gosa-plugins/gofax/gofax/faxreports/class_faxreport.inc index 1292b1aba..f02aef2ad 100644 --- a/gosa-plugins/gofax/gofax/faxreports/class_faxreport.inc +++ b/gosa-plugins/gofax/gofax/faxreports/class_faxreport.inc @@ -112,26 +112,26 @@ class faxreport extends plugin /* 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))); } } @@ -154,7 +154,7 @@ class faxreport extends plugin /* 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))); } @@ -163,7 +163,7 @@ class faxreport extends plugin 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))); } @@ -173,7 +173,7 @@ class faxreport extends plugin $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))); } @@ -278,7 +278,7 @@ class faxreport extends plugin "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))); } @@ -294,7 +294,7 @@ class faxreport extends plugin @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))); } -- 2.30.2