Rather than repeating the event info for each day that a multiple day event spans (such as a conference), it would be great if there were a single description per week (in the week or month view) and a narrow horizontal bar that spanned the days. This would more accurately present the event and take up less real estate.

Thanks.

Comments

BachusII’s picture

Category: feature » bug

There is a bug on lines 1007, 1012 & 1016 of
// $Id: event.module,v 1.183.2.6 2006/05/22 13:54:07 killes Exp $

On those lines an object ($nid) is placed in an array. (On the preceding line an event_state is set.)
As is, each and every time one of these is set it's the exact same instance of the exact same object. On multi-day events what you expect is start-ongoing-ongoing-end. What you get is end-end-end-end

The fix is to clone the object each time.

  $data[$year][$month][gmdate('j', $x)][] = clone $nid;

 

 

Now, for single bars. in
// $Id: event.theme,v 1.26.2.3 2006/05/22 13:35:07 killes Exp $
On line 157, add the event_state to the class. (Prefix of suffix it with something (anything) otherwise it will clash with another class.)

//  $output .= '<div class="event monthview">'."\n";
    $output .= '<div class="event monthview event_' .$node->event_state. '">'."\n";

The rest is a CSS exercise. The following gets a "worksforme";
(IE may choke on the !important rules.)

/**
 * remove the padding from the table cell (gets set by the default theme)
 */
.event-calendar td {
  padding: 0px !important;
}
/**
 * remove left/right margins and borders where applicable
 */
.event-calendar div.event.monthview.event_start {
  margin-right: 0em !important;
  border-right: none;
}
.event-calendar div.event.monthview.event_ongoing {
  margin-left: 0em !important;
  margin-right: 0em !important;
  border-left: none;
  border-right: none;
}
.event-calendar div.event.monthview.event_end {
  margin-left: 0em !important;
  border-left: none;
}
/**
 * Hide node type, node title, links? and "all day" message
 * display:none also works, but setting visibility keeps the height of the box in line with the others.
 */
.event-calendar div.event.monthview.event_ongoing  div.type,
.event-calendar div.event.monthview.event_ongoing  div.title,
.event-calendar div.event.monthview.event_ongoing  div.ongoing,
.event-calendar div.event.monthview.event_ongoing  div.links,
.event-calendar div.event.monthview.event_end  div.type,
.event-calendar div.event.monthview.event_end  div.title,
.event-calendar div.event.monthview.event_end  div.links {
  visibility: hidden;
}
/**
 * Make everything less wide to save horizontal real estate.
 *
 * The "all day" message (div.ongoing) is omitted here, for some reason it insists on wrapping.
 * I'm too lazy to check.
 */
.event-calendar div.event.monthview.event_ongoing div.type,
.event-calendar div.event.monthview.event_ongoing div.title,
.event-calendar div.event.monthview.event_ongoing div.links,
.event-calendar div.event.monthview.event_end div.type,
.event-calendar div.event.monthview.event_end div.title,
.event-calendar div.event.monthview.event_end div.links {
  width: 1em;
  overflow: hidden !important;
}
BachusII’s picture

/ $Id: event.theme,v 1.26.2.3 2006/05/22 13:35:07 killes Exp $
Line 107

//  $output .= '<div class="event weelview">'."\n";
    $output .= '<div class="event weekview event_' .$node->event_state. '">'."\n";

And you can remove the .event.monthview classes from the CSS selectors.

kloomis’s picture

Thanks. That looks great. I'm looking forward to implementing it.

Ken

kloomis’s picture

The code above is great! Just what I was looking for.

A couple of notes:
The clone fix is required for PHP5 but not PHP4 and below.
See: http://www.hat.net/geeky/php_tricks_-_php_5_clone_in_php4
So, if you're running PHP4 you can leave it alone, it works fine, or use the suggested code at PHP tricks for portability.

Also, just my preference, in the css I removed the title in the event_end from the visiblity:hidden and I removed it from the width: 1em so that the title shows up at the beginning of the event and at the end. I also added a height:2em attribute to monthview.event.ongoing to create a narrow bar for the ongoing sections.

Thanks, again.

BachusII’s picture

Title: Display a single bar for multiple day events » Cloning of object in PHP 5 (was FR "Display a single bar for multiple day events")

This issue was raised again yesterday, see http://drupal.org/node/85972
I thought it prudent to adapt the title of this bug.

The problem remains, in CVS HEAD too.

killes@www.drop.org’s picture

we have a drupal_clone function that works with php 4 and 5. This should be used.

BachusII’s picture

Which would be http://api.drupal.org/api/HEAD/function/drupal_clone

If event.module and event.theme are patched as killes and I suggested, we can turn this issue back to a (closed) feature request.

killes@www.drop.org’s picture

Status: Active » Closed (duplicate)