Code

Added ACLs for FonMacros && Added baseselect dialog
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 May 2006 07:37:17 +0000 (07:37 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 May 2006 07:37:17 +0000 (07:37 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3481 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofon/macro/class_gofonMacro.inc
plugins/gofon/macro/generic.tpl

index 9adf21534b7aa42cc564cd34ec6c714679c0b3be..cabcb9a8b03b787d559f1cadefa28ecf7bf06a84 100755 (executable)
@@ -103,6 +103,33 @@ class macro extends plugin
         _("This 'dn' is no phone macro.")."</b>";
       return ($display);
     }
+    
+    /* Base select dialog */
+    $once = true;
+    foreach($_POST as $name => $value){
+      if(preg_match("/^chooseBase/",$name) && $once){
+        $once = false;
+        $this->dialog = new baseSelectDialog($this->config,$this->allowedBasesToMoveTo());
+        $this->dialog->setCurrentBase($this->base);
+      }
+    }
+
+    /* Dialog handling */
+    if(is_object($this->dialog)){
+      /* Must be called before save_object */
+      $this->dialog->save_object();
+
+      if($this->dialog->isClosed()){
+        $this->dialog = false;
+      }elseif($this->dialog->isSelected()){
+        $this->base = $this->dialog->isSelected();
+        $this->dialog= false;
+      }else{
+        return($this->dialog->execute());
+      }
+    }
+
+
 
     /* Fill templating stuff */
     $smarty= get_smarty();
@@ -111,6 +138,7 @@ class macro extends plugin
     /* Assign all vars to Smarty */
     foreach($this->attributes as $ar){
       $smarty->assign($ar, $this->$ar);
+      $smarty->assign($ar."ACL", chkacl($this->acl,$ar));
     }
     /* Checkboxes */
     $smarty->assign("base_select", $this->base);
index f3a3096e5bde5d39c832a1bf2741c020c9de3962..07ab79fe0d2083560a90d27d680fa6485b5793d8 100755 (executable)
@@ -4,12 +4,12 @@
                        <table summary="">
                        <tr>
                                <td><LABEL for="cn">{t}Macro name{/t}</LABEL>{$must}</td>
-                               <td><input {$disable_cn} name="cn" id="id" size=13 maxlength=13 value="{$cn}" title="{t}Macro name{/t}"></td>
+                               <td><input {$disable_cn} name="cn" id="id" size=13 maxlength=13 value="{$cn}" {$cnACL} title="{t}Macro name{/t}"></td>
                        </tr>
                        <tr>
                                <td><LABEL for="displayName">{t}Display name{/t}</LABEL>{$must}</td>
                                <td>
-                                       <input name="displayName" id="displayName" size=35 maxlength=60 value="{$displayName}" title="{t}Macro name to be displayed{/t}">
+                                       <input {$displayNameACL} name="displayName" id="displayName" size=35 maxlength=60 value="{$displayName}" title="{t}Macro name to be displayed{/t}">
                                </td>
                        </tr>
                        <tr>
                        <tr>
                                <td><LABEL for="base">{t}Base{/t}</LABEL>{$must}</td>
                                <td>
-                                          <select size="1" id="base" name="base" title="{t}Choose subtree to place macro in{/t}">
+                                          <select size="1" id="base" name="base" title="{t}Choose subtree to place macro in{/t}" {$baseACL}>
                                                        {html_options options=$bases selected=$base_select}
-               <option disabled>&nbsp;</option>
+                                                       <option disabled>&nbsp;</option>
                                           </select>
+                                               {if $baseACL == ""}
+                                                       <input type="image" name="chooseBase" src="images/folder.png" class="center" title="{t}Select a base{/t}">
+                                               {else}
+                                                       <img src="images/folder_gray.png" class="center" title="{t}Select a base{/t}">
+                                               {/if}
                                </td>
                        </tr>
                        </table>
                        <tr>
                                <td><LABEL for="description">{t}Description{/t}</LABEL></td>
                                <td>
-                                       <input name="description" id="description" size=35 maxlength=80 value="{$description}">
+                                       <input name="description" id="description" size=35 maxlength=80 value="{$description}"  {$descriptionACL}>
                                </td>
                        </tr>
                        <tr>
                                <td colspan=2>
-                                       <input type="checkbox" name="goFonMacroVisible" size=35 maxlength=60 value="1" {$goFonMacroVisibleChecked}> {t}Visible for user{/t}
+                                       <input type="checkbox" name="goFonMacroVisible" size=35 maxlength=60 value="1" {$goFonMacroVisibleACL} {$goFonMacroVisibleChecked}> {t}Visible for user{/t}
                                </td>
                        </tr>
                        </table>
@@ -51,7 +56,7 @@
 <br>
 {t}Macro text{/t}
 <br>
-<textarea name="goFonMacroContent" style="width:99%;height:300px;font-size:14px;font-family:Arial;">{$goFonMacroContent}</textarea>
+<textarea name="goFonMacroContent" style="width:99%;height:300px;font-size:14px;font-family:Arial;" {$goFonMacroContentACL}>{$goFonMacroContent}</textarea>
 
 <!-- Place cursor -->
 <script language="JavaScript" type="text/javascript">