Code

Added ability to edit uid proposals for users created from a template
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Jun 2011 09:17:58 +0000 (09:17 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Jun 2011 09:17:58 +0000 (09:17 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20921 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_core.inc
gosa-core/plugins/admin/users/class_userManagement.inc
gosa-core/plugins/admin/users/template.tpl

index 834ed53f6632cbf391b7eefd9507d0a4336b6975..29ddf149f551914bdc5332b57d24b6fd5cba2b77 100644 (file)
@@ -495,6 +495,16 @@ class core extends plugin {
                                 "group"         => "core",
                                 "mandatory"     => FALSE),
 
+                        array(
+                                "name"          => "allowModificationOfUid",
+                                "type"          => "bool",
+                                "default"       => "false",
+                                "description"   => _("Allows to modify uid-proposals when creating a new user from a user-template."),
+                                "check"         => "gosaProperty::isBool",
+                                "migrate"       => "",
+                                "group"         => "core",
+                                "mandatory"     => FALSE),
+
                         array(
                                 "name"          => "modificationDetectionAttribute",
                                 "type"          => "switch",
index f554cf3720ce6ff546493b934fb182110eb4bd5a..a16e1e20267d6d3fafe9da072faf59101133fe54 100644 (file)
@@ -481,6 +481,7 @@ class userManagement extends management
             $smarty->assign("template",  array_pop($target));
             $smarty->assign("templates", $templates);
             $smarty->assign("edit_uid", "");
+            $smarty->assign("allowModificationOfUid", $this->config->get_cfg_value("core","allowModificationOfUid"));
             return($smarty->fetch(get_template_path('template.tpl', TRUE)));
 
             // -> See 'templateContinue' for further handling!
@@ -517,6 +518,7 @@ class userManagement extends management
             $smarty->assign("template", "none");
             $smarty->assign("templates", $templates);
             $smarty->assign("edit_uid", "");
+            $smarty->assign("allowModificationOfUid", $this->config->get_cfg_value("core","allowModificationOfUid"));
             return($smarty->fetch(get_template_path('template.tpl', TRUE)));
 
             // -> See 'templateContinue' for further handling!
@@ -570,6 +572,7 @@ class userManagement extends management
             $smarty->assign("templates",$templates);
             $smarty->assign("got_uid", $this->got_uid);
             $smarty->assign("edit_uid",false);
+            $smarty->assign("allowModificationOfUid", $this->config->get_cfg_value("core","allowModificationOfUid"));
             return($smarty->fetch(get_template_path('template.tpl', TRUE)));
         }
 
@@ -625,6 +628,7 @@ class userManagement extends management
                 $smarty->assign("template", get_post('template'));
             }
             $smarty->assign("templates",$templates); 
+            $smarty->assign("allowModificationOfUid", $this->config->get_cfg_value("core","allowModificationOfUid"));
             return($smarty->fetch(get_template_path('template.tpl', TRUE)));
         }
 
index ce9fee3953bcee937a30a2619b1f79d8ddc02037..a1b44392820516a723e8f5ca9961631ed9de0ca9 100644 (file)
     <td><b>{t}Login{/t}</b></td>
     <td>
       {if $edit_uid eq "false"}
-      <select size="1" name="uid">
-        {html_options output=$uids values=$uids selected=$uid}
-      </select>
-      {else}
-      <input type='text' name="uid" size="30" maxlength="40" value="{$uid}">
+        {if $allowModificationOfUid == "true"}
+           <select size="1" name="uidSelect" id='uidSelect' onChange="
+                document.getElementById('uid').value = document.getElementById('uidSelect').value;">
+            {html_options output=$uids values=$uids selected=$uid}
+          </select>
+          <input type='text' id="uid" name="uid" size="30" maxlength="40" value="{$uid}" 
+                style="display: none;">
+          <img src="images/lists/edit.png" onClick="$('uid').toggle();" 
+                title="{t}Modify the uid proposal{/t}">
+        {else}
+           <select size="1" name="uid">
+            {html_options output=$uids values=$uids selected=$uid}
+          </select>
+        {/if}
+      {else}                    
+          <input type='text' id="uid" name="uid" size="30" maxlength="40" value="{$uid}">
       {/if}
     </td>
   </tr>