Code

fixed Smarty handling for GOsa 2.6
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Jul 2011 07:38:00 +0000 (07:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Jul 2011 07:38:00 +0000 (07:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@20956 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index e2cb35c7899e4dff269bde28f9fad52281794264..eaabceec0159a9c040b9c167c574ca779c88e727 100644 (file)
@@ -292,7 +292,13 @@ require("smarty/Smarty.class.php");
 $smarty = new Smarty;
 $smarty->template_dir = $BASE_DIR.'/ihtml/';
 $smarty->caching= false;
-$smarty->php_handling= SMARTY_PHP_REMOVE;
+
+// To be able to switch between smarty version 2/3                                                                      
+if(defined('SMARTY_PHP_REMOVE')){
+    $smarty->php_handling= SMARTY_PHP_REMOVE;
+}else{
+    $smarty->php_handling= Smarty::PHP_REMOVE;
+}
 
 /* Global FPDF define */
 define('FPDF_FONTPATH', '/usr/share/php/fpdf/font/');
index cf4faef32cfe95dc67d4d0065fca77d89abe6f68..a3817e77ea083942846f25935b96812558892aac 100644 (file)
@@ -483,6 +483,7 @@ class userManagement extends management
       $smarty->assign("template",  array_pop($target));
       $smarty->assign("templates", $templates);
       $smarty->assign("edit_uid", "");
+      $smarty->assign("allowUidProposalModification", $this->config->get_cfg_value("allowUidProposalModification", "false"));
       return($smarty->fetch(get_template_path('template.tpl', TRUE)));
 
       // -> See 'templateContinue' for further handling!
@@ -519,6 +520,7 @@ class userManagement extends management
       $smarty->assign("template", "none");
       $smarty->assign("templates", $templates);
       $smarty->assign("edit_uid", "");
+      $smarty->assign("allowUidProposalModification", $this->config->get_cfg_value("allowUidProposalModification", "false"));
       return($smarty->fetch(get_template_path('template.tpl', TRUE)));
 
       // -> See 'templateContinue' for further handling!
@@ -572,6 +574,7 @@ class userManagement extends management
       $smarty->assign("templates",$templates);
       $smarty->assign("got_uid", $this->got_uid);
       $smarty->assign("edit_uid",false);
+      $smarty->assign("allowUidProposalModification", $this->config->get_cfg_value("allowUidProposalModification", "false"));
       return($smarty->fetch(get_template_path('template.tpl', TRUE)));
     }
 
@@ -620,6 +623,7 @@ class userManagement extends management
         $smarty->assign("template", $_POST['template']);
       }
       $smarty->assign("templates",$templates); 
+      $smarty->assign("allowUidProposalModification", $this->config->get_cfg_value("allowUidProposalModification", "false"));
       return($smarty->fetch(get_template_path('template.tpl', TRUE)));
     }
 
index 47ef0d730e0682067998253c5c9c9e951efc6321..ffd35695615c87e36e5fd82be5f6496139a70d0b 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 $allowUidProposalModification == "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>