{"action":"created","comment":{"url":"https://api.github.com/repos/aces/Loris/pulls/comments/24434010","id":24434010,"diff_hunk":"@@ -199,6 +229,110 @@ function _addMRIFeedback($current_feedback, $scan_type, $mri_feedback)\n     }\n \n     /**\n+    * Gets the date according to the type\n+    *\n+    * @param MRIFile $file  file object\n+    * @param string  $type  type of the date\n+    * @param array   $array array containing the date\n+    *\n+    * @return date if exists, if not an empty string\n+    */\n+    function _getDate($file, $type, $array)\n+    {\n+        if (preg_match(\n+            \"/(\\d{4})-?(\\d{2})-?(\\d{2})/\", \n+            $file->getParameter($type), $array\n+        )) {\n+            return (mktime(12, 0, 0, $array[2], $array[3], $array[1]));\n+        } else {\n+            return \"\";\n+        }\n+    }\n+\n+    /**\n+    * Gets a rejected parameter according to its type\n+    *\n+    * @param MRIFile $file  file object\n+    * @param string  $type  type of the rejected\n+    * @param array   $array array containing rejected\n+    *\n+    * @return parameter of the rejected\n+    */\n+    function _getRejected($file, $type, $array)\n+    {\n+        $parameter = 'processing:' . $type . '_rejected';\n+        if (preg_match(\n+            \"/(Directions)([^\\(]+)(\\(\\d+\\))/\",\n+            $file->getParameter($parameter), $array\n+        )) {\n+            $dirList = preg_split('/\\,/', $array[2]);\n+            if (count($dirList) > 1) {\n+                sort($dirList);\n+            }","path":"tools/CouchDB_Import_MRI.php","position":89,"original_position":89,"commit_id":"37e91fdedab80253b6d8e7a1b1143595bf0eed8a","original_commit_id":"37e91fdedab80253b6d8e7a1b1143595bf0eed8a","user":{"login":"driusan","id":498329,"avatar_url":"https://avatars.githubusercontent.com/u/498329?v=3","gravatar_id":"","url":"https://api.github.com/users/driusan","html_url":"https://github.com/driusan","followers_url":"https://api.github.com/users/driusan/followers","following_url":"https://api.github.com/users/driusan/following{/other_user}","gists_url":"https://api.github.com/users/driusan/gists{/gist_id}","starred_url":"https://api.github.com/users/driusan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/driusan/subscriptions","organizations_url":"https://api.github.com/users/driusan/orgs","repos_url":"https://api.github.com/users/driusan/repos","events_url":"https://api.github.com/users/driusan/events{/privacy}","received_events_url":"https://api.github.com/users/driusan/received_events","type":"User","site_admin":false},"body":"This code is a little obtuse. What's this trying to accomplish that just directly returning getParameter wouldn't? What/why is it sorting? There should be a comment explaining what's going on here.","created_at":"2015-02-10T18:00:12Z","updated_at":"2015-02-10T18:00:12Z","html_url":"https://github.com/aces/Loris/pull/918#discussion_r24434010","pull_request_url":"https://api.github.com/repos/aces/Loris/pulls/918","_links":{"self":{"href":"https://api.github.com/repos/aces/Loris/pulls/comments/24434010"},"html":{"href":"https://github.com/aces/Loris/pull/918#discussion_r24434010"},"pull_request":{"href":"https://api.github.com/repos/aces/Loris/pulls/918"}}},"pull_request":{"url":"https://api.github.com/repos/aces/Loris/pulls/918","id":28593701,"html_url":"https://github.com/aces/Loris/pull/918","diff_url":"https://github.com/aces/Loris/pull/918.diff","patch_url":"https://github.com/aces/Loris/pull/918.patch","issue_url":"https://api.github.com/repos/aces/Loris/issues/918","number":918,"state":"open","locked":false,"title":"adding code to include mri header info","user":{"login":"rathisekaran","id":3045167,"avatar_url":"https://avatars.githubusercontent.com/u/3045167?v=3","gravatar_id":"","url":"https://api.github.com/users/rathisekaran","html_url":"https://github.com/rathisekaran","followers_url":"https://api.github.com/users/rathisekaran/followers","following_url":"https://api.github.com/users/rathisekaran/following{/other_user}","gists_url":"https://api.github.com/users/rathisekaran/gists{/gist_id}","starred_url":"https://api.github.com/users/rathisekaran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rathisekaran/subscriptions","organizations_url":"https://api.github.com/users/rathisekaran/orgs","repos_url":"https://api.github.com/users/rathisekaran/repos","events_url":"https://api.github.com/users/rathisekaran/events{/privacy}","received_events_url":"https://api.github.com/users/rathisekaran/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-03T22:06:19Z","updated_at":"2015-02-10T18:00:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0382bfb049790e1d877d5ae2edc80a7685c8f05d","assignee":{"login":"driusan","id":498329,"avatar_url":"https://avatars.githubusercontent.com/u/498329?v=3","gravatar_id":"","url":"https://api.github.com/users/driusan","html_url":"https://github.com/driusan","followers_url":"https://api.github.com/users/driusan/followers","following_url":"https://api.github.com/users/driusan/following{/other_user}","gists_url":"https://api.github.com/users/driusan/gists{/gist_id}","starred_url":"https://api.github.com/users/driusan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/driusan/subscriptions","organizations_url":"https://api.github.com/users/driusan/orgs","repos_url":"https://api.github.com/users/driusan/repos","events_url":"https://api.github.com/users/driusan/events{/privacy}","received_events_url":"https://api.github.com/users/driusan/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/aces/Loris/milestones/2","labels_url":"https://api.github.com/repos/aces/Loris/milestones/2/labels","id":906132,"number":2,"title":"15.04","description":"The upcoming 15.04 Loris release","creator":{"login":"driusan","id":498329,"avatar_url":"https://avatars.githubusercontent.com/u/498329?v=3","gravatar_id":"","url":"https://api.github.com/users/driusan","html_url":"https://github.com/driusan","followers_url":"https://api.github.com/users/driusan/followers","following_url":"https://api.github.com/users/driusan/following{/other_user}","gists_url":"https://api.github.com/users/driusan/gists{/gist_id}","starred_url":"https://api.github.com/users/driusan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/driusan/subscriptions","organizations_url":"https://api.github.com/users/driusan/orgs","repos_url":"https://api.github.com/users/driusan/repos","events_url":"https://api.github.com/users/driusan/events{/privacy}","received_events_url":"https://api.github.com/users/driusan/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":36,"state":"open","created_at":"2014-12-16T20:47:35Z","updated_at":"2015-02-10T16:49:26Z","due_on":"2015-04-15T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/aces/Loris/pulls/918/commits","review_comments_url":"https://api.github.com/repos/aces/Loris/pulls/918/comments","review_comment_url":"https://api.github.com/repos/aces/Loris/pulls/comments/{number}","comments_url":"https://api.github.com/repos/aces/Loris/issues/918/comments","statuses_url":"https://api.github.com/repos/aces/Loris/statuses/37e91fdedab80253b6d8e7a1b1143595bf0eed8a","head":{"label":"rathisekaran:add_mri_headerinfo","ref":"add_mri_headerinfo","sha":"37e91fdedab80253b6d8e7a1b1143595bf0eed8a","user":{"login":"rathisekaran","id":3045167,"avatar_url":"https://avatars.githubusercontent.com/u/3045167?v=3","gravatar_id":"","url":"https://api.github.com/users/rathisekaran","html_url":"https://github.com/rathisekaran","followers_url":"https://api.github.com/users/rathisekaran/followers","following_url":"https://api.github.com/users/rathisekaran/following{/other_user}","gists_url":"https://api.github.com/users/rathisekaran/gists{/gist_id}","starred_url":"https://api.github.com/users/rathisekaran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rathisekaran/subscriptions","organizations_url":"https://api.github.com/users/rathisekaran/orgs","repos_url":"https://api.github.com/users/rathisekaran/repos","events_url":"https://api.github.com/users/rathisekaran/events{/privacy}","received_events_url":"https://api.github.com/users/rathisekaran/received_events","type":"User","site_admin":false},"repo":{"id":25537393,"name":"Loris","full_name":"rathisekaran/Loris","owner":{"login":"rathisekaran","id":3045167,"avatar_url":"https://avatars.githubusercontent.com/u/3045167?v=3","gravatar_id":"","url":"https://api.github.com/users/rathisekaran","html_url":"https://github.com/rathisekaran","followers_url":"https://api.github.com/users/rathisekaran/followers","following_url":"https://api.github.com/users/rathisekaran/following{/other_user}","gists_url":"https://api.github.com/users/rathisekaran/gists{/gist_id}","starred_url":"https://api.github.com/users/rathisekaran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rathisekaran/subscriptions","organizations_url":"https://api.github.com/users/rathisekaran/orgs","repos_url":"https://api.github.com/users/rathisekaran/repos","events_url":"https://api.github.com/users/rathisekaran/events{/privacy}","received_events_url":"https://api.github.com/users/rathisekaran/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rathisekaran/Loris","description":"LORIS (Longitudinal Online Research and Imaging System) is a web-accessible database solution for neuroimaging.","fork":true,"url":"https://api.github.com/repos/rathisekaran/Loris","forks_url":"https://api.github.com/repos/rathisekaran/Loris/forks","keys_url":"https://api.github.com/repos/rathisekaran/Loris/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rathisekaran/Loris/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rathisekaran/Loris/teams","hooks_url":"https://api.github.com/repos/rathisekaran/Loris/hooks","issue_events_url":"https://api.github.com/repos/rathisekaran/Loris/issues/events{/number}","events_url":"https://api.github.com/repos/rathisekaran/Loris/events","assignees_url":"https://api.github.com/repos/rathisekaran/Loris/assignees{/user}","branches_url":"https://api.github.com/repos/rathisekaran/Loris/branches{/branch}","tags_url":"https://api.github.com/repos/rathisekaran/Loris/tags","blobs_url":"https://api.github.com/repos/rathisekaran/Loris/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rathisekaran/Loris/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rathisekaran/Loris/git/refs{/sha}","trees_url":"https://api.github.com/repos/rathisekaran/Loris/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rathisekaran/Loris/statuses/{sha}","languages_url":"https://api.github.com/repos/rathisekaran/Loris/languages","stargazers_url":"https://api.github.com/repos/rathisekaran/Loris/stargazers","contributors_url":"https://api.github.com/repos/rathisekaran/Loris/contributors","subscribers_url":"https://api.github.com/repos/rathisekaran/Loris/subscribers","subscription_url":"https://api.github.com/repos/rathisekaran/Loris/subscription","commits_url":"https://api.github.com/repos/rathisekaran/Loris/commits{/sha}","git_commits_url":"https://api.github.com/repos/rathisekaran/Loris/git/commits{/sha}","comments_url":"https://api.github.com/repos/rathisekaran/Loris/comments{/number}","issue_comment_url":"https://api.github.com/repos/rathisekaran/Loris/issues/comments/{number}","contents_url":"https://api.github.com/repos/rathisekaran/Loris/contents/{+path}","compare_url":"https://api.github.com/repos/rathisekaran/Loris/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rathisekaran/Loris/merges","archive_url":"https://api.github.com/repos/rathisekaran/Loris/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rathisekaran/Loris/downloads","issues_url":"https://api.github.com/repos/rathisekaran/Loris/issues{/number}","pulls_url":"https://api.github.com/repos/rathisekaran/Loris/pulls{/number}","milestones_url":"https://api.github.com/repos/rathisekaran/Loris/milestones{/number}","notifications_url":"https://api.github.com/repos/rathisekaran/Loris/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rathisekaran/Loris/labels{/name}","releases_url":"https://api.github.com/repos/rathisekaran/Loris/releases{/id}","created_at":"2014-10-21T18:00:38Z","updated_at":"2014-10-18T14:42:32Z","pushed_at":"2015-02-03T22:18:06Z","git_url":"git://github.com/rathisekaran/Loris.git","ssh_url":"git@github.com:rathisekaran/Loris.git","clone_url":"https://github.com/rathisekaran/Loris.git","svn_url":"https://github.com/rathisekaran/Loris","homepage":"","size":55988,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"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":"aces:master","ref":"master","sha":"8350e495285b369fb153543de97e3b663d2e3968","user":{"login":"aces","id":472868,"avatar_url":"https://avatars.githubusercontent.com/u/472868?v=3","gravatar_id":"","url":"https://api.github.com/users/aces","html_url":"https://github.com/aces","followers_url":"https://api.github.com/users/aces/followers","following_url":"https://api.github.com/users/aces/following{/other_user}","gists_url":"https://api.github.com/users/aces/gists{/gist_id}","starred_url":"https://api.github.com/users/aces/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aces/subscriptions","organizations_url":"https://api.github.com/users/aces/orgs","repos_url":"https://api.github.com/users/aces/repos","events_url":"https://api.github.com/users/aces/events{/privacy}","received_events_url":"https://api.github.com/users/aces/received_events","type":"Organization","site_admin":false},"repo":{"id":1125630,"name":"Loris","full_name":"aces/Loris","owner":{"login":"aces","id":472868,"avatar_url":"https://avatars.githubusercontent.com/u/472868?v=3","gravatar_id":"","url":"https://api.github.com/users/aces","html_url":"https://github.com/aces","followers_url":"https://api.github.com/users/aces/followers","following_url":"https://api.github.com/users/aces/following{/other_user}","gists_url":"https://api.github.com/users/aces/gists{/gist_id}","starred_url":"https://api.github.com/users/aces/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aces/subscriptions","organizations_url":"https://api.github.com/users/aces/orgs","repos_url":"https://api.github.com/users/aces/repos","events_url":"https://api.github.com/users/aces/events{/privacy}","received_events_url":"https://api.github.com/users/aces/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aces/Loris","description":"LORIS (Longitudinal Online Research and Imaging System) is a web-accessible database solution for neuroimaging.","fork":false,"url":"https://api.github.com/repos/aces/Loris","forks_url":"https://api.github.com/repos/aces/Loris/forks","keys_url":"https://api.github.com/repos/aces/Loris/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aces/Loris/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aces/Loris/teams","hooks_url":"https://api.github.com/repos/aces/Loris/hooks","issue_events_url":"https://api.github.com/repos/aces/Loris/issues/events{/number}","events_url":"https://api.github.com/repos/aces/Loris/events","assignees_url":"https://api.github.com/repos/aces/Loris/assignees{/user}","branches_url":"https://api.github.com/repos/aces/Loris/branches{/branch}","tags_url":"https://api.github.com/repos/aces/Loris/tags","blobs_url":"https://api.github.com/repos/aces/Loris/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aces/Loris/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aces/Loris/git/refs{/sha}","trees_url":"https://api.github.com/repos/aces/Loris/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aces/Loris/statuses/{sha}","languages_url":"https://api.github.com/repos/aces/Loris/languages","stargazers_url":"https://api.github.com/repos/aces/Loris/stargazers","contributors_url":"https://api.github.com/repos/aces/Loris/contributors","subscribers_url":"https://api.github.com/repos/aces/Loris/subscribers","subscription_url":"https://api.github.com/repos/aces/Loris/subscription","commits_url":"https://api.github.com/repos/aces/Loris/commits{/sha}","git_commits_url":"https://api.github.com/repos/aces/Loris/git/commits{/sha}","comments_url":"https://api.github.com/repos/aces/Loris/comments{/number}","issue_comment_url":"https://api.github.com/repos/aces/Loris/issues/comments/{number}","contents_url":"https://api.github.com/repos/aces/Loris/contents/{+path}","compare_url":"https://api.github.com/repos/aces/Loris/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aces/Loris/merges","archive_url":"https://api.github.com/repos/aces/Loris/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aces/Loris/downloads","issues_url":"https://api.github.com/repos/aces/Loris/issues{/number}","pulls_url":"https://api.github.com/repos/aces/Loris/pulls{/number}","milestones_url":"https://api.github.com/repos/aces/Loris/milestones{/number}","notifications_url":"https://api.github.com/repos/aces/Loris/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aces/Loris/labels{/name}","releases_url":"https://api.github.com/repos/aces/Loris/releases{/id}","created_at":"2010-11-30T14:57:57Z","updated_at":"2015-02-10T16:49:27Z","pushed_at":"2015-02-10T16:49:26Z","git_url":"git://github.com/aces/Loris.git","ssh_url":"git@github.com:aces/Loris.git","clone_url":"https://github.com/aces/Loris.git","svn_url":"https://github.com/aces/Loris","homepage":"","size":61348,"stargazers_count":20,"watchers_count":20,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":16,"forks":17,"open_issues":16,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aces/Loris/pulls/918"},"html":{"href":"https://github.com/aces/Loris/pull/918"},"issue":{"href":"https://api.github.com/repos/aces/Loris/issues/918"},"comments":{"href":"https://api.github.com/repos/aces/Loris/issues/918/comments"},"review_comments":{"href":"https://api.github.com/repos/aces/Loris/pulls/918/comments"},"review_comment":{"href":"https://api.github.com/repos/aces/Loris/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/aces/Loris/pulls/918/commits"},"statuses":{"href":"https://api.github.com/repos/aces/Loris/statuses/37e91fdedab80253b6d8e7a1b1143595bf0eed8a"}}}}