further steps

This commit is contained in:
Klaus Leithoff 2013-02-11 11:46:35 +00:00
parent f49c6996fe
commit 82982e8933
4 changed files with 19 additions and 9 deletions

View File

@ -164,6 +164,7 @@ class mail_bo
*/
public static function getInstance($_restoreSession=true, $_profileID=0, $_validate=true)
{
//error_log(__METHOD__.__LINE__.' RestoreSession:'.$_restoreSession.' ProfileId:'.$_profileID.' called from:'.function_backtrace());
if ($_profileID == 0)
{
if (isset($GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']) && !empty($GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']))

View File

@ -54,6 +54,7 @@ class mail_ui
}
$this->mail_bo = mail_bo::getInstance(false,$icServerID);
// no icServer Object: something failed big time
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);
@ -68,6 +69,7 @@ class mail_ui
*/
function index(array $content=null,$msg=null)
{
//$this->TestConnection();
if (!is_array($content))
{
@ -78,9 +80,10 @@ class mail_ui
{
$content['nm'] = array(
'get_rows' => 'mail.mail_ui.get_rows', // I method/callback to request the data for the rows eg. 'notes.bo.get_rows'
'filter' => '1', // current dir only
'no_filter2' => True, // I disable the 2. filter (params are the same as for filter)
'no_cat' => True, // I disable the cat-selectbox
'filter' => 'INBOX', // filter is used to choose the mailbox
'no_filter2' => false, // I disable the 2. filter (params are the same as for filter)
'no_cat' => false, // I disable the cat-selectbox
//'cat_is_select' => 'no_lang', // true or no_lang
'lettersearch' => false, // I show a lettersearch
'searchletter' => false, // I0 active letter of the lettersearch or false for [all]
'start' => 0, // IO position in list
@ -95,6 +98,11 @@ class mail_ui
//$content['nm']['path'] = self::get_home_dir();
}
}
// filter is used to choose the mailbox
//if (!isset($content['nm']['foldertree'])) // maybe wev fetch the folder here
$sel_options['nm']['foldertree'] = array('/'=>'IMAP Server','/INBOX'=>'INBOX');
if (!isset($content['nm']['filter'])) $content['nm']['filter'] = 'INBOX';
if (!isset($content['nm']['cat_id'])) $content['nm']['cat_id'] = 'All';
$etpl = new etemplate('mail.index');
return $etpl->exec('mail.mail_ui.index',$content,$sel_options,$readonlys,$preserv);
}
@ -105,14 +113,14 @@ class mail_ui
*/
function TestConnection ()
{
$preferences =& $this->mail_bo->mailPreferences->preferences;
$preferences =& $this->mail_bo->mailPreferences;
if ($preferences->preferences['prefcontroltestconnection'] == 'none') die('You should not be here!');
if (isset($GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']))
$icServerID = (int)$GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'];
//_debug_array($icServerID);
if (is_object($preferences)) $imapServer = $preferences->getIncomingServer($icServerID);
//_debug_array($this->mail_bo->mailPreferences);
if (is_object($preferences)) $imapServer = $preferences->getIncomingServer($icServerID);
if (isset($imapServer->ImapServerId) && !empty($imapServer->ImapServerId))
{
$icServerID = $GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'] = $imapServer->ImapServerId;
@ -586,7 +594,6 @@ class mail_ui
*/
function get_rows($query,&$rows,&$readonlys)
{
$_folderName='INBOX';
unset($query['actions']);
error_log(__METHOD__.__LINE__.array2string($query));
//error_log(__METHOD__.__LINE__.' Folder:'.array2string($_folderName).' FolderType:'.$folderType.' RowsFetched:'.array2string($rowsFetched)." these Uids:".array2string($uidOnly).' Headers passed:'.array2string($headers));
@ -596,6 +603,7 @@ error_log(__METHOD__.__LINE__.array2string($query));
$maxMessages = (int)$this->mail_bo->mailPreferences->preferences['prefMailGridBehavior'];
$previewMessage = $this->sessionData['previewMessage'];
$sRToFetch = null;
$_folderName=$query['filter'];
$rowsFetched['messages'] = null;
$offset = $query['start']+1; // we always start with 1
$maxMessages = $query['num_rows'];

View File

@ -2,7 +2,7 @@
/**
* EGroupware - eTemplates for Application mail
* http://www.egroupware.org
* generated by soetemplate::dump4setup() 2013-02-08 14:47
* generated by soetemplate::dump4setup() 2013-02-11 11:44
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package mail
@ -12,7 +12,7 @@
$templ_version=1;
$templ_data[] = array('name' => 'mail.index','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:1:{i:0;a:3:{s:4:"type";s:9:"nextmatch";s:4:"name";s:2:"nm";s:4:"size";s:4:"rows";}}','size' => '100%,,,,0,3','style' => '','modified' => '1360257690',);
$templ_data[] = array('name' => 'mail.index','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:2:{i:0;a:2:{s:4:"type";s:4:"tree";s:4:"name";s:14:"nm[foldertree]";}i:1;a:3:{s:4:"type";s:9:"nextmatch";s:4:"name";s:2:"nm";s:4:"size";s:4:"rows";}}','size' => '100%,,,,0,3','style' => '','modified' => '1360577272',);
$templ_data[] = array('name' => 'mail.index.rows','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:6:{s:2:"c1";s:2:"th";s:1:"A";s:2:"25";s:1:"F";s:2:"50";s:1:"E";s:3:"120";s:1:"D";s:3:"120";s:1:"C";s:2:"95";}i:1;a:6:{s:1:"A";a:4:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:2:"ID";s:4:"name";s:3:"uid";s:8:"readonly";s:1:"1";}s:1:"B";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:4:"name";s:7:"subject";s:5:"label";s:7:"subject";}s:1:"C";a:4:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"date";s:4:"name";s:4:"date";s:5:"align";s:6:"center";}s:1:"D";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:2:"to";s:4:"name";s:9:"toaddress";}s:1:"E";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"from";s:4:"name";s:11:"fromaddress";}s:1:"F";a:4:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"size";s:4:"name";s:4:"size";s:5:"align";s:6:"center";}}i:2;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"name";s:11:"${row}[uid]";s:8:"readonly";s:1:"1";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:4:"name";s:15:"${row}[subject]";}s:1:"C";a:4:{s:4:"type";s:9:"date-time";s:4:"name";s:12:"${row}[date]";s:8:"readonly";s:1:"1";s:5:"align";s:6:"center";}s:1:"D";a:3:{s:4:"type";s:9:"url-email";s:4:"name";s:17:"${row}[toaddress]";s:8:"readonly";s:1:"1";}s:1:"E";a:3:{s:4:"type";s:9:"url-email";s:4:"name";s:19:"${row}[fromaddress]";s:8:"readonly";s:1:"1";}s:1:"F";a:5:{s:4:"type";s:5:"label";s:4:"name";s:12:"${row}[size]";s:7:"no_lang";s:1:"1";s:8:"readonly";s:1:"1";s:5:"align";s:5:"right";}}}s:4:"rows";i:2;s:4:"cols";i:6;}}','size' => '','style' => '','modified' => '1360252030',);

View File

@ -32,6 +32,7 @@
</grid>
</template>
<template id="mail.index" template="" lang="" group="0" version="1.9.001">
<tree id="nm[foldertree]"/>
<nextmatch id="nm" options="mail.index.rows"/>
</template>
</overlay>