feat: expose suffix and valedictory in user admin and esign (#6814)
[openemr.git] / library / js / calendarDirectSelect.js
blobce78fcd86576bb1257169ba5dc4d1e147daa9715
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>
23 // Author:   Jerry Padgett <sjpadgett@gmail.com>
25 // +------------------------------------------------------------------------------+
26 function updateApptTime(marker, index, y, date, provider) {
27     let row = $("#times table tr").eq(index);
28     let timeSlot = row.find("td a");
29     if (typeof timeSlot.attr("href") !== 'undefined') {
30         if (index && y) {
31             let params = timeSlot.attr("href").split("(")[1].split(",");
32             let newEvtParam = params[0] + "," + params[1] + "," + params[2] + "," + date + "," + provider + "," + "0";
33             let onClk = "javascript:newEvt(" + newEvtParam + ")";
34             marker.html(timeSlot.html());
35             marker.attr("href", onClk);
36         }
37     }
40 function displayApptTime(evt) {
41     let marker = $(this).find("a.apptMarker");
42     if (marker.length == 0) {
43         style = "style='height:" + tsHeight + ";'";
44         $(this).find("div.calendar_day").append("<a class='apptMarker event event_appointment'" + style + "></a>");
45         marker = $(this).find("a.apptMarker");
46         marker.css("z-index", 1);
47     }
48     y = evt.pageY - $(this).offset().top;
49     rem = y % tsHeightNum;
50     y = y - rem;
51     let ph = $(this).find("div.providerheader");
52     let index = y / tsHeightNum;
53     if (ph.length == 1) {
54         y = y - ph.height();
55         if (index == 0) {
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();
66 function hideApptTime(evt) {
67     let marker = $(this).find("a.apptMarker");
68     marker.hide();
71 function setupDirectTime() {
72     $("td.schedule").mousemove(displayApptTime);
73     $("td.schedule").mouseleave(hideApptTime);