- Quest CM tasks should be prioritized ahead of any other 1.6 work unless otherwise specified. Work for this issue s/b done on "trunk") ***
Quest College Match "Readers" will need a batch update "grid" so they can quickly enter their feedback for a set of applicants. This is also a useful feature for many of our other users - so we will implement this in core in a generalized way.
- Use search (basic, advanced, builder) to return a set of contacts
- User selects all or some of the result-set as usual, and select a new task from the actions drop-down: "Batch Update via Profile"
- User selects a Profile (uf_group) from a drop-down
- CiviCRM displays a grid form with columns = all editable fields in the selected profile, and rows = all selected contacts in result-set. Use profile field labels as column headers.
- User updates fields (cells in the grid) as desired and clicks Save when done.
- CiviCRM updates records for all rows where data has been modifed and returns user to search results.
- Use a CONSTANT (initial value = 100) to limit the max number of contact (rows) displayed in grid. If user selects more than max - give an error and return to search results instead of next step (select profile). "The maximum number of contacts you can select for Batch Update is 100. You have selected xxx. Please select fewer contacts from your search results and try again."
- Contacts selected for batch update must all be of the same type (e.g. Individuals, or Organizations, or Households). If user selects mixed contact types - give an error and return to search results instead of next step (select profile). "Batch update requires that all selected contacts be the same type (e.g. all Individuals OR all Organizations...). Please modify your selected contacts and try again."
- Use a CONSTANT (initial value = 8) for the number of profile fields (columns) displayed in the grid-form. If the selected profile has more than 8, use only the first 8 (ordered by Weight).
- Any form field which can be included in a profile should be supported for the batch update grid. For Quest, we will use 3 new fields from the quest_student_summary table in the "Reader" batch update profile.
- Profiles with mixed object-type fields (e.g. Individual fields + Org fields) can not be selected for batch update. Prefereably, do not offer these in drop-down. Else - give error is user selects a mixed profile.
- The first column of the grid is always the contact.sort_name (as with profile listings). This is a read-only column.
- Profile fields where is_view = TRUE are included in the grid, but are read-only.
- Form validation code needs to check whether each record in the grid has been modified from when it was loaded. If not modified - skip validation (we won't do an update on these). If modified, then do form validation on the grid fields for that row. Add validation errors to error array and continue. After looping, if any validation errors, redisplay grid and display form errors. If possible, the error display on the top of the grid page should prepend the row sort_name in front of the list of errors for that row, e.g.:
- Birth Date is required.
- Number of siblings must be an integer.
- Dog's Name is required.
- If no validation errors (ON MODIFIED ROWS) - then postProcess saves changes for each modified row, and returns to Search Results with status "Your updates have been saved."