bug fix of sql upgrade script
[openemr.git] / library / js / calendarDirectSelect.js
blobd859787cd42ef0559270ce137cd0a46f21b7d1e7
1 // +-----------------------------------------------------------------------------+
2 // Copyright (C) 2011 IntegralEMR LLC <kevin.y@integralemr.com>
3 //
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
17 // A copy of the GNU General Public License is included along with this program:
18 // openemr/interface/login/GnuGPL.html
19 // For more information write to the Free Software
20 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 // Author:   Kevin Yeh <kevin.y@integralemr.com>
24 // +------------------------------------------------------------------------------+
25 function updateApptTime(marker,index,y,date,provider)
26     {
27         row=$("#times table tr").eq(index);
28         timeSlot=row.find("td a");
29         params=timeSlot.attr("href").split("(")[1].split(",");
30         newEvtParam=params[0]+","+params[1]+","+params[2]+","+date+","+provider+","+"0";
31         onClk="javascript:newEvt("+newEvtParam+")";
32         marker.html(timeSlot.html());
33         marker.attr("href",onClk);
34     }
35     function displayApptTime(evt)
36     {
37         
38         marker=$(this).find("a.apptMarker");
39         if(marker.length==0)
40         {
41             style="style=\'height:"+tsHeight+";\'"
42             $(this).find("div.calendar_day").append("<a class=\'apptMarker event event_appointment\'"+style+">");
43             marker=$(this).find("a.apptMarker");
44             marker.css("z-index",1);
45         }
46         y=evt.pageY-$(this).offset().top;
47         rem=y % tsHeightNum;
48         y=y-rem;
49         ph=$(this).find("div.providerheader");
50         index=y/tsHeightNum;
51         if(ph.length==1)
52             {
53                 y=y-ph.height();
54                 if(index==0)
55                     {
56                         marker.hide();
57                         return;
58                     }
59             }
60         marker.css("top",y);
61         date=$(this).attr("date");
62         updateApptTime(marker,index,y,date,$(this).attr("provider"));
63         marker.show();
64     }
65     function hideApptTime(evt)
66     {
67         marker=$(this).find("a.apptMarker");
68         marker.hide();
69     }
70     function setupDirectTime()
71     {
72         $("td.schedule").mousemove(displayApptTime);
73         $("td.schedule").mouseout(hideApptTime);
74     }