Resource Reservation plugin for Trac
A Trac plugin and macro to allow for visually planning and reserving the use of resources in your environment, e.g. test machines, consumable test data, etc..., with just one click.
Installation of the plugin adds a new tab named Resource Reservation that leads to a pre-filled Wiki page with the macro already in place.
By default, the macro displays an empty calendar spanning three months in the future, including the current month. You can then:
- Add a new resource, by entering the resource name in the edit box and click Add a Resource
- See who owns a resource in any particular date:
- A white cell indicates the resource is free at a certain date
- A blue cell indicates the resource is reserved by the current user at a certain date
- A red cell indicates some other user has reserved the resource at a certain date. The name of the user can be seen by hovering with the mouse on the cell.
- Reserve the resource for any days in the calendar, by simply clicking on the corresponding table cell => the information is saved in the database on the fly, no need to save the page. The cell will become blue
- Cancel a resource reservation, when it is reserved by you (blue cell), by simply clicking on it again => The cell becomes white again
- Take on a resource reserved by something else (red cell), by simply clicking on the corresponding cell => The cell becomes blue and the resource is immediately assigned to the current user
You can edit the default page, changing the macro default parameters:
- type: you can define any number of resource types by simply providing a different value for this parameter to any instance of the macro. This way, you can plan the use of different types of resources at the same time, with no conflict between them
- period: the number of months, including the current one, to display in the calendar
- title: the title, i.e. descriptive name of the resource type, to be used in the calendar as the header of the resource names column
- override: true or false. It controls whether clicking on an already-reserved resource you will take ownership of it, overriding the previous reservation
All parameters are optional, with the following default values:
- type = defaulttype
- period = 3
- title = Resource
- override = true, meaning that anyone can take on a resource reserved by someone else in any day by clicking on it. A value of false means the current owner must first cancel the reservation before anyone else can take the resource
Or you can add the following snippet in any of your Wiki pages, for example to keep track of multiple resource types in different places.
The following example may be useful to reserve test machines:
Two Trac permissions have been added to control access to the resource reservation features.
- RES_RESERVE_VIEW is needed to view the resource reservations
- RES_RESERVE_MODIFY is needed to reserve resources
Project site: http://sourceforge.net/projects/resreserv4trac/
If you have any issues, create a new ticket.
|#7478||Provide an hourly view||new||normal||normal||enhancement||seccanj||4 years|
For quite some time I've been wanting to add a conference room reservation calendar to my Trac instance. There hasn't been any plugin to provide this, but now this looks to be the closest thing yet!
For a room reservation, we'd need the ability to reserve in a minimum of 30 min increments. So, it appears that day and weekly views would need to be added that provide a more fine grained reservation ability.
Just thought I'd post this as a potential enhancement and see what everyone thinks.
|#7480||Does not work on IE||closed||normal||normal||defect||seccanj||4 years|
Does not work on Internet Explorer, due to a bug ion how I get the target from the mouse event.
|#8464||Project environment upgrade fails with database error||reopened||normal||normal||defect||seccanj||4 years|
I was trying to install the ResourceReservationPlugin on my system running:
Trac: 0.12.2dev-r10313 MySQL: "5.0.75-0ubuntu10.5", client: "5.0.75", thread-safe: 1
Installation goes fine, I managed to enable the plugin, but failed to upgrade the Trac environment:
Trac [/export/trac/my_project]> upgrade use the hashlib module instead resreservation needs to create the db resreservation needs to create the db upgrade_environment resreservation needs to create the db _upgrade_db exception in the database creation OperationalError: (1072, "Key column 'res_from' doesn't exist in table") Trac [/export/trac/my_project]> quit
I checked the database but there were no tables by the name res* .
|#8627||Missing Component||closed||normal||normal||defect||seccanj||4 years|
Resource doesn't load.. tried installing WikiCalendar .. but that fails too missing locale information.
2011-03-21 11:24:05,068 Trac[loader] DEBUG: Loading resreservation from /usr/lib/python2.4/site-packages/ResourceReservation-1.0.1-py2.4.egg 2011-03-21 11:24:05,071 Trac[loader] ERROR: Skipping "resreservation = resreservation": (can't import "ImportError: cannot import name Calendar")
|#8746||Unicode trouble||closed||normal||normal||defect||seccanj||3 years|
First off, nice work, I was looking for this for quite some time!
I did get:
Error: Macro !ResourceReservationList(type=resource,period=3,title=Prüfstand) failed 'unicode' object has no attribute 'month'
Adding some resources and setting reservations works - but only up until reloading the page. Then above failure blocks the macro. Flushing the resreservation table did help. It seems as soon as I enter reservation dates it stops to work. There are unicode characters in german named months if that creates an issue.
hum, I just found some output on the console:
Trac[formatter] ERROR: Macro !ResourceReservationList(type=resource,period=3,title=Prüfstand) failed: Traceback (most recent call last): File "/usr/lib/python2.6/dist-packages/trac/wiki/formatter.py", line 484, in _macro_formatter return macro.process(args, in_paragraph=True) File "/usr/lib/python2.6/dist-packages/trac/wiki/formatter.py", line 180, in process text = self.processor(text) File "/usr/lib/python2.6/dist-packages/trac/wiki/formatter.py", line 167, in _macro_processor text) File "/usr/local/lib/python2.6/dist-packages/ResourceReservation-1.0.3-py2.6.egg/resreservation/macros.py", line 52, in expand_macro return _render_resreservation_list(self.env, req, res_type, period, title, override) File "/usr/local/lib/python2.6/dist-packages/ResourceReservation-1.0.3-py2.6.egg/resreservation/macros.py", line 130, in _render_resreservation_list curr_month = curr_date.month - first_month !AttributeError: 'unicode' object has no attribute 'month'
|#9621||Edit a resource name||new||major||high||enhancement||seccanj||3 years|
It would be useful to add more management capabilities to the plugin. For example, renaming or deleting a specific resource in the list.
|#10046||Using views with different time periods will fail||new||normal||normal||defect||seccanj||2 years|
Editing some items for example in month 4, 5 or 6 using the macro
Error: Macro ResourceReservationList(type=testmachine,period=3,title=Test Machine) failed list index out of range
|#10048||Submit using two macros on one wiki page||new||normal||normal||defect||seccanj||2 years|
When on a wiki page more than one macro with different types is used, p.e.:
=== room1 === [[ResourceReservationList(type=room1,period=3,title=room1,override=false)]] === room2 === [[ResourceReservationList(type=room2,period=3,title=room2,override=false)]]
there will be an error adding a resource:
Download the egg files, ready to be installed, from the project site here.
You can download the source code from here.
The plugin can be installed as usual, from the Trac administration panel, and requires a database upgrade.
At the moment it has been tested only on Trac 0.11.7 and 0.12.2, with Python 2.5 and 2.6.