The CPNP batch admin was rolled live in the fall of 2009. It was effectively my 3rd iteration of this type of CRM segment configuration, and it has stood up to the test of time. The search mechanism itself is different than most you find online. Rather than exposing the grouping aspects of the boolean logic, each criterion is simply applied in the specified order. From a logical perspective, each new step is wrapped in parentheses with the steps before. From a metaphor perspective, the steps are instructions for how to progressively add and remove people from the batch. This level of abstraction allows me to expose extremely powerful filters to the end user, but the corresponding implementation drawback is that each segment has to be built using either multiple queries or extremely slow large queries. Regardless, every type of batch can be created using this approach.
The different types of criteria can be extended and configured using Drupal-style hooks and basic HTML templates for UI. The batches are generated by iterating over the criteria with the appropriate application logic. Once generated (takes less than a second in most cases), the user is able to browse/search contacts within the batch. With the batch created, the user might create an Excel spreadsheet export using any number of configurable columns for export. As with the filters, the column exports can also be extended using Drupal-style hooks. Other styles of export include optimizations for sending email and aggregate demographic data.
Early in the process, the Excel generation proved too processor-intensive given the heavy queries required to create some of the column data (e.g., committee history). The solution was to leverage the Drupal batch system (as in batch processing, not as in batches of contacts). The batch would iterate over the contacts in the batch and cache the data until the data had been cached for all contacts in the batch. Creating the export based on pre-cached data is trivial within the processor/time limitations.
This write-up does not do justice to this AJAX application. Over the last 3 years, it has proven reliable, extensible and responsive to all challenges. If we upgrade to Drupal 7+ with standardized entities support, I will look forward to evolving this into a public module. It is far more powerful than any other CRM reporting system I have seen for open source and SMB.