diff --git a/doc/config.html b/doc/config.html
index 20836f07..7f0efb5c 100755
--- a/doc/config.html
+++ b/doc/config.html
@@ -827,6 +827,12 @@ Alternatively, an absolute path can be used if the file name starts with a
(Windows).
+
Preset on reply <attribute> = <string>
+
+Same as Preset <attribute>, but evaluated for
+replies.
+
+
Locked Attributes = <list>
The attributes specified here cannot be modified when a new entry is submitted.
diff --git a/src/elogd.c b/src/elogd.c
index 04840e0d..6cba6bfc 100755
--- a/src/elogd.c
+++ b/src/elogd.c
@@ -6,6 +6,9 @@
Contents: Web server program for Electronic Logbook ELOG
$Log$
+ Revision 1.389 2004/07/15 19:15:47 midas
+ Implemented 'preset on reply'
+
Revision 1.388 2004/07/15 10:01:03 midas
First attribute cannot be on same line
@@ -6999,6 +7002,30 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
}
}
+ sprintf(str, "Preset on reply %s", attr_list[index]);
+ if ((i = getcfg(lbs->name, str, preset)) > 0 && breply) {
+
+ if (!breedit || (breedit && i == 2)) { /* subst on reedit only if preset is under condition */
+
+ /* do not format date for date attributes */
+ i = build_subst_list(lbs, slist, svalue, attrib,
+ (attr_flags[index] & AF_DATE) == 0);
+ strsubst(preset, slist, svalue, i);
+
+ /* check for index substitution */
+ if (!bedit && strchr(preset, '%')) {
+ /* get index */
+ i = get_last_index(lbs, index);
+
+ strcpy(str, preset);
+ sprintf(preset, str, i + 1);
+ }
+
+ if (!strchr(preset, '%'))
+ strcpy(attrib[index], preset);
+ }
+ }
+
/* display text box with optional tooltip */
sprintf(str, "Tooltip %s", attr_list[index]);
title[0] = 0;
@@ -7052,7 +7079,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
}
} else {
strencode2(str, attrib[index]);
- rsprintf("\n",
+ rsprintf("\n",
ua, str);
}
} else {