forked from extern/egroupware
* Mail/Sieve: Fix sieve save into folder with wrong namespace
This commit is contained in:
parent
3c4cb54f34
commit
94ea53a688
@ -3084,8 +3084,16 @@ class mail_compose
|
||||
return $_string;
|
||||
}
|
||||
}
|
||||
|
||||
function ajax_searchFolder($_searchStringLength=2, $_returnList=false, $_mailaccountToSearch=null) {
|
||||
/**
|
||||
* Callback function to search mail folders
|
||||
*
|
||||
* @param int $_searchStringLength
|
||||
* @param boolean $_returnList
|
||||
* @param int $_mailaccountToSearch
|
||||
* @param boolean $_noPrefixID = false, if set to true folders name does not get prefixed by account id
|
||||
* @return type
|
||||
*/
|
||||
function ajax_searchFolder($_searchStringLength=2, $_returnList=false, $_mailaccountToSearch=null, $_noPrefixId=false) {
|
||||
//error_log(__METHOD__.__LINE__.':'.array2string($_REQUEST));
|
||||
static $useCacheIfPossible = null;
|
||||
if (is_null($useCacheIfPossible)) $useCacheIfPossible = true;
|
||||
@ -3116,7 +3124,7 @@ class mail_compose
|
||||
{
|
||||
//error_log(__METHOD__.__LINE__.$_searchString.'/'.$searchString.' in '.$k.'->'.$fA->displayName);
|
||||
$f=false;
|
||||
$key = $_mailaccountToSearch.'::'.$k;
|
||||
$key = $_noPrefixId?$k:$_mailaccountToSearch.'::'.$k;
|
||||
if ($_searchStringLength<=0)
|
||||
{
|
||||
$f=true;
|
||||
|
@ -223,7 +223,7 @@ class mail_sieve
|
||||
{
|
||||
//Instantiate an etemplate_new object, representing sieve.edit template
|
||||
$etmpl = new etemplate_new('mail.sieve.edit');
|
||||
|
||||
$etmpl->setElementAttribute('action_folder_text','autocomplete_params', array('noPrefixId'=> true));
|
||||
if (!is_array($content))
|
||||
{
|
||||
if ( $this->getRules($_GET['ruleID']) && isset($_GET['ruleID']))
|
||||
@ -376,8 +376,7 @@ class mail_sieve
|
||||
);
|
||||
|
||||
//Set the preselect_options for mail/folders as we are not allow free entry for folder taglist
|
||||
$mailCompose = new mail_compose();
|
||||
$sel_options['action_folder_text'] = $mailCompose->ajax_searchFolder(0,true);
|
||||
$sel_options['action_folder_text'] = $this->ajax_getFolders(0,true,null,true);
|
||||
|
||||
return $etmpl->exec('mail.mail_sieve.edit',$content,$sel_options,$readonlys,array(),2);
|
||||
}
|
||||
@ -1233,5 +1232,18 @@ class mail_sieve
|
||||
);
|
||||
return $actions;
|
||||
}
|
||||
/**
|
||||
* Callback function to get mail folders
|
||||
* int $_searchStringLength
|
||||
* @param boolean $_returnList
|
||||
* @param int $_mailaccountToSearch
|
||||
* @param boolean $_noPrefixID = false, if set to true folders name does not get prefixed by account id
|
||||
*/
|
||||
function ajax_getFolders ($_searchStringLength=2, $_returnList=false, $_mailaccountToSearch=null, $_noPrefixId=false)
|
||||
{
|
||||
$mailCompose = new mail_compose();
|
||||
if ($_REQUEST['noPrefixId']) $_noPrefixID = $_REQUEST['noPrefixId'];
|
||||
$mailCompose->ajax_searchFolder($_searchStringLength,$_returnList,$_mailaccountToSearch,$_noPrefixID);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@
|
||||
<row>
|
||||
<radio label="File into:" id="action" options="folder"/>
|
||||
<hbox>
|
||||
<taglist id="action_folder_text" width="40%" autocomplete_url="mail.mail_compose.ajax_searchFolder" autocomplete_params="" allowFreeEntries="false" maxSelection="1" onfocus="app.mail.sieve_focus_radioBtn" />
|
||||
<taglist id="action_folder_text" width="40%" autocomplete_url="mail.mail_sieve.ajax_getFolders" autocomplete_params="" allowFreeEntries="false" maxSelection="1" onfocus="app.mail.sieve_focus_radioBtn" />
|
||||
</hbox>
|
||||
</row>
|
||||
<row>
|
||||
|
Loading…
Reference in New Issue
Block a user