mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
JSON callback to autoload folders of other profiles (not yet working, as getFolderTree returns too much, should only be children (item) of selected node)
This commit is contained in:
parent
5c6f6471f3
commit
f052fc4fe4
@ -79,7 +79,7 @@ class mail_ui
|
|||||||
if (!isset($this->mail_bo->icServer)) exit; // ToDo: Exception or the dialog for setting up a server config
|
if (!isset($this->mail_bo->icServer)) exit; // ToDo: Exception or the dialog for setting up a server config
|
||||||
/*if (!($this->mail_bo->icServer->_connected == 1))*/ $this->mail_bo->openConnection($icServerID);
|
/*if (!($this->mail_bo->icServer->_connected == 1))*/ $this->mail_bo->openConnection($icServerID);
|
||||||
// save session varchar
|
// save session varchar
|
||||||
$oldicServerID =& egw_cache::getSession('mail','activeProfileID');
|
$oldicServerID =& egw_cache::getSession('mail','activeProfileID');
|
||||||
$oldicServerID = $icServerID;
|
$oldicServerID = $icServerID;
|
||||||
// save pref
|
// save pref
|
||||||
$GLOBALS['egw']->preferences->add('mail','ActiveProfileID',$icServerID,'user');
|
$GLOBALS['egw']->preferences->add('mail','ActiveProfileID',$icServerID,'user');
|
||||||
@ -133,7 +133,7 @@ class mail_ui
|
|||||||
unset($content['msg']);
|
unset($content['msg']);
|
||||||
}
|
}
|
||||||
$this->mail_bo->restoreSessionData();
|
$this->mail_bo->restoreSessionData();
|
||||||
|
|
||||||
// filter is used to choose the mailbox
|
// filter is used to choose the mailbox
|
||||||
//if (!isset($content['nm']['foldertree'])) // maybe we fetch the folder here
|
//if (!isset($content['nm']['foldertree'])) // maybe we fetch the folder here
|
||||||
/*
|
/*
|
||||||
@ -169,7 +169,7 @@ class mail_ui
|
|||||||
|
|
||||||
// Set tree actions
|
// Set tree actions
|
||||||
$etpl->set_cell_attribute('nm[foldertree]','actions', array(
|
$etpl->set_cell_attribute('nm[foldertree]','actions', array(
|
||||||
|
|
||||||
'drop_move_mail' => array(
|
'drop_move_mail' => array(
|
||||||
'type' => 'drop',
|
'type' => 'drop',
|
||||||
'acceptedTypes' => 'mail',
|
'acceptedTypes' => 'mail',
|
||||||
@ -342,6 +342,24 @@ class mail_ui
|
|||||||
common::egw_footer();
|
common::egw_footer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ajax callback to fetch folders for given profile
|
||||||
|
*
|
||||||
|
* We currently load all folders of a given profile, tree can also load parts of a tree.
|
||||||
|
*
|
||||||
|
* @param string $_GET[selected] if of node whos children are requested
|
||||||
|
*/
|
||||||
|
public function ajax_foldertree()
|
||||||
|
{
|
||||||
|
list($profileId) = explode(':', $_GET['selected']);
|
||||||
|
|
||||||
|
$data = $this->getFolderTree(false, $profileId);
|
||||||
|
|
||||||
|
header('Content-Type: application/json; charset=utf-8');
|
||||||
|
echo json_encode($data);
|
||||||
|
common::egw_exit();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getFolderTree, get folders from server and prepare the folder tree
|
* getFolderTree, get folders from server and prepare the folder tree
|
||||||
* @param bool $_fetchCounters, wether to fetch extended information on folders
|
* @param bool $_fetchCounters, wether to fetch extended information on folders
|
||||||
|
@ -38,8 +38,8 @@
|
|||||||
</grid>
|
</grid>
|
||||||
</template>
|
</template>
|
||||||
<template id="mail.index" template="" lang="" group="0" version="1.9.001">
|
<template id="mail.index" template="" lang="" group="0" version="1.9.001">
|
||||||
<tree id="nm[foldertree]" onclick="mail_changeFolder(widget.event_args[0],widget);" parent_node="tree_target"/>
|
<tree id="nm[foldertree]" onclick="mail_changeFolder(widget.event_args[0],widget);" parent_node="tree_target" autoloading="mail.mail_ui.ajax_foldertree"/>
|
||||||
<html id="msg"/>
|
<html id="msg"/>
|
||||||
<nextmatch id="nm" options="mail.index.rows"/>
|
<nextmatch id="nm" options="mail.index.rows"/>
|
||||||
</template>
|
</template>
|
||||||
</overlay>
|
</overlay>
|
||||||
|
Loading…
Reference in New Issue
Block a user