mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
checked for existence of result set before applying RecordCount method
New questionnaire form has larger text boxes for entering data - and hides entry when rs not required
This commit is contained in:
@@ -62,8 +62,10 @@ function vq($client_id,$questionnaire_id)
|
|||||||
|
|
||||||
$vq = $db->Execute($sql);
|
$vq = $db->Execute($sql);
|
||||||
|
|
||||||
return $vq->RecordCount();
|
if ($vq)
|
||||||
|
return $vq->RecordCount();
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ include("../functions/functions.input.php");
|
|||||||
global $ldb;
|
global $ldb;
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
xhtml_head(T_("New: Create new questionnaire"));
|
xhtml_head(T_("New: Create new questionnaire"),true,false,array("../js/new.js"));
|
||||||
|
|
||||||
if (isset($_POST['import_file']))
|
if (isset($_POST['import_file']))
|
||||||
{
|
{
|
||||||
@@ -139,13 +139,15 @@ foreach($surveys as $s)
|
|||||||
<p><? echo T_("Restrict appointments to shifts?"); ?> <input name="ras" type="checkbox" checked="checked"/></p>
|
<p><? echo T_("Restrict appointments to shifts?"); ?> <input name="ras" type="checkbox" checked="checked"/></p>
|
||||||
<p><? echo T_("Restrict work to shifts?"); ?> <input name="rws" type="checkbox" checked="checked"/></p>
|
<p><? echo T_("Restrict work to shifts?"); ?> <input name="rws" type="checkbox" checked="checked"/></p>
|
||||||
<p><? echo T_("Questionnaire for testing only?"); ?> <input name="testing" type="checkbox"/></p>
|
<p><? echo T_("Questionnaire for testing only?"); ?> <input name="testing" type="checkbox"/></p>
|
||||||
<p><? echo T_("Use respondent selection text?"); ?> <input name="rs" type="checkbox" checked="checked"/></p>
|
<p><? echo T_("Use respondent selection text?"); ?> <input name="rs" id="rs" type="checkbox" checked="checked" onclick="showHide(this,'rstext');"/></p>
|
||||||
<p><? echo T_("Respondent selection introduction:"); ?> <input type="text" name="rs_intro"/></p>
|
<div id='rstext'>
|
||||||
<p><? echo T_("Respondent selection project introduction:"); ?> <input type="text" name="rs_project_intro"/></p>
|
<p><? echo T_("Respondent selection introduction:"); ?> <textarea cols="40" rows="4" name="rs_intro"></textarea></p>
|
||||||
<p><? echo T_("Respondent selection project end:"); ?> <input type="text" name="rs_project_end"/></p>
|
<p><? echo T_("Respondent selection project introduction:"); ?> <textarea cols="40" rows="4" name="rs_project_intro"></textarea></p>
|
||||||
<p><? echo T_("Respondent selection callback (already started questionnaire):"); ?> <input type="text" name="rs_callback"/></p>
|
<p><? echo T_("Respondent selection project end:"); ?> <textarea cols="40" rows="4" name="rs_project_end"></textarea></p>
|
||||||
<p><? echo T_("Message to leave on an answering machine:"); ?> <input type="text" name="rs_answeringmachine"/></p>
|
<p><? echo T_("Respondent selection callback (already started questionnaire):"); ?> <textarea cols="40" rows="4" name="rs_callback"></textarea></p>
|
||||||
<p><input type="submit" name="import_file"/></p>
|
<p><? echo T_("Message to leave on an answering machine:"); ?> <textarea cols="40" rows="4" name="rs_answeringmachine"></textarea></p>
|
||||||
|
</div>
|
||||||
|
<p><input type="submit" name="import_file" value="<? echo T_("Create Questionnaire"); ?>"/></p>
|
||||||
</form>
|
</form>
|
||||||
<?
|
<?
|
||||||
xhtml_foot();
|
xhtml_foot();
|
||||||
|
|||||||
@@ -62,8 +62,10 @@ function vq($operator_id,$questionnaire_id)
|
|||||||
|
|
||||||
$vq = $db->Execute($sql);
|
$vq = $db->Execute($sql);
|
||||||
|
|
||||||
return $vq->RecordCount();
|
if ($vq)
|
||||||
|
return $vq->RecordCount();
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -62,8 +62,10 @@ function vq($operator_id,$outcome_type_id)
|
|||||||
|
|
||||||
$vq = $db->Execute($sql);
|
$vq = $db->Execute($sql);
|
||||||
|
|
||||||
return $vq->RecordCount();
|
if ($vq)
|
||||||
|
return $vq->RecordCount();
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -496,7 +496,7 @@ function display_calendar($respondent_id, $questionnaire_id, $year = false, $mon
|
|||||||
AND MONTH(CONVERT_TZ(s.start,'UTC',r.Time_zone_name)) = '{$Day->thisMonth()}'
|
AND MONTH(CONVERT_TZ(s.start,'UTC',r.Time_zone_name)) = '{$Day->thisMonth()}'
|
||||||
AND YEAR(CONVERT_TZ(s.start,'UTC',r.Time_zone_name)) = '{$Day->thisYear()}'");
|
AND YEAR(CONVERT_TZ(s.start,'UTC',r.Time_zone_name)) = '{$Day->thisYear()}'");
|
||||||
|
|
||||||
if ($rs->RecordCount() == 0)
|
if (!empty($rs) && $rs->RecordCount() == 0)
|
||||||
{
|
{
|
||||||
echo ( "<td class=\"notavailable $today\">".$Day->thisDay()."</td>\n" );
|
echo ( "<td class=\"notavailable $today\">".$Day->thisDay()."</td>\n" );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ function create_limesurvey_questionnaire($title)
|
|||||||
$isquery = "SELECT sid FROM ".db_table_name('surveys')." WHERE sid=$surveyid";
|
$isquery = "SELECT sid FROM ".db_table_name('surveys')." WHERE sid=$surveyid";
|
||||||
$isresult = $ldb->Execute($isquery);
|
$isresult = $ldb->Execute($isquery);
|
||||||
}
|
}
|
||||||
while ($isresult->RecordCount()>0);
|
while (!empty($isresult) && $isresult->RecordCount() > 0);
|
||||||
|
|
||||||
$isquery = "INSERT INTO ". LIME_PREFIX ."surveys\n"
|
$isquery = "INSERT INTO ". LIME_PREFIX ."surveys\n"
|
||||||
. "(sid, owner_id, admin, active, useexpiry, expires, "
|
. "(sid, owner_id, admin, active, useexpiry, expires, "
|
||||||
|
|||||||
Reference in New Issue
Block a user