From 12273aa82492cbaae502b076f663638d687ee39f Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Thu, 4 Dec 2003 20:56:51 +0000 Subject: [PATCH] Added 'date on reply' flag SVN revision: 636 --- doc/config.html | 11 +++++++++-- src/elogd.c | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/doc/config.html b/doc/config.html index 18bcd38c..d2ba7185 100755 --- a/doc/config.html +++ b/doc/config.html @@ -1301,7 +1301,7 @@ The default is 1.

  • Hidden = 0|1 -
    +
    If this flag is 1, the logbook is not displayed in the initial logbook selection page and in the logbook tabs. This can be useful for logbooks which are only accessed for backup or archiving and would clutter up the logbook list for the normal user. To @@ -1310,7 +1310,7 @@ Default is 0.

  • Use Lock = 0|1 -
    +
    If this flag is 1, a logbook entry is locked when someone edits it (clicking the Edit command). A locked message gets displayed with a little red sign indicating that the message is currently edited by someone and should not be touched. This can be @@ -1330,6 +1330,13 @@ resulting in all messages being locked. In those cases locking has to be turned Default for "Use Lock" is 0.

    +

  • Date on reply = 0|1 +
    +If this flag is 1, the current date is placed between the quoted original entry +and the new entry. This can be useful for email notifications, if one wants to see the +time history of all replies in the email messages. Default is 0. +

    +


    diff --git a/src/elogd.c b/src/elogd.c index c5604d16..03b54e31 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 1.165 2003/12/04 20:56:51 midas + Added 'date on reply' flag + Revision 1.164 2003/12/04 11:34:36 midas Made 'preset xxx' work with boolean attributes @@ -5199,6 +5202,7 @@ char date[80], attrib[MAX_N_ATTR][NAME_LENGTH], text[TEXT_SIZE], owner[256], locked_by[256], class_value[80], class_name[80]; time_t now; char fl[8][NAME_LENGTH]; +struct tm *ts; for (i=0 ; iname, "Date on reply", str) && atoi(str) > 0) + { + time(&now); + ts = localtime(&now); + if (getcfg(lbs->name, "Date format", format)) + strftime(str, sizeof(str), format, ts); + else + { + strcpy(str, ctime(&now)); + str[strlen(str)-1] = 0; + } + rsprintf("%s\n\n", str); + } } } }