Closed (fixed)
Project:
Station
Version:
5.x-2.x-dev
Component:
Schedule
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 May 2007 at 16:20 UTC
Updated:
9 Dec 2007 at 21:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
drewish commentedyeah that would be good. then all you non-US people would be happy.
Comment #2
shawnc commentedI think I'm looking for a similar fix as joachim...
My reason is that our station has a show that starts at 10pm on Saturday, and runs until 2am on Sunday. The problem I encounter is that the Schedule module won't let me add this show, telling me that the show must "start before it ends". Well yes, of course it must. =P In my 'global' settings within Drupal, my week starts on a Monday. If my station schedule could start on a Monday, that would be great, since 12 midnight Monday morning starts a new block of programming.
Mind you, this would solve my problem, but it doesn't address the real issue. The real issue is that the schedule module needs to have the foresight to recognize that real-world radio station schedules are in a constant weekly loop, and programs may run from the end of Day 1 into the wee hours of Day 2.
Comment #3
drewish commentedshawnc, no arguments, the schedule is dumb. i've got plenty of ideas to fix it but not enough time. any help on this small fix would be much appreciated.
Comment #4
shawnc commentedThanks for your swift reply. We're making a great deal of progress in other directions using the Station module, so this isn't holding us back by any means (though, it would be great to see it fixed). =)
Comment #5
drewish commentedafter looking at the relevant code i think i could adjust the ordering of the days on the weekly schedule but it wouldn't solve shawnc's problem. as has been discussed, his is actually related to the limited way that the schedule is stored on a weekly basis.
Comment #6
joachim commentedHere's a patch...
- sets the weights of the day sections on the schedule node
- makes a rearranged copy of the schedule array prior to it being turned into a table, both for viewing and editing the schedule.
Comment #7
joachim commentedJust realized that I haven't fixed the drop-downs you get to add or edit a schedule item.
Drewish, do you think it needs handling as well?
Oh, and shawnc -- I'll try to look at letting a schedule item wrap round the end of the week for another patch later & file it as a separate issue.
Comment #8
drewish commentedjoachim, it might be best to set the order in dayhour.inc::station_day_name() so that it's correct everywhere.
Comment #9
joachim commentedI don't think it's possible to set the order everywhere just by changing dayhour.inc::station_day_name().
For example, in schedule.module at line 818, the order in which columns are put into the table comes from $node->schedule, so I've got to reorder of that array before the foreach loops on it.
However, ALSO setting the order in dayhour.inc::station_day_name() means that the drop-downs are right :)
I can't make a patch for dayhour.inc, I'm afraid -- CVS gives me the error 'cvs [update aborted]: tag `*' must start with a letter' which is greek to me.
Here's my altered version of station_day_name, in addition to the earlier patch:
Comment #10
drewish commentedah, then i think the correct thing to do would be for station_schedule_load() to put them in the correct order when it loads the node... rather than when we display them.
also try
cvs -dP -Ait should reset all the tags/branches to HEAD.Comment #11
drewish commentedgive this patch for HEAD a test. i'm kind of stoked on how little code needs to be changed to get this working...assuming it's working for you too ;)
Comment #12
joachim commentedYeah, that's pretty slick. It works perfectly for me.
By the way, I had a look at the way the Calendar and Date modules handle the week's start date. In calendar/calendar_api.inc, the function that's sort of equivalent to station_day_name() has a switch on the 'date_first_day' variable, and each case has the array of day names in a the different order... the code isn't not as nice to look at, and I have no idea which method is optimal. Just though I'd mention it though :)
Comment #13
drewish commentedcool, them i'm going to commit it. the one thing i noticed that's a little weird is when adding a program sunday is still chosen as the default.
Comment #14
joachim commentedYeah, noticed that too but figured it was nitpicking :)
Comment #15
techczech commentedsubscribing
Comment #16
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #17
joachim commentedThe other thing that doesn't work is the list of times on a program node.
I'll look at it once I'm back on HEAD.
Comment #18
drewish commentedjoachim, what do you mean that the list of times on the program node don't work? they're in the wrong order?
Comment #19
joachim commentedSuppose a program is on every day of the week. The list on the program node always starts with Sunday -- if we're allowing the site admin to change the order of days on the schedule, perhaps we should change the order of the list here too.
Comment #20
drewish commentedgive this a whirl. it uses some addition and modulo to wrap the entries.
Comment #21
joachim commentedWorks great :)
Comment #22
drewish commentedgreat, committed to HEAD.
Comment #23
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.