From: hickert Date: Wed, 31 Aug 2005 10:14:05 +0000 (+0000) Subject: Added ppd for printer dialog, schema parser is still missing X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0fa543f315723492fbb74f9966a1636d135b5844;p=gosa.git Added ppd for printer dialog, schema parser is still missing git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1269 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 18a8e1b9b..61a0e71e3 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -26,7 +26,7 @@ class printgeneric extends plugin var $UserMember =""; var $UserMembers =array(); var $UserMemberKeys =array(); - + var $AdminMember =""; var $AdminMembers =array(); var $AdminMemberKeys =array(); @@ -37,7 +37,7 @@ class printgeneric extends plugin var $dialog =NULL; /* attribute list for save action */ - var $attributes = array("cn", "description", "l", "labeledURI", "gotoPrinterPPD","macAddress", "ipHostNumber"); + var $attributes = array("cn", "description", "l", "labeledURI", "macAddress", "ipHostNumber","gotoPrinterPPD"); var $objectclasses = array("top", "gotoPrinter"); function printgeneric ($config, $dn= NULL) @@ -124,6 +124,7 @@ class printgeneric extends plugin function execute() { + $smarty= get_smarty(); $display=""; /* Template management. @@ -198,11 +199,34 @@ class printgeneric extends plugin $this->dialog = new selectUserToPrinterDialog($this->config, get_userinfo(),"AddAdminGroup"); } + if(isset($_POST['EditDriver'])){ + $this->dialog = new printerPPDDialog($this->config, $this->dn,$this->gotoPrinterPPD); + } + if(isset($_POST['PrinterCancel'])){ unset($this->dialog); $this->dialog= NULL; } + if(isset($_POST['SavePPD'])){ + if(count($this->dialog->check())){ + foreach($this->dialog->check() as $msg){ + print_red($msg); + } + }else{ + $this->gotoPrinterPPD = array(); + $this->gotoPrinterPPD = $this->dialog->save(); + unset($this->dialog); + $this->dialog=NULL; + } + + } + + if(isset($_POST['ClosePPD'])){ + unset($this->dialog); + $this->dialog=NULL; + } + if((isset($_POST['DelUser']))&&(isset($_POST['UserMember']))){ if(isset($this->member['AddUser'][$_POST['UserMember']])){ unset($this->member['AddUser'][$_POST['UserMember']]); @@ -259,7 +283,15 @@ class printgeneric extends plugin /* Don't show Asterisk for non-required attribute ipHostNumber and macAddress */ $smarty->assign("staticAddress", ""); - $smarty->assign("driverInfo", "Not implemented yet"); + + + require_once ("class_ppdManager.inc"); + $ppdManager= new ppdManager('/var/spool/ppd/'); + if(!empty($this->gotoPrinterPPD)){ + $smarty->assign("driverInfo", $ppdManager->loadDescription($this->gotoPrinterPPD)); + }else{ + $smarty->assign("driverInfo", _("Undefined")); + } $list=$this->generateList(); $userlist = array_merge($list['AddUser'],$list['AddGroup']); diff --git a/plugins/admin/systems/printer.tpl b/plugins/admin/systems/printer.tpl index 6893d3c77..c04020c5f 100644 --- a/plugins/admin/systems/printer.tpl +++ b/plugins/admin/systems/printer.tpl @@ -3,6 +3,7 @@ {if $is_terminal ne 'true'} +

{t}General{/t}

@@ -37,6 +38,7 @@ @@ -57,7 +63,7 @@

 

-{t}Permissions{/t} +

{t}Permissions{/t}

{$must}
{/if} +

{t}Details{/t}

@@ -46,9 +48,13 @@ +
+ - - +
{t}Driver{/t}:
{$driverInfo}
+
+ {t}PPD{/t} : {$driverInfo}
+
@@ -66,7 +72,7 @@
{t}Following objects are assigned as user.{/t}
- {html_options options=$UserMembers values=$UserMemberKeys}
@@ -83,7 +89,7 @@
{t}Following objects are assigned as admin.{/t}
- {html_options options=$AdminMembers values=$AdminMemberKeys}