diff --git a/application/controllers/admin/questiongroup.php b/application/controllers/admin/questiongroup.php index 1b3a473448e..47e94ad4df1 100644 --- a/application/controllers/admin/questiongroup.php +++ b/application/controllers/admin/questiongroup.php @@ -1,44 +1,44 @@ input->post('action'); @@ -71,7 +71,7 @@ function import() } /**else { - $surveyid=returnglobal('sid'); + $surveyid=returnglobal('sid'); }*/ if (isset($fatalerror)) @@ -102,13 +102,13 @@ function import() if (isset($aImportResults['fatalerror'])) { - $importgroup .= "
".$clang->gT("Error")."

\n"; - $importgroup .= $aImportResults['fatalerror']."

\n"; - $importgroup .= "\n"; - $importgroup .= "\n"; - unlink($sFullFilepath); - show_error($importgroup); - return; + $importgroup .= "
".$clang->gT("Error")."

\n"; + $importgroup .= $aImportResults['fatalerror']."

\n"; + $importgroup .= "\n"; + $importgroup .= "\n"; + unlink($sFullFilepath); + show_error($importgroup); + return; } $importgroup .= "
".$clang->gT("Success")."

\n" @@ -143,13 +143,13 @@ function import() /** - * questiongroup::add() - * Load add new question grup screen. - * @return - */ + * questiongroup::add() + * Load add new question grup screen. + * @return + */ function add($surveyid) { - $surveyid = sanitize_int($surveyid); + $surveyid = sanitize_int($surveyid); if(bHasSurveyPermission($surveyid,'surveycontent','read')) { @@ -181,16 +181,16 @@ function add($surveyid) self::_loadEndScripts(); self::_getAdminFooter("http://docs.limesurvey.org", $this->limesurvey_lang->gT("LimeSurvey online manual")); - } + } } /** - * questiongroup::delete() - * Function responsible for deleting a question group. - * @return - */ + * questiongroup::delete() + * Function responsible for deleting a question group. + * @return + */ function delete() { $action = $this->input->post("action"); @@ -243,15 +243,15 @@ function delete() } /** - * questiongroup::edit() - * Load editing of a question group screen. - * @return - */ + * questiongroup::edit() + * Load editing of a question group screen. + * @return + */ function edit($surveyid,$gid) { - $surveyid = sanitize_int($surveyid); - $gid = sanitize_int($gid); + $surveyid = sanitize_int($surveyid); + $gid = sanitize_int($gid); if(bHasSurveyPermission($surveyid,'surveycontent','read')) { @@ -315,12 +315,12 @@ function edit($surveyid,$gid) $data['esrow'] = $esrow; $data['i'] = 0; $tab_content[0] = $this->load->view('admin/survey/QuestionGroups/editGroup_view',$data,true);/**"
\n") - . "\n" - . "\t
\n" - . "
\n" - . "\n" - . getEditor("group-desc","description_".$esrow['language'], "[".$clang->gT("Description:", "js")."](".$esrow['language'].")",$surveyid,$gid,'',$action) - . "\t
"; */ + . "\n" + . "\t\n" + . "
\n" + . "\n" + . getEditor("group-desc","description_".$esrow['language'], "[".$clang->gT("Description:", "js")."](".$esrow['language'].")",$surveyid,$gid,'',$action) + . "\t
"; */ $egquery = "SELECT * FROM ".$this->db->dbprefix."groups WHERE sid=$surveyid AND gid=$gid AND language!='$baselang'"; $egresult = db_execute_assoc($egquery); $i = 1; @@ -335,12 +335,12 @@ function edit($surveyid,$gid) $data['esrow'] = $esrow; $tab_content[$i] = $this->load->view('admin/survey/QuestionGroups/editGroup_view',$data,true); /**"
\n" - . "\n" - . "\t
\n" - . "
\n" - . "\n" - . getEditor("group-desc","description_".$esrow['language'], "[".$clang->gT("Description:", "js")."](".$esrow['language'].")",$surveyid,$gid,'',$action) - . "\t
"; */ + . "\n" + . "\t\n" + . "
\n" + . "\n" + . getEditor("group-desc","description_".$esrow['language'], "[".$clang->gT("Description:", "js")."](".$esrow['language'].")",$surveyid,$gid,'',$action) + . "\t
"; */ $i++; } @@ -380,32 +380,72 @@ function edit($surveyid,$gid) } - /** - * questiongroup::organize() - * Load ordering of question group screen. - * @return - */ - function organize($surveyid) + /** + * questiongroup::organize() + * Load ordering of question group screen. + * @return + */ + function organize($iSurveyID) { - $surveyid= (int)$surveyid; - $this->load->model('groups_model'); - $aGrouplist=$this->groups_model->getGroups($surveyid); - foreach($aGrouplist as $aGroup) - { + $iSurveyID= (int)$iSurveyID; + $this->load->model('groups_model'); + $this->load->model('questions_model'); + + if ($this->input->post('orgdata') && bHasSurveyPermission($iSurveyID,'surveycontent','update')) + { + $AOrgData=array(); + parse_str($this->input->post('orgdata'),$AOrgData); + $grouporder=0; + foreach($AOrgData['list'] as $ID=>$parent) + { + if ($parent=='root' && $ID[0]=='g'){ + $this->groups_model->update(array('group_order'=>$grouporder),array('gid'=>(int)substr($ID,1))); + $grouporder++; + } + elseif ($ID[0]=='q') + { + if (!isset($questionorder[(int)substr($parent,1)])) $questionorder[(int)substr($parent,1)]=0; + $this->questions_model->update(array('question_order'=>$questionorder[(int)substr($parent,1)],'gid'=>(int)substr($parent,1)),array('qid'=>(int)substr($ID,1))); + $this->questions_model->update(array('gid'=>(int)substr($parent,1)),array('parent_qid'=>(int)substr($ID,1))); + $questionorder[(int)substr($parent,1)]++; + } + } + $this->session->set_userdata('flashmessage', $this->limesurvey_lang->gT("The new question group/question order was successfully saved.")); + redirect('admin/survey/view/'.$iSurveyID); + } + $sBaseLanguage=GetBaseLanguageFromSurveyID($iSurveyID); + self::_js_admin_includes(base_url().'scripts/jquery/jquery.ui.nestedSortable.js'); + self::_js_admin_includes(base_url().'scripts/admin/organize.js'); - } + $aGrouplist=$this->groups_model->getGroups($iSurveyID); + foreach($aGrouplist as $iGID=>$aGroup) + { + $oQuestionData=$this->questions_model->getQuestions($iSurveyID,$aGroup['gid'],$sBaseLanguage); + $aGrouplist[$iGID]['questions']=$oQuestionData->result_array(); + } + $aViewData['aGroupsAndQuestions']=$aGrouplist; + $aViewData['clang']=$this->limesurvey_lang; + $aViewData['surveyid']=$iSurveyID; + $css_admin_includes[] = $this->config->item('styleurl')."admin/default/superfish.css"; + $this->config->set_item("css_admin_includes", $css_admin_includes); + self::_getAdminHeader(); + self::_showadminmenu(); + self::_surveybar($iSurveyID); + $this->load->view('admin/survey/organizeGroupsAndQuestions_view',$aViewData); + self::_loadEndScripts(); + self::_getAdminFooter("http://docs.limesurvey.org", $this->limesurvey_lang->gT("LimeSurvey online manual")); } /** - * questiongroup::order() - * Load ordering of question group screen. - * @return - */ + * questiongroup::order() + * Load ordering of question group screen. + * @return + */ function order($surveyid) { - $surveyid = sanitize_int($surveyid); + $surveyid = sanitize_int($surveyid); $clang = $this->limesurvey_lang; $css_admin_includes[] = $this->config->item('styleurl')."admin/default/superfish.css"; @@ -675,4 +715,4 @@ function order($surveyid) - } \ No newline at end of file +} \ No newline at end of file diff --git a/application/controllers/admin/templates.php b/application/controllers/admin/templates.php index b1d9f6b6dd8..ae0995378dd 100644 --- a/application/controllers/admin/templates.php +++ b/application/controllers/admin/templates.php @@ -430,6 +430,7 @@ function templaterename() */ function templatecopy() { + $clang = $this->limesurvey_lang; if ($this->input->post('action') == "templatecopy" && $this->input->post('newname') && $this->input->post('copydir')) { //Copies all the files from one template directory to a new one //This is a security issue because it is allowing copying from get variables... diff --git a/application/helpers/replacements_helper.php b/application/helpers/replacements_helper.php index 1fae9fe12a9..80ee9cb7aa8 100644 --- a/application/helpers/replacements_helper.php +++ b/application/helpers/replacements_helper.php @@ -1,18 +1,18 @@ => - * @param boolean $anonymized Determines if token data is being used or just replaced with blanks - * @param questionNum - needed to support dynamic JavaScript-based tailoring within questions - * @return string Text with replaced strings - */ +* This function replaces keywords in a text and is mainly intended for templates +* If you use this functions put your replacement strings into the $replacements variable +* instead of using global variables +* NOTE - Don't do any embedded replacements in this function. Create the array of replacement values and +* they will be done in batch at the end +* +* @param mixed $line Text to search in +* @param mixed $replacements Array of replacements: Array( => +* @param boolean $anonymized Determines if token data is being used or just replaced with blanks +* @param questionNum - needed to support dynamic JavaScript-based tailoring within questions +* @return string Text with replaced strings +*/ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSrc='Unspecified', $anonymized=false, $questionNum=NULL) { $CI =& get_instance(); @@ -21,60 +21,60 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr global $clienttoken,$token,$sitename,$move,$showXquestions,$showqnumcode,$questioncode,$register_errormsg; global $s_lang,$errormsg,$saved_id, $totalBoilerplatequestions, $relativeurl, $languagechanger,$captchapath,$loadname; */ - /* - $allowedvars = array('surveylist', 'sitename', 'clienttoken', 'rooturl', 'thissurvey', 'imageurl', 'defaulttemplate', - 'percentcomplete', 'move', 'groupname', 'groupdescription', 'question', 'showXquestions', - 'showgroupinfo', 'showqnumcode', 'questioncode', 'answer', 'navigator', 'help', 'totalquestions', - 'surveyformat', 'completed', 'register_errormsg', 'notanswered', 'privacy', 'surveyid', 'publicurl', - 'templatedir', 'token', 'assessments', 's_lang', 'errormsg', 'clang', 'saved_id', 'usertemplaterootdir', - 'totalBoilerplatequestions', 'relativeurl', 'languagechanger', 'printoutput', 'captchapath', 'loadname'); + /* + $allowedvars = array('surveylist', 'sitename', 'clienttoken', 'rooturl', 'thissurvey', 'imageurl', 'defaulttemplate', + 'percentcomplete', 'move', 'groupname', 'groupdescription', 'question', 'showXquestions', + 'showgroupinfo', 'showqnumcode', 'questioncode', 'answer', 'navigator', 'help', 'totalquestions', + 'surveyformat', 'completed', 'register_errormsg', 'notanswered', 'privacy', 'surveyid', 'publicurl', + 'templatedir', 'token', 'assessments', 's_lang', 'errormsg', 'clang', 'saved_id', 'usertemplaterootdir', + 'totalBoilerplatequestions', 'relativeurl', 'languagechanger', 'printoutput', 'captchapath', 'loadname'); */ $allowedvars = array( - 'answer', - 'assessments', - 'captchapath', - 'clienttoken', - 'completed', - 'errormsg', - 'groupdescription', - 'groupname', - 'help', - 'imageurl', - 'languagechanger', - 'loadname', - 'move', - 'navigator', - 'percentcomplete', - 'privacy', - 'question', - 'register_errormsg', - 'relativeurl', - 's_lang', - 'saved_id', - 'showgroupinfo', - 'showqnumcode', - 'showXquestions', - 'sitename', - 'surveylist', - 'templatedir', - 'thissurvey', - 'token', - 'totalBoilerplatequestions', - 'totalquestions', + 'answer', + 'assessments', + 'captchapath', + 'clienttoken', + 'completed', + 'errormsg', + 'groupdescription', + 'groupname', + 'help', + 'imageurl', + 'languagechanger', + 'loadname', + 'move', + 'navigator', + 'percentcomplete', + 'privacy', + 'question', + 'register_errormsg', + 'relativeurl', + 's_lang', + 'saved_id', + 'showgroupinfo', + 'showqnumcode', + 'showXquestions', + 'sitename', + 'surveylist', + 'templatedir', + 'thissurvey', + 'token', + 'totalBoilerplatequestions', + 'totalquestions', ); $varsPassed = array(); - foreach($allowedvars as $var) - { - if(isset($redata[$var])) { + foreach($allowedvars as $var) + { + if(isset($redata[$var])) { $$var = $redata[$var]; $varsPassed[] = $var; } - } + } if (count($varsPassed) > 0) { log_message('debug', 'templatereplace() called from ' . $debugSrc . ' contains: ' . implode(', ', $varsPassed)); } -// extract($redata); // creates variables for each of the keys in the array + // extract($redata); // creates variables for each of the keys in the array // Local over-rides in case not set above if (!isset($showgroupinfo)) { $showgroupinfo = 'Y'; } @@ -95,13 +95,13 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr $clang = $CI->limesurvey_lang; $CI->load->helper('surveytranslator'); $questiondetails = array('sid' => 0, 'gid' => 0, 'qid' => 0, 'aid' =>0); - if(isset($question) && isset($question['sgq'])) $questiondetails=getsidgidqidaidtype($question['sgq']); //Gets an array containing SID, GID, QID, AID and Question Type) + if(isset($question) && isset($question['sgq'])) $questiondetails=getsidgidqidaidtype($question['sgq']); //Gets an array containing SID, GID, QID, AID and Question Type) if (isset($thissurvey['sid'])) { $surveyid = $thissurvey['sid']; } - // lets sanitize the survey template + // lets sanitize the survey template if(isset($thissurvey['templatedir'])) { $templatename=$thissurvey['templatedir']; @@ -111,13 +111,13 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr $templatename=$CI->config->item('defaulttemplate'); } $templatename=validate_templatedir($templatename); - if(!isset($templatedir)) $templatedir = sGetTemplatePath($templatename); - if(!isset($templateurl)) $templateurl = sGetTemplateURL($templatename)."/"; + if(!isset($templatedir)) $templatedir = sGetTemplatePath($templatename); + if(!isset($templateurl)) $templateurl = sGetTemplateURL($templatename)."/"; if (stripos ($line,"")) { $line=str_ireplace("", - "\n" + "\n" .use_firebug() ."\t", $line); } @@ -162,11 +162,11 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr } if ( - $showgroupinfo == 'both' || - $showgroupinfo == 'name' || - ($showgroupinfo == 'choose' && !isset($thissurvey['showgroupinfo'])) || - ($showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'B') || - ($showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'N') + $showgroupinfo == 'both' || + $showgroupinfo == 'name' || + ($showgroupinfo == 'choose' && !isset($thissurvey['showgroupinfo'])) || + ($showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'B') || + ($showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'N') ) { $_groupname = isset($groupname) ? $groupname : ''; @@ -176,11 +176,11 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr $_groupname = ''; }; if ( - $showgroupinfo == 'both' || - $showgroupinfo == 'description' || - ($showgroupinfo == 'choose' && !isset($thissurvey['showgroupinfo'])) || - ($showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'B') || - ($showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'D') + $showgroupinfo == 'both' || + $showgroupinfo == 'description' || + ($showgroupinfo == 'choose' && !isset($thissurvey['showgroupinfo'])) || + ($showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'B') || + ($showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'D') ) { $_groupdescription = isset($groupdescription) ? $groupdescription : ''; @@ -222,11 +222,11 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr }; if ( - $showqnumcode == 'both' || - $showqnumcode == 'number' || - ($showqnumcode == 'choose' && !isset($thissurvey['showqnumcode'])) || - ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B') || - ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'N') + $showqnumcode == 'both' || + $showqnumcode == 'number' || + ($showqnumcode == 'choose' && !isset($thissurvey['showqnumcode'])) || + ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B') || + ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'N') ) { $_question_number = $question['number']; @@ -236,11 +236,11 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr $_question_number = ''; }; if ( - $showqnumcode == 'both' || - $showqnumcode == 'code' || - ($showqnumcode == 'choose' && !isset($thissurvey['showqnumcode'])) || - ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B') || - ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'C') + $showqnumcode == 'both' || + $showqnumcode == 'code' || + ($showqnumcode == 'choose' && !isset($thissurvey['showqnumcode'])) || + ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B') || + ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'C') ) { $_question_code = $question['code']; @@ -253,9 +253,9 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr if(!isset($totalquestions)) $totalquestions = 0; $_totalquestionsAsked = $totalquestions - $totalBoilerplatequestions; if ( - $showXquestions == 'show' || - ($showXquestions == 'choose' && !isset($thissurvey['showXquestions'])) || - ($showXquestions == 'choose' && $thissurvey['showXquestions'] == 'Y') + $showXquestions == 'show' || + ($showXquestions == 'choose' && !isset($thissurvey['showXquestions'])) || + ($showXquestions == 'choose' && $thissurvey['showXquestions'] == 'Y') ) { if ($_totalquestionsAsked < 1) @@ -269,7 +269,7 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr else { $_therearexquestions = $clang->gT("There are {NUMBEROFQUESTIONS} questions in this survey."); //Note this line MUST be before {NUMBEROFQUESTIONS} - }; + }; } else { @@ -315,7 +315,7 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr else { $_linkreplace = "{$thissurvey['surveyls_url']}"; - } + } } else { @@ -324,7 +324,7 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr if (isset($surveyid)) { $_clearall = "gT("Are you sure you want to clear all your responses?", 'js') . "')) {\nwindow.open('".$CI->config->item('publicurl')."/index.php?sid=$surveyid&move=clearall&lang=" . $s_lang; + . "onclick=\"if (confirm('" . $clang->gT("Are you sure you want to clear all your responses?", 'js') . "')) {\nwindow.open('".$CI->config->item('publicurl')."/index.php?sid=$surveyid&move=clearall&lang=" . $s_lang; if (returnglobal('token')) { $_clearall .= "&token=" . urlencode(trim(sanitize_token(strip_tags(returnglobal('token'))))); @@ -353,12 +353,12 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr if ($thissurvey['tokenanswerspersistence'] != 'Y') { $_saveall = "\t\t\t" - . "\n\t\t\t"; // Show Save So Far button + . "\n\t\t\t"; // Show Save So Far button } else { $_saveall = "\t\t\t"; // Show Save So Far button - }; + }; } elseif (!isset($_SESSION['step']) || !$_SESSION['step']) { //First page, show LOAD @@ -377,12 +377,12 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr } else { - $_saveall = ""; // Show Save So Far button + $_saveall = ""; // Show Save So Far button } } else { - $_saveall = ""; + $_saveall = ""; } $_templatecss = "\n"; @@ -391,7 +391,7 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr $_templatecss.="\n"; } - if(!isset($help)) $help = ""; + if(!isset($help)) $help = ""; if (FlattenText($help, true) != '') { if (!isset($helpicon)) @@ -432,13 +432,13 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr $_restart.="'>".$clang->gT("Restart this Survey").""; } else if (isset($surveyid)) - { - $restart_extra = ""; - $restart_token = returnglobal('token'); - if (!empty($restart_token)) $restart_extra .= "/token/".urlencode($restart_token); - else $restart_extra = "/newtest/Y"; - if (!empty($_GET['lang'])) $restart_extra .= "/lang/".returnglobal('lang'); - $_restart = "".$clang->gT("Restart this Survey").""; + { + $restart_extra = ""; + $restart_token = returnglobal('token'); + if (!empty($restart_token)) $restart_extra .= "/token/".urlencode($restart_token); + else $restart_extra = "/newtest/Y"; + if (!empty($_GET['lang'])) $restart_extra .= "/lang/".returnglobal('lang'); + $_restart = "".$clang->gT("Restart this Survey").""; } else { @@ -475,19 +475,19 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr $_saveform .= html_escape(auto_unescape($_POST['savename'])); } $_saveform .= "' />\n" - . "" . $clang->gT("Password") . ":" . $clang->gT("Password") . ":" . $clang->gT("Repeat Password") . ":" . $clang->gT("Repeat Password") . ":" . $clang->gT("Your Email") . ":" . $clang->gT("Your Email") . ":gT("Security Question") . ":
\n"; } $_saveform .= "\n" - . "\n" - . ""; + . "\n" + . ""; // Load Form $_loadform = "\n" - . "\n"; } $_loadform .="\n" - . "
" . $clang->gT("Saved name") . ":
" . $clang->gT("Password") . ":" . $clang->gT("Password") . ":" . $clang->gT("Security Question") . ":
\n"; + . "\n"; // Registration Form if (isset($surveyid)) @@ -537,23 +537,23 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr $_registerform .= "\n"; $_registerform.="\n" - . "" - . "" + . "\n" - . "\n" + . "\n" - . "\n" + . "\n"; } $_registerform .= "\n" - . "
" - . $clang->gT("First name") . ":" + . $clang->gT("First name") . ":" . $clang->gT("Last name") . ":" . $clang->gT("Last name") . ":" . $clang->gT("Email address") . ":" . $clang->gT("Email address") . ":gT("Security Question") . ":
" - . "
\n" - . "\n"; + . "\n" + . "\n" + . "\n"; } else { @@ -585,83 +585,83 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr } - // Set the array of replacement variables here - don't include curly braces - $coreReplacements = array(); + // Set the array of replacement variables here - don't include curly braces + $coreReplacements = array(); $coreReplacements['AID'] = isset($questiondetails['aid']) ? $questiondetails['aid'] : ''; - $coreReplacements['ANSWER'] = isset($answer) ? $answer : ''; // global - $coreReplacements['ANSWERSCLEARED'] = $clang->gT("Answers Cleared"); - $coreReplacements['ASSESSMENTS'] = isset($assessments) ? $assessments : ''; // global - $coreReplacements['ASSESSMENT_CURRENT_TOTAL'] = $_assessment_current_total; - $coreReplacements['ASSESSMENT_HEADING'] = $clang->gT("Your Assessment"); - $coreReplacements['CHECKJAVASCRIPT'] = ""; - $coreReplacements['CLEARALL'] = $_clearall; - $coreReplacements['CLOSEWINDOW'] = "".$clang->gT("Close this window").""; - $coreReplacements['COMPLETED'] = isset($completed) ? $completed : ''; // global - $coreReplacements['DATESTAMP'] = $_datestamp; - $coreReplacements['EXPIRY'] = $_dateoutput; + $coreReplacements['ANSWER'] = isset($answer) ? $answer : ''; // global + $coreReplacements['ANSWERSCLEARED'] = $clang->gT("Answers Cleared"); + $coreReplacements['ASSESSMENTS'] = isset($assessments) ? $assessments : ''; // global + $coreReplacements['ASSESSMENT_CURRENT_TOTAL'] = $_assessment_current_total; + $coreReplacements['ASSESSMENT_HEADING'] = $clang->gT("Your Assessment"); + $coreReplacements['CHECKJAVASCRIPT'] = ""; + $coreReplacements['CLEARALL'] = $_clearall; + $coreReplacements['CLOSEWINDOW'] = "".$clang->gT("Close this window").""; + $coreReplacements['COMPLETED'] = isset($completed) ? $completed : ''; // global + $coreReplacements['DATESTAMP'] = $_datestamp; + $coreReplacements['EXPIRY'] = $_dateoutput; $coreReplacements['GID'] = isset($questiondetails['gid']) ? $questiondetails['gid']: ''; - $coreReplacements['GROUPDESCRIPTION'] = $_groupdescription; - $coreReplacements['GROUPNAME'] = $_groupname; - $coreReplacements['LANG'] = $clang->getlangcode(); - $coreReplacements['LANGUAGECHANGER'] = isset($languagechanger) ? $languagechanger : ''; // global - $coreReplacements['LOADERROR'] = isset($errormsg) ? $errormsg : ''; // global - $coreReplacements['LOADFORM'] = $_loadform; - $coreReplacements['LOADHEADING'] = $clang->gT("Load A Previously Saved Survey"); - $coreReplacements['LOADMESSAGE'] = $clang->gT("You can load a survey that you have previously saved from this screen.")."
".$clang->gT("Type in the 'name' you used to save the survey, and the password.")."
"; - $coreReplacements['NAVIGATOR'] = isset($navigator) ? $navigator : ''; // global - $coreReplacements['NOSURVEYID'] = (isset($surveylist))?$surveylist['nosid']:''; - $coreReplacements['NUMBEROFQUESTIONS'] = $_totalquestionsAsked; - $coreReplacements['PERCENTCOMPLETE'] = isset($percentcomplete) ? $percentcomplete : ''; // global - $coreReplacements['PRIVACY'] = isset($privacy) ? $privacy : ''; // global - $coreReplacements['PRIVACYMESSAGE'] = "".$clang->gT("A Note On Privacy")."
".$clang->gT("This survey is anonymous.")."
".$clang->gT("The record kept of your survey responses does not contain any identifying information about you unless a specific question in the survey has asked for this. If you have responded to a survey that used an identifying token to allow you to access the survey, you can rest assured that the identifying token is not kept with your responses. It is managed in a separate database, and will only be updated to indicate that you have (or haven't) completed this survey. There is no way of matching identification tokens with survey responses in this survey."); + $coreReplacements['GROUPDESCRIPTION'] = $_groupdescription; + $coreReplacements['GROUPNAME'] = $_groupname; + $coreReplacements['LANG'] = $clang->getlangcode(); + $coreReplacements['LANGUAGECHANGER'] = isset($languagechanger) ? $languagechanger : ''; // global + $coreReplacements['LOADERROR'] = isset($errormsg) ? $errormsg : ''; // global + $coreReplacements['LOADFORM'] = $_loadform; + $coreReplacements['LOADHEADING'] = $clang->gT("Load A Previously Saved Survey"); + $coreReplacements['LOADMESSAGE'] = $clang->gT("You can load a survey that you have previously saved from this screen.")."
".$clang->gT("Type in the 'name' you used to save the survey, and the password.")."
"; + $coreReplacements['NAVIGATOR'] = isset($navigator) ? $navigator : ''; // global + $coreReplacements['NOSURVEYID'] = (isset($surveylist))?$surveylist['nosid']:''; + $coreReplacements['NUMBEROFQUESTIONS'] = $_totalquestionsAsked; + $coreReplacements['PERCENTCOMPLETE'] = isset($percentcomplete) ? $percentcomplete : ''; // global + $coreReplacements['PRIVACY'] = isset($privacy) ? $privacy : ''; // global + $coreReplacements['PRIVACYMESSAGE'] = "".$clang->gT("A Note On Privacy")."
".$clang->gT("This survey is anonymous.")."
".$clang->gT("The record kept of your survey responses does not contain any identifying information about you unless a specific question in the survey has asked for this. If you have responded to a survey that used an identifying token to allow you to access the survey, you can rest assured that the identifying token is not kept with your responses. It is managed in a separate database, and will only be updated to indicate that you have (or haven't) completed this survey. There is no way of matching identification tokens with survey responses in this survey."); $coreReplacements['QID'] = isset($questiondetails['qid']) ? $questiondetails['qid'] : ''; - $coreReplacements['QUESTION'] = $_question; - $coreReplacements['QUESTIONHELP'] = $_questionhelp; - $coreReplacements['QUESTIONHELPPLAINTEXT'] = strip_tags(addslashes($help)); // global - $coreReplacements['QUESTION_CLASS'] = $_question_class; - $coreReplacements['QUESTION_CODE'] = $_question_code; - $coreReplacements['QUESTION_ESSENTIALS'] = $_question_essentials; - $coreReplacements['QUESTION_FILE_VALID_MESSAGE'] = $_question_file_valid_message; - $coreReplacements['QUESTION_HELP'] = $_question_help; - $coreReplacements['QUESTION_INPUT_ERROR_CLASS'] = $_question_input_error_class; - $coreReplacements['QUESTION_MANDATORY'] = $_question_mandatory; - $coreReplacements['QUESTION_MAN_CLASS'] = $_question_man_class; - $coreReplacements['QUESTION_MAN_MESSAGE'] = $_question_man_message; - $coreReplacements['QUESTION_NUMBER'] = $_question_number; - $coreReplacements['QUESTION_TEXT'] = $_question_text; - $coreReplacements['QUESTION_VALID_MESSAGE'] = $_question_valid_message; - $coreReplacements['REGISTERERROR'] = isset($register_errormsg) ? $register_errormsg : ''; // global - $coreReplacements['REGISTERFORM'] = $_registerform; - $coreReplacements['REGISTERMESSAGE1'] = $clang->gT("You must be registered to complete this survey"); - $coreReplacements['REGISTERMESSAGE2'] = $clang->gT("You may register for this survey if you wish to take part.")."
\n".$clang->gT("Enter your details below, and an email containing the link to participate in this survey will be sent immediately."); - $coreReplacements['RESTART'] = $_restart; - $coreReplacements['RETURNTOSURVEY'] = $_return_to_survey; - $coreReplacements['SAVE'] = $_saveall; - $coreReplacements['SAVEALERT'] = $_savealert; - $coreReplacements['SAVEDID'] = isset($saved_id) ? $saved_id : ''; // global - $coreReplacements['SAVEERROR'] = isset($errormsg) ? $errormsg : ''; // global - same as LOADERROR - $coreReplacements['SAVEFORM'] = $_saveform; - $coreReplacements['SAVEHEADING'] = $clang->gT("Save Your Unfinished Survey"); - $coreReplacements['SAVEMESSAGE'] = $clang->gT("Enter a name and password for this survey and click save below.")."
\n".$clang->gT("Your survey will be saved using that name and password, and can be completed later by logging in with the same name and password.")."

\n".$clang->gT("If you give an email address, an email containing the details will be sent to you.")."

\n".$clang->gT("After having clicked the save button you can either close this browser window or continue filling out the survey."); - $coreReplacements['SGQ'] = $_question_sgq; - $coreReplacements['SID'] = (isset($surveyid) ? $surveyid : (isset($questiondetails['sid']) ? $questiondetails['sid'] : '')); - $coreReplacements['SITENAME'] = isset($sitename) ? $sitename : ''; // global - $coreReplacements['SUBMITBUTTON'] = $_submitbutton; - $coreReplacements['SUBMITCOMPLETE'] = "".$clang->gT("Thank you!")."

".$clang->gT("You have completed answering the questions in this survey.")."


".$clang->gT("Click on 'Submit' now to complete the process and save your answers."); - $coreReplacements['SUBMITREVIEW'] = $_strreview; - $coreReplacements['SURVEYCONTACT'] = $surveycontact; - $coreReplacements['SURVEYDESCRIPTION'] = (isset($thissurvey['description']) ? $thissurvey['description'] : ''); - $coreReplacements['SURVEYFORMAT'] = isset($surveyformat) ? $surveyformat : ''; // global - $coreReplacements['SURVEYLANGAGE'] = $clang->langcode; - $coreReplacements['SURVEYLIST'] = (isset($surveylist))?$surveylist['list']:''; - $coreReplacements['SURVEYLISTHEADING'] = (isset($surveylist))?$surveylist['listheading']:''; - $coreReplacements['SURVEYNAME'] = (isset($thissurvey['name']) ? $thissurvey['name'] : ''); - $coreReplacements['TEMPLATECSS'] = $_templatecss; - $coreReplacements['TEMPLATEURL'] = $templateurl; - $coreReplacements['THEREAREXQUESTIONS'] = $_therearexquestions; - if (!$anonymized) $coreReplacements['TOKEN'] = $_token; - $coreReplacements['URL'] = $_linkreplace; - $coreReplacements['WELCOME'] = (isset($thissurvey['welcome']) ? $thissurvey['welcome'] : ''); + $coreReplacements['QUESTION'] = $_question; + $coreReplacements['QUESTIONHELP'] = $_questionhelp; + $coreReplacements['QUESTIONHELPPLAINTEXT'] = strip_tags(addslashes($help)); // global + $coreReplacements['QUESTION_CLASS'] = $_question_class; + $coreReplacements['QUESTION_CODE'] = $_question_code; + $coreReplacements['QUESTION_ESSENTIALS'] = $_question_essentials; + $coreReplacements['QUESTION_FILE_VALID_MESSAGE'] = $_question_file_valid_message; + $coreReplacements['QUESTION_HELP'] = $_question_help; + $coreReplacements['QUESTION_INPUT_ERROR_CLASS'] = $_question_input_error_class; + $coreReplacements['QUESTION_MANDATORY'] = $_question_mandatory; + $coreReplacements['QUESTION_MAN_CLASS'] = $_question_man_class; + $coreReplacements['QUESTION_MAN_MESSAGE'] = $_question_man_message; + $coreReplacements['QUESTION_NUMBER'] = $_question_number; + $coreReplacements['QUESTION_TEXT'] = $_question_text; + $coreReplacements['QUESTION_VALID_MESSAGE'] = $_question_valid_message; + $coreReplacements['REGISTERERROR'] = isset($register_errormsg) ? $register_errormsg : ''; // global + $coreReplacements['REGISTERFORM'] = $_registerform; + $coreReplacements['REGISTERMESSAGE1'] = $clang->gT("You must be registered to complete this survey"); + $coreReplacements['REGISTERMESSAGE2'] = $clang->gT("You may register for this survey if you wish to take part.")."
\n".$clang->gT("Enter your details below, and an email containing the link to participate in this survey will be sent immediately."); + $coreReplacements['RESTART'] = $_restart; + $coreReplacements['RETURNTOSURVEY'] = $_return_to_survey; + $coreReplacements['SAVE'] = $_saveall; + $coreReplacements['SAVEALERT'] = $_savealert; + $coreReplacements['SAVEDID'] = isset($saved_id) ? $saved_id : ''; // global + $coreReplacements['SAVEERROR'] = isset($errormsg) ? $errormsg : ''; // global - same as LOADERROR + $coreReplacements['SAVEFORM'] = $_saveform; + $coreReplacements['SAVEHEADING'] = $clang->gT("Save Your Unfinished Survey"); + $coreReplacements['SAVEMESSAGE'] = $clang->gT("Enter a name and password for this survey and click save below.")."
\n".$clang->gT("Your survey will be saved using that name and password, and can be completed later by logging in with the same name and password.")."

\n".$clang->gT("If you give an email address, an email containing the details will be sent to you.")."

\n".$clang->gT("After having clicked the save button you can either close this browser window or continue filling out the survey."); + $coreReplacements['SGQ'] = $_question_sgq; + $coreReplacements['SID'] = (isset($surveyid) ? $surveyid : (isset($questiondetails['sid']) ? $questiondetails['sid'] : '')); + $coreReplacements['SITENAME'] = isset($sitename) ? $sitename : ''; // global + $coreReplacements['SUBMITBUTTON'] = $_submitbutton; + $coreReplacements['SUBMITCOMPLETE'] = "".$clang->gT("Thank you!")."

".$clang->gT("You have completed answering the questions in this survey.")."


".$clang->gT("Click on 'Submit' now to complete the process and save your answers."); + $coreReplacements['SUBMITREVIEW'] = $_strreview; + $coreReplacements['SURVEYCONTACT'] = $surveycontact; + $coreReplacements['SURVEYDESCRIPTION'] = (isset($thissurvey['description']) ? $thissurvey['description'] : ''); + $coreReplacements['SURVEYFORMAT'] = isset($surveyformat) ? $surveyformat : ''; // global + $coreReplacements['SURVEYLANGAGE'] = $clang->langcode; + $coreReplacements['SURVEYLIST'] = (isset($surveylist))?$surveylist['list']:''; + $coreReplacements['SURVEYLISTHEADING'] = (isset($surveylist))?$surveylist['listheading']:''; + $coreReplacements['SURVEYNAME'] = (isset($thissurvey['name']) ? $thissurvey['name'] : ''); + $coreReplacements['TEMPLATECSS'] = $_templatecss; + $coreReplacements['TEMPLATEURL'] = $templateurl; + $coreReplacements['THEREAREXQUESTIONS'] = $_therearexquestions; + if (!$anonymized) $coreReplacements['TOKEN'] = $_token; + $coreReplacements['URL'] = $_linkreplace; + $coreReplacements['WELCOME'] = (isset($thissurvey['welcome']) ? $thissurvey['welcome'] : ''); if (!is_null($replacements) && is_array($replacements)) { @@ -679,38 +679,38 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr } /** - * insertAnsReplace() takes a string and looks for any {INSERTANS:xxxx} variables - * which it then, one by one, substitutes the SGQA code with the relevant answer - * from the session array containing responses - * - * The operations of this function were previously in the templatereplace function - * but have been moved to a function of their own to make it available - * to other areas of the script. - * - * @param mixed $line string - the string to iterate, and then return - * - * @return string This string is returned containing the substituted responses - * - */ +* insertAnsReplace() takes a string and looks for any {INSERTANS:xxxx} variables +* which it then, one by one, substitutes the SGQA code with the relevant answer +* from the session array containing responses +* +* The operations of this function were previously in the templatereplace function +* but have been moved to a function of their own to make it available +* to other areas of the script. +* +* @param mixed $line string - the string to iterate, and then return +* +* @return string This string is returned containing the substituted responses +* +*/ function insertansReplace($line) { return $line; } /** - * tokenReplace() takes a string and looks for any {TOKEN:xxxx} variables - * which it then, one by one, substitutes the TOKEN code with the relevant token - * from the session array containing token information - * - * The operations of this function were previously in the templatereplace function - * but have been moved to a function of their own to make it available - * to other areas of the script. - * - * @param mixed $line string - the string to iterate, and then return - * - * @return string This string is returned containing the substituted responses - * - */ +* tokenReplace() takes a string and looks for any {TOKEN:xxxx} variables +* which it then, one by one, substitutes the TOKEN code with the relevant token +* from the session array containing token information +* +* The operations of this function were previously in the templatereplace function +* but have been moved to a function of their own to make it available +* to other areas of the script. +* +* @param mixed $line string - the string to iterate, and then return +* +* @return string This string is returned containing the substituted responses +* +*/ function tokenReplace($line) { return $line; @@ -735,15 +735,15 @@ function ReplaceFields ($text,$fieldsarray, $bReplaceInsertans=false) /** - * passthruReplace() takes a string and looks for {PASSTHRU:myarg} variables - * which it then substitutes for parameter data sent in the initial URL and stored - * in the session array containing responses - * - * @param mixed $line string - the string to iterate, and then return - * @param mixed $thissurvey string - the string containing the surveyinformation - * @return string This string is returned containing the substituted responses - * - */ +* passthruReplace() takes a string and looks for {PASSTHRU:myarg} variables +* which it then substitutes for parameter data sent in the initial URL and stored +* in the session array containing responses +* +* @param mixed $line string - the string to iterate, and then return +* @param mixed $thissurvey string - the string containing the surveyinformation +* @return string This string is returned containing the substituted responses +* +*/ function PassthruReplace($line, $thissurvey) { while (strpos($line,"{PASSTHRU:") !== false) diff --git a/application/views/admin/participants/blacklist_view.php b/application/views/admin/participants/blacklist_view.php index c4ba809450f..2347b66db31 100644 --- a/application/views/admin/participants/blacklist_view.php +++ b/application/views/admin/participants/blacklist_view.php @@ -4,7 +4,7 @@ <?PHP echo $clang->gT("Blacklist Control") ?> " /> " /> @@ -16,96 +16,96 @@ - - - - - - - - - + + + + + + + + +
-
-

Blacklist Control

-

-
-
-
+
+

Blacklist Control

+

+
+
+
-

-gT("You have successfully blacklisted from any survey on this server"); - } - else if($blacklist == 'N') - { - echo $clang->gT("You have successfully un-blacklisted from any survey on this server"); - } - } - else if($is_participant) - { - if($blacklist == 'Y') - { - echo $clang->gT("You have already been blacklisted from any survey on this server"); - } - else if($blacklist == 'N') - { - echo $clang->gT("You have already been un-blacklisted from any survey on this server"); - } - - } - else if(!$is_survey) - { - echo $clang->gT("Survey is no longer active"); - } - else - { - echo $clang->gT("The URL you are trying to use is either modified, or you have been removed from this server"); - } - -} -else if($local == 1) -{ - if($is_participant && $is_updated) - { - if($blacklist == 'Y') - { - echo $clang->gT("You have successfully blacklisted from this survey"); - } - else if($blacklist == 'N') - { - echo $clang->gT("You have successfully un-blacklisted from this survey"); - } - } - else if($is_participant) - { - if($blacklist == 'Y') - { - echo $clang->gT("You have already been blacklisted from this survey"); - } - else if($blacklist == 'N') - { - echo $clang->gT("You have already been un-blacklisted from this survey"); - } - - } - else - { - echo $clang->gT("The URL you are trying to use is either modified, or you have been removed from this server"); - - } - -} -else -{ - echo $clang->gT("You have successfully blacklisted from this survey"); -} -?> -

+

+ gT("You have successfully blacklisted from any survey on this server"); + } + else if($blacklist == 'N') + { + echo $clang->gT("You have successfully un-blacklisted from any survey on this server"); + } + } + else if($is_participant) + { + if($blacklist == 'Y') + { + echo $clang->gT("You have already been blacklisted from any survey on this server"); + } + else if($blacklist == 'N') + { + echo $clang->gT("You have already been un-blacklisted from any survey on this server"); + } + + } + else if(!$is_survey) + { + echo $clang->gT("Survey is no longer active"); + } + else + { + echo $clang->gT("The URL you are trying to use is either modified, or you have been removed from this server"); + } + + } + else if($local == 1) + { + if($is_participant && $is_updated) + { + if($blacklist == 'Y') + { + echo $clang->gT("You have successfully blacklisted from this survey"); + } + else if($blacklist == 'N') + { + echo $clang->gT("You have successfully un-blacklisted from this survey"); + } + } + else if($is_participant) + { + if($blacklist == 'Y') + { + echo $clang->gT("You have already been blacklisted from this survey"); + } + else if($blacklist == 'N') + { + echo $clang->gT("You have already been un-blacklisted from this survey"); + } + + } + else + { + echo $clang->gT("The URL you are trying to use is either modified, or you have been removed from this server"); + + } + + } + else + { + echo $clang->gT("You have successfully blacklisted from this survey"); + } + ?> +

diff --git a/application/views/admin/survey/QuestionGroups/questiongroupbar_view.php b/application/views/admin/survey/QuestionGroups/questiongroupbar_view.php index 0639c14f479..70134e8b584 100644 --- a/application/views/admin/survey/QuestionGroups/questiongroupbar_view.php +++ b/application/views/admin/survey/QuestionGroups/questiongroupbar_view.php @@ -62,26 +62,7 @@ " > /dumpgroup.png' title='' alt='gT("Export this question group"); ?>' name='ExportGroup' width="40" height="40"/> - - /seperator.gif' alt='' /> - 1) - { ?> - - " > - /reorder.png' alt='gT("Change Question Order"); ?>' name='updatequestionorder' width="40" height="40"/> - - /blank.gif' alt='' width='40' /> - - + + if (bHasSurveyPermission($surveyid,'surveysettings','update')) + {?>

@@ -31,19 +31,19 @@
  • -
  • +
-

+

diff --git a/application/views/admin/survey/listSurveys_view.php b/application/views/admin/survey/listSurveys_view.php index 134b1dc0879..154705dd753 100644 --- a/application/views/admin/survey/listSurveys_view.php +++ b/application/views/admin/survey/listSurveys_view.php @@ -5,116 +5,122 @@ sConfirmationArchiveMessage='eT("This function creates a ZIP archive of several survey archives and can take some time - please be patient! Do you want to contine?",'js');?>';
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
 eT("Responses"); ?> 
style='display:none;' >eT("Status"); ?>eT("SID"); ?>eT("Survey"); ?>eT("Date created"); ?>eT("Owner"); ?>eT("Access"); ?>eT("Anonymized responses"); ?>eT("Full"); ?>eT("Partial"); ?>eT("Total"); ?>eT("Tokens available"); ?>eT("Response rate"); ?>
- - - '> -   
+ + + + + + - + + + + + + + + + + + + + + + + + + + + + - + + + + + + + - } - } - elseif ($aSurveyEntry['status']=='inactive') - { - if ( $aSurveyEntry['questioncount'] && $aSurveyEntry['mayupdate'] ) + - - - - - - - - - - - - + elseif ($aSurveyEntry['status']=='active') + { + if ($aSurveyEntry['mayupdate']) + {?> + + <?php $clang->eT("This survey is active - click here to stop this survey.");?> + + <?php $clang->eT("This survey is currently active.")?> - - + } + } + elseif ($aSurveyEntry['status']=='inactive') + { + if ( $aSurveyEntry['questioncount'] && $aSurveyEntry['mayupdate'] ) + {?> + + <?php $clang->eT("This survey is currently not active - click here to activate this survey.");?> + + <?php $clang->eT("This survey is currently not active.");?> + + + + + + + + + + + + + + - - + + + + + + + + + + - -
 eT("Responses"); ?> 
style='display:none;'>' name='surveyids[]' class='surveycbs' /> style='display:none;' >eT("Status"); ?>eT("SID"); ?>eT("Survey"); ?>eT("Date created"); ?>eT("Owner"); ?>eT("Access"); ?>eT("Anonymized responses"); ?>eT("Full"); ?>eT("Partial"); ?>eT("Total"); ?>eT("Tokens available"); ?>eT("Response rate"); ?>
+ + + ' /> +   - <?php $clang->eT("This survey is active but expired.");?> - <?php $clang->eT("This survey is active but has a start date.");?> - - <?php $clang->eT("This survey is active - click here to stop this survey.");?> - - <?php $clang->eT("This survey is currently active.")?> +  
style='display:none;'>' name='surveyids[]' class='surveycbs' /> + - - <?php $clang->eT("This survey is currently not active - click here to activate this survey.");?> - /expired.png' alt='eT("This survey is active but expired.");?>' /> - <?php $clang->eT("This survey is currently not active.");?> - /notyetstarted.png' alt='eT("This survey is active but has a start date.");?>' /> - '>'> ('>Edit)      '>'> ('>Edit)
     

+ + +
+
diff --git a/application/views/admin/survey/organizeGroupsAndQuestions.php b/application/views/admin/survey/organizeGroupsAndQuestions.php new file mode 100644 index 00000000000..10b5c686adf --- /dev/null +++ b/application/views/admin/survey/organizeGroupsAndQuestions.php @@ -0,0 +1,19 @@ +
    + +
  1. + +
      + +
    1. + + +
    + +
  2. + +
diff --git a/application/views/admin/survey/organizeGroupsAndQuestions_view.php b/application/views/admin/survey/organizeGroupsAndQuestions_view.php new file mode 100644 index 00000000000..06863a787f1 --- /dev/null +++ b/application/views/admin/survey/organizeGroupsAndQuestions_view.php @@ -0,0 +1,26 @@ +
eT('Organize question groups/questions');?>
+
    + +
  1. '>
    + +
      + +
    1. '>
      :
    2. + + +
    + +
  2. + +
+
+

+ +

+
diff --git a/application/views/admin/survey/subview/tabCopy_view.php b/application/views/admin/survey/subview/tabCopy_view.php index a9289022495..fa1b191a8f1 100644 --- a/application/views/admin/survey/subview/tabCopy_view.php +++ b/application/views/admin/survey/subview/tabCopy_view.php @@ -1,23 +1,23 @@
' id='copysurveyform' method='post'> -
    -
  • - gT("*Required"); ?>
  • -
  • - - gT("*Required"); ?>
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
-

- -

- - +
    +
  • + gT("*Required"); ?>
  • +
  • + + gT("*Required"); ?>
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
+

+ +

+
\ No newline at end of file diff --git a/application/views/admin/survey/subview/tabPanelIntegration_view.php b/application/views/admin/survey/subview/tabPanelIntegration_view.php index 351f9a5a2bf..b4b89531fe9 100644 --- a/application/views/admin/survey/subview/tabPanelIntegration_view.php +++ b/application/views/admin/survey/subview/tabPanelIntegration_view.php @@ -16,8 +16,8 @@
-
-
- +
 
+
+
\ No newline at end of file diff --git a/application/views/admin/survey/surveybar_view.php b/application/views/admin/survey/surveybar_view.php index 245ac58196e..a5c9d936104 100644 --- a/application/views/admin/survey/surveybar_view.php +++ b/application/views/admin/survey/surveybar_view.php @@ -65,18 +65,7 @@
  • gT("Survey permissions");?>
  • - -
  • ');" > - gT("Reorder question groups");?>
  • - -
  • - gT("Reorder question groups");?>
  • - -
  • ');" > - gT("Reorder question groups");?>
  • - +
  • gT("Quotas");?>
  • @@ -202,12 +191,13 @@ -
  • - /organize_disabled.png' title='' alt='gT("Question group/question organizer disabled"); ?> - gT("This survey is currently active."); ?>' - width="40" height="40"/>
  • + /organize_disabled.png' title='' alt='gT("Question group/question organizer disabled"); ?> - gT("This survey is currently active."); ?>' + width="40" height="40"/>
  • diff --git a/scripts/admin/organize.js b/scripts/admin/organize.js new file mode 100644 index 00000000000..8d3d0b46469 --- /dev/null +++ b/scripts/admin/organize.js @@ -0,0 +1,23 @@ +$(document).ready(function(){ + + $('ol.organizer').nestedSortable({ + disableNesting: 'no-nest', + forcePlaceholderSize: true, + handle: 'div', + helper: 'clone', + items: 'li', + maxLevels: 2, + opacity: .6, + placeholder: 'placeholder', + revert: 250, + tabSize: 25, + tolerance: 'pointer', + toleranceElement: '> div' + }); + + $('#btnSave').click(function(){ + $('#orgdata').val($('ol.organizer').nestedSortable('serialize')); + frmOrganize.submit(); + }) + +}); diff --git a/styles/admin/default/adminstyle.css b/styles/admin/default/adminstyle.css index a8199d95a36..7fd2bc78e94 100644 --- a/styles/admin/default/adminstyle.css +++ b/styles/admin/default/adminstyle.css @@ -85,7 +85,7 @@ table.statisticstable { } table.statisticstable span { - font-weight:bold; + font-weight:bold; } span.basic { @@ -152,10 +152,10 @@ div.menubar { } .menubar-title-right a { - font-size:10px; - font-weight:bold; - color:#ee0000 !important; - text-decoration: underline !important; + font-size:10px; + font-weight:bold; + color:#ee0000 !important; + text-decoration: underline !important; } .menubar-left { @@ -184,25 +184,25 @@ div.menubar { } .menubar-right .arrow-wrapper { - display: inline; /* For IE */ - position: relative; - margin: 0 5px 0 5px; - width: 20px; - vertical-align: bottom; + display: inline; /* For IE */ + position: relative; + margin: 0 5px 0 5px; + width: 20px; + vertical-align: bottom; } html>body .menubar-right .arrow-wrapper { /* For real browsers */ - display: inline-block; + display: inline-block; padding:0 5px; } .menubar-right .arrow-wrapper a { - display: block; + display: block; } .menubar-right .arrow-wrapper img { - display: block; - margin: 0; + display: block; + margin: 0; } /* END menubar CSS */ @@ -259,9 +259,9 @@ td { } .disabledbtn { -height:20px; -color:#999; -font-size:11px; + height:20px; + color:#999; + font-size:11px; } .disabledUpDnBtn { @@ -287,16 +287,16 @@ and are having difficulty seeing text in inputs, textareas and dropdown selects. /* input, textarea { - background: #FFF; - border: 1px solid #DBDFE6; - border-top-color: #ABADB3; - border-bottom-color: #E3E9EF; - padding: 2px; +background: #FFF; +border: 1px solid #DBDFE6; +border-top-color: #ABADB3; +border-bottom-color: #E3E9EF; +padding: 2px; } select { - background: #FFF; - border: 1px solid #828790; +background: #FFF; +border: 1px solid #828790; } */ @@ -348,7 +348,7 @@ textarea { .annotationasterisk { - color: #E00; + color: #E00; } .annotation { @@ -399,11 +399,11 @@ span.settingcaption { clear: right; margin-bottom: 10px; background-color: #F8F8FF; - outline: 0 none; + outline: 0 none; } .settingentry span { - outline: 0 none; + outline: 0 none; } .settingrow { @@ -415,7 +415,7 @@ span.settingcaption { .settingrow .cke_skin_office2003, .settingrow .cke_skin_office2003 .cke_wrapper{ - margin-bottom: 0; + margin-bottom: 0; } .movableList { @@ -441,17 +441,17 @@ span.settingcaption { .langpopup ul { font-size: 1em; font-weight:bold; - padding-left:1.2em; - line-height:1.5em; + padding-left:1.2em; + line-height:1.5em; margin-top:0.5em; } li.cancellink { - list-style-type:none; - margin-top:1em; - margin-left:-1.2em; - text-align:center; + list-style-type:none; + margin-top:1em; + margin-left:-1.2em; + text-align:center; } @@ -580,12 +580,12 @@ a.optoutemail { background-color: #C5D0F2; } .browsetable td span.content{ - display:block; + display:block; height:3em; overflow:hidden; } .browsetable th strong.content{ - display:block; + display:block; height:4em; overflow:hidden; } @@ -751,22 +751,22 @@ a.optoutemail { .browsetokens td:first-child { text-align:right; - padding-right: 3px; + padding-right: 3px; } .tokensummary tr:first-child { - font-weight:bold; + font-weight:bold; } .tokensummary tr { - margin:0px; - padding:0px; + margin:0px; + padding:0px; } .tokensummary td { - outline: 1px solid; - outline-color:#D2E0F2; -padding: 2px 5px; + outline: 1px solid; + outline-color:#D2E0F2; + padding: 2px 5px; } #addattribute label, @@ -808,9 +808,9 @@ table.templatecontrol select } .templatecontrol textarea#changes { - font-family: monospace; - font-size:0.8em; - width:95%; + font-family: monospace; + font-size:0.8em; + width:95%; } /* Added by evan to help usability on the user template rights form in useradmin/userrighthandling.php */ @@ -832,7 +832,7 @@ table#user-template-rights tr:hover { background-color: #D1D1DF; } - table#user-template-rights tr td +table#user-template-rights tr td ,table#user-template-rights tr th ,table#user-template-rights tfoot tr td { @@ -906,8 +906,8 @@ table.statisticstable, table.statisticssummary { } form#personalsettings { - width:750px; - margin:0 auto; + width:750px; + margin:0 auto; } div.messagebox { @@ -1186,9 +1186,9 @@ div.loader { } #wrapper { - background-color:#f8f8ff; - width:100%; - padding:1px 0px; + background-color:#f8f8ff; + width:100%; + padding:1px 0px; } .background { @@ -1235,7 +1235,7 @@ thead tr .headerSortDown { } thead tr .headerSortDown, thead tr .headerSortUp { -background-color: #8195BA; + background-color: #8195BA; } #tokensearch, #tokenrange, #browseresults{ @@ -1256,18 +1256,18 @@ background-color: #8195BA; div.left { -float:left; -width:300px; + float:left; + width:300px; } div.right { - float:right; - width:300px; + float:right; + width:300px; } .wrap2columns { -width:600px; -margin:0 auto; + width:600px; + margin:0 auto; } #resultexport ul { @@ -1305,7 +1305,7 @@ margin:0 auto; } #statistics_general_filter fieldset{ -clear:both; + clear:both; } @@ -1340,7 +1340,7 @@ clear:both; border-right:1px #fff solid; border-bottom:1px #fff solid; vertical-align: top; - border-collapse:collapse !important; + border-collapse:collapse !important; } .filtertable td:last-child { @@ -1362,17 +1362,17 @@ clear:both; .limebutton { - outline: 0; - margin:1px 4px 1px 0; - padding: 1px 1em; - text-decoration:none !important; - cursor:pointer; - text-align: center; - zoom: 1; + outline: 0; + margin:1px 4px 1px 0; + padding: 1px 1em; + text-decoration:none !important; + cursor:pointer; + text-align: center; + zoom: 1; } #emailtemplates .ui-tabs-panel .limebutton { - margin: 3px 20% 10px 30.5%; + margin: 3px 20% 10px 30.5%; } table.limetable thead th{ @@ -1411,11 +1411,11 @@ thead th } .usersurveypermissions th{ - padding:0 2em; + padding:0 2em; } #responsedetail td{ - padding:3px 5px; + padding:3px 5px; } #frmglobalsettings table { @@ -1432,18 +1432,18 @@ thead th } div.translate { - margin: 2px 1px; + margin: 2px 1px; } #translateform table { - padding: 1px 0; - vertical-align: top; - width: 90%; + padding: 1px 0; + vertical-align: top; + width: 90%; } #translateform textarea:focus{ - outline: blue solid thin; + outline: blue solid thin; } #gbox_urlparams { @@ -1452,4 +1452,56 @@ div.translate { #loginform input[type='text'], #loginform input[type='password'], #loginform select{ width:230px; -} \ No newline at end of file +} + +.placeholder { + background-color: #cfcfcf; +} + +.ui-nestedSortable-error { + background:#fbe3e4; + color:#8a1f11; +} + + +ol.organizer { + padding: 0 auto; + list-style-type: none; + font-weight: bold; + width:800px; +} + +ol.organizer ol { + list-style-type: none; + font-weight: normal; + width:750px; + +} + +ol.organizer { + margin: 4em 0; +} + +.organizer li { + margin: 10px 0 0 0; + padding: 0; +} + +.organizer li ol li{ + margin: 3px 0 0 0; + padding: 0; +} + + +.organizer li div { + border: 1px solid #D2E0F2; + background-color:#D2E0F2; + padding: 3px; + margin: 0; + cursor: move; + width:80%; +} + +.organizer li ol li div{ + background-color:#EEF6FF; +}