diff --git a/admin/bulkappointment.php b/admin/bulkappointment.php index 96bff7b8..518ad57a 100644 --- a/admin/bulkappointment.php +++ b/admin/bulkappointment.php @@ -278,7 +278,7 @@ else
" type="file" accept=""/> 
- + diff --git a/admin/new.php b/admin/new.php index daab6d46..2f8dc713 100644 --- a/admin/new.php +++ b/admin/new.php @@ -233,7 +233,7 @@ $surveys = $db->GetAll($sql);
- " data-off="" data-width="80"/> + " data-off="" data-width="80"/>
@@ -269,7 +269,7 @@ $surveys = $db->GetAll($sql);
- +
diff --git a/admin/questionnairelist.php b/admin/questionnairelist.php index f98786b8..0fcd1e42 100644 --- a/admin/questionnairelist.php +++ b/admin/questionnairelist.php @@ -314,7 +314,7 @@ if (isset($_GET['modify'])) } xhtml_head(T_("Modify Questionnaire "),true,$css,$js_head, false, false, false, "  " . "$rs[description]" . ""); - + $CKEditor = new CKEditor(); $CKEditor->basePath = "../include/ckeditor/"; @@ -361,7 +361,7 @@ if (isset($_GET['modify']))
-
onchange="if(this.checked==true) show(this,'limesc'); else hide(this,'limesc');" data-toggle="toggle" data-on="" data-off="" data-width="80"/>
+
onchange="if(this.checked==true) {show(this,'limesc'); $('#url').attr('required','required');} else{ hide(this,'limesc'); $('#url').removeAttr('required');}" data-toggle="toggle" data-on="" data-off="" data-width="80"/>
>
@@ -396,7 +396,7 @@ if (isset($_GET['modify']))
- +
@@ -566,5 +566,5 @@ print "
"; xhtml_foot($js_foot); ?> \ No newline at end of file diff --git a/admin/quotarow.php b/admin/quotarow.php index 3dfce00f..59f2c720 100755 --- a/admin/quotarow.php +++ b/admin/quotarow.php @@ -123,7 +123,7 @@ if (isset($_GET['questionnaire_id']) && isset($_GET['questionnaire_sample_quota_ $questionnaire_id = false; if (isset($_GET['questionnaire_id'])) $questionnaire_id = bigintval($_GET['questionnaire_id']); -xhtml_head(T_("Quota row management"),true,array("../include/bootstrap-3.3.2/css/bootstrap.min.css","../css/custom.css"),array("../js/window.js")); +xhtml_head(T_("Quota row management"),true,array("../include/bootstrap-3.3.2/css/bootstrap.min.css","../include/bootstrap-toggle/css/bootstrap-toggle.min.css","../css/custom.css"),array("../js/jquery-2.1.3.min.js","../include/bootstrap-toggle/js/bootstrap-toggle.min.js","../js/window.js")); print "

" . T_("Questionnaire") . ": 

"; $sql = "SELECT questionnaire_id as value,description, CASE WHEN questionnaire_id = '$questionnaire_id' THEN 'selected=\'selected\'' ELSE '' END AS selected @@ -295,7 +295,7 @@ if ($questionnaire_id != false)

-

+ " data-off="" data-offstyle="warning"/>

diff --git a/admin/systemsort.php b/admin/systemsort.php index 4a5f77ac..b7f68e7b 100644 --- a/admin/systemsort.php +++ b/admin/systemsort.php @@ -98,9 +98,7 @@ else //print "

" . T_("Monitor system wide case sorting") . "

"; print "

" . T_("Click here to enable and begin system wide case sorting") . "

"; print "

" . T_("System wide case sorting is periodically (via SYSTEM_SORT_MINUTES configuration directive) sorting cases on a system wide basis instead of finding the most appropriate case each time an operator requests a new case. This may increase performance where there are a large number of cases or complex quotas in place. If you are not experiencing any performance problems, it is not recommended to use this feature.") . "

"; - print "

" . T_("Outcome of last process run (if any)") . "

"; - $d = process_get_last_data(2); if ($d !== false) { diff --git a/admin/systemsortprocess.php b/admin/systemsortprocess.php index f39281e4..90291595 100644 --- a/admin/systemsortprocess.php +++ b/admin/systemsortprocess.php @@ -258,11 +258,11 @@ while (!is_process_killed($process_id)) //check if process killed every $sleepin AND ((qsep.questionnaire_id is NULL) or qsep.exclude = 0) AND !(q.restrict_work_shifts = 1 AND sh.shift_id IS NULL) AND !(si.call_restrict = 1 AND cr.day_of_week IS NULL) - AND ((apn.appointment_id IS NOT NULL) or qs.call_attempt_max = 0 or ((SELECT count(*) FROM call_attempt WHERE case_id = c.case_id) < qs.call_attempt_max)) - AND ((apn.appointment_id IS NOT NULL) or qs.call_max = 0 or ((SELECT count(*) FROM `call` WHERE case_id = c.case_id) < qs.call_max)) + AND ((apn.appointment_id IS NOT NULL) or qs.call_attempt_max = 0 or ((SELECT count(*) FROM call_attempt WHERE call_attempt.case_id = c.case_id) < qs.call_attempt_max)) + AND ((apn.appointment_id IS NOT NULL) or qs.call_max = 0 or ((SELECT count(*) FROM `call` WHERE `call`.case_id = c.case_id) < qs.call_max)) AND (SELECT count(*) FROM `questionnaire_sample_quota` WHERE questionnaire_id = c.questionnaire_id AND sample_import_id = s.import_id AND quota_reached = 1) = 0 GROUP BY c.case_id - ORDER BY IF(ISNULL(apn.end),1,0), apn.end ASC, qsep.priority DESC, a.start ASC"; + ORDER BY IF(ISNULL(apn.end),1,0), apn.end ASC, a.start ASC, qsep.priority DESC"; $rs = $db->GetAll($sql); diff --git a/functions/functions.limesurvey.php b/functions/functions.limesurvey.php index 71682d03..6327c4bb 100644 --- a/functions/functions.limesurvey.php +++ b/functions/functions.limesurvey.php @@ -293,7 +293,7 @@ function limesurvey_quota_replicate_completions($lime_sid,$questionnaire_id,$sam $sql = "SELECT COUNT(*) FROM information_schema.tables - WHERE table_schema = 'quexs' + WHERE table_schema = '".DB_NAME."' AND table_name = '" . LIME_PREFIX . "survey_$lime_sid'"; $rs = $db->GetOne($sql); @@ -402,7 +402,7 @@ function limesurvey_quota_completions($lime_sgqa,$lime_sid,$questionnaire_id,$sa $sql = "SELECT COUNT(*) FROM information_schema.tables - WHERE table_schema = 'quexs' + WHERE table_schema = '".DB_NAME."' AND table_name = '" . LIME_PREFIX . "survey_$lime_sid'"; $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 * * @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 */ -function get_limesurvey_quota_info($lime_quota_id,$baselang = DEFAULT_LOCALE) +function get_limesurvey_quota_info($lime_quota_id) { global $db; $ret = array(); - $sql = "SELECT * - FROM ".LIME_PREFIX."quota_members - WHERE quota_id='$lime_quota_id'"; + $sql = "SELECT q.*,s.language + FROM ".LIME_PREFIX."quota_members as q, ".LIME_PREFIX."surveys as s + WHERE q.quota_id='$lime_quota_id' + AND s.sid = q.sid"; $rs = $db->GetAll($sql); @@ -451,11 +451,12 @@ function get_limesurvey_quota_info($lime_quota_id,$baselang = DEFAULT_LOCALE) { $lime_qid = $quota_entry['qid']; $surveyid = $quota_entry['sid']; + $language = $quota_entry['language']; $sql = "SELECT type, title,gid FROM ".LIME_PREFIX."questions WHERE qid='$lime_qid' - AND language='$baselang'"; + AND language='$language'"; $qtype = $db->GetRow($sql); diff --git a/waitnextcase_interface2.php b/waitnextcase_interface2.php index ced1bebd..d4db4c8f 100644 --- a/waitnextcase_interface2.php +++ b/waitnextcase_interface2.php @@ -29,7 +29,7 @@ * * */ - + /** * Language file */ @@ -62,7 +62,6 @@ if (isset($_GET['auto']))