mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-14 20:33:48 +00:00
Implemented option 'guest display'
SVN revision: 828
This commit is contained in:
parent
19105cc101
commit
062c2ab87d
@ -578,6 +578,14 @@ next <i>Routine</i> entry and all <i>Routine</i> entries:<br>
|
|||||||
</small>
|
</small>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
<li><b><code>Guest Display = <list></code></b>
|
||||||
|
</br>
|
||||||
|
This option specifies which attributes are displayed on guest access. It is possible
|
||||||
|
to display only a subset of all attributes for guest access, but the full list
|
||||||
|
if someone is logged in (using the option "Password file"). The <code><b>list</b></code>
|
||||||
|
consists of comma separated attributes, including the word <i>text</i>, if one
|
||||||
|
wants to display the entry body text for guests.<p>
|
||||||
|
|
||||||
<li><b><code>Find Menu text = <file></code></b>
|
<li><b><code>Find Menu text = <file></code></b>
|
||||||
</br>
|
</br>
|
||||||
The same for the find result page. One example would be following text to
|
The same for the find result page. One example would be following text to
|
||||||
|
|||||||
@ -44,7 +44,6 @@ starting at the items with the most votes. You can vote for a feature, or sugges
|
|||||||
<tr><td>Add/Remove logbooks though the web interface<td>1</tr>
|
<tr><td>Add/Remove logbooks though the web interface<td>1</tr>
|
||||||
<tr><td>Specify date format explicitly for substitutions, like $entry date{%Y}<td>1</tr>
|
<tr><td>Specify date format explicitly for substitutions, like $entry date{%Y}<td>1</tr>
|
||||||
<tr><td>Implement attribute substituions including message id (or change message id display fromat)<td>1</tr>
|
<tr><td>Implement attribute substituions including message id (or change message id display fromat)<td>1</tr>
|
||||||
<tr><td>Only display a subset of attributes if not logged in (guest mode)<td>2</tr>
|
|
||||||
<tr><td>Only display a subset of attributes in edit, entry and list mode<td>1</tr>
|
<tr><td>Only display a subset of attributes in edit, entry and list mode<td>1</tr>
|
||||||
|
|
||||||
</table></center><p>
|
</table></center><p>
|
||||||
|
|||||||
@ -6,6 +6,9 @@
|
|||||||
Contents: Electronic logbook utility
|
Contents: Electronic logbook utility
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.17 2004/03/14 16:43:29 midas
|
||||||
|
Implemented option 'guest display'
|
||||||
|
|
||||||
Revision 1.16 2004/02/19 08:18:31 midas
|
Revision 1.16 2004/02/19 08:18:31 midas
|
||||||
Changed '-p' for email suppress to '-x'
|
Changed '-p' for email suppress to '-x'
|
||||||
|
|
||||||
|
|||||||
189
src/elogd.c
189
src/elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.294 2004/03/14 16:43:29 midas
|
||||||
|
Implemented option 'guest display'
|
||||||
|
|
||||||
Revision 1.293 2004/03/13 21:07:58 midas
|
Revision 1.293 2004/03/13 21:07:58 midas
|
||||||
Implemented and between conditions
|
Implemented and between conditions
|
||||||
|
|
||||||
@ -6841,10 +6844,12 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
sprintf(str, "%s_%d", ua, i);
|
sprintf(str, "%s_%d", ua, i);
|
||||||
|
|
||||||
if (strstr(attrib[index], attr_options[index][i]))
|
if (strstr(attrib[index], attr_options[index][i]))
|
||||||
rsprintf("<nobr><input type=checkbox id=\"%s\" name=\"%s\" value=\"%s\" checked>\n",
|
rsprintf
|
||||||
|
("<nobr><input type=checkbox id=\"%s\" name=\"%s\" value=\"%s\" checked>\n",
|
||||||
str, str, attr_options[index][i]);
|
str, str, attr_options[index][i]);
|
||||||
else
|
else
|
||||||
rsprintf("<nobr><input type=checkbox id=\"%s\" name=\"%s\" value=\"%s\">\n",
|
rsprintf
|
||||||
|
("<nobr><input type=checkbox id=\"%s\" name=\"%s\" value=\"%s\">\n",
|
||||||
str, str, attr_options[index][i]);
|
str, str, attr_options[index][i]);
|
||||||
|
|
||||||
rsprintf("<label for=\"%s\">%s</label></nobr>\n",
|
rsprintf("<label for=\"%s\">%s</label></nobr>\n",
|
||||||
@ -6861,10 +6866,12 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
|
|
||||||
for (i = 0; i < MAX_N_LIST && attr_options[index][i][0]; i++) {
|
for (i = 0; i < MAX_N_LIST && attr_options[index][i][0]; i++) {
|
||||||
if (strstr(attrib[index], attr_options[index][i]))
|
if (strstr(attrib[index], attr_options[index][i]))
|
||||||
rsprintf("<nobr><input type=radio id=\"%s\" name=\"%s\" value=\"%s\" checked>\n",
|
rsprintf
|
||||||
|
("<nobr><input type=radio id=\"%s\" name=\"%s\" value=\"%s\" checked>\n",
|
||||||
attr_options[index][i], ua, attr_options[index][i]);
|
attr_options[index][i], ua, attr_options[index][i]);
|
||||||
else
|
else
|
||||||
rsprintf("<nobr><input type=radio id=\"%s\" name=\"%s\" value=\"%s\">\n",
|
rsprintf
|
||||||
|
("<nobr><input type=radio id=\"%s\" name=\"%s\" value=\"%s\">\n",
|
||||||
attr_options[index][i], ua, attr_options[index][i]);
|
attr_options[index][i], ua, attr_options[index][i]);
|
||||||
|
|
||||||
rsprintf("<label for=\"%s\">%s</label></nobr>\n",
|
rsprintf("<label for=\"%s\">%s</label></nobr>\n",
|
||||||
@ -7189,8 +7196,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Suppress email check box */
|
/* Suppress email check box */
|
||||||
if (!(bedit && !breedit && !bupload
|
if (!(bedit && !breedit && !bupload && getcfg(lbs->name, "Suppress Email on edit", str)
|
||||||
&& getcfg(lbs->name, "Suppress Email on edit", str)
|
|
||||||
&& atoi(str) == 1)) {
|
&& atoi(str) == 1)) {
|
||||||
if (getcfg(lbs->name, "Suppress default", str)) {
|
if (getcfg(lbs->name, "Suppress default", str)) {
|
||||||
if (atoi(str) == 0) {
|
if (atoi(str) == 0) {
|
||||||
@ -7371,10 +7377,12 @@ void show_find_form(LOGBOOK * lbs)
|
|||||||
rsprintf("<input type=radio id=\"full\" name=\"mode\" value=\"full\" checked>");
|
rsprintf("<input type=radio id=\"full\" name=\"mode\" value=\"full\" checked>");
|
||||||
else
|
else
|
||||||
rsprintf("<input type=radio id=\"full\" name=\"mode\" value=\"full\">");
|
rsprintf("<input type=radio id=\"full\" name=\"mode\" value=\"full\">");
|
||||||
rsprintf("<label for=\"full\">%s </label>\n", loc("Display full entries"));
|
rsprintf("<label for=\"full\">%s </label>\n",
|
||||||
|
loc("Display full entries"));
|
||||||
|
|
||||||
if (strieq(mode, "Summary"))
|
if (strieq(mode, "Summary"))
|
||||||
rsprintf("<input type=radio id=\"summary\" name=\"mode\" value=\"summary\" checked>");
|
rsprintf
|
||||||
|
("<input type=radio id=\"summary\" name=\"mode\" value=\"summary\" checked>");
|
||||||
else
|
else
|
||||||
rsprintf("<input type=radio id=\"summary\" name=\"mode\" value=\"summary\">");
|
rsprintf("<input type=radio id=\"summary\" name=\"mode\" value=\"summary\">");
|
||||||
rsprintf("<label for=\"summary\">%s </label>\n", loc("Summary only"));
|
rsprintf("<label for=\"summary\">%s </label>\n", loc("Summary only"));
|
||||||
@ -7382,14 +7390,16 @@ void show_find_form(LOGBOOK * lbs)
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (strieq(mode, "Full") || strieq(mode, "Summary"))
|
if (strieq(mode, "Full") || strieq(mode, "Summary"))
|
||||||
rsprintf("<input type=radio id=\"summary\" name=\"mode\" value=\"summary\" checked>");
|
rsprintf
|
||||||
|
("<input type=radio id=\"summary\" name=\"mode\" value=\"summary\" checked>");
|
||||||
else
|
else
|
||||||
rsprintf("<input type=radio id=\"summary\" name=\"mode\" value=\"summary\">");
|
rsprintf("<input type=radio id=\"summary\" name=\"mode\" value=\"summary\">");
|
||||||
rsprintf("<label for=\"summary\">%s </label>\n", loc("Summary"));
|
rsprintf("<label for=\"summary\">%s </label>\n", loc("Summary"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strieq(mode, "Threaded"))
|
if (strieq(mode, "Threaded"))
|
||||||
rsprintf("<input type=radio id=\"threaded\" name=\"mode\" value=\"threaded\" checked>");
|
rsprintf
|
||||||
|
("<input type=radio id=\"threaded\" name=\"mode\" value=\"threaded\" checked>");
|
||||||
else
|
else
|
||||||
rsprintf("<input type=radio id=\"threaded\" name=\"mode\" value=\"threaded\">");
|
rsprintf("<input type=radio id=\"threaded\" name=\"mode\" value=\"threaded\">");
|
||||||
rsprintf("<label for=\"threaded\">%s </label>\n", loc("Display threads"));
|
rsprintf("<label for=\"threaded\">%s </label>\n", loc("Display threads"));
|
||||||
@ -7399,7 +7409,8 @@ void show_find_form(LOGBOOK * lbs)
|
|||||||
else
|
else
|
||||||
rsprintf("<input type=radio id=\"CSV\" name=\"mode\" value=\"CSV\">");
|
rsprintf("<input type=radio id=\"CSV\" name=\"mode\" value=\"CSV\">");
|
||||||
|
|
||||||
rsprintf("<label for=\"CSV\">%s </label>\n", loc("Display comma-separated values (CSV)"));
|
rsprintf("<label for=\"CSV\">%s </label>\n",
|
||||||
|
loc("Display comma-separated values (CSV)"));
|
||||||
|
|
||||||
rsprintf("</td></tr>\n");
|
rsprintf("</td></tr>\n");
|
||||||
|
|
||||||
@ -8843,17 +8854,20 @@ void show_import_page(LOGBOOK * lbs)
|
|||||||
|
|
||||||
/*---- entry form ----*/
|
/*---- entry form ----*/
|
||||||
|
|
||||||
rsprintf("<tr><td class=\"attribname\" nowrap width=\"10%%\">%s:</td>\n", loc("CSV filename"));
|
rsprintf("<tr><td class=\"attribname\" nowrap width=\"10%%\">%s:</td>\n",
|
||||||
|
loc("CSV filename"));
|
||||||
rsprintf("<td class=\"attribvalue\">");
|
rsprintf("<td class=\"attribvalue\">");
|
||||||
rsprintf("<input type=\"file\" size=\"60\" maxlength=\"200\" name=\"csvfile\" ");
|
rsprintf("<input type=\"file\" size=\"60\" maxlength=\"200\" name=\"csvfile\" ");
|
||||||
rsprintf("accept=\"filetype/*\"></td></tr>\n");
|
rsprintf("accept=\"filetype/*\"></td></tr>\n");
|
||||||
|
|
||||||
rsprintf("<tr><td class=\"attribname\" nowrap width=\"10%%\">%s:</td>\n", loc("Field separator"));
|
rsprintf("<tr><td class=\"attribname\" nowrap width=\"10%%\">%s:</td>\n",
|
||||||
|
loc("Field separator"));
|
||||||
rsprintf("<td class=\"attribvalue\">");
|
rsprintf("<td class=\"attribvalue\">");
|
||||||
rsprintf("<input type=\"text\" size=\"1\" maxlength=\"1\" name=\"sep\" value=\",\">");
|
rsprintf("<input type=\"text\" size=\"1\" maxlength=\"1\" name=\"sep\" value=\",\">");
|
||||||
rsprintf("</td></tr>\n");
|
rsprintf("</td></tr>\n");
|
||||||
|
|
||||||
rsprintf("<tr><td class=\"attribname\" nowrap width=\"10%%\">%s:</td>\n", loc("Options"));
|
rsprintf("<tr><td class=\"attribname\" nowrap width=\"10%%\">%s:</td>\n",
|
||||||
|
loc("Options"));
|
||||||
rsprintf("<td class=\"attribvalue\">");
|
rsprintf("<td class=\"attribvalue\">");
|
||||||
rsprintf("<input type=checkbox id=\"head\" name=\"head\" value=\"1\">\n");
|
rsprintf("<input type=checkbox id=\"head\" name=\"head\" value=\"1\">\n");
|
||||||
rsprintf("<label for=\"head\">%s</label>\n", loc("Derive attributes from CSV file"));
|
rsprintf("<label for=\"head\">%s</label>\n", loc("Derive attributes from CSV file"));
|
||||||
@ -10253,7 +10267,8 @@ void synchronize_logbook(LOGBOOK * lbs, BOOL bcron)
|
|||||||
if (_logging_level > 1)
|
if (_logging_level > 1)
|
||||||
logf(lbs, "MIRROR delete remote entry #%d", message_id);
|
logf(lbs, "MIRROR delete remote entry #%d", message_id);
|
||||||
|
|
||||||
sprintf(str, "%d?cmd=%s&confirm=%s", message_id, loc("Delete"), loc("Yes"));
|
sprintf(str, "%d?cmd=%s&confirm=%s", message_id, loc("Delete"),
|
||||||
|
loc("Yes"));
|
||||||
combine_url(lbs, list[index], str, url, sizeof(url));
|
combine_url(lbs, list[index], str, url, sizeof(url));
|
||||||
|
|
||||||
all_identical = FALSE;
|
all_identical = FALSE;
|
||||||
@ -10276,7 +10291,8 @@ void synchronize_logbook(LOGBOOK * lbs, BOOL bcron)
|
|||||||
|
|
||||||
free(buffer);
|
free(buffer);
|
||||||
} else
|
} else
|
||||||
rsprintf("ID%d:\t%s\n", message_id, loc("Entry deleted remotely"));
|
rsprintf("ID%d:\t%s\n", message_id,
|
||||||
|
loc("Entry deleted remotely"));
|
||||||
|
|
||||||
md5_cache[i_cache].message_id = -1;
|
md5_cache[i_cache].message_id = -1;
|
||||||
}
|
}
|
||||||
@ -10382,7 +10398,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
|
|||||||
char *reply_to, int n_attr_disp,
|
char *reply_to, int n_attr_disp,
|
||||||
char disp_attr[MAX_N_ATTR + 4][NAME_LENGTH],
|
char disp_attr[MAX_N_ATTR + 4][NAME_LENGTH],
|
||||||
char attrib[MAX_N_ATTR][NAME_LENGTH], int n_attr,
|
char attrib[MAX_N_ATTR][NAME_LENGTH], int n_attr,
|
||||||
char *text,
|
char *text, BOOL show_text,
|
||||||
char attachment[MAX_ATTACHMENTS][MAX_PATH_LENGTH], char *encoding,
|
char attachment[MAX_ATTACHMENTS][MAX_PATH_LENGTH], char *encoding,
|
||||||
BOOL select, int *n_display, char *locked_by)
|
BOOL select, int *n_display, char *locked_by)
|
||||||
{
|
{
|
||||||
@ -10479,8 +10495,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
|
|||||||
add_subst_time(lbs, (char (*)[NAME_LENGTH]) slist, (char (*)[NAME_LENGTH]) svalue,
|
add_subst_time(lbs, (char (*)[NAME_LENGTH]) slist, (char (*)[NAME_LENGTH]) svalue,
|
||||||
"entry time", date, &j);
|
"entry time", date, &j);
|
||||||
|
|
||||||
strsubst(display, (char (*)[NAME_LENGTH])slist,
|
strsubst(display, (char (*)[NAME_LENGTH]) slist, (char (*)[NAME_LENGTH]) svalue, j);
|
||||||
(char (*)[NAME_LENGTH])svalue, j);
|
|
||||||
|
|
||||||
rsprintf("<a href=\"%s\">", ref);
|
rsprintf("<a href=\"%s\">", ref);
|
||||||
|
|
||||||
@ -10529,10 +10544,10 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
|
|||||||
j = build_subst_list(lbs, (char (*)[NAME_LENGTH]) slist,
|
j = build_subst_list(lbs, (char (*)[NAME_LENGTH]) slist,
|
||||||
(char (*)[NAME_LENGTH]) svalue, attrib, TRUE);
|
(char (*)[NAME_LENGTH]) svalue, attrib, TRUE);
|
||||||
sprintf(str, "%d", message_id);
|
sprintf(str, "%d", message_id);
|
||||||
add_subst_list((char (*)[NAME_LENGTH])slist, (char (*)[NAME_LENGTH])svalue,
|
add_subst_list((char (*)[NAME_LENGTH]) slist,
|
||||||
"message id", str, &j);
|
(char (*)[NAME_LENGTH]) svalue, "message id", str, &j);
|
||||||
add_subst_time(lbs, (char (*)[NAME_LENGTH])slist, (char (*)[NAME_LENGTH])svalue,
|
add_subst_time(lbs, (char (*)[NAME_LENGTH]) slist,
|
||||||
"entry time", date, &j);
|
(char (*)[NAME_LENGTH]) svalue, "entry time", date, &j);
|
||||||
|
|
||||||
strsubst(display, (char (*)[NAME_LENGTH]) slist,
|
strsubst(display, (char (*)[NAME_LENGTH]) slist,
|
||||||
(char (*)[NAME_LENGTH]) svalue, j);
|
(char (*)[NAME_LENGTH]) svalue, j);
|
||||||
@ -10559,15 +10574,19 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
|
|||||||
|
|
||||||
if (strieq(disp_attr[index], loc("Edit"))) {
|
if (strieq(disp_attr[index], loc("Edit"))) {
|
||||||
if (!strieq(mode, "Threaded")) {
|
if (!strieq(mode, "Threaded")) {
|
||||||
rsprintf("<td class=\"%s\" %s><a href=\"%s?cmd=%s\">", sclass, nowrap, ref, loc("Edit"));
|
rsprintf("<td class=\"%s\" %s><a href=\"%s?cmd=%s\">", sclass, nowrap, ref,
|
||||||
rsprintf("<img src=\"edit.gif\" border=0 alt=\"%s\"></a></td>\n", loc("Edit entry"));
|
loc("Edit"));
|
||||||
|
rsprintf("<img src=\"edit.gif\" border=0 alt=\"%s\"></a></td>\n",
|
||||||
|
loc("Edit entry"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strieq(disp_attr[index], loc("Delete"))) {
|
if (strieq(disp_attr[index], loc("Delete"))) {
|
||||||
if (!strieq(mode, "Threaded")) {
|
if (!strieq(mode, "Threaded")) {
|
||||||
rsprintf("<td class=\"%s\" %s><a href=\"%s?cmd=%s\">", sclass, nowrap, ref, loc("Delete"));
|
rsprintf("<td class=\"%s\" %s><a href=\"%s?cmd=%s\">", sclass, nowrap, ref,
|
||||||
rsprintf("<img src=\"delete.gif\" border=0 alt=\"%s\"></a></td>\n", loc("Delete entry"));
|
loc("Delete"));
|
||||||
|
rsprintf("<img src=\"delete.gif\" border=0 alt=\"%s\"></a></td>\n",
|
||||||
|
loc("Delete entry"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10688,7 +10707,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
|
|||||||
rsprintf("</a>\n");
|
rsprintf("</a>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strieq(mode, "Threaded") && expand > 1) {
|
if (strieq(mode, "Threaded") && expand > 1 && show_text) {
|
||||||
rsprintf("</td></tr>\n");
|
rsprintf("</td></tr>\n");
|
||||||
|
|
||||||
rsprintf("<tr><td class=\"summary\">");
|
rsprintf("<tr><td class=\"summary\">");
|
||||||
@ -10722,7 +10741,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((strieq(mode, "Summary") && n_line > 0)) {
|
if (strieq(mode, "Summary") && n_line > 0 && show_text) {
|
||||||
rsprintf("<td class=\"summary\">");
|
rsprintf("<td class=\"summary\">");
|
||||||
for (i = i_line = 0; i < (int) sizeof(str) - 1; i++) {
|
for (i = i_line = 0; i < (int) sizeof(str) - 1; i++) {
|
||||||
str[i] = text[i];
|
str[i] = text[i];
|
||||||
@ -10749,7 +10768,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
|
|||||||
if (select)
|
if (select)
|
||||||
colspan++;
|
colspan++;
|
||||||
|
|
||||||
if (strieq(mode, "Full")) {
|
if (strieq(mode, "Full") && show_text) {
|
||||||
if (!getcfg(lbs->name, "Show text", str) || atoi(str) == 1) {
|
if (!getcfg(lbs->name, "Show text", str) || atoi(str) == 1) {
|
||||||
rsprintf("<tr><td class=\"messagelist\" colspan=%d>", colspan);
|
rsprintf("<tr><td class=\"messagelist\" colspan=%d>", colspan);
|
||||||
|
|
||||||
@ -10843,7 +10862,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
|
|||||||
|
|
||||||
void display_reply(LOGBOOK * lbs, int message_id, int printable,
|
void display_reply(LOGBOOK * lbs, int message_id, int printable,
|
||||||
int expand, int n_line, int n_attr_disp,
|
int expand, int n_line, int n_attr_disp,
|
||||||
char disp_attr[MAX_N_ATTR + 4][NAME_LENGTH], int level)
|
char disp_attr[MAX_N_ATTR + 4][NAME_LENGTH], BOOL show_text, int level)
|
||||||
{
|
{
|
||||||
char *date, *text, *in_reply_to, *reply_to, *encoding, *locked_by, *attachment,
|
char *date, *text, *in_reply_to, *reply_to, *encoding, *locked_by, *attachment,
|
||||||
*attrib, *p;
|
*attrib, *p;
|
||||||
@ -10882,14 +10901,14 @@ void display_reply(LOGBOOK * lbs, int message_id, int printable,
|
|||||||
|
|
||||||
display_line(lbs, message_id, 0, "threaded", expand, level, printable,
|
display_line(lbs, message_id, 0, "threaded", expand, level, printable,
|
||||||
n_line, FALSE, date, in_reply_to, reply_to, n_attr_disp,
|
n_line, FALSE, date, in_reply_to, reply_to, n_attr_disp,
|
||||||
disp_attr, (void *) attrib, lbs->n_attr, text, NULL, encoding, 0, NULL,
|
disp_attr, (void *) attrib, lbs->n_attr, text, show_text, NULL, encoding, 0, NULL,
|
||||||
locked_by);
|
locked_by);
|
||||||
|
|
||||||
if (reply_to[0]) {
|
if (reply_to[0]) {
|
||||||
p = reply_to;
|
p = reply_to;
|
||||||
do {
|
do {
|
||||||
display_reply(lbs, atoi(p), printable, expand, n_line, n_attr_disp, disp_attr,
|
display_reply(lbs, atoi(p), printable, expand, n_line, n_attr_disp, disp_attr,
|
||||||
level + 1);
|
show_text, level + 1);
|
||||||
|
|
||||||
while (*p && isdigit(*p))
|
while (*p && isdigit(*p))
|
||||||
p++;
|
p++;
|
||||||
@ -11161,7 +11180,8 @@ BOOL is_command_allowed(LOGBOOK * lbs, char *command)
|
|||||||
strlcat(menu_str, "Config, ", sizeof(menu_str));
|
strlcat(menu_str, "Config, ", sizeof(menu_str));
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(other_str, "Update, Upload, Submit, Back, Search, Save, Download, CSV Import, ");
|
strcpy(other_str,
|
||||||
|
"Update, Upload, Submit, Back, Search, Save, Download, CSV Import, ");
|
||||||
strcat(other_str, "Cancel, First, Last, Previous, Next, Requested, Forgot, ");
|
strcat(other_str, "Cancel, First, Last, Previous, Next, Requested, Forgot, ");
|
||||||
|
|
||||||
/* admin commands */
|
/* admin commands */
|
||||||
@ -11684,8 +11704,9 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
attachment[MAX_ATTACHMENTS][MAX_PATH_LENGTH], encoding[80], locked_by[256],
|
attachment[MAX_ATTACHMENTS][MAX_PATH_LENGTH], encoding[80], locked_by[256],
|
||||||
str[NAME_LENGTH], ref[256], img[80], comment[NAME_LENGTH], mode[80], mid[80],
|
str[NAME_LENGTH], ref[256], img[80], comment[NAME_LENGTH], mode[80], mid[80],
|
||||||
menu_str[1000], menu_item[MAX_N_LIST][NAME_LENGTH], param[NAME_LENGTH];
|
menu_str[1000], menu_item[MAX_N_LIST][NAME_LENGTH], param[NAME_LENGTH];
|
||||||
char *p, *pt, *pt1, *pt2, *slist, *svalue;
|
char *p, *pt, *pt1, *pt2, *slist, *svalue, *gattr;
|
||||||
BOOL show_attachments, threaded, csv, mode_commands, expand, filtering, disp_filter;
|
BOOL show_attachments, threaded, csv, mode_commands, expand, filtering, disp_filter,
|
||||||
|
show_text;
|
||||||
time_t ltime, ltime_start, ltime_end, now, ltime1, ltime2;
|
time_t ltime, ltime_start, ltime_end, now, ltime1, ltime2;
|
||||||
struct tm tms, *ptms;
|
struct tm tms, *ptms;
|
||||||
MSG_LIST *msg_list;
|
MSG_LIST *msg_list;
|
||||||
@ -11763,6 +11784,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
|
|
||||||
slist = malloc((MAX_N_ATTR + 10) * NAME_LENGTH);
|
slist = malloc((MAX_N_ATTR + 10) * NAME_LENGTH);
|
||||||
svalue = malloc((MAX_N_ATTR + 10) * NAME_LENGTH);
|
svalue = malloc((MAX_N_ATTR + 10) * NAME_LENGTH);
|
||||||
|
gattr = malloc(MAX_N_ATTR * NAME_LENGTH);
|
||||||
list = malloc(10000);
|
list = malloc(10000);
|
||||||
|
|
||||||
printable = atoi(getparam("Printable"));
|
printable = atoi(getparam("Printable"));
|
||||||
@ -11826,6 +11848,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
if (ltime_start < 0) {
|
if (ltime_start < 0) {
|
||||||
free(slist);
|
free(slist);
|
||||||
free(svalue);
|
free(svalue);
|
||||||
|
free(gattr);
|
||||||
free(list);
|
free(list);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -11841,6 +11864,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
if (ltime_end < 0) {
|
if (ltime_end < 0) {
|
||||||
free(slist);
|
free(slist);
|
||||||
free(svalue);
|
free(svalue);
|
||||||
|
free(gattr);
|
||||||
free(list);
|
free(list);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -11852,6 +11876,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
show_error(str);
|
show_error(str);
|
||||||
free(slist);
|
free(slist);
|
||||||
free(svalue);
|
free(svalue);
|
||||||
|
free(gattr);
|
||||||
free(list);
|
free(list);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -11867,6 +11892,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
show_error(loc("Error: start date after end date"));
|
show_error(loc("Error: start date after end date"));
|
||||||
free(slist);
|
free(slist);
|
||||||
free(svalue);
|
free(svalue);
|
||||||
|
free(gattr);
|
||||||
free(list);
|
free(list);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -11998,6 +12024,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
show_error("Out of memory");
|
show_error("Out of memory");
|
||||||
free(slist);
|
free(slist);
|
||||||
free(svalue);
|
free(svalue);
|
||||||
|
free(gattr);
|
||||||
free(list);
|
free(list);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -12607,6 +12634,38 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* evaluate Guest display list */
|
||||||
|
show_text = TRUE;
|
||||||
|
if (getcfg(lbs->name, "Password file", str) &&
|
||||||
|
getcfg(lbs->name, "Guest display", str) &&
|
||||||
|
!isparam("unm")) {
|
||||||
|
|
||||||
|
n = strbreak(str, (char (*)[NAME_LENGTH])gattr, MAX_N_ATTR, ",");
|
||||||
|
for (i=0 ; i<n_attr_disp ; i++) {
|
||||||
|
for (j=0 ; j<n ; j++)
|
||||||
|
if (strieq(gattr+NAME_LENGTH*j, disp_attr[i]))
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (j == n &&
|
||||||
|
!strieq(disp_attr[i], loc("Logbook")) &&
|
||||||
|
!strieq(disp_attr[i], loc("ID")) &&
|
||||||
|
!strieq(disp_attr[i], loc("Date"))) {
|
||||||
|
|
||||||
|
memcpy(disp_attr[i], disp_attr[i+1], (n_attr_disp-i-1)*NAME_LENGTH);
|
||||||
|
n_attr_disp--;
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j=0 ; j<n ; j++)
|
||||||
|
if (strieq(gattr+j*NAME_LENGTH, "text"))
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (j == n)
|
||||||
|
show_text = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (threaded) {
|
if (threaded) {
|
||||||
} else {
|
} else {
|
||||||
rsprintf("<tr>\n");
|
rsprintf("<tr>\n");
|
||||||
@ -12662,7 +12721,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
disp_attr[i], img);
|
disp_attr[i], img);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strieq(mode, "Full") && n_line > 0)
|
if (!strieq(mode, "Full") && n_line > 0 && show_text)
|
||||||
rsprintf("<th class=\"listtitle\">%s</th>\n", loc("Text"));
|
rsprintf("<th class=\"listtitle\">%s</th>\n", loc("Text"));
|
||||||
|
|
||||||
rsprintf("</tr>\n\n");
|
rsprintf("</tr>\n\n");
|
||||||
@ -12770,7 +12829,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
display_line(msg_list[index].lbs, message_id,
|
display_line(msg_list[index].lbs, message_id,
|
||||||
index, mode, expand, 0, printable, n_line,
|
index, mode, expand, 0, printable, n_line,
|
||||||
show_attachments, date, in_reply_to, reply_to,
|
show_attachments, date, in_reply_to, reply_to,
|
||||||
n_attr_disp, disp_attr, attrib, lbs->n_attr, text,
|
n_attr_disp, disp_attr, attrib, lbs->n_attr, text, show_text,
|
||||||
attachment, encoding, atoi(getparam("select")), &n_display,
|
attachment, encoding, atoi(getparam("select")), &n_display,
|
||||||
locked_by);
|
locked_by);
|
||||||
|
|
||||||
@ -12779,7 +12838,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
p = reply_to;
|
p = reply_to;
|
||||||
do {
|
do {
|
||||||
display_reply(msg_list[index].lbs, atoi(p), printable, expand, n_line,
|
display_reply(msg_list[index].lbs, atoi(p), printable, expand, n_line,
|
||||||
n_attr_disp, disp_attr, 1);
|
n_attr_disp, disp_attr, show_text, 1);
|
||||||
|
|
||||||
while (*p && isdigit(*p))
|
while (*p && isdigit(*p))
|
||||||
p++;
|
p++;
|
||||||
@ -12814,6 +12873,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
|
|
||||||
free(slist);
|
free(slist);
|
||||||
free(svalue);
|
free(svalue);
|
||||||
|
free(gattr);
|
||||||
free(list);
|
free(list);
|
||||||
free(msg_list);
|
free(msg_list);
|
||||||
free(text);
|
free(text);
|
||||||
@ -13856,13 +13916,13 @@ void show_elog_message(LOGBOOK * lbs, char *dec_path, char *command)
|
|||||||
char date[80], text[TEXT_SIZE], menu_str[1000], cmd[256], cmd_enc[256],
|
char date[80], text[TEXT_SIZE], menu_str[1000], cmd[256], cmd_enc[256],
|
||||||
orig_tag[80], reply_tag[MAX_REPLY_TO * 10], display[256],
|
orig_tag[80], reply_tag[MAX_REPLY_TO * 10], display[256],
|
||||||
attachment[MAX_ATTACHMENTS][MAX_PATH_LENGTH], encoding[80], locked_by[256],
|
attachment[MAX_ATTACHMENTS][MAX_PATH_LENGTH], encoding[80], locked_by[256],
|
||||||
att[256], lattr[256], mid[80];
|
att[256], lattr[256], mid[80], menu_item[MAX_N_LIST][NAME_LENGTH], format[80],
|
||||||
char menu_item[MAX_N_LIST][NAME_LENGTH], format[80], admin_user[80],
|
admin_user[80], slist[MAX_N_ATTR + 10][NAME_LENGTH],
|
||||||
slist[MAX_N_ATTR + 10][NAME_LENGTH], svalue[MAX_N_ATTR + 10][NAME_LENGTH], *p;
|
gattr[MAX_N_ATTR][NAME_LENGTH], svalue[MAX_N_ATTR + 10][NAME_LENGTH], *p,
|
||||||
char lbk_list[MAX_N_LIST][NAME_LENGTH], comment[256], class_name[80], class_value[80],
|
lbk_list[MAX_N_LIST][NAME_LENGTH], comment[256], class_name[80], class_value[80],
|
||||||
fl[8][NAME_LENGTH];
|
fl[8][NAME_LENGTH];
|
||||||
FILE *f;
|
FILE *f;
|
||||||
BOOL first;
|
BOOL first, show_text;
|
||||||
struct tm *pts;
|
struct tm *pts;
|
||||||
time_t ltime;
|
time_t ltime;
|
||||||
|
|
||||||
@ -14261,8 +14321,8 @@ void show_elog_message(LOGBOOK * lbs, char *dec_path, char *command)
|
|||||||
sprintf(str, "%d", message_id);
|
sprintf(str, "%d", message_id);
|
||||||
add_subst_list((char (*)[NAME_LENGTH]) slist, (char (*)[NAME_LENGTH]) svalue,
|
add_subst_list((char (*)[NAME_LENGTH]) slist, (char (*)[NAME_LENGTH]) svalue,
|
||||||
"message id", str, &j);
|
"message id", str, &j);
|
||||||
add_subst_time(lbs, (char (*)[NAME_LENGTH])slist, (char (*)[NAME_LENGTH])svalue,
|
add_subst_time(lbs, (char (*)[NAME_LENGTH]) slist,
|
||||||
"entry time", date, &j);
|
(char (*)[NAME_LENGTH]) svalue, "entry time", date, &j);
|
||||||
|
|
||||||
strsubst(display, (char (*)[NAME_LENGTH]) slist,
|
strsubst(display, (char (*)[NAME_LENGTH]) slist,
|
||||||
(char (*)[NAME_LENGTH]) svalue, j);
|
(char (*)[NAME_LENGTH]) svalue, j);
|
||||||
@ -14326,6 +14386,20 @@ void show_elog_message(LOGBOOK * lbs, char *dec_path, char *command)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < lbs->n_attr; i++) {
|
for (i = 0; i < lbs->n_attr; i++) {
|
||||||
|
|
||||||
|
if (getcfg(lbs->name, "Password file", str) &&
|
||||||
|
getcfg(lbs->name, "Guest display", str) &&
|
||||||
|
!isparam("unm")) {
|
||||||
|
|
||||||
|
n = strbreak(str, gattr, MAX_N_ATTR, ",");
|
||||||
|
for (j=0 ; j<n ; j++)
|
||||||
|
if (strieq(gattr[j], attr_list[i]))
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (j == n)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
strcpy(class_name, "attribname");
|
strcpy(class_name, "attribname");
|
||||||
strcpy(class_value, "attribvalue");
|
strcpy(class_value, "attribvalue");
|
||||||
|
|
||||||
@ -14432,7 +14506,22 @@ void show_elog_message(LOGBOOK * lbs, char *dec_path, char *command)
|
|||||||
|
|
||||||
/*---- message text ----*/
|
/*---- message text ----*/
|
||||||
|
|
||||||
if (!getcfg(lbs->name, "Show text", str) || atoi(str) == 1) {
|
show_text = !getcfg(lbs->name, "Show text", str) || atoi(str) == 1;
|
||||||
|
|
||||||
|
if (getcfg(lbs->name, "Password file", str) &&
|
||||||
|
getcfg(lbs->name, "Guest display", str) &&
|
||||||
|
!isparam("unm")) {
|
||||||
|
|
||||||
|
n = strbreak(str, gattr, MAX_N_ATTR, ",");
|
||||||
|
for (j=0 ; j<n ; j++)
|
||||||
|
if (strieq(gattr[j], "text"))
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (j == n)
|
||||||
|
show_text = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (show_text) {
|
||||||
rsprintf("<tr><td class=\"messageframe\">\n");
|
rsprintf("<tr><td class=\"messageframe\">\n");
|
||||||
|
|
||||||
if (strieq(encoding, "plain")) {
|
if (strieq(encoding, "plain")) {
|
||||||
@ -14443,7 +14532,6 @@ void show_elog_message(LOGBOOK * lbs, char *dec_path, char *command)
|
|||||||
rsputs(text);
|
rsputs(text);
|
||||||
|
|
||||||
rsputs("</td></tr>\n");
|
rsputs("</td></tr>\n");
|
||||||
}
|
|
||||||
|
|
||||||
for (index = 0; index < MAX_ATTACHMENTS; index++) {
|
for (index = 0; index < MAX_ATTACHMENTS; index++) {
|
||||||
if (attachment[index][0] && strlen(attachment[index]) > 14) {
|
if (attachment[index][0] && strlen(attachment[index]) > 14) {
|
||||||
@ -14535,6 +14623,7 @@ void show_elog_message(LOGBOOK * lbs, char *dec_path, char *command)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* overall table (class "frame" from show_standard_header) */
|
/* overall table (class "frame" from show_standard_header) */
|
||||||
rsprintf("\r\n</table><!-- show_standard_title -->\r\n");
|
rsprintf("\r\n</table><!-- show_standard_title -->\r\n");
|
||||||
@ -15029,8 +15118,8 @@ void show_logbook_node(LBLIST plb, LBLIST pparent, int level, int btop)
|
|||||||
lb_list[index].n_attr = scan_attributes(lb_list[index].name);
|
lb_list[index].n_attr = scan_attributes(lb_list[index].name);
|
||||||
message_id = el_search_message(&lb_list[index], EL_LAST, 0, FALSE);
|
message_id = el_search_message(&lb_list[index], EL_LAST, 0, FALSE);
|
||||||
el_retrieve(&lb_list[index],
|
el_retrieve(&lb_list[index],
|
||||||
message_id, date, attr_list, attrib, lb_list[index].n_attr, NULL, 0, NULL,
|
message_id, date, attr_list, attrib, lb_list[index].n_attr, NULL,
|
||||||
NULL, NULL, NULL, NULL);
|
0, NULL, NULL, NULL, NULL, NULL);
|
||||||
if (!getcfg(lb_list[index].name, "Last submission", str)) {
|
if (!getcfg(lb_list[index].name, "Last submission", str)) {
|
||||||
sprintf(str, "$entry time");
|
sprintf(str, "$entry time");
|
||||||
for (i = 0; i < lb_list[index].n_attr; i++)
|
for (i = 0; i < lb_list[index].n_attr; i++)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user