Esempio n. 1
0
function show_prj()
{
    checkPerm('view');
    $out =& $GLOBALS['page'];
    $out->setWorkingZone('content');
    $lang =& DoceboLanguage::createInstance('project', "lms");
    global $pathprj;
    require_once _base_ . '/lib/lib.table.php';
    // Controllo che l'utente non cerchi di entrare in progetti a cui non e' iscritto.
    $id = $_GET["id"];
    $myprj = user_projects(Docebo::user()->getIdSt());
    if (!in_array($id, $myprj)) {
        die("You can't access");
    }
    $modimg = '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def("_MOD") . '" />';
    $query = sql_query("SELECT * FROM " . $GLOBALS["prefix_lms"] . "_prj WHERE id='{$id}';");
    if ($query && mysql_num_rows($query) > 0) {
        $row = mysql_fetch_array($query);
    }
    $ta_array = array();
    $ta_array["index.php?modname=project&amp;op=project"] = $lang->def("_PROJECT_MANAGER");
    $ta_array[] = $row["ptitle"];
    $out->add(getTitleArea($ta_array, "project"));
    $out->add('<div class="std_block">');
    /*	$out->add('<div class="alignRight">'
    		.'<a class="back_comand" href="index.php?modname=project&amp;op=project">'.$lang->def("_BACK").'</a></div><br />'); */
    $url = "index.php?modname=project&amp;op=project";
    $out->add(getBackUi($url, $lang->def('_BACK')));
    $show_something = false;
    $out->add("<table class=\"prjcontainer\">\n");
    $out->add("<tr>\n");
    $out->add("<td width=\"60%\">\n");
    //=TASKS==============
    if ($row["pstasks"]) {
        show_task($id, $row, $modimg);
        $show_something = true;
    }
    //=FILES==============
    if ($row["psfiles"]) {
        show_files($id, $row, $modimg);
        $show_something = true;
    }
    $out->add("</td>\n");
    $out->add("<td>");
    //=NEWS==============
    if ($row["psnews"]) {
        show_news($id, $row, $modimg);
        $show_something = true;
    }
    //=TODO==============
    if ($row["pstodo"]) {
        show_todo($id, $row, $modimg);
        $show_something = true;
    }
    $out->add("</td>\n");
    $out->add("</tr>\n");
    $out->add("</table><br />\n");
    require_once _base_ . '/lib/lib.dialog.php';
    setupHrefDialogBox('a[href*=prjdelitem]');
    //=MSG======================================================
    if ($row["psmsg"]) {
        $show_something = true;
        require_once $GLOBALS["where_framework"] . "/lib/lib.sysforum.php";
        $out->add('<h3 class="prjmsg_title">' . $lang->def("_MESSAGES") . '</h3>' . "\n");
        $out =& $GLOBALS['page'];
        $out->setWorkingZone('content');
        //$lang=DoceboLanguage::createInstance("sysforum", "lms");
        $sf = new sys_forum("lms", "project_message", $id);
        $sf->setPrefix($GLOBALS["prefix_lms"]);
        $sf->can_write = true;
        $sf->can_moderate = (bool) (is_owner(Docebo::user()->getIdSt(), $id) || is_admin(Docebo::user()->getIdSt(), $id));
        $sf->can_upload = true;
        $sf->use_realname = true;
        $sf->url = "index.php?modname=project&amp;op=showprj&amp;id=" . $id;
        $out->add($sf->show());
        // Change with sysforum class
    }
    if (!$show_something) {
        $out->add("<h3>" . $lang->def("_NOTHINGTOSEE") . "</h3>\n");
    }
    $out->add('</div>');
}
Esempio n. 2
0
 */
global $encounter;
global $pid;
global $visit_date;
global $PDF_OUTPUT;
global $form_id;
global $task;
global $send;
$PDF_OUTPUT = '1';
// If this is a request to make a task, make it.
$ajax_req = $_REQUEST;
if ($_REQUEST['action'] == 'make_task') {
    make_task($ajax_req);
}
if ($_REQUEST['action'] == 'show_task') {
    show_task($ajax_req);
}
// Get the list of Tasks and process them one-by-one
// unless this is a call from the web, then just do the task at hand
// or should the web not do these at all, leave them to the background processor?
$query = "SELECT * FROM form_taskman where PATIENT_ID=? AND (COMPLETED is NULL or COMPLETED != '1')  order by REQ_DATE";
$result = sqlStatement($query, array($ajax_req['pid']));
while ($task = sqlFetchArray($result)) {
    $send = process_tasks($task);
    if ($_REQUEST['action'] == 'make_task') {
        echo json_encode($send);
        exit;
    }
}
$send['comments'] = "Nothing new to do!";
echo json_encode($send);