public function PageLoad() { $this->presenter->PageLoad(ServiceLocator::GetServer()->GetUserSession()); header("Content-Type: text/Calendar"); header("Content-Disposition: inline; filename=calendar.ics"); $display = new CalendarExportDisplay(); echo $display->Render($this->reservations); }
public function testCannotSeeReservationDetailsIfConfiguredOff() { $referenceNumber = 'ref'; $reservationResult = new ReservationView(); $this->validator->expects($this->atLeastOnce())->method('IsValid')->will($this->returnValue(true)); $this->page->expects($this->once())->method('GetReferenceNumber')->will($this->returnValue($referenceNumber)); $this->repo->expects($this->once())->method('GetReservationForEditing')->with($this->equalTo($referenceNumber))->will($this->returnValue($reservationResult)); $this->page->expects($this->once())->method('SetReservations')->with($this->arrayHasKey(0)); $this->presenter->PageLoad($this->fakeUser); }
public function PageLoad() { $this->presenter->PageLoad(ServiceLocator::GetServer()->GetUserSession()); header("Content-Type: text/Calendar"); header("Content-Disposition: inline; filename=calendar.ics"); $config = Configuration::Instance(); $this->Set('bookedVersion', $config->GetKey(ConfigKeys::VERSION)); $this->Set('DateStamp', Date::Now()); /** * ScriptUrl is used to generate iCal UID's. As a workaround to this bug * https://bugzilla.mozilla.org/show_bug.cgi?id=465853 * we need to avoid using any slashes "/" */ $url = $config->GetScriptUrl(); $this->Set('ScriptUrl', parse_url($url, PHP_URL_HOST)); $this->Display('Export/ical.tpl'); }