Code

Updated FAI management
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 Dec 2008 11:46:34 +0000 (11:46 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 Dec 2008 11:46:34 +0000 (11:46 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13142 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_divListFai.inc
gosa-plugins/fai/admin/fai/class_faiGroupHandle.inc
gosa-plugins/fai/admin/fai/class_faiManagement.inc
gosa-plugins/fai/admin/fai/faiGroupHandle.tpl

index ccdd458124fe3d75a080e1ccf5c8473501e444b6..5ac631747760f9d1027f2bdda4d1adbe6be0e89a 100644 (file)
@@ -272,13 +272,21 @@ class divListFai extends MultiSelectWindow
       /* Create actions string
        */
       $actions = "";
-      $actions.= "<input type='image' name='group_edit_".$key."' class='center'
-        src='images/lists/edit.png'>";
-      if(!$opsi_only){
+      if($opsi_only){
+        $actions.= "<input type='image' name='group_edit_".$key."' class='center'
+          src='images/lists/edit.png'>";
+        $actions.= "<img class='center' src='images/empty.png' alt=' '>";
+      }else{
+
+        $actions.= '<input class="center" src="images/lists/cut.png" alt="Ausschneiden" name="cut_10" 
+          title="Diesen Eintrag ausschneiden" type="image">&nbsp;
+        <input class="center" src="images/lists/copy.png" alt="Kopieren" name="copy_10" 
+          title="Diesen Eintrag kopieren" type="image">&nbsp;';
+
+        $actions.= "<input type='image' name='group_edit_".$key."' class='center'
+          src='images/lists/edit.png'>";
         $actions.= "<input type='image' name='group_remove_".$key."' class='center'
           src='images/lists/trash.png'>";
-      }else{
-        $actions.= "<img class='center' src='images/empty.png' alt=' '>";
       }
 
       /* Create list 
index 2ae27825ec5129907fe21c3c697c95a046e57f9d..999b692332725ff4d8518c80bd4ef2e6fcea89de 100644 (file)
@@ -20,12 +20,10 @@ class faiGroupHandle{
     /* Preset required values */
     foreach($FAI_group as $type => $data){
       $FAI_group[$type]['selected'] = FALSE;
-    }
-    
-    /* Select first entry in edit mode */
-    if($this->mode == "edit"){
-      reset($FAI_group);
-      $FAI_group[key($FAI_group)]['selected'] = TRUE;
+      $FAI_group[$type]['freezed'] = isset($data['FAIstate']) && preg_match("/freeze/",$data['FAIstate']);
+      if($this->mode == "edit" && !$FAI_group[$type]['freezed']){
+        $FAI_group[$type]['selected'] = TRUE;
+      }
     }
     $this->FAI_group = $FAI_group;
   }
index 013ee765745a44e7459974e4754ba927f7e4595d..c88f435d26e1ec2993516f8c3a0975d045d06d9b 100644 (file)
@@ -277,9 +277,12 @@ class faiManagement extends plugin
       $this->dialog->save_object();
       if($this->dialog->is_open()){
         return($this->dialog->execute());
-      }
-      if($this->dialog->is_canceled() || isset($_POST['cancel_lock'])){
+      }elseif($this->dialog->is_canceled() || isset($_POST['cancel_lock'])){
         $this->dialog = FALSE;
+      }else{
+        if(!count($this->dialog->get_selected())){
+          $this->dialog = FALSE;
+        }
       }
     }
 
index 5b771277a47a9550a30894906abc7f593b9174b3..cddbd0fa4a22333563ebc175746907163bf08832 100644 (file)
@@ -1,7 +1,7 @@
 
 {if $mode == "remove"}
 
-<h2>{t}Edit entry{/t}</h2>
+<h2>{t}Remove entry{/t}</h2>
 <br>
 {t}Select the entries you want to remove.{/t}
 <br>
 {foreach from=$FAI_group item=item key=key}
        <tr>
                <td>
-                       <input type='checkbox' name='{$mode}_{$key}'
-                       {if $item.selected} checked {/if}>
+                       {if $item.freezed}
+                               <img src="images/lists/locked.png" class='center'>
+                       {else}
+                               <input type='checkbox' name='{$mode}_{$key}'
+                       {if $item.selected} checked {/if}>
+                       {/if}
                </td>
                <td>
                        <img src='{$types.$key.IMG}' alt='{$types.$key.KZL}' title='{$types.$key.NAME}'
                                class='center'>
                </td>
                <td style='width:150px;'>{$types.$key.NAME}</td>
-               <td>{$item.description}
-               </td>
+               <td style='width:80px;'>{if $item.freezed}<i>({t}Freezed{/t})</i>{/if}</td>
+               <td>{$item.description}</td>
        </tr>
 {/foreach}
 </table>