Page 1 of 1
Hook Request - FormPayment
Posted: Wed Jul 15, 2015 12:41 am
by mopensoft
I would like to add 2 hooks into FormPayment.cs
1. At the end of butOK_Click handler: Plugins.HookAddCode(this, "FormPayment.butOK_Click_end", PaymentCur, SplitList);
2. At the end of FormPayment_Load handler: Plugins.HookAddCode(this, "FormPayment.Load_end", PaymentCur, IsNew);
Thanks
Minh
Re: Hook Request - FormPayment
Posted: Wed Jul 15, 2015 1:03 pm
by vishal
Please back port this to stable version if possible. Thank, Vishal.
Re: Hook Request - FormPayment
Posted: Thu Jul 16, 2015 12:47 pm
by allends
http://opendental.com/manual/plugins.html
Hooks
In addition to the obvious buttons from Program Links, any number of hooks are allowed. We add them quickly and we backport them to the beta version so you can get going right away.
I have backported these hooks to the 15.2.12 version which will be stable very soon.
Re: Hook Request - FormPayment
Posted: Mon Jul 20, 2015 1:18 am
by mopensoft
Can you add the following hook into ApptSingleDrawing.cs, in method DrawElement(...) after FillText region (line 420)
Code: Select all
object[] parameters = {Patients.GetPat(PIn.Long(dataRoww["PatNum"].ToString())), PatFieldDefs.GetFieldName(apptRows[elementI].PatFieldDefNum), text};
Plugins.HookAddCode(null, "ApptSingleDrawing.DrawElement_update", parameters);
text = (string)parameters[2];
This hook is in the middle of the method which I want to change the value of "text" variable and after adding the hook, code look like below:
Code: Select all
#endregion
object[] parameters = {Patients.GetPat(PIn.Long(dataRoww["PatNum"].ToString())), PatFieldDefs.GetFieldName(apptRows[elementI].PatFieldDefNum), text};
Plugins.HookAddCode(null, "ApptSingleDrawing.DrawElement_update", parameters);
text = (string)parameters[2];
if(text=="" && !isGraphic) {
return drawLoc;//next element will draw at the same position as this one would have.
}
Thanks
Minh
Re: Hook Request - FormPayment
Posted: Mon Jul 20, 2015 2:52 pm
by allends
With the new release of 15.3 as the beta this new hook will be going back to 15.3 and not 15.2. I should be able to add them to the next release of 15.3.
Re: Hook Request - FormPayment
Posted: Mon Jul 20, 2015 11:13 pm
by mopensoft
could you backport it to 15.2.12 as the previous hooks in this thread? This is part of the payment plugin I build for vishal. It would be good if he can get the plugin function completely.
Re: Hook Request - FormPayment
Posted: Tue Jul 21, 2015 9:55 am
by allends
Since it is against our policy to backport plug-in hooks past the beta I cannot.
Thankfully, our release cycle is only around 6-8 weeks, so our current beta will be stable soon enough.
Re: Hook Request - FormPayment
Posted: Wed Jul 29, 2015 12:18 pm
by allends
I have added your plug-in hook to 15.3.6, but I have changed it slightly so all of our customers are not running extra queries.
Code: Select all
object[] parameters={ dataRoww["PatNum"].ToString(),apptRows[elementI].PatFieldDefNum,text };
Plugins.HookAddCode(null,"ApptSingleDrawing.DrawElement_afterFillText",parameters);
text=(string)parameters[2];
This means that you are getting the PatNum, PatFieldDefNum, and text as parameters and will need to run the Patients.GetPat() and PatFieldDefs.GetFieldName() in your plugin.
I have also changed the name of the hook to better highlight where it is located in the DrawElement method.