Create trip and fundraiser content types required for Trip Fund module. These content types will be delivered with the module containing the minimum required fields. The content types may then be extended by the site administrator.

At a minimum, the trip type should contain field_trip_cost to denote the total cost of the trip. Fundraisers don't really have any required fields.

Comments

micahw156’s picture

Status: Active » Needs review
StatusFileSize
new2.65 KB
new814 bytes

Initial configurations for content types are attached.

micahw156’s picture

Status: Needs review » Needs work

Moving this project to Drupal 7 (6cc4306b033d) so we'll be using entities for a lot of things now. It should be easier to manage trips and fundraisers as entities where the mandatory fields can be managed in code, so I need to rethink most of my data structures.

micahw156’s picture

Title: Create minimum required content types for Trip Fund module » Create required entity types for Trip Fund module

Now that we're working in Drupal 7, we'll create entity types to manage the tables we need. By making the entity types fieldable, we'll be able to maintain our required fields while still allowing site owners to add any arbitrary fields they want.

For starters, we still need the two tables defined in #1418410: Database schema planning for Trip Fund, trip_fund_participants and trip_fund_contributions. It appears that the schema definitions for these can remain mostly the same, although I'm going to add a unique assignment_id key for trip_fund_participants. We'll also add a trip_fund_trips entity type that requires at least a trip_id and a trip_cost field to replace the CCK trip content type above.

I'm not sure yet whether we'll want to enforce a fundraiser entity type, or create a setting to specify which content types can be specified as fundraisers for the listings. Maybe that should even be a user-defined entity field and make fundraiser associations totally optional. Let's just get these first three entity types created and working, then worry about fundraisers. It seems like trips, trip-to-participant relationships and contributions are the only mandatory parts here.

Also, I'm thinking about making entities for participants, similar to what happens in the Party module (or making that module a dependency.) That way, participants can be Drupal users, but the won't have to be. Again, let's get the fundamentals working first on this, then worry about getting fancy if time permits.

micahw156’s picture

Status: Needs work » Active

Created database schema for trip_fund_trips, trip_fund_participants and trip_fund_contributions entities. (41905fe)

micahw156’s picture

Added sub-module to manage trip_fund_trips entity type and ability to create new records using it (cd3ef94).

micahw156’s picture

Switched to using Entity API and added Views support. (504b355)

micahw156’s picture

Added ability to create and display trip_fund_participants entities. (f489974)

micahw156’s picture

Added ability to create and display trip_fund_contributions entities. (aed38cf)

micahw156’s picture

Version: 7.x-1.x-dev »

Next task:

I need to add fields to trip_fund_contributions entity for uid and trip_id. These can be derived from the stored trip_fund_participants id, but that has to happen every time, and makes database queries really clunky. It would be better to just set and carry these values. The small amount of database space required for two integer fields is irrelevant compared to the overall benefits of this change.

I think for best handling, I'll drag these around as read-only attributes during the editing process, and then derive and store them by lookup from trip_fund_participants in trip_fund_contributions_save() trip_fund_contributions_form_submit().

micahw156’s picture

Version: » 7.x-1.x-dev

Added new uid and trip_id fields to trip_fund_contributions entity. (7f1629e)

micahw156’s picture

Implemented trip_fund_contributions uid and trip_id fields, made general code improvements in all modules, and cleaned up bugs. (fb027bf)

micahw156’s picture

Next steps for workable alpha:

  • Configure proper view permissions for trip assignments and contributions. - done
  • Add edit form for trip assignments.
  • Allow for deletion of trips, participants and contributions.
  • Group contributions displays by trip.
  • Calculate totals and balances.
micahw156’s picture

Version: » 7.x-1.x-dev

Improved permissions handling for all entity types. (449762a)

micahw156’s picture

Added totals and balances to user contribution displays. (f366adb)

micahw156’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

This module has been abandoned.