* @link http://www.openeyes.org.uk
*
* @author OpenEyes <*****@*****.**>
* @copyright Copyright (c) 2008-2011, Moorfields Eye Hospital NHS Foundation Trust
* @copyright Copyright (c) 2011-2012, OpenEyes Foundation
* @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0
*/
?>
<?php
$service = new OphCoTherapyapplication_Processor($this->event);
$status = $service->getApplicationStatus();
$warnings = $service->getProcessWarnings();
if (!$warnings && !$this->event->isLocked()) {
if ($status != $service::STATUS_SENT) {
$nonCompliant = $service->isEventNonCompliant();
if ($nonCompliant) {
$preview_button = EventAction::link('Preview Application', $this->createUrl('previewApplication', array('event_id' => $this->event->id)), null, array('id' => 'application-preview', 'class' => 'button small'));
$submit_button_text = 'Submit Application';
} else {
$preview_button = EventAction::button('Preview Application', null, array('disabled' => true), array('title' => 'Preview unavailable for NICE compliant applications', 'class' => 'button small'));
$submit_button_text = 'Submit Notification';
}
if ($this->checkPrintAccess()) {
$this->event_actions[] = $preview_button;
}
if ($this->checkEditAccess()) {
$url = '#';
if ($service->hasEmailRecipients()) {
$submitButtonStyles = array('class' => 'button small');
$url = $this->createUrl('processApplication', array('event_id' => $this->event->id));