From 6cc4ba0195d18c5356e59986e0864cda06d27bfa Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 12 Jun 2008 12:58:59 +0000 Subject: [PATCH] Added country class. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11303 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../departments/class_departmentGeneric.inc | 3 ++ .../class_departmentManagement.inc | 11 ++-- .../departments/class_divListDepartment.inc | 18 ++++++- .../plugins/admin/departments/generic.tpl | 54 +++++++++++++++++++ .../admin/departments/tabs_department.inc | 1 - 5 files changed, 81 insertions(+), 6 deletions(-) diff --git a/gosa-core/plugins/admin/departments/class_departmentGeneric.inc b/gosa-core/plugins/admin/departments/class_departmentGeneric.inc index 7b3736f7e..62b3947af 100644 --- a/gosa-core/plugins/admin/departments/class_departmentGeneric.inc +++ b/gosa-core/plugins/admin/departments/class_departmentGeneric.inc @@ -36,6 +36,8 @@ class department extends plugin var $gosaUnitTag= ""; var $view_logged = FALSE; + var $type ="ou"; + /* Headpage attributes */ var $last_dep_sorting= "invalid"; var $departments= array(); @@ -162,6 +164,7 @@ class department extends plugin $smarty->assign("unitTag", ""); } + $smarty->assign("dep_type",$this->type); return($smarty->fetch (get_template_path('generic.tpl', TRUE))); } diff --git a/gosa-core/plugins/admin/departments/class_departmentManagement.inc b/gosa-core/plugins/admin/departments/class_departmentManagement.inc index 174b11bd1..baf9ae2e4 100644 --- a/gosa-core/plugins/admin/departments/class_departmentManagement.inc +++ b/gosa-core/plugins/admin/departments/class_departmentManagement.inc @@ -91,14 +91,13 @@ class departmentManagement extends plugin // Post for new }elseif(preg_match("/^remove_multiple_departments/",$key)){ $s_action="del_multiple"; - }elseif(preg_match("/dep_new.*/",$key)){ - $s_action="new"; } } /* Create options */ - if(isset($_POST['menu_action']) && $_POST['menu_action'] == "dep_new"){ + if(isset($_POST['menu_action']) && preg_match("/^dep_new_/",$_POST['menu_action'])){ $s_action = "new"; + $s_entry = preg_replace("/^dep_new_([a-z]*)/","\\1",$_POST['menu_action']); } /* handle remove from layers menu */ @@ -115,7 +114,11 @@ class departmentManagement extends plugin */ if ($s_action=="new"){ $this->dn= "new"; - $this->deptabs= new deptabs($this->config,$this->config->data['TABS']['DEPTABS'], $this->dn,"department"); + if($s_entry == "c"){ + $this->deptabs= new deptabs($this->config,$this->config->data['TABS']['COUNTRY_TABS'], $this->dn,"country"); + }else{ + $this->deptabs= new deptabs($this->config,$this->config->data['TABS']['DEPTABS'], $this->dn,"department"); + } $this->deptabs->set_acl_base($this->DivListDepartment->selectedBase); } diff --git a/gosa-core/plugins/admin/departments/class_divListDepartment.inc b/gosa-core/plugins/admin/departments/class_divListDepartment.inc index f4f85944f..55ef8d2fa 100644 --- a/gosa-core/plugins/admin/departments/class_divListDepartment.inc +++ b/gosa-core/plugins/admin/departments/class_divListDepartment.inc @@ -153,7 +153,23 @@ class divListDepartment extends MultiSelectWindow $s .= "..|". " "._("Create")."|\n"; $s.= "...|". - " "._("Department")."|dep_new|\n"; + " "._("Department")." (ou)|dep_new_ou|\n"; + + $s.= "...|". + " "._("Organization")." (o)|dep_new_o|\n"; + + $s.= "...|". + " "._("Country")." (c)"."|dep_new_c|\n"; + + $s.= "...|". + " "._("Locality")." (l)|dep_new_l|\n"; + + $s.= "...|". + " "._("Alias")."|dep_new_alias|\n"; + + $s.= "...|". + " "._("Referal")."|dep_new_referal|\n"; + $s.= "..|---|\n"; } $s.= "..|". diff --git a/gosa-core/plugins/admin/departments/generic.tpl b/gosa-core/plugins/admin/departments/generic.tpl index da26e94d7..d3bb658e3 100644 --- a/gosa-core/plugins/admin/departments/generic.tpl +++ b/gosa-core/plugins/admin/departments/generic.tpl @@ -1,3 +1,48 @@ +{if $dep_type == "c"} + + + + +
+

{t}Properties{/t}

+ + + + + + + + + + + + + +
{$must} +{render acl=$ouACL} + +{/render} +
{$must} +{render acl=$descriptionACL} + +{/render} +
{$must} +{render acl=$baseACL} + +{/render} + +{render acl=$baseACL disable_picture='images/lists/folder_grey.png'} + +{/render} +
+
+ + + +{else} + + + + + @@ -113,6 +166,7 @@
@@ -9,6 +54,14 @@ {render acl=$ouACL} +{/render} +
{$must} +{render acl=$ouACL} + {/render}
+{/if} diff --git a/gosa-core/plugins/admin/departments/tabs_department.inc b/gosa-core/plugins/admin/departments/tabs_department.inc index 7e9b45c3a..65fc151ef 100644 --- a/gosa-core/plugins/admin/departments/tabs_department.inc +++ b/gosa-core/plugins/admin/departments/tabs_department.inc @@ -28,7 +28,6 @@ class deptabs extends tabs function deptabs($config, $data, $dn,$category) { tabs::tabs($config, $data, $dn,$category); - $this->base= $this->by_object['department']->base; /* Add references/acls/snapshots */ $this->addSpecialTabs(); -- 2.30.2