hook change request

This forum is for programmers who have questions about the source code.
Post Reply
alkhaef
Posts: 105
Joined: Fri Jul 02, 2010 10:37 am
Location: Los Angeles, CA

hook change request

Post by alkhaef » Wed Oct 06, 2010 2:58 pm

Hello.

I had previously requested the hook:

Code: Select all

Plugins.HookAddCode(this,"FormApptEdit.CalculateTime_end",strBTime,provDent,provHyg,codeNums);//set strBTime, but without using the 'new' keyword.
...and it works wonderfully... BUT:
1. I never realized that Appointments.CalculatePattern() is called from other places as well (namely, ContrAppt). So, for example, when a provider is changed by ContrAppt, my code is bypassed :(.
2. With my current implementation, a HookMethod will be more appropriate for performance reasons.

...So...
1. I'd like to request a HookMethod at "Appointments.CalculatePattern" with the equivalent parameter set.
2. The original hook I requested is no longer necessary (for me). I'm not sure if anyone else is using it... I guess this begs the question of policy for removing hooks...

Thanks,
Al
Help! I've OD'ed on OD! :)

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

Re: hook change request

Post by jordansparks » Thu Oct 07, 2010 7:24 am

We will add the new hook and remove the old one. But the old one only gets removed in the head, and only because we're pretty sure nobody else is using it.
Jordan Sparks, DMD
http://www.opendental.com

alkhaef
Posts: 105
Joined: Fri Jul 02, 2010 10:37 am
Location: Los Angeles, CA

Re: hook change request

Post by alkhaef » Thu Oct 07, 2010 8:49 am

Great! :)

Thanks,
Al
Help! I've OD'ed on OD! :)

michael
Posts: 38
Joined: Wed Aug 04, 2010 8:49 am

Re: hook change request

Post by michael » Fri Oct 15, 2010 2:30 pm

The new hook has been added in 7.3.6 and the old one will be removed in 7.4.1.

alkhaef
Posts: 105
Joined: Fri Jul 02, 2010 10:37 am
Location: Los Angeles, CA

Re: hook change request

Post by alkhaef » Sun Nov 07, 2010 9:23 pm

Hi.

I just finally got some time to use my plugin against the new hook location so I can move to 7.4, and I realized it stops working at this new location, because at that line strBtime has been digested and is no longer relevant:

Code: Select all

			if(strBTime.Length>39) {
				strBTime.Remove(39,strBTime.Length-39);
			}
			string pattern=strBTime.ToString();
			if(make5minute) {
				return ConvertPatternTo5(pattern);
			}
			Plugins.HookAddCode(null,"Appointments.CalculatePattern_end",strBTime,provDent,provHyg,codeNums);
			return pattern;
I'd like to request it to move up a few lines so that my plugin's changes to strBTime are used by OD, like so:

Code: Select all

			if(strBTime.Length>39) {
				strBTime.Remove(39,strBTime.Length-39);
			}
			Plugins.HookAddCode(null,"Appointments.CalculatePattern_end",strBTime,provDent,provHyg,codeNums);
			string pattern=strBTime.ToString();
			if(make5minute) {
				return ConvertPatternTo5(pattern);
			}
			return pattern;
Thanks!
-Al
Al
Help! I've OD'ed on OD! :)

michael
Posts: 38
Joined: Wed Aug 04, 2010 8:49 am

Re: hook change request

Post by michael » Tue Nov 09, 2010 5:45 am

Hook has been moved as requested and will be released with version 7.5.4.

Post Reply