Active
Project:
MERCI (Manage Equipment Reservations, Checkout and Inventory)
Version:
6.x-2.0-beta9
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
9 Feb 2011 at 01:53 UTC
Updated:
26 May 2025 at 08:52 UTC
Jump to comment: Most recent
Comments
Comment #1
darrick commentedThis would be moderately difficult to fix. One problem is the conflict grid only works in 15 minute increments. The code would need to be audited to find the spots where reservation a to < reservation b and changed to reservation a to <= reservation b. I'm a bit to busy right now but would welcome a patch.
Comment #2
mhamilton commentedThe workaround we went with was to change MERCI granularity down to minutes as opposed to the 15 minute increments and make reservations up to the 59 or 29 mark. I.E. 1:00 - 1:29, next reservation 1:30 -1:59.
Obviously you're going to be losing a minute per reservation, and in the long run this may add up in reporting, but it's something.
Darrick or Kevin is there any reason to not go with this method?
Comment #3
Anonymous (not verified) commentedOur workaround, patching date.module and merci reservation content type:
It creates one date popup (booking only on the selected date) a pop up start time (24h format) and booking time span (1, 2, 3, .. 8 hour). To create a back to back reservation the time span (end time) is saved as full hour minus one minute: One hour booking from 10:00-11:00 is saved as 10:00-10:59.
workaround:
Install date.module and merci.module (....)
For one calendar pop-up install the date patch: http://drupal.org/node/127200#comment-3902902
For patching date-popup, install the date patch http://drupal.org/files/issues/233047-date-timepicker-alternative_0.patch
Replace the content in /date/date_popup/lib/date_popup.timedropdown.js with the code (Pimm thanks for the code).
Setup date.module and date_popup(!) to your needs and change the 'To date' setup (!) in field_merci_date in reservations contenttype (you can make it visable in Merci settings).
Comment #4
darrick commentedI've thought about this a bit. I would prefer not to change the validation functions to support a reservation time ending at the same exact time and new one begins. I've delved quite a bit into the date and calendar modules. Those modules would consider the reservations to be overlapping and display them as such. The best option is either @markhamilton suggestion.
Given what @cmeasy says. I would implement hook_form_alter and define a reservation length field and hide the reservation to field. Then attach a ahah handler to the length field. When the length field is changed the callback sets the reservation to field and updates the form.
Comment #5
jonscyu commented@mhamilton: I'm trying to set up the same work-around for my own projects. That said I'm not a coder and an was wondering how you were able to set it up with the 1 minute granularity. Would it be possible to post your how-to here? Thanks.
Comment #6
gocaps commentedYou can change the granularity in the merci.install file:
function _merci_installed_instances() : change 'increment' => '15' to 'increment' => '1'
If you've already installed the module, you can make the change in the database in the field_config_instance table.
I ended up changing the granularity to 1 minute, then I created a Reservation Duration field using hook_form_alter. I ended up using some jquery to take the duration selection and set the "Reservation To" field equal to start time + duration - 1 min.
Comment #7
mhamilton commentedSorry for the delay on this gocaps, I just saw your message recently. Also my post may not make any sense as I had an in depth explanation typed up and unintentionally used one of the HIGHLY USEFUL Apple Magic Mouse shortcuts and found that I'd navigated back 3 pages and lost everything typed.
For gocaps & jonscyu and anyone else that stumbles across this: There's actually an easier and more "Drupal" way to achieve this that doesn't involve any code changes or hacks.
I'm positive our version of MERCI will differ from yours, but you should be able to find the setting at admin/settings/merci. From there you'll see an option to Unlock Core MERCI fields. This will allow you to edit the Datetime field titled field_merci_date on the Reservation content type, and alter the granularity. Without fields unlocked you'll be able to edit the content type, but not this particular (and some other) field(s).
Once unlocked either go to Content Types or the same merci administration page and edit Reservation -> Manage Fields -> Configure (for field_merci_date) then turn Time Increment down to 1.
I 'think' this is how I achieved this, but our initial setup was almost 2 years ago at this point so... fingers crossed. Good luck!
Comment #8
naiamaya commentedWould be nice if this was configurable option, so everyone could adapt to their own needs, allowing or not do at the same time the end and the beginning of a book.