Re: [MRBS-general] Adding 'private' bookings feature
Brought to you by:
jberanek
From: Cory J. <cj...@dc...> - 2009-02-28 21:41:52
|
Ok, I finally decided that what you recommended probably makes the code easier to follow and maintain and was probably the right way to go even on K.I.S.S. principals alone. I'm going with the following addition to the config file which should be clear enough for most people: // Private Bookings Settings // Only administrators or the person who booked a private event can see // details of the event. Everyone else just sees that the time/period // is booked on the schedule. $private_enabled = TRUE; // Enable checkbox in entry page to make // the booking private. $private_default = TRUE; // Set default value for "Private" checkbox. $private_mandatory = FALSE; // If TRUE all entries will be // saved as private regardless of whether checkbox is // displayed. If checkbox is displayed it will be checked // and disabled. $private_override = "none"; // Override default privacy behavior. // "none" - Private flag on entry is used // "private" - ALL entries are treated as private regardless // of flag. // "public" - NO entry is treated as private, regardless of // flag on entry. // Overrides $private_default and $private_mandatory Time to go hack away on this stuff a bit. >>> "Campbell Morrison" <ma...@ca...> 02/27/09 6:55 PM >>> I think $private_xxxx sounds OK. Yes, I think you're going to need four parameters. The three you've got control the behaviour of edit_entry, ie _creating_ new bookings: $private_enabled // the checkbox option for marking private bookings is enabled $private_default // the default setting for the checkbox option $private_mandatory // all bookings will be private (and whether you see the checkbox is determined by $private_enabled). If set, this overrides $private_default Then there's fourth setting which controls how all bookings (old and new) are _displayed_, and it can have three values: - display according to the privacy setting of the booking - display as private, regardless of the setting - display as public, regardless of the setting This could be something like $display_private = default/private/public Campbell |