2008-09-29 05:18:23 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Displays a summary of instances of a form submitted to the website
|
2009-04-15 00:59:46 +02:00
|
|
|
*
|
|
|
|
* @package userforms
|
2008-09-29 05:18:23 +02:00
|
|
|
*/
|
|
|
|
class SubmittedFormReportField extends FormField {
|
|
|
|
|
|
|
|
function Field() {
|
|
|
|
Requirements::css(SAPPHIRE_DIR . "/css/SubmittedFormReportField.css");
|
|
|
|
|
|
|
|
return $this->renderWith("SubmittedFormReportField");
|
|
|
|
}
|
|
|
|
|
2009-04-15 00:59:46 +02:00
|
|
|
/**
|
|
|
|
* Return the submissions from the site
|
|
|
|
*
|
|
|
|
* @return ComponentSet
|
|
|
|
*/
|
2008-09-29 05:18:23 +02:00
|
|
|
function Submissions() {
|
|
|
|
return $this->form->getRecord()->Submissions();
|
|
|
|
}
|
2008-09-29 07:33:43 +02:00
|
|
|
|
2009-04-15 00:59:46 +02:00
|
|
|
/**
|
|
|
|
* Link to the export function of the controller
|
|
|
|
*
|
|
|
|
* @return String
|
|
|
|
*/
|
2008-09-29 07:33:43 +02:00
|
|
|
function ExportLink() {
|
|
|
|
if($this->Submissions() && $this->Submissions()->Count() > 0) {
|
|
|
|
return $this->form->getRecord()->Link() . 'export/' . $this->form->getRecord()->ID;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-04-15 00:59:46 +02:00
|
|
|
/**
|
|
|
|
* Link to the delete the submission
|
|
|
|
*
|
|
|
|
* @return String
|
|
|
|
*/
|
|
|
|
function DeleteLink() {
|
|
|
|
if($this->Submissions() && $this->Submissions()->Count() > 0) {
|
|
|
|
return $this->form->getRecord()->Link() . 'deletesubmissions/' . $this->form->getRecord()->ID;
|
|
|
|
}
|
|
|
|
}
|
2008-09-29 05:18:23 +02:00
|
|
|
}
|
|
|
|
?>
|