예제 #1
0
     $user_date_id = UserDateFactory::findOrInsertUserDate($user_id, $filter_date);
 }
 if ($user_date_id != '') {
     $udtlf = new UserDateTotalListFactory();
     $udtlf->getByUserDateIDAndStatusAndType($user_date_id, array(10, 20, 30), array(10, 20, 30, 40, 100), $current_user_prefs->getItemsPerPage(), $page, NULL, $sort_array);
     $pager = new Pager($udtlf);
     $blf = new BranchListFactory();
     $branch_options = $blf->getByCompanyIdArray($current_company->getId());
     $dlf = new DepartmentListFactory();
     $department_options = $dlf->getByCompanyIdArray($current_company->getId());
     //Absence policies
     $otplf = new AbsencePolicyListFactory();
     $absence_policy_options = $otplf->getByCompanyIDArray($current_company->getId(), TRUE);
     //Overtime policies
     $otplf = new OverTimePolicyListFactory();
     $over_time_policy_options = $otplf->getByCompanyIDArray($current_company->getId(), TRUE);
     //Premium policies
     $pplf = new PremiumPolicyListFactory();
     $premium_policy_options = $pplf->getByCompanyIDArray($current_company->getId(), TRUE);
     $job_options = array();
     $job_item_options = array();
     if ($current_company->getProductEdition() == 20) {
         $jlf = new JobListFactory();
         $job_options = $jlf->getByCompanyIdArray($current_company->getId(), FALSE);
         $jilf = new JobItemListFactory();
         $job_item_options = $jilf->getByCompanyIdArray($current_company->getId(), TRUE);
     }
     $day_total_time = array('total_time' => 0, 'worked_time' => 0, 'difference' => 0);
     foreach ($udtlf as $udt_obj) {
         if ($udt_obj->getStatus() == 20) {
             $day_total_time['worked_time'] += $udt_obj->getTotalTime();
예제 #2
0
     $pgf->FailTransaction();
 default:
     if (isset($id)) {
         BreadCrumb::setCrumb($title);
         $pglf = new PolicyGroupListFactory();
         $pglf->getByIdAndCompanyID($id, $current_company->getID());
         foreach ($pglf as $pg_obj) {
             //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);
             $data = array('id' => $pg_obj->getId(), 'name' => $pg_obj->getName(), 'meal_policy_ids' => $pg_obj->getMealPolicy(), 'break_policy_ids' => $pg_obj->getBreakPolicy(), 'holiday_policy_ids' => $pg_obj->getHolidayPolicy(), 'exception_policy_control_id' => $pg_obj->getExceptionPolicyControlID(), 'user_ids' => $pg_obj->getUser(), 'over_time_policy_ids' => $pg_obj->getOverTimePolicy(), 'premium_policy_ids' => $pg_obj->getPremiumPolicy(), 'round_interval_policy_ids' => $pg_obj->getRoundIntervalPolicy(), 'accrual_policy_ids' => $pg_obj->getAccrualPolicy(), 'created_date' => $pg_obj->getCreatedDate(), 'created_by' => $pg_obj->getCreatedBy(), 'updated_date' => $pg_obj->getUpdatedDate(), 'updated_by' => $pg_obj->getUpdatedBy(), 'deleted_date' => $pg_obj->getDeletedDate(), 'deleted_by' => $pg_obj->getDeletedBy());
         }
     }
     $none_array_option = array('0' => TTi18n::gettext('-- None --'));
     $ulf = new UserListFactory();
     $user_options = $ulf->getByCompanyIDArray($current_company->getId(), FALSE, TRUE);
     $otplf = new OverTimePolicyListFactory();
     $over_time_policy_options = Misc::prependArray($none_array_option, $otplf->getByCompanyIDArray($current_company->getId(), FALSE));
     $pplf = new PremiumPolicyListFactory();
     $premium_policy_options = Misc::prependArray($none_array_option, $pplf->getByCompanyIDArray($current_company->getId(), FALSE));
     $riplf = new RoundIntervalPolicyListFactory();
     $round_interval_policy_options = Misc::prependArray($none_array_option, $riplf->getByCompanyIDArray($current_company->getId(), FALSE));
     $mplf = new MealPolicyListFactory();
     $meal_options = Misc::prependArray($none_array_option, $mplf->getByCompanyIdArray($current_company->getId(), FALSE));
     $bplf = new BreakPolicyListFactory();
     $break_options = Misc::prependArray($none_array_option, $bplf->getByCompanyIdArray($current_company->getId(), FALSE));
     $epclf = new ExceptionPolicyControlListFactory();
     $exception_options = Misc::prependArray($none_array_option, $epclf->getByCompanyIdArray($current_company->getId(), FALSE));
     $hplf = new HolidayPolicyListFactory();
     $holiday_policy_options = Misc::prependArray($none_array_option, $hplf->getByCompanyIdArray($current_company->getId(), FALSE));
     $aplf = new AccrualPolicyListFactory();
     $aplf->getByCompanyIdAndTypeID($current_company->getId(), array(20, 30));
     //Calendar and Hour based.
예제 #3
0
        }
    default:
        if (isset($id)) {
            BreadCrumb::setCrumb($title);
            $splf = new SchedulePolicyListFactory();
            $splf->getByIdAndCompanyID($id, $current_company->getID());
            foreach ($splf as $sp_obj) {
                //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);
                $data = array('id' => $sp_obj->getId(), 'name' => $sp_obj->getName(), 'over_time_policy_id' => $sp_obj->getOverTimePolicyID(), 'absence_policy_id' => $sp_obj->getAbsencePolicyID(), 'meal_policy_id' => $sp_obj->getMealPolicyID(), 'break_policy_ids' => $sp_obj->getBreakPolicy(), 'start_stop_window' => $sp_obj->getStartStopWindow(), 'created_date' => $sp_obj->getCreatedDate(), 'created_by' => $sp_obj->getCreatedBy(), 'updated_date' => $sp_obj->getUpdatedDate(), 'updated_by' => $sp_obj->getUpdatedBy(), 'deleted_date' => $sp_obj->getDeletedDate(), 'deleted_by' => $sp_obj->getDeletedBy());
            }
        } elseif ($action != 'submit') {
            $data = array('start_stop_window' => 3600);
        }
        $aplf = new AbsencePolicyListFactory();
        $absence_options = $aplf->getByCompanyIDArray($current_company->getId(), TRUE);
        $otplf = new OverTimePolicyListFactory();
        $over_time_options = $otplf->getByCompanyIDArray($current_company->getId(), TRUE, array('type_id' => '= 200'));
        $mplf = new MealPolicyListFactory();
        $meal_options = $mplf->getByCompanyIDArray($current_company->getId(), TRUE);
        $bplf = new BreakPolicyListFactory();
        $break_options = $bplf->getByCompanyIdArray($current_company->getId(), TRUE);
        //Select box options;
        $data['over_time_options'] = $over_time_options;
        $data['absence_options'] = $absence_options;
        $data['meal_options'] = $meal_options;
        $data['break_options'] = $break_options;
        $smarty->assign_by_ref('data', $data);
        break;
}
$smarty->assign_by_ref('spf', $spf);
$smarty->display('policy/EditSchedulePolicy.tpl');