$plan_hour = sprintf("csa_plan_hour=%s,", GetSQLValueString($_POST['plan_hour'], "text")); } if (isset($_POST["MM_update"]) && $_POST["MM_update"] == "form1") { if ($_POST['user_cc'] == null) { $cc_post = $_POST['user_cc']; } else { $cc_post = "[" . implode(",", $_POST['user_cc']) . "]"; } $updateSQL = sprintf("UPDATE tk_task SET csa_from_user=%s, csa_to_user=%s, csa_type=%s, csa_text=%s, csa_priority=%s, csa_temp=%s, csa_plan_st=%s, csa_plan_et=%s, {$plan_hour} {$csa_remark1} csa_remark2=%s, test01=%s, csa_last_user=%s, {$test02} WHERE TID=%s", GetSQLValueString($_POST['csa_from_user'], "text"), GetSQLValueString($to_user, "text"), GetSQLValueString($_POST['csa_type'], "text"), GetSQLValueString($_POST['csa_text'], "text"), GetSQLValueString($_POST['csa_priority'], "text"), GetSQLValueString($_POST['csa_temp'], "text"), GetSQLValueString($_POST['plan_start'], "text"), GetSQLValueString($_POST['plan_end'], "text"), GetSQLValueString($_POST['csa_remark2'], "text"), GetSQLValueString($cc_post, "text"), GetSQLValueString($_POST['csa_last_user'], "text"), GetSQLValueString($_POST['TID'], "int")); mysql_select_db($database_tankdb, $tankdb); $Result1 = mysql_query($updateSQL, $tankdb) or die(mysql_error()); $newID = $colname_Recordset_task; $newName = $_SESSION['MM_uid']; $insertSQL2 = sprintf("INSERT INTO tk_log (tk_log_user, tk_log_action, tk_log_type, tk_log_class, tk_log_description) VALUES (%s, %s, %s, 1, '' )", GetSQLValueString($newName, "text"), GetSQLValueString($multilingual_log_edittask, "text"), GetSQLValueString($newID, "text")); $Result2 = mysql_query($insertSQL2, $tankdb) or die(mysql_error()); $last_use_arr = pushlastuse($to_user_arr["0"], $to_user_arr["1"], $_SESSION['MM_uid']); $msg_to = $to_user; $msg_from = $_POST['csa_from_user']; $msg_type = "edittask"; $msg_id = $_POST['TID']; $msg_title = $_POST['csa_text']; if ($cc_post != null) { $cc_arr = json_decode($cc_post, true); foreach ($cc_arr as $k => $v) { send_message($v['uid'], $msg_from, $msg_type, $msg_id, $msg_title, 1); } } $updateGoTo = "default_task_edit.php?editID={$colname_Recordset_task}"; if (isset($_SERVER['QUERY_STRING'])) { $updateGoTo .= strpos($updateGoTo, '?') ? "&" : "?"; $updateGoTo .= $_SERVER['QUERY_STRING'];
$wbs = $task_id . ">" . $wbs_id; } else { $wbs = $row_Recordset_task['csa_remark5'] . ">" . $row_Recordset_task['TID'] . ">" . $wbs_id; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if (isset($_POST["MM_insert"]) && $_POST["MM_insert"] == "form1") { if ($_POST['user_cc'] == null) { $cc_post = $_POST['user_cc']; } else { $cc_post = "[" . implode(",", $_POST['user_cc']) . "]"; } $newID = add_task($cc_post, $_POST['csa_from_user'], $to_user_arr['0'], $project_id, $_POST['csa_type'], $_POST['csa_text'], $_POST['csa_priority'], $_POST['csa_temp'], $_POST['plan_start'], $_POST['plan_end'], $_POST['plan_hour'], $_POST['csa_remark2'], $_POST['csa_create_user'], $_POST['csa_last_user'], $task_id, $wbs, $wbs_id, $_SESSION['MM_uid'], $csa_tag, $csa_remark1); $last_use_arr = pushlastuse($to_user_arr["0"], $to_user_arr["1"], $myid); if ($project_url == 1) { $insertGoTo = "project_view.php?recordID={$project_id}"; } else { if ($user_url == 1) { $insertGoTo = "user_view.php?recordID={$user_id}"; } else { $insertGoTo = "default_task_edit.php?editID={$newID}"; } } if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= strpos($insertGoTo, '?') ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } $msg_to = $to_user_arr['0']; $msg_from = $_POST['csa_create_user'];