ActionHandler/Ticket.php

Go to the documentation of this file.
00001 <?php
00003 // {{{ license
00004 
00005 // +----------------------------------------------------------------------+
00006 // | FastFrame Application Framework                                      |
00007 // +----------------------------------------------------------------------+
00008 // | Copyright (c) 2002-2006 The Codejanitor Group                        |
00009 // +----------------------------------------------------------------------+
00010 // | This source file is subject to the GNU Lesser Public License (LGPL), |
00011 // | that is bundled with this package in the file LICENSE, and is        |
00012 // | available at through the world-wide-web at                           |
00013 // | http://www.fsf.org/copyleft/lesser.html                              |
00014 // | If you did not receive a copy of the LGPL and are unable to          |
00015 // | obtain it through the world-wide-web, you can get it by writing the  |
00016 // | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
00017 // | MA 02111-1307, USA.                                                  |
00018 // +----------------------------------------------------------------------+
00019 // | Authors: Jason Rust <jrust@codejanitor.com>                          |
00020 // +----------------------------------------------------------------------+
00021 
00022 // }}}
00023 // {{{ requires
00024 
00025 require_once FASTFRAME_ROOT . 'lib/FastFrame/ActionHandlerConfig.php';
00026 require_once dirname(__FILE__) . '/../Model/Ticket.php';
00027 require_once dirname(__FILE__) . '/actions.php';
00028 
00029 // }}}
00030 // {{{ class FF_ActionHandlerConfig_Ticket
00031 
00042 // }}}
00043 class FF_ActionHandlerConfig_Ticket extends FF_ActionHandlerConfig {
00044     // {{{ loadConfig()
00045 
00053     function loadConfig()
00054     {
00055         $appName = $this->actionHandler->o_registry->getCurrentApp();
00056         $this->actionHandler->setDefaultActionId(ACTION_SUMMARY);
00057         $this->actionHandler->batchModifyActions(
00058             array(ACTION_LIST, ACTION_EDIT, ACTION_ADD, ACTION_EDIT_SUBMIT, ACTION_ADD_SUBMIT, ACTION_DISPLAY),
00059             $this->actionHandler->o_registry->getAppFile('Action', $appName, 'libs'), 
00060             '_Ticket', 'Ticket');
00061         $this->actionHandler->addAction(
00062             ACTION_RELOAD, 
00063             $this->actionHandler->o_registry->getAppFile('Action/TicketForm.php', $appName, 'libs'), 
00064             'FF_Action_Form_Ticket'
00065         );
00066         $this->actionHandler->addAction(
00067             ACTION_REOPEN, 
00068             $this->actionHandler->o_registry->getAppFile('Action/TicketForm.php', $appName, 'libs'), 
00069             'FF_Action_Form_Ticket'
00070         );
00071         $this->actionHandler->addAction(
00072             ACTION_REOPEN_SUBMIT, 
00073             $this->actionHandler->o_registry->getAppFile('Action/TicketFormSubmit.php', $appName, 'libs'), 
00074             'FF_Action_FormSubmit_Ticket'
00075         );
00076         $this->actionHandler->addAction(
00077             ACTION_RESOLVE, 
00078             $this->actionHandler->o_registry->getAppFile('Action/TicketForm.php', $appName, 'libs'), 
00079             'FF_Action_Form_Ticket'
00080         );
00081         $this->actionHandler->addAction(
00082             ACTION_RESOLVE_SUBMIT, 
00083             $this->actionHandler->o_registry->getAppFile('Action/TicketFormSubmit.php', $appName, 'libs'), 
00084             'FF_Action_FormSubmit_Ticket'
00085         );
00086         $this->actionHandler->addAction(
00087             ACTION_ASSIGN_TICKET,
00088             $this->actionHandler->o_registry->getAppFile('Action/QuickAssign.php', $appName, 'libs'), 
00089             'FF_Action_QuickAssign'
00090         );
00091         $this->actionHandler->addAction(
00092             ACTION_GET_HANDLERS,
00093             $this->actionHandler->o_registry->getAppFile('Action/GetHandlers.php', $appName, 'libs'), 
00094             'FF_Action_GetHandlers'
00095         );
00096         $this->actionHandler->addAction(
00097             ACTION_INCREASE_POINTS,
00098             $this->actionHandler->o_registry->getAppFile('Action/QuickPoints.php', $appName, 'libs'),
00099             'FF_Action_QuickPoints'
00100         );
00101         $this->actionHandler->addAction(
00102             ACTION_DECREASE_POINTS,
00103             $this->actionHandler->o_registry->getAppFile('Action/QuickPoints.php', $appName, 'libs'),
00104             'FF_Action_QuickPoints'
00105         );
00106         $this->actionHandler->addAction(
00107             ACTION_DELETE_ATTACHMENT,
00108             $this->actionHandler->o_registry->getAppFile('Action/TicketAttachmentDelete.php', $appName, 'libs'),
00109             'FF_Action_Delete_TicketAttachment'
00110         );
00111         $this->actionHandler->addAction(
00112             ACTION_DELETE_COMMENT,
00113             $this->actionHandler->o_registry->getAppFile('Action/TicketCommentDelete.php', $appName, 'libs'),
00114             'FF_Action_Delete_TicketComment'
00115         );
00116         $this->actionHandler->addAction(
00117             ACTION_DELETE_WATCHLIST,
00118             $this->actionHandler->o_registry->getAppFile('Action/TicketWatchlistDelete.php', $appName, 'libs'),
00119             'FF_Action_Delete_TicketWatchlist'
00120         );
00121         $this->actionHandler->addAction(
00122             ACTION_EDIT_COMMENT,
00123             $this->actionHandler->o_registry->getAppFile('Action/TicketCommentEdit.php', $appName, 'libs'),
00124             'FF_Action_TicketCommentEdit'
00125         );
00126         $this->actionHandler->addAction(
00127             ACTION_EDIT_DESCRIPTION,
00128             $this->actionHandler->o_registry->getAppFile('Action/TicketDescriptionEdit.php', $appName, 'libs'),
00129             'FF_Action_TicketDescriptionEdit'
00130         );
00131         $this->actionHandler->addAction(
00132             ACTION_SUMMARY, 
00133             $this->actionHandler->o_registry->getAppFile('Action/TicketSummary.php', $appName, 'libs'), 
00134             'FF_Action_TicketSummary'
00135         );
00136         $this->actionHandler->o_model =& new FF_Model_Ticket();
00137     }
00138 
00139     // }}}
00140     // {{{ checkPerms()
00141 
00150     function checkPerms()
00151     {
00152         $o_perms =& FF_Perms::factory();
00153         if (!$o_perms->hasPerm(array('can_use_mayday'))) {
00154             $this->actionHandler->setActionId(ACTION_PROBLEM);
00155             $o_output =& FF_Output::factory();
00156             $o_output->setMessage(_('You do not have permission to use Mayday.'), FASTFRAME_ERROR_MESSAGE);
00157             return false;
00158         }
00159 
00160         return true;
00161     }
00162 
00163     // }}}
00164 }
00165 ?>

Generated on Fri Jun 23 11:38:18 2006 for FastFrame by  doxygen 1.4.4