Gossamer Forum
Home : Products : DBMan : Customization :

checkbox for showing record

Quote Reply
checkbox for showing record
is there a modification for making it so that there's a checkbox when people add/modify records and that if it's unchecked, the record isn't shown in a search?
Quote Reply
Re: checkbox for showing record In reply to
You could add a checkbox field to your database. I'll call it "ShowRecord" for illustrative purposes. You can call it anything you'd like, as long as you're consistent.

Define the checkbox as

%db_checkbox_fields = ( ShowRecord => 'Yes' );

In db.cgi, sub view_records, at the beginning of the subroutine, add

Code:
unless ($per_admin) {
$in{'ShowRecord'} = "Yes";
}

This will let those with admin permission to view all records, but those without will only be able to view the ones that have the box checked. This will also apply to the owner of the record. The owner will be able to see his own record if he does a "modify" or "delete" though.


------------------
JPD