summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f7bd29e)
raw | patch | inline | side by side (parent: f7bd29e)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 27 Mar 2008 13:44:03 +0000 (13:44 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 27 Mar 2008 13:44:03 +0000 (13:44 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10027 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc | patch | blob | history | |
gosa-plugins/goto/addons/goto/events/class_EventTargetAddList.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc
index e6eafceeda9eef4dfe7cf1490d7896161f9cbd06..f1e2756cf62e4f3288cb9bba08f0dc11c294de88 100644 (file)
}
if(isset($_POST['save_target_dialog'])){
$this->target_add_list_used =FALSE;
- foreach($this->list_get_selected_items() as $id){
- if(in_array("gosaGroupOfNames",$this->target_divlist->_target_list[$id]['objectClass'])){
- foreach($this->target_divlist->_target_list[$id]['member'] as $mem_dn){
- if(isset($this->target_divlist->workstation_list[$mem_dn])){
- $this->a_targets[] = $this->target_divlist->workstation_list[$mem_dn]['macAddress'][0];
- }
- if(isset($this->target_divlist->server_list[$mem_dn])){
- $this->a_targets[] = $this->target_divlist->server_list[$mem_dn]['macAddress'][0];
- }
- }
- }else{
- if(isset($this->target_divlist->_target_list[$id]['macAddress'][0])){
- $this->a_targets[] = $this->target_divlist->_target_list[$id]['macAddress'][0];
- }
- }
- }
+ $this->add_targets($this->target_divlist->get_selected_targets());
$this->target_divlist = NULL;
}
}
diff --git a/gosa-plugins/goto/addons/goto/events/class_EventTargetAddList.inc b/gosa-plugins/goto/addons/goto/events/class_EventTargetAddList.inc
index 476e0ab33dbadb30241a443d21de103d106f95ec..b908ddd68c5a8260e4d9bf4d1604330c262d0045 100644 (file)
}
+ function get_selected_targets()
+ {
+ $a_targets = array();
+ foreach($this->list_get_selected_items() as $id){
+ if(in_array("gosaGroupOfNames",$this->_target_list[$id]['objectClass'])){
+ foreach($this->_target_list[$id]['member'] as $mem_dn){
+ if(isset($this->workstation_list[$mem_dn])){
+ $a_targets[] = $this->workstation_list[$mem_dn]['macAddress'][0];
+ }
+ if(isset($this->server_list[$mem_dn])){
+ $a_targets[] = $this->server_list[$mem_dn]['macAddress'][0];
+ }
+ }
+ }else{
+ if(isset($this->_target_list[$id]['macAddress'][0])){
+ $a_targets[] = $this->_target_list[$id]['macAddress'][0];
+ }
+ }
+ }
+ return($a_targets);
+ }
+
+
function setEntries()
{
$_target_list = array();
$this->AddElement(array($field1,$field2,$field3));
}
}
+
+
+ /*! \brief Returns a set of elements selected in a MultiSelectWindow
+ @return Array[integer]=integer
+ */
+ protected function list_get_selected_items()
+ {
+ $ids = array();
+ foreach($_POST as $name => $value){
+ if(preg_match("/^item_selected_[0-9]*$/",$name)){
+ $id = preg_replace("/^item_selected_/","",$name);
+ $ids[$id] = $id;
+ }
+ }
+ return($ids);
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>