Plugin Hook request

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Plugin Hook request

Post by drtech » Sun Apr 18, 2010 2:15 pm

1)Can we request a variable to be public static so we can use it in our plugins?

I am trying to get the amount left on all payment plans which is in PPBalanceTotal It would make it much more efficient if I used data already loaded in the account rather than get the data again.

If this is ok...if we could change the declaration of OpenDental.ContrAccount.PPBalanceTotal to "public static" in the beginning of the class and then reset it to 0 at the very beginning of FillPaymentPlans().

2)Also, I would like to add a few more parameters passed to the current hook
Replace --> Plugins.HookAddCode(this,"ContrAccount.RefreshModuleData_end",FamCur,PatCur);
With --> Plugins.HookAddCode(this,"ContrAccount.RefreshModuleData_end",FamCur,PatCur,DataSetMain,isSelectingFamily);


3)Need a hook to replace the whole "panelaging" with a new modified one in the account
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Plugin Hook request

Post by jordansparks » Sun Apr 18, 2010 9:38 pm

I moved the variable to the class level. But you'll have to argue your case for public static harder. That's only if we're desperate. Can't you pass it in from there, now? What hook do you need it added to?

Changes made and posted.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Plugin Hook request

Post by drtech » Mon Apr 19, 2010 5:50 am

i will look at what you did...need the hook at the end of account refreshmodulescreen just like account refreshmoduledata-- only I don't think I really need any parameters passed besides the one to indicate IsFamily or whatever it is called. (not in front of the code right now)
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Plugin Hook request

Post by jordansparks » Mon Apr 19, 2010 8:29 am

Let me know what parameters you need.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Plugin Hook request

Post by drtech » Sun Apr 25, 2010 3:14 pm

Need this done as soon as you can:

Replace --> Plugins.HookAddCode(this,"ContrAccount.RefreshModuleData_end",FamCur,PatCur,DataSetMain,isSelectingFamily);
With -->Plugins.HookAddCode(this,"ContrAccount.RefreshModuleData_end",FamCur,PatCur,DataSetMain,PPBalanceTotal,isSelectingFamily);


thanks
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Plugin Hook request

Post by jordansparks » Sun Apr 25, 2010 3:47 pm

Done
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Plugin Hook request

Post by drtech » Sun Apr 25, 2010 4:43 pm

great..now we need to reset
PPBalanceTotal=0;

first thing in FillPaymentPlans(), before the null condition and all so it will always be 0 unless a payment plan actually exists for that pt
Last edited by drtech on Sun Apr 25, 2010 5:01 pm, edited 1 time in total.
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Plugin Hook request

Post by drtech » Sun Apr 25, 2010 4:59 pm

and I also figured out that it is passing the variable before it is being set now that it is not global static like I made it originally locally.

need to move the hooks from

Plugins.HookAddCode(this,"ContrAccount.RefreshModuleData_null");
Plugins.HookAddCode(this,"ContrAccount.RefreshModuleData_end",FamCur,PatCur,DataSetMain,PPBalanceTotal,isSelectingFamily);

to

Plugins.HookAddCode(this,"ContrAccount.RefreshModuleScreen_null");
Plugins.HookAddCode(this,"ContrAccount.RefreshModuleScreen_end",FamCur,PatCur,DataSetMain,PPBalanceTotal,isSelectingFamily);

I don't think i actually need the hook in refreshmoduledata....but leave it there for now just in case. Thanks. I think I almost have it. Got to test it now with different situations ans see if the math is correct.
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Plugin Hook request

Post by jordansparks » Sun Apr 25, 2010 6:12 pm

done
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Plugin Hook request

Post by drtech » Sun Apr 25, 2010 6:26 pm

got the variable reset...not seeing the hooks in

ContrAccount.RefreshModuleScreen rather than RefreshModuleData.....

see above.
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Plugin Hook request

Post by drtech » Sun Apr 25, 2010 7:44 pm

check your e-mail...sent the patch

thanks
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Plugin Hook request

Post by jordansparks » Sun Apr 25, 2010 9:59 pm

drtech wrote:and I also figured out that it is passing the variable before it is being set now that it is not global static like I made it originally locally.

need to move the hooks from

Plugins.HookAddCode(this,"ContrAccount.RefreshModuleData_null");
Plugins.HookAddCode(this,"ContrAccount.RefreshModuleData_end",FamCur,PatCur,DataSetMain,PPBalanceTotal,isSelectingFamily);

to

Plugins.HookAddCode(this,"ContrAccount.RefreshModuleScreen_null");
Plugins.HookAddCode(this,"ContrAccount.RefreshModuleScreen_end",FamCur,PatCur,DataSetMain,PPBalanceTotal,isSelectingFamily);

I don't think i actually need the hook in refreshmoduledata....but leave it there for now just in case. Thanks. I think I almost have it. Got to test it now with different situations ans see if the math is correct.
Due to the timing of my posts, I completely missed the above post of yours. I'm off to bed before I have a chance to look into it further. Hopefully, since I committed your patch, I got it covered. If not, let me know tomorrow.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Plugin Hook request

Post by drtech » Mon Apr 26, 2010 8:09 am

no prob...thanks...working great today in the office...I updated this morning and am trying it out now...
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

Post Reply