Skip to content

Commit

Permalink
Fixed issue #13993: Batch-edit participants is missing the language f…
Browse files Browse the repository at this point in the history
…ield
  • Loading branch information
dominikvitt committed Sep 5, 2018
1 parent 0952eaf commit 6fc239e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
12 changes: 8 additions & 4 deletions application/controllers/admin/tokens.php
Expand Up @@ -363,7 +363,7 @@ public function browse($iSurveyId, $limit = 50, $start = 0)
Yii::app()->user->setState('pageSizeTokenView', (int) $_POST['pageSizeTokenView']);
}

$aData['massiveAction'] = App()->getController()->renderPartial('/admin/token/massive_actions/_selector', array(), true, false);
$aData['massiveAction'] = App()->getController()->renderPartial('/admin/token/massive_actions/_selector', $aData, true, false);

$this->_renderWrappedTemplate('token', array('browse'), $aData);
}
Expand Down Expand Up @@ -415,9 +415,13 @@ public function editMultiple()
// Core Fields
$aCoreTokenFields = array('firstname', 'lastname', 'emailstatus', 'token', 'language', 'sent', 'remindersent', 'completed', 'usesleft');
foreach ($aCoreTokenFields as $sCoreTokenField) {
if (trim(Yii::app()->request->getPost($sCoreTokenField, 'lskeep')) != 'lskeep') {
$aData[$sCoreTokenField] = flattenText(Yii::app()->request->getPost($sCoreTokenField));
}
if (trim(Yii::app()->request->getPost($sCoreTokenField, 'lskeep')) != 'lskeep') {
$value = flattenText(Yii::app()->request->getPost($sCoreTokenField));
if ($sCoreTokenField == 'language' and empty($value)){
continue;
}
$aData[$sCoreTokenField] = $value;
}
}

// Attibutes fields
Expand Down
Expand Up @@ -33,7 +33,7 @@
'no' => gT('Cancel'),
'keepopen' => 'yes',
'sModalTitle' => gT('Batch-edit participants'),
'htmlModalBody' => $this->renderPartial('./token/massive_actions/_update', array('dateformatdetails' => getDateFormatData(Yii::app()->session['dateformat'])), true),
'htmlModalBody' => $this->renderPartial('./token/massive_actions/_update', array('dateformatdetails' => getDateFormatData(Yii::app()->session['dateformat']), 'aLanguages' => $aLanguages), true),
),

// Delete
Expand Down
15 changes: 14 additions & 1 deletion application/views/admin/token/massive_actions/_update.php
Expand Up @@ -135,6 +135,19 @@ class="YesNoDatePicker form-control"
<input class='form-control custom-data selector_submitField' type='text' size='30' id='massedit_lastname' name='lastname' value="lskeep" disabled />
</div>
</div>

<!-- Language -->
<div class="form-group">
<div class="col-sm-1">
<label class="" >
<input type="checkbox" class="action_check_to_keep_old_value"></input>
</label>
</div>
<label class="col-sm-3 control-label" for='massedit_language'><?php eT("Language:"); ?></label>
<div class="col-sm-8">
<?php echo CHtml::dropDownList('language', '', array_merge(array('lskeep'=>''), $aLanguages), array('id'=>'massedit_language', 'class'=>'form-control custom-data selector_submitField', 'disabled'=>'disabled')); ?>
</div>
</div>

<!-- Email -->
<div class="form-group">
Expand Down Expand Up @@ -437,7 +450,7 @@ class="YesNoDatePicker form-control action_datepickerUpdateHiddenField"
var currentValue = !$(this).prop('checked');
var myFormGroup = $(this).closest('.form-group');
$(this).closest('.form-group').find('input:not(.action_check_to_keep_old_value)').prop('disabled', currentValue)
$(this).closest('.form-group').find('input:not(.action_check_to_keep_old_value),select:not(.action_check_to_keep_old_value)').prop('disabled', currentValue)
if($(this).closest('.form-group').find('.bootstrap-switch-container').length > 0){
$(this).closest('.form-group').find('.bootstrap-switch-container input[type=checkbox]').bootstrapSwitch('disabled', currentValue);
Expand Down

0 comments on commit 6fc239e

Please sign in to comment.