// Diary Windows and the Status History window. var diaryWindow = null; var activeDiaryField = null; var formHTML = "
\n"; var diaryTableHTML = "
\n"; var diaryHistHTML1 = "\n" + "\n"; var diaryEditHTML1 = "\n" + "\n"; var statusHistWindow = null; // ----------------------------------------------------------------- // Opens a diary window for the diary field specified. The diary window // contains a diary history field, and a diary editor field. // The diary editor can be typed in, and if the user presses OK, the // value is sent to the field and the diary window closes. // ----------------------------------------------------------------- function openDiary(fieldID, diaryHistory) { var field = getFieldInstanceByID(fieldID); var accessHTML = ""; if (field.access == disabled) return; if (diaryWindow != null && !diaryWindow.closed) { // alert with message defined in arweb.jsp if (activeDiaryField != field.ctrl) alert( DiaryOpenMsgStr ); diaryWindow.focus(); return; } activeDiaryField = field.ctrl; diaryWindow = window.open("about:blank", 'diaryWindow', 'toolbar=no,location=no,directories=no,dependent=yes' + 'status=no,menubar=no,scrollbars=yes,resizable=yes,' + 'width=520,height=350'); var htmlLabel; htmlLabel = field.label; htmlLabel = EncodeHtmlString(htmlLabel); diaryWindow.document.write("" + htmlLabel +""); diaryWindow.document.write(formHTML); diaryWindow.document.write(diaryTableHTML); var htmlDiaryHistory; htmlDiaryHistory = diaryHistory; htmlDiaryHistory = EncodeHtmlStringTextArea(htmlDiaryHistory); diaryWindow.document.write(diaryHistHTML1 + htmlDiaryHistory + diaryHistHTML2); if (field.access == readOnly) accessHTML = " readonly onFocus=\"this.blur();\">"; else accessHTML = ">"; var htmlValue; htmlValue = field.ctrl.value; htmlValue = EncodeHtmlStringTextArea(htmlValue); diaryWindow.document.write(diaryEditHTML1 + accessHTML); diaryWindow.document.write(htmlValue + diaryEditHTML2); if (field.access == readOnly) diaryWindow.document.write(okButtonHTML); else diaryWindow.document.write(okCancelButtonHTML); diaryWindow.document.write(endHTML); diaryWindow.focus(); } function openDiaryEdit(fieldID) { var field = getFieldInstanceByID(fieldID); var accessHTML = ""; if (field.access == disabled) return; if (diaryWindow != null && !diaryWindow.closed) { // alert with message defined in arweb.jsp if (activeDiaryField != field.ctrl) alert( DiaryOpenMsgStr ); diaryWindow.focus(); return; } activeDiaryField = field.ctrl; diaryWindow = window.open("about:blank", 'diaryWindow', 'toolbar=no,location=no,directories=no,dependent=yes' + 'status=no,menubar=no,scrollbars=yes,resizable=yes,' + 'width=520,height=330'); var htmlLabel; htmlLabel = field.label; htmlLabel = EncodeHtmlString(htmlLabel); diaryWindow.document.write("" + htmlLabel +""); diaryWindow.document.write(formHTML); if (field.access == readOnly) accessHTML = " readonly onFocus=\"this.blur();\">"; else accessHTML = ">"; diaryWindow.document.write(diaryEditorHTML1 + accessHTML); var htmlValue; htmlValue = field.ctrl.value; htmlValue = EncodeHtmlStringTextArea(htmlValue); diaryWindow.document.write(htmlValue + diaryEditorHTML2); if (field.access == readOnly) diaryWindow.document.write(okButtonHTML); else diaryWindow.document.write(okCancelButtonHTML); diaryWindow.document.write(endHTML); diaryWindow.focus(); } // ----------------------------------------------------------------- // The diary editor can be typed in, and if the user presses OK, the // value is sent to the field and the diary window closes. This function // sets the field's value. // ----------------------------------------------------------------- function setDiaryFieldValue(newValue) { activeDiaryField.value = newValue; } // ----------------------------------------------------------------- // the Diary History text field should be read only. This function // is called when focus is set to the Diary History field, and it // causes focus to be lost, thereby not allowing the user to type into // the diary history field. // ----------------------------------------------------------------- function setDiaryReadOnly(form) { form.DiaryHistoryText.blur(); } // ----------------------------------------------------------------- // Opens the status history dialog box. // ----------------------------------------------------------------- function openStatusHistory(statusHistHtml) { if (statusHistWindow != null && !statusHistWindow.closed) { statusHistWindow.focus(); return; } statusHistWindow = window.open("about:blank", 'statusHistWindow', 'toolbar=no,location=no,directories=no,dependent=yes,' + 'status=no,menubar=no,scrollbars=yes,resizable=yes,' + 'width=500,height=350'); statusHistWindow.document.write("Status History"); statusHistWindow.document.write("" + statusHistHtml + ""); statusHistWindow.focus(); }
Diary History:
Diary Editor: