Page 1 of 1
Plugin Hook request
Posted: Sun Apr 18, 2010 2:15 pm
by drtech
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
Re: Plugin Hook request
Posted: Sun Apr 18, 2010 9:38 pm
by jordansparks
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.
Re: Plugin Hook request
Posted: Mon Apr 19, 2010 5:50 am
by drtech
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)
Re: Plugin Hook request
Posted: Mon Apr 19, 2010 8:29 am
by jordansparks
Let me know what parameters you need.
Re: Plugin Hook request
Posted: Sun Apr 25, 2010 3:14 pm
by drtech
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
Re: Plugin Hook request
Posted: Sun Apr 25, 2010 3:47 pm
by jordansparks
Done
Re: Plugin Hook request
Posted: Sun Apr 25, 2010 4:43 pm
by drtech
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
Re: Plugin Hook request
Posted: Sun Apr 25, 2010 4:59 pm
by drtech
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.
Re: Plugin Hook request
Posted: Sun Apr 25, 2010 6:12 pm
by jordansparks
done
Re: Plugin Hook request
Posted: Sun Apr 25, 2010 6:26 pm
by drtech
got the variable reset...not seeing the hooks in
ContrAccount.RefreshModuleScreen rather than RefreshModuleData.....
see above.
Re: Plugin Hook request
Posted: Sun Apr 25, 2010 7:44 pm
by drtech
check your e-mail...sent the patch
thanks
Re: Plugin Hook request
Posted: Sun Apr 25, 2010 9:59 pm
by jordansparks
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.
Re: Plugin Hook request
Posted: Mon Apr 26, 2010 8:09 am
by drtech
no prob...thanks...working great today in the office...I updated this morning and am trying it out now...