Hello,
I'm to build a simple financial application for a NGO and at this point we should either decide to write it from scratch in Rails or try to fit it into Drupal CCK and Views. It's just the usual CRUD stuff with fairly simple business logic - something any 14-year old could put together in MS Access were it not for the web.
I'm fairly convinced I can bend CCK into whatever the data entry part of it might require, but I'm not really sure at this point whether Views / Views Calc can display any kind of report we might write as Views weren't really meant for financial reporting as far as I know. So in case Views would prove insufficient can I just write a MySQL View and display it in a View, or if that's not possible, iterate through View rows in PHP, make changes to fields before they are displayed, skip some rows, insert some extra rows at the bottom with values calculated in PHP and so on? If yes, can someone please briefly point me into the right direction - I don't think I need complete code examples just a few ideas which hooks or functions to look at. And if it is not possible, any ideas what to do in the worst case as long as I'm happy to write SQL, slightly less happy, but willing to write PHP, but I'd like the results really integrated into Drupal look & feel, i.e. no custom HTML table generation... ?
thank you in advance,
Miki
Comments
Yes
You can do this with some very basic php and the drupal theming functions.
Write a module that has a single call back, run your query and return the data with theme_table
Yes, if you can code in php
Yes, if you can code in php by all means use the views API.
You can code your own fields and filters, even whole submodules just like the existing ones.
Put these codes inside a custom module, so that it loads from the disk and save queries.
You can hard code the whole view in that custom module to avoid loading the UI by making it a default view.
Then theme the views to have full control of the tables and layout.
You can also change the way the values are loaded, pulling them from the cache.
(See http://drupal.org/node/67502)
As for the hooks, you can use the "query alter" hook to modify existing queries from drupal modules.
In sum, you can do whatever you can do with your own coding and still benefit from the existing helper functions.
It may take a while to browse the knowledge base but you'll be rolling out a solution faster than coding everything from scratch.
Besides, it will be compatible with other modules, easy to upgrade and troubleshooted by other users.