Code

Added information message, if printer belongs to terminal or Workstation
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Sep 2005 13:55:37 +0000 (13:55 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Sep 2005 13:55:37 +0000 (13:55 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1309 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_printGeneric.inc
plugins/admin/systems/printer.tpl

index 28c81aac41d883ca50cca244646e60d658a87f5e..a25df8639065b1d0151015eabae7ec8901ab3c5b 100644 (file)
@@ -30,7 +30,9 @@ class printgeneric extends plugin
   var $AdminMember      ="";
   var $AdminMembers     =array();
   var $AdminMemberKeys  =array();
-  
+
+  var $is_terminalBased = false; 
   var $member           =array();
   var $strings          = "";
   var $type             = "";
@@ -121,6 +123,18 @@ class printgeneric extends plugin
         }
       }
     }
+  
+    $ldap->search("(&(cn=".$this->cn.")(|(objectClass=gotoTerminal)(objectClass=gotoWorkstation)))",array("cn","objectClass"));
+    if($attrs = $ldap->fetch()){
+      if(in_array("gotoTerminal",$attrs['objectClass'])){
+        $this->is_terminalBased = "Terminal";
+      }else{
+        $this->is_terminalBased = "Workstation";
+      }
+    }
+
+
+
   }
 
   function execute()
@@ -307,7 +321,16 @@ class printgeneric extends plugin
 
     asort($userlist);
     asort($adminlist);
-
+    if($this->is_terminalBased){
+      if($this->is_terminalBased == "Terminal"){
+        $smarty->assign("desc"    ,sprintf(_("This printer belongs to terminal %s. You can't rename this printer."),$this->cn));
+      }else{
+        $smarty->assign("desc"    ,sprintf(_("This printer belongs to workstation %s. You can't rename this printer."),$this->cn));
+      }
+      $smarty->assign("cnACL"    ," disabled ");
+    }else{
+      $smarty->assign("desc"    ,_(""));
+    }
     $smarty->assign("UserMember"    ,$this->UserMember);
     $smarty->assign("UserMembers"   ,$userlist);
     $smarty->assign("UserMemberKeys",array_flip($userlist));
index c04020c5f086d3652f00160f403a096e5cc545d4..9b58d29a3b9bc42df959584b7589212805159eac 100644 (file)
@@ -5,9 +5,14 @@
 {if $is_terminal ne 'true'}
                        <h2>{t}General{/t}</h2>
                        <table summary="">
+                        <tr>
+                         <td colspan=2>
+                          {$desc}
+                         </td>
+                        </tr>
                         <tr>
                          <td><LABEL for="cn" >{t}Printer name{/t}</LABEL>{$must}</td>
-                         <td><input name="cn" id="cn" size=20 maxlength=60 value="{$cn}"></td>
+                         <td><input name="cn" id="cn" size=20 maxlength=60 value="{$cn}" {$cnACL}></td>
                         </tr>
                         <tr>
                          <td><LABEL for="description">{t}Description{/t}</LABEL></td>
@@ -15,7 +20,7 @@
                         </tr>
                        </table>
                </td>
-               <td>
+               <td valign="top">
                        <table summary="">
                         <tr>
                                  <td colspan=2>&nbsp;</td>