/usr/share/horde/nag/lib/Driver/Smartlist.php is in php-horde-nag 4.2.13-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | <?php
/**
* Nag storage driver for handling smart tasklists.
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Michael J Rubinsky <mrubinsk@horde.org>
* @package Nag
*/
class Nag_Driver_Smartlist extends Nag_Driver
{
/**
* The composed Nag_Driver
*
* @var Nag_Driver
*/
protected $_driver;
/**
* The share object the smartlist is based on.
*
* @var array An array of criteria
*/
protected $_share;
/**
* Constructs a new SQL storage object.
*
* @param string $tasklist The tasklist to load.
* @param array $params A hash containing connection parameters.
*/
public function __construct($tasklist, $params = array())
{
$this->_driver = $params['driver'];
$this->_share = $GLOBALS['nag_shares']->getShare($tasklist);
$this->_search = unserialize($this->_share->get('search'));
$this->tasks = new Nag_Task();
}
public function add(array $task)
{
throw new Nag_Exception(_("Cannot add tasks to smart lists."));
}
/**
* Needed to satisfy the abstract parent class.
*/
protected function _add(array $task)
{
}
public function modify($taskId, array $task)
{
$this->_driver->modify($taskId, $task);
}
public function _modify($taskId, array $task)
{
}
public function delete($taskId)
{
$this->_driver->delete($taskId);
}
protected function _delete($taskId)
{
}
/**
* @TODO
*/
public function deleteAll()
{
}
public function _deleteAll()
{
}
/**
* Return the list of tasks that match this smart list's search criteria.
*
*/
public function retrieve()
{
$this->tasks = $this->_search->getSlice();
}
public function getChildren($parentId, $include_history = true)
{
return $this->_driver->getChildren($parentId, $include_history);
}
public function get($taskId)
{
return $this->_driver->get($taskId);
}
public function getByUID($uid)
{
return $this->_driver->getByUID($uid);
}
}
|