{"action":"created","comment":{"url":"https://api.github.com/repos/openemr/openemr/pulls/comments/73838784","id":73838784,"diff_hunk":"@@ -1347,28 +1347,77 @@ function setMyPatient() {\n         $apptNum = (int)$GLOBALS['number_of_appts_to_show'];\n         if($apptNum != 0) $apptNum2 = abs($apptNum);\n         else $apptNum2 = 10;\n-        $events = fetchNextXAppts($current_date2, $pid, $apptNum2 + 1);\n-        //////\n-        if(count($events) > $apptNum2) {\n-          $extraApptDate = $events[$apptNum2]['pc_eventDate'];\n-          array_pop($events);\n-        }\n-        else $extraApptDate = '';\n+        //\n+        $mode1 = !$GLOBALS['appt_display_sets_option'];\n+        $colorSet1 = $GLOBALS['appt_display_sets_color_1'];\n+        $colorSet2 = $GLOBALS['appt_display_sets_color_2'];\n+        $colorSet3 = $GLOBALS['appt_display_sets_color_3'];\n+        $colorSet4 = $GLOBALS['appt_display_sets_color_4'];\n+        //\n+        if($mode1) $extraAppts = 1;\n+        else $extraAppts = 6;\n+        $events = fetchNextXAppts($current_date2, $pid, $apptNum2 + $extraAppts);\n         //////\n-        if($extraApptDate) {\n-          $firstApptIndx = 0;\n-          $lastApptIndx = $apptNum2 - 1;\n-          $lastApptDate = $events[$lastApptIndx]['pc_eventDate'];\n-          for($i = 0; $i <= $lastApptIndx; ++$i) {\n-            if($events[$lastApptIndx - $i]['pc_eventDate'] != $lastApptDate) {\n-              $firstApptIndx = $apptNum2 - $i;\n-              break;\n-            }\n+        if($events) {\n+          $selectNum = 0;\n+          $apptNumber = count($events);\n+          //\n+          if($apptNumber <= $apptNum2) {\n+            $extraApptDate = '';\n+            //\n+          } else if($mode1 && $apptNumber == $apptNum2 + 1) {\n+            $extraApptDate = $events[$apptNumber - 1]['pc_eventDate'];\n+            array_pop($events);\n+            --$apptNumber;\n+            $selectNum = 1;\n+            //\n+          } else if($apptNumber == $apptNum2 + 6) {\n+            $extraApptDate = $events[$apptNumber - 1]['pc_eventDate'];\n+            array_pop($events);\n+            --$apptNumber;\n+            $selectNum = 2;\n+            //\n+          } else { // mode 2 - $apptNum2 < $apptNumber < $apptNum2 + 6\n+            $extraApptDate = '';\n+            $selectNum = 2;\n+            //\n+          }\n+          //\n+          $limitApptIndx = $apptNum2 - 1;\n+          $limitApptDate = $events[$limitApptIndx]['pc_eventDate'];\n+          //\n+          switch ($selectNum) {\n+            //\n+            case 2:\n+              $lastApptIndx = $apptNumber - 1;\n+              $thisNumber = $lastApptIndx - $limitApptIndx;\n+              for($i = 1; $i <= $thisNumber; ++$i) {\n+                if($events[$limitApptIndx + $i]['pc_eventDate'] != $limitApptDate) {\n+                  $extraApptDate = $events[$limitApptIndx + $i]['pc_eventDate'];\n+                  $events = array_slice($events, 0, $limitApptIndx + $i);\n+                  break;\n+                }\n+              }\n+              //\n+              case 1:\n+                $firstApptIndx = 0;\n+                for($i = 1; $i <= $limitApptIndx; ++$i) {\n+                  if($events[$limitApptIndx - $i]['pc_eventDate'] != $limitApptDate) {\n+                    $firstApptIndx = $apptNum2 - $i;\n+                    break;\n+                  }\n+                }\n+                //\n+          }\n+          //\n+          if($extraApptDate) {\n+            if($extraApptDate != $limitApptDate) $apptStyle2 = \" style='background-color:$colorSet3;'\";","path":"interface/patient_file/summary/demographics.php","position":95,"original_position":95,"commit_id":"8f14357bad82faf21f33521d562afcae5a0a7efb","original_commit_id":"8f14357bad82faf21f33521d562afcae5a0a7efb","user":{"login":"bradymiller","id":278968,"avatar_url":"https://avatars.githubusercontent.com/u/278968?v=3","gravatar_id":"","url":"https://api.github.com/users/bradymiller","html_url":"https://github.com/bradymiller","followers_url":"https://api.github.com/users/bradymiller/followers","following_url":"https://api.github.com/users/bradymiller/following{/other_user}","gists_url":"https://api.github.com/users/bradymiller/gists{/gist_id}","starred_url":"https://api.github.com/users/bradymiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradymiller/subscriptions","organizations_url":"https://api.github.com/users/bradymiller/orgs","repos_url":"https://api.github.com/users/bradymiller/repos","events_url":"https://api.github.com/users/bradymiller/events{/privacy}","received_events_url":"https://api.github.com/users/bradymiller/received_events","type":"User","site_admin":false},"body":"attr() the $colorSet3","created_at":"2016-08-08T08:30:11Z","updated_at":"2016-08-08T08:30:11Z","html_url":"https://github.com/openemr/openemr/pull/170#discussion_r73838784","pull_request_url":"https://api.github.com/repos/openemr/openemr/pulls/170","_links":{"self":{"href":"https://api.github.com/repos/openemr/openemr/pulls/comments/73838784"},"html":{"href":"https://github.com/openemr/openemr/pull/170#discussion_r73838784"},"pull_request":{"href":"https://api.github.com/repos/openemr/openemr/pulls/170"}}},"pull_request":{"url":"https://api.github.com/repos/openemr/openemr/pulls/170","id":80376912,"html_url":"https://github.com/openemr/openemr/pull/170","diff_url":"https://github.com/openemr/openemr/pull/170.diff","patch_url":"https://github.com/openemr/openemr/pull/170.patch","issue_url":"https://api.github.com/repos/openemr/openemr/issues/170","number":170,"state":"open","locked":false,"title":"Added option to Appointment  Display Sets","user":{"login":"epsdky","id":8593654,"avatar_url":"https://avatars.githubusercontent.com/u/8593654?v=3","gravatar_id":"","url":"https://api.github.com/users/epsdky","html_url":"https://github.com/epsdky","followers_url":"https://api.github.com/users/epsdky/followers","following_url":"https://api.github.com/users/epsdky/following{/other_user}","gists_url":"https://api.github.com/users/epsdky/gists{/gist_id}","starred_url":"https://api.github.com/users/epsdky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epsdky/subscriptions","organizations_url":"https://api.github.com/users/epsdky/orgs","repos_url":"https://api.github.com/users/epsdky/repos","events_url":"https://api.github.com/users/epsdky/events{/privacy}","received_events_url":"https://api.github.com/users/epsdky/received_events","type":"User","site_admin":false},"body":"Option added to Appointment Display Sets to allow the last set to expand past the appointment display limit.","created_at":"2016-08-07T20:24:23Z","updated_at":"2016-08-08T08:30:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3594e6460c4e71dc80e6fcfc02e1768eef212399","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openemr/openemr/pulls/170/commits","review_comments_url":"https://api.github.com/repos/openemr/openemr/pulls/170/comments","review_comment_url":"https://api.github.com/repos/openemr/openemr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openemr/openemr/issues/170/comments","statuses_url":"https://api.github.com/repos/openemr/openemr/statuses/8f14357bad82faf21f33521d562afcae5a0a7efb","head":{"label":"epsdky:Appt-display-sets-option-added","ref":"Appt-display-sets-option-added","sha":"8f14357bad82faf21f33521d562afcae5a0a7efb","user":{"login":"epsdky","id":8593654,"avatar_url":"https://avatars.githubusercontent.com/u/8593654?v=3","gravatar_id":"","url":"https://api.github.com/users/epsdky","html_url":"https://github.com/epsdky","followers_url":"https://api.github.com/users/epsdky/followers","following_url":"https://api.github.com/users/epsdky/following{/other_user}","gists_url":"https://api.github.com/users/epsdky/gists{/gist_id}","starred_url":"https://api.github.com/users/epsdky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epsdky/subscriptions","organizations_url":"https://api.github.com/users/epsdky/orgs","repos_url":"https://api.github.com/users/epsdky/repos","events_url":"https://api.github.com/users/epsdky/events{/privacy}","received_events_url":"https://api.github.com/users/epsdky/received_events","type":"User","site_admin":false},"repo":{"id":39649918,"name":"openemr","full_name":"epsdky/openemr","owner":{"login":"epsdky","id":8593654,"avatar_url":"https://avatars.githubusercontent.com/u/8593654?v=3","gravatar_id":"","url":"https://api.github.com/users/epsdky","html_url":"https://github.com/epsdky","followers_url":"https://api.github.com/users/epsdky/followers","following_url":"https://api.github.com/users/epsdky/following{/other_user}","gists_url":"https://api.github.com/users/epsdky/gists{/gist_id}","starred_url":"https://api.github.com/users/epsdky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epsdky/subscriptions","organizations_url":"https://api.github.com/users/epsdky/orgs","repos_url":"https://api.github.com/users/epsdky/repos","events_url":"https://api.github.com/users/epsdky/events{/privacy}","received_events_url":"https://api.github.com/users/epsdky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/epsdky/openemr","description":"Mirror of official OpenEMR Sourceforge repository","fork":true,"url":"https://api.github.com/repos/epsdky/openemr","forks_url":"https://api.github.com/repos/epsdky/openemr/forks","keys_url":"https://api.github.com/repos/epsdky/openemr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/epsdky/openemr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/epsdky/openemr/teams","hooks_url":"https://api.github.com/repos/epsdky/openemr/hooks","issue_events_url":"https://api.github.com/repos/epsdky/openemr/issues/events{/number}","events_url":"https://api.github.com/repos/epsdky/openemr/events","assignees_url":"https://api.github.com/repos/epsdky/openemr/assignees{/user}","branches_url":"https://api.github.com/repos/epsdky/openemr/branches{/branch}","tags_url":"https://api.github.com/repos/epsdky/openemr/tags","blobs_url":"https://api.github.com/repos/epsdky/openemr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/epsdky/openemr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/epsdky/openemr/git/refs{/sha}","trees_url":"https://api.github.com/repos/epsdky/openemr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/epsdky/openemr/statuses/{sha}","languages_url":"https://api.github.com/repos/epsdky/openemr/languages","stargazers_url":"https://api.github.com/repos/epsdky/openemr/stargazers","contributors_url":"https://api.github.com/repos/epsdky/openemr/contributors","subscribers_url":"https://api.github.com/repos/epsdky/openemr/subscribers","subscription_url":"https://api.github.com/repos/epsdky/openemr/subscription","commits_url":"https://api.github.com/repos/epsdky/openemr/commits{/sha}","git_commits_url":"https://api.github.com/repos/epsdky/openemr/git/commits{/sha}","comments_url":"https://api.github.com/repos/epsdky/openemr/comments{/number}","issue_comment_url":"https://api.github.com/repos/epsdky/openemr/issues/comments{/number}","contents_url":"https://api.github.com/repos/epsdky/openemr/contents/{+path}","compare_url":"https://api.github.com/repos/epsdky/openemr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/epsdky/openemr/merges","archive_url":"https://api.github.com/repos/epsdky/openemr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/epsdky/openemr/downloads","issues_url":"https://api.github.com/repos/epsdky/openemr/issues{/number}","pulls_url":"https://api.github.com/repos/epsdky/openemr/pulls{/number}","milestones_url":"https://api.github.com/repos/epsdky/openemr/milestones{/number}","notifications_url":"https://api.github.com/repos/epsdky/openemr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/epsdky/openemr/labels{/name}","releases_url":"https://api.github.com/repos/epsdky/openemr/releases{/id}","deployments_url":"https://api.github.com/repos/epsdky/openemr/deployments","created_at":"2015-07-24T18:20:49Z","updated_at":"2016-05-05T19:26:43Z","pushed_at":"2016-08-07T20:12:37Z","git_url":"git://github.com/epsdky/openemr.git","ssh_url":"git@github.com:epsdky/openemr.git","clone_url":"https://github.com/epsdky/openemr.git","svn_url":"https://github.com/epsdky/openemr","homepage":"http://open-emr.org/","size":255117,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openemr:master","ref":"master","sha":"addd1c9bbef7ae260dfc8ae9380dfd8ea2b05603","user":{"login":"openemr","id":283089,"avatar_url":"https://avatars.githubusercontent.com/u/283089?v=3","gravatar_id":"","url":"https://api.github.com/users/openemr","html_url":"https://github.com/openemr","followers_url":"https://api.github.com/users/openemr/followers","following_url":"https://api.github.com/users/openemr/following{/other_user}","gists_url":"https://api.github.com/users/openemr/gists{/gist_id}","starred_url":"https://api.github.com/users/openemr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openemr/subscriptions","organizations_url":"https://api.github.com/users/openemr/orgs","repos_url":"https://api.github.com/users/openemr/repos","events_url":"https://api.github.com/users/openemr/events{/privacy}","received_events_url":"https://api.github.com/users/openemr/received_events","type":"User","site_admin":false},"repo":{"id":679584,"name":"openemr","full_name":"openemr/openemr","owner":{"login":"openemr","id":283089,"avatar_url":"https://avatars.githubusercontent.com/u/283089?v=3","gravatar_id":"","url":"https://api.github.com/users/openemr","html_url":"https://github.com/openemr","followers_url":"https://api.github.com/users/openemr/followers","following_url":"https://api.github.com/users/openemr/following{/other_user}","gists_url":"https://api.github.com/users/openemr/gists{/gist_id}","starred_url":"https://api.github.com/users/openemr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openemr/subscriptions","organizations_url":"https://api.github.com/users/openemr/orgs","repos_url":"https://api.github.com/users/openemr/repos","events_url":"https://api.github.com/users/openemr/events{/privacy}","received_events_url":"https://api.github.com/users/openemr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/openemr/openemr","description":"Mirror of official OpenEMR Sourceforge repository","fork":false,"url":"https://api.github.com/repos/openemr/openemr","forks_url":"https://api.github.com/repos/openemr/openemr/forks","keys_url":"https://api.github.com/repos/openemr/openemr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openemr/openemr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openemr/openemr/teams","hooks_url":"https://api.github.com/repos/openemr/openemr/hooks","issue_events_url":"https://api.github.com/repos/openemr/openemr/issues/events{/number}","events_url":"https://api.github.com/repos/openemr/openemr/events","assignees_url":"https://api.github.com/repos/openemr/openemr/assignees{/user}","branches_url":"https://api.github.com/repos/openemr/openemr/branches{/branch}","tags_url":"https://api.github.com/repos/openemr/openemr/tags","blobs_url":"https://api.github.com/repos/openemr/openemr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openemr/openemr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openemr/openemr/git/refs{/sha}","trees_url":"https://api.github.com/repos/openemr/openemr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openemr/openemr/statuses/{sha}","languages_url":"https://api.github.com/repos/openemr/openemr/languages","stargazers_url":"https://api.github.com/repos/openemr/openemr/stargazers","contributors_url":"https://api.github.com/repos/openemr/openemr/contributors","subscribers_url":"https://api.github.com/repos/openemr/openemr/subscribers","subscription_url":"https://api.github.com/repos/openemr/openemr/subscription","commits_url":"https://api.github.com/repos/openemr/openemr/commits{/sha}","git_commits_url":"https://api.github.com/repos/openemr/openemr/git/commits{/sha}","comments_url":"https://api.github.com/repos/openemr/openemr/comments{/number}","issue_comment_url":"https://api.github.com/repos/openemr/openemr/issues/comments{/number}","contents_url":"https://api.github.com/repos/openemr/openemr/contents/{+path}","compare_url":"https://api.github.com/repos/openemr/openemr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openemr/openemr/merges","archive_url":"https://api.github.com/repos/openemr/openemr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openemr/openemr/downloads","issues_url":"https://api.github.com/repos/openemr/openemr/issues{/number}","pulls_url":"https://api.github.com/repos/openemr/openemr/pulls{/number}","milestones_url":"https://api.github.com/repos/openemr/openemr/milestones{/number}","notifications_url":"https://api.github.com/repos/openemr/openemr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openemr/openemr/labels{/name}","releases_url":"https://api.github.com/repos/openemr/openemr/releases{/id}","deployments_url":"https://api.github.com/repos/openemr/openemr/deployments","created_at":"2010-05-21T19:54:08Z","updated_at":"2016-07-26T06:27:42Z","pushed_at":"2016-08-08T08:01:34Z","git_url":"git://github.com/openemr/openemr.git","ssh_url":"git@github.com:openemr/openemr.git","clone_url":"https://github.com/openemr/openemr.git","svn_url":"https://github.com/openemr/openemr","homepage":"http://open-emr.org/","size":279223,"stargazers_count":294,"watchers_count":294,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":445,"mirror_url":null,"open_issues_count":45,"forks":445,"open_issues":45,"watchers":294,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openemr/openemr/pulls/170"},"html":{"href":"https://github.com/openemr/openemr/pull/170"},"issue":{"href":"https://api.github.com/repos/openemr/openemr/issues/170"},"comments":{"href":"https://api.github.com/repos/openemr/openemr/issues/170/comments"},"review_comments":{"href":"https://api.github.com/repos/openemr/openemr/pulls/170/comments"},"review_comment":{"href":"https://api.github.com/repos/openemr/openemr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openemr/openemr/pulls/170/commits"},"statuses":{"href":"https://api.github.com/repos/openemr/openemr/statuses/8f14357bad82faf21f33521d562afcae5a0a7efb"}}}}
{"actor":{"display_login":"bradymiller"}}