Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into questionobject_prot…
Browse files Browse the repository at this point in the history
…otype1
  • Loading branch information
olleharstedt committed Oct 10, 2016
2 parents 060b874 + 30e5664 commit 87a6759
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 36 deletions.
2 changes: 1 addition & 1 deletion application/config/version.php
Expand Up @@ -12,7 +12,7 @@
*150413
*/

$config['versionnumber'] = '2.54';
$config['versionnumber'] = '2.54.1';
$config['dbversionnumber'] = 260;
$config['buildnumber'] = '';
$config['updatable'] = true;
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/admin/export.php
Expand Up @@ -461,7 +461,7 @@ public function exportspss()
}

$sNoAnswerValue = (isset($_POST['noanswervalue']) && $_POST['noanswervalue'] != '' )?'\''.$_POST['noanswervalue'].'\'':'';
SPSSExportData($iSurveyID, $iLength, $sNoAnswerValue, $sLanguage);
SPSSExportData($iSurveyID, $iLength, $sNoAnswerValue,'\'',false, $sLanguage);

exit;
}
Expand Down
12 changes: 6 additions & 6 deletions application/helpers/admin/ajax_helper.php
Expand Up @@ -36,7 +36,7 @@ public static function createUrl($route, array $params = array())
public static function output($msg)
{
$output = new JsonOutput($msg);
self::echo($output); // Encoded to json format when converted to string
self::echoString($output); // Encoded to json format when converted to string
}

/**
Expand All @@ -47,7 +47,7 @@ public static function output($msg)
public static function outputSuccess($msg)
{
$output = new JsonOutputSuccess($msg);
self::echo($output);
self::echoString($output);
}

/**
Expand All @@ -59,7 +59,7 @@ public static function outputSuccess($msg)
public static function outputError($msg, $code = 0)
{
$output = new JsonOutputError($msg, $code);
self::echo($output);
self::echoString($output);
}

/**
Expand All @@ -69,7 +69,7 @@ public static function outputError($msg, $code = 0)
public static function outputNoPermission()
{
$output = new JsonOutputNoPermission();
self::echo($output);
self::echoString($output);
}

/**
Expand All @@ -78,15 +78,15 @@ public static function outputNoPermission()
public static function outputNotLoggedIn()
{
$output = new JsonOutputNotLoggedIn();
self::echo($output);
self::echoString($output);
}

/**
* Echo $str with json header
* @param string str
* @return void
*/
private static function echo($str)
private static function echoString($str)
{
header('Content-Type: application/json');
echo $str;
Expand Down
3 changes: 2 additions & 1 deletion application/views/admin/responses/listResponses_view.php
Expand Up @@ -40,6 +40,7 @@
<div class="col-sm-12">
<div class="content-right scrolling-wrapper" >
<input type='hidden' name='dateFormatDetails' value='<?php echo json_encode($dateformatdetails); ?>' />
<input type='hidden' name='rtl' value='<?php echo getLanguageRTL($_SESSION['adminlang']) ? '1' : '0'; ?>' />
<?php
// the massive actions dropup button
$massiveAction = App()->getController()->renderPartial('/admin/responses/massive_actions/_selector', array(), true, false);
Expand Down Expand Up @@ -172,7 +173,7 @@
'id' => 'responses-grid',
'ajaxUpdate' => true,
'ajaxType' => 'POST',
'afterAjaxUpdate'=>'bindScrollWrapper',
'afterAjaxUpdate'=>'LS.resp.bindScrollWrapper',
'template' => "{items}\n<div id='ListPager'><div class=\"col-sm-4\" id=\"massive-action-container\">$massiveAction</div><div class=\"col-sm-4 pager-container \">{pager}</div><div class=\"col-sm-4 summary-container\">{summary}</div></div>",
'summaryText' => gT('Displaying {start}-{end} of {count} result(s).').' '. sprintf(gT('%s rows per page'),
CHtml::dropDownList(
Expand Down
1 change: 1 addition & 0 deletions application/views/admin/token/browse.php
Expand Up @@ -140,6 +140,7 @@ function checkMandatoryAttr(value, colname) {

<div class='side-body <?php echo getSideBodyClass(false); ?>'>
<input type='hidden' name='dateFormatDetails' value='<?php echo json_encode($dateformatdetails); ?>' />
<input type='hidden' name='rtl' value='<?php echo getLanguageRTL($_SESSION['adminlang']) ? '1' : '0'; ?>' />
<?php $this->renderPartial('/admin/survey/breadcrumb', array('oSurvey'=>$oSurvey, 'token'=>true, 'active'=>gT("Display"))); ?>
<h3><?php eT("Survey participants"); ?></h3>

Expand Down
3 changes: 3 additions & 0 deletions docs/release_notes.txt
Expand Up @@ -36,6 +36,9 @@ CHANGE LOG
------------------------------------------------------


Changes from 2.54 (build 161007) to 2.54.1 (build 161010) Oct 10, 2016
-Fixed issue #11760: White screen/error when opening CPDB

Changes from 2.53 (build 161004) to 2.54 (build 161007) Oct 07, 2016
-New feature #11683: i18n for EM validations tip (Denis Chenu)
-New feature: Choose language when exporting SPSS data (Carsten Schmitz)
Expand Down
95 changes: 73 additions & 22 deletions scripts/admin/listresponse.js
Expand Up @@ -4,31 +4,82 @@

// @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GNU/GPL License v2 or later


/**
* Scroll the pager and the footer when scrolling horizontally
*/
function setListPagerPosition(){
var $elListPager = $(document).find('#ListPager');
$elListPager.css({
position: 'relative',
'left': $(document).find('.scrolling-wrapper').scrollLeft() ,
});

}

function bindScrollWrapper(){
setListPagerPosition();
$(document).find('.scrolling-wrapper').scroll(function(){
setListPagerPosition();
});

reinstallResponsesFilterDatePicker();
}
// Module
LS.resp = (function() {

/**
* Needed to calculate correct pager position at RTL language
* @var {number}
*/
var initialScrollValue = 0;

/**
* True if admin uses an RTL language
* @var {boolean}
*/
var useRtl = false;

/**
* Scroll the pager and the footer when scrolling horizontally
* @return
*/
function setListPagerPosition() {
var $elListPager = $('#ListPager');

if (useRtl) {
var scrollAmount = Math.abs($('.scrolling-wrapper').scrollLeft() - initialScrollValue);
$elListPager.css({
'position': 'relative',
'right': scrollAmount
});
}
else {
$elListPager.css({
'position': 'relative',
'left': $('.scrolling-wrapper').scrollLeft()
});
}
}

// Return public functions for this module
return {

/**
* Bind fixing pager position on scroll event
* @return
*/
bindScrollWrapper: function () {
setListPagerPosition();
$(document).find('.scrolling-wrapper').scroll(function() {
setListPagerPosition();
});

reinstallResponsesFilterDatePicker();
},

/**
* Set value of module private variable initialScrollValue
* @param {number} val
*/
setInitialScrollValue: function(val) {
initialScrollValue = val;
},

/**
* @param {boolean} val
*/
setUseRtl: function(val) {
useRtl = val;
}
};
})();

$(document).ready(function(){

bindScrollWrapper();
LS.resp.setInitialScrollValue($('.scrolling-wrapper').scrollLeft());
LS.resp.setUseRtl($('input[name="rtl"]').val() === '1');

LS.resp.bindScrollWrapper();

$('#display-mode').click(function(event){
event.preventDefault();
Expand Down
22 changes: 17 additions & 5 deletions scripts/admin/tokens.js
Expand Up @@ -45,7 +45,6 @@ $.fn.YesNo = function(options)
var that = $(this); // calling element
var $elHiddenInput = that.find('.YesNoDateHidden').first(); // input form, containing the value to submit to the database


$(document).ready(function(){
var $elSwitch = that.find('.YesNoSwitch').first(); // switch element (generated with YiiWheels widgets)
$elSwitch.bootstrapSwitch(); // Generate the switch
Expand Down Expand Up @@ -175,11 +174,24 @@ $(document).ready(function(){
});
}

$('.scrolling-wrapper').scroll(function(){
$('#tokenListPager').css({
'left': $(this).scrollLeft() ,
var initialScrollValue = $('.scrolling-wrapper').scrollLeft();
var useRtl = $('input[name="rtl"]').val() === '1';

if (useRtl) {
$('.scrolling-wrapper').scroll(function(){
var scrollAmount = Math.abs($('.scrolling-wrapper').scrollLeft() - initialScrollValue);
$('#tokenListPager').css({
'right': scrollAmount
});
});
});
}
else {
$('.scrolling-wrapper').scroll(function(){
$('#tokenListPager').css({
'left': $(this).scrollLeft() ,
});
});
}

/**
* Token delete Token
Expand Down

0 comments on commit 87a6759

Please sign in to comment.