Progress on Meet Events

Saturday morning I had a little time to work on wp-SwimTeam and started working on managing events for a particular swim meet.  As I had noted in another post, the idea is to import a set of standard events and then tweak them.

For the most part I have it working but now it needs some clean up.  The way WordPress loads up pages means you have to monitor the URL if you need to append GET values to control the flow for the user.  I had to work this out when I implemented to tabbed UI and now will have to do something similar for meet events.  Right now the meet id gets appended to the URI and by repeating a set of actions as you modify meet events, it can end up repeated N number of times.  Once I get that worked out, I think I will be ready to import meet results.

How to handle meet events?

Now that I have the standard events working with drag and drop reordering, I need to propagate events to each meet.  My thinking has been that a meet will start by importing the standard events and then add, delete, edit, and reorder as necessary to support a specific swim meet.

While I have had this model in my head, my first look at actually implementing it raised a bunch of questions – where I do put it?  How does it work?  The event management isn’t as simple as other meet management tasks so it sort of breaks in the way that I implemented the meet data.  I have an idea how to solve it but it will take some experimenting to see if it will work.

Phase 1 of Drag and Drop Event Ordering

Today I got the first part of Ajax based Drag and Drop Event Ordering working.  A few weeks ago when I was skimming the Internet looking for some Ajax tips I found this interesting jQuery demo called Portlets.  You really need to see the example to get the idea of how it works.  When I found it I knew it was exactly what I was looking for to do event order (and hopefully heat sheets at some point).

I finally got some cycles to work on it yesterday and earlier today I got the first phase of it working.  I can display the events to the user and they can drag and drop them to order them however they see fit.  This part of it works as I hoped it would.  Now that it is working, I need to get Ajax handshaking worked out so the database gets updated with the new sort order.  Hopefully that won’t be to difficult but working with this type of Ajax problem is new ground for me.

Drag and Drop Event Ordering

Drag and Drop Event Ordering

Better Solution for Event Ordering

I haven’t made much progress over the last few weeks as I have been working on a project at work which was taking a lot of my free cycles.  Fortunately the project at work also uses phpHtmlLib so some of the work I did for the work project will roll out to this project as well.

Even though I haven’t put a lot of active cycles into wp-SwimTeam, I have been looking for some ideas on how to deal with event ordering better.  Event ordering was one of the last things I checked in and I went back and used it and it is clunky.

I have concluded that Event Ordering and ultimately heat sheet management needs to be AJAX based so drag and drop can be implemented.  I want to implement something similar to this jQuery Portlet demo.  Since I have never done anything with AJAX (other than a Google Maps implementation), this is new ground for me.

Code Cleanup in progress

It is interesting to go back and revisit code which I wrote early in this project.  When  I go back and look at it, I ask myself why I implemented things the way I did.   The change to the  tabbed menu bar has required me to go back and visit almost every page which is presented as a menu to a user of the system.

Some of the early functionality like Age Groups and Seasons had a clunky implementation of the decision tree logic and resulted in processing the same variables to make decisions repeatedly.  I have migrated the code I developed latter on for things like the Roster and Events pages and implemented “Guidance” for all pages as well.

Now that I have all of the code cleaned up, at least I think I have it all done, I need to return to the Events functionality.  I need the ability to add events to a meet and then re-order them.  The standard events can be used to seed the events for a meet and reordering works although it is clunky.  This should probably be done with AJAX so events can be dragged and dropped into the desired order.

More Menu Changes

There has been a lot of discussion on the wp-hackers mailing list about the upcomming 2.7 release of WordPress and the change to the Admin Menus.  I decided to load it up and see how it affected this plugin.  For the most part everything works the way it is supposed to.  I ran into a few oddities which were errors that weren’t obvious until I ran it with 2.7 but everthing worked as it is supposed to.

The big change is the location (left side bar) of the new admin menus and the change in terminology.  The change in terminology takes some getting used to.  We’ll see if it stays as it currently is in the development build or if it changes.  From the Admin perspective, the presentation is different but not markedly so.  From the user perspective, the Swim Team menu doesn’t show up and I am not sure why yet.

I committed a whole bunch of changes I had to make as a result of debugging the 2.7 presentation issues.  So far, all of the changes work as they should on 2.5.1, 2.6 and 2.6.1 as well.  Switching releases (2.6.1 and 2.7) and platforms (Windows and Linux) during development is proving to be a useful thing as it flushes out stuff earlier in the process.

UI Change for wp-SwimTeam

As the Swim Team Dashboard menu has grown I have been thinking of changing how I present the various choices to both the Admin as well as a Subscriber.  While I have thought about it from time to time, I haven’t done anything about it.  I was recently looking for something in the WordPress plugin directory and found something called Lighter Menus.

Lighter Menus changes the Dashboard menus into a set of drop down menus.  It is very similar to Andy Staines’ Admin Dropdown Menus.  Unfortunately, Admin Dropdown Menus really changed with the WP 2.5 release and the author has subsequently stated he will no longer support it.  Lighter Menus looked like it might be a suitable replacement so I decided to give it a try.

I really liked the way Lighter Menus works except for one thing:  The custom Swim Team menu didn’t work right.  The URLs weren’t constructed correctly.  Bummer.  But I really liked the way it looked.  Was this the compelling event to fix the growing Swim Team menu?  The Swim Team menu was really unwieldy when using the standard Dashboard as well.

As I worked on phpHtmlLib I tested all of the examples and I kept coming back to the TabControlWidget thinking it might be a good solution for wp-SwimTeam.  The TabControlWidget is a CSS based solution which presents different content based on which tab is selected.

Earlier this week, I decided to try it and see if it would work.  The implementation turned out to be really simple and I was able to use all of individual page code almost verbatim.  I like this implementation much better and I think it is much, much easier to use.  This decision also let me clean up some of the code which had been duplicated between the Admin and User side and resulted in the elimination of a half a dozen PHP file.

Google Maps problem is fixed!

Last night I fixed the Google Maps problem by re-coding the way I was getting the data from Google.  I had been using a class called Phoogle but have eliminated it in favor of a direct AJAX solution using Google’s AJAX API.

Instead of embedding this new solution in the wp-SwimTeam plugin, I implemented as a widget in phpHtmlLib.  It works pretty well too!