Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' into develop
  • Loading branch information
olleharstedt committed Nov 7, 2018
2 parents 5aae5f2 + fb4068b commit 749afa5
Show file tree
Hide file tree
Showing 18 changed files with 226 additions and 145 deletions.
2 changes: 1 addition & 1 deletion application/config/version.php
Expand Up @@ -16,5 +16,5 @@
$config['dbversionnumber'] = 403;
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['assetsversionnumber'] = '30063';
$config['assetsversionnumber'] = '30065';
return $config;
14 changes: 8 additions & 6 deletions application/controllers/admin/surveyadmin.php
Expand Up @@ -1145,15 +1145,17 @@ public function copy()
LimeExpressionManager::SetDirtyFlag();
LimeExpressionManager::singleton();
// Why this @ !
@LimeExpressionManager::UpgradeConditionsToRelevance($aImportResults['newsid']);
@LimeExpressionManager::StartSurvey($oSurvey->sid, 'survey', $oSurvey->attributes, true);
@LimeExpressionManager::StartProcessingPage(true, true);
LimeExpressionManager::SetSurveyId($aImportResults['newsid']);
LimeExpressionManager::RevertUpgradeConditionsToRelevance($aImportResults['newsid']);
LimeExpressionManager::UpgradeConditionsToRelevance($aImportResults['newsid']);
LimeExpressionManager::StartSurvey($oSurvey->sid, 'survey', $oSurvey->attributes, true);
LimeExpressionManager::StartProcessingPage(true, true);
$aGrouplist = QuestionGroup::model()->findAllByAttributes(['sid'=>$aImportResults['newsid']]);
foreach ($aGrouplist as $aGroup) {
@LimeExpressionManager::StartProcessingGroup($aGroup['gid'], $oSurvey->anonymized != 'Y', $aImportResults['newsid']);
@LimeExpressionManager::FinishProcessingGroup();
LimeExpressionManager::StartProcessingGroup($aGroup['gid'], $oSurvey->anonymized != 'Y', $aImportResults['newsid']);
LimeExpressionManager::FinishProcessingGroup();
}
@LimeExpressionManager::FinishProcessingPage();
LimeExpressionManager::FinishProcessingPage();
}

$this->_renderWrappedTemplate('survey', 'importSurvey_view', $aData);
Expand Down
8 changes: 6 additions & 2 deletions application/controllers/admin/tokens.php
Expand Up @@ -241,9 +241,11 @@ public function bounceprocessing($iSurveyId)
*/
public function deleteMultiple()
{
// TODO: permission checks
$aTokenIds = json_decode(Yii::app()->getRequest()->getPost('sItems'));
$iSid = Yii::app()->getRequest()->getPost('sid');
if (!Permission::model()->hasSurveyPermission($iSid, 'tokens', 'delete')) {
throw new CHttpException(403, gT("You do not have permission to access this page."));
}
TokenDynamic::model($iSid)->deleteRecords($aTokenIds);
return true;
}
Expand All @@ -253,9 +255,11 @@ public function deleteMultiple()
*/
public function deleteToken()
{
// TODO: permission checks
$aTokenId = Yii::app()->getRequest()->getParam('sItem');
$iSid = Yii::app()->getRequest()->getParam('sid');
if (!Permission::model()->hasSurveyPermission($iSid, 'tokens', 'delete')) {
throw new CHttpException(403, gT("You do not have permission to access this page."));
}
TokenDynamic::model($iSid)->deleteRecords(array($aTokenId));
return true;
}
Expand Down
Expand Up @@ -16,6 +16,9 @@
* perform an ajax request and show the result in the modal
*/
var onClickListAction = function () {
if($(this).data('disabled')) {
return;
}
var $that = $(this); // The clicked link
var $actionUrl = $that.data('url'); // The url of the Survey Controller action to call
var onSuccess = $that.data('on-success');
Expand Down Expand Up @@ -282,6 +285,7 @@ function getDefaultDateTimePickerSettings() {

function bindListItemclick(){
$( '.listActions a').off('click.listactions').on('click.listactions', onClickListAction);
$( '.listActions .disabled a').off('click.listactions').on('click.listactions', function(e){ e.preventDefault(); });
}


Expand Down
Expand Up @@ -37,8 +37,15 @@
<?php case 'action': ?>

<!-- Action -->
<li>
<li
<?php if(!empty($aAction['disabled'])) : ?>
class='disabled'
<?php endif;?>
>
<a href="#"
<?php if(!empty($aAction['disabled'])) : ?>
data-disabled='1'
<?php endif;?>
data-url="<?php echo $aAction['url'];?>"
<?php if (isset($aAction['on-success'])): ?>
data-on-success="<?php echo $aAction['on-success'];?>"
Expand All @@ -49,7 +56,6 @@
data-action="<?php echo $aAction['action'];?>"
data-type="<?php echo $aAction['actionType']; //Direct action, or modal ?>"
data-grid-reload="<?php if(isset($aAction['grid-reload'])){echo $aAction['grid-reload'];}else{echo "no";}?>"

<?php
/**
* It the action type is 'modal', a modal will be generated for this action, with the id: massive-actions-modal- $aAction['action'] - $key
Expand Down
6 changes: 6 additions & 0 deletions application/models/SurveyDynamic.php
Expand Up @@ -271,12 +271,18 @@ public function getCompleted()
*/
public function getButtons()
{
$sBrowseLanguage=sanitize_languagecode(Yii::app()->request->getParam('browselang', ''));
$sViewUrl = App()->createUrl("/admin/responses/sa/view/surveyid/".self::$sid."/id/".$this->id);
$sViewPDFUrl = App()->createUrl("/admin/responses/sa/viewquexmlpdf/surveyid/".self::$sid."/id/".$this->id);
$sEditUrl = App()->createUrl("admin/dataentry/sa/editdata/subaction/edit/surveyid/".self::$sid."/id/".$this->id);
$sDownloadUrl = App()->createUrl("admin/responses", array("sa"=>"actionDownloadfiles", "surveyid"=>self::$sid, "sResponseId"=>$this->id));
$sDeleteUrl = convertGETtoPOST(App()->createUrl("admin/responses/sa/actionDelete/surveyid/".self::$sid."?surveyid=".self::$sid."&sResponseId=".$this->id));
$sAttachmentDeleteUrl = convertGETtoPOST(App()->createUrl("admin/responses/sa/actionDeleteAttachments/?surveyid=".self::$sid."&sResponseId=".$this->id));
if (!empty($sBrowseLanguage)) {
$sViewUrl.='?browselang='.$sBrowseLanguage;
$sViewPDFUrl.='?browselang='.$sBrowseLanguage;
$sEditUrl.='?browselang='.$sBrowseLanguage;
}
$button = "";

// View detail icon
Expand Down
2 changes: 1 addition & 1 deletion application/models/TemplateConfig.php
Expand Up @@ -501,7 +501,7 @@ public function getClassAndAttributes()

$aClassAndAttributes['attr']['maincolformdivainput'] = ' type="password" id="token" name="token" value="" required ';
$aClassAndAttributes['attr']['maincoldivdivbul'] = ' role="alert" ';
$aClassAndAttributes['attr']['maincolformlabel'] = ' for="loadname"';
$aClassAndAttributes['attr']['maincolformlabel'] = ' for="token"';
$aClassAndAttributes['attr']['maincolformlabelsmall'] = ' aria-hidden="true" ';
$aClassAndAttributes['attr']['maincolformdivblabel'] = ' for="loadsecurity" ';
$aClassAndAttributes['attr']['maincolformdivblabelsmall'] = ' aria-hidden="true" ';
Expand Down
16 changes: 9 additions & 7 deletions application/views/admin/token/massive_actions/_selector.php
Expand Up @@ -15,17 +15,16 @@
'dropUpText' => gT('Selected participant(s)...'),

'aActions' => array(

// Massive update
array(
// li element
'type' => 'action',
'action' => 'edit',
'disabled' => !Permission::model()->hasSurveyPermission($surveyid, 'tokens', 'update'),
'url' => App()->createUrl('/admin/tokens/sa/editMultiple/'),
'iconClasses' => 'fa fa-pencil text-success',
'text' => gT('Batch-edit participants'),
'grid-reload' => 'yes',

// modal
'actionType' => 'modal',
'modalType' => 'yes-no',
Expand All @@ -41,6 +40,7 @@
// li element
'type' => 'action',
'action' => 'delete',
'disabled' => !Permission::model()->hasSurveyPermission($surveyid, 'tokens', 'delete'),
'url' => App()->createUrl('/admin/tokens/sa/deleteMultiple/'),
'iconClasses' => 'text-danger fa fa-trash',
'text' => gT('Delete'),
Expand All @@ -53,7 +53,7 @@
'sModalTitle' => gT('Delete survey participants'),
'htmlModalBody' => gT('Are you sure you want to delete the selected participants?'),
'aCustomDatas' => array(
array( 'name'=>'sid', 'value'=> $_GET['surveyid']),
array( 'name'=>'sid', 'value'=> $surveyid),
),
),

Expand All @@ -77,7 +77,8 @@
// li element
'type' => 'action',
'action' => 'invite',
'url' => App()->createUrl('/admin/tokens/sa/email/surveyid/'.$_GET['surveyid']),
'disabled' => !Permission::model()->hasSurveyPermission($surveyid, 'tokens', 'update'),
'url' => App()->createUrl('/admin/tokens/sa/email/surveyid/'.$surveyid),
'iconClasses' => 'icon-invite text-success',
'text' => gT('Send email invitations'),

Expand All @@ -94,7 +95,8 @@
// li element
'type' => 'action',
'action' => 'remind',
'url' => App()->createUrl('/admin/tokens/sa/email/action/remind/surveyid/'.$_GET['surveyid']),
'disabled' => !Permission::model()->hasSurveyPermission($surveyid, 'tokens', 'update'),
'url' => App()->createUrl('/admin/tokens/sa/email/action/remind/surveyid/'.$surveyid),
'iconClasses' => 'icon-remind text-success',
'text' => gT('Send email reminder'),

Expand Down Expand Up @@ -126,10 +128,10 @@
// li element
'type' => 'action',
'action' => 'addCPDB',
'url' => App()->createUrl('admin/participants/sa/attributeMapToken/sid/'.$_GET['surveyid']),
'url' => App()->createUrl('admin/participants/sa/attributeMapToken/sid/'.$surveyid),
'iconClasses' => 'ui-icon ui-add-to-cpdb-link',
'text' => gT('Add participants to central database'),

'disabled' => !Permission::model()->hasGlobalPermission('participantpanel', 'create'),
'aLinkSpecificDatas' => array(
'input-name' => 'tokenids',
),
Expand Down
13 changes: 7 additions & 6 deletions assets/packages/limesurvey/survey.js
Expand Up @@ -155,14 +155,15 @@ function activateLanguageChanger(){
* @param {string} lang Language to change to.
*/
var applyChangeAndSubmit = function(lang) {
// Remove existing lang input.
limesurveyForm.find('input[name="lang"]').remove();
// Remove existing onsubmitbuttoninput, no need to remove lang : last one is the submitted
$("#onsubmitbuttoninput").remove();
// Append new input.
$('<input type="hidden">')
.attr('name', 'lang')
.val(lang)
.appendTo(limesurveyForm);
// Append move type.
/* onsubmitbuttoninput is related to template (and ajax) : MUST move to template with ajax … */
$('<input type="hidden" id="onsubmitbuttoninput" name="move" value="changelang" />').appendTo(limesurveyForm);
limesurveyForm.submit();
};
Expand Down Expand Up @@ -210,7 +211,7 @@ function activateLanguageChanger(){
}
});
/* Language changer dropdown */
$('.form-change-lang [name="lang"]').on('change', function() {
$('.form-change-lang [name="lang"] option:not(selected)').on('click', function(event) {
var closestForm = $(this).closest('form');
var newLang = $(this).val();
if (!closestForm.length) {
Expand All @@ -222,9 +223,9 @@ function activateLanguageChanger(){
// Answer : remind user can put language changer everywhere, not only in home page, but for example in clear all page etc …
} else {
// If there are no form : we can't use it */
if($(this).data('targeturl')){
if($(this).parent().data('targeturl')){
/* If we have a target url : just move location to this url with lang set */
var target=$(this).data('targeturl');
var target=$(this).parent().data('targeturl');
/* adding lang in get param manually */
if(target.indexOf("?") >=0){
target+="&lang="+$(this).val();
Expand All @@ -247,7 +248,7 @@ function activateLanguageChanger(){
}
}else{
/* we are inside a form : just submit : but remove other lang input if exist : be sure it's this one send */
$(this).closest('form').find("[name='lang']").not($(this)).remove();
$(this).closest('form').find("[name='lang']").not($(this).parent()).remove();
$(this).closest('.form-change-lang').find(':submit').click();
}
});
Expand Down
73 changes: 73 additions & 0 deletions docs/release_notes.txt
Expand Up @@ -35,6 +35,79 @@ Thank you to everyone who helped with this new release!
CHANGE LOG
------------------------------------------------------

Changes from 3.15.1 (build 181017) to 3.15.2 (build 181107) November 07, 2018

-New feature: allow to change config file location (LouisGac)
-New feature: allow to change config file location, part 2 (LouisGac)
-New feature: configuration option to use a single upload directory for all surveys (LouisGac)
-Fixed issue #10162: new visit on a survey with token deletes last entry (Dominik Vitt)
-Fixed issue #11787: filtered question with multiple column (Denis Chenu)
-Fixed issue #13982: Allow kcfinder use with CHttpSession derived classes (#1112) (Casey Lucas)
-Fixed issue #14062: No languages list when clicking the hamburger icon in Token page (Dominik Vitt)
-Fixed issue #14066: Broken link on reset button from mass-action response export (Anton Victorson)
-Fixed issue #14098: Subquestion incorrectly named 'Sub-question' (Carsten Schmitz)
-Fixed issue #14101: Missing CSS-class "form-horizontal" for multiple-short-text-questions (Denis Chenu)
-Fixed issue #14106: Button "Add new question to group" does not work (Dominik Vitt)
-Fixed issue #14124: Changing invitation/reminder dates for a certain tokens changes the date format at the database (Dominik Vitt)
-Fixed issue #14150: Wrong survey menu id entry (Carsten Schmitz)
-Fixed issue #14162: Functionality ranking questions breaks with relev… (#1154) (Denis Chenu)
-Fixed issue #14167: Double Quotes are not allowed (title) = File upload (Dominik Vitt)
-Fixed issue #14168: PHP7.2.0 Removed plugins throw error in plugin manager (Denis Chenu)
-Fixed issue #14191: Broken question view if sum of width !=12 (Denis Chenu)
-Fixed issue #14192: Mass action on Survey listing doesn't work on second page (Dominik Vitt)
-Fixed issue #14196: Unable to use dynamic mindate and maxdate (Denis Chenu)
-Fixed issue #14205: Unable to save, clearall (and maybe load) without javascript (Denis Chenu)
-Fixed issue #14209: Long answer options for array question types not line-breaked in mobile view (Dominik Vitt)
-Fixed issue #14212: Deleting or editing details of a to be attached file at token emails is not doable (Dominik Vitt)
-Fixed issue #14216: Users without rights to delete tokens can still delete them (Denis Chenu)
-Fixed issue : Same choice height work again (Denis Chenu)
-Fixed issue : aria-label for warning and error not translated (Denis Chenu)
-Fixed issue : broken HTML validatio on welcome page (Denis Chenu)
-Fixed issue : class and title broken in array number (text layout) (Denis Chenu)
-Fixed issue : hidden column in multiple short text (Denis Chenu)
-Fixed issue : label usage broken in token form (Denis Chenu)
-Fixed issue : no "No answser" in list with comment , dropdown (Denis Chenu)
-Fixed issue : no label related for Yes No button (a11y related) (Denis Chenu)
-Fixed issue: EM variables are shown in red color after survey copy (Dominik Vitt)
-Fixed issue: JSON editor options to load the right content (#1130) (yent)
-Fixed issue: Not possible to save or load saved survey when in anonymized mode (Dominik Vitt)
-Fixed issue: PHP7 compatibility (Markus Flür)
-Fixed issue: PHP7 compatibility 2 (Markus Flür)
-Fixed issue: Survey groups not being wiped (Carsten Schmitz)
-Fixed issue: can't extract large zip file (LouisGac)
-Fixed issue: child survey group could become parent (LouisGac)
-Fixed issue: content, whatever its type, was passed to CHtml::encode which expects a string due to lack of encode htmlOption for CHtml::textarea. Also added needed json_encode so that textarea value is a string in the end. (yent)
-Fixed issue: corrected the icon class on the footer help icon (Markus Flür)
-Fixed issue: datefield from mssql database always contains milliseconds (Markus Flür)
-Fixed issue: more php7 issues fixed (count, etc) (Markus Flür)
-Fixed issue: multiple design issues in question edit (Markus Flür)
-Fixed issue: resumed survey lose saved values after click on "Next" (Dominik Vitt)
-Fixed issue: unable to check all questions on survey statistics page (Dominik Vitt)
-Fixed issue: upload to generalfiles fails (Markus Flür)
-Fixed issue: wrong path for adminstyle-rtl.css (Dominik Vitt)
#Updated translation: Arabic by AbdelmalekTEBBOUB
#Updated translation: Catalan by qualitatuvic
#Updated translation: Chinese (Simplified) by johnxan
#Updated translation: Croatian by dominikvitt
#Updated translation: Czech by jelen1
#Updated translation: Dutch (Informal) by Han
#Updated translation: Dutch by Han
#Updated translation: Dutch by kpadm, Han
#Updated translation: German (Informal) by c_schmitz
#Updated translation: German by actxcellence, c_schmitz
#Updated translation: Hebrew by vis_kerem
#Updated translation: Hungarian by kkd
#Updated translation: Italian (Informal) by lfanfoni
#Updated translation: Italian by lfanfoni
#Updated translation: Norwegian (Bokmål) by peterhol, pmonstad
#Updated translation: Norwegian (Bokmål) by pmonstad
#Updated translation: Polish (Informal) by elissa
#Updated translation: Polish by elissa
#Updated translation: Romanian by cdorin
#Updated translation: Russian by ddrmoscow
#Updated translation: Spanish (Argentina) by Eescudero
#Updated translation: Thai by tomzt


Changes from 3.15.0 (build 181008) to 3.15.1 (build 181017) to October 17, 2018
-Fixed issue #13928: script (and tag) are not filtered or encoded if question is in same group (Denis Chenu)
Expand Down

0 comments on commit 749afa5

Please sign in to comment.