|
From: <gem...@li...> - 2012-07-30 08:43:09
|
Revision: 884
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=884&view=rev
Author: mennodekker
Date: 2012-07-30 08:42:58 +0000 (Mon, 30 Jul 2012)
Log Message:
-----------
Created extra snippet for export: SurveyHeaderSnippet to allow having more or less information on a survey. Added round description.
Modified Paths:
--------------
trunk/library/classes/Gems/Export/RespondentExport.php
Added Paths:
-----------
trunk/library/classes/Gems/Snippets/Export/SurveyHeaderSnippet.php
Modified: trunk/library/classes/Gems/Export/RespondentExport.php
===================================================================
--- trunk/library/classes/Gems/Export/RespondentExport.php 2012-07-27 12:08:05 UTC (rev 883)
+++ trunk/library/classes/Gems/Export/RespondentExport.php 2012-07-30 08:42:58 UTC (rev 884)
@@ -170,7 +170,7 @@
}
if ($engine->getTrackType() == 'S' || !$groupSurveys) {
- $this->html->div($token->getSurveyName(), array('class'=>'surveyTitle'));
+ $this->html->snippet('Export_SurveyHeaderSnippet', 'token', $token);
$this->html->snippet($this->_singleSurveySnippet, 'token', $token, 'tokenId', $token->getTokenId(),
'showHeaders', false, 'showButtons', false, 'showSelected', false, 'showTakeButton', false);
@@ -179,7 +179,7 @@
if (!isset($surveys[$token->getSurveyId()])) {
$surveys[$token->getSurveyId()] = true;
- $this->html->div($token->getSurveyName(), array('class'=>'surveyTitle'));
+ $this->html->snippet('Export_SurveyHeaderSnippet', 'token', $token);
$this->html->snippet($this->_groupedSurveySnippet, 'token', $token, 'tokenId', $token->getTokenId(),
'showHeaders', false, 'showButtons', false, 'showSelected', false, 'showTakeButton', false);
Added: trunk/library/classes/Gems/Snippets/Export/SurveyHeaderSnippet.php
===================================================================
--- trunk/library/classes/Gems/Snippets/Export/SurveyHeaderSnippet.php (rev 0)
+++ trunk/library/classes/Gems/Snippets/Export/SurveyHeaderSnippet.php 2012-07-30 08:42:58 UTC (rev 884)
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Copyright (c) 2011, Erasmus MC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Erasmus MC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * @package Gems
+ * @subpackage Snippets
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @version $Id: Sample.php 215 2011-07-12 08:52:54Z michiel $
+ */
+
+/**
+ * Header for html/pdf export of a survey
+ *
+ * @package Gems
+ * @subpackage Snippets
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.6
+ */
+class Gems_Snippets_Export_SurveyHeaderSnippet extends MUtil_Snippets_SnippetAbstract
+{
+ /**
+ * @var Gems_Tracker_Token
+ */
+ public $token;
+
+ public function getHtmlOutput(Zend_View_Abstract $view)
+ {
+ $html = $this->getHtmlSequence();
+ $html->div($this->token->getSurveyName(), array('class'=>'surveyTitle'));
+ $html->div($this->token->getRoundDescription(), array('class'=>'roundDescription'));
+
+ return $html;
+ }
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|