* Mail: Make switching between different folders of an mail account available in ACL dialog

-Style mail ACL dialog
This commit is contained in:
Hadi Nategh 2014-09-24 12:02:35 +00:00
parent a0ba88621c
commit 695e78c455
3 changed files with 100 additions and 69 deletions

View File

@ -70,9 +70,12 @@ class mail_acl
*/ */
function edit(array $content=null ,$msg='') function edit(array $content=null ,$msg='')
{ {
$tmpl = new etemplate_new('mail.acl'); $tmpl = new etemplate_new('mail.acl');
$mailbox = base64_decode($_GET['mailbox']); $mailbox = $_GET['mailbox']? base64_decode($_GET['mailbox']): $content['mailbox'][0];
// Unset the content if folder is changed, in order to read acl rights for new selected folder
if (!is_array($content['button']) && is_array($content['mailbox']) && !is_array($content['grid']['delete'])) unset($content);
if (!is_array($content)) if (!is_array($content))
{ {
if (!empty($mailbox)) if (!empty($mailbox))

View File

@ -3600,7 +3600,23 @@ app.classes.mail = AppJS.extend(
var folder = mailbox[1] || 'INBOX', acc_id = mailbox[0]; var folder = mailbox[1] || 'INBOX', acc_id = mailbox[0];
this.egw.open_link('mail.mail_acl.edit&mailbox='+ jQuery.base64Encode(folder)+'&acc_id='+acc_id, '_blank', '640x480'); this.egw.open_link('mail.mail_acl.edit&mailbox='+ jQuery.base64Encode(folder)+'&acc_id='+acc_id, '_blank', '640x480');
}, },
/**
*
*/
acl_folderChange: function ()
{
var mailbox = this.et2.getWidgetById('mailbox');
if (mailbox)
{
if (mailbox.taglist.getValue().length > 0)
{
this.et2._inst.submit();
}
}
},
/** /**
* Edit a mail account * Edit a mail account
* *

View File

@ -2,71 +2,83 @@
<!-- $Id$ --> <!-- $Id$ -->
<overlay> <overlay>
<template id="mail.acl" template="" lang="" group="0" version="1.9.001"> <template id="mail.acl" template="" lang="" group="0" version="1.9.001">
<vbox> <grid width="100%">
<hbox> <columns>
<description id="msg" class="message"/> <column width="10%"/>
</hbox> <column width="90%"/>
<vbox > </columns>
<description id="mailbox" align="center"/> <rows>
</vbox> <row class="dialogHeader">
<grid id="grid"> <description value="Mail ACL" />
<columns> </row>
<column/> <row>
<column/> <description value="Folder:"/>
<column/> <taglist id="mailbox" width="100%" autocomplete_url='mail.mail_compose.ajax_searchFolder' maxSelection="1" autocomplete_params='' allowFreeEntries="false" onchange='app.mail.acl_folderChange'/>
<column/> </row>
<column/> <row>
<column/> <description value="Rights:"/>
<column/> <grid id="grid" width="100%">
<column/> <columns>
<column/> <column/>
<column/> <column/>
<column/> <column/>
<column/> <column/>
<column/> <column/>
</columns> <column/>
<rows> <column/>
<row class="th dialogHeader"> <column/>
<description value="Name"/> <column/>
<description value="Common ACL"/> <column/>
<description align="center" value="L"/> <column/>
<description align="center" value="R"/> <column/>
<description align="center" value="S"/> <column/>
<description align="center" value="W"/> </columns>
<description align="center" value="I"/> <rows>
<description align="center" value="P"/> <row class="th">
<description align="center" value="C"/> <description value="Name"/>
<description align="center" value="D"/> <description value="Common ACL"/>
<description align="center" value="A"/> <description align="center" value="L"/>
<description align="center" value="Recursively"/> <description align="center" value="R"/>
<description value="Action"/> <description align="center" value="S"/>
</row> <description align="center" value="W"/>
<row class="row"> <description align="center" value="I"/>
<taglist-account id="${row}[acc_id]" allowFreeEntries="true" maxSelection="1" account_type="@account_type" /> <description align="center" value="P"/>
<menulist> <description align="center" value="C"/>
<menupopup id="${row}[acl]" onchange="app.mail.acl_common_rights_selector"/> <description align="center" value="D"/>
</menulist> <description align="center" value="A"/>
<checkbox align="center" id="${row}[acl_l]" onchange="app.mail.acl_common_rights"/> <description align="center" value="Recursively"/>
<checkbox align="center" id="${row}[acl_r]" onchange="app.mail.acl_common_rights"/> <description value="Action"/>
<checkbox align="center" id="${row}[acl_s]" onchange="app.mail.acl_common_rights"/> </row>
<checkbox align="center" id="${row}[acl_w]" onchange="app.mail.acl_common_rights"/> <row class="row">
<checkbox align="center" id="${row}[acl_i]" onchange="app.mail.acl_common_rights"/> <taglist-account id="${row}[acc_id]" allowFreeEntries="true" maxSelection="1" account_type="@account_type" />
<checkbox align="center" id="${row}[acl_p]" onchange="app.mail.acl_common_rights"/> <menulist>
<checkbox align="center" id="${row}[acl_c]" onchange="app.mail.acl_common_rights"/> <menupopup id="${row}[acl]" onchange="app.mail.acl_common_rights_selector"/>
<checkbox align="center" id="${row}[acl_d]" onchange="app.mail.acl_common_rights"/> </menulist>
<checkbox align="center" id="${row}[acl_a]" onchange="app.mail.acl_common_rights"/> <checkbox align="center" id="${row}[acl_l]" onchange="app.mail.acl_common_rights"/>
<checkbox align="center" id="${row}[acl_recursive]"/> <checkbox align="center" id="${row}[acl_r]" onchange="app.mail.acl_common_rights"/>
<hbox orient=",0,0"> <checkbox align="center" id="${row}[acl_s]" onchange="app.mail.acl_common_rights"/>
<button align="right" statustext="Delete this ACL" label="Delete" id="delete[${row}]" value="${row}" image="delete" onclick="et2_dialog.confirm(widget,'Do you really want to remove all rights from this account','Remove')"/> <checkbox align="center" id="${row}[acl_w]" onchange="app.mail.acl_common_rights"/>
</hbox> <checkbox align="center" id="${row}[acl_i]" onchange="app.mail.acl_common_rights"/>
</row> <checkbox align="center" id="${row}[acl_p]" onchange="app.mail.acl_common_rights"/>
</rows> <checkbox align="center" id="${row}[acl_c]" onchange="app.mail.acl_common_rights"/>
</grid> <checkbox align="center" id="${row}[acl_d]" onchange="app.mail.acl_common_rights"/>
<hbox class="dialogFooterToolbar"> <checkbox align="center" id="${row}[acl_a]" onchange="app.mail.acl_common_rights"/>
<button statustext="Saves this ACL" label="Save" id="button[save]"/> <checkbox align="center" id="${row}[acl_recursive]"/>
<button statustext="Applies the changes made" label="Apply" id="button[apply]"/> <hbox orient=",0,0">
<button label="Cancel" id="button[cancel]"/> <button align="right" statustext="Delete this ACL" label="Delete" id="delete[${row}]" value="${row}" image="delete" onclick="et2_dialog.confirm(widget,'Do you really want to remove all rights from this account','Remove')"/>
</hbox> </hbox>
</vbox> </row>
</rows>
</grid>
</row>
<row>
<hbox class="dialogFooterToolbar">
<button statustext="Saves this ACL" label="Save" id="button[save]"/>
<button statustext="Applies the changes made" label="Apply" id="button[apply]"/>
<button label="Cancel" id="button[cancel]"/>
</hbox>
</row>
</rows>
</grid>
</template> </template>
</overlay> </overlay>