diff --git a/src/elogd.c b/src/elogd.c index a3736e25..15c1ff98 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -9489,7 +9489,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL if (getcfg(lbs->name, str, comment, sizeof(comment))) sprintf(title, " title=\"%s\"", comment); - rsprintf("", title); + rsprintf("", title, class_name); /* display attribute name */ rsprintf("%s%s:", attr_list[index], star); @@ -9522,7 +9522,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL } else strlcpy(str, attrib[index], sizeof(str)); - rsprintf("\n", title); + rsprintf("\n", class_value, title); rsputs2(lbs, FALSE, str); rsprintf(" "); @@ -9606,7 +9606,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL sec = pts->tm_sec; } - rsprintf("", title); + rsprintf("", title, class_value); sprintf(str, "%d", index); show_date_selector(day, month, year, str); rsprintf("  "); @@ -9616,7 +9616,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL } else if (attr_flags[index] & AF_USERLIST) { - rsprintf("\n", title); + rsprintf("\n", title, class_value); /* display drop-down box with list of users */ rsprintf("", title); + rsprintf("", title, class_value); strencode2(str, attrib[index], sizeof(str)); rsprintf @@ -9758,18 +9758,18 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL /* display checkbox */ if (atoi(attrib[index]) == 1) rsprintf - ("\n", - title, ua); + ("\n", + title, class_value, ua); else rsprintf - ("\n", - title, ua); + ("\n", + title, class_value, ua); } else { sprintf(str, "extend_%d", index); if (isparam(str)) { - rsprintf("\n", title); + rsprintf("\n", title, class_value); rsprintf(""); rsprintf(loc("Add new option here"), attr_list[index]); rsprintf(" : \n"); @@ -9789,7 +9789,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL } else if (attr_flags[index] & AF_MULTI) { /* display multiple check boxes */ - rsprintf("\n", title); + rsprintf("\n", title, class_value); n_moptions = strbreak(attrib[index], attr_moptions, MAX_N_LIST, "|", FALSE); for (i = 0; i < MAX_N_LIST && attr_options[index][i][0]; i++) { @@ -9834,7 +9834,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL } else if (attr_flags[index] & AF_RADIO) { /* display radio buttons */ - rsprintf("\n", title); + rsprintf("\n", title, class_value); for (i = 0; i < MAX_N_LIST && attr_options[index][i][0]; i++) { /* display check box with optional tooltip */ @@ -9879,7 +9879,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL } else if (attr_flags[index] & AF_ICON) { /* display icons */ - rsprintf("\n", title); + rsprintf("\n", title, class_value); rsprintf("\n"); for (i = 0; i < MAX_N_LIST && attr_options[index][i][0]; i++) { @@ -9912,7 +9912,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL } else { - rsprintf("\n", title); + rsprintf("\n", title, class_value); /* display drop-down box */ rsprintf("\n"); rsprintf("\n", user_email); - rsprintf("
Email:
%s:\n", loc("Subscribe to logbooks")); - - rsprintf("
(%s)\n", - loc("enable automatic email notifications")); - - rsprintf("
\n"); - - for (i = 0; lb_list[i].name[0]; i++) { + for (i = n = 0; lb_list[i].name[0]; i++) { if (!getcfg_topgroup() || strieq(getcfg_topgroup(), lb_list[i].top_group)) { @@ -12202,18 +12195,42 @@ void show_config_page(LOGBOOK * lbs) 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]) - rsprintf("\n", i, i); - else - rsprintf("\n", i, i); - rsprintf("
\n", i, lb_list[i].name); + if (!getcfg(lb_list[i].name, "Suppress email to users", str, sizeof(str)) || atoi(str) == 0) + n++; + } + } + } + + if (n > 0) { + + rsprintf("
%s:\n", loc("Subscribe to logbooks")); + + rsprintf("
(%s)\n", + loc("enable automatic email notifications")); + + rsprintf("
\n"); + + for (i = 0; lb_list[i].name[0]; i++) { + + if (!getcfg_topgroup() || strieq(getcfg_topgroup(), lb_list[i].top_group)) { + + /* check if user has access */ + 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]) + rsprintf("\n", i, i); + else + rsprintf("\n", i, i); + rsprintf("
\n", i, lb_list[i].name); + } } } } } - if (i > 2) { + if (n > 2) { rsprintf("