Skip to content

Commit

Permalink
Merge branch 'master' into bug/17267-allow-to-update-question-theme
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Jun 3, 2021
2 parents c47b2cf + b03648f commit 7a2c14d
Show file tree
Hide file tree
Showing 83 changed files with 1,585 additions and 690 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Please be advised, that we sometimes push development versions into the reposito
### Minimal
The absolute minimal requirements are:
- Apache >= 2.4 | nginx >= 1.1 | any other php-ready webserver
- php >= 7.0
- php >= 7.2.5
- with mbstring and pdo-database drivers
- mysql >= 5.5.9 | pgsql >= 9 | mariadb >= 5.5 | mssql >= 2005

Expand Down
2 changes: 0 additions & 2 deletions application/config/config-defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@
// If the user enters password incorrectly
$config['maxLoginAttempt'] = 3; // Lock them out after 3 attempts
$config['timeOutTime'] = 60 * 10; // Lock them out for 10 minutes.
$config['loginIpWhitelist'] = ''; // List of IP addresses, separated by comma, that should be excluded from the max login attemps check. Octet wildcards are allowed (e.g. 192.168.0.*)
$config['tokenIpWhitelist'] = ''; // List of IP addresses, separated by comma, that should be excluded from the max token validation attemps check. Octet wildcards are allowed (e.g. 192.168.0.*)

// Site Settings
$config['printanswershonorsconditions'] = 1; // If set to 1, only relevant answers to questions can be printed by user. If set to 0, also questions not shown are printed
Expand Down
6 changes: 3 additions & 3 deletions application/config/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
* See COPYRIGHT.php for copyright notices and details.
*/

$config['versionnumber'] = '5.0.0';
$config['dbversionnumber'] = 447;
$config['versionnumber'] = '5.0.1';
$config['dbversionnumber'] = 449;
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['templateapiversion'] = 3;
$config['assetsversionnumber'] = '30207';
$config['assetsversionnumber'] = '30208';
return $config;
4 changes: 2 additions & 2 deletions application/controllers/QuestionAdministrationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1901,7 +1901,7 @@ public static function setMultipleQuestionOtherState($aQids, $sOther, $iSid)
{
foreach ($aQids as $sQid) {
$iQid = (int)$sQid;
$oQuestion = Question::model()->findByPk(["qid" => $iQid], ['sid=:sid'], [':sid' => $iSid]);
$oQuestion = Question::model()->findByPk(["qid" => $iQid], 'sid=:sid', [':sid' => $iSid]);
// Only set the other state for question types that have this attribute
if (
($oQuestion->type == Question::QT_L_LIST_DROPDOWN)
Expand All @@ -1926,7 +1926,7 @@ public static function setMultipleQuestionMandatoryState($aQids, $sMandatory, $i
{
foreach ($aQids as $sQid) {
$iQid = (int)$sQid;
$oQuestion = Question::model()->findByPk(["qid" => $iQid], ['sid=:sid'], [':sid' => $iSid]);
$oQuestion = Question::model()->findByPk(["qid" => $iQid], 'sid=:sid', [':sid' => $iSid]);
// These are the questions types that have no mandatory property - so ignore them
if ($oQuestion->type != Question::QT_X_BOILERPLATE_QUESTION && $oQuestion->type != Question::QT_VERTICAL_FILE_UPLOAD) {
$oQuestion->mandatory = $sMandatory;
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/SurveyAdministrationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2354,7 +2354,7 @@ private function getSurveyIdFromGetRequest()
*
* @todo is this new implementation???
*
* @param Survey $oSurvey Given Survey
* @param Survey $survey Given Survey
*
* @return array
*/
Expand All @@ -2369,7 +2369,7 @@ private function tabResourceManagement($survey)
}

$disabledIfNoResources = '';
if (hasResources($oSurvey->sid, 'survey') === false) {
if (hasResources($survey->sid, 'survey') === false) {
$disabledIfNoResources = " disabled='disabled'";
}
$aData = [];
Expand Down
14 changes: 7 additions & 7 deletions application/controllers/admin/globalsettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,20 +440,20 @@ public function surveySettings()
{
$bRedirect = 0;
$gsid = 0; // global setting in SurveysGroupsettings model
$oSurvey = SurveysGroupsettings::model()->findByPk($gsid);
$oSurvey->setOptions();
$oSurveyGroupSetting = SurveysGroupsettings::model()->findByPk($gsid);
$oSurveyGroupSetting->setOptions();

$sPartial = Yii::app()->request->getParam('partial', '_generaloptions_panel');

if (isset($_POST)) {
$oSurvey->attributes = $_POST;
$oSurvey->gsid = 0;
$oSurvey->usecaptcha = Survey::saveTranscribeCaptchaOptions();
$oSurveyGroupSetting->attributes = $_POST;
$oSurveyGroupSetting->gsid = 0;
$oSurveyGroupSetting->usecaptcha = Survey::saveTranscribeCaptchaOptions();

//todo: when changing ipanonymiez from "N" to "Y", call the function that anonymizes the ip-addresses


if ($oSurvey->save()) {
if ($oSurveyGroupSetting->save()) {
$bRedirect = 1;
}
}
Expand All @@ -466,7 +466,7 @@ public function surveySettings()
// Sort users by name
asort($aData['users']);

$aData['oSurvey'] = $oSurvey;
$aData['oSurvey'] = $oSurveyGroupSetting;

if ($bRedirect && App()->request->getPost('saveandclose') !== null) {
$this->getController()->redirect($this->getController()->createUrl('admin/index'));
Expand Down
2 changes: 1 addition & 1 deletion application/core/LsDefaultDataSets.php
Original file line number Diff line number Diff line change
Expand Up @@ -2078,7 +2078,7 @@ public static function getBaseQuestionThemeEntries()
"core_theme" => 1,
"extends" => "",
"group" => "Arrays",
"settings" => "{\"subquestions\":\"1\",\"answerscales\":\"2\",\"hasdefaultvalues\":\"0\",\"assessable\":\"1\",\"class\":\"array-flexible-duel-scale\"}",
"settings" => "{\"subquestions\":\"1\",\"answerscales\":\"2\",\"hasdefaultvalues\":\"0\",\"assessable\":\"1\",\"class\":\"array-flexible-dual-scale\"}",
),
array(
"name" => "arrays/increasesamedecrease",
Expand Down
1 change: 1 addition & 0 deletions application/core/plugins/AuditLog/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</metadata>

<compatibility>
<version>5.0</version>
<version>4.0</version>
<version>3.0</version>
<version>2.73</version>
Expand Down
1 change: 1 addition & 0 deletions application/core/plugins/AuthLDAP/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</metadata>

<compatibility>
<version>5.0</version>
<version>4.0</version>
<version>3.0</version>
<version>2.73</version>
Expand Down
1 change: 1 addition & 0 deletions application/core/plugins/Authdb/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</metadata>

<compatibility>
<version>5.0</version>
<version>4.0</version>
<version>3.0</version>
<version>2.73</version>
Expand Down
1 change: 1 addition & 0 deletions application/core/plugins/Authwebserver/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</metadata>

<compatibility>
<version>5.0</version>
<version>4.0</version>
<version>3.0</version>
<version>2.73</version>
Expand Down
1 change: 1 addition & 0 deletions application/core/plugins/ComfortUpdateChecker/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<supportUrl>https://www.limesurvey.org</supportUrl>
</metadata>
<compatibility>
<version>5.0</version>
<version>4.0</version>
<version>3.0</version>
</compatibility>
Expand Down
1 change: 1 addition & 0 deletions application/core/plugins/ExportR/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</metadata>

<compatibility>
<version>5.0</version>
<version>4.0</version>
<version>3.0</version>
<version>2.73</version>
Expand Down
1 change: 1 addition & 0 deletions application/core/plugins/ExportSTATAxml/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</metadata>

<compatibility>
<version>5.0</version>
<version>4.0</version>
<version>3.0</version>
<version>2.73</version>
Expand Down
1 change: 1 addition & 0 deletions application/core/plugins/PasswordRequirement/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
</metadata>

<compatibility>
<version>5.0</version>
<version>4.0</version>
<version>3.0</version>
<version>2.73</version>
Expand Down
1 change: 1 addition & 0 deletions application/core/plugins/TwoFactorAdminLogin/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<supportUrl>https://www.limesurvey.org</supportUrl>
</metadata>
<compatibility>
<version>5.0</version>
<version>4.0</version>
<version>3.0</version>
</compatibility>
Expand Down
1 change: 1 addition & 0 deletions application/core/plugins/UpdateCheck/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</metadata>

<compatibility>
<version>5.0</version>
<version>4.0</version>
</compatibility>

Expand Down
1 change: 1 addition & 0 deletions application/core/plugins/customToken/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</metadata>

<compatibility>
<version>5.0</version>
<version>4.0</version>
</compatibility>

Expand Down
1 change: 1 addition & 0 deletions application/core/plugins/expressionFixedDbVar/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
</metadata>

<compatibility>
<version>5.0</version>
<version>4.0</version>
</compatibility>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<priority>1</priority>

<compatibility>
<version>5.0</version>
<version>4.0</version>
</compatibility>

Expand Down
1 change: 1 addition & 0 deletions application/core/plugins/expressionQuestionHelp/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</metadata>

<compatibility>
<version>5.0</version>
<version>4.0</version>
</compatibility>

Expand Down
1 change: 1 addition & 0 deletions application/core/plugins/mailSenderToFrom/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</metadata>

<compatibility>
<version>5.0</version>
<version>4.0</version>
</compatibility>

Expand Down
1 change: 1 addition & 0 deletions application/core/plugins/oldUrlCompat/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</metadata>

<compatibility>
<version>5.0</version>
<version>4.0</version>
<version>3.0</version>
<version>2.73</version>
Expand Down
1 change: 1 addition & 0 deletions application/core/plugins/statFunctions/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
</metadata>

<compatibility>
<version>5.0</version>
<version>4.0</version>
</compatibility>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
/**
* This view defines a simple select instead of a modal box
*/


$disable = '';
if ($this->survey_active) {
$disable = 'disabled';
}

?>
<select id="<?=$this->widgetsJsName?>" name="<?=$this->widgetsJsName?>" class="form-control">
<select id="<?=$this->widgetsJsName?>" name="<?=$this->widgetsJsName?>" class="form-control" <?=$disable?>>
<?php
foreach ($this->groupStructureArray as $sGroupTitle => $aGroupArray) {
echo sprintf("<optgroup label='%s'>", $aGroupArray[$this->groupTitleKey]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
/**
* This view defines a simple select instead of a modal box
*/

//disable dropdown select when survey is active
$disable = '';
if ($this->survey_active) {
$disable = 'disabled';
}

?>
<select id="<?=$this->widgetsJsName?>" name="<?=$this->widgetsJsName?>" class="form-control">
<select id="<?=$this->widgetsJsName?>" name="<?=$this->widgetsJsName?>" class="form-control" <?= $disable?> >
<?php
foreach ($this->itemArray as $sItemKey => $aItemContent) {
$selected = $this->value == $sItemKey ? 'selected' : '';
Expand Down
8 changes: 7 additions & 1 deletion application/helpers/export_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1833,8 +1833,14 @@ function quexml_export($surveyi, $quexmllan, $iResponseID = false)
case "R": //RANKING STYLE
quexml_create_subQuestions($question, $qid, $sgq, $iResponseID, $fieldmap, true);

$sqllength = "CHAR_LENGTH";
$platform = Yii::app()->db->getDriverName();
if ($platform == 'mssql' || $platform == 'sqlsrv' || $platform == 'dblib') {
$sqllength = "LEN";
}

$QROW = App()->db->createCommand()
->select('MAX(CHAR_LENGTH(code)) as sc')
->select('MAX(' . $sqllength . '(code)) as sc')
->from('{{answers}} a')
->join('{{answer_l10ns}} al', 'a.aid=al.aid')
->where('a.qid=:qid AND al.language=:language', [':qid' => $qid, ':language' => $quexmllang])
Expand Down

0 comments on commit 7a2c14d

Please sign in to comment.