mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Implemented "Preset on edit"
SVN revision: 2453
This commit is contained in:
parent
2cdb573a5f
commit
ab9e18a47a
20
src/elogd.c
20
src/elogd.c
@ -9343,6 +9343,26 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sprintf(str, "Preset on edit %s", attr_list[index]);
|
||||||
|
if ((i = getcfg(lbs->name, str, preset, sizeof(preset))) > 0 && bedit) {
|
||||||
|
|
||||||
|
if (!breedit || (breedit && i == 2)) { /* subst on reedit only if preset is under condition */
|
||||||
|
|
||||||
|
/* check for index substitution */
|
||||||
|
if (!bedit && (strchr(preset, '%') || strchr(preset, '#'))) {
|
||||||
|
/* get index */
|
||||||
|
get_auto_index(lbs, index, preset, str, sizeof(str));
|
||||||
|
strcpy(preset, str);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* do not format date for date attributes */
|
||||||
|
i = build_subst_list(lbs, slist, svalue, attrib, (attr_flags[index] & (AF_DATE | AF_DATETIME))
|
||||||
|
== 0);
|
||||||
|
strsubst_list(preset, sizeof(preset), slist, svalue, i);
|
||||||
|
strcpy(attrib[index], preset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sprintf(str, "Preset on duplicate %s", attr_list[index]);
|
sprintf(str, "Preset on duplicate %s", attr_list[index]);
|
||||||
if ((i = getcfg(lbs->name, str, preset, sizeof(preset))) > 0 && bduplicate) {
|
if ((i = getcfg(lbs->name, str, preset, sizeof(preset))) > 0 && bduplicate) {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user