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 Mar 20, 2020
2 parents 9709397 + 4f94856 commit bd4c077
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 16 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Expand Up @@ -175,3 +175,9 @@ tags
package-lock.json

third_party/

# Docker related files
.dockerignore
.Dockerfile
docker-compose.yml
docker/
4 changes: 3 additions & 1 deletion application/controllers/admin/assessments.php
Expand Up @@ -114,7 +114,9 @@ private function prepareDataArray(&$aData, $collectEdit = false)
$aData['groups'] = $this->_collectGroupData($oSurvey, $aData);
$this->setSearchParams($oAssessments);
$aData['model'] = $oAssessments;
$aData['pageSizeAsessements'] = Yii::app()->user->getState('pageSizeAsessements', Yii::app()->params['defaultPageSize']);
if (isset($_POST['pageSize'])) {
Yii::app()->user->setState('pageSize', Yii::app()->request->getParam('pageSize'));
}
$aData['actiontitle'] = gT("Add");
$aData['actionvalue'] = "assessmentadd";
$aData['editId'] = '';
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/admin/checkintegrity.php
Expand Up @@ -538,7 +538,7 @@ protected function _checkintegrity()
if ($oQuestion->gid != $sGid){

// If not, we change the column name
$sNvColName = $oSurvey->sid . 'X'. $oQuestion->groups->gid . 'X' . $sDirtyQid;
$sNvColName = $oSurvey->sid . 'X'. $oQuestion->group->gid . 'X' . $sDirtyQid;

if ( array_key_exists( $sNvColName, $aColumns ) ){
// This case will not happen often, only when QID + Subquestion ID == QID of a question in the target group
Expand Down
2 changes: 1 addition & 1 deletion application/models/Assessment.php
Expand Up @@ -177,7 +177,7 @@ public function search()
$criteria->compare('message', $this->message, true);
$criteria->compare('language', $survey->language);

$pageSize = Yii::app()->user->getState('pageSizeParticipantView', Yii::app()->params['defaultPageSize']);
$pageSize = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']);
return new CActiveDataProvider(
$this,
array(
Expand Down
6 changes: 4 additions & 2 deletions application/models/Response.php
Expand Up @@ -48,12 +48,14 @@ public function getFiles($qid = null)
$criteria = new CDbCriteria();
$criteria->compare('sid', $this->dynamicId);
$criteria->compare('type', Question::QT_VERTICAL_FILE_UPLOAD);
$criteria->compare('questionL10ns.language', $survey->language);
$criteria->compare('ql10ns.language', $survey->language);
if ($qid !== null) {
$criteria->compare('t.qid', $qid);
}

$questions = Question::model()->with('questionL10ns')->findAll($criteria);
$questions = Question::model()
->with(array('questionL10ns' => array('alias' => 'ql10ns')))
->findAll($criteria);
$files = array();
foreach ($questions as $question) {
$field = $question->sid.'X'.$question->gid.'X'.$question->qid;
Expand Down
27 changes: 19 additions & 8 deletions application/views/admin/assessments/assessments_view.php
Expand Up @@ -6,13 +6,15 @@
// todo implement new ekeditor 1580136051118
//echo PrepareEditorScript(true, $this);
Yii::app()->getClientScript()->registerScript(
"AssessmentsVariables",
"var strnogroup = '".gT("There are no groups available.", "js")."',\n
loadEditUrl = '".$this->createUrl("admin/assessments/sa/index/", ["surveyid" => $surveyid, 'action' => 'assessmentopenedit'])."',\n
deleteUrl = '".$this->createUrl("admin/assessments/sa/index/", ["surveyid" => $surveyid, 'action' => 'assessmentdelete'])."';",
LSYii_ClientScript::POS_BEGIN
"AssessmentsVariables",
"var strnogroup = '".gT("There are no groups available.", "js")."',\n
loadEditUrl = '".$this->createUrl("admin/assessments/sa/index/", ["surveyid" => $surveyid, 'action' => 'assessmentopenedit'])."',\n
deleteUrl = '".$this->createUrl("admin/assessments/sa/index/", ["surveyid" => $surveyid, 'action' => 'assessmentdelete'])."';",
LSYii_ClientScript::POS_BEGIN
);

$pageSize = intval(Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']));

?>
<div class="side-body <?=getSideBodyClass(false)?>">
<?=viewHelper::getViewTestTag('surveyAssessments');?>
Expand Down Expand Up @@ -45,13 +47,13 @@
'summaryText'=>gT('Displaying {start}-{end} of {count} result(s).').' '
. sprintf(gT('%s rows per page'),
CHtml::dropDownList(
'pageSizeAsessements',
$pageSizeAsessements,
'pageSize',
$pageSize,
Yii::app()->params['pageSizeOptions'],
array('class'=>'changePageSize form-control', 'style'=>'display: inline; width: auto')
)
),
'rowHtmlOptionsExpression' => '["data-assessment-id" => $data->id]',
//'rowHtmlOptionsExpression' => '["data-assessment-id" => $data->id]',
'htmlOptions' => array('class'=> 'table-responsive'),
'itemsCssClass' => 'table table-responsive table-striped',
'htmlOptions'=>array('style'=>'cursor: pointer;', 'class'=>'hoverAction grid-view'),
Expand Down Expand Up @@ -95,3 +97,12 @@
};
?>
</div>

<script type="text/javascript">
jQuery(function($) {
// To update rows per page via ajax
$(document).on("change", '#pageSize', function() {
$.fn.yiiGridView.update('assessments-grid', {data:{pageSize: $(this).val()}});
});
});
</script>
14 changes: 13 additions & 1 deletion application/views/admin/pluginmanager/index.php
Expand Up @@ -11,8 +11,9 @@
// DO NOT REMOVE This is for automated testing to validate we see that page
echo viewHelper::getViewTestTag('pluginManager');

$pageSize = intval(Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']));

?>
<?php $pageSize = intval(Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize'])); ?>

<div class='col-sm-12'>
<div> <!-- Extra funny div -->
Expand Down Expand Up @@ -152,7 +153,18 @@ class='btn btn-default'
),
'columns' => $gridColumns,
'rowHtmlOptionsExpression' => 'array("data-id" => $data["id"])',
'ajaxUpdate' => 'plugins-grid'
]
);

$this->renderPartial('./pluginmanager/uploadModal', []);
?>

<script type="text/javascript">
jQuery(function($) {
// To update rows per page via ajax
$(document).on("change", '#pageSize', function() {
$.fn.yiiGridView.update('plugins-grid',{ data:{ pageSize: $(this).val() }});
});
});
</script>
4 changes: 2 additions & 2 deletions application/views/admin/super/footer.php
Expand Up @@ -41,9 +41,9 @@
}

/* Fix array to string , see #13352 */
foreach($systemInfos as &$systemInfo) {
foreach($systemInfos as $key=>$systemInfo) {
if(is_array($systemInfo)) {
$systemInfo = json_encode($systemInfo, JSON_PRETTY_PRINT);
$systemInfos[$key] = json_encode($systemInfo, JSON_PRETTY_PRINT);
}
}
?>
Expand Down

0 comments on commit bd4c077

Please sign in to comment.