Code

Added Department templates.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 24 Jun 2008 12:52:57 +0000 (12:52 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 24 Jun 2008 12:52:57 +0000 (12:52 +0000)
-Locality, country, organization

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11418 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/departments/class_departmentGeneric.inc
gosa-core/plugins/admin/departments/class_organizationGeneric.inc
gosa-core/plugins/admin/departments/country.tpl [new file with mode: 0644]
gosa-core/plugins/admin/departments/generic.tpl
gosa-core/plugins/admin/departments/locality.tpl [new file with mode: 0644]
gosa-core/plugins/admin/departments/organization.tpl [new file with mode: 0644]

index 3962c47942570b43d7a8585d1f728fa42ac1464d..c8da2b281e438896435e5b869a3bd41f165ff4bc 100644 (file)
@@ -172,7 +172,18 @@ class department extends plugin
     }
 
     $smarty->assign("dep_type",$this->type);
-               return($smarty->fetch (get_template_path('generic.tpl', TRUE)));
+
+    switch($this->type){
+      case 'c'        : $tpl ="country.tpl";break;
+      case 'o'        : $tpl ="organization.tpl";break;
+      case 'l'        : $tpl ="locality.tpl";break;
+      case 'ou'       : $tpl ="generic.tpl";break;
+      case 'alias'    : $tpl ="alias.tpl";break;
+      case 'referal'  : $tpl ="referal.tpl";break;
+      default  : $tpl ="generic.tpl";
+    }
+
+               return($smarty->fetch (get_template_path($tpl, TRUE)));
        }
 
        function clear_fields()
index 248c482015dad4ca7f6385eb72f7e5e82db2637d..467aa85e5b1a12e68db0241d2043a3ed57147db0 100644 (file)
 class organization extends department
 {
        /* attribute list for save action */
-       var $attributes     = array( "o", "description");
-       var $objectclasses  = array("top", "organization");
-  var $type   ="o";
-  var $o      ="";
-  var $orgi_o ="";
+  var $attributes     = array( "o", "description","userPassword","searchGuide",
+      "seeAlso","businessCategory","x121Address","registeredAddress",
+      "destinationIndicator","preferredDeliveryMethod","telexNumber",
+      "telephoneNumber","internationaliSDNNumber","facsimileTelephoneNumber","street",
+      "postOfficeBox","postalCode", "postalAddress","physicalDeliveryOfficeName",
+      "st","l","teletexTerminalIdentifier");
 
-  var $namingAttr = "o";
+  var $objectclasses  = array("top", "organization");
+
+  /* Attributes 
+   */ 
+  var $st                       ="c";
+  var $l                        ="c";
+  var $description              ="c";
+  var $userPassword             ="c";
+  var $searchGuide              ="c";
+  var $seeAlso                  ="c";
+  var $businessCategory         ="c";
+  var $x121Address              ="c";
+  var $registeredAddress        ="c";
+  var $destinationIndicator     ="c";
+  var $preferredDeliveryMethod  ="c";
+  var $telexNumber              ="c";
+  var $telephoneNumber          ="c";
+  var $internationaliSDNNumber  ="c";
+  var $facsimileTelephoneNumber ="c";
+  var $street                   ="c";
+  var $postOfficeBox            ="c";
+  var $postalCode               ="c";
+  var $postalAddress            ="c";
+  var $teletexTerminalIdentifier="c";
+  var $physicalDeliveryOfficeName="c";
+
+  /* Naming attributes 
+   */
+  var $o            ="";
+  var $type         = "o";
+  var $orgi_o       = "";
+  var $namingAttr   = "o";
 
   function check()
   {
     $message = plugin::check();
     return($message);
   }
-
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/gosa-core/plugins/admin/departments/country.tpl b/gosa-core/plugins/admin/departments/country.tpl
new file mode 100644 (file)
index 0000000..437a1c2
--- /dev/null
@@ -0,0 +1,54 @@
+<!--////////////////////
+       //      COUNTRY (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>
+<p class='seperator'>&nbsp;</p>
+<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4>
+ <tr>
+   <td style="vertical-align:top; width:100%">
+     <h2><img class="center" alt="" align="middle" src="images/lists/locked.png"> {t}Administrative settings{/t}</h2>
+{render acl=$gosaUnitTagACL}
+     <input id="unitTag" type=checkbox name="unitTag" value="1" {$unitTag}><label for="unitTag">{t}Tag department as an independent administrative unit{/t}</label>
+{/render}
+   </td>
+  </tr>
+</table>
index df3c9121f2c758a188dbea9331f6a5c9e6a4d145..3b44f6f1e3347a278bff944d66ee949a05781a52 100644 (file)
@@ -1,185 +1,6 @@
-
-{if $dep_type == "l"}
-
-<!--////////////////////
-       //      LOCALITY (l)
-    //////////////////// -->
-
-<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="l">{t}Locality name{/t}</LABEL>{$must}</td>
-       <td>
-{render acl=$ouACL}
-       <input id="l" name="l" size=25 maxlength=60 value="{$l}" title="{t}Name of locality 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>
-<p class='seperator'>&nbsp;</p>
-<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4>
- <tr>
-   <td style="vertical-align:top; width:100%">
-     <h2><img class="center" alt="" align="middle" src="images/lists/locked.png"> {t}Administrative settings{/t}</h2>
-{render acl=$gosaUnitTagACL}
-     <input id="unitTag" type=checkbox name="unitTag" value="1" {$unitTag}><label for="unitTag">{t}Tag department as an independent administrative unit{/t}</label>
-{/render}
-   </td>
-  </tr>
-</table>
-
-
-{elseif $dep_type == "o"}
-
-<!--////////////////////
-       //      ORGANIZATION (o)
-    //////////////////// -->
-
-<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="o">{t}Organization name{/t}</LABEL>{$must}</td>
-       <td>
-{render acl=$ouACL}
-       <input id="o" name="o" size=25 maxlength=60 value="{$o}" title="{t}Name of organization 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>
-<p class='seperator'>&nbsp;</p>
-<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4>
- <tr>
-   <td style="vertical-align:top; width:100%">
-     <h2><img class="center" alt="" align="middle" src="images/lists/locked.png"> {t}Administrative settings{/t}</h2>
-{render acl=$gosaUnitTagACL}
-     <input id="unitTag" type=checkbox name="unitTag" value="1" {$unitTag}><label for="unitTag">{t}Tag department as an independent administrative unit{/t}</label>
-{/render}
-   </td>
-  </tr>
-</table>
-
-
-{elseif $dep_type == "c"}
-
-<!--////////////////////
-       //      COUNTRY (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>
-<p class='seperator'>&nbsp;</p>
-<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4>
- <tr>
-   <td style="vertical-align:top; width:100%">
-     <h2><img class="center" alt="" align="middle" src="images/lists/locked.png"> {t}Administrative settings{/t}</h2>
-{render acl=$gosaUnitTagACL}
-     <input id="unitTag" type=checkbox name="unitTag" value="1" {$unitTag}><label for="unitTag">{t}Tag department as an independent administrative unit{/t}</label>
-{/render}
-   </td>
-  </tr>
-</table>
-
-
-{elseif $dep_type == "ou"}
-
 <!--////////////////////
        //      ORGANIZATIONAL UNIT (ou)
     //////////////////// -->
-
-
 <table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4>
  <tr>
    <td style="vertical-align:top; width:50%">
    </td>
   </tr>
 </table>
-{/if}
 
 <!-- Place cursor -->
 <input type='hidden' name='dep_generic_posted' value='1'>
diff --git a/gosa-core/plugins/admin/departments/locality.tpl b/gosa-core/plugins/admin/departments/locality.tpl
new file mode 100644 (file)
index 0000000..10c9290
--- /dev/null
@@ -0,0 +1,54 @@
+<!--////////////////////
+       //      LOCALITY (l)
+    //////////////////// -->
+
+<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="l">{t}Locality name{/t}</LABEL>{$must}</td>
+       <td>
+{render acl=$ouACL}
+       <input id="l" name="l" size=25 maxlength=60 value="{$l}" title="{t}Name of locality 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>
+<p class='seperator'>&nbsp;</p>
+<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4>
+ <tr>
+   <td style="vertical-align:top; width:100%">
+     <h2><img class="center" alt="" align="middle" src="images/lists/locked.png"> {t}Administrative settings{/t}</h2>
+{render acl=$gosaUnitTagACL}
+     <input id="unitTag" type=checkbox name="unitTag" value="1" {$unitTag}><label for="unitTag">{t}Tag department as an independent administrative unit{/t}</label>
+{/render}
+   </td>
+  </tr>
+</table>
diff --git a/gosa-core/plugins/admin/departments/organization.tpl b/gosa-core/plugins/admin/departments/organization.tpl
new file mode 100644 (file)
index 0000000..25b79dc
--- /dev/null
@@ -0,0 +1,102 @@
+<!--////////////////////
+       //      ORGANIZATION (o)
+    //////////////////// -->
+
+<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="o">{t}Organization name{/t}</LABEL>{$must}</td>
+       <td>
+{render acl=$ouACL}
+       <input id="o" name="o" size=25 maxlength=60 value="{$o}" title="{t}Name of organization 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 style="border-left:1px solid #A0A0A0">
+    &nbsp;
+   </td>
+   <td>
+     <h2><img class="center" alt="" align="middle" src="plugins/departments/images/department.png"> {t}Location{/t}</h2>
+
+     <table summary="" style="width:100%">
+      <tr>
+       <td><LABEL for="st">{t}State{/t}</LABEL></td>
+       <td>
+{render acl=$stACL}
+       <input id="st" name="st" size=25 maxlength=60 value="{$st}" title="{t}State where this subtree is located{/t}">
+{/render}
+       </td>
+      </tr>
+      <tr>
+       <td><LABEL for="l">{t}Location{/t}</LABEL></td>
+       <td>
+{render acl=$lACL}
+       <input id="l" name="l" size=25 maxlength=60 value="{$l}" title="{t}Location of this subtree{/t}">
+{/render}
+       </td>
+      </tr>
+      <tr>
+       <td style="vertical-align:top;"><LABEL for="postalAddress">{t}Address{/t}</LABEL></td>
+       <td>
+{render acl=$postalAddressACL}
+       <textarea id="postalAddress" name="postalAddress" style="width:100%" rows=3 cols=22 title="{t}Postal address of this subtree{/t}">{$postalAddress}</textarea>
+{/render}
+      </tr>
+      <tr>
+       <td><LABEL for="telephoneNumber">{t}Phone{/t}</LABEL></td>
+       <td>
+{render acl=$telephoneNumberACL}
+       <input id="telephoneNumber" name="telephoneNumber" size=25 maxlength=60 value="{$telephoneNumber}" title="{t}Base telephone number of this subtree{/t}">
+{/render}
+       </td>
+      </tr>
+      <tr>
+       <td><LABEL for="facsimileTelephoneNumber">{t}Fax{/t}</LABEL></td>
+       <td>
+{render acl=$facsimileTelephoneNumberACL}
+       <input id="facsimileTelephoneNumber" name="facsimileTelephoneNumber" size=25 maxlength=60 value="{$facsimileTelephoneNumber}" title="{t}Base facsimile telephone number of this subtree{/t}">
+{/render}
+       </td>
+      </tr>
+        </tr>
+       </table>
+  </td>
+ </tr>
+</table>
+<p class='seperator'>&nbsp;</p>
+<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4>
+ <tr>
+   <td style="vertical-align:top; width:100%">
+     <h2><img class="center" alt="" align="middle" src="images/lists/locked.png"> {t}Administrative settings{/t}</h2>
+{render acl=$gosaUnitTagACL}
+     <input id="unitTag" type=checkbox name="unitTag" value="1" {$unitTag}><label for="unitTag">{t}Tag department as an independent administrative unit{/t}</label>
+{/render}
+   </td>
+  </tr>
+</table>