diff --git a/src/elogd.c b/src/elogd.c index 6ac0dbbe..e62b62f2 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 1.387 2004/07/15 09:55:03 midas + Use 'format = 1' also in entry form + Revision 1.386 2004/07/15 07:59:15 midas Apply tooltip title to whole attribute row @@ -6445,14 +6448,14 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL BOOL breedit) { int i, j, n, index, size, width, height, fh, length, first, input_size, input_maxlen, - format_flags, year, month, day; + format_flags[MAX_N_ATTR], year, month, day; char str[1000], preset[1000], *p, *pend, star[80], comment[10000], reply_string[256], list[MAX_N_ATTR][NAME_LENGTH], file_name[256], *buffer, format[256], date[80], attrib[MAX_N_ATTR][NAME_LENGTH], *text, orig_tag[80], reply_tag[MAX_REPLY_TO * 10], att[MAX_ATTACHMENTS][256], encoding[80], slist[MAX_N_ATTR + 10][NAME_LENGTH], svalue[MAX_N_ATTR + 10][NAME_LENGTH], owner[256], locked_by[256], class_value[80], class_name[80], condition[256], - ua[NAME_LENGTH], mid[80]; + ua[NAME_LENGTH], mid[80], title[256]; time_t now, ltime; char fl[8][NAME_LENGTH]; struct tm *pts, ts; @@ -6895,7 +6898,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL /*---- entry form ----*/ /* table for two-column items */ - rsprintf(""); + rsprintf("
"); /* print required message if one of the attributes has it set */ for (i = 0; i < lbs->n_attr; i++) { @@ -6929,21 +6932,29 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL rsprintf("\n", date); + /* retrieve attribute flags */ + for (i = 0; i < lbs->n_attr; i++) { + format_flags[i] = 0; + sprintf(str, "Format %s", attr_list[i]); + if (getcfg(lbs->name, str, format)) { + n = strbreak(format, fl, 8, ","); + if (n > 0) + format_flags[i] = atoi(fl[0]); + } + } + /* display attributes */ for (index = 0; index < lbs->n_attr; index++) { strcpy(class_name, "attribname"); strcpy(class_value, "attribvalue"); input_size = 80; input_maxlen = NAME_LENGTH; - format_flags = 0; strcpy(ua, attr_list[index]); btou(ua); sprintf(str, "Format %s", attr_list[index]); if (getcfg(lbs->name, str, format)) { n = strbreak(format, fl, 8, ","); - if (n > 0) - format_flags = atoi(fl[0]); if (n > 1) strlcpy(class_name, fl[1], sizeof(class_name)); if (n > 2) @@ -6954,6 +6965,9 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL input_maxlen = atoi(fl[4]); } + if ((format_flags[index] & AFF_SAME_LINE) == 0) + rsprintf("\n"); } /* set textarea width */
%s\n", str); rsprintf("
"); + strcpy(star, (attr_flags[index] & AF_REQUIRED) ? "*" : ""); /* check for preset string */ @@ -6984,10 +6998,11 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL /* display text box with optional tooltip */ sprintf(str, "Tooltip %s", attr_list[index]); + title[0] = 0; if (getcfg(lbs->name, str, comment)) - rsprintf("\n"); + rsprintf("\n"); } else { /* show normal edit field */ - rsprintf("\n"); + rsprintf("\n"); } } else { @@ -7074,18 +7089,18 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL /* display checkbox */ if (atoi(attrib[index]) == 1) rsprintf - ("\n"); + rsprintf("\n"); } else if (attr_flags[index] & AF_MULTI) { /* display multiple check boxes */ - rsprintf("\n"); + rsprintf("\n"); } else if (attr_flags[index] & AF_RADIO) { /* display radio buttons */ - rsprintf("\n"); + rsprintf("\n"); } else if (attr_flags[index] & AF_ICON) { /* display icons */ - rsprintf("\n"); + rsprintf("\n"); } else { - rsprintf("\n"); + rsprintf("\n"); } } } } + + if (index == lbs->n_attr - 1 || (format_flags[index + 1] & AFF_SAME_LINE) == 0) + rsprintf("
", comment); - else - rsprintf("
"); + sprintf(title, " title=\"%s\"", comment); + + rsprintf("", title); /* display attribute name */ rsprintf("%s%s:", attr_list[index], star); @@ -7004,7 +7019,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL (bedit && (attr_flags[index] & AF_FIXED_EDIT)) || (message_id && !bedit && (attr_flags[index] & AF_FIXED_REPLY))) { - rsprintf("\n"); + rsprintf("\n", title); rsputs2(attrib[index]); rsprintf(" "); @@ -7051,22 +7066,22 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL day = pts->tm_mday; } - rsprintf(""); + rsprintf("", title); sprintf(str, "%d", index); show_date_selector(day, month, year, str); - rsprintf("
"); + rsprintf("", title); strencode2(str, attrib[index]); rsprintf ("\n", input_size, input_maxlen, ua, str); - rsprintf("
\n", - ua); + ("\n", + title, ua); else rsprintf - ("\n", - ua); + ("\n", + title, ua); } else { sprintf(str, loc("Add %s"), attr_list[index]); if (strieq(getparam("extend"), str)) { - rsprintf("\n"); + rsprintf("\n", title); rsprintf(""); rsprintf(loc("Add new option here"), attr_list[index]); rsprintf(" : \n"); @@ -7094,12 +7109,12 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL ("\n", input_maxlen, ua, attrib[index]); - rsprintf("
\n"); + rsprintf("\n", title); for (i = 0; i < MAX_N_LIST && attr_options[index][i][0]; i++) { sprintf(str, "%s_%d", ua, i); @@ -7116,7 +7131,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL rsprintf("\n", str, attr_options[index][i]); - if (format_flags & AFF_MULTI_LINE) + if (format_flags[index] & AFF_MULTI_LINE) rsprintf("
"); } @@ -7125,11 +7140,11 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL rsprintf("\n", str); } - rsprintf("
\n"); + rsprintf("\n", title); for (i = 0; i < MAX_N_LIST && attr_options[index][i][0]; i++) { if (strstr(attrib[index], attr_options[index][i])) @@ -7144,7 +7159,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL rsprintf("\n", attr_options[index][i], attr_options[index][i]); - if (format_flags & AFF_MULTI_LINE) + if (format_flags[index] & AFF_MULTI_LINE) rsprintf("
"); } @@ -7153,11 +7168,11 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL rsprintf("\n", str); } - rsprintf("
\n"); + rsprintf("\n", title); for (i = 0; i < MAX_N_LIST && attr_options[index][i][0]; i++) { if (strstr(attrib[index], attr_options[index][i])) @@ -7178,15 +7193,15 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL rsprintf("\n", attr_options[index][i]); - if (format_flags & AFF_MULTI_LINE) + if (format_flags[index] & AFF_MULTI_LINE) rsprintf("
"); } - rsprintf("
\n"); + rsprintf("\n", title); /* display drop-down box */ rsprintf("