Skip to content

Commit

Permalink
Dev: copy/import survey display
Browse files Browse the repository at this point in the history
  • Loading branch information
louis committed Sep 21, 2015
1 parent 76ec2a0 commit ed57a53
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 30 deletions.
121 changes: 95 additions & 26 deletions application/views/admin/survey/subview/tabCopy_view.php
@@ -1,31 +1,100 @@
<div id='copy' class="tab-pane fade in">
<?php echo CHtml::form(array('admin/survey/sa/copy'), 'post', array('id'=>'copysurveyform', 'name'=>'copysurveyform', 'class'=>'form30')); ?>
<ul>
<li><label for='copysurveylist'><?php eT("Select survey to copy:"); ?> </label>
<select id='copysurveylist' name='copysurveylist' required="required">
<?php echo getSurveyList(false); ?> </select> <span class='annotation'><?php echo gT("Required"); ?> </span></li>
<li><label for='copysurveyname'><?php echo gT("New survey title:"); ?> </label>
<input type='text' id='copysurveyname' size='82' maxlength='200' name='copysurveyname' value='' required="required" />
<span class='annotation'><?php echo gT("Required"); ?> </span></li>
<li><label for='copysurveyid'><?php echo gT("New survey id:"); ?> </label>
<input type='text' id='copysurveyid' size='82' maxlength='6' name='copysurveyid' value=''/>
<span class='annotation'><?php echo gT("Optional"); ?> </span></li>
<?php echo CHtml::form(array('admin/survey/sa/copy'), 'post', array('id'=>'copysurveyform', 'name'=>'copysurveyform', 'class'=>'form30 form-horizontal')); ?>

<!-- Select survey -->
<div class="form-group">
<label for='copysurveylist' class="col-sm-3 control-label"><?php eT("Select survey to copy:"); ?> </label>
<div class="col-sm-5">
<select id='copysurveylist' name='copysurveylist' required="required" class="form-control">
<?php echo getSurveyList(false); ?>
</select>
</div>
<div class="col-sm-2">
<p class="form-control-static">
<span class='annotation text-warning'><?php echo gT("Required"); ?> </span>
</p>
</div>
</div>

<!-- New survey title -->
<div class="form-group">
<label for='copysurveyname' class="col-sm-3 control-label"><?php echo eT("New survey title:"); ?> </label>
<div class="col-sm-5">
<input type='text' id='copysurveyname' size='82' maxlength='200' name='copysurveyname' value='' required="required" class="form-control" />
</div>
<div class="col-sm-2">
<p class="form-control-static">
<span class='annotation text-warning'><?php echo gT("Required"); ?> </span>
</p>
</div>
</div>

<!-- New survey id -->
<div class="form-group">
<label class="col-sm-3 control-label" for='copysurveyid'><?php echo eT("New survey id:"); ?> </label>
<div class="col-sm-5">
<input type='text' id='copysurveyid' size='82' maxlength='6' name='copysurveyid' value='' class="form-control" />
</div>
<div class="col-sm-2">
<p class="form-control-static">
<span class='annotation text-info'><?php echo gT("Optional"); ?> </span>
</p>
</div>
</div>

<li><label for='copysurveytranslinksfields'><?php echo gT("Convert resource links and INSERTANS fields?"); ?> </label>
<input id='copysurveytranslinksfields' name="copysurveytranslinksfields" type="checkbox" checked='checked'/></li>
<li><label for='copysurveyexcludequotas'><?php eT("Exclude quotas?"); ?></label>
<input id='copysurveyexcludequotas' name="copysurveyexcludequotas" type="checkbox" /></li>
<li><label for='copysurveyexcludepermissions'><?php echo gT("Exclude survey permissions?"); ?> </label>
<input id='copysurveyexcludepermissions' name="copysurveyexcludepermissions" type="checkbox"/></li>
<li><label for='copysurveyexcludeanswers'><?php echo gT("Exclude answers?"); ?> </label>
<input id='copysurveyexcludeanswers' name="copysurveyexcludeanswers" type="checkbox" /></li>
<li><label for='copysurveyresetconditions'><?php echo gT("Reset conditions/relevance?"); ?></label>
<input id='copysurveyresetconditions' name="copysurveyresetconditions" type="checkbox" /></li>
<li><label for='copysurveyresetstartenddate'><?php echo gT("Reset start/end date/time?"); ?></label>
<input id='copysurveyresetstartenddate' name="copysurveyresetstartenddate" type="checkbox" /></li>
</ul>
<p><input type='submit' value='<?php eT("Copy survey"); ?>' />
<!-- Convert resource links -->
<div class="form-group">
<label class="col-sm-3 control-label" for='copysurveytranslinksfields'><?php echo eT("Convert resource links and INSERTANS fields?"); ?> </label>
<div class="col-sm-5">
<input id='copysurveytranslinksfields' name="copysurveytranslinksfields" type="checkbox" checked='checked'/>
</div>
</div>

<!-- Exclude quotas -->
<div class="form-group">
<label class="col-sm-3 control-label" for='copysurveyexcludequotas'><?php echo eT("Exclude quotas?"); ?> </label>
<div class="col-sm-5">
<input id='copysurveyexcludequotas' name="copysurveyexcludequotas" type="checkbox" />
</div>
</div>

<!-- Exclude survey permissions -->
<div class="form-group">
<label class="col-sm-3 control-label" for='copysurveyexcludepermissions'><?php echo eT("Exclude survey permissions?"); ?> </label>
<div class="col-sm-5">
<input id='copysurveyexcludepermissions' name="copysurveyexcludepermissions" type="checkbox" />
</div>
</div>

<!-- Exclude answers -->
<div class="form-group">
<label class="col-sm-3 control-label" for='copysurveyexcludeanswers'><?php echo eT("Exclude answers?"); ?> </label>
<div class="col-sm-5">
<input id='copysurveyexcludeanswers' name="copysurveyexcludeanswers" type="checkbox" />
</div>
</div>

<!-- Reset conditions/relevance -->
<div class="form-group">
<label class="col-sm-3 control-label" for='copysurveyresetconditions'><?php echo eT("Reset conditions/relevance?"); ?> </label>
<div class="col-sm-5">
<input id='copysurveyresetconditions' name="copysurveyresetconditions" type="checkbox" />
</div>
</div>

<!-- Reset start/end date/time -->
<div class="form-group">
<label class="col-sm-3 control-label" for='copysurveyresetstartenddate'><?php echo eT("Reset start/end date/time?"); ?> </label>
<div class="col-sm-5">
<input id='copysurveyresetstartenddate' name="copysurveyresetstartenddate" type="checkbox" />
</div>
</div>

<div class="text-center">
<input type='submit' class='btn btn-default' value='<?php eT("Copy survey"); ?>' />
<?php if (isset($surveyid)) echo '<input type="hidden" name="sid" value="' . $surveyid . '" />'; ?>
<input type='hidden' name='action' value='copysurvey' /></p>
<input type='hidden' name='action' value='copysurvey' />
</div>

</form>
</div>
11 changes: 7 additions & 4 deletions application/views/admin/survey/subview/tabImport_view.php
@@ -1,13 +1,16 @@
<div id='import' class="tab-pane fade in">
<?php echo CHtml::form(array('admin/survey/sa/copy'), 'post', array('id'=>'importsurvey', 'name'=>'importsurvey', 'class'=>'form30', 'enctype'=>'multipart/form-data', 'onsubmit'=>'return validatefilename(this,"'. gT('Please select a file to import!', 'js').'");')); ?>
<ul>
<ul class="list-unstyled col-lg-12">
<li><label for='the_file'><?php eT("Select survey structure file (*.lss, *.csv, *.txt) or survey archive (*.lsa):"); ?> </label>
<input id='the_file' name="the_file" type="file" /></li>
<li>&nbsp;</li>
<li><label for='translinksfields'><?php eT("Convert resource links and INSERTANS fields?"); ?> </label>
<input id='translinksfields' name="translinksfields" type="checkbox" checked='checked'/></li></ul>
<p><input type='submit' value='<?php eT("Import survey"); ?>' />
<input id='translinksfields' name="translinksfields" type="checkbox" checked='checked'/>
</li>

<li><input type='submit' class="btn btn-default" value='<?php eT("Import survey"); ?>' /></li>
<?php if (isset($surveyid)) echo '<input type="hidden" name="sid" value="'.$surveyid.'" />'; ?>
<input type='hidden' name='action' value='importsurvey' /></p>
<input type='hidden' name='action' value='importsurvey' />
</ul>
</form>
</div>

0 comments on commit ed57a53

Please sign in to comment.