PDA

View Full Version : Adding custom fields to projects


oberon
06-07-04, 03:11 AM
I customized projects with additional custom fields.
First, I added my fields to the projects table.
Second, I added the form fields to /modules/projects/addedit.php.

But it didn't work out at first, because the values entered did not reappear next time.

I had to add the additional fields into projects.class.php, as follows:

class CProject extends CDpObject {
var $project_id = NULL;
var $project_company = NULL;
var $project_department = NULL;
var $project_name = NULL;
var $project_short_name = NULL;
var $project_owner = NULL;
var $project_url = NULL;
var $project_demo_url = NULL;
var $project_start_date = NULL;
var $project_end_date = NULL;
var $project_actual_end_date = NULL;
var $project_status = NULL;
var $project_percent_complete = NULL;
var $project_color_identifier = NULL;
var $project_description = NULL;
var $project_target_budget = NULL;
var $project_actual_budget = NULL;
var $project_creator = NULL;
var $project_active = NULL;
var $project_private = NULL;

var $project_customfield1 = NULL;
var $project_customfield2 = NULL;
var $project_customfield3 = NULL;
var $project_customfield4 = NULL;
var $project_customfield5 = NULL;
var $project_customfield6 = NULL;


After that, it worked out fine. I assume, that this is working for other tables as well.

Revelation7
08-07-04, 03:05 AM
Yes, you need to put the variables in the base class, as all higher level functions interact with the base class. What is your question? Is that the correct way to go about it? Yes to that.

"I assume, that this is working for other tables as well." Not sure what you meant? Are you asking if customizing other tables is done in the same way? Yes.

djkalman
12-08-04, 10:13 AM
You also need to add the fields you've created to the view.php file as well.

amaltea
23-07-05, 01:08 AM
I think i have the opposite question ...

is there any way to create some class vars that the inherited db methods doesnt try to put as fields in the related db table ?