[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Time Cards and Projects - billing for professional services
- Subject: Re: Time Cards and Projects - billing for professional services
- From: "Chris Travers" <..hidden..>
- Date: Tue, 2 Jan 2007 09:27:38 -0800
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
in.
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