/** * Tests loading the CSystem_Bcode Object */ public function testLoad() { $this->obj->bind($this->post_data); $result = $this->obj->store(); $this->assertTrue($result); $item = new CSystem_Bcode(); $item->overrideDatabase($this->mockDB); $this->post_data['billingcode_id'] = $this->obj->billingcode_id; $this->mockDB->stageHash($this->post_data); $item->load($this->obj->billingcode_id); $this->assertEquals($this->obj->billingcode_id, $item->billingcode_id); $this->assertEquals($this->obj->billingcode_name, $item->billingcode_name); $this->assertEquals($this->obj->billingcode_desc, $item->billingcode_desc); }
<?php /* $Id$ $URL$ */ if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } $company_id = (int) w2PgetParam($_POST, 'company_id', -1); $billingcode_id = (int) w2PgetParam($_GET, 'billingcode_id', 0); if (!canEdit('system')) { $AppUI->redirect('m=public&a=access_denied'); } $bcode = new CSystem_Bcode(); $bcode->load($billingcode_id); $billingcodes = $bcode->getBillingCodes($company_id, false); // get a list of permitted companies $company = new CCompany(); $companies = $company->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name'); $companies = arrayMerge(array('0' => $AppUI->_('None specified')), $companies); $companies = arrayMerge(array('-1' => $AppUI->_('All Codes')), $companies); $billingCategory = w2PgetSysVal('BudgetCategory'); $billingCategory = arrayMerge(array('0' => $AppUI->_('None specified')), $billingCategory); $titleBlock = new w2p_Theme_TitleBlock('Edit Billing Codes', 'myevo-weather.png', $m, $m . '.' . $a); $titleBlock->addCrumb('?m=system', 'system admin'); $titleBlock->show(); ?> <script language="javascript" type="text/javascript"> <!-- function submitIt(){ var form = document.frmAddcode; form.submit(); }