Implemented 'List after submit'

SVN revision: 2327
This commit is contained in:
2010-09-16 22:57:41 +00:00
parent 7e16a552ef
commit e5fa0cd237
3 changed files with 23 additions and 5 deletions
+1 -1
View File
@@ -21,9 +21,9 @@ Global
{8D6EBED8-48F3-4719-907E-7BE46A3C0FA4}.Debug|Win32.ActiveCfg = Debug|Win32
{8D6EBED8-48F3-4719-907E-7BE46A3C0FA4}.Release|Win32.ActiveCfg = Release|Win32
{FD6FCAF3-A94B-40FA-AE52-07705DE2E519}.Debug|Win32.ActiveCfg = Debug|Win32
{FD6FCAF3-A94B-40FA-AE52-07705DE2E519}.Debug|Win32.Build.0 = Debug|Win32
{FD6FCAF3-A94B-40FA-AE52-07705DE2E519}.Release|Win32.ActiveCfg = Release|Win32
{CB6EB7FE-CC3D-4548-B8B8-8DDA05916759}.Debug|Win32.ActiveCfg = Debug|Win32
{CB6EB7FE-CC3D-4548-B8B8-8DDA05916759}.Debug|Win32.Build.0 = Debug|Win32
{CB6EB7FE-CC3D-4548-B8B8-8DDA05916759}.Release|Win32.ActiveCfg = Release|Win32
{CB6EB7FE-CC3D-4548-B8B8-8DDA05916759}.Release|Win32.Build.0 = Release|Win32
{77ED3530-9382-4830-8513-9729C051A93E}.Debug|Win32.ActiveCfg = Debug|Win32
+6
View File
@@ -2473,6 +2473,12 @@ Options Location = Main Building{a}, New Building{b}, Old Building{c}
to the logbook selection page instead to the login page. The default is
<b>0</b>.
</li>
<li>
<b><code>List after submit = 0|1</code></b><br>
If this flag is <b>1</b>, the list page is shown after the
submission of a new entry. If this flag is <b>0</b>, the entry just
submitted is shown. The default is <b>0</b>.
</li>
<li>
<b><code>Restrict edit = 0|1</code></b><br>
If this flag is <b>1</b>, users can only edit their own messages. The
+16 -4
View File
@@ -22666,7 +22666,10 @@ void submit_elog(LOGBOOK * lbs)
return;
}
sprintf(str, "%d%s", message_id, mail_param);
if (getcfg(lbs->name, "List after submit", str, sizeof(str)) && atoi(str) == 1)
sprintf(str, "");
else
sprintf(str, "%d%s", message_id, mail_param);
redirect(lbs, str);
}
@@ -23568,9 +23571,12 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command)
strlcpy(str, loc(menu_item[i]), sizeof(str));
url_encode(str, sizeof(str));
if (strieq(menu_item[i], "list"))
rsprintf("&nbsp;<a href=\".?id=%d\">%s</a>&nbsp;\n", message_id, loc(menu_item[i]));
else
if (strieq(menu_item[i], "list")) {
if (getcfg(lbs->name, "Back to main", str, sizeof(str)) && atoi(str) == 1)
rsprintf("&nbsp;<a href=\"../\">%s</a>&nbsp;\n", loc(menu_item[i]));
else
rsprintf("&nbsp;<a href=\".?id=%d\">%s</a>&nbsp;\n", message_id, loc(menu_item[i]));
} else
rsprintf("&nbsp;<a href=\"%d?cmd=%s\">%s</a>&nbsp;\n", message_id, str, loc(menu_item[i]));
if (i < n - 1)
@@ -26216,6 +26222,12 @@ void interprete(char *lbook, char *path)
/* check for "List" button */
if (strieq(command, loc("List"))) {
if (getcfg(lbs->name, "Back to main", str, sizeof(str)) && atoi(str) == 1) {
redirect(lbs, "../");
return;
}
show_elog_list(lbs, 0, 0, 0, TRUE, NULL);
return;
}