{"action":"created","comment":{"url":"https://api.github.com/repos/elabftw/elabftw/pulls/comments/117474942","pull_request_review_id":39188019,"id":117474942,"diff_hunk":"@@ -143,11 +143,15 @@\n         try {\n             $Entity->setId($_POST['id']);\n             $Entity->canOrExplode('write');\n-            $ts = new TrustedTimestamps(new Config(), new Teams($_SESSION['team_id']), $Entity);\n-            if ($ts->timeStamp()) {\n-                echo json_encode(array(\n+            if ($Entity->isTimestampable()) {\n+                $ts = new TrustedTimestamps(new Config(), new Teams($_SESSION['team_id']), $Entity);\n+                if ($ts->timeStamp()) {\n+                    echo json_encode(array(\n                     'res' => true\n                 ));\n+                }\n+            } else {\n+                throw new Exception(_('This experiment cannot be timestamped!'));","path":"app/controllers/ExperimentsController.php","position":15,"original_position":15,"commit_id":"aa348d08bf1386bedc8114f3ff5eda454a95951a","original_commit_id":"aa348d08bf1386bedc8114f3ff5eda454a95951a","user":{"login":"NicolasCARPi","id":3043706,"avatar_url":"https://avatars0.githubusercontent.com/u/3043706?v=3","gravatar_id":"","url":"https://api.github.com/users/NicolasCARPi","html_url":"https://github.com/NicolasCARPi","followers_url":"https://api.github.com/users/NicolasCARPi/followers","following_url":"https://api.github.com/users/NicolasCARPi/following{/other_user}","gists_url":"https://api.github.com/users/NicolasCARPi/gists{/gist_id}","starred_url":"https://api.github.com/users/NicolasCARPi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NicolasCARPi/subscriptions","organizations_url":"https://api.github.com/users/NicolasCARPi/orgs","repos_url":"https://api.github.com/users/NicolasCARPi/repos","events_url":"https://api.github.com/users/NicolasCARPi/events{/privacy}","received_events_url":"https://api.github.com/users/NicolasCARPi/received_events","type":"User","site_admin":false},"body":"This is called by ajax, so throwing an exception here is useless. It's better to reply a json message with res:false and msg:errormsg.","created_at":"2017-05-19T13:03:29Z","updated_at":"2017-05-19T13:13:01Z","html_url":"https://github.com/elabftw/elabftw/pull/395#discussion_r117474942","pull_request_url":"https://api.github.com/repos/elabftw/elabftw/pulls/395","_links":{"self":{"href":"https://api.github.com/repos/elabftw/elabftw/pulls/comments/117474942"},"html":{"href":"https://github.com/elabftw/elabftw/pull/395#discussion_r117474942"},"pull_request":{"href":"https://api.github.com/repos/elabftw/elabftw/pulls/395"}}},"pull_request":{"url":"https://api.github.com/repos/elabftw/elabftw/pulls/395","id":121384647,"html_url":"https://github.com/elabftw/elabftw/pull/395","diff_url":"https://github.com/elabftw/elabftw/pull/395.diff","patch_url":"https://github.com/elabftw/elabftw/pull/395.patch","issue_url":"https://api.github.com/repos/elabftw/elabftw/issues/395","number":395,"state":"open","locked":false,"title":"Allow timestamping for specific status types only","user":{"login":"Athemis","id":552653,"avatar_url":"https://avatars3.githubusercontent.com/u/552653?v=3","gravatar_id":"","url":"https://api.github.com/users/Athemis","html_url":"https://github.com/Athemis","followers_url":"https://api.github.com/users/Athemis/followers","following_url":"https://api.github.com/users/Athemis/following{/other_user}","gists_url":"https://api.github.com/users/Athemis/gists{/gist_id}","starred_url":"https://api.github.com/users/Athemis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Athemis/subscriptions","organizations_url":"https://api.github.com/users/Athemis/orgs","repos_url":"https://api.github.com/users/Athemis/repos","events_url":"https://api.github.com/users/Athemis/events{/privacy}","received_events_url":"https://api.github.com/users/Athemis/received_events","type":"User","site_admin":false},"body":"This pull request add the ability to allow/disallow timestamps for certain status types. On new installations, timestamping is forbidden for the default status \"Running\". On existing installations, all status types are allowed to be timestamped to be consistent with current behaviour.\r\n\r\nTimestamping can be controlled via the \"Status\" tab in the admin panel. For experiments with a status type that does not allow timestamping, the stamp button will be hidden. If timestamping in this case is tried by other means (e.g. direct POST request), an error is thrown.\r\n\r\nThis closes #390. ","created_at":"2017-05-18T21:45:31Z","updated_at":"2017-05-19T13:13:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"35cb078db79f91a7a2bec456bde40d4be13a256a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/elabftw/elabftw/pulls/395/commits","review_comments_url":"https://api.github.com/repos/elabftw/elabftw/pulls/395/comments","review_comment_url":"https://api.github.com/repos/elabftw/elabftw/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elabftw/elabftw/issues/395/comments","statuses_url":"https://api.github.com/repos/elabftw/elabftw/statuses/aa348d08bf1386bedc8114f3ff5eda454a95951a","head":{"label":"Athemis:control_ts","ref":"control_ts","sha":"aa348d08bf1386bedc8114f3ff5eda454a95951a","user":{"login":"Athemis","id":552653,"avatar_url":"https://avatars3.githubusercontent.com/u/552653?v=3","gravatar_id":"","url":"https://api.github.com/users/Athemis","html_url":"https://github.com/Athemis","followers_url":"https://api.github.com/users/Athemis/followers","following_url":"https://api.github.com/users/Athemis/following{/other_user}","gists_url":"https://api.github.com/users/Athemis/gists{/gist_id}","starred_url":"https://api.github.com/users/Athemis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Athemis/subscriptions","organizations_url":"https://api.github.com/users/Athemis/orgs","repos_url":"https://api.github.com/users/Athemis/repos","events_url":"https://api.github.com/users/Athemis/events{/privacy}","received_events_url":"https://api.github.com/users/Athemis/received_events","type":"User","site_admin":false},"repo":{"id":31231723,"name":"elabftw","full_name":"Athemis/elabftw","owner":{"login":"Athemis","id":552653,"avatar_url":"https://avatars3.githubusercontent.com/u/552653?v=3","gravatar_id":"","url":"https://api.github.com/users/Athemis","html_url":"https://github.com/Athemis","followers_url":"https://api.github.com/users/Athemis/followers","following_url":"https://api.github.com/users/Athemis/following{/other_user}","gists_url":"https://api.github.com/users/Athemis/gists{/gist_id}","starred_url":"https://api.github.com/users/Athemis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Athemis/subscriptions","organizations_url":"https://api.github.com/users/Athemis/orgs","repos_url":"https://api.github.com/users/Athemis/repos","events_url":"https://api.github.com/users/Athemis/events{/privacy}","received_events_url":"https://api.github.com/users/Athemis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Athemis/elabftw","description":"Lab manager, experiment notebook, database for research labs","fork":true,"url":"https://api.github.com/repos/Athemis/elabftw","forks_url":"https://api.github.com/repos/Athemis/elabftw/forks","keys_url":"https://api.github.com/repos/Athemis/elabftw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Athemis/elabftw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Athemis/elabftw/teams","hooks_url":"https://api.github.com/repos/Athemis/elabftw/hooks","issue_events_url":"https://api.github.com/repos/Athemis/elabftw/issues/events{/number}","events_url":"https://api.github.com/repos/Athemis/elabftw/events","assignees_url":"https://api.github.com/repos/Athemis/elabftw/assignees{/user}","branches_url":"https://api.github.com/repos/Athemis/elabftw/branches{/branch}","tags_url":"https://api.github.com/repos/Athemis/elabftw/tags","blobs_url":"https://api.github.com/repos/Athemis/elabftw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Athemis/elabftw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Athemis/elabftw/git/refs{/sha}","trees_url":"https://api.github.com/repos/Athemis/elabftw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Athemis/elabftw/statuses/{sha}","languages_url":"https://api.github.com/repos/Athemis/elabftw/languages","stargazers_url":"https://api.github.com/repos/Athemis/elabftw/stargazers","contributors_url":"https://api.github.com/repos/Athemis/elabftw/contributors","subscribers_url":"https://api.github.com/repos/Athemis/elabftw/subscribers","subscription_url":"https://api.github.com/repos/Athemis/elabftw/subscription","commits_url":"https://api.github.com/repos/Athemis/elabftw/commits{/sha}","git_commits_url":"https://api.github.com/repos/Athemis/elabftw/git/commits{/sha}","comments_url":"https://api.github.com/repos/Athemis/elabftw/comments{/number}","issue_comment_url":"https://api.github.com/repos/Athemis/elabftw/issues/comments{/number}","contents_url":"https://api.github.com/repos/Athemis/elabftw/contents/{+path}","compare_url":"https://api.github.com/repos/Athemis/elabftw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Athemis/elabftw/merges","archive_url":"https://api.github.com/repos/Athemis/elabftw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Athemis/elabftw/downloads","issues_url":"https://api.github.com/repos/Athemis/elabftw/issues{/number}","pulls_url":"https://api.github.com/repos/Athemis/elabftw/pulls{/number}","milestones_url":"https://api.github.com/repos/Athemis/elabftw/milestones{/number}","notifications_url":"https://api.github.com/repos/Athemis/elabftw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Athemis/elabftw/labels{/name}","releases_url":"https://api.github.com/repos/Athemis/elabftw/releases{/id}","deployments_url":"https://api.github.com/repos/Athemis/elabftw/deployments","created_at":"2015-02-23T21:51:55Z","updated_at":"2015-02-23T21:51:57Z","pushed_at":"2017-05-18T21:32:11Z","git_url":"git://github.com/Athemis/elabftw.git","ssh_url":"git@github.com:Athemis/elabftw.git","clone_url":"https://github.com/Athemis/elabftw.git","svn_url":"https://github.com/Athemis/elabftw","homepage":"http://www.elabftw.net","size":212926,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"elabftw:hypernext","ref":"hypernext","sha":"a196c628258b708997a0b9a6b949b2fcb9f1adad","user":{"login":"elabftw","id":7669213,"avatar_url":"https://avatars1.githubusercontent.com/u/7669213?v=3","gravatar_id":"","url":"https://api.github.com/users/elabftw","html_url":"https://github.com/elabftw","followers_url":"https://api.github.com/users/elabftw/followers","following_url":"https://api.github.com/users/elabftw/following{/other_user}","gists_url":"https://api.github.com/users/elabftw/gists{/gist_id}","starred_url":"https://api.github.com/users/elabftw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elabftw/subscriptions","organizations_url":"https://api.github.com/users/elabftw/orgs","repos_url":"https://api.github.com/users/elabftw/repos","events_url":"https://api.github.com/users/elabftw/events{/privacy}","received_events_url":"https://api.github.com/users/elabftw/received_events","type":"Organization","site_admin":false},"repo":{"id":7167597,"name":"elabftw","full_name":"elabftw/elabftw","owner":{"login":"elabftw","id":7669213,"avatar_url":"https://avatars1.githubusercontent.com/u/7669213?v=3","gravatar_id":"","url":"https://api.github.com/users/elabftw","html_url":"https://github.com/elabftw","followers_url":"https://api.github.com/users/elabftw/followers","following_url":"https://api.github.com/users/elabftw/following{/other_user}","gists_url":"https://api.github.com/users/elabftw/gists{/gist_id}","starred_url":"https://api.github.com/users/elabftw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elabftw/subscriptions","organizations_url":"https://api.github.com/users/elabftw/orgs","repos_url":"https://api.github.com/users/elabftw/repos","events_url":"https://api.github.com/users/elabftw/events{/privacy}","received_events_url":"https://api.github.com/users/elabftw/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elabftw/elabftw","description":"Lab manager, experiment notebook, database for research labs","fork":false,"url":"https://api.github.com/repos/elabftw/elabftw","forks_url":"https://api.github.com/repos/elabftw/elabftw/forks","keys_url":"https://api.github.com/repos/elabftw/elabftw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elabftw/elabftw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elabftw/elabftw/teams","hooks_url":"https://api.github.com/repos/elabftw/elabftw/hooks","issue_events_url":"https://api.github.com/repos/elabftw/elabftw/issues/events{/number}","events_url":"https://api.github.com/repos/elabftw/elabftw/events","assignees_url":"https://api.github.com/repos/elabftw/elabftw/assignees{/user}","branches_url":"https://api.github.com/repos/elabftw/elabftw/branches{/branch}","tags_url":"https://api.github.com/repos/elabftw/elabftw/tags","blobs_url":"https://api.github.com/repos/elabftw/elabftw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elabftw/elabftw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elabftw/elabftw/git/refs{/sha}","trees_url":"https://api.github.com/repos/elabftw/elabftw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elabftw/elabftw/statuses/{sha}","languages_url":"https://api.github.com/repos/elabftw/elabftw/languages","stargazers_url":"https://api.github.com/repos/elabftw/elabftw/stargazers","contributors_url":"https://api.github.com/repos/elabftw/elabftw/contributors","subscribers_url":"https://api.github.com/repos/elabftw/elabftw/subscribers","subscription_url":"https://api.github.com/repos/elabftw/elabftw/subscription","commits_url":"https://api.github.com/repos/elabftw/elabftw/commits{/sha}","git_commits_url":"https://api.github.com/repos/elabftw/elabftw/git/commits{/sha}","comments_url":"https://api.github.com/repos/elabftw/elabftw/comments{/number}","issue_comment_url":"https://api.github.com/repos/elabftw/elabftw/issues/comments{/number}","contents_url":"https://api.github.com/repos/elabftw/elabftw/contents/{+path}","compare_url":"https://api.github.com/repos/elabftw/elabftw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elabftw/elabftw/merges","archive_url":"https://api.github.com/repos/elabftw/elabftw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elabftw/elabftw/downloads","issues_url":"https://api.github.com/repos/elabftw/elabftw/issues{/number}","pulls_url":"https://api.github.com/repos/elabftw/elabftw/pulls{/number}","milestones_url":"https://api.github.com/repos/elabftw/elabftw/milestones{/number}","notifications_url":"https://api.github.com/repos/elabftw/elabftw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elabftw/elabftw/labels{/name}","releases_url":"https://api.github.com/repos/elabftw/elabftw/releases{/id}","deployments_url":"https://api.github.com/repos/elabftw/elabftw/deployments","created_at":"2012-12-14T15:41:21Z","updated_at":"2017-05-15T18:53:19Z","pushed_at":"2017-05-18T21:45:32Z","git_url":"git://github.com/elabftw/elabftw.git","ssh_url":"git@github.com:elabftw/elabftw.git","clone_url":"https://github.com/elabftw/elabftw.git","svn_url":"https://github.com/elabftw/elabftw","homepage":"https://www.elabftw.net","size":171821,"stargazers_count":113,"watchers_count":113,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":24,"forks":52,"open_issues":24,"watchers":113,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elabftw/elabftw/pulls/395"},"html":{"href":"https://github.com/elabftw/elabftw/pull/395"},"issue":{"href":"https://api.github.com/repos/elabftw/elabftw/issues/395"},"comments":{"href":"https://api.github.com/repos/elabftw/elabftw/issues/395/comments"},"review_comments":{"href":"https://api.github.com/repos/elabftw/elabftw/pulls/395/comments"},"review_comment":{"href":"https://api.github.com/repos/elabftw/elabftw/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elabftw/elabftw/pulls/395/commits"},"statuses":{"href":"https://api.github.com/repos/elabftw/elabftw/statuses/aa348d08bf1386bedc8114f3ff5eda454a95951a"}}}}
{"actor":{"display_login":"NicolasCARPi"}}