summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bd46976)
raw | patch | inline | side by side (parent: bd46976)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 24 Feb 2010 11:37:06 +0000 (11:37 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 24 Feb 2010 11:37:06 +0000 (11:37 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@15692 594d385d-05f5-0310-b6e9-bd551577e9d8
12 files changed:
diff --git a/gosa-core/plugins/admin/departments/class_countryGeneric.inc b/gosa-core/plugins/admin/departments/class_countryGeneric.inc
index da87b915048090758c789360a31fc9fa68ea066d..f69343431fbadd2cdf126c1eac7d33ca5385a000 100644 (file)
class country extends department
{
/* attribute list for save action */
- var $attributes = array( "c", "ou", "description","gosaUnitTag");
+ var $attributes = array( "c", "ou", "description","gosaUnitTag", "manager");
var $objectclasses = array("top", "gosaDepartment");
var $structuralOC = array("country");
var $type ="country";
var $orgi_c ="";
var $namingAttr = "c";
+ var $manager_enabled = FALSE;
+ var $manager_name ="";
+ var $manager ="";
+
function check()
{
"plProvidedAcls" => array(
"c" => _("Country name"),
"description" => _("Description"),
+ "manager" => _("Manager"),
"base" => _("Base"),
"gosaUnitTag" => _("Administrative settings"))
));
diff --git a/gosa-core/plugins/admin/departments/class_dcObject.inc b/gosa-core/plugins/admin/departments/class_dcObject.inc
index 246e6539df7c35ebebaeefe3f9bbdc22b6adba7b..c4423d7faf9f0cae77bebfa386e16ea21fda7f61 100644 (file)
class dcObject extends department
{
/* attribute list for save action */
- var $attributes = array( "dc", "ou", "description","gosaUnitTag");
+ var $attributes = array( "dc", "ou", "description","gosaUnitTag", "manager");
var $objectclasses = array("top", "dcObject", "gosaDepartment");
var $structuralOC = array("locality");
var $type = "dcObject";
var $orgi_dc = "";
var $namingAttr = "dc";
+ var $manager_enabled = FALSE;
+ var $manager_name ="";
+ var $manager ="";
+
function check()
{
"plProvidedAcls" => array(
"dc" => _("Name"),
"description" => _("Description"),
+ "manager" => _("Manager"),
"base" => _("Base"),
"gosaUnitTag" => _("Administrative settings"))
));
diff --git a/gosa-core/plugins/admin/departments/class_department.inc b/gosa-core/plugins/admin/departments/class_department.inc
index ba0cc57099b6105356ccc23788d9803ccaf7f693..859ec3f9a52b4eab00a467a531c8d9022340bc02 100644 (file)
/* attribute list for save action */
var $attributes= array("ou", "description", "businessCategory", "st", "l", "postalAddress",
- "telephoneNumber", "facsimileTelephoneNumber", "gosaUnitTag");
+ "telephoneNumber", "facsimileTelephoneNumber", "gosaUnitTag", "manager");
/* Do not append the structural object classes here, they are added dynamically in the constructor */
var $objectclasses= array("top", "gosaDepartment");
var $orig_ou = "";
var $baseSelector;
+ var $manager_enabled = FALSE;
+ var $manager_name ="";
+ var $manager ="";
+
function department (&$config, $dn)
{
/* Add the default structural obejct class 'locality' if this is a new entry
$this->baseSelector->setSubmitButton(false);
$this->baseSelector->setHeight(300);
$this->baseSelector->update(true);
+
+
+
+ // If the 'manager' attribute is present in gosaDepartment allow to manage it.
+ $ldap = $this->config->get_ldap_link();
+ $ocs = $ldap->get_objectclasses();
+ if(isset($ocs['gosaDepartment']['MAY']) && in_array('manager', $ocs['gosaDepartment']['MAY'])){
+ $this->manager_enabled = TRUE;
+
+ // Detect the managers name
+ $this->manager_name = "";
+ $ldap = $this->config->get_ldap_link();
+ if(!empty($this->manager)){
+ $ldap->cat($this->manager, array('cn'));
+ if($ldap->count()){
+ $attrs = $ldap->fetch();
+ $this->manager_name = $attrs['cn'][0];
+ }else{
+ $this->manager_name = "("._("Unknown")."!): ".$this->manager;
+ }
+ }
+ }
}
function execute()
$this->config->get_departments($this->dn);
$this->config->make_idepartments();
$smarty= get_smarty();
- $smarty->assign("usePrototype", "true");
+ $smarty->assign("usePrototype", "true");
+
+ // Clear manager attribute if requested
+ if(preg_match("/ removeManager/i", " ".implode(array_keys($_POST),' ')." ")){
+ $this->manager = "";
+ $this->manager_name = "";
+ }
+
+ // Allow to manager manager attribute
+ if($this->manager_enabled){
+
+ // Allow to select a new inetOrgPersion:manager
+ if(preg_match("/ editManager/i", " ".implode(array_keys($_POST),' ')." ")){
+ $this->dialog = new singleUserSelect($this->config, get_userinfo());
+ }
+ if($this->dialog && count($this->dialog->detectPostActions())){
+ $users = $this->dialog->detectPostActions();
+ if(isset($users['targets']) && count($users['targets'])){
+
+ $headpage = $this->dialog->getHeadpage();
+ $dn = $users['targets'][0];
+ $attrs = $headpage->getEntry($dn);
+ $this->manager = $dn;
+ $this->manager_name = $attrs['cn'][0];
+ $this->dialog = NULL;
+ }
+ }
+ if(isset($_POST['add_users_cancel'])){
+ $this->dialog = NULL;
+ }
+ if($this->dialog) return($this->dialog->execute());
+ }
+ $smarty->assign("manager",$this->manager);
+ $smarty->assign("manager_name",$this->manager_name);
+ $smarty->assign("manager_enabled",$this->manager_enabled);
+
$tmp = $this->plInfo();
foreach($tmp['plProvidedAcls'] as $name => $translation){
"postalAddress" => _("Address"),
"telephoneNumber" => _("Telephone"),
"facsimileTelephoneNumber" => _("Fax"),
+ "manager" => _("Manager"),
"gosaUnitTag" => _("Administrative settings"))
));
diff --git a/gosa-core/plugins/admin/departments/class_domain.inc b/gosa-core/plugins/admin/departments/class_domain.inc
index 1e37d2b7bf6f842c518ff184e088e887cd08b928..560503a7db072f25d9fd8902410a7ef7aee55070 100644 (file)
class domain extends department
{
/* attribute list for save action */
- var $attributes = array( "dc", "ou", "description","gosaUnitTag");
+ var $attributes = array( "dc", "ou", "description","gosaUnitTag", "manager");
var $objectclasses = array("top", "domain", "gosaDepartment");
var $structuralOC = array("domain");
var $type = "domain";
var $orgi_dc = "";
var $namingAttr = "dc";
+ var $manager_enabled = FALSE;
+ var $manager_name ="";
+ var $manager ="";
+
function check()
{
"dc" => _("Name"),
"description" => _("Description"),
"base" => _("Base"),
+ "manager" => _("Manager"),
"gosaUnitTag" => _("Administrative settings"))
));
}
diff --git a/gosa-core/plugins/admin/departments/class_localityGeneric.inc b/gosa-core/plugins/admin/departments/class_localityGeneric.inc
index 5394bcbd8e09e86f680f8a45f754715492d0cf76..9c435ee418a66830222e10198ba6f4c8d2c6a511 100644 (file)
class locality extends department
{
/* attribute list for save action */
- var $attributes = array("l", "description", "ou", "gosaUnitTag");
+ var $attributes = array("l", "description", "ou", "gosaUnitTag", "manager");
var $objectclasses = array("top", "gosaDepartment");
var $structuralOC = array("locality");
var $orig_l = "";
var $namingAttr = "l";
+ var $manager_enabled = FALSE;
+ var $manager_name ="";
+ var $manager ="";
+
function check()
{
$message = plugin::check();
"plProvidedAcls" => array(
"l" => _("Location"),
"description" => _("Description"),
+ "manager" => _("Manager"),
"base" => _("Base"),
"gosaUnitTag" => _("Administrative settings"))
));
diff --git a/gosa-core/plugins/admin/departments/class_organizationGeneric.inc b/gosa-core/plugins/admin/departments/class_organizationGeneric.inc
index ead3c230f77f765ecc9615dc5a085541c56755cc..7f55361f97f9819091edb3ae6fd1be3e809ac037 100644 (file)
{
/* attribute list for save action */
var $attributes = array( "o", "ou", "description","userPassword","searchGuide",
- "seeAlso","businessCategory","x121Address","registeredAddress",
+ "seeAlso","businessCategory","x121Address","registeredAddress","manager",
"destinationIndicator","preferredDeliveryMethod","telexNumber",
"telephoneNumber","internationaliSDNNumber","facsimileTelephoneNumber","street",
"postOfficeBox","postalCode", "postalAddress","physicalDeliveryOfficeName",
var $orgi_o = "";
var $namingAttr = "o";
+ var $manager_enabled = FALSE;
+ var $manager_name ="";
+ var $manager ="";
+
function check()
{
$message = plugin::check();
"businessCategory" => _("Category"),
"base" => _("Base"),
+ "manager" => _("Manager"),
+
"st" => _("State"),
"l" => _("Location"),
"postalAddress" => _("Postal address"),
diff --git a/gosa-core/plugins/admin/departments/country.tpl b/gosa-core/plugins/admin/departments/country.tpl
index eff9c73a104655d5a662d79bca8f25a59b7365e9..d3da83a1a069d1b525d58fadaeef300be7c602e8 100644 (file)
</td>
</tr>
{/if}
+
+ {if $manager_enabled}
+ <tr>
+ <td><label for="manager">{t}Manager{/t}</label></td>
+ <td>
+{render acl=$managerACL}
+ <input type='text' name='manager_name' id='manager_name' value='{$manager_name}' disabled
+ title='{$manager}'>
+{/render}
+{render acl=$managerACL}
+ <input type='image' src='images/lists/edit.png' name='editManager' class='center'>
+{/render}
+ {if $manager!=""}
+{render acl=$managerACL}
+ <img src='images/info_small.png' title='{$manager}' class='center'>
+{/render}
+{render acl=$managerACL}
+ <input type='image' src='images/lists/trash.png' name='removeManager' class='center'>
+{/render}
+ {/if}
+ </td>
+ </tr>
+ {/if}
</table>
</td>
</tr>
diff --git a/gosa-core/plugins/admin/departments/dcObject.tpl b/gosa-core/plugins/admin/departments/dcObject.tpl
index 51a6ec45953418285bc7cdc8619a488652d871ac..23c7aa4665dd417e0fb63e882831667e477491ca 100644 (file)
</td>
</tr>
{/if}
+
+ {if $manager_enabled}
+ <tr>
+ <td><label for="manager">{t}Manager{/t}</label></td>
+ <td>
+{render acl=$managerACL}
+ <input type='text' name='manager_name' id='manager_name' value='{$manager_name}' disabled
+ title='{$manager}'>
+{/render}
+{render acl=$managerACL}
+ <input type='image' src='images/lists/edit.png' name='editManager' class='center'>
+{/render}
+ {if $manager!=""}
+{render acl=$managerACL}
+ <img src='images/info_small.png' title='{$manager}' class='center'>
+{/render}
+{render acl=$managerACL}
+ <input type='image' src='images/lists/trash.png' name='removeManager' class='center'>
+{/render}
+ {/if}
+ </td>
+ </tr>
+ {/if}
</table>
</td>
</tr>
diff --git a/gosa-core/plugins/admin/departments/domain.tpl b/gosa-core/plugins/admin/departments/domain.tpl
index c30170e6ac9a75db27d8cf906fd31b71ebca3915..a686ed9cf21234cb17d73909d697196614b939a1 100644 (file)
</td>
</tr>
{/if}
+
+ {if $manager_enabled}
+ <tr>
+ <td><label for="manager">{t}Manager{/t}</label></td>
+ <td>
+{render acl=$managerACL}
+ <input type='text' name='manager_name' id='manager_name' value='{$manager_name}' disabled
+ title='{$manager}'>
+{/render}
+{render acl=$managerACL}
+ <input type='image' src='images/lists/edit.png' name='editManager' class='center'>
+{/render}
+ {if $manager!=""}
+{render acl=$managerACL}
+ <img src='images/info_small.png' title='{$manager}' class='center'>
+{/render}
+{render acl=$managerACL}
+ <input type='image' src='images/lists/trash.png' name='removeManager' class='center'>
+{/render}
+ {/if}
+ </td>
+ </tr>
+ {/if}
</table>
</td>
</tr>
diff --git a/gosa-core/plugins/admin/departments/generic.tpl b/gosa-core/plugins/admin/departments/generic.tpl
index 022098f827e7cf2c7694a9bfcd54e8c4f7c5bb7d..5e0dd79df164e2638f4ce18b9a7cbadd6ebb84e4 100644 (file)
</td>
</tr>
{/if}
+
+ {if $manager_enabled}
+ <tr>
+ <td><label for="manager">{t}Manager{/t}</label></td>
+ <td>
+{render acl=$managerACL}
+ <input type='text' name='manager_name' id='manager_name' value='{$manager_name}' disabled
+ title='{$manager}'>
+{/render}
+{render acl=$managerACL}
+ <input type='image' src='images/lists/edit.png' name='editManager' class='center'>
+{/render}
+ {if $manager!=""}
+{render acl=$managerACL}
+ <img src='images/info_small.png' title='{$manager}' class='center'>
+{/render}
+{render acl=$managerACL}
+ <input type='image' src='images/lists/trash.png' name='removeManager' class='center'>
+{/render}
+ {/if}
+ </td>
+ </tr>
+ {/if}
+
</table>
</td>
diff --git a/gosa-core/plugins/admin/departments/locality.tpl b/gosa-core/plugins/admin/departments/locality.tpl
index e009c37f8913f6dc1b867b6a832343a55e50f31f..d84781458ef5b4ea7143ec3c866fbfa84439b369 100644 (file)
</td>
</tr>
{/if}
+
+ {if $manager_enabled}
+ <tr>
+ <td><label for="manager">{t}Manager{/t}</label></td>
+ <td>
+{render acl=$managerACL}
+ <input type='text' name='manager_name' id='manager_name' value='{$manager_name}' disabled
+ title='{$manager}'>
+{/render}
+{render acl=$managerACL}
+ <input type='image' src='images/lists/edit.png' name='editManager' class='center'>
+{/render}
+ {if $manager!=""}
+{render acl=$managerACL}
+ <img src='images/info_small.png' title='{$manager}' class='center'>
+{/render}
+{render acl=$managerACL}
+ <input type='image' src='images/lists/trash.png' name='removeManager' class='center'>
+{/render}
+ {/if}
+ </td>
+ </tr>
+ {/if}
</table>
</td>
</tr>
diff --git a/gosa-core/plugins/admin/departments/organization.tpl b/gosa-core/plugins/admin/departments/organization.tpl
index e7c825ce4c84928c760c663396db83d2f9c74d6b..8ee12f983605779ab12ef69a18ec24e7e07a3ad1 100644 (file)
</td>
</tr>
{/if}
+
+ {if $manager_enabled}
+ <tr>
+ <td><label for="manager">{t}Manager{/t}</label></td>
+ <td>
+{render acl=$managerACL}
+ <input type='text' name='manager_name' id='manager_name' value='{$manager_name}' disabled
+ title='{$manager}'>
+{/render}
+{render acl=$managerACL}
+ <input type='image' src='images/lists/edit.png' name='editManager' class='center'>
+{/render}
+ {if $manager!=""}
+{render acl=$managerACL}
+ <img src='images/info_small.png' title='{$manager}' class='center'>
+{/render}
+{render acl=$managerACL}
+ <input type='image' src='images/lists/trash.png' name='removeManager' class='center'>
+{/render}
+ {/if}
+ </td>
+ </tr>
+ {/if}
</table>
</td>