Breaking this out from http://drupal.org/node/1699272#comment-6363368 :
3) Some conferences (such as LinuxFestNW that has been the motivation for COD contributions by japerry and DyanneNova) have a session scheduling workflow where a higher tiered session organizer first blocks out the schedule to specify which types of sessions can happen during certain parts of the schedule (eg, a room that has a keynote from 9-10 but then should allow only BoFs from 10-4).
4) A proposed UI for implementing #3 would add a control such as "Alllowed in this slot: Bofs" or "Allowed in this slot: Sessions & BoFs" to slots in both the vertical and grid schedule views. When engaged, this control would allow the more permissionsed session organizer to specify which types of scheudulable items are allowed in that room during that timeslot. This information could be stored in a field collection on the room node (such as room_slot_types_allowed) that would contain an entity reference to each timeslot, and a set of checkboxes for each of the schedulable types that can fit in the room during a particular timeslot. So, when editing the room node, you might see something such as:Schedule settings:
-- 6/15/2013 10:00-11:00. Allowed in this slot:
[] Sessions
[] Schedule items
[] BoFs
- 6/15/2013 11:00-12:00. Allowed in this slot:
[] Sessions
[] Schedule items
[] BoFs
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 1742806-cod_scheduler-9.patch | 307.51 KB | japerry |
| #1 | cod_scheduler.patch | 20.39 KB | japerry |
| #9 | 1742806-cod-bof-scheduler-8.patch | 82 KB | japerry |
| #8 | 1742806-cod-bof-scheduler-7.patch | 81.56 KB | japerry |
| #6 | 1742806-cod-bof-scheduler-6.patch | 80.07 KB | ezra-g |
Comments
Comment #1
japerryHere is the initial patch to start work on this. Its fairly close to alpha-release, but needs work.
Comment #2
ezra-g commentedComment #3
ezra-g commentedA note on the approach for the patch in #1: The new field collection we're defining provides a base join against for interactive schedule views. As a result, it eliminates the need to do extensive pre-process work to display timeslots that have no scheduled items in them. This should greatly simplify construction of the COD_BoF view, and even lays the groundwork for an interactive schedule view that conference organizers can use to build their schedules.
Comment #4
japerryAlso, you'll need to download and enable field_collection and field_select_ct for this to work. Once we get this ready for committing, I'll add an issue on cod to update the make file.
http://drupal.org/project/field_select_ct
http://drupal.org/project/field_collection
Comment #5
japerryOkay here is the built out version of the bof scheduler, includes a few other fun things:
The master scheduler, available at admin/conference/schedule
This allows admins to set a room type and capacity for a room/timeslot combo
The bof view, built off the results of the entity fieldcollection from the room CT
This allows bofs to be scheduled, but and uses the room capacity.
This isn't done-done yet, but it should be at a point where we can start collaborating with others on the patch. And it does get the basic functionality in there.
Comment #6
ezra-g commentedThis is a great start! I think the big picture architecture is right here, but as you point out there are some functional and code-style issues that we should fix, some of them before committing.
I re-rolled #5 to make the following changes:
- admin/conference/schedule didn't display any of the menu tabs for sites that only have a single day of time slots. I updated cod_session_scheduler_form() to provide a default day.
- If we're going to be using the short, numeric date format in both the our implementation of hook_menu() and the cod_session_scheduler_form() and potentially other places, it would be ideal for cod_session_days() to return an array in the desired format.
- When configured with multiple days, the tabs sorted out of chronological sequence. I added a weight to the tabs so they'll appear chronologically.
- Currently adding a new time slot or changing the day of an existing one will not create a new menu tab because the menu cache isn't cleared after saving the time-slot. If we continue with the these as local tasks (as opposed to another solution such as Vertical Tabs) then we should clear the menu cache after saving timeslot nodes.
- I added and made quick tweaks to description text around the timeslot settings, though I'd love to get some recommendations for alternate text in the long-term.
- Changed the default return value from _cod_session_get_room_slots_types_allowed() to session so that folks don't have to configure these settings for every room and timeslot combination in order to fulfill the most basic scheduling use case: sessions only.
- I filed #1751636: Display human-readable content type names but upon closer code level inspection realized that we're doing:
- In the above section, the Allowed types field uses a uses a statically coded list, so it appears that it won't work with additional schedulable types added to a COD site, such as DrupalCon Core conversations. I would have expected us to re-use the shiny new field_select_ct type for this since it's a reference to content types - What's the reason not to?
- In the short-term, I updated the select list to use human-readable content type names.
- I suggest we use checkboxes rather than a select box for clarity.
- What does the "unscheduled" option mean?
When I visit program/schedule/bofs the actual display used was 'page'. I tried just removing the display check from the condition but then:
$footer = cod_bof_get_bof_link($args[0], $args[1]);-- We don't' have args when we get to program/schedule/bofs so the code fails at this point, and I'm unable to test actual scheduling.So close!
We also need to:
- Remove the old "Birds of a Feather (BoFs) may be scheduled during this time slot" field and other cruft from the previous COD BoF architecture.
- Add validation to the session editing form to enforce the settings introduced in this patch.
General code cleanup:
- cod_session_scheduler_form_submit & API functions would benefit from some comment headers could use more code comments.
- We should remove the print_r's, dsms, etc.
- Watch out for
} else {- Please remember to follow the Drupal coding standards around conditional indentation in order to preserve legibility :).Despite these small issues this is looking great in a big picture sense!
Comment #7
japerryGreat review! haha as you started commenting about everyone one of those I was like, "oh yah note to self--I need to fix that before rolling it out." Thanks for catching them!
The human readable select options is definitely a hack-in-place. When I built that functionality on the plane I didn't quite know where to read the available values from the field. Optimally I think those form values should be created from the field api, but I couldn't figure out what function allows you to insert a form element. Perhaps you know?
I'll take a look at your re-roll and see if any other glaring issues are there. I was debugging right until I pushed this, so I'm pretty sure there are a bunch of error_log, dsms, and print_r's.
One note about the 'pre-view' part. You'll notice that there is a page and a block in bof_schedule view. The page is what shows the bofs, the block is the view field inside the page view. This allows us to loop through field collection entities, and pass an argument to the block display for the room nid to show all the scheduled bofs for the room.
Comment #8
japerryOne issue with this is if someone goes in and specifies a block to be unscheduled (so nothing gets scheduled in that slot), it'll always go back to 'session'. Instead I've made it so it can use the field's default value, which means you can set it to anything from the field, and if none is set, it'll default to nothing. Because we're using checkboxes (much better idea), unscheduled just means none of the checkboxes are marked. (and thus an entity isn't made). If there is no entity, then no schedule type should be scheduled in that timeslot/room Combo.
I've patched the field_select_ct #1751636: Display human-readable content type names to allow human readable names, and its being dynamically fetched.
Comment #9
japerryRe-added a check on bof_schedule footer that makes sure the bof can be scheduled for the combo.
You'll notice when you goto the BoF schedule, that rooms that don't have any BoFs in them, nor should have any, show up in the listing anyway. When I make the view not display if empty, I get a 'Recursion, Stop!' error.
To replicate:
goto: program/schedule/bofs
edit the view
make it so the 'Global: View' is not displayed if empty, and set other fields to be hidden if empty as well.
Save the view
you'll see the 'Recursion, Stop!' error on fields with no data.
Perhaps there is a better way to not show the fields if they're empty?
Comment #10
dsdeiz commentedApplies cleanly on my end but with a few "Trailing whitespace" warnings. Just a note, the modules field_collection and field_select_ct should be enabled first before enabling cod_session and cod_bof or you'll get a bunch of "Base table or view not found:" errors.
Would love to help but I'm not sure where this is set. :D
Comment #11
twardnw commentedPretty slick way to do this.
If we are setting the ability of a time/room to have BoFs on the Room node, do we need it on the time slot any more?
Also, is the scheduler not created yet? I can see the schedule at program/schedule/bofs, but no ability to create through there, and it has the problem from #9 of showing all rooms/times, not jus the BoF enabled ones.
Comment #12
japerrySo close! assigning to me as the next issue to tackle
Comment #13
japerryAlright, so after a lonnnggg day doing a code sprint, I've pretty much turned cod_session and cod_bof upside down on its head.. maybe chopped it off and put a new head.
anyway...
Refactored sessions, bofs, and schedule items to use 'timeslot combos' instead of rooms and timeslots. I was seeing a logic error in validation when we're comparing what a timeslot combo had to what an individual room had. Since you should be building the schedule 'grid' before scheduling items, it makes sense to just reference the time slot.
Consequentially, this takes a lot of cruft out of cod_session.module. There are a bunch of extra views that I don't think we need, and thus I've set them to be disabled by default. For this patch (because I want to roll the alpha asap) I think we should keep this code, and get rid of it in a subsequent patch.
Also, sessions and bofs have the same interface now, basically a cloned view of each other
program/schedule/sessions
program/schedule/bofs
These will act as good starting points for single column schedules. I'm sure this will need some more expansion, but its a start.
Also, you'll need the latest version of cod -- which includes aloha and the commons_wysiwyg modules. We'll start including commons whenever possible to share the workload!
Comment #14
japerryCommitted!
214a343941ff3ae010fc4b5d8c65f017f3970327
If there is a want for the grid back, we should make that a new issue.