mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Fixes lp:1436664 - System sort process fails where database name not 'quexs'
Also fixes notices generated where the default language doesn't match the questionnaire language on quota reporting
This commit is contained in:
@@ -293,7 +293,7 @@ function limesurvey_quota_replicate_completions($lime_sid,$questionnaire_id,$sam
|
|||||||
|
|
||||||
$sql = "SELECT COUNT(*)
|
$sql = "SELECT COUNT(*)
|
||||||
FROM information_schema.tables
|
FROM information_schema.tables
|
||||||
WHERE table_schema = 'quexs'
|
WHERE table_schema = '".DB_NAME."'
|
||||||
AND table_name = '" . LIME_PREFIX . "survey_$lime_sid'";
|
AND table_name = '" . LIME_PREFIX . "survey_$lime_sid'";
|
||||||
|
|
||||||
$rs = $db->GetOne($sql);
|
$rs = $db->GetOne($sql);
|
||||||
@@ -402,7 +402,7 @@ function limesurvey_quota_completions($lime_sgqa,$lime_sid,$questionnaire_id,$sa
|
|||||||
|
|
||||||
$sql = "SELECT COUNT(*)
|
$sql = "SELECT COUNT(*)
|
||||||
FROM information_schema.tables
|
FROM information_schema.tables
|
||||||
WHERE table_schema = 'quexs'
|
WHERE table_schema = '".DB_NAME."'
|
||||||
AND table_name = '" . LIME_PREFIX . "survey_$lime_sid'";
|
AND table_name = '" . LIME_PREFIX . "survey_$lime_sid'";
|
||||||
|
|
||||||
$rs = $db->GetOne($sql);
|
$rs = $db->GetOne($sql);
|
||||||
@@ -432,18 +432,18 @@ function limesurvey_quota_completions($lime_sgqa,$lime_sid,$questionnaire_id,$sa
|
|||||||
* Based on GetQuotaInformation() from common.php in Limesurvey
|
* Based on GetQuotaInformation() from common.php in Limesurvey
|
||||||
*
|
*
|
||||||
* @param int $lime_quota_id The quota id to get information on
|
* @param int $lime_quota_id The quota id to get information on
|
||||||
* @param string $baselang The base language for getting information from questions
|
|
||||||
* @return array An array containing the question information for comparison
|
* @return array An array containing the question information for comparison
|
||||||
*/
|
*/
|
||||||
function get_limesurvey_quota_info($lime_quota_id,$baselang = DEFAULT_LOCALE)
|
function get_limesurvey_quota_info($lime_quota_id)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
|
||||||
$sql = "SELECT *
|
$sql = "SELECT q.*,s.language
|
||||||
FROM ".LIME_PREFIX."quota_members
|
FROM ".LIME_PREFIX."quota_members as q, ".LIME_PREFIX."surveys as s
|
||||||
WHERE quota_id='$lime_quota_id'";
|
WHERE q.quota_id='$lime_quota_id'
|
||||||
|
AND s.sid = q.sid";
|
||||||
|
|
||||||
$rs = $db->GetAll($sql);
|
$rs = $db->GetAll($sql);
|
||||||
|
|
||||||
@@ -451,11 +451,12 @@ function get_limesurvey_quota_info($lime_quota_id,$baselang = DEFAULT_LOCALE)
|
|||||||
{
|
{
|
||||||
$lime_qid = $quota_entry['qid'];
|
$lime_qid = $quota_entry['qid'];
|
||||||
$surveyid = $quota_entry['sid'];
|
$surveyid = $quota_entry['sid'];
|
||||||
|
$language = $quota_entry['language'];
|
||||||
|
|
||||||
$sql = "SELECT type, title,gid
|
$sql = "SELECT type, title,gid
|
||||||
FROM ".LIME_PREFIX."questions
|
FROM ".LIME_PREFIX."questions
|
||||||
WHERE qid='$lime_qid'
|
WHERE qid='$lime_qid'
|
||||||
AND language='$baselang'";
|
AND language='$language'";
|
||||||
|
|
||||||
$qtype = $db->GetRow($sql);
|
$qtype = $db->GetRow($sql);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user