Пример #1
0
 public function __construct()
 {
     parent::__construct();
     trigger_error("budgets has been deprecated in v3.0 and will be removed by v4.0. Please use CSystem_Budget instead.", E_USER_NOTICE);
 }
Пример #2
0
}
global $AppUI, $cal_sdf;
$AppUI->loadCalendarJS();
$budget_id = (int) w2PgetParam($_GET, 'budget_id', 0);
if (!canEdit('system')) {
    $AppUI->redirect('m=public&a=access_denied');
}
$df = $AppUI->getPref('SHDATEFORMAT');
// 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);
$budgetCategory = w2PgetSysVal('BudgetCategory');
$budgetCategory = arrayMerge(array('0' => $AppUI->_('None specified')), $budgetCategory);
// load the record data
$budget = new CSystem_Budget();
$budget->load($budget_id);
$titleBlock = new w2p_Theme_TitleBlock('Setup Budgets', 'myevo-weather.png', $m, $m . '.' . $a);
$titleBlock->addCrumb('?m=system', 'system admin');
$titleBlock->addCrumb('?m=system&a=budgeting_allocated', 'budgets allocated');
$titleBlock->show();
?>
<script language="javascript" type="text/javascript">
    function setDate( frm_name, f_date ) {
        fld_date = eval( 'document.' + frm_name + '.' + f_date );
        fld_real_date = eval( 'document.' + frm_name + '.' + 'budget_' + f_date );
        if (fld_date.value.length > 0) {
            if ((parseDate(fld_date.value))==null) {
                alert('The Date/Time you typed does not match your prefered format, please retype.');
                fld_real_date.value = '';
                fld_date.style.backgroundColor = 'red';
<?php

if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
global $AppUI, $cal_sdf;
$AppUI->getTheme()->loadCalendarJS();
$budget_id = (int) w2PgetParam($_GET, 'budget_id', 0);
if (!canEdit('system')) {
    $AppUI->redirect(ACCESS_DENIED);
}
$df = $AppUI->getPref('SHDATEFORMAT');
// 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);
$budgetCategory = w2PgetSysVal('BudgetCategory');
$budgetCategory = arrayMerge(array('0' => $AppUI->_('None specified')), $budgetCategory);
// load the record data
$budget = new CSystem_Budget();
$budget->load($budget_id);
$titleBlock = new w2p_Theme_TitleBlock('Budget Allocated', 'myevo-weather.png', $m);
$titleBlock->addCrumb('?m=system', 'system admin');
$titleBlock->addCrumb('?m=system&a=budgeting', 'setup budgets');
$titleBlock->show();
Пример #4
0
 /**
  * Tests the delete of a bcode
  */
 public function testDelete()
 {
     $this->obj->bind($this->post_data);
     $result = $this->obj->store();
     $this->assertTrue($result);
     $original_id = $this->obj->budget_id;
     $result = $this->obj->delete();
     $item = new CSystem_Budget();
     $item->overrideDatabase($this->mockDB);
     $this->mockDB->stageHash(array('budget_amount' => null, 'budget_start_date' => null));
     $item->load($original_id);
     $this->assertTrue(is_a($item, 'CSystem_Budget'));
     $this->assertEquals('', $item->budget_amount);
     $this->assertEquals('', $item->budget_start_date);
 }