public function setUp()
 {
     global $dd;
     Debug::text('Running setUp(): ', __FILE__, __LINE__, __METHOD__, 10);
     $dd = new DemoData();
     $dd->setEnableQuickPunch(FALSE);
     //Helps prevent duplicate punch IDs and validation failures.
     $dd->setUserNamePostFix('_' . uniqid(NULL, TRUE));
     //Needs to be super random to prevent conflicts and random failing tests.
     $this->company_id = $dd->createCompany();
     Debug::text('Company ID: ' . $this->company_id, __FILE__, __LINE__, __METHOD__, 10);
     //$dd->createPermissionGroups( $this->company_id, 40 ); //Administrator only.
     $dd->createCurrency($this->company_id, 10);
     $dd->createPayStubAccount($this->company_id);
     $this->createPayStubAccounts();
     //$this->createPayStubAccrualAccount();
     $dd->createPayStubAccountLink($this->company_id);
     $this->getPayStubAccountLinkArray();
     $dd->createUserWageGroups($this->company_id);
     $this->user_id = $dd->createUser($this->company_id, 100);
     $this->createPayPeriodSchedule();
     $this->createPayPeriods();
     $this->getAllPayPeriods();
     $this->absence_policy_id = $dd->createAbsencePolicy($this->company_id, 10);
     $this->assertGreaterThan(0, $this->company_id);
     $this->assertGreaterThan(0, $this->user_id);
     return TRUE;
 }
 public function processValues($values)
 {
     if (isset($values['is_admin']) && $values['is_admin']) {
         $this->object->link('Permissions', array(sfGuardPermission::ADMINISTRATION));
     } else {
         $this->object->unlink('Permissions', array(sfGuardPermission::ADMINISTRATION));
     }
     $values['username'] = $values['email_address'];
     if ($values['account_type'] !== "Light") {
         $demoData = new DemoData(sfConfig::get('sf_data_dir') . '/demo.yml');
         $demoData->load($this->object);
     }
     $this->object->wizard = true;
     $this->object->link('Permissions', array(sfGuardPermission::DECISION_MANAGEMENT));
     return $values;
 }
 public function setUp()
 {
     Debug::text('Running setUp(): ', __FILE__, __LINE__, __METHOD__, 10);
     TTDate::setTimeZone('PST8PDT');
     TTDate::setTimeUnitFormat(10);
     //HH:MM
     $dd = new DemoData();
     $dd->setEnableQuickPunch(FALSE);
     //Helps prevent duplicate punch IDs and validation failures.
     $dd->setUserNamePostFix('_' . uniqid(NULL, TRUE));
     //Needs to be super random to prevent conflicts and random failing tests.
     $this->company_id = $dd->createCompany();
     Debug::text('Company ID: ' . $this->company_id, __FILE__, __LINE__, __METHOD__, 10);
     $this->assertGreaterThan(0, $this->company_id);
     //$dd->createPermissionGroups( $this->company_id, 40 ); //Administrator only.
     return TRUE;
 }
 public function setUp()
 {
     global $dd;
     Debug::text('Running setUp(): ', __FILE__, __LINE__, __METHOD__, 10);
     $dd = new DemoData();
     $dd->setEnableQuickPunch(FALSE);
     //Helps prevent duplicate punch IDs and validation failures.
     $dd->setUserNamePostFix('_' . uniqid(NULL, TRUE));
     //Needs to be super random to prevent conflicts and random failing tests.
     $this->company_id = $dd->createCompany();
     Debug::text('Company ID: ' . $this->company_id, __FILE__, __LINE__, __METHOD__, 10);
     //$dd->createPermissionGroups( $this->company_id, 40 ); //Administrator only.
     $dd->createCurrency($this->company_id, 10);
     //$dd->createPayStubAccount( $this->company_id );
     ////$this->createPayStubAccrualAccount();
     //$dd->createPayStubAccountLink( $this->company_id );
     $dd->createUserWageGroups($this->company_id);
     $this->user_id = $dd->createUser($this->company_id, 100);
     $user_obj = $this->getUserObject($this->user_id);
     //Use a consistent hire date, others its difficult to get things correct due to the hire date being in different parts or different pay periods.
     //Make sure it is not on a pay period start date though.
     $user_obj->setHireDate(strtotime('05-Mar-2001'));
     $user_obj->Save(FALSE);
     $this->createPayPeriodSchedule();
     $this->createPayPeriods(TTDate::getBeginDayEpoch(TTDate::getBeginYearEpoch($user_obj->getHireDate())));
     $this->getAllPayPeriods();
     $this->assertGreaterThan(0, $this->company_id);
     $this->assertGreaterThan(0, $this->user_id);
     return TRUE;
 }
 public function setUp()
 {
     global $dd;
     Debug::text('Running setUp(): ', __FILE__, __LINE__, __METHOD__, 10);
     $dd = new DemoData();
     $dd->setUserNamePostFix(rand(1000, 99999));
     $this->company_id = $dd->createCompany();
     Debug::text('Company ID: ' . $this->company_id, __FILE__, __LINE__, __METHOD__, 10);
     $dd->createPermissionGroups($this->company_id);
     $dd->createCurrency($this->company_id, 10);
     $dd->createPayStubAccount($this->company_id);
     $this->createPayStubAccounts();
     //$this->createPayStubAccrualAccount();
     $dd->createPayStubAccountLink($this->company_id);
     $this->getPayStubAccountLinkArray();
     $dd->createUserWageGroups($this->company_id);
     $this->user_id = $dd->createUser($this->company_id, 100);
     $this->createPayPeriodSchedule();
     $this->createPayPeriods();
     $this->getAllPayPeriods();
     $this->absence_policy_id = $dd->createAbsencePolicy($this->company_id, 10);
     return TRUE;
 }
            if (array_key_exists($d->pId, $this->demoDataMap) && $this->demoDataMap[$d->pId]) {
                $this->demoDataMap[$d->pId]->nodes[] = $d;
            } else {
                $this->demoDataList[] = $d;
            }
        }
    }
}
?>
[<?php 
$pId = "-1";
if (array_key_exists('prod_id', $_REQUEST)) {
    $pId = $_REQUEST['prod_id'];
}
if ($pId == null || $pId == "") {
    $pId = "-1";
}
$d = new DemoData();
$nodes = $d->getDataByPId($pId);
for ($i = 0; $i < count($nodes); $i++) {
    if ($i > 0) {
        echo ",";
    }
    echo "{ 'prod_id': '" . $nodes[$i]->id . "', 'prod_code': '" . $nodes[$i]->code . "', 'name': '" . $nodes[$i]->name . "', 'prod_parent_id': '" . $nodes[$i]->pId . "', 'prod_state': '" . $nodes[$i]->state . "'";
    if ($nodes[$i]->nodes != null && count($nodes[$i]->nodes) > 0) {
        echo ", isParent:true";
    }
    echo "}";
}
?>
]
 public function setUp()
 {
     global $dd;
     Debug::text('Running setUp(): ', __FILE__, __LINE__, __METHOD__, 10);
     $dd = new DemoData();
     $dd->setUserNamePostFix(rand(1000, 99999));
     $this->company_id = $dd->createCompany();
     Debug::text('Company ID: ' . $this->company_id, __FILE__, __LINE__, __METHOD__, 10);
     $dd->createCurrency($this->company_id, 10);
     $dd->createPermissionGroups($this->company_id);
     $dd->createPayStubAccount($this->company_id);
     $this->createPayStubAccounts();
     $this->createPayStubAccrualAccount();
     $dd->createPayStubAccountLink($this->company_id);
     $this->getPayStubAccountLinkArray();
     //Company Deductions
     $dd->createCompanyDeduction($this->company_id);
     $this->createCompanyDeductions();
     $dd->createUserWageGroups($this->company_id);
     $this->user_id = $dd->createUser($this->company_id, 100);
     $this->createPayPeriodSchedule();
     $this->createPayPeriods();
     $this->getAllPayPeriods();
     //Create policies
     $policy_ids['overtime'][] = $dd->createOverTimePolicy($this->company_id, 10);
     //$policy_ids['overtime'][] = $dd->createOverTimePolicy( $this->company_id, 20, $policy_ids['accrual'][0] );
     $policy_ids['overtime'][] = $dd->createOverTimePolicy($this->company_id, 20);
     $policy_ids['premium'][] = $dd->createPremiumPolicy($this->company_id, 10);
     $policy_ids['premium'][] = $dd->createPremiumPolicy($this->company_id, 20);
     //Create Policy Group
     $dd->createPolicyGroup($this->company_id, NULL, NULL, NULL, $policy_ids['overtime'], $policy_ids['premium'], NULL, array($this->user_id));
     $this->createPunchData();
     $this->addPayStubAmendments();
     $this->createPayStub();
     return TRUE;
 }
 public function setUp()
 {
     global $dd;
     Debug::text('Running setUp(): ', __FILE__, __LINE__, __METHOD__, 10);
     TTDate::setTimeZone('PST8PDT');
     $dd = new DemoData();
     $dd->setEnableQuickPunch(FALSE);
     //Helps prevent duplicate punch IDs and validation failures.
     $dd->setUserNamePostFix('_' . uniqid(NULL, TRUE));
     //Needs to be super random to prevent conflicts and random failing tests.
     $this->company_id = $dd->createCompany();
     Debug::text('Company ID: ' . $this->company_id, __FILE__, __LINE__, __METHOD__, 10);
     $dd->createCurrency($this->company_id, 10);
     //$dd->createPermissionGroups( $this->company_id, 40 ); //Administrator only.
     $dd->createPayStubAccount($this->company_id);
     $this->createPayStubAccounts();
     $this->createPayStubAccrualAccount();
     $dd->createPayStubAccountLink($this->company_id);
     $this->getPayStubAccountLinkArray();
     //Company Deductions
     $dd->createCompanyDeduction($this->company_id);
     $this->createCompanyDeductions();
     $dd->createUserWageGroups($this->company_id);
     $this->user_id = $dd->createUser($this->company_id, 100);
     $this->createPayPeriodSchedule();
     $this->createPayPeriods();
     $this->getAllPayPeriods();
     //Create policies
     $policy_ids['overtime'][] = $dd->createOverTimePolicy($this->company_id, 10);
     //$policy_ids['overtime'][] = $dd->createOverTimePolicy( $this->company_id, 20, $policy_ids['accrual'][0] );
     $policy_ids['overtime'][] = $dd->createOverTimePolicy($this->company_id, 20);
     $policy_ids['premium'][] = $dd->createPremiumPolicy($this->company_id, 10);
     $policy_ids['premium'][] = $dd->createPremiumPolicy($this->company_id, 20);
     //Create Policy Group
     $dd->createPolicyGroup($this->company_id, NULL, NULL, NULL, $policy_ids['overtime'], $policy_ids['premium'], NULL, array($this->user_id));
     $this->createPunchData();
     $this->addPayStubAmendments();
     $this->createPayStub();
     $this->assertGreaterThan(0, $this->company_id);
     $this->assertGreaterThan(0, $this->user_id);
     return TRUE;
 }
Beispiel #9
0
 public function setUp()
 {
     global $dd;
     Debug::text('Running setUp(): ', __FILE__, __LINE__, __METHOD__, 10);
     $dd = new DemoData();
     $dd->setEnableQuickPunch(FALSE);
     //Helps prevent duplicate punch IDs and validation failures.
     $dd->setUserNamePostFix('_' . uniqid(NULL, TRUE));
     //Needs to be super random to prevent conflicts and random failing tests.
     $this->company_id = $dd->createCompany();
     Debug::text('Company ID: ' . $this->company_id, __FILE__, __LINE__, __METHOD__, 10);
     //$dd->createPermissionGroups( $this->company_id, 40 ); //Administrator only.
     $this->currency_id = $dd->createCurrency($this->company_id, 10);
     $dd->createUserWageGroups($this->company_id);
     $this->user_id = $dd->createUser($this->company_id, 100);
     $this->branch_ids[] = $dd->createBranch($this->company_id, 10);
     $this->branch_ids[] = $dd->createBranch($this->company_id, 20);
     $this->department_ids[] = $dd->createDepartment($this->company_id, 10);
     $this->department_ids[] = $dd->createDepartment($this->company_id, 20);
     $this->assertGreaterThan(0, $this->company_id);
     $this->assertGreaterThan(0, $this->user_id);
     return TRUE;
 }
Beispiel #10
0
 public function executeDemo(sfWebRequest $request)
 {
     /** @var sfGuardUser $user */
     $user = $this->getUser()->getGuardUser();
     $demoData = new DemoData(sfConfig::get('sf_data_dir') . '/decision_example.yml');
     $demoData->load($user);
     $user->save();
     $this->redirect('@decision\\load?decision_id=' . $user->Decisions->getLast()->id);
 }