function insert_new_message_form($events, $bulk) { global $USER_DETAILS; if ($bulk) { $title = S_ACKNOWLEDGE_ALARM_BY; $btn_txt2 = S_ACKNOWLEDGE . ' ' . S_AND_SYMB . ' ' . S_RETURN; } else { $temp = get_acknowledges_by_eventid(get_request('eventid', 0)); if (!DBfetch($temp)) { $title = S_ACKNOWLEDGE_ALARM_BY; $btn_txt = S_ACKNOWLEDGE; $btn_txt2 = S_ACKNOWLEDGE . ' ' . S_AND_SYMB . ' ' . S_RETURN; } else { $title = S_ADD_COMMENT_BY; $btn_txt = S_SAVE; $btn_txt2 = S_SAVE . ' ' . S_AND_SYMB . ' ' . S_RETURN; } } $frmMsg = new CFormTable($title . ' "' . $USER_DETAILS["alias"] . '"'); $frmMsg->SetHelp("manual.php"); if ($bulk) { $frmMsg->addVar('bulkacknowledge', 1); } foreach ($events as $id => $eventid) { $frmMsg->addVar('events[' . $eventid . ']', $eventid); } $frmMsg->addRow(S_MESSAGE, new CTextArea("message", "", 80, 6)); $frmMsg->addItemToBottomRow(new CButton("saveandreturn", $btn_txt2)); isset($btn_txt) ? $frmMsg->addItemToBottomRow(new CButton("save", $btn_txt)) : ''; $frmMsg->addItemToBottomRow(new CButtonCancel(url_param('eventid'))); $frmMsg->Show(false); SetFocus($frmMsg->GetName(), 'message'); $frmMsg->Destroy(); }