Example #1
1
function makeTask(&$frm)
{
    global $session;
    /* frist feld formatieren */
    $frist = "0000-00-00";
    if (isset($frm['frist']) && $frm['frist'] != "JJJJ-MM-TT") {
        $frist = $frm['frist'];
    }
    // Überprüfung ob Task mit Language schon vorhanden
    /////////////
    // neuen Text anlegen
    $ntextid = sql_addNewText(sqlv($frm['title']), sqlv(nvl($frm['abstract'])), 0, $frm['lang'], nvl($frm['cat'], 0), nvl($frm['filetyp'], 0), $session['userid'], $frm['textID']);
    if (!isset($ntextid) or $ntextid == 0) {
        $session['notice'] = "error making Task. Cannot generate new Text! Please contact the administrator via contact-link<br>Errorcode: tid={$frm['textID']}";
        return 0;
    }
    // neuen Task anlegen
    $taskID = sql_addNewTask($frm['textID'], $ntextid, $session['userid'], $frist);
    return 1;
}
function sql_changeTextAbstract($id, $abstract)
{
    global $CFG;
    db_query("UPDATE otmp_Text SET TextAbstract='" . sqlv($abstract) . "' WHERE TextTID={$id}");
    return db_affected_rows();
}