function saveQueue()
 {
     if (is_array($this->queue)) {
         Debug::Arr($this->queue, 'Generic Status Queue', __FILE__, __LINE__, __METHOD__, 10);
         foreach ($this->queue as $key => $queue_data) {
             $ugsf = new UserGenericStatusFactory();
             $ugsf->setUser($this->getUser());
             if ($this->getBatchId() !== FALSE) {
                 $ugsf->setBatchID($this->getBatchID());
             } else {
                 $this->setBatchId($this->getNextBatchId());
             }
             $ugsf->setLabel($queue_data['label']);
             $ugsf->setStatus($queue_data['status']);
             $ugsf->setDescription($queue_data['description']);
             $ugsf->setLink($queue_data['link']);
             if ($ugsf->isValid()) {
                 $ugsf->Save();
                 unset($this->queue[$key]);
             }
         }
         return TRUE;
     }
     Debug::Text('Generic Status Queue Empty', __FILE__, __LINE__, __METHOD__, 10);
     return FALSE;
 }
Example #2
0
                     }
                     //Debug::Text('Setting Percent: '. Misc::calculatePercent( $x, $total_shifts ), __FILE__, __LINE__, __METHOD__,10);
                     $progress_bar->setValue(Misc::calculatePercent($x, $total_shifts));
                     $progress_bar->display();
                     $x++;
                 }
             } else {
                 Debug::Text(' Skipping Day Of Week: (' . TTDate::getDayOfWeek($time_stamp) . ') ' . TTDate::getDate('DATE+TIME', $time_stamp), __FILE__, __LINE__, __METHOD__, 10);
                 $x++;
             }
             $time_stamp = $time_stamp + 86400;
         }
         //$sf->FailTransaction();
         $sf->CommitTransaction();
         $ugsf = new UserGenericStatusFactory();
         $ugsf->setUser($current_user->getId());
         $ugsf->setBatchID($ugsf->getNextBatchId());
         $ugsf->setQueue(UserGenericStatusFactory::getStaticQueue());
         $ugsf->saveQueue();
         $progress_bar->setValue(100);
         $progress_bar->display();
         $next_page = URLBuilder::getURL(array('batch_id' => $ugsf->getBatchID(), 'batch_title' => 'Mass Schedule', 'batch_next_page' => urlencode(URLBuilder::getURL(array('data' => $data, 'filter_user_id' => $filter_user_id), '../schedule/AddMassSchedule.php'))), '../users/UserGenericStatusList.php');
     }
     break;
 case 'recalculate_accrual_policy':
     //Debug::setVerbosity(11);
     if (isset($data['accrual_policy_id']) and isset($data['start_date']) and isset($data['end_date'])) {
         if ($data['start_date'] <= $data['end_date']) {
             $start_date = TTDate::getBeginDayEpoch($data['start_date']);
             $end_date = TTDate::getBeginDayEpoch($data['end_date']);
             $total_days = TTDate::getDays($end_date - $start_date);