From: hickert Date: Fri, 14 Dec 2007 10:58:46 +0000 (+0000) Subject: Updated printer settings when editing multiple entries X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=080bb8edb4cd5585bad03229937ccb23874030c2;p=gosa.git Updated printer settings when editing multiple entries git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8128 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/personal/environment/class_environment.inc b/gosa-core/plugins/personal/environment/class_environment.inc index 54c7c0283..1e4934514 100644 --- a/gosa-core/plugins/personal/environment/class_environment.inc +++ b/gosa-core/plugins/personal/environment/class_environment.inc @@ -82,6 +82,8 @@ class environment extends plugin var $multiple_support =TRUE; + var $use_gotoPrinter; + function environment (&$config, $dn= NULL) { plugin::plugin ($config, $dn); @@ -882,7 +884,9 @@ class environment extends plugin $type = "AddGroup"; } }else{ - if(isset($this->NewDeletedPrinters[$pname])){ + if($this->multiple_support_active){ + $type = "AddUser"; + }elseif(isset($this->NewDeletedPrinters[$pname])){ $type = "AddUser"; }elseif($printerObj->by_object['printgeneric']->AddMember("AddUser",$this->dn)){ $type = "AddUser"; @@ -974,6 +978,16 @@ class environment extends plugin return($disp); } + /* Assign used attributes for multiple edit */ + foreach(array("gotoPrinter") as $box){ + $ubox ="use_".$box; + if(in_array($box,$this->multi_boxes)){ + $smarty->assign($ubox,TRUE); + }else{ + $smarty->assign($ubox,FALSE); + } + } + /* Als smarty vars are set. Get smarty template and generate output */ $smarty->assign("multiple_support",$this->multiple_support_active); $display.= $smarty->fetch(get_template_path('environment.tpl', TRUE,dirname(__FILE__))); @@ -1611,10 +1625,30 @@ class environment extends plugin $ret['gotoShares'] = $this->gotoShares; $ret['gotoLogonScripts'] = $this->gotoLogonScripts; $ret['gotoHotplugDevices'] = $this->gotoHotplugDevices; + + if(in_array("gotoPrinter",$this->multi_boxes)){ + $ret['gotoPrinter'] = $this->gotoPrinter; + $ret['gotoPrinterSel'] = $this->gotoPrinterSel; + $ret['gosaDefaultPrinter'] = $this->gosaDefaultPrinter; + + /* Force printer reset */ + $ret['add_del_printer_member_was_called'] = TRUE; + } + return($ret); } + function multiple_save_object() + { + if(isset($_POST['environment_multiple_posted'])){ + plugin::multiple_save_object(); + if(isset($_POST['use_gotoPrinter'])){ + $this->multi_boxes[] = "gotoPrinter"; + } + } + } + /* Return plugin informations for acl handling #FIXME these ACLs should work for groups too */ static function plInfo() diff --git a/gosa-core/plugins/personal/environment/environment.tpl b/gosa-core/plugins/personal/environment/environment.tpl index cbc6bc209..fa387379e 100644 --- a/gosa-core/plugins/personal/environment/environment.tpl +++ b/gosa-core/plugins/personal/environment/environment.tpl @@ -201,9 +201,9 @@ {if $multiple_support} {foreach from=$gotoLogonScripts item=item key=key} {if $item.UsedByAllUsers} - + {else} - + {/if} {/foreach} {else} @@ -247,9 +247,9 @@ {if $multiple_support} {foreach from=$gotoHotplugDevices item=item key=key} {if $item.UsedByAllUsers} - + {else} - + {/if} {/foreach} {else} @@ -274,6 +274,48 @@ + + +{if $multiple_support} + +

+ +   + +

+ + + +{else} +

  @@ -303,9 +345,15 @@ + +{/if} + +{if $multiple_support} + +{/if}