Hook Request - FormPayment

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
mopensoft
Posts: 146
Joined: Tue Dec 04, 2012 3:33 pm
Location: Melbourne, Australia
Contact:

Hook Request - FormPayment

Post by mopensoft » Wed Jul 15, 2015 12:41 am

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

vishal
Posts: 9
Joined: Thu May 09, 2013 4:49 am

Re: Hook Request - FormPayment

Post by vishal » Wed Jul 15, 2015 1:03 pm

Please back port this to stable version if possible. Thank, Vishal.

allends
Posts: 235
Joined: Fri Aug 23, 2013 11:29 am

Re: Hook Request - FormPayment

Post by allends » Thu Jul 16, 2015 12:47 pm

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.
Allen
Open Dental Software
http://www.opendental.com

User avatar
mopensoft
Posts: 146
Joined: Tue Dec 04, 2012 3:33 pm
Location: Melbourne, Australia
Contact:

Re: Hook Request - FormPayment

Post by mopensoft » Mon Jul 20, 2015 1:18 am

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

allends
Posts: 235
Joined: Fri Aug 23, 2013 11:29 am

Re: Hook Request - FormPayment

Post by allends » Mon Jul 20, 2015 2:52 pm

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.
Allen
Open Dental Software
http://www.opendental.com

User avatar
mopensoft
Posts: 146
Joined: Tue Dec 04, 2012 3:33 pm
Location: Melbourne, Australia
Contact:

Re: Hook Request - FormPayment

Post by mopensoft » Mon Jul 20, 2015 11:13 pm

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.

allends
Posts: 235
Joined: Fri Aug 23, 2013 11:29 am

Re: Hook Request - FormPayment

Post by allends » Tue Jul 21, 2015 9:55 am

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.
Allen
Open Dental Software
http://www.opendental.com

allends
Posts: 235
Joined: Fri Aug 23, 2013 11:29 am

Re: Hook Request - FormPayment

Post by allends » Wed Jul 29, 2015 12:18 pm

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.
Allen
Open Dental Software
http://www.opendental.com

Post Reply