Compare commits
979 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33a709ecbc | ||
|
|
9b42d3a4fc | ||
|
|
c598e3d9c0 | ||
|
|
c822fff714 | ||
|
|
c881535fda | ||
|
|
715fc3fa9b | ||
|
|
c484afb12b | ||
|
|
5ec91ef5fc | ||
|
|
30db9a2943 | ||
|
|
1273c4ca87 | ||
|
|
cb73d81d5b | ||
|
|
04735f1aff | ||
|
|
d33dcbbcb1 | ||
|
|
04401ca09f | ||
|
|
0ff23c422a | ||
|
|
74a7b304c2 | ||
|
|
231e465898 | ||
|
|
68c3e88343 | ||
|
|
ef6eae63d8 | ||
|
|
afe2eb736c | ||
|
|
1552c1e917 | ||
|
|
258d1cd705 | ||
|
|
d7b4e8a8de | ||
|
|
c0c563b1c7 | ||
|
|
430b8233ed | ||
|
|
47f1488acc | ||
|
|
21799cca6d | ||
|
|
e7ae4bd1c4 | ||
|
|
7da6ba5f68 | ||
|
|
8e9f7965c7 | ||
|
|
4ef2dd0c7e | ||
|
|
19ad8970d7 | ||
|
|
a20e1f6943 | ||
|
|
5010720a97 | ||
|
|
efaf067b94 | ||
|
|
6efd268004 | ||
|
|
7f26f01a8f | ||
|
|
31df29cac8 | ||
|
|
15a7e205be | ||
|
|
3e189d3502 | ||
|
|
6d16c97902 | ||
|
|
1ac401f0c0 | ||
|
|
62cb1daefd | ||
|
|
acedab5587 | ||
|
|
ad30aebcbc | ||
|
|
528c06cf7f | ||
|
|
97d97fc4df | ||
|
|
e89cb883ec | ||
|
|
88ce0abe85 | ||
|
|
4570efc68b | ||
|
|
ea28873fb0 | ||
|
|
eb5d4983de | ||
|
|
379f6bef6c | ||
|
|
e090762b5a | ||
|
|
9f3edd701b | ||
|
|
54bad2e4f6 | ||
|
|
e41621def0 | ||
|
|
95fd96f29a | ||
|
|
663d5213eb | ||
|
|
92d6ed0761 | ||
|
|
59ea144b28 | ||
|
|
f9f3b5b4f9 | ||
|
|
3de1a8f96c | ||
|
|
5d71628927 | ||
|
|
323a607130 | ||
|
|
8eaa70c39b | ||
|
|
29863004e2 | ||
|
|
c2bbc1281c | ||
|
|
a6232cbfd8 | ||
|
|
734dc49564 | ||
|
|
a5a1c4223b | ||
|
|
ca1351b704 | ||
|
|
3135869d5a | ||
|
|
c2d30ce865 | ||
|
|
69a446af97 | ||
|
|
93b11c35d0 | ||
|
|
cc3d007fa6 | ||
|
|
8cc1bd0159 | ||
|
|
8879bff160 | ||
|
|
fae70bb485 | ||
|
|
d4cafe364f | ||
|
|
346b62bf26 | ||
|
|
3ba6e45011 | ||
|
|
525a9225c8 | ||
|
|
df448f0c35 | ||
|
|
7808039d0d | ||
|
|
0ff0d18351 | ||
|
|
fc4f1fd7fc | ||
|
|
d55d9f5530 | ||
|
|
cd7461a3a8 | ||
|
|
ad39ec1dc3 | ||
|
|
b2af455523 | ||
|
|
6d4f4c6064 | ||
|
|
2b83b52735 | ||
|
|
cd99295f83 | ||
|
|
6ab95ff387 | ||
|
|
1aa25d1e6d | ||
|
|
1b5b3fba8a | ||
|
|
c71bdc0d5e | ||
|
|
7380affe9c | ||
|
|
1734c5ab99 | ||
|
|
18f96bb20a | ||
|
|
da28036297 | ||
|
|
474731d1a3 | ||
|
|
f59db3c741 | ||
|
|
ecfc0e0e2b | ||
|
|
8ac16e53c7 | ||
|
|
5d81c04b3d | ||
|
|
037a8bee2f | ||
|
|
e12bbbc171 | ||
|
|
31e2299385 | ||
|
|
097bb38a23 | ||
|
|
73ae41f3a9 | ||
|
|
4340d50071 | ||
|
|
de94311c47 | ||
|
|
cb51dc45b6 | ||
|
|
dee4baf7dd | ||
|
|
e04ac89c5a | ||
|
|
3fa1bc5c3f | ||
|
|
254f4b5f3e | ||
|
|
132578bfe3 | ||
|
|
c2a1e39b54 | ||
|
|
c41f4e9203 | ||
|
|
c54615a85f | ||
|
|
a7d953f923 | ||
|
|
35cf5b3d60 | ||
|
|
ae381576aa | ||
|
|
b28bcce5f1 | ||
|
|
7d7059504e | ||
|
|
e04fb70aa3 | ||
|
|
7f1489a701 | ||
|
|
720c36e433 | ||
|
|
0cceacd17d | ||
|
|
f9ad8d8aa5 | ||
|
|
253c402f3d | ||
|
|
083cb1b5ec | ||
|
|
8b3e22b58e | ||
|
|
ad9e7f1d9e | ||
|
|
5887cce2c5 | ||
|
|
f85061f988 | ||
|
|
f8e12cabd4 | ||
|
|
348e996e31 | ||
|
|
70ae59ed62 | ||
|
|
6c4d661a85 | ||
|
|
ae104293da | ||
|
|
c07907833c | ||
|
|
7360e52f61 | ||
|
|
7d87b3384c | ||
|
|
30df21c7aa | ||
|
|
6bc1524783 | ||
|
|
366fb60628 | ||
|
|
01f11f2da4 | ||
|
|
f6ae35df63 | ||
|
|
87936a58fa | ||
|
|
305db59472 | ||
|
|
c0ce1939cb | ||
|
|
879b6b8f3f | ||
|
|
8777a1a9f1 | ||
|
|
43cdace9de | ||
|
|
a04af4aead | ||
|
|
e7eec42ab8 | ||
|
|
063e5c407c | ||
|
|
3ba02b65fb | ||
|
|
88dc0700f0 | ||
|
|
899e2bc9b6 | ||
|
|
1e4071b51d | ||
|
|
f5b5f66b82 | ||
|
|
24e72d1b56 | ||
|
|
f2922b0a44 | ||
|
|
92a99993ea | ||
|
|
9be159ea15 | ||
|
|
38961298ed | ||
|
|
ea6a6d098a | ||
|
|
3ee9e93349 | ||
|
|
c9b51bface | ||
|
|
1f0f9c2441 | ||
|
|
d4fbea3571 | ||
|
|
b32d74de57 | ||
|
|
4e4144ea74 | ||
|
|
7b331b26d3 | ||
|
|
e02bea4275 | ||
|
|
24f5cdc743 | ||
|
|
08ee02d0cd | ||
|
|
ec1ab6913e | ||
|
|
f40bb7b8b3 | ||
|
|
17258b73a1 | ||
|
|
4a5007264e | ||
|
|
bd01b11f4f | ||
|
|
064c0211db | ||
|
|
4cb931a93b | ||
|
|
3df8243d80 | ||
|
|
f57c61dd4d | ||
|
|
7a4f115cb3 | ||
|
|
58ff929d71 | ||
|
|
49f25a23a9 | ||
|
|
bcf75073ec | ||
|
|
6908456d09 | ||
|
|
c26369f8cc | ||
|
|
56e090f3e7 | ||
|
|
00f7717142 | ||
|
|
823e0c8562 | ||
|
|
95be7908f8 | ||
|
|
c660c71556 | ||
|
|
fbf03b225d | ||
|
|
a5f4c51ab2 | ||
|
|
89dce89035 | ||
|
|
8cdd215614 | ||
|
|
342a8b81af | ||
|
|
cd5a352961 | ||
|
|
a451fa1fa6 | ||
|
|
e343c157c5 | ||
|
|
37fc216c5a | ||
|
|
96feb84fd4 | ||
|
|
80e10c4c98 | ||
|
|
35a133bbf9 | ||
|
|
0adbce77f9 | ||
|
|
c89be34503 | ||
|
|
9c3873e712 | ||
|
|
4f6eeda368 | ||
|
|
f690cd6305 | ||
|
|
447ed3518e | ||
|
|
d9d99b2223 | ||
|
|
2b99adba5f | ||
|
|
11aa98d389 | ||
|
|
591f97f149 | ||
|
|
ef696f8207 | ||
|
|
ab1c921443 | ||
|
|
7b165a12e0 | ||
|
|
6f2f7cc214 | ||
|
|
89729bfa51 | ||
|
|
34032c73ce | ||
|
|
f72b385790 | ||
|
|
d541ded862 | ||
|
|
8cc95a3b9b | ||
|
|
bf9a825095 | ||
|
|
5c92be5190 | ||
|
|
fa9cf35ff5 | ||
|
|
f36029a34a | ||
|
|
c2e532e32e | ||
|
|
9bcc9a7ed1 | ||
|
|
7715731c4a | ||
|
|
a2178392e6 | ||
|
|
0aa4d2a3db | ||
|
|
5867c60410 | ||
|
|
268fb98dbb | ||
|
|
5f1227d0fa | ||
|
|
1b93c5538a | ||
|
|
3645f85731 | ||
|
|
0b02b1631b | ||
|
|
31f4ba88f6 | ||
|
|
c06a4d4118 | ||
|
|
dbc93de6b3 | ||
|
|
2277b6ee69 | ||
|
|
b36d73a4bb | ||
|
|
283d2855d7 | ||
|
|
f175f52530 | ||
|
|
e29da5521d | ||
|
|
1db1819a56 | ||
|
|
aef3a734a3 | ||
|
|
d2438f9fdb | ||
|
|
53d000e2d0 | ||
|
|
addfcd4bc5 | ||
|
|
b360736b77 | ||
|
|
2bae77b3af | ||
|
|
c1600a33db | ||
|
|
5d3b84e01a | ||
|
|
7ed098de67 | ||
|
|
22af5561b2 | ||
|
|
7009b24748 | ||
|
|
389c27b2e6 | ||
|
|
a61e913824 | ||
|
|
95ae26eb2a | ||
|
|
cfebe11755 | ||
|
|
d86b5aa613 | ||
|
|
c255de7fc0 | ||
|
|
42d5d8db80 | ||
|
|
91bf9763d2 | ||
|
|
9c66dd5431 | ||
|
|
614396a15b | ||
|
|
cfe0472ea2 | ||
|
|
d20b5136b8 | ||
|
|
29f5b7c5e3 | ||
|
|
140bd137a4 | ||
|
|
3a9cb9ba7a | ||
|
|
6d0828bfe5 | ||
|
|
51a7752771 | ||
|
|
a8681225f5 | ||
|
|
26a59afa44 | ||
|
|
e22ce0d377 | ||
|
|
2fbef7f561 | ||
|
|
2678611c79 | ||
|
|
416cd236d2 | ||
|
|
4936a5914f | ||
|
|
36fce27297 | ||
|
|
4b2e45c5f2 | ||
|
|
11f46474ab | ||
|
|
b0d52a4158 | ||
|
|
7b4845c255 | ||
|
|
223ba349ea | ||
|
|
feeef4b66c | ||
|
|
42f8a35078 | ||
|
|
0128505213 | ||
|
|
06bee68cd2 | ||
|
|
c255edaf61 | ||
|
|
7f0e21d50c | ||
|
|
1aeb4de0fa | ||
|
|
bff33cb7f5 | ||
|
|
5695815360 | ||
|
|
e67ba8a743 | ||
|
|
3669ab2ae8 | ||
|
|
e2ee954592 | ||
|
|
b4750f016d | ||
|
|
7069d9c6b1 | ||
|
|
8e0d774023 | ||
|
|
394836821c | ||
|
|
a1ac7f8676 | ||
|
|
cd338d2a70 | ||
|
|
4dc81ce65f | ||
|
|
f5efc368a5 | ||
|
|
1db806f8b2 | ||
|
|
b3af102d22 | ||
|
|
2b86f14e30 | ||
|
|
3f0e494276 | ||
|
|
a4bac03692 | ||
|
|
950567e9d6 | ||
|
|
dede09e9c5 | ||
|
|
3787a3f4ba | ||
|
|
95141d49ba | ||
|
|
d85e524680 | ||
|
|
4a77dee79c | ||
|
|
6fba41e026 | ||
|
|
f39922f51f | ||
|
|
53085983f8 | ||
|
|
4a2ac03ace | ||
|
|
548de1a1a2 | ||
|
|
82560b1098 | ||
|
|
3c141e8f50 | ||
|
|
5e496672c6 | ||
|
|
4887c53f25 | ||
|
|
2b79a61d65 | ||
|
|
5268c579e2 | ||
|
|
21448ea8e6 | ||
|
|
778a7bb18c | ||
|
|
685881cf27 | ||
|
|
cf4b80bbd5 | ||
|
|
5c98dae57d | ||
|
|
e434616db8 | ||
|
|
8a7b7418db | ||
|
|
533be7f942 | ||
|
|
094ec50a68 | ||
|
|
98a29e460d | ||
|
|
27fabfd110 | ||
|
|
dce1d47228 | ||
|
|
9bbec53635 | ||
|
|
82232a34ee | ||
|
|
3d1795e312 | ||
|
|
d858861d0f | ||
|
|
eec36cb13a | ||
|
|
cee966e76e | ||
|
|
dcf2b428da | ||
|
|
80d8432c35 | ||
|
|
8ec5934af5 | ||
|
|
31f77dcb4b | ||
|
|
0663ccb99f | ||
|
|
19189f688f | ||
|
|
7849320db0 | ||
|
|
cc8ca54b3f | ||
|
|
ecb4d0d948 | ||
|
|
f20566f222 | ||
|
|
73dd339772 | ||
|
|
5a6139fb64 | ||
|
|
0fb2728e3f | ||
|
|
5e6c4a250a | ||
|
|
bf96aae9d9 | ||
|
|
daefc86e58 | ||
|
|
64c16a0bac | ||
|
|
89a2b87e42 | ||
|
|
1b41c974cf | ||
|
|
d6a0249c60 | ||
|
|
6a6676b1e7 | ||
|
|
1024816313 | ||
|
|
6905d82fc4 | ||
|
|
22746db8b7 | ||
|
|
b826673d0d | ||
|
|
637009054c | ||
|
|
5f5be6aa2a | ||
|
|
a863cf1615 | ||
|
|
05d8ff0252 | ||
|
|
b73ae3147a | ||
|
|
81b2ce33c2 | ||
|
|
501e1749b3 | ||
|
|
53f279f55f | ||
|
|
f5fb2525de | ||
|
|
53951c8bbc | ||
|
|
00755eadf0 | ||
|
|
13b173409f | ||
|
|
7ddc6d497a | ||
|
|
2829eeca7c | ||
|
|
e39227633f | ||
|
|
89c7159c56 | ||
|
|
6854453bc5 | ||
|
|
ce9c616843 | ||
|
|
40b0ced8da | ||
|
|
57ec8aa3c2 | ||
|
|
02feb69d5d | ||
|
|
fc2d472ed3 | ||
|
|
b622d977d9 | ||
|
|
6d2a073d04 | ||
|
|
564cf90e58 | ||
|
|
c60e40096a | ||
|
|
74ae2fceea | ||
|
|
02605bdf69 | ||
|
|
432e348e56 | ||
|
|
d91a7c7aa8 | ||
|
|
f2ae05786b | ||
|
|
3d3e2dc985 | ||
|
|
3c3617d641 | ||
|
|
b518162c50 | ||
|
|
b2d5dc9ec5 | ||
|
|
cff24309a1 | ||
|
|
b25c94e429 | ||
|
|
53a47743e8 | ||
|
|
8a10386737 | ||
|
|
7e95d36245 | ||
|
|
f90327ee9c | ||
|
|
3b5670965c | ||
|
|
8699a90093 | ||
|
|
562e5cd700 | ||
|
|
3f7486e1a9 | ||
|
|
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 | ||
|
|
21e6f2c249 | ||
|
|
ec9eab81bf | ||
|
|
b863bd2c53 | ||
|
|
09ca2be28d | ||
|
|
a170efae27 | ||
|
|
919119c5b9 | ||
|
|
7cb0db5b83 | ||
|
|
d24c4ed7eb | ||
|
|
a0f7083e9c | ||
|
|
8b914102b7 | ||
|
|
77f4848d6e | ||
|
|
afabd28142 | ||
|
|
67d23bdb45 | ||
|
|
124acc89c4 | ||
|
|
5c0e912080 | ||
|
|
47a8363f1d | ||
|
|
b09aec67f1 | ||
|
|
86400f435b | ||
|
|
82f0c6f00c | ||
|
|
9fe76a21f6 | ||
|
|
264a6e304d | ||
|
|
ad62ec7540 | ||
|
|
3b9f96419b | ||
|
|
6b8ed1a1ad | ||
|
|
164ca5f77b | ||
|
|
a142afe177 | ||
|
|
15d48c903e | ||
|
|
cbd3420327 | ||
|
|
380417953b | ||
|
|
6f42b3045e | ||
|
|
b717a3ee34 | ||
|
|
945cb3253f | ||
|
|
3e7a9e45d1 | ||
|
|
0c9d94deb1 | ||
|
|
19de7425e6 | ||
|
|
3cc038208f | ||
|
|
a48efb8855 | ||
|
|
7ddf84adf7 | ||
|
|
57628d725e | ||
|
|
45f353e575 | ||
|
|
bef5170b7c | ||
|
|
e7e75631c5 | ||
|
|
a4c931e4fd | ||
|
|
d1499deecd | ||
|
|
b365ada0ce | ||
|
|
185ffd3df1 | ||
|
|
5fdb61589f | ||
|
|
b3292c3a35 | ||
|
|
4ce1c94bc3 | ||
|
|
08d05b481f | ||
|
|
7742bb30c1 | ||
|
|
bf3062f4ef | ||
|
|
8f744e02fd | ||
|
|
ba3e56df9a | ||
|
|
8aebaaf502 | ||
|
|
c937796224 | ||
|
|
74653d3480 | ||
|
|
65d298a557 | ||
|
|
04f23ef792 | ||
|
|
507b6e5128 | ||
|
|
4271f5265d | ||
|
|
d9a8ede623 | ||
|
|
117ed3294b | ||
|
|
cd0f42c508 | ||
|
|
2fe66c1bdc | ||
|
|
dae3220f2b | ||
|
|
7448db6334 | ||
|
|
2f90069792 | ||
|
|
ffab309940 | ||
|
|
34b4615f4e | ||
|
|
75590b6852 | ||
|
|
610c405aa5 | ||
|
|
94016678f8 | ||
|
|
dc256583d4 | ||
|
|
cbc945299e | ||
|
|
607484b294 | ||
|
|
9714178ce1 | ||
|
|
46afc0cc73 | ||
|
|
dfa5d1c642 | ||
|
|
e463b28b37 | ||
|
|
9db6605085 | ||
|
|
d57955c7e7 | ||
|
|
ad9b1fc446 | ||
|
|
3518ab9f55 | ||
|
|
cd8ebbd7b6 | ||
|
|
c2ed0f6b21 | ||
|
|
f4c5da57d0 | ||
|
|
8a7f71ec56 | ||
|
|
b627c5cfbf | ||
|
|
c21c3a4a9e | ||
|
|
d29e30bcf6 | ||
|
|
1cf42932fb | ||
|
|
fee5fcf608 | ||
|
|
e512b8f7ef | ||
|
|
5e1fedda45 | ||
|
|
d0789da472 | ||
|
|
fc21fc1aab | ||
|
|
24ae1b948f | ||
|
|
f1cc547151 | ||
|
|
594212db6b | ||
|
|
ca0f5df63a | ||
|
|
57e903a926 | ||
|
|
06067fc19c | ||
|
|
67aba76d3f | ||
|
|
96e47612fa | ||
|
|
97af71d592 | ||
|
|
71c0c01430 | ||
|
|
78f4615d01 | ||
|
|
d93639d480 | ||
|
|
70fb2d98a0 | ||
|
|
34960e26cc | ||
|
|
3473ef5fa6 | ||
|
|
2fc197623a | ||
|
|
7bc681dfef | ||
|
|
af603f0380 | ||
|
|
1d10425d19 | ||
|
|
5690e9ce1f | ||
|
|
792e45bd12 | ||
|
|
5a798110ad | ||
|
|
ad8b95f07c | ||
|
|
729f94331f | ||
|
|
faa9b95a6f | ||
|
|
0e633efca2 | ||
|
|
b2015e7e08 | ||
|
|
efad5db082 | ||
|
|
9423c9e9d3 | ||
|
|
366e7d01a3 | ||
|
|
869cd3ea14 | ||
|
|
a2f068eb8f | ||
|
|
580590b4c0 | ||
|
|
5ec87e81b1 | ||
|
|
60d94eea04 | ||
|
|
78e3171fa6 | ||
|
|
d03d692868 | ||
|
|
4b4eefb4cc | ||
|
|
940cf7b227 | ||
|
|
3e47e47add | ||
|
|
8b3f409703 | ||
|
|
d497a84245 | ||
|
|
01612652b5 | ||
|
|
5cb0a1465e | ||
|
|
55b54e0a42 | ||
|
|
a3eb61b307 | ||
|
|
9e5e9ee96b | ||
|
|
92347c6707 | ||
|
|
dc5ea81d34 | ||
|
|
9c369d72e1 | ||
|
|
ea0560e1ce | ||
|
|
cd62be0de0 | ||
|
|
e186bb115d | ||
|
|
7a3f6fb714 | ||
|
|
1ed761c97f | ||
|
|
a193e3118d | ||
|
|
e9a675a9a4 | ||
|
|
439a139d7c | ||
|
|
40d6ad09ae | ||
|
|
3acd88d451 | ||
|
|
8806208e83 | ||
|
|
5ba487d74e | ||
|
|
7c12d5fed0 | ||
|
|
f6717d9f49 | ||
|
|
3ec6df492d | ||
|
|
cdddbcf695 | ||
|
|
483f9b1289 | ||
|
|
b2912195ac | ||
|
|
19b524e113 | ||
|
|
1cec46f997 | ||
|
|
4468cbd096 | ||
|
|
4c3e2a9a68 | ||
|
|
da9f28fbe7 | ||
|
|
8ac394bd3f | ||
|
|
ff22ee8292 | ||
|
|
d36409d037 | ||
|
|
7e9be9b935 | ||
|
|
dd701d253c | ||
|
|
78b3a0e1f9 | ||
|
|
1e9a81f59d | ||
|
|
432f44118f | ||
|
|
b697c77cd8 | ||
|
|
23ce0a9e67 | ||
|
|
0cd6c60fd9 | ||
|
|
82de635a75 | ||
|
|
299393aa26 | ||
|
|
7bc9a53b13 | ||
|
|
c1bf27fcba | ||
|
|
d72daf14ff | ||
|
|
c5678414ae | ||
|
|
329980c6c6 | ||
|
|
5fb649b59e | ||
|
|
900a441908 | ||
|
|
19de8a15cf | ||
|
|
ab99e6a64f | ||
|
|
5dc9c30bca | ||
|
|
9308059230 | ||
|
|
ac9dfe2edc | ||
|
|
ae26b683fb | ||
|
|
cf9cd1a7a0 | ||
|
|
194150bbf0 | ||
|
|
b97f5fc043 | ||
|
|
aaebaa8d36 | ||
|
|
ef4743ed49 | ||
|
|
6737a9a91a | ||
|
|
965d329ae5 | ||
|
|
e4fd2373fb | ||
|
|
e784854e05 | ||
|
|
c4c4db201f | ||
|
|
33df88d434 | ||
|
|
f02f4341ca | ||
|
|
211a527ae1 | ||
|
|
cc275367bf | ||
|
|
65e0e4d749 | ||
|
|
1dc7fd1bdf | ||
|
|
e49420f62d | ||
|
|
9fe8ace39b | ||
|
|
d591c1ea04 | ||
|
|
ae05f27015 | ||
|
|
b8ebcf769a | ||
|
|
9c718dce59 | ||
|
|
efb3ed4932 | ||
|
|
e09d250dd6 | ||
|
|
4d27008c5d | ||
|
|
cfd6c4301c | ||
|
|
dddba1198d | ||
|
|
a0267db832 | ||
|
|
0d46eba76e | ||
|
|
c8e47ad00e | ||
|
|
47b065208e | ||
|
|
edf71a7692 | ||
|
|
775ec10114 | ||
|
|
d19721d17a | ||
|
|
c11510fdca | ||
|
|
1f2b3f8505 | ||
|
|
fba853a6a7 | ||
|
|
1af24827bd | ||
|
|
392cc8eb44 | ||
|
|
c21a1ef16b | ||
|
|
46281dd39b | ||
|
|
db2c751480 | ||
|
|
c08d672e49 | ||
|
|
70c446cb35 | ||
|
|
2de48f2b91 | ||
|
|
391334ee13 | ||
|
|
a678ec4171 | ||
|
|
ea42a18930 | ||
|
|
36a714b154 | ||
|
|
bee260b1f0 | ||
|
|
45f46466d7 | ||
|
|
8f235881c5 | ||
|
|
8bf6a34c58 | ||
|
|
ca591ccb5d | ||
|
|
9d22ce5ac7 | ||
|
|
067ddb9aac | ||
|
|
66bddba6fe | ||
|
|
fbe3ace0dd | ||
|
|
b352817407 | ||
|
|
e2dc24d926 | ||
|
|
baab758377 | ||
|
|
d91d75abe4 | ||
|
|
12d3d10dec | ||
|
|
7693e83d7f | ||
|
|
3bc35208af | ||
|
|
78d1c0345e | ||
|
|
ca39b34b8c | ||
|
|
3d1a533bf2 | ||
|
|
71eaeb2783 | ||
|
|
f9d8cb1b93 | ||
|
|
2e82794ab4 | ||
|
|
7c3a9faf53 | ||
|
|
2fe58f8d6d | ||
|
|
295cef61df | ||
|
|
8ed5584565 |
37
.bash_history
Executable file
37
.bash_history
Executable file
@@ -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
|
||||
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@@ -0,0 +1,5 @@
|
||||
.git
|
||||
.dockerignore
|
||||
app/storage/logs/*
|
||||
app/storage/views/*
|
||||
vendor/*
|
||||
16
.gitignore
vendored
16
.gitignore
vendored
@@ -5,7 +5,19 @@ composer.phar
|
||||
/app/config/database.php
|
||||
/app/config/mail.php
|
||||
/app/database/*.sqlite
|
||||
/app/storage/logs/*
|
||||
/app/storage/meta/services.json
|
||||
/app/storage/sessions/*
|
||||
/app/config/*/mail.php
|
||||
/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/
|
||||
/bin/
|
||||
.idea
|
||||
crowdin.yaml
|
||||
public/uploads/logo.gif
|
||||
public/uploads/logo.png
|
||||
.siteflow
|
||||
|
||||
40
.travis.yml
Executable file
40
.travis.yml
Executable file
@@ -0,0 +1,40 @@
|
||||
addons:
|
||||
hosts:
|
||||
- AlisonMBP
|
||||
|
||||
# see http://about.travis-ci.org/docs/user/languages/php/ for more hints
|
||||
language: php
|
||||
|
||||
# list any PHP version you want to test against
|
||||
php:
|
||||
- 5.4
|
||||
- 5.5
|
||||
- 5.6
|
||||
|
||||
# optionally specify a list of environments, for example to test different RDBMS
|
||||
env:
|
||||
- DB=mysql
|
||||
|
||||
# execute any number of scripts before the test run, custom env's are available as variables
|
||||
before_script:
|
||||
- if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS snipeit_laravel;" -utravis; fi
|
||||
- curl -s http://getcomposer.org/installer | php
|
||||
- cp app/config/testing/app.example.php app/config/testing/app.php
|
||||
- cp app/config/testing/database.example.php app/config/testing/database.php
|
||||
- cp app/config/testing/mail.example.php app/config/testing/mail.php
|
||||
- composer self-update
|
||||
- composer install --prefer-source --no-interaction
|
||||
- php artisan key:generate --env=testing
|
||||
- php artisan migrate:install --env=testing --no-interaction -vvv
|
||||
- php artisan migrate --package cartalyst/sentry --env=testing --no-interaction -vvv
|
||||
- php artisan migrate --env=testing --no-interaction -vvv
|
||||
- php artisan db:seed --env=testing --no-interaction -vvv
|
||||
|
||||
# omitting "script:" will default to phpunit
|
||||
# use the $DB env variable to determine the phpunit.xml to use
|
||||
script: phpunit
|
||||
|
||||
# configure notifications (email, IRC, campfire etc)
|
||||
notifications:
|
||||
slack:
|
||||
secure: vv9we1RxB9RsrMbomSdq6D7vz/okobw87pEkgIZjB+hj1QpQ2by90gsPsOa+NgsJEFaEP7e4KlT6SH8kK+zhbmuKaUd3d1//XdcancE22LZXi6tkiB5yuR/Jhhb1LLDqyGJTB4D92hMnnCPiUjpxNA3r437ttNeYRdYIEEP3drA=
|
||||
236
CHANGELOG.md
Executable file
236
CHANGELOG.md
Executable file
@@ -0,0 +1,236 @@
|
||||
|
||||
|
||||
### v1.1 - Released Nov 06, 2014 02:16:26
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/fafd03f00f49cb9ffe81d50aa9ca3d1f1fa1d043">view</a> • Added DB Prefix to Migrations
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/309772e67d62989f1f60141a4a10d724a44c6baa">view</a> • Fixed operator for setting bool display
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/22f81912e416cfe1227a08b5d8b6323e32e1ef36">view</a> • Fixes #299
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/86b7b6946f1e1bd404127e228c615e4abe0b20fb">view</a> • Fixes #316 - added model name back to view
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/9e85dcb9fcb4cc932ecddd23caa6b51e83110543">view</a> • Fixes #315 - add EOL as display option in settings (run migrations)
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/ee35948980c22f9256241c02d7febd90275f6229">view</a> • fix div issues
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/0022389463e251e73402450cfbc280cb05633bd1">view</a> • Fix dropdown menu position
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/343798d241172707145ef365445062db9bb6b99a">view</a> • Merge pull request #322 from madd15/fix-js-delete-asset
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/1078dbf5c5f6a5bec1a2ef864cebfcc7883d31e6">view</a> • Fixes #324
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/6b2d3efe3e76429c9c2f5de78f04c4f7e2748a3d">view</a> • Fixes #237 - reporting-only group
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/e04cc806d9209b54a1833172ebb66ab55b5f0c06">view</a> • Fixes #327
|
||||
|
||||
|
||||
### v1.0 - Released Oct 16, 2014 09:46:47
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/a4b220d6c31c97f6504023f0b52527825a4cd897">view</a> • Fixed #191 - allow admins to assign a user during asset creation
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/dc1033025a0bc1b2d657e06c89058c3ab95f2c59">view</a> • Fixed #151 - more complete translations
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/56d619b218794b43d8c6b182c89c75f83af9dcd9">view</a> • Fixed missing language string
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/69fca5d1eda0e5f26d2085f7eebc08fafd84a3ae">view</a> • Fixed #58
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/8197e6174e9f12bcfddd94c6bf606ee36e6801bf">view</a> • Fixes #200
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/cb8369e9de96aaf1cf9108e22f4038fa6486b881">view</a> • Initial QA Patch to fix errors Add License Add Asset Show Deleted Users License Assign
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/62a3ed671bbd957075563933f49e8a5445042737">view</a> • DB migration, layout and clone fixes
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/9ccc7d756f9361757eafc1dce9684ee9f5ecc1c3">view</a> • A0.4.2: Added asset, license, user, model cloning and fixed some bugs.
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/652f1c746c4757dce9d33d7bd90a9357822c4656">view</a> • Fixes Travis CI build
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/363d084bd623f778cd72ca7d385a4fb2f67ef474">view</a> • Fixed DB name in travis CI
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/49c5607e1c8a82a3111123ad84b537644546ebb3">view</a> • Fixes #222
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/96e40d72b9ac3f74b94b0e39b6f296f0f0b2a1f4">view</a> • fix typo: artisand -> artisan
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/e978038cc044f60c2eca71b6319063009a57886f">view</a> • Merge pull request #234 from burlito/typo-fix
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/a829fcf52f933d087c3776993b42311ec9a8988e">view</a> • fix: Use the old asset tag when cloning
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/ee7d9bec7082dc2e60a4797dea84a0b7443c8090">view</a> • Fixes #279 - QR checkbox not staying checked
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/bf1e07555160ede517d41f649d6b1d0911f89dd2">view</a> • Fixes #87 - made datatables responsive
|
||||
|
||||
|
||||
### v0.3.11-alpha - Released Jul 19, 2014 05:16:53
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/ac4c905c42d920d2cf8455d644f4c65332a81d0d">view</a> • Fixed #140
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/4a13cded607415d749151cef495332c48c58cf86">view</a> • Fixed path for Travis composer
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/ddf946ad5eb6dd8480eeaa709f82af75e0c61444">view</a> • Tried to fix failing build caused by travis composer
|
||||
|
||||
|
||||
### v0.3.10-alpha - Released Jul 17, 2014 05: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.9-alpha - Released Jul 03, 2014 02: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.8-alpha - Released Jun 27, 2014 09: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
|
||||
|
||||
|
||||
### v.0.3.5-alpha - Released Jun 20, 2014 02: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 19, 2014 10: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 08: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 08: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 04: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 01: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 10: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 01: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/1b56c31a22afd39a875677714b9c07e96876b8df">view</a> • Fixed relationship between users/locations because fuck you ORM
|
||||
* <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
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/839d01a3af08d780be4152bc02b33bff1a7d7f20">view</a> • Fixed relationship method because fuck you ORM
|
||||
|
||||
|
||||
### v0.1.1-alpha - Released Nov 26, 2013 11: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
|
||||
|
||||
|
||||
### Initial alpha - Released Nov 26, 2013 09:01:13
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/14972f894bb0e761e2d0170a2c93c9aac4edfca6">view</a> • fixed typo
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/79da13dff767d57f6f4fbb12f195e25f409ee5ec">view</a> • Fixed layout for category view
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/0e4e26206bdcc164e5df586368ed45edd45b9a74">view</a> • fixed broken redirect route
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/9364c46c2df79c0de07dc5dbb724a3c44485b739">view</a> • Fixed licensed link
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/4f0a1789db01f12ebc4bd47e7e0594bf67b64daf">view</a> • Fixed license blades
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/27514f85c3ba9056c4609774a482a58605f4d8cf">view</a> • Fixed typo in variable name
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/ffe786f659e3e8c5b91c27cd33cb77b6d24d3545">view</a> • Fixed routes.
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/cf59ec8c67e142c0612fb7797448057b19af5cfa">view</a> • Fixed pagination bug
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/76ac39115347dabac8ada21d981494a3edf7a29c">view</a> • Fixed edit bug where new Category was invoked twice
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/940281dd4dd0a69b900a052c0bb84e24dde89666">view</a> • Fixed bug on validation display
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/31d323fb71fcbe94f17f0a2b38183709e8c77151">view</a> • Cosmetic fix on form
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/8f86ec9dae58cef27387b028f70c8116d649b425">view</a> • Change depreciation to be by month; formatting fixes.
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/4da2bccbf78a0b630267c6ed75f3a1bd8100e20d">view</a> • Merge pull request #27 from snipe/depreciation_fix
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/7bc7ffb72813cd176658d536bbdd6be0faa9a45c">view</a> • Fixed some error reporting/required fields around checkout/checkin
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/48e180c6910d30732559b0cc077fce679344f56e">view</a> • Fixed asset bug caused by unique validation in assets model
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/57107dceeee81e8618198da33af79fe66bde0d9e">view</a> • Fixed checkin text
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/7b59f42fb03ee5017c11cf32abc8a23c3f5d2141">view</a> • Fixed pagination bug, styled buttons
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/ffdb4b1aa8dde9942f7c3b110e9a68006779998b">view</a> • Fixed wonky layout issue
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/3401fee672d796f4aca8dafced6917c7caf87866">view</a> • Another table fix
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/ddfd69e5100b19bb05d6b76cb9fad3dbadad1921">view</a> • More table fixes
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/5c43caf0579a26c1604fc81f5cbdf8f0d43c157d">view</a> • More table fixes
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/44ba90f9f0a968999a743c35dd2bf153c2edbf1d">view</a> • Fixed icon set to white in main nav
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/719c36d482cc67f1513351672eda057519f7f735">view</a> • migration to fix a few fields in the log table
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/5b27a34f050646467a178ff780efc80036aadf1b">view</a> • Fixed fieldname in userlog
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/76da83cbe1c4334380bb996a40cc374ab4ec12e9">view</a> • Fixed links to edit/checkout
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/d6a718e99766829e700760c2266b62ad37cdb66b">view</a> • Fixed bug in views for created_at date
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/0ee08e47e9f2b144084703142ae5eb099090476d">view</a> • Fixed fatal error if admin who created the asset was deleted. (This should never happen, but...)
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/61cceb5f0b44e7f2a82ccca44be2bc42e8825156">view</a> • Fixed open tag in CSS
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/c93469c465c0ce8a291d595ac8ccbafbfc68c71a">view</a> • Fixed query for asset/license header boxes
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/d46556a83d5335913b8b7fe8558f416540290343">view</a> • Fixed phone display if no value set
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/fc8c3c086ca70a513cd3fff39275fcf035cead5a">view</a> • fixed #37
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/52020d09f034c9de78b798725c0f3700d0253beb">view</a> • Fixed bomb when asset is unassigned
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/1b1efec858e8e0cfc5cfafc63bfb537e45191cd1">view</a> • Fixed foreign key in assets
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/b7251d9992401c04a5da1771af0fcddad2754362">view</a> • Fixed potential bug in blade
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/9249786a25bc166bf5341f59a11d644cf4f6425c">view</a> • Fixed status display
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/c32d45e90142b41b567a350af6d399af67994a02">view</a> • Fixed ID
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/2203789f4c5310599a94799bb3ead9ff9c1ce802">view</a> • Fixes #41
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/03edbc008c671c868fced94a7761683309d9ab8b">view</a> • Fixes #43
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/2b088a3fb2ea7711f66e4a887882b17f401ba4bc">view</a> • Fixes #17
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/ad680a337e50638b4b9865e42e4ea7e453c4151b">view</a> • Fixed column name spelling in DB
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/718236b2d4bedeaaad80cc601e3e91a3229e81fa">view</a> • Fixed #9
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/3cc0ed87438b632679ce8b61a7ea0fae48999438">view</a> • Fixed sorting weirdness
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/57d0f3643518190f0b4a6fe33ac6d83eda647119">view</a> • Fixes #4
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/3ea0ad87c8733ce1bac0e9c10c2cdaf3254743d5">view</a> • Fixes #22
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/e87e5b9cae19bfd06b815cf01be309d665409828">view</a> • Fixes #46
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/7a5b133c5875959c5d7bebf16ea82bac7ceb3989">view</a> • Fixed bug linking to assets when they should be pointing to licenses
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/e13578d97d6b1ef1990f171beda9b35868fda47c">view</a> • Fixed error when no category is given
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/45c04b1cdebc0b19243a519d2580af921c82b47b">view</a> • Fixed display bug
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/4d1dd1c446f76e5530d6fb7f932a77a8da2d0b73">view</a> • Fixed #50 - MOAR VALIDATION!
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/12958553022d4b7b2184ebf837d4113b23f5cf27">view</a> • Fixes #51
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/d0cbb9f3a7e4a1fc05ddcabd19e201434c14370b">view</a> • Fixes #52
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/5bf38b1d02e743af22a51393f1e477100b1f76b7">view</a> • Fixes #50
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/e6fc1956fc93132d04bf5ac4c0d108c1ae9eee0b">view</a> • Fixes #55
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/ee3fb2785e719c938b6036f6ea74527c1217aba8">view</a> • Fixed XSS on modal
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/dc5ad876863a1e17babce06adfb365f38c30ca59">view</a> • Fixes #59
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/d7a8cac1dc6158983673688c2e48e9a48217b6f2">view</a> • Fixed validation
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/196710dac807d48f6c73b02c2444a5b8d301b8a6">view</a> • Fixed bug in error validation display
|
||||
@@ -1,3 +1,21 @@
|
||||
# Contribution Guidelines
|
||||
|
||||
Please submit all issues and pull requests to the [snipe/snipe-it](http://github.com/snipe/snipe-it) repository in the develop branch!
|
||||
Please submit all issues and pull requests to the [snipe/snipe-it](http://github.com/snipe/snipe-it) repository in the `develop` branch!
|
||||
|
||||
**As you're working on bug-fixes or features, please break them out into their own feature branches and open the pull request against your feature branch**. It makes it _much_ easier to decipher down the road, as you open multiple pull requests over time, and makes it much easier for me to approve pull requests quickly.
|
||||
|
||||
If you don't have a feature in mind, but would like to contribute back to the project, check out the [open issues](https://github.com/snipe/snipe-it/issues?state=open) and see if there are any you can tackle.
|
||||
|
||||
We use Waffle.io to help better communicate our roadmap with users. Our [project page there](http://waffle.io/snipe/snipe-it) will show you the backlog, what's ready to be worked on, what's in progress, and what's completed.
|
||||
|
||||
[](http://waffle.io/snipe/snipe-it)
|
||||
|
||||
The labels we use in GitHub Issues and Waffle.io indicate whether we've confirmed an issue as a bug, whether we're considering the issue as a potential feature, and whether it's ready for someone to work on it. We also provide labels such as "n00b", "intermediate" and "advanced" for the experience level we think it requires for contributors who want to help.
|
||||
|
||||
-----
|
||||
|
||||
## Translations!
|
||||
|
||||
If you're not a coder but want to give back to the project and you're fluent in other languages, that's okay too. We use [CrowdIn](https://crowdin.com) to manage translations, and it makes it super-simple for you to add translations (or validate proposed translations) to the project without messing with code. __Check out [the Snipe-IT CrowdIn translation project here](https://crowdin.com/project/snipe-it/)__.
|
||||
|
||||
Thanks!
|
||||
|
||||
88
Dockerfile
Normal file
88
Dockerfile
Normal file
@@ -0,0 +1,88 @@
|
||||
FROM ubuntu
|
||||
MAINTAINER Brady Wetherington <uberbrady@gmail.com>
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
apache2-bin \
|
||||
libapache2-mod-php5 \
|
||||
php5-mysql \
|
||||
php5-mcrypt \
|
||||
php5-gd \
|
||||
patch \
|
||||
curl \
|
||||
vim \
|
||||
git
|
||||
|
||||
RUN php5enmod mcrypt
|
||||
RUN php5enmod gd
|
||||
|
||||
RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php5/apache2/php.ini
|
||||
RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php5/cli/php.ini
|
||||
|
||||
RUN useradd --uid 1000 --gid 50 docker
|
||||
|
||||
RUN echo export APACHE_RUN_USER=docker >> /etc/apache2/envvars
|
||||
RUN echo export APACHE_RUN_GROUP=staff >> /etc/apache2/envvars
|
||||
|
||||
COPY docker/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
COPY . /var/www/html
|
||||
|
||||
RUN a2enmod rewrite
|
||||
|
||||
############ INITIAL APPLICATION SETUP #####################
|
||||
|
||||
COPY docker/app_start.patch /tmp/app_start.patch
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
#Patch bootstrap file
|
||||
RUN patch -p1 < /tmp/app_start.patch
|
||||
|
||||
#DB create?
|
||||
# mysqladmin -u root create snipeit_laravel
|
||||
|
||||
#DB create user, grant access to new DB?
|
||||
# grant all privileges on snipeit_laravel.* TO snipeit;
|
||||
|
||||
#DB config file init? (NEVER overwrite!)
|
||||
#RUN cp -n /var/www/html/app/config/production/database.example.php /var/www/html/app/config/production/database.php
|
||||
COPY docker/database.php /var/www/html/app/config/production/database.php
|
||||
|
||||
COPY docker/mail.php /var/www/html/app/config/production/mail.php
|
||||
|
||||
#change DB file user
|
||||
#RUN sed -i s/travis/snipe_it/ /var/www/html/app/config/production/database.php
|
||||
|
||||
#init app config file (DO NOT overwrite!)
|
||||
RUN cp -n /var/www/html/app/config/production/app.example.php /var/www/html/app/config/production/app.php
|
||||
|
||||
# Change default hostname to blank...I guess?
|
||||
RUN sed -i s%http://staging.yourserver.com%% /var/www/html/app/config/production/app.php
|
||||
|
||||
# turn off the toolbar
|
||||
RUN sed -i 's%\x27debug\x27 => true%\x27debug\x27 => false%' /var/www/html/app/config/production/app.php
|
||||
|
||||
RUN chown -R docker /var/www/html
|
||||
|
||||
############## DEPENDENCIES via COMPOSER ###################
|
||||
|
||||
#global install of composer
|
||||
RUN cd /tmp;curl -sS https://getcomposer.org/installer | php;mv /tmp/composer.phar /usr/local/bin/composer
|
||||
|
||||
# Get dependencies
|
||||
RUN cd /var/www/html;composer install
|
||||
|
||||
############### APPLICATION INSTALL/INIT #################
|
||||
|
||||
#RUN php artisan app:install
|
||||
# too interactive! Try something else
|
||||
|
||||
#COPY docker/app_install.exp /tmp/app_install.exp
|
||||
#RUN chmod +x /tmp/app_install.exp
|
||||
#RUN /tmp/app_install.exp
|
||||
|
||||
##### START SERVER
|
||||
|
||||
CMD . /etc/apache2/envvars ;apache2 -DFOREGROUND
|
||||
|
||||
EXPOSE 80
|
||||
196
README.md
Normal file → Executable file
196
README.md
Normal file → Executable file
@@ -1,25 +1,63 @@
|
||||
<a href='https://pledgie.com/campaigns/22899'><img alt='Click here to lend your support to: Snipe IT - Free Open Source Asset Management System and make a donation at pledgie.com !' src='https://pledgie.com/campaigns/22899.png?skin_name=chrome' border='0' ></a>
|
||||
[](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
|
||||
|
||||
[](https://gitter.im/snipe/snipe-it?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
This is a FOSS project for asset management in IT Operations. Knowing who has which laptop, when it was purchased in order to depreciate it correctly, handling software licenses, etc.
|
||||
|
||||
It is built on [Laravel 4](http://laravel.com) and uses the [Sentry 2](https://github.com/cartalyst/sentry) package.
|
||||
It is built on [Laravel 4.2](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 isn't actually ready for anyone to use yet, as I'm still working out some of the basic functionality. Feel free to check out the [GitHub Issues for this project](https://github.com/snipe/snipe-it/issues) to check on progress, open a bug report, or see what open issues you can help with.
|
||||
__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://snipeitapp.com/documentation/.__
|
||||
|
||||
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.
|
||||
|
||||
We use Waffle.io to help better communicate our roadmap with users. Our [project page there](http://waffle.io/snipe/snipe-it) will show you the backlog, what's ready to be worked on, what's in progress, and what's completed.
|
||||
|
||||
[](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, Chinese, Finnish, Malay, Romanian and Spanish completed, and are looking for lots more!
|
||||
|
||||
-----
|
||||
## Requirements
|
||||
|
||||
- PHP 5.3.7 or later
|
||||
- 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:
|
||||
|
||||
@@ -27,149 +65,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 http://github.com/snipe/snipe-it your-folder
|
||||
|
||||
#### 1.2) Download the Repository
|
||||
|
||||
https://github.com/snipe/snipe-it/archive/master.zip
|
||||
|
||||
-----
|
||||
|
||||
### 2) Install the Dependencies via Composer
|
||||
##### 2.1) If you don't have composer installed globally
|
||||
|
||||
cd your-folder
|
||||
curl -s http://getcomposer.org/installer | php
|
||||
php composer.phar install
|
||||
|
||||
##### 2.2) For globally composer installations
|
||||
|
||||
cd your-folder
|
||||
composer install
|
||||
|
||||
-----
|
||||
|
||||
### 3) Setup Database
|
||||
|
||||
Copy the file `app/config/database.php` to `database.php`, and update `database.php` with your database name and credentials
|
||||
|
||||
cp app/config/database.example.php app/config/database.php
|
||||
vi app/config/database.example.php
|
||||
|
||||
-----
|
||||
|
||||
### 4) Setup Mail Settings
|
||||
|
||||
Now, copy the file `app/config/mail.php` to `mail.php`, and update `mail.php` with your mail settings
|
||||
|
||||
cp app/config/mail.example.php app/config/mail.php
|
||||
vi app/config/mail.example.php
|
||||
|
||||
This will be used to send emails to your users, when they register and they request a password reset.
|
||||
|
||||
-----
|
||||
|
||||
### 5) 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
|
||||
|
||||
-----
|
||||
|
||||
### 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:
|
||||
|
||||
<VirtualHost *:80>
|
||||
DocumentRoot /var/www/html/public
|
||||
ServerName www.example.org
|
||||
|
||||
# Other directives here
|
||||
</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
|
||||
|
||||
-----
|
||||
|
||||
### 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/>.
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ use Illuminate\Console\Command;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
|
||||
class AppCommand extends Command {
|
||||
|
||||
class AppCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
@@ -32,6 +32,8 @@ class AppCommand extends Command {
|
||||
'password' => null
|
||||
);
|
||||
|
||||
protected $dummyData = true;
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
@@ -67,6 +69,7 @@ class AppCommand extends Command {
|
||||
$this->askUserEmail();
|
||||
$this->askUserPassword();
|
||||
|
||||
$this->askUserDummyData();
|
||||
|
||||
$this->comment('');
|
||||
$this->comment('');
|
||||
@@ -95,7 +98,19 @@ class AppCommand extends Command {
|
||||
$this->sentryRunner();
|
||||
|
||||
// Seed the tables with dummy data
|
||||
$this->call('db:seed');
|
||||
if( $this->dummyData === true )
|
||||
{
|
||||
$this->call('db:seed', array('--force'=>true));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Seeding Settings table is mandatory
|
||||
$this->call('db:seed', array('--class' => 'SettingsSeeder', '--force'=>true));
|
||||
// Seeding Statuslabels is strongly recommended
|
||||
$this->call('db:seed', array('--class' => 'StatuslabelsSeeder', '--force'=>true));
|
||||
// Seeding Categories is good to have
|
||||
$this->call('db:seed', array('--class' => 'CategoriesSeeder', '--force'=>true));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,14 +121,12 @@ class AppCommand extends Command {
|
||||
*/
|
||||
protected function askUserFirstName()
|
||||
{
|
||||
do
|
||||
{
|
||||
do {
|
||||
// Ask the user to input the first name
|
||||
$first_name = $this->ask('Please enter your first name: ');
|
||||
|
||||
// Check if the first name is valid
|
||||
if ($first_name == '')
|
||||
{
|
||||
if ($first_name == '') {
|
||||
// Return an error message
|
||||
$this->error('Your first name is invalid. Please try again.');
|
||||
}
|
||||
@@ -132,14 +145,12 @@ class AppCommand extends Command {
|
||||
*/
|
||||
protected function askUserLastName()
|
||||
{
|
||||
do
|
||||
{
|
||||
do {
|
||||
// Ask the user to input the last name
|
||||
$last_name = $this->ask('Please enter your last name: ');
|
||||
|
||||
// Check if the last name is valid.
|
||||
if ($last_name == '')
|
||||
{
|
||||
if ($last_name == '') {
|
||||
// Return an error message
|
||||
$this->error('Your last name is invalid. Please try again.');
|
||||
}
|
||||
@@ -158,14 +169,12 @@ class AppCommand extends Command {
|
||||
*/
|
||||
protected function askUserEmail()
|
||||
{
|
||||
do
|
||||
{
|
||||
do {
|
||||
// Ask the user to input the email address
|
||||
$email = $this->ask('Please enter your user email: ');
|
||||
|
||||
// Check if email is valid
|
||||
if ($email == '')
|
||||
{
|
||||
if ($email == '') {
|
||||
// Return an error message
|
||||
$this->error('Email is invalid. Please try again.');
|
||||
}
|
||||
@@ -184,22 +193,33 @@ class AppCommand extends Command {
|
||||
*/
|
||||
protected function askUserPassword()
|
||||
{
|
||||
do
|
||||
{
|
||||
do {
|
||||
// Ask the user to input the user password
|
||||
$password = $this->ask('Please enter your user password: ');
|
||||
$password = $this->ask('Please enter your user password (at least 8 characters): ');
|
||||
|
||||
// Check if email is valid
|
||||
if ($password == '')
|
||||
{
|
||||
if ($password == '') {
|
||||
// Return an error message
|
||||
$this->error('Password is invalid. Please try again.');
|
||||
}
|
||||
|
||||
// Store the password
|
||||
$this->userData['password'] = $password;
|
||||
} while( ! $password);
|
||||
}
|
||||
while( ! $password);
|
||||
|
||||
/**
|
||||
* Asks the user to create dummy data
|
||||
*
|
||||
* @return void
|
||||
* @todo Use the Laravel Validator
|
||||
*/
|
||||
protected function askUserDummyData()
|
||||
{
|
||||
// Ask the user to input the user password
|
||||
$dummydata = $this->ask('Do you want to seed your database with dummy data? (deafult is yes): ');
|
||||
|
||||
$this->dummyData = ( strstr($dummydata, 'y' ) || empty($dummydata) ) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -216,8 +236,11 @@ class AppCommand extends Command {
|
||||
$this->sentryCreateUser();
|
||||
|
||||
// Create dummy user
|
||||
if( $this->dummyData === true )
|
||||
{
|
||||
$this->sentryCreateDummyUser();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the default groups.
|
||||
@@ -226,23 +249,60 @@ class AppCommand extends Command {
|
||||
*/
|
||||
protected function sentryCreateDefaultGroups()
|
||||
{
|
||||
try
|
||||
{
|
||||
try {
|
||||
// Create the admin group
|
||||
$group = Sentry::getGroupProvider()->create(array(
|
||||
'name' => 'Admin',
|
||||
'permissions' => array(
|
||||
'admin' => 1,
|
||||
'users' => 1
|
||||
'users' => 1,
|
||||
'reports' => 1
|
||||
)
|
||||
));
|
||||
|
||||
// Show the success message.
|
||||
$this->comment('');
|
||||
$this->info('Admin group created successfully.');
|
||||
} catch (Cartalyst\Sentry\Groups\GroupExistsException $e) {
|
||||
$this->error('Group already exists.');
|
||||
}
|
||||
catch (Cartalyst\Sentry\Groups\GroupExistsException $e)
|
||||
{
|
||||
|
||||
|
||||
|
||||
try {
|
||||
// Create the reporting group
|
||||
$group = Sentry::getGroupProvider()->create(array(
|
||||
'name' => 'Reporting',
|
||||
'permissions' => array(
|
||||
'admin' => 0,
|
||||
'users' => 1,
|
||||
'reports' => 1,
|
||||
)
|
||||
));
|
||||
|
||||
// Show the success message.
|
||||
$this->comment('');
|
||||
$this->info('Reporting group created successfully.');
|
||||
} catch (Cartalyst\Sentry\Groups\GroupExistsException $e) {
|
||||
$this->error('Group already exists.');
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
// Create the general users group
|
||||
$group = Sentry::getGroupProvider()->create(array(
|
||||
'name' => 'Users',
|
||||
'permissions' => array(
|
||||
'admin' => 0,
|
||||
'users' => 1,
|
||||
'reports' => 0,
|
||||
)
|
||||
));
|
||||
|
||||
// Show the success message.
|
||||
$this->comment('');
|
||||
$this->info('Users group created successfully.');
|
||||
} catch (Cartalyst\Sentry\Groups\GroupExistsException $e) {
|
||||
$this->error('Group already exists.');
|
||||
}
|
||||
}
|
||||
@@ -257,6 +317,7 @@ class AppCommand extends Command {
|
||||
// Prepare the user data array.
|
||||
$data = array_merge($this->userData, array(
|
||||
'activated' => 1,
|
||||
'manager_id' => NULL,
|
||||
'permissions' => array(
|
||||
'admin' => 1,
|
||||
'user' => 1,
|
||||
@@ -290,6 +351,7 @@ class AppCommand extends Command {
|
||||
'email' => 'john.doe@example.com',
|
||||
'password' => 'johndoe',
|
||||
'activated' => 1,
|
||||
'manager_id' => 1,
|
||||
);
|
||||
|
||||
// Create the user
|
||||
|
||||
94
app/commands/SendExpirationAlerts.php
Normal file
94
app/commands/SendExpirationAlerts.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
|
||||
class SendExpirationAlerts extends Command {
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'alerts:expiring';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'This command checks for expiring warrantees and service agreements, and sends out an alert email.';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function fire()
|
||||
{
|
||||
$expiring_assets = Asset::getExpiringWarrantee(60);
|
||||
|
||||
$data['count'] = count($expiring_assets);
|
||||
$data['email_content'] ='';
|
||||
|
||||
|
||||
|
||||
foreach ($expiring_assets as $asset) {
|
||||
$now = date("Y-m-d");
|
||||
$expires = $asset->warrantee_expires();
|
||||
$difference = round(abs(strtotime($expires) - strtotime($now))/86400);
|
||||
|
||||
if ($difference > 30) {
|
||||
$data['email_content'] .= '<tr style="background-color: #fcffa3;">';
|
||||
} else {
|
||||
$data['email_content'] .= '<tr style="background-color:#d9534f;">';
|
||||
}
|
||||
$data['email_content'] .= '<td><a href="'.Config::get('app.url').'/hardware/'.$asset->id.'/view">';
|
||||
$data['email_content'] .= $asset->name.'</a></td><td>'.$asset->asset_tag.'</td>';
|
||||
$data['email_content'] .= '<td>'.$asset->warrantee_expires().'</td>';
|
||||
$data['email_content'] .= '<td>'.$difference.' days</td>';
|
||||
$data['email_content'] .= '</tr>';
|
||||
}
|
||||
|
||||
if ((Setting::getSettings()->alert_email!='') && (Setting::getSettings()->alerts_enabled==1)){
|
||||
|
||||
if (count($expiring_assets) > 0) {
|
||||
|
||||
Mail::send('emails.expiring-report', $data, function ($m) {
|
||||
$m->to(Setting::getSettings()->alert_email, Setting::getSettings()->site_name);
|
||||
$m->subject('Expiring Assets Report');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (Setting::getSettings()->alert_email=='') {
|
||||
echo "Could not send email. No alert email configured in settings. \n";
|
||||
} elseif (Setting::getSettings()->alerts_enabled!=1) {
|
||||
echo "Alerts are disabled in the settings. No mail will be sent. \n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -2,32 +2,6 @@
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Debug Mode
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When your application is in debug mode, detailed error messages with
|
||||
| stack traces will be shown on every error that occurs within your
|
||||
| application. If disabled, a simple generic error page is shown.
|
||||
|
|
||||
*/
|
||||
|
||||
'debug' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application URL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This URL is used by the console to properly generate URLs when using
|
||||
| the Artisan command line tool. You should set this to the root of
|
||||
| your application so that it is used when running Artisan tasks.
|
||||
|
|
||||
*/
|
||||
|
||||
'url' => 'http://localhost',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Timezone
|
||||
@@ -43,12 +17,11 @@ return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Locale Configuration
|
||||
| Application Locale
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The application locale determines the default locale that will be used
|
||||
| by the translation service provider. You are free to set this value
|
||||
| to any of the locales which will be supported by the application.
|
||||
| This locale ties into the languaage files in app/lang, which contain the
|
||||
| language files for each translation.
|
||||
|
|
||||
*/
|
||||
|
||||
@@ -56,16 +29,34 @@ return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Encryption Key
|
||||
| Autoloaded Service Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This key is used by the Illuminate encrypter service and should be set
|
||||
| to a random, 32 character string, otherwise these encrypted strings
|
||||
| will not be safe. Please do this before deploying an application!
|
||||
| This setting may be used to control the default cipher used by the Laravel
|
||||
| encryption facilities.
|
||||
|
|
||||
| Note: In Laravel 4.2, the default cipher is MCRYPT_RIJNDAEL_128 (AES),
|
||||
| which is considered to be the most secure cipher. Changing the cipher
|
||||
| back to MCRYPT_RIJNDAEL_256 is required to decrypt cookies/values that
|
||||
| were encrypted in Laravel <= 4.1
|
||||
|
|
||||
*/
|
||||
|
||||
'key' => 'YourSecretKey!!!',
|
||||
'cipher' => MCRYPT_RIJNDAEL_256,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Prevent Password changes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If for some reason you do not wish for admins to be able to edit the password
|
||||
| for any user (including themselves), set this to true.
|
||||
|
|
||||
*/
|
||||
|
||||
'lock_passwords' => false,
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -78,14 +69,14 @@ return array(
|
||||
|
|
||||
*/
|
||||
|
||||
|
||||
'providers' => array(
|
||||
|
||||
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
|
||||
'Illuminate\Auth\AuthServiceProvider',
|
||||
'Illuminate\Cache\CacheServiceProvider',
|
||||
'Illuminate\Foundation\Providers\CommandCreatorServiceProvider',
|
||||
'Illuminate\Session\CommandsServiceProvider',
|
||||
'Illuminate\Foundation\Providers\ComposerServiceProvider',
|
||||
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
|
||||
'Illuminate\Routing\ControllerServiceProvider',
|
||||
'Illuminate\Cookie\CookieServiceProvider',
|
||||
'Illuminate\Database\DatabaseServiceProvider',
|
||||
@@ -93,28 +84,24 @@ return array(
|
||||
'Illuminate\Filesystem\FilesystemServiceProvider',
|
||||
'Illuminate\Hashing\HashServiceProvider',
|
||||
'Illuminate\Html\HtmlServiceProvider',
|
||||
'Illuminate\Foundation\Providers\KeyGeneratorServiceProvider',
|
||||
'Illuminate\Log\LogServiceProvider',
|
||||
'Illuminate\Mail\MailServiceProvider',
|
||||
'Illuminate\Foundation\Providers\MaintenanceServiceProvider',
|
||||
'Illuminate\Database\MigrationServiceProvider',
|
||||
'Illuminate\Foundation\Providers\OptimizeServiceProvider',
|
||||
'Illuminate\Pagination\PaginationServiceProvider',
|
||||
'Illuminate\Foundation\Providers\PublisherServiceProvider',
|
||||
'Illuminate\Queue\QueueServiceProvider',
|
||||
'Illuminate\Redis\RedisServiceProvider',
|
||||
'Illuminate\Remote\RemoteServiceProvider',
|
||||
'Illuminate\Auth\Reminders\ReminderServiceProvider',
|
||||
'Illuminate\Foundation\Providers\RouteListServiceProvider',
|
||||
'Illuminate\Database\SeedServiceProvider',
|
||||
'Illuminate\Foundation\Providers\ServerServiceProvider',
|
||||
'Illuminate\Session\SessionServiceProvider',
|
||||
'Illuminate\Foundation\Providers\TinkerServiceProvider',
|
||||
'Illuminate\Translation\TranslationServiceProvider',
|
||||
'Illuminate\Validation\ValidationServiceProvider',
|
||||
'Illuminate\View\ViewServiceProvider',
|
||||
'Illuminate\Workbench\WorkbenchServiceProvider',
|
||||
|
||||
'Barryvdh\Debugbar\ServiceProvider',
|
||||
'Cartalyst\Sentry\SentryServiceProvider',
|
||||
'Chumper\Datatable\DatatableServiceProvider',
|
||||
'Dinesh\Barcode\BarcodeServiceProvider',
|
||||
|
||||
),
|
||||
|
||||
@@ -151,16 +138,18 @@ return array(
|
||||
'Cache' => 'Illuminate\Support\Facades\Cache',
|
||||
'ClassLoader' => 'Illuminate\Support\ClassLoader',
|
||||
'Config' => 'Illuminate\Support\Facades\Config',
|
||||
'Controller' => 'Illuminate\Routing\Controllers\Controller',
|
||||
'Controller' => 'Illuminate\Routing\Controller',
|
||||
'Cookie' => 'Illuminate\Support\Facades\Cookie',
|
||||
'Crypt' => 'Illuminate\Support\Facades\Crypt',
|
||||
'DB' => 'Illuminate\Support\Facades\DB',
|
||||
'Datatable' => 'Chumper\Datatable\Facades\DatatableFacade',
|
||||
'Eloquent' => 'Illuminate\Database\Eloquent\Model',
|
||||
'Event' => 'Illuminate\Support\Facades\Event',
|
||||
'File' => 'Illuminate\Support\Facades\File',
|
||||
'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',
|
||||
@@ -175,13 +164,17 @@ return array(
|
||||
'Route' => 'Illuminate\Support\Facades\Route',
|
||||
'Schema' => 'Illuminate\Support\Facades\Schema',
|
||||
'Seeder' => 'Illuminate\Database\Seeder',
|
||||
'Sentry' => 'Cartalyst\Sentry\Facades\Laravel\Sentry',
|
||||
'Session' => 'Illuminate\Support\Facades\Session',
|
||||
'SoftDeletingTrait' => 'Illuminate\Database\Eloquent\SoftDeletingTrait',
|
||||
'SSH' => 'Illuminate\Support\Facades\SSH',
|
||||
'Str' => 'Illuminate\Support\Str',
|
||||
'URL' => 'Illuminate\Support\Facades\URL',
|
||||
'Validator' => 'Illuminate\Support\Facades\Validator',
|
||||
'View' => 'Illuminate\Support\Facades\View',
|
||||
|
||||
'Sentry' => 'Cartalyst\Sentry\Facades\Laravel\Sentry',
|
||||
'Reader' => 'League\Csv\Reader',
|
||||
'DNS1D' => 'Dinesh\Barcode\Facades\DNS1DFacade',
|
||||
'DNS2D' => 'Dinesh\Barcode\Facades\DNS2DFacade',
|
||||
|
||||
),
|
||||
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| PDO Fetch Style
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default, database results will be returned as instances of the PHP
|
||||
| stdClass object; however, you may desire to retrieve records in an
|
||||
| array format for simplicity. Here you can tweak the fetch style.
|
||||
|
|
||||
*/
|
||||
|
||||
'fetch' => PDO::FETCH_CLASS,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Database Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the database connections below you wish
|
||||
| to use as your default connection for all database work. Of course
|
||||
| you may use many connections at once using the Database library.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => 'mysql',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here are each of the database connections setup for your application.
|
||||
| Of course, examples of configuring each database platform that is
|
||||
| supported by Laravel is shown below to make development simple.
|
||||
|
|
||||
|
|
||||
| All database work in Laravel is done through the PHP PDO facilities
|
||||
| so make sure you have the driver for your particular database of
|
||||
| choice installed on your machine before you begin development.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => array(
|
||||
|
||||
'sqlite' => array(
|
||||
'driver' => 'sqlite',
|
||||
'database' => __DIR__.'/../database/production.sqlite',
|
||||
'prefix' => '',
|
||||
),
|
||||
|
||||
'mysql' => array(
|
||||
'driver' => 'mysql',
|
||||
'host' => 'localhost',
|
||||
'database' => 'snipeit_laravel',
|
||||
'username' => 'snipeit_laravel',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
'collation' => 'utf8_unicode_ci',
|
||||
'prefix' => '',
|
||||
),
|
||||
|
||||
'pgsql' => array(
|
||||
'driver' => 'pgsql',
|
||||
'host' => 'localhost',
|
||||
'database' => 'database',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'schema' => 'public',
|
||||
),
|
||||
|
||||
'sqlsrv' => array(
|
||||
'driver' => 'sqlsrv',
|
||||
'host' => 'localhost',
|
||||
'database' => 'database',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'prefix' => '',
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Migration Repository Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This table keeps track of all the migrations that have already run for
|
||||
| your application. Using this information, we can determine which of
|
||||
| the migrations on disk have not actually be run in the databases.
|
||||
|
|
||||
*/
|
||||
|
||||
'migrations' => 'migrations',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Redis Databases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Redis is an open source, fast, and advanced key-value store that also
|
||||
| provides a richer set of commands than a typical key-value systems
|
||||
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
||||
|
|
||||
*/
|
||||
|
||||
'redis' => array(
|
||||
|
||||
'cluster' => true,
|
||||
|
||||
'default' => array(
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 6379,
|
||||
'database' => 0,
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
);
|
||||
3
app/config/local/.gitignore
vendored
Executable file
3
app/config/local/.gitignore
vendored
Executable file
@@ -0,0 +1,3 @@
|
||||
app.php
|
||||
mail.php
|
||||
database.php
|
||||
45
app/config/local/app.example.php
Executable file
45
app/config/local/app.example.php
Executable file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Debug Mode
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When your application is in debug mode, detailed error messages with
|
||||
| stack traces will be shown on every error that occurs within your
|
||||
| application. If disabled, a simple generic error page is shown.
|
||||
|
|
||||
*/
|
||||
|
||||
'debug' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application URL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This URL is used by the console to properly generate URLs when using
|
||||
| the Artisan command line tool. You should set this to the root of
|
||||
| your application so that it is used when running Artisan tasks.
|
||||
|
|
||||
*/
|
||||
|
||||
'url' => 'http://snipe-it-laravel.local:8888',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Encryption Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This key is used by the Illuminate encrypter service and should be set
|
||||
| to a random, 32 character string, otherwise these encrypted strings
|
||||
| will not be safe. Please do this before deploying an application!
|
||||
|
|
||||
| Run a php artisan key:generate to create a random one
|
||||
*/
|
||||
|
||||
'key' => 'Change_this_key_or_snipe_will_get_ya',
|
||||
|
||||
);
|
||||
125
app/config/local/database.example.php
Executable file
125
app/config/local/database.example.php
Executable file
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| PDO Fetch Style
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default, database results will be returned as instances of the PHP
|
||||
| stdClass object; however, you may desire to retrieve records in an
|
||||
| array format for simplicity. Here you can tweak the fetch style.
|
||||
|
|
||||
*/
|
||||
|
||||
'fetch' => PDO::FETCH_CLASS,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Database Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the database connections below you wish
|
||||
| to use as your default connection for all database work. Of course
|
||||
| you may use many connections at once using the Database library.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => 'mysql',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here are each of the database connections setup for your application.
|
||||
| Of course, examples of configuring each database platform that is
|
||||
| supported by Laravel is shown below to make development simple.
|
||||
|
|
||||
|
|
||||
| All database work in Laravel is done through the PHP PDO facilities
|
||||
| so make sure you have the driver for your particular database of
|
||||
| choice installed on your machine before you begin development.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => array(
|
||||
|
||||
'sqlite' => array(
|
||||
'driver' => 'sqlite',
|
||||
'database' => __DIR__.'/../database/production.sqlite',
|
||||
'prefix' => '',
|
||||
),
|
||||
|
||||
'mysql' => array(
|
||||
'driver' => 'mysql',
|
||||
'host' => 'localhost',
|
||||
'database' => 'snipeit_laravel',
|
||||
'username' => 'snipeit_laravel',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
'collation' => 'utf8_unicode_ci',
|
||||
'prefix' => '',
|
||||
'strict' => false,
|
||||
),
|
||||
|
||||
'pgsql' => array(
|
||||
'driver' => 'pgsql',
|
||||
'host' => 'localhost',
|
||||
'database' => 'database',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'schema' => 'public',
|
||||
),
|
||||
|
||||
'sqlsrv' => array(
|
||||
'driver' => 'sqlsrv',
|
||||
'host' => 'localhost',
|
||||
'database' => 'database',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'prefix' => '',
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Migration Repository Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This table keeps track of all the migrations that have already run for
|
||||
| your application. Using this information, we can determine which of
|
||||
| the migrations on disk have not actually be run in the databases.
|
||||
|
|
||||
*/
|
||||
|
||||
'migrations' => 'migrations',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Redis Databases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Redis is an open source, fast, and advanced key-value store that also
|
||||
| provides a richer set of commands than a typical key-value systems
|
||||
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
||||
|
|
||||
*/
|
||||
|
||||
'redis' => array(
|
||||
|
||||
'cluster' => true,
|
||||
|
||||
'default' => array(
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 6379,
|
||||
'database' => 0,
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
);
|
||||
124
app/config/local/mail.example.php
Executable file
124
app/config/local/mail.example.php
Executable file
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mail Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
|
||||
| sending of e-mail. You may specify which one you're using throughout
|
||||
| your application here. By default, Laravel is setup for SMTP mail.
|
||||
|
|
||||
| Supported: "smtp", "mail", "sendmail"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'smtp',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Host Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may provide the host address of the SMTP server used by your
|
||||
| applications. A default option is provided that is compatible with
|
||||
| the Postmark mail service, which will provide reliable delivery.
|
||||
|
|
||||
*/
|
||||
|
||||
'host' => 'smtp.mailgun.org',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Host Port
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the SMTP port used by your application to delivery e-mails to
|
||||
| users of your application. Like the host we have set this value to
|
||||
| stay compatible with the Postmark e-mail application by default.
|
||||
|
|
||||
*/
|
||||
|
||||
'port' => 587,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global "From" Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may wish for all e-mails sent by your application to be sent from
|
||||
| the same address. Here, you may specify a name and address that is
|
||||
| used globally for all e-mails that are sent by your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'from' => array('address' => null, 'name' => null),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| E-Mail Encryption Protocol
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the encryption protocol that should be used when
|
||||
| the application send e-mail messages. A sensible default using the
|
||||
| transport layer security protocol should provide great security.
|
||||
|
|
||||
*/
|
||||
|
||||
'encryption' => 'tls',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Server Username
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If your SMTP server requires a username for authentication, you should
|
||||
| set it here. This will get used to authenticate with your server on
|
||||
| connection. You may also set the "password" value below this one.
|
||||
|
|
||||
*/
|
||||
|
||||
'username' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Server Password
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may set the password required by your SMTP server to send out
|
||||
| messages from your application. This will be given to the server on
|
||||
| connection so that the application will be able to send messages.
|
||||
|
|
||||
*/
|
||||
|
||||
'password' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sendmail System Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "sendmail" driver to send e-mails, we will need to know
|
||||
| the path to where Sendmail lives on this server. A default path has
|
||||
| been provided here, which will work well on most of your systems.
|
||||
|
|
||||
*/
|
||||
|
||||
'sendmail' => '/usr/sbin/sendmail -bs',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mail "Pretend"
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When this option is enabled, e-mail will not actually be sent over the
|
||||
| web and will instead be written to your application's logs files so
|
||||
| you may inspect the message. This is great for local development.
|
||||
|
|
||||
*/
|
||||
|
||||
'pretend' => false,
|
||||
|
||||
);
|
||||
@@ -1,124 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mail Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
|
||||
| sending of e-mail. You may specify which one you're using throughout
|
||||
| your application here. By default, Laravel is setup for SMTP mail.
|
||||
|
|
||||
| Supported: "smtp", "mail", "sendmail"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'smtp',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Host Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may provide the host address of the SMTP server used by your
|
||||
| applications. A default option is provided that is compatible with
|
||||
| the Postmark mail service, which will provide reliable delivery.
|
||||
|
|
||||
*/
|
||||
|
||||
'host' => 'smtp.mailgun.org',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Host Port
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the SMTP port used by your application to delivery e-mails to
|
||||
| users of your application. Like the host we have set this value to
|
||||
| stay compatible with the Postmark e-mail application by default.
|
||||
|
|
||||
*/
|
||||
|
||||
'port' => 587,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global "From" Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may wish for all e-mails sent by your application to be sent from
|
||||
| the same address. Here, you may specify a name and address that is
|
||||
| used globally for all e-mails that are sent by your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'from' => array('address' => null, 'name' => null),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| E-Mail Encryption Protocol
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the encryption protocol that should be used when
|
||||
| the application send e-mail messages. A sensible default using the
|
||||
| transport layer security protocol should provide great security.
|
||||
|
|
||||
*/
|
||||
|
||||
'encryption' => 'tls',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Server Username
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If your SMTP server requires a username for authentication, you should
|
||||
| set it here. This will get used to authenticate with your server on
|
||||
| connection. You may also set the "password" value below this one.
|
||||
|
|
||||
*/
|
||||
|
||||
'username' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Server Password
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may set the password required by your SMTP server to send out
|
||||
| messages from your application. This will be given to the server on
|
||||
| connection so that the application will be able to send messages.
|
||||
|
|
||||
*/
|
||||
|
||||
'password' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sendmail System Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "sendmail" driver to send e-mails, we will need to know
|
||||
| the path to where Sendmail lives on this server. A default path has
|
||||
| been provided here, which will work well on most of your systems.
|
||||
|
|
||||
*/
|
||||
|
||||
'sendmail' => '/usr/sbin/sendmail -bs',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mail "Pretend"
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When this option is enabled, e-mail will not actually be sent over the
|
||||
| web and will instead be written to your application's logs files so
|
||||
| you may inspect the message. This is great for local development.
|
||||
|
|
||||
*/
|
||||
|
||||
'pretend' => false,
|
||||
|
||||
);
|
||||
146
app/config/packages/barryvdh/laravel-debugbar/config.php
Executable file
146
app/config/packages/barryvdh/laravel-debugbar/config.php
Executable file
@@ -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,
|
||||
|
||||
);
|
||||
@@ -42,12 +42,38 @@ return array(
|
||||
|
|
||||
| This option allows you to specify the default hasher used by Sentry
|
||||
|
|
||||
| Supported: "native", "bcrypt", "sha256"
|
||||
| Supported: "native", "bcrypt", "sha256", "whirlpool"
|
||||
|
|
||||
*/
|
||||
|
||||
'hasher' => 'native',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cookie
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configuration specific to the cookie component of Sentry.
|
||||
|
|
||||
*/
|
||||
|
||||
'cookie' => array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Cookie Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option allows you to specify the default cookie key used by Sentry.
|
||||
|
|
||||
| Supported: string
|
||||
|
|
||||
*/
|
||||
|
||||
'key' => 'cartalyst_sentry',
|
||||
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Groups
|
||||
@@ -56,6 +82,7 @@ return array(
|
||||
| Configuration specific to the group management component of Sentry.
|
||||
|
|
||||
*/
|
||||
|
||||
'groups' => array(
|
||||
|
||||
/*
|
||||
@@ -80,6 +107,7 @@ return array(
|
||||
| Configuration specific to the user management component of Sentry.
|
||||
|
|
||||
*/
|
||||
|
||||
'users' => array(
|
||||
|
||||
/*
|
||||
@@ -92,6 +120,7 @@ return array(
|
||||
|
|
||||
*/
|
||||
|
||||
//'model' => 'Cartalyst\Sentry\Users\Eloquent\User',
|
||||
'model' => 'User',
|
||||
|
||||
/*
|
||||
@@ -99,9 +128,9 @@ return 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.
|
||||
| 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.
|
||||
|
|
||||
*/
|
||||
|
||||
@@ -109,6 +138,20 @@ return array(
|
||||
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| User Groups Pivot Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "eloquent" driver, you can specify the table name
|
||||
| for the user groups pivot table.
|
||||
|
|
||||
| Default: users_groups
|
||||
|
|
||||
*/
|
||||
|
||||
'user_groups_pivot_table' => 'users_groups',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Throttling
|
||||
@@ -118,6 +161,7 @@ return array(
|
||||
| enables limiting of login attempts and the suspension & banning of users.
|
||||
|
|
||||
*/
|
||||
|
||||
'throttling' => array(
|
||||
|
||||
/*
|
||||
|
||||
@@ -16,4 +16,12 @@ return array(
|
||||
),
|
||||
),
|
||||
|
||||
'Reporting' => array(
|
||||
array(
|
||||
'permission' => 'reports',
|
||||
'label' => 'View Reports',
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
);
|
||||
|
||||
3
app/config/production/.gitignore
vendored
Executable file
3
app/config/production/.gitignore
vendored
Executable file
@@ -0,0 +1,3 @@
|
||||
app.php
|
||||
mail.php
|
||||
database.php
|
||||
45
app/config/production/app.example.php
Executable file
45
app/config/production/app.example.php
Executable file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Debug Mode
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When your application is in debug mode, detailed error messages with
|
||||
| stack traces will be shown on every error that occurs within your
|
||||
| application. If disabled, a simple generic error page is shown.
|
||||
|
|
||||
*/
|
||||
|
||||
'debug' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application URL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This URL is used by the console to properly generate URLs when using
|
||||
| the Artisan command line tool. You should set this to the root of
|
||||
| your application so that it is used when running Artisan tasks.
|
||||
|
|
||||
*/
|
||||
|
||||
'url' => 'http://staging.yourserver.com',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Encryption Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This key is used by the Illuminate encrypter service and should be set
|
||||
| to a random, 32 character string, otherwise these encrypted strings
|
||||
| will not be safe. Please do this before deploying an application!
|
||||
|
|
||||
| Run a php artisan key:generate --env=staging to create a random one
|
||||
*/
|
||||
|
||||
'key' => 'Change_this_key_or_snipe_will_get_ya',
|
||||
|
||||
);
|
||||
124
app/config/production/database.example.php
Executable file
124
app/config/production/database.example.php
Executable file
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| PDO Fetch Style
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default, database results will be returned as instances of the PHP
|
||||
| stdClass object; however, you may desire to retrieve records in an
|
||||
| array format for simplicity. Here you can tweak the fetch style.
|
||||
|
|
||||
*/
|
||||
|
||||
'fetch' => PDO::FETCH_CLASS,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Database Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the database connections below you wish
|
||||
| to use as your default connection for all database work. Of course
|
||||
| you may use many connections at once using the Database library.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => 'mysql',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here are each of the database connections setup for your application.
|
||||
| Of course, examples of configuring each database platform that is
|
||||
| supported by Laravel is shown below to make development simple.
|
||||
|
|
||||
|
|
||||
| All database work in Laravel is done through the PHP PDO facilities
|
||||
| so make sure you have the driver for your particular database of
|
||||
| choice installed on your machine before you begin development.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => array(
|
||||
|
||||
'sqlite' => array(
|
||||
'driver' => 'sqlite',
|
||||
'database' => __DIR__.'/../database/production.sqlite',
|
||||
'prefix' => '',
|
||||
),
|
||||
|
||||
'mysql' => array(
|
||||
'driver' => 'mysql',
|
||||
'host' => 'localhost',
|
||||
'database' => 'snipeit_laravel',
|
||||
'username' => 'travis',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
'collation' => 'utf8_unicode_ci',
|
||||
'prefix' => '',
|
||||
),
|
||||
|
||||
'pgsql' => array(
|
||||
'driver' => 'pgsql',
|
||||
'host' => 'localhost',
|
||||
'database' => 'database',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'schema' => 'public',
|
||||
),
|
||||
|
||||
'sqlsrv' => array(
|
||||
'driver' => 'sqlsrv',
|
||||
'host' => 'localhost',
|
||||
'database' => 'database',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'prefix' => '',
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Migration Repository Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This table keeps track of all the migrations that have already run for
|
||||
| your application. Using this information, we can determine which of
|
||||
| the migrations on disk have not actually be run in the databases.
|
||||
|
|
||||
*/
|
||||
|
||||
'migrations' => 'migrations',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Redis Databases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Redis is an open source, fast, and advanced key-value store that also
|
||||
| provides a richer set of commands than a typical key-value systems
|
||||
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
||||
|
|
||||
*/
|
||||
|
||||
'redis' => array(
|
||||
|
||||
'cluster' => true,
|
||||
|
||||
'default' => array(
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 6379,
|
||||
'database' => 0,
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
);
|
||||
124
app/config/production/mail.example.php
Executable file
124
app/config/production/mail.example.php
Executable file
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mail Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
|
||||
| sending of e-mail. You may specify which one you're using throughout
|
||||
| your application here. By default, Laravel is setup for SMTP mail.
|
||||
|
|
||||
| Supported: "smtp", "mail", "sendmail"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'smtp',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Host Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may provide the host address of the SMTP server used by your
|
||||
| applications. A default option is provided that is compatible with
|
||||
| the Postmark mail service, which will provide reliable delivery.
|
||||
|
|
||||
*/
|
||||
|
||||
'host' => 'smtp.mailgun.org',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Host Port
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the SMTP port used by your application to delivery e-mails to
|
||||
| users of your application. Like the host we have set this value to
|
||||
| stay compatible with the Postmark e-mail application by default.
|
||||
|
|
||||
*/
|
||||
|
||||
'port' => 587,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global "From" Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may wish for all e-mails sent by your application to be sent from
|
||||
| the same address. Here, you may specify a name and address that is
|
||||
| used globally for all e-mails that are sent by your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'from' => array('address' => null, 'name' => null),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| E-Mail Encryption Protocol
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the encryption protocol that should be used when
|
||||
| the application send e-mail messages. A sensible default using the
|
||||
| transport layer security protocol should provide great security.
|
||||
|
|
||||
*/
|
||||
|
||||
'encryption' => 'tls',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Server Username
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If your SMTP server requires a username for authentication, you should
|
||||
| set it here. This will get used to authenticate with your server on
|
||||
| connection. You may also set the "password" value below this one.
|
||||
|
|
||||
*/
|
||||
|
||||
'username' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Server Password
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may set the password required by your SMTP server to send out
|
||||
| messages from your application. This will be given to the server on
|
||||
| connection so that the application will be able to send messages.
|
||||
|
|
||||
*/
|
||||
|
||||
'password' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sendmail System Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "sendmail" driver to send e-mails, we will need to know
|
||||
| the path to where Sendmail lives on this server. A default path has
|
||||
| been provided here, which will work well on most of your systems.
|
||||
|
|
||||
*/
|
||||
|
||||
'sendmail' => '/usr/sbin/sendmail -bs',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mail "Pretend"
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When this option is enabled, e-mail will not actually be sent over the
|
||||
| web and will instead be written to your application's logs files so
|
||||
| you may inspect the message. This is great for local development.
|
||||
|
|
||||
*/
|
||||
|
||||
'pretend' => false,
|
||||
|
||||
);
|
||||
@@ -55,6 +55,10 @@ return array(
|
||||
'queue' => 'your-queue-name',
|
||||
),
|
||||
|
||||
'failed' => array(
|
||||
'database' => 'mysql', 'table' => 'failed_jobs',
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
59
app/config/remote.php
Executable file
59
app/config/remote.php
Executable file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Remote Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default connection that will be used for SSH
|
||||
| operations. This name should correspond to a connection name below
|
||||
| in the server list. Each connection will be manually accessible.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => 'production',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Remote Server Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These are the servers that will be accessible via the SSH task runner
|
||||
| facilities of Laravel. This feature radically simplifies executing
|
||||
| tasks on your servers, such as deploying out these applications.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => array(
|
||||
|
||||
'production' => array(
|
||||
'host' => '',
|
||||
'username' => '',
|
||||
'password' => '',
|
||||
'key' => '',
|
||||
'keyphrase' => '',
|
||||
'root' => '/var/www',
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Remote Server Groups
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may list connections under a single group name, which allows
|
||||
| you to easily access all of the servers at once using a short name
|
||||
| that is extremely easy to remember, such as "web" or "database".
|
||||
|
|
||||
*/
|
||||
|
||||
'groups' => array(
|
||||
|
||||
'web' => array('production')
|
||||
|
||||
),
|
||||
|
||||
);
|
||||
@@ -122,4 +122,6 @@ return array(
|
||||
|
||||
'domain' => null,
|
||||
|
||||
'expire_on_close' => false,
|
||||
|
||||
);
|
||||
|
||||
3
app/config/staging/.gitignore
vendored
Executable file
3
app/config/staging/.gitignore
vendored
Executable file
@@ -0,0 +1,3 @@
|
||||
app.php
|
||||
mail.php
|
||||
database.php
|
||||
45
app/config/staging/app.example.php
Executable file
45
app/config/staging/app.example.php
Executable file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Debug Mode
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When your application is in debug mode, detailed error messages with
|
||||
| stack traces will be shown on every error that occurs within your
|
||||
| application. If disabled, a simple generic error page is shown.
|
||||
|
|
||||
*/
|
||||
|
||||
'debug' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application URL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This URL is used by the console to properly generate URLs when using
|
||||
| the Artisan command line tool. You should set this to the root of
|
||||
| your application so that it is used when running Artisan tasks.
|
||||
|
|
||||
*/
|
||||
|
||||
'url' => 'http://staging.yourserver.com',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Encryption Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This key is used by the Illuminate encrypter service and should be set
|
||||
| to a random, 32 character string, otherwise these encrypted strings
|
||||
| will not be safe. Please do this before deploying an application!
|
||||
|
|
||||
| Run a php artisan key:generate --env=staging to create a random one
|
||||
*/
|
||||
|
||||
'key' => 'Change_this_key_or_snipe_will_get_ya',
|
||||
|
||||
);
|
||||
124
app/config/staging/database.example.php
Executable file
124
app/config/staging/database.example.php
Executable file
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| PDO Fetch Style
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default, database results will be returned as instances of the PHP
|
||||
| stdClass object; however, you may desire to retrieve records in an
|
||||
| array format for simplicity. Here you can tweak the fetch style.
|
||||
|
|
||||
*/
|
||||
|
||||
'fetch' => PDO::FETCH_CLASS,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Database Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the database connections below you wish
|
||||
| to use as your default connection for all database work. Of course
|
||||
| you may use many connections at once using the Database library.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => 'mysql',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here are each of the database connections setup for your application.
|
||||
| Of course, examples of configuring each database platform that is
|
||||
| supported by Laravel is shown below to make development simple.
|
||||
|
|
||||
|
|
||||
| All database work in Laravel is done through the PHP PDO facilities
|
||||
| so make sure you have the driver for your particular database of
|
||||
| choice installed on your machine before you begin development.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => array(
|
||||
|
||||
'sqlite' => array(
|
||||
'driver' => 'sqlite',
|
||||
'database' => __DIR__.'/../database/production.sqlite',
|
||||
'prefix' => '',
|
||||
),
|
||||
|
||||
'mysql' => array(
|
||||
'driver' => 'mysql',
|
||||
'host' => 'localhost',
|
||||
'database' => 'snipeit_laravel',
|
||||
'username' => 'snipeit_laravel',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
'collation' => 'utf8_unicode_ci',
|
||||
'prefix' => '',
|
||||
),
|
||||
|
||||
'pgsql' => array(
|
||||
'driver' => 'pgsql',
|
||||
'host' => 'localhost',
|
||||
'database' => 'database',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'schema' => 'public',
|
||||
),
|
||||
|
||||
'sqlsrv' => array(
|
||||
'driver' => 'sqlsrv',
|
||||
'host' => 'localhost',
|
||||
'database' => 'database',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'prefix' => '',
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Migration Repository Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This table keeps track of all the migrations that have already run for
|
||||
| your application. Using this information, we can determine which of
|
||||
| the migrations on disk have not actually be run in the databases.
|
||||
|
|
||||
*/
|
||||
|
||||
'migrations' => 'migrations',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Redis Databases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Redis is an open source, fast, and advanced key-value store that also
|
||||
| provides a richer set of commands than a typical key-value systems
|
||||
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
||||
|
|
||||
*/
|
||||
|
||||
'redis' => array(
|
||||
|
||||
'cluster' => true,
|
||||
|
||||
'default' => array(
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 6379,
|
||||
'database' => 0,
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
);
|
||||
124
app/config/staging/mail.example.php
Executable file
124
app/config/staging/mail.example.php
Executable file
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mail Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
|
||||
| sending of e-mail. You may specify which one you're using throughout
|
||||
| your application here. By default, Laravel is setup for SMTP mail.
|
||||
|
|
||||
| Supported: "smtp", "mail", "sendmail"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'smtp',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Host Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may provide the host address of the SMTP server used by your
|
||||
| applications. A default option is provided that is compatible with
|
||||
| the Postmark mail service, which will provide reliable delivery.
|
||||
|
|
||||
*/
|
||||
|
||||
'host' => 'smtp.mailgun.org',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Host Port
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the SMTP port used by your application to delivery e-mails to
|
||||
| users of your application. Like the host we have set this value to
|
||||
| stay compatible with the Postmark e-mail application by default.
|
||||
|
|
||||
*/
|
||||
|
||||
'port' => 587,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global "From" Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may wish for all e-mails sent by your application to be sent from
|
||||
| the same address. Here, you may specify a name and address that is
|
||||
| used globally for all e-mails that are sent by your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'from' => array('address' => null, 'name' => null),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| E-Mail Encryption Protocol
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the encryption protocol that should be used when
|
||||
| the application send e-mail messages. A sensible default using the
|
||||
| transport layer security protocol should provide great security.
|
||||
|
|
||||
*/
|
||||
|
||||
'encryption' => 'tls',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Server Username
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If your SMTP server requires a username for authentication, you should
|
||||
| set it here. This will get used to authenticate with your server on
|
||||
| connection. You may also set the "password" value below this one.
|
||||
|
|
||||
*/
|
||||
|
||||
'username' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Server Password
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may set the password required by your SMTP server to send out
|
||||
| messages from your application. This will be given to the server on
|
||||
| connection so that the application will be able to send messages.
|
||||
|
|
||||
*/
|
||||
|
||||
'password' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sendmail System Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "sendmail" driver to send e-mails, we will need to know
|
||||
| the path to where Sendmail lives on this server. A default path has
|
||||
| been provided here, which will work well on most of your systems.
|
||||
|
|
||||
*/
|
||||
|
||||
'sendmail' => '/usr/sbin/sendmail -bs',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mail "Pretend"
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When this option is enabled, e-mail will not actually be sent over the
|
||||
| web and will instead be written to your application's logs files so
|
||||
| you may inspect the message. This is great for local development.
|
||||
|
|
||||
*/
|
||||
|
||||
'pretend' => false,
|
||||
|
||||
);
|
||||
45
app/config/testing/app.example.php
Executable file
45
app/config/testing/app.example.php
Executable file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Debug Mode
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When your application is in debug mode, detailed error messages with
|
||||
| stack traces will be shown on every error that occurs within your
|
||||
| application. If disabled, a simple generic error page is shown.
|
||||
|
|
||||
*/
|
||||
|
||||
'debug' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application URL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This URL is used by the console to properly generate URLs when using
|
||||
| the Artisan command line tool. You should set this to the root of
|
||||
| your application so that it is used when running Artisan tasks.
|
||||
|
|
||||
*/
|
||||
|
||||
'url' => 'http://staging.yourserver.com',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Encryption Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This key is used by the Illuminate encrypter service and should be set
|
||||
| to a random, 32 character string, otherwise these encrypted strings
|
||||
| will not be safe. Please do this before deploying an application!
|
||||
|
|
||||
| Run a php artisan key:generate --env=staging to create a random one
|
||||
*/
|
||||
|
||||
'key' => 'Change_this_key_or_snipe_will_get_ya',
|
||||
|
||||
);
|
||||
103
app/config/testing/database.example.php
Executable file
103
app/config/testing/database.example.php
Executable file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| PDO Fetch Style
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default, database results will be returned as instances of the PHP
|
||||
| stdClass object; however, you may desire to retrieve records in an
|
||||
| array format for simplicity. Here you can tweak the fetch style.
|
||||
|
|
||||
*/
|
||||
|
||||
'fetch' => PDO::FETCH_CLASS,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Database Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the database connections below you wish
|
||||
| to use as your default connection for all database work. Of course
|
||||
| you may use many connections at once using the Database library.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => 'mysql',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here are each of the database connections setup for your application.
|
||||
| Of course, examples of configuring each database platform that is
|
||||
| supported by Laravel is shown below to make development simple.
|
||||
|
|
||||
|
|
||||
| All database work in Laravel is done through the PHP PDO facilities
|
||||
| so make sure you have the driver for your particular database of
|
||||
| choice installed on your machine before you begin development.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => array(
|
||||
'sqlite' => array(
|
||||
'driver' => 'sqlite',
|
||||
'database' => ':memory:',
|
||||
'prefix' => ''
|
||||
),
|
||||
|
||||
'mysql' => array(
|
||||
'driver' => 'mysql',
|
||||
'host' => 'localhost',
|
||||
'database' => 'snipeit_laravel',
|
||||
'username' => 'travis',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
'collation' => 'utf8_unicode_ci',
|
||||
'prefix' => '',
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Migration Repository Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This table keeps track of all the migrations that have already run for
|
||||
| your application. Using this information, we can determine which of
|
||||
| the migrations on disk have not actually be run in the databases.
|
||||
|
|
||||
*/
|
||||
|
||||
'migrations' => 'migrations',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Redis Databases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Redis is an open source, fast, and advanced key-value store that also
|
||||
| provides a richer set of commands than a typical key-value systems
|
||||
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
||||
|
|
||||
*/
|
||||
|
||||
'redis' => array(
|
||||
|
||||
'cluster' => true,
|
||||
|
||||
'default' => array(
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 6379,
|
||||
'database' => 0,
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
);
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'default' => 'sqlite',
|
||||
|
||||
'connections' => array(
|
||||
'sqlite' => array(
|
||||
'driver' => 'sqlite',
|
||||
'database' => ':memory:',
|
||||
'prefix' => ''
|
||||
),
|
||||
)
|
||||
);
|
||||
124
app/config/testing/mail.example.php
Executable file
124
app/config/testing/mail.example.php
Executable file
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mail Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
|
||||
| sending of e-mail. You may specify which one you're using throughout
|
||||
| your application here. By default, Laravel is setup for SMTP mail.
|
||||
|
|
||||
| Supported: "smtp", "mail", "sendmail"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'smtp',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Host Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may provide the host address of the SMTP server used by your
|
||||
| applications. A default option is provided that is compatible with
|
||||
| the Postmark mail service, which will provide reliable delivery.
|
||||
|
|
||||
*/
|
||||
|
||||
'host' => 'smtp.mailgun.org',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Host Port
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the SMTP port used by your application to delivery e-mails to
|
||||
| users of your application. Like the host we have set this value to
|
||||
| stay compatible with the Postmark e-mail application by default.
|
||||
|
|
||||
*/
|
||||
|
||||
'port' => 587,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global "From" Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may wish for all e-mails sent by your application to be sent from
|
||||
| the same address. Here, you may specify a name and address that is
|
||||
| used globally for all e-mails that are sent by your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'from' => array('address' => null, 'name' => null),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| E-Mail Encryption Protocol
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the encryption protocol that should be used when
|
||||
| the application send e-mail messages. A sensible default using the
|
||||
| transport layer security protocol should provide great security.
|
||||
|
|
||||
*/
|
||||
|
||||
'encryption' => 'tls',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Server Username
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If your SMTP server requires a username for authentication, you should
|
||||
| set it here. This will get used to authenticate with your server on
|
||||
| connection. You may also set the "password" value below this one.
|
||||
|
|
||||
*/
|
||||
|
||||
'username' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Server Password
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may set the password required by your SMTP server to send out
|
||||
| messages from your application. This will be given to the server on
|
||||
| connection so that the application will be able to send messages.
|
||||
|
|
||||
*/
|
||||
|
||||
'password' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sendmail System Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "sendmail" driver to send e-mails, we will need to know
|
||||
| the path to where Sendmail lives on this server. A default path has
|
||||
| been provided here, which will work well on most of your systems.
|
||||
|
|
||||
*/
|
||||
|
||||
'sendmail' => '/usr/sbin/sendmail -bs',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mail "Pretend"
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When this option is enabled, e-mail will not actually be sent over the
|
||||
| web and will instead be written to your application's logs files so
|
||||
| you may inspect the message. This is great for local development.
|
||||
|
|
||||
*/
|
||||
|
||||
'pretend' => true,
|
||||
|
||||
);
|
||||
@@ -1,16 +1,19 @@
|
||||
<?php
|
||||
|
||||
class AdminController extends AuthorizedController {
|
||||
|
||||
class AdminController extends AuthorizedController
|
||||
{
|
||||
/**
|
||||
* Initializer.
|
||||
*
|
||||
* @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));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -24,12 +27,9 @@ class AdminController extends AuthorizedController {
|
||||
*/
|
||||
protected function encodeAllPermissions(array &$allPermissions, $removeSuperUser = false)
|
||||
{
|
||||
foreach ($allPermissions as $area => &$permissions)
|
||||
{
|
||||
foreach ($permissions as $index => &$permission)
|
||||
{
|
||||
if ($removeSuperUser == true and $permission['permission'] == 'superuser')
|
||||
{
|
||||
foreach ($allPermissions as $area => &$permissions) {
|
||||
foreach ($permissions as $index => &$permission) {
|
||||
if ($removeSuperUser == true and $permission['permission'] == 'superuser') {
|
||||
unset($permissions[$index]);
|
||||
continue;
|
||||
}
|
||||
@@ -40,8 +40,7 @@ class AdminController extends AuthorizedController {
|
||||
|
||||
// If we removed a super user permission and there are
|
||||
// none left, let's remove the group
|
||||
if ($removeSuperUser == true and empty($permissions))
|
||||
{
|
||||
if ($removeSuperUser == true and empty($permissions)) {
|
||||
unset($allPermissions[$area]);
|
||||
}
|
||||
}
|
||||
@@ -58,8 +57,7 @@ class AdminController extends AuthorizedController {
|
||||
{
|
||||
$encodedPermissions = array();
|
||||
|
||||
foreach ($permissions as $permission => $access)
|
||||
{
|
||||
foreach ($permissions as $permission => $access) {
|
||||
$encodedPermissions[base64_encode($permission)] = $access;
|
||||
}
|
||||
|
||||
@@ -77,8 +75,7 @@ class AdminController extends AuthorizedController {
|
||||
{
|
||||
$decodedPermissions = array();
|
||||
|
||||
foreach ($permissions as $permission => $access)
|
||||
{
|
||||
foreach ($permissions as $permission => $access) {
|
||||
$decodedPermissions[base64_decode($permission)] = $access;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
class AuthController extends BaseController {
|
||||
|
||||
class AuthController extends BaseController
|
||||
{
|
||||
/**
|
||||
* Account sign in.
|
||||
*
|
||||
@@ -10,8 +10,7 @@ class AuthController extends BaseController {
|
||||
public function getSignin()
|
||||
{
|
||||
// Is the user logged in?
|
||||
if (Sentry::check())
|
||||
{
|
||||
if (Sentry::check()) {
|
||||
return Redirect::route('account');
|
||||
}
|
||||
|
||||
@@ -29,21 +28,19 @@ class AuthController extends BaseController {
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
'email' => 'required|email',
|
||||
'password' => 'required|between:3,32',
|
||||
'password' => 'required',
|
||||
);
|
||||
|
||||
// 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())
|
||||
{
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
// Try to log the user in
|
||||
Sentry::authenticate(Input::only('email', 'password'), Input::get('remember-me', 0));
|
||||
|
||||
@@ -55,21 +52,13 @@ class AuthController extends BaseController {
|
||||
|
||||
// Redirect to the users page
|
||||
return Redirect::to($redirect)->with('success', Lang::get('auth/message.signin.success'));
|
||||
}
|
||||
catch (Cartalyst\Sentry\Users\UserNotFoundException $e)
|
||||
{
|
||||
} catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
|
||||
$this->messageBag->add('email', Lang::get('auth/message.account_not_found'));
|
||||
}
|
||||
catch (Cartalyst\Sentry\Users\UserNotActivatedException $e)
|
||||
{
|
||||
} catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
|
||||
$this->messageBag->add('email', Lang::get('auth/message.account_not_activated'));
|
||||
}
|
||||
catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e)
|
||||
{
|
||||
} catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
|
||||
$this->messageBag->add('email', Lang::get('auth/message.account_suspended'));
|
||||
}
|
||||
catch (Cartalyst\Sentry\Throttling\UserBannedException $e)
|
||||
{
|
||||
} catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
|
||||
$this->messageBag->add('email', Lang::get('auth/message.account_banned'));
|
||||
}
|
||||
|
||||
@@ -85,8 +74,7 @@ class AuthController extends BaseController {
|
||||
public function getSignup()
|
||||
{
|
||||
// Is the user logged in?
|
||||
if (Sentry::check())
|
||||
{
|
||||
if (Sentry::check()) {
|
||||
return Redirect::route('account');
|
||||
}
|
||||
|
||||
@@ -103,11 +91,11 @@ class AuthController extends BaseController {
|
||||
{
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
'first_name' => 'required|min:3',
|
||||
'last_name' => 'required|min:3',
|
||||
'first_name' => 'required|min:2',
|
||||
'last_name' => 'required|min:2',
|
||||
'email' => 'required|email|unique:users',
|
||||
'email_confirm' => 'required|email|same:email',
|
||||
'password' => 'required|between:3,32',
|
||||
'password' => 'required|between:10,32',
|
||||
'password_confirm' => 'required|same:password',
|
||||
);
|
||||
|
||||
@@ -115,14 +103,12 @@ class AuthController extends BaseController {
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
// If validation fails, we'll exit the operation now.
|
||||
if ($validator->fails())
|
||||
{
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
// Register the user
|
||||
$user = Sentry::register(array(
|
||||
'first_name' => Input::get('first_name'),
|
||||
@@ -138,17 +124,14 @@ class AuthController extends BaseController {
|
||||
);
|
||||
|
||||
// Send the activation code through email
|
||||
Mail::send('emails.register-activate', $data, function($m) use ($user)
|
||||
{
|
||||
Mail::send('emails.register-activate', $data, function ($m) use ($user) {
|
||||
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
|
||||
$m->subject('Welcome ' . $user->first_name);
|
||||
});
|
||||
|
||||
// Redirect to the register page
|
||||
return Redirect::back()->with('success', Lang::get('auth/message.signup.success'));
|
||||
}
|
||||
catch (Cartalyst\Sentry\Users\UserExistsException $e)
|
||||
{
|
||||
} catch (Cartalyst\Sentry\Users\UserExistsException $e) {
|
||||
$this->messageBag->add('email', Lang::get('auth/message.account_already_exists'));
|
||||
}
|
||||
|
||||
@@ -165,28 +148,23 @@ class AuthController extends BaseController {
|
||||
public function getActivate($activationCode = null)
|
||||
{
|
||||
// Is the user logged in?
|
||||
if (Sentry::check())
|
||||
{
|
||||
if (Sentry::check()) {
|
||||
return Redirect::route('account');
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
// Get the user we are trying to activate
|
||||
$user = Sentry::getUserProvider()->findByActivationCode($activationCode);
|
||||
|
||||
// Try to activate this user account
|
||||
if ($user->attemptActivation($activationCode))
|
||||
{
|
||||
if ($user->attemptActivation($activationCode)) {
|
||||
// Redirect to the login page
|
||||
return Redirect::route('signin')->with('success', Lang::get('auth/message.activate.success'));
|
||||
}
|
||||
|
||||
// The activation failed.
|
||||
$error = Lang::get('auth/message.activate.error');
|
||||
}
|
||||
catch (Cartalyst\Sentry\Users\UserNotFoundException $e)
|
||||
{
|
||||
} catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
|
||||
$error = Lang::get('auth/message.activate.error');
|
||||
}
|
||||
|
||||
@@ -221,14 +199,12 @@ class AuthController extends BaseController {
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
// If validation fails, we'll exit the operation now.
|
||||
if ($validator->fails())
|
||||
{
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::route('forgot-password')->withInput()->withErrors($validator);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
// Get the user password recovery code
|
||||
$user = Sentry::getUserProvider()->findByLogin(Input::get('email'));
|
||||
|
||||
@@ -239,14 +215,11 @@ class AuthController extends BaseController {
|
||||
);
|
||||
|
||||
// Send the activation code through email
|
||||
Mail::send('emails.forgot-password', $data, function($m) use ($user)
|
||||
{
|
||||
Mail::send('emails.forgot-password', $data, function ($m) use ($user) {
|
||||
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
|
||||
$m->subject('Account Password Recovery');
|
||||
});
|
||||
}
|
||||
catch (Cartalyst\Sentry\Users\UserNotFoundException $e)
|
||||
{
|
||||
} catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
|
||||
// Even though the email was not found, we will pretend
|
||||
// we have sent the password reset code through email,
|
||||
// this is a security measure against hackers.
|
||||
@@ -264,13 +237,10 @@ class AuthController extends BaseController {
|
||||
*/
|
||||
public function getForgotPasswordConfirm($passwordResetCode = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
try {
|
||||
// Find the user using the password reset code
|
||||
$user = Sentry::getUserProvider()->findByResetPasswordCode($passwordResetCode);
|
||||
}
|
||||
catch(Cartalyst\Sentry\Users\UserNotFoundException $e)
|
||||
{
|
||||
} catch(Cartalyst\Sentry\Users\UserNotFoundException $e) {
|
||||
// Redirect to the forgot password page
|
||||
return Redirect::route('forgot-password')->with('error', Lang::get('auth/message.account_not_found'));
|
||||
}
|
||||
@@ -289,7 +259,7 @@ class AuthController extends BaseController {
|
||||
{
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
'password' => 'required',
|
||||
'password' => 'required|between:10,32',
|
||||
'password_confirm' => 'required|same:password'
|
||||
);
|
||||
|
||||
@@ -297,31 +267,24 @@ class AuthController extends BaseController {
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
// If validation fails, we'll exit the operation now.
|
||||
if ($validator->fails())
|
||||
{
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::route('forgot-password-confirm', $passwordResetCode)->withInput()->withErrors($validator);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
// Find the user using the password reset code
|
||||
$user = Sentry::getUserProvider()->findByResetPasswordCode($passwordResetCode);
|
||||
|
||||
// Attempt to reset the user password
|
||||
if ($user->attemptResetPassword($passwordResetCode, Input::get('password')))
|
||||
{
|
||||
if ($user->attemptResetPassword($passwordResetCode, Input::get('password'))) {
|
||||
// Password successfully reseted
|
||||
return Redirect::route('signin')->with('success', Lang::get('auth/message.forgot-password-confirm.success'));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::route('signin')->with('error', Lang::get('auth/message.forgot-password-confirm.error'));
|
||||
}
|
||||
}
|
||||
catch (Cartalyst\Sentry\Users\UserNotFoundException $e)
|
||||
{
|
||||
} catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
|
||||
// Redirect to the forgot password page
|
||||
return Redirect::route('forgot-password')->with('error', Lang::get('auth/message.account_not_found'));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
class AuthorizedController extends BaseController {
|
||||
|
||||
class AuthorizedController extends BaseController
|
||||
{
|
||||
/**
|
||||
* Whitelisted auth routes.
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
class BaseController extends Controller {
|
||||
|
||||
class BaseController extends Controller
|
||||
{
|
||||
/**
|
||||
* Message bag.
|
||||
*
|
||||
@@ -30,8 +30,7 @@ class BaseController extends Controller {
|
||||
*/
|
||||
protected function setupLayout()
|
||||
{
|
||||
if ( ! is_null($this->layout))
|
||||
{
|
||||
if ( ! is_null($this->layout)) {
|
||||
$this->layout = View::make($this->layout);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
class HomeController extends BaseController {
|
||||
|
||||
class HomeController extends BaseController
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Home Controller
|
||||
|
||||
@@ -6,9 +6,11 @@ use Redirect;
|
||||
use Sentry;
|
||||
use Validator;
|
||||
use View;
|
||||
use Config;
|
||||
use Lang;
|
||||
|
||||
class ChangeEmailController extends AuthorizedController {
|
||||
|
||||
class ChangeEmailController extends AuthorizedController
|
||||
{
|
||||
/**
|
||||
* User change email page.
|
||||
*
|
||||
@@ -37,12 +39,15 @@ class ChangeEmailController extends AuthorizedController {
|
||||
'email_confirm' => 'required|same:email',
|
||||
);
|
||||
|
||||
if (Config::get('app.lock_passwords')) {
|
||||
return Redirect::route('change-password')->with('error', Lang::get('admin/users/table.lock_passwords'));
|
||||
} else {
|
||||
|
||||
// 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())
|
||||
{
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
@@ -51,8 +56,7 @@ class ChangeEmailController extends AuthorizedController {
|
||||
$user = Sentry::getUser();
|
||||
|
||||
// Check the user current password
|
||||
if ( ! $user->checkPassword(Input::get('current_password')))
|
||||
{
|
||||
if ( ! $user->checkPassword(Input::get('current_password'))) {
|
||||
// Set the error message
|
||||
$this->messageBag->add('current_password', 'Your current password is incorrect');
|
||||
|
||||
@@ -67,5 +71,6 @@ class ChangeEmailController extends AuthorizedController {
|
||||
// Redirect to the settings page
|
||||
return Redirect::route('change-email')->with('success', 'Email successfully updated');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,9 +6,11 @@ use Redirect;
|
||||
use Sentry;
|
||||
use Validator;
|
||||
use View;
|
||||
use Config;
|
||||
use Lang;
|
||||
|
||||
class ChangePasswordController extends AuthorizedController {
|
||||
|
||||
class ChangePasswordController extends AuthorizedController
|
||||
{
|
||||
/**
|
||||
* User change password page.
|
||||
*
|
||||
@@ -32,17 +34,19 @@ 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',
|
||||
);
|
||||
|
||||
if (Config::get('app.lock_passwords')) {
|
||||
return Redirect::route('change-password')->with('error', Lang::get('admin/users/table.lock_passwords'));
|
||||
} else {
|
||||
// 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())
|
||||
{
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
@@ -51,8 +55,7 @@ class ChangePasswordController extends AuthorizedController {
|
||||
$user = Sentry::getUser();
|
||||
|
||||
// Check the user current password
|
||||
if ( ! $user->checkPassword(Input::get('old_password')))
|
||||
{
|
||||
if ( ! $user->checkPassword(Input::get('old_password'))) {
|
||||
// Set the error message
|
||||
$this->messageBag->add('old_password', 'Your current password is incorrect.');
|
||||
|
||||
@@ -63,6 +66,7 @@ class ChangePasswordController extends AuthorizedController {
|
||||
// Update the user password
|
||||
$user->password = Input::get('password');
|
||||
$user->save();
|
||||
}
|
||||
|
||||
// Redirect to the change-password page
|
||||
return Redirect::route('change-password')->with('success', 'Password successfully updated');
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
use AuthorizedController;
|
||||
use Redirect;
|
||||
|
||||
class DashboardController extends AuthorizedController {
|
||||
|
||||
class DashboardController extends AuthorizedController
|
||||
{
|
||||
/**
|
||||
* Redirect to the profile page.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php namespace Controllers\Account;
|
||||
|
||||
use AuthorizedController;
|
||||
use Image;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Sentry;
|
||||
@@ -8,8 +9,8 @@ use Validator;
|
||||
use Location;
|
||||
use View;
|
||||
|
||||
class ProfileController extends AuthorizedController {
|
||||
|
||||
class ProfileController extends AuthorizedController
|
||||
{
|
||||
/**
|
||||
* User profile page.
|
||||
*
|
||||
@@ -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',
|
||||
);
|
||||
|
||||
@@ -48,8 +49,7 @@ class ProfileController extends AuthorizedController {
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
// If validation fails, we'll exit the operation now.
|
||||
if ($validator->fails())
|
||||
{
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
@@ -63,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
|
||||
|
||||
146
app/controllers/account/ViewAssetsController.php
Executable file
146
app/controllers/account/ViewAssetsController.php
Executable file
@@ -0,0 +1,146 @@
|
||||
<?php namespace Controllers\Account;
|
||||
|
||||
use AuthorizedController;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Sentry;
|
||||
use Validator;
|
||||
use Location;
|
||||
use View;
|
||||
use Asset;
|
||||
use Actionlog;
|
||||
use Lang;
|
||||
use Accessory;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getRequestableIndex() {
|
||||
|
||||
$assets = Asset::with('model','defaultLoc')->Hardware()->RequestableAssets()->get();
|
||||
return View::make('frontend/account/requestable-assets', compact('user','assets'));
|
||||
}
|
||||
|
||||
|
||||
public function getRequestAsset($assetId = null) {
|
||||
|
||||
// Check if the asset exists
|
||||
if (is_null($asset = Asset::find($assetId))) {
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
|
||||
} else {
|
||||
|
||||
|
||||
return View::make('frontend/account/view-asset', compact('asset'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Get the acceptance screen
|
||||
public function getAcceptAsset($logID = null) {
|
||||
|
||||
if (is_null($findlog = Actionlog::find($logID))) {
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('account')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
|
||||
}
|
||||
|
||||
// Asset
|
||||
if (($findlog->asset_id!='') && ($findlog->asset_type=='hardware')) {
|
||||
$item = Asset::find($findlog->asset_id);
|
||||
|
||||
// software
|
||||
} elseif (($findlog->asset_id!='') && ($findlog->asset_type=='software')) {
|
||||
$item = License::find($findlog->asset_id);
|
||||
// accessories
|
||||
} elseif ($findlog->accessory_id!='') {
|
||||
$item = Accessory::find($findlog->accessory_id);
|
||||
}
|
||||
|
||||
// Check if the asset exists
|
||||
if (is_null($item)) {
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('account')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
|
||||
}
|
||||
|
||||
return View::make('frontend/account/accept-asset', compact('item'))->with('findlog', $findlog);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Save the acceptance
|
||||
public function postAcceptAsset($logID = null) {
|
||||
|
||||
|
||||
// Check if the asset exists
|
||||
if (is_null($findlog = Actionlog::find($logID))) {
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('account')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
|
||||
}
|
||||
|
||||
$user = Sentry::getUser();
|
||||
$logaction = new Actionlog();
|
||||
|
||||
// Asset
|
||||
if (($findlog->asset_id!='') && ($findlog->asset_type=='hardware')) {
|
||||
$logaction->asset_id = $findlog->asset_id;
|
||||
$logaction->accessory_id = NULL;
|
||||
$logaction->asset_type = 'hardware';
|
||||
|
||||
// software
|
||||
} elseif (($findlog->asset_id!='') && ($findlog->asset_type=='software')) {
|
||||
$logaction->asset_id = $findlog->asset_id;
|
||||
$logaction->accessory_id = NULL;
|
||||
$logaction->asset_type = 'software';
|
||||
|
||||
// accessories
|
||||
} elseif ($findlog->accessory_id!='') {
|
||||
$logaction->asset_id = NULL;
|
||||
$logaction->accessory_id = $findlog->accessory_id;
|
||||
$logaction->asset_type = 'accessory';
|
||||
}
|
||||
|
||||
$logaction->checkedout_to = $findlog->checkedout_to;
|
||||
|
||||
$logaction->note = e(Input::get('note'));
|
||||
$logaction->user_id = $user->id;
|
||||
$logaction->accepted_at = date("Y-m-d h:i:s");
|
||||
$log = $logaction->logaction('accepted');
|
||||
|
||||
return Redirect::to('account/view-assets')->with('success', 'You have successfully accept this asset.');
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
362
app/controllers/admin/AccessoriesController.php
Executable file
362
app/controllers/admin/AccessoriesController.php
Executable file
@@ -0,0 +1,362 @@
|
||||
<?php namespace Controllers\Admin;
|
||||
|
||||
use AdminController;
|
||||
use Input;
|
||||
use Lang;
|
||||
use Accessory;
|
||||
use Redirect;
|
||||
use Setting;
|
||||
use DB;
|
||||
use Sentry;
|
||||
use Str;
|
||||
use Validator;
|
||||
use View;
|
||||
use User;
|
||||
use Actionlog;
|
||||
use Mail;
|
||||
|
||||
class AccessoriesController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Show a list of all the accessories.
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the accessories
|
||||
$accessories = Accessory::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/accessories/index', compact('accessories'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Accessory create.
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function getCreate()
|
||||
{
|
||||
// Show the page
|
||||
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','accessory')->whereNull('deleted_at')->lists('name', 'id');
|
||||
return View::make('backend/accessories/edit')->with('accessory',new Accessory)->with('category_list',$category_list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Accessory create form processing.
|
||||
*
|
||||
* @return Redirect
|
||||
*/
|
||||
public function postCreate()
|
||||
{
|
||||
|
||||
// create a new model instance
|
||||
$accessory = new Accessory();
|
||||
|
||||
$validator = Validator::make(Input::all(), $accessory->rules);
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
else{
|
||||
|
||||
// Update the accessory data
|
||||
$accessory->name = e(Input::get('name'));
|
||||
$accessory->category_id = e(Input::get('category_id'));
|
||||
$accessory->qty = e(Input::get('qty'));
|
||||
$accessory->user_id = Sentry::getId();
|
||||
|
||||
// Was the accessory created?
|
||||
if($accessory->save()) {
|
||||
// Redirect to the new accessory page
|
||||
return Redirect::to("admin/accessories")->with('success', Lang::get('admin/accessories/message.create.success'));
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the accessory create page
|
||||
return Redirect::to('admin/accessories/create')->with('error', Lang::get('admin/accessories/message.create.error'));
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Accessory update.
|
||||
*
|
||||
* @param int $accessoryId
|
||||
* @return View
|
||||
*/
|
||||
public function getEdit($accessoryId = null)
|
||||
{
|
||||
// Check if the accessory exists
|
||||
if (is_null($accessory = Accessory::find($accessoryId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/accessories')->with('error', Lang::get('admin/accessories/message.does_not_exist'));
|
||||
}
|
||||
|
||||
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','accessory')->whereNull('deleted_at')->lists('name', 'id');
|
||||
return View::make('backend/accessories/edit', compact('accessory'))->with('category_list',$category_list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Accessory update form processing page.
|
||||
*
|
||||
* @param int $accessoryId
|
||||
* @return Redirect
|
||||
*/
|
||||
public function postEdit($accessoryId = null)
|
||||
{
|
||||
// Check if the blog post exists
|
||||
if (is_null($accessory = Accessory::find($accessoryId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/accessories')->with('error', Lang::get('admin/accessories/message.does_not_exist'));
|
||||
}
|
||||
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
// attempt validation
|
||||
$validator = Validator::make(Input::all(), $accessory->validationRules($accessoryId));
|
||||
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
else {
|
||||
|
||||
// Update the accessory data
|
||||
$accessory->name = e(Input::get('name'));
|
||||
$accessory->category_id = e(Input::get('category_id'));
|
||||
$accessory->qty = e(Input::get('qty'));
|
||||
|
||||
// Was the accessory created?
|
||||
if($accessory->save()) {
|
||||
// Redirect to the new accessory page
|
||||
return Redirect::to("admin/accessories")->with('success', Lang::get('admin/accessories/message.update.success'));
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the accessory management page
|
||||
return Redirect::to("admin/accessories/$accessoryID/edit")->with('error', Lang::get('admin/accessories/message.update.error'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the given accessory.
|
||||
*
|
||||
* @param int $accessoryId
|
||||
* @return Redirect
|
||||
*/
|
||||
public function getDelete($accessoryId)
|
||||
{
|
||||
// Check if the blog post exists
|
||||
if (is_null($accessory = Accessory::find($accessoryId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/accessories')->with('error', Lang::get('admin/accessories/message.not_found'));
|
||||
}
|
||||
|
||||
|
||||
if ($accessory->hasUsers() > 0) {
|
||||
return Redirect::to('admin/accessories')->with('error', Lang::get('admin/accessories/message.assoc_users', array('count'=> $accessory->hasUsers())));
|
||||
} else {
|
||||
$accessory->delete();
|
||||
|
||||
// Redirect to the locations management page
|
||||
return Redirect::to('admin/accessories')->with('success', Lang::get('admin/accessories/message.delete.success'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get the accessory information to present to the accessory view page
|
||||
*
|
||||
* @param int $accessoryId
|
||||
* @return View
|
||||
**/
|
||||
public function getView($accessoryID = null)
|
||||
{
|
||||
$accessory = Accessory::find($accessoryID);
|
||||
|
||||
if (isset($accessory->id)) {
|
||||
return View::make('backend/accessories/view', compact('accessory'));
|
||||
} else {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/accessories/message.does_not_exist', compact('id'));
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('accessories')->with('error', $error);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Check out the accessory to a person
|
||||
**/
|
||||
public function getCheckout($accessoryId)
|
||||
{
|
||||
// Check if the accessory exists
|
||||
if (is_null($accessory = Accessory::find($accessoryId))) {
|
||||
// Redirect to the accessory management page with error
|
||||
return Redirect::to('accessories')->with('error', Lang::get('admin/accessories/message.not_found'));
|
||||
}
|
||||
|
||||
// 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(last_name,", ",first_name) as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id');
|
||||
|
||||
return View::make('backend/accessories/checkout', compact('accessory'))->with('users_list',$users_list);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Check out the accessory to a person
|
||||
**/
|
||||
public function postCheckout($accessoryId)
|
||||
{
|
||||
// Check if the accessory exists
|
||||
if (is_null($accessory = Accessory::find($accessoryId))) {
|
||||
// Redirect to the accessory management page with error
|
||||
return Redirect::to('accessories')->with('error', Lang::get('admin/accessories/message.not_found'));
|
||||
}
|
||||
|
||||
$assigned_to = e(Input::get('assigned_to'));
|
||||
|
||||
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
'assigned_to' => 'required|min:1'
|
||||
);
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
||||
// Check if the user exists
|
||||
if (is_null($user = User::find($assigned_to))) {
|
||||
// Redirect to the accessory management page with error
|
||||
return Redirect::to('admin/accessories')->with('error', Lang::get('admin/accessories/message.user_does_not_exist'));
|
||||
}
|
||||
|
||||
// Update the accessory data
|
||||
$accessory->assigned_to = e(Input::get('assigned_to'));
|
||||
|
||||
$accessory->users()->attach($accessory->id, array(
|
||||
'accessory_id' => $accessory->id,
|
||||
'assigned_to' => e(Input::get('assigned_to'))));
|
||||
|
||||
$logaction = new Actionlog();
|
||||
$logaction->accessory_id = $accessory->id;
|
||||
$logaction->checkedout_to = $accessory->assigned_to;
|
||||
$logaction->asset_type = 'accessory';
|
||||
$logaction->location_id = $user->location_id;
|
||||
$logaction->user_id = Sentry::getUser()->id;
|
||||
$logaction->note = e(Input::get('note'));
|
||||
$log = $logaction->logaction('checkout');
|
||||
|
||||
$accessory_user = DB::table('accessories_users')->where('assigned_to','=',$accessory->assigned_to)->where('accessory_id','=',$accessory->id)->first();
|
||||
|
||||
$data['log_id'] = $logaction->id;
|
||||
$data['eula'] = $accessory->getEula();
|
||||
$data['first_name'] = $user->first_name;
|
||||
$data['item_name'] = $accessory->name;
|
||||
$data['require_acceptance'] = $accessory->requireAcceptance();
|
||||
|
||||
|
||||
if (($accessory->requireAcceptance()=='1') || ($accessory->getEula())) {
|
||||
|
||||
Mail::send('emails.accept-asset', $data, function ($m) use ($user) {
|
||||
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
|
||||
$m->subject('Confirm accessory delivery');
|
||||
});
|
||||
}
|
||||
|
||||
// Redirect to the new accessory page
|
||||
return Redirect::to("admin/accessories")->with('success', Lang::get('admin/accessories/message.checkout.success'));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check the accessory back into inventory
|
||||
*
|
||||
* @param int $accessoryId
|
||||
* @return View
|
||||
**/
|
||||
public function getCheckin($accessoryUserId)
|
||||
{
|
||||
// Check if the accessory exists
|
||||
if (is_null($accessory_user = DB::table('accessories_users')->find($accessoryUserId))) {
|
||||
// Redirect to the accessory management page with error
|
||||
return Redirect::to('admin/accessories')->with('error', Lang::get('admin/accessories/message.not_found'));
|
||||
}
|
||||
|
||||
$accessory = Accessory::find($accessory_user->accessory_id);
|
||||
return View::make('backend/accessories/checkin', compact('accessory'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check in the item so that it can be checked out again to someone else
|
||||
*
|
||||
* @param int $accessoryId
|
||||
* @return View
|
||||
**/
|
||||
public function postCheckin($accessoryUserId)
|
||||
{
|
||||
// Check if the accessory exists
|
||||
if (is_null($accessory_user = DB::table('accessories_users')->find($accessoryUserId))) {
|
||||
// Redirect to the accessory management page with error
|
||||
return Redirect::to('admin/accessories')->with('error', Lang::get('admin/accessories/message.not_found'));
|
||||
}
|
||||
|
||||
|
||||
$accessory = Accessory::find($accessory_user->accessory_id);
|
||||
$logaction = new Actionlog();
|
||||
$logaction->checkedout_to = $accessory_user->assigned_to;
|
||||
|
||||
// Was the accessory updated?
|
||||
if(DB::table('accessories_users')->where('id', '=', $accessory_user->id)->delete()) {
|
||||
|
||||
$logaction->accessory_id = $accessory->id;
|
||||
$logaction->location_id = NULL;
|
||||
$logaction->asset_type = 'accessory';
|
||||
$logaction->user_id = Sentry::getUser()->id;
|
||||
$log = $logaction->logaction('checkin from');
|
||||
|
||||
// Redirect to the new accessory page
|
||||
return Redirect::to("admin/accessories")->with('success', Lang::get('admin/accessories/message.checkin.success'));
|
||||
}
|
||||
|
||||
// Redirect to the accessory management page with error
|
||||
return Redirect::to("admin/accessories")->with('error', Lang::get('admin/accessories/message.checkin.error'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
597
app/controllers/admin/AssetsController.php
Normal file → Executable file
597
app/controllers/admin/AssetsController.php
Normal file → Executable file
@@ -4,6 +4,7 @@ use AdminController;
|
||||
use Input;
|
||||
use Lang;
|
||||
use Asset;
|
||||
use Supplier;
|
||||
use Statuslabel;
|
||||
use User;
|
||||
use Setting;
|
||||
@@ -16,8 +17,16 @@ use Sentry;
|
||||
use Str;
|
||||
use Validator;
|
||||
use View;
|
||||
use Response;
|
||||
use Config;
|
||||
use Location;
|
||||
use Log;
|
||||
use DNS2D;
|
||||
use Mail;
|
||||
|
||||
class AssetsController extends AdminController {
|
||||
class AssetsController extends AdminController
|
||||
{
|
||||
protected $qrCodeDimensions = array( 'height' => 3.5, 'width' => 3.5);
|
||||
|
||||
/**
|
||||
* Show a list of all the assets.
|
||||
@@ -29,28 +38,27 @@ class AssetsController extends AdminController {
|
||||
{
|
||||
// Grab all the assets
|
||||
|
||||
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')->Hardware();
|
||||
// Filter results
|
||||
if (Input::get('Pending'))
|
||||
{
|
||||
$assets = Asset::orderBy('asset_tag', 'ASC')->whereNull('status_id','and')->where('assigned_to','=','0')->where('physical', '=', 1)->get();
|
||||
}
|
||||
else if (Input::get('RTD'))
|
||||
{
|
||||
$assets = Asset::orderBy('asset_tag', 'ASC')->where('status_id', '=', 0)->where('assigned_to','=','0')->where('physical', '=', 1)->get();
|
||||
}
|
||||
else if (Input::get('Undeployable'))
|
||||
{
|
||||
$assets = Asset::orderBy('asset_tag', 'ASC')->where('status_id', '>', 1)->where('physical', '=', 1)->get();
|
||||
}
|
||||
else if (Input::get('Deployed'))
|
||||
{
|
||||
$assets = Asset::orderBy('asset_tag', 'ASC')->where('status_id', '=', 0)->where('assigned_to','>','0')->where('physical', '=', 1)->get();
|
||||
}
|
||||
else
|
||||
{
|
||||
$assets = Asset::orderBy('asset_tag', 'ASC')->where('physical', '=', 1)->get();
|
||||
if (Input::get('Pending')) {
|
||||
$assets->Pending();
|
||||
} elseif (Input::get('RTD')) {
|
||||
$assets->RTD();
|
||||
} elseif (Input::get('Undeployable')) {
|
||||
$assets->Undeployable();
|
||||
} elseif (Input::get('Archived')) {
|
||||
$assets->Archived();
|
||||
} elseif (Input::get('Requestable')) {
|
||||
$assets->RequestableAssets();
|
||||
} elseif (Input::get('Deployed')) {
|
||||
$assets->Deployed();
|
||||
} elseif (Input::get('Deleted')) {
|
||||
$assets->withTrashed()->Deleted();
|
||||
}
|
||||
|
||||
$assets = $assets->orderBy('asset_tag', 'ASC')->get();
|
||||
|
||||
|
||||
// Paginate the users
|
||||
/**$assets = $assets->paginate(Setting::getSettings()->per_page)
|
||||
->appends(array(
|
||||
@@ -64,31 +72,50 @@ class AssetsController extends AdminController {
|
||||
return View::make('backend/hardware/index', compact('assets'));
|
||||
}
|
||||
|
||||
public function getReports()
|
||||
{
|
||||
// Grab all the assets
|
||||
$assets = Asset::orderBy('created_at', 'DESC')->get();
|
||||
return View::make('backend/reports/index', compact('assets'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Asset create.
|
||||
*
|
||||
* @param null $model_id
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function getCreate()
|
||||
public function getCreate($model_id = null)
|
||||
{
|
||||
|
||||
// Grab the dropdown list of models
|
||||
$model_list = array('' => '') + Model::lists('name', 'id');
|
||||
$depreciation_list = array('' => '') + Depreciation::lists('name', 'id');
|
||||
//$model_list = array('' => 'Select a Model') + Model::orderBy('name', 'asc')->lists('name'.' '. 'modelno', 'id');
|
||||
|
||||
$model_list = array('' => 'Select a Model') + DB::table('models')
|
||||
->select(DB::raw('concat(name," / ",modelno) as name, id'))->orderBy('name', 'asc')
|
||||
->orderBy('modelno', '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('' => 'Pending') + array('1' => 'Ready to Deploy') + Statuslabel::lists('name', 'id');
|
||||
$statuslabel_list = Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
|
||||
|
||||
return View::make('backend/hardware/edit')->with('model_list',$model_list)->with('statuslabel_list',$statuslabel_list)->with('depreciation_list',$depreciation_list)->with('asset',new Asset);
|
||||
$view = View::make('backend/hardware/edit');
|
||||
$view->with('supplier_list',$supplier_list);
|
||||
$view->with('model_list',$model_list);
|
||||
$view->with('statuslabel_list',$statuslabel_list);
|
||||
$view->with('assigned_to',$assigned_to);
|
||||
$view->with('location_list',$location_list);
|
||||
$view->with('asset',new Asset);
|
||||
|
||||
if (!is_null($model_id)) {
|
||||
$selected_model = Model::find($model_id);
|
||||
$view->with('selected_model',$selected_model);
|
||||
}
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Asset create form processing.
|
||||
@@ -97,16 +124,19 @@ class AssetsController extends AdminController {
|
||||
*/
|
||||
public function postCreate()
|
||||
{
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
// create a new model instance
|
||||
$asset = new Asset();
|
||||
|
||||
// attempt validation
|
||||
if ($asset->validate($new))
|
||||
//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
|
||||
else {
|
||||
|
||||
if ( e(Input::get('status_id')) == '') {
|
||||
$asset->status_id = NULL;
|
||||
@@ -123,7 +153,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')) == '') {
|
||||
@@ -132,6 +162,30 @@ class AssetsController extends AdminController {
|
||||
$asset->purchase_date = e(Input::get('purchase_date'));
|
||||
}
|
||||
|
||||
if (e(Input::get('assigned_to')) == '') {
|
||||
$asset->assigned_to = NULL;
|
||||
} 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 = NULL;
|
||||
} 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'));
|
||||
@@ -139,26 +193,29 @@ 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->mac_address = e(Input::get('mac_address'));
|
||||
$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())
|
||||
{
|
||||
if($asset->save()) {
|
||||
|
||||
if (Input::get('assigned_to')!='') {
|
||||
$logaction = new Actionlog();
|
||||
$logaction->asset_id = $asset->id;
|
||||
$logaction->checkedout_to = $asset->assigned_to;
|
||||
$logaction->asset_type = 'hardware';
|
||||
$logaction->user_id = Sentry::getUser()->id;
|
||||
$logaction->note = e(Input::get('note'));
|
||||
$log = $logaction->logaction('checkout');
|
||||
}
|
||||
|
||||
// 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
|
||||
return Redirect::to('assets/create')->with('error', Lang::get('admin/hardware/message.create.error'));
|
||||
@@ -175,22 +232,24 @@ class AssetsController extends AdminController {
|
||||
public function getEdit($assetId = null)
|
||||
{
|
||||
// Check if the asset exists
|
||||
if (is_null($asset = Asset::find($assetId)))
|
||||
{
|
||||
if (is_null($asset = Asset::find($assetId))) {
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
|
||||
}
|
||||
|
||||
|
||||
// Grab the dropdown list of models
|
||||
$model_list = array('' => '') + Model::lists('name', 'id');
|
||||
$model_list = array('' => '') + DB::table('models')
|
||||
->select(DB::raw('concat(name," / ",modelno) as name, id'))->orderBy('name', 'asc')
|
||||
->orderBy('modelno', '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('' => 'Pending') + array('0' => 'Ready to Deploy') + Statuslabel::lists('name', 'id');
|
||||
$statuslabel_list = Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
|
||||
|
||||
// get depreciation list
|
||||
$depreciation_list = array('' => '') + Depreciation::lists('name', 'id');
|
||||
|
||||
return View::make('backend/hardware/edit', compact('asset'))->with('model_list',$model_list)->with('depreciation_list',$depreciation_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);
|
||||
}
|
||||
|
||||
|
||||
@@ -203,34 +262,24 @@ class AssetsController extends AdminController {
|
||||
public function postEdit($assetId = null)
|
||||
{
|
||||
// Check if the asset exists
|
||||
if (is_null($asset = Asset::find($assetId)))
|
||||
{
|
||||
if (is_null($asset = Asset::find($assetId))) {
|
||||
// Redirect to the asset management page with error
|
||||
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' => 'required|min:3',
|
||||
'asset_tag' => 'required|alpha_space|min:3',
|
||||
'model_id' => 'required',
|
||||
'serial' => 'required|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);
|
||||
// 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'));
|
||||
@@ -245,7 +294,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')) == '') {
|
||||
@@ -254,6 +303,23 @@ 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'));
|
||||
@@ -263,12 +329,17 @@ class AssetsController extends AdminController {
|
||||
$asset->asset_tag = e(Input::get('asset_tag'));
|
||||
$asset->notes = e(Input::get('notes'));
|
||||
$asset->physical = '1';
|
||||
$asset->mac_address = e(Input::get('mac_address'));
|
||||
|
||||
// Was the asset updated?
|
||||
if($asset->save())
|
||||
{
|
||||
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'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -286,8 +357,7 @@ class AssetsController extends AdminController {
|
||||
public function getDelete($assetId)
|
||||
{
|
||||
// Check if the asset exists
|
||||
if (is_null($asset = Asset::find($assetId)))
|
||||
{
|
||||
if (is_null($asset = Asset::find($assetId))) {
|
||||
// Redirect to the asset management page with error
|
||||
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.not_found'));
|
||||
}
|
||||
@@ -297,6 +367,12 @@ class AssetsController extends AdminController {
|
||||
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.assoc_users'));
|
||||
} else {
|
||||
// Delete the asset
|
||||
|
||||
DB::table('assets')
|
||||
->where('id', $asset->id)
|
||||
->update(array('assigned_to' => NULL));
|
||||
|
||||
|
||||
$asset->delete();
|
||||
|
||||
// Redirect to the asset management page
|
||||
@@ -313,16 +389,14 @@ class AssetsController extends AdminController {
|
||||
public function getCheckout($assetId)
|
||||
{
|
||||
// Check if the asset exists
|
||||
if (is_null($asset = Asset::find($assetId)))
|
||||
{
|
||||
if (is_null($asset = Asset::find($assetId))) {
|
||||
// Redirect to the asset management page with error
|
||||
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.not_found'));
|
||||
}
|
||||
|
||||
// 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');
|
||||
$users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat(last_name,", ",first_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);
|
||||
|
||||
}
|
||||
@@ -333,8 +407,7 @@ class AssetsController extends AdminController {
|
||||
public function postCheckout($assetId)
|
||||
{
|
||||
// Check if the asset exists
|
||||
if (is_null($asset = Asset::find($assetId)))
|
||||
{
|
||||
if (is_null($asset = Asset::find($assetId))) {
|
||||
// Redirect to the asset management page with error
|
||||
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.not_found'));
|
||||
}
|
||||
@@ -352,16 +425,14 @@ class AssetsController extends AdminController {
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
// If validation fails, we'll exit the operation now.
|
||||
if ($validator->fails())
|
||||
{
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
|
||||
|
||||
// Check if the user exists
|
||||
if (is_null($assigned_to = User::find($assigned_to)))
|
||||
{
|
||||
if (is_null($user = User::find($assigned_to))) {
|
||||
// Redirect to the asset management page with error
|
||||
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.user_does_not_exist'));
|
||||
}
|
||||
@@ -370,17 +441,31 @@ class AssetsController extends AdminController {
|
||||
$asset->assigned_to = e(Input::get('assigned_to'));
|
||||
|
||||
// Was the asset updated?
|
||||
if($asset->save())
|
||||
{
|
||||
if($asset->save()) {
|
||||
$logaction = new Actionlog();
|
||||
$logaction->asset_id = $asset->id;
|
||||
$logaction->checkedout_to = $asset->assigned_to;
|
||||
$logaction->asset_type = 'hardware';
|
||||
$logaction->location_id = $assigned_to->location_id;
|
||||
$logaction->location_id = $user->location_id;
|
||||
$logaction->user_id = Sentry::getUser()->id;
|
||||
$logaction->note = e(Input::get('note'));
|
||||
$log = $logaction->logaction('checkout');
|
||||
|
||||
$data['log_id'] = $logaction->id;
|
||||
$data['eula'] = $asset->getEula();
|
||||
$data['first_name'] = $user->first_name;
|
||||
$data['item_name'] = $asset->name;
|
||||
$data['require_acceptance'] = $asset->requireAcceptance();
|
||||
|
||||
|
||||
if (($asset->requireAcceptance()=='1') || ($asset->getEula())) {
|
||||
|
||||
Mail::send('emails.accept-asset', $data, function ($m) use ($user) {
|
||||
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
|
||||
$m->subject('Confirm asset delivery');
|
||||
});
|
||||
}
|
||||
|
||||
// Redirect to the new asset page
|
||||
return Redirect::to("hardware")->with('success', Lang::get('admin/hardware/message.checkout.success'));
|
||||
}
|
||||
@@ -399,8 +484,7 @@ class AssetsController extends AdminController {
|
||||
public function getCheckin($assetId)
|
||||
{
|
||||
// Check if the asset exists
|
||||
if (is_null($asset = Asset::find($assetId)))
|
||||
{
|
||||
if (is_null($asset = Asset::find($assetId))) {
|
||||
// Redirect to the asset management page with error
|
||||
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.not_found'));
|
||||
}
|
||||
@@ -418,8 +502,7 @@ class AssetsController extends AdminController {
|
||||
public function postCheckin($assetId)
|
||||
{
|
||||
// Check if the asset exists
|
||||
if (is_null($asset = Asset::find($assetId)))
|
||||
{
|
||||
if (is_null($asset = Asset::find($assetId))) {
|
||||
// Redirect to the asset management page with error
|
||||
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.not_found'));
|
||||
}
|
||||
@@ -432,11 +515,10 @@ class AssetsController extends AdminController {
|
||||
$logaction->checkedout_to = $asset->assigned_to;
|
||||
|
||||
// Update the asset data to null, since it's being checked in
|
||||
$asset->assigned_to = '0';
|
||||
$asset->assigned_to = NULL;
|
||||
|
||||
// Was the asset updated?
|
||||
if($asset->save())
|
||||
{
|
||||
if($asset->save()) {
|
||||
|
||||
$logaction->asset_id = $asset->id;
|
||||
$logaction->location_id = NULL;
|
||||
@@ -462,20 +544,62 @@ class AssetsController extends AdminController {
|
||||
**/
|
||||
public function getView($assetId = null)
|
||||
{
|
||||
$asset = Asset::find($assetId);
|
||||
$asset = Asset::withTrashed()->find($assetId);
|
||||
|
||||
if (isset($asset->id)) {
|
||||
return View::make('backend/hardware/view', compact('asset'));
|
||||
|
||||
$settings = Setting::getSettings();
|
||||
|
||||
$qr_code = (object) array(
|
||||
'display' => $settings->qr_code == '1',
|
||||
'url' => route('qr_code/hardware', $asset->id)
|
||||
);
|
||||
|
||||
return View::make('backend/hardware/view', compact('asset', 'qr_code'));
|
||||
} else {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/hardware/message.does_not_exist', compact('id' ));
|
||||
$error = Lang::get('admin/hardware/message.does_not_exist', compact('id'));
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('assets')->with('error', $error);
|
||||
return Redirect::route('hardware')->with('error', $error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the QR code representing the asset
|
||||
*
|
||||
* @param int $assetId
|
||||
* @return View
|
||||
**/
|
||||
public function getQrCode($assetId = null)
|
||||
{
|
||||
$settings = Setting::getSettings();
|
||||
|
||||
if ($settings->qr_code == '1') {
|
||||
$asset = Asset::find($assetId);
|
||||
|
||||
if (isset($asset->id,$asset->asset_tag)) {
|
||||
|
||||
$content = DNS2D::getBarcodePNG(route('view/hardware', $asset->id), "QRCODE",
|
||||
$this->qrCodeDimensions['height'],$this->qrCodeDimensions['width']);
|
||||
|
||||
$img = imagecreatefromstring(base64_decode($content));
|
||||
imagepng($img);
|
||||
imagedestroy($img);
|
||||
|
||||
$content_disposition = sprintf('attachment;filename=qr_code_%s.png', preg_replace('/\W/', '', $asset->asset_tag));
|
||||
$response = Response::make($content, 200);
|
||||
$response->header('Content-Type', 'image/png');
|
||||
$response->header('Content-Disposition', $content_disposition);
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
$response = Response::make('', 404);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Asset update.
|
||||
*
|
||||
@@ -485,8 +609,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'));
|
||||
}
|
||||
@@ -495,13 +618,269 @@ class AssetsController extends AdminController {
|
||||
$model_list = array('' => '') + Model::lists('name', 'id');
|
||||
|
||||
// Grab the dropdown list of status
|
||||
$statuslabel_list = array('' => 'Pending') + array('0' => 'Ready to Deploy') + Statuslabel::lists('name', 'id');
|
||||
$statuslabel_list = 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);
|
||||
}
|
||||
|
||||
|
||||
public function getRestore($assetId = null)
|
||||
{
|
||||
|
||||
// Get user information
|
||||
$asset = Asset::withTrashed()->find($assetId);
|
||||
|
||||
if (isset($asset->id)) {
|
||||
|
||||
// Restore the user
|
||||
$asset->restore();
|
||||
|
||||
// Prepare the success message
|
||||
$success = Lang::get('admin/hardware/message.restore.success');
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('hardware')->with('success', $success);
|
||||
|
||||
} else {
|
||||
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.not_found'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Upload the file to the server
|
||||
*
|
||||
* @param int $assetId
|
||||
* @return View
|
||||
**/
|
||||
public function postUpload($assetID = null)
|
||||
{
|
||||
$asset = Asset::find($assetID);
|
||||
|
||||
// the asset is valid
|
||||
$destinationPath = app_path().'/private_uploads';
|
||||
|
||||
if (isset($asset->id)) {
|
||||
|
||||
if (Input::hasFile('assetfile')) {
|
||||
|
||||
foreach(Input::file('assetfile') as $file) {
|
||||
|
||||
$rules = array(
|
||||
'assetfile' => 'required|mimes:png,gif,jpg,jpeg,doc,docx,pdf,txt|max:2000'
|
||||
);
|
||||
$validator = Validator::make(array('assetfile'=> $file), $rules);
|
||||
|
||||
if($validator->passes()){
|
||||
|
||||
$extension = $file->getClientOriginalExtension();
|
||||
$filename = 'hardware-'.$asset->id.'-'.str_random(8);
|
||||
$filename .= '-'.Str::slug($file->getClientOriginalName()).'.'.$extension;
|
||||
$upload_success = $file->move($destinationPath, $filename);
|
||||
|
||||
//Log the deletion of seats to the log
|
||||
$logaction = new Actionlog();
|
||||
$logaction->asset_id = $asset->id;
|
||||
$logaction->asset_type = 'hardware';
|
||||
$logaction->user_id = Sentry::getUser()->id;
|
||||
$logaction->note = e(Input::get('notes'));
|
||||
$logaction->checkedout_to = NULL;
|
||||
$logaction->created_at = date("Y-m-d h:i:s");
|
||||
$logaction->filename = $filename;
|
||||
$log = $logaction->logaction('uploaded');
|
||||
} else {
|
||||
return Redirect::back()->with('error', Lang::get('admin/hardware/message.upload.invalidfiles'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ($upload_success) {
|
||||
return Redirect::back()->with('success', Lang::get('admin/hardware/message.upload.success'));
|
||||
} else {
|
||||
return Redirect::back()->with('success', Lang::get('admin/hardware/message.upload.error'));
|
||||
}
|
||||
|
||||
} else {
|
||||
return Redirect::back()->with('success', Lang::get('admin/hardware/message.upload.nofiles'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/hardware/message.does_not_exist', compact('id'));
|
||||
|
||||
// Redirect to the hardware management page
|
||||
return Redirect::route('hardware')->with('error', $error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete the associated file
|
||||
*
|
||||
* @param int $assetId
|
||||
* @return View
|
||||
**/
|
||||
public function getDeleteFile($assetID = null, $fileId = null)
|
||||
{
|
||||
$asset = Asset::find($assetID);
|
||||
$destinationPath = app_path().'/private_uploads';
|
||||
|
||||
// the asset is valid
|
||||
if (isset($asset->id)) {
|
||||
|
||||
$log = Actionlog::find($fileId);
|
||||
$full_filename = $destinationPath.'/'.$log->filename;
|
||||
if (file_exists($full_filename)) {
|
||||
unlink($destinationPath.'/'.$log->filename);
|
||||
}
|
||||
$log->delete();
|
||||
return Redirect::back()->with('success', Lang::get('admin/hardware/message.deletefile.success'));
|
||||
|
||||
} else {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/hardware/message.does_not_exist', compact('id'));
|
||||
|
||||
// Redirect to the hardware management page
|
||||
return Redirect::route('hardware')->with('error', $error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Display/download the uploaded file
|
||||
*
|
||||
* @param int $assetId
|
||||
* @return View
|
||||
**/
|
||||
public function displayFile($assetID = null, $fileId = null)
|
||||
{
|
||||
|
||||
$asset = Asset::find($assetID);
|
||||
|
||||
// the asset is valid
|
||||
if (isset($asset->id)) {
|
||||
$log = Actionlog::find($fileId);
|
||||
$file = $log->get_src();
|
||||
return Response::download($file);
|
||||
} else {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/hardware/message.does_not_exist', compact('id'));
|
||||
|
||||
// Redirect to the hardware management page
|
||||
return Redirect::route('hardware')->with('error', $error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Display bulk edit screen
|
||||
*
|
||||
* @return View
|
||||
**/
|
||||
public function postBulkEdit($assets = null)
|
||||
{
|
||||
|
||||
if (Input::has('edit_asset')) {
|
||||
|
||||
$assets = Input::get('edit_asset');
|
||||
|
||||
$supplier_list = array('' => '') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
|
||||
$statuslabel_list = array('' => '') + Statuslabel::lists('name', 'id');
|
||||
$location_list = array('' => '') + Location::lists('name', 'id');
|
||||
}
|
||||
|
||||
return View::make('backend/hardware/bulk')->with('assets',$assets)->with('supplier_list',$supplier_list)->with('statuslabel_list',$statuslabel_list)->with('location_list',$location_list);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Save bulk edits
|
||||
*
|
||||
* @return View
|
||||
**/
|
||||
public function postBulkSave($assets = null)
|
||||
{
|
||||
|
||||
if (Input::has('bulk_edit')) {
|
||||
|
||||
$assets = Input::get('bulk_edit');
|
||||
|
||||
if ( (Input::has('purchase_date')) || (Input::has('rtd_location_id')) || (Input::has('status_id')) ) {
|
||||
|
||||
foreach ($assets as $key => $value) {
|
||||
|
||||
$update_array = array();
|
||||
|
||||
if (Input::has('purchase_date')) {
|
||||
$update_array['purchase_date'] = e(Input::get('purchase_date'));
|
||||
}
|
||||
|
||||
if (Input::has('rtd_location_id')) {
|
||||
$update_array['rtd_location_id'] = e(Input::get('rtd_location_id'));
|
||||
}
|
||||
|
||||
if (Input::has('status_id')) {
|
||||
$update_array['status_id'] = e(Input::get('status_id'));
|
||||
}
|
||||
|
||||
|
||||
if (DB::table('assets')
|
||||
->where('id', $key)
|
||||
->update($update_array)) {
|
||||
|
||||
$logaction = new Actionlog();
|
||||
$logaction->asset_id = $key;
|
||||
$logaction->asset_type = 'hardware';
|
||||
$logaction->created_at = date("Y-m-d h:i:s");
|
||||
|
||||
if (Input::has('rtd_location_id')) {
|
||||
$logaction->location_id = e(Input::get('rtd_location_id'));
|
||||
}
|
||||
$logaction->user_id = Sentry::getUser()->id;
|
||||
$log = $logaction->logaction('update');
|
||||
|
||||
}
|
||||
|
||||
} // endforeach
|
||||
|
||||
return Redirect::to("hardware")->with('success', Lang::get('admin/hardware/message.update.success'));
|
||||
|
||||
// no values given, nothing to update
|
||||
} else {
|
||||
return Redirect::to("hardware")->with('info',Lang::get('admin/hardware/message.update.nothing_updated'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
} // endif
|
||||
|
||||
return Redirect::to("hardware");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
101
app/controllers/admin/CategoriesController.php
Normal file → Executable file
101
app/controllers/admin/CategoriesController.php
Normal file → Executable file
@@ -12,8 +12,8 @@ use Str;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class CategoriesController extends AdminController {
|
||||
|
||||
class CategoriesController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Show a list of all the categories.
|
||||
*
|
||||
@@ -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'));
|
||||
@@ -38,7 +38,9 @@ class CategoriesController extends AdminController {
|
||||
public function getCreate()
|
||||
{
|
||||
// Show the page
|
||||
return View::make('backend/categories/edit')->with('category',new Category);
|
||||
$category_types= array('' => '', 'asset' => 'Asset', 'accessory' => 'Accessory');
|
||||
return View::make('backend/categories/edit')->with('category',new Category)
|
||||
->with('category_types',$category_types);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,33 +52,32 @@ class CategoriesController extends AdminController {
|
||||
public function postCreate()
|
||||
{
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
// create a new model instance
|
||||
$category = new Category();
|
||||
|
||||
// attempt validation
|
||||
if ($category->validate($new))
|
||||
$validator = Validator::make(Input::all(), $category->rules);
|
||||
|
||||
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'));
|
||||
$category->category_type = e(Input::get('category_type'));
|
||||
$category->eula_text = e(Input::get('eula_text'));
|
||||
$category->use_default_eula = e(Input::get('use_default_eula', '0'));
|
||||
$category->require_acceptance = e(Input::get('require_acceptance', '0'));
|
||||
$category->user_id = Sentry::getId();
|
||||
|
||||
// Was the asset created?
|
||||
if($category->save())
|
||||
{
|
||||
if($category->save()) {
|
||||
// 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'));
|
||||
@@ -93,8 +94,7 @@ class CategoriesController extends AdminController {
|
||||
public function getEdit($categoryId = null)
|
||||
{
|
||||
// Check if the category exists
|
||||
if (is_null($category = Category::find($categoryId)))
|
||||
{
|
||||
if (is_null($category = Category::find($categoryId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/settings/categories')->with('error', Lang::get('admin/categories/message.does_not_exist'));
|
||||
}
|
||||
@@ -103,7 +103,11 @@ class CategoriesController extends AdminController {
|
||||
//$category_options = array('' => 'Top Level') + Category::lists('name', 'id');
|
||||
|
||||
$category_options = array('' => 'Top Level') + DB::table('categories')->where('id', '!=', $categoryId)->lists('name', 'id');
|
||||
return View::make('backend/categories/edit', compact('category'))->with('category_options',$category_options);
|
||||
$category_types= array('' => '', 'asset' => 'Asset', 'accessory' => 'Accessory');
|
||||
|
||||
return View::make('backend/categories/edit', compact('category'))
|
||||
->with('category_options',$category_options)
|
||||
->with('category_types',$category_types);
|
||||
}
|
||||
|
||||
|
||||
@@ -116,8 +120,7 @@ class CategoriesController extends AdminController {
|
||||
public function postEdit($categoryId = null)
|
||||
{
|
||||
// Check if the blog post exists
|
||||
if (is_null($category = Category::find($categoryId)))
|
||||
{
|
||||
if (is_null($category = Category::find($categoryId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/categories')->with('error', Lang::get('admin/categories/message.does_not_exist'));
|
||||
}
|
||||
@@ -127,25 +130,30 @@ class CategoriesController extends AdminController {
|
||||
$new = Input::all();
|
||||
|
||||
// attempt validation
|
||||
if ($category->validate($new))
|
||||
$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
|
||||
else {
|
||||
|
||||
// Update the category data
|
||||
$category->name = e(Input::get('name'));
|
||||
$category->category_type = e(Input::get('category_type'));
|
||||
$category->eula_text = e(Input::get('eula_text'));
|
||||
$category->use_default_eula = e(Input::get('use_default_eula', '0'));
|
||||
$category->require_acceptance = e(Input::get('require_acceptance', '0'));
|
||||
|
||||
// Was the asset created?
|
||||
if($category->save())
|
||||
{
|
||||
if($category->save()) {
|
||||
// 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'));
|
||||
@@ -160,9 +168,8 @@ class CategoriesController extends AdminController {
|
||||
*/
|
||||
public function getDelete($categoryId)
|
||||
{
|
||||
// Check if the blog post exists
|
||||
if (is_null($category = Category::find($categoryId)))
|
||||
{
|
||||
// Check if the category exists
|
||||
if (is_null($category = Category::find($categoryId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/settings/categories')->with('error', Lang::get('admin/categories/message.not_found'));
|
||||
}
|
||||
@@ -185,4 +192,30 @@ class CategoriesController extends AdminController {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get the asset information to present to the category view page
|
||||
*
|
||||
* @param int $assetId
|
||||
* @return View
|
||||
**/
|
||||
public function getView($categoryID = null)
|
||||
{
|
||||
$category = Category::find($categoryID);
|
||||
|
||||
if (isset($category->id)) {
|
||||
return View::make('backend/categories/view', compact('category'));
|
||||
} else {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/categories/message.does_not_exist', compact('id'));
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('categories')->with('error', $error);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
|
||||
use AdminController;
|
||||
use View;
|
||||
use Asset;
|
||||
use Actionlog;
|
||||
|
||||
class DashboardController extends AdminController {
|
||||
|
||||
class DashboardController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Show the administration dashboard page.
|
||||
*
|
||||
@@ -13,7 +15,57 @@ class DashboardController extends AdminController {
|
||||
public function getIndex()
|
||||
{
|
||||
// Show the page
|
||||
return View::make('backend/dashboard');
|
||||
|
||||
$recent_activity = Actionlog::orderBy('created_at','DESC')->take(7)->get();
|
||||
|
||||
|
||||
$asset_stats['total'] = Asset::Hardware()->count();
|
||||
|
||||
$asset_stats['rtd']['total'] = Asset::Hardware()->RTD()->count();
|
||||
|
||||
if ($asset_stats['rtd']['total'] > 0) {
|
||||
$asset_stats['rtd']['percent'] = round(($asset_stats['rtd']['total']/$asset_stats['total']) * 100);
|
||||
} else {
|
||||
$asset_stats['rtd']['percent'] = 0;
|
||||
}
|
||||
|
||||
|
||||
$asset_stats['pending']['total'] = Asset::Hardware()->Pending()->count();
|
||||
|
||||
if ($asset_stats['pending']['total'] > 0) {
|
||||
$asset_stats['pending']['percent'] = round(($asset_stats['pending']['total']/$asset_stats['total']) * 100);
|
||||
} else {
|
||||
$asset_stats['pending']['percent'] = 0;
|
||||
}
|
||||
|
||||
|
||||
$asset_stats['deployed']['total'] = Asset::Hardware()->Deployed()->count();
|
||||
|
||||
if ($asset_stats['deployed']['total'] > 0) {
|
||||
$asset_stats['deployed']['percent'] = round(($asset_stats['deployed']['total']/$asset_stats['total']) * 100);
|
||||
} else {
|
||||
$asset_stats['deployed']['percent'] = 0;
|
||||
}
|
||||
|
||||
|
||||
$asset_stats['undeployable']['total'] = Asset::Hardware()->Undeployable()->count();
|
||||
|
||||
if ($asset_stats['undeployable']['total'] > 0) {
|
||||
$asset_stats['undeployable']['percent'] = round(($asset_stats['undeployable']['total']/$asset_stats['total']) * 100);
|
||||
} else {
|
||||
$asset_stats['undeployable']['percent'] = 0;
|
||||
}
|
||||
|
||||
$asset_stats['archived']['total'] = Asset::Hardware()->Archived()->count();
|
||||
|
||||
if ($asset_stats['archived']['total'] > 0) {
|
||||
$asset_stats['archived']['percent'] = round(($asset_stats['archived']['total']/$asset_stats['total']) * 100);
|
||||
} else {
|
||||
$asset_stats['archived']['percent'] = 0;
|
||||
}
|
||||
|
||||
|
||||
return View::make('backend/dashboard')->with('asset_stats',$asset_stats)->with('recent_activity',$recent_activity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
50
app/controllers/admin/DepreciationsController.php
Normal file → Executable file
50
app/controllers/admin/DepreciationsController.php
Normal file → Executable file
@@ -12,8 +12,8 @@ use Str;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class DepreciationsController extends AdminController {
|
||||
|
||||
class DepreciationsController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Show a list of all the depreciations.
|
||||
*
|
||||
@@ -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'));
|
||||
@@ -58,8 +58,7 @@ class DepreciationsController extends AdminController {
|
||||
$depreciation = new Depreciation();
|
||||
|
||||
// attempt validation
|
||||
if ($depreciation->validate($new))
|
||||
{
|
||||
if ($depreciation->validate($new)) {
|
||||
|
||||
// Depreciation data
|
||||
$depreciation->name = e(Input::get('name'));
|
||||
@@ -67,14 +66,11 @@ class DepreciationsController extends AdminController {
|
||||
$depreciation->user_id = Sentry::getId();
|
||||
|
||||
// Was the asset created?
|
||||
if($depreciation->save())
|
||||
{
|
||||
if($depreciation->save()) {
|
||||
// Redirect to the new depreciation page
|
||||
return Redirect::to("admin/settings/depreciations")->with('success', Lang::get('admin/depreciations/message.create.success'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// failure
|
||||
$errors = $depreciation->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
@@ -94,8 +90,7 @@ class DepreciationsController extends AdminController {
|
||||
public function getEdit($depreciationId = null)
|
||||
{
|
||||
// Check if the depreciation exists
|
||||
if (is_null($depreciation = Depreciation::find($depreciationId)))
|
||||
{
|
||||
if (is_null($depreciation = Depreciation::find($depreciationId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/settings/depreciations')->with('error', Lang::get('admin/depreciations/message.does_not_exist'));
|
||||
}
|
||||
@@ -117,38 +112,32 @@ class DepreciationsController extends AdminController {
|
||||
public function postEdit($depreciationId = null)
|
||||
{
|
||||
// Check if the depreciation exists
|
||||
if (is_null($depreciation = Depreciation::find($depreciationId)))
|
||||
{
|
||||
if (is_null($depreciation = Depreciation::find($depreciationId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/settings/depreciations')->with('error', Lang::get('admin/depreciations/message.does_not_exist'));
|
||||
}
|
||||
|
||||
|
||||
//attempt to validate
|
||||
$validator = Validator::make(Input::all(), $depreciation->validationRules($depreciationId));
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
// attempt validation
|
||||
if ($depreciation->validate($new))
|
||||
if ($validator->fails())
|
||||
{
|
||||
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
else {
|
||||
// Depreciation data
|
||||
$depreciation->name = e(Input::get('name'));
|
||||
$depreciation->months = e(Input::get('months'));
|
||||
|
||||
// Was the asset created?
|
||||
if($depreciation->save())
|
||||
{
|
||||
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'));
|
||||
@@ -165,8 +154,7 @@ class DepreciationsController extends AdminController {
|
||||
public function getDelete($depreciationId)
|
||||
{
|
||||
// Check if the depreciation exists
|
||||
if (is_null($depreciation = Depreciation::find($depreciationId)))
|
||||
{
|
||||
if (is_null($depreciation = Depreciation::find($depreciationId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/settings/depreciations')->with('error', Lang::get('admin/depreciations/message.not_found'));
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ use Sentry;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class GroupsController extends AdminController {
|
||||
|
||||
class GroupsController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Show a list of all the groups.
|
||||
*
|
||||
@@ -63,14 +63,12 @@ class GroupsController extends AdminController {
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
// If validation fails, we'll exit the operation now.
|
||||
if ($validator->fails())
|
||||
{
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
// We need to reverse the UI specific logic for our
|
||||
// permissions here before we create the user.
|
||||
$permissions = Input::get('permissions', array());
|
||||
@@ -81,21 +79,16 @@ class GroupsController extends AdminController {
|
||||
$inputs = Input::except('_token');
|
||||
|
||||
// Was the group created?
|
||||
if ($group = Sentry::getGroupProvider()->create($inputs))
|
||||
{
|
||||
if ($group = Sentry::getGroupProvider()->create($inputs)) {
|
||||
// Redirect to the new group page
|
||||
return Redirect::route('update/group', $group->id)->with('success', Lang::get('admin/groups/message.success.create'));
|
||||
}
|
||||
|
||||
// Redirect to the new group page
|
||||
return Redirect::route('create/group')->with('error', Lang::get('admin/groups/message.error.create'));
|
||||
}
|
||||
catch (NameRequiredException $e)
|
||||
{
|
||||
} catch (NameRequiredException $e) {
|
||||
$error = 'group_name_required';
|
||||
}
|
||||
catch (GroupExistsException $e)
|
||||
{
|
||||
} catch (GroupExistsException $e) {
|
||||
$error = 'group_exists';
|
||||
}
|
||||
|
||||
@@ -111,8 +104,7 @@ class GroupsController extends AdminController {
|
||||
*/
|
||||
public function getEdit($id = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
try {
|
||||
// Get the group information
|
||||
$group = Sentry::getGroupProvider()->findById($id);
|
||||
|
||||
@@ -124,9 +116,7 @@ class GroupsController extends AdminController {
|
||||
$groupPermissions = $group->getPermissions();
|
||||
$this->encodePermissions($groupPermissions);
|
||||
$groupPermissions = array_merge($groupPermissions, Input::old('permissions', array()));
|
||||
}
|
||||
catch (GroupNotFoundException $e)
|
||||
{
|
||||
} catch (GroupNotFoundException $e) {
|
||||
// Redirect to the groups management page
|
||||
return Redirect::route('groups')->with('error', Lang::get('admin/groups/message.group_not_found', compact('id')));
|
||||
}
|
||||
@@ -149,13 +139,10 @@ class GroupsController extends AdminController {
|
||||
$this->decodePermissions($permissions);
|
||||
app('request')->request->set('permissions', $permissions);
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
// Get the group information
|
||||
$group = Sentry::getGroupProvider()->findById($id);
|
||||
}
|
||||
catch (GroupNotFoundException $e)
|
||||
{
|
||||
} catch (GroupNotFoundException $e) {
|
||||
// Redirect to the groups management page
|
||||
return Rediret::route('groups')->with('error', Lang::get('admin/groups/message.group_not_found', compact('id')));
|
||||
}
|
||||
@@ -169,32 +156,25 @@ class GroupsController extends AdminController {
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
// If validation fails, we'll exit the operation now.
|
||||
if ($validator->fails())
|
||||
{
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
// Update the group data
|
||||
$group->name = Input::get('name');
|
||||
$group->permissions = Input::get('permissions');
|
||||
|
||||
// Was the group updated?
|
||||
if ($group->save())
|
||||
{
|
||||
if ($group->save()) {
|
||||
// Redirect to the group page
|
||||
return Redirect::route('update/group', $id)->with('success', Lang::get('admin/groups/message.success.update'));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// Redirect to the group page
|
||||
return Redirect::route('update/group', $id)->with('error', Lang::get('admin/groups/message.error.update'));
|
||||
}
|
||||
}
|
||||
catch (NameRequiredException $e)
|
||||
{
|
||||
} catch (NameRequiredException $e) {
|
||||
$error = Lang::get('admin/group/message.group_name_required');
|
||||
}
|
||||
|
||||
@@ -210,8 +190,7 @@ class GroupsController extends AdminController {
|
||||
*/
|
||||
public function getDelete($id = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
try {
|
||||
// Get group information
|
||||
$group = Sentry::getGroupProvider()->findById($id);
|
||||
|
||||
@@ -220,9 +199,7 @@ class GroupsController extends AdminController {
|
||||
|
||||
// Redirect to the group management page
|
||||
return Redirect::route('groups')->with('success', Lang::get('admin/groups/message.success.delete'));
|
||||
}
|
||||
catch (GroupNotFoundException $e)
|
||||
{
|
||||
} catch (GroupNotFoundException $e) {
|
||||
// Redirect to the group management page
|
||||
return Redirect::route('groups')->with('error', Lang::get('admin/groups/message.group_not_found', compact('id')));
|
||||
}
|
||||
|
||||
502
app/controllers/admin/LicensesController.php
Normal file → Executable file
502
app/controllers/admin/LicensesController.php
Normal file → Executable file
@@ -1,5 +1,6 @@
|
||||
<?php namespace Controllers\Admin;
|
||||
|
||||
use Assets;
|
||||
use AdminController;
|
||||
use Input;
|
||||
use Lang;
|
||||
@@ -14,21 +15,26 @@ use Depreciation;
|
||||
use Setting;
|
||||
use Sentry;
|
||||
use Str;
|
||||
use Supplier;
|
||||
use Validator;
|
||||
use View;
|
||||
use Response;
|
||||
|
||||
class LicensesController extends AdminController {
|
||||
|
||||
class LicensesController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Show a list of all the licenses.
|
||||
*
|
||||
* @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'));
|
||||
@@ -45,8 +51,15 @@ class LicensesController extends AdminController {
|
||||
// Show the page
|
||||
$license_options = array('0' => 'Top Level') + License::lists('name', 'id');
|
||||
// Show the page
|
||||
$depreciation_list = array('0' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
|
||||
return View::make('backend/licenses/edit')->with('license_options',$license_options)->with('depreciation_list',$depreciation_list)->with('license',new License);
|
||||
$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');
|
||||
$maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No');
|
||||
return View::make('backend/licenses/edit')
|
||||
->with('license_options',$license_options)
|
||||
->with('depreciation_list',$depreciation_list)
|
||||
->with('supplier_list',$supplier_list)
|
||||
->with('maintained_list',$maintained_list)
|
||||
->with('license',new License);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,8 +79,32 @@ class LicensesController extends AdminController {
|
||||
$license = new License();
|
||||
|
||||
// attempt validation
|
||||
if ($license->validate($new))
|
||||
{
|
||||
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'));
|
||||
}
|
||||
|
||||
if ( e(Input::get('maintained')) == '') {
|
||||
$license->maintained = 0;
|
||||
} else {
|
||||
$license->maintained = e(Input::get('maintained'));
|
||||
}
|
||||
|
||||
if ( e(Input::get('purchase_order')) == '') {
|
||||
$license->purchase_order = '';
|
||||
} else {
|
||||
$license->purchase_order = e(Input::get('purchase_order'));
|
||||
}
|
||||
|
||||
// Save the license data
|
||||
$license->name = e(Input::get('name'));
|
||||
@@ -78,22 +115,33 @@ class LicensesController extends AdminController {
|
||||
$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->purchase_order = e(Input::get('purchase_order'));
|
||||
$license->depreciation_id = e(Input::get('depreciation_id'));
|
||||
$license->expiration_date = e(Input::get('expiration_date'));
|
||||
$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;
|
||||
}
|
||||
|
||||
// Was the license created?
|
||||
if($license->save())
|
||||
{
|
||||
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 = NULL;
|
||||
$license_seat->notes = NULL;
|
||||
$license_seat->save();
|
||||
}
|
||||
|
||||
@@ -101,9 +149,7 @@ class LicensesController extends AdminController {
|
||||
// Redirect to the new license page
|
||||
return Redirect::to("admin/licenses")->with('success', Lang::get('admin/licenses/message.create.success'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// failure
|
||||
$errors = $license->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
@@ -123,16 +169,29 @@ class LicensesController extends AdminController {
|
||||
public function getEdit($licenseId = null)
|
||||
{
|
||||
// Check if the license exists
|
||||
if (is_null($license = License::find($licenseId)))
|
||||
{
|
||||
if (is_null($license = License::find($licenseId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.does_not_exist'));
|
||||
}
|
||||
|
||||
if ($license->purchase_date == "0000-00-00") {
|
||||
$license->purchase_date = NULL;
|
||||
}
|
||||
|
||||
if ($license->purchase_cost == "0.00") {
|
||||
$license->purchase_cost = NULL;
|
||||
}
|
||||
|
||||
// Show the page
|
||||
$license_options = array('' => 'Top Level') + DB::table('assets')->where('id', '!=', $licenseId)->lists('name', 'id');
|
||||
$depreciation_list = array('0' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
|
||||
return View::make('backend/licenses/edit', compact('license'))->with('license_options',$license_options)->with('depreciation_list',$depreciation_list);
|
||||
$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');
|
||||
$maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No');
|
||||
return View::make('backend/licenses/edit', compact('license'))
|
||||
->with('license_options',$license_options)
|
||||
->with('depreciation_list',$depreciation_list)
|
||||
->with('supplier_list',$supplier_list)
|
||||
->with('maintained_list',$maintained_list);
|
||||
}
|
||||
|
||||
|
||||
@@ -145,8 +204,7 @@ class LicensesController extends AdminController {
|
||||
public function postEdit($licenseId = null)
|
||||
{
|
||||
// Check if the license exists
|
||||
if (is_null($license = License::find($licenseId)))
|
||||
{
|
||||
if (is_null($license = License::find($licenseId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.does_not_exist'));
|
||||
}
|
||||
@@ -156,9 +214,9 @@ class LicensesController extends AdminController {
|
||||
$new = Input::all();
|
||||
|
||||
|
||||
|
||||
// attempt validation
|
||||
if ($license->validate($new))
|
||||
{
|
||||
if ($license->validate($new)) {
|
||||
|
||||
// Update the license data
|
||||
$license->name = e(Input::get('name'));
|
||||
@@ -167,25 +225,123 @@ class LicensesController extends AdminController {
|
||||
$license->license_name = e(Input::get('license_name'));
|
||||
$license->notes = e(Input::get('notes'));
|
||||
$license->order_number = e(Input::get('order_number'));
|
||||
$license->purchase_date = e(Input::get('purchase_date'));
|
||||
$license->purchase_cost = e(Input::get('purchase_cost'));
|
||||
$license->depreciation_id = e(Input::get('depreciation_id'));
|
||||
$license->purchase_order = e(Input::get('purchase_order'));
|
||||
$license->maintained = e(Input::get('maintained'));
|
||||
|
||||
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')) == '') {
|
||||
$license->purchase_date = NULL;
|
||||
} else {
|
||||
$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'));
|
||||
}
|
||||
|
||||
// Update the asset data
|
||||
if ( e(Input::get('termination_date')) == '') {
|
||||
$license->termination_date = NULL;
|
||||
} else {
|
||||
$license->termination_date = e(Input::get('termination_date'));
|
||||
}
|
||||
|
||||
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('maintained')) == '') {
|
||||
$license->maintained = 0;
|
||||
} else {
|
||||
$license->maintained = e(Input::get('maintained'));
|
||||
}
|
||||
|
||||
if ( e(Input::get('purchase_order')) == '') {
|
||||
$license->purchase_order = '';
|
||||
} else {
|
||||
$license->purchase_order = e(Input::get('purchase_order'));
|
||||
}
|
||||
|
||||
|
||||
//Are we changing the total number of seats?
|
||||
if( $license->seats != e(Input::get('seats'))) {
|
||||
//Determine how many seats we are dealing with
|
||||
$difference = e(Input::get('seats')) - $license->licenseseats()->count();
|
||||
|
||||
if( $difference < 0 ) {
|
||||
//Filter out any license which have a user attached;
|
||||
$seats = $license->licenseseats->filter(function ($seat) {
|
||||
return is_null($seat->user);
|
||||
});
|
||||
|
||||
|
||||
//If the remaining collection is as large or larger than the number of seats we want to delete
|
||||
if($seats->count() >= abs($difference)) {
|
||||
for ($i=1; $i <= abs($difference); $i++) {
|
||||
//Delete the appropriate number of seats
|
||||
$seats->pop()->delete();
|
||||
}
|
||||
|
||||
//Log the deletion of seats to the log
|
||||
$logaction = new Actionlog();
|
||||
$logaction->asset_id = $license->id;
|
||||
$logaction->asset_type = 'software';
|
||||
$logaction->user_id = Sentry::getUser()->id;
|
||||
$logaction->note = abs($difference)." seats";
|
||||
$logaction->checkedout_to = NULL;
|
||||
$log = $logaction->logaction('delete seats');
|
||||
|
||||
} else {
|
||||
// Redirect to the license edit page
|
||||
return Redirect::to("admin/licenses/$licenseId/edit")->with('error', Lang::get('admin/licenses/message.assoc_users'));
|
||||
}
|
||||
} else {
|
||||
|
||||
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 = NULL;
|
||||
$license_seat->notes = NULL;
|
||||
$license_seat->save();
|
||||
}
|
||||
|
||||
//Log the addition of license to the log.
|
||||
$logaction = new Actionlog();
|
||||
$logaction->asset_id = $license->id;
|
||||
$logaction->asset_type = 'software';
|
||||
$logaction->user_id = Sentry::getUser()->id;
|
||||
$logaction->note = abs($difference)." seats";
|
||||
$log = $logaction->logaction('add seats');
|
||||
}
|
||||
$license->seats = e(Input::get('seats'));
|
||||
}
|
||||
|
||||
// Was the asset created?
|
||||
if($license->save())
|
||||
{
|
||||
if($license->save()) {
|
||||
// Redirect to the new license page
|
||||
return Redirect::to("admin/licenses/$licenseId/edit")->with('success', Lang::get('admin/licenses/message.update.success'));
|
||||
return Redirect::to("admin/licenses/$licenseId/view")->with('success', Lang::get('admin/licenses/message.update.success'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// failure
|
||||
$errors = $license->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
}
|
||||
|
||||
// Redirect to the category create page
|
||||
// Redirect to the license edit page
|
||||
return Redirect::to("admin/licenses/$licenseId/edit")->with('error', Lang::get('admin/licenses/message.update.error'));
|
||||
|
||||
}
|
||||
@@ -199,8 +355,7 @@ class LicensesController extends AdminController {
|
||||
public function getDelete($licenseId)
|
||||
{
|
||||
// Check if the license exists
|
||||
if (is_null($license = License::find($licenseId)))
|
||||
{
|
||||
if (is_null($license = License::find($licenseId))) {
|
||||
// Redirect to the license management page
|
||||
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
|
||||
}
|
||||
@@ -213,11 +368,17 @@ class LicensesController extends AdminController {
|
||||
} else {
|
||||
|
||||
// Delete the license and the associated license seats
|
||||
DB::table('license_seats')
|
||||
->where('id', $license->id)
|
||||
->update(array('assigned_to' => NULL,'asset_id' => NULL));
|
||||
|
||||
$licenseseats = $license->licenseseats();
|
||||
$licenseseats->delete();
|
||||
$license->delete();
|
||||
|
||||
|
||||
|
||||
|
||||
// Redirect to the licenses management page
|
||||
return Redirect::to('admin/licenses')->with('success', Lang::get('admin/licenses/message.delete.success'));
|
||||
}
|
||||
@@ -232,17 +393,40 @@ class LicensesController extends AdminController {
|
||||
public function getCheckout($seatId)
|
||||
{
|
||||
// Check if the asset exists
|
||||
if (is_null($licenseseat = LicenseSeat::find($seatId)))
|
||||
{
|
||||
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'));
|
||||
}
|
||||
|
||||
// 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');
|
||||
$users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat(last_name,", ",first_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/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')
|
||||
->leftJoin('models', 'assets.model_id', '=', 'models.id')
|
||||
->select('assets.id', 'assets.name', 'first_name', 'last_name','asset_tag',
|
||||
DB::raw('concat (first_name," ",last_name) as full_name, assets.id as id, models.name as modelname'))
|
||||
->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'].') '.$asset_array[$x]['modelname'];
|
||||
} else {
|
||||
$full_name = ' (Unassigned) '.$asset_array[$x]['modelname'];
|
||||
}
|
||||
$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);
|
||||
|
||||
}
|
||||
|
||||
@@ -253,56 +437,93 @@ 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
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
// If validation fails, we'll exit the operation now.
|
||||
if ($validator->fails())
|
||||
{
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
|
||||
|
||||
if ($assigned_to!='') {
|
||||
// Check if the user exists
|
||||
if (is_null($assigned_to = User::find($assigned_to)))
|
||||
{
|
||||
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
|
||||
$licenseseat->assigned_to = e(Input::get('assigned_to'));
|
||||
if ( e(Input::get('assigned_to')) == '') {
|
||||
$licenseseat->assigned_to = NULL;
|
||||
|
||||
} else {
|
||||
$licenseseat->assigned_to = e(Input::get('assigned_to'));
|
||||
}
|
||||
|
||||
// Was the asset updated?
|
||||
if($licenseseat->save())
|
||||
{
|
||||
if($licenseseat->save()) {
|
||||
|
||||
$logaction = new Actionlog();
|
||||
$logaction->asset_id = $licenseseat->id;
|
||||
$logaction->checkedout_to = $licenseseat->assigned_to;
|
||||
$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'));
|
||||
$logaction->asset_id = $licenseseat->license_id;
|
||||
|
||||
|
||||
// Update the asset data
|
||||
if ( e(Input::get('assigned_to')) == '') {
|
||||
$logaction->checkedout_to = NULL;
|
||||
} else {
|
||||
$logaction->checkedout_to = e(Input::get('assigned_to'));
|
||||
}
|
||||
|
||||
$log = $logaction->logaction('checkout');
|
||||
|
||||
|
||||
// Redirect to the new asset page
|
||||
return Redirect::to("admin/licenses")->with('success', Lang::get('admin/licenses/message.checkout.success'));
|
||||
}
|
||||
@@ -318,8 +539,7 @@ class LicensesController extends AdminController {
|
||||
public function getCheckin($seatId)
|
||||
{
|
||||
// Check if the asset exists
|
||||
if (is_null($licenseseat = LicenseSeat::find($seatId)))
|
||||
{
|
||||
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'));
|
||||
}
|
||||
@@ -335,8 +555,7 @@ class LicensesController extends AdminController {
|
||||
public function postCheckin($seatId)
|
||||
{
|
||||
// Check if the asset exists
|
||||
if (is_null($licenseseat = LicenseSeat::find($seatId)))
|
||||
{
|
||||
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'));
|
||||
}
|
||||
@@ -351,8 +570,7 @@ class LicensesController extends AdminController {
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
// If validation fails, we'll exit the operation now.
|
||||
if ($validator->fails())
|
||||
{
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
@@ -361,12 +579,12 @@ class LicensesController extends AdminController {
|
||||
$logaction->checkedout_to = $licenseseat->assigned_to;
|
||||
|
||||
// Update the asset data
|
||||
$licenseseat->assigned_to = '0';
|
||||
$licenseseat->assigned_to = NULL;
|
||||
$licenseseat->asset_id = NULL;
|
||||
|
||||
// Was the asset updated?
|
||||
if($licenseseat->save())
|
||||
{
|
||||
$logaction->asset_id = $licenseseat->id;
|
||||
if($licenseseat->save()) {
|
||||
$logaction->asset_id = $licenseseat->license_id;
|
||||
$logaction->location_id = NULL;
|
||||
$logaction->asset_type = 'software';
|
||||
$logaction->note = e(Input::get('note'));
|
||||
@@ -402,5 +620,157 @@ 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');
|
||||
$maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No');
|
||||
//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)->with('maintained_list',$maintained_list);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Upload the file to the server
|
||||
*
|
||||
* @param int $assetId
|
||||
* @return View
|
||||
**/
|
||||
public function postUpload($licenseId = null)
|
||||
{
|
||||
$license = License::find($licenseId);
|
||||
|
||||
// the license is valid
|
||||
$destinationPath = app_path().'/private_uploads';
|
||||
|
||||
if (isset($license->id)) {
|
||||
|
||||
if (Input::hasFile('licensefile')) {
|
||||
|
||||
foreach(Input::file('licensefile') as $file) {
|
||||
|
||||
$rules = array(
|
||||
'licensefile' => 'required|mimes:png,gif,jpg,jpeg,doc,docx,pdf,txt|max:2000'
|
||||
);
|
||||
$validator = Validator::make(array('licensefile'=> $file), $rules);
|
||||
|
||||
if($validator->passes()){
|
||||
|
||||
$extension = $file->getClientOriginalExtension();
|
||||
$filename = 'license-'.$license->id.'-'.str_random(8);
|
||||
$filename .= '-'.Str::slug($file->getClientOriginalName()).'.'.$extension;
|
||||
$upload_success = $file->move($destinationPath, $filename);
|
||||
|
||||
//Log the deletion of seats to the log
|
||||
$logaction = new Actionlog();
|
||||
$logaction->asset_id = $license->id;
|
||||
$logaction->asset_type = 'software';
|
||||
$logaction->user_id = Sentry::getUser()->id;
|
||||
$logaction->note = e(Input::get('notes'));
|
||||
$logaction->checkedout_to = NULL;
|
||||
$logaction->created_at = date("Y-m-d h:i:s");
|
||||
$logaction->filename = $filename;
|
||||
$log = $logaction->logaction('uploaded');
|
||||
} else {
|
||||
return Redirect::back()->with('error', Lang::get('admin/licenses/message.upload.invalidfiles'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ($upload_success) {
|
||||
return Redirect::back()->with('success', Lang::get('admin/licenses/message.upload.success'));
|
||||
} else {
|
||||
return Redirect::back()->with('success', Lang::get('admin/licenses/message.upload.error'));
|
||||
}
|
||||
|
||||
} else {
|
||||
return Redirect::back()->with('success', Lang::get('admin/licenses/message.upload.nofiles'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/licenses/message.does_not_exist', compact('id'));
|
||||
|
||||
// Redirect to the licence management page
|
||||
return Redirect::route('licenses')->with('error', $error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete the associated file
|
||||
*
|
||||
* @param int $assetId
|
||||
* @return View
|
||||
**/
|
||||
public function getDeleteFile($licenseId = null, $fileId = null)
|
||||
{
|
||||
$license = License::find($licenseId);
|
||||
$destinationPath = app_path().'/private_uploads';
|
||||
|
||||
// the license is valid
|
||||
if (isset($license->id)) {
|
||||
|
||||
$log = Actionlog::find($fileId);
|
||||
$full_filename = $destinationPath.'/'.$log->filename;
|
||||
if (file_exists($full_filename)) {
|
||||
unlink($destinationPath.'/'.$log->filename);
|
||||
}
|
||||
$log->delete();
|
||||
return Redirect::back()->with('success', Lang::get('admin/licenses/message.deletefile.success'));
|
||||
|
||||
} else {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/licenses/message.does_not_exist', compact('id'));
|
||||
|
||||
// Redirect to the licence management page
|
||||
return Redirect::route('licenses')->with('error', $error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Display/download the uploaded file
|
||||
*
|
||||
* @param int $assetId
|
||||
* @return View
|
||||
**/
|
||||
public function displayFile($licenseId = null, $fileId = null)
|
||||
{
|
||||
|
||||
$license = License::find($licenseId);
|
||||
|
||||
// the license is valid
|
||||
if (isset($license->id)) {
|
||||
$log = Actionlog::find($fileId);
|
||||
$file = $log->get_src();
|
||||
return Response::download($file);
|
||||
} else {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/licenses/message.does_not_exist', compact('id'));
|
||||
|
||||
// Redirect to the licence management page
|
||||
return Redirect::route('licenses')->with('error', $error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
51
app/controllers/admin/LocationsController.php
Normal file → Executable file
51
app/controllers/admin/LocationsController.php
Normal file → Executable file
@@ -12,8 +12,8 @@ use Str;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class LocationsController extends AdminController {
|
||||
|
||||
class LocationsController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Show a list of all the locations.
|
||||
*
|
||||
@@ -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'));
|
||||
@@ -58,8 +58,7 @@ class LocationsController extends AdminController {
|
||||
$location = new Location();
|
||||
|
||||
// attempt validation
|
||||
if ($location->validate($new))
|
||||
{
|
||||
if ($location->validate($new)) {
|
||||
|
||||
// Save the location data
|
||||
$location->name = e(Input::get('name'));
|
||||
@@ -72,14 +71,11 @@ class LocationsController extends AdminController {
|
||||
$location->user_id = Sentry::getId();
|
||||
|
||||
// Was the asset created?
|
||||
if($location->save())
|
||||
{
|
||||
if($location->save()) {
|
||||
// Redirect to the new location page
|
||||
return Redirect::to("admin/settings/locations")->with('success', Lang::get('admin/locations/message.create.success'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// failure
|
||||
$errors = $location->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
@@ -100,8 +96,7 @@ class LocationsController extends AdminController {
|
||||
public function getEdit($locationId = null)
|
||||
{
|
||||
// Check if the location exists
|
||||
if (is_null($location = Location::find($locationId)))
|
||||
{
|
||||
if (is_null($location = Location::find($locationId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.does_not_exist'));
|
||||
}
|
||||
@@ -123,21 +118,21 @@ class LocationsController extends AdminController {
|
||||
public function postEdit($locationId = null)
|
||||
{
|
||||
// Check if the location exists
|
||||
if (is_null($location = Location::find($locationId)))
|
||||
{
|
||||
if (is_null($location = Location::find($locationId))) {
|
||||
// Redirect to the blogs management page
|
||||
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();
|
||||
|
||||
|
||||
// attempt validation
|
||||
if ($location->validate($new))
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
else {
|
||||
|
||||
// Update the location data
|
||||
$location->name = e(Input::get('name'));
|
||||
@@ -149,18 +144,11 @@ class LocationsController extends AdminController {
|
||||
$location->zip = e(Input::get('zip'));
|
||||
|
||||
// Was the asset created?
|
||||
if($location->save())
|
||||
{
|
||||
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'));
|
||||
@@ -176,8 +164,7 @@ class LocationsController extends AdminController {
|
||||
public function getDelete($locationId)
|
||||
{
|
||||
// Check if the location exists
|
||||
if (is_null($location = Location::find($locationId)))
|
||||
{
|
||||
if (is_null($location = Location::find($locationId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.not_found'));
|
||||
}
|
||||
|
||||
72
app/controllers/admin/ManufacturersController.php
Normal file → Executable file
72
app/controllers/admin/ManufacturersController.php
Normal file → Executable file
@@ -11,8 +11,8 @@ use Str;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class ManufacturersController extends AdminController {
|
||||
|
||||
class ManufacturersController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Show a list of all manufacturers
|
||||
*
|
||||
@@ -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'));
|
||||
@@ -54,22 +54,18 @@ class ManufacturersController extends AdminController {
|
||||
$manufacturer = new Manufacturer;
|
||||
|
||||
// attempt validation
|
||||
if ($manufacturer->validate($new))
|
||||
{
|
||||
if ($manufacturer->validate($new)) {
|
||||
|
||||
// Save the location data
|
||||
$manufacturer->name = e(Input::get('name'));
|
||||
$manufacturer->user_id = Sentry::getId();
|
||||
|
||||
// Was it created?
|
||||
if($manufacturer->save())
|
||||
{
|
||||
if($manufacturer->save()) {
|
||||
// Redirect to the new manufacturer page
|
||||
return Redirect::to("admin/settings/manufacturers")->with('success', Lang::get('admin/manufacturers/message.create.success'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// failure
|
||||
$errors = $manufacturer->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
@@ -89,8 +85,7 @@ class ManufacturersController extends AdminController {
|
||||
public function getEdit($manufacturerId = null)
|
||||
{
|
||||
// Check if the manufacturer exists
|
||||
if (is_null($manufacturer = Manufacturer::find($manufacturerId)))
|
||||
{
|
||||
if (is_null($manufacturer = Manufacturer::find($manufacturerId))) {
|
||||
// Redirect to the manufacturer page
|
||||
return Redirect::to('admin/settings/manufacturers')->with('error', Lang::get('admin/manufacturers/message.does_not_exist'));
|
||||
}
|
||||
@@ -109,36 +104,29 @@ class ManufacturersController extends AdminController {
|
||||
public function postEdit($manufacturerId = null)
|
||||
{
|
||||
// Check if the manufacturer exists
|
||||
if (is_null($manufacturer = Manufacturer::find($manufacturerId)))
|
||||
{
|
||||
if (is_null($manufacturer = Manufacturer::find($manufacturerId))) {
|
||||
// Redirect to the manufacturer page
|
||||
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();
|
||||
|
||||
// attempt validation
|
||||
if ($manufacturer->validate($new))
|
||||
if ($validator->fails())
|
||||
{
|
||||
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
else {
|
||||
// Save the data
|
||||
$manufacturer->name = e(Input::get('name'));
|
||||
|
||||
// Was it created?
|
||||
if($manufacturer->save())
|
||||
{
|
||||
if($manufacturer->save()) {
|
||||
// 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'));
|
||||
@@ -154,8 +142,7 @@ class ManufacturersController extends AdminController {
|
||||
public function getDelete($manufacturerId)
|
||||
{
|
||||
// Check if the manufacturer exists
|
||||
if (is_null($manufacturer = Manufacturer::find($manufacturerId)))
|
||||
{
|
||||
if (is_null($manufacturer = Manufacturer::find($manufacturerId))) {
|
||||
// Redirect to the manufacturers page
|
||||
return Redirect::to('admin/settings/manufacturers')->with('error', Lang::get('admin/manufacturers/message.not_found'));
|
||||
}
|
||||
@@ -182,5 +169,30 @@ class ManufacturersController extends AdminController {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get the asset information to present to the category view page
|
||||
*
|
||||
* @param int $assetId
|
||||
* @return View
|
||||
**/
|
||||
public function getView($manufacturerID = null)
|
||||
{
|
||||
$manufacturer = Manufacturer::find($manufacturerID);
|
||||
|
||||
if (isset($manufacturer->id)) {
|
||||
return View::make('backend/manufacturers/view', compact('manufacturer'));
|
||||
} else {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/manufacturers/message.does_not_exist', compact('id'));
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('manufacturers')->with('error', $error);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
159
app/controllers/admin/ModelsController.php
Normal file → Executable file
159
app/controllers/admin/ModelsController.php
Normal file → Executable file
@@ -1,6 +1,7 @@
|
||||
<?php namespace Controllers\Admin;
|
||||
|
||||
use AdminController;
|
||||
use Image;
|
||||
use Input;
|
||||
use Lang;
|
||||
use Model;
|
||||
@@ -14,8 +15,8 @@ use Str;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class ModelsController extends AdminController {
|
||||
|
||||
class ModelsController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Show a list of all the models.
|
||||
*
|
||||
@@ -24,7 +25,12 @@ 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');
|
||||
if (Input::get('Deleted')) {
|
||||
$models->withTrashed()->Deleted();
|
||||
}
|
||||
|
||||
$models = $models->with('category','assets','depreciation')->get();
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/models/index', compact('models'));
|
||||
@@ -65,27 +71,46 @@ class ModelsController extends AdminController {
|
||||
$model = new Model;
|
||||
|
||||
// attempt validation
|
||||
if ($model->validate($new))
|
||||
{
|
||||
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->manufacturer_id = e(Input::get('manufacturer_id'));
|
||||
$model->category_id = e(Input::get('category_id'));
|
||||
$model->user_id = Sentry::getId();
|
||||
$model->show_mac_address = e(Input::get('show_mac_address', '0'));
|
||||
|
||||
|
||||
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())
|
||||
{
|
||||
if($model->save()) {
|
||||
// Redirect to the new model page
|
||||
return Redirect::to("hardware/models")->with('success', Lang::get('admin/models/message.create.success'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// failure
|
||||
$errors = $model->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
@@ -105,8 +130,7 @@ class ModelsController extends AdminController {
|
||||
public function getEdit($modelId = null)
|
||||
{
|
||||
// Check if the model exists
|
||||
if (is_null($model = Model::find($modelId)))
|
||||
{
|
||||
if (is_null($model = Model::find($modelId))) {
|
||||
// Redirect to the model management page
|
||||
return Redirect::to('assets/models')->with('error', Lang::get('admin/models/message.does_not_exist'));
|
||||
}
|
||||
@@ -131,40 +155,62 @@ class ModelsController extends AdminController {
|
||||
public function postEdit($modelId = null)
|
||||
{
|
||||
// Check if the model exists
|
||||
if (is_null($model = Model::find($modelId)))
|
||||
{
|
||||
// Redirect to the blogs management page
|
||||
if (is_null($model = Model::find($modelId))) {
|
||||
// Redirect to the models management page
|
||||
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));
|
||||
|
||||
// attempt validation
|
||||
if ($model->validate($new))
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
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->manufacturer_id = e(Input::get('manufacturer_id'));
|
||||
$model->category_id = e(Input::get('category_id'));
|
||||
$model->show_mac_address = e(Input::get('show_mac_address', '0'));
|
||||
|
||||
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())
|
||||
{
|
||||
if($model->save()) {
|
||||
// Redirect to the new model page
|
||||
return Redirect::to("hardware/models/$modelId/edit")->with('success', Lang::get('admin/models/message.update.success'));
|
||||
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'));
|
||||
@@ -180,8 +226,7 @@ class ModelsController extends AdminController {
|
||||
public function getDelete($modelId)
|
||||
{
|
||||
// Check if the model exists
|
||||
if (is_null($model = Model::find($modelId)))
|
||||
{
|
||||
if (is_null($model = Model::find($modelId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('hardware/models')->with('error', Lang::get('admin/models/message.not_found'));
|
||||
}
|
||||
@@ -199,6 +244,29 @@ class ModelsController extends AdminController {
|
||||
}
|
||||
}
|
||||
|
||||
public function getRestore($modelId = null)
|
||||
{
|
||||
|
||||
// Get user information
|
||||
$model = Model::withTrashed()->find($modelId);
|
||||
|
||||
if (isset($model->id)) {
|
||||
|
||||
// Restore the model
|
||||
$model->restore();
|
||||
|
||||
// Prepare the success message
|
||||
$success = Lang::get('admin/models/message.restore.success');
|
||||
|
||||
// Redirect back
|
||||
return Redirect::back()->with('success', $success);
|
||||
|
||||
} else {
|
||||
return Redirect::back()->with('error', Lang::get('admin/models/message.not_found'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the asset information to present to the model view page
|
||||
@@ -208,7 +276,7 @@ class ModelsController extends AdminController {
|
||||
**/
|
||||
public function getView($modelId = null)
|
||||
{
|
||||
$model = Model::find($modelId);
|
||||
$model = Model::withTrashed()->find($modelId);
|
||||
|
||||
if (isset($model->id)) {
|
||||
return View::make('backend/models/view', compact('model'));
|
||||
@@ -223,5 +291,30 @@ 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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
459
app/controllers/admin/ReportsController.php
Normal file
459
app/controllers/admin/ReportsController.php
Normal file
@@ -0,0 +1,459 @@
|
||||
<?php namespace Controllers\Admin;
|
||||
|
||||
use AdminController;
|
||||
use Input;
|
||||
use Lang;
|
||||
use License;
|
||||
use Asset;
|
||||
use User;
|
||||
use View;
|
||||
use Location;
|
||||
use Redirect;
|
||||
use Response;
|
||||
|
||||
class ReportsController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Show Asset Report
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function getAssetsReport()
|
||||
{
|
||||
// Grab all the assets
|
||||
$assets = Asset::with('model','assigneduser.userLoc','assetstatus','defaultLoc','assetlog','supplier','model.manufacturer')->orderBy('created_at', 'DESC')->get();
|
||||
return View::make('backend/reports/asset', compact('assets'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Export Asset Report as CSV
|
||||
*
|
||||
* @return file download
|
||||
*/
|
||||
public function exportAssetReport()
|
||||
{
|
||||
// Grab all the assets
|
||||
$assets = Asset::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
$rows = array();
|
||||
|
||||
// Create the header row
|
||||
$header = array(
|
||||
Lang::get('admin/hardware/table.asset_tag'),
|
||||
Lang::get('admin/hardware/form.manufacturer'),
|
||||
Lang::get('admin/hardware/form.model'),
|
||||
Lang::get('general.model_no'),
|
||||
Lang::get('general.name'),
|
||||
Lang::get('admin/hardware/table.serial'),
|
||||
Lang::get('admin/hardware/table.purchase_date'),
|
||||
Lang::get('admin/hardware/table.purchase_cost'),
|
||||
Lang::get('admin/hardware/form.order'),
|
||||
Lang::get('admin/hardware/form.supplier'),
|
||||
Lang::get('admin/hardware/table.checkoutto'),
|
||||
Lang::get('admin/hardware/table.location'),
|
||||
Lang::get('general.status')
|
||||
);
|
||||
$header = array_map('trim', $header);
|
||||
$rows[] = implode($header, ',');
|
||||
|
||||
// Create a row per asset
|
||||
foreach ($assets as $asset) {
|
||||
$row = array();
|
||||
$row[] = $asset->asset_tag;
|
||||
if ($asset->model->manufacturer) {
|
||||
$row[] = $asset->model->manufacturer->name;
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
$row[] = '"'.$asset->model->name.'"';
|
||||
$row[] = '"'.$asset->model->modelno.'"';
|
||||
$row[] = $asset->name;
|
||||
$row[] = $asset->serial;
|
||||
$row[] = $asset->purchase_date;
|
||||
$row[] = '"'.number_format($asset->purchase_cost).'"';
|
||||
if ($asset->order_number) {
|
||||
$row[] = $asset->order_number;
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
if ($asset->supplier_id) {
|
||||
$row[] = $asset->supplier->name;
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
|
||||
if ($asset->assigned_to > 0) {
|
||||
$user = User::find($asset->assigned_to);
|
||||
$row[] = $user->fullName();
|
||||
} else {
|
||||
$row[] = ''; // Empty string if unassigned
|
||||
}
|
||||
|
||||
if (($asset->assigned_to > 0) && ($asset->assigneduser->location_id > 0)) {
|
||||
$location = Location::find($asset->assigneduser->location_id);
|
||||
if ($location->name) {
|
||||
$row[] = $location->name;
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
} elseif ($asset->rtd_location_id) {
|
||||
$location = Location::find($asset->rtd_location_id);
|
||||
if ($location->name) {
|
||||
$row[] = $location->name;
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
} else {
|
||||
$row[] = ''; // Empty string if location is not set
|
||||
}
|
||||
|
||||
if (($asset->status_id == '0') && ($asset->assigned_to == '0')) {
|
||||
$row[] = Lang::get('general.ready_to_deploy');
|
||||
} elseif (($asset->status_id == '') && ($asset->assigned_to == '0')) {
|
||||
$row[] = Lang::get('general.pending');
|
||||
} elseif ($asset->assetstatus) {
|
||||
$row[] = $asset->assetstatus->name;
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
|
||||
$rows[] = implode($row, ',');
|
||||
}
|
||||
|
||||
// spit out a csv
|
||||
$csv = implode($rows, "\n");
|
||||
$response = Response::make($csv, 200);
|
||||
$response->header('Content-Type', 'text/csv');
|
||||
$response->header('Content-disposition', 'attachment;filename=report.csv');
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show Depreciation Report for Assets
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function getDeprecationReport()
|
||||
{
|
||||
// Grab all the assets
|
||||
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')->orderBy('created_at', 'DESC')->get();
|
||||
return View::make('backend/reports/depreciation', compact('assets'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Export Depreciation Report as CSV
|
||||
*
|
||||
* @return file download
|
||||
*/
|
||||
public function exportDeprecationReport()
|
||||
{
|
||||
// Grab all the assets
|
||||
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')->orderBy('created_at', 'DESC')->get();
|
||||
|
||||
$rows = array();
|
||||
|
||||
// Create the header row
|
||||
$header = array(
|
||||
Lang::get('admin/hardware/table.asset_tag'),
|
||||
Lang::get('admin/hardware/table.title'),
|
||||
Lang::get('admin/hardware/table.serial'),
|
||||
Lang::get('admin/hardware/table.checkoutto'),
|
||||
Lang::get('admin/hardware/table.location'),
|
||||
Lang::get('admin/hardware/table.purchase_date'),
|
||||
Lang::get('admin/hardware/table.purchase_cost'),
|
||||
Lang::get('admin/hardware/table.book_value'),
|
||||
Lang::get('admin/hardware/table.diff')
|
||||
);
|
||||
$header = array_map('trim', $header);
|
||||
$rows[] = implode($header, ',');
|
||||
|
||||
// Create a row per asset
|
||||
foreach ($assets as $asset) {
|
||||
$row = array();
|
||||
$row[] = $asset->asset_tag;
|
||||
$row[] = $asset->name;
|
||||
$row[] = $asset->serial;
|
||||
|
||||
|
||||
if ($asset->assigned_to > 0) {
|
||||
$user = User::find($asset->assigned_to);
|
||||
$row[] = $user->fullName();
|
||||
} else {
|
||||
$row[] = ''; // Empty string if unassigned
|
||||
}
|
||||
|
||||
if (($asset->assigned_to > 0) && ($asset->assigneduser->location_id > 0)) {
|
||||
$location = Location::find($asset->assigneduser->location_id);
|
||||
if ($location->city) {
|
||||
$row[] = '"'.$location->city . ', ' . $location->state.'"';
|
||||
} elseif ($location->name) {
|
||||
$row[] = $location->name;
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
} else {
|
||||
$row[] = ''; // Empty string if location is not set
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$row[] = $asset->purchase_date;
|
||||
$row[] = '"'.Lang::get('general.currency').number_format($asset->purchase_cost).'"';
|
||||
$row[] = '"'.Lang::get('general.currency').number_format($asset->getDepreciatedValue()).'"';
|
||||
$row[] = '"-'.Lang::get('general.currency').number_format(($asset->purchase_cost - $asset->getDepreciatedValue())).'"';
|
||||
$rows[] = implode($row, ',');
|
||||
}
|
||||
|
||||
// spit out a csv
|
||||
$csv = implode($rows, "\n");
|
||||
|
||||
$response = Response::make($csv, 200);
|
||||
$response->header('Content-Type', 'text/csv');
|
||||
$response->header('Content-disposition', 'attachment;filename=report.csv');
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show Report for Licenses
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function getLicenseReport()
|
||||
{
|
||||
$licenses = License::orderBy('created_at', 'DESC')->get();
|
||||
return View::make('backend/reports/licenses', compact('licenses'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Export License Report as CSV
|
||||
*
|
||||
* @return file download
|
||||
*/
|
||||
public function exportLicenseReport()
|
||||
{
|
||||
$licenses = License::orderBy('created_at', 'DESC')->get();
|
||||
$rows = array();
|
||||
$header = array(
|
||||
Lang::get('admin/licenses/table.title'),
|
||||
Lang::get('admin/licenses/table.serial'),
|
||||
Lang::get('admin/licenses/form.seats'),
|
||||
Lang::get('admin/licenses/form.remaining_seats'),
|
||||
Lang::get('admin/licenses/form.expiration'),
|
||||
Lang::get('admin/licenses/form.date'),
|
||||
Lang::get('admin/licenses/form.cost')
|
||||
);
|
||||
|
||||
$header = array_map('trim', $header);
|
||||
$rows[] = implode($header, ', ');
|
||||
|
||||
// Row per license
|
||||
foreach ($licenses as $license) {
|
||||
$row = array();
|
||||
$row[] = $license->name;
|
||||
$row[] = $license->serial;
|
||||
$row[] = $license->seats;
|
||||
$row[] = $license->remaincount();
|
||||
$row[] = $license->expiration_date;
|
||||
$row[] = $license->purchase_date;
|
||||
$row[] = '"'.number_format($license->purchase_cost).'"';
|
||||
|
||||
$rows[] = implode($row, ',');
|
||||
}
|
||||
|
||||
$csv = implode($rows, "\n");
|
||||
$response = Response::make($csv, 200);
|
||||
$response->header('Content-Type', 'text/csv');
|
||||
$response->header('Content-disposition', 'attachment;filename=report.csv');
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function getCustomReport()
|
||||
{
|
||||
return View::make('backend/reports/custom');
|
||||
}
|
||||
|
||||
public function postCustom()
|
||||
{
|
||||
$assets = Asset::orderBy('created_at', 'DESC')->get();
|
||||
$rows = array();
|
||||
$header = array();
|
||||
|
||||
if (e(Input::get('asset_name')) == '1')
|
||||
{
|
||||
$header[] = 'Asset Name';
|
||||
}
|
||||
if (e(Input::get('asset_tag')) == '1')
|
||||
{
|
||||
$header[] = 'Asset Tag';
|
||||
}
|
||||
if (e(Input::get('manufacturer')) == '1')
|
||||
{
|
||||
$header[] = 'Manufacturer';
|
||||
}
|
||||
if (e(Input::get('model')) == '1')
|
||||
{
|
||||
$header[] = 'Model';
|
||||
$header[] = 'Model Number';
|
||||
}
|
||||
if (e(Input::get('serial')) == '1')
|
||||
{
|
||||
$header[] = 'Serial';
|
||||
}
|
||||
if (e(Input::get('purchase_date')) == '1')
|
||||
{
|
||||
$header[] = 'Purchase Date';
|
||||
}
|
||||
if ((e(Input::get('purchase_cost')) == '1') && (e(Input::get('depreciation')) == '0'))
|
||||
{
|
||||
$header[] = 'Purchase Cost';
|
||||
}
|
||||
if (e(Input::get('order')) == '1')
|
||||
{
|
||||
$header[] = 'Order Number';
|
||||
}
|
||||
if (e(Input::get('supplier')) == '1')
|
||||
{
|
||||
$header[] = 'Supplier';
|
||||
}
|
||||
if (e(Input::get('location')) == '1')
|
||||
{
|
||||
$header[] = 'Location';
|
||||
}
|
||||
if (e(Input::get('assigned_to')) == '1')
|
||||
{
|
||||
$header[] = 'Assigned To';
|
||||
}
|
||||
if (e(Input::get('status')) == '1')
|
||||
{
|
||||
$header[] = 'Status';
|
||||
}
|
||||
if (e(Input::get('warranty')) == '1')
|
||||
{
|
||||
$header[] = 'Warranty';
|
||||
$header[] = 'Warranty Expires';
|
||||
}
|
||||
if (e(Input::get('depreciation')) == '1')
|
||||
{
|
||||
$header[] = 'Purchase Cost';
|
||||
$header[] = 'Value';
|
||||
$header[] = 'Diff';
|
||||
}
|
||||
|
||||
$header = array_map('trim', $header);
|
||||
$rows[] = implode($header, ',');
|
||||
|
||||
foreach($assets as $asset) {
|
||||
$row = array();
|
||||
if (e(Input::get('asset_name')) == '1') {
|
||||
$row[] = $asset->name;
|
||||
}
|
||||
if (e(Input::get('asset_tag')) == '1') {
|
||||
$row[] = $asset->asset_tag;
|
||||
}
|
||||
if (e(Input::get('manufacturer')) == '1') {
|
||||
if ($asset->model->manufacturer) {
|
||||
$row[] = $asset->model->manufacturer->name;
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
}
|
||||
if (e(Input::get('model')) == '1') {
|
||||
$row[] = '"'.$asset->model->name.'"';
|
||||
$row[] = '"'.$asset->model->modelno.'"';
|
||||
}
|
||||
if (e(Input::get('serial')) == '1') {
|
||||
$row[] = $asset->serial;
|
||||
}
|
||||
if (e(Input::get('purchase_date')) == '1') {
|
||||
$row[] = $asset->purchase_date;
|
||||
}
|
||||
if ((e(Input::get('purchase_cost')) == '1') && (e(Input::get('depreciation')) == '0')) {
|
||||
$row[] = '"'.number_format($asset->purchase_cost).'"';
|
||||
}
|
||||
if (e(Input::get('order')) == '1') {
|
||||
if ($asset->order_number) {
|
||||
$row[] = $asset->order_number;
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
}
|
||||
if (e(Input::get('supplier')) == '1') {
|
||||
if ($asset->supplier_id) {
|
||||
$row[] = $asset->supplier->name;
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
}
|
||||
if (e(Input::get('location')) == '1') {
|
||||
if (($asset->assigned_to > 0) && ($asset->assigneduser->location_id > 0)) {
|
||||
$location = Location::find($asset->assigneduser->location_id);
|
||||
if ($location->name) {
|
||||
$row[] = $location->name;
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
} elseif ($asset->rtd_location_id) {
|
||||
$location = Location::find($asset->rtd_location_id);
|
||||
if ($location->name) {
|
||||
$row[] = $location->name;
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
} else {
|
||||
$row[] = ''; // Empty string if location is not set
|
||||
}
|
||||
}
|
||||
if (e(Input::get('assigned_to')) == '1') {
|
||||
if ($asset->assigned_to > 0) {
|
||||
$user = User::find($asset->assigned_to);
|
||||
$row[] = $user->fullName();
|
||||
} else {
|
||||
$row[] = ''; // Empty string if unassigned
|
||||
}
|
||||
}
|
||||
if (e(Input::get('status')) == '1') {
|
||||
if (($asset->status_id == '0') && ($asset->assigned_to == '0')) {
|
||||
$row[] = Lang::get('general.ready_to_deploy');
|
||||
} elseif (($asset->status_id == '') && ($asset->assigned_to == '0')) {
|
||||
$row[] = Lang::get('general.pending');
|
||||
} elseif ($asset->assetstatus) {
|
||||
$row[] = $asset->assetstatus->name;
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
}
|
||||
if (e(Input::get('warranty')) == '1') {
|
||||
if ($asset->warranty_months) {
|
||||
$row[] = $asset->warranty_months;
|
||||
$row[] = $asset->warrantee_expires();
|
||||
} else {
|
||||
$row[] = '';
|
||||
$row[] = '';
|
||||
}
|
||||
}
|
||||
if (e(Input::get('depreciation')) == '1') {
|
||||
$depreciation = $asset->depreciate();
|
||||
$row[] = '"'.number_format($asset->purchase_cost).'"';
|
||||
$row[] = '"'.number_format($depreciation).'"';
|
||||
$row[] = '"'.number_format($asset->purchase_cost - $depreciation).'"';
|
||||
}
|
||||
$rows[] = implode($row, ',');
|
||||
}
|
||||
|
||||
// spit out a csv
|
||||
if (array_filter($rows)) {
|
||||
$csv = implode($rows, "\n");
|
||||
$response = Response::make($csv, 200);
|
||||
$response->header('Content-Type', 'text/csv');
|
||||
$response->header('Content-disposition', 'attachment;filename=report.csv');
|
||||
return $response;
|
||||
} else {
|
||||
return Redirect::to("reports/custom")->with('error', Lang::get('admin/reports/message.error'));
|
||||
}
|
||||
}
|
||||
}
|
||||
47
app/controllers/admin/SettingsController.php
Normal file → Executable file
47
app/controllers/admin/SettingsController.php
Normal file → Executable file
@@ -10,9 +10,10 @@ use Sentry;
|
||||
use Str;
|
||||
use Validator;
|
||||
use View;
|
||||
use Image;
|
||||
|
||||
class SettingsController extends AdminController {
|
||||
|
||||
class SettingsController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Show a list of all the settings.
|
||||
*
|
||||
@@ -38,7 +39,8 @@ class SettingsController extends AdminController {
|
||||
public function getEdit()
|
||||
{
|
||||
$settings = Setting::orderBy('created_at', 'DESC')->paginate(10);
|
||||
return View::make('backend/settings/edit', compact('settings'));
|
||||
$is_gd_installed = extension_loaded('gd');
|
||||
return View::make('backend/settings/edit', compact('settings', 'is_gd_installed'));
|
||||
}
|
||||
|
||||
|
||||
@@ -52,8 +54,7 @@ class SettingsController extends AdminController {
|
||||
{
|
||||
|
||||
// Check if the asset exists
|
||||
if (is_null($setting = Setting::find(1)))
|
||||
{
|
||||
if (is_null($setting = Setting::find(1))) {
|
||||
// Redirect to the asset management page with error
|
||||
return Redirect::to('admin')->with('error', Lang::get('admin/settings/message.update.error'));
|
||||
}
|
||||
@@ -65,6 +66,9 @@ class SettingsController extends AdminController {
|
||||
$rules = array(
|
||||
"site_name" => 'required|min:3',
|
||||
"per_page" => 'required|min:1|numeric',
|
||||
"qr_text" => 'min:1|max:31',
|
||||
"logo" => 'mimes:jpeg,bmp,png,gif',
|
||||
"alert_email" => 'email',
|
||||
);
|
||||
|
||||
// Create a new validator instance from our validation rules
|
||||
@@ -72,20 +76,45 @@ class SettingsController extends AdminController {
|
||||
|
||||
|
||||
// If validation fails, we'll exit the operation now.
|
||||
if ($validator->fails())
|
||||
{
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
|
||||
if (Input::get('clear_logo')=='1') {
|
||||
$setting->logo = NULL;
|
||||
} elseif (Input::file('logo')) {
|
||||
$image = Input::file('logo');
|
||||
$file_name = "logo.".$image->getClientOriginalExtension();
|
||||
$path = public_path('uploads/'.$file_name);
|
||||
Image::make($image->getRealPath())->resize(null, 40, function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
$constraint->upsize();
|
||||
})->save($path);
|
||||
$setting->logo = $file_name;
|
||||
}
|
||||
|
||||
|
||||
// Update the asset data
|
||||
$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->load_remote = e(Input::get('load_remote', '0'));
|
||||
$setting->qr_text = e(Input::get('qr_text'));
|
||||
$setting->auto_increment_prefix = e(Input::get('auto_increment_prefix'));
|
||||
$setting->auto_increment_assets = e(Input::get('auto_increment_assets', '0'));
|
||||
$setting->alert_email = e(Input::get('alert_email'));
|
||||
$setting->alerts_enabled = e(Input::get('alerts_enabled', '0'));
|
||||
$setting->header_color = e(Input::get('header_color'));
|
||||
$setting->default_eula_text = e(Input::get('default_eula_text'));
|
||||
|
||||
|
||||
// Was the asset updated?
|
||||
if($setting->save())
|
||||
{
|
||||
if($setting->save()) {
|
||||
// Redirect to the settings page
|
||||
return Redirect::to("admin/settings/app")->with('success', Lang::get('admin/settings/message.update.success'));
|
||||
}
|
||||
|
||||
77
app/controllers/admin/StatuslabelsController.php
Normal file → Executable file
77
app/controllers/admin/StatuslabelsController.php
Normal file → Executable file
@@ -12,8 +12,8 @@ use Str;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class StatuslabelsController extends AdminController {
|
||||
|
||||
class StatuslabelsController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Show a list of all the statuslabels.
|
||||
*
|
||||
@@ -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'));
|
||||
@@ -38,7 +38,12 @@ class StatuslabelsController extends AdminController {
|
||||
public function getCreate()
|
||||
{
|
||||
// Show the page
|
||||
return View::make('backend/statuslabels/edit')->with('statuslabel',new Statuslabel);
|
||||
$statuslabel = new Statuslabel;
|
||||
$use_statuslabel_type = $statuslabel->getStatuslabelType();
|
||||
|
||||
$statuslabel_types = array('' => Lang::get('admin/hardware/form.select_statustype')) + array('undeployable' => Lang::get('admin/hardware/general.undeployable')) + array('pending' => Lang::get('admin/hardware/general.pending')) + array('archived' => Lang::get('admin/hardware/general.archived')) + array('deployable' => Lang::get('admin/hardware/general.deployable'));
|
||||
|
||||
return View::make('backend/statuslabels/edit', compact('statuslabel_types','statuslabel'))->with('use_statuslabel_type',$use_statuslabel_type);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,22 +62,24 @@ class StatuslabelsController extends AdminController {
|
||||
$statuslabel = new Statuslabel();
|
||||
|
||||
// attempt validation
|
||||
if ($statuslabel->validate($new))
|
||||
{
|
||||
if ($statuslabel->validate($new)) {
|
||||
|
||||
$statustype = Statuslabel::getStatuslabelTypesForDB(Input::get('statuslabel_types'));
|
||||
|
||||
// Save the Statuslabel data
|
||||
$statuslabel->name = e(Input::get('name'));
|
||||
$statuslabel->user_id = Sentry::getId();
|
||||
$statuslabel->notes = e(Input::get('notes'));
|
||||
$statuslabel->deployable = $statustype['deployable'];
|
||||
$statuslabel->pending = $statustype['pending'];
|
||||
$statuslabel->archived = $statustype['archived'];
|
||||
|
||||
// Was the asset created?
|
||||
if($statuslabel->save())
|
||||
{
|
||||
if($statuslabel->save()) {
|
||||
// Redirect to the new Statuslabel page
|
||||
return Redirect::to("admin/settings/statuslabels")->with('success', Lang::get('admin/statuslabels/message.create.success'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// failure
|
||||
$errors = $statuslabel->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
@@ -93,14 +100,16 @@ class StatuslabelsController extends AdminController {
|
||||
public function getEdit($statuslabelId = null)
|
||||
{
|
||||
// Check if the Statuslabel exists
|
||||
if (is_null($statuslabel = Statuslabel::find($statuslabelId)))
|
||||
{
|
||||
if (is_null($statuslabel = Statuslabel::find($statuslabelId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/settings/statuslabels')->with('error', Lang::get('admin/statuslabels/message.does_not_exist'));
|
||||
}
|
||||
|
||||
$use_statuslabel_type = $statuslabel->getStatuslabelType();
|
||||
|
||||
return View::make('backend/statuslabels/edit', compact('statuslabel'));
|
||||
$statuslabel_types = array('' => Lang::get('admin/hardware/form.select_statustype')) + array('undeployable' => Lang::get('admin/hardware/general.undeployable')) + array('pending' => Lang::get('admin/hardware/general.pending')) + array('archived' => Lang::get('admin/hardware/general.archived')) + array('deployable' => Lang::get('admin/hardware/general.deployable'));
|
||||
|
||||
return View::make('backend/statuslabels/edit', compact('statuslabel','statuslabel_types'))->with('use_statuslabel_type',$use_statuslabel_type);
|
||||
}
|
||||
|
||||
|
||||
@@ -113,38 +122,37 @@ class StatuslabelsController extends AdminController {
|
||||
public function postEdit($statuslabelId = null)
|
||||
{
|
||||
// Check if the Statuslabel exists
|
||||
if (is_null($statuslabel = Statuslabel::find($statuslabelId)))
|
||||
{
|
||||
if (is_null($statuslabel = Statuslabel::find($statuslabelId))) {
|
||||
// Redirect to the blogs management page
|
||||
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();
|
||||
|
||||
|
||||
// attempt validation
|
||||
if ($statuslabel->validate($new))
|
||||
if ($validator->fails())
|
||||
{
|
||||
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
else {
|
||||
// Update the Statuslabel data
|
||||
$statustype = Statuslabel::getStatuslabelTypesForDB(Input::get('statuslabel_types'));
|
||||
|
||||
$statuslabel->name = e(Input::get('name'));
|
||||
$statuslabel->notes = e(Input::get('notes'));
|
||||
$statuslabel->deployable = $statustype['deployable'];
|
||||
$statuslabel->pending = $statustype['pending'];
|
||||
$statuslabel->archived = $statustype['archived'];
|
||||
|
||||
|
||||
// Was the asset created?
|
||||
if($statuslabel->save())
|
||||
{
|
||||
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'));
|
||||
@@ -160,8 +168,7 @@ class StatuslabelsController extends AdminController {
|
||||
public function getDelete($statuslabelId)
|
||||
{
|
||||
// Check if the Statuslabel exists
|
||||
if (is_null($statuslabel = Statuslabel::find($statuslabelId)))
|
||||
{
|
||||
if (is_null($statuslabel = Statuslabel::find($statuslabelId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/settings/statuslabels')->with('error', Lang::get('admin/statuslabels/message.not_found'));
|
||||
}
|
||||
|
||||
245
app/controllers/admin/SuppliersController.php
Executable file
245
app/controllers/admin/SuppliersController.php
Executable file
@@ -0,0 +1,245 @@
|
||||
<?php namespace Controllers\Admin;
|
||||
|
||||
use AdminController;
|
||||
use Image;
|
||||
use Input;
|
||||
use Lang;
|
||||
use Supplier;
|
||||
use Redirect;
|
||||
use Setting;
|
||||
use Sentry;
|
||||
use Str;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class SuppliersController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Show a list of all suppliers
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the suppliers
|
||||
$suppliers = Supplier::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/suppliers/index', compact('suppliers'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Supplier create.
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function getCreate()
|
||||
{
|
||||
return View::make('backend/suppliers/edit')->with('supplier', new Supplier);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Supplier create form processing.
|
||||
*
|
||||
* @return Redirect
|
||||
*/
|
||||
public function postCreate()
|
||||
{
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
// Create a new supplier
|
||||
$supplier = new Supplier;
|
||||
|
||||
// attempt validation
|
||||
if ($supplier->validate($new)) {
|
||||
|
||||
// Save the location data
|
||||
$supplier->name = e(Input::get('name'));
|
||||
$supplier->address = e(Input::get('address'));
|
||||
$supplier->address2 = e(Input::get('address2'));
|
||||
$supplier->city = e(Input::get('city'));
|
||||
$supplier->state = e(Input::get('state'));
|
||||
$supplier->country = e(Input::get('country'));
|
||||
$supplier->zip = e(Input::get('zip'));
|
||||
$supplier->contact = e(Input::get('contact'));
|
||||
$supplier->phone = e(Input::get('phone'));
|
||||
$supplier->fax = e(Input::get('fax'));
|
||||
$supplier->email = e(Input::get('email'));
|
||||
$supplier->notes = e(Input::get('notes'));
|
||||
$supplier->url = $supplier->addhttp(e(Input::get('url')));
|
||||
$supplier->user_id = Sentry::getId();
|
||||
|
||||
if (Input::file('image')) {
|
||||
$image = Input::file('image');
|
||||
$file_name = str_random(25).".".$image->getClientOriginalExtension();
|
||||
$path = public_path('uploads/suppliers/'.$file_name);
|
||||
Image::make($image->getRealPath())->resize(300, null, function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
$constraint->upsize();
|
||||
})->save($path);
|
||||
$supplier->image = $file_name;
|
||||
}
|
||||
|
||||
// Was it created?
|
||||
if($supplier->save()) {
|
||||
// Redirect to the new supplier page
|
||||
return Redirect::to("admin/settings/suppliers")->with('success', Lang::get('admin/suppliers/message.create.success'));
|
||||
}
|
||||
} else {
|
||||
// failure
|
||||
$errors = $supplier->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
}
|
||||
|
||||
// Redirect to the supplier create page
|
||||
return Redirect::to('admin/settings/suppliers/create')->with('error', Lang::get('admin/suppliers/message.create.error'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Supplier update.
|
||||
*
|
||||
* @param int $supplierId
|
||||
* @return View
|
||||
*/
|
||||
public function getEdit($supplierId = null)
|
||||
{
|
||||
// Check if the supplier exists
|
||||
if (is_null($supplier = Supplier::find($supplierId))) {
|
||||
// Redirect to the supplier page
|
||||
return Redirect::to('admin/settings/suppliers')->with('error', Lang::get('admin/suppliers/message.does_not_exist'));
|
||||
}
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/suppliers/edit', compact('supplier'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Supplier update form processing page.
|
||||
*
|
||||
* @param int $supplierId
|
||||
* @return Redirect
|
||||
*/
|
||||
public function postEdit($supplierId = null)
|
||||
{
|
||||
// Check if the supplier exists
|
||||
if (is_null($supplier = Supplier::find($supplierId))) {
|
||||
// Redirect to the supplier page
|
||||
return Redirect::to('admin/settings/suppliers')->with('error', Lang::get('admin/suppliers/message.does_not_exist'));
|
||||
}
|
||||
|
||||
|
||||
//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
|
||||
else {
|
||||
|
||||
// Save the data
|
||||
$supplier->name = e(Input::get('name'));
|
||||
$supplier->address = e(Input::get('address'));
|
||||
$supplier->address2 = e(Input::get('address2'));
|
||||
$supplier->city = e(Input::get('city'));
|
||||
$supplier->state = e(Input::get('state'));
|
||||
$supplier->country = e(Input::get('country'));
|
||||
$supplier->zip = e(Input::get('zip'));
|
||||
$supplier->contact = e(Input::get('contact'));
|
||||
$supplier->phone = e(Input::get('phone'));
|
||||
$supplier->fax = e(Input::get('fax'));
|
||||
$supplier->email = e(Input::get('email'));
|
||||
$supplier->url = $supplier->addhttp(e(Input::get('url')));
|
||||
$supplier->notes = e(Input::get('notes'));
|
||||
|
||||
if (Input::file('image')) {
|
||||
$image = Input::file('image');
|
||||
$file_name = str_random(25).".".$image->getClientOriginalExtension();
|
||||
$path = public_path('uploads/suppliers/'.$file_name);
|
||||
Image::make($image->getRealPath())->resize(300, null, function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
$constraint->upsize();
|
||||
})->save($path);
|
||||
$supplier->image = $file_name;
|
||||
}
|
||||
|
||||
if (Input::get('image_delete') == 1 && Input::file('image') == "") {
|
||||
$supplier->image = NULL;
|
||||
}
|
||||
|
||||
// Was it created?
|
||||
if($supplier->save()) {
|
||||
// Redirect to the new supplier page
|
||||
return Redirect::to("admin/settings/suppliers")->with('success', Lang::get('admin/suppliers/message.update.success'));
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the supplier management page
|
||||
return Redirect::to("admin/settings/suppliers/$supplierId/edit")->with('error', Lang::get('admin/suppliers/message.update.error'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the given supplier.
|
||||
*
|
||||
* @param int $supplierId
|
||||
* @return Redirect
|
||||
*/
|
||||
public function getDelete($supplierId)
|
||||
{
|
||||
// Check if the supplier exists
|
||||
if (is_null($supplier = Supplier::find($supplierId))) {
|
||||
// Redirect to the suppliers page
|
||||
return Redirect::to('admin/settings/suppliers')->with('error', Lang::get('admin/suppliers/message.not_found'));
|
||||
}
|
||||
|
||||
if ($supplier->num_assets() > 0) {
|
||||
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('admin/settings/suppliers')->with('error', Lang::get('admin/suppliers/message.assoc_users'));
|
||||
} else {
|
||||
|
||||
// Delete the supplier
|
||||
$supplier->delete();
|
||||
|
||||
// Redirect to the suppliers management page
|
||||
return Redirect::to('admin/settings/suppliers')->with('success', Lang::get('admin/suppliers/message.delete.success'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the asset information to present to the supplier view page
|
||||
*
|
||||
* @param int $assetId
|
||||
* @return View
|
||||
**/
|
||||
public function getView($supplierId = null)
|
||||
{
|
||||
$supplier = Supplier::find($supplierId);
|
||||
|
||||
if (isset($supplier->id)) {
|
||||
return View::make('backend/suppliers/view', compact('supplier'));
|
||||
} else {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/suppliers/message.does_not_exist', compact('id'));
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('suppliers')->with('error', $error);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -5,6 +5,8 @@ use Cartalyst\Sentry\Users\LoginRequiredException;
|
||||
use Cartalyst\Sentry\Users\PasswordRequiredException;
|
||||
use Cartalyst\Sentry\Users\UserExistsException;
|
||||
use Cartalyst\Sentry\Users\UserNotFoundException;
|
||||
use HTML;
|
||||
use URL;
|
||||
use Config;
|
||||
use DB;
|
||||
use Input;
|
||||
@@ -18,9 +20,12 @@ use Redirect;
|
||||
use Sentry;
|
||||
use Validator;
|
||||
use View;
|
||||
use Chumper\Datatable\Facades\Datatable;
|
||||
use League\Csv\Reader;
|
||||
use Mail;
|
||||
|
||||
class UsersController extends AdminController {
|
||||
|
||||
class UsersController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Declare the rules for the form validation
|
||||
*
|
||||
@@ -29,9 +34,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',
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -41,34 +47,41 @@ 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?
|
||||
if (Input::get('withTrashed'))
|
||||
{
|
||||
// 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();
|
||||
}
|
||||
else if (Input::get('onlyTrashed'))
|
||||
{
|
||||
$users = $users->onlyTrashed();
|
||||
}
|
||||
//$users = Sentry::getUserProvider()->createModel()->paginate();
|
||||
|
||||
} elseif (Input::get('onlyTrashed')) {
|
||||
|
||||
// Get the user assets
|
||||
//$assets = $users->assets();
|
||||
// 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();
|
||||
}
|
||||
|
||||
|
||||
// Paginate the users
|
||||
$users = $users->paginate()
|
||||
$users = $users->paginate(100000)
|
||||
->appends(array(
|
||||
'withTrashed' => Input::get('withTrashed'),
|
||||
'onlyTrashed' => Input::get('onlyTrashed'),
|
||||
));
|
||||
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/users/index', compact('users', 'assets'));
|
||||
return View::make('backend/users/index', compact('users'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,20 +95,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('' => '') + 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);
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,33 +136,38 @@ class UsersController extends AdminController {
|
||||
{
|
||||
// Create a new validator instance from our validation rules
|
||||
$validator = Validator::make(Input::all(), $this->validationRules);
|
||||
|
||||
// If validation fails, we'll exit the operation now.
|
||||
if ($validator->fails())
|
||||
{
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
// If validation fails, we'll exit the operation now.
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
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.
|
||||
|
||||
// Get the inputs, with some exceptions
|
||||
$inputs = Input::except('csrf_token', 'password_confirm', 'groups');
|
||||
$inputs = Input::except('csrf_token', 'password_confirm', 'groups','email_user');
|
||||
|
||||
// @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);
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -141,25 +175,38 @@ 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);
|
||||
|
||||
if (Input::get('email_user')==1) {
|
||||
// Send the credentials through email
|
||||
|
||||
$data = array();
|
||||
$data['email'] = e(Input::get('email'));
|
||||
$data['first_name'] = e(Input::get('first_name'));
|
||||
$data['password'] = e(Input::get('password'));
|
||||
|
||||
Mail::send('emails.send-login', $data, function ($m) use ($user) {
|
||||
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
|
||||
$m->subject('Welcome ' . $user->first_name);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return Redirect::route('users')->with('success', $success);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/users/message.error.create');
|
||||
|
||||
// Redirect to the user creation page
|
||||
return Redirect::route('create/user')->with('error', $error);
|
||||
}
|
||||
catch (LoginRequiredException $e)
|
||||
{
|
||||
} catch (LoginRequiredException $e) {
|
||||
$error = Lang::get('admin/users/message.user_login_required');
|
||||
}
|
||||
catch (PasswordRequiredException $e)
|
||||
{
|
||||
} catch (PasswordRequiredException $e) {
|
||||
$error = Lang::get('admin/users/message.user_password_required');
|
||||
}
|
||||
catch (UserExistsException $e)
|
||||
{
|
||||
} catch (UserExistsException $e) {
|
||||
$error = Lang::get('admin/users/message.user_exists');
|
||||
}
|
||||
|
||||
@@ -175,13 +222,12 @@ class UsersController extends AdminController {
|
||||
*/
|
||||
public function getEdit($id = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
try {
|
||||
// Get the user information
|
||||
$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());
|
||||
@@ -195,12 +241,15 @@ class UsersController extends AdminController {
|
||||
$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');
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (UserNotFoundException $e)
|
||||
{
|
||||
} catch (UserNotFoundException $e) {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/users/message.user_not_found', compact('id'));
|
||||
|
||||
@@ -209,7 +258,9 @@ class UsersController extends AdminController {
|
||||
}
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/users/edit', compact('user', 'groups', 'userGroups', 'permissions', 'userPermissions'))->with('location_list',$location_list);
|
||||
return View::make('backend/users/edit', compact('user', 'groups', 'userGroups', 'permissions', 'userPermissions'))
|
||||
->with('location_list',$location_list)
|
||||
->with('manager_list',$manager_list);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -226,13 +277,10 @@ class UsersController extends AdminController {
|
||||
$this->decodePermissions($permissions);
|
||||
app('request')->request->set('permissions', $permissions);
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
// Get the user information
|
||||
$user = Sentry::getUserProvider()->findById($id);
|
||||
}
|
||||
catch (UserNotFoundException $e)
|
||||
{
|
||||
} catch (UserNotFoundException $e) {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/users/message.user_not_found', compact('id'));
|
||||
|
||||
@@ -244,8 +292,7 @@ class UsersController extends AdminController {
|
||||
$this->validationRules['email'] = "required|email|unique:users,email,{$user->email},email";
|
||||
|
||||
// Do we want to update the user password?
|
||||
if ( ! $password = Input::get('password'))
|
||||
{
|
||||
if ( ! $password = Input::get('password')) {
|
||||
unset($this->validationRules['password']);
|
||||
unset($this->validationRules['password_confirm']);
|
||||
#$this->validationRules['password'] = 'required|between:3,32';
|
||||
@@ -255,29 +302,37 @@ class UsersController extends AdminController {
|
||||
// Create a new validator instance from our validation rules
|
||||
$validator = Validator::make(Input::all(), $this->validationRules);
|
||||
|
||||
|
||||
// If validation fails, we'll exit the operation now.
|
||||
if ($validator->fails())
|
||||
{
|
||||
if ($validator->fails()) {
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
// Update the user
|
||||
$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;
|
||||
}
|
||||
|
||||
if ($user->location_id == "") {
|
||||
$user->location_id = NULL;
|
||||
}
|
||||
|
||||
|
||||
// Do we want to update the user password?
|
||||
if ($password)
|
||||
{
|
||||
if ($password) {
|
||||
$user->password = $password;
|
||||
}
|
||||
|
||||
@@ -293,36 +348,31 @@ class UsersController extends AdminController {
|
||||
$groupsToRemove = array_diff($userGroups, $selectedGroups);
|
||||
|
||||
// Assign the user to groups
|
||||
foreach ($groupsToAdd as $groupId)
|
||||
{
|
||||
foreach ($groupsToAdd as $groupId) {
|
||||
$group = Sentry::getGroupProvider()->findById($groupId);
|
||||
|
||||
$user->addGroup($group);
|
||||
}
|
||||
|
||||
// Remove the user from groups
|
||||
foreach ($groupsToRemove as $groupId)
|
||||
{
|
||||
foreach ($groupsToRemove as $groupId) {
|
||||
$group = Sentry::getGroupProvider()->findById($groupId);
|
||||
|
||||
$user->removeGroup($group);
|
||||
}
|
||||
|
||||
// Was the user updated?
|
||||
if ($user->save())
|
||||
{
|
||||
if ($user->save()) {
|
||||
// Prepare the success message
|
||||
$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
|
||||
$error = Lang::get('admin/users/message.error.update');
|
||||
}
|
||||
catch (LoginRequiredException $e)
|
||||
{
|
||||
} catch (LoginRequiredException $e) {
|
||||
$error = Lang::get('admin/users/message.user_login_required');
|
||||
}
|
||||
|
||||
@@ -338,14 +388,12 @@ class UsersController extends AdminController {
|
||||
*/
|
||||
public function getDelete($id = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
try {
|
||||
// Get user information
|
||||
$user = Sentry::getUserProvider()->findById($id);
|
||||
|
||||
// Check if we are not trying to delete ourselves
|
||||
if ($user->id === Sentry::getId())
|
||||
{
|
||||
if ($user->id === Sentry::getId()) {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/users/message.error.delete');
|
||||
|
||||
@@ -355,8 +403,7 @@ class UsersController extends AdminController {
|
||||
|
||||
|
||||
// Do we have permission to delete this user?
|
||||
if ($user->isSuperUser() and ! Sentry::getUser()->isSuperUser())
|
||||
{
|
||||
if ($user->isSuperUser() and ! Sentry::getUser()->isSuperUser()) {
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('users')->with('error', 'Insufficient permissions!');
|
||||
}
|
||||
@@ -381,9 +428,7 @@ class UsersController extends AdminController {
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('users')->with('success', $success);
|
||||
}
|
||||
catch (UserNotFoundException $e)
|
||||
{
|
||||
} catch (UserNotFoundException $e) {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/users/message.user_not_found', compact('id' ));
|
||||
|
||||
@@ -400,8 +445,7 @@ class UsersController extends AdminController {
|
||||
*/
|
||||
public function getRestore($id = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
try {
|
||||
// Get user information
|
||||
$user = Sentry::getUserProvider()->createModel()->withTrashed()->find($id);
|
||||
|
||||
@@ -413,9 +457,7 @@ class UsersController extends AdminController {
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('users')->with('success', $success);
|
||||
}
|
||||
catch (UserNotFoundException $e)
|
||||
{
|
||||
} catch (UserNotFoundException $e) {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/users/message.user_not_found', compact('id'));
|
||||
|
||||
@@ -434,7 +476,7 @@ class UsersController extends AdminController {
|
||||
public function getView($userId = null)
|
||||
{
|
||||
|
||||
$user = Sentry::getUserProvider()->createModel()->withTrashed()->find($userId);
|
||||
$user = Sentry::getUserProvider()->createModel()->find($userId);
|
||||
|
||||
if (isset($user->id)) {
|
||||
return View::make('backend/users/view', compact('user'));
|
||||
@@ -448,4 +490,251 @@ class UsersController extends AdminController {
|
||||
|
||||
}
|
||||
|
||||
public function getDatatable()
|
||||
{
|
||||
return Datatable::collection(User::all())
|
||||
->addColumn('name',function ($model) {
|
||||
$name = HTML::image($model->gravatar(), $model->first_name, array('class'=>'img-circle avatar hidden-phone', 'style'=>'max-width: 45px'));
|
||||
$name .= HTML::link(URL::action('Controllers\Admin\UsersController@getView', $model->id), $model->first_name . ' ' . $model->last_name, array('class' => 'name'));
|
||||
return $name;
|
||||
}
|
||||
)
|
||||
->showColumns('email')
|
||||
->addColumn('assets', function ($model) {
|
||||
$assets = $model->assets->count();
|
||||
return $assets;
|
||||
}
|
||||
)
|
||||
->addColumn('licenses', function ($model) {
|
||||
$licenses = $model->licenses->count();
|
||||
return $licenses;
|
||||
}
|
||||
)
|
||||
->addColumn('activated', function ($model) {
|
||||
$activated = $model->isActivated() ? '<i class="fa fa-check"></i>' : '';
|
||||
return $activated;
|
||||
}
|
||||
)
|
||||
->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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User import.
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function getImport()
|
||||
{
|
||||
// Get all the available groups
|
||||
$groups = Sentry::getGroupProvider()->findAll();
|
||||
// Selected groups
|
||||
$selectedGroups = 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);
|
||||
// Show the page
|
||||
return View::make('backend/users/import', compact('groups', 'selectedGroups', 'permissions', 'selectedPermissions'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* User import form processing.
|
||||
*
|
||||
* @return Redirect
|
||||
*/
|
||||
public function postImport()
|
||||
{
|
||||
|
||||
if (! ini_get("auto_detect_line_endings")) {
|
||||
ini_set("auto_detect_line_endings", '1');
|
||||
}
|
||||
|
||||
$csv = Reader::createFromPath(Input::file('user_import_csv'));
|
||||
$csv->setNewline("\r\n");
|
||||
|
||||
if (Input::get('has_headers')==1) {
|
||||
$csv->setOffset(1);
|
||||
}
|
||||
|
||||
$duplicates = '';
|
||||
|
||||
$nbInsert = $csv->each(function ($row) use ($duplicates) {
|
||||
|
||||
if (array_key_exists(2, $row)) {
|
||||
|
||||
if (Input::get('activate')==1) {
|
||||
$activated = '1';
|
||||
} else {
|
||||
$activated = '0';
|
||||
}
|
||||
|
||||
$pass = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10);
|
||||
|
||||
|
||||
|
||||
try {
|
||||
// Check if this email already exists in the system
|
||||
$user = DB::table('users')->where('email', $row[2])->first();
|
||||
if ($user) {
|
||||
$duplicates .= $row[2].', ';
|
||||
} else {
|
||||
|
||||
$newuser = array(
|
||||
'first_name' => $row[0],
|
||||
'last_name' => $row[1],
|
||||
'email' => $row[2],
|
||||
'password' => $pass,
|
||||
'activated' => $activated,
|
||||
'permissions' => '{"user":1}'
|
||||
);
|
||||
|
||||
DB::table('users')->insert($newuser);
|
||||
|
||||
$udpateuser = Sentry::findUserByLogin($row[2]);
|
||||
|
||||
// Update the user details
|
||||
$udpateuser->password = $pass;
|
||||
|
||||
// Update the user
|
||||
$udpateuser->save();
|
||||
|
||||
|
||||
if (Input::get('email_user')==1) {
|
||||
// Send the credentials through email
|
||||
|
||||
$data = array();
|
||||
$data['email'] = $row[2];
|
||||
$data['first_name'] = $row[0];
|
||||
$data['password'] = $pass;
|
||||
|
||||
Mail::send('emails.send-login', $data, function ($m) use ($newuser) {
|
||||
$m->to($newuser['email'], $newuser['first_name'] . ' ' . $newuser['last_name']);
|
||||
$m->subject('Welcome ' . $newuser['first_name']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo 'Caught exception: ', $e->getMessage(), "\n";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
return Redirect::route('users')->with('duplicates',$duplicates)->with('success', 'Success');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class UpdateUsersTable extends Migration {
|
||||
|
||||
class UpdateUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -12,8 +12,7 @@ class UpdateUsersTable extends Migration {
|
||||
public function up()
|
||||
{
|
||||
// Update the users table
|
||||
Schema::table('users', function($table)
|
||||
{
|
||||
Schema::table('users', function ($table) {
|
||||
$table->softDeletes();
|
||||
$table->string('website')->nullable();
|
||||
$table->string('country')->nullable();
|
||||
@@ -29,8 +28,7 @@ class UpdateUsersTable extends Migration {
|
||||
public function down()
|
||||
{
|
||||
// Update the users table
|
||||
Schema::table('users', function($table)
|
||||
{
|
||||
Schema::table('users', function ($table) {
|
||||
$table->dropColumn('deleted_at', 'website', 'country', 'gravatar');
|
||||
});
|
||||
}
|
||||
|
||||
7
app/database/migrations/2013_11_13_075318_create_models_table.php
Normal file → Executable file
7
app/database/migrations/2013_11_13_075318_create_models_table.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateModelsTable extends Migration {
|
||||
|
||||
class CreateModelsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class CreateModelsTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('models', function($table)
|
||||
{
|
||||
Schema::create('models', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->string('modelno');
|
||||
|
||||
7
app/database/migrations/2013_11_13_075335_create_categories_table.php
Normal file → Executable file
7
app/database/migrations/2013_11_13_075335_create_categories_table.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateCategoriesTable extends Migration {
|
||||
|
||||
class CreateCategoriesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class CreateCategoriesTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('categories', function($table)
|
||||
{
|
||||
Schema::create('categories', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->integer('parent')->default(0);
|
||||
|
||||
7
app/database/migrations/2013_11_13_075347_create_manufacturers_table.php
Normal file → Executable file
7
app/database/migrations/2013_11_13_075347_create_manufacturers_table.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateManufacturersTable extends Migration {
|
||||
|
||||
class CreateManufacturersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class CreateManufacturersTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('manufacturers', function($table)
|
||||
{
|
||||
Schema::create('manufacturers', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
|
||||
7
app/database/migrations/2013_11_15_015858_add_user_id_to_categories.php
Normal file → Executable file
7
app/database/migrations/2013_11_15_015858_add_user_id_to_categories.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddUserIdToCategories extends Migration {
|
||||
|
||||
class AddUserIdToCategories extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddUserIdToCategories extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('categories', function($table)
|
||||
{
|
||||
Schema::table('categories', function ($table) {
|
||||
$table->integer('user_id');
|
||||
});
|
||||
}
|
||||
|
||||
7
app/database/migrations/2013_11_15_112701_add_user_id_to_manufacturers.php
Normal file → Executable file
7
app/database/migrations/2013_11_15_112701_add_user_id_to_manufacturers.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddUserIdToManufacturers extends Migration {
|
||||
|
||||
class AddUserIdToManufacturers extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddUserIdToManufacturers extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('manufacturers', function($table)
|
||||
{
|
||||
Schema::table('manufacturers', function ($table) {
|
||||
$table->integer('user_id');
|
||||
});
|
||||
}
|
||||
|
||||
7
app/database/migrations/2013_11_15_190327_create_assets_table.php
Normal file → Executable file
7
app/database/migrations/2013_11_15_190327_create_assets_table.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateAssetsTable extends Migration {
|
||||
|
||||
class CreateAssetsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class CreateAssetsTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('assets', function($table)
|
||||
{
|
||||
Schema::create('assets', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->string('asset_tag')->nullable();
|
||||
|
||||
7
app/database/migrations/2013_11_15_190357_create_licenses_table.php
Normal file → Executable file
7
app/database/migrations/2013_11_15_190357_create_licenses_table.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateLicensesTable extends Migration {
|
||||
|
||||
class CreateLicensesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class CreateLicensesTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('licenses', function($table)
|
||||
{
|
||||
Schema::create('licenses', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->integer('model_id');
|
||||
|
||||
4
app/database/migrations/2013_11_15_201848_add_license_name_to_licenses.php
Normal file → Executable file
4
app/database/migrations/2013_11_15_201848_add_license_name_to_licenses.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddLicenseNameToLicenses extends Migration {
|
||||
|
||||
class AddLicenseNameToLicenses extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
|
||||
7
app/database/migrations/2013_11_16_040323_create_depreciations_table.php
Normal file → Executable file
7
app/database/migrations/2013_11_16_040323_create_depreciations_table.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateDepreciationsTable extends Migration {
|
||||
|
||||
class CreateDepreciationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class CreateDepreciationsTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('depreciations', function($table)
|
||||
{
|
||||
Schema::create('depreciations', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->integer('months');
|
||||
|
||||
7
app/database/migrations/2013_11_16_042851_add_depreciation_id_to_models.php
Normal file → Executable file
7
app/database/migrations/2013_11_16_042851_add_depreciation_id_to_models.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddDepreciationIdToModels extends Migration {
|
||||
|
||||
class AddDepreciationIdToModels extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddDepreciationIdToModels extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('models', function($table)
|
||||
{
|
||||
Schema::table('models', function ($table) {
|
||||
$table->integer('depreciation_id')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
7
app/database/migrations/2013_11_16_084923_add_user_id_to_models.php
Normal file → Executable file
7
app/database/migrations/2013_11_16_084923_add_user_id_to_models.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddUserIdToModels extends Migration {
|
||||
|
||||
class AddUserIdToModels extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddUserIdToModels extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('models', function($table)
|
||||
{
|
||||
Schema::table('models', function ($table) {
|
||||
$table->integer('user_id');
|
||||
});
|
||||
}
|
||||
|
||||
7
app/database/migrations/2013_11_16_103258_create_locations_table.php
Normal file → Executable file
7
app/database/migrations/2013_11_16_103258_create_locations_table.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateLocationsTable extends Migration {
|
||||
|
||||
class CreateLocationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class CreateLocationsTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('locations', function($table)
|
||||
{
|
||||
Schema::create('locations', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->string('city');
|
||||
|
||||
7
app/database/migrations/2013_11_16_103336_add_location_id_to_assets.php
Normal file → Executable file
7
app/database/migrations/2013_11_16_103336_add_location_id_to_assets.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddLocationIdToAssets extends Migration {
|
||||
|
||||
class AddLocationIdToAssets extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddLocationIdToAssets extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('assets', function($table)
|
||||
{
|
||||
Schema::table('assets', function ($table) {
|
||||
$table->integer('location_id');
|
||||
});
|
||||
}
|
||||
|
||||
7
app/database/migrations/2013_11_16_103407_add_checkedout_to_to_assets.php
Normal file → Executable file
7
app/database/migrations/2013_11_16_103407_add_checkedout_to_to_assets.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddCheckedoutToToAssets extends Migration {
|
||||
|
||||
class AddCheckedoutToToAssets extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddCheckedoutToToAssets extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('assets', function($table)
|
||||
{
|
||||
Schema::table('assets', function ($table) {
|
||||
$table->integer('checkedout_to');
|
||||
});
|
||||
}
|
||||
|
||||
7
app/database/migrations/2013_11_16_103425_create_history_table.php
Normal file → Executable file
7
app/database/migrations/2013_11_16_103425_create_history_table.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateHistoryTable extends Migration {
|
||||
|
||||
class CreateHistoryTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class CreateHistoryTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('history', function($table)
|
||||
{
|
||||
Schema::create('history', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->integer('checkedout_to')->nullable;
|
||||
$table->integer('location_id')->nullable;
|
||||
|
||||
4
app/database/migrations/2013_11_17_054359_drop_licenses_table.php
Normal file → Executable file
4
app/database/migrations/2013_11_17_054359_drop_licenses_table.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class DropLicensesTable extends Migration {
|
||||
|
||||
class DropLicensesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
|
||||
7
app/database/migrations/2013_11_17_054526_add_physical_to_assets.php
Normal file → Executable file
7
app/database/migrations/2013_11_17_054526_add_physical_to_assets.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddPhysicalToAssets extends Migration {
|
||||
|
||||
class AddPhysicalToAssets extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -12,8 +12,7 @@ class AddPhysicalToAssets extends Migration {
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
Schema::table('assets', function($table)
|
||||
{
|
||||
Schema::table('assets', function ($table) {
|
||||
$table->boolean('physical')->default(1);
|
||||
$table->dropColumn('checkedout_to')->nullable();
|
||||
|
||||
|
||||
7
app/database/migrations/2013_11_17_055126_create_settings_table.php
Normal file → Executable file
7
app/database/migrations/2013_11_17_055126_create_settings_table.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateSettingsTable extends Migration {
|
||||
|
||||
class CreateSettingsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -12,8 +12,7 @@ class CreateSettingsTable extends Migration {
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
Schema::create('settings', function($table)
|
||||
{
|
||||
Schema::create('settings', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->string('option_name');
|
||||
$table->string('option_value');
|
||||
|
||||
7
app/database/migrations/2013_11_17_062634_add_license_to_assets.php
Normal file → Executable file
7
app/database/migrations/2013_11_17_062634_add_license_to_assets.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddLicenseToAssets extends Migration {
|
||||
|
||||
class AddLicenseToAssets extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddLicenseToAssets extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('assets', function($table)
|
||||
{
|
||||
Schema::table('assets', function ($table) {
|
||||
$table->string('license_name')->nullable();
|
||||
$table->string('license_email')->nullable();
|
||||
});
|
||||
|
||||
10
app/database/migrations/2013_11_18_134332_add_contacts_to_users.php
Normal file → Executable file
10
app/database/migrations/2013_11_18_134332_add_contacts_to_users.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddContactsToUsers extends Migration {
|
||||
|
||||
class AddContactsToUsers extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddContactsToUsers extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function($table)
|
||||
{
|
||||
Schema::table('users', function ($table) {
|
||||
$table->integer('location_id')->nullable();
|
||||
$table->string('phone');
|
||||
$table->string('jobtitle');
|
||||
@@ -27,8 +26,7 @@ class AddContactsToUsers extends Migration {
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function($table)
|
||||
{
|
||||
Schema::table('users', function ($table) {
|
||||
$table->dropColumn('location_id');
|
||||
$table->dropColumn('phone');
|
||||
$table->dropColumn('jobtitle');
|
||||
|
||||
10
app/database/migrations/2013_11_18_142847_add_info_to_locations.php
Normal file → Executable file
10
app/database/migrations/2013_11_18_142847_add_info_to_locations.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddInfoToLocations extends Migration {
|
||||
|
||||
class AddInfoToLocations extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddInfoToLocations extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('locations', function($table)
|
||||
{
|
||||
Schema::table('locations', function ($table) {
|
||||
|
||||
$table->string('address', 80);
|
||||
$table->string('address2', 80);
|
||||
@@ -28,8 +27,7 @@ class AddInfoToLocations extends Migration {
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('locations', function($table)
|
||||
{
|
||||
Schema::table('locations', function ($table) {
|
||||
|
||||
$table->dropColumn('address');
|
||||
$table->dropColumn('address2');
|
||||
|
||||
10
app/database/migrations/2013_11_18_152942_remove_location_id_from_asset.php
Normal file → Executable file
10
app/database/migrations/2013_11_18_152942_remove_location_id_from_asset.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class RemoveLocationIdFromAsset extends Migration {
|
||||
|
||||
class RemoveLocationIdFromAsset extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class RemoveLocationIdFromAsset extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('assets', function($table)
|
||||
{
|
||||
Schema::table('assets', function ($table) {
|
||||
$table->dropColumn('location_id');
|
||||
});
|
||||
}
|
||||
@@ -24,8 +23,7 @@ class RemoveLocationIdFromAsset extends Migration {
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('assets', function($table)
|
||||
{
|
||||
Schema::table('assets', function ($table) {
|
||||
$table->integer('location_id');
|
||||
});
|
||||
}
|
||||
|
||||
11
app/database/migrations/2013_11_18_164423_set_nullvalues_for_user.php
Normal file → Executable file
11
app/database/migrations/2013_11_18_164423_set_nullvalues_for_user.php
Normal file → Executable file
@@ -2,19 +2,20 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class SetNullvaluesForUser extends Migration {
|
||||
|
||||
class SetNullvaluesForUser extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @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');
|
||||
|
||||
}
|
||||
|
||||
|
||||
7
app/database/migrations/2013_11_19_013337_create_asset_logs_table.php
Normal file → Executable file
7
app/database/migrations/2013_11_19_013337_create_asset_logs_table.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateAssetLogsTable extends Migration {
|
||||
|
||||
class CreateAssetLogsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class CreateAssetLogsTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('asset_logs', function($table)
|
||||
{
|
||||
Schema::create('asset_logs', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->integer('user_id');
|
||||
$table->string('action_type');
|
||||
|
||||
6
app/database/migrations/2013_11_19_061409_edit_added_on_asset_logs_table.php
Normal file → Executable file
6
app/database/migrations/2013_11_19_061409_edit_added_on_asset_logs_table.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class EditAddedOnAssetLogsTable extends Migration {
|
||||
|
||||
class EditAddedOnAssetLogsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -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');
|
||||
|
||||
}
|
||||
|
||||
|
||||
10
app/database/migrations/2013_11_19_062250_edit_location_id_asset_logs_table.php
Normal file → Executable file
10
app/database/migrations/2013_11_19_062250_edit_location_id_asset_logs_table.php
Normal file → Executable file
@@ -2,9 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class EditLocationIdAssetLogsTable extends Migration {
|
||||
|
||||
|
||||
class EditLocationIdAssetLogsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -12,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');
|
||||
|
||||
}
|
||||
|
||||
|
||||
7
app/database/migrations/2013_11_20_055822_add_soft_delete_on_assets.php
Normal file → Executable file
7
app/database/migrations/2013_11_20_055822_add_soft_delete_on_assets.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddSoftDeleteOnAssets extends Migration {
|
||||
|
||||
class AddSoftDeleteOnAssets extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddSoftDeleteOnAssets extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('assets', function($table)
|
||||
{
|
||||
Schema::table('assets', function ($table) {
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
7
app/database/migrations/2013_11_20_121404_add_soft_delete_on_locations.php
Normal file → Executable file
7
app/database/migrations/2013_11_20_121404_add_soft_delete_on_locations.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddSoftDeleteOnLocations extends Migration {
|
||||
|
||||
class AddSoftDeleteOnLocations extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddSoftDeleteOnLocations extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('locations', function($table)
|
||||
{
|
||||
Schema::table('locations', function ($table) {
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
7
app/database/migrations/2013_11_20_123137_add_soft_delete_on_manufacturers.php
Normal file → Executable file
7
app/database/migrations/2013_11_20_123137_add_soft_delete_on_manufacturers.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddSoftDeleteOnManufacturers extends Migration {
|
||||
|
||||
class AddSoftDeleteOnManufacturers extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddSoftDeleteOnManufacturers extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('manufacturers', function($table)
|
||||
{
|
||||
Schema::table('manufacturers', function ($table) {
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
7
app/database/migrations/2013_11_20_123725_add_soft_delete_on_categories.php
Normal file → Executable file
7
app/database/migrations/2013_11_20_123725_add_soft_delete_on_categories.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddSoftDeleteOnCategories extends Migration {
|
||||
|
||||
class AddSoftDeleteOnCategories extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddSoftDeleteOnCategories extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('categories', function($table)
|
||||
{
|
||||
Schema::table('categories', function ($table) {
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
7
app/database/migrations/2013_11_20_130248_create_status_labels.php
Normal file → Executable file
7
app/database/migrations/2013_11_20_130248_create_status_labels.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateStatusLabels extends Migration {
|
||||
|
||||
class CreateStatusLabels extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class CreateStatusLabels extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('status_labels', function($table)
|
||||
{
|
||||
Schema::create('status_labels', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->string('name',100);
|
||||
$table->integer('user_id');
|
||||
|
||||
10
app/database/migrations/2013_11_20_130830_add_status_id_on_assets_table.php
Normal file → Executable file
10
app/database/migrations/2013_11_20_130830_add_status_id_on_assets_table.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddStatusIdOnAssetsTable extends Migration {
|
||||
|
||||
class AddStatusIdOnAssetsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddStatusIdOnAssetsTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('assets', function($table)
|
||||
{
|
||||
Schema::table('assets', function ($table) {
|
||||
$table->integer('status_id')->nullable();
|
||||
});
|
||||
}
|
||||
@@ -24,8 +23,7 @@ class AddStatusIdOnAssetsTable extends Migration {
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('assets', function($table)
|
||||
{
|
||||
Schema::table('assets', function ($table) {
|
||||
$table->dropColumn('status_id');
|
||||
});
|
||||
}
|
||||
|
||||
10
app/database/migrations/2013_11_20_131544_add_status_type_on_status_labels.php
Normal file → Executable file
10
app/database/migrations/2013_11_20_131544_add_status_type_on_status_labels.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddStatusTypeOnStatusLabels extends Migration {
|
||||
|
||||
class AddStatusTypeOnStatusLabels extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddStatusTypeOnStatusLabels extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('status_labels', function($table)
|
||||
{
|
||||
Schema::table('status_labels', function ($table) {
|
||||
$table->boolean('deployable');
|
||||
});
|
||||
}
|
||||
@@ -24,8 +23,7 @@ class AddStatusTypeOnStatusLabels extends Migration {
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('status_labels', function($table)
|
||||
{
|
||||
Schema::table('status_labels', function ($table) {
|
||||
$table->dropColumn('deployable');
|
||||
});
|
||||
}
|
||||
|
||||
10
app/database/migrations/2013_11_20_134103_add_archived_to_assets.php
Normal file → Executable file
10
app/database/migrations/2013_11_20_134103_add_archived_to_assets.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddArchivedToAssets extends Migration {
|
||||
|
||||
class AddArchivedToAssets extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddArchivedToAssets extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('assets', function($table)
|
||||
{
|
||||
Schema::table('assets', function ($table) {
|
||||
$table->boolean('archived');
|
||||
});
|
||||
}
|
||||
@@ -24,8 +23,7 @@ class AddArchivedToAssets extends Migration {
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('assets', function($table)
|
||||
{
|
||||
Schema::table('assets', function ($table) {
|
||||
$table->dropColumn('archived');
|
||||
});
|
||||
}
|
||||
|
||||
7
app/database/migrations/2013_11_21_002321_add_uploads_table.php
Normal file → Executable file
7
app/database/migrations/2013_11_21_002321_add_uploads_table.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddUploadsTable extends Migration {
|
||||
|
||||
class AddUploadsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddUploadsTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('asset_uploads', function($table)
|
||||
{
|
||||
Schema::create('asset_uploads', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->integer('user_id');
|
||||
$table->string('filename');
|
||||
|
||||
10
app/database/migrations/2013_11_21_024531_remove_deployable_boolean_from_status_labels.php
Normal file → Executable file
10
app/database/migrations/2013_11_21_024531_remove_deployable_boolean_from_status_labels.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class RemoveDeployableBooleanFromStatusLabels extends Migration {
|
||||
|
||||
class RemoveDeployableBooleanFromStatusLabels extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class RemoveDeployableBooleanFromStatusLabels extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('status_labels', function($table)
|
||||
{
|
||||
Schema::table('status_labels', function ($table) {
|
||||
$table->dropColumn('deployable');
|
||||
});
|
||||
}
|
||||
@@ -24,8 +23,7 @@ class RemoveDeployableBooleanFromStatusLabels extends Migration {
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('status_labels', function($table)
|
||||
{
|
||||
Schema::table('status_labels', function ($table) {
|
||||
$table->boolean('deployable');
|
||||
});
|
||||
}
|
||||
|
||||
10
app/database/migrations/2013_11_22_075308_add_option_label_to_settings_table.php
Normal file → Executable file
10
app/database/migrations/2013_11_22_075308_add_option_label_to_settings_table.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddOptionLabelToSettingsTable extends Migration {
|
||||
|
||||
class AddOptionLabelToSettingsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class AddOptionLabelToSettingsTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('settings', function($table)
|
||||
{
|
||||
Schema::table('settings', function ($table) {
|
||||
$table->string('option_label','80')->nullable();
|
||||
});
|
||||
}
|
||||
@@ -24,8 +23,7 @@ class AddOptionLabelToSettingsTable extends Migration {
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('settings', function($table)
|
||||
{
|
||||
Schema::table('settings', function ($table) {
|
||||
$table->dropColumn('option_label');
|
||||
});
|
||||
}
|
||||
|
||||
7
app/database/migrations/2013_11_22_213400_edits_to_settings_table.php
Normal file → Executable file
7
app/database/migrations/2013_11_22_213400_edits_to_settings_table.php
Normal file → Executable file
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class EditsToSettingsTable extends Migration {
|
||||
|
||||
class EditsToSettingsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -11,8 +11,7 @@ class EditsToSettingsTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('settings', function($table)
|
||||
{
|
||||
Schema::table('settings', function ($table) {
|
||||
$table->dropColumn('option_label');
|
||||
$table->dropColumn('option_name');
|
||||
$table->dropColumn('option_value');
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user