diff --git a/doc/config.html b/doc/config.html
index 3be9f385..77bc9604 100755
--- a/doc/config.html
+++ b/doc/config.html
@@ -714,8 +714,8 @@ attachments. The default is 10485760 (= 10 MB).
Attributes = <list>
-Define a number of attributes for the logbook, separated by commata. A maximum of
-100 attributes can be defined. Typical values are "Author", "Subject"
+Define a number of attributes for the logbook, separated by commata. A maximum of
+100 attributes can be defined. Typical values are "Author", "Subject"
or "Type".
@@ -1061,7 +1061,7 @@ so specifying for example only the flags is possible.
Type <attribute> = date | numeric | userlist
A normal attribute can contain strings of any type. With this option, attributes can be
-forced to be numeric or to be a date, or to consist of a list of all users from the password file.
+forced to be numeric or to be a date, or to consist of a list of all users from the password file.
When new logbook entries are made,
numeric attributes are checked to contain only digits. Note that JavaScript has to be
enabled to do this.
@@ -1171,8 +1171,8 @@ Same as before, but for editing entries.
Sort Attributes = <list>
For the list display, the entries are normally sorted by their ID. Alternatively,
-one can specify one or more (separated by commata) attributes, which are used
-for sorting. The first attribute in the list has the highest priority. Only if two
+one can specify one or more (separated by commata) attributes, which are used
+for sorting. The first attribute in the list has the highest priority. Only if two
entries have the same value in the first sort attribute, they are sorted according to
the second sort attribute and so on.
@@ -1259,6 +1259,25 @@ message comment can be displayed to tell the user what to enter exactly in the
message body for that attribute value.
+
Hidden Attributes = <list>
+
+When using conditional attributes, it might be necessary to omit certain attributes
+under certain conditions, to make the input mask shorter. With this option, a list
+of attributes can be specified which are not displayed on the new entry input page.
+This option only makes sense when used with condisions, such as:
+
+
+Attributes = PC Name, Operating System, Version, Distribution
+Options Operating System = Linux{1}, Windows{2}
+{1} Hidden Attributes = Version
+{2} Hidden Attributes = Distribution
+
+
+
+The above statements caus the atrribute Version to be only
+visible when "Windows" is selected, and Version to be only
+visible when "Linux" is selected.
+
Multiple conditions
It is possible to define conditions in more than one options list. The only requiremnt
diff --git a/src/elogd.c b/src/elogd.c
index 50a1d2d3..6164e7f4 100755
--- a/src/elogd.c
+++ b/src/elogd.c
@@ -6,6 +6,9 @@
Contents: Web server program for Electronic Logbook ELOG
$Log$
+ Revision 1.534 2005/01/06 10:02:34 midas
+ Implemented 'hidden attributes'
+
Revision 1.533 2005/01/06 08:51:22 midas
Made extendable attributes work with conditional attributes
@@ -942,6 +945,7 @@ char author_list[MAX_N_LIST][NAME_LENGTH] = {
#define AF_DATE (1<<8)
#define AF_NUMERIC (1<<9)
#define AF_USERLIST (1<<10)
+#define AF_HIDDEN (1<<11)
/* attribute format flags */
#define AFF_SAME_LINE 1
@@ -6075,7 +6079,15 @@ and attr_flags arrays */
for (j = 0; j < n; j++)
if (strieq(attr_list[j], tmp_list[i]))
attr_flags[j] |= AF_EXTENDABLE;
+ }
+ /* check for hidden attributes */
+ getcfg(logbook, "Hidden Attributes", list, sizeof(list));
+ m = strbreak(list, tmp_list, MAX_N_ATTR, ",");
+ for (i = 0; i < m; i++) {
+ for (j = 0; j < n; j++)
+ if (strieq(attr_list[j], tmp_list[i]))
+ attr_flags[j] |= AF_HIDDEN;
}
for (i = 0; i < n; i++) {
@@ -7704,7 +7716,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
rsprintf("{\n");
for (i = 0; i < n_attr; i++) {
- if (attr_flags[i] & AF_REQUIRED) {
+ if ((attr_flags[i] & AF_REQUIRED) && (attr_flags[i] & AF_HIDDEN) == 0) {
/* convert blanks to underscores */
strcpy(ua, attr_list[i]);
@@ -7942,6 +7954,10 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
/* display attributes */
for (index = 0; index < n_attr; index++) {
+
+ if (attr_flags[index] & AF_HIDDEN)
+ continue;
+
strcpy(class_name, "attribname");
strcpy(class_value, "attribvalue");
input_size = 80;