예제 #1
0
 function postProcess()
 {
     $params = $this->controller->exportValues($this->_name);
     $startDate = CRM_Utils_Date::processDate($params['start_date'], null, false, 'Ymd');
     $endDate = CRM_Utils_Date::processDate($params['end_date'], null, false, 'Ymd');
     $includeMorning = CRM_Utils_Array::value('include_morning', $params, false);
     $showDetails = CRM_Utils_Array::value('show_details', $params, false);
     $notSignedOut = CRM_Utils_Array::value('not_signed_out', $params, false);
     $showBalances = CRM_Utils_Array::value('show_balances', $params, false);
     require_once 'SFS/Utils/ExtendedCare.php';
     if ($showBalances) {
         $showDetails = false;
         $summary =& SFS_Utils_ExtendedCare::balanceDetails();
     } else {
         $summary =& SFS_Utils_ExtendedCare::signoutDetails($startDate, $endDate, $includeMorning, $showDetails, $notSignedOut, $params['student_id']);
     }
     $this->assign('summary', $summary);
     $this->assign('showBalances', $showBalances);
     $this->assign('showDetails', $showDetails);
 }
예제 #2
0
 function view($id, $startDate, $endDate, $actionPermission, $calledByBrowse = false)
 {
     require_once 'SFS/Utils/ExtendedCare.php';
     $showSignoutDetails = true;
     if ($calledByBrowse) {
         // show recent 10 activities
         $details = SFS_Utils_ExtendedCare::signoutDetails(null, null, true, true, false, $id, 10);
     } else {
         $month = CRM_Utils_Request::retrieve('month', 'String', $this, false, date('m'));
         $year = CRM_Utils_Request::retrieve('year', 'String', $this, false, date('Y'));
         $detailStartDate = "{$year}{$month}01";
         $detailEndDate = "{$year}{$month}" . date("t", strtotime($year . "-" . $month . "-01"));
         $backButtonUrl = CRM_Utils_System::url(CRM_Utils_System::currentPath(), "reset=1&id={$id}&startDate={$startDate}&endDate={$endDate}");
         $this->assign('backButtonUrl', $backButtonUrl);
         $details = SFS_Utils_ExtendedCare::signoutDetails($detailStartDate, $detailEndDate, true, true, false, $id);
     }
     $signoutDetails = array_pop($details);
     if (!empty($signoutDetails) && $actionPermission) {
         foreach ($signoutDetails['details'] as $key => $value) {
             $signoutDetails['details'][$key]['action'] = CRM_Core_Action::formLink(self::actionLinks(), null, array('objectID' => $key, 'id' => $id, 'object' => 'signout'));
         }
     }
     $this->assign_by_ref('signoutDetail', $signoutDetails);
 }