Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into cint
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Aug 26, 2016
2 parents fa9a0f0 + 5888026 commit 4a966bb
Show file tree
Hide file tree
Showing 12 changed files with 154 additions and 154 deletions.
129 changes: 87 additions & 42 deletions application/views/admin/dataentry/vvimport.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,96 @@
<?php if($tableExists):?>
<h3><?php eT("Import a VV survey file"); ?></h3>
<?php endif;?>

<div class="row">
<div class="col-lg-12 content-right">


<?php
if ($tableExists) {
?>
<?php echo CHtml::form(array('admin/dataentry/sa/vvimport/surveyid/'.$surveyid), 'post', array('enctype'=>'multipart/form-data', 'id'=>'vvexport'));?>
<ul class="list-unstyled">
<li>
<label for='csv_vv_file'><?php eT("File:"); ?></label>
<?php echo CHtml::fileField('csv_vv_file'); ?>
</li>
<li>
<label for='noid'><?php eT("Exclude record IDs?"); ?></label>
<?php echo CHtml::checkBox('noid',true,array('value'=>"noid",'onChange' => 'javascript:form.insertmethod.disabled=this.checked')) ?>
<!-- <input type='checkbox' id='noid' name='noid' value='noid' checked=checked onchange='form.insertmethod.disabled=this.checked;' /> -->
</li>
<li>
<label for='insertmethod'><?php eT("When an imported record matches an existing record ID:"); ?></label>
<?php echo CHtml::dropDownList('insertmethod', 'ignore', array(
'skip' => gT("Report and skip the new record."),
'renumber' => gT("Renumber the new record."),
'replace' => gT("Replace the existing record."),
'replaceanswers' => gT("Replace answers in file in the existing record."),
),array('disabled'=>'disabled','class'=>'form-control')); ?>
</li>
<li>
<label for='notfinalized'><?php eT("Import as not finalized answers?"); ?></label>
<?php echo CHtml::checkBox('notfinalized',false,array('value'=>"notfinalized")); ?>
</li>
<li>
<label for='vvcharset'><?php eT("Character set of the file:"); ?></label>
<?php echo CHtml::dropDownList('vvcharset',false,$aEncodings,array('class'=>'form-control', 'empty' => gT('Automatic (UTF-8)'))); ?>
</li>
<li>
<label for='dontdeletefirstline' title='<?php eT("With real vv file : questions code are in second line"); ?>'><?php eT("First line contains the code of questions:"); ?></label>
<?php echo CHtml::checkBox('dontdeletefirstline',false,array('value'=>"dontdeletefirstline")); ?>
</li>
<li>
<label for='forceimport' title='<?php eT("Try to import even if question codes don't match"); ?>'><?php eT("Force import:"); ?></label>
<?php echo CHtml::checkBox('forceimport',false,array('value'=>"forceimport")); ?>
</li>
</ul>
<?php echo CHtml::form(array('admin/dataentry/sa/vvimport/surveyid/'.$surveyid), 'post', array('enctype'=>'multipart/form-data', 'id'=>'vvexport', 'class'=>'form-horizontal'));?>

<div class="panel panel-primary" id="pannel-1" style="opacity: 1; top: 0px;">
<div class="panel-heading">
<h4 class="panel-title">
<?php eT("General");?>
</h4>
</div>

<div class="panel-body">
<div class="form-group">
<label for="csv_vv_file" class="col-sm-2 control-label">
<?php eT("File:");?>
</label>
<div class="col-sm-4">
<input type="file" value="" name="csv_vv_file" id="csv_vv_file" class="form-control">
</div>
</div>

<div class="form-group">
<label for="noid" class="col-sm-2 control-label">
<?php eT("Exclude record IDs?"); ?>
</label>
<div class="col-sm-4">
<?php echo CHtml::checkBox('noid',true,array('value'=>"noid",'onChange' => 'javascript:form.insertmethod.disabled=this.checked')) ?>
</div>
</div>

<div class="form-group">
<label for="insertmethod" class="col-sm-2 control-label">
<?php eT("When an imported record matches an existing record ID:"); ?>
</label>
<div class="col-sm-4">
<?php echo CHtml::dropDownList('insertmethod', 'ignore', array(
'skip' => gT("Report and skip the new record."),
'renumber' => gT("Renumber the new record."),
'replace' => gT("Replace the existing record."),
'replaceanswers' => gT("Replace answers in file in the existing record."),
),array('disabled'=>'disabled','class'=>'form-control')); ?>

</div>
</div>

<div class="form-group">
<label for="notfinalized" class="col-sm-2 control-label">
<?php eT("Import as not finalized answers?"); ?>
</label>
<div class="col-sm-4">
<?php echo CHtml::checkBox('notfinalized',false,array('value'=>"notfinalized")); ?>
</div>
</div>

<div class="form-group">
<label for="vvcharset" class="col-sm-2 control-label">
<?php eT("Character set of the file:"); ?>
</label>
<div class="col-sm-4">
<?php echo CHtml::dropDownList('vvcharset',false,$aEncodings,array('class'=>'form-control', 'empty' => gT('Automatic (UTF-8)'))); ?>
</div>
</div>

<div class="form-group">
<label for="dontdeletefirstline" class="col-sm-2 control-label" title='<?php eT("With real vv file : questions code are in second line"); ?>' data-toggle="tooltip" data-placement="right">
<?php eT("First line contains the code of questions:"); ?>
</label>
<div class="col-sm-4">
<?php echo CHtml::checkBox('dontdeletefirstline',false,array('value'=>"dontdeletefirstline")); ?>
</div>
</div>

<div class="form-group">
<label for="forceimport" class="col-sm-2 control-label" title='<?php eT("Try to import even if question codes don't match"); ?>' data-toggle="tooltip" data-placement="right">
<?php eT("Force import:"); ?>
</label>
<div class="col-sm-4">
<?php echo CHtml::checkBox('forceimport',false,array('value'=>"forceimport")); ?>
</div>
</div>


</div>
</div>

<p>
<input type='submit' class="hidden" value='<?php eT("Import"); ?>' />
<input type='hidden' name='action' value='vvimport' />
Expand All @@ -57,7 +102,7 @@
<br />

<?php } else { ?>

<div class="jumbotron message-box message-box-error">
<h2 class="danger"><?php eT("Import a VV response data file"); ?>:</h2>
<p class="lead text-danger">
Expand All @@ -69,8 +114,8 @@
<p>
<a class="btn btn-lg btn-default" href='<?php echo $this->createUrl('admin/survey/sa/view/'.$surveyid); ?>'><?php eT("Return to survey administration"); ?></a>
</p>
</div>
</div>

<?php } ?>

</div></div></div>
2 changes: 1 addition & 1 deletion application/views/admin/export/vv_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="panel-body">
<div class="form-group">
<label for="surveyid" class="col-sm-2 control-label">
<?php eT("Survey id:");?>
<?php eT("Survey ID:");?>
</label>
<div class="col-sm-4">
<?php echo CHtml::textField('surveyid', $surveyid, array('size'=>10, 'readonly'=>'readonly', 'class'=>'form-control')); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
var strCantDeleteLastAnswer = '<?php eT('You cannot delete the last answer option.','js'); ?>';
var duplicatesubquestioncode = '<?php eT('Error: You are trying to use duplicate subquestion codes.','js'); ?>';
var clickToExpand = '<?php eT('Click to expand'); ?>';
//Érror Code translations
var errorReservedWord = '<?php echo gT("You have used a reserved word as code.")."<br/>".gT("Reserved words are: "); ?>';
</script>
<?php elseif($viewType=='answerOptions'):?>
<script>
Expand Down
Loading

0 comments on commit 4a966bb

Please sign in to comment.