mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-12 19:33:03 +00:00
Added 'preset on duplicate'
SVN revision: 1713
This commit is contained in:
parent
2a3ebf2706
commit
469d259ed4
@ -1066,6 +1066,12 @@ XYZ-2005-Nov-002
|
|||||||
Same as <b><code>Preset <attribute></code></b>, but evaluated for
|
Same as <b><code>Preset <attribute></code></b>, but evaluated for
|
||||||
replies.
|
replies.
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<b><code>Preset on duplicate <attribute> =
|
||||||
|
<string></code></b><br>
|
||||||
|
Same as <b><code>Preset <attribute></code></b>, but evaluated for
|
||||||
|
duplicted entries.
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><code>Locked Attributes = <list></code></b><br>
|
<b><code>Locked Attributes = <list></code></b><br>
|
||||||
The attributes specified here cannot be modified when a new entry is
|
The attributes specified here cannot be modified when a new entry is
|
||||||
|
|||||||
44
src/elogd.c
44
src/elogd.c
@ -8607,6 +8607,28 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sprintf(str, "Preset on duplicate %s", attr_list[index]);
|
||||||
|
if ((i = getcfg(lbs->name, str, preset, sizeof(preset))) > 0 && bduplicate) {
|
||||||
|
|
||||||
|
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 | AF_DATETIME)) == 0);
|
||||||
|
strsubst_list(preset, sizeof(preset), slist, svalue, i);
|
||||||
|
|
||||||
|
/* check for index substitution */
|
||||||
|
if (!bedit && (strchr(preset, '%') || strchr(preset, '#'))) {
|
||||||
|
/* get index */
|
||||||
|
get_auto_index(lbs, index, preset, str, sizeof(str));
|
||||||
|
strcpy(preset, str);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!strchr(preset, '%'))
|
||||||
|
strcpy(attrib[index], preset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* check for p<attribute> */
|
/* check for p<attribute> */
|
||||||
sprintf(str, "p%s", attr_list[index]);
|
sprintf(str, "p%s", attr_list[index]);
|
||||||
if (isparam(str))
|
if (isparam(str))
|
||||||
@ -8670,6 +8692,28 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
strcpy(attrib[index], preset);
|
strcpy(attrib[index], preset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sprintf(str, "Preset on duplicate %s", attr_list[index]);
|
||||||
|
if ((i = getcfg(lbs->name, str, preset, sizeof(preset))) > 0 && bduplicate) {
|
||||||
|
|
||||||
|
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 | AF_DATETIME)) == 0);
|
||||||
|
strsubst_list(preset, sizeof(preset), slist, svalue, i);
|
||||||
|
|
||||||
|
/* check for index substitution */
|
||||||
|
if (!bedit && (strchr(preset, '%') || strchr(preset, '#'))) {
|
||||||
|
/* get index */
|
||||||
|
get_auto_index(lbs, index, preset, str, sizeof(str));
|
||||||
|
strcpy(preset, str);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!strchr(preset, '%'))
|
||||||
|
strcpy(attrib[index], preset);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else // if (_condition[0])
|
} else // if (_condition[0])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user