summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0e5a02c)
raw | patch | inline | side by side (parent: 0e5a02c)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 28 Jan 2008 14:26:00 +0000 (14:26 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 28 Jan 2008 14:26:00 +0000 (14:26 +0000) |
-If terminal is added, add the terminal service tab.
-Only allow one system type at once, terminals or workstations.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8621 594d385d-05f5-0310-b6e9-bd551577e9d8
-Only allow one system type at once, terminals or workstations.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8621 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/admin/ogroups/class_ogroup.inc | patch | blob | history | |
gosa-core/plugins/admin/ogroups/tabs_ogroups.inc | patch | blob | history |
diff --git a/gosa-core/plugins/admin/ogroups/class_ogroup.inc b/gosa-core/plugins/admin/ogroups/class_ogroup.inc
index ef6388f32550e37b33025b504bf4c60c351fbfce..5e1dec7ae4113b6f7d64c8df6c33587f1cb3a738 100644 (file)
/* Add objects to group */
if (isset($_POST['add_object_finish']) && isset($_POST['objects'])){
+
+ $tmp = "";
+ foreach($this->memberList as $obj){
+ $tmp .= $obj['type'];
+ }
+ $skipped = FALSE;
foreach ($_POST['objects'] as $value){
- $this->memberList["$value"]= $this->objects[$value];
- $this->member["$value"]= $value;
- unset ($this->objects[$value]);
- uasort ($this->memberList, 'sort_list');
- reset ($this->memberList);
+ if(preg_match("/T/",$tmp) && $this->objects[$value]['type'] == "W"){
+ $skipped =TRUE;
+ }elseif(preg_match("/W/",$tmp) && $this->objects[$value]['type'] == "T"){
+ $skipped =TRUE;
+ }else{
+ $this->memberList["$value"]= $this->objects[$value];
+ $this->member["$value"]= $value;
+ unset ($this->objects[$value]);
+ uasort ($this->memberList, 'sort_list');
+ reset ($this->memberList);
+ }
+ }
+ if($skipped){
+ print_red(_("You can only have terminals or workstations in one group, but not both."));
}
$this->reload();
}
diff --git a/gosa-core/plugins/admin/ogroups/tabs_ogroups.inc b/gosa-core/plugins/admin/ogroups/tabs_ogroups.inc
index 3cbeccd92639f7a3222adbc534e5b9e0e2c57cf3..adcc709f596173e9fb467ad8a2b1594dd30d87bb 100644 (file)
unset($this->by_object['termgroup']);
unset($this->by_name['termgroup']);
}
+ if(((!preg_match("/T/",$objects)) && (!preg_match("/W/",$objects)))&&(isset($this->by_object['termservice']))){
+ $this->by_object['termservice']->remove_from_parent();
+ unset($this->by_object['termservice']);
+ unset($this->by_name['termservice']);
+ }
/* Remove ws tabs, if theres no ws left in the object list */
if((!preg_match("/W/",$objects))&&(isset($this->by_object['workservice']))){
$this->by_object['termgroup']->inheritTimeServer = false;
$this->by_object['termgroup']->parent= &$this;
}
+ if(!isset($this->by_object['termservice'])){
+ $this->by_name['termservice']= _("Service");
+ $this->by_object['termservice']= new termservice($this->config, $this->dn);
+ $this->by_object['termservice']->parent= &$this;
+ }
}
/* Add Workstation tabs */
$this->by_object['termgroup']= new termgroup($this->config, $this->dn);
$this->by_object['termgroup']->parent= &$this;
+ $this->by_name['termservice']= _("Service");
+ $this->by_object['termservice']= new termservice($this->config, $this->dn);
+ $this->by_object['termservice']->parent= &$this;
break;
case "U":