mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-05 13:39:23 +01:00
* eMail: completely remove the ui/bo/sofilter classes as they are not effectively used anymore
This commit is contained in:
parent
215cc95315
commit
a4ff6334b6
@ -199,13 +199,11 @@ class ajaxfelamimail
|
||||
$this->bofelamimail->restoreSessionData();
|
||||
$this->bofelamimail->compressFolder($this->sessionData['mailbox']);
|
||||
|
||||
$bofilter = new felamimail_bofilter();
|
||||
|
||||
$sortResult = $this->bofelamimail->getSortedList(
|
||||
$this->sessionData['mailbox'],
|
||||
$this->sessionData['sort'],
|
||||
$this->sessionData['sortReverse'],
|
||||
$bofilter->getFilter($this->sessionData['activeFilter'])
|
||||
$this->sessionData['messageFilter']
|
||||
);
|
||||
|
||||
if(!is_array($sortResult) || empty($sortResult)) {
|
||||
@ -657,19 +655,6 @@ class ajaxfelamimail
|
||||
return $this->generateMessageList($this->sessionData['mailbox']);
|
||||
}
|
||||
|
||||
function extendedSearch($_filterID)
|
||||
{
|
||||
// start displaying at message 1
|
||||
$this->sessionData['startMessage'] = 1;
|
||||
$this->sessionData['activeFilter'] = (int)$_filterID;
|
||||
// unset the previewID, as the Message will not probably not be within the selection
|
||||
unset($this->sessionData['previewMessage']);
|
||||
$this->saveSessionData(true);
|
||||
|
||||
// generate the new messageview
|
||||
return $this->generateMessageList($this->sessionData['mailbox']);
|
||||
}
|
||||
|
||||
/*
|
||||
* flag messages as read, unread, flagged, ...
|
||||
*
|
||||
@ -1105,11 +1090,20 @@ class ajaxfelamimail
|
||||
}
|
||||
}
|
||||
|
||||
function clearSearch()
|
||||
{
|
||||
$this->sessionData['messageFilter'] = array();
|
||||
|
||||
$this->sessionData['startMessage'] = 1;
|
||||
|
||||
$this->saveSessionData(true);
|
||||
|
||||
// generate the new messageview
|
||||
return $this->generateMessageList($this->sessionData['mailbox']);
|
||||
}
|
||||
|
||||
function quickSearch($_searchType, $_searchString, $_status)
|
||||
{
|
||||
// save the filter
|
||||
$bofilter = new felamimail_bofilter();
|
||||
|
||||
$filter['filterName'] = lang('Quicksearch');
|
||||
$filter['type'] = $_searchType;
|
||||
$filter['string'] = str_replace('"','\"', str_replace('\\','\\\\',$_searchString));
|
||||
|
@ -1,168 +0,0 @@
|
||||
<?php
|
||||
/***************************************************************************\
|
||||
* eGroupWare - FeLaMiMail *
|
||||
* http://www.linux-at-work.de *
|
||||
* http://www.phpgw.de *
|
||||
* http://www.egroupware.org *
|
||||
* Written by : Lars Kneschke [lkneschke@linux-at-work.de] *
|
||||
* ------------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\***************************************************************************/
|
||||
/* $Id$ */
|
||||
|
||||
class felamimail_bofilter
|
||||
{
|
||||
var $public_functions = array
|
||||
(
|
||||
'getActiveFilter' => True,
|
||||
'flagMessages' => True
|
||||
);
|
||||
|
||||
function __construct($_restoreSession=true)
|
||||
{
|
||||
$this->accountid = $GLOBALS['egw_info']['user']['account_id'];
|
||||
|
||||
$this->sofilter = new felamimail_sofilter();
|
||||
|
||||
$this->sessionData['activeFilter'] = "-1";
|
||||
|
||||
if ($_restoreSession) $this->restoreSessionData();
|
||||
|
||||
if(!is_array($this->sessionData['filter'])) {
|
||||
$this->sessionData['filter'][0]['filterName'] = lang('Quicksearch');
|
||||
$this->saveSessionData();
|
||||
}
|
||||
if(!isset($this->sessionData['activeFilter'])) {
|
||||
$this->sessionData['activeFilter'] = "-1";
|
||||
}
|
||||
}
|
||||
|
||||
function deleteFilter($_filterID)
|
||||
{
|
||||
unset($this->sessionData['filter'][$_filterID]);
|
||||
$this->saveSessionData();
|
||||
$this->sofilter->saveFilter($this->sessionData['filter']);
|
||||
}
|
||||
|
||||
function getActiveFilter()
|
||||
{
|
||||
return $this->sessionData['activeFilter'];
|
||||
}
|
||||
|
||||
function getFilter($_filterID)
|
||||
{
|
||||
return $this->sessionData['filter'][$_filterID];
|
||||
}
|
||||
|
||||
function getFilterList()
|
||||
{
|
||||
return $this->sessionData['filter'];
|
||||
}
|
||||
|
||||
function restoreSessionData()
|
||||
{
|
||||
$arrayFunctions =& CreateObject('phpgwapi.arrayfunctions');
|
||||
|
||||
$this->sessionData = $GLOBALS['egw']->session->appsession('filter_session_data');
|
||||
|
||||
// sort the filter list
|
||||
$unsortedFilter = $this->sofilter->restoreFilter();
|
||||
|
||||
// save the quicksearchfilter
|
||||
// must always have id=0
|
||||
if(is_array($unsortedFilter[0]))
|
||||
{
|
||||
$quickSearchFilter[0] = $unsortedFilter[0];
|
||||
unset($unsortedFilter[0]);
|
||||
}
|
||||
// or create the array
|
||||
else
|
||||
{
|
||||
$quickSearchFilter[0] = array('filterName' => lang('quicksearch'));
|
||||
}
|
||||
|
||||
// _debug_array($this->sessionData['filter']);
|
||||
// the first one is always the quicksearch filter
|
||||
if(count($unsortedFilter) > 0)
|
||||
{
|
||||
$sortedFilter = $arrayFunctions->arfsort($unsortedFilter, array('filterName'));
|
||||
$sortedFilter = array_merge($quickSearchFilter, $sortedFilter);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sortedFilter = $quickSearchFilter;
|
||||
}
|
||||
#_debug_array($sortedFilter);
|
||||
|
||||
$this->sessionData['filter'] = $sortedFilter;
|
||||
}
|
||||
|
||||
function saveFilter($_formData, $_filterID='')
|
||||
{
|
||||
if(!empty($_formData['filterName']))
|
||||
$data['filterName'] = $_formData['filterName'];
|
||||
if(!empty($_formData['from']))
|
||||
$data['from'] = $_formData['from'];
|
||||
if(!empty($_formData['to']))
|
||||
$data['to'] = $_formData['to'];
|
||||
if(!empty($_formData['subject']))
|
||||
$data['subject']= $_formData['subject'];
|
||||
|
||||
if($_filterID === '')
|
||||
{
|
||||
$this->sessionData['filter'][] = $data;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->sessionData['filter'][$_filterID] = $data;
|
||||
}
|
||||
|
||||
$this->saveSessionData();
|
||||
|
||||
$this->sofilter->saveFilter($this->sessionData['filter']);
|
||||
}
|
||||
|
||||
function saveSessionData()
|
||||
{
|
||||
$GLOBALS['egw']->session->appsession('filter_session_data','',$this->sessionData);
|
||||
}
|
||||
|
||||
function setActiveFilter($_filter)
|
||||
{
|
||||
$this->sessionData['activeFilter'] = "$_filter";
|
||||
$this->saveSessionData();
|
||||
}
|
||||
|
||||
function updateFilter($_data)
|
||||
{
|
||||
$filter = $this->getFilterList();
|
||||
$activeFilter = $this->getActiveFilter();
|
||||
|
||||
// check for new quickfilter
|
||||
if($activeFilter == $_data['filter'] && isset($_data['quickSearch']))
|
||||
{
|
||||
#print " new Quickfilter $_quickSearch<br>";
|
||||
if($_data['quickSearch'] == '')
|
||||
{
|
||||
$this->setActiveFilter("-1");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->setActiveFilter("0");
|
||||
$data['filterName'] = lang('Quicksearch');
|
||||
$data['subject'] = $_data['quickSearch'];
|
||||
$data['from'] = $_data['quickSearch'];
|
||||
$this->saveFilter($data, '0');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->setActiveFilter($_data['filter']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,51 +0,0 @@
|
||||
<?php
|
||||
/***************************************************************************\
|
||||
* eGroupWare - FeLaMiMail *
|
||||
* http://www.linux-at-work.de *
|
||||
* http://www.phpgw.de *
|
||||
* http://www.egroupware.org *
|
||||
* Written by : Lars Kneschke [lkneschke@linux-at-work.de] *
|
||||
* ------------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\***************************************************************************/
|
||||
/* $Id$ */
|
||||
|
||||
class felamimail_sofilter
|
||||
{
|
||||
var $filter_table = 'egw_felamimail_displayfilter'; // only reference to table-prefix
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->accountid = $GLOBALS['egw_info']['user']['account_id'];
|
||||
$this->db = clone($GLOBALS['egw']->db);
|
||||
}
|
||||
|
||||
function saveFilter($_filterArray)
|
||||
{
|
||||
$this->db->insert($this->filter_table,array(
|
||||
'fmail_filter_data' => serialize($_filterArray)
|
||||
),array(
|
||||
'fmail_filter_accountid' => $this->accountid
|
||||
),__LINE__,__FILE__,'felamimail');
|
||||
|
||||
unset($this->sessionData['filter'][$_filterID]);
|
||||
}
|
||||
|
||||
function restoreFilter()
|
||||
{
|
||||
$this->db->select($this->filter_table,'fmail_filter_data',array(
|
||||
'fmail_filter_accountid' => $this->accountid
|
||||
),__LINE__,__FILE__,False,False,'felamimail');
|
||||
|
||||
|
||||
if ($this->db->next_record())
|
||||
{
|
||||
$filter = unserialize($this->db->f('fmail_filter_data'));
|
||||
return $filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
@ -19,7 +19,6 @@ class uifelamimail
|
||||
var $public_functions = array
|
||||
(
|
||||
'addVcard' => True,
|
||||
'changeFilter' => True,
|
||||
'changeFolder' => True,
|
||||
'changeSorting' => True,
|
||||
'compressFolder' => True,
|
||||
@ -45,7 +44,6 @@ class uifelamimail
|
||||
static $icServerID;
|
||||
var $connectionStatus = false;
|
||||
var $bofelamimail;
|
||||
var $bofilter;
|
||||
var $bopreferences;
|
||||
|
||||
function uifelamimail()
|
||||
@ -80,7 +78,6 @@ class uifelamimail
|
||||
//error_log(__METHOD__.'->'.self::$icServerID);
|
||||
$this->bofelamimail = felamimail_bo::getInstance(false,self::$icServerID);
|
||||
self::$icServerID = $GLOBALS['egw_info']['user']['preferences']['felamimail']['ActiveProfileID'] = $this->bofelamimail->profileID;
|
||||
$this->bofilter = new felamimail_bofilter(false);
|
||||
$this->bopreferences=& $this->bofelamimail->bopreferences;
|
||||
$this->preferences =& $this->bofelamimail->mailPreferences;
|
||||
if (is_object($this->preferences))
|
||||
@ -354,23 +351,6 @@ class uifelamimail
|
||||
$GLOBALS['egw']->common->egw_exit();
|
||||
}
|
||||
|
||||
function changeFilter()
|
||||
{
|
||||
error_log(__METHOD__." called from:".function_backtrace());
|
||||
if(isset($_POST["filter"]))
|
||||
{
|
||||
$data['quickSearch'] = $_POST["quickSearch"];
|
||||
$data['filter'] = $_POST["filter"];
|
||||
$this->bofilter->updateFilter($data);
|
||||
}
|
||||
elseif(isset($_GET["filter"]))
|
||||
{
|
||||
$data['filter'] = $_GET["filter"];
|
||||
$this->bofilter->updateFilter($data);
|
||||
}
|
||||
$this->viewMainScreen();
|
||||
}
|
||||
|
||||
function changeFolder()
|
||||
{
|
||||
// change folder
|
||||
@ -799,7 +779,6 @@ class uifelamimail
|
||||
//error_log(__METHOD__.__LINE__.$connectionReset);
|
||||
|
||||
#printf ("this->uifelamimail->viewMainScreen() start: %s<br>",date("H:i:s",mktime()));
|
||||
$bofilter =& $this->bofilter;
|
||||
$uiwidgets = CreateObject('felamimail.uiwidgets');
|
||||
// fetch the active account with prefs and identities
|
||||
$preferences =& $this->preferences;
|
||||
|
@ -894,19 +894,6 @@ function toggleFolderRadio(inputBox, _refreshTimeOut) {
|
||||
}
|
||||
}
|
||||
|
||||
function extendedSearch(_selectBox) {
|
||||
mail_resetMessageSelect();
|
||||
//disable select allMessages in Folder Checkbox, as it is not implemented for filters
|
||||
document.getElementById('selectAllMessagesCheckBox').disabled = true;
|
||||
egw_appWindow('felamimail').setStatusMessage('<span style="font-weight: bold;">Applying filter '+_selectBox.options[_selectBox.selectedIndex].text+'</span>');
|
||||
mail_cleanup();
|
||||
document.getElementById('divMessageList').innerHTML = '';
|
||||
|
||||
document.getElementById('quickSearch').value = '';
|
||||
|
||||
egw_appWindow('felamimail').xajax_doXMLHTTP('felamimail.ajaxfelamimail.extendedSearch',_selectBox.options[_selectBox.selectedIndex].value);
|
||||
}
|
||||
|
||||
function mail_flagMessages(_flag)
|
||||
{
|
||||
var Check=true;
|
||||
@ -1304,6 +1291,7 @@ function fm_clearSearch() {
|
||||
}
|
||||
|
||||
inputQuickSearch.focus();
|
||||
xajax_doXMLHTTP('felamimail.ajaxfelamimail.clearSearch');
|
||||
}
|
||||
|
||||
function changeActiveAccount(_accountSelection)
|
||||
|
Loading…
Reference in New Issue
Block a user