Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev: Updated participant panel mass editing option
- Loading branch information
Showing
6 changed files
with
229 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
application/views/admin/participants/massive_actions/_update.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?php | ||
/** | ||
* Render the selector for surveys massive actions. | ||
* | ||
*/ | ||
?> | ||
<?php | ||
$model = Participant::model(); | ||
?> | ||
|
||
<form class="custom-modal-datas form form-horizontal"> | ||
<div class="container-fluid"> | ||
<div class="form-group"> | ||
<div class="col-sm-1"> | ||
<label class="" > | ||
<?php eT("Modify"); ?> | ||
</label> | ||
</div> | ||
<div class="col-sm-11"></div> | ||
</div> | ||
<?php | ||
if (Permission::model()->hasGlobalPermission('superadmin', 'read') | ||
|| $this->uid == Yii::app()->session['loginID'] | ||
|| (Permission::model()->hasGlobalPermission('users', 'update') | ||
&& $this->parent_id == Yii::app()->session['loginID'] | ||
) | ||
) { | ||
?> | ||
<div class="form-group"> | ||
<div class="col-sm-1"> | ||
<label class="" > | ||
<input type="checkbox" class="action_check_to_keep_old_value" /> | ||
</label> | ||
</div> | ||
<label class="col-sm-3 control-label" for='owner_uid'><?php eT("Owner?"); ?></label> | ||
<div class="col-sm-8"> | ||
<?php echo TbHtml::dropDownList('owner_uid', 'lskeep', array_merge(['lskeep' => gT('Keep old value')], $model->getOwnerOptions()), ['disabled'=>'disabled','class'=>'custom-data selector_submitField'] );?> | ||
</div> | ||
</div> | ||
<?php } ?> | ||
<div class="form-group"> | ||
<div class="col-sm-1"> | ||
<label class="" > | ||
<input type="checkbox" class="action_check_to_keep_old_value" /> | ||
</label> | ||
</div> | ||
<label class="col-sm-3 control-label" for='language'><?php eT("Language?"); ?></label> | ||
<div class="col-sm-8"> | ||
<?php echo TbHtml::dropDownList('language', 'lskeep', array_merge(['lskeep' => gT('Keep old value')], $model->getLanguageOptions()), ['disabled'=>'disabled','class'=>'custom-data selector_submitField'] );?> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<div class="col-sm-1"> | ||
<label class="" > | ||
<input type="checkbox" class="action_check_to_keep_old_value" /> | ||
</label> | ||
</div> | ||
<label class="col-sm-3 control-label" for='blacklisted'><?php eT("Blacklisted?"); ?></label> | ||
<div class="col-sm-8"> | ||
<?php echo TbHtml::dropDownList('blacklisted', 'lskeep', ['lskeep' => gT('Keep old value'), 'Y' => gT('Yes'), 'N' => gT('No')], ['disabled'=>'disabled','class'=>'custom-data selector_submitField'] );?> | ||
</div> | ||
</div> | ||
<?php echo TbHtml::hiddenField('changed_by', Yii::app()->user->id, ['class'=>'custom-data']);?> | ||
<?php echo TbHtml::hiddenField('changed_at', date('Y-m-d H:i:s'), ['class'=>'custom-data']);?> | ||
|
||
</div> | ||
</form> | ||
<!-- form --> | ||
<script> | ||
$('.action_check_to_keep_old_value').on('click', function(){ | ||
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('select').prop('disabled', currentValue) | ||
|
||
if(currentValue){ | ||
$(this).closest('.form-group').find('.selector_submitField').val('lskeep'); | ||
} else { | ||
$(this).closest('.form-group').find('input.selector_submitField').val(''); | ||
} | ||
|
||
}); | ||
</script> |
39 changes: 39 additions & 0 deletions
39
application/views/admin/participants/massive_actions/_update_results.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* This view display the result of multiple update action. It's rendered via ajax for the confirmation modal | ||
* | ||
* @var $aResults The array containing the result of each surveymenu entry action | ||
*/ | ||
?> | ||
|
||
<?php if (!$aResults['global']['result']):?> | ||
<strong> | ||
<?php echo $aResults['global']['message'] ;?> | ||
</strong> | ||
<?php else: ?> | ||
<?php unset($aResults['global']); ?> | ||
<table class="table table-striped"> | ||
<thead> | ||
<th><?php eT('Survey menu entry ID');?></th> | ||
<th><?php eT('Status');?></th> | ||
</thead> | ||
<tbody> | ||
<?php foreach($aResults as $sParticipantToken => $result):?> | ||
<tr> | ||
<td> | ||
<?php echo $sParticipantToken;?> | ||
</td> | ||
<?php if ($result['status'] === true):?> | ||
<td class="text-success"> | ||
<?php echo $result['message']; ?> | ||
</td> | ||
<?php else: ?> | ||
<td class="text-warning"> | ||
<?php echo $result['message']; ?> | ||
</td> | ||
<?php endif;?> | ||
</tr> | ||
<?php endforeach;?> | ||
</tbody> | ||
</table> | ||
<?php endif;?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1371cf5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great!