From 1ae2116e07c1d6fff4b20a7c9203f6eeb349c4db Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Wed, 4 Feb 2009 14:16:41 -0500 Subject: [PATCH] Remove all traces of categories from kronolith - they are being replaced by tags. Migration script still to come. Also, still need to use tags as the categories in iCalendar. --- kronolith/config/prefs.php.dist | 36 +---------- kronolith/data.php | 15 +---- kronolith/feed/index.php | 1 - kronolith/lib/Block/monthlist.php | 7 +-- kronolith/lib/Block/prevmonthlist.php | 5 +- kronolith/lib/Block/summary.php | 6 +- kronolith/lib/Driver.php | 84 ++++++------------------- kronolith/lib/Driver/kolab.php | 6 -- kronolith/lib/Driver/sql.php | 19 +----- kronolith/lib/Kronolith.php | 7 --- kronolith/lib/Maintenance/Task/purge_events.php | 1 - kronolith/lib/Views/Day.php | 9 --- kronolith/lib/Views/EditEvent.php | 6 +- kronolith/lib/Views/Event.php | 1 - kronolith/lib/Views/Month.php | 5 -- kronolith/lib/Views/Week.php | 12 +--- kronolith/lib/Views/Year.php | 2 - kronolith/lib/base.php | 5 -- kronolith/new.php | 2 +- kronolith/scripts/sql/kronolith.mssql.sql | 1 - kronolith/scripts/sql/kronolith.mysql.sql | 1 - kronolith/scripts/sql/kronolith.oci8.sql | 1 - kronolith/scripts/sql/kronolith.pgsql.sql | 1 - kronolith/scripts/sql/kronolith.sql | 1 - kronolith/scripts/sql/kronolith.xml | 6 -- kronolith/search.php | 6 +- kronolith/templates/common-header.inc | 1 - kronolith/templates/edit/edit.inc | 9 --- kronolith/templates/edit/javascript.inc | 2 - kronolith/templates/search/event_headers.inc | 1 - kronolith/templates/search/event_summaries.inc | 3 +- kronolith/templates/search/search_advanced.inc | 23 ------- kronolith/templates/view/view.inc | 8 --- kronolith/themes/screen.css | 5 -- 34 files changed, 36 insertions(+), 262 deletions(-) diff --git a/kronolith/config/prefs.php.dist b/kronolith/config/prefs.php.dist index 1b8644c3a..6f15323a7 100644 --- a/kronolith/config/prefs.php.dist +++ b/kronolith/config/prefs.php.dist @@ -13,7 +13,7 @@ $prefGroups['view'] = array( 'time_between_days', 'week_start_monday', 'day_hour_start', 'day_hour_end', 'day_hour_force', 'slots_per_hour', 'show_icons', 'show_time', 'show_location', - 'show_legend', 'show_panel', 'show_fb_legend', 'show_shared_side_by_side', 'show_external_colors'), + 'show_panel', 'show_fb_legend', 'show_shared_side_by_side'), ); $prefGroups['summary'] = array( @@ -203,16 +203,6 @@ $_prefs['show_location'] = array( 'desc' => _("Choose the views to show event locations in:"), ); -// show category legend? -// a value of 0 = no, 1 = yes -$_prefs['show_legend'] = array( - 'value' => 1, - 'locked' => false, - 'shared' => false, - 'type' => 'checkbox', - 'desc' => _("Show category legend?"), -); - // show the calendar options panel? // a value of 0 = no, 1 = yes $_prefs['show_panel'] = array( @@ -271,15 +261,6 @@ $_prefs['summary_alarms'] = array( 'desc' => _("Show only events that have an alarm set?"), ); -// show external event colors? -$_prefs['show_external_colors'] = array( - 'value' => 1, - 'locked' => false, - 'shared' => false, - 'type' => 'checkbox', - 'desc' => _("Show external events using category colors?"), -); - // default calendar selection widget $_prefs['shareselect'] = array('type' => 'special'); @@ -458,21 +439,6 @@ $_prefs['fb_cals'] = array( // Free/Busy calendars selector. $_prefs['fb_cals_select'] = array('type' => 'special'); -// The following two preferences are no longer used and only necessary for the -// upgrade script. -$_prefs['event_categories'] = array( - 'value' => '', - 'locked' => false, - 'shared' => false, - 'type' => 'implicit' -); -$_prefs['event_colors'] = array( - 'value' => '', - 'locked' => false, - 'shared' => false, - 'type' => 'implicit' -); - $_prefs['purge_events'] = array( 'value' => 0, 'locked' => false, diff --git a/kronolith/data.php b/kronolith/data.php index 9163c9f3a..556d25ceb 100644 --- a/kronolith/data.php +++ b/kronolith/data.php @@ -59,7 +59,6 @@ $app_fields = array('title' => _("Title"), 'alarm_date' => _("Alarm Date"), 'alarm_time' => _("Alarm Time"), 'description' => _("Description"), - 'category' => _("Category"), 'location' => _("Location"), 'recur_type' => _("Recurrence Type"), 'recur_end_date' => _("Recurrence End Date"), @@ -121,10 +120,9 @@ case 'export': if (is_a($event, 'PEAR_Error')) { continue; } - +//@TODO Tags $row = array(); $row['title'] = $event->getTitle(); - $row['category'] = $event->category; $row['location'] = $event->location; $row['description'] = $event->description; $row['start_date'] = sprintf('%d-%02d-%02d', $event->start->year, $event->start->month, $event->start->mday); @@ -222,11 +220,6 @@ if (!$error) { /* We have a final result set. */ if (is_array($next_step)) { - /* Create a category manager. */ - require_once 'Horde/Prefs/CategoryManager.php'; - $cManager = new Prefs_CategoryManager(); - $categories = $cManager->get(); - $events = array(); $error = false; $max_events = Kronolith::hasPermission('max_events'); @@ -291,12 +284,6 @@ if (is_array($next_step)) { break; } - $category = $event->getCategory(); - if (!empty($category) && !in_array($category, $categories)) { - $cManager->add($category); - $categories[] = $category; - } - if ($max_events !== true) { $num_events++; } diff --git a/kronolith/feed/index.php b/kronolith/feed/index.php index 0bab07681..e3ed10654 100644 --- a/kronolith/feed/index.php +++ b/kronolith/feed/index.php @@ -148,7 +148,6 @@ foreach ($events as $day_events) { $entries[$id]['desc'] = @htmlspecialchars($desc, ENT_COMPAT, NLS::getCharset()); $entries[$id]['url'] = htmlspecialchars(Horde::url($event->getViewUrl(), true, -1)); $entries[$id]['modified'] = $modified->format(DATE_ATOM); - $entries[$id]['category'] = $event->getCategory(); } } $template->set('entries', $entries, true); diff --git a/kronolith/lib/Block/monthlist.php b/kronolith/lib/Block/monthlist.php index c07b820bc..b0af31039 100644 --- a/kronolith/lib/Block/monthlist.php +++ b/kronolith/lib/Block/monthlist.php @@ -86,14 +86,14 @@ class Horde_Block_Kronolith_monthlist extends Horde_Block { return '' . $all_events->getMessage() . ''; } - $html = ''; - /* How many days do we need to check. */ $days = Date_Calc::dateDiff($startDate->mday, $startDate->month, $startDate->year, $endDate->mday, $endDate->month, $endDate->year); /* Loop through the days. */ $totalevents = 0; + + $html = ''; for ($i = 0; $i < $days; ++$i) { $day = new Kronolith_Day($startDate->month, $today + $i); $date_stamp = $day->dateString(); @@ -149,9 +149,6 @@ class Horde_Block_Kronolith_monthlist extends Horde_Block { $html .= $event->getLocation(); } - $html .= '   ' . - ''; - if ($event->start->compareDate($now) < 0 && $event->end->compareDate($now) > 0) { $html .= ''; diff --git a/kronolith/lib/Block/prevmonthlist.php b/kronolith/lib/Block/prevmonthlist.php index 4d438c083..89d77924f 100644 --- a/kronolith/lib/Block/prevmonthlist.php +++ b/kronolith/lib/Block/prevmonthlist.php @@ -81,7 +81,7 @@ class Horde_Block_Kronolith_prevmonthlist extends Horde_Block { return '' . $all_events->getMessage() . ''; } - $html = ''; + $html = ''; /* How many days do we need to check. */ $days = Date_Calc::dateDiff($startDate->mday, $startDate->month, $startDate->year, @@ -141,9 +141,6 @@ class Horde_Block_Kronolith_prevmonthlist extends Horde_Block { $html .= $event->getLocation(); } - $html .= '   ' . - ''; - if ($event->start->compareDate($startDate) < 0 && $event->end->compareDate($startDate) > 0) { $html .= ''; diff --git a/kronolith/lib/Block/summary.php b/kronolith/lib/Block/summary.php index a3a1ac874..8492ca574 100644 --- a/kronolith/lib/Block/summary.php +++ b/kronolith/lib/Block/summary.php @@ -60,7 +60,6 @@ class Horde_Block_Kronolith_summary extends Horde_Block { global $registry, $prefs; require_once dirname(__FILE__) . '/../base.php'; require_once KRONOLITH_BASE . '/lib/Day.php'; - require_once 'Horde/Prefs/CategoryManager.php'; Horde::addScriptFile('tooltip.js', 'horde', true); @@ -174,9 +173,6 @@ class Horde_Block_Kronolith_summary extends Horde_Block { $html .= ''; } - $html .= '   ' . - ''; - if ($event_active) { $html .= ''; } @@ -193,7 +189,7 @@ class Horde_Block_Kronolith_summary extends Horde_Block { return '' . _("No events to display") . ''; } - return '' . $html . '
'; + return '' . $html . '
'; } } diff --git a/kronolith/lib/Driver.php b/kronolith/lib/Driver.php index 5e05acf92..27c57272b 100644 --- a/kronolith/lib/Driver.php +++ b/kronolith/lib/Driver.php @@ -144,9 +144,7 @@ class Kronolith_Driver { (empty($query->description) || stristr($event->getDescription(), $query->description)) && (empty($query->creatorID) || - stristr($event->getCreatorID(), $query->creatorID)) && - (!isset($query->category) || - $event->getCategory() == $query->category) && + stristr($event->getCreatorID(), $query->creatorID)) && (!isset($query->status) || $event->getStatus() == $query->status)) { $results[] = $event; @@ -325,13 +323,6 @@ class Kronolith_Event { var $title = ''; /** - * The category of this event. - * - * @var string - */ - var $category = ''; - - /** * The location this event occurs at. * * @var string @@ -647,10 +638,11 @@ class Kronolith_Event { if (!empty($this->description)) { $vEvent->setAttribute('DESCRIPTION', $v1 ? $this->description : String::convertCharset($this->description, NLS::getCharset(), 'utf-8')); } - $categories = $this->getCategory(); - if (!empty($categories)) { - $vEvent->setAttribute('CATEGORIES', $v1 ? $categories : String::convertCharset($categories, NLS::getCharset(), 'utf-8')); - } +//@TODO: Tags -> iCal +// $categories = $this->getCategory(); +// if (!empty($categories)) { +// $vEvent->setAttribute('CATEGORIES', $v1 ? $categories : String::convertCharset($categories, NLS::getCharset(), 'utf-8')); +// } if (!empty($this->location)) { $vEvent->setAttribute('LOCATION', $v1 ? $this->location : String::convertCharset($this->location, NLS::getCharset(), 'utf-8')); } @@ -840,24 +832,25 @@ class Kronolith_Event { $this->_sequence = $seq; } - // Title, category and description. + // Title, tags and description. $title = $vEvent->getAttribute('SUMMARY'); if (!is_array($title) && !is_a($title, 'PEAR_Error')) { $this->setTitle($title); } - $categories = $vEvent->getAttribute('CATEGORIES'); - if (!is_array($categories) && !is_a($categories, 'PEAR_Error')) { - // The CATEGORY attribute is delimited by commas, so split - // it up. - $categories = explode(',', $categories); - - // We only support one category per event right now, so - // arbitrarily take the last one. - foreach ($categories as $category) { - $this->setCategory($category); - } - } +// @TODO iCal -> Tags +// $categories = $vEvent->getAttribute('CATEGORIES'); +// if (!is_array($categories) && !is_a($categories, 'PEAR_Error')) { +// // The CATEGORY attribute is delimited by commas, so split +// // it up. +// $categories = explode(',', $categories); +// +// // We only support one category per event right now, so +// // arbitrarily take the last one. +// foreach ($categories as $category) { +// $this->setCategory($category); +// } +// } $desc = $vEvent->getAttribute('DESCRIPTION'); if (!is_array($desc) && !is_a($desc, 'PEAR_Error')) { $this->setDescription($desc); @@ -1083,14 +1076,6 @@ class Kronolith_Event { if (!empty($hash['description'])) { $this->setDescription($hash['description']); } - if (!empty($hash['category'])) { - global $cManager; - $categories = $cManager->get(); - if (!in_array($hash['category'], $categories)) { - $cManager->add($hash['category']); - } - $this->setCategory($hash['category']); - } if (!empty($hash['location'])) { $this->setLocation($hash['location']); } @@ -1567,26 +1552,6 @@ class Kronolith_Event { } /** - * Returns the category of this event. - * - * @return string The category of this event. - */ - function getCategory() - { - return $this->category; - } - - /** - * Sets the category of this event. - * - * @param string $category The category of this event. - */ - function setCategory($category) - { - $this->category = $category; - } - - /** * Returns the location this event occurs at. * * @return string The location of this event. @@ -1780,15 +1745,6 @@ class Kronolith_Event { $this->setLocation(Util::getFormData('location', $this->location)); $this->setPrivate(Util::getFormData('private')); - // Category. - if ($new_category = Util::getFormData('new_category')) { - $new_category = $cManager->add($new_category); - $category = $new_category ? $new_category : ''; - } else { - $category = Util::getFormData('category', $this->category); - } - $this->setCategory($category); - // Status. $this->setStatus(Util::getFormData('status', $this->status)); diff --git a/kronolith/lib/Driver/kolab.php b/kronolith/lib/Driver/kolab.php index d41d7bef9..3124cf9c4 100644 --- a/kronolith/lib/Driver/kolab.php +++ b/kronolith/lib/Driver/kolab.php @@ -479,7 +479,6 @@ class Kronolith_Driver_kolab_wrapper_old extends Kronolith_Driver_kolab_wrapper $this->_kolab->setStr('summary', $event->getTitle()); $this->_kolab->setStr('body', $event->getDescription()); - $this->_kolab->setStr('categories', $event->getCategory()); $this->_kolab->setStr('location', $event->getLocation()); if ($event->isPrivate()) { $this->_kolab->setStr('sensitivity', 'private'); @@ -769,7 +768,6 @@ class Kronolith_Event_kolab_old extends Kronolith_Event { $this->title = $kolab->getStr('summary'); $this->description = $kolab->getStr('body'); $this->location = $kolab->getStr('location'); - $this->category = $kolab->getStr('categories'); $class = String::lower($kolab->getStr('sensitivity')); if ($class == 'private' || $class == 'confidential') { @@ -1429,9 +1427,6 @@ class Kronolith_Event_kolab_new extends Kronolith_Event { if (isset($event['location'])) { $this->location = $event['location']; } - if (isset($event['categories'])) { - $this->category = $event['categories']; - } if (isset($event['sensitivity']) && ($event['sensitivity'] == 'private' || $event['sensitivity'] == 'confidential')) { @@ -1541,7 +1536,6 @@ class Kronolith_Event_kolab_new extends Kronolith_Event { $event['summary'] = $this->title; $event['body'] = $this->description; $event['location'] = $this->location; - $event['categories'] = $this->category; if ($this->isPrivate()) { $event['sensitivity'] = 'private'; diff --git a/kronolith/lib/Driver/sql.php b/kronolith/lib/Driver/sql.php index 56cd70207..6b13ebd87 100644 --- a/kronolith/lib/Driver/sql.php +++ b/kronolith/lib/Driver/sql.php @@ -132,15 +132,6 @@ class Kronolith_Driver_sql extends Kronolith_Driver { $cond .= $binds; } } - if (isset($query->category)) { - $binds = Horde_SQL::buildClause($this->_db, 'event_category', '=', $this->convertToDriver($query->category), true); - if (is_array($binds)) { - $cond .= $binds[0] . ' AND '; - $values = array_merge($values, $binds[1]); - } else { - $cond .= $binds; - } - } if (isset($query->status)) { $binds = Horde_SQL::buildClause($this->_db, 'event_status', '=', $query->status, true); if (is_array($binds)) { @@ -278,7 +269,7 @@ class Kronolith_Driver_sql extends Kronolith_Driver { { $q = 'SELECT event_id, event_uid, event_description, event_location,' . ' event_private, event_status, event_attendees,' . - ' event_title, event_category, event_recurcount,' . + ' event_title, event_recurcount,' . ' event_recurtype, event_recurenddate, event_recurinterval,' . ' event_recurdays, event_start, event_end, event_allday,' . ' event_alarm, event_alarm_methods, event_modified,' . @@ -375,7 +366,7 @@ class Kronolith_Driver_sql extends Kronolith_Driver { $query = 'SELECT event_id, event_uid, event_description,' . ' event_location, event_private, event_status, event_attendees,' . - ' event_title, event_category, event_recurcount,' . + ' event_title, event_recurcount,' . ' event_recurtype, event_recurenddate, event_recurinterval,' . ' event_recurdays, event_start, event_end, event_allday,' . ' event_alarm, event_alarm_methods, event_modified,' . @@ -416,7 +407,7 @@ class Kronolith_Driver_sql extends Kronolith_Driver { { $query = 'SELECT event_id, event_uid, calendar_id, event_description,' . ' event_location, event_private, event_status, event_attendees,' . - ' event_title, event_category, event_recurcount,' . + ' event_title, event_recurcount,' . ' event_recurtype, event_recurenddate, event_recurinterval,' . ' event_recurdays, event_start, event_end, event_allday,' . ' event_alarm, event_alarm_methods, event_modified,' . @@ -926,9 +917,6 @@ class Kronolith_Event_sql extends Kronolith_Event { } } - if (isset($SQLEvent['event_category'])) { - $this->category = $driver->convertFromDriver($SQLEvent['event_category']); - } if (isset($SQLEvent['event_location'])) { $this->location = $driver->convertFromDriver($SQLEvent['event_location']); } @@ -962,7 +950,6 @@ class Kronolith_Event_sql extends Kronolith_Event { $this->_properties['event_creator_id'] = $driver->convertToDriver($this->getCreatorId()); $this->_properties['event_title'] = $driver->convertToDriver($this->title); $this->_properties['event_description'] = $driver->convertToDriver($this->getDescription()); - $this->_properties['event_category'] = $driver->convertToDriver((string)String::substr($this->getCategory(), 0, 80)); $this->_properties['event_location'] = $driver->convertToDriver($this->getLocation()); $this->_properties['event_private'] = (int)$this->isPrivate(); $this->_properties['event_status'] = $this->getStatus(); diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 7bd76144a..2b196c01c 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -1077,7 +1077,6 @@ class Kronolith { 'description' => $task['desc'], 'start' => $task['due'], 'end' => $task['due'], - 'category' => $task['category'], 'params' => array('task' => $task['task_id'], 'tasklist' => $task['tasklist_id'])); } @@ -1104,12 +1103,6 @@ class Kronolith { } $event = &$kronolith_driver->getEvent(); - - if ($GLOBALS['prefs']->getValue('show_external_colors') && - isset($eventsListItem['category'])) { - $event->category = $eventsListItem['category']; - } - $event->eventID = '_' . $api . $eventsListItem['id']; $event->external = $api; $event->external_params = $eventsListItem['params']; diff --git a/kronolith/lib/Maintenance/Task/purge_events.php b/kronolith/lib/Maintenance/Task/purge_events.php index 0dfb8774c..2d9f7e65f 100644 --- a/kronolith/lib/Maintenance/Task/purge_events.php +++ b/kronolith/lib/Maintenance/Task/purge_events.php @@ -37,7 +37,6 @@ class Maintenance_Task_purge_events extends Maintenance_Task { $query = &$kronolith_driver->getEvent(); $query->start = null; $query->end = $del_time; - $query->category = null; $query->status = null; $query->calendars = array_keys($calendars); $query->creatorID = Auth::getAuth(); diff --git a/kronolith/lib/Views/Day.php b/kronolith/lib/Views/Day.php index 1dccef9d5..1bba08c3d 100644 --- a/kronolith/lib/Views/Day.php +++ b/kronolith/lib/Views/Day.php @@ -93,8 +93,6 @@ class Kronolith_View_Day extends Kronolith_Day { } echo ''; - $eventCategories = array(); - if ($addLinks) { $newEventUrl = Util::addParameter( 'new.php', @@ -127,10 +125,6 @@ class Kronolith_View_Day extends Kronolith_Day { // We have not printed every all day event yet. Put one // into this row. $event = $this->_all_day_events[$cid][$k]; - if ($event->hasPermission(PERMS_READ)) { - $eventCategories[$event->getCategory()] = true; - } - $row .= 'getCSSColors() . 'width="' . round(90 / count($this->_currentCalendars)) . '%" ' @@ -235,9 +229,6 @@ class Kronolith_View_Day extends Kronolith_Day { ($day_hour_force && $i == $day_hour_start && $event->start->compareDateTime($start) < 0)) { - if ($event->hasPermission(PERMS_READ)) { - $eventCategories[$event->getCategory()] = true; - } // Store the nodes that we're covering for // this event in the coverage graph. diff --git a/kronolith/lib/Views/EditEvent.php b/kronolith/lib/Views/EditEvent.php index 45abb4552..3a6fb8d05 100644 --- a/kronolith/lib/Views/EditEvent.php +++ b/kronolith/lib/Views/EditEvent.php @@ -74,17 +74,17 @@ class Kronolith_View_EditEvent { (!empty($GLOBALS['conf']['hooks']['permsdenied']) || Kronolith::hasPermission('max_events') === true || Kronolith::hasPermission('max_events') > Kronolith::countEvents())) { - $buttons[] = ''; + $buttons[] = ''; } else { if (!$this->event->isRemote()) { - $buttons[] = ''; + $buttons[] = ''; } if ($this->event->isInitialized()) { if (!$this->event->recurs() && (!empty($conf['hooks']['permsdenied']) || Kronolith::hasPermission('max_events') === true || Kronolith::hasPermission('max_events') > Kronolith::countEvents())) { - $buttons[] = ''; + $buttons[] = ''; } } } diff --git a/kronolith/lib/Views/Event.php b/kronolith/lib/Views/Event.php index 838c90c1b..40938878c 100644 --- a/kronolith/lib/Views/Event.php +++ b/kronolith/lib/Views/Event.php @@ -76,7 +76,6 @@ class Kronolith_View_Event { } $creatorId = $this->event->getCreatorId(); - $category = $this->event->getCategory(); $description = $this->event->getDescription(); $location = $this->event->getLocation(); $private = $this->event->isPrivate() && $creatorId != Auth::getAuth(); diff --git a/kronolith/lib/Views/Month.php b/kronolith/lib/Views/Month.php index c08d490ed..dd7cd3a4d 100644 --- a/kronolith/lib/Views/Month.php +++ b/kronolith/lib/Views/Month.php @@ -136,8 +136,6 @@ class Kronolith_View_Month { require KRONOLITH_TEMPLATES . '/month/head.inc'; } - $eventCategories = array(); - $html = ''; if (!$sidebyside && count($this->_currentCalendars)) { $html .= ''; @@ -203,9 +201,6 @@ class Kronolith_View_Month { if (!empty($this->_events[$date_stamp])) { foreach ($this->_events[$date_stamp] as $event) { if (!$sidebyside || $event->getCalendar() == $id) { - if ($event->hasPermission(PERMS_READ)) { - $eventCategories[$event->getCategory()] = true; - } $html .= '
getCSSColors() . '>' . $event->getLink($date, true, $this->link(0, true)); if ($showTime) { diff --git a/kronolith/lib/Views/Week.php b/kronolith/lib/Views/Week.php index 6fa4c58ed..2cd3d5c27 100644 --- a/kronolith/lib/Views/Week.php +++ b/kronolith/lib/Views/Week.php @@ -127,8 +127,6 @@ class Kronolith_View_Week { $newEventUrl = _("All day"); } - $eventCategories = array(); - $row = ''; for ($j = $this->startDay; $j <= $this->endDay; ++$j) { $row .= '' . ($more_timeslots ? _("All day") : ' ') . '' . @@ -141,10 +139,6 @@ class Kronolith_View_Week { $row .= ' '; } elseif (count($this->days[$j]->_all_day_events[$cid]) > $k) { $event = $this->days[$j]->_all_day_events[$cid][$k]; - if ($event->hasPermission(PERMS_READ)) { - $eventCategories[$event->getCategory()] = true; - } - $row .= 'getCSSColors() . 'width="' . round(99 / count($this->days[$j]->_currentCalendars)) . '%" ' @@ -259,11 +253,7 @@ class Kronolith_View_Week { $event->start->compareDateTime($slot_end) < 0 || $start->compareDateTime($this->days[$j]) == 0) || ($day_hour_force && - $i == $day_hour_start && - $event->start->compareDateTime($start) < 0)) { - if ($event->hasPermission(PERMS_READ)) { - $eventCategories[$event->getCategory()] = true; - } + $i == $day_hour_start)) { // Store the nodes that we're covering for // this event in the coverage graph. diff --git a/kronolith/lib/Views/Year.php b/kronolith/lib/Views/Year.php index 7506b4009..7714f302c 100644 --- a/kronolith/lib/Views/Year.php +++ b/kronolith/lib/Views/Year.php @@ -97,8 +97,6 @@ class Kronolith_View_Year { } $currentCalendars = array(true); - $eventCategories = array(); - foreach ($currentCalendars as $id => $cal) { $cell = 0; for ($day = $startOfView; $day < $startOfView + $daysInView; ++$day) { diff --git a/kronolith/lib/base.php b/kronolith/lib/base.php index 976723a1b..3ec9b2001 100644 --- a/kronolith/lib/base.php +++ b/kronolith/lib/base.php @@ -69,11 +69,6 @@ $notification->attach('status'); require_once KRONOLITH_BASE . '/lib/Kronolith.php'; require_once KRONOLITH_BASE . '/lib/Driver.php'; -/* Categories. */ -require_once 'Horde/Prefs/CategoryManager.php'; -$GLOBALS['cManager'] = new Prefs_CategoryManager(); -$GLOBALS['cManager_fgColors'] = $GLOBALS['cManager']->fgColors(); - /* Start compression, if requested. */ Horde::compressOutput(); diff --git a/kronolith/new.php b/kronolith/new.php index adefdc0a3..fa626c8bb 100644 --- a/kronolith/new.php +++ b/kronolith/new.php @@ -61,7 +61,7 @@ $event->end->correct(); $month = $event->start->month; $year = $event->start->year; -$buttons = array(''); +$buttons = array(''); if (isset($url)) { $cancelurl = $url; } else { diff --git a/kronolith/scripts/sql/kronolith.mssql.sql b/kronolith/scripts/sql/kronolith.mssql.sql index 6f29291ee..a5abdcf69 100644 --- a/kronolith/scripts/sql/kronolith.mssql.sql +++ b/kronolith/scripts/sql/kronolith.mssql.sql @@ -9,7 +9,6 @@ CREATE TABLE kronolith_events ( event_attendees VARCHAR(MAX), event_exceptions VARCHAR(MAX), event_title VARCHAR(255), - event_category VARCHAR(80), event_recurtype INT DEFAULT 0, event_recurinterval INT, event_recurdays INT, diff --git a/kronolith/scripts/sql/kronolith.mysql.sql b/kronolith/scripts/sql/kronolith.mysql.sql index bd29d7031..c5b7a190e 100644 --- a/kronolith/scripts/sql/kronolith.mysql.sql +++ b/kronolith/scripts/sql/kronolith.mysql.sql @@ -9,7 +9,6 @@ CREATE TABLE kronolith_events ( event_attendees TEXT, event_exceptions TEXT, event_title VARCHAR(255), - event_category VARCHAR(80), event_recurtype SMALLINT DEFAULT 0, event_recurinterval SMALLINT, event_recurdays SMALLINT, diff --git a/kronolith/scripts/sql/kronolith.oci8.sql b/kronolith/scripts/sql/kronolith.oci8.sql index 9453141ec..e5788ec35 100644 --- a/kronolith/scripts/sql/kronolith.oci8.sql +++ b/kronolith/scripts/sql/kronolith.oci8.sql @@ -9,7 +9,6 @@ CREATE TABLE kronolith_events ( event_attendees VARCHAR2(4000), event_exceptions VARCHAR2(4000), event_title VARCHAR2(255), - event_category VARCHAR2(80), event_recurtype INT DEFAULT 0, event_recurinterval INT, event_recurdays INT, diff --git a/kronolith/scripts/sql/kronolith.pgsql.sql b/kronolith/scripts/sql/kronolith.pgsql.sql index a96a1ef93..d1924692d 100644 --- a/kronolith/scripts/sql/kronolith.pgsql.sql +++ b/kronolith/scripts/sql/kronolith.pgsql.sql @@ -9,7 +9,6 @@ CREATE TABLE kronolith_events ( event_attendees TEXT, event_exceptions TEXT, event_title VARCHAR(255), - event_category VARCHAR(80), event_recurtype SMALLINT DEFAULT 0, event_recurinterval SMALLINT, event_recurdays SMALLINT, diff --git a/kronolith/scripts/sql/kronolith.sql b/kronolith/scripts/sql/kronolith.sql index a95fa0ca6..2174b3654 100644 --- a/kronolith/scripts/sql/kronolith.sql +++ b/kronolith/scripts/sql/kronolith.sql @@ -9,7 +9,6 @@ CREATE TABLE kronolith_events ( event_attendees TEXT, event_exceptions TEXT, event_title VARCHAR(255), - event_category VARCHAR(80), event_recurtype INT DEFAULT 0, event_recurinterval INT, event_recurdays INT, diff --git a/kronolith/scripts/sql/kronolith.xml b/kronolith/scripts/sql/kronolith.xml index 3dc02ec62..8951c80fa 100644 --- a/kronolith/scripts/sql/kronolith.xml +++ b/kronolith/scripts/sql/kronolith.xml @@ -72,12 +72,6 @@ - event_category - text - 80 - - - event_recurtype integer 0 diff --git a/kronolith/search.php b/kronolith/search.php index 26e907693..d5353c279 100644 --- a/kronolith/search.php +++ b/kronolith/search.php @@ -32,7 +32,7 @@ $search_mode = Util::getFormData('search_mode', 'basic'); if ($search_mode != 'basic') { /* Make a new empty event object with default values. */ $event = &$kronolith_driver->getEvent(); - $event->title = $event->calendars = $event->category = $event->location = + $event->title = $event->calendars = $event->location = $event->status = $event->description = null; /* Set start on today, stop on tomorrow. */ @@ -50,9 +50,6 @@ if ($search_mode != 'basic') { if (isset($q_title)) { /* We're returning from a previous search. */ $event->readForm(); - if ($event->category == '__any') { - $event->category = null; - } if (Util::getFormData('status') == KRONOLITH_STATUS_NONE) { $event->status = null; } @@ -66,7 +63,6 @@ if ($desc || $title) { $event = &$kronolith_driver->getEvent(); $event->setDescription($desc); $event->setTitle($title); - $event->category = null; $event->status = null; $time1 = $_SERVER['REQUEST_TIME']; diff --git a/kronolith/templates/common-header.inc b/kronolith/templates/common-header.inc index 3eee3ee8d..ddae416e0 100644 --- a/kronolith/templates/common-header.inc +++ b/kronolith/templates/common-header.inc @@ -46,7 +46,6 @@ var kronolithPrintLink = ''; <?php echo htmlspecialchars($page_title) ?> - diff --git a/kronolith/templates/edit/edit.inc b/kronolith/templates/edit/edit.inc index 9167eab18..7f7236cb1 100644 --- a/kronolith/templates/edit/edit.inc +++ b/kronolith/templates/edit/edit.inc @@ -5,7 +5,6 @@ - @@ -88,14 +87,6 @@ - - - - - - getSelect('category', $event->getCategory()) ?> - - diff --git a/kronolith/templates/edit/javascript.inc b/kronolith/templates/edit/javascript.inc index 4fb004475..58d120929 100644 --- a/kronolith/templates/edit/javascript.inc +++ b/kronolith/templates/edit/javascript.inc @@ -1,5 +1,3 @@ -getJavaScript('eventform', 'category') ?> -