summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d71de0e)
raw | patch | inline | side by side (parent: d71de0e)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 14 Dec 2007 10:20:51 +0000 (10:20 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 14 Dec 2007 10:20:51 +0000 (10:20 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8126 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/personal/environment/class_environment.inc | patch | blob | history | |
gosa-core/plugins/personal/environment/environment.tpl | patch | blob | history |
diff --git a/gosa-core/plugins/personal/environment/class_environment.inc b/gosa-core/plugins/personal/environment/class_environment.inc
index dc410f4bff0c48d6e4f52a6a46fe6a74ba24acf0..54c7c0283cdcc70556531148561bfec1574caedc 100644 (file)
if(is_array($a_tmp)){
foreach($a_tmp as $name => $hotplug){
+ if($this->multiple_support_active){
+ $hotplug['UsedByAllUsers'] = TRUE;
+ }
$this->gotoHotplugDevices[$name]= $hotplug;
}
}
$this->is_dialog = false;
}
}
- $smarty->assign("gotoHotplugDevices",$this->printOutHotPlugDevices());
- $smarty->assign("gotoHotplugDeviceKeys",array_flip($this->printOutHotPlugDevices()));
+
+ if($this->multiple_support_active){
+ $smarty->assign("gotoHotplugDevices",$this->gotoHotplugDevices);
+ }else{
+ $smarty->assign("gotoHotplugDevices",$this->printOutHotPlugDevices());
+ $smarty->assign("gotoHotplugDeviceKeys",array_flip($this->printOutHotPlugDevices()));
+ }
/* Printer Assignment will managed below
* A printer can be assigned in two different ways and two different types
$this->gotoLogonScripts[$tmp[0]]=$tmp2;
}
}
+
+ /* Prepare hotplugs */
+ if(isset($this->multi_attrs_all['gotoHotplugDeviceDN']) && is_array($this->multi_attrs_all['gotoHotplugDeviceDN'])){
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ for($i = 0 ; $i < $this->multi_attrs_all['gotoHotplugDeviceDN']['count'] ; $i ++){
+ $ldap->cat($this->multi_attrs_all['gotoHotplugDeviceDN'][$i]);
+ if($ldap->count()){
+ $multi_attrs_all = $ldap->fetch();
+
+ if(isset($multi_attrs_all['gotoHotplugDevice'][0])){
+ $tmp = preg_split("/\|/",$multi_attrs_all['gotoHotplugDevice'][0]);
+ $tmp2 = array();
+ $tmp2['name'] = $multi_attrs_all['cn'][0];
+ $tmp2['description'] = $tmp[0];
+ $tmp2['id'] = $tmp[1];
+ $tmp2['produkt'] = $tmp[2];
+ $tmp2['vendor'] = $tmp[3];
+ $tmp2['dn'] = $multi_attrs_all['dn'];
+ $tmp2['UsedByAllUsers'] = FALSE;
+ $this->gotoHotplugDevices[$tmp2['dn']] = $tmp2;
+ }
+ }
+ }
+ }
+
+ /* Prepare hotplugs */
+ if(isset($this->multi_attrs['gotoHotplugDeviceDN']) && is_array($this->multi_attrs['gotoHotplugDeviceDN'])){
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ for($i = 0 ; $i < $this->multi_attrs['gotoHotplugDeviceDN']['count'] ; $i ++){
+ $ldap->cat($this->multi_attrs['gotoHotplugDeviceDN'][$i]);
+ if($ldap->count()){
+ $multi_attrs = $ldap->fetch();
+
+ if(isset($multi_attrs['gotoHotplugDevice'][0])){
+ $tmp = preg_split("/\|/",$multi_attrs['gotoHotplugDevice'][0]);
+ $tmp2 = array();
+ $tmp2['name'] = $multi_attrs['cn'][0];
+ $tmp2['description'] = $tmp[0];
+ $tmp2['id'] = $tmp[1];
+ $tmp2['produkt'] = $tmp[2];
+ $tmp2['vendor'] = $tmp[3];
+ $tmp2['dn'] = $multi_attrs['dn'];
+ $tmp2['UsedByAllUsers'] = TRUE;
+ $this->gotoHotplugDevices[$tmp2['dn']] = $tmp2;
+ }
+ }
+ }
+ }
+ $this->gotoHotplugDevices = array_values($this->gotoHotplugDevices);
}
{
$shares = $this->gotoShares;
$scripts= $this->gotoLogonScripts;
+ $plugs= $this->gotoHotplugDevices;
plugin::set_multi_edit_values($attrs);
$this->gotoShares = $shares;
$this->gotoLogonScripts = $scripts;
+ $this->gotoHotplugDevices = $plugs;
+
foreach($attrs['gotoShares'] as $name => $share){
if($share['UsedByAllUsers'] == TRUE){
$this->gotoShares[$name] = $share;
unset($this->gotoShares[$name]);
}
}
- foreach($attrs['gotoLogonScripts'] as $name => $share){
- if($share['UsedByAllUsers'] == TRUE){
- $this->gotoLogonScripts[$name] = $share;
+ foreach($attrs['gotoLogonScripts'] as $name => $script){
+ if($script['UsedByAllUsers'] == TRUE){
+ $this->gotoLogonScripts[$name] = $script;
}
}
- foreach($this->gotoLogonScripts as $name => $share){
+ foreach($this->gotoLogonScripts as $name => $script){
if(!isset($attrs['gotoLogonScripts'][$name])){
unset($this->gotoLogonScripts[$name]);
}
}
+ $tmp = array();
+ foreach($this->gotoHotplugDevices as $entry){
+ $tmp[$entry['dn']] = $entry;
+ }
+
+ foreach($attrs['gotoHotplugDevices'] as $name => $plug){
+ if($plug['UsedByAllUsers'] == TRUE){
+ $tmp[$plug['dn']] = $plug;
+ }
+ }
+ foreach($tmp as $name => $plug){
+ $found = false;
+ foreach($attrs['gotoHotplugDevices'] as $test){
+ if($test['dn'] == $name){
+ $found = true;
+ }
+ }
+ if(!$found){
+ unset($tmp[$name]);
+ }
+ }
+ $this->gotoHotplugDevices = array_values($tmp);
}
$ret = plugin::get_multi_edit_values();
$ret['gotoShares'] = $this->gotoShares;
$ret['gotoLogonScripts'] = $this->gotoLogonScripts;
+ $ret['gotoHotplugDevices'] = $this->gotoHotplugDevices;
return($ret);
}
diff --git a/gosa-core/plugins/personal/environment/environment.tpl b/gosa-core/plugins/personal/environment/environment.tpl
index 3fdbead4b6653d49667bd39d18aec1efeb0d6af5..cbc6bc20977912913820376aafe354e9eeb04d1f 100644 (file)
<td>
{render acl=$gotoHotplugDeviceACL}
<select name="gotoHotplugDevice_post[]" size=5 style="width:100%;" id="gotoHotplugDevice_post" multiple>
- {html_options values=$gotoHotplugDeviceKeys output=$gotoHotplugDevices}
- <option disabled> </option>
+ {if $multiple_support}
+ {foreach from=$gotoHotplugDevices item=item key=key}
+ {if $item.UsedByAllUsers}
+ <option value="{$key}">{$item.name} [{$item.description}]</option>
+ {else}
+ <option style='color: #888888; background: #DDDDDD;background-color: #DDDDDD;' value="{$key}">{$item.name} [{$item.description}]</option>
+ {/if}
+ {/foreach}
+ {else}
+ {html_options values=$gotoHotplugDeviceKeys output=$gotoHotplugDevices}
+ <option disabled> </option>
+ {/if}
</select>
{/render}
</td>