summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 557a6e5)
raw | patch | inline | side by side (parent: 557a6e5)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 Aug 2006 10:42:19 +0000 (10:42 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 Aug 2006 10:42:19 +0000 (10:42 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4366 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/gofax/faxaccount/class_gofaxAccount.inc | patch | blob | history | |
plugins/gofax/faxaccount/generic.tpl | patch | blob | history | |
plugins/gofax/faxaccount/lists.tpl | patch | blob | history |
diff --git a/plugins/gofax/faxaccount/class_gofaxAccount.inc b/plugins/gofax/faxaccount/class_gofaxAccount.inc
index d106b88cd4b4e1ad0ab477314e72078a72f3cd40..78102e8609f0edef26d7a1131f5c3f81e8ed2ca2 100644 (file)
var $current_blocklist= array();
/* attribute list for save action */
- var $attributes= array("goFaxDeliveryMode", "goFaxIsEnabled","goFaxRBlockgroups","facsimileAlternateTelephoneNumber",
+ var $attributes= array("goFaxDeliveryMode", "goFaxIsEnabled","goFaxRBlockgroups","facsimileAlternateTelephoneNumber","facsimileTelephoneNumber",
"goFaxPrinter", "goFaxDivertNumber", "goFaxLanguage", "goFaxFormat", "mail");
var $objectclasses= array("goFaxAccount");
if ($dn != "new"){
/* Get arrays */
- foreach (array("goFaxRBlocklist", "goFaxRBlockgroups", "goFaxSBlocklist",
+ foreach (array("goFaxRBlocklist", "goFaxRBlockgroups", "goFaxSBlocklist","facsimileTelephoneNumber",
"goFaxSBlockgroups", "facsimileAlternateTelephoneNumber") as $val){
$this->$val =array();
if (isset($this->attrs["$val"]["count"])){
if (in_array("gosaMailAccount", $this->attrs['objectClass'])){
$this->has_mailAccount= TRUE;
}
- if (isset($this->attrs["facsimileTelephoneNumber"][0])){
- $this->facsimileTelephoneNumber= $this->attrs["facsimileTelephoneNumber"][0];
- }
}
/* Load printer list */
/* Trigger Add local fax alternatives dialog */
if (isset($_POST['add_local_alternate'])){
- $this->locals_dialog= TRUE;
- $this->dialog= TRUE;
+ if($this->acl_is_writeable("facsimileAlternateTelephoneNumber")){
+ $this->locals_dialog= TRUE;
+ $this->dialog= TRUE;
+ }
}
/* Add alternatives from dialog */
- if (isset($_POST['add_locals_finish'])){
- if (isset($_POST['local_list']) &&
- chkacl ($this->acl, "facsimileAlternateTelephoneNumber") == ""){
-
+ if (isset($_POST['add_locals_finish']) && isset($_POST['local_list'])){
+ if($this->acl_is_writeable("facsimileAlternateTelephoneNumber")){
foreach ($_POST['local_list'] as $val){
$this->addAlternate($val);
$this->is_modified= TRUE;
}
/* Add alternatives */
- if (isset($_POST['add_alternate'])){
- if ($_POST['forward_address'] != "" &&
- is_phone_nr($_POST['forward_address']) &&
- chkacl ($this->acl, "facsimileAlternateTelephoneNumber") == ""){
-
+ if (isset($_POST['add_alternate']) && !empty($_POST['forward_address']) && is_phone_nr($_POST['forward_address'])){
+ if($this->acl_is_writeable("facsimileAlternateTelephoneNumber")){
$this->addAlternate($_POST['forward_address']);
}
}
/* Delete alternate fax number */
- if (isset($_POST['delete_alternate'])){
- if (isset($_POST['alternate_list']) && count($_POST['alternate_list']) &&
- chkacl ($this->acl, "facsimileAlternateTelephoneNumber") == ""){
-
+ if (isset($_POST['delete_alternate']) && isset($_POST['alternate_list']) && count($_POST['alternate_list'])){
+ if($this->acl_is_writeable("facsimileAlternateTelephoneNumber")){
$this->delAlternate ($_POST['alternate_list']);
}
}
/* Edit incoming blocklists */
if (isset($_POST['edit_incoming'])){
- $this->current_blocklist= array_merge($this->goFaxRBlocklist,
- $this->goFaxRBlockgroups);
- sort($this->current_blocklist);
- reset($this->current_blocklist);
+ if($this->acl_is_writeable("goFaxRBlocklist")) {
+ $this->current_blocklist= array_merge($this->goFaxRBlocklist,$this->goFaxRBlockgroups);
+ sort($this->current_blocklist);
+ reset($this->current_blocklist);
- $this->in_blocklist_dialog= TRUE;
- $this->dialog= TRUE;
+ $this->in_blocklist_dialog= TRUE;
+ $this->dialog= TRUE;
+ }
}
/* Edit outgoing blocklists */
if (isset($_POST['edit_outgoing'])){
- $this->current_blocklist= array_merge($this->goFaxSBlocklist,
- $this->goFaxSBlockgroups);
+ $this->current_blocklist= array_merge($this->goFaxSBlocklist,$this->goFaxSBlockgroups);
sort($this->current_blocklist);
reset($this->current_blocklist);
/* Set departments */
- if ($this->locals_dialog ||
- $this->in_blocklist_dialog ||
- $this->out_blocklist_dialog){
-
+ if ($this->locals_dialog || $this->in_blocklist_dialog || $this->out_blocklist_dialog){
+
$list= array ();
$ldap= $this->config->get_ldap_link();
if (isset ($_POST['department'])){
}
$faxfilter['fuser']= $s;
}
- register_global("faxfilter", $faxfilter);
if ($faxfilter['regex'] != '*' && $faxfilter['regex'] != ""){
$regex= $faxfilter['regex'];
/* Fetch all returned departments an add them to our divlist */
while($value = $ldap->fetch()){
if($value["description"][0]!=".."){
- $this->departments[$value['dn']]=convert_department_dn($value['dn'])." - [".$value["description"][0]."]";
+ $this->departments[$value['dn']]=@LDAP::fix(convert_department_dn($value['dn'])." - [".$value["description"][0]."]");
}else{
$this->departments[$value['dn']]=$value["description"][0];
}
/* Show dialog */
$smarty->assign("cblocklist", $this->current_blocklist);
- $smarty->assign("goFaxBlockListACL", chkacl($this->acl, "goFaxBlockList"));
$smarty->assign("departments", $this->config->idepartments);
$smarty->assign("divSelectPredefined", $divSel->DrawList());
$display.= $smarty->fetch (get_template_path('lists.tpl', TRUE, dirname(__FILE__)));
/* Get all departments */
while($value = $ldap->fetch()){
if(isset($value["description"][0])){
- $this->departments[$value['dn']]=convert_department_dn($value['dn'])." - [".$value["description"][0]."]";
+ $this->departments[$value['dn']]=@LDAP::fix(convert_department_dn($value['dn'])." - [".$value["description"][0]."]");
}else{
$this->departments[$value['dn']]=$value["description"][0];
}
/* Show dialog */
$smarty->assign("cblocklist", $this->current_blocklist);
- $smarty->assign("goFaxBlockListACL", chkacl($this->acl, "goFaxBlockList"));
$smarty->assign("departments", $this->config->idepartments);
$smarty->assign("divSelectPredefined", $divSel->DrawList());
$display.= $smarty->fetch (get_template_path('lists.tpl', TRUE, dirname(__FILE__)));
"facsimileAlternateTelephoneNumber", "mail") as $val){
$smarty->assign("$val", $this->$val);
- $smarty->assign($val."ACL", chkacl($this->acl, "$val"));
}
- $smarty->assign("goFaxRBlockgroupsACL", chkacl($this->acl, "goFaxRBlockgroups"));
- $smarty->assign("goFaxSBlockgroupsACL", chkacl($this->acl, "goFaxSBlockgroups"));
+
+ $tmp = $this->plInfo();
+ foreach($tmp['plProvidedAcls'] as $acl => $desc){
+ $smarty->assign($acl."ACL",$this->getacl($acl));
+ }
/* Load checkboxes */
if ($this->goFaxIsEnabled == "1"){
}
/* goFaxAccount has "mail" as must! Block if no mailaddress is specified... */
if ($this->goFaxDeliveryMode & 32) {
- $smarty->assign("fax_to_mail", "checked");
+ $smarty->assign("faxtomail", "checked");
} else {
- $smarty->assign("fax_to_mail", "");
+ $smarty->assign("faxtomail", "");
}
if ($this->goFaxDeliveryMode & 64) {
- $smarty->assign("fax_to_printer", "checked");
+ $smarty->assign("faxtoprinter", "checked");
} else {
- $smarty->assign("fax_to_printer", "");
+ $smarty->assign("faxtoprinter", "");
}
if (isset($_POST['faxTab'])){
plugin::save_object();
- /* Adapt combobox values */
- $tmp= 0;
- if (isset($_POST["fax_to_mail"]) && $_POST["fax_to_mail"] == 1){
- $tmp+= 32;
+
+ $tmp = 0+$this->goFaxDeliveryMode;
+
+ if($this->acl_is_writeable("faxtomail")){
+ if (isset($_POST["faxtomail"]) && $_POST["faxtomail"] == 1){
+ $tmp |= 32;
+ }elseif($tmp & 32){
+ $tmp &= (!32);
+ }
}
- if (isset($_POST["fax_to_printer"]) && $_POST["fax_to_printer"] == 1){
- $tmp+= 64;
+ if($this->acl_is_writeable("faxtoprinter")){
+ if (isset($_POST["faxtoprinter"]) && $_POST["faxtoprinter"] == 1){
+ $tmp |= 64;
+ }elseif($tmp & 64){
+ $tmp &= !64;
+ }
}
- if (chkacl ($this->acl, "goFaxIsEnabled") == ""){
+ $this->goFaxDeliveryMode = $tmp;
+
+ if($this->acl_is_writeable("goFaxIsEnabled")){
if (isset($_POST["goFaxIsEnabled"]) && $_POST["goFaxIsEnabled"] == "1"){
$this->goFaxIsEnabled= "0";
} else {
}
}
- if (isset($_POST['facsimileTelephoneNumber'])){
- if ($_POST['facsimileTelephoneNumber'] != $this->facsimileTelephoneNumber){
- $this->is_modified= TRUE;
- }
- $this->facsimileTelephoneNumber= $_POST['facsimileTelephoneNumber'];
- }
-
- if (isset($_POST['mail'])){
- if ($this->mail != $_POST['mail']){
- $this->is_modified= TRUE;
- }
+
+ if (isset($_POST['mail']) && $this->acl_is_writeable("faxtomail")){
$this->mail= $_POST['mail'];
}
- /* Write to object */
- if (chkacl ($this->acl, "goFaxDeliveryMode") == ""){
- if ($tmp != $this->goFaxDeliveryMode){
- $this->is_modified= TRUE;
- }
- $this->goFaxDeliveryMode= "$tmp";
- }
-
/* Check if mail account is active and correct the internal
reference to represent the current status. */
if (isset($this->parent->by_object['mailAccount']->is_account)&&($this->parent->by_object['mailAccount']->is_account)){
$this->attrs[$val]= $this->$val;
}
+ if(!$this->attrs['goFaxDeliveryMode']){
+ $this->attrs['goFaxDeliveryMode'] = 0;
+ }
+
/* Adapt mail settings if needed */
unset($this->attrs['mail']);
if (!$this->has_mailAccount && $this->goFaxDeliveryMode && 32){
"goFaxRBlocklist" => _("Receive blocklist"),
"goFaxSBlocklist" => _("Send blocklist"),
"facsimileTelephoneNumber" => _("Fax number"), // goFaxDeliveryMode
- "goFaxPrinter" => _("Deliver fax to printer"),
+ "facsimileAlternateTelephoneNumber" => _("Alternate fax number"), // goFaxDeliveryMode
+ "faxtomail" => _("Deliver fax as mail"),
+ "faxtoprinter" => _("Deliver fax to printer"),
"goFaxFormat" => _("Delivery format"),
"goFaxLanguage" => _("Language"))
));
index b29402516d99c33d00ce444b5751a4116a76f2a7..93deffd4214ff97c55e31c4c99ac9d6a3c6ebdbb 100644 (file)
<tr>
<td><label for="facsimileTelephoneNumber">{t}Fax{/t}</label>{$must}</td>
<td>
- <input name="facsimileTelephoneNumber" id="facsimileTelephoneNumber" size=20 maxlength=65 {$facsimileTelephoneNumberACL} value="{$facsimileTelephoneNumber}" title="{t}Fax number for GOfax to trigger on{/t}">
+
+{render acl=$facsimileTelephoneNumberACL}
+ <input name="facsimileTelephoneNumber" id="facsimileTelephoneNumber" ze=20 maxlength=65
+ value="{$facsimileTelephoneNumber}" title="{t}Fax number for GOfax to trigger on{/t}">
+{/render}
+
</td>
</tr>
<tr>
<td><label for="goFaxLanguage">{t}Language{/t}</label></td>
<td>
- <select size="1" name="goFaxLanguage" id="goFaxLanguage" {$goFaxLanguageACL} title="{t}Specify the GOfax communication language for fax to mail gateway{/t}">
+
+{render acl=$goFaxLanguageACL}
+ <select size="1" name="goFaxLanguage" id="goFaxLanguage"
+ title="{t}Specify the GOfax communication language for fax to mail gateway{/t}">
{html_options values=$languages output=$languages selected=$goFaxLanguage}
</select>
+{/render}
+
</td>
</tr>
<tr>
<td><label for="goFaxFormat">{t}Delivery format{/t}</label></td>
<td>
- <select id="goFaxFormat" size="1" name="goFaxFormat" {$goFaxFormatACL} title="{t}Specify delivery format for fax to mail gateway{/t}">
+
+{render acl=$goFaxFormatACL}
+ <select id="goFaxFormat" size="1" name="goFaxFormat" title="{t}Specify delivery format for fax to mail gateway{/t}">
{html_options values=$formats output=$formats selected=$goFaxFormat}
</select>
+{/render}
</td>
</tr>
</table>
<td style="vertical-align:top; width:100%">
<h2><img class="center" alt="" align="middle" src="images/printer.png" /> {t}Delivery methods{/t}</h2>
- <input type=checkbox name="goFaxIsEnabled" value="1" {$goFaxIsEnabled} {$goFaxIsEnabledACL}>
+{render acl=$goFaxIsEnabledACL}
+ <input type=checkbox name="goFaxIsEnabled" value="1" {$goFaxIsEnabled}>
+{/render}
{t}Temporary disable fax usage{/t}<br>
{if $has_mailaccount eq "false"}
- <input type=checkbox name="fax_to_mail" value="1" {$fax_to_mail} {$goFaxDeliveryModeACL}>
+{render acl=$faxtomailACL}
+ <input type=checkbox name="faxtomail" value="1" {$faxtomail}>
+{/render}
<label for="mail">{t}Deliver fax as mail to{/t}</label>
- <input name="mail" id="mail" size=25 maxlength=65 {$goFaxDeliveryModeACL} value="{$mail}">
+{render acl=$faxtomailACL}
+ <input name="mail" id="mail" size=25 maxlength=65 value="{$mail}">
+{/render}
{else}
- <input type=checkbox name="fax_to_mail" value="1" {$fax_to_mail} {$goFaxDeliveryModeACL}>
+{render acl=$faxtomailACL}
+ <input type=checkbox name="faxtomail" value="1" {$faxtomail}>
+{/render}
{t}Deliver fax as mail{/t}
{/if}
<br>
- <input type=checkbox name="fax_to_printer" value="1" {$fax_to_printer} {$goFaxDeliveryModeACL}>
+{render acl=$faxtoprinterACL}
+ <input type=checkbox name="faxtoprinter" value="1" {$faxtoprinter}>
+{/render}
{t}Deliver fax to printer{/t}
- <select size="1" name="goFaxPrinter" {$goFaxPrinterACL}>
+{render acl=$faxtoprinterACL}
+ <select size="1" name="goFaxPrinter">
{html_options options=$printers selected=$goFaxPrinter}
<option disabled> </option>
</select>
-
+{/render}
</td>
</tr>
</table>
<tr>
<td style="width:50%; border-right:1px solid #A0A0A0">
<h2><img class="center" alt="" align="middle" src="images/fax_small.png"> {t}Alternate fax numbers{/t}</h2>
- <select style="width:100%" name="alternate_list[]" size="10" multiple {$facsimileAlternateTelephoneNumberACL}>
+{render acl=$facsimileAlternateTelephoneNumberACL}
+ <select style="width:100%" name="alternate_list[]" size="10" multiple>
{html_options values=$facsimileAlternateTelephoneNumber output=$facsimileAlternateTelephoneNumber}
<option disabled> </option>
</select>
+{/render}
<br>
- <input name="forward_address" size=20 align="middle" maxlength=65 {$facsimileAlternateTelephoneNumberACL} value="">
- <input type=submit value="{t}Add{/t}" name="add_alternate" {$facsimileAlternateTelephoneNumberACL}>
- <input type=submit value="{t}Add local{/t}" name="add_local_alternate" {$facsimileAlternateTelephoneNumberACL}>
- <input type=submit value="{t}Delete{/t}" name="delete_alternate" {$facsimileAlternateTelephoneNumberACL}>
+{render acl=$facsimileAlternateTelephoneNumberACL}
+ <input name="forward_address" size=20 align="middle" maxlength=65 value="">
+{/render}
+{render acl=$facsimileAlternateTelephoneNumberACL}
+ <input type=submit value="{t}Add{/t}" name="add_alternate">
+{/render}
+{render acl=$facsimileAlternateTelephoneNumberACL}
+ <input type=submit value="{t}Add local{/t}" name="add_local_alternate" >
+{/render}
+{render acl=$facsimileAlternateTelephoneNumberACL}
+ <input type=submit value="{t}Delete{/t}" name="delete_alternate">
+{/render}
</td>
<td style="vertical-align:top; width:50%">
<h2><img class="center" alt="" align="middle" src="images/false.png" /> {t}Blocklists{/t}</h2>
<tr>
<td>{t}Blocklists for incoming fax{/t}</td>
<td>
- <input type=submit name="edit_incoming" {$goFaxRBlockgroupsACL} value="{t}Edit{/t}">
+{render acl=$goFaxRBlocklistACL}
+ <input type=submit name="edit_incoming" value="{t}Edit{/t}">
+{/render}
</td>
</tr>
<tr>
<td>{t}Blocklists for outgoing fax{/t}</td>
<td>
- <input type=submit name="edit_outgoing" {$goFaxSBlockgroupsACL} value="{t}Edit{/t}">
+{render acl=$goFaxSBlocklistACL}
+ <input type=submit name="edit_outgoing" value="{t}Edit{/t}">
+{/render}
</td>
</tr>
</table>
index 8794a9c768ff088cf3006e177ef3be2a2fab9e45..5817e6c7dd26afe0fdc4531d8bb07f2224834553 100644 (file)
<option disabled> </option>
</select>
<br>
- <input name="block_number" size=25 align="middle" maxlength=30 {$goFaxBlockListACL} value="">
- <input type=submit value="{t}Add{/t}" name="add_blocklist_number" {$goFaxBlockListACL}>
- <input type=submit value="{t}Delete{/t}" name="delete_blocklist_number" {$goFaxBlockListACL}>
+ <input name="block_number" size=25 align="middle" maxlength=30 value="">
+ <input type=submit value="{t}Add{/t}" name="add_blocklist_number" >
+ <input type=submit value="{t}Delete{/t}" name="delete_blocklist_number" >
</td>
<td>
<b>{t}List of predefined blocklists{/t}</b><br>
</td>
</tr>
</table>
- <input type=submit value="{t}Add the list to the blocklists{/t}" name="add_blocklist" {$goFaxBlockListACL}><br>
+ <input type=submit value="{t}Add the list to the blocklists{/t}" name="add_blocklist"><br>
</td>
</tr>
</table>