Gossamer Forum
Home : Products : DBMan : Customization :

Modify question

Quote Reply
Modify question
I've been asked if we can 'disable' certain database fields on a modify (admin user). Here is what needs to be done:

Example db: field1 field2 field3 field4.

Derfault user can add a record but field3 and field4 are admin only fields.

We want the admin to be able to modify only field3 and field4. field1 and field2 should be displayed but cannot be edited.

Is there a workflow for this?

Thanks
Quote Reply
Re: [dawg821] Modify question In reply to
This and many more tips are available in the FAQ noted below.

For an example you could use:

|;
if (($per_admin) or (!$in{'modify'})) {
print qq|
<TR><TD><$font>Field 3</font></TD><TD><INPUT TYPE="TEXT" NAME="Field3" SIZE="10" VALUE="$rec{'Field3'}" MAXLENGTH="10"></TD></TR> |;
}

for each field that you only want admin to be able to modify.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Modify question In reply to
Hi Lois,

I tried the following code:

<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>Users Impacted:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475">&nbsp;|; print &build_radio_field("Users",$rec{'Users'}); print qq|</TD></TR>

<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>Workstations Impacted:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475">&nbsp;|; print &build_radio_field("Workstations",$rec{'Workstations'}); print qq|</TD></TR>
|;


if ($per_admin) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>IOM Ticket/Log #:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475">&nbsp;<INPUT TYPE="TEXT" NAME="IOM Ticket #" SIZE="20" VALUE="$rec{'IOM Ticket #'}" MAXLENGTH="20"></TD></TR>
|;
}
else {
print qq|
<input type="hidden" NAME="IOM Ticket #" VALUE="$rec{'IOM Ticket #'}">
|;
}
|;
if ($per_admin) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>Status:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475">&nbsp;|; print &build_select_field("Status",$rec{'Status'}); print qq|</TD></TR>
|;
}
else {
print qq|
<input type="hidden" NAME="Status" VALUE="$rec{'Status'}">
|;
}

and received the following syntax error: syntax error near "|"

I think I am missing an end print (|; command) but am not quite sure. Any ideas?

thanks--

fletch
Quote Reply
Re: [dawg821] Modify question In reply to
Looks like you have an extra |; stuck in there :)

<input type="hidden" NAME="IOM Ticket #" VALUE="$rec{'IOM Ticket #'}"> |;
}
### |; remove this one
if ($per_admin) {

Hope that helps

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/