Code

Dialog unifying
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 28 Mar 2008 14:33:12 +0000 (14:33 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 28 Mar 2008 14:33:12 +0000 (14:33 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10065 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/samba/personal/samba/class_sambaAccount.inc
gosa-plugins/samba/personal/samba/samba3_workstations.tpl
gosa-plugins/samba/personal/samba/sambaLogonHours.tpl

index 7c197fa1fe04e6a8633f3d919079f4d26e0b0030..65830c6d5b990c8ee855bd302f88048c92ff1c43 100644 (file)
@@ -338,27 +338,34 @@ class sambaAccount extends plugin
     }
 
     /* Add user workstation finished? */
-    if (isset($_POST["add_ws_finish"]) || isset($_POST["add_ws_cancel"])){
+    if (isset($_POST["add_ws_cancel"])){
       $this->show_ws_dialog= FALSE;
       $this->dialog= FALSE;
     }
 
     /* Add user workstation? */
-    if (isset($_POST["add_ws_finish"]) && isset($_POST['wslist'])){
+    if (isset($_POST["add_ws_finish"])){
 
-      if($this->multiple_support_active){
-        foreach($_POST['wslist'] as $ws){
-          $this->multiple_sambaUserWorkstations[trim($we)] = array("Name" => trim($ws), "UsedByAllUsers" => TRUE);
-        }
-      }else{
-        $tmp= $this->sambaUserWorkstations;
-        foreach($_POST['wslist'] as $ws){
-          $tmp.= ",$ws";
+      if (isset($_POST['wslist'])){
+        if($this->multiple_support_active){
+          foreach($_POST['wslist'] as $ws){
+            $this->multiple_sambaUserWorkstations[trim($we)] = array("Name" => trim($ws), "UsedByAllUsers" => TRUE);
+          }
+        }else{
+          $tmp= $this->sambaUserWorkstations;
+          foreach($_POST['wslist'] as $ws){
+            $tmp.= ",$ws";
+          }
+          $tmp= preg_replace('/,+/', ',', $tmp);
+          $this->sambaUserWorkstations= trim($tmp, ',');
         }
-        $tmp= preg_replace('/,+/', ',', $tmp);
-        $this->sambaUserWorkstations= trim($tmp, ',');
+        $this->is_modified= TRUE;
+
+        $this->show_ws_dialog= FALSE;
+        $this->dialog= FALSE;
+      } else {
+        msg_dialog::display(_("Error"), _("Please select an entry!"), ERROR_DIALOG);
       }
-      $this->is_modified= TRUE;
     }
 
     /* Show ws dialog */
index f403a434a5bedf70b9ebb8ab80558244f9dddeb0..c44f17c3a65e9579326fb4a607e58379ace969e9 100644 (file)
@@ -1,6 +1,6 @@
 <table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding="4">
 <tr>
-  <td style="vertical-align:top;width:600px">
+  <td style="vertical-align:top;">
    <div class="contentboxh" style="height:20px;">
     <p class="contentboxh" style="font-size:12px">
      <b><label for="wslist">{t}Select workstations to add{/t}</label> {$hint}</b><br />
@@ -8,13 +8,13 @@
    </div>
    <div class="contentboxb">
     <p class="contentboxb" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
-     <select id="wslist" style="width:600px; margin-top:4px; height:450px;" name="wslist[]" size="15" multiple>
+     <select id="wslist" style="width:100%; margin-top:4px; height:450px;" name="wslist[]" size="15" multiple>
        {html_options values=$wslist output=$wslist}
      </select>
     </p>
    </div>
   </td>
-  <td style="vertical-align:top;">
+  <td style="vertical-align:top;width:350px">
    <div class="contentboxh" style="height:20px;">
     <p class="contentboxh" style="font-size:12px"><img src="{$launchimage}" align="right" alt="[F]">
        <b>{t}Filters{/t}</b></p>
index 24d2199b941828fd799fa25798eff1667c28970f..3f5ab3029b49907eb7182bbd521be727492a698b 100644 (file)
@@ -91,7 +91,7 @@
 <input type='hidden' name='sambaLogonHoursPosted' value='1'> 
 <br>
 <p class="plugbottom">
-  <input type=submit name="save_logonHours" value="{msgPool type=applyButton}">
+  <input type=submit name="save_logonHours" value="{msgPool type=saveButton}">
   &nbsp;
   <input type=submit name="cancel_logonHours" value="{msgPool type=cancelButton}">
 </p>