From f07a0ae5da54940c18e826e2fdd8a84d9993b172 Mon Sep 17 00:00:00 2001 From: Sander van den Akker Date: Mon, 26 Aug 2013 13:01:17 +0200 Subject: [PATCH 1/2] Implemented mandatory option for multiple choice entries. --- design/standard/templates/survey/edit/multiplechoice.tpl | 6 ++++++ design/standard/templates/survey/view/multiplechoice.tpl | 2 +- modules/survey/classes/ezsurveymultiplechoice.php | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/design/standard/templates/survey/edit/multiplechoice.tpl b/design/standard/templates/survey/edit/multiplechoice.tpl index 76ae469..b8fe2db 100644 --- a/design/standard/templates/survey/edit/multiplechoice.tpl +++ b/design/standard/templates/survey/edit/multiplechoice.tpl @@ -17,6 +17,12 @@ +
+ + +
+ diff --git a/design/standard/templates/survey/view/multiplechoice.tpl b/design/standard/templates/survey/view/multiplechoice.tpl index 8a839de..ffc3dec 100644 --- a/design/standard/templates/survey/view/multiplechoice.tpl +++ b/design/standard/templates/survey/view/multiplechoice.tpl @@ -1,4 +1,4 @@ - +
{def $attr_id=concat($prefix_attribute,'_ezsurvey_answer_id_',$question.id,'_', $attribute_id)} {def $attr_name=concat($prefix_attribute, '_ezsurvey_answer_' , $question.id, '_' , $attribute_id)} diff --git a/modules/survey/classes/ezsurveymultiplechoice.php b/modules/survey/classes/ezsurveymultiplechoice.php index a56ba8e..df0754e 100644 --- a/modules/survey/classes/ezsurveymultiplechoice.php +++ b/modules/survey/classes/ezsurveymultiplechoice.php @@ -316,6 +316,7 @@ function processViewActions( &$validation, $params ) $postSurveyAnswer = $prefix . '_ezsurvey_answer_' . $this->ID . '_' . $attributeID; if ( !$http->hasPostVariable( $postSurveyAnswer ) and + $this->attribute('mandatory') and $this->attribute( 'num' ) != 3 and // 3 - checkboxes in a row $this->attribute( 'num' ) != 4 ) // 4 - checkboxes in a column { From 64c1aa4ea488947647a9fd541741e93cba1364e3 Mon Sep 17 00:00:00 2001 From: Sander van den Akker Date: Mon, 26 Aug 2013 14:15:19 +0200 Subject: [PATCH 2/2] Re-enabled result removal. --- design/standard/templates/survey/rview.tpl | 3 +++ modules/survey/{rremove.php => result_remove.php} | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) rename modules/survey/{rremove.php => result_remove.php} (96%) diff --git a/design/standard/templates/survey/rview.tpl b/design/standard/templates/survey/rview.tpl index f563f5e..f376585 100644 --- a/design/standard/templates/survey/rview.tpl +++ b/design/standard/templates/survey/rview.tpl @@ -56,6 +56,9 @@
+
+ +
diff --git a/modules/survey/rremove.php b/modules/survey/result_remove.php similarity index 96% rename from modules/survey/rremove.php rename to modules/survey/result_remove.php index 53e0d43..38d076b 100644 --- a/modules/survey/rremove.php +++ b/modules/survey/result_remove.php @@ -5,7 +5,7 @@ // Created on: <10-Jun-2005 15:55:33 sp> // -// Copyright (C) 1999-2013 eZ Systems AS. All rights reserved. +// Copyright (C) 1999-2010 eZ Systems AS. All rights reserved. // // This source file is part of the eZ Publish (tm) Open Source Content // Management System.