I'm creating the "Cases" subpanel under the Project Task module. This has been setup for a one-to-many relationship using an additional field labeled "project_task_id" in the cases table.
When clicking the Create button within the Cases subpanel, it does not record the id from project task into the cases table. How can this be accomplished?
If I manually record the project task id into the database table, it does display when viewing the detail page. The only missing action/item is recording the project task id into the cases table field => project_task_id; which i created within the cases vardef.php file.
/modules/Cases/vardef.php
/modules/ProjectTask/layout_defs.phpPHP Code:'project_task_id'=>
array(
'name'=>'project_task_id',
'type' => 'id',
'reportable'=>false,
'vname'=>'LBL_PROJECT_TASK_ID',
'audited'=>false,
'comment' => 'The project task to which the case is associated'
),
/modules/ProjectTask/vardefs.phpPHP Code:'cases' => array(
'order' => 70,
'sort_order' => 'desc',
'sort_by' => 'case_number',
'module' => 'Cases',
'subpanel_name' => 'default',
'get_subpanel_data' => 'cases',
'add_subpanel_data' => 'case_id',
'title_key' => 'LBL_CASES_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopButtonQuickCreate'),
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
),
),
PHP Code:'cases' => array (
'name' => 'cases',
'type' => 'link',
'relationship' => 'project_task_cases', //relationship table
'module'=>'Cases',
'bean_name'=>'Case',
'source'=>'non-db',
'vname'=>'LBL_CASES',
),
I'm not sure if this should automatically record the project task id in the cases table for the field I created or if I manually need to get the project task id and record the id into the cases table.PHP Code:,'project_task_cases' => array(
'lhs_module'=> 'ProjectTask',
'lhs_table'=> 'project_task',
'lhs_key' => 'id',
'rhs_module'=> 'Cases',
'rhs_table'=> 'cases',
'rhs_key' => 'project_task_id',
'relationship_type'=>'one-to-many'
)
If I need to manually record the project task id into the cases table for the field I created, where does this need to be taken place?
Any help would be appreciated, I'm getting frustrated for such a simple task...
Regards,
Rustin
* FIXED
/modules/Cases/Case.php
/modules/Cases/Save.phpPHP Code:var $relationship_fields = Array('project_task_id' => 'projecttask', 'account_id'=>'account', 'bug_id' => 'bugs',
'task_id'=>'tasks', 'note_id'=>'notes',
'meeting_id'=>'meetings', 'call_id'=>'calls', 'email_id'=>'emails',
);
PHP Code:$focus = new aCase();
$focus = populateFromPost('', $focus);
$focus->project_task_id = $_POST['return_id'];
$focus->save($GLOBALS['check_notify']);
$return_id = $focus->id;


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks