Stump the Panel » jQuery for Everyone

Getting the Day View to show hourly event totals...?

(11 posts)
  1. bmix
    Member

    We have a large calendar (we're actually using it as a shift scheduler) that always has many events (usually 30-50) happening simultaneously in the Day View. I've made several CSS mods to clean up the display and make it legible for this many events. We're trying to figure out if there's any way to show a total of how many people are scheduled for a particular hour of the day.

    The best way I can describe this is with an example: Let's say that twelve people are in a meeting from 3pm to 4pm. How would I go about getting the calendar Day View to show a "12" next to the Timeline, between the 3pm and 4pm marks?

    Note: 3rd-party solutions are out for the moment (at least until next year, I'm told). I've tried a raft of self-made and third-party trialware, but none have been able to do this, unless there's something I'm missing. It seems there should be some way to do this with jQuery, but I can't seem to wrap my head around it enough to come up with an answer. Any help is greatly, GREATLY appreciated.

    Posted 1 week ago #
  2. Do you have WSS or MOSS?

    Posted 1 week ago #
  3. bmix
    Member

    We're running WSS 3.0 on Windows Server 2008. MOSS isn't an option at the moment, unless there's something in it that's completely critical to what we're doing. Don't know if it helps or not for this particular solution, but we also have SharePoint Designer and Visual Studio 2008 with all the templates and updates and such.

    I'm using Christophe's famous code snip in a CEWP (for color-coding and such), and also some CSS to shrink the daily events down to thin bars, force them to left-justify, and expand to show event details with a hover event.

    Here's the CSS I'm using, just in case it might interfere with any ideas you may have. I commented the whole block here just in case of any rendering issues:

    /* <style type="text/css">

    .ms-calheader img {width:auto;}
    .ms-cal-nav {display:none;}
    .ms-cal-nav-buttonsltr {display:none;}
    .ms-cal-navheader {padding:0px; spacing:0px;}
    body td {overflow:hidden;}
    .ms-propertysheet th {font-size:7px; font-weight:bold;}
    .ms-cal-dayhour img, .ms-cal-dayhalfhour img, .ms-cal-dayhourF img, .ms-cal-dayhalfhourF img {height:8px;}
    .ms-cal-tdayitem td {font-size:0px; line-height:0px; padding:0px; width:20px; background-image:none;}
    .ms-cal-gempty {width:auto;}
    .ms-cal-tdayitem img {display:none;}
    .ms-cal-tdayitem a {font-size:0px; line-height:0px;}
    .ms-cal-tdayitem a:hover {font-size:10px; line-height:10px;}

    </style> */

    Posted 1 week ago #
  4. bmix,

    Clarification: In your example, are the 12 people associated with a single event or are there 12 events in the calendar?

    Posted 1 week ago #
  5. bmix
    Member

    We're using it as, essentially, a work shift scheduler. Each person has one 8-hour event per day. We're looking at all this in a CSS-modified Day View, so that the events are thin bars going up and down the screen instead of the usual screen-filling day view events. It's amazing how many simultaneous events you can cram into the view in this way.

    So, for a direct answer to the question, there are 12 events (12 stripes on the calendar per day), one for each actual person. What we're trying to do is to figure out a total of how many total people are scheduled during a particular 30-minute time block. Or, in SharePoint terms, how many individual events are scheduled during the time block.

    We can do a manual count by (laugh if you must) holding the edge of a sheet of paper on the screen and counting the events going across the day view. However, with 40-50 events per day and growing, this is almost unworkable now, and is only going to get worse. We've broken it up into separate views by department, so each of THOSE views only have about 10-12 events per day, which helps, but it would still be nice to have the info at a glance, like a total for each time block, rather than holding papers up to the screen and such.

    Something that might help: if there's a way I can do it on the system here, and if it's something you would like, I'd be more than happy to post an image of what we've got now and what I'm trying to do. Let me know, and again, I REALLY appreciate you taking an interest in this. If it weren't for people like you and sites like this, we'd be stumbling around in the dark and stubbing our toes on unpleasant pointy things.

    Posted 1 week ago #
  6. bmix,

    I think we can break this down and come up with a strategy but I need to understand one more piece (thanks for your patience).

    I think getting the "time blocks" to roll up inside the calendar will be more difficult than just summarizing the data elsewhere on the page. However, I don't think it's impossible if that's what you're trying to achieve.

    I assume you're using the Month view (a screenshot may help). There's no simple way to find a specific day on the calendar (by looking at the HTML markup). However, I think I found one. I've noticed that the header cell of the Month-view day has a link with javascript in the HREF attribute. That script (generated dynamically by SP) has an encoded date inside it. These cells also have a tabindex attribute, an integer, which acts like a counter of the days displayed.

    My strategy is to get tabindex #2's date and create an array that predicts the position of the remaining dates mapping their date to a tabindex. Then, using a web service call or my owsapi, do the sums and filtering for each tabindex. The last step is to inject the sum of each tabindex into the header cell (next to the date). Because you don't display more than a month at a time, the performance will be consistent within a certain tolerance for the number of events (a month with one event will process faster than a month with 1000, but there is a practical limit to the number of events you can schedule in a month).

    Now, that will work for rolling up the number of events in a DAY. If you want other categories (8am-5pm, 3pm-12am, 11pm-7am) I would need to know that because it would probably not change. Also, if there are other categories, how are they displayed (I'm guessing on the Month view, they all roll up to the top like so, 17 (4/3/3)).

    Posted 1 week ago #
  7. bmix
    Member

    Actually, I'm using a heavily modified Day View to look at these. In fact, I've got the navigation buttons hidden so you can't see these events in a month view or weekly view; the Day View is all we need for what we're doing.

    It's probably much easier to understand with a screen shot. Here's my attempt. Please let me know if you can't see this, or it won't open:

    http://lh6.ggpht.com/_CgqAAgBFOzc/SiKt9wioFgI/AAAAAAAAABE/mmCLtl368KM/%5BUNSET%5D.jpg?imgmax=800

    This shot is from my development notebook, so it's not populated with "real" data. The colored bars going up and down are the events. In the actual SharePoint window you would be able to hover and get the event details.

    Keep in mind that this screenshot is a work in progress. The empty white space above the calendar itself is just a spare div I was using for something else that I haven't removed yet. The important part is circled in red: The total number of events, broken down by hour. An important thing to note is that in this example, the data in the Totals column are not correct. They're simply numbered sequentially 1,2,3, and on up to 24, just to mark where the actual numbers (ideally) would go. So for the test events that are shown in this window, the Totals column SHOULD read (top to bottom): 1 1 3 3 2 2 and so on, with the number corresponding to the number of events for that half-hour period.

    I've been working on this for about three weeks now off-and-on, and fear I've melted some of the circuitry in my brain (which is out of warranty by about, oh, 35 years) trying to come up with something on this. Thanks again.

    Posted 1 week ago #
  8. @bmix,

    Ok, I think I have enough to take a stab at a script. I worked all day on my prepopulate and hide form fields script, so I may not get to look at this for a day or two.

    Posted 1 week ago #
  9. bmix
    Member

    Wow! I thought you were gonna give me pointers and stuff. But if you're actually _writing_ the thing... I'll bend the laws of physics and fax you a pizza or something.

    Posted 1 week ago #
  10. I posted my solution here:
    http://www.endusersharepoint.com/?p=1719#more-1719

    Try it out and let me know how it goes.

    Posted 6 days ago #
  11. bmix
    Member

    Thanks a bazillion AS! Just got in to work (night shift) and will try this within the next hour or so. I'll report back here to let you know what happens.

    Posted 5 days ago #

RSS feed for this topic

Reply

You must log in to post.