Hey All,
I am working on a small project to integrate our current SugarCRM (5.2.0.e - we cannot upgrade due to many customizations done to the system breaks upgrades - planning on a clean install and dump of data down the road) with Trac ticketing system.
My idea was to build a hook based on before_save and so I have done the following:
This works for every time a 'submit' button is basically used within 'Bugs' module right? So with that being the case, I only want NEW bugs to perform this action (create a Trac ticket/bug). So i coded my TracSync.php to have this in it:Code:<?php $hook_version = 1; $hook_array = Array(); $hook_array['before_save'] = Array(); $hook_array['before_save'][] = Array(1, 'TracSync', 'custom/modules/Bugs/TracSync.php', bug_opened, bug_opened); ?>
Is this the best way to go about doing this - and getting this 'on certain actions only' ability? Please let me know if there is another way that might be better.Code:if ($bean->status == 'New' && $bean->fetched_row['Status'] == ''){ //perform actions ... }
Thank you in advance for your help.


LinkBack URL
About LinkBacks



Reply With Quote


Bookmarks