Code

Updated msgDialog call to msg_dialog
[gosa.git] / gosa-plugins / gofax / gofax / faxaccount / main.inc
index d2786d889e0c390db926fb9dfbe0d12f7872f576..23147d12db984a6a6a239b0728634a2fd3870fc7 100644 (file)
@@ -10,21 +10,21 @@ if (!$remove_lock){
                (isset($_GET['reset']) && $_GET['reset'] == 1)){
 
                del_lock ($ui->dn);
-               sess_del ('edit');
-               sess_del ('gofaxAccount');
+               session::un_set ('edit');
+               session::un_set ('gofaxAccount');
        }
 
        /* Create gofaxAccount object on demand */
-       if (!isset($_SESSION['gofaxAccount']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-               $_SESSION['gofaxAccount']= new gofaxAccount ($config, $ui->dn);
-               $_SESSION['gofaxAccount']->set_acl_base($ui->dn);
-               $_SESSION['gofaxAccount']->set_acl_category("users");
-
+       if (!session::is_set('gofaxAccount') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
+               $gofaxAccount= new gofaxAccount ($config, $ui->dn);
+               $gofaxAccount->set_acl_base($ui->dn);
+               $gofaxAccount->set_acl_category("users");
+               session::set('gofaxAccount',$gofaxAccount);
        }
-       $gofaxAccount= $_SESSION['gofaxAccount'];
+       $gofaxAccount = session::get('gofaxAccount');
 
        /* save changes back to object */
-       if (isset ($_SESSION['edit'])){
+       if (session::is_set('edit')){
                $gofaxAccount->save_object ();
        }
 
@@ -33,16 +33,16 @@ if (!$remove_lock){
 
                /* Check locking */
                if (($username= get_lock($ui->dn)) != ""){
-                       $_SESSION['back_plugin']= $plug;
-                       $_SESSION['LOCK_VARS_TO_USE'] = array("/^edit$/","/^plug$/");
+                       session::set('back_plugin',$plug);
+                       session::set('LOCK_VARS_TO_USE',array("/^edit$/","/^plug$/"));
                        $lock_msg =  gen_locked_message ($username, $ui->dn);
 
                }else{
 
                        /* Lock the current entry */
                        add_lock ($ui->dn, $ui->dn);
-                       $_SESSION['dn']= $ui->dn;
-                       $_SESSION['edit']= TRUE;
+                       session::set('dn',$ui->dn);
+                       session::set('edit',TRUE);
                }
        }
 
@@ -56,11 +56,11 @@ if (!$remove_lock){
                 if (count ($message) == 0){
                         $gofaxAccount->save ();
                         del_lock ($ui->dn);
-                        sess_del ('edit');
+                        session::un_set ('edit');
 
                 } else {
                         /* Errors found, show message */
-                        show_errors ($message);
+                        msg_dialog::displayChecks($message);
                 }
         }
 
@@ -74,8 +74,8 @@ if (!$remove_lock){
        $info= "";
 
        /* Store changes  in session */
-       if (isset ($_SESSION['edit'])){
-               $_SESSION['gofaxAccount']= $gofaxAccount;
+       if (session::is_set('edit')){
+               session::set('gofaxAccount',$gofaxAccount);
        }
 
        /* Show page footer depending on the mode */
@@ -88,17 +88,17 @@ if (!$remove_lock){
                $display.= "<p class=\"plugbottom\">\n";
 
                /* Are we in edit mode? */
-               if (isset($_SESSION['edit'])){
-                       $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\""._("Ok")."\">\n";
+               if (session::is_set('edit')){
+                       $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
                        $display.= "&nbsp;\n";
-                       $display.= "<input type=submit name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
+                       $display.= "<input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
                        $info= "<img alt='' align=\"middle\" src=\"".get_template_path('images/closedlock.png')."\"> ".$ui->dn."&nbsp;";
                } else {
                        $info= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/openlock.png')."\"> ".$ui->dn."&nbsp;";
 
                        if(preg_match("/w/",$ui->get_permissions($ui->dn,"users/gofaxAccount"))){
                                $info.= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lamp.png')."\">"._("Click the 'Edit' button below to change informations in this dialog");
-                               $display.= "<input type=submit name=\"edit\" value=\""._("Edit")."\">";
+                               $display.= "<input type=submit name=\"edit\" value=\"".msgPool::editButton()."\">";
                        }
                        $display.= "<input type=\"hidden\" name=\"ignore\">\n";
                }