コード例 #1
0
ファイル: Calendar.class.php プロジェクト: Niggu/cloudrexx
 /**
  * Display the success page
  * 
  * @return null
  */
 function showSuccessPage()
 {
     $this->_objTpl->setTemplate($this->pageContent, true, true);
     if ($_REQUEST["handler"] == "yellowpay") {
         $orderId = \Yellowpay::getOrderId();
         $this->getSettings();
         if (\Yellowpay::checkin($this->arrSettings["paymentYellowpayShaOut"])) {
             switch (abs($_REQUEST["result"])) {
                 case 2:
                     // fehler aufgetreten
                     $objRegistration = new \Cx\Modules\Calendar\Controller\CalendarRegistration(null);
                     $objRegistration->delete($orderId);
                     $this->_objTpl->touchBlock("cancelMessage");
                     break;
                 case 1:
                     // erfolgreich
                     $objRegistration = new \Cx\Modules\Calendar\Controller\CalendarRegistration(null);
                     $objRegistration->get($orderId);
                     $objRegistration->setPaid(1);
                     $this->_objTpl->touchBlock("successMessage");
                     break;
                 case 0:
                     // abgebrochen
                     $objRegistration = new \Cx\Modules\Calendar\Controller\CalendarRegistration(null);
                     $objRegistration->delete($orderId);
                     $this->_objTpl->touchBlock("cancelMessage");
                     break;
                 default:
                     \Cx\Core\Csrf\Controller\Csrf::redirect("index.php?section=" . $this->moduleName);
                     break;
             }
         } else {
             \Cx\Core\Csrf\Controller\Csrf::redirect("index.php?section=" . $this->moduleName);
             return;
         }
     } else {
         \Cx\Core\Csrf\Controller\Csrf::redirect("index.php?section=" . $this->moduleName);
         return;
     }
 }
コード例 #2
0
 /**
  * Perform the event registration
  *
  * @param integer $eventId Event id
  *
  * @return null
  */
 function showEventRegistrations($eventId)
 {
     global $_ARRAYLANG;
     $this->_objTpl->loadTemplateFile('module_calendar_registrations.html');
     $objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent(intval($eventId));
     $getTpl = isset($_GET['tpl']) ? $_GET['tpl'] : 'r';
     if (isset($_GET['delete'])) {
         $objRegistration = new \Cx\Modules\Calendar\Controller\CalendarRegistration($objEvent->registrationForm, $_GET['delete']);
         $status = $objRegistration->delete($_GET['delete']) ? true : false;
         $messageVar = 'DELETED';
     }
     if (isset($_GET['multi'])) {
         \Permission::checkAccess(180, 'static');
         foreach ($_POST['selectedRegistrationId'] as $regId) {
             $objRegistration = new \Cx\Modules\Calendar\Controller\CalendarRegistration($objEvent->registrationForm, $regId);
             switch ($_GET['multi']) {
                 case 'r':
                     $status = $objRegistration->move($regId, 1) ? true : false;
                     $messageVar = 'MOVED';
                     break;
                 case 'd':
                     $status = $objRegistration->move($regId, 0) ? true : false;
                     $messageVar = 'MOVED';
                     break;
                 case 'w':
                     $status = $objRegistration->move($regId, 2) ? true : false;
                     $messageVar = 'MOVED';
                     break;
                 case 'delete':
                     $status = $objRegistration->delete($regId) ? true : false;
                     $messageVar = 'DELETED';
                     break;
             }
         }
     }
     if ($status) {
         $this->okMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_SUCCESSFULLY_' . $messageVar];
     } else {
         $this->errMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_CORRUPT_' . $messageVar];
     }
     $this->_objTpl->setGlobalVariable(array('TXT_' . $this->moduleLangVar . '_REGISTRATIONS' => $_ARRAYLANG['TXT_CALENDAR_REGISTRATIONS'], 'TXT_' . $this->moduleLangVar . '_DEREGISTRATIONS' => $_ARRAYLANG['TXT_CALENDAR_DEREGISTRATIONS'], 'TXT_' . $this->moduleLangVar . '_WAITLIST' => $_ARRAYLANG['TXT_CALENDAR_WAITLIST'], 'TXT_' . $this->moduleLangVar . '_CONFIRM_DELETE_DATA' => $_ARRAYLANG['TXT_CALENDAR_CONFIRM_DELETE_DATA'], 'TXT_' . $this->moduleLangVar . '_ACTION_IS_IRREVERSIBLE' => $_ARRAYLANG['TXT_CALENDAR_ACTION_IS_IRREVERSIBLE'], 'TXT_' . $this->moduleLangVar . '_MAKE_SELECTION' => $_ARRAYLANG['TXT_CALENDAR_MAKE_SELECTION'], 'TXT_' . $this->moduleLangVar . '_BACK' => $_ARRAYLANG['TXT_CALENDAR_BACK'], 'TXT_' . $this->moduleLangVar . '_NO_REGISTRATIONS' => $_ARRAYLANG['TXT_CALENDAR_NO_REGISTRATIONS'], 'TXT_' . $this->moduleLangVar . '_SUBSCRIPTIONS' => $_ARRAYLANG['TXT_CALENDAR_SUBSCRIPTIONS'], 'TXT_' . $this->moduleLangVar . '_ADD' => $_ARRAYLANG['TXT_CALENDAR_ADD'], 'TXT_' . $this->moduleLangVar . '_EXPORT' => $_ARRAYLANG['TXT_CALENDAR_EXPORT'], 'TXT_SUBMIT_SELECT' => $_ARRAYLANG['TXT_SUBMIT_SELECT'], 'TXT_SUBMIT_MOVE' => $_ARRAYLANG['TXT_SUBMIT_MOVE'], 'TXT_SELECT_ALL' => $_ARRAYLANG['TXT_SELECT_ALL'], 'TXT_DESELECT_ALL' => $_ARRAYLANG['TXT_DESELECT_ALL'], 'TXT_SUBMIT_DELETE' => $_ARRAYLANG['TXT_SUBMIT_DELETE'], $this->moduleLangVar . '_EVENT_ID' => $eventId, $this->moduleLangVar . '_REGISTRATION_ID' => $regId, $this->moduleLangVar . '_REGISTRATION_' . strtoupper($getTpl) . '_CONTAINER_CLASS' => 'active'));
     $tplArr = array('r', 'd', 'w');
     foreach ($tplArr as $tpl) {
         $r = $d = $w = false;
         switch ($tpl) {
             case 'r':
                 $r = true;
                 $title = $_ARRAYLANG['TXT_CALENDAR_REGISTRATIONS'];
                 $containerId = 'registration';
                 $containerDisplay = $getTpl == 'r';
                 break;
             case 'd':
                 $d = true;
                 $title = $_ARRAYLANG['TXT_CALENDAR_DEREGISTRATIONS'];
                 $containerId = 'deregistration';
                 $containerDisplay = $getTpl == 'd';
                 break;
             case 'w':
                 $w = true;
                 $title = $_ARRAYLANG['TXT_CALENDAR_WAITLIST'];
                 $containerId = 'waitlist';
                 $containerDisplay = $getTpl == 'w';
                 break;
             default:
                 break;
         }
         $filterStartTimeStamp = $filterEndTimeStamp = false;
         if (isset($_GET['date']) && $containerDisplay) {
             $filterYear = $filterMonth = $filterDate = 0;
             list($filterYear, $filterMonth, $filterDate) = explode('-', $_GET['date']);
             $filterStartYear = !empty($filterYear) ? $filterYear : date('Y');
             $filterStartMonth = !empty($filterMonth) ? $filterMonth : 1;
             $filterStartDay = !empty($filterDate) ? $filterDate : 1;
             $filterStartDateTime = new \DateTime();
             $filterStartDateTime->setDate($filterStartYear, $filterStartMonth, $filterStartDay);
             $filterStartDateTime->setTime(0, 0, 0);
             $filterEndYear = !empty($filterYear) ? $filterYear : date('Y');
             $filterEndMonth = !empty($filterMonth) ? $filterMonth : 12;
             $filterEndDay = !empty($filterDate) ? $filterDate : 1;
             $filterEndDateTime = new \DateTime();
             $filterEndDateTime->setDate($filterEndYear, $filterEndMonth, $filterEndDay);
             if (empty($filterDate)) {
                 $filterEndDateTime->modify('last day of this month');
             }
             $filterEndDateTime->setTime(23, 59, 59);
             $filterStartTimeStamp = $filterStartDateTime->getTimestamp();
             $filterEndTimeStamp = $filterEndDateTime->getTimestamp();
         }
         $objRegistrationManager = new \Cx\Modules\Calendar\Controller\CalendarRegistrationManager($objEvent, $r, $d, $w, $filterStartTimeStamp, $filterEndTimeStamp, $containerDisplay);
         $objRegistrationManager->getRegistrationList();
         $objRegistrationManager->showRegistrationList($this->_objTpl, $tpl);
         $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_TPL' => $tpl, 'TXT_' . $this->moduleLangVar . '_REGISTRATIONS_TITLE' => $title, $this->moduleLangVar . '_REGISTRATION_LIST_CONTAINER_ID' => $containerId, $this->moduleLangVar . '_REGISTRATION_LIST_CONTAINER_DISPLAY' => $containerDisplay ? 'block' : 'none'));
         $this->_objTpl->parse("calendar_registration_lists");
     }
 }