mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Implemented 'preset on reply'
SVN revision: 965
This commit is contained in:
parent
c3ac366674
commit
bebac1f1ab
@ -827,6 +827,12 @@ Alternatively, an absolute path can be used if the file name starts with a
|
|||||||
(Windows).
|
(Windows).
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
|
<LI><b><code>Preset on reply <attribute> = <string></code></b>
|
||||||
|
<br>
|
||||||
|
Same as <b><code>Preset <attribute></code></b>, but evaluated for
|
||||||
|
replies.
|
||||||
|
<p>
|
||||||
|
|
||||||
<LI><b><code>Locked Attributes = <list></code></b>
|
<LI><b><code>Locked Attributes = <list></code></b>
|
||||||
<br>
|
<br>
|
||||||
The attributes specified here cannot be modified when a new entry is submitted.
|
The attributes specified here cannot be modified when a new entry is submitted.
|
||||||
|
|||||||
29
src/elogd.c
29
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.389 2004/07/15 19:15:47 midas
|
||||||
|
Implemented 'preset on reply'
|
||||||
|
|
||||||
Revision 1.388 2004/07/15 10:01:03 midas
|
Revision 1.388 2004/07/15 10:01:03 midas
|
||||||
First attribute cannot be on same line
|
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 */
|
/* display text box with optional tooltip */
|
||||||
sprintf(str, "Tooltip %s", attr_list[index]);
|
sprintf(str, "Tooltip %s", attr_list[index]);
|
||||||
title[0] = 0;
|
title[0] = 0;
|
||||||
@ -7052,7 +7079,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
strencode2(str, attrib[index]);
|
strencode2(str, attrib[index]);
|
||||||
rsprintf("<input type=\"hidden\" name=\"%s\" value=\"%s\"></td></tr>\n",
|
rsprintf("<input type=\"hidden\" name=\"%s\" value=\"%s\"></td>\n",
|
||||||
ua, str);
|
ua, str);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user