Implemented USERLIST as attribute type

SVN revision: 1134
This commit is contained in:
2004-11-17 14:41:11 +00:00
parent d549e5e568
commit e044406256
5 changed files with 43 additions and 10 deletions
+2 -2
View File
@@ -93,7 +93,7 @@ BSC32_SBRS= \
<<
LINK32=link.exe
LINK32_FLAGS=wsock32.lib advapi32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\elogd.pdb" /machine:I386 /out:"$(OUTDIR)\elogd.exe"
LINK32_FLAGS=wsock32.lib advapi32.lib /nologo /subsystem:console /stack:4000000 /incremental:no /pdb:"$(OUTDIR)\elogd.pdb" /machine:I386 /out:"$(OUTDIR)\elogd.exe"
LINK32_OBJS= \
"$(INTDIR)\elogd.obj" "$(INTDIR)\regex.obj"
@@ -173,7 +173,7 @@ BSC32_SBRS= \
<<
LINK32=link.exe
LINK32_FLAGS=wsock32.lib advapi32.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\elogd.pdb" /debug /machine:I386 /out:"$(OUTDIR)\elogd.exe" /pdbtype:sept
LINK32_FLAGS=wsock32.lib advapi32.lib /nologo /subsystem:console /stack:4000000 /incremental:yes /pdb:"$(OUTDIR)\elogd.pdb" /debug /machine:I386 /out:"$(OUTDIR)\elogd.exe" /pdbtype:sept
LINK32_OBJS= \
"$(INTDIR)\elogd.obj" "$(INTDIR)\regex.obj"
+1 -1
View File
@@ -44,7 +44,7 @@
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/elogd.pdb"
SubSystem="1"
StackReserveSize="1048576"
StackReserveSize="4000000"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
+7 -2
View File
@@ -1057,10 +1057,11 @@ Default is <i>"0, attribname, attribvalue, 80, 500"</i>. Trailing parameters can
so specifying for example only the flags is possible.
<p>
<LI><b><code>Type &lt;attribute&gt; = date | numeric</b></code>
<LI><b><code>Type &lt;attribute&gt; = date | numeric | userlist</b></code>
<br>
A normal attribute can contain strings of any type. With this option, attributes can be
forced to be numeric or to be a date. When new logbook entries are made,
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.<br><br>
@@ -1073,6 +1074,10 @@ dates can be searched for via a start and end date. If date attributes are used
(see above), a drop-down quick filter box is displayed which lets the user select "last day",
"last week", "next week", and so on.<p>
If the attribute type is <b><code>userlist</code></b>, a drop-down box is displayed which contains
all user names from the current password file. This can be useful for example in a bug
tracking system, where a new entry gets assigned to an individual.<p>
<LI><b><code>Display &lt;attribute&gt; = &lt;string&gt;</b></code>
<br>
Instead of subsituting an attribute, the original attribute can be kept and just the
-4
View File
@@ -53,10 +53,6 @@
<tr>
<td>
Derive attribute options from list of entries of another logbook<td>1</td>
<tr>
<td>
Derive list of options for attribute from user list (Options [attrib] =
$user_list)<td>2</td>
<tr>
<td>
Add/Remove logbooks though the web interface<td>1</td>
+33 -1
View File
@@ -6,6 +6,9 @@
Contents: Web server program for Electronic Logbook ELOG
$Log$
Revision 1.513 2004/11/17 14:39:16 midas
Implemented USERLIST as attribute type
Revision 1.512 2004/11/16 15:35:17 midas
Version 2.5.5-2
@@ -878,6 +881,7 @@ char author_list[MAX_N_LIST][NAME_LENGTH] = {
#define AF_EXTENDABLE (1<<7)
#define AF_DATE (1<<8)
#define AF_NUMERIC (1<<9)
#define AF_USERLIST (1<<10)
/* attribute format flags */
#define AFF_SAME_LINE 1
@@ -5988,6 +5992,8 @@ and attr_flags arrays */
attr_flags[i] |= AF_DATE;
if (strieq(type, "numeric"))
attr_flags[i] |= AF_NUMERIC;
if (strieq(type, "userlist"))
attr_flags[i] |= AF_USERLIST;
}
}
@@ -7318,7 +7324,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
reply_tag[MAX_REPLY_TO * 10], att[MAX_ATTACHMENTS][256], encoding[80],
slist[MAX_N_ATTR + 10][NAME_LENGTH], svalue[MAX_N_ATTR + 10][NAME_LENGTH],
owner[256], locked_by[256], class_value[80], class_name[80], condition[256],
ua[NAME_LENGTH], mid[80], title[256];
ua[NAME_LENGTH], mid[80], title[256], login_name[256];
time_t now, ltime;
char fl[8][NAME_LENGTH];
struct tm *pts, ts;
@@ -7980,6 +7986,32 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
show_date_selector(day, month, year, str);
rsprintf("</td>\n");
} else if (attr_flags[index] & AF_USERLIST) {
rsprintf("<td%s class=\"attribvalue\">\n", title);
/* display drop-down box with list of users */
rsprintf("<select name=\"%s\"", ua);
rsprintf(" onChange=\"mod();\">\n");
/* display emtpy option */
rsprintf("<option value=\"\">- %s -\n", loc("please select"));
for (i = 0; ; i++) {
if (!enum_user_line(lbs, i, login_name))
break;
get_user_line(lbs->name, login_name, NULL, str, NULL, NULL);
if (strieq(str, attrib[index]))
rsprintf("<option selected value=\"%s\">%s\n", str, str);
else
rsprintf("<option value=\"%s\">%s\n", str, str);
}
rsprintf("</select>\n");
rsprintf("</td>\n");
} else {
/* show normal edit field */