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 upload_file(&$frm) { global $session, $CFG; $ext = $frm['file']['ext']; // fileextension for savefile // neuen Text anlegen $textID = sql_addNewText($frm['title'], nvl($frm['abstract']), nvl($frm['length'], 0), $frm['lang'], nvl($frm['cat'], 0), $frm['file']['fileID'], $session['userid']); // file anlegen/kopieren copy($frm['file']['tmp_name'], $CFG->uploadDir . "/{$textID}.{$ext}"); //packer($textID.$ext); return $textID; }