Recurring Events Problem for IN/OUT

Developers
Jooaquin
2012-11-23
2013-04-06
  • Jooaquin
    Jooaquin
    2012-11-23

    Hi, I'm observing problems to edit a recurring event for IN or OUT category.
    I can't click on the cyrcle, as the new div with the time overlaps this alternative.
    To be noted that LUNCH and patient's events are fine, the problem seems to be only in the In office and Out of the office alternatives.
    May be someone found the same?
    Thank you.

     
  • McGillicutty
    McGillicutty
    2012-11-23

    It seems that if you position your mouse just right, you can get a double-click on the IN/OUT event, but for the most part it is overlapped as you said.

     
  • Kevin Yeh
    Kevin Yeh
    2012-11-24

    A workaround, if you edit:

    interface\themes\ajax_calendar.css

    and add z-index:100 to event_highlight class elements, it should let you double click. 

    .event_highlight { 
        font-weight: bold; 
        border-top: 1px solid #999;
        border-left: 1px solid #999;
        border-right: 2px solid #666;
        border-bottom: 2px solid #666;
        margin: -3px;
        background-color: black;
        z-index: 100;
    }
    
     
  • Jooaquin
    Jooaquin
    2012-11-24

    SOLVED
    Thank you mcgillcutty and yehster.
    yehster I tried, very good idea, but I couldn't make it work because css is overwritten, although I may be doing something wrong..

    This is how I've just solved for Day and Week Calendar.
    interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/ajax_template.html

    Line 677 on version 4.1.1 patch 7. Please note background-color, I used GREEN but you can replace it.
    Replace this:
              if ($event == 2) {
                  $inTop = ($eStartPos - $timeslotHeightVal).$timeslotHeightUnit;
                  echo "<div class='".$evtClass." event' style='top:".$inTop.
                      "; height:".$timeslotHeightVal.$timeslotHeightUnit.
                      "; $divWidth".
                      "; $divLeft".
                      "; background:transparent".
                      "; border: none".
                      "' title='".$divTitle."'".
                      " id='".$eventdate."-".$eventid."-".$pccattype."'".
                      ">";

    with this:
              if ($event == 2) {
                  $inTop = ($eStartPos - $timeslotHeightVal).$timeslotHeightUnit;
                  echo "<div class='".$evtClass." event' style='top:".$inTop.
                      "; height:".$timeslotHeightVal.$timeslotHeightUnit.
                      "; $divWidth".
                      "; $divLeft".
                      "; background:yellowgreen".
                      "; border: none".
                      "; z-index: 1000".
                      "' title='".$divTitle."'".
                      " id='".$eventdate."-".$eventid."-".$pccattype."'".
                      ">";

    AND IN WEEK:
    replace this:
                // output the DIV and content
    if($_SESSION == 0){
    // output the DIV and content
    echo "<div class='".$evtClass." event' style='top:".$evtTop."; height:".$evtHeight.
    "; background-color:".$color.
    "; $divWidth".
    "; $divLeft".
    "' title='".$divTitle."'".
    " id='".$eventdate."-".$eventid."-".$pccattype."'".
    ">";
    echo $content;
    echo "</div>\n";
    }

    with this
           if($_SESSION == 0){
              // a special case for the 'IN' event this puts the time ABOVE
              // the normal DIV so it doesn't overlap another event DIV and include the time
              if ($event == 2) {
                  $inTop = ($eStartPos - $timeslotHeightVal).$timeslotHeightUnit;
                  echo "<div class='".$evtClass." event' style='top:".$inTop.
                      "; height:".$timeslotHeightVal.$timeslotHeightUnit.
                      "; $divWidth".
                      "; $divLeft".
                      "; background:yellowgreen".
                      "; border: none".
                      "; z-index: 1000".
                      "' title='".$divTitle."'".
                      " id='".$eventdate."-".$eventid."-".$pccattype."'".
                      ">";
                  $content = $dispstarth . ':' . $startm . " " . $content;
                  echo $content;
                  echo "</div>\n";
              }
     
              // output the DIV and content
              echo "<div class='".$evtClass." event' style='top:".$evtTop."; height:".$evtHeight.
                  "; background-color:".$color.
                  "; $divWidth".
                  "; $divLeft".
                  "' title='".$divTitle."'".
                  " id='".$eventdate."-".$eventid."-".$pccattype."'".
                  ">";
              // second part for the special IN event
              if ($event != 2) { echo $content; }
              echo "</div>\n";
           }

     
  • Jooaquin
    Jooaquin
    2012-11-24

    Yhester, I took your CSS idea to make a cleaner solution.

    Hhere for both events categories 2 and 3 ( IN and OUT )
    Create in ajax_calendar.css  the following class:

    .event_in_office {
        background:yellowgreen;
        border: none;
        z-index: 1000;
    }
    

    In interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/ajax_template.html

           if($_SESSION['pc_facility'] == 0){
              // a special case for the 'IN' event this puts the time ABOVE
              // the normal DIV so it doesn't overlap another event DIV and include the time
              if ($event['catid'] == 2) {
                  $inTop = ($eStartPos - $timeslotHeightVal).$timeslotHeightUnit;
                  echo "<div class='".$evtClass." event event_in_office' style='top:".$inTop.
                      "; height:".$timeslotHeightVal.$timeslotHeightUnit.
                      "; $divWidth".
                      "; $divLeft".
                      "' title='".$divTitle."'".
                      " id='".$eventdate."-".$eventid."-".$pccattype."'".
                      ">";
                  $content = $dispstarth . ':' . $startm . " " . $content;
                  echo $content;
                  echo "</div>\n";
              }
      
              if ($event['catid'] == 3) {
                  $inTop = ($eStartPos).$timeslotHeightUnit;
                  echo "<div class='".$evtClass." event event_in_office' style='top:".$inTop.
                      "; height:".$timeslotHeightVal.$timeslotHeightUnit.
                      "; $divWidth".
                      "; $divLeft".
                      "' title='".$divTitle."'".
                      " id='".$eventdate."-".$eventid."-".$pccattype."'".
                      ">";
                  $content = $dispstarth . ':' . $startm . " " . $content;
                  echo $content;
                  echo "</div>\n";
              }
              // output the DIV and content
              echo "<div class='".$evtClass." event' style='top:".$evtTop."; height:".$evtHeight.
                  "; background-color:".$color.
                  "; $divWidth".
                  "; $divLeft".
                  "' title='".$divTitle."'".
                  " id='".$eventdate."-".$eventid."-".$pccattype."'".
                  ">";
              // second part for the special IN event
              if ($event['catid'] != 2 AND $event['catid'] != 3) { echo $content; }
              echo "</div>\n";
    

    and the very same coding in the week ajax_template.

     
  • CVerk
    CVerk
    2012-11-25

    After about 30 trys I managed to get IN/OUT reset until the end of the year.  Is this the sort of fix that might get tested and put into a future patch?  I think a do over setting for provider IN/OUT settings would be good, because it is really easy to get all messed up. Like a swiss watch or a vasectomy, much easier to take apart than to put back together and make it work again.

     
  • Kevin Yeh
    Kevin Yeh
    2012-11-25

    The popup for selecting an appointment slot is my responsibility, so I will work on fixing the conflict between that display mechanism and editing IN/OUT events. The dynamic appearing/disappearing of the time slots isn't a great UI paradigm and it doesn't work on tablets.  I've got a better implementation in mind.

    If you want a "do-over."  Use the MySQL tool of your choice and execute

    DELETE FROM openemr_postcalendar_events where pc_catid in (2,3)
    

    Proceed with caution of course. 

    Unless someone wants to pay for it, I have no intention of formally implementing IN/OUT reset.

     
  • Kevin Yeh
    Kevin Yeh
    2012-11-25

    Also, it seems that my appointment code isn't compatible with the highlighting indicating IN/OUT in addition to the conflict with the IN/OUT markers, so another way to disable my code would be to edit:
    library\js\calendarDirectSelect.js and delete these two line:

    $("td.schedule").mousemove(displayApptTime);
    $("td.schedule").mouseleave(hideApptTime);
    

    Towards the bottom of the file.