Code

Added country class.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Jun 2008 12:58:59 +0000 (12:58 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Jun 2008 12:58:59 +0000 (12:58 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11303 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/departments/class_departmentGeneric.inc
gosa-core/plugins/admin/departments/class_departmentManagement.inc
gosa-core/plugins/admin/departments/class_divListDepartment.inc
gosa-core/plugins/admin/departments/generic.tpl
gosa-core/plugins/admin/departments/tabs_department.inc

index 7b3736f7ede389e27a2b9a0d1478a2a42c2b81a9..62b3947afa36c125cbdbf6a937bd210935c13340 100644 (file)
@@ -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)));
        }
 
index 174b11bd18372326457e1c38c1df1dac24a06012..baf9ae2e4d35b166650dff300021cb8f94b95b82 100644 (file)
@@ -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);
     }
 
index f4f85944fcbf24fc778b29330194827ca502aea2..55ef8d2fac7cd8e8f0899241808d8933c7c4cb95 100644 (file)
@@ -153,7 +153,23 @@ class divListDepartment extends MultiSelectWindow
       $s .= "..|<img src='images/lists/new.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Create")."|\n";
       $s.= "...|<input class='center' type='image' src='plugins/departments/images/department.png' alt=''>".
-        "&nbsp;"._("Department")."|dep_new|\n";
+        "&nbsp;"._("Department")."&nbsp;(ou)|dep_new_ou|\n";
+
+      $s.= "...|<input class='center' type='image' src='plugins/departments/images/department.png' alt=''>".
+        "&nbsp;"._("Organization")."&nbsp;(o)|dep_new_o|\n";
+
+      $s.= "...|<input class='center' type='image' src='plugins/departments/images/department.png' alt=''>".
+        "&nbsp;"._("Country")."&nbsp;(c)"."|dep_new_c|\n";
+
+      $s.= "...|<input class='center' type='image' src='plugins/departments/images/department.png' alt=''>".
+        "&nbsp;"._("Locality")."&nbsp;(l)|dep_new_l|\n";
+
+      $s.= "...|<input class='center' type='image' src='plugins/departments/images/department.png' alt=''>".
+        "&nbsp;"._("Alias")."|dep_new_alias|\n";
+
+      $s.= "...|<input class='center' type='image' src='plugins/departments/images/department.png' alt=''>".
+        "&nbsp;"._("Referal")."|dep_new_referal|\n";
+
       $s.= "..|---|\n";
     }
     $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
index da26e94d72f68fc24eaf63e2b7d6e41ef4886b78..d3bb658e3db62deb15c926f5d0845644caeb58f4 100644 (file)
@@ -1,3 +1,48 @@
+{if $dep_type == "c"}
+<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4>
+ <tr>
+   <td style="vertical-align:top; width:50%">
+     <h2><img class="center" alt="" align="middle" src="images/rightarrow.png"> {t}Properties{/t}</h2>
+     <table summary="">
+      <tr>
+       <td><LABEL for="c">{t}Country name{/t}</LABEL>{$must}</td>
+       <td>
+{render acl=$ouACL}
+       <input id="c" name="c" size=25 maxlength=60 value="{$c}" title="{t}Name of country to create{/t}">
+{/render}
+       </td>
+      </tr>
+      <tr>
+       <td><LABEL for="description">{t}Description{/t}</LABEL>{$must}</td>
+       <td>
+{render acl=$descriptionACL}
+        <input id="description" name="description" size=25 maxlength=80 value="{$description}" title="{t}Descriptive text for department{/t}">
+{/render}
+       </td>
+      </tr>
+      <tr>
+        <td><LABEL for="base">{t}Base{/t}</LABEL>{$must}</td>
+        <td>
+{render acl=$baseACL}
+         <select id="base" size="1" name="base" title="{t}Choose subtree to place department in{/t}"> 
+          {html_options options=$bases selected=$base_select}
+         </select>
+{/render}
+
+{render acl=$baseACL disable_picture='images/lists/folder_grey.png'}
+        <input type="image" name="chooseBase" src="images/lists/folder.png" class="center" title="{t}Select a base{/t}">
+{/render}
+         </td>
+        </tr>
+       </table>
+  </td>
+ </tr>
+</table>
+
+
+
+{else}
+
 <table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4>
  <tr>
    <td style="vertical-align:top; width:50%">
@@ -9,6 +54,14 @@
        <td>
 {render acl=$ouACL}
        <input id="ou" name="ou" size=25 maxlength=60 value="{$ou}" title="{t}Name of subtree to create{/t}">
+{/render}
+       </td>
+      </tr>
+      <tr>
+       <td><LABEL for="c">{t}Name of department{/t}</LABEL>{$must}</td>
+       <td>
+{render acl=$ouACL}
+    <input id="c" name="c" size=25 maxlength=60 value="{$c}" title="{t}Name of country to create{/t}">
 {/render}
        </td>
       </tr>
    </td>
   </tr>
 </table>
+{/if}
 
 <!-- Place cursor -->
 <input type='hidden' name='dep_generic_posted' value='1'>
index 7e9b45c3ac4d7ea87643c2959358fcae868b0aa8..65fc151ef45dc2327fcfbb1d29213ecbd7030522 100644 (file)
@@ -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();