Show only subscribe options for logbooks which email notification turned on

SVN revision: 1775
This commit is contained in:
Stefan Ritt 2006-12-10 10:29:53 +00:00
parent db417346ed
commit 95186b9fa9

View File

@ -11929,6 +11929,9 @@ void show_config_page(LOGBOOK * lbs)
/* check if user has access */ /* check if user has access */
if (!isparam("unm") || check_login_user(&lb_list[i], getparam("unm"))) { if (!isparam("unm") || check_login_user(&lb_list[i], getparam("unm"))) {
/* check if emails are enabled for this logbook */
if (!getcfg(lb_list[i].name, "Suppress email to users", str, sizeof(str)) ||
atoi(str) == 0) {
if (email_notify[i]) if (email_notify[i])
rsprintf("<input type=checkbox checked id=\"lb%d\" name=\"sub_lb%d\" value=\"1\">\n", i, i); rsprintf("<input type=checkbox checked id=\"lb%d\" name=\"sub_lb%d\" value=\"1\">\n", i, i);
else else
@ -11937,6 +11940,7 @@ void show_config_page(LOGBOOK * lbs)
} }
} }
} }
}
if (i > 2) { if (i > 2) {
rsprintf("<script language=\"JavaScript\" type=\"text/javascript\">\n"); rsprintf("<script language=\"JavaScript\" type=\"text/javascript\">\n");
@ -16325,7 +16329,8 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands,
loc("Last"), loc("Week")); loc("Last"), loc("Week"));
rsprintf("<option %s value=-1>%s %s\n", i == -1 ? "selected" : "", loc("Last"), loc("Day")); rsprintf("<option %s value=-1>%s %s\n", i == -1 ? "selected" : "", loc("Last"), loc("Day"));
rsprintf("<option %s value=\"_all_\">%s\n", i == 0 ? "selected" : "", loc("All entries")); sprintf(str, "-- %s --", list[index]);
rsprintf("<option %s value=\"_all_\">%s\n", i == 0 ? "selected" : "", str);
rsprintf("<option %s value=1>%s %s\n", i == 1 ? "selected" : "", loc("Next"), loc("Day")); rsprintf("<option %s value=1>%s %s\n", i == 1 ? "selected" : "", loc("Next"), loc("Day"));
rsprintf("<option %s value=7>%s %s\n", i == 7 ? "selected" : "", loc("Next"), loc("Week")); rsprintf("<option %s value=7>%s %s\n", i == 7 ? "selected" : "", loc("Next"), loc("Week"));
@ -17939,11 +17944,8 @@ void show_elog_list(LOGBOOK * lbs, int past_n, int last_n, int page_n, BOOL defa
|| isparam("subtext"); || isparam("subtext");
for (i = 0; i < lbs->n_attr; i++) for (i = 0; i < lbs->n_attr; i++)
if (isparam(attr_list[i]) && (attr_flags[i] & (AF_DATE | AF_DATETIME)) == 0) { if (isparam(attr_list[i]) && (attr_flags[i] & (AF_DATE | AF_DATETIME)) == 0)
strlcpy(str, getparam(attr_list[i]), sizeof(str));
if (str[0] && !strieq(str, "_all_") && strncmp(str, "--", 2) != 0)
disp_filter = TRUE; disp_filter = TRUE;
}
for (i = 0; i < lbs->n_attr; i++) { for (i = 0; i < lbs->n_attr; i++) {
if (attr_flags[i] & (AF_DATE | AF_DATETIME)) { if (attr_flags[i] & (AF_DATE | AF_DATETIME)) {