Skip to content

Commit

Permalink
Dev: redesigned statistics view filters
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Dec 17, 2015
1 parent adde88a commit c78b56b
Show file tree
Hide file tree
Showing 17 changed files with 228 additions and 149 deletions.
8 changes: 8 additions & 0 deletions application/controllers/admin/statistics.php
Expand Up @@ -643,6 +643,14 @@ function graph()
*/
protected function _renderWrappedTemplate($sAction = 'export', $aViewUrls = array(), $aData = array())
{
//$switch = realpath(__DIR__ . '/../..').'/widgets/switch/assets/js/bootstrap-switch.min.js ';
$switch = Yii::app()->getBaseUrl(true).'/application/extensions/yiiwheels/widgets/switch/assets/js/bootstrap-switch.min.js ';
//var_dump($switch);
//App()->getClientScript()->registerScriptFile( App()->getAssetManager()->publish( $switch) );
App()->getClientScript()->registerScriptFile( $switch );


//

$aData['display']['menu_bars'] = false;
$aData['display']['menu_bars']['browse'] = gT('Browse responses'); // browse is independent of the above
Expand Down
@@ -1,51 +1,55 @@
<fieldset style='clear:both;'>
<legend><?php eT("Data selection"); ?></legend>
<div class="panel panel-primary" id="pannel-1">
<div class="panel-heading">
<h4 class="panel-title"><?php eT("Data selection"); ?></h4>
</div>
<div class="panel-body">

<div class="form-group">
<label for='completionstate' class="col-sm-5 control-label"><?php eT("Include:"); ?> </label>
<div class="form-group">
<label for='completionstate' class="col-sm-4 control-label"><?php eT("Include:"); ?> </label>

<div class="col-sm-5">
<select name='completionstate' id='completionstate' class='form-control'>
<option value='all' <?php echo $selectshow; ?>><?php eT("All responses"); ?></option>
<option value='complete' <?php echo $selecthide; ?> > <?php eT("Completed responses only"); ?></option>
<option value='incomplete' <?php echo $selectinc; ?> > <?php eT("Incomplete responses only"); ?></option>
</select>
</div>
</div>
<div class="col-sm-4">
<select name='completionstate' id='completionstate' class='form-control'>
<option value='all' <?php echo $selectshow; ?>><?php eT("All responses"); ?></option>
<option value='complete' <?php echo $selecthide; ?> > <?php eT("Completed responses only"); ?></option>
<option value='incomplete' <?php echo $selectinc; ?> > <?php eT("Incomplete responses only"); ?></option>
</select>
</div>
</div>

<div class='form-group'>
<label class="col-sm-5 control-label" for='viewsummaryall'><?php eT("View summary of all available fields"); ?></label>
<div class='col-sm-7'>
<input type='checkbox' id='viewsummaryall' name='viewsummaryall' <?php if (isset($_POST['viewsummaryall'])) { echo "checked='checked'";} ?> />
</div>
</div>
<div class='form-group'>
<label class="col-sm-4 control-label" for='viewsummaryall'><?php eT("View summary of all available fields"); ?></label>
<div class='col-sm-1'>
<input type='checkbox' id='viewsummaryall' name='viewsummaryall' <?php if (isset($_POST['viewsummaryall'])) { echo "checked='checked'";} ?> />
</div>
</div>

<div class='form-group'>
<label class="col-sm-5 control-label" id='noncompletedlbl' for='noncompleted' title='<?php eT("Count stats for each question based only on the total number of responses for which the question was displayed"); ?>'><?php eT("Subtotals based on displayed questions"); ?></label>
<div class='col-sm-7'>
<input type='checkbox' id='noncompleted' name='noncompleted' <?php if (isset($_POST['noncompleted'])) {echo "checked='checked'"; } ?> />
</div>
</div>
<div class='form-group'>
<label class="col-sm-4 control-label" id='noncompletedlbl' for='noncompleted' title='<?php eT("Count stats for each question based only on the total number of responses for which the question was displayed"); ?>'><?php eT("Subtotals based on displayed questions"); ?></label>
<div class='col-sm-1'>
<input type='checkbox' id='noncompleted' name='noncompleted' <?php if (isset($_POST['noncompleted'])) {echo "checked='checked'"; } ?> />
</div>
</div>

<?php
$language_options="";
foreach ($survlangs as $survlang)
{
$language_options .= "\t<option value=\"{$survlang}\"";
if ($sStatisticsLanguage == $survlang)
{
$language_options .= " selected=\"selected\" " ;
}
$temp = getLanguageNameFromCode($survlang,true);
$language_options .= ">".$temp[1]."</option>\n";
}
<?php
$language_options="";
foreach ($survlangs as $survlang)
{
$language_options .= "\t<option value=\"{$survlang}\"";
if ($sStatisticsLanguage == $survlang)
{
$language_options .= " selected=\"selected\" " ;
}
$temp = getLanguageNameFromCode($survlang,true);
$language_options .= ">".$temp[1]."</option>\n";
}

?>
?>

<div class='form-group'>
<label for='statlang' class="col-sm-5 control-label" ><?php eT("Statistics report language"); ?></label>
<div class='col-sm-5'>
<select name="statlang" id="statlang" class="form-control"><?php echo $language_options; ?></select>
<div class='form-group'>
<label for='statlang' class="col-sm-4 control-label" ><?php eT("Statistics report language"); ?></label>
<div class='col-sm-4'>
<select name="statlang" id="statlang" class="form-control"><?php echo $language_options; ?></select>
</div>
</div>
</div>
</div>
</fieldset>
16 changes: 5 additions & 11 deletions application/views/admin/export/statistics_subviews/_header.php
@@ -1,11 +1,5 @@
<div class='header statistics col-lg-12 box text-left'>
<div style='float:right;'>
<span id='showgfilter' alt='<?php eT("Maximize"); ?>' class="icon-maximize" ></span>
<span id='hidegfilter' alt='<?php eT("Minimize"); ?>' class="icon-minimize" ></span>
</div>

<div style='float:left;'>
<?php eT("General filters"); ?>
</div>

</div>
<!-- views/admin/export/statistics_subviews/_header.php -->
<h3 id="survey-action-title">
<?php eT("General filters"); ?>
<span data-url="/LimeSurveyNext/index.php/admin/survey/sa/togglequickaction" id="generalfilters-chevron" class="glyphicon glyphicon-chevron-up"></span>
</h3>
@@ -1,21 +1,19 @@
<fieldset>
<legend><?php eT("Select output format"); ?>:</legend>
<div class="form-group col-sm-12">
<label class="col-sm-5 control-label" for='outputtypehtml'>HTML</label>
<div class='col-sm-5'>
<input type='radio' id="outputtypehtml" name='outputtype' value='html' checked='checked' />
<div class="panel panel-primary " id="pannel-1">
<div class="panel-heading">
<h4 class="panel-title"><?php eT("Select output format"); ?>:</h4>
</div>
</div>
<div class="form-group col-sm-12">
<label class="col-sm-5 control-label" for='outputtypepdf'>PDF</label>
<div class='col-sm-5'>
<input type='radio' id="outputtypepdf" name='outputtype' value='pdf' />
</div>
</div>
<div class="form-group col-sm-12">
<label class="col-sm-5 control-label" for='outputtypexls'>Excel</label>
<div class='col-sm-5'>
<input type='radio' id="outputtypexls" onclick='nographs();' name='outputtype' value='xls' />
<div class="panel-body">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default">
<input name="outputtype" value="html" type="radio" checked='checked' id="outputtypehtml" ><?php eT('HTML');?>
</label>
<label class="btn btn-default">
<input name="outputtype" value="pdf" type="radio" id="outputtypepdf"><?php eT('PDF');?>
</label>
<label class="btn btn-default">
<input name="outputtype" value="xls" class="active" type="radio" id="outputtypexls" onclick='nographs();'><?php eT('Excel'); ?>
</label>
</div>
</div>

</div>
</fieldset>
@@ -1,44 +1,49 @@
<fieldset>
<legend><?php eT("Output options"); ?></legend>
<div class='form-group'>
<label for='showtextinline' class="col-sm-5 control-label" ><?php eT("Show text responses inline:") ?></label>
<div class='col-sm-5'>
<input type='checkbox' id='showtextinline' name='showtextinline'<?php if(isset($showtextinline) && $showtextinline == 1) {echo "checked='checked'"; } ?> />
</div>
<div class="panel panel-primary" id="pannel-1">
<div class="panel-heading">
<h4 class="panel-title"><?php eT("Output options"); ?></h4>
</div>
<div class="panel-body">
<div class='form-group'>
<label for='showtextinline' class="col-sm-5 control-label" ><?php eT("Show text responses inline:") ?></label>
<div class='col-sm-1'>
<input type='checkbox' id='showtextinline' name='showtextinline' <?php if(isset($showtextinline) && $showtextinline == 1) {echo "checked='checked'"; } ?> />
</div>
</div>

<div class='form-group'>
<label for='usegraph' class="col-sm-5 control-label" ><?php eT("Show graphs"); ?></label>
<div class='col-sm-5'>
<input type='checkbox' id='usegraph' name='usegraph' <?php if (isset($usegraph) && $usegraph == 1) { echo "checked='checked'"; } ?> />
<div class='form-group'>
<label for='usegraph' class="col-sm-5 control-label" ><?php eT("Show graphs"); ?></label>
<div class='col-sm-1'>
<input type='checkbox' id='usegraph' name='usegraph' <?php if (isset($usegraph) && $usegraph == 1) { echo "checked='checked'"; } ?> />
</div>
<?php if($error != '') { echo "<div id='grapherror' style='display:none'>$error<hr /></div>"; } ?>
</div>
<?php if($error != '') { echo "<div id='grapherror' style='display:none'>$error<hr /></div>"; } ?>
</div>

<div class="form-group col-sm-12">
<div class="col-sm-offset-1 alert alert-info alert-dismissible" role="alert">
<button type="button" class="close limebutton" data-dismiss="alert" aria-label="Close"><span>×</span></button>
<?php eT("Each question has its own graph type defined in its advanced settings.");?>
<br/>
<?php eT("With chart type selector, you can force the use of graph type for all selected questions)");?>
<div class="form-group col-sm-12">
<div class="col-sm-offset-1 alert alert-info alert-dismissible" role="alert">
<button type="button" class="close limebutton" data-dismiss="alert" aria-label="Close"><span>×</span></button>
<?php eT("Each question has its own graph type defined in its advanced settings.");?>
<br/>
<?php eT("With chart type selector, you can force the use of graph type for all selected questions)");?>
</div>
</div>
</div>

<div class="form-group col-sm-12">
<label for='charttype' class="col-sm-5 control-label">
<?php eT('Chart type:');?>
</label>
<div class="form-group col-sm-12">
<label for='charttype' class="col-sm-5 control-label">
<?php eT('Chart type:');?>
</label>

<div class='col-sm-5'>
<select name="charttype" id='charttype' class="form-control">
<option value="default" selected="selected"><?php eT('as defined in questions\'s advanced setting');?></option>
<option value="0" ><?php eT('bar chart');?></option>
<option value="1"><?php eT('pie chart');?></option>
<option value="2"><?php eT('radar chart');?></option>
<option value="3"><?php eT('line chart');?></option>
<option value="4"><?php eT('polar chart');?></option>
<option value="5"><?php eT('doughnut chart');?></option>
</select>
<div class='col-sm-5'>
<select name="charttype" id='charttype' class="form-control">
<option value="default" selected="selected"><?php eT('as defined in questions\'s advanced setting');?></option>
<option value="0" ><?php eT('bar chart');?></option>
<option value="1"><?php eT('pie chart');?></option>
<option value="2"><?php eT('radar chart');?></option>
<option value="3"><?php eT('line chart');?></option>
<option value="4"><?php eT('polar chart');?></option>
<option value="5"><?php eT('doughnut chart');?></option>
</select>
</div>
</div>

</div>
</fieldset>
</div>
@@ -1,10 +1,5 @@
<div class='header statistics col-lg-12 box text-left' id="response-filter-header">
<div style='float:right'>
<span id='showfilter' alt='<?php eT("Maximize"); ?>' class="icon-maximize" ></span>
<span id='hidefilter' alt='<?php eT("Minimize"); ?>' class="icon-minimize" ></span>

</div>
<div style='float:left'>
<?php eT("Response filters"); ?>
</div>
</div>
<!-- views/admin/export/statistics_subviews/_header.php -->
<h3 id="survey-action-title">
<?php eT("Response filters"); ?>
<span data-url="/LimeSurveyNext/index.php/admin/survey/sa/togglequickaction" id="responsefilters-chevron" class="glyphicon glyphicon-chevron-up"></span>
</h3>
28 changes: 16 additions & 12 deletions application/views/admin/export/statistics_subviews/_responseid.php
@@ -1,16 +1,20 @@
<fieldset id='left'>
<legend><?php eT("Response ID"); ?></legend>
<div class='form-group'>
<label class="col-sm-5 control-label" for='idG'><?php eT("Greater than:"); ?></label>
<div class='col-sm-5'>
<input type='text' id='idG' name='idG' size='10' value='<?php if (isset($_POST['idG'])){ echo sanitize_int($_POST['idG']);} ?>' onkeypress="return goodchars(event,'0123456789')" />
<div class="panel panel-primary" id="pannel-1">
<div class="panel-heading">
<h4 class="panel-title"><?php eT("Response ID"); ?></h4>
</div>
</div>
<div class="panel-body">
<div class='form-group'>
<label class="col-sm-5 control-label" for='idG'><?php eT("Greater than:"); ?></label>
<div class='col-sm-5'>
<input type='number' id='idG' name='idG' size='10' value='<?php if (isset($_POST['idG'])){ echo sanitize_int($_POST['idG']);} ?>' onkeypress="return goodchars(event,'0123456789')" />
</div>
</div>

<div class='form-group'>
<label class="col-sm-5 control-label" for='idL'><?php eT("Less than:"); ?></label>
<div class='col-sm-5'>
<input type='text' id='idL' name='idL' size='10' value='<?php if (isset($_POST['idL'])) { echo sanitize_int($_POST['idL']);} ?>' onkeypress="return goodchars(event,'0123456789')" />
<div class='form-group'>
<label class="col-sm-5 control-label" for='idL'><?php eT("Less than:"); ?></label>
<div class='col-sm-5'>
<input type='number' id='idL' name='idL' size='10' value='<?php if (isset($_POST['idL'])) { echo sanitize_int($_POST['idL']);} ?>' onkeypress="return goodchars(event,'0123456789')" />
</div>
</div>
</div>
</div>
</fieldset>
30 changes: 16 additions & 14 deletions application/views/admin/export/statistics_view.php
Expand Up @@ -7,7 +7,7 @@
<!-- Javascript variables -->
<?php $this->renderPartial('/admin/export/statistics_subviews/_statistics_view_scripts', array('sStatisticsLanguage'=>$sStatisticsLanguage, 'surveyid'=>$surveyid, 'showtextinline'=>$showtextinline)) ; ?>

<div class="side-body">
<div class="side-body statisticsview">
<h3>
<span class="glyphicon glyphicon-stats"></span> &nbsp;&nbsp;&nbsp;
<?php eT("Statistics"); ?>
Expand All @@ -21,27 +21,29 @@
<?php $this->renderPartial('/admin/export/statistics_subviews/_header', array()) ; ?>

<!-- AUTOSCROLLING DIV CONTAINING GENERAL FILTERS -->
<div id='statisticsgeneralfilters' class='statisticsfilters jumbotron message-box box col-lg-12' <?php if ($filterchoice_state!='' || !empty($summary)) { echo " style='display:none' "; } ?>>

<div id='statisticsgeneralfilters' class='statisticsfilters' <?php if ($filterchoice_state!='' || !empty($summary)) { echo " style='display:none' "; } ?>>
<div id='statistics_general_filter'>

<!-- Data Selection -->
<?php $this->renderPartial('/admin/export/statistics_subviews/_dataselection', array('selectshow'=>$selectshow, 'selecthide'=>$selecthide, 'selectinc'=>$selectinc, 'survlangs'=>$survlangs, 'sStatisticsLanguage'=>$sStatisticsLanguage)) ; ?>
<div class="col-sm-6">
<!-- Data Selection -->
<?php $this->renderPartial('/admin/export/statistics_subviews/_dataselection', array('selectshow'=>$selectshow, 'selecthide'=>$selecthide, 'selectinc'=>$selectinc, 'survlangs'=>$survlangs, 'sStatisticsLanguage'=>$sStatisticsLanguage)) ; ?>

<!-- Response ID -->
<?php $this->renderPartial('/admin/export/statistics_subviews/_responseid', array()) ; ?>
<!-- Response ID -->
<?php $this->renderPartial('/admin/export/statistics_subviews/_responseid', array()) ; ?>

<!-- Submission date -->
<?php $this->renderPartial('/admin/export/statistics_subviews/_submissiondate', array('datestamp'=>$datestamp)) ; ?>
<!-- Submission date -->
<?php $this->renderPartial('/admin/export/statistics_subviews/_submissiondate', array('datestamp'=>$datestamp)) ; ?>
</div>

<!-- Output options -->
<?php $this->renderPartial('/admin/export/statistics_subviews/_outputoptions', array('error'=>$error, 'showtextinline'=>$showtextinline, 'usegraph'=>$usegraph, 'showtextinline'=>$showtextinline)) ; ?>
<div class="col-sm-6">
<!-- Output options -->
<?php $this->renderPartial('/admin/export/statistics_subviews/_outputoptions', array('error'=>$error, 'showtextinline'=>$showtextinline, 'usegraph'=>$usegraph, 'showtextinline'=>$showtextinline)) ; ?>

<!-- Output format -->
<?php $this->renderPartial('/admin/export/statistics_subviews/_outputformat', array()) ; ?>
<!-- Output format -->
<?php $this->renderPartial('/admin/export/statistics_subviews/_outputformat', array()) ; ?>
</div>
</div>


<p>
<input type='hidden' name='summary[]' value='idG' />
<input type='hidden' name='summary[]' value='idL' />
Expand Down
1 change: 0 additions & 1 deletion scripts/admin/admin_core.js
Expand Up @@ -126,7 +126,6 @@ $(document).ready(function(){
alert('error');
}
});

});


Expand Down

0 comments on commit c78b56b

Please sign in to comment.