Show only resource calendars on the event form when we are editing a
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 10 Sep 2009 14:27:44 +0000 (10:27 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 29 Sep 2009 20:53:53 +0000 (16:53 -0400)
resource's calendar.

kronolith/templates/edit/edit.inc

index 3a94947..b55d7f6 100644 (file)
     <?php
     $creator = $event->getCreatorId();
     if (!empty($GLOBALS['display_resource_calendars'])) {
+        // We are editing/viewing resource calendars
         foreach ($GLOBALS['display_resource_calendars'] as $cal) {
-            echo $cal;
+            $rd = Kronolith::getDriver('Resource');
+            $rc = $rd->getResource($rd->getResourceIdByCalendar($cal));
             printf('<option value="%s"%s>%s</option>',
-                    htmlspecialchars($cal), '', $cal) . "\n";
+                    htmlspecialchars($cal), '', $rc->name) . "\n";
         }
     } else {
-
+        // Normal view
         foreach ($calendars as $id => $cal) {
             $delegates = array();
             if ($cal->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT, $creator)) {