Skip to content

Commit

Permalink
Dev Added enhancements to survey toolbar
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_dev@8340 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Feb 3, 2010
1 parent 6bdd64a commit 9f4d7ba
Show file tree
Hide file tree
Showing 10 changed files with 388 additions and 134 deletions.
360 changes: 237 additions & 123 deletions admin/html.php

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions admin/printablesurvey.php
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ function star_replace($input)
} else {
$checkboxlayout=false;
}
$meaquery = "SELECT * FROM ".db_table_name("questions")." WHERE parent_qid={$deqrow['qid']} AND language='{$surveyprintlang}' ORDER BY question_order, question";
$meaquery = "SELECT * FROM ".db_table_name("questions")." WHERE parent_qid={$deqrow['qid']} AND scale_id=0 AND language='{$surveyprintlang}' ORDER BY question_order, question";
$mearesult = db_execute_assoc($meaquery);
if ($checkboxlayout === false)
{
Expand All @@ -1283,7 +1283,7 @@ function star_replace($input)
}

$question['ANSWER'] .= "\n<table>\n\t<thead>\n\t\t<tr>\n\t\t\t<td>&nbsp;</td>\n";
$fquery = "SELECT * FROM ".db_table_name("answers")." WHERE qid='{$deqrow['qid']}' AND scale_id=0 AND language='{$surveyprintlang}' ORDER BY sortorder, code";
$fquery = "SELECT * FROM ".db_table_name("questions")." WHERE parent_qid={$deqrow['qid']} AND scale_id=1 AND language='{$surveyprintlang}' ORDER BY question_order, question";
$fresult = db_execute_assoc($fquery);
$fcount = $fresult->RecordCount();
$fwidth = "120";
Expand All @@ -1292,9 +1292,9 @@ function star_replace($input)
$pdfoutput[0][0]=' ';
while ($frow = $fresult->FetchRow())
{
$question['ANSWER'] .= "\t\t\t<th>{$frow['answer']}</th>\n";
$question['ANSWER'] .= "\t\t\t<th>{$frow['question']}</th>\n";
$i++;
$pdfoutput[0][$i]=$frow['answer'];
$pdfoutput[0][$i]=$frow['question'];
}
$question['ANSWER'] .= "\t\t</tr>\n\t</thead>\n\n\t<tbody>\n";
$a=1; //Counter for pdfoutput
Expand Down Expand Up @@ -1343,11 +1343,11 @@ function star_replace($input)
// ==================================================================
case ";": //ARRAY (Multi Flexible) (text)
$headstyle="style='padding-left: 20px; padding-right: 7px'";
$meaquery = "SELECT * FROM ".db_table_name("questions")." WHERE parent_qid={$deqrow['qid']} AND language='{$surveyprintlang}' ORDER BY question_order, question";
$meaquery = "SELECT * FROM ".db_table_name("questions")." WHERE parent_qid={$deqrow['qid']} AND scale_id=0 AND language='{$surveyprintlang}' ORDER BY question_order, question";
$mearesult = db_execute_assoc($meaquery);

$question['ANSWER'] .= "\n<table>\n\t<thead>\n\t\t<tr>\n\t\t\t<td>&nbsp;</td>\n";
$fquery = "SELECT * FROM ".db_table_name("answers")." WHERE qid='{$deqrow['qid']}' AND language='{$surveyprintlang}' ORDER BY sortorder, code";
$fquery = "SELECT * FROM ".db_table_name("questions")." WHERE parent_qid={$deqrow['qid']} AND scale_id=1 AND language='{$surveyprintlang}' ORDER BY question_order, question";
$fresult = db_execute_assoc($fquery);
$fcount = $fresult->RecordCount();
$fwidth = "120";
Expand All @@ -1356,9 +1356,9 @@ function star_replace($input)
$pdfoutput[0][0]='';
while ($frow = $fresult->FetchRow())
{
$question['ANSWER'] .= "\t\t\t<th>{$frow['answer']}</th>\n";
$question['ANSWER'] .= "\t\t\t<th>{$frow['question']}</th>\n";
$i++;
$pdfoutput[0][$i]=$frow['answer'];
$pdfoutput[0][$i]=$frow['question'];
}
$question['ANSWER'] .= "\t\t</tr>\n\t</thead>\n\n<tbody>\n";
$a=1;
Expand Down
1 change: 0 additions & 1 deletion admin/scripts/admin_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ $(document).ready(function(){
$('#MaximizeGroupWindow').click(function(){
$('#groupdetails').show();
});

});


Expand Down
37 changes: 37 additions & 0 deletions admin/scripts/surveytoolbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// $Id: templates.js 7699 2009-09-30 22:28:50Z c_schmitz $
// based on TTabs from http://interface.eyecon.ro/

$(document).ready(function(){
$('.btnsurveybar').click(function(){
$('.btnsurveybar').attr('disabled','disabled');
$('#basicsurveybar').css('white-space','nowrap')
$('#advancedsurveybar').css('white-space','nowrap')
$('.btnsurveybar').toggle();
$('#basicsurveybar').animate({width: 'toggle'}, {duration:1500, easing:'easeOutExpo'});
$('#advancedsurveybar').animate({ width: 'toggle'}, 1500, 'easeOutExpo', function()
{
$('#basicsurveybar').css('white-space','normal')
$('#advancedsurveybar').css('white-space','normal')
$('.btnsurveybar').attr('disabled',false);
});
$.cookie('surveybarmode',$('#advancedsurveybar').css('width'));


});

if ($.cookie('surveybarmode')!='1px')
{
$('#surveyhandleright').hide();
$('#advancedsurveybar').hide();
$('#advancedsurveybar').attr('width','0%');
$('#basicsurveybar').show();
}
else
{
$('#surveyhandleleft').hide();
$('#advancedsurveybar').show();
$('#basicsurveybar').hide();
$('#basicsurveybar').attr('width','0%');
}

});
8 changes: 8 additions & 0 deletions admin/styles/default/adminstyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -1206,4 +1206,12 @@ table.limetable thead th{

table.limetable tbody tr.highlight {
background-color:#EAF2FF;
}

#surveyhandleright{
margin-right:7px;
}

#surveyhandleleft{
margin-left:7px;
}
Binary file added images/handle-left.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/handle-right.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/translate.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions qanda.php
Original file line number Diff line number Diff line change
Expand Up @@ -2738,7 +2738,7 @@ function excludeAllOthers$ia[1](value, doconditioncheck)
if ($_SESSION[$myfname] == 'Y')
{
$answer .= CHECKED;
if(in_array($ansrow['code'], $excludeallothers))
if(in_array($ansrow['title'], $excludeallothers))
{
$postrow.="\n\n<script type='text/javascript'>\n<!--\nexcludeAllOthers$ia[1]('answer$ia[1]{$ansrow['title']}', 'no');\n-->\n</script>\n";
}
Expand Down Expand Up @@ -3165,7 +3165,7 @@ function do_multiplechoice_withcomments($ia)
$myfname2 = $myfname.'comment';
$anscount = $anscount + 2;
$answer_main .= "\t<li class=\"other\">\n<span class=\"option\">\n"
. "\t<label for=\"answer$myfname\" class=\"answertext\">\n".$othertext.":\n<input class=\"text other\" $numbersonly type=\"text\" name=\"$myfname\" id=\"answer$myfname\" title=\"".$clang->gT('Other').'" size="10"';
. "\t<label for=\"answer$myfname\" class=\"answertext\">\n".$othertext."\n<input class=\"text other\" $numbersonly type=\"text\" name=\"$myfname\" id=\"answer$myfname\" title=\"".$clang->gT('Other').'" size="10"';
if (isset($_SESSION[$myfname]) && $_SESSION[$myfname])
{
$answer_main .= ' value="'.htmlspecialchars($_SESSION[$myfname],ENT_QUOTES).'"';
Expand Down
96 changes: 96 additions & 0 deletions scripts/jquery/jquery.cookie.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/**
* Cookie plugin
*
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/

/**
* Create a cookie with the given name and value and other optional parameters.
*
* @example $.cookie('the_cookie', 'the_value');
* @desc Set the value of a cookie.
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
* @desc Create a cookie with all available options.
* @example $.cookie('the_cookie', 'the_value');
* @desc Create a session cookie.
* @example $.cookie('the_cookie', null);
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
* used when the cookie was set.
*
* @param String name The name of the cookie.
* @param String value The value of the cookie.
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
* If set to null or omitted, the cookie will be a session cookie and will not be retained
* when the the browser exits.
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
* require a secure protocol (like HTTPS).
* @type undefined
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/

/**
* Get the value of a cookie with the given name.
*
* @example $.cookie('the_cookie');
* @desc Get the value of a cookie.
*
* @param String name The name of the cookie.
* @return The value of the cookie.
* @type String
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
jQuery.cookie = function(name, value, options) {
if (typeof value != 'undefined') { // name and value given, set cookie
options = options || {};
if (value === null) {
value = '';
options.expires = -1;
}
var expires = '';
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
var date;
if (typeof options.expires == 'number') {
date = new Date();
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
} else {
date = options.expires;
}
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
}
// CAUTION: Needed to parenthesize options.path and options.domain
// in the following expressions, otherwise they evaluate to undefined
// in the packed version for some reason...
var path = options.path ? '; path=' + (options.path) : '';
var domain = options.domain ? '; domain=' + (options.domain) : '';
var secure = options.secure ? '; secure' : '';
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
} else { // only name given, get cookie
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
};

0 comments on commit 9f4d7ba

Please sign in to comment.