mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Use single attribute table in edit form
SVN revision: 1076
This commit is contained in:
parent
807ab54ad2
commit
87a088d94f
56
src/elogd.c
56
src/elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.472 2004/09/18 02:43:03 midas
|
||||||
|
Use single attribute table in edit form
|
||||||
|
|
||||||
Revision 1.471 2004/09/15 05:24:31 midas
|
Revision 1.471 2004/09/15 05:24:31 midas
|
||||||
Use again common table for attribute display
|
Use again common table for attribute display
|
||||||
|
|
||||||
@ -7217,7 +7220,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
time_t now, ltime;
|
time_t now, ltime;
|
||||||
char fl[8][NAME_LENGTH];
|
char fl[8][NAME_LENGTH];
|
||||||
struct tm *pts, ts;
|
struct tm *pts, ts;
|
||||||
BOOL preset_text;
|
BOOL preset_text, subtable;
|
||||||
|
|
||||||
for (i = 0; i < MAX_ATTACHMENTS; i++)
|
for (i = 0; i < MAX_ATTACHMENTS; i++)
|
||||||
att[i][0] = 0;
|
att[i][0] = 0;
|
||||||
@ -7662,8 +7665,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
/*---- entry form ----*/
|
/*---- entry form ----*/
|
||||||
|
|
||||||
/* table for two-column items */
|
/* table for two-column items */
|
||||||
rsprintf
|
rsprintf("<tr><td><table class=\"listframe\" width=\"100%%\" cellspacing=0 cellpadding=0>");
|
||||||
("<tr><td><table class=\"listframe\" width=\"100%%\" cellspacing=0 cellpadding=0>");
|
|
||||||
|
|
||||||
/* print required message if one of the attributes has it set */
|
/* print required message if one of the attributes has it set */
|
||||||
for (i = 0; i < lbs->n_attr; i++) {
|
for (i = 0; i < lbs->n_attr; i++) {
|
||||||
@ -7708,6 +7710,8 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
subtable = 0;
|
||||||
|
|
||||||
/* display attributes */
|
/* display attributes */
|
||||||
for (index = 0; index < lbs->n_attr; index++) {
|
for (index = 0; index < lbs->n_attr; index++) {
|
||||||
strcpy(class_name, "attribname");
|
strcpy(class_name, "attribname");
|
||||||
@ -7730,9 +7734,16 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
input_maxlen = atoi(fl[4]);
|
input_maxlen = atoi(fl[4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index == 0 || (format_flags[index] & AFF_SAME_LINE) == 0)
|
if (format_flags[index] & AFF_SAME_LINE)
|
||||||
rsprintf
|
/* if attribute on same line, do nothing */
|
||||||
("<tr><td colspan=2><table width=\"100%%\" cellpadding=0 cellspacing=0><tr>");
|
rsprintf("");
|
||||||
|
else if (index < lbs->n_attr-1 && (format_flags[index+1] & AFF_SAME_LINE)) {
|
||||||
|
/* if next attribute on same line, start a new subtable */
|
||||||
|
rsprintf("<tr><td colspan=2><table width=\"100%%\" cellpadding=0 cellspacing=0><tr>");
|
||||||
|
subtable = 1;
|
||||||
|
} else
|
||||||
|
/* for normal attribute, start new row */
|
||||||
|
rsprintf("<tr>");
|
||||||
|
|
||||||
strcpy(star, (attr_flags[index] & AF_REQUIRED) ? "<font color=red>*</font>" : "");
|
strcpy(star, (attr_flags[index] & AF_REQUIRED) ? "<font color=red>*</font>" : "");
|
||||||
|
|
||||||
@ -8062,10 +8073,25 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index == lbs->n_attr - 1 || (format_flags[index + 1] & AFF_SAME_LINE) == 0)
|
if (index < lbs->n_attr-1 && (format_flags[index+1] & AFF_SAME_LINE) == 0) {
|
||||||
rsprintf("</tr></table></td></tr>\n");
|
/* if next attribute not on same line, close row or subtable */
|
||||||
}
|
if (subtable) {
|
||||||
|
rsprintf("</table></td></tr>\n");
|
||||||
|
subtable = 0;
|
||||||
|
} else
|
||||||
|
rsprintf("</tr>");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* if last attribute, close row or subtable */
|
||||||
|
if (index == lbs->n_attr - 1) {
|
||||||
|
if (subtable) {
|
||||||
|
rsprintf("</table></td></tr>\n");
|
||||||
|
subtable = 0;
|
||||||
|
} else
|
||||||
|
rsprintf("</tr>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* set textarea width */
|
/* set textarea width */
|
||||||
width = 76;
|
width = 76;
|
||||||
|
|
||||||
@ -18946,6 +18972,12 @@ void interprete(char *lbook, char *path)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* check for calender */
|
||||||
|
if (strieq(dec_path, "cal.html")) {
|
||||||
|
show_calendar(lbs);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*---- check if file requested -----------------------------------*/
|
/*---- check if file requested -----------------------------------*/
|
||||||
|
|
||||||
/* skip elog message id in front of possible attachment */
|
/* skip elog message id in front of possible attachment */
|
||||||
@ -19383,12 +19415,6 @@ void interprete(char *lbook, char *path)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check for calender */
|
|
||||||
if (strieq(dec_path, "cal.html")) {
|
|
||||||
show_calendar(lbs);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* show page listing or display single entry */
|
/* show page listing or display single entry */
|
||||||
if (dec_path[0] == 0)
|
if (dec_path[0] == 0)
|
||||||
show_elog_list(lbs, 0, 0, 1, NULL);
|
show_elog_list(lbs, 0, 0, 1, NULL);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user