Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Nov 21, 2022
2 parents 6fe7525 + deff34f commit fc9f661
Show file tree
Hide file tree
Showing 239 changed files with 10,900 additions and 404 deletions.
29 changes: 29 additions & 0 deletions application/config/fonts.php
Expand Up @@ -101,6 +101,35 @@
),
),

'font-opensans' => array(
'title' => 'Open Sans',
'type' => 'core',
'devBaseUrl' => 'assets/fonts/',
'basePath' => 'fonts',
'css' => array(
'opensans.css',
),
),

'font-raleway' => array(
'title' => 'Raleway',
'type' => 'core',
'devBaseUrl' => 'assets/fonts/',
'basePath' => 'fonts',
'css' => array(
'raleway.css',
),
),

'font-source-sans-pro' => array(
'title' => 'Source Sans Pro',
'type' => 'core',
'devBaseUrl' => 'assets/fonts/',
'basePath' => 'fonts',
'css' => array(
'source-sans-pro.css',
),
),
);

// get user fonts configuration from /upload/fonts directory
Expand Down
2 changes: 1 addition & 1 deletion application/config/updater_version.php
Expand Up @@ -17,5 +17,5 @@

$config['updaterversion'] = 16;
$config['comfort_update_server_url'] = 'comfortupdate.limesurvey.org/';
$config['comfort_update_server_ssl'] = 0;
$config['comfort_update_server_ssl'] = 1;
return $config;
2 changes: 1 addition & 1 deletion application/config/version.php
Expand Up @@ -16,5 +16,5 @@
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['templateapiversion'] = 3;
$config['assetsversionnumber'] = '30306';
$config['assetsversionnumber'] = '30307';
return $config;
Expand Up @@ -210,7 +210,7 @@ private function getChildQuestions(array $questions)
}

$shortquestion = $row['title'] . ": " . flattenText($question);
$cquestions[] = array($shortquestion, $row['qid'], $row['type'], $row['fieldname'], $row['previouspage']);
$cquestions[] = array($shortquestion, $row['qid'], $row['type'], $row['fieldname'], $row['previouspage'], $row['title']);
}
return $cquestions;
}
Expand Down
1 change: 1 addition & 0 deletions application/core/LSYii_ImageValidator.php
Expand Up @@ -60,6 +60,7 @@ public static function validateImage($file)
"image/ico",
"image/gif",
"image/svg+xml",
"image/svg",
"image/x-icon",
"image/vnd.microsoft.icon"
);
Expand Down
7 changes: 3 additions & 4 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -3399,9 +3399,9 @@ public function setVariableAndTokenMappingsForExpressionManager($surveyid, $forc
}

$questionNum = $fielddata['qid'];
$relevance = (isset($fielddata['relevance'])) ? $fielddata['relevance'] : 1;
$SQrelevance = (isset($fielddata['SQrelevance'])) ? $fielddata['SQrelevance'] : 1;
$grelevance = (isset($fielddata['grelevance'])) ? $fielddata['grelevance'] : 1;
$relevance = (isset($fielddata['relevance'])) ? trim($fielddata['relevance']) : 1;
$SQrelevance = (isset($fielddata['SQrelevance'])) ? trim($fielddata['SQrelevance']) : 1;
$grelevance = (isset($fielddata['grelevance'])) ? trim($fielddata['grelevance']) : 1;
$hidden = (isset($qattr[$questionNum]['hidden'])) ? ($qattr[$questionNum]['hidden'] == '1') : false;
$scale_id = (isset($fielddata['scale_id'])) ? $fielddata['scale_id'] : '0';
$preg = (isset($fielddata['preg'])) ? $fielddata['preg'] : null; // a perl regular exrpession validation function
Expand Down Expand Up @@ -4252,7 +4252,6 @@ private function _ProcessRelevance($eqn, $questionNum = null, $gseq = null, $jsR
$questionSeq = isset($this->questionId2questionSeq[$questionNum]) ? $this->questionId2questionSeq[$questionNum] : -1;
$groupSeq = isset($this->questionId2groupSeq[$questionNum]) ? $this->questionId2groupSeq[$questionNum] : -1;
}

$stringToParse = htmlspecialchars_decode($eqn, ENT_QUOTES);
$result = $this->em->ProcessBooleanExpression($stringToParse, $groupSeq, $questionSeq);
$hasErrors = $this->em->HasErrors();
Expand Down
3 changes: 2 additions & 1 deletion application/models/Question.php
Expand Up @@ -154,7 +154,8 @@ public function rules()
array('scale_id', 'numerical', 'integerOnly' => true, 'allowEmpty' => true),
array('same_default', 'numerical', 'integerOnly' => true, 'allowEmpty' => true),
array('type', 'length', 'min' => 1, 'max' => 1),
array('preg,relevance', 'safe'),
array('relevance', 'filter', 'filter' => 'trim'),
array('preg', 'safe'),
array('modulename', 'length', 'max' => 255),
array('same_script', 'numerical', 'integerOnly' => true, 'allowEmpty' => true),
);
Expand Down
2 changes: 1 addition & 1 deletion application/models/QuestionGroup.php
Expand Up @@ -63,7 +63,7 @@ public function rules()
{
return [
['group_order', 'numerical', 'integerOnly' => true, 'allowEmpty' => true],
['grelevance', 'safe'],
['grelevance', 'filter', 'filter' => 'trim'],
['randomization_group', 'safe']
];
}
Expand Down
5 changes: 1 addition & 4 deletions application/models/UpdateForm.php
Expand Up @@ -913,10 +913,8 @@ private function getMysqlChecks($build)
private function getProtocol()
{
$server_ssl = Yii::app()->getConfig("comfort_update_server_ssl");
if ($server_ssl === 1) {
if (extension_loaded("openssl")) {
if ($server_ssl === 1 && extension_loaded("openssl")) {
return 'https://';
}
}
return 'http://';
}
Expand Down Expand Up @@ -965,7 +963,6 @@ private function performRequest($getters, $create_new_cookie_file = false)
if (isset($_REQUEST['access_token'])) {
$getters .= "&access_token=" . urlencode($_REQUEST['access_token']);
}

$ch = curl_init($this->getProtocol() . Yii::app()->getConfig("comfort_update_server_url") . $getters);

if ($this->proxy_host_name != '') {
Expand Down
Expand Up @@ -9,76 +9,63 @@ function Ok()
</script>
<div class="form-group">
<?php
if (count($replFields) > 0 || isset($cquestions) )
{
$InsertansUnsupportedtypes= Yii::app()->getConfig('InsertansUnsupportedtypes');
if (count($replFields) > 0 || isset($cquestions)) {
$InsertansUnsupportedtypes = Yii::app()->getConfig('InsertansUnsupportedtypes');
?>
<select name='cquestions' id='cquestions' size='14' style='width:390px' ondblclick="$('.cke_dialog_ui_button_ok').children().click();" class='form-control'>
<?php
$noselection = false;
}
else
{
eT("No replacement variable available for this field");
$noselection = true;
}
} else {
eT("No replacement variable available for this field");
$noselection = true;
}

if (count($replFields) > 0)
{
?>
if (count($replFields) > 0) {
?>
<optgroup label='<?php eT("Standard fields");?>'>
<?php
foreach ($replFields as $stdfield=>$stdfieldvalue)
{
?>
<?php
foreach ($replFields as $stdfield => $stdfieldvalue) {
?>
<option value='<?php echo $stdfield;?>' title='<?php echo $stdfieldvalue;?>'><?php echo $stdfieldvalue;?></option>
<?php
}
?>
}
?>
</optgroup>
<?php
}
}

if (isset($cquestions))
{
?>
if (isset($cquestions)) {
?>
<optgroup label='<?php eT("Previous answer fields");?>'>
<?php
foreach ($cquestions as $cqn)
{
$isDisabled="";
if (in_array($cqn[2],$InsertansUnsupportedtypes))
{
$isDisabled=" disabled='disabled'";
}
elseif ($cqn[4] === false)
{
$isDisabled=" disabled='disabled'";
}
?>
<option value='INSERTANS:<?php echo $cqn[3];?>' title='<?php echo $cqn[0];?>' <?php echo $isDisabled;?>><?php echo $cqn[0];?></option>
<?php
<?php
foreach ($cquestions as $cqn) {
$isDisabled = "";
if (in_array($cqn[2], $InsertansUnsupportedtypes)) {
$isDisabled = " disabled='disabled'";
} elseif ($cqn[4] === false) {
$isDisabled = " disabled='disabled'";
}
?>
<option value='<?php echo $cqn[5];?>.shown' title='<?php echo $cqn[0];?>' <?php echo $isDisabled;?>><?php echo $cqn[0];?></option>
<?php
}
?>
</optgroup>
<?php
}
}

if ($noselection === false)
{
?>
if ($noselection === false) {
?>
</select>
<?php
}
?>
<?php
if (isset($surveyformat))
{
if (isset($surveyformat)) {
?>
<div class="panel panel-default">
<?php
switch ($surveyformat)
{
switch ($surveyformat) {
case 'A':
?>
<div class="panel-body">
Expand Down
14 changes: 10 additions & 4 deletions application/views/questionAdministration/summary.php
Expand Up @@ -195,7 +195,7 @@
<?php endif; ?>

<!-- Condition for this question -->
<?php if (trim($question->relevance) != ''): ?>
<?php if (trim($question->relevance) != '') : ?>
<tr>
<td>
<strong>
Expand All @@ -204,20 +204,26 @@
</td>
<td>
<?php
LimeExpressionManager::ProcessString("{" . $question->relevance . "}", $question->qid); // tests Relevance equation so can pretty-print it
LimeExpressionManager::ProcessString(
"{" . trim($question->relevance) . "}",
$question->qid
);
echo viewHelper::stripTagsEM(LimeExpressionManager::GetLastPrettyPrintExpression());
?>
</td>
</tr>
<?php endif; ?>

<!-- Group Relevance equation -->
<?php if (trim($question->group->grelevance)!=''): ?>
<?php if (trim($question->group->grelevance) != '') : ?>
<tr>
<td><strong><?php eT("Group relevance:"); ?></strong></td>
<td>
<?php
LimeExpressionManager::ProcessString("{" . $question->group->grelevance . "}", $question->qid);
LimeExpressionManager::ProcessString(
"{" . trim($question->group->grelevance) . "}",
$question->qid
);
echo viewHelper::stripTagsEM(LimeExpressionManager::GetLastPrettyPrintExpression());
?>
</td>
Expand Down

0 comments on commit fc9f661

Please sign in to comment.