Overview

Packages

  • Horde
    • Form
    • MIME
      • Viewer
    • Scheduler
  • None
  • Whups
    • UnitTests

Classes

  • Whups_Application
  • Whups_Block_Myqueries
  • Whups_Block_Myrequests
  • Whups_Block_Mytickets
  • Whups_Block_Query
  • Whups_Block_Queuecontents
  • Whups_Block_Queuesummary
  • Whups_Block_Unassigned
  • Whups_Driver_sql
  • Whups_Exception
  • Whups_Factory_Driver
  • Whups_Form_AddListener
  • Whups_Form_DeleteListener
  • Whups_Form_Queue_StepOne
  • Whups_Form_Queue_StepThree
  • Whups_Form_Queue_StepTwo
  • Whups_Form_Renderer_Query
  • Whups_Form_SetTypeStepOne
  • Whups_Form_SetTypeStepTwo
  • Whups_Form_Ticket_Delete
  • Whups_Test_Perms
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Display a summary of the current user's requested tickets.
 4:  */
 5: class Whups_Block_Myrequests extends Horde_Core_Block
 6: {
 7:     /**
 8:      */
 9:     public function __construct($app, $params = array())
10:     {
11:         parent::__construct($app, $params);
12: 
13:         $this->_name = _("My Requests");
14:     }
15: 
16:     /**
17:      */
18:     protected function _content()
19:     {
20:         global $whups_driver, $prefs;
21: 
22:         $queue_ids = array_keys(Whups::permissionsFilter($whups_driver->getQueues(), 'queue', Horde_Perms::READ));
23:         $info = array('requester' => $GLOBALS['registry']->getAuth(),
24:                       'notowner' => 'user:' . $GLOBALS['registry']->getAuth(),
25:                       'nores' => true,
26:                       'queue' => $queue_ids);
27:         $requests = $whups_driver->getTicketsByProperties($info);
28:         if (!$requests) {
29:             return '<p><em>' . _("You have no open requests.") . '</em></p>';
30:         }
31: 
32:         $html = '<thead><tr>';
33:         $sortby = $prefs->getValue('sortby');
34:         $sortdirclass = ' class="' . ($prefs->getValue('sortdir') ? 'sortup' : 'sortdown') . '"';
35:         foreach (Whups::getSearchResultColumns('block') as $name => $column) {
36:             $html .= '<th' . ($sortby == $column ? $sortdirclass : '') . '>' . $name . '</th>';
37:         }
38:         $html .= '</tr></thead><tbody>';
39: 
40:         Whups::sortTickets($requests);
41:         foreach ($requests as $ticket) {
42:             $link = Horde::link(Whups::urlFor('ticket', $ticket['id'], true));
43:             $html .= '<tr><td>' . $link . htmlspecialchars($ticket['id']) . '</a></td>' .
44:                 '<td>' . $link . htmlspecialchars($ticket['summary']) . '</a></td>' .
45:                 '<td>' . htmlspecialchars($ticket['priority_name']) . '</td>' .
46:                 '<td>' . htmlspecialchars($ticket['state_name']) . '</td></tr>';
47:         }
48: 
49:         Horde::addScriptFile('tables.js', 'horde', true);
50: 
51:         return '<table id="whups_block_myrequests" cellspacing="0" class="tickets striped sortable">' . $html . '</tbody></table>';
52:    }
53: 
54: }
55: 
API documentation generated by ApiGen