Administrative Fields for Users and Swimmers

I had a request to support fields that weren’t visible to the end users when they used the system.  I decided to support these “administrative” fields as I have been referring to them by enhancing the optional fields for swimmers and users to be tagged as “user” fields or “administrative” fields.

When a field is defined as “administrative”, only users with WordPress permissions of EDITOR or higher will have the fields visible.  For all other users, they are hidden.  An Admin or Editor can change the value of the field and it will be saved when the user or swimmer data is saved.

The first practical usage of this is with a team that wants to mark registration fees as paid on a per swimmer basis.  Not the sort of thing you would expose to a parent but useful from a logistics perspective.

Both user and administrative fields are available in reports.

wp-SwimTeam v0.1.376 – bug fixes for Add/Register Swimmer

In the build I posted yesterday there were a couple of bugs which prevented the auto-registration feature to work when a swimmer is added.  There was also a bug in the age verification which allowed swimmers outside of the age range to added to the system and then registered for the active season.

If you download v0.1.375 yesterday, you will want to download v0.1.376 and update the plugin.

wp-SwimTeam v0.1.357 available

This morning I uploaded v0.1.357 of the wp-SwimTeam plugin.  You can download it from the download page.  Note the bump of the minor version number from 0 to 1 in this build.

This build completes the changes to the option model for the optional fields for users and swimmers.  In prior builds the optional fields were hard coded at 5 for both swimmers and users and the data was stored as part of the user and swimmer records.  This build allows an administrator to set the number of optional fields for users and swimmers (independently) and offers several new types of optional fields (required and optional URLs and e-mail addresses) and stores optional data in a separate table.

The extent of this change was pretty extensive which is why there hasn’t been a release in almost a month.  Unfortunately the old option data is not migrated to the new table so if you are using optional fields, you may have to re-enter some data.  I had to do this with my own swim team.  It is a nuisance.  The old data is still in the database in the users and swimmers table but not accessed.

This build also fixes numerous GUI nits with messages and guidance, it should all be consistent now although I am sure I have missed something.  It also fixes a bug with age groups when swimmer label prefixes are not being used.

I strongly recommend backing up your database before installing this update!

Reports working again

This afternoon I finished updating the Report Generator so it completely supports the new option model.  Both CSV and HTML reports are working.  Filtering works too but right now only YES-NO optional fields are available as filters.  I am not sure if I will change that or not.

I need to run through some additional testing and then I’ll post a release.  This is enough of a change that I’ll probably bump the revision from 0.0.x to 0.1.x for both the software and database version.

Update on the Option Model

I haven’t posted much for the last couple weeks – I have been very busy at work including a very short notice trip to Stockholm.  I have not had as much time to work on wp-SwimTeam as I had hoped I’d have.  Usually I can get a lot done on the flight home from Europe but not this time.  I had to fly Continental and the plane was packed – not real conducive to getting work done.

Anyway, I am back and have been working on re-implementing how I had handled the optional fields for users and swimmers.  It has always bothered me that I had hard coded five (5) optional fields in – I knew it was wrong but never bothered to work out a better solution.  Before I left for Sweden I implemented a new model which is loosely based on how WordPress handles user meta data.

I had completed the work on the user and swimmer profile aspect of the new option model but the Report Generator was broken as was the ability to export users and swimmers in CSV format.  It turns  out fixing the Report Generator was more involved than I thought it would be but I now have the User portion of it completed and committed to SVN.  Doing the swimmer report should be pretty straight forward, I can reuse most of the code.  The hard part is done, to do it for swimmers is pretty simple.

So what is the downside?  I haven’t figured out a good way to migrate any information currently stored in the old option fields to the new model.  For our swim team I think I am just going to manually re-enter since we have decided to eliminate one of the fields anyway.

On the upside, the new option models allows the site administrator to configure an arbitrary number of extra fields and fields can now be defined as URL, E-mail, Text, Clothing Size, or Yes-No fields.

wp-SwimTeam v0.0.326 available

This afternoon I posted a new version of the wp-SwimTeam plugin to the download page.  This update adds new functionality to the swimmer registration process.  There is also the initial stages of registration fees.  You can define what the registration fee is globally and then override it at the age group level.  There is no support currently for a family discount.

New

If your team has Terms of Use (aka Rules and Regulations) and/or Billing information posted on your web site, you can add the URL(s) to the Registration Options and the link(s) will be displayed on the Registration Form and the user will be required to acknowledge the information via a Check Box.  The MacDolphins needed this for billing purposes.

The other new feature is the addition of e-mail confirmation of registration (and unregistration).  The person performing the action is sent an e-mail as is the list of e-mail addresses set up on the Registration Options tab.

Bug Fixes

A couple of minor form layout items were fixed in this build, nothing of major significance.

wp-SwimTeam v0.0.322 posted

This afternoon I uploaded v0.0.322 of the wp-SwimTeam plugin.

Bug Fixes

  • Permission requirements were wrong – to do much of anything required the user to have Administrator permissions.  It now works as outlined in the earlier post today.
  • Reporting has been fixed to account for an odd database query issue where in some cases, the age group for swimmers would show up as “none”.

Enhancements

  • Registration has been enhanced to support registration fees.  This is still a work in progress.  The fees can be entered but nothing is done with them yet.

Roles and Capabilities for wp-SwimTeam

WordPress has a built in set of Roles and Capabilities.  The wp-SwimTeam plugin makes use of these standard roles and capabilities to allow certain actions to be performed.  At least it is supposed to.  It turns out that when I redesigned the menus to take advantage of the 2.7 Dashboard, I restricted access to all of the menus except the end user capability to users with Administrator privileges.

This is a mistake and this morning I committed a change which will rectify the problem.  The way it is supposed to work is as follows:

  • Subscriber – access to the “Swim Team” end user menu and capability.
  • Author – Subscriber capability plus access to the Report Generators.
  • Editor – Author capability plus access to the Manage menu and capability.
  • Administrator – Author capability plus access to the Options menu.

In theory the Options menu contains items which should be set once and by in large, left alone.  The Management menu contains the items which require regular interaction from one or more users who coordinate the Swim Team.

wp-SwimTeam v0.0.310 available

As I noted in an earlier post, a minor update to the wp-SwimTeam plugin has been posted and is available for download.  This update fixes a the issues I encountered as I worked on the MacDolphins registration.  A couple of them were just dumb mistakes – some hardcoded paths that assumed the plugin path (from before I knew how to determine the plugin path).

While I was fixing the Report Generator I enhanced it – it can now export the primary and secondary contact details but only to the CSV version of the report.  The HTML report will be updated as well in the next day or two.

Note:  Make sure you download and install the phpHtmlLib plugin!  wp-SwimTeam won’t work with it.

CSV Report Bugs

There is a bug in the Report Generator and the Roster CSV export which prevents the CSV file from being sent to the browser for download.  I ran into this with the MacDolphins this morning as I was working on our 2009 Registration.  I have fixed the problem and committed the changes, I will post an update later this afternoon of this evening.