{"action":"created","issue":{"url":"https://api.github.com/repos/snipe/snipe-it/issues/862","labels_url":"https://api.github.com/repos/snipe/snipe-it/issues/862/labels{/name}","comments_url":"https://api.github.com/repos/snipe/snipe-it/issues/862/comments","events_url":"https://api.github.com/repos/snipe/snipe-it/issues/862/events","html_url":"https://github.com/snipe/snipe-it/issues/862","id":90058736,"number":862,"title":"Asset location","user":{"login":"smenghi","id":12327537,"avatar_url":"https://avatars.githubusercontent.com/u/12327537?v=3","gravatar_id":"","url":"https://api.github.com/users/smenghi","html_url":"https://github.com/smenghi","followers_url":"https://api.github.com/users/smenghi/followers","following_url":"https://api.github.com/users/smenghi/following{/other_user}","gists_url":"https://api.github.com/users/smenghi/gists{/gist_id}","starred_url":"https://api.github.com/users/smenghi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smenghi/subscriptions","organizations_url":"https://api.github.com/users/smenghi/orgs","repos_url":"https://api.github.com/users/smenghi/repos","events_url":"https://api.github.com/users/smenghi/events{/privacy}","received_events_url":"https://api.github.com/users/smenghi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-22T10:00:18Z","updated_at":"2015-06-23T02:24:35Z","closed_at":null,"body":"We have the following scenario: The ICT staff works from an office, but assets assigned to them are not all in the same location. If the user (ICT staff) does not have his location set, it would be nice to see the default location of the asset instead. So when ICT checks the inventory they can directly see where the equipment is located.\r\nI'm not sure if this is related to the issue with sub locations or checkout asset to location, but this could avoid additional model changing, only a simple if condition is needed (if user location null, then asset location).\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/22724523-asset-location?utm_campaign=plugin&utm_content=tracker%2F505106&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F505106&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/snipe/snipe-it/issues/comments/114331531","html_url":"https://github.com/snipe/snipe-it/issues/862#issuecomment-114331531","issue_url":"https://api.github.com/repos/snipe/snipe-it/issues/862","id":114331531,"user":{"login":"snipe","id":197404,"avatar_url":"https://avatars.githubusercontent.com/u/197404?v=3","gravatar_id":"","url":"https://api.github.com/users/snipe","html_url":"https://github.com/snipe","followers_url":"https://api.github.com/users/snipe/followers","following_url":"https://api.github.com/users/snipe/following{/other_user}","gists_url":"https://api.github.com/users/snipe/gists{/gist_id}","starred_url":"https://api.github.com/users/snipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snipe/subscriptions","organizations_url":"https://api.github.com/users/snipe/orgs","repos_url":"https://api.github.com/users/snipe/repos","events_url":"https://api.github.com/users/snipe/events{/privacy}","received_events_url":"https://api.github.com/users/snipe/received_events","type":"User","site_admin":false},"created_at":"2015-06-23T02:24:35Z","updated_at":"2015-06-23T02:24:35Z","body":"Hi @smenghi - location is a required field for users (unless you've imported them).\r\n\r\nWhat you're describing should be the current behavior as long as the user has no location assigned, and the asset has a default location defined. \r\n\r\n            if ($assets->assigned_to && $assets->assigneduser->userloc) {\r\n                return link_to('admin/settings/locations/'.$assets->assigneduser->userloc->id.'/edit', $assets->assigneduser->userloc->name);\r\n            } elseif ($assets->defaultLoc){\r\n                return link_to('admin/settings/locations/'.$assets->defaultLoc->id.'/edit', $assets->defaultLoc->name);\r\n            }"}}