mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Implemented 'Custom xxx form'
SVN revision: 2326
This commit is contained in:
parent
40a00e5adf
commit
7e16a552ef
30
src/elogd.c
30
src/elogd.c
@ -9194,8 +9194,21 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
date[0] = 0;
|
date[0] = 0;
|
||||||
locked_by[0] = 0;
|
locked_by[0] = 0;
|
||||||
|
|
||||||
/* check for custom form */
|
/* check for custom form for new entries */
|
||||||
if (getcfg(lbs->name, "Custom form", str, sizeof(str))) {
|
if (!bedit && getcfg(lbs->name, "Custom new form", str, sizeof(str))) {
|
||||||
|
/* check if file starts with an absolute directory */
|
||||||
|
if (str[0] == DIR_SEPARATOR || str[1] == ':')
|
||||||
|
strcpy(file_name, str);
|
||||||
|
else {
|
||||||
|
strlcpy(file_name, logbook_dir, sizeof(file_name));
|
||||||
|
strlcat(file_name, str, sizeof(file_name));
|
||||||
|
}
|
||||||
|
send_file_direct(str);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* check for custom form for editing an entry */
|
||||||
|
if (bedit && getcfg(lbs->name, "Custom edit form", str, sizeof(str))) {
|
||||||
/* check if file starts with an absolute directory */
|
/* check if file starts with an absolute directory */
|
||||||
if (str[0] == DIR_SEPARATOR || str[1] == ':')
|
if (str[0] == DIR_SEPARATOR || str[1] == ':')
|
||||||
strcpy(file_name, str);
|
strcpy(file_name, str);
|
||||||
@ -23263,6 +23276,19 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command)
|
|||||||
_current_message_id = message_id;
|
_current_message_id = message_id;
|
||||||
email = strieq(command, "email") || strieq(command, "oldemail");
|
email = strieq(command, "email") || strieq(command, "oldemail");
|
||||||
|
|
||||||
|
/* check for custom form to display entry */
|
||||||
|
if (getcfg(lbs->name, "Custom display form", str, sizeof(str))) {
|
||||||
|
/* check if file starts with an absolute directory */
|
||||||
|
if (str[0] == DIR_SEPARATOR || str[1] == ':')
|
||||||
|
strcpy(file_name, str);
|
||||||
|
else {
|
||||||
|
strlcpy(file_name, logbook_dir, sizeof(file_name));
|
||||||
|
strlcat(file_name, str, sizeof(file_name));
|
||||||
|
}
|
||||||
|
send_file_direct(str);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* check for guest access */
|
/* check for guest access */
|
||||||
if (!getcfg(lbs->name, "Guest Menu commands", menu_str, sizeof(menu_str)) || isparam("unm") != 0)
|
if (!getcfg(lbs->name, "Guest Menu commands", menu_str, sizeof(menu_str)) || isparam("unm") != 0)
|
||||||
getcfg(lbs->name, "Menu commands", menu_str, sizeof(menu_str));
|
getcfg(lbs->name, "Menu commands", menu_str, sizeof(menu_str));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user