mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-29 04:04:29 +00:00
Fixed wrong date on date attributes on edit/reply if attribute is fixed
SVN revision: 993
This commit is contained in:
parent
0456bcfce4
commit
f4e074fa4d
25
src/elogd.c
25
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.412 2004/07/28 19:20:46 midas
|
||||||
|
Fixed wrong date on date attributes on edit/reply if attribute is fixed
|
||||||
|
|
||||||
Revision 1.411 2004/07/28 18:51:48 midas
|
Revision 1.411 2004/07/28 18:51:48 midas
|
||||||
Close syslog on cleanup
|
Close syslog on cleanup
|
||||||
|
|
||||||
@ -7431,8 +7434,23 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
(bedit && (attr_flags[index] & AF_FIXED_EDIT)) || (message_id && !bedit
|
(bedit && (attr_flags[index] & AF_FIXED_EDIT)) || (message_id && !bedit
|
||||||
&& (attr_flags[index] &
|
&& (attr_flags[index] &
|
||||||
AF_FIXED_REPLY))) {
|
AF_FIXED_REPLY))) {
|
||||||
|
if (attr_flags[index] & AF_DATE) {
|
||||||
|
|
||||||
|
if (!getcfg(lbs->name, "Date format", format, sizeof(format)))
|
||||||
|
strcpy(format, DEFAULT_DATE_FORMAT);
|
||||||
|
|
||||||
|
ltime = atoi(attrib[index]);
|
||||||
|
pts = localtime(<ime);
|
||||||
|
if (ltime == 0)
|
||||||
|
strcpy(str, "-");
|
||||||
|
else
|
||||||
|
strftime(str, sizeof(str), format, pts);
|
||||||
|
|
||||||
|
} else
|
||||||
|
strlcpy(str, attrib[index], sizeof(str));
|
||||||
|
|
||||||
rsprintf("<td%s class=\"attribvalue\">\n", title);
|
rsprintf("<td%s class=\"attribvalue\">\n", title);
|
||||||
rsputs2(attrib[index]);
|
rsputs2(str);
|
||||||
rsprintf(" ");
|
rsprintf(" ");
|
||||||
|
|
||||||
if (attr_flags[index] & AF_MULTI) {
|
if (attr_flags[index] & AF_MULTI) {
|
||||||
@ -15577,6 +15595,10 @@ void submit_elog(LOGBOOK * lbs)
|
|||||||
}
|
}
|
||||||
} else if (attr_flags[i] & AF_DATE) {
|
} else if (attr_flags[i] & AF_DATE) {
|
||||||
|
|
||||||
|
if (isparam(ua)) // from edit/reply of fixed attributes
|
||||||
|
strlcpy(attrib[i], getparam(ua), NAME_LENGTH);
|
||||||
|
else {
|
||||||
|
|
||||||
sprintf(str, "y%d", i);
|
sprintf(str, "y%d", i);
|
||||||
year = atoi(getparam(str));
|
year = atoi(getparam(str));
|
||||||
if (year < 100)
|
if (year < 100)
|
||||||
@ -15600,6 +15622,7 @@ void submit_elog(LOGBOOK * lbs)
|
|||||||
ltime = mktime(&tms);
|
ltime = mktime(&tms);
|
||||||
sprintf(attrib[i], "%d", ltime);
|
sprintf(attrib[i], "%d", ltime);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
strlcpy(attrib[i], getparam(ua), NAME_LENGTH);
|
strlcpy(attrib[i], getparam(ua), NAME_LENGTH);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user