Code

Hide toggle default printer option, if current object is a group
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 14 Nov 2006 11:41:17 +0000 (11:41 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 14 Nov 2006 11:41:17 +0000 (11:41 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5107 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/environment/class_environment.inc
plugins/personal/environment/environment.tpl

index 8b06f7af11dd07dcb8707ca18dbcaf64652c1220..57aa9f1391350b8590fa0d4cd75dad28eca5bf7a 100644 (file)
@@ -761,13 +761,15 @@ class environment extends plugin
       }
     }
 
-    if((isset($_POST['gotoPrinterDefault']))&&(isset($_POST['gotoPrinterSel']))&&(!empty($_POST['gotoPrinterSel']))){
-      if ($this->gosaDefaultPrinter == $_POST['gotoPrinterSel'][0]){
-        $this->gosaDefaultPrinter= "";
-      } else {
-        $this->gosaDefaultPrinter= $_POST['gotoPrinterSel'][0];
+    if(!$this->is_group){
+      if((isset($_POST['gotoPrinterDefault']))&&(isset($_POST['gotoPrinterSel']))&&(!empty($_POST['gotoPrinterSel']))){
+        if ($this->gosaDefaultPrinter == $_POST['gotoPrinterSel'][0]){
+          $this->gosaDefaultPrinter= "";
+        } else {
+          $this->gosaDefaultPrinter= $_POST['gotoPrinterSel'][0];
+        }
       }
-    }
+    }  
 
     $smarty->assign("gotoPrinter",$this->printOutPrinterDevices());
     $smarty->assign("gotoPrinterKeys",array_flip($this->printOutPrinterDevices()));
@@ -801,6 +803,8 @@ class environment extends plugin
       $smarty->assign("gotoProfileQuotaACL"," disabled ");
     }
 
+    $smarty->assign("is_group",$this->is_group);
+
     /* Als smarty vars are set. Get smarty template and generate output */
     $display.= $smarty->fetch(get_template_path('environment.tpl', TRUE,dirname(__FILE__)));
     return($display);
index ee1d37ba56891c67f3b07dfefcdb973e3e74d509..6271a4dc0cb616e0cd7158d394e03853b0506063 100644 (file)
                <input type="submit" {$gotoPrinterACL} name="gotoPrinterAdd"     value="{t}Add{/t}">
                <input type="submit" {$gotoPrinterACL} name="gotoPrinterDel"     value="{t}Delete{/t}">
                <input type="submit" {$gotoPrinterACL} name="gotoPrinterEdit"    value="{t}Toggle admin{/t}">
+{if $is_group }
+               <input type="submit" {$gotoPrinterACL} name="gotoPrinterDefault"    value="{t}Toggle default{/t}" disabled>
+{else}
                <input type="submit" {$gotoPrinterACL} name="gotoPrinterDefault"    value="{t}Toggle default{/t}">
+{/if}
            </td>
        </tr>
     </table>