mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Restructured code
SVN revision: 756
This commit is contained in:
parent
fdf70e1b9d
commit
cf4ccf4a2f
177
src/elogd.c
177
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.244 2004/02/13 23:27:20 midas
|
||||||
|
Restructured code
|
||||||
|
|
||||||
Revision 1.243 2004/02/13 20:45:09 midas
|
Revision 1.243 2004/02/13 20:45:09 midas
|
||||||
Fixed another problem with quotation marks
|
Fixed another problem with quotation marks
|
||||||
|
|
||||||
@ -2339,7 +2342,6 @@ char *loc(char *orig)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getcfg("global", "Language", language);
|
getcfg("global", "Language", language);
|
||||||
printf("Language error: string \"%s\" not found for language \"%s\"\n", orig,
|
printf("Language error: string \"%s\" not found for language \"%s\"\n", orig,
|
||||||
language);
|
language);
|
||||||
@ -5924,6 +5926,58 @@ BOOL is_cond_attr(index)
|
|||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
void show_date_selector(int day, int month, int year, int index)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
rsprintf("<select name=\"m%d\">\n", index);
|
||||||
|
|
||||||
|
rsprintf("<option value=\"\">\n");
|
||||||
|
for (i = 0; i < 12; i++)
|
||||||
|
if (i+1 == month)
|
||||||
|
rsprintf("<option selected value=\"%d\">%s\n", i + 1, month_name(i));
|
||||||
|
else
|
||||||
|
rsprintf("<option value=\"%d\">%s\n", i + 1, month_name(i));
|
||||||
|
rsprintf("</select>\n");
|
||||||
|
|
||||||
|
rsprintf("<select name=\"d%d\">", index);
|
||||||
|
rsprintf("<option selected value=\"\">\n");
|
||||||
|
for (i = 0; i < 31; i++)
|
||||||
|
if (i+1 == day)
|
||||||
|
rsprintf("<option selected value=%d>%d\n", i + 1, i + 1);
|
||||||
|
else
|
||||||
|
rsprintf("<option value=%d>%d\n", i + 1, i + 1);
|
||||||
|
rsprintf("</select>\n");
|
||||||
|
|
||||||
|
if (year)
|
||||||
|
rsprintf(" %s: <input type=\"text\" size=5 maxlength=5 name=\"y%d\" value=\"%d\">",
|
||||||
|
loc("Year"), index, year);
|
||||||
|
else
|
||||||
|
rsprintf(" %s: <input type=\"text\" size=5 maxlength=5 name=\"y%d\">",
|
||||||
|
loc("Year"), index);
|
||||||
|
|
||||||
|
rsprintf("\n<script language=\"javascript\" type=\"text/javascript\">\n");
|
||||||
|
rsprintf("<!--\n");
|
||||||
|
rsprintf("function opencal(i)\n");
|
||||||
|
rsprintf("{\n");
|
||||||
|
rsprintf(" window.open(\"cal.html?i=\"+i, \"\",\n");
|
||||||
|
rsprintf
|
||||||
|
(" \"width=300,height=195,dependent=yes,menubar=no,scrollbars=no,location=no\");\n");
|
||||||
|
rsprintf("}\n\n");
|
||||||
|
|
||||||
|
rsprintf("if (navigator.javaEnabled()) {\n");
|
||||||
|
rsprintf(" document.write(\" \");\n");
|
||||||
|
rsprintf(" document.write(\"<a href=\\\"javascript:opencal(%d)\\\">\");\n", index);
|
||||||
|
rsprintf
|
||||||
|
(" document.writeln(\"<img src=\\\"cal.gif\\\" border=\\\"0\\\" alt=\\\"%s\\\"></a>\");\n",
|
||||||
|
loc("Pick a date"));
|
||||||
|
rsprintf("} \n");
|
||||||
|
rsprintf("//-->\n");
|
||||||
|
rsprintf("</script>\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------*/
|
||||||
|
|
||||||
void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL bupload,
|
void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL bupload,
|
||||||
BOOL breedit)
|
BOOL breedit)
|
||||||
{
|
{
|
||||||
@ -6405,54 +6459,10 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
day = pts->tm_mday;
|
day = pts->tm_mday;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* display date selector */
|
rsprintf("<td class=\"attribvalue\">");
|
||||||
rsprintf("<td class=\"attribvalue\"><select name=\"m%d\">\n", index);
|
show_date_selector(day, month, year, index);
|
||||||
|
|
||||||
rsprintf("<option value=\"\">\n");
|
|
||||||
for (i = 0; i < 12; i++)
|
|
||||||
if (i+1 == month)
|
|
||||||
rsprintf("<option selected value=\"%d\">%s\n", i + 1, month_name(i));
|
|
||||||
else
|
|
||||||
rsprintf("<option value=\"%d\">%s\n", i + 1, month_name(i));
|
|
||||||
rsprintf("</select>\n");
|
|
||||||
|
|
||||||
rsprintf("<select name=\"d%d\">", index);
|
|
||||||
rsprintf("<option selected value=\"\">\n");
|
|
||||||
for (i = 0; i < 31; i++)
|
|
||||||
if (i+1 == day)
|
|
||||||
rsprintf("<option selected value=%d>%d\n", i + 1, i + 1);
|
|
||||||
else
|
|
||||||
rsprintf("<option value=%d>%d\n", i + 1, i + 1);
|
|
||||||
rsprintf("</select>\n");
|
|
||||||
|
|
||||||
if (year)
|
|
||||||
rsprintf(" %s: <input type=\"text\" size=5 maxlength=5 name=\"y%d\" value=\"%d\">",
|
|
||||||
loc("Year"), index, year);
|
|
||||||
else
|
|
||||||
rsprintf(" %s: <input type=\"text\" size=5 maxlength=5 name=\"y%d\">",
|
|
||||||
loc("Year"), index);
|
|
||||||
|
|
||||||
rsprintf("\n<script language=\"javascript\" type=\"text/javascript\">\n");
|
|
||||||
rsprintf("<!--\n");
|
|
||||||
rsprintf("function opencal(i)\n");
|
|
||||||
rsprintf("{\n");
|
|
||||||
rsprintf(" window.open(\"cal.html?i=\"+i, \"\",\n");
|
|
||||||
rsprintf
|
|
||||||
(" \"width=300,height=195,dependent=yes,menubar=no,scrollbars=no,location=no\");\n");
|
|
||||||
rsprintf("}\n\n");
|
|
||||||
|
|
||||||
rsprintf("if (navigator.javaEnabled()) {\n");
|
|
||||||
rsprintf(" document.write(\" \");\n");
|
|
||||||
rsprintf(" document.write(\"<a href=\\\"javascript:opencal(%d)\\\">\");\n", index);
|
|
||||||
rsprintf
|
|
||||||
(" document.writeln(\"<img src=\\\"cal.gif\\\" border=\\\"0\\\" alt=\\\"%s\\\"></a>\");\n",
|
|
||||||
loc("Pick a date"));
|
|
||||||
rsprintf("} \n");
|
|
||||||
rsprintf("//-->\n");
|
|
||||||
rsprintf("</script>\n");
|
|
||||||
|
|
||||||
rsprintf("</td></tr>\n");
|
rsprintf("</td></tr>\n");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
/* show normal edit field */
|
/* show normal edit field */
|
||||||
@ -7077,42 +7087,12 @@ void show_find_form(LOGBOOK * lbs)
|
|||||||
/* table for two-column items */
|
/* table for two-column items */
|
||||||
rsprintf("<table width=\"100%%\" cellspacing=0>\n");
|
rsprintf("<table width=\"100%%\" cellspacing=0>\n");
|
||||||
|
|
||||||
rsprintf("<tr><td nowrap width=\"10%%\">%s:</td>", loc("Start date"));
|
rsprintf("<tr><td nowrap width=\"10%%\">%s:</td>", loc("Entry date"));
|
||||||
rsprintf("<td><select name=\"m1\">\n");
|
rsprintf("<td><table width=\"100%%\" cellspacing=0 border=1>\n");
|
||||||
|
rsprintf("<tr><td>%s:<td>", loc("Start"));
|
||||||
rsprintf("<option value=\"\">\n");
|
|
||||||
for (i = 0; i < 12; i++)
|
show_date_selector(0, 0, 0, 1);
|
||||||
rsprintf("<option value=\"%d\">%s\n", i + 1, month_name(i));
|
|
||||||
rsprintf("</select>\n");
|
|
||||||
|
|
||||||
rsprintf("<select name=\"d1\">");
|
|
||||||
rsprintf("<option selected value=\"\">\n");
|
|
||||||
for (i = 0; i < 31; i++)
|
|
||||||
rsprintf("<option value=%d>%d\n", i + 1, i + 1);
|
|
||||||
rsprintf("</select>\n");
|
|
||||||
|
|
||||||
rsprintf(" %s: <input type=\"text\" size=5 maxlength=5 name=\"y1\">",
|
|
||||||
loc("Year"));
|
|
||||||
|
|
||||||
rsprintf("\n<script language=\"javascript\" type=\"text/javascript\">\n");
|
|
||||||
rsprintf("<!--\n");
|
|
||||||
rsprintf("function opencal(i)\n");
|
|
||||||
rsprintf("{\n");
|
|
||||||
rsprintf(" window.open(\"cal.html?i=\"+i, \"\",\n");
|
|
||||||
rsprintf
|
|
||||||
(" \"width=300,height=195,dependent=yes,menubar=no,scrollbars=no,location=no\");\n");
|
|
||||||
rsprintf("}\n\n");
|
|
||||||
|
|
||||||
rsprintf("if (navigator.javaEnabled()) {\n");
|
|
||||||
rsprintf(" document.write(\" \");\n");
|
|
||||||
rsprintf(" document.write(\"<a href=\\\"javascript:opencal(1)\\\">\");\n");
|
|
||||||
rsprintf
|
|
||||||
(" document.writeln(\"<img src=\\\"cal.gif\\\" border=\\\"0\\\" alt=\\\"%s\\\"></a>\");\n",
|
|
||||||
loc("Pick a date"));
|
|
||||||
rsprintf("} \n");
|
|
||||||
rsprintf("//-->\n");
|
|
||||||
rsprintf("</script>\n");
|
|
||||||
|
|
||||||
rsprintf(" / %s: ", loc("Show last"));
|
rsprintf(" / %s: ", loc("Show last"));
|
||||||
|
|
||||||
rsprintf("<select name=last>\n");
|
rsprintf("<select name=last>\n");
|
||||||
@ -7127,34 +7107,11 @@ void show_find_form(LOGBOOK * lbs)
|
|||||||
|
|
||||||
rsprintf("</td></tr>\n");
|
rsprintf("</td></tr>\n");
|
||||||
|
|
||||||
rsprintf("<tr><td>%s:</td>", loc("End date"));
|
rsprintf("<tr><td>%s:<td>", loc("End"));
|
||||||
rsprintf("<td><select name=\"m2\">\n");
|
|
||||||
|
|
||||||
rsprintf("<option value=\"\">\n");
|
show_date_selector(0, 0, 0, 2);
|
||||||
for (i = 0; i < 12; i++)
|
|
||||||
rsprintf("<option value=\"%d\">%s\n", i + 1, month_name(i));
|
|
||||||
rsprintf("</select>\n");
|
|
||||||
|
|
||||||
rsprintf("<select name=\"d2\">");
|
rsprintf("</td></tr></table></td></tr>\n");
|
||||||
rsprintf("<option selected value=\"\">\n");
|
|
||||||
for (i = 0; i < 31; i++)
|
|
||||||
rsprintf("<option value=%d>%d\n", i + 1, i + 1);
|
|
||||||
rsprintf("</select>\n");
|
|
||||||
|
|
||||||
rsprintf(" %s: <input type=\"text\" size=5 maxlength=5 name=\"y2\">",
|
|
||||||
loc("Year"));
|
|
||||||
|
|
||||||
rsprintf("\n<script language=\"javascript\" type=\"text/javascript\">\n");
|
|
||||||
rsprintf("if (navigator.javaEnabled()) {\n");
|
|
||||||
rsprintf(" document.write(\" \");\n");
|
|
||||||
rsprintf(" document.write(\"<a href=\\\"javascript:opencal(2)\\\">\");\n");
|
|
||||||
rsprintf
|
|
||||||
(" document.writeln(\"<img src=\\\"cal.gif\\\" border=\\\"0\\\" alt=\\\"%s\\\"></a>\");\n",
|
|
||||||
loc("Pick a date"));
|
|
||||||
rsprintf("} \n");
|
|
||||||
rsprintf("</script>\n");
|
|
||||||
|
|
||||||
rsprintf("</td></tr>\n");
|
|
||||||
|
|
||||||
for (i = 0; i < lbs->n_attr; i++) {
|
for (i = 0; i < lbs->n_attr; i++) {
|
||||||
rsprintf("<tr><td nowrap>%s:</td>", attr_list[i]);
|
rsprintf("<tr><td nowrap>%s:</td>", attr_list[i]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user