Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/LimeSurvey/LimeSurvey
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Apr 15, 2016
2 parents 48c4ab5 + 17e8afc commit fdb7e6a
Show file tree
Hide file tree
Showing 15 changed files with 203 additions and 91 deletions.
2 changes: 1 addition & 1 deletion application/config/version.php
Expand Up @@ -16,7 +16,7 @@
$config['dbversionnumber'] = 258;
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['assetsversionnumber'] = 2;
$config['assetsversionnumber'] = 3;
//$config['updaterversion'] = 1;
return $config;

Expand Down
2 changes: 1 addition & 1 deletion application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -420,7 +420,7 @@ function run($surveyid,$args)
{
buildsurveysession($surveyid);


if($surveyid != LimeExpressionManager::getLEMsurveyId())
LimeExpressionManager::SetDirtyFlag();

Expand Down
41 changes: 32 additions & 9 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -6363,7 +6363,10 @@ function _ValidateQuestion($questionSeq,$force=false)
$mandatoryTip = '';
if ($qrel && !$qhidden && ($qInfo['mandatory'] == 'Y'))
{
$mandatoryTip = "<p class='errormandatory alert alert-danger' role='alert'><span class='glyphicon glyphicon-exclamation-sign'></span>&nbsp" . $LEM->gT('This question is mandatory') . "</p>";
//$mandatoryTip = "<p class='errormandatory alert alert-danger' role='alert'><span class='glyphicon glyphicon-exclamation-sign'></span>&nbsp" . $LEM->gT('This question is mandatory') . "</p>";
$mandatoryTip = Yii::app()->getController()->renderPartial('/survey/system/questionhelp/mandatory_tip', array(
'sMandatoryText'=>$LEM->gT('This question is mandatory'),
), true);
switch ($qInfo['type'])
{
case 'M':
Expand All @@ -6377,7 +6380,10 @@ function _ValidateQuestion($questionSeq,$force=false)
}
if (!($qInfo['type'] == '!' || $qInfo['type'] == 'L'))
{
$mandatoryTip .= $LEM->gT('Please check at least one item.');
$sMandatoryText .= $LEM->gT('Please check at least one item.');
$mandatoryTip .= Yii::app()->getController()->renderPartial('/survey/system/questionhelp/mandatory_tip', array(
'sMandatoryText'=>$sMandatoryText,
), true);
}
if ($qInfo['other']=='Y')
{
Expand All @@ -6388,7 +6394,12 @@ function _ValidateQuestion($questionSeq,$force=false)
else {
$othertext = $LEM->gT('Other:');
}
$mandatoryTip .= "\n".sprintf($this->gT("If you choose '%s' please also specify your choice in the accompanying text field."),$othertext);
//$mandatoryTip .= "\n".sprintf($this->gT("If you choose '%s' please also specify your choice in the accompanying text field."),$othertext);
$sMandatoryText = "\n".sprintf($this->gT("If you choose '%s' please also specify your choice in the accompanying text field."),$othertext);
$mandatoryTip .= Yii::app()->getController()->renderPartial('/survey/system/questionhelp/mandatory_tip', array(
'sMandatoryText'=>$sMandatoryText,
), true);

}
break;
case 'X': // Boilerplate can never be mandatory
Expand All @@ -6410,7 +6421,10 @@ function _ValidateQuestion($questionSeq,$force=false)
{
$qmandViolation = true; // TODO - what about 'other'?
}
$mandatoryTip .= $LEM->gT('Please complete all parts').'.';
$sMandatoryText = $LEM->gT('Please complete all parts').'.';
$mandatoryTip .= Yii::app()->getController()->renderPartial('/survey/system/questionhelp/mandatory_tip', array(
'sMandatoryText'=>$sMandatoryText,
), true);
break;
case ':':
$qattr = isset($LEM->qattr[$qid]) ? $LEM->qattr[$qid] : array();
Expand Down Expand Up @@ -6439,23 +6453,33 @@ function _ValidateQuestion($questionSeq,$force=false)
}
}
}
$mandatoryTip .= $LEM->gT('Please check at least one box per row').'.';
$sMandatoryText = $LEM->gT('Please check at least one box per row').'.';
$mandatoryTip .= Yii::app()->getController()->renderPartial('/survey/system/questionhelp/mandatory_tip', array(
'sMandatoryText'=>$sMandatoryText,
), true);

}
else
{
if (count($unansweredSQs) > 0)
{
$qmandViolation = true; // TODO - what about 'other'?
}
$mandatoryTip .= $LEM->gT('Please complete all parts').'.';
$sMandatoryText = $LEM->gT('Please complete all parts').'.';
$mandatoryTip .= Yii::app()->getController()->renderPartial('/survey/system/questionhelp/mandatory_tip', array(
'sMandatoryText'=>$sMandatoryText,
), true);
}
break;
case 'R':
if (count($unansweredSQs) > 0)
{
$qmandViolation = true; // TODO - what about 'other'?
}
$mandatoryTip .= $LEM->gT('Please rank all items').'.';
$sMandatoryText = $LEM->gT('Please rank all items').'.';
$mandatoryTip .= Yii::app()->getController()->renderPartial('/survey/system/questionhelp/mandatory_tip', array(
'sMandatoryText'=>$sMandatoryText,
), true);
break;
case 'O': //LIST WITH COMMENT drop-down/radio-button list + textarea
$_count=0;
Expand All @@ -6477,8 +6501,7 @@ function _ValidateQuestion($questionSeq,$force=false)
$qmandViolation = true;
}
break;
}
$mandatoryTip .= "</span></strong>\n";
}
}

/////////////////////////////////////////////////////////////
Expand Down
12 changes: 7 additions & 5 deletions application/helpers/qanda_helper.php
Expand Up @@ -287,9 +287,11 @@ function retrieveAnswers($ia)

if ($ia[6] == 'Y')
{
$qtitle = Yii::app()->getController()->renderPartial('/survey/question_help/asterisk', array(), true);
$qtitle .= $qtitle;
$question_text['mandatory'] = gT('*');

//$qtitle .= Yii::app()->getController()->renderPartial('/survey/question_help/asterisk', array(), true);
//$qtitle .= $qtitle;
//$question_text['mandatory'] = gT('*');
$question_text['mandatory'] = Yii::app()->getController()->renderPartial('/survey/question_help/asterisk', array(), true);
}

//If this question is mandatory but wasn't answered in the last page
Expand Down Expand Up @@ -4875,7 +4877,7 @@ function do_array_multitext($ia)
$q_table_id = 'totals_'.$ia[0];
$q_table_id_HTML = ' id="'.$q_table_id.'"';
}

$num_class = ' numbers-only';
$extraclass .= " numberonly";
$caption .= gT("Each answer is a number. ");
Expand Down Expand Up @@ -5929,7 +5931,7 @@ function do_array_dual($ia)

array_push($inputnames, $myfname0);

if (isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname0]))
if (isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname0]))
{
$aData['aSubQuestions'][$i]['sessionfname0'] = $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname0];
}
Expand Down
4 changes: 2 additions & 2 deletions application/views/admin/survey/editLocalSettings_view.php
Expand Up @@ -70,7 +70,7 @@
<div class="form-group">
<label class="control-label col-sm-2"><?php eT("Date format:"); ?></label>

<div class="col-sm-9">
<div class="col-sm-3">
<select size='1' id='dateformat_<?php echo $esrow['surveyls_language']; ?>' name='dateformat_<?php echo $esrow['surveyls_language']; ?>' class="form-control">
<?php foreach (getDateFormatData(0,Yii::app()->session['adminlang']) as $index=>$dateformatdata): ?>
<option value='<?php echo $index; ?>'
Expand All @@ -86,7 +86,7 @@
<!-- Decimal mark -->
<div class="form-group">
<label class="control-label col-sm-2"><?php eT("Decimal mark:"); ?></label>
<div class="col-sm-9">
<div class="col-sm-3">
<select size='1' id='numberformat_<?php echo $esrow['surveyls_language']; ?>' name='numberformat_<?php echo $esrow['surveyls_language']; ?>' class="form-control">
<?php foreach (getRadixPointData() as $index=>$radixptdata): ?>
<option value='<?php echo $index; ?>'
Expand Down
Expand Up @@ -21,12 +21,12 @@
<div class="modal-body">
<input type='hidden' name='surveyid' value='<?php echo $surveyid; ?>' />
<input type='hidden' name='action' value='importsurveyresources' />
<label for='the_file'><?php eT("Select ZIP File:"); ?></label>
<label for='the_file'><?php eT("Select ZIP file:"); ?></label>
<input id='the_file' name='the_file' type='file' />
</div>

<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-danger" data-dismiss="modal"><?php eT("Close");?></button>
<input type='button' class="btn btn-default" value='<?php eT("Import resources ZIP archive"); ?>' <?php echo $ZIPimportAction; ?> />
</div>
</form>
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion application/views/survey/question_help/asterisk.php
Expand Up @@ -3,4 +3,4 @@
* This file render the asterisk for mandatory questions
*/
?>
<span class="asterisk"><?php gT('*'); ?></span>;
<span class="text-danger asterisk"></span>
2 changes: 1 addition & 1 deletion application/views/survey/question_help/help.php
Expand Up @@ -4,6 +4,6 @@
* @var $message
*/
?>
<div class="alert alert-info questionhelp <?php echo $classes; ?>" role="alert" <?php if(isset($id)):?> id="<?php echo $id;?>" <?php endif;?> >
<div class="text-info questionhelp <?php echo $classes; ?>" role="alert" <?php if(isset($id)):?> id="<?php echo $id;?>" <?php endif;?> >
<?php echo $message;?>
</div>
10 changes: 10 additions & 0 deletions application/views/survey/system/questionhelp/mandatory_tip.php
@@ -0,0 +1,10 @@
<?php
/**
* render the error text when user submit a page without filling a mandatory question
* called from em_manager_helper
*/
?>
<p class='errormandatory text-danger' role='alert'>
<span class='glyphicon glyphicon-exclamation-sign'></span>
<?php echo $sMandatoryText; ?>
</p>
Expand Up @@ -5,7 +5,7 @@
*/
?>
<!-- views/survey/system/questionhelp -->
<div class="alert alert-info questionhelp">
<div class="text-info questionhelp">
<span class="glyphicon glyphicon-question-sign"></span>
&nbsp;<?php echo $questionHelp; ?>
</div>
1 change: 1 addition & 0 deletions application/views/survey/system/questionhelp/tips.php
Expand Up @@ -7,6 +7,7 @@
*/
?>
<div id='vmsg_<?php echo $qid; ?>_<?php echo $vclass; ?>' class='em_<?php echo $vclass; ?> emtip '>

<span class='glyphicon glyphicon-info-sign'></span>
&nbsp;<?php echo $vtip; ?>
</div>
89 changes: 88 additions & 1 deletion templates/default/css/template.css
Expand Up @@ -7,7 +7,6 @@
div[id^="group-"]>div {
background-color: #fff;
margin-bottom: 1em;
border: none;
}

div[id^="group-"]>div.group-container {
Expand Down Expand Up @@ -787,3 +786,91 @@ table.numbers-only th, table.numbers-only input {
.geoname_search {
margin-bottom: 10px;
}




/** Question Design **/

body div.row .question-container {
margin-bottom: 2em;
}

.answer-container, .question-help-container
{
border-color: #dbdbdb;
border-style: solid;
}

.answer-container
{
border-width: 0px 1px 0px 1px;
padding-top: 3em;
background-color: white;
}

.question-help-container
{
border-width: 0px 1px 1px 1px;
padding-bottom: 5px;
}


/** Header **/
.question-title-container, .questionvalidcontainer {
background-color: #233140;
}

.question-title-container {
color: white;
padding: 2em 1em 1em 1em;

}

.questionvalidcontainer {
position: relative;
text-align: center;
padding-bottom: 1em;
}

.questionvalidcontainer .text-danger{
color: #E75041;
font-weight: bold;
}

.questionvalidcontainer .text-info{
color: #B9CC14;
font-weight: bold;
}

/* Arrow */
.questionvalidcontainer:after {
top: 100%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-top-color: #233140;
border-width: 0.9em;
margin-left: -0.9em;
}

/* Asterix */
.asterisk {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.asterisk:before {
content: "\f069";
}

.input-error {
border: 1px solid #E75041;
}

0 comments on commit fdb7e6a

Please sign in to comment.