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:
@@ -50,6 +50,11 @@ include("../functions/functions.xhtml.php");
|
|||||||
*/
|
*/
|
||||||
include("../functions/functions.display.php");
|
include("../functions/functions.display.php");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Limesurvey functions
|
||||||
|
*/
|
||||||
|
include("../functions/functions.limesurvey.php");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operator functions
|
* Operator functions
|
||||||
*/
|
*/
|
||||||
@@ -206,6 +211,14 @@ if ($case_id != false)
|
|||||||
</p>
|
</p>
|
||||||
</form>
|
</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&sid=$sid&subaction=edit&id=$id'>" . T_("Modify responses for this case") . "</a></h3>";
|
||||||
|
|
||||||
|
|
||||||
//set an outcome
|
//set an outcome
|
||||||
|
|
||||||
print "<h3>" . T_("Set a case outcome") . "</h3>";
|
print "<h3>" . T_("Set a case outcome") . "</h3>";
|
||||||
|
|||||||
@@ -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
|
* Return the lime_sid given the case_id
|
||||||
|
|||||||
Reference in New Issue
Block a user