00001 <?php
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 require_once FASTFRAME_ROOT . 'lib/FastFrame/ActionHandlerConfig.php';
00027 require_once dirname(__FILE__) . '/../Model/Inventory.php';
00028 require_once dirname(__FILE__) . '/actions.php';
00029
00030
00031
00032
00042
00043 class FF_ActionHandlerConfig_Inventory extends FF_ActionHandlerConfig {
00044
00045
00052 function loadConfig()
00053 {
00054 $appName = $this->actionHandler->o_registry->getCurrentApp();
00055 $this->actionHandler->setDefaultActionId(ACTION_LIST);
00056 $this->actionHandler->batchModifyActions(
00057 array(ACTION_LIST, ACTION_ADD, ACTION_ADD_SUBMIT, ACTION_DELETE),
00058 $this->actionHandler->o_registry->getAppFile('Action', $appName, 'libs'),
00059 '_Inventory',
00060 'Inventory'
00061 );
00062 $this->actionHandler->addAction(
00063 ACTION_INVENTORY_PROCESS,
00064 $this->actionHandler->o_registry->getAppFile('Action/InventoryProcess.php', $appName, 'libs'),
00065 'FF_Action_Form_InventoryProcess'
00066 );
00067 $this->actionHandler->addAction(
00068 ACTION_INVENTORY_PROCESS_SUBMIT,
00069 $this->actionHandler->o_registry->getAppFile('Action/InventoryProcessSubmit.php', $appName, 'libs'),
00070 'FF_Action_InventoryProcessSubmit'
00071 );
00072 $this->actionHandler->o_model =& new FF_Model_Inventory();
00073 }
00074
00075
00076
00077
00086 function checkPerms()
00087 {
00088 $o_perms =& FF_Perms::factory();
00089 if (!$o_perms->hasPerm(array('can_use_inventory'))) {
00090 $this->actionHandler->setActionId(ACTION_PROBLEM);
00091 $o_output =& FF_Output::factory();
00092 $o_output->setMessage(_('You do not have permission to use the inventory module.'), FASTFRAME_ERROR_MESSAGE);
00093 return false;
00094 }
00095
00096 return true;
00097 }
00098
00099
00100 }
00101 ?>