Code

Update goto import
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Sep 2008 08:41:38 +0000 (08:41 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Sep 2008 08:41:38 +0000 (08:41 +0000)
-Updated import dialog design

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12415 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/addons/goto/class_goto_import_file.inc
gosa-plugins/goto/addons/goto/class_gotomasses.inc
gosa-plugins/goto/addons/goto/goto_import_file.tpl

index 4b549d88e23009f2e81271529288ede17ce203aa..0b3338505931d32596e737930b50fd3c3ce8552b 100644 (file)
@@ -5,6 +5,7 @@ class goto_import_file extends plugin
 
   var $events     = array();
   var $csv_fields = array();
+  var $import_successful = FALSE; // Indicates that we have successfully imported everything.
 
   public function __construct($config,&$parent)
   {
@@ -128,6 +129,7 @@ class goto_import_file extends plugin
           }
         }
         msg_dialog::display(_("Import"),sprintf(_("Import complete: %s events successfully send, %s failed"),$success,$fail),INFO_DIALOG);
+        $this->import_successful = count($this->events) == 0;
       }
     }
 
index e094be422ff0fd8cfe317ba64cc07c7204d14931..4f0aec35c4d8552ddcad0df2fd18e00a0db44347 100644 (file)
@@ -340,7 +340,13 @@ class gotomasses extends plugin
     /* Display dialogs if currently opened */
     if(is_object($this->dialog)){
       $this->dialog->save_object();
-      return($this->dialog->execute());
+      $display = $this->dialog->execute();
+
+      if($this->dialog instanceOf goto_import_file && $this->dialog->import_successful){
+        $this->dialog = FALSE;
+      }else{
+        return($display);
+      }
     }
 
     /************
index adb841af602c15719d2a472889291645c8fd9201..30bddeaaccd7c010912429b4d05d0ae25b2d5b4b 100644 (file)
                        <input type='submit' name='import' value='{t}Upload{/t}'>
                </td>
        </tr>
-       {if  $count}
-       <tr>
-               <td>{t}Start import{/t}</td>
-               <td>
-                       <input type='submit' name='start_import' value='{t}Import{/t}'>
-               </td>
-       </tr>
-       {/if}
 </table>
 
        {if  $count}
@@ -89,6 +81,7 @@
 <br>
 <p class='seperator'></p>
 <div style='text-align:right;width:99%; padding-right:5px; padding-top:5px;'>
+       <input type='submit' name='start_import' value='{t}Import{/t}' >&nbsp;
        <input type='submit' name='import_abort' value='{msgPool type=backButton}'>
 </div>
 <br>