[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Time Cards and Projects - billing for professional services

Before I got this message I had added a column employee_id to the parts table in Postgres using phpPgAdmin. I was then looking at the code to figure out how to add the field to the IC (parts and services form) and also how to add the function to the time card form. I am a little lost. I have almost never worked with Perl - I hack around with php all the time and have a good understanding of that. I have a couple of guys I know here who are Perl wizards though. I'll keep working on it.

On 02/01/07, Chris Travers <..hidden..> wrote:
Hi Steve;
Use create_custom_field(ENT, NAME, TYPE) to create the custom field.
For example:
SELECT create_custom_field('parts', 'employee_id', 'text');

Right now all custom fields should be text unless you want to make
them required fields becuase I don't have adequate null handling built

Then you will need to:
1)  Add the field to the form (ic.pl)
2)  If using 1.1, add lines like:
$form->run_custom_queries(OPERATION, ENT)
for example
$form->run_custom_queries('SELECT', 'parts');
where appropriate in 1.1 in IC.pm.
(1.2 has this done already)

3)  Wherever else you want to filter by the field, you can add
appropriate logic to retrieve the custom fields and use them.  I do
recommend however, that anywhere you add the run_custom_queries()
function, you send us a patch so you have less porting work to do for
future versions.

run_custom_queries basically creates the SQL queries for the custom
fields and runs them.  The OPERATION can be 'SELECT', 'INSERT', or
'UPDATE' and ENT is the entity the fields are attached to.  Right now
we recommend naming them after the db tables used.  But this could be
used to create new entities for custom work.

Best Wishes,
Chris Travers

Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
Ledger-smb-users mailing list

Steve Jacobs