~ubuntu-branches/ubuntu/vivid/php-horde-nag/vivid-proposed

« back to all changes in this revision

Viewing changes to nag-4.1.3/lib/Tasklist.php

  • Committer: Package Import Robot
  • Author(s): Mathieu Parent
  • Date: 2014-03-11 21:27:39 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140311212739-m6rbihspu5zjpvaq
Tags: 4.1.4-1
New upstream version 4.1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
/**
3
 
 * Nag_Tasklist is a light wrapper around a Nag tasklist.
4
 
 *
5
 
 * See the enclosed file COPYING for license information (GPL). If you
6
 
 * did not receive this file, see http://www.horde.org/licenses/gpl.
7
 
 *
8
 
 * @author  Michael J Rubinsky <mrubinsk@horde.org>
9
 
 * @package Nag
10
 
 */
11
 
class Nag_Tasklist
12
 
{
13
 
    protected $_share;
14
 
 
15
 
    /**
16
 
     * Const'r
17
 
     *
18
 
     * @param Horde_Share_Object_Base  The base share for this tasklist.
19
 
     */
20
 
    public function __construct(Horde_Share_Object $share)
21
 
    {
22
 
        $this->_share = $share;
23
 
    }
24
 
 
25
 
    /**
26
 
     * Convert this tasklist to a hash.
27
 
     *
28
 
     * @return array  A hash of tasklist properties.
29
 
     */
30
 
    public function toHash()
31
 
    {
32
 
        $tasks = Nag::listTasks(array(
33
 
            'tasklists' => $this->_share->getName(),
34
 
            'include_history' => false)
35
 
        );
36
 
 
37
 
        $hash = array(
38
 
            'name' => Nag::getLabel($this->_share),
39
 
            'desc' => $this->_share->get('desc'),
40
 
            'color' => $this->_share->get('color'),
41
 
            'owner' => $this->_share->get('owner'),
42
 
            'id' => $this->_share->getName(),
43
 
            'count' => $tasks->count(),
44
 
            'smart' => $this->_share->get('issmart') ? true : false,
45
 
            'overdue' => $tasks->childrenOverdue());
46
 
 
47
 
        return $hash;
48
 
    }
49
 
 
50
 
}
 
 
b'\\ No newline at end of file'