{"action":"opened","number":902,"pull_request":{"url":"https://api.github.com/repos/modxcms/evolution/pulls/902","id":92452210,"html_url":"https://github.com/modxcms/evolution/pull/902","diff_url":"https://github.com/modxcms/evolution/pull/902.diff","patch_url":"https://github.com/modxcms/evolution/pull/902.patch","issue_url":"https://api.github.com/repos/modxcms/evolution/issues/902","number":902,"state":"open","locked":false,"title":"New \"lock elements/resources\" feature","user":{"login":"Deesen","id":8569221,"avatar_url":"https://avatars.githubusercontent.com/u/8569221?v=3","gravatar_id":"","url":"https://api.github.com/users/Deesen","html_url":"https://github.com/Deesen","followers_url":"https://api.github.com/users/Deesen/followers","following_url":"https://api.github.com/users/Deesen/following{/other_user}","gists_url":"https://api.github.com/users/Deesen/gists{/gist_id}","starred_url":"https://api.github.com/users/Deesen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deesen/subscriptions","organizations_url":"https://api.github.com/users/Deesen/orgs","repos_url":"https://api.github.com/users/Deesen/repos","events_url":"https://api.github.com/users/Deesen/events{/privacy}","received_events_url":"https://api.github.com/users/Deesen/received_events","type":"User","site_admin":false},"body":"Ref. to #862 I think this solution is now ready for production but of course needs some testing first (I guess for 1.2.1). In my local environment it is already working great and relyable.\r\n\r\nBefore only the last selected resource OR element was locked against further editing using table \"active_users\". This table only saves the last user-action, so it can only lock a single resource or element.\r\n\r\nWith this PR I added a new table \"active_user_locks\" which can store multiple elements / resources. See screenshot-text for more details.\r\n\r\nWhen an admin unlocks a resource or the locks is lost for whatever reason while it was still being edited, the users gets a Java-script alert + a red warning-DIV :\r\n\r\n![lock-lost](https://cloud.githubusercontent.com/assets/8569221/20030008/5b7e04ee-a35c-11e6-99b7-88536bf44187.png)\r\n\r\n**New settings**\r\n\r\n![lock1](https://cloud.githubusercontent.com/assets/8569221/20029942/ca6044a0-a35a-11e6-9a34-9351cfd5bbc5.png)\r\n\r\n------------------------------------\r\n**New permission\"display_locks\"**\r\n\r\n![lock2](https://cloud.githubusercontent.com/assets/8569221/20029961/51d2e780-a35b-11e6-8402-cce654af1f4d.png)\r\n\r\n------------------------------------\r\n**Elements Management with Icons**\r\n\r\n![lock3](https://cloud.githubusercontent.com/assets/8569221/20029966/6ebc02d2-a35b-11e6-99df-a6666c8783a6.png)\r\n\r\n------------------------------------\r\n**Resource Tree & Elements Management with Icons**\r\n\r\n![lock4](https://cloud.githubusercontent.com/assets/8569221/20030028/b14d95a6-a35c-11e6-8a47-a330c61fbe40.png)\r\n\r\n![lock3](https://cloud.githubusercontent.com/assets/8569221/20029966/6ebc02d2-a35b-11e6-99df-a6666c8783a6.png)\r\n\r\n------------------------------------\r\n**Unlocking single element / resource by clicking Lock-Icon**\r\n\r\n![lock5](https://cloud.githubusercontent.com/assets/8569221/20030037/e5ad5c0a-a35c-11e6-8c48-9aac43f8cc35.png)","created_at":"2016-11-05T12:39:07Z","updated_at":"2016-11-05T12:39:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e3c00c02e9f63d630532844425529199a2d6d73","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/modxcms/evolution/pulls/902/commits","review_comments_url":"https://api.github.com/repos/modxcms/evolution/pulls/902/comments","review_comment_url":"https://api.github.com/repos/modxcms/evolution/pulls/comments{/number}","comments_url":"https://api.github.com/repos/modxcms/evolution/issues/902/comments","statuses_url":"https://api.github.com/repos/modxcms/evolution/statuses/75c3d82b2afdde741087a333931ac737f00bf3cf","head":{"label":"Deesen:develop","ref":"develop","sha":"75c3d82b2afdde741087a333931ac737f00bf3cf","user":{"login":"Deesen","id":8569221,"avatar_url":"https://avatars.githubusercontent.com/u/8569221?v=3","gravatar_id":"","url":"https://api.github.com/users/Deesen","html_url":"https://github.com/Deesen","followers_url":"https://api.github.com/users/Deesen/followers","following_url":"https://api.github.com/users/Deesen/following{/other_user}","gists_url":"https://api.github.com/users/Deesen/gists{/gist_id}","starred_url":"https://api.github.com/users/Deesen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deesen/subscriptions","organizations_url":"https://api.github.com/users/Deesen/orgs","repos_url":"https://api.github.com/users/Deesen/repos","events_url":"https://api.github.com/users/Deesen/events{/privacy}","received_events_url":"https://api.github.com/users/Deesen/received_events","type":"User","site_admin":false},"repo":{"id":50949193,"name":"evolution","full_name":"Deesen/evolution","owner":{"login":"Deesen","id":8569221,"avatar_url":"https://avatars.githubusercontent.com/u/8569221?v=3","gravatar_id":"","url":"https://api.github.com/users/Deesen","html_url":"https://github.com/Deesen","followers_url":"https://api.github.com/users/Deesen/followers","following_url":"https://api.github.com/users/Deesen/following{/other_user}","gists_url":"https://api.github.com/users/Deesen/gists{/gist_id}","starred_url":"https://api.github.com/users/Deesen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deesen/subscriptions","organizations_url":"https://api.github.com/users/Deesen/orgs","repos_url":"https://api.github.com/users/Deesen/repos","events_url":"https://api.github.com/users/Deesen/events{/privacy}","received_events_url":"https://api.github.com/users/Deesen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Deesen/evolution","description":"MODX Evolution","fork":true,"url":"https://api.github.com/repos/Deesen/evolution","forks_url":"https://api.github.com/repos/Deesen/evolution/forks","keys_url":"https://api.github.com/repos/Deesen/evolution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Deesen/evolution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Deesen/evolution/teams","hooks_url":"https://api.github.com/repos/Deesen/evolution/hooks","issue_events_url":"https://api.github.com/repos/Deesen/evolution/issues/events{/number}","events_url":"https://api.github.com/repos/Deesen/evolution/events","assignees_url":"https://api.github.com/repos/Deesen/evolution/assignees{/user}","branches_url":"https://api.github.com/repos/Deesen/evolution/branches{/branch}","tags_url":"https://api.github.com/repos/Deesen/evolution/tags","blobs_url":"https://api.github.com/repos/Deesen/evolution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Deesen/evolution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Deesen/evolution/git/refs{/sha}","trees_url":"https://api.github.com/repos/Deesen/evolution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Deesen/evolution/statuses/{sha}","languages_url":"https://api.github.com/repos/Deesen/evolution/languages","stargazers_url":"https://api.github.com/repos/Deesen/evolution/stargazers","contributors_url":"https://api.github.com/repos/Deesen/evolution/contributors","subscribers_url":"https://api.github.com/repos/Deesen/evolution/subscribers","subscription_url":"https://api.github.com/repos/Deesen/evolution/subscription","commits_url":"https://api.github.com/repos/Deesen/evolution/commits{/sha}","git_commits_url":"https://api.github.com/repos/Deesen/evolution/git/commits{/sha}","comments_url":"https://api.github.com/repos/Deesen/evolution/comments{/number}","issue_comment_url":"https://api.github.com/repos/Deesen/evolution/issues/comments{/number}","contents_url":"https://api.github.com/repos/Deesen/evolution/contents/{+path}","compare_url":"https://api.github.com/repos/Deesen/evolution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Deesen/evolution/merges","archive_url":"https://api.github.com/repos/Deesen/evolution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Deesen/evolution/downloads","issues_url":"https://api.github.com/repos/Deesen/evolution/issues{/number}","pulls_url":"https://api.github.com/repos/Deesen/evolution/pulls{/number}","milestones_url":"https://api.github.com/repos/Deesen/evolution/milestones{/number}","notifications_url":"https://api.github.com/repos/Deesen/evolution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Deesen/evolution/labels{/name}","releases_url":"https://api.github.com/repos/Deesen/evolution/releases{/id}","deployments_url":"https://api.github.com/repos/Deesen/evolution/deployments","created_at":"2016-02-02T20:21:54Z","updated_at":"2016-10-22T07:40:30Z","pushed_at":"2016-11-05T12:14:33Z","git_url":"git://github.com/Deesen/evolution.git","ssh_url":"git@github.com:Deesen/evolution.git","clone_url":"https://github.com/Deesen/evolution.git","svn_url":"https://github.com/Deesen/evolution","homepage":"http://rtfm.modx.com/display/Evo1/Home","size":31434,"stargazers_count":1,"watchers_count":1,"language":"PHP","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":1,"default_branch":"develop"}},"base":{"label":"modxcms:develop","ref":"develop","sha":"7dbe2075546d34e883235f8817307c93f36a5a10","user":{"login":"modxcms","id":232723,"avatar_url":"https://avatars.githubusercontent.com/u/232723?v=3","gravatar_id":"","url":"https://api.github.com/users/modxcms","html_url":"https://github.com/modxcms","followers_url":"https://api.github.com/users/modxcms/followers","following_url":"https://api.github.com/users/modxcms/following{/other_user}","gists_url":"https://api.github.com/users/modxcms/gists{/gist_id}","starred_url":"https://api.github.com/users/modxcms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modxcms/subscriptions","organizations_url":"https://api.github.com/users/modxcms/orgs","repos_url":"https://api.github.com/users/modxcms/repos","events_url":"https://api.github.com/users/modxcms/events{/privacy}","received_events_url":"https://api.github.com/users/modxcms/received_events","type":"Organization","site_admin":false},"repo":{"id":817850,"name":"evolution","full_name":"modxcms/evolution","owner":{"login":"modxcms","id":232723,"avatar_url":"https://avatars.githubusercontent.com/u/232723?v=3","gravatar_id":"","url":"https://api.github.com/users/modxcms","html_url":"https://github.com/modxcms","followers_url":"https://api.github.com/users/modxcms/followers","following_url":"https://api.github.com/users/modxcms/following{/other_user}","gists_url":"https://api.github.com/users/modxcms/gists{/gist_id}","starred_url":"https://api.github.com/users/modxcms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modxcms/subscriptions","organizations_url":"https://api.github.com/users/modxcms/orgs","repos_url":"https://api.github.com/users/modxcms/repos","events_url":"https://api.github.com/users/modxcms/events{/privacy}","received_events_url":"https://api.github.com/users/modxcms/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/modxcms/evolution","description":"MODX Evolution","fork":false,"url":"https://api.github.com/repos/modxcms/evolution","forks_url":"https://api.github.com/repos/modxcms/evolution/forks","keys_url":"https://api.github.com/repos/modxcms/evolution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/modxcms/evolution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/modxcms/evolution/teams","hooks_url":"https://api.github.com/repos/modxcms/evolution/hooks","issue_events_url":"https://api.github.com/repos/modxcms/evolution/issues/events{/number}","events_url":"https://api.github.com/repos/modxcms/evolution/events","assignees_url":"https://api.github.com/repos/modxcms/evolution/assignees{/user}","branches_url":"https://api.github.com/repos/modxcms/evolution/branches{/branch}","tags_url":"https://api.github.com/repos/modxcms/evolution/tags","blobs_url":"https://api.github.com/repos/modxcms/evolution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/modxcms/evolution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/modxcms/evolution/git/refs{/sha}","trees_url":"https://api.github.com/repos/modxcms/evolution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/modxcms/evolution/statuses/{sha}","languages_url":"https://api.github.com/repos/modxcms/evolution/languages","stargazers_url":"https://api.github.com/repos/modxcms/evolution/stargazers","contributors_url":"https://api.github.com/repos/modxcms/evolution/contributors","subscribers_url":"https://api.github.com/repos/modxcms/evolution/subscribers","subscription_url":"https://api.github.com/repos/modxcms/evolution/subscription","commits_url":"https://api.github.com/repos/modxcms/evolution/commits{/sha}","git_commits_url":"https://api.github.com/repos/modxcms/evolution/git/commits{/sha}","comments_url":"https://api.github.com/repos/modxcms/evolution/comments{/number}","issue_comment_url":"https://api.github.com/repos/modxcms/evolution/issues/comments{/number}","contents_url":"https://api.github.com/repos/modxcms/evolution/contents/{+path}","compare_url":"https://api.github.com/repos/modxcms/evolution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/modxcms/evolution/merges","archive_url":"https://api.github.com/repos/modxcms/evolution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/modxcms/evolution/downloads","issues_url":"https://api.github.com/repos/modxcms/evolution/issues{/number}","pulls_url":"https://api.github.com/repos/modxcms/evolution/pulls{/number}","milestones_url":"https://api.github.com/repos/modxcms/evolution/milestones{/number}","notifications_url":"https://api.github.com/repos/modxcms/evolution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/modxcms/evolution/labels{/name}","releases_url":"https://api.github.com/repos/modxcms/evolution/releases{/id}","deployments_url":"https://api.github.com/repos/modxcms/evolution/deployments","created_at":"2010-08-04T20:44:39Z","updated_at":"2016-11-02T19:15:25Z","pushed_at":"2016-11-05T12:39:07Z","git_url":"git://github.com/modxcms/evolution.git","ssh_url":"git@github.com:modxcms/evolution.git","clone_url":"https://github.com/modxcms/evolution.git","svn_url":"https://github.com/modxcms/evolution","homepage":"http://rtfm.modx.com/display/Evo1/Home","size":36529,"stargazers_count":160,"watchers_count":160,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":122,"mirror_url":null,"open_issues_count":94,"forks":122,"open_issues":94,"watchers":160,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/modxcms/evolution/pulls/902"},"html":{"href":"https://github.com/modxcms/evolution/pull/902"},"issue":{"href":"https://api.github.com/repos/modxcms/evolution/issues/902"},"comments":{"href":"https://api.github.com/repos/modxcms/evolution/issues/902/comments"},"review_comments":{"href":"https://api.github.com/repos/modxcms/evolution/pulls/902/comments"},"review_comment":{"href":"https://api.github.com/repos/modxcms/evolution/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/modxcms/evolution/pulls/902/commits"},"statuses":{"href":"https://api.github.com/repos/modxcms/evolution/statuses/75c3d82b2afdde741087a333931ac737f00bf3cf"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":20,"additions":486,"deletions":70,"changed_files":22}}
{"actor":{"display_login":"Deesen"}}