Compare commits
279 Commits
v0.3.8-alpha
...
v1.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 0eb6183711 | |||
| cdf5ecc084 | |||
| 0eda46da0c | |||
| 1047c5c8bb | |||
| 5f6f3de25e | |||
| 7833d10006 | |||
| 122b3d89d9 | |||
| 14801eca79 | |||
| 4a4b974f41 | |||
| ab7b828e33 | |||
| b0e87d967a | |||
| a0001fe1ed | |||
| ac5fa1641e | |||
| 7c16dd8c92 | |||
| 294b02127b | |||
| e04cc806d9 | |||
| 2bee522a7c | |||
| 5441dd41f0 | |||
| 7858252fca | |||
| 6c6d31f15a | |||
| 6b2d3efe3e | |||
| 1078dbf5c5 | |||
| 300c262739 | |||
| 25a7b05de6 | |||
| 70d7748229 | |||
| 6315db7fd8 | |||
| 343798d241 | |||
| 5050862979 | |||
| 90baf2eeba | |||
| 0022389463 | |||
| 04123b3fe8 | |||
| 491de30374 | |||
| 0d402f52c8 | |||
| 55cd7c0f81 | |||
| 63656762b0 | |||
| 87a9399b6b | |||
| ed5ff9a01b | |||
| 68bf40a7ea | |||
| 0cf24bdde1 | |||
| 05502cf29d | |||
| 1305ea9597 | |||
| 94e1fcb01b | |||
| 9c01ab334f | |||
| b685ea666c | |||
| ee35948980 | |||
| 569714315c | |||
| f09455117b | |||
| af70559754 | |||
| 07e6d49dce | |||
| 86597bb863 | |||
| 6d057846a1 | |||
| ba9f8c61f1 | |||
| d3266dd4e8 | |||
| 9143ac461f | |||
| 7199d6fd22 | |||
| 2b21b26950 | |||
| c122cc2647 | |||
| ced8610833 | |||
| af63d34412 | |||
| 9e85dcb9fc | |||
| 687c629953 | |||
| 13b3e2c4d4 | |||
| 4d8e663bd1 | |||
| 3e11ea70da | |||
| 86b7b6946f | |||
| 3184c3e03b | |||
| 55eb4325bc | |||
| d4ef8a75b8 | |||
| cf4804a994 | |||
| 22590e2a43 | |||
| d9f86df05f | |||
| 636eb29421 | |||
| 5dea4c7691 | |||
| 672e2e5fd4 | |||
| 42ad3da3d3 | |||
| bb3aa99b9c | |||
| 676155eacb | |||
| 54071d1837 | |||
| 5abc4467df | |||
| ffe095d64b | |||
| ce566509ce | |||
| 84cb51b4c3 | |||
| 9b0d930a21 | |||
| 1680d45163 | |||
| 5e1f61ea2a | |||
| 75d0136d7f | |||
| 30428cb858 | |||
| 26ab53c02c | |||
| d8815b5ef5 | |||
| e8737b156a | |||
| f200e81334 | |||
| 03f3294873 | |||
| da70d5042c | |||
| 239370058c | |||
| 0b4c1b8d83 | |||
| 736c9a1ad7 | |||
| fb46a04d78 | |||
| e9e332e19e | |||
| 16420dafa9 | |||
| 22f81912e4 | |||
| e61f93deb8 | |||
| 8d2b09a647 | |||
| b11a0cb436 | |||
| dd923984ef | |||
| d36c73550b | |||
| bbfc87dddf | |||
| 90497bb6a4 | |||
| 35ce00f6ab | |||
| 3cbd8c9b5d | |||
| 599520dff6 | |||
| 309772e67d | |||
| 139a0a2e2a | |||
| 88459b755f | |||
| e17de3d34f | |||
| a6cd7c0bab | |||
| 062d16b2c0 | |||
| 7f44d6dd47 | |||
| 9125def119 | |||
| 024972e239 | |||
| b0e1ef6024 | |||
| d74bddb51f | |||
| 189523a943 | |||
| 98b96d372d | |||
| 14a9500c6f | |||
| 0e9e659dc4 | |||
| 7bea50feca | |||
| 8f582f29e2 | |||
| cbf23fc455 | |||
| fafd03f00f | |||
| 05fb2a434c | |||
| e43a94586b | |||
| 0d12428140 | |||
| 692c861594 | |||
| c68d76870e | |||
| 255b618559 | |||
| bf1e075551 | |||
| 7c97477a53 | |||
| ee7d9bec70 | |||
| 58a99a2219 | |||
| a829fcf52f | |||
| af450c9bcc | |||
| 5575567726 | |||
| 97724a95e3 | |||
| 2bf57febd8 | |||
| a82a35d921 | |||
| 94ead64386 | |||
| e978038cc0 | |||
| 96e40d72b9 | |||
| 284154a2d7 | |||
| e0da7ffe9b | |||
| 35479bfa40 | |||
| 582a9bf78b | |||
| e8c197c6a5 | |||
| ec658b0cf5 | |||
| 68d44e65d3 | |||
| 6fd0cbe044 | |||
| 4629875bdf | |||
| 297f986c4b | |||
| ccb49f4b23 | |||
| 49c5607e1c | |||
| 13f61e1e8a | |||
| cd4e994ef5 | |||
| 974fb6b9ae | |||
| 4365659a2c | |||
| 363d084bd6 | |||
| 69cd6404f5 | |||
| 229291999f | |||
| 2cb61ab1c5 | |||
| 652f1c746c | |||
| caaa96ec67 | |||
| db49e570fd | |||
| e242f8da0d | |||
| 8d3d8c86b1 | |||
| 144c9eb7f8 | |||
| 9ccc7d756f | |||
| b1fafa7ca4 | |||
| 62a3ed671b | |||
| 7ac06fa004 | |||
| 54c3dfbcce | |||
| 0dfc9660ca | |||
| d6404dc734 | |||
| d482b1ea69 | |||
| 8c7be8fbb3 | |||
| 3944ebddf3 | |||
| 6cfb4ab5d8 | |||
| 64abdddccb | |||
| 23a64cfe26 | |||
| 448b54d8e2 | |||
| 72671d3e1d | |||
| efbe7b0fee | |||
| af083570a0 | |||
| 87c2a4c9c0 | |||
| cb8369e9de | |||
| 6c5bbec44e | |||
| d71a02982d | |||
| b8a4c7e4d6 | |||
| 8197e6174e | |||
| 3de929bb28 | |||
| f2036e0951 | |||
| 213e313e45 | |||
| a695d8513c | |||
| 69fca5d1ed | |||
| 94daba9bab | |||
| 56d619b218 | |||
| dc1033025a | |||
| a4b220d6c3 | |||
| a8c2955218 | |||
| 03cd9f893c | |||
| 4f04b96a13 | |||
| d2d85436ad | |||
| 85cd343bb6 | |||
| 6f6b98186e | |||
| f855be45aa | |||
| ddf946ad5e | |||
| 4a13cded60 | |||
| 27e43eebcb | |||
| 196dbb856e | |||
| 3d91a43554 | |||
| 9df9371ffe | |||
| ca24ef1cd8 | |||
| ac4c905c42 | |||
| 7f48ca04b0 | |||
| 39fff92bdb | |||
| 43b98eff92 | |||
| e203fc516f | |||
| ff61705a8f | |||
| aa8bbb88e9 | |||
| 7d04ded02a | |||
| 04ea0528a8 | |||
| 89000440f3 | |||
| 73b469621f | |||
| e94087d62b | |||
| 21251b4623 | |||
| 381f99543f | |||
| 6f2b78ad9f | |||
| 6043321bed | |||
| 03dffa3541 | |||
| 99003e126a | |||
| 82a84310ed | |||
| 9dc40a3a9c | |||
| 784f7e8dec | |||
| deb9f42ec8 | |||
| beb4d6500a | |||
| 45fa66b41e | |||
| 8eb2523293 | |||
| 2b9494ed82 | |||
| 66c9264fcb | |||
| f22f23f21d | |||
| 90eb883b67 | |||
| 300358bc46 | |||
| 3cffff3415 | |||
| 4253744d9d | |||
| 6b5a552d95 | |||
| 43485e1a51 | |||
| 5cdceb1db1 | |||
| 0c285d64bc | |||
| 38cdbf8804 | |||
| 9606834e14 | |||
| 276b1553c1 | |||
| 182f2bfa62 | |||
| 5266d9a30a | |||
| 6068a940bd | |||
| fc032c95b4 | |||
| 2265b9321e | |||
| a7b809cb91 | |||
| af269b536e | |||
| 89a8f3c277 | |||
| 57b3f6c44f | |||
| 380ff9917d | |||
| 6532f1aba5 | |||
| 49dfd259b4 | |||
| fad2ec66fa | |||
| e455de65f9 | |||
| 7a0c1cc6ff | |||
| 2517359f3a | |||
| c782f29f5a | |||
| 2825bcb431 | |||
| 1117c2958a | |||
| 4464c221b7 |
Executable
+37
@@ -0,0 +1,37 @@
|
||||
ls
|
||||
pwd
|
||||
cd app
|
||||
ls
|
||||
cd views/
|
||||
cd backend/
|
||||
ls
|
||||
cd users/
|
||||
ls
|
||||
vi view.blade.php
|
||||
ls -alF
|
||||
cd
|
||||
pwd
|
||||
ls -alF
|
||||
pwd
|
||||
cd app
|
||||
ls
|
||||
cd views/
|
||||
cd backend/
|
||||
cd users/
|
||||
ls
|
||||
ls -alF
|
||||
chown snipeitftp view.blade.php
|
||||
sudo chown snipeitftp view.blade.php
|
||||
pwd
|
||||
ls
|
||||
vi view.blade.php
|
||||
set noswapfile
|
||||
set nobackup
|
||||
vi view.blade.php
|
||||
touch delete.me
|
||||
vi delete.me
|
||||
ls
|
||||
ls -alF
|
||||
touch view.blade.php
|
||||
touch index.blade.php
|
||||
vi view.blade.php
|
||||
+4
-1
@@ -10,6 +10,9 @@ composer.phar
|
||||
/app/config/*/database.php
|
||||
/app/config/*/app.php
|
||||
public/packages/*
|
||||
public/uploads/models/*
|
||||
public/uploads/avatars/*
|
||||
/app/storage/views/*
|
||||
/app/storage/logs/*
|
||||
/app/storage/debugbar/
|
||||
/app/storage/debugbar/
|
||||
/bin/
|
||||
Regular → Executable
+1
-3
@@ -17,9 +17,7 @@ before_script:
|
||||
- curl -s http://getcomposer.org/installer | php
|
||||
- cp app/config/production/database.example.php app/config/database.php
|
||||
- cp app/config/production/mail.example.php app/config/mail.php
|
||||
- php composer.phar self-update
|
||||
- php composer.phar validate
|
||||
- php composer.phar install --prefer-source --no-interaction --dev
|
||||
- composer install --prefer-source --no-interaction --dev
|
||||
- php artisan key:generate
|
||||
- php artisan migrate:install
|
||||
- php artisan migrate --package cartalyst/sentry
|
||||
|
||||
Regular → Executable
+127
-82
@@ -1,92 +1,137 @@
|
||||
### v0.1.0
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/1527b88fd671a20c879c9b2061ae95f3b386ba27">view commit •</a> Fixes #61</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/4c0af1eae1031c2630f6e29cc73f8a9dfac1081c">view commit •</a> Fixed typo causing failure with mysql strict</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/0e3bcfecd05a39bfea6fc7ba11cb24d9d49e6d86">view commit •</a> Should be final fixes for mysql strict mode</li>
|
||||
|
||||
### v0.1.1
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/b1aa67ddb72158513f0a706996c8c1f5b3609aa5">view commit •</a> Fixes #69</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/aa38d83ba6369215451d905e599492214e9f4b8b">view commit •</a> Fixes #63 and #70</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/65cd28aad3903e11879e01faba382454dec7e75c">view commit •</a> Fixes #14</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/6552401fd869fd285aef5e217438f4f055b53ab6">view commit •</a> Fixes #77</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/012a889444fa25b174a5fb2c67e89c8c5fcf09aa">view commit •</a> Corrected license seat count associated with license. Fixes #75</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/9e189aa309750c221c27352f35e2ca1f5fab9173">view commit •</a> Fixes #80, also prevents the user from checking out an asset that is undeployable, etc</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/8680d98bc36bffa08f87020300b315d26be09928">view commit •</a> Fixed status display bug</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/4fcdf72ab6505625f244a6e6ee8683204fb81ccd">view commit •</a> Responsive design bug fixes, placeholder code for #64 (commented out)</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/d9a37f38228d55bb6265efc626e3ab7919013362">view commit •</a> Fixes #88</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/5858bfb99b2144fbc805ec62cc90e6aaaf019f77">view commit •</a> Fixed language file paths caused by #88</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/9f7cbc8a4f01ddf2596e831f658c9a8c321b2f46">view commit •</a> Another fix related to #88, also accounts for users with invalid location_ids</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/1b56c31a22afd39a875677714b9c07e96876b8df">view commit •</a> Fixed relationship between users/locations because fuck you ORM</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/f0f07b578b2439a627e5e946df0849d88d8526cf">view commit •</a> Fixing pivot for users</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/9fa826b2e77ce22d25a8b3094bc825802d25be85">view commit •</a> Fixed assigned to id</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/839d01a3af08d780be4152bc02b33bff1a7d7f20">view commit •</a> Fixed relationship method because fuck you ORM</li>
|
||||
|
||||
### v0.2.0
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/06cbd0723e415d81ea12aa48f2c37188741b2dbc">view commit •</a> Fixes #93</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/e305099b45401c871f16fec23c200080830fcd5d">view commit •</a> Fixed model view</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/7003eff42ca0e0ea2b9070187c0afd8ba1a8d8b0">view commit •</a> More fixes for #88</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/567f395afaa19335671f366ce889630426f33273">view commit •</a> More fixes for #88</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/02f1977d301cd449aa806e02e8a829516d436ef7">view commit •</a> Fixed error message</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/11c657ffa4c3bdd01cd04b81d01980b2d795107c">view commit •</a> Fixes #36</li>
|
||||
### v0.3.11-alpha - Released Jul 19, 2014 07:16:53
|
||||
#### This is a pre-release
|
||||
|
||||
### v0.3.0-alpha
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/d91d75abe4df19dd6cd54705ba9967295973ced0">view commit •</a> Fixing JSON parse errors from #97</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/baab758377e117a86c3273dd1d6e03e66b02dc8b">view commit •</a> Fixed language support</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/a678ec41714f5d7f77418b5933bc112aa67eae9c">view commit •</a> Fixed Gravatar Hash</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/c08d672e4923b12972eae76d0699e6a301f911cd">view commit •</a> Fixes mail config documentation</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/fba853a6a7a2f8166265cac2e99a526fd9b88c7b">view commit •</a> Fixes composer formatting issues</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/c11510fdcac2b2de09ae9e241c846426bdf0b187">view commit •</a> Removes sorting from actions column. Fixes #56</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/ae05f2701559a841cb8d9bc8767e6d7a56dcd93c">view commit •</a> Fixed depreciation bug</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/d591c1ea0495de091eb0f71daa8572929096c897">view commit •</a> Fixed bug where RTD = 1 instead of 0</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/e49420f62d26405b2fa0385f0ae7b3009b3beeaf">view commit •</a> Fixed bug in depreciation display</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/1dc7fd1bdf8852fed6d886938f632c8ea69d4798">view commit •</a> Fixed depreciation display on asset view</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/211a527ae176df667f6f8fbc95901c53a368d8e2">view commit •</a> Fixed FK</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/aaebaa8d36158aafc61988a6370239e85f2e75e5">view commit •</a> Bugfix to put custom title in the page title</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/194150bbf0493512018390d011e8d88d144e9763">view commit •</a> Hacky shit to fix pagination weirdness - will come back to this</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/5fb649b59e76aa9db6e433ad8c9fc75b4b8d5fc2">view commit •</a> Fixed error message layout</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/7bc9a53b133895206a3df230baca50d3879abbe5">view commit •</a> Fixed error when user is invalid</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/82de635a75aba376209b741ce1ed4497b91e65e0">view commit •</a> Fixed invalid seed data</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/b697c77cd85416ca502ec3bb28c990099c7faae3">view commit •</a> Fixing error when no depreciation</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/432f44118f46381bdaa44daf61dfa35677aba0ee">view commit •</a> Fixed FK in licenses model</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/4468cbd096e9990300240205baf7139eafbc423c">view commit •</a> Fixes #112</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/cd62be0de03da071f344c8f66730cbc9e1475fb7">view commit •</a> Minor div fix</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/9c369d72e1e7e29f3c205586c916b2f42b250047">view commit •</a> Fixed typo</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/60d94eea04d1ebb93704e6a0d20621ff18708272">view commit •</a> Changes serial to text area, allow new lines. Fixes #118</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/580590b4c0b4a2f76ef8edfe02de986267fc7395">view commit •</a> Fixed === to == (PHP is loosely typed)</li>
|
||||
|
||||
### v0.3.1-alpha
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/efad5db082d1461ea26556fad2f1671a49dc1480">view commit •</a> Fix for broken datatables in upgrading to v2.2</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/5690e9ce1f178486179ce6cdfb00ca417acd87dd">view commit •</a> Fixed code indentation for Apache virtualhost example</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/67aba76d3f83c5f374c05fe07d52eebd81d13278">view commit •</a> Fixing this change from #109 that somehow got reverted</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/06067fc19c0127fdcbb78541e7cdc8e77f5444ac">view commit •</a> Fixed CSV rexport</li>
|
||||
### v0.3.10-alpha - Released Jul 17, 2014 07:54:10
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/89a8f3c277d2482b2cd04c4c5c582c9e507770f8">view</a> • Fixes #183 - added employee number to users
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/a7b809cb91f49fb2c8eaecc67822fa155a0f20ce">view</a> • Updated title/header for users, additional fixes for #151
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/5266d9a30a9663fa80ff764b25ff71726e5c4f4c">view</a> • Fixed title tag for user list view
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/43485e1a51330ef585a65b469d7eb85ae7bde13a">view</a> • Fixed language definition
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/6b5a552d95ff6f6d5567275b50fcd487fb793820">view</a> • Fixed #186 - Bug with select box not retaining selections on edit screen
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/90eb883b671919ea360122c2bf44433995a12144">view</a> • Fixed #187 - replaced dummy site name with site name from admin panel preferences
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/f22f23f21dc11d393854849580f0c1229cec9827">view</a> • Fixed button label on forgotten password page
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/2b9494ed8271254f8f84e016f238d518e6109842">view</a> • Fixed inconsistent password requirements across admin user creation, user profile and forgotten password
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/9dc40a3a9c161267fd8c88aacc1fbf536c1ec2de">view</a> • Fixed a few CSS quirks
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/99003e126a8fd0ad9aaea5a550e0af5e306fc1bb">view</a> • Fixed bug with edit (supplier_id), added requestable field for assets
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/21251b462308f2d783b83be1a331a0faf0813d16">view</a> • Fixed #190, where depreciation on licenses would not be saved
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/89000440f344f766a31adc69718d7f66df235abf">view</a> • Added admin ability to unsuspend locked accounts #changelog
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/e203fc516fadf6218f5ce87c070d0cdba9fca188">view</a> • Fixes #194
|
||||
|
||||
### v0.3.2-alpha
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/f4c5da57d0397877d90aa398267e59fcffee7b47">view commit •</a> Fixed auth error when user isn't logged in</li>
|
||||
|
||||
### v0.3.3-alpha
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/3518ab9f55f7992d6d4f886389d67b062a02f2d8">view commit •</a> Fixes #139</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/ad9b1fc446ab15157502fe7c52ddbda455e3ea8f">view commit •</a> Fixes #139</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/dfa5d1c64205b23c4c3d16190d1478da8aa0edbb">view commit •</a> Fixes #136</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/9714178ce1fa1e2814389e4b6b82eb596a650084">view commit •</a> Fixes #141</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/607484b29407718238571eb5269c9c27830338f7">view commit •</a> Fixes #141 for mysql with strict mode enabled</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/cbc945299e7f67f5f10dfdc6a875e5c53ac8440a">view commit •</a> Fixes #148</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/dc256583d410cb09253e30b075149c79fb4864e5">view commit •</a> Fixes #144</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/610c405aa50118163ad5d26d43e4bf6c2456f624">view commit •</a> More fixes for #151</li>
|
||||
### v0.3.9-alpha - Released Jul 03, 2014 04:08:38
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/2825bcb4310899e89ccbc73dfa8b59ade28018da">view</a> • Fixed #179 - account page to show assets checked out to the logged in user
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/c782f29f5aae752a6246be9778d418df172dd4f6">view</a> • Pulled account sub-nav into top menu to free up UI space. #changelog
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/fad2ec66fa9abe0b34baf16cce453a7e9fc9e4d4">view</a> • More README fixes and refinement
|
||||
|
||||
### v0.3.4-alpha
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/3518ab9f55f7992d6d4f886389d67b062a02f2d8">view commit •</a> Fixes #139</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/ad9b1fc446ab15157502fe7c52ddbda455e3ea8f">view commit •</a> Fixes #139</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/dfa5d1c64205b23c4c3d16190d1478da8aa0edbb">view commit •</a> Fixes #136</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/9714178ce1fa1e2814389e4b6b82eb596a650084">view commit •</a> Fixes #141</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/607484b29407718238571eb5269c9c27830338f7">view commit •</a> Fixes #141 for mysql with strict mode enabled</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/cbc945299e7f67f5f10dfdc6a875e5c53ac8440a">view commit •</a> Fixes #148</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/dc256583d410cb09253e30b075149c79fb4864e5">view commit •</a> Fixes #144</li>
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/610c405aa50118163ad5d26d43e4bf6c2456f624">view commit •</a> More fixes for #151</li>
|
||||
|
||||
### v0.3.4-alpha
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/08d05b481f6366ad48fcdce72a8df53755f5dee8">view commit •</a> Fixes #158</li>
|
||||
### v0.3.8-alpha - Released Jun 27, 2014 11:28:22
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/3e7a9e45d1954531bbc3b73f2ed59dd16d59c657">view</a> • Fixes PR #168 and #167
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/945cb3253f1349e30aafa4e7cb57bb507a2ea0cc">view</a> • Fix #117
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/6f42b3045e2a65cdf98ec1038284cc2ecf01fa5d">view</a> • Resolves #155
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/380417953b6b67a506f0cc395fd2dfb744cf26cd">view</a> • Fixed missing string
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/b09aec67f1ab76ff0435a2e1e49b179c3d73bc12">view</a> • Fixes #155
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/124acc89c4027e346daf54c62cb38b85586de870">view</a> • Resolves #174
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/afabd2814205fdcd83b7bf9ce9095aa367b08311">view</a> • Additional fixes for #167
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/a170efae2796314896d548d86b79d89d859c37d2">view</a> • fix for #167
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/ec9eab81bfb3b35bfe7ad06008b26f19009e6638">view</a> • Closes #177 - change log file added, needs refining
|
||||
|
||||
### v0.3.5-alpha
|
||||
<li> <a href="http://github.com/snipe/snipe-it/commit/d1499deecdff3c7a4235ffdfad5adbddc1a5098f">view commit •</a> Provisions for strict mode, fixed license deletion bug</li>
|
||||
|
||||
### v0.3.6-alpha
|
||||
<li>Erroneous release - sorry :( It's identical to v0.3.5-alpha</li>
|
||||
### v.0.3.5-alpha - Released Jun 20, 2014 04:23:09
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/d1499deecdff3c7a4235ffdfad5adbddc1a5098f">view</a> • Provisions for strict mode, fixed license deletion bug
|
||||
|
||||
|
||||
### v.0.3.4-alpha - Released Jun 20, 2014 12:27:59
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/08d05b481f6366ad48fcdce72a8df53755f5dee8">view</a> • Fixes #158
|
||||
|
||||
|
||||
### v.0.3.3-alpha - Released Jun 18, 2014 10:04:46
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/3518ab9f55f7992d6d4f886389d67b062a02f2d8">view</a> • Fixes #139
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/ad9b1fc446ab15157502fe7c52ddbda455e3ea8f">view</a> • Fixes #139
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/dfa5d1c64205b23c4c3d16190d1478da8aa0edbb">view</a> • Fixes #136
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/9714178ce1fa1e2814389e4b6b82eb596a650084">view</a> • Fixes #141
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/607484b29407718238571eb5269c9c27830338f7">view</a> • Fixes #141 for mysql with strict mode enabled
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/cbc945299e7f67f5f10dfdc6a875e5c53ac8440a">view</a> • Fixes #148
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/dc256583d410cb09253e30b075149c79fb4864e5">view</a> • Fixes #144
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/610c405aa50118163ad5d26d43e4bf6c2456f624">view</a> • More fixes for #151
|
||||
|
||||
|
||||
### v.0.3.2-alpha - Released May 06, 2014 10:26:21
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/f4c5da57d0397877d90aa398267e59fcffee7b47">view</a> • Fixed auth error when user isn't logged in
|
||||
|
||||
|
||||
### v.0.3.1-alpha - Released May 06, 2014 06:48:09
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/efad5db082d1461ea26556fad2f1671a49dc1480">view</a> • Fix for broken datatables in upgrading to v2.2
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/5690e9ce1f178486179ce6cdfb00ca417acd87dd">view</a> • Fixed code indentation for Apache virtualhost example
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/67aba76d3f83c5f374c05fe07d52eebd81d13278">view</a> • Fixing this change from #109 that somehow got reverted
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/06067fc19c0127fdcbb78541e7cdc8e77f5444ac">view</a> • Fixed CSV rexport
|
||||
|
||||
|
||||
### v0.3.0-alpha - Released Jan 29, 2014 02:28:31
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/d91d75abe4df19dd6cd54705ba9967295973ced0">view</a> • Fixing JSON parse errors from #97
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/baab758377e117a86c3273dd1d6e03e66b02dc8b">view</a> • Fixed language support
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/a678ec41714f5d7f77418b5933bc112aa67eae9c">view</a> • Fixed Gravatar Hash
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/c08d672e4923b12972eae76d0699e6a301f911cd">view</a> • Fixes mail config documentation
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/fba853a6a7a2f8166265cac2e99a526fd9b88c7b">view</a> • Fixes composer formatting issues
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/c11510fdcac2b2de09ae9e241c846426bdf0b187">view</a> • Removes sorting from actions column. Fixes #56
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/ae05f2701559a841cb8d9bc8767e6d7a56dcd93c">view</a> • Fixed depreciation bug
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/d591c1ea0495de091eb0f71daa8572929096c897">view</a> • Fixed bug where RTD = 1 instead of 0
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/e49420f62d26405b2fa0385f0ae7b3009b3beeaf">view</a> • Fixed bug in depreciation display
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/1dc7fd1bdf8852fed6d886938f632c8ea69d4798">view</a> • Fixed depreciation display on asset view
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/211a527ae176df667f6f8fbc95901c53a368d8e2">view</a> • Fixed FK
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/aaebaa8d36158aafc61988a6370239e85f2e75e5">view</a> • Bugfix to put custom title in the page title
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/194150bbf0493512018390d011e8d88d144e9763">view</a> • Hacky shit to fix pagination weirdness - will come back to this
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/5fb649b59e76aa9db6e433ad8c9fc75b4b8d5fc2">view</a> • Fixed error message layout
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/7bc9a53b133895206a3df230baca50d3879abbe5">view</a> • Fixed error when user is invalid
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/82de635a75aba376209b741ce1ed4497b91e65e0">view</a> • Fixed invalid seed data
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/b697c77cd85416ca502ec3bb28c990099c7faae3">view</a> • Fixing error when no depreciation
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/432f44118f46381bdaa44daf61dfa35677aba0ee">view</a> • Fixed FK in licenses model
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/4468cbd096e9990300240205baf7139eafbc423c">view</a> • Fixes #112
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/cd62be0de03da071f344c8f66730cbc9e1475fb7">view</a> • Minor div fix
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/9c369d72e1e7e29f3c205586c916b2f42b250047">view</a> • Fixed typo
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/60d94eea04d1ebb93704e6a0d20621ff18708272">view</a> • Changes serial to text area, allow new lines. Fixes #118
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/580590b4c0b4a2f76ef8edfe02de986267fc7395">view</a> • Fixed === to == (PHP is loosely typed)
|
||||
|
||||
|
||||
### v0.2.0-alpha - Released Nov 29, 2013 11:09:07
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/06cbd0723e415d81ea12aa48f2c37188741b2dbc">view</a> • Fixes #93
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/e305099b45401c871f16fec23c200080830fcd5d">view</a> • Fixed model view
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/7003eff42ca0e0ea2b9070187c0afd8ba1a8d8b0">view</a> • More fixes for #88
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/567f395afaa19335671f366ce889630426f33273">view</a> • More fixes for #88
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/02f1977d301cd449aa806e02e8a829516d436ef7">view</a> • Fixed error message
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/11c657ffa4c3bdd01cd04b81d01980b2d795107c">view</a> • Fixes #36
|
||||
|
||||
|
||||
### v0.1.2-alpha - Released Nov 29, 2013 02:59:05
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/b1aa67ddb72158513f0a706996c8c1f5b3609aa5">view</a> • Fixes #69
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/aa38d83ba6369215451d905e599492214e9f4b8b">view</a> • Fixes #63 and #70
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/65cd28aad3903e11879e01faba382454dec7e75c">view</a> • Fixes #14
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/6552401fd869fd285aef5e217438f4f055b53ab6">view</a> • Fixes #77
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/012a889444fa25b174a5fb2c67e89c8c5fcf09aa">view</a> • Corrected license seat count associated with license. Fixes #75
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/9e189aa309750c221c27352f35e2ca1f5fab9173">view</a> • Fixes #80, also prevents the user from checking out an asset that is undeployable, etc
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/8680d98bc36bffa08f87020300b315d26be09928">view</a> • Fixed status display bug
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/4fcdf72ab6505625f244a6e6ee8683204fb81ccd">view</a> • Responsive design bug fixes, placeholder code for #64 (commented out)
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/d9a37f38228d55bb6265efc626e3ab7919013362">view</a> • Fixes #88
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/5858bfb99b2144fbc805ec62cc90e6aaaf019f77">view</a> • Fixed language file paths caused by #88
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/9f7cbc8a4f01ddf2596e831f658c9a8c321b2f46">view</a> • Another fix related to #88, also accounts for users with invalid location_ids
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/f0f07b578b2439a627e5e946df0849d88d8526cf">view</a> • Fixing pivot for users
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/9fa826b2e77ce22d25a8b3094bc825802d25be85">view</a> • Fixed assigned to id
|
||||
|
||||
|
||||
### v0.1.1-alpha - Released Nov 27, 2013 12:11:00
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/1527b88fd671a20c879c9b2061ae95f3b386ba27">view</a> • Fixes #61
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/4c0af1eae1031c2630f6e29cc73f8a9dfac1081c">view</a> • Fixed typo causing failure with mysql strict
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/0e3bcfecd05a39bfea6fc7ba11cb24d9d49e6d86">view</a> • Should be final fixes for mysql strict mode
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
[](https://pledgie.com/campaigns/22899) [](https://travis-ci.org/snipe/snipe-it) [](http://waffle.io/snipe/snipe-it)
|
||||
[](https://pledgie.com/campaigns/22899) [](https://travis-ci.org/snipe/snipe-it) [](http://waffle.io/snipe/snipe-it) [](http://stillmaintained.com/snipe/snipe-it) [](https://crowdin.com/project/snipe-it)
|
||||
|
||||
|
||||
## Snipe-IT - Asset Management For the Rest of Us
|
||||
|
||||
@@ -6,10 +7,20 @@ This is a FOSS project for asset management in IT Operations. Knowing who has wh
|
||||
|
||||
It is built on [Laravel 4.1](http://laravel.com) and uses the [Sentry 2](https://github.com/cartalyst/sentry) package.
|
||||
|
||||
Many thanks to the [Laravel 4 starter site](https://github.com/brunogaspar/laravel4-starter-kit) for a quick start.
|
||||
This project is being actively developed and we're [releasing quite frequently](https://github.com/snipe/snipe-it/releases). ([Check out the live demo here](http://snipeitapp.com/demo.php).)
|
||||
|
||||
This project is being actively developed (at what seems like breakneck speed sometimes!) We're still in alpha release, so this is NOT recommended for production use yet, as many more things will likely change before v1.0-stable is ready - but we're [releasing quite frequently](https://github.com/snipe/snipe-it/releases).
|
||||
__This is web-based software__. This means there there is no executable file (aka no .exe files), and it must be run on a web server and accessed through a web browser. It runs on any Mac OSX, flavor of Linux, as well as Windows.
|
||||
|
||||
-----
|
||||
### Documentation & Installation
|
||||
|
||||
__Installation and configuration documentation for this project has been moved to http://docs.snipeitapp.com.__ This provides a more easily navigated, organized view of the documentation, and is based off of the [documentation branch](https://github.com/snipe/snipe-it/tree/documentation) in this repo. Contributions and bugfixes to the documentation are always welcome!
|
||||
|
||||
We'll be adding a long-overdue user's manual soon as well.
|
||||
|
||||
__To deploy on Ubuntu using Ansible and Vagrant, be sure to check out the [Snipe-IT Installation scripts](https://github.com/GR360RY/snipeit-ansible) created by [@GR360RY](https://github.com/GR360RY/).__
|
||||
|
||||
-----
|
||||
### Bug Reports & Feature Requests
|
||||
|
||||
Feel free to check out the [GitHub Issues for this project](https://github.com/snipe/snipe-it/issues) to open a bug report or see what open issues you can help with. Please search through existing issues (open and closed) to see if your question hasn't already been answered before opening a new issue.
|
||||
@@ -18,20 +29,33 @@ We use Waffle.io to help better communicate our roadmap with users. Our [project
|
||||
|
||||
[](http://waffle.io/snipe/snipe-it)
|
||||
|
||||
-----
|
||||
### Announcement List
|
||||
|
||||
To be notified of important news (such as new releases, security advisories, etc), [sign up for our list](http://eepurl.com/XyZKz). We'll never sell or give away your info, and we'll only email you when it's important.
|
||||
|
||||
-----
|
||||
|
||||
### Translations!
|
||||
|
||||
If you're not a coder but want to give back to the project and you're fluent in other languages, consider helping out with the translations. We use [CrowdIn](https://crowdin.com) to manage translations, and it makes it super-simple for you to add translations to the project without messing with code. Check out [the Snipe-IT CrowdIn translation project here](https://crowdin.com/project/snipe-it/).
|
||||
|
||||
We currently have English and Spanish completed, and are looking for lots more!
|
||||
|
||||
-----
|
||||
## Requirements
|
||||
|
||||
- PHP 5.4 or later
|
||||
- MCrypt PHP Extension
|
||||
- Fileinfo Extension
|
||||
|
||||
And _one_ of the following image libraries (for QR codes, asset model image and user avatar image uploads).
|
||||
|
||||
- GD Library (>=2.0) … or …
|
||||
- Imagick PHP extension (>=6.3.8)
|
||||
|
||||
-----
|
||||
|
||||
## Important Note on Updating
|
||||
## Important Notes on Updating
|
||||
|
||||
Whenever you pull down a new version from master or develop, when you grab the [latest official release](https://github.com/snipe/snipe-it/releases), make sure to run the following commands via command line:
|
||||
|
||||
@@ -39,217 +63,3 @@ Whenever you pull down a new version from master or develop, when you grab the [
|
||||
php artisan migrate
|
||||
|
||||
Forgetting to do this can mean your DB might end up out of sync with the new files you just pulled, or you may have some funky cached autoloader values. It's a good idea to get into the habit of running these every time you pull anything new down. If there are no database changes to migrate, it won't hurt anything to run migrations anyway.
|
||||
|
||||
-----
|
||||
|
||||
## How to Install
|
||||
|
||||
### 1) Downloading
|
||||
#### 1.1) Clone the Repository
|
||||
|
||||
git clone https://github.com/snipe/snipe-it your-folder
|
||||
|
||||
#### 1.2) Download the Repository
|
||||
|
||||
https://github.com/snipe/snipe-it/archive/master.zip
|
||||
|
||||
-----
|
||||
|
||||
### 2) Setup Environment, Database and Mail Settings
|
||||
|
||||
#### 2.1) Adjust Environments
|
||||
|
||||
Update the file `boostrap/start.php` under the section `Detect The Application Environment`.
|
||||
|
||||
vi bootstrap/start.php
|
||||
|
||||
-----
|
||||
|
||||
__AS OF LARAVEL 4.1__
|
||||
Per the [Laravel 4.1 upgrade docs](http://laravel.com/docs/upgrade):
|
||||
|
||||
__*"For security reasons, URL domains may no longer be used to detect your application environment. These values are easily spoofable and allow attackers to modify the environment for a request. You should convert your environment detection to use machine host names (hostname command on Mac & Ubuntu)."*__
|
||||
|
||||
To find out your local machine's hostname, type `hostname` from a terminal prompt on the machine you're installing it on. The command-line response is that machine's hostname. Please note that the hostname is NOT always the same as the domain name.
|
||||
|
||||
So for example, if you're installing this locally on your Mac named SnipeMBP, the environmental variable section of `bootstrap/start.php` might look like this:
|
||||
|
||||
$env = $app->detectEnvironment(array(
|
||||
'local' => array('SnipeMBP'),
|
||||
'staging' => array('staging.mysite.com'),
|
||||
'production' => array('www.mysite.com')
|
||||
));
|
||||
|
||||
If your development, staging and production sites all run on the same server (which is generally a terrible idea), [see this example](http://words.weareloring.com/development/setting-up-multiple-environments-in-laravel-4-1/) of how to configure the app using environmental variables.
|
||||
|
||||
-----
|
||||
|
||||
#### 2.2) Setup Your Database
|
||||
|
||||
Copy the example database config `app/config/local/database.example.php` to `app/config/local/database.php`.
|
||||
Update the file `app/config/local/database.php` with your database name and credentials.
|
||||
|
||||
vi app/config/local/database.php
|
||||
|
||||
|
||||
#### 2.3) Setup Mail Settings
|
||||
|
||||
Copy the example mail config `app/config/local/mail.example.php` to `app/config/local/mail.php`.
|
||||
Update the file `app/config/local/mail.php` with your mail settings.
|
||||
|
||||
vi app/config/local/mail.php
|
||||
|
||||
This will be used to send emails to your users, when they register and they request a password reset.
|
||||
|
||||
#### 2.4) Adjust the application settings.
|
||||
|
||||
Copy the example app config `app/config/local/app.example.php` to `app/config/local/app.php`.
|
||||
|
||||
Update the file `app/config/local/app.php` with your URL settings.
|
||||
|
||||
vi app/config/local/app.php
|
||||
|
||||
You should also change your secret key here -- if you prefer to have your key randomly generated, run the artisan key:generate command from the application root.
|
||||
|
||||
php artisan key:generate --env=local
|
||||
|
||||
|
||||
#### 2.5) Additional Adjustments
|
||||
|
||||
The app is configured to automatically detect if you're in a local, staging, or production environment. Before deploying to a staging or production environment, follow sets 2.1, 2.2, and 2.3 above to tweak each environment as necessary. Configuration files for each environment can be found in app/config/{environment} (local, staging, and production).
|
||||
|
||||
-----
|
||||
|
||||
### 3) Install the Dependencies via Composer
|
||||
##### 3.1) If you don't have composer installed globally
|
||||
|
||||
cd your-folder
|
||||
curl -sS https://getcomposer.org/installer | php
|
||||
php composer.phar install
|
||||
|
||||
##### 3.2) For global composer installations
|
||||
|
||||
cd your-folder
|
||||
composer install
|
||||
|
||||
-----
|
||||
|
||||
### 4) Use custom CLI Installer Command
|
||||
|
||||
Now, you need to create yourself a user and finish the installation.
|
||||
|
||||
Use the following command to create your default user, user groups and run all the necessary migrations automatically.
|
||||
|
||||
php artisan app:install --env=local
|
||||
|
||||
-----
|
||||
|
||||
### 6) Fix permissions
|
||||
|
||||
You'll need to make sure that the `app/storage` directory is writable by your webserver, since caches and log files get written there. You should use the minimum permissions available for writing, based on how you've got your webserver configured.
|
||||
|
||||
chmod -R 755 app/storage
|
||||
|
||||
If you still run into a permissions error, you may need to increase the permissions to 775, or twiddle your user/group permissions on your server.
|
||||
|
||||
chmod -R 775 app/storage
|
||||
|
||||
-----
|
||||
|
||||
### 7) Set the correct document root for your server
|
||||
|
||||
The document root for the app should be set to the public directory. In a standard Apache virtualhost setup, that might look something like this on a standard linux LAMP stack:
|
||||
|
||||
<VirtualHost *:80>
|
||||
<Directory /var/www/html/public>
|
||||
AllowOverride All
|
||||
</Directory>
|
||||
DocumentRoot /var/www/html/public
|
||||
ServerName www.example.org
|
||||
|
||||
# Other directives here
|
||||
</VirtualHost>
|
||||
|
||||
An OS X virtualhost setup could look more like:
|
||||
|
||||
Directory "/Users/flashingcursor/Sites/snipe-it/public/">
|
||||
Allow From All
|
||||
AllowOverride All
|
||||
Options +Indexes
|
||||
</Directory>
|
||||
<VirtualHost *:80>
|
||||
ServerName "snipe-it.dev"
|
||||
DocumentRoot "/Users/flashingcursor/Sites/snipe-it/public"
|
||||
SetEnv LARAVEL_ENV development
|
||||
</VirtualHost>
|
||||
|
||||
-----
|
||||
|
||||
### 8) Seed the Database
|
||||
|
||||
Loading up the sample data will give you an idea of how this should look, how your info should be structured, etc. It only pre-loads a handful of items, so you won't have to spend an hour deleting sample data.
|
||||
|
||||
php artisan db:seed
|
||||
|
||||
-----
|
||||
|
||||
|
||||
## Optional Development Stuff
|
||||
### Set up the debugbar
|
||||
|
||||
In dev mode, I use the fabulous [Laravel Debugbar](https://github.com/barryvdh/laravel-debugbar) by @barryvdh. After you've installed/updated composer, you'll need to publish the assets for the debugbar:
|
||||
|
||||
php artisan debugbar:publish
|
||||
|
||||
The profiler is enabled by default if you have debug set to true in your app.php. You certainly don't have to use it, but it's pretty handy for troubleshooting queries, seeing how much memory your pages are using, etc.
|
||||
|
||||
-----
|
||||
|
||||
### Purging the autoloader
|
||||
|
||||
If you're doing any development on this, make sure you purge the auto-loader if you see any errors stating the new model you created can't be found, etc, otherwise your new models won't be grokked.
|
||||
|
||||
php composer.phar dump-autoload
|
||||
|
||||
|
||||
-----
|
||||
|
||||
### Application logs
|
||||
|
||||
Application logs for this app are found in `app/storage/logs`, as is customary of Laravel.
|
||||
|
||||
-----
|
||||
|
||||
### Running this on an EC2 Micro Instance
|
||||
|
||||
Depending on your needs, you could probably run this system in an EC2 micro instance. It doesn't take up very much memory and typically won't be a super-high-traffic application. EC2 micros fall into the free/dirt-cheap tier, which might make this a nice option. One thing to note though - composer can be a little memory-intensive while you're running updates, and you may have trouble with it failing on a micro. You can crank the memory_limit up in php.ini, but EC2 micros have swap disabled by default, so even that may not cut it. If you run into totally unhelpful error messages while running composer updates (like simply 'Killed') or fatal memory issues mentioning phar, your best bet will be to enable swap:
|
||||
|
||||
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
|
||||
sudo /sbin/mkswap /var/swap.1
|
||||
sudo /sbin/swapon /var/swap.1
|
||||
|
||||
If you need more than 1024 then change that to something higher.
|
||||
|
||||
To enable it by default after reboot, add this line to /etc/fstab:
|
||||
|
||||
/var/swap.1 swap swap defaults 0 0
|
||||
|
||||
-----
|
||||
|
||||
## License
|
||||
|
||||
Copyright (C) 2013 Alison Gianotto - snipe@snipe.net
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
@@ -223,7 +223,8 @@ class AppCommand extends Command
|
||||
'name' => 'Admin',
|
||||
'permissions' => array(
|
||||
'admin' => 1,
|
||||
'users' => 1
|
||||
'users' => 1,
|
||||
'reports' => 1
|
||||
)
|
||||
));
|
||||
|
||||
@@ -242,7 +243,8 @@ class AppCommand extends Command
|
||||
'name' => 'Reporting',
|
||||
'permissions' => array(
|
||||
'admin' => 0,
|
||||
'users' => 1
|
||||
'users' => 1,
|
||||
'reports' => 1,
|
||||
)
|
||||
));
|
||||
|
||||
@@ -260,7 +262,8 @@ class AppCommand extends Command
|
||||
'name' => 'Users',
|
||||
'permissions' => array(
|
||||
'admin' => 0,
|
||||
'users' => 1
|
||||
'users' => 1,
|
||||
'reports' => 0,
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
+1
-1
@@ -67,7 +67,6 @@ return array(
|
||||
'Illuminate\Validation\ValidationServiceProvider',
|
||||
'Illuminate\View\ViewServiceProvider',
|
||||
'Illuminate\Workbench\WorkbenchServiceProvider',
|
||||
|
||||
'Barryvdh\Debugbar\ServiceProvider',
|
||||
'Cartalyst\Sentry\SentryServiceProvider',
|
||||
'Chumper\Datatable\DatatableServiceProvider',
|
||||
@@ -118,6 +117,7 @@ return array(
|
||||
'Form' => 'Illuminate\Support\Facades\Form',
|
||||
'Hash' => 'Illuminate\Support\Facades\Hash',
|
||||
'HTML' => 'Illuminate\Support\Facades\HTML',
|
||||
'Image' => 'Intervention\Image\ImageManagerStatic',
|
||||
'Input' => 'Illuminate\Support\Facades\Input',
|
||||
'Lang' => 'Illuminate\Support\Facades\Lang',
|
||||
'Log' => 'Illuminate\Support\Facades\Log',
|
||||
|
||||
Regular → Executable
Regular → Executable
+1
-1
@@ -37,7 +37,7 @@ return array(
|
||||
| to a random, 32 character string, otherwise these encrypted strings
|
||||
| will not be safe. Please do this before deploying an application!
|
||||
|
|
||||
| Run a php artisand key:generate --env=staging to create a random one
|
||||
| Run a php artisan key:generate --env=staging to create a random one
|
||||
*/
|
||||
|
||||
'key' => 'Change_this_key_or_snipe_will_get_ya',
|
||||
|
||||
+146
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Debugbar Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Debugbar is enabled by default, when debug is set to true in app.php.
|
||||
|
|
||||
*/
|
||||
|
||||
'enabled' => Config::get('app.debug'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Storage settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| DebugBar stores data for session/ajax requests in a directory.
|
||||
| You can disable this, so the debugbar stores data in headers/session,
|
||||
| but this can cause problems with large data collectors.
|
||||
|
|
||||
*/
|
||||
'storage' => array(
|
||||
'enabled' => true,
|
||||
'path' => storage_path() . '/debugbar',
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Vendors
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Vendor files are included by default, but can be set to false.
|
||||
| This can also be set to 'js' or 'css', to only include javascript or css vendor files.
|
||||
| Vendor files are for css: font-awesome (including fonts) and highlight.js (css files)
|
||||
| and for js: jquery and and highlight.js
|
||||
| So if you want syntax highlighting, set it to true.
|
||||
| jQuery is set to not conflict with existing jQuery scripts.
|
||||
|
|
||||
*/
|
||||
|
||||
'include_vendors' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Capture Ajax Requests
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors),
|
||||
| you can use this option to disable sending the data through the headers.
|
||||
|
|
||||
*/
|
||||
|
||||
'capture_ajax' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Capture Console Commands
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The Debugbar can listen to Artisan commands. You can view them with the browse button in the Debugbar.
|
||||
|
|
||||
*/
|
||||
|
||||
'capture_console' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DataCollectors
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Enable/disable DataCollectors
|
||||
|
|
||||
*/
|
||||
|
||||
'collectors' => array(
|
||||
'phpinfo' => true, // Php version
|
||||
'messages' => true, // Messages
|
||||
'time' => true, // Time Datalogger
|
||||
'memory' => true, // Memory usage
|
||||
'exceptions' => true, // Exception displayer
|
||||
'log' => true, // Logs from Monolog (merged in messages if enabled)
|
||||
'db' => true, // Show database (PDO) queries and bindings
|
||||
'views' => true, // Views with their data
|
||||
'route' => true, // Current route information
|
||||
'laravel' => false, // Laravel version and environment
|
||||
'events' => false, // All events fired
|
||||
'default_request' => false, // Regular or special Symfony request logger
|
||||
'symfony_request' => true, // Only one can be enabled..
|
||||
'mail' => true, // Catch mail messages
|
||||
'logs' => false, // Add the latest log messages
|
||||
'files' => false, // Show the included files
|
||||
'config' => false, // Display config settings
|
||||
'auth' => false, // Display Laravel authentication status
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Extra options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure some DataCollectors
|
||||
|
|
||||
*/
|
||||
|
||||
'options' => array(
|
||||
'auth' => array(
|
||||
'show_name' => false, // Also show the users name/email in the debugbar
|
||||
),
|
||||
'db' => array(
|
||||
'with_params' => true, // Render SQL with the parameters substituted
|
||||
'timeline' => false, // Add the queries to the timeline
|
||||
),
|
||||
'mail' => array(
|
||||
'full_log' => false
|
||||
),
|
||||
'views' => array(
|
||||
'data' => false, //Note: Can slow down the application, because the data can be quite large..
|
||||
),
|
||||
'route' => array(
|
||||
'label' => true // show complete route on bar
|
||||
),
|
||||
'logs' => array(
|
||||
'file' => null
|
||||
),
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Inject Debugbar in Response
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Usually, the debugbar is added just before <body>, by listening to the
|
||||
| Response after the App is done. If you disable this, you have to add them
|
||||
| in your template yourself. See http://phpdebugbar.com/docs/rendering.html
|
||||
|
|
||||
*/
|
||||
|
||||
'inject' => true,
|
||||
|
||||
);
|
||||
@@ -20,159 +20,203 @@
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Authentication Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the authentication driver that will be utilized.
|
||||
| This drivers manages the retrieval and authentication of the users
|
||||
| attempting to get access to protected areas of your application.
|
||||
|
|
||||
| Supported: "eloquent" (more coming soon).
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Authentication Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the authentication driver that will be utilized.
|
||||
| This drivers manages the retrieval and authentication of the users
|
||||
| attempting to get access to protected areas of your application.
|
||||
|
|
||||
| Supported: "eloquent" (more coming soon).
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'eloquent',
|
||||
'driver' => 'eloquent',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Hasher
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option allows you to specify the default hasher used by Sentry
|
||||
|
|
||||
| Supported: "native", "bcrypt", "sha256"
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Hasher
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option allows you to specify the default hasher used by Sentry
|
||||
|
|
||||
| Supported: "native", "bcrypt", "sha256", "whirlpool"
|
||||
|
|
||||
*/
|
||||
|
||||
'hasher' => 'native',
|
||||
'hasher' => 'native',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Groups
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configuration specific to the group management component of Sentry.
|
||||
|
|
||||
*/
|
||||
'groups' => array(
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cookie
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configuration specific to the cookie component of Sentry.
|
||||
|
|
||||
*/
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Model
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "eloquent" driver, we need to know which
|
||||
| Eloquent models should be used throughout Sentry.
|
||||
|
|
||||
*/
|
||||
'cookie' => array(
|
||||
|
||||
'model' => 'Cartalyst\Sentry\Groups\Eloquent\Group',
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Cookie Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option allows you to specify the default cookie key used by Sentry.
|
||||
|
|
||||
| Supported: string
|
||||
|
|
||||
*/
|
||||
|
||||
),
|
||||
'key' => 'cartalyst_sentry',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Users
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configuration specific to the user management component of Sentry.
|
||||
|
|
||||
*/
|
||||
'users' => array(
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Model
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "eloquent" driver, we need to know which
|
||||
| Eloquent models should be used throughout Sentry.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Groups
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configuration specific to the group management component of Sentry.
|
||||
|
|
||||
*/
|
||||
|
||||
'model' => 'User',
|
||||
'groups' => array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Login Attribute
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If you're the "eloquent" driver and extending the base Eloquent model,
|
||||
| we allow you to globally override the login attribute without even
|
||||
| subclassing the model, simply by specifying the attribute below.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Model
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "eloquent" driver, we need to know which
|
||||
| Eloquent models should be used throughout Sentry.
|
||||
|
|
||||
*/
|
||||
|
||||
'login_attribute' => 'email',
|
||||
'model' => 'Cartalyst\Sentry\Groups\Eloquent\Group',
|
||||
|
||||
),
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Throttling
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Throttling is an optional security feature for authentication, which
|
||||
| enables limiting of login attempts and the suspension & banning of users.
|
||||
|
|
||||
*/
|
||||
'throttling' => array(
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Users
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configuration specific to the user management component of Sentry.
|
||||
|
|
||||
*/
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Throttling
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Enable throttling or not. Throttling is where users are only allowed a
|
||||
| certain number of login attempts before they are suspended. Suspension
|
||||
| must be removed before a new login attempt is allowed.
|
||||
|
|
||||
*/
|
||||
'users' => array(
|
||||
|
||||
'enabled' => true,
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Model
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "eloquent" driver, we need to know which
|
||||
| Eloquent models should be used throughout Sentry.
|
||||
|
|
||||
*/
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Model
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "eloquent" driver, we need to know which
|
||||
| Eloquent models should be used throughout Sentry.
|
||||
|
|
||||
*/
|
||||
//'model' => 'Cartalyst\Sentry\Users\Eloquent\User',
|
||||
'model' => 'User',
|
||||
|
||||
'model' => 'Cartalyst\Sentry\Throttling\Eloquent\Throttle',
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Login Attribute
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If you're using the "eloquent" driver and extending the base Eloquent
|
||||
| model, we allow you to globally override the login attribute without
|
||||
| even subclassing the model, simply by specifying the attribute below.
|
||||
|
|
||||
*/
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Attempts Limit
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "eloquent" driver and extending the base Eloquent model,
|
||||
| you have the option to globally set the login attempts.
|
||||
|
|
||||
| Supported: int
|
||||
|
|
||||
*/
|
||||
'login_attribute' => 'email',
|
||||
|
||||
'attempt_limit' => 5,
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Suspension Time
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "eloquent" driver and extending the base Eloquent model,
|
||||
| you have the option to globally set the suspension time, in minutes.
|
||||
|
|
||||
| Supported: int
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| User Groups Pivot Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "eloquent" driver, you can specify the table name
|
||||
| for the user groups pivot table.
|
||||
|
|
||||
| Default: users_groups
|
||||
|
|
||||
*/
|
||||
|
||||
'suspension_time' => 15,
|
||||
'user_groups_pivot_table' => 'users_groups',
|
||||
|
||||
),
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Throttling
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Throttling is an optional security feature for authentication, which
|
||||
| enables limiting of login attempts and the suspension & banning of users.
|
||||
|
|
||||
*/
|
||||
|
||||
'throttling' => array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Throttling
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Enable throttling or not. Throttling is where users are only allowed a
|
||||
| certain number of login attempts before they are suspended. Suspension
|
||||
| must be removed before a new login attempt is allowed.
|
||||
|
|
||||
*/
|
||||
|
||||
'enabled' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Model
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "eloquent" driver, we need to know which
|
||||
| Eloquent models should be used throughout Sentry.
|
||||
|
|
||||
*/
|
||||
|
||||
'model' => 'Cartalyst\Sentry\Throttling\Eloquent\Throttle',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Attempts Limit
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "eloquent" driver and extending the base Eloquent model,
|
||||
| you have the option to globally set the login attempts.
|
||||
|
|
||||
| Supported: int
|
||||
|
|
||||
*/
|
||||
|
||||
'attempt_limit' => 5,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Suspension Time
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "eloquent" driver and extending the base Eloquent model,
|
||||
| you have the option to globally set the suspension time, in minutes.
|
||||
|
|
||||
| Supported: int
|
||||
|
|
||||
*/
|
||||
|
||||
'suspension_time' => 15,
|
||||
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
@@ -16,4 +16,12 @@ return array(
|
||||
),
|
||||
),
|
||||
|
||||
'Reporting' => array(
|
||||
array(
|
||||
'permission' => 'reports',
|
||||
'label' => 'View Reports',
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
);
|
||||
|
||||
Regular → Executable
Regular → Executable
+3
-3
@@ -13,7 +13,7 @@ return array(
|
||||
|
|
||||
*/
|
||||
|
||||
'debug' => false,
|
||||
'debug' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -26,7 +26,7 @@ return array(
|
||||
|
|
||||
*/
|
||||
|
||||
'url' => 'http://www.yourserver.com',
|
||||
'url' => 'http://staging.yourserver.com',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -37,7 +37,7 @@ return array(
|
||||
| to a random, 32 character string, otherwise these encrypted strings
|
||||
| will not be safe. Please do this before deploying an application!
|
||||
|
|
||||
| Run a php artisand key:generate --env=staging to create a random one
|
||||
| Run a php artisan key:generate --env=staging to create a random one
|
||||
*/
|
||||
|
||||
'key' => 'Change_this_key_or_snipe_will_get_ya',
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
+1
-1
@@ -37,7 +37,7 @@ return array(
|
||||
| to a random, 32 character string, otherwise these encrypted strings
|
||||
| will not be safe. Please do this before deploying an application!
|
||||
|
|
||||
| Run a php artisand key:generate --env=staging to create a random one
|
||||
| Run a php artisan key:generate --env=staging to create a random one
|
||||
*/
|
||||
|
||||
'key' => 'Change_this_key_or_snipe_will_get_ya',
|
||||
|
||||
Regular → Executable
+1
-1
@@ -37,7 +37,7 @@ return array(
|
||||
| to a random, 32 character string, otherwise these encrypted strings
|
||||
| will not be safe. Please do this before deploying an application!
|
||||
|
|
||||
| Run a php artisand key:generate --env=staging to create a random one
|
||||
| Run a php artisan key:generate --env=staging to create a random one
|
||||
*/
|
||||
|
||||
'key' => 'Change_this_key_or_snipe_will_get_ya',
|
||||
|
||||
@@ -7,10 +7,13 @@ class AdminController extends AuthorizedController
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
// These have been moved into the routes for more granular control
|
||||
// Apply the admin auth filter
|
||||
$this->beforeFilter('admin-auth');
|
||||
//$this->beforeFilter('admin-auth', array('except' => $this->whitelist));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ class AuthController extends BaseController
|
||||
'last_name' => 'required|min:2',
|
||||
'email' => 'required|email|unique:users',
|
||||
'email_confirm' => 'required|email|same:email',
|
||||
'password' => 'required|between:8,32',
|
||||
'password' => 'required|between:10,32',
|
||||
'password_confirm' => 'required|same:password',
|
||||
);
|
||||
|
||||
@@ -259,7 +259,7 @@ class AuthController extends BaseController
|
||||
{
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
'password' => 'required|between:8,32',
|
||||
'password' => 'required|between:10,32',
|
||||
'password_confirm' => 'required|same:password'
|
||||
);
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ class ChangePasswordController extends AuthorizedController
|
||||
{
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
'old_password' => 'required|between:3,32',
|
||||
'password' => 'required|between:3,32',
|
||||
'old_password' => 'required|min:6',
|
||||
'password' => 'required|min:6',
|
||||
'password_confirm' => 'required|same:password',
|
||||
);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php namespace Controllers\Account;
|
||||
|
||||
use AuthorizedController;
|
||||
use Image;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Sentry;
|
||||
@@ -37,10 +38,10 @@ class ProfileController extends AuthorizedController
|
||||
{
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
'first_name' => 'required|min:3',
|
||||
'last_name' => 'required|min:3',
|
||||
'first_name' => 'required|alpha_space|min:2',
|
||||
'last_name' => 'required|alpha_space|min:2',
|
||||
'location_id' => 'required',
|
||||
'website' => 'url',
|
||||
'website' => 'url|alpha_space|min:10',
|
||||
'gravatar' => 'email',
|
||||
);
|
||||
|
||||
@@ -62,6 +63,19 @@ class ProfileController extends AuthorizedController
|
||||
$user->website = Input::get('website');
|
||||
$user->location_id = Input::get('location_id');
|
||||
$user->gravatar = Input::get('gravatar');
|
||||
|
||||
if (Input::file('avatar')) {
|
||||
$image = Input::file('avatar');
|
||||
$file_name = $user->first_name."-".$user->last_name.".".$image->getClientOriginalExtension();
|
||||
$path = public_path('uploads/avatars/'.$file_name);
|
||||
Image::make($image->getRealPath())->resize(84, 84)->save($path);
|
||||
$user->avatar = $file_name;
|
||||
}
|
||||
|
||||
if (Input::get('avatar_delete') == 1 && Input::file('avatar') == "") {
|
||||
$user->avatar = NULL;
|
||||
}
|
||||
|
||||
$user->save();
|
||||
|
||||
// Redirect to the settings page
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<?php namespace Controllers\Account;
|
||||
|
||||
use AuthorizedController;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Sentry;
|
||||
use Validator;
|
||||
use Location;
|
||||
use View;
|
||||
|
||||
class ViewAssetsController extends AuthorizedController
|
||||
{
|
||||
/**
|
||||
* Redirect to the profile page.
|
||||
*
|
||||
* @return Redirect
|
||||
*/
|
||||
public function getIndex()
|
||||
{
|
||||
$user = Sentry::getUser();
|
||||
|
||||
|
||||
if (isset($user->id)) {
|
||||
return View::make('frontend/account/view-assets', compact('user'));
|
||||
} else {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/users/message.user_not_found', compact('id' ));
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('users')->with('error', $error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Regular → Executable
+112
-48
@@ -40,15 +40,35 @@ class AssetsController extends AdminController
|
||||
|
||||
// Filter results
|
||||
if (Input::get('Pending')) {
|
||||
$assets = Asset::orderBy('asset_tag', 'ASC')->whereNull('status_id','and')->where('assigned_to','=','0')->where('physical', '=', 1)->get();
|
||||
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')
|
||||
->whereNull('status_id','and')
|
||||
->where('assigned_to','=','0')
|
||||
->where('physical', '=', 1)
|
||||
->get();
|
||||
} elseif (Input::get('RTD')) {
|
||||
$assets = Asset::orderBy('asset_tag', 'ASC')->where('status_id', '=', 0)->where('assigned_to','=','0')->where('physical', '=', 1)->get();
|
||||
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')
|
||||
->where('status_id', '=', 0)
|
||||
->where('physical', '=', 1)
|
||||
->orderBy('asset_tag', 'ASC')
|
||||
->get();
|
||||
} elseif (Input::get('Undeployable')) {
|
||||
$assets = Asset::orderBy('asset_tag', 'ASC')->where('status_id', '>', 1)->where('physical', '=', 1)->get();
|
||||
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')
|
||||
->where('physical', '=', 1)
|
||||
->where('assigned_to','>','1')
|
||||
->orderBy('asset_tag', 'ASC')
|
||||
->get();
|
||||
} elseif (Input::get('Deployed')) {
|
||||
$assets = Asset::orderBy('asset_tag', 'ASC')->where('status_id', '=', 0)->where('assigned_to','>','0')->where('physical', '=', 1)->get();
|
||||
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')
|
||||
->where('physical', '=', 1)
|
||||
->where('assigned_to','>','0')
|
||||
->orderBy('asset_tag', 'ASC')
|
||||
->get();
|
||||
} else {
|
||||
$assets = Asset::orderBy('asset_tag', 'ASC')->where('physical', '=', 1)->get();
|
||||
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc')
|
||||
->where('physical', '=', 1)
|
||||
->orderBy('asset_tag', 'ASC')
|
||||
->get();
|
||||
|
||||
}
|
||||
|
||||
// Paginate the users
|
||||
@@ -151,11 +171,13 @@ class AssetsController extends AdminController
|
||||
// Grab the dropdown list of models
|
||||
$model_list = array('' => '') + Model::orderBy('name', 'asc')->lists('name', 'id');
|
||||
$supplier_list = array('' => '') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
|
||||
$assigned_to = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat (first_name," ",last_name) as full_name, id'))->whereNull('deleted_at')->lists('full_name', 'id');
|
||||
$location_list = array('' => '') + Location::orderBy('name', 'asc')->lists('name', 'id');
|
||||
|
||||
// Grab the dropdown list of status
|
||||
$statuslabel_list = array('' => Lang::get('general.pending')) + array('0' => Lang::get('general.ready_to_deploy')) + Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
|
||||
|
||||
return View::make('backend/hardware/edit')->with('supplier_list',$supplier_list)->with('model_list',$model_list)->with('statuslabel_list',$statuslabel_list)->with('asset',new Asset);
|
||||
return View::make('backend/hardware/edit')->with('supplier_list',$supplier_list)->with('model_list',$model_list)->with('statuslabel_list',$statuslabel_list)->with('assigned_to',$assigned_to)->with('location_list',$location_list)->with('asset',new Asset);
|
||||
|
||||
}
|
||||
|
||||
@@ -167,15 +189,19 @@ class AssetsController extends AdminController
|
||||
*/
|
||||
public function postCreate()
|
||||
{
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
// create a new model instance
|
||||
$asset = new Asset();
|
||||
|
||||
//attempt to validate
|
||||
$validator = Validator::make(Input::all(), $asset->validationRules());
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
if ($asset->validate($new)) {
|
||||
else {
|
||||
|
||||
if ( e(Input::get('status_id')) == '') {
|
||||
$asset->status_id = NULL;
|
||||
@@ -192,7 +218,7 @@ class AssetsController extends AdminController
|
||||
if (e(Input::get('purchase_cost')) == '') {
|
||||
$asset->purchase_cost = NULL;
|
||||
} else {
|
||||
$asset->purchase_cost = e(Input::get('purchase_cost'));
|
||||
$asset->purchase_cost = ParseFloat(e(Input::get('purchase_cost')));
|
||||
}
|
||||
|
||||
if (e(Input::get('purchase_date')) == '') {
|
||||
@@ -201,6 +227,30 @@ class AssetsController extends AdminController
|
||||
$asset->purchase_date = e(Input::get('purchase_date'));
|
||||
}
|
||||
|
||||
if (e(Input::get('assigned_to')) == '') {
|
||||
$asset->assigned_to = 0;
|
||||
} else {
|
||||
$asset->assigned_to = e(Input::get('assigned_to'));
|
||||
}
|
||||
|
||||
if (e(Input::get('supplier_id')) == '') {
|
||||
$asset->supplier_id = 0;
|
||||
} else {
|
||||
$asset->supplier_id = e(Input::get('supplier_id'));
|
||||
}
|
||||
|
||||
if (e(Input::get('requestable')) == '') {
|
||||
$asset->requestable = 0;
|
||||
} else {
|
||||
$asset->requestable = e(Input::get('requestable'));
|
||||
}
|
||||
|
||||
if (e(Input::get('rtd_location_id')) == '') {
|
||||
$asset->rtd_location_id = 0;
|
||||
} else {
|
||||
$asset->rtd_location_id = e(Input::get('rtd_location_id'));
|
||||
}
|
||||
|
||||
// Save the asset data
|
||||
$asset->name = e(Input::get('name'));
|
||||
$asset->serial = e(Input::get('serial'));
|
||||
@@ -208,23 +258,17 @@ class AssetsController extends AdminController
|
||||
$asset->order_number = e(Input::get('order_number'));
|
||||
$asset->notes = e(Input::get('notes'));
|
||||
$asset->asset_tag = e(Input::get('asset_tag'));
|
||||
$asset->supplier_id = e(Input::get('supplier_id'));
|
||||
|
||||
$asset->user_id = Sentry::getId();
|
||||
$asset->assigned_to = '0';
|
||||
$asset->archived = '0';
|
||||
$asset->physical = '1';
|
||||
$asset->depreciate = '0';
|
||||
|
||||
|
||||
// Was the asset created?
|
||||
if($asset->save()) {
|
||||
// Redirect to the asset listing page
|
||||
return Redirect::to("hardware")->with('success', Lang::get('admin/hardware/message.create.success'));
|
||||
}
|
||||
} else {
|
||||
// failure
|
||||
$errors = $asset->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
}
|
||||
|
||||
// Redirect to the asset create page with an error
|
||||
@@ -247,14 +291,16 @@ class AssetsController extends AdminController
|
||||
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
|
||||
}
|
||||
|
||||
|
||||
// Grab the dropdown list of models
|
||||
$model_list = array('' => '') + Model::orderBy('name', 'asc')->lists('name', 'id');
|
||||
$supplier_list = array('' => '') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
|
||||
$location_list = array('' => '') + Location::orderBy('name', 'asc')->lists('name', 'id');
|
||||
|
||||
// Grab the dropdown list of status
|
||||
$statuslabel_list = array('' => Lang::get('general.pending')) + array('0' => Lang::get('general.ready_to_deploy')) + Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
|
||||
|
||||
return View::make('backend/hardware/edit', compact('asset'))->with('model_list',$model_list)->with('supplier_list',$supplier_list)->with('statuslabel_list',$statuslabel_list);
|
||||
return View::make('backend/hardware/edit', compact('asset'))->with('model_list',$model_list)->with('supplier_list',$supplier_list)->with('location_list',$location_list)->with('statuslabel_list',$statuslabel_list);
|
||||
}
|
||||
|
||||
|
||||
@@ -272,27 +318,19 @@ class AssetsController extends AdminController
|
||||
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
|
||||
}
|
||||
|
||||
//attempt to validate
|
||||
$validator = Validator::make(Input::all(), $asset->validationRules($assetId));
|
||||
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
'name' => 'alpha_space|min:3',
|
||||
'asset_tag' => 'required|alpha_space|min:3',
|
||||
'model_id' => 'required',
|
||||
'serial' => 'alpha_space|min:3',
|
||||
'warranty_months' => 'integer',
|
||||
'notes' => 'alpha_space',
|
||||
);
|
||||
|
||||
// Create a new validator instance from our validation rules
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
// If validation fails, we'll exit the operation now.
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
else {
|
||||
|
||||
if ( e(Input::get('status_id')) == '') {
|
||||
|
||||
if ( e(Input::get('status_id')) == '' ) {
|
||||
$asset->status_id = NULL;
|
||||
} else {
|
||||
$asset->status_id = e(Input::get('status_id'));
|
||||
@@ -307,7 +345,7 @@ class AssetsController extends AdminController
|
||||
if (e(Input::get('purchase_cost')) == '') {
|
||||
$asset->purchase_cost = NULL;
|
||||
} else {
|
||||
$asset->purchase_cost = e(Input::get('purchase_cost'));
|
||||
$asset->purchase_cost = ParseFloat(e(Input::get('purchase_cost')));
|
||||
}
|
||||
|
||||
if (e(Input::get('purchase_date')) == '') {
|
||||
@@ -316,22 +354,43 @@ class AssetsController extends AdminController
|
||||
$asset->purchase_date = e(Input::get('purchase_date'));
|
||||
}
|
||||
|
||||
if (e(Input::get('supplier_id')) == '') {
|
||||
$asset->supplier_id = NULL;
|
||||
} else {
|
||||
$asset->supplier_id = e(Input::get('supplier_id'));
|
||||
}
|
||||
|
||||
if (e(Input::get('requestable')) == '') {
|
||||
$asset->requestable = 0;
|
||||
} else {
|
||||
$asset->requestable = e(Input::get('requestable'));
|
||||
}
|
||||
|
||||
if (e(Input::get('rtd_location_id')) == '') {
|
||||
$asset->rtd_location_id = 0;
|
||||
} else {
|
||||
$asset->rtd_location_id = e(Input::get('rtd_location_id'));
|
||||
}
|
||||
|
||||
// Update the asset data
|
||||
$asset->name = e(Input::get('name'));
|
||||
$asset->serial = e(Input::get('serial'));
|
||||
$asset->model_id = e(Input::get('model_id'));
|
||||
$asset->order_number = e(Input::get('order_number'));
|
||||
$asset->order_number = e(Input::get('order_number'));
|
||||
$asset->asset_tag = e(Input::get('asset_tag'));
|
||||
$asset->notes = e(Input::get('notes'));
|
||||
$asset->supplier_id = e(Input::get('supplier_id'));
|
||||
$asset->physical = '1';
|
||||
$asset->physical = '1';
|
||||
|
||||
// Was the asset updated?
|
||||
if($asset->save()) {
|
||||
// Redirect to the new asset page
|
||||
return Redirect::to("hardware")->with('success', Lang::get('admin/hardware/message.update.success'));
|
||||
return Redirect::to("hardware/$assetId/view")->with('success', Lang::get('admin/hardware/message.update.success'));
|
||||
}
|
||||
else
|
||||
{
|
||||
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Redirect to the asset management page with error
|
||||
@@ -382,7 +441,6 @@ class AssetsController extends AdminController
|
||||
// Get the dropdown of users and then pass it to the checkout view
|
||||
$users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat(first_name," ",last_name) as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id');
|
||||
|
||||
//print_r($users);
|
||||
return View::make('backend/hardware/checkout', compact('asset'))->with('users_list',$users_list);
|
||||
|
||||
}
|
||||
@@ -582,7 +640,7 @@ class AssetsController extends AdminController
|
||||
public function getClone($assetId = null)
|
||||
{
|
||||
// Check if the asset exists
|
||||
if (is_null($asset = Asset::find($assetId))) {
|
||||
if (is_null($asset_to_clone = Asset::find($assetId))) {
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
|
||||
}
|
||||
@@ -593,11 +651,17 @@ class AssetsController extends AdminController
|
||||
// Grab the dropdown list of status
|
||||
$statuslabel_list = array('' => 'Pending') + array('0' => 'Ready to Deploy') + Statuslabel::lists('name', 'id');
|
||||
|
||||
$location_list = array('' => '') + Location::lists('name', 'id');
|
||||
|
||||
// get depreciation list
|
||||
$depreciation_list = array('' => '') + Depreciation::lists('name', 'id');
|
||||
$supplier_list = array('' => '') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
|
||||
$assigned_to = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat (first_name," ",last_name) as full_name, id'))->whereNull('deleted_at')->lists('full_name', 'id');
|
||||
|
||||
$asset = clone $asset_to_clone;
|
||||
$asset->id = null;
|
||||
$asset->asset_tag = '';
|
||||
return View::make('backend/hardware/edit')->with('supplier_list',$supplier_list)->with('model_list',$model_list)->with('statuslabel_list',$statuslabel_list)->with('assigned_to',$assigned_to)->with('asset',$asset)->with('location_list',$location_list);
|
||||
|
||||
return View::make('backend/hardware/clone', compact('asset'))->with('model_list',$model_list)->with('depreciation_list',$depreciation_list)->with('statuslabel_list',$statuslabel_list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Regular → Executable
+21
-17
@@ -23,7 +23,7 @@ class CategoriesController extends AdminController
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the categories
|
||||
$categories = Category::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
|
||||
$categories = Category::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/categories/index', compact('categories'));
|
||||
@@ -50,14 +50,17 @@ class CategoriesController extends AdminController
|
||||
public function postCreate()
|
||||
{
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
// create a new model instance
|
||||
$category = new Category();
|
||||
|
||||
$validator = Validator::make(Input::all(), $category->rules);
|
||||
|
||||
// attempt validation
|
||||
if ($category->validate($new)) {
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
else{
|
||||
|
||||
// Update the category data
|
||||
$category->name = e(Input::get('name'));
|
||||
@@ -68,11 +71,7 @@ class CategoriesController extends AdminController
|
||||
// Redirect to the new category page
|
||||
return Redirect::to("admin/settings/categories")->with('success', Lang::get('admin/categories/message.create.success'));
|
||||
}
|
||||
} else {
|
||||
// failure
|
||||
$errors = $category->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the category create page
|
||||
return Redirect::to('admin/settings/categories/create')->with('error', Lang::get('admin/categories/message.create.error'));
|
||||
@@ -120,8 +119,17 @@ class CategoriesController extends AdminController
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
// attempt validation
|
||||
$validator = Validator::make(Input::all(), $category->validationRules($categoryId));
|
||||
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
if ($category->validate($new)) {
|
||||
else {
|
||||
|
||||
// Update the category data
|
||||
$category->name = e(Input::get('name'));
|
||||
@@ -131,11 +139,7 @@ class CategoriesController extends AdminController
|
||||
// Redirect to the new category page
|
||||
return Redirect::to("admin/settings/categories")->with('success', Lang::get('admin/categories/message.update.success'));
|
||||
}
|
||||
} else {
|
||||
// failure
|
||||
$errors = $category->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the category management page
|
||||
return Redirect::to("admin/settings/categories/$categoryID/edit")->with('error', Lang::get('admin/categories/message.update.error'));
|
||||
|
||||
Regular → Executable
+12
-13
@@ -23,7 +23,7 @@ class DepreciationsController extends AdminController
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the depreciations
|
||||
$depreciations = Depreciation::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
|
||||
$depreciations = Depreciation::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/depreciations/index', compact('depreciations'));
|
||||
@@ -118,27 +118,26 @@ class DepreciationsController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
//attempt to validate
|
||||
$validator = Validator::make(Input::all(), $depreciation->validationRules($depreciationId));
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
if ($depreciation->validate($new)) {
|
||||
|
||||
else {
|
||||
// Depreciation data
|
||||
$depreciation->name = e(Input::get('name'));
|
||||
$depreciation->name = e(Input::get('name'));
|
||||
$depreciation->months = e(Input::get('months'));
|
||||
|
||||
// Was the asset created?
|
||||
if($depreciation->save()) {
|
||||
// Redirect to the depreciation page
|
||||
return Redirect::to("admin/settings/depreciations/$depreciationId/edit")->with('success', Lang::get('admin/depreciations/message.update.success'));
|
||||
return Redirect::to("admin/settings/depreciations/")->with('success', Lang::get('admin/depreciations/message.update.success'));
|
||||
}
|
||||
} else {
|
||||
// failure
|
||||
$errors = $depreciation->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the depreciation management page
|
||||
return Redirect::to("admin/settings/depreciations/$depreciationId/edit")->with('error', Lang::get('admin/depreciations/message.update.error'));
|
||||
|
||||
Regular → Executable
+160
-51
@@ -1,5 +1,6 @@
|
||||
<?php namespace Controllers\Admin;
|
||||
|
||||
use Assets;
|
||||
use AdminController;
|
||||
use Input;
|
||||
use Lang;
|
||||
@@ -14,9 +15,11 @@ use Depreciation;
|
||||
use Setting;
|
||||
use Sentry;
|
||||
use Str;
|
||||
use Supplier;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
|
||||
class LicensesController extends AdminController
|
||||
{
|
||||
/**
|
||||
@@ -25,10 +28,13 @@ class LicensesController extends AdminController
|
||||
* @return View
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the licenses
|
||||
$licenses = License::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
|
||||
$licenses = License::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/licenses/index', compact('licenses'));
|
||||
@@ -46,7 +52,8 @@ class LicensesController extends AdminController
|
||||
$license_options = array('0' => 'Top Level') + License::lists('name', 'id');
|
||||
// Show the page
|
||||
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
|
||||
return View::make('backend/licenses/edit')->with('license_options',$license_options)->with('depreciation_list',$depreciation_list)->with('license',new License);
|
||||
$supplier_list = array('' => 'Select Supplier') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
|
||||
return View::make('backend/licenses/edit')->with('license_options',$license_options)->with('depreciation_list',$depreciation_list)->with('supplier_list',$supplier_list)->with('license',new License);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,42 +75,57 @@ class LicensesController extends AdminController
|
||||
// attempt validation
|
||||
if ($license->validate($new)) {
|
||||
|
||||
if ( e(Input::get('purchase_cost')) == '') {
|
||||
$license->purchase_cost = NULL;
|
||||
} else {
|
||||
$license->purchase_cost = ParseFloat(e(Input::get('purchase_cost')));
|
||||
//$license->purchase_cost = e(Input::get('purchase_cost'));
|
||||
}
|
||||
|
||||
if ( e(Input::get('supplier_id')) == '') {
|
||||
$license->supplier_id = NULL;
|
||||
} else {
|
||||
$license->supplier_id = e(Input::get('supplier_id'));
|
||||
}
|
||||
|
||||
// Save the license data
|
||||
$license->name = e(Input::get('name'));
|
||||
$license->serial = e(Input::get('serial'));
|
||||
$license->license_email = e(Input::get('license_email'));
|
||||
$license->license_name = e(Input::get('license_name'));
|
||||
$license->notes = e(Input::get('notes'));
|
||||
$license->order_number = e(Input::get('order_number'));
|
||||
$license->seats = e(Input::get('seats'));
|
||||
$license->purchase_date = e(Input::get('purchase_date'));
|
||||
$license->purchase_cost = e(Input::get('purchase_cost'));
|
||||
$license->depreciate = e(Input::get('depreciate'));
|
||||
$license->user_id = Sentry::getId();
|
||||
$license->name = e(Input::get('name'));
|
||||
$license->serial = e(Input::get('serial'));
|
||||
$license->license_email = e(Input::get('license_email'));
|
||||
$license->license_name = e(Input::get('license_name'));
|
||||
$license->notes = e(Input::get('notes'));
|
||||
$license->order_number = e(Input::get('order_number'));
|
||||
$license->seats = e(Input::get('seats'));
|
||||
$license->purchase_date = e(Input::get('purchase_date'));
|
||||
$license->purchase_order = e(Input::get('purchase_order'));
|
||||
//$license->purchase_cost = e(Input::get('purchase_cost'));
|
||||
$license->depreciation_id = e(Input::get('depreciation_id'));
|
||||
$license->expiration_date = e(Input::get('expiration_date'));
|
||||
//$license->asset_id = e(Input::get('asset_id'));
|
||||
$license->user_id = Sentry::getId();
|
||||
|
||||
if (($license->purchase_date == "") || ($license->purchase_date == "0000-00-00")) {
|
||||
$license->purchase_date = NULL;
|
||||
}
|
||||
|
||||
if (($license->expiration_date == "") || ($license->expiration_date == "0000-00-00")) {
|
||||
$license->expiration_date = NULL;
|
||||
}
|
||||
|
||||
if (($license->purchase_cost == "") || ($license->purchase_cost == "0.00")) {
|
||||
$license->purchase_cost = NULL;
|
||||
}
|
||||
|
||||
if ($license->depreciate == "") {
|
||||
$license->depreciate = 0;
|
||||
}
|
||||
|
||||
|
||||
// Was the license created?
|
||||
if($license->save()) {
|
||||
$insertedId = $license->id;
|
||||
// Save the license seat data
|
||||
for ($x=0; $x<$license->seats; $x++) {
|
||||
$license_seat = new LicenseSeat();
|
||||
$license_seat->license_id = $insertedId;
|
||||
$license_seat->user_id = Sentry::getId();
|
||||
$license_seat->assigned_to = 0;
|
||||
$license_seat->notes = NULL;
|
||||
$license_seat->license_id = $insertedId;
|
||||
$license_seat->user_id = Sentry::getId();
|
||||
$license_seat->assigned_to = 0;
|
||||
$license_seat->notes = NULL;
|
||||
$license_seat->save();
|
||||
}
|
||||
|
||||
@@ -147,7 +169,8 @@ class LicensesController extends AdminController
|
||||
// Show the page
|
||||
$license_options = array('' => 'Top Level') + DB::table('assets')->where('id', '!=', $licenseId)->lists('name', 'id');
|
||||
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
|
||||
return View::make('backend/licenses/edit', compact('license'))->with('license_options',$license_options)->with('depreciation_list',$depreciation_list);
|
||||
$supplier_list = array('' => 'Select Supplier') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
|
||||
return View::make('backend/licenses/edit', compact('license'))->with('license_options',$license_options)->with('depreciation_list',$depreciation_list)->with('supplier_list',$supplier_list);
|
||||
}
|
||||
|
||||
|
||||
@@ -175,12 +198,20 @@ class LicensesController extends AdminController
|
||||
if ($license->validate($new)) {
|
||||
|
||||
// Update the license data
|
||||
$license->name = e(Input::get('name'));
|
||||
$license->serial = e(Input::get('serial'));
|
||||
$license->license_email = e(Input::get('license_email'));
|
||||
$license->license_name = e(Input::get('license_name'));
|
||||
$license->notes = e(Input::get('notes'));
|
||||
$license->order_number = e(Input::get('order_number'));
|
||||
$license->name = e(Input::get('name'));
|
||||
$license->serial = e(Input::get('serial'));
|
||||
$license->license_email = e(Input::get('license_email'));
|
||||
$license->license_name = e(Input::get('license_name'));
|
||||
$license->notes = e(Input::get('notes'));
|
||||
$license->order_number = e(Input::get('order_number'));
|
||||
$license->depreciation_id = e(Input::get('depreciation_id'));
|
||||
$license->purchase_order = e(Input::get('purchase_order'));
|
||||
|
||||
if ( e(Input::get('supplier_id')) == '') {
|
||||
$license->supplier_id = NULL;
|
||||
} else {
|
||||
$license->supplier_id = e(Input::get('supplier_id'));
|
||||
}
|
||||
|
||||
// Update the asset data
|
||||
if ( e(Input::get('purchase_date')) == '') {
|
||||
@@ -189,10 +220,17 @@ class LicensesController extends AdminController
|
||||
$license->purchase_date = e(Input::get('purchase_date'));
|
||||
}
|
||||
|
||||
if ( e(Input::get('expiration_date')) == '') {
|
||||
$license->expiration_date = NULL;
|
||||
} else {
|
||||
$license->expiration_date = e(Input::get('expiration_date'));
|
||||
}
|
||||
|
||||
if ( e(Input::get('purchase_cost')) == '') {
|
||||
$license->purchase_cost = NULL;
|
||||
} else {
|
||||
$license->purchase_cost = e(Input::get('purchase_cost'));
|
||||
$license->purchase_cost = ParseFloat(e(Input::get('purchase_cost')));
|
||||
//$license->purchase_cost = e(Input::get('purchase_cost'));
|
||||
}
|
||||
|
||||
|
||||
@@ -233,10 +271,10 @@ class LicensesController extends AdminController
|
||||
for ($i=1; $i <= $difference; $i++) {
|
||||
//Create a seat for this license
|
||||
$license_seat = new LicenseSeat();
|
||||
$license_seat->license_id = $license->id;
|
||||
$license_seat->user_id = Sentry::getId();
|
||||
$license_seat->assigned_to = 0;
|
||||
$license_seat->notes = NULL;
|
||||
$license_seat->license_id = $license->id;
|
||||
$license_seat->user_id = Sentry::getId();
|
||||
$license_seat->assigned_to = 0;
|
||||
$license_seat->notes = NULL;
|
||||
$license_seat->save();
|
||||
}
|
||||
|
||||
@@ -248,7 +286,7 @@ class LicensesController extends AdminController
|
||||
$logaction->note = abs($difference)." seats";
|
||||
$log = $logaction->logaction('add seats');
|
||||
}
|
||||
$license->seats = e(Input::get('seats'));
|
||||
$license->seats = e(Input::get('seats'));
|
||||
}
|
||||
|
||||
// Was the asset created?
|
||||
@@ -316,8 +354,30 @@ class LicensesController extends AdminController
|
||||
// Get the dropdown of users and then pass it to the checkout view
|
||||
$users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat (first_name," ",last_name) as full_name, id'))->whereNull('deleted_at')->lists('full_name', 'id');
|
||||
|
||||
//print_r($users);
|
||||
return View::make('backend/licenses/checkout', compact('licenseseat'))->with('users_list',$users_list);
|
||||
// Left join to get a list of assets and some other helpful info
|
||||
$asset = DB::table('assets')
|
||||
->leftJoin('users', 'users.id', '=', 'assets.assigned_to')
|
||||
->select('assets.id', 'name', 'first_name', 'last_name','asset_tag',
|
||||
DB::raw('concat (first_name," ",last_name) as full_name, assets.id as id'))
|
||||
->whereNull('assets.deleted_at')
|
||||
->get();
|
||||
|
||||
$asset_array = json_decode(json_encode($asset), true);
|
||||
$asset_element[''] = 'Please select an asset';
|
||||
|
||||
// Build a list out of the data results
|
||||
for ($x=0; $x<count($asset_array); $x++) {
|
||||
|
||||
if ($asset_array[$x]['full_name']!='') {
|
||||
$full_name = ' ('.$asset_array[$x]['full_name'].')';
|
||||
} else {
|
||||
$full_name = ' (Unassigned)';
|
||||
}
|
||||
$asset_element[$asset_array[$x]['id']] = $asset_array[$x]['asset_tag'].' - '.$asset_array[$x]['name'].$full_name;
|
||||
|
||||
}
|
||||
|
||||
return View::make('backend/licenses/checkout', compact('licenseseat'))->with('users_list',$users_list)->with('asset_list',$asset_element);
|
||||
|
||||
}
|
||||
|
||||
@@ -328,18 +388,16 @@ class LicensesController extends AdminController
|
||||
**/
|
||||
public function postCheckout($seatId)
|
||||
{
|
||||
// Check if the asset exists
|
||||
if (is_null($licenseseat = LicenseSeat::find($seatId))) {
|
||||
// Redirect to the asset management page with error
|
||||
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
|
||||
}
|
||||
|
||||
|
||||
$assigned_to = e(Input::get('assigned_to'));
|
||||
$asset_id = e(Input::get('asset_id'));
|
||||
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
'assigned_to' => 'required|integer|min:1',
|
||||
|
||||
'note' => 'alpha_space',
|
||||
'asset_id' => 'required_without:assigned_to',
|
||||
);
|
||||
|
||||
// Create a new validator instance from our validation rules
|
||||
@@ -351,17 +409,46 @@ class LicensesController extends AdminController
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
|
||||
|
||||
if ($assigned_to!='') {
|
||||
// Check if the user exists
|
||||
if (is_null($assigned_to = User::find($assigned_to))) {
|
||||
// Redirect to the asset management page with error
|
||||
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.user_does_not_exist'));
|
||||
if (is_null($is_assigned_to = User::find($assigned_to))) {
|
||||
// Redirect to the asset management page with error
|
||||
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.user_does_not_exist'));
|
||||
}
|
||||
}
|
||||
|
||||
if ($asset_id!='') {
|
||||
|
||||
if (is_null($is_asset_id = Asset::find($asset_id))) {
|
||||
// Redirect to the asset management page with error
|
||||
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.asset_does_not_exist'));
|
||||
}
|
||||
|
||||
if (($is_asset_id->assigned_to!=$assigned_to) && ($assigned_to!='')) {
|
||||
//echo 'asset assigned to: '.$is_asset_id->assigned_to.'<br>license assigned to: '.$assigned_to;
|
||||
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.owner_doesnt_match_asset'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Check if the asset exists
|
||||
if (is_null($licenseseat = LicenseSeat::find($seatId))) {
|
||||
// Redirect to the asset management page with error
|
||||
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
|
||||
}
|
||||
|
||||
if ( e(Input::get('asset_id')) == '') {
|
||||
$licenseseat->asset_id = NULL;
|
||||
} else {
|
||||
$licenseseat->asset_id = e(Input::get('asset_id'));
|
||||
}
|
||||
|
||||
// Update the asset data
|
||||
if ( e(Input::get('assigned_to')) == '') {
|
||||
$licenseseat->assigned_to = NULL;
|
||||
|
||||
} else {
|
||||
$licenseseat->assigned_to = e(Input::get('assigned_to'));
|
||||
}
|
||||
@@ -370,8 +457,8 @@ class LicensesController extends AdminController
|
||||
if($licenseseat->save()) {
|
||||
|
||||
$logaction = new Actionlog();
|
||||
$logaction->asset_id = $licenseseat->license_id;
|
||||
$logaction->location_id = $assigned_to->location_id;
|
||||
|
||||
//$logaction->location_id = $assigned_to->location_id;
|
||||
$logaction->asset_type = 'software';
|
||||
$logaction->user_id = Sentry::getUser()->id;
|
||||
$logaction->note = e(Input::get('note'));
|
||||
@@ -442,11 +529,12 @@ class LicensesController extends AdminController
|
||||
$logaction->checkedout_to = $licenseseat->assigned_to;
|
||||
|
||||
// Update the asset data
|
||||
$licenseseat->assigned_to = '0';
|
||||
$licenseseat->assigned_to = '0';
|
||||
$licenseseat->asset_id = NULL;
|
||||
|
||||
// Was the asset updated?
|
||||
if($licenseseat->save()) {
|
||||
$logaction->asset_id = $licenseseat->license_id;
|
||||
$logaction->asset_id = NULL;
|
||||
$logaction->location_id = NULL;
|
||||
$logaction->asset_type = 'software';
|
||||
$logaction->note = e(Input::get('note'));
|
||||
@@ -482,5 +570,26 @@ class LicensesController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function getClone($licenseId = null)
|
||||
{
|
||||
// Check if the license exists
|
||||
if (is_null($license_to_clone = License::find($licenseId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.does_not_exist'));
|
||||
}
|
||||
|
||||
// Show the page
|
||||
$license_options = array('0' => 'Top Level') + License::lists('name', 'id');
|
||||
|
||||
//clone the orig
|
||||
$license = clone $license_to_clone;
|
||||
$license->id = null;
|
||||
$license->serial = null;
|
||||
|
||||
// Show the page
|
||||
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
|
||||
$supplier_list = array('' => 'Select Supplier') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
|
||||
return View::make('backend/licenses/edit')->with('license_options',$license_options)->with('depreciation_list',$depreciation_list)->with('supplier_list',$supplier_list)->with('license',$license);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+11
-13
@@ -23,7 +23,7 @@ class LocationsController extends AdminController
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the locations
|
||||
$locations = Location::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
|
||||
$locations = Location::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/locations/index', compact('locations'));
|
||||
@@ -123,14 +123,16 @@ class LocationsController extends AdminController
|
||||
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.does_not_exist'));
|
||||
}
|
||||
|
||||
//attempt to validate
|
||||
$validator = Validator::make(Input::all(), $location->validationRules($locationId));
|
||||
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
if ($location->validate($new)) {
|
||||
else {
|
||||
|
||||
// Update the location data
|
||||
$location->name = e(Input::get('name'));
|
||||
@@ -144,13 +146,9 @@ class LocationsController extends AdminController
|
||||
// Was the asset created?
|
||||
if($location->save()) {
|
||||
// Redirect to the saved location page
|
||||
return Redirect::to("admin/settings/locations/$locationId/edit")->with('success', Lang::get('admin/locations/message.update.success'));
|
||||
return Redirect::to("admin/settings/locations/")->with('success', Lang::get('admin/locations/message.update.success'));
|
||||
}
|
||||
} else {
|
||||
// failure
|
||||
$errors = $location->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the location management page
|
||||
return Redirect::to("admin/settings/locations/$locationId/edit")->with('error', Lang::get('admin/locations/message.update.error'));
|
||||
|
||||
Regular → Executable
+9
-11
@@ -21,7 +21,7 @@ class ManufacturersController extends AdminController
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the manufacturers
|
||||
$manufacturers = Manufacturer::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
|
||||
$manufacturers = Manufacturer::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/manufacturers/index', compact('manufacturers'));
|
||||
@@ -109,13 +109,15 @@ class ManufacturersController extends AdminController
|
||||
return Redirect::to('admin/settings/manufacturers')->with('error', Lang::get('admin/manufacturers/message.does_not_exist'));
|
||||
}
|
||||
|
||||
$validator = Validator::make(Input::all(), $manufacturer->validationRules($manufacturerId));
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
if ($manufacturer->validate($new)) {
|
||||
|
||||
else {
|
||||
// Save the data
|
||||
$manufacturer->name = e(Input::get('name'));
|
||||
|
||||
@@ -124,11 +126,7 @@ class ManufacturersController extends AdminController
|
||||
// Redirect to the new manufacturer page
|
||||
return Redirect::to("admin/settings/manufacturers")->with('success', Lang::get('admin/manufacturers/message.update.success'));
|
||||
}
|
||||
} else {
|
||||
// failure
|
||||
$errors = $manufacturer->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the manufacturer management page
|
||||
return Redirect::to("admin/settings/manufacturers/$manufacturerId/edit")->with('error', Lang::get('admin/manufacturers/message.update.error'));
|
||||
|
||||
Regular → Executable
+87
-14
@@ -1,6 +1,7 @@
|
||||
<?php namespace Controllers\Admin;
|
||||
|
||||
use AdminController;
|
||||
use Image;
|
||||
use Input;
|
||||
use Lang;
|
||||
use Model;
|
||||
@@ -24,7 +25,7 @@ class ModelsController extends AdminController
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the models
|
||||
$models = Model::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
|
||||
$models = Model::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/models/index', compact('models'));
|
||||
@@ -66,16 +67,38 @@ class ModelsController extends AdminController
|
||||
|
||||
// attempt validation
|
||||
if ($model->validate($new)) {
|
||||
|
||||
if ( e(Input::get('depreciation_id')) == '') {
|
||||
$model->depreciation_id = 0;
|
||||
} else {
|
||||
$model->depreciation_id = e(Input::get('depreciation_id'));
|
||||
}
|
||||
|
||||
if ( e(Input::get('eol')) == '') {
|
||||
$model->eol = 0;
|
||||
} else {
|
||||
$model->eol = e(Input::get('eol'));
|
||||
}
|
||||
|
||||
// Save the model data
|
||||
$model->name = e(Input::get('name'));
|
||||
$model->modelno = e(Input::get('modelno'));
|
||||
$model->depreciation_id = e(Input::get('depreciation_id'));
|
||||
//$model->depreciation_id = e(Input::get('depreciation_id'));
|
||||
$model->manufacturer_id = e(Input::get('manufacturer_id'));
|
||||
$model->category_id = e(Input::get('category_id'));
|
||||
$model->user_id = Sentry::getId();
|
||||
$model->eol = e(Input::get('eol'));
|
||||
//$model->eol = e(Input::get('eol'));
|
||||
|
||||
if (Input::file('image')) {
|
||||
$image = Input::file('image');
|
||||
$file_name = str_random(25).".".$image->getClientOriginalExtension();
|
||||
$path = public_path('uploads/models/'.$file_name);
|
||||
Image::make($image->getRealPath())->resize(300, null, function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
$constraint->upsize();
|
||||
})->save($path);
|
||||
$model->image = $file_name;
|
||||
}
|
||||
|
||||
// Was it created?
|
||||
if($model->save()) {
|
||||
@@ -132,31 +155,56 @@ class ModelsController extends AdminController
|
||||
return Redirect::to('admin/models')->with('error', Lang::get('admin/models/message.does_not_exist'));
|
||||
}
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
//attempt to validate
|
||||
$validator = Validator::make(Input::all(), $model->validationRules($modelId));
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
if ($model->validate($new)) {
|
||||
else {
|
||||
|
||||
if ( e(Input::get('depreciation_id')) == '') {
|
||||
$model->depreciation_id = 0;
|
||||
} else {
|
||||
$model->depreciation_id = e(Input::get('depreciation_id'));
|
||||
}
|
||||
|
||||
if ( e(Input::get('eol')) == '') {
|
||||
$model->eol = 0;
|
||||
} else {
|
||||
$model->eol = e(Input::get('eol'));
|
||||
}
|
||||
|
||||
// Update the model data
|
||||
$model->name = e(Input::get('name'));
|
||||
$model->modelno = e(Input::get('modelno'));
|
||||
$model->depreciation_id = e(Input::get('depreciation_id'));
|
||||
$model->modelno = e(Input::get('modelno'));
|
||||
$model->manufacturer_id = e(Input::get('manufacturer_id'));
|
||||
$model->category_id = e(Input::get('category_id'));
|
||||
$model->eol = e(Input::get('eol'));
|
||||
|
||||
if (Input::file('image')) {
|
||||
$image = Input::file('image');
|
||||
$file_name = str_random(25).".".$image->getClientOriginalExtension();
|
||||
$path = public_path('uploads/models/'.$file_name);
|
||||
Image::make($image->getRealPath())->resize(300, null, function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
$constraint->upsize();
|
||||
})->save($path);
|
||||
$model->image = $file_name;
|
||||
}
|
||||
|
||||
if (Input::get('image_delete') == 1 && Input::file('image') == "") {
|
||||
$model->image = NULL;
|
||||
}
|
||||
|
||||
// Was it created?
|
||||
if($model->save()) {
|
||||
// Redirect to the new model page
|
||||
return Redirect::to("hardware/models")->with('success', Lang::get('admin/models/message.update.success'));
|
||||
}
|
||||
} else {
|
||||
// failure
|
||||
$errors = $model->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the model create page
|
||||
return Redirect::to("hardware/models/$modelId/edit")->with('error', Lang::get('admin/models/message.update.error'));
|
||||
@@ -212,6 +260,31 @@ class ModelsController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function getClone($modelId = null)
|
||||
{
|
||||
// Check if the model exists
|
||||
if (is_null($model_to_clone = Model::find($modelId))) {
|
||||
// Redirect to the model management page
|
||||
return Redirect::to('assets/models')->with('error', Lang::get('admin/models/message.does_not_exist'));
|
||||
}
|
||||
|
||||
$model = clone $model_to_clone;
|
||||
$model->id = null;
|
||||
|
||||
// Show the page
|
||||
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
|
||||
$manufacturer_list = array('' => 'Select One') + Manufacturer::lists('name', 'id');
|
||||
$category_list = array('' => '') + DB::table('categories')->whereNull('deleted_at')->lists('name', 'id');
|
||||
$view = View::make('backend/models/edit');
|
||||
$view->with('category_list',$category_list);
|
||||
$view->with('depreciation_list',$depreciation_list);
|
||||
$view->with('manufacturer_list',$manufacturer_list);
|
||||
$view->with('model',$model);
|
||||
$view->with('clone_model',$model_to_clone);
|
||||
return $view;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Regular → Executable
+2
@@ -82,8 +82,10 @@ class SettingsController extends AdminController
|
||||
$setting->id = '1';
|
||||
$setting->site_name = e(Input::get('site_name'));
|
||||
$setting->display_asset_name = e(Input::get('display_asset_name', '0'));
|
||||
$setting->display_checkout_date = e(Input::get('display_checkout_date', '0'));
|
||||
$setting->per_page = e(Input::get('per_page'));
|
||||
$setting->qr_code = e(Input::get('qr_code', '0'));
|
||||
$setting->display_eol = e(Input::get('display_eol', '0'));
|
||||
$setting->qr_text = e(Input::get('qr_text'));
|
||||
|
||||
// Was the asset updated?
|
||||
|
||||
Regular → Executable
+11
-14
@@ -23,7 +23,7 @@ class StatuslabelsController extends AdminController
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the statuslabels
|
||||
$statuslabels = Statuslabel::orderBy('created_at', 'DESC')->paginate(10);
|
||||
$statuslabels = Statuslabel::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/statuslabels/index', compact('statuslabels'));
|
||||
@@ -113,28 +113,25 @@ class StatuslabelsController extends AdminController
|
||||
return Redirect::to('admin/settings/statuslabels')->with('error', Lang::get('admin/statuslabels/message.does_not_exist'));
|
||||
}
|
||||
|
||||
//attempt to validate
|
||||
$validator = Validator::make(Input::all(), $statuslabel->validationRules($statuslabelId));
|
||||
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
if ($statuslabel->validate($new)) {
|
||||
|
||||
else {
|
||||
// Update the Statuslabel data
|
||||
$statuslabel->name = e(Input::get('name'));
|
||||
|
||||
// Was the asset created?
|
||||
if($statuslabel->save()) {
|
||||
// Redirect to the saved Statuslabel page
|
||||
return Redirect::to("admin/settings/statuslabels/$statuslabelId/edit")->with('success', Lang::get('admin/statuslabels/message.update.success'));
|
||||
return Redirect::to("admin/settings/statuslabels/")->with('success', Lang::get('admin/statuslabels/message.update.success'));
|
||||
}
|
||||
} else {
|
||||
// failure
|
||||
$errors = $statuslabel->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the Statuslabel management page
|
||||
return Redirect::to("admin/settings/statuslabels/$statuslabelId/edit")->with('error', Lang::get('admin/statuslabels/message.update.error'));
|
||||
|
||||
Regular → Executable
+10
-10
@@ -21,7 +21,7 @@ class SuppliersController extends AdminController
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the suppliers
|
||||
$suppliers = Supplier::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
|
||||
$suppliers = Supplier::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/suppliers/index', compact('suppliers'));
|
||||
@@ -122,12 +122,16 @@ class SuppliersController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
//attempt to validate
|
||||
$validator = Validator::make(Input::all(), $supplier->validationRules($supplierId));
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
if ($supplier->validate($new)) {
|
||||
else {
|
||||
|
||||
// Save the data
|
||||
$supplier->name = e(Input::get('name'));
|
||||
@@ -150,11 +154,7 @@ class SuppliersController extends AdminController
|
||||
// Redirect to the new supplier page
|
||||
return Redirect::to("admin/settings/suppliers")->with('success', Lang::get('admin/suppliers/message.update.success'));
|
||||
}
|
||||
} else {
|
||||
// failure
|
||||
$errors = $supplier->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the supplier management page
|
||||
return Redirect::to("admin/settings/suppliers/$supplierId/edit")->with('error', Lang::get('admin/suppliers/message.update.error'));
|
||||
|
||||
@@ -32,9 +32,10 @@ class UsersController extends AdminController
|
||||
protected $validationRules = array(
|
||||
'first_name' => 'required|alpha_space|min:2',
|
||||
'last_name' => 'required|alpha_space|min:2',
|
||||
'location_id' => 'required',
|
||||
'email' => 'required|email|unique:users,email',
|
||||
'password' => 'required|between:10,32',
|
||||
'password_confirm' => 'required|between:10,32|same:password',
|
||||
'password' => 'required|min:6',
|
||||
'password_confirm' => 'required|min:6|same:password',
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -44,14 +45,29 @@ class UsersController extends AdminController
|
||||
*/
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the users
|
||||
// Grab all the users - depending on the scope to include
|
||||
$users = Sentry::getUserProvider()->createModel();
|
||||
|
||||
// Do we want to include the deleted users?
|
||||
// the with and onlyTrashed calls currently do not work - returns an
|
||||
// inconsistent array which cannot be displayed by the blade output
|
||||
|
||||
if (Input::get('withTrashed')) {
|
||||
|
||||
$users = $users->withTrashed();
|
||||
//$users = Sentry::getUserProvider()->createModel()->paginate();
|
||||
|
||||
} elseif (Input::get('onlyTrashed')) {
|
||||
$users = $users->onlyTrashed();
|
||||
|
||||
// this is a tempoary 'fix' to display NO deleted users.
|
||||
//$users = Sentry::getUserProvider()->createModel()->whereNotNull('deleted_at')->paginate();
|
||||
//$users = Sentry::findAllUsers();
|
||||
//$users = users::deletedUsers()->paginate();
|
||||
$users = Sentry::getUserProvider()->createModel()->onlyTrashed();
|
||||
//$users = users::whereNotNull('deleted_at')->paginate();
|
||||
//$users = $users->onlyTrashed();
|
||||
//$users = Users::onlyTrashed()->get();
|
||||
//$users = Sentry::getUserProvider()->createModel();
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +78,6 @@ class UsersController extends AdminController
|
||||
'onlyTrashed' => Input::get('onlyTrashed'),
|
||||
));
|
||||
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/users/index', compact('users'));
|
||||
}
|
||||
@@ -78,26 +93,36 @@ class UsersController extends AdminController
|
||||
$groups = Sentry::getGroupProvider()->findAll();
|
||||
|
||||
// Selected groups
|
||||
$selectedGroups = Input::old('groups', array());
|
||||
$userGroups = Input::old('groups', array());
|
||||
|
||||
// Get all the available permissions
|
||||
$permissions = Config::get('permissions');
|
||||
$this->encodeAllPermissions($permissions);
|
||||
|
||||
// Selected permissions
|
||||
$selectedPermissions = Input::old('permissions', array('superuser' => -1));
|
||||
$this->encodePermissions($selectedPermissions);
|
||||
$userPermissions = Input::old('permissions', array('superuser' => -1));
|
||||
$this->encodePermissions($userPermissions);
|
||||
|
||||
$location_list = array('' => '') + Location::lists('name', 'id');
|
||||
$manager_list = array('' => 'Select a User') + DB::table('users')
|
||||
$manager_list = array('' => '') + DB::table('users')
|
||||
->select(DB::raw('concat(first_name," ",last_name) as full_name, id'))
|
||||
->whereNull('deleted_at','and')
|
||||
->orderBy('last_name', 'asc')
|
||||
->orderBy('first_name', 'asc')
|
||||
->lists('full_name', 'id');
|
||||
|
||||
/*echo '<pre>';
|
||||
print_r($userPermissions);
|
||||
echo '</pre>';
|
||||
exit;
|
||||
*/
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/users/create', compact('groups', 'selectedGroups', 'permissions', 'selectedPermissions'))->with('location_list',$location_list)->with('manager_list',$manager_list);
|
||||
return View::make('backend/users/edit', compact('groups', 'userGroups', 'permissions', 'userPermissions'))
|
||||
->with('location_list',$location_list)
|
||||
->with('manager_list',$manager_list)
|
||||
->with('user',new User);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,29 +134,38 @@ class UsersController extends AdminController
|
||||
{
|
||||
// Create a new validator instance from our validation rules
|
||||
$validator = Validator::make(Input::all(), $this->validationRules);
|
||||
$permissions = Input::get('permissions', array());
|
||||
$this->decodePermissions($permissions);
|
||||
app('request')->request->set('permissions', $permissions);
|
||||
|
||||
// If validation fails, we'll exit the operation now.
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
return Redirect::back()->withInput()->withErrors($validator)->with('permissions',$permissions);
|
||||
}
|
||||
|
||||
try {
|
||||
// We need to reverse the UI specific logic for our
|
||||
// permissions here before we create the user.
|
||||
$permissions = Input::get('permissions', array());
|
||||
$this->decodePermissions($permissions);
|
||||
app('request')->request->set('permissions', $permissions);
|
||||
|
||||
// Get the inputs, with some exceptions
|
||||
$inputs = Input::except('csrf_token', 'password_confirm', 'groups');
|
||||
|
||||
// @TODO: Figure out WTF I need to do this.
|
||||
if ($inputs['manager_id']=='') {
|
||||
unset($inputs['manager_id']);
|
||||
}
|
||||
|
||||
if ($inputs['location_id']=='') {
|
||||
unset($inputs['location_id']);
|
||||
}
|
||||
|
||||
// Was the user created?
|
||||
if ($user = Sentry::getUserProvider()->create($inputs)) {
|
||||
|
||||
// Assign the selected groups to this user
|
||||
foreach (Input::get('groups', array()) as $groupId) {
|
||||
$group = Sentry::getGroupProvider()->findById($groupId);
|
||||
|
||||
$user->addGroup($group);
|
||||
}
|
||||
|
||||
@@ -139,9 +173,12 @@ class UsersController extends AdminController
|
||||
$success = Lang::get('admin/users/message.success.create');
|
||||
|
||||
// Redirect to the new user page
|
||||
return Redirect::route('update/user', $user->id)->with('success', $success);
|
||||
//return Redirect::route('update/user', $user->id)->with('success', $success);
|
||||
return Redirect::route('users')->with('success', $success);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/users/message.error.create');
|
||||
|
||||
@@ -172,7 +209,7 @@ class UsersController extends AdminController
|
||||
$user = Sentry::getUserProvider()->findById($id);
|
||||
|
||||
// Get this user groups
|
||||
$userGroups = $user->groups()->lists('name', 'group_id');
|
||||
$userGroups = $user->groups()->lists('group_id', 'name');
|
||||
|
||||
// Get this user permissions
|
||||
$userPermissions = array_merge(Input::old('permissions', array('superuser' => -1)), $user->getPermissions());
|
||||
@@ -256,15 +293,16 @@ class UsersController extends AdminController
|
||||
|
||||
try {
|
||||
// Update the user
|
||||
$user->first_name = Input::get('first_name');
|
||||
$user->last_name = Input::get('last_name');
|
||||
$user->email = Input::get('email');
|
||||
$user->activated = Input::get('activated', $user->activated);
|
||||
$user->permissions = Input::get('permissions');
|
||||
$user->jobtitle = Input::get('jobtitle');
|
||||
$user->phone = Input::get('phone');
|
||||
$user->location_id = Input::get('location_id');
|
||||
$user->manager_id = Input::get('manager_id');
|
||||
$user->first_name = Input::get('first_name');
|
||||
$user->last_name = Input::get('last_name');
|
||||
$user->email = Input::get('email');
|
||||
$user->employee_num = Input::get('employee_num');
|
||||
$user->activated = Input::get('activated', $user->activated);
|
||||
$user->permissions = Input::get('permissions');
|
||||
$user->jobtitle = Input::get('jobtitle');
|
||||
$user->phone = Input::get('phone');
|
||||
$user->location_id = Input::get('location_id');
|
||||
$user->manager_id = Input::get('manager_id');
|
||||
|
||||
if ($user->manager_id == "") {
|
||||
$user->manager_id = NULL;
|
||||
@@ -311,7 +349,7 @@ class UsersController extends AdminController
|
||||
$success = Lang::get('admin/users/message.success.update');
|
||||
|
||||
// Redirect to the user page
|
||||
return Redirect::route('update/user', $id)->with('success', $success);
|
||||
return Redirect::route('view/user', $id)->with('success', $success);
|
||||
}
|
||||
|
||||
// Prepare the error message
|
||||
@@ -462,4 +500,106 @@ class UsersController extends AdminController
|
||||
->make();
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsuspend the given user.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Redirect
|
||||
*/
|
||||
public function getUnsuspend($id = null)
|
||||
{
|
||||
try {
|
||||
// Get user information
|
||||
$user = Sentry::getUserProvider()->findById($id);
|
||||
|
||||
// Check if we are not trying to unsuspend ourselves
|
||||
if ($user->id === Sentry::getId()) {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/users/message.error.unsuspend');
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('users')->with('error', $error);
|
||||
}
|
||||
|
||||
// Do we have permission to unsuspend this user?
|
||||
if ($user->isSuperUser() and ! Sentry::getUser()->isSuperUser()) {
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('users')->with('error', 'Insufficient permissions!');
|
||||
}
|
||||
|
||||
// Unsuspend the user
|
||||
$throttle = Sentry::findThrottlerByUserId($id);
|
||||
$throttle->unsuspend();
|
||||
|
||||
// Prepare the success message
|
||||
$success = Lang::get('admin/users/message.success.unsuspend');
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('users')->with('success', $success);
|
||||
} catch (UserNotFoundException $e) {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/users/message.user_not_found', compact('id' ));
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('users')->with('error', $error);
|
||||
}
|
||||
}
|
||||
|
||||
public function getClone($id = null)
|
||||
{
|
||||
// We need to reverse the UI specific logic for our
|
||||
// permissions here before we update the user.
|
||||
$permissions = Input::get('permissions', array());
|
||||
$this->decodePermissions($permissions);
|
||||
app('request')->request->set('permissions', $permissions);
|
||||
|
||||
|
||||
try {
|
||||
// Get the user information
|
||||
$user_to_clone = Sentry::getUserProvider()->findById($id);
|
||||
$user = clone $user_to_clone;
|
||||
$user->first_name = '';
|
||||
$user->last_name = '';
|
||||
$user->email = substr($user->email, ($pos = strpos($user->email, '@')) !== false ? $pos : 0);;
|
||||
$user->id = null;
|
||||
|
||||
// Get this user groups
|
||||
$userGroups = $user_to_clone->groups()->lists('group_id', 'name');
|
||||
|
||||
// Get this user permissions
|
||||
$userPermissions = array_merge(Input::old('permissions', array('superuser' => -1)), $user_to_clone->getPermissions());
|
||||
$this->encodePermissions($userPermissions);
|
||||
|
||||
// Get a list of all the available groups
|
||||
$groups = Sentry::getGroupProvider()->findAll();
|
||||
|
||||
// Get all the available permissions
|
||||
$permissions = Config::get('permissions');
|
||||
$this->encodeAllPermissions($permissions);
|
||||
|
||||
$location_list = array('' => '') + Location::lists('name', 'id');
|
||||
$manager_list = array('' => 'Select a User') + DB::table('users')
|
||||
->select(DB::raw('concat(first_name," ",last_name) as full_name, id'))
|
||||
->whereNull('deleted_at')
|
||||
->where('id','!=',$id)
|
||||
->orderBy('last_name', 'asc')
|
||||
->orderBy('first_name', 'asc')
|
||||
->lists('full_name', 'id');
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/users/edit', compact('groups', 'userGroups', 'permissions', 'userPermissions'))
|
||||
->with('location_list',$location_list)
|
||||
->with('manager_list',$manager_list)
|
||||
->with('user',$user)
|
||||
->with('clone_user',$user_to_clone);
|
||||
|
||||
} catch (UserNotFoundException $e) {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/users/message.user_not_found', compact('id'));
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('users')->with('error', $error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
+4
-3
@@ -9,12 +9,13 @@ class SetNullvaluesForUser extends Migration
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
|
||||
DB::statement('ALTER TABLE users MODIFY phone varchar(20) null');
|
||||
DB::statement('ALTER TABLE users MODIFY jobtitle varchar(50) null');
|
||||
$prefix = DB::getTablePrefix();
|
||||
DB::statement('ALTER TABLE '.$prefix.'users MODIFY phone varchar(20) null');
|
||||
DB::statement('ALTER TABLE '.$prefix.'users MODIFY jobtitle varchar(50) null');
|
||||
|
||||
}
|
||||
|
||||
|
||||
Regular → Executable
Regular → Executable
+1
-1
@@ -11,7 +11,7 @@ class EditAddedOnAssetLogsTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
DB::statement('ALTER TABLE asset_logs MODIFY added_on timestamp null');
|
||||
DB::statement('ALTER TABLE ' . DB::getTablePrefix() . 'asset_logs MODIFY added_on timestamp null');
|
||||
|
||||
}
|
||||
|
||||
|
||||
Regular → Executable
+3
-2
@@ -11,8 +11,9 @@ class EditLocationIdAssetLogsTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
DB::statement('ALTER TABLE asset_logs MODIFY location_id int(11) null');
|
||||
DB::statement('ALTER TABLE asset_logs MODIFY added_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP');
|
||||
$prefix=DB::getTablePrefix();
|
||||
DB::statement('ALTER TABLE '.$prefix.'asset_logs MODIFY location_id int(11) null');
|
||||
DB::statement('ALTER TABLE '.$prefix.'asset_logs MODIFY added_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP');
|
||||
|
||||
}
|
||||
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
+1
-1
@@ -11,7 +11,7 @@ class AlterWarrantyColumnOnAssets extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
DB::statement('ALTER TABLE assets CHANGE warrantee_months warranty_months int (3)');
|
||||
DB::statement('ALTER TABLE ' . DB::getTablePrefix() . 'assets CHANGE warrantee_months warranty_months int (3)');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
+5
-5
@@ -11,11 +11,11 @@ class AddNullableToLicensesTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
DB::statement('ALTER TABLE licenses MODIFY order_number varchar(50) null');
|
||||
DB::statement('ALTER TABLE licenses MODIFY notes varchar(255) null');
|
||||
DB::statement('ALTER TABLE licenses MODIFY license_name varchar(100) null');
|
||||
DB::statement('ALTER TABLE licenses MODIFY license_email varchar(120) null');
|
||||
$prefix = DB::getTablePrefix();
|
||||
DB::statement('ALTER TABLE ' . $prefix . 'licenses MODIFY order_number varchar(50) null');
|
||||
DB::statement('ALTER TABLE ' . $prefix . 'licenses MODIFY notes varchar(255) null');
|
||||
DB::statement('ALTER TABLE ' . $prefix . 'licenses MODIFY license_name varchar(100) null');
|
||||
DB::statement('ALTER TABLE ' . $prefix . 'licenses MODIFY license_email varchar(120) null');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
+1
-1
@@ -13,7 +13,7 @@ class AlterDefaultLicenseDepreciationId extends Migration
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
DB::statement('ALTER TABLE licenses MODIFY column depreciation_id tinyint(1) NOT NULL DEFAULT "0"');
|
||||
DB::statement('ALTER TABLE '.DB::getTablePrefix().'licenses MODIFY column depreciation_id tinyint(1) NOT NULL DEFAULT "0"');
|
||||
|
||||
}
|
||||
|
||||
|
||||
Regular → Executable
+1
-1
@@ -13,7 +13,7 @@ class AlterDefaultValuesLicenses extends Migration
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
DB::statement('ALTER TABLE license_seats MODIFY column notes text NULL');
|
||||
DB::statement('ALTER TABLE ' . DB::getTablePrefix() . 'license_seats MODIFY column notes text NULL');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Regular → Executable
Regular → Executable
+1
-1
@@ -13,7 +13,7 @@ class MakeAssetLogCheckedoutToNullable extends Migration
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
DB::statement('ALTER TABLE asset_logs MODIFY column checkedout_to int(11) NULL');
|
||||
DB::statement('ALTER TABLE ' . DB::getTablePrefix() . 'asset_logs MODIFY column checkedout_to int(11) NULL');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Regular → Executable
+1
-1
@@ -13,7 +13,7 @@ class MakeAssetLogPurchasedateToNullable extends Migration
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
DB::statement('ALTER TABLE licenses MODIFY column purchase_date date NULL');
|
||||
DB::statement('ALTER TABLE ' . DB::getTablePrefix() . 'licenses MODIFY column purchase_date date NULL');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user