Lots of stuff:
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 11 Sep 2009 19:09:15 +0000 (15:09 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 29 Sep 2009 20:53:59 +0000 (16:53 -0400)
- 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/lib/Kronolith.php
kronolith/lib/Resource/Base.php
kronolith/lib/Resource/Single.php
kronolith/resources/index.php

index a8f4615..0c0c9cf 100644 (file)
@@ -2018,9 +2018,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;
     }
 
index c59091f..29ba9fc 100644 (file)
@@ -12,10 +12,16 @@ abstract class Kronolith_Resource_Base
      *
      *   name        - Display name of resource.
      *   calendar    - The calendar associated with this resource.
+<<<<<<< HEAD
      *
      *   description -
      *   email       -
      *   response_type - a RESPONSETYPE_* constant
+=======
+     *   category    - The category of this resource...an arbitrary label used
+     *                 to group multiple resources for the resource_group implementation
+     *   description -
+>>>>>>> Lots of stuff:
      *
      * @var array
      */
@@ -48,9 +54,15 @@ abstract class Kronolith_Resource_Base
     }
 
     /**
+<<<<<<< HEAD
      * Obtain the resource's internal identifier.
      *
      * @return mixed The id.
+=======
+     * Obtain the resource's internal id.
+     *
+     * @return integer  The id.
+>>>>>>> Lots of stuff:
      */
     public function getId()
     {
index 75f1680..b40e175 100644 (file)
@@ -141,11 +141,9 @@ class Kronolith_Resource_Single extends Kronolith_Resource_Base
         }
     }
 
-<<<<<<< HEAD
     public function getResponseType()
     {
         return $this->get('response_type');
     }
-=======
->>>>>>> Only attempt to remove resources from the event if they have actually
+
 }
\ No newline at end of file
index 9c76043..cf23398 100644 (file)
@@ -17,10 +17,11 @@ if (!Horde_Auth::getAuth()) {
 }
 $edit_url_base = Horde::applicationUrl('resources/edit.php');
 $edit_img = Horde::img('edit.png', _("Edit"), null, $registry->getImageDir('horde'));
-$resources = Kronolith::getDriver('Resource')->listResources(PERMS_READ, array('type' => 'Single'));
+$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'));
+
 ?>
 <script type="text/javascript">
 function performAction(action, rid)
@@ -41,7 +42,6 @@ function performAction(action, rid)
  <form method="get" action="create.php">
   <?php echo Horde_Util::formInput() ?>
   <input type="submit" class="button" value="<?php echo _("Create a new Resource") ?>" />
-  <a class="button" href="<?php echo Horde::applicationUrl('resources/groups') ?>"><?php echo _("Manage Resource Groups")?> </a>
  </form>
 <?php endif ?>
 <table summary="<?php echo _("Resource List") ?>" cellspacing="0" id="calendar-list" class="striped sortable">
@@ -63,7 +63,7 @@ function performAction(action, rid)
   <td>&nbsp;</td>
   <?php endif;?>
   <td><?php echo htmlspecialchars($resource->get('name')) ?></td>
-  <td><?php $url = Horde_Util::addParameter($display_url_base, 'display_cal', $resource->get('calendar'), false); echo Horde::link($url, _("Click or copy this URL to display this calendar")) . htmlspecialchars(shorten_url($url)) . '</a>' ?></td>
+  <td><?php $url = Horde_Util::addParameter($display_url_base, 'display_cal', $resource->get('calendar'), false); echo Horde::link($url, _("Click or copy this URL to display this calendar"), '', '_blank') . htmlspecialchars(shorten_url($url)) . '</a>' ?></td>
  </tr>
 <?php endforeach; ?>
 </tbody>
@@ -84,5 +84,12 @@ function shorten_url($url, $separator = '...', $first_chunk_length = 35, $last_c
 
     return $url;
 }
+/* Test creating a new resource */
+//$new = array('name' => _("Another Big Meeting Room"),
+//             'category' => 'conference rooms');
+//
+//$resource = new Kronolith_Resource_Single($new);
+//$results = Kronolith::addResource($resource);
+//var_dump($results);
 ?>
 </div>
\ No newline at end of file