summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7d8be69)
raw | patch | inline | side by side (parent: 7d8be69)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 3 Aug 2006 03:27:27 +0000 (03:27 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 3 Aug 2006 03:27:27 +0000 (03:27 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4367 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/gofon/phoneaccount/class_phoneAccount.inc | patch | blob | history | |
plugins/gofon/phoneaccount/generic.tpl | patch | blob | history |
diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc
index 5b70424b812920c3a01c825ae4ca4ecd1dee5484..dd5d5591d42403258e2249ce5f204dac019d155a 100644 (file)
/* attribute list for save action */
var $CopyPasteVars = array("phoneNumbers");
var $attributes = array("goFonDeliveryMode", "goFonFormat","uid","cn",
- "goFonHardware","goFonPIN","goFonVoicemailPIN","telephoneNumber", "goFonMacro","macro");
+ "goFonHardware","goFonPIN","goFonVoicemailPIN",
+ "telephoneNumber", "goFonMacro","macro");
var $objectclasses= array("goFonAccount");
function phoneAccount ($config, $dn= NULL)
$choosen = $paras['choosen'] ;
$str = $default;
+ $dis = "";
+ if(!$this->acl_is_writeable("goFonMacro")){
+ $dis = " disabled ";
+ }
+
/* in case of a combo box display a combobox with selected attr */
$macrotab.= "<tr>";
switch ($type){
case "combo":
- $str= "<select name='".$var."' ".chkacl($this->acl, "goFonMacro")." >";
+ $str= "<select name='".$var."' ".chkacl($this->acl, "goFonMacro")." ".$dis.">";
foreach(split(":",$default) as $choice){
if($choosen==$choice){
$str.= "\n<option value='".$choice."' selected>".$choice." </option>";
case "bool":
if(!$choosen){
- $str="\n<input type='checkbox' name='".$var."' value='1' ".chkacl($this->acl, "goFonMacro")." >";
+ $str="\n<input type='checkbox' name='".$var."' value='1' ".chkacl($this->acl, "goFonMacro")." ".$dis.">";
}else{
- $str="\n<input type='checkbox' name='".$var."' value='1' checked ".chkacl($this->acl, "goFonMacro").">";
+ $str="\n<input type='checkbox' name='".$var."' value='1' checked ".chkacl($this->acl, "goFonMacro")." ".$dis.">";
}
$macrotab.= "<td colspan='2'>$str ".base64_decode($name)."";
break;
case "string":
- $str="<input name='".$var."' value='".$choosen."' ".chkacl($this->acl, "goFonMacro")." style='width:340px;'>";
+ $str="<input name='".$var."' value='".$choosen."' ".chkacl($this->acl, "goFonMacro")." style='width:340px;' ".$dis.">";
$macrotab.= "<td>".base64_decode($name)."</td><td>$str";
break;
/* Transfer ACL's */
foreach($this->attributes as $val){
- $smarty->assign($val."ACL", chkacl($this->acl,$val));
+ $smarty->assign($val."ACL",$this->getacl($val));
if(isset($this->$val)){
$smarty->assign($val,$this->$val);
}else{
} else {
$smarty->assign ("phoneNumbers", $this->phoneNumbers);
}
- $hl= "<select size=\"1\" name=\"goFonHardware\" title=\"".
- _("Choose your private phone")."\" ".chkacl($this->acl, "goFonHardware").">\n";
+
+
+ $dis = "";
+ if(!$this->acl_is_writeable("goFonHardware")){
+ $dis= " disabled ";
+ }
+ $hl= "<select size=\"1\" name=\"goFonHardware\" ".$dis." title=\"".
+ _("Choose your private phone")." >\n";
foreach ($this->hardware_list as $cn => $description){
+
if ($cn == $this->goFonHardware){
$selected= "selected";
} else {
$selected= "";
}
+
if (isset($this->used_hardware[$cn])){
$color= "style=\"color:#A0A0A0\"";
} else {
if (isset($_POST["phoneTab"])){
plugin::save_object();
- /* Save checkbox */
- if (isset($_POST['fon_to_mail'])){
- $tmp= "[M]";
- } else {
- $tmp= "[]";
- }
- if (chkacl ($this->acl, "goFonDeliveryMode") == ""){
- if ($this->goFonDeliveryMode != $tmp){
- $this->is_modified= TRUE;
- }
- $this->goFonDeliveryMode= $tmp;
- }
-
/* Every macro in the select box are available */
if((isset($_POST['macro']))){
$this->macrostillavailable=true;
}
/* get all Postvars */
- if(isset($this->macroarray[$this->macro])){
- foreach($this->macroarray[$this->macro] as $key => $paras){
- if(isset($_POST[$paras['var']])){
- $this->macroarray[$this->macro][$key]['choosen'] = $_POST[$paras['var']];
- }
-
- /* Checkboxes are special, they are not Posted if they are not selected, so the won't be changed with the above code
- We need this code below to read and save checkboxes correct
- */
+ if(isset($this->macroarray[$this->macro])){
+ if($this->acl_is_writeable("goFonMarco")){
+ foreach($this->macroarray[$this->macro] as $key => $paras){
+ if(isset($_POST[$paras['var']])){
+ $this->macroarray[$this->macro][$key]['choosen'] = $_POST[$paras['var']];
+ }
- if(isset($_POST['post_success'])){
- if($this->macroarray[$this->macro][$key]['type']=="bool"){
- if(isset($_POST[$this->macroarray[$this->macro][$key]['var']])) {
- $this->macroarray[$this->macro][$key]['choosen']=$_POST[$paras['var']];
- }else{
- $this->macroarray[$this->macro][$key]['choosen']=false;
+ /* Checkboxes are special, they are not Posted if they are not selected, so the won't be changed with the above code
+ We need this code below to read and save checkboxes correct
+ */
+
+ if(isset($_POST['post_success'])){
+ if($this->macroarray[$this->macro][$key]['type']=="bool"){
+ if(isset($_POST[$this->macroarray[$this->macro][$key]['var']])) {
+ $this->macroarray[$this->macro][$key]['choosen']=$_POST[$paras['var']];
+ }else{
+ $this->macroarray[$this->macro][$key]['choosen']=false;
+ }
}
}
}
"plOptions" => array(),
"plProvidedAcls" => array(
- "goFonDeliveryMode" => _("Delivery mode"),
+ "telephoneNumber" => _("Telephone number"),
+ "goFonMacro" => _("Macro settings"),
"goFonHardware" => _("Phone hardware"),
"goFonPIN" => _("Telephone pin"),
- "goFonVoicemailPIN" => _("Voicemail pin"),
- "telephoneNumber" => _("Telephone number"),
- "goFonMacro" => _("Macro settings"))
+ "goFonVoicemailPIN" => _("Voicemail pin"))
));
}
}
index dd2bfb62f332431a8d2f7ff0d9866e1428a6e263..33e494d8405d60964ccbc3b2572b33807c55c4ef 100644 (file)
<table summary="{t}Phone numbers{/t}" style="width:100%">
<tr>
<td style="vertical-align:top; border-right:1px solid #A0A0A0; width:50%">
- <h2><img class="center" alt="" align="middle" src="images/banana.png" /> {t}Phone numbers{/t}</h2>
- <select style="width:100%;" name="phonenumber_list[]" size=7 multiple {$telephoneNumberACL}>
- {html_options options=$phoneNumbers}
- <option disabled>
-
- </option>
- </select>
- <br>
- <input name="phonenumber" size=20 align=middle maxlength=60 {$telephoneNumberACL} value="">
- <input type="submit" value="{t}Add{/t}" name="add_phonenumber"
- {$telephoneNumberACL}>
- <input type="submit" value="{t}Delete{/t}" name="delete_phonenumber"
- {$telephoneNumberACL}>
+ <h2>
+ <img class="center" alt="" align="middle" src="images/banana.png" />
+ {t}Phone numbers{/t}
+ </h2>
+{render acl=$telephoneNumberACL}
+ <select style="width:100%;" name="phonenumber_list[]" size=7 multiple>
+ {html_options options=$phoneNumbers}
+ <option disabled> </option>
+ </select>
+{/render}
+ <br>
+{render acl=$telephoneNumberACL}
+ <input name="phonenumber" size=20 align=middle maxlength=60 value="">
+{/render}
+{render acl=$telephoneNumberACL}
+ <input type="submit" value="{t}Add{/t}" name="add_phonenumber">
+{/render}
+{render acl=$telephoneNumberACL}
+ <input type="submit" value="{t}Delete{/t}" name="delete_phonenumber">
+{/render}
</td>
-
<td style="vertical-align:top; width:50%;">
-<table summary="" style="width:100%" border=0>
+ <table summary="" style="width:100%" border=0>
<tr>
<td style="vertical-align:top;">
<h2><img class="center" alt="" align="middle" src="images/hardware.png" /> {t}Telephone hardware{/t}</h2>
- <table summary="{t}Telephone{/t}" border=0>
- <tr>
- <td>{t}Telephone{/t}</td>
- <td>{$hardware_list}</td>
+ <table summary="{t}Telephone{/t}" border=0>
+ <tr>
+ <td>{t}Telephone{/t}</td>
+ <td>{$hardware_list}</td>
+ </tr>
+ <tr>
+ <td>
+ <label for="goFonVoicemailPIN">{t}Voicemail PIN{/t}{$must}</label>
+ </td>
+ <td>
+{render acl=$goFonVoicemailPINACL}
+ <input type="password" id="goFonVoicemailPIN" name="goFonVoicemailPIN" value="{$goFonVoicemailPIN}">
+{/render}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <label for="goFonPIN">{t}Phone PIN{/t}{$must}</label>
+ </td>
+ <td>
+{render acl=$goFonPINACL}
+ <input type="password" id="goFonPIN" name="goFonPIN" value="{$goFonPIN}">
+{/render}
+ </td>
+ </tr>
+ </table>
+ </td>
</tr>
- <tr>
- <td>
- <label for="goFonVoicemailPIN">{t}Voicemail PIN{/t}{$must}</label>
- </td>
- <td>
- <input type="password" id="goFonVoicemailPIN" name="goFonVoicemailPIN" value="{$goFonVoicemailPIN}" {$goFonVoicemailPINACL}>
- </td>
- </tr>
- <tr>
- <td>
- <label for="goFonPIN">{t}Phone PIN{/t}{$must}</label>
- </td>
- <td>
- <input type="password" id="goFonPIN" name="goFonPIN" value="{$goFonPIN}" {$goFonPINACL}>
- </td>
- </tr>
</table>
</td>
- </tr>
-</table>
- </td>
</tr>
<tr>
- <td style="vertical-align:top; border-top:1px solid #A0A0A0; width:50%" colspan="2"> </td>
+ <td style="vertical-align:top; border-top:1px solid #A0A0A0; width:50%" colspan="2"> </td>
</tr>
<tr style="vertical-align:top; border-top:1px solid #A0A0A0;">
- <td colspan=2 style="vertical-align:top;width:50%">
- <h2><img class="center" alt="" src="images/select_macro.png" align="middle" /> {t}Phone macro{/t}</h2>
- <table summary="{t}Phone macro{/t}">
- <tr>
- <td colspan=2>
- <select name="macro" onchange="document.mainform.submit()" {$goFonMacroACL}>
- {html_options options=$macros selected=$macro}
- <option disabled> </option>
- </select>
- {if $javascript eq 'false'}
- <input type="submit" name="refresh" value="{t}Refresh{/t}" {$goFonMacroACL}>
- {/if}
- </td>
- </tr>
- </table>
- <br>
- {$macrotab}
- </td>
+ <td colspan=2 style="vertical-align:top;width:50%">
+ <h2>
+ <img class="center" alt="" src="images/select_macro.png" align="middle" />
+ {t}Phone macro{/t}
+ </h2>
+ <table summary="{t}Phone macro{/t}">
+ <tr>
+ <td colspan=2>
+{render acl=$goFonMacroACL}
+ <select name="macro" onchange="document.mainform.submit()">
+ {html_options options=$macros selected=$macro}
+ <option disabled> </option>
+ </select>
+{/render}
+ {if $javascript eq 'false'}
+{render acl=$goFonMacroACL}
+ <input type="submit" name="refresh" value="{t}Refresh{/t}">
+{/render}
+ {/if}
+ </td>
+ </tr>
+ </table>
+ <br>
+ {$macrotab}
+ </td>
</tr>
</table>
<input type="hidden" name="phoneTab" value="phoneTab">