Skip to content

Commit

Permalink
Fixed issue #9498: Error message when try to import a big LSA file ca…
Browse files Browse the repository at this point in the history
…n be an error

Dev Partial fix - show max upload size in UI
  • Loading branch information
c-schmitz committed Jun 5, 2016
1 parent 89151a7 commit af24ba7
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 23 deletions.
10 changes: 5 additions & 5 deletions application/views/admin/labels/editlabel_view.php
Expand Up @@ -105,27 +105,27 @@
<div id='neweditlblset1' class="tab-pane fade in" >
<?php echo CHtml::form(array("admin/labels/sa/import"), 'post',array('enctype'=>'multipart/form-data', 'class'=>'form-horizontal','id'=>'importlabels','name'=>"importlabels")); ?>
<div class="form-group">
<label class="col-sm-2 control-label" for='the_file'>
<?php eT("Select label set file (*.lsl):"); ?>
<label class="col-sm-3 control-label" for='the_file'>
<?php echo gT("Select label set file (*.lsl):").'<br>'.sprintf(gT("(Maximum file size: %01.2f MB)"),getMaximumFileUploadSize()/1024/1024); ?>
</label>
<input id='the_file' name='the_file' type='file'/>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for='checkforduplicates'>
<label class="col-sm-3 control-label" for='checkforduplicates'>
<?php eT("Don't import if label set already exists:"); ?>
</label>
<input name='checkforduplicates' id='checkforduplicates' type='checkbox' checked='checked' />
</div>

<div class="form-group">
<label class="col-sm-2 control-label" for='translinksfields'>
<label class="col-sm-3 control-label" for='translinksfields'>
<?php eT("Convert resources links?"); ?>
</label>
<input name='translinksfields' id='translinksfields' type='checkbox' checked='checked' />
</div>

<div class="form-group">
<div class="col-sm-offset-1">
<div class="col-sm-offset-2">
<input type='submit' class='btn btn-default' value='<?php eT("Import label set(s)"); ?>' />
<input type='hidden' name='action' value='importlabels' />
</div>
Expand Down
18 changes: 10 additions & 8 deletions application/views/admin/survey/Question/importQuestion_view.php
@@ -1,8 +1,8 @@
<?php
<?php
/**
* This view display the page to add a new question to a controller, and to choose its group.
* TODO : It will have to be merged with other question function such as "edit" or "copy".
*
* TODO : It will have to be merged with other question function such as "edit" or "copy".
*
*/
?>
<div id='edit-question-body' class='side-body <?php echo getSideBodyClass(false); ?>'>
Expand All @@ -11,18 +11,20 @@
<div class="col-lg-12">
<?php echo CHtml::form(array("admin/questions/sa/import"), 'post', array('id'=>'importquestion', 'class'=>'form-horizontal', 'name'=>'importquestion', 'enctype'=>'multipart/form-data','onsubmit'=>"return validatefilename(this, '".gT("Please select a file to import!",'js')."');")); ?>
<div class="form-group">
<label class="col-sm-2 control-label" for='the_file'><?php eT("Select LimeSurvey question file (*.lsq)"); ?>:</label>
<label class="col-sm-2 control-label" for='the_file'><?php eT("Select question file (*.lsq):");
echo '<br>'.sprintf(gT("(Maximum file size: %01.2f MB)"),getMaximumFileUploadSize()/1024/1024);?>
</label>
<div class="col-sm-3">
<input name='the_file' class="form-control" id='the_file' type="file" required="required" accept=".lsq,.csv" />
<input name='the_file' id='the_file' type="file" required="required" accept=".lsq,.csv" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for='the_file'><?php eT("Question group:"); ?></label>
<div class="col-sm-3">
<select name='gid' id='gid' class="form-control">
<?php echo getGroupList3($groupid, $surveyid); ?>
</select>
</div>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for='translinksfields'><?php eT("Convert resource links?"); ?></label>
Expand All @@ -34,7 +36,7 @@
<input type='submit' class="hidden" value='<?php eT("Import Question"); ?>' />
<input type='hidden' name='action' value='importquestion' />
<input type='hidden' name='sid' value='<?php echo $surveyid; ?>' />
</form>
</form>
</div>
</div>
</div>
Expand Down
@@ -1,6 +1,6 @@
<?php
/**
* Import a group view
* Import a group view
*/
?>

Expand All @@ -10,23 +10,25 @@
<div class="col-lg-12">
<!-- form -->
<?php echo CHtml::form(array("admin/questiongroups/sa/import"), 'post', array('id'=>'importgroup', 'name'=>'importgroup', 'class'=>'form30 form-horizontal', 'enctype'=>'multipart/form-data', 'onsubmit'=>'return validatefilename(this,"'.gT('Please select a file to import!','js').'");')); ?>

<!-- Select question group file -->
<div class="form-group">
<label for='the_file' class="col-sm-2 control-label"><?php eT("Select question group file (*.lsg):"); ?></label>
<label for='the_file' class="col-sm-2 control-label"><?php eT("Select question group file (*.lsg):");
echo '<br>'.sprintf(gT("(Maximum file size: %01.2f MB)"),getMaximumFileUploadSize()/1024/1024);
?></label>
<div class="col-sm-3">
<input id='the_file' name="the_file" type="file" class="form-control" />
</div>
<input id='the_file' name="the_file" type="file" />
</div>
</div>

<!-- Convert resource links -->
<div class="form-group">
<label for='translinksfields' class="col-sm-2 control-label"><?php eT("Convert resource links?"); ?></label>
<div class="col-sm-10">
<input id='translinksfields' name="translinksfields" type="checkbox" checked="checked" />
</div>
</div>

<input type='submit' class="hidden" value='<?php eT("Import question group"); ?>' />
<input type='hidden' name='action' value='importgroup' />
<input type='hidden' name='sid' value='<?php echo $surveyid; ?>' />
Expand Down
4 changes: 3 additions & 1 deletion application/views/admin/survey/subview/tabImport_view.php
Expand Up @@ -10,7 +10,9 @@

<!-- Select file -->
<div class='form-group '>
<label class='control-label col-sm-3' for='the_file'><?php eT("Select survey structure file (*.lss, *.csv, *.txt) or survey archive (*.lsa):"); ?> </label>
<label class='control-label col-sm-3' for='the_file'>
<?php printf(gT("Select survey structure file (*.lss, *.csv, *.txt) or survey archive (*.lsa) (maximum file size: %01.2f MB)"),getMaximumFileUploadSize()/1024/1024); ?>
</label>
<div class='col-sm-4'>
<input id='the_file' name="the_file" type="file" />
</div>
Expand Down
Expand Up @@ -244,6 +244,7 @@ function copyprompt(text, defvalue, copydirectory, action)
<div class="form-group">
<label for='the_file'><?php eT("Select template ZIP file:") ?></label>
<input id='the_file' name='the_file' type="file" />
<?php printf(gT('(Maximum file size: %01.2f MB)'),getMaximumFileUploadSize()/1024/1024); ?>
</div>
</div>
<div class="modal-footer">
Expand Down
5 changes: 3 additions & 2 deletions application/views/admin/templates/templatesummary_view.php
Expand Up @@ -107,7 +107,7 @@
{ ?>

<?php echo CHtml::form(array('admin/templates/sa/uploadfile'), 'post', array('id'=>'importtemplatefile', 'name'=>'importtemplatefile', 'enctype'=>'multipart/form-data')); ?>
<?php eT("Upload a file:"); ?>
<?php printf(gT("Upload a file (maximum size: %d MB):"),getMaximumFileUploadSize()/1024/1024); ?>
<br>
<input name='upload_file' id="upload_file" type="file" required="required"/>
<input type='submit' value='<?php eT("Upload"); ?>' class='btn btn-default'
Expand Down Expand Up @@ -147,7 +147,8 @@
<code>background-image: url('../files/yourpicture.png');</code><br/><br/>
<?php eT("To place the logo anywhere in a .pstpl file: ");?><br/>
<code>{SITELOGO}</code><br/>
<?php eT("This will generate a responsive image containing the logo file.");?><br/>
<?php eT("This will generate a responsive image containing the logo file.");?><br/><br>

</div>

<div class="modal-footer">
Expand Down

0 comments on commit af24ba7

Please sign in to comment.