From a4703c1673eb838b565bd5a416963ade00059eaa Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Fri, 11 Sep 2009 15:09:15 -0400 Subject: [PATCH] Lots of stuff: - Move resource viewing/CRUD related pages to resources/* - Have Kronolith_Resource objects present a Horde_Share_Object-like interface - Remove the Resource link from the menu - put it in the panel under the "Manage My Calendars" link - Various tweaks/corrections --- kronolith/attendees.php | 2 +- kronolith/lib/Driver/Resource.php | 12 +-- kronolith/lib/Event.php | 4 +- kronolith/lib/Forms/CreateResource.php | 46 ++++++++++++ kronolith/lib/Forms/DeleteResource.php | 62 ++++++++++++++++ kronolith/lib/Forms/EditResource.php | 66 ++++++++++++++++ kronolith/lib/Kronolith.php | 7 +- kronolith/lib/Resource/Base.php | 95 ++++++++++++++++++------ kronolith/lib/Resource/Single.php | 16 ++-- kronolith/resources/create.php | 41 ++++++++++ kronolith/resources/delete.php | 53 +++++++++++++ kronolith/resources/edit.php | 61 +++++++++++++++ kronolith/{resources.php => resources/index.php} | 46 +++++++++--- kronolith/templates/attendees/attendees.inc | 4 +- kronolith/templates/calendar_list.php | 20 ----- kronolith/templates/calendar_titles.inc | 2 +- kronolith/templates/edit/edit.inc | 2 +- kronolith/templates/panel.inc | 3 +- 18 files changed, 461 insertions(+), 81 deletions(-) create mode 100644 kronolith/lib/Forms/CreateResource.php create mode 100644 kronolith/lib/Forms/DeleteResource.php create mode 100644 kronolith/lib/Forms/EditResource.php create mode 100644 kronolith/resources/create.php create mode 100644 kronolith/resources/delete.php create mode 100644 kronolith/resources/edit.php rename kronolith/{resources.php => resources/index.php} (52%) diff --git a/kronolith/attendees.php b/kronolith/attendees.php index edd990fdb..d0fce0da0 100644 --- a/kronolith/attendees.php +++ b/kronolith/attendees.php @@ -108,7 +108,7 @@ case 'add': $resources[$newResource] = array( 'attendance' => Kronolith::PART_IGNORE, 'response' => Kronolith::RESPONSE_NONE, - 'name' => $resource->name, + 'name' => $resource->get('name'), ); $_SESSION['kronolith']['resources'] = $resources; diff --git a/kronolith/lib/Driver/Resource.php b/kronolith/lib/Driver/Resource.php index 5034dac2e..6a8f50d70 100644 --- a/kronolith/lib/Driver/Resource.php +++ b/kronolith/lib/Driver/Resource.php @@ -359,9 +359,9 @@ class Kronolith_Driver_Resource extends Kronolith_Driver_Sql */ public function save($resource) { - if ($resource->id) { + if ($resource->getId()) { $query = 'UPDATE kronolith_resources SET resource_name = ?, resource_calendar = ?, resource_category = ? WHERE resource_id = ?'; - $values = array($resource->name, $resource->calendar, $resource->category, $resource->id); + $values = array($resource->get('name'), $resource->get('calendar'), $resource->get('category'), $resource->getId()); $result = $this->_write_db->query($query, $values); if ($result instanceof PEAR_Error) { throw new Horde_Exception($result->getMessage()); @@ -370,7 +370,7 @@ class Kronolith_Driver_Resource extends Kronolith_Driver_Sql $query = 'INSERT INTO kronolith_resources (resource_id, resource_name, resource_calendar, resource_category)'; $cols_values = ' VALUES (?, ?, ?, ?)'; $id = $this->_db->nextId('kronolity_resources'); - $values = array($id, $resource->name, $resource->calendar, $resource->category); + $values = array($id, $resource->get('name'), $resource->get('calendar'), $resource->get('category')); $result = $this->_write_db->query($query . $cols_values, $values); if (!($result instanceof PEAR_Error)) { return true; @@ -391,18 +391,18 @@ class Kronolith_Driver_Resource extends Kronolith_Driver_Sql */ public function delete($resource) { - if (!$resource->calendar || !$resource->id) { + if (!$resource->get('calendar') || !$resource->getId()) { var_dump($resource); throw new Horde_Exception(_("Resource not valid.")); } $query = 'DELETE FROM ' . $this->_params['table'] . ' WHERE calendar_id = ?'; - $result = $this->_write_db->query($query, array($resource->calendar)); + $result = $this->_write_db->query($query, array($resource->get('calendar'))); if ($result instanceof PEAR_Error) { throw new Horde_Exception($result->getMessage()); } $query = 'DELETE FROM kronolith_resources WHERE resource_id = ?'; - $result = $this->_write_db->query($query, array($resource->id)); + $result = $this->_write_db->query($query, array($resource->getId())); if ($result instanceof PEAR_Error) { throw new Horde_Exception($result->getMessage()); } diff --git a/kronolith/lib/Event.php b/kronolith/lib/Event.php index 6ed3a61c3..b6094a6c8 100644 --- a/kronolith/lib/Event.php +++ b/kronolith/lib/Event.php @@ -1552,10 +1552,10 @@ abstract class Kronolith_Event */ public function addResource($resource, $response) { - $this->_resources[$resource->id] = array( + $this->_resources[$resource->getId()] = array( 'attendance' => Kronolith::PART_REQUIRED, 'response' => $response, - 'name' => $resource->name + 'name' => $resource->get('name') ); } diff --git a/kronolith/lib/Forms/CreateResource.php b/kronolith/lib/Forms/CreateResource.php new file mode 100644 index 000000000..0e15600e7 --- /dev/null +++ b/kronolith/lib/Forms/CreateResource.php @@ -0,0 +1,46 @@ + + * @author Michael J. Rubinsky + * @package Kronolith + */ +class Kronolith_CreateResourceForm extends Horde_Form { + + function Kronolith_CreateResourceForm(&$vars) + { + parent::Horde_Form($vars, _("Create Resource")); + + $this->addVariable(_("Name"), 'name', 'text', true); + $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60)); + $this->addVariable(_("Category"), 'category', 'text', false); + $this->setButtons(array(_("Create"))); + } + + function execute() + { + $new = array('name' => $this->_vars->get('name'), + 'category' =>$this->_vars->get('category')); + + $resource = new Kronolith_Resource_Single($new); + return $results = Kronolith::addResource($resource); + } + +} diff --git a/kronolith/lib/Forms/DeleteResource.php b/kronolith/lib/Forms/DeleteResource.php new file mode 100644 index 000000000..6754697b4 --- /dev/null +++ b/kronolith/lib/Forms/DeleteResource.php @@ -0,0 +1,62 @@ + + * @package Kronolith + */ +class Kronolith_DeleteResourceForm extends Horde_Form { + + /** + * Calendar being deleted + */ + var $_calendar; + + function Kronolith_DeleteResourceForm(&$vars, &$resource) + { + $this->_resource = &$resource; + parent::Horde_Form($vars, sprintf(_("Delete %s"), $resource->get('name'))); + + $this->addHidden('', 'c', 'text', true); + $this->addVariable(sprintf(_("Really delete the resource \"%s\"? This cannot be undone and all data on this resource will be permanently removed."), $this->_resource->get('name')), 'desc', 'description', false); + + $this->setButtons(array(_("Delete"), _("Cancel"))); + } + + function execute() + { + // If cancel was clicked, return false. + if ($this->_vars->get('submitbutton') == _("Cancel")) { + return false; + } + + if (!($this->_resource->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE))) { + return PEAR::raiseError(_("Permission denied")); + } + + // Delete the resource. + $result = Kronolith::getDriver('Resource')->delete($this->_resource); + if ($result instanceof PEAR_Error) { + return PEAR::raiseError(sprintf(_("Unable to delete \"%s\": %s"), $this->_resource->get('name'), $result->getMessage())); + } + + return true; + } + +} diff --git a/kronolith/lib/Forms/EditResource.php b/kronolith/lib/Forms/EditResource.php new file mode 100644 index 000000000..4ca875f6c --- /dev/null +++ b/kronolith/lib/Forms/EditResource.php @@ -0,0 +1,66 @@ + + * @package Kronolith + */ +class Kronolith_EditResourceForm extends Horde_Form { + + /** + * Calendar being edited + */ + var $_resource; + + function Kronolith_EditResourceForm(&$vars, &$resource) + { + $this->_resource = &$resource; + parent::Horde_Form($vars, sprintf(_("Edit %s"), $resource->get('name'))); + + $this->addHidden('', 'c', 'text', true); + $this->addVariable(_("Name"), 'name', 'text', true); + $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60)); + $this->addVariable(_("Category"), 'category', 'text', false); + $this->setButtons(array(_("Save"))); + } + + function execute() + { + $original_name = $this->_resource->get('name'); + $new_name = $this->_vars->get('name'); + $this->_resource->set('name', $new_name); + $this->_resource->set('description', $this->_vars->get('description')); + $this->_resource->set('category', $this->_vars->get('category')); + if ($original_name != $new_name) { + $result = Kronolith::getDriver()->rename($original_name, $new_name); + if (is_a($result, 'PEAR_Error')) { + return PEAR::raiseError(sprintf(_("Unable to rename \"%s\": %s"), $original_name, $result->getMessage())); + } + } + + $result = $this->_resource->save(); + if (is_a($result, 'PEAR_Error')) { + return PEAR::raiseError(sprintf(_("Unable to save resource \"%s\": %s"), $new_name, $result->getMessage())); + } + + return $this->_resource; + + } + +} diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index af832c798..539524bbe 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -1548,7 +1548,7 @@ class Kronolith foreach ($event->getResources() as $id => $resource) { if ($resource['response'] == Kronolith::RESPONSE_DECLINED) { $r = Kronolith::getDriver('Resource')->getResource($id); - $declined[] = $r->name; + $declined[] = $r->get('name'); } } if (count($declined)) { @@ -2008,9 +2008,6 @@ class Kronolith $menu->add(Horde::applicationUrl('data.php'), _("_Import/Export"), 'data.png', $registry->getImageDir('horde')); } - /* Resources */ - $menu->add(Horde::applicationUrl('resources.php'), _("Resources"), 'resource.png'); - return $menu; } @@ -2047,7 +2044,7 @@ class Kronolith { // Create a new calendar id. $calendar = 'resource_' . hash('md5', microtime()); - $resource->calendar = $calendar; + $resource->set('calendar', $calendar); $driver = Kronolith::getDriver('Resource'); return $driver->save($resource); diff --git a/kronolith/lib/Resource/Base.php b/kronolith/lib/Resource/Base.php index e3a4b2459..0e6661cc8 100644 --- a/kronolith/lib/Resource/Base.php +++ b/kronolith/lib/Resource/Base.php @@ -1,13 +1,39 @@ _id = $params['id']; } + array_merge($params, array('description' => '', + 'category' => '')); $this->_params = $params; } /** + * Obtain the resource's internal id. * - * Properties: - * name - Display name of resource. - * calendar - The calendar associated with this resource. - * category - The category of this resource...an arbitrary label used - * to group multiple resources for the resource_group implementation - * properties - any other properties this resource may have? - * (max capacity of room, size of TV, whatever...) - * probably just for display, not sure how this would work - * if we wanted to be able to search since we are implementing these generically. - * Don't think we want a datatree-style attirbutes table for this. + * @return integer The id. */ - public function __get($property) + public function getId() { - if ($property == 'id') { - return $this->_id; - } + return $this->_id; + } - $property = str_replace('resource_', '', $property); - if (isset($this->_params[$property])) { - return $this->_params[$property]; - } else { - throw new Horde_Exception(sprintf(_("Invalid property, %s, requested in Kronolith_Resource"), $property)); + /** + * Allow setting of the name and category properties. + * + * @param string $property The property to set + * @param mixed $value The value to set to + * + * @return void + */ + public function set($property, $value) + { + if (in_array($property, array('name', 'category', 'calendar'))) { + $this->_params[$property] = $value; } } /** * @TODO: need to fine tune this * - * - * * @param $user * @param $permission * @param $restrict @@ -72,13 +96,36 @@ abstract class Kronolith_Resource_Base */ public function get($property) { - return $this->{$property}; + $property = str_replace('resource_', '', $property); + return !empty($this->_params[$property]) ? $this->_params[$property] : false; } + /** + * Save resource to storage. + */ + public function save() + { + $d = $this->getDriver(); + return $d->save($this); + } + /** + * Get a storage driver instance for the resource. For now, just instantiate + * it here, in future, probably inject it in the const'r. + * + * @return Kronolith_Driver_Resource + */ + public function getDriver() + { + if (!$this->get('calendar')) { + return Kronolith::getDriver('Resource'); + } else { + return Kronolith::getDriver('Resource', $this->get('calendar')); + } + } /** - * Should this take an event, or a time range? + * Determine if event is free for specified time * * @param $startTime * @param $endTime diff --git a/kronolith/lib/Resource/Single.php b/kronolith/lib/Resource/Single.php index d0a15fbd7..c8e181819 100644 --- a/kronolith/lib/Resource/Single.php +++ b/kronolith/lib/Resource/Single.php @@ -23,7 +23,7 @@ class Kronolith_Resource_Single extends Kronolith_Resource_Base public function isFree($event) { /* Fetch events. */ - $busy = Kronolith::listEvents($event->start, $event->end, array($this->calendar)); + $busy = Kronolith::listEvents($event->start, $event->end, array($this->get('calendar'))); if ($busy instanceof PEAR_Error) { throw new Horde_Exception($busy->getMessage()); } @@ -64,11 +64,11 @@ class Kronolith_Resource_Single extends Kronolith_Resource_Base public function addEvent($event) { /* Get a driver for this resource's calendar */ - $driver = Kronolith::getDriver('Resource', $this->calendar); + $driver = Kronolith::getDriver('Resource', $this->get('calendar')); /* Make sure it's not already attached. */ $uid = $event->getUID(); - $existing = $driver->getByUID($uid, array($this->calendar)); + $existing = $driver->getByUID($uid, array($this->get('calendar'))); if (!($existing instanceof PEAR_Error)) { /* Already attached, just update */ $existing->fromiCalendar($event->toiCalendar(new Horde_iCalendar('2.0'))); @@ -77,7 +77,7 @@ class Kronolith_Resource_Single extends Kronolith_Resource_Base } else { /* Create a new event */ $e = $driver->getEvent(); - $e->setCalendar($this->calendar); + $e->setCalendar($this->get('calendar')); $e->fromiCalendar($event->toiCalendar(new Horde_iCalendar('2.0'))); $e->save(); } @@ -91,8 +91,8 @@ class Kronolith_Resource_Single extends Kronolith_Resource_Base */ public function removeEvent($event) { - $driver = Kronolith::getDriver('Resource', $this->calendar); - $re = $driver->getByUID($event->getUID(), array($this->calendar)); + $driver = Kronolith::getDriver('Resource', $this->get('calendar')); + $re = $driver->getByUID($event->getUID(), array($this->get('calendar'))); // Event will only be in the calendar if it's been accepted. This error // should never happen, but put it here as a safeguard for now. if (!($re instanceof PEAR_Error)) { @@ -107,9 +107,9 @@ class Kronolith_Resource_Single extends Kronolith_Resource_Base */ public function getFreeBusy($startstamp = null, $endstamp = null, $asObject = false) { - $vfb = Kronolith_Freebusy::generate($this->calendar, $startstamp, $endstamp, $asObject); + $vfb = Kronolith_Freebusy::generate($this->get('calendar'), $startstamp, $endstamp, $asObject); $vfb->removeAttribute('ORGANIZER'); - $vfb->setAttribute('ORGANIZER', $this->name); + $vfb->setAttribute('ORGANIZER', $this->get('name')); return $vfb; } diff --git a/kronolith/resources/create.php b/kronolith/resources/create.php new file mode 100644 index 000000000..6cdeb6db7 --- /dev/null +++ b/kronolith/resources/create.php @@ -0,0 +1,41 @@ + + */ + +@define('KRONOLITH_BASE', dirname(dirname(__FILE__))); +require_once KRONOLITH_BASE . '/lib/base.php'; +require_once KRONOLITH_BASE . '/lib/Forms/CreateResource.php'; + +// Exit if this isn't an authenticated, administrative user +if (!Horde_Auth::isAdmin()) { + header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true)); + exit; +} + +$vars = Horde_Variables::getDefaultVariables(); +$form = new Kronolith_CreateResourceForm($vars); + +// Execute if the form is valid. +if ($form->validate($vars)) { + $result = $form->execute(); + if (is_a($result, 'PEAR_Error')) { + $notification->push($result, 'horde.error'); + } else { + $notification->push(sprintf(_("The calendar \"%s\" has been created."), $vars->get('name')), 'horde.success'); + } + + header('Location: ' . Horde::applicationUrl('resources/', true)); + exit; +} + +$title = $form->getTitle(); +require KRONOLITH_TEMPLATES . '/common-header.inc'; +require KRONOLITH_TEMPLATES . '/menu.inc'; +echo $form->renderActive($form->getRenderer(), $vars, 'create.php', 'post'); +require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/kronolith/resources/delete.php b/kronolith/resources/delete.php new file mode 100644 index 000000000..e0500c3bd --- /dev/null +++ b/kronolith/resources/delete.php @@ -0,0 +1,53 @@ + + */ + +require_once dirname(__FILE__) . '/../lib/base.php'; +require_once KRONOLITH_BASE . '/lib/Forms/DeleteResource.php'; + +// Exit if this isn't an authenticated administrative user. +if (!Horde_Auth::isAdmin()) { + header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true)); + exit; +} + +$vars = Horde_Variables::getDefaultVariables(); +$d = Kronolith::getDriver('Resource'); +$resource = $d->getResource($vars->get('c')); + +if ($resource instanceof PEAR_Error) { + $notification->push($resoruce, 'horde.error'); + header('Location: ' . Horde::applicationUrl('resources/', true)); + exit; +} elseif (!$resource->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) { + $notification->push(_("You are not allowed to delete this resource."), 'horde.error'); + header('Location: ' . Horde::applicationUrl('resources/', true)); + exit; +} + +$form = new Kronolith_DeleteResourceForm($vars, $resource); + +// Execute if the form is valid (must pass with POST variables only). +if ($form->validate(new Horde_Variables($_POST))) { + $result = $form->execute(); + if ($result instanceof PEAR_Error) { + $notification->push($result, 'horde.error'); + } elseif ($result) { + $notification->push(sprintf(_("The resource \"%s\" has been deleted."), $resource->get('name')), 'horde.success'); + } + + header('Location: ' . Horde::applicationUrl('resources/', true)); + exit; +} + +$title = $form->getTitle(); +require KRONOLITH_TEMPLATES . '/common-header.inc'; +require KRONOLITH_TEMPLATES . '/menu.inc'; +echo $form->renderActive($form->getRenderer(), $vars, 'delete.php', 'post'); +require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/kronolith/resources/edit.php b/kronolith/resources/edit.php new file mode 100644 index 000000000..37306c83c --- /dev/null +++ b/kronolith/resources/edit.php @@ -0,0 +1,61 @@ + + */ + +require_once dirname(__FILE__) . '/../lib/base.php'; +require_once KRONOLITH_BASE . '/lib/Forms/EditResource.php'; + +// Exit if this isn't an authenticated administrative user. +if (!Horde_Auth::isAdmin()) { + header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true)); + exit; +} + +$vars = Horde_Variables::getDefaultVariables(); +$d = Kronolith::getDriver('Resource'); +$resource = $d->getResource($vars->get('c')); + +if ($resource instanceof PEAR_Error) { + $notification->push($resource, 'horde.error'); + header('Location: ' . Horde::applicationUrl('resources/', true)); + exit; +} elseif (!$resource->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) { + $notification->push(_("You are not allowed to change this resource."), 'horde.error'); + header('Location: ' . Horde::applicationUrl('resources/', true)); + exit; +} +$form = new Kronolith_EditResourceForm($vars, $resource); + +// Execute if the form is valid. +if ($form->validate($vars)) { + $original_name = $resource->get('name'); + $result = $form->execute(); + if ($result instanceof PEAR_Error) { + $notification->push($result, 'horde.error'); + } else { + if ($result->get('name') != $original_name) { + $notification->push(sprintf(_("The resource \"%s\" has been renamed to \"%s\"."), $original_name, $resource->get('name')), 'horde.success'); + } else { + $notification->push(sprintf(_("The resource \"%s\" has been saved."), $original_name), 'horde.success'); + } + } + + header('Location: ' . Horde::applicationUrl('resources/', true)); + exit; +} + +$vars->set('name', $resource->get('name')); +$vars->set('description', $resource->get('description')); +$vars->set('category', $resource->get('category')); + +$title = $form->getTitle(); +require KRONOLITH_TEMPLATES . '/common-header.inc'; +require KRONOLITH_TEMPLATES . '/menu.inc'; +echo $form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post'); +require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/kronolith/resources.php b/kronolith/resources/index.php similarity index 52% rename from kronolith/resources.php rename to kronolith/resources/index.php index e64bffaec..cf2339842 100644 --- a/kronolith/resources.php +++ b/kronolith/resources/index.php @@ -3,33 +3,51 @@ * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. */ -require_once dirname(__FILE__) . '/lib/base.php'; +require_once dirname(__FILE__) . '/../lib/base.php'; $title = _("Edit resources"); -$resources = array(); -$resources = Kronolith::listResources((PERMS_DELETE)); -$display_url_base = Horde::applicationUrl('month.php', true, -1); - require KRONOLITH_TEMPLATES . '/common-header.inc'; require KRONOLITH_TEMPLATES . '/menu.inc'; +// Exit if this isn't an authenticated user. +if (!Horde_Auth::getAuth()) { + header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php')); + exit; +} +$edit_url_base = Horde::applicationUrl('resources/edit.php'); +$edit_img = Horde::img('edit.png', _("Edit"), null, $registry->getImageDir('horde')); +$resources = Kronolith::listResources(); +$display_url_base = Horde::applicationUrl('month.php', true, -1); +$delete_url_base = Horde::applicationUrl('resources/delete.php'); +$delete_img = Horde::img('delete.png', _("Delete"), null, $registry->getImageDir('horde')); + ?> +

- -
+ + " />
- + " cellspacing="0" id="calendar-list" class="striped sortable"> + @@ -37,12 +55,20 @@ require KRONOLITH_TEMPLATES . '/menu.inc'; - - + + + + +
 
name) ?>calendar, false); echo Horde::link($url, _("Click or copy this URL to display this calendar"), '', '_blank') . htmlspecialchars(shorten_url($url)) . '' ?> + getId()), _("Delete")) . $delete_img . '' ?> + getId()), _("Edit")) . $edit_img . '' ?> + +  get('name')) ?>get('calendar'), false); echo Horde::link($url, _("Click or copy this URL to display this calendar"), '', '_blank') . htmlspecialchars(shorten_url($url)) . '' ?>
+ - %s', $resource->id, $resource->name) ?> + %s', $resource->getId(), $resource->get('name')) ?> @@ -142,7 +142,7 @@ function switchDateView(view, date)
" /> " /> - " /> + " />

diff --git a/kronolith/templates/calendar_list.php b/kronolith/templates/calendar_list.php index 5ba7267d4..63796e3a1 100644 --- a/kronolith/templates/calendar_list.php +++ b/kronolith/templates/calendar_list.php @@ -57,24 +57,4 @@ - - -

Resources

-" cellspacing="0" class="striped sortable"> - - - - - - - - - - - - - -
 
name ?>url ?>get('calendar')), _("Edit")) . $edit_img . '' ?>
- - diff --git a/kronolith/templates/calendar_titles.inc b/kronolith/templates/calendar_titles.inc index 79495cccf..e3a5fa314 100644 --- a/kronolith/templates/calendar_titles.inc +++ b/kronolith/templates/calendar_titles.inc @@ -7,7 +7,7 @@ if (!empty($GLOBALS['display_resource_calendars'])) { $driver = Kronolith::getDriver('Resource'); foreach ($GLOBALS['display_resource_calendars'] as $c) { $rc = $driver->getResource($driver->getResourceIdByCalendar($c)); - $calendar_names[] = htmlspecialchars($rc->name); + $calendar_names[] = htmlspecialchars($rc->get('name')); } } ?> diff --git a/kronolith/templates/edit/edit.inc b/kronolith/templates/edit/edit.inc index 9dd1e743c..1e1eba902 100644 --- a/kronolith/templates/edit/edit.inc +++ b/kronolith/templates/edit/edit.inc @@ -75,7 +75,7 @@ $rd = Kronolith::getDriver('Resource'); $rc = $rd->getResource($rd->getResourceIdByCalendar($cal)); printf('', - htmlspecialchars($cal), '', $rc->name) . "\n"; + htmlspecialchars($cal), '', $rc->get('name')) . "\n"; } } else { // Normal view diff --git a/kronolith/templates/panel.inc b/kronolith/templates/panel.inc index ea9b4691d..9a4cafe43 100644 --- a/kronolith/templates/panel.inc +++ b/kronolith/templates/panel.inc @@ -48,7 +48,8 @@ $tagger = Kronolith::getTagger();

- +
+

-- 2.11.0