Пример #1
0
 function getScheduleObject()
 {
     if (is_object($this->schedule_obj)) {
         return $this->schedule_obj;
     } else {
         if ($this->getScheduleID() !== FALSE) {
             $slf = new ScheduleListFactory();
             $slf->getById($this->getScheduleID());
             if ($slf->getRecordCount() > 0) {
                 $this->schedule_obj = $slf->getCurrent();
                 return $this->schedule_obj;
             }
         }
         return FALSE;
     }
 }
Пример #2
0
             $fail_transaction = TRUE;
         }
     }
     if ($fail_transaction == FALSE) {
         //$sf->FailTransaction();
         $sf->CommitTransaction();
         Redirect::Page(URLBuilder::getURL(array('refresh' => TRUE), '../CloseWindow.php'));
         break;
     } else {
         $sf->FailTransaction();
     }
 default:
     if ($id != '') {
         Debug::Text(' ID was passed: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
         $slf = new ScheduleListFactory();
         $slf->getById($id);
         foreach ($slf as $s_obj) {
             //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);
             $data = array('id' => $s_obj->getId(), 'user_date_id' => $s_obj->getUserDateId(), 'user_id' => $s_obj->getUserDateObject()->getUser(), 'user_full_name' => $s_obj->getUserDateObject()->getUserObject()->getFullName(), 'date_stamp' => $s_obj->getUserDateObject()->getDateStamp(), 'status_id' => $s_obj->getStatus(), 'start_time' => $s_obj->getStartTime(), 'parsed_start_time' => $s_obj->getStartTime(), 'end_time' => $s_obj->getEndTime(), 'parsed_end_time' => $s_obj->getEndTime(), 'total_time' => $s_obj->getTotalTime(), 'schedule_policy_id' => $s_obj->getSchedulePolicyID(), 'absence_policy_id' => $s_obj->getAbsencePolicyID(), 'branch_id' => $s_obj->getBranch(), 'department_id' => $s_obj->getDepartment(), 'job_id' => $s_obj->getJob(), 'job_item_id' => $s_obj->getJobItem(), 'pay_period_is_locked' => $s_obj->getUserDateObject()->getPayPeriodObject()->getIsLocked(), 'created_date' => $s_obj->getCreatedDate(), 'created_by' => $s_obj->getCreatedBy(), 'updated_date' => $s_obj->getUpdatedDate(), 'updated_by' => $s_obj->getUpdatedBy(), 'deleted_date' => $s_obj->getDeletedDate(), 'deleted_by' => $s_obj->getDeletedBy(), 'is_owner' => $permission->isOwner($s_obj->getUserDateObject()->getUserObject()->getCreatedBy(), $s_obj->getUserDateObject()->getUserObject()->getId()), 'is_child' => $permission->isChild($s_obj->getUserDateObject()->getUserObject()->getId(), $permission_children_ids));
         }
     } elseif ($action != 'submit') {
         Debug::Text(' ID was NOT passed: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
         //Get user full name
         if ($user_id != '') {
             $ulf = new UserListFactory();
             $user_obj = $ulf->getById($user_id)->getCurrent();
             $user_full_name = $user_obj->getFullName();
             $user_default_branch = $user_obj->getDefaultBranch();
             $user_default_department = $user_obj->getDefaultDepartment();
             $user_date_id = UserDateFactory::getUserDateID($user_id, $date_stamp);
             $pplf = new PayPeriodListFactory();