meeting-room-booking-system / mrbs-code

MRBS application code
Other
124 stars 61 forks source link

Multiple select options not working #2315

Open jberanek opened 6 years ago

jberanek commented 6 years ago

First of all, we love and appreciate this program. We set up a Custom Field for Additional Food. Everything worked well. The client asked if we could make this a Multiple Select box, so I added the following to my Config.inc.: $select_options['entry.food'] = array('' => 'None', 'c' => 'Continental Breakfast', 'h' => 'Hot Buffet Breakfast', 'a' => 'Additional Break',
'l' => 'Buffet Lunch', 'd' => 'Buffet Dinner', 'r' => 'Reception'); Then I went to functions.inc and changed to TRUE
case 'multiple': $params[$key] = TRUE; break;

However, It allows you to select multiple options by holding CTRL, but it is not recording them. Another fluke was you couldn't enter a meeting for 1/2 hour. I changed it back to FALSE and was able to add an 1/2 hour meeting.

Is this a bug? or did i miss a setting?

Reported by: slfedesna

Original Ticket: mrbs/support-requests/1608

jberanek commented 6 years ago

Multiple selections are not supported at the moment. It's not a trivial change to the code either because you need to think about how to store the data, whether as a serialised array - which mkes searching difficult - or in a new table.

The best thing to do in the short term is to create six new custom fields, oner for each of the options and each one of them as a TINYINT(1), and then MRBS will present six options.

Original comment by: campbell-m

jberanek commented 6 years ago

woult they show up as check boxes?

Original comment by: slfedesna

jberanek commented 6 years ago

Yes, they'll show up as checkboxes

Original comment by: campbell-m

jberanek commented 6 years ago

Would there be a way to add a description above these check boxes? Additional AV is a box, then my list with checkboxes. could I add Additional Food & Beverage above those? Continental Breakfast Hot Buffet Breakfast Additional Break Buffet Lunch Buffet Dinner Reception

Original comment by: slfedesna

jberanek commented 6 years ago

Not without modifying the MRBS code.

Original comment by: campbell-m

jberanek commented 6 years ago

I know PHP would it be an easy edit? I assume it would be in the edit_entry.php file.

Original comment by: slfedesna

jberanek commented 6 years ago

Yes, it would be in there. There's a function create_field_entry_custom_field() which is called for each of the custom fields.

Original comment by: campbell-m