2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Added link for modifying responses for the case

This commit is contained in:
azammitdcarf
2009-02-26 07:11:08 +00:00
parent 9656973f9a
commit f5774e8458
2 changed files with 68 additions and 0 deletions

View File

@@ -50,6 +50,11 @@ include("../functions/functions.xhtml.php");
*/
include("../functions/functions.display.php");
/**
* Limesurvey functions
*/
include("../functions/functions.limesurvey.php");
/**
* Operator functions
*/
@@ -206,6 +211,14 @@ if ($case_id != false)
</p>
</form>
<?
//Modify the case in Limesurvey
$sid = get_lime_sid($case_id);
$id = get_lime_id($case_id);
print "<h3><a href='" . LIME_URL . "admin/admin.php?action=dataentry&amp;sid=$sid&amp;subaction=edit&amp;id=$id'>" . T_("Modify responses for this case") . "</a></h3>";
//set an outcome
print "<h3>" . T_("Set a case outcome") . "</h3>";

View File

@@ -134,7 +134,62 @@ function create_limesurvey_questionnaire($title)
}
/**
* Return the limesurvey id given the case_id
*
* @param int $case_id The case id
* @return bool|int False if no lime_id otherwise the lime_id
*
*/
function get_lime_id($case_id)
{
global $ldb;
$lime_sid = get_lime_sid($case_id);
if ($lime_sid == false) return false;
$sql = "SELECT id
FROM " . LIME_PREFIX . "survey_$lime_sid
WHERE token = '$case_id'";
$r = $ldb->GetRow($sql);
if (!empty($r) && isset($r['id']))
return $r['id'];
return false;
}
/**
* Return the limesurvey tid given the case_id
*
* @param int $case_id The case id
* @return bool|int False if no lime_tid otherwise the lime_tid
*
*/
function get_lime_tid($case_id)
{
global $ldb;
$lime_sid = get_lime_sid($case_id);
if ($lime_sid == false) return false;
$sql = "SELECT tid
FROM " . LIME_PREFIX . "tokens_$lime_sid
WHERE token = '$case_id'";
$r = $ldb->GetRow($sql);
if (!empty($r) && isset($r['tid']))
return $r['tid'];
return false;
}
/**
* Return the lime_sid given the case_id