Compare commits
795 Commits
v1.2.3-bet
...
v2.0-pre-b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8842a85ee | ||
|
|
7255a8bb0c | ||
|
|
f5d4eb5842 | ||
|
|
7e5f32c9d8 | ||
|
|
e1724cf25f | ||
|
|
9936cf4a43 | ||
|
|
e9443a244c | ||
|
|
f8be47dfbf | ||
|
|
2d10931d6c | ||
|
|
4a5066054b | ||
|
|
84ffc1a728 | ||
|
|
74429d9075 | ||
|
|
c2d63915c3 | ||
|
|
fd59ca0802 | ||
|
|
de23ec5785 | ||
|
|
05f0b94bf6 | ||
|
|
f54c86db87 | ||
|
|
e714def74a | ||
|
|
a9e169261c | ||
|
|
665ffa6571 | ||
|
|
a22687abc5 | ||
|
|
1edce0a4fa | ||
|
|
7da7907fbd | ||
|
|
32a0f6eb92 | ||
|
|
1301119c9a | ||
|
|
c7f2dc83db | ||
|
|
82892a38b8 | ||
|
|
3664e75c47 | ||
|
|
61836f20c5 | ||
|
|
62d382d704 | ||
|
|
3746bc333b | ||
|
|
ccde517c88 | ||
|
|
f855bfd4ef | ||
|
|
674348b5a5 | ||
|
|
7d5810b656 | ||
|
|
1601bdd4eb | ||
|
|
552bdfdc2d | ||
|
|
d4af197b0e | ||
|
|
be685467eb | ||
|
|
7a0b3a7350 | ||
|
|
55f544829d | ||
|
|
bb7ce83c48 | ||
|
|
1d4cfcfd58 | ||
|
|
6915987239 | ||
|
|
3a44a7e8bb | ||
|
|
f2abbd0e8f | ||
|
|
62f8d002e3 | ||
|
|
0766ae2d17 | ||
|
|
95920be8ea | ||
|
|
588ff742fe | ||
|
|
a8cb5c1e7d | ||
|
|
1fb2878772 | ||
|
|
84e130d6aa | ||
|
|
edfa064fd4 | ||
|
|
3caded990a | ||
|
|
3bca2566d7 | ||
|
|
1aa4841868 | ||
|
|
fc1e8a4e4e | ||
|
|
bf3cb73070 | ||
|
|
d77e763f86 | ||
|
|
8ef3d00f22 | ||
|
|
5266c22890 | ||
|
|
26540b1aac | ||
|
|
39a3b93537 | ||
|
|
ba13101f64 | ||
|
|
ce55b7ab2f | ||
|
|
28a9f90a72 | ||
|
|
f2a2ccdab4 | ||
|
|
f2e1ec0928 | ||
|
|
17ca66f4a2 | ||
|
|
a43f075ff0 | ||
|
|
c87d4ad801 | ||
|
|
d94cc1f17d | ||
|
|
f30285eaea | ||
|
|
20d35953f1 | ||
|
|
537630bae4 | ||
|
|
85d6b062f3 | ||
|
|
74a9a176e9 | ||
|
|
94f8c61720 | ||
|
|
75b9b70a86 | ||
|
|
2e585f9cd2 | ||
|
|
edddf6ae80 | ||
|
|
ea0f2c5f34 | ||
|
|
826d3ccae8 | ||
|
|
fd7d4eb3f2 | ||
|
|
e8e0c7bfe4 | ||
|
|
ccdda7b8e8 | ||
|
|
9abafba180 | ||
|
|
2ed47a6089 | ||
|
|
818d1769b8 | ||
|
|
bf6674f6a0 | ||
|
|
ee08586279 | ||
|
|
ef75880398 | ||
|
|
221ae62ea5 | ||
|
|
40c59e664b | ||
|
|
61e3381b24 | ||
|
|
3dfa1e1ea7 | ||
|
|
c0fab2f425 | ||
|
|
ffdd437e47 | ||
|
|
76825441b9 | ||
|
|
8e83206556 | ||
|
|
2aa357f315 | ||
|
|
df59e7f699 | ||
|
|
5084836737 | ||
|
|
063e3bbea6 | ||
|
|
d0216d76f8 | ||
|
|
ec10526d69 | ||
|
|
49b746a811 | ||
|
|
1013580236 | ||
|
|
98d9a2e6f9 | ||
|
|
e4217af1ec | ||
|
|
3d4607ebd3 | ||
|
|
2be1d64de3 | ||
|
|
c3c4e9def2 | ||
|
|
16ec68e0b6 | ||
|
|
3ce9500d75 | ||
|
|
c699452473 | ||
|
|
d943408f44 | ||
|
|
a7aee2fe1c | ||
|
|
32f3740eda | ||
|
|
f42540fedf | ||
|
|
f25b90ee27 | ||
|
|
fdef266089 | ||
|
|
c4375f9fbc | ||
|
|
7820efc121 | ||
|
|
d0189fb076 | ||
|
|
e4517a8782 | ||
|
|
19604480bb | ||
|
|
704d66b6f3 | ||
|
|
6315c343a7 | ||
|
|
766b4b901f | ||
|
|
f671c89b14 | ||
|
|
03bd1498e8 | ||
|
|
f743bacd0f | ||
|
|
309158352e | ||
|
|
2540ac09ec | ||
|
|
5a6fe6ccf8 | ||
|
|
af2decea9d | ||
|
|
c69038d3ae | ||
|
|
9ea8316d74 | ||
|
|
5939e46eee | ||
|
|
a8a0a59982 | ||
|
|
73a08c031c | ||
|
|
123caf42c2 | ||
|
|
5997dd9387 | ||
|
|
9cf03e2e60 | ||
|
|
c77e7bf725 | ||
|
|
7a4299c724 | ||
|
|
b9b0239837 | ||
|
|
a43ae71afd | ||
|
|
c4339a5d94 | ||
|
|
b161a38e9b | ||
|
|
735268034d | ||
|
|
aad473486f | ||
|
|
08970f2b7b | ||
|
|
212f09dd31 | ||
|
|
8334e7b863 | ||
|
|
a80d67c1ff | ||
|
|
7c95f4231e | ||
|
|
6e8ad5b085 | ||
|
|
145d386ce2 | ||
|
|
496a768013 | ||
|
|
7415a5898f | ||
|
|
f1486bfee3 | ||
|
|
bc8521043b | ||
|
|
3597d71230 | ||
|
|
d92e2eaebc | ||
|
|
8cdea8a384 | ||
|
|
4457c7aec0 | ||
|
|
95279f885b | ||
|
|
94bfab762b | ||
|
|
20d8ad29e5 | ||
|
|
75644eb894 | ||
|
|
2d7a348ab7 | ||
|
|
139dd13392 | ||
|
|
2f52369d07 | ||
|
|
aab52d0850 | ||
|
|
71febc1c81 | ||
|
|
68d8b10b22 | ||
|
|
0d2333203a | ||
|
|
3881e2e83e | ||
|
|
51eeee09d7 | ||
|
|
c487beeaca | ||
|
|
f463cd6c8d | ||
|
|
5e7a4e8193 | ||
|
|
c8870ddcab | ||
|
|
bbdbd5397c | ||
|
|
527650d03b | ||
|
|
126121065c | ||
|
|
48ccf844fa | ||
|
|
7556f989df | ||
|
|
8207597a58 | ||
|
|
1137768f84 | ||
|
|
5f6925858b | ||
|
|
77d1d93ebc | ||
|
|
c95af84452 | ||
|
|
62b5ec5b02 | ||
|
|
9f9a9a51b3 | ||
|
|
a2dd2509fd | ||
|
|
3c00f38a0f | ||
|
|
767e2c69f3 | ||
|
|
3b491d4a6b | ||
|
|
179ef7f060 | ||
|
|
a0fce2e0fb | ||
|
|
bce06543b2 | ||
|
|
9841dbbbc4 | ||
|
|
d61506fcf7 | ||
|
|
6a7fcd5c40 | ||
|
|
b4b273fc43 | ||
|
|
495201ebf7 | ||
|
|
e6d0d83070 | ||
|
|
564d5fcb31 | ||
|
|
c0a58897c0 | ||
|
|
1c2e5ecc0f | ||
|
|
6109368799 | ||
|
|
f8ea40d3d1 | ||
|
|
2fb65c5682 | ||
|
|
c6419e1c07 | ||
|
|
ba58e718b4 | ||
|
|
30c8fffa0a | ||
|
|
a560d4db31 | ||
|
|
fe72139410 | ||
|
|
6f9daa28eb | ||
|
|
d408bb9086 | ||
|
|
5f3bc8e74b | ||
|
|
bd3409285f | ||
|
|
18a3ff67cb | ||
|
|
61eda122e4 | ||
|
|
6cb70e865e | ||
|
|
4b32c28f7e | ||
|
|
f0a9b2c71d | ||
|
|
2e0fa9126a | ||
|
|
63b1f3834e | ||
|
|
1a4f148318 | ||
|
|
9de083afa7 | ||
|
|
551b5c42d8 | ||
|
|
30966b14af | ||
|
|
9bbf933b05 | ||
|
|
f8143b6c7c | ||
|
|
efba1b9038 | ||
|
|
80090a41ec | ||
|
|
0cff78d127 | ||
|
|
e88a81141f | ||
|
|
c88ce0d14d | ||
|
|
33e7ce6761 | ||
|
|
766afdeeae | ||
|
|
1edd6d3542 | ||
|
|
9be50152b3 | ||
|
|
7ad6dda260 | ||
|
|
e4b45231ec | ||
|
|
6b853750e5 | ||
|
|
dc1380edd1 | ||
|
|
b53847cb61 | ||
|
|
06b465540d | ||
|
|
0a734d8502 | ||
|
|
98eda57188 | ||
|
|
46781c94cd | ||
|
|
3a06d8802d | ||
|
|
0e26480674 | ||
|
|
92a4f025d8 | ||
|
|
5529204b17 | ||
|
|
da43f44fea | ||
|
|
ff23616bb5 | ||
|
|
de59f654af | ||
|
|
7d9c90f8dd | ||
|
|
b0886f970a | ||
|
|
afdf00eacb | ||
|
|
51148f1371 | ||
|
|
d58cc8d490 | ||
|
|
0c827b318b | ||
|
|
5d946b19cb | ||
|
|
d2e23adf84 | ||
|
|
7d35fae0f4 | ||
|
|
605d0ed8e1 | ||
|
|
c92f09fddb | ||
|
|
2cde817ffb | ||
|
|
87bf51b033 | ||
|
|
06b3d6e5ce | ||
|
|
b32379393f | ||
|
|
bbcc8aa9ac | ||
|
|
865c302f71 | ||
|
|
2cf8256079 | ||
|
|
e2a2746ed6 | ||
|
|
6854c568c7 | ||
|
|
d952a1199b | ||
|
|
7f2ccc860b | ||
|
|
f0d3d1b036 | ||
|
|
d9b9224045 | ||
|
|
8685e90513 | ||
|
|
a9f15fbcae | ||
|
|
7d266fdc4e | ||
|
|
7f03c7538f | ||
|
|
d90d7d7ddd | ||
|
|
7881e70afb | ||
|
|
e61f254ffc | ||
|
|
678b7700b4 | ||
|
|
1d1c14ae21 | ||
|
|
66d1872230 | ||
|
|
faa999ab2b | ||
|
|
6678905d79 | ||
|
|
3e98f05564 | ||
|
|
35bbea3052 | ||
|
|
86623822f5 | ||
|
|
ad1a9396ac | ||
|
|
2c6597c5fb | ||
|
|
da983af2cb | ||
|
|
c79fd5ed30 | ||
|
|
2d9e49f245 | ||
|
|
75d5f494a3 | ||
|
|
40852f9a6a | ||
|
|
7f07f35beb | ||
|
|
c6be6f480e | ||
|
|
617cc67467 | ||
|
|
0c9bc4e59e | ||
|
|
72048a5267 | ||
|
|
80d2347095 | ||
|
|
fa794d7a15 | ||
|
|
85b6571bc3 | ||
|
|
14aa12eb09 | ||
|
|
8af799614e | ||
|
|
f9e0add436 | ||
|
|
3782531f57 | ||
|
|
fab313a908 | ||
|
|
4e70cfdb95 | ||
|
|
75bbbcb4ca | ||
|
|
abf91c7b29 | ||
|
|
603fccb26c | ||
|
|
333d858f33 | ||
|
|
c9628722cb | ||
|
|
e56ccb0c82 | ||
|
|
61d916d94d | ||
|
|
7e573c73f9 | ||
|
|
4aa4e7c9fc | ||
|
|
161d72390b | ||
|
|
53ab21b016 | ||
|
|
7bb9929624 | ||
|
|
25dea384fe | ||
|
|
ceb93926a3 | ||
|
|
e9a6261752 | ||
|
|
434dbe035c | ||
|
|
f5e14e59e9 | ||
|
|
c8bf26a3b3 | ||
|
|
139d206413 | ||
|
|
a341db4cf7 | ||
|
|
b66f55362f | ||
|
|
fdb92a2012 | ||
|
|
b3a75690f1 | ||
|
|
0292a0fee6 | ||
|
|
c14761b9a1 | ||
|
|
8404736662 | ||
|
|
9edcc39de2 | ||
|
|
1620186f5d | ||
|
|
94afe20c20 | ||
|
|
d254f9809f | ||
|
|
18209c2448 | ||
|
|
519575893d | ||
|
|
f794218b6f | ||
|
|
4932fe3397 | ||
|
|
4f18a71124 | ||
|
|
07e9ff4290 | ||
|
|
176264b317 | ||
|
|
4c3033d414 | ||
|
|
61e6d55bcf | ||
|
|
c00086c740 | ||
|
|
e01b1b3935 | ||
|
|
c2c0196a3d | ||
|
|
3da652216b | ||
|
|
0ffb5df40b | ||
|
|
cfc26b283c | ||
|
|
1a615f8941 | ||
|
|
41dd7a2b2a | ||
|
|
c0b61991ba | ||
|
|
1597461c02 | ||
|
|
46c1f2a28b | ||
|
|
77fd73bc1b | ||
|
|
3ad17d64b0 | ||
|
|
412ec53d08 | ||
|
|
6f3be59b14 | ||
|
|
fce4c4dcb1 | ||
|
|
bb7d3d1a85 | ||
|
|
ff7499e373 | ||
|
|
958a7298fe | ||
|
|
69b80dc9c6 | ||
|
|
60531450c8 | ||
|
|
cbfdb88e13 | ||
|
|
fcd62d72b1 | ||
|
|
e8355fe4ff | ||
|
|
aabf879464 | ||
|
|
41928e4bb9 | ||
|
|
6f38f76e4a | ||
|
|
5cfb2d5f6a | ||
|
|
f6141e59e4 | ||
|
|
d581fbc2c8 | ||
|
|
ab0a8b3b61 | ||
|
|
4243710378 | ||
|
|
2a0350b9d1 | ||
|
|
f58b448f6b | ||
|
|
1f0625cfa1 | ||
|
|
5e4175723c | ||
|
|
61f1b145b7 | ||
|
|
5db853dbdd | ||
|
|
87d6d83c41 | ||
|
|
1d3d41b808 | ||
|
|
fc81e404ca | ||
|
|
3af215de45 | ||
|
|
2244c60499 | ||
|
|
9cf2798424 | ||
|
|
e23c0cb89f | ||
|
|
1684d211ff | ||
|
|
96e40721b2 | ||
|
|
e94c24ded7 | ||
|
|
ebe13fd665 | ||
|
|
fe2d696f1f | ||
|
|
3656822ac9 | ||
|
|
009b66eccf | ||
|
|
da3743ad55 | ||
|
|
47136ca774 | ||
|
|
00b3556188 | ||
|
|
b2b11812bd | ||
|
|
5e5b32e060 | ||
|
|
662c3f04dd | ||
|
|
2cdfeacc1b | ||
|
|
7559f5836b | ||
|
|
b2af86230a | ||
|
|
482c28804a | ||
|
|
48481586ec | ||
|
|
f33844d4af | ||
|
|
35f3350ddf | ||
|
|
84affbafa6 | ||
|
|
ae2d2ca2be | ||
|
|
f9dcefcc21 | ||
|
|
cb171bcac5 | ||
|
|
b92e46180c | ||
|
|
62d5ed48f0 | ||
|
|
83c6371016 | ||
|
|
33dd59fb81 | ||
|
|
e72577cbd8 | ||
|
|
85c22c897a | ||
|
|
6a89728380 | ||
|
|
d31c12cfaf | ||
|
|
91d2b89d68 | ||
|
|
fb85ac8d07 | ||
|
|
7ef17365be | ||
|
|
00b16c6434 | ||
|
|
4fd17f267a | ||
|
|
54b63fa218 | ||
|
|
70c770a975 | ||
|
|
cbf1fc1988 | ||
|
|
a71ad5dd02 | ||
|
|
22942c3bef | ||
|
|
b98fa6075e | ||
|
|
d88b90c398 | ||
|
|
ff8b88d187 | ||
|
|
f532665f06 | ||
|
|
6bab442651 | ||
|
|
df0da15dbb | ||
|
|
696325ac8b | ||
|
|
f1afe1ed20 | ||
|
|
456d8e365a | ||
|
|
6746c18092 | ||
|
|
45ae13749d | ||
|
|
330a6d0f87 | ||
|
|
76a0ef8d83 | ||
|
|
4a175aea4e | ||
|
|
90536b1cc2 | ||
|
|
f62148b28c | ||
|
|
100ac9dba0 | ||
|
|
dba243b1f7 | ||
|
|
4c8239c03d | ||
|
|
dab3a7135c | ||
|
|
0dae4cef08 | ||
|
|
14280a277c | ||
|
|
e9ac0a3209 | ||
|
|
efebfe3a13 | ||
|
|
472b7056c9 | ||
|
|
984ef44a43 | ||
|
|
94e8ca0c86 | ||
|
|
58a8d2f077 | ||
|
|
9f38a62fe5 | ||
|
|
c79e830888 | ||
|
|
ad25c048c4 | ||
|
|
bb33e3c831 | ||
|
|
f62f22b4bf | ||
|
|
7d339624b8 | ||
|
|
f27fb90457 | ||
|
|
2115c82587 | ||
|
|
4076b29b63 | ||
|
|
817384b761 | ||
|
|
3f9d9f23d5 | ||
|
|
7d5ee9750f | ||
|
|
1c333e4a24 | ||
|
|
4ae624a541 | ||
|
|
2540e90c37 | ||
|
|
2d196b1595 | ||
|
|
18fc20777b | ||
|
|
61b04d6e40 | ||
|
|
3263543d84 | ||
|
|
9ea4386354 | ||
|
|
ac23e8fd02 | ||
|
|
6bb3f222ea | ||
|
|
d7b7a3a4a8 | ||
|
|
4502582beb | ||
|
|
9355fcb58f | ||
|
|
c6f23e7b27 | ||
|
|
b986b3276c | ||
|
|
3e3935485f | ||
|
|
7047af44f6 | ||
|
|
2d5e9b6ea5 | ||
|
|
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 | ||
|
|
dede09e9c5 | ||
|
|
f39922f51f | ||
|
|
5268c579e2 | ||
|
|
21448ea8e6 | ||
|
|
5c98dae57d | ||
|
|
5a6139fb64 | ||
|
|
0fb2728e3f |
@@ -1,37 +0,0 @@
|
||||
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/*
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
@@ -7,6 +7,7 @@ composer.phar
|
||||
/app/database/*.sqlite
|
||||
/app/storage/meta/services.json
|
||||
/app/config/*/mail.php
|
||||
/app/config/*/session.php
|
||||
/app/config/*/database.php
|
||||
/app/config/*/app.php
|
||||
public/packages/*
|
||||
@@ -17,4 +18,11 @@ public/uploads/avatars/*
|
||||
/app/storage/debugbar/
|
||||
/bin/
|
||||
.idea
|
||||
crowdin.yaml
|
||||
crowdin.yaml
|
||||
public/uploads/logo.gif
|
||||
public/uploads/logo.png
|
||||
.siteflow
|
||||
public/assets/.siteflow
|
||||
.settings/settings.json
|
||||
|
||||
|
||||
|
||||
170
CHANGELOG.md
170
CHANGELOG.md
@@ -1,5 +1,175 @@
|
||||
|
||||
|
||||
### v1.2.6.1 - Released Mar 12, 2015 08:25:28
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/7047af44f6544d2eeed0f0fcefdbdd44489f189a">view</a> • Fixed layout for remember me button
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/4502582beb064ffeee4a1cdf892f513e58534014">view</a> • Trying to fix pre-commit hook :(
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/61b04d6e40baa9054e1701455259d8d62fa868ff">view</a> • Fixes #579 - user cannot accept more than once
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/2d196b1595ec87f119ad5a82f8f676918c52c896">view</a> • Fixes #602 for strict_mode
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/2540e90c37f37515d8d0277a4152c4b8198a4222">view</a> • Fixes #605 - hides user requestable view from admins
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/1c333e4a24a4950418175a8c354d7541637b7658">view</a> • Fixes #596 - better routes for checking in multiple items from user
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/7d5ee9750f912d85ac0c7f42e2beaba7e026989c">view</a> • Added #596 fix for accessories
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/3f9d9f23d5190052deb1f36be919c650e8f773b8">view</a> • Fixes #280 - updated link to use config url
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/817384b7615a301d6d692aefe6e41cd92ecfd6e1">view</a> • Fixes #597 - print-friendly view on users
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/2115c82587e06049245f17f9d710fbc7a61e57b9">view</a> • Fixed DB format for nullable EULA
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/f62f22b4bf1399c3b98041dfe17f4cc8450847b2">view</a> • ref #599. showing groups in user detail view. fixes a small design bug with group edit view
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/ad25c048c4a52a7f80a479a3b7d621aaad18b1d7">view</a> • Updated Sentry version to fix #625
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/d31c12cfafb2ba323973964215f033bd9aeb1f9b">view</a> • Merge pull request #629 from uberbrady/unicode_fix
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/33dd59fb814089c81886c0264b2356df2b212864">view</a> • Fix #637 - Remove Deleted Models from drop down
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/cb171bcac5c4ccbb347f370e3d2b28783378c0b2">view</a> • Fixes #645 - adds zip and rar to filetype
|
||||
|
||||
|
||||
### v1.2.6 - Released Feb 28, 2015 08:27:45
|
||||
|
||||
|
||||
### v1.2.6-beta - Released Feb 27, 2015 03:17:06
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/30df21c7aa2582bc3b1efbfd788c1aea2733aa7d">view</a> • Fixed missing checkedout-to info on asset view
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/70ae59ed6260101bcfb6e3cbd6309ecb9c1c935a">view</a> • Fixed a bug when no assets are in table that the autoincrement method blows up. Also optimzed the logic to get max id instead of popping top off creation date.
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/f8e12cabd4af8875abd759a3c9d6c2216cb88601">view</a> • Fixes #476 - added logo upload and header color
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/f85061f988a946f1d4a284fbfc8c442636c1364c">view</a> • Fix #541 - Headers not being skipped if checked
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/8b3e22b58e080b44e4de809b8598283fa6ba5bb0">view</a> • Fixes #546 - only insert data if values exist
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/083cb1b5ec51aa2b6932a59b9436a1a45fad5460">view</a> • Fix activate for strict db
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/35cf5b3d609fec2bc3613bdae42d338448413520">view</a> • Fixes #423
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/097bb38a231795aa52ff772a38887700e828256d">view</a> • Fixes #163 - accept acceptance + eula
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/b2af455523fcca1bb02018b38fdb6dc4861819d8">view</a> • Merge conflict resolution. Added a use at the same line as remote. Fixed
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/8879bff16084b2cfa0280fcb1f83d3f90368797f">view</a> • Fixed bug for reporting on upload in dashboard
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/3135869d5a3fafcf70e49dcbb99e36c2ec04ddd0">view</a> • Fixed font path
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/a5a1c4223b357b9cc2751a28e0c4e3085e476733">view</a> • Fixed chevrons
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/734dc49564e4f970846f786177c9d2928284fb5f">view</a> • Fixed icon
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/a6232cbfd8050ace613259df56afae243954c625">view</a> • Fix language string for create accessory
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/c2bbc1281ccdda65caa55665c66c78613142099f">view</a> • Mobile fixes
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/29863004e2e622a9b3b4616abdcd92f2b950bebe">view</a> • more small mobile fixes
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/8eaa70c39b3ace90a517387dc91f452aede18958">view</a> • Fixes #567 - bug in depreciation report csv export
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/e41621def05994302627cd4a6a81abd8e43c86be">view</a> • Fixed relation between accessory and category
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/9f3edd701b51a7aecf792e5736534c1bb15aca9a">view</a> • Fixes #565 - Soft Delete Models and Allow Restore
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/528c06cf7fb4f5c35d4b90eb256c0d195b8366b7">view</a> • Reverting icon fix
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/1ac401f0c036eca0cec1df0986d4c7e1903556fa">view</a> • Fixed EULA mail
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/6d16c97902dadad2351b627f3157257774a075f3">view</a> • Fixed back arrow
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/3e189d3502f8147c012b641cc366394875e9005c">view</a> • Fixes #538 - sortable tables
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/31df29cac878deeb75d8b9b5a2efc7c84ef4b592">view</a> • Fixed funky layout from datatables
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/efaf067b948899d0b784f47092dc3bc22fe504ca">view</a> • Fixed user relationship
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/5010720a976019306e37b89f5aa0e917c0ffdea3">view</a> • Fixed accessory relationship
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/a20e1f6943eab11fc937fcfeb3fe99dc0d520734">view</a> • Fixed attach to relation
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/19ad8970d76a1676de3494b758efa65c0ed6a5c1">view</a> • Fixed arrow icon
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/430b8233ed6f23402597fe54215b9988a3405dd7">view</a> • Fixed user relationship
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/c0c563b1c77ff9942212af89384c8ded40b83b29">view</a> • Fixes accessory relationshop for pivot
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/ef6eae63d86f159a170c3a322a44e08bab827080">view</a> • Fixed error icon
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/d33dcbbcb12172527cec977f679198f594ac975b">view</a> • Fixed bad method call in accessories on delete
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/04735f1affd2fdff9d6cf96ed583ece895cfb341">view</a> • Fixed assetlog display
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/c484afb12b0720eaba2d28f501bf547e2ad9caa9">view</a> • Fixed typo for accessories accept
|
||||
|
||||
|
||||
### v1.2.5 - Released Feb 18, 2015 03:18:10
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/00f7717142e11b90764ffce2d554c566f8ad219f">view</a> • Fix #475 and styling
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/49f25a23a99c08606d58101e039a885b89503fa7">view</a> • Merge pull request #516 from splaer/fix-475
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/58ff929d7193b054073ef46ae2fafdef51d51919">view</a> • Fixes error when no model present because new asset
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/f57c61dd4d789635cee6f62899807b1a7928800e">view</a> • Possible fix for #518 - license count issue
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/064c0211dbb310d1dfdb126e3ce2cee72a80f628">view</a> • Fix #517 - User Requestable Assets
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/4a5007264e1712250726047162df91041d12d28c">view</a> • Fixed mac address not showing
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/17258b73a1c09918960d894702a0ae341a18f0b8">view</a> • Fixes #520 - state no longer required
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/f40bb7b8b3a17ff772c797a3f91a845b068be3d2">view</a> • Fixes #520 postal code requirement
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/08ee02d0cd4d1ff9ed2b0600b75390c1e34c1f53">view</a> • Fixes #525 - added serial to asset model UI
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/24f5cdc743acd55ead02282e13e07f3cbd3551b0">view</a> • Fixes #523 - added file uploads to assets
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/e02bea4275306fb3d2696e3018066b4b1486fa8d">view</a> • Fixes #457 - added bulk options to hardware
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/4e4144ea749974332f645fa77eb74fbbfef51b90">view</a> • Fixed blade reference
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/b32d74de57a3a26326a220236838f57550549ca5">view</a> • Fixed seeder with duplicate ID
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/ea6a6d098ad1795fc5463c61b72240cdcd8a43e7">view</a> • Fixes #440 - removed unique constraint on serial
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/38961298ed6efe3649fdbf4b1e9b3278ab85567a">view</a> • Fixes #439 - loads javascript and CSS locally
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/063e5c407c8f817c16026887be16eeb42598417f">view</a> • Fixed the depreciation report, fixes to calculate current depreciated value (which were only used there). Additional fixes and refactoring around Depreciable, in terms of how assets get depreciation via models, and licenses get depreciation directly.
|
||||
|
||||
|
||||
### v1.2.4 - Released Feb 12, 2015 06:57:47
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/2277b6ee699a78108523eee11695a280e76b1bb4">view</a> • Fixed checkout logic for new assigned_to
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/dbc93de6b3966470f83254547f8029c60f489490">view</a> • Fixes checkin button on view
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/c06a4d4118039d112b69e48f9d4efc2be796f2e0">view</a> • Fixed wonky checkin/checkout buttons
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/31f4ba88f655e1386f2f4f0efae84399f7aa6d52">view</a> • Fix RTD query to not display checked out asset
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/5867c604104781c351f870ff3e0fd4b4d6eeb35a">view</a> • Fixed scope chaining on assigned_to
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/a2178392e65bcc35594d516a20f67eea8466e5c1">view</a> • Fixed seeder
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/7715731c4a2e423afb94873227eb728ad4877221">view</a> • Fix count in header
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/c2e532e32e4943e251dcb5fdd005e9b65d9798a5">view</a> • Fixed language file for status label messages
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/f36029a34a696d89b1058c9abdca7953d51e2bc4">view</a> • Fixed migration for to set assigned_to to null per #506
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/f72b38579037d76b5b188c5d85e24ca567e2480b">view</a> • Fix licenses so null instead of 0
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/34032c73ceee7a9666680f21bf7490fdc32dbdb6">view</a> • Fixed licenses so null instead of 0
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/7b165a12e05396b72381fc2789124acd2b98a2b8">view</a> • Fixes #508 - compacted UI for licenses overview
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/c89be345033bfbed326ffd4207a63438ea09378f">view</a> • Fixes #329 and #454 - added category asset view
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/35a133bbf9f7330a038dda2e79995b9825ca7633">view</a> • Fixes #382 - allow admins to restore deleted assets
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/80e10c4c9838ae4acea8847ed907c6ad05bfac1a">view</a> • Fixes #387 - sortable asset view by manufacturer
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/e343c157c5998d6f30a4e25da23ad1092d50c103">view</a> • Fixed naming conflict for requestable
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/cd5a352961a1e1e8d90368abf81fedee5ce94bef">view</a> • Fix for wrong math on remaining licenses when assigned to an asset
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/342a8b81afb2060a128d0667acc15fa5caafc2ea">view</a> • Fix for error when asset has null status
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/8cdd2156143864974423bea70521d45db6d0cb9c">view</a> • Fixed intenting
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/fbf03b225d732e12821bfc83b9bae7fb7b4b8be8">view</a> • Fixes #509 - added MAC address as model option
|
||||
|
||||
|
||||
### v1.2.4-beta - Released Feb 11, 2015 01:11:40
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/389c27b2e691743eb361cc1fbe4ece4259ae6046">view</a> • Fixes #477 - wrong sidebar on asset view
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/7009b24748edab02921c609c26bc549fa96dcd2f">view</a> • Merge pull request #498 from snipe/fixes/477
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/c1600a33db6d4463d27f74f87389489210de700e">view</a> • Fixes #499 - timestamps in asset logs
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/b360736b7728d2ac872193bbe8888037c9794494">view</a> • Fixes #484
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/addfcd4bc5417784f95145394940f90f1302376f">view</a> • Fix RTD bug
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/d2438f9fdb9b281025c17e22ac2bfaa07ce04a2d">view</a> • Fixes #502 - normalized statuses
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/aef3a734a3530f109b82fc0897e25727293f9862">view</a> • Small fix for pending status
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/f175f52530e58bd5ab80139c526fc7838750cb11">view</a> • Fixed spacer in sidenav for list all
|
||||
|
||||
|
||||
### v1.2.3 - Released Feb 09, 2015 12:22:12
|
||||
|
||||
|
||||
### v1.2.3-beta - Released Feb 07, 2015 06:02:52
|
||||
#### This is a pre-release
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/950567e9d66a6836cbca1383d24fc8548d3cbadf">view</a> • Fixes issue related to #471 - assigning to user ID 0 causes erro
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/2b86f14e30c155f72b903428fd05a896ee9adfcc">view</a> • Possible fix for #484 - fullname issue
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/b3af102d22a2f4f147b863e0ba8c2e4064aad01a">view</a> • Fixed safe mode issue with license seeder
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/1db806f8b283e13dd04f20335d7087d12a04fa23">view</a> • Fixes #488 - longer user jobtitle
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/f5efc368a58e1b26689dadb285918b090b66eb59">view</a> • Fixes #487 - maintained and purchase order in strict mode
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/4dc81ce65fddced3282a9255a5a31ba8aa6a1458">view</a> • Resolves #478 - redirects non-reporting users to view assets page
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/cd338d2a70e1bd4dca3bc651813e51095d7155f0">view</a> • Fixes #483 - line breaks in notes on view
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/e67ba8a7437d4f27ae869072898e65749602f2dd">view</a> • Fix reporting error on depreciation
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/1aeb4de0fae723801f0cdb555c77b5ee17ae1919">view</a> • Possible fix for #491 - solving for giticide on package dep
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/c255edaf617872ac4a896106e56cc816209c2d5b">view</a> • More travis fixes
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/feeef4b66c1b6049a1f18c67e034907ea26c7da9">view</a> • Fix for asset log incorrectly using soft deletes
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/140bd137a48c199269d635aef57d14b1f0a4330a">view</a> • Minor display fixes
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/29f5b7c5e3adc994b727842730c0157429520197">view</a> • Fixed datetime
|
||||
|
||||
|
||||
### v1.2.2 - Released Jan 22, 2015 11:41:36
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/4a77dee79c18f0e2ab155c7024234150ce98b808">view</a> • Fixes #447 - added asset log entry on save
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/d85e5246807e597c1efac85c368a642a6fdcf944">view</a> • Fixes #451 - allows spaces in state name
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/95141d49ba3c4f2b17ed6a26c20e7ad2a8aac9cb">view</a> • Fixes #432 - add model name to checkout
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/3787a3f4bab9908f4903abdc2951cc254c8dc911">view</a> • Fixed language strings for incrementing IDs
|
||||
|
||||
|
||||
### v1.2.1 - Released Jan 22, 2015 09:24:01
|
||||
|
||||
|
||||
### v1.2.0 - Released Jan 22, 2015 09:24:01
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/8699a90093bd27c0502dcc25f6e7d55344d54a3b">view</a> • Fixed changelog
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/cff24309a1514f9ea991881ca72898c7a6358562">view</a> • Possibly fixes #343
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/b2d5dc9ec5460ff1f02db6c1a31ea87d224de4c9">view</a> • Fix #342
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/74ae2fceea68d18514e87edc008cb3016361beee">view</a> • Fix class on th
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/fc2d472ed350d7d63fb97942d00a97b62d4bed55">view</a> • Fixed english language string
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/89c7159c56f88bcf8459a5eb02d79d636335cb28">view</a> • Fix array check for empty rows
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/7ddc6d497af13e7894031ac763939be9863889a4">view</a> • Fix Report Langs
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/13b173409fcd5b5ce8e79566b5110eadcf51c233">view</a> • Fix License form langs
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/b73ae3147a60b29ac455063ecf419a609cce2cac">view</a> • Fixes #362, reduced asset name to 2 char min
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/637009054cc74b17e2dd226c6f8c467eed5b0962">view</a> • Fixed typo in english
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/6905d82fc48998f9c95c454c8bf37a34e30c002e">view</a> • Fixes #374 to keep the requirement to PHP 5.4
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/102481631330fbed894bf72510845bff6c88e59e">view</a> • Fix #377 - Checkout users last_name, first_name
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/d6a0249c60cbb026b2e3190285d50723a76f22ee">view</a> • Fixed #373 - added ability to auto-increment asset tags
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/1b41c974cf67c550b2cae39eeec8f90cb2da79e0">view</a> • Fixes #348 - remove constraints on license keys
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/89a2b87e42c18b308835ef71d196b91002b451ef">view</a> • Fixes #367 - added model number to dropdown
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/64c16a0bacfcde7c4d92971f2129f1b1aeac2c0e">view</a> • Fixes #386 and #273 - altered column type to text
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/daefc86e5878a21f9909806599f22198360c1f9b">view</a> • Formattig fixes for #386
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/73dd339772fcc35e50603ded115f67714620da69">view</a> • Fix #388 - License not showing checked out in view
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/0663ccb99fa926ff944dded330ba1f0cd95abbb3">view</a> • Check if ->adminuser->id isset before trying to print the fullName so we can catch when a user that created an asset has been deleted. Fixes #349
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/533be7f942cb6dfccd1e8a79c043d61791e4c54b">view</a> • fixed #435. using namespace with route groups to increase the readability
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/e434616db83a8d693af63b4705e1b24476fc3c17">view</a> • Merge pull request #436 from rashivkp/fix-435
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/5e496672c66428a1bbd37772aabd44f8bb1cb0fa">view</a> • Fixes #469
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/3c141e8f5017e8f161b6fd1fb82b288283b8450c">view</a> • Fixes #467
|
||||
* <a href="http://github.com/snipe/snipe-it/commit/548de1a1a217e6b5c6fcbbf6cd4918f078e64542">view</a> • Fixes #468 - updated ordering on license checkout
|
||||
|
||||
|
||||
### 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
|
||||
|
||||
15
CODE_OF_CONDUCT.md
Normal file
15
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Contributor Code of Conduct
|
||||
|
||||
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
||||
|
||||
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
||||
|
||||
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
||||
|
||||
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.1.0, available at [http://contributor-covenant.org/version/1/1/0/](http://contributor-covenant.org/version/1/1/0/)
|
||||
@@ -1,6 +1,10 @@
|
||||
# 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!
|
||||
**Before opening an issue to report a bug or request help, make sure you've checked the [Common Issues](http://snipeitapp.com/documentation/common-issues/) and [Getting Help](http://snipeitapp.com/documentation/getting-help/) pages.**
|
||||
|
||||
## Developing on Snipe-IT
|
||||
|
||||
Please submit all 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.
|
||||
|
||||
@@ -19,3 +23,9 @@ The labels we use in GitHub Issues and Waffle.io indicate whether we've confirme
|
||||
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!
|
||||
|
||||
-----
|
||||
|
||||
## Contributor Code of Conduct
|
||||
|
||||
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
||||
|
||||
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
|
||||
11
README.md
11
README.md
@@ -7,16 +7,16 @@
|
||||
|
||||
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.1](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.
|
||||
|
||||
This project is being actively developed and we're [releasing quite frequently](https://github.com/snipe/snipe-it/releases). ([Check out the live demo here](http://snipeitapp.com/demo.php).)
|
||||
This project is being actively developed and we're [releasing quite frequently](https://github.com/snipe/snipe-it/releases). ([Check out the live demo here](http://snipeitapp.com/demo/).)
|
||||
|
||||
__This is web-based software__. This means there there is no executable file (aka no .exe files), and it must be run on a web server and accessed through a web browser. It runs on any Mac OSX, flavor of Linux, as well as Windows.
|
||||
|
||||
-----
|
||||
### Documentation & Installation
|
||||
|
||||
__Installation and configuration documentation for this project has been moved to http://docs.snipeitapp.com.__ This provides a more easily navigated, organized view of the documentation, and is based off of the [documentation branch](https://github.com/snipe/snipe-it/tree/documentation) in this repo. Contributions and bugfixes to the documentation are always welcome!
|
||||
__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.
|
||||
|
||||
@@ -65,3 +65,8 @@ 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.
|
||||
|
||||
## Contributor Code of Conduct
|
||||
|
||||
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class AppCommand extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = '';
|
||||
protected $description = 'This command kicks off your database table creation and migration, and creates your first admin user.';
|
||||
|
||||
/**
|
||||
* Holds the user information.
|
||||
@@ -28,10 +28,12 @@ class AppCommand extends Command
|
||||
protected $userData = array(
|
||||
'first_name' => null,
|
||||
'last_name' => null,
|
||||
'email' => null,
|
||||
'username' => null,
|
||||
'password' => null
|
||||
);
|
||||
|
||||
protected $dummyData = true;
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
@@ -64,9 +66,10 @@ class AppCommand extends Command
|
||||
// Let's ask the user some questions, shall we?
|
||||
$this->askUserFirstName();
|
||||
$this->askUserLastName();
|
||||
$this->askUserEmail();
|
||||
$this->askUserUsername();
|
||||
$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));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -147,7 +162,7 @@ class AppCommand extends Command
|
||||
}
|
||||
|
||||
/**
|
||||
* Asks the user for the user email address.
|
||||
* Asks the user for the username address.
|
||||
*
|
||||
* @return void
|
||||
* @todo Use the Laravel Validator
|
||||
@@ -156,7 +171,7 @@ class AppCommand extends Command
|
||||
{
|
||||
do {
|
||||
// Ask the user to input the email address
|
||||
$email = $this->ask('Please enter your user email: ');
|
||||
$email = $this->ask('Please enter your email: ');
|
||||
|
||||
// Check if email is valid
|
||||
if ($email == '') {
|
||||
@@ -170,6 +185,32 @@ class AppCommand extends Command
|
||||
while ( ! $email);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Asks the user for the username address.
|
||||
*
|
||||
* @return void
|
||||
* @todo Use the Laravel Validator
|
||||
*/
|
||||
protected function askUserUsername()
|
||||
{
|
||||
do {
|
||||
// Ask the user to input the username
|
||||
$username = $this->ask('Please enter your username: ');
|
||||
|
||||
// Check if username is valid
|
||||
if ($username == '') {
|
||||
// Return an error message
|
||||
$this->error('Username is invalid. Please try again.');
|
||||
}
|
||||
|
||||
// Store the username address
|
||||
$this->userData['username'] = $username;
|
||||
}
|
||||
while ( ! $username);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Asks the user for the user password.
|
||||
*
|
||||
@@ -182,7 +223,7 @@ class AppCommand extends Command
|
||||
// Ask the user to input the user password
|
||||
$password = $this->ask('Please enter your user password (at least 8 characters): ');
|
||||
|
||||
// Check if email is valid
|
||||
// Check if password is valid
|
||||
if ($password == '') {
|
||||
// Return an error message
|
||||
$this->error('Password is invalid. Please try again.');
|
||||
@@ -193,6 +234,20 @@ class AppCommand extends Command
|
||||
} 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? Y/n (default is yes): ');
|
||||
|
||||
$this->dummyData = ( strstr($dummydata, 'Y' ) || empty($dummydata) ) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs all the necessary Sentry commands.
|
||||
*
|
||||
@@ -207,7 +262,10 @@ class AppCommand extends Command
|
||||
$this->sentryCreateUser();
|
||||
|
||||
// Create dummy user
|
||||
$this->sentryCreateDummyUser();
|
||||
if( $this->dummyData === true )
|
||||
{
|
||||
$this->sentryCreateDummyUser();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -286,6 +344,7 @@ class AppCommand extends Command
|
||||
$data = array_merge($this->userData, array(
|
||||
'activated' => 1,
|
||||
'manager_id' => NULL,
|
||||
'notes' => 'Generated on install',
|
||||
'permissions' => array(
|
||||
'admin' => 1,
|
||||
'user' => 1,
|
||||
@@ -296,7 +355,7 @@ class AppCommand extends Command
|
||||
$user = Sentry::getUserProvider()->create($data);
|
||||
|
||||
// Associate the Admin group to this user
|
||||
$group = Sentry::getGroupProvider()->findById(1);
|
||||
$group = Sentry::findGroupByName('Admin');
|
||||
$user->addGroup($group);
|
||||
|
||||
// Show the success message
|
||||
@@ -317,7 +376,9 @@ class AppCommand extends Command
|
||||
'first_name' => 'John',
|
||||
'last_name' => 'Doe',
|
||||
'email' => 'john.doe@example.com',
|
||||
'password' => 'johndoe',
|
||||
'username' => 'john.doe@example.com',
|
||||
'password' => substr(str_shuffle(str_repeat('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', mt_rand(1,10))),1,10),
|
||||
'notes' => 'Generated on install',
|
||||
'activated' => 1,
|
||||
'manager_id' => 1,
|
||||
);
|
||||
|
||||
275
app/commands/ImportCommand.php
Normal file
275
app/commands/ImportCommand.php
Normal file
@@ -0,0 +1,275 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use League\Csv\Reader;
|
||||
|
||||
class ImportCommand extends Command {
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'import:csv';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Import from CSV';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function fire()
|
||||
{
|
||||
$filename = $this->argument('filename');
|
||||
|
||||
|
||||
if (!$this->option('testrun')=='true') {
|
||||
$this->comment('======= Importing '.$filename.' =========');
|
||||
} else {
|
||||
$this->comment('====== TEST ONLY Import for '.$filename.' ====');
|
||||
$this->comment('============== NO DATA WILL BE WRITTEN ==============');
|
||||
}
|
||||
|
||||
if (! ini_get("auto_detect_line_endings")) {
|
||||
ini_set("auto_detect_line_endings", '1');
|
||||
}
|
||||
|
||||
$csv = Reader::createFromPath($this->argument('filename'));
|
||||
$csv->setNewline("\r\n");
|
||||
$csv->setOffset(1);
|
||||
$duplicates = '';
|
||||
|
||||
// Loop through the records
|
||||
$nbInsert = $csv->each(function ($row) use ($duplicates) {
|
||||
$status_id = 1;
|
||||
|
||||
if (is_numeric($row[0])) {
|
||||
$this->comment('User '.$row[0].' is not a name - assume this user already exists');
|
||||
} elseif ($row[0]=='') {
|
||||
$this->comment('No user data provided - skipping user creation, just adding asset');
|
||||
} else {
|
||||
|
||||
// Generate an email based on their name
|
||||
$name = explode(" ", $row[0]);
|
||||
$first_name = $name[0];
|
||||
$last_name = '';
|
||||
$email_last_name = '';
|
||||
|
||||
if ($first_name=='Unknown') {
|
||||
$status_id = 7;
|
||||
}
|
||||
|
||||
if (!array_key_exists(1, $name)) {
|
||||
$last_name='';
|
||||
$email_last_name = $last_name;
|
||||
$email_prefix = $first_name;
|
||||
} else {
|
||||
// Loop through the rest of the explode so you don't truncate
|
||||
for ($x=0; $x < count($name); $x++) {
|
||||
if (($x > 0) && ($name[$x]!='')) {
|
||||
$last_name.=' '.$name[$x];
|
||||
$email_last_name.=$name[$x];
|
||||
}
|
||||
}
|
||||
$email_prefix = $first_name[0].$email_last_name;
|
||||
}
|
||||
|
||||
$email = strtolower(str_replace('.','',$email_prefix)).'@'.$this->option('domain');
|
||||
$email = str_replace("'",'',$email);
|
||||
|
||||
$this->comment('Full Name: '.$row[0]);
|
||||
$this->comment('First Name: '.$first_name);
|
||||
$this->comment('Last Name: '.$last_name);
|
||||
$this->comment('Email: '.$email);
|
||||
$this->comment('Category Name: '.$row[1]);
|
||||
$this->comment('Item: '.$row[2]);
|
||||
$this->comment('Manufacturer ID: '.$row[3]);
|
||||
$this->comment('Model No: '.$row[4]);
|
||||
$this->comment('Serial No: '.$row[5]);
|
||||
$this->comment('Asset Tag: '.$row[6]);
|
||||
$this->comment('Location: '.$row[7]);
|
||||
}
|
||||
|
||||
$this->comment('------------- Action Summary ----------------');
|
||||
|
||||
if (isset($email)) {
|
||||
if ($user = User::where('email', $email)->first()) {
|
||||
$this->comment('User '.$email.' already exists');
|
||||
} else {
|
||||
// Create the user
|
||||
$user = Sentry::createUser(array(
|
||||
'first_name' => $first_name,
|
||||
'last_name' => $last_name,
|
||||
'email' => $email,
|
||||
'password' => substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10),
|
||||
'activated' => true,
|
||||
'permissions' => array(
|
||||
'admin' => 0,
|
||||
'user' => 1,
|
||||
),
|
||||
'notes' => 'Imported user'
|
||||
));
|
||||
|
||||
// Find the group using the group id
|
||||
$userGroup = Sentry::findGroupById(3);
|
||||
|
||||
// Assign the group to the user
|
||||
$user->addGroup($userGroup);
|
||||
$this->comment('User '.$first_name.' created');
|
||||
}
|
||||
} else {
|
||||
$user = new User;
|
||||
}
|
||||
|
||||
// Check for the location match and create it if it doesn't exist
|
||||
if ($location = Location::where('name', $row[7])->first()) {
|
||||
$this->comment('Location '.$row[7].' already exists');
|
||||
} else {
|
||||
$location = new Location();
|
||||
$location->name = e($row[7]);
|
||||
$location->address = '';
|
||||
$location->city = '';
|
||||
$location->state = '';
|
||||
$location->country = '';
|
||||
$location->user_id = 1;
|
||||
|
||||
if (!$this->option('testrun')=='true') {
|
||||
|
||||
if ($location->save()) {
|
||||
$this->comment('Location '.$row[7].' was created');
|
||||
} else {
|
||||
$this->comment('Something went wrong! Location '.$row[1].' was NOT created');
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->comment('Location '.$row[7].' was (not) created - test run only');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Check for the category match and create it if it doesn't exist
|
||||
if ($category = Category::where('name', $row[1])->where('category_type', 'asset')->first()) {
|
||||
$this->comment('Category '.$row[1].' already exists');
|
||||
} else {
|
||||
$category = new Category();
|
||||
$category->name = e($row[1]);
|
||||
$category->category_type = 'asset';
|
||||
$category->user_id = 1;
|
||||
|
||||
if ($category->save()) {
|
||||
$this->comment('Category '.$row[1].' was created');
|
||||
} else {
|
||||
$this->comment('Something went wrong! Category '.$row[1].' was NOT created');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Check for the manufacturer match and create it if it doesn't exist
|
||||
if ($manufacturer = Manufacturer::where('name', $row[3])->first()) {
|
||||
$this->comment('Manufacturer '.$row[3].' already exists');
|
||||
} else {
|
||||
$manufacturer = new Manufacturer();
|
||||
$manufacturer->name = e($row[3]);
|
||||
$manufacturer->user_id = 1;
|
||||
|
||||
if ($manufacturer->save()) {
|
||||
$this->comment('Manufacturer '.$row[3].' was created');
|
||||
} else {
|
||||
$this->comment('Something went wrong! Manufacturer '.$row[3].' was NOT created');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Check for the asset model match and create it if it doesn't exist
|
||||
if ($asset_model = Model::where('name', $row[2])->where('modelno', $row[4])->where('category_id', $category->id)->where('manufacturer_id', $manufacturer->id)->first()) {
|
||||
$this->comment('The Asset Model '.$row[2].' with model number '.$row[4].' already exists');
|
||||
} else {
|
||||
$asset_model = new Model();
|
||||
$asset_model->name = e($row[2]);
|
||||
$asset_model->manufacturer_id = $manufacturer->id;
|
||||
$asset_model->modelno = e($row[4]);
|
||||
$asset_model->category_id = $category->id;
|
||||
$asset_model->user_id = 1;
|
||||
|
||||
if ($asset_model->save()) {
|
||||
$this->comment('Asset Model '.$row[2].' with model number '.$row[4].' was created');
|
||||
} else {
|
||||
$this->comment('Something went wrong! Asset Model '.$row[2].' was NOT created');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Check for the asset match and create it if it doesn't exist
|
||||
|
||||
$asset = new Asset();
|
||||
$asset->name = e($row[2]);
|
||||
$asset->serial = e($row[5]);
|
||||
$asset->asset_tag = e($row[6]);
|
||||
$asset->model_id = $asset_model->id;
|
||||
$asset->assigned_to = $user->id;
|
||||
$asset->rtd_location_id = $location->id;
|
||||
$asset->user_id = 1;
|
||||
$asset->status_id = $status_id;
|
||||
|
||||
if ($asset->save()) {
|
||||
$this->comment('Asset '.$row[2].' with serial number '.$row[5].' was created');
|
||||
} else {
|
||||
$this->comment('Something went wrong! Asset '.$row[5].' was NOT created');
|
||||
}
|
||||
|
||||
|
||||
$this->comment('=====================================');
|
||||
|
||||
return true;
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the console command arguments.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getArguments()
|
||||
{
|
||||
return array(
|
||||
array('filename', InputArgument::REQUIRED, 'File for the CSV import.'),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the console command options.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
return array(
|
||||
array('domain', null, InputOption::VALUE_REQUIRED, 'Email domain for generated email addresses.', null),
|
||||
array('testrun', null, InputOption::VALUE_REQUIRED, 'Test the output without writing to the database or not.', null),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
130
app/commands/SendExpirationAlerts.php
Normal file
130
app/commands/SendExpirationAlerts.php
Normal file
@@ -0,0 +1,130 @@
|
||||
<?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
|
||||
$expiring_assets = Asset::getExpiringWarrantee(60);
|
||||
$this->info(count($expiring_assets).' expiring assets');
|
||||
|
||||
$asset_data['count'] = count($expiring_assets);
|
||||
$asset_data['email_content'] ='';
|
||||
$now = date("Y-m-d");
|
||||
|
||||
|
||||
foreach ($expiring_assets as $asset) {
|
||||
|
||||
$expires = $asset->warrantee_expires();
|
||||
$difference = round(abs(strtotime($expires) - strtotime($now))/86400);
|
||||
|
||||
if ($difference > 30) {
|
||||
$asset_data['email_content'] .= '<tr style="background-color: #fcffa3;">';
|
||||
} else {
|
||||
$asset_data['email_content'] .= '<tr style="background-color:#d9534f;">';
|
||||
}
|
||||
$asset_data['email_content'] .= '<td><a href="'.Config::get('app.url').'/hardware/'.$asset->id.'/view">';
|
||||
$asset_data['email_content'] .= $asset->showAssetName().'</a></td><td>'.$asset->asset_tag.'</td>';
|
||||
$asset_data['email_content'] .= '<td>'.$asset->warrantee_expires().'</td>';
|
||||
$asset_data['email_content'] .= '<td>'.$difference.' days</td>';
|
||||
$asset_data['email_content'] .= '</tr>';
|
||||
}
|
||||
|
||||
// Expiring licenses
|
||||
$expiring_licenses = License::getExpiringLicenses(60);
|
||||
$this->info(count($expiring_licenses).' expiring licenses');
|
||||
|
||||
|
||||
$license_data['count'] = count($expiring_licenses);
|
||||
$license_data['email_content'] = '';
|
||||
|
||||
foreach ($expiring_licenses as $license) {
|
||||
$expires = $license->expiration_date;
|
||||
$difference = round(abs(strtotime($expires) - strtotime($now))/86400);
|
||||
|
||||
if ($difference > 30) {
|
||||
$license_data['email_content'] .= '<tr style="background-color: #fcffa3;">';
|
||||
} else {
|
||||
$license_data['email_content'] .= '<tr style="background-color:#d9534f;">';
|
||||
}
|
||||
$license_data['email_content'] .= '<td><a href="'.Config::get('app.url').'/admin/licenses/'.$license->id.'/view">';
|
||||
$license_data['email_content'] .= $license->name.'</a></td>';
|
||||
$license_data['email_content'] .= '<td>'.$license->expiration_date.'</td>';
|
||||
$license_data['email_content'] .= '<td>'.$difference.' days</td>';
|
||||
$license_data['email_content'] .= '</tr>';
|
||||
}
|
||||
|
||||
if ((Setting::getSettings()->alert_email!='') && (Setting::getSettings()->alerts_enabled==1)) {
|
||||
|
||||
|
||||
if (count($expiring_assets) > 0) {
|
||||
Mail::send('emails.expiring-assets-report', $asset_data, function ($m) {
|
||||
$m->to(Setting::getSettings()->alert_email, Setting::getSettings()->site_name);
|
||||
$m->subject('Expiring Assets Report');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if (count($expiring_licenses) > 0) {
|
||||
Mail::send('emails.expiring-licenses-report', $license_data, function ($m) {
|
||||
$m->to(Setting::getSettings()->alert_email, Setting::getSettings()->site_name);
|
||||
$m->subject('Expiring Licenses 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";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
65
app/commands/SystemBackup.php
Normal file
65
app/commands/SystemBackup.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
|
||||
class SystemBackup extends Command {
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'snipeit:backup';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'This commandcreates a database dump and zips up all of the uploaded files in the upload directories.';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function fire()
|
||||
{
|
||||
//
|
||||
$files['avatars'] = glob(public_path().'/uploads/avatars/*');
|
||||
$files['models'] = glob(public_path().'/uploads/models/*');
|
||||
$files['suppliers'] = glob(public_path().'/uploads/suppliers/*');
|
||||
$files['private_uploads'] = glob(app_path().'/private_uploads/*');
|
||||
$base_filename = date('Ymdgis');
|
||||
$zip_file = app_path().'/storage/dumps/'.$base_filename.'-backup.zip';
|
||||
$db_dump = Config::get('backup::path').$base_filename.'-db.sql';
|
||||
$this->call('db:backup', array('filename' => $db_dump));
|
||||
|
||||
Zipper::make($zip_file)
|
||||
->folder('avatars')->add($files['avatars'])
|
||||
->folder('models')->add($files['models'])
|
||||
->folder('suppliers')->add($files['suppliers'])
|
||||
->folder('private_uploads')->add($files['private_uploads'])
|
||||
->folder('database')->add($db_dump)->close();
|
||||
|
||||
$this->info('Backup file created at '.$zip_file);
|
||||
$this->info('Removing SQL dump at '.$db_dump);
|
||||
unlink($db_dump);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
89
app/commands/Versioning.php
Normal file
89
app/commands/Versioning.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
|
||||
class Versioning extends Command {
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'versioning:update';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Generate and update app\'s version via git.';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function fire()
|
||||
{
|
||||
// Path to the file containing your version
|
||||
// This will be overwritten everything you commit a message
|
||||
$versionFile = app_path().'/config/version.php';
|
||||
|
||||
// The git's output
|
||||
// get the argument passed in the git command
|
||||
$hash_version = $this->argument('app_version');
|
||||
|
||||
// discard the commit hash
|
||||
$version = explode('-', $hash_version);
|
||||
$realVersion = $version[0] . '-' . $version[1];
|
||||
|
||||
// save the version array to a variable
|
||||
$array = var_export(array('app_version' => $realVersion,'hash_version' => $hash_version), true);
|
||||
|
||||
|
||||
// Construct our file content
|
||||
$content = <<<CON
|
||||
<?php
|
||||
return $array;
|
||||
CON;
|
||||
|
||||
// And finally write the file and output the current version
|
||||
\File::put($versionFile, $content);
|
||||
$this->line('Setting version: '. \Config::get('version.latest'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the console command arguments.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getArguments()
|
||||
{
|
||||
return array(
|
||||
array('app_version', InputArgument::REQUIRED, 'version number is required.'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the console command options.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
return array(
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,20 @@ return array(
|
||||
|
||||
'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,
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Autoloaded Service Providers
|
||||
@@ -87,6 +101,10 @@ return array(
|
||||
'Barryvdh\Debugbar\ServiceProvider',
|
||||
'Cartalyst\Sentry\SentryServiceProvider',
|
||||
'Chumper\Datatable\DatatableServiceProvider',
|
||||
'Dinesh\Barcode\BarcodeServiceProvider',
|
||||
'Maknz\Slack\SlackServiceProvider',
|
||||
'Schickling\Backup\BackupServiceProvider',
|
||||
'Chumper\Zipper\ZipperServiceProvider',
|
||||
|
||||
),
|
||||
|
||||
@@ -156,7 +174,12 @@ return array(
|
||||
'Str' => 'Illuminate\Support\Str',
|
||||
'URL' => 'Illuminate\Support\Facades\URL',
|
||||
'Validator' => 'Illuminate\Support\Facades\Validator',
|
||||
'View' => 'Illuminate\Support\Facades\View'
|
||||
'View' => 'Illuminate\Support\Facades\View',
|
||||
'Reader' => 'League\Csv\Reader',
|
||||
'DNS1D' => 'Dinesh\Barcode\Facades\DNS1DFacade',
|
||||
'DNS2D' => 'Dinesh\Barcode\Facades\DNS2DFacade',
|
||||
'Slack' => 'Maknz\Slack\Facades\Slack',
|
||||
'Zipper' => 'Chumper\Zipper\Zipper',
|
||||
|
||||
),
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ return array(
|
||||
|
|
||||
*/
|
||||
|
||||
'host' => 'smtp.mailgun.org',
|
||||
'host' => 'smtp.mandrillapp.com',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
140
app/config/local/session.example.php
Normal file
140
app/config/local/session.example.php
Normal file
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Session Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default session "driver" that will be used on
|
||||
| requests. By default, we will use the lightweight native driver but
|
||||
| you may specify any of the other wonderful drivers provided here.
|
||||
|
|
||||
| Supported: "file", "cookie", "database", "apc",
|
||||
| "memcached", "redis", "array"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'file',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Lifetime
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the number of minutes that you wish the session
|
||||
| to be allowed to remain idle before it expires. If you want them
|
||||
| to immediately expire on the browser closing, set that option.
|
||||
|
|
||||
*/
|
||||
|
||||
'lifetime' => 12000,
|
||||
|
||||
'expire_on_close' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session File Location
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the native session driver, we need a location where session
|
||||
| files may be stored. A default has been set for you but a different
|
||||
| location may be specified. This is only needed for file sessions.
|
||||
|
|
||||
*/
|
||||
|
||||
'files' => storage_path().'/sessions',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Connection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" or "redis" session drivers, you may specify a
|
||||
| connection that should be used to manage these sessions. This should
|
||||
| correspond to a connection in your database configuration options.
|
||||
|
|
||||
*/
|
||||
|
||||
'connection' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" session driver, you may specify the table we
|
||||
| should use to manage the sessions. Of course, a sensible default is
|
||||
| provided for you; however, you are free to change this as needed.
|
||||
|
|
||||
*/
|
||||
|
||||
'table' => 'sessions',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Sweeping Lottery
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Some session drivers must manually sweep their storage location to get
|
||||
| rid of old sessions from storage. Here are the chances that it will
|
||||
| happen on a given request. By default, the odds are 2 out of 100.
|
||||
|
|
||||
*/
|
||||
|
||||
'lottery' => array(2, 100),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may change the name of the cookie used to identify a session
|
||||
| instance by ID. The name specified here will get used every time a
|
||||
| new session cookie is created by the framework for every driver.
|
||||
|
|
||||
*/
|
||||
|
||||
'cookie' => 'snipeit_session',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The session cookie path determines the path for which the cookie will
|
||||
| be regarded as available. Typically, this will be the root path of
|
||||
| your application but you are free to change this when necessary.
|
||||
|
|
||||
*/
|
||||
|
||||
'path' => '/',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Domain
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may change the domain of the cookie used to identify a session
|
||||
| in your application. This will determine which domains the cookie is
|
||||
| available to in your application. A sensible default has been set.
|
||||
|
|
||||
*/
|
||||
|
||||
'domain' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| HTTPS Only Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By setting this option to true, session cookies will only be sent back
|
||||
| to the server if the browser has a HTTPS connection. This will keep
|
||||
| the cookie from being sent to you if it can not be done securely.
|
||||
|
|
||||
*/
|
||||
|
||||
'secure' => false,
|
||||
|
||||
);
|
||||
@@ -134,7 +134,7 @@ return array(
|
||||
|
|
||||
*/
|
||||
|
||||
'login_attribute' => 'email',
|
||||
'login_attribute' => 'username',
|
||||
|
||||
),
|
||||
|
||||
|
||||
0
app/config/packages/chumper/datatable/.gitkeep
Normal file
0
app/config/packages/chumper/datatable/.gitkeep
Normal file
210
app/config/packages/chumper/datatable/config.php
Normal file
210
app/config/packages/chumper/datatable/config.php
Normal file
@@ -0,0 +1,210 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Table specific configuration options.
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
|
||||
'table' => array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Table class
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Class(es) added to the table
|
||||
| Supported: string
|
||||
|
|
||||
*/
|
||||
|
||||
'class' => 'table table-bordered',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Table ID
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| ID given to the table. Used for connecting the table and the Datatables
|
||||
| jQuery plugin. If left empty a random ID will be generated.
|
||||
| Supported: string
|
||||
|
|
||||
*/
|
||||
|
||||
'id' => '',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DataTable options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| jQuery dataTable plugin options. The array will be json_encoded and
|
||||
| passed through to the plugin. See https://datatables.net/usage/options
|
||||
| for more information.
|
||||
| Supported: array
|
||||
|
|
||||
*/
|
||||
|
||||
'options' => array(
|
||||
|
||||
"pagingType" => "full_numbers",
|
||||
'processing'=>true,
|
||||
'language'=>array(
|
||||
'processing'=>'<i class="fa fa-spinner fa-spin"></i> Loading...'
|
||||
),
|
||||
'deferRender'=> true,
|
||||
'stateSave'=> true,
|
||||
'paging'=>true,
|
||||
'pageLength'=> Setting::getSettings()->per_page,
|
||||
'lengthMenu'=>array(array(10,25,50,75,100,125,150,-1), array(10,25,50,75,100,125,150,'All')),
|
||||
'tableTools' => array(
|
||||
'sSwfPath'=> Config::get('app.url').'/assets/swf/copy_csv_xls_pdf.swf',
|
||||
'aButtons'=>array(
|
||||
array(
|
||||
'sExtends'=>'copy',
|
||||
'sButtonText'=>'Copy',
|
||||
'mColumns'=>'visible',
|
||||
'bFooter'=>false,
|
||||
),
|
||||
array(
|
||||
'sExtends'=>'print',
|
||||
'sButtonText'=>'Print',
|
||||
'mColumns'=>'visible',
|
||||
'bShowAll'=>true,
|
||||
),
|
||||
array(
|
||||
'sExtends'=>'collection',
|
||||
'sButtonText'=>'Export',
|
||||
'aButtons'=>array(
|
||||
array(
|
||||
'sExtends'=>'csv',
|
||||
'sButtonText'=>'csv',
|
||||
'mColumns'=>'visible',
|
||||
'bFooter'=>false,
|
||||
),
|
||||
array(
|
||||
'sExtends'=>'xls',
|
||||
'sButtonText'=>'XLS',
|
||||
'mColumns'=>'visible',
|
||||
'bFooter'=>false,
|
||||
),
|
||||
array(
|
||||
'sExtends'=>'pdf',
|
||||
'sButtonText'=>'PDF',
|
||||
'mColumns'=>'visible',
|
||||
'bFooter'=>false,
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DataTable callbacks
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| jQuery dataTable plugin callbacks. The array will be json_encoded and
|
||||
| passed through to the plugin. See https://datatables.net/usage/callbacks
|
||||
| for more information.
|
||||
| Supported: array
|
||||
|
|
||||
*/
|
||||
|
||||
'callbacks' => array(
|
||||
"stateSaveCallback"=>"function (oSettings, oData) {
|
||||
localStorage.setItem('DataTables_'+window.location.pathname, JSON.stringify(oData));
|
||||
}",
|
||||
"stateLoadCallback"=>"function (oSettings) {
|
||||
return JSON.parse(localStorage.getItem('DataTables_'+window.location.pathname));
|
||||
}",
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Skip javascript in table template
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Determines if the template should echo the javascript
|
||||
| Supported: boolean
|
||||
|
|
||||
*/
|
||||
|
||||
'noScript' => false,
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Table view
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Template used to render the table
|
||||
| Supported: string
|
||||
|
|
||||
*/
|
||||
|
||||
'table_view' => 'datatable::template',
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Script view
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Template used to render the javascript
|
||||
| Supported: string
|
||||
|
|
||||
*/
|
||||
|
||||
'script_view' => 'datatable::javascript',
|
||||
|
||||
|
||||
),
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Engine specific configuration options.
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
|
||||
'engine' => array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Search for exact words
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If the search should be done with exact matching
|
||||
| Supported: boolean
|
||||
|
|
||||
*/
|
||||
|
||||
'exactWordSearch' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable to display all records.
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Be careful! It may be overloaded with large record.
|
||||
| Supported: boolean
|
||||
|
|
||||
*/
|
||||
'enableDisplayAll' => false,
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Limit display when iDisplayLength invaild
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'defaultDisplayLength' => 10,
|
||||
)
|
||||
|
||||
|
||||
);
|
||||
31
app/config/packages/fideloper/proxy/config.example.php
Normal file
31
app/config/packages/fideloper/proxy/config.example.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Trusted Proxies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Set an array of trusted proxies, so Laravel knows to grab the client's
|
||||
| information via the X-Forwarded-* headers.
|
||||
|
|
||||
| To trust all proxies, use the value '*':
|
||||
|
|
||||
| 'proxies' => '*'
|
||||
|
|
||||
|
|
||||
| To trust only specific proxies (recommended), set an array of those
|
||||
| proxies' IP addresses:
|
||||
|
|
||||
| 'proxies' => array('192.168.1.1', '192.168.1.2')
|
||||
|
|
||||
|
|
||||
| Or use CIDR notation:
|
||||
|
|
||||
| 'proxies' => array('192.168.12.0/23')
|
||||
|
|
||||
*/
|
||||
|
||||
'proxies' => '*',
|
||||
|
||||
);
|
||||
0
app/config/packages/maknz/slack/.gitkeep
Normal file
0
app/config/packages/maknz/slack/.gitkeep
Normal file
122
app/config/packages/maknz/slack/config.php
Normal file
122
app/config/packages/maknz/slack/config.php
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|-------------------------------------------------------------
|
||||
| Incoming webhook endpoint
|
||||
|-------------------------------------------------------------
|
||||
|
|
||||
| The endpoint which Slack generates when creating a
|
||||
| new incoming webhook. It will look something like
|
||||
| https://hooks.slack.com/services/XXXXXXXX/XXXXXXXX/XXXXXXXXXXXXXX
|
||||
|
|
||||
*/
|
||||
|
||||
'endpoint' => '',
|
||||
|
||||
/*
|
||||
|-------------------------------------------------------------
|
||||
| Default channel
|
||||
|-------------------------------------------------------------
|
||||
|
|
||||
| The default channel we should post to. The channel can either be a
|
||||
| channel like #general, a private #group, or a @username. Set to
|
||||
| null to use the default set on the Slack webhook
|
||||
|
|
||||
*/
|
||||
|
||||
'channel' => '#general',
|
||||
|
||||
/*
|
||||
|-------------------------------------------------------------
|
||||
| Default username
|
||||
|-------------------------------------------------------------
|
||||
|
|
||||
| The default username we should post as. Set to null to use
|
||||
| the default set on the Slack webhook
|
||||
|
|
||||
*/
|
||||
|
||||
'username' => 'Snipe-IT Bot',
|
||||
|
||||
/*
|
||||
|-------------------------------------------------------------
|
||||
| Default icon
|
||||
|-------------------------------------------------------------
|
||||
|
|
||||
| The default icon to use. This can either be a URL to an image or Slack
|
||||
| emoji like :ghost: or :heart_eyes:. Set to null to use the default
|
||||
| set on the Slack webhook
|
||||
|
|
||||
*/
|
||||
|
||||
'icon' => null,
|
||||
|
||||
/*
|
||||
|-------------------------------------------------------------
|
||||
| Link names
|
||||
|-------------------------------------------------------------
|
||||
|
|
||||
| Whether names like @regan should be converted into links
|
||||
| by Slack
|
||||
|
|
||||
*/
|
||||
|
||||
'link_names' => false,
|
||||
|
||||
/*
|
||||
|-------------------------------------------------------------
|
||||
| Unfurl links
|
||||
|-------------------------------------------------------------
|
||||
|
|
||||
| Whether Slack should unfurl links to text-based content
|
||||
|
|
||||
*/
|
||||
|
||||
'unfurl_links' => false,
|
||||
|
||||
/*
|
||||
|-------------------------------------------------------------
|
||||
| Unfurl media
|
||||
|-------------------------------------------------------------
|
||||
|
|
||||
| Whether Slack should unfurl links to media content such
|
||||
| as images and YouTube videos
|
||||
|
|
||||
*/
|
||||
|
||||
'unfurl_media' => true,
|
||||
|
||||
/*
|
||||
|-------------------------------------------------------------
|
||||
| Markdown in message text
|
||||
|-------------------------------------------------------------
|
||||
|
|
||||
| Whether message text should be interpreted in Slack's Markdown-like
|
||||
| language. For formatting options, see Slack's help article: http://goo.gl/r4fsdO
|
||||
|
|
||||
*/
|
||||
|
||||
'allow_markdown' => true,
|
||||
|
||||
/*
|
||||
|-------------------------------------------------------------
|
||||
| Markdown in attachments
|
||||
|-------------------------------------------------------------
|
||||
|
|
||||
| Which attachment fields should be interpreted in Slack's Markdown-like
|
||||
| language. By default, Slack assumes that no fields in an attachment
|
||||
| should be formatted as Markdown.
|
||||
|
|
||||
*/
|
||||
|
||||
'markdown_in_attachments' => [],
|
||||
|
||||
// Allow Markdown in just the text and title fields
|
||||
// 'markdown_in_attachments' => ['text', 'title']
|
||||
|
||||
// Allow Markdown in all fields
|
||||
// 'markdown_in_attachments' => ['pretext', 'text', 'title', 'fields', 'fallback']
|
||||
|
||||
];
|
||||
15
app/config/packages/schickling/backup/config.example.php
Normal file
15
app/config/packages/schickling/backup/config.example.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
return array(
|
||||
'path' => storage_path() . '/dumps/',
|
||||
|
||||
'mysql' => array(
|
||||
'dump_command_path' => '',
|
||||
'restore_command_path' => '',
|
||||
),
|
||||
|
||||
's3' => array(
|
||||
'path' => ''
|
||||
),
|
||||
|
||||
'compress' => false,
|
||||
);
|
||||
@@ -13,7 +13,7 @@ return array(
|
||||
|
|
||||
*/
|
||||
|
||||
'debug' => true,
|
||||
'debug' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -26,7 +26,7 @@ return array(
|
||||
|
|
||||
*/
|
||||
|
||||
'url' => 'http://staging.yourserver.com',
|
||||
'url' => 'https://production.yourserver.com',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
@@ -28,7 +28,7 @@ return array(
|
||||
|
|
||||
*/
|
||||
|
||||
'host' => 'smtp.mailgun.org',
|
||||
'host' => 'smtp.mandrillapp.com',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
154
app/config/production/session.example.php
Normal file
154
app/config/production/session.example.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Session Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default session "driver" that will be used on
|
||||
| requests. By default, we will use the lightweight native driver but
|
||||
| you may specify any of the other wonderful drivers provided here.
|
||||
|
|
||||
| Supported: "file", "cookie", "database", "apc",
|
||||
| "memcached", "redis", "array"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'file',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Lifetime
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the number of minutes that you wish the session
|
||||
| to be allowed to remain idle before it expires. If you want them
|
||||
| to immediately expire on the browser closing, set that option.
|
||||
|
|
||||
*/
|
||||
|
||||
'lifetime' => 12000,
|
||||
|
||||
'expire_on_close' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session File Location
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the native session driver, we need a location where session
|
||||
| files may be stored. A default has been set for you but a different
|
||||
| location may be specified. This is only needed for file sessions.
|
||||
|
|
||||
*/
|
||||
|
||||
'files' => storage_path().'/sessions',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Connection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" or "redis" session drivers, you may specify a
|
||||
| connection that should be used to manage these sessions. This should
|
||||
| correspond to a connection in your database configuration options.
|
||||
|
|
||||
*/
|
||||
|
||||
'connection' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" session driver, you may specify the table we
|
||||
| should use to manage the sessions. Of course, a sensible default is
|
||||
| provided for you; however, you are free to change this as needed.
|
||||
|
|
||||
*/
|
||||
|
||||
'table' => 'sessions',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Sweeping Lottery
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Some session drivers must manually sweep their storage location to get
|
||||
| rid of old sessions from storage. Here are the chances that it will
|
||||
| happen on a given request. By default, the odds are 2 out of 100.
|
||||
|
|
||||
*/
|
||||
|
||||
'lottery' => array(2, 100),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may change the name of the cookie used to identify a session
|
||||
| instance by ID. The name specified here will get used every time a
|
||||
| new session cookie is created by the framework for every driver.
|
||||
|
|
||||
*/
|
||||
|
||||
'cookie' => 'snipeit_session',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The session cookie path determines the path for which the cookie will
|
||||
| be regarded as available. Typically, this will be the root path of
|
||||
| your application but you are free to change this when necessary.
|
||||
|
|
||||
*/
|
||||
|
||||
'path' => '/',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Domain
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may change the domain of the cookie used to identify a session
|
||||
| in your application. This will determine which domains the cookie is
|
||||
| available to in your application. A sensible default has been set.
|
||||
|
|
||||
*/
|
||||
|
||||
'domain' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| HTTPS Only Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By setting this option to true, session cookies will only be sent back
|
||||
| to the server if the browser has a HTTPS connection. This will keep
|
||||
| the cookie from being sent to you if it can not be done securely.
|
||||
|
|
||||
*/
|
||||
|
||||
'secure' => false,
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Allow multiple logins from different devices at the same time
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default, if a user logs into an account where someone is already
|
||||
| logged in, the previous user will be logged out. We recommend leaving
|
||||
| this set to false for security reasons.
|
||||
|
|
||||
*/
|
||||
|
||||
'multi_login' => false,
|
||||
|
||||
);
|
||||
@@ -28,7 +28,7 @@ return array(
|
||||
|
|
||||
*/
|
||||
|
||||
'host' => 'smtp.mailgun.org',
|
||||
'host' => 'smtp.mandrillapp.com',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
154
app/config/staging/session.example.php
Normal file
154
app/config/staging/session.example.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Session Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default session "driver" that will be used on
|
||||
| requests. By default, we will use the lightweight native driver but
|
||||
| you may specify any of the other wonderful drivers provided here.
|
||||
|
|
||||
| Supported: "file", "cookie", "database", "apc",
|
||||
| "memcached", "redis", "array"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'file',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Lifetime
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the number of minutes that you wish the session
|
||||
| to be allowed to remain idle before it expires. If you want them
|
||||
| to immediately expire on the browser closing, set that option.
|
||||
|
|
||||
*/
|
||||
|
||||
'lifetime' => 12000,
|
||||
|
||||
'expire_on_close' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session File Location
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the native session driver, we need a location where session
|
||||
| files may be stored. A default has been set for you but a different
|
||||
| location may be specified. This is only needed for file sessions.
|
||||
|
|
||||
*/
|
||||
|
||||
'files' => storage_path().'/sessions',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Connection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" or "redis" session drivers, you may specify a
|
||||
| connection that should be used to manage these sessions. This should
|
||||
| correspond to a connection in your database configuration options.
|
||||
|
|
||||
*/
|
||||
|
||||
'connection' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" session driver, you may specify the table we
|
||||
| should use to manage the sessions. Of course, a sensible default is
|
||||
| provided for you; however, you are free to change this as needed.
|
||||
|
|
||||
*/
|
||||
|
||||
'table' => 'sessions',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Sweeping Lottery
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Some session drivers must manually sweep their storage location to get
|
||||
| rid of old sessions from storage. Here are the chances that it will
|
||||
| happen on a given request. By default, the odds are 2 out of 100.
|
||||
|
|
||||
*/
|
||||
|
||||
'lottery' => array(2, 100),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may change the name of the cookie used to identify a session
|
||||
| instance by ID. The name specified here will get used every time a
|
||||
| new session cookie is created by the framework for every driver.
|
||||
|
|
||||
*/
|
||||
|
||||
'cookie' => 'snipeit_session',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The session cookie path determines the path for which the cookie will
|
||||
| be regarded as available. Typically, this will be the root path of
|
||||
| your application but you are free to change this when necessary.
|
||||
|
|
||||
*/
|
||||
|
||||
'path' => '/',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Domain
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may change the domain of the cookie used to identify a session
|
||||
| in your application. This will determine which domains the cookie is
|
||||
| available to in your application. A sensible default has been set.
|
||||
|
|
||||
*/
|
||||
|
||||
'domain' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| HTTPS Only Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By setting this option to true, session cookies will only be sent back
|
||||
| to the server if the browser has a HTTPS connection. This will keep
|
||||
| the cookie from being sent to you if it can not be done securely.
|
||||
|
|
||||
*/
|
||||
|
||||
'secure' => true,
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Allow multiple logins from different devices at the same time
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default, if a user logs into an account where someone is already
|
||||
| logged in, the previous user will be logged out. We recommend leaving
|
||||
| this set to false for security reasons.
|
||||
|
|
||||
*/
|
||||
|
||||
'multi_login' => true,
|
||||
|
||||
);
|
||||
@@ -28,7 +28,7 @@ return array(
|
||||
|
|
||||
*/
|
||||
|
||||
'host' => 'smtp.mailgun.org',
|
||||
'host' => 'smtp.mandrillapp.com',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
5
app/config/version.php
Normal file
5
app/config/version.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array (
|
||||
'app_version' => 'v2.0-beta',
|
||||
'hash_version' => 'v2.0-beta-4-g7e5f32c',
|
||||
);
|
||||
@@ -27,7 +27,7 @@ class AuthController extends BaseController
|
||||
{
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
'email' => 'required|email',
|
||||
'username' => 'required',
|
||||
'password' => 'required',
|
||||
);
|
||||
|
||||
@@ -42,7 +42,7 @@ class AuthController extends BaseController
|
||||
|
||||
try {
|
||||
// Try to log the user in
|
||||
Sentry::authenticate(Input::only('email', 'password'), Input::get('remember-me', 0));
|
||||
Sentry::authenticate(Input::only('username', 'password'), Input::get('remember-me', 0));
|
||||
|
||||
// Get the page we were before
|
||||
$redirect = Session::get('loginRedirect', 'account');
|
||||
@@ -53,91 +53,19 @@ 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) {
|
||||
$this->messageBag->add('email', Lang::get('auth/message.account_not_found'));
|
||||
$this->messageBag->add('username', Lang::get('auth/message.account_not_found'));
|
||||
} catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
|
||||
$this->messageBag->add('email', Lang::get('auth/message.account_not_activated'));
|
||||
$this->messageBag->add('username', Lang::get('auth/message.account_not_activated'));
|
||||
} catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
|
||||
$this->messageBag->add('email', Lang::get('auth/message.account_suspended'));
|
||||
$this->messageBag->add('username', Lang::get('auth/message.account_suspended'));
|
||||
} catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
|
||||
$this->messageBag->add('email', Lang::get('auth/message.account_banned'));
|
||||
$this->messageBag->add('username', Lang::get('auth/message.account_banned'));
|
||||
}
|
||||
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($this->messageBag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Account sign up.
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function getSignup()
|
||||
{
|
||||
// Is the user logged in?
|
||||
if (Sentry::check()) {
|
||||
return Redirect::route('account');
|
||||
}
|
||||
|
||||
// Show the page
|
||||
return View::make('frontend.auth.signup');
|
||||
}
|
||||
|
||||
/**
|
||||
* Account sign up form processing.
|
||||
*
|
||||
* @return Redirect
|
||||
*/
|
||||
public function postSignup()
|
||||
{
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
'first_name' => 'required|min:2',
|
||||
'last_name' => 'required|min:2',
|
||||
'email' => 'required|email|unique:users',
|
||||
'email_confirm' => 'required|email|same:email',
|
||||
'password' => 'required|between:10,32',
|
||||
'password_confirm' => 'required|same:password',
|
||||
);
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
try {
|
||||
// Register the user
|
||||
$user = Sentry::register(array(
|
||||
'first_name' => Input::get('first_name'),
|
||||
'last_name' => Input::get('last_name'),
|
||||
'email' => Input::get('email'),
|
||||
'password' => Input::get('password'),
|
||||
));
|
||||
|
||||
// Data to be used on the email view
|
||||
$data = array(
|
||||
'user' => $user,
|
||||
'activationUrl' => URL::route('activate', $user->getActivationCode()),
|
||||
);
|
||||
|
||||
// Send the activation code through email
|
||||
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) {
|
||||
$this->messageBag->add('email', Lang::get('auth/message.account_already_exists'));
|
||||
}
|
||||
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($this->messageBag);
|
||||
}
|
||||
|
||||
/**
|
||||
* User account activation page.
|
||||
@@ -192,7 +120,7 @@ class AuthController extends BaseController
|
||||
{
|
||||
// Declare the rules for the validator
|
||||
$rules = array(
|
||||
'email' => 'required|email',
|
||||
'username' => 'required',
|
||||
);
|
||||
|
||||
// Create a new validator instance from our dynamic rules
|
||||
@@ -206,22 +134,22 @@ class AuthController extends BaseController
|
||||
|
||||
try {
|
||||
// Get the user password recovery code
|
||||
$user = Sentry::getUserProvider()->findByLogin(Input::get('email'));
|
||||
$user = Sentry::getUserProvider()->findByLogin(Input::get('username'));
|
||||
|
||||
// Data to be used on the email view
|
||||
// Data to be used on the username view
|
||||
$data = array(
|
||||
'user' => $user,
|
||||
'forgotPasswordUrl' => URL::route('forgot-password-confirm', $user->getResetPasswordCode()),
|
||||
);
|
||||
|
||||
// Send the activation code through email
|
||||
Mail::send('emails.forgot-password', $data, function ($m) use ($user) {
|
||||
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
|
||||
// Send the activation code through username
|
||||
Mail::send('usernames.forgot-password', $data, function ($m) use ($user) {
|
||||
$m->to($user->username, $user->first_name . ' ' . $user->last_name);
|
||||
$m->subject('Account Password Recovery');
|
||||
});
|
||||
} 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,
|
||||
// Even though the username was not found, we will pretend
|
||||
// we have sent the password reset code through username,
|
||||
// this is a security measure against hackers.
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ use Redirect;
|
||||
use Sentry;
|
||||
use Validator;
|
||||
use View;
|
||||
use Config;
|
||||
use Lang;
|
||||
|
||||
class ChangeEmailController extends AuthorizedController
|
||||
{
|
||||
@@ -30,40 +32,47 @@ class ChangeEmailController extends AuthorizedController
|
||||
*/
|
||||
public function postIndex()
|
||||
{
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
'current_password' => 'required|between:3,32',
|
||||
'email' => 'required|email|unique:users,email,'.Sentry::getUser()->email.',email',
|
||||
'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 {
|
||||
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
'current_password' => 'required|between:3,32',
|
||||
'email' => 'required|email|unique:users,email,'.Sentry::getUser()->email.',email',
|
||||
'email_confirm' => 'required|same:email',
|
||||
);
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
// Grab the user
|
||||
$user = Sentry::getUser();
|
||||
|
||||
// Check the user current password
|
||||
if ( ! $user->checkPassword(Input::get('current_password'))) {
|
||||
// Set the error message
|
||||
$this->messageBag->add('current_password', 'Your current password is incorrect');
|
||||
|
||||
// Redirect to the change email page
|
||||
return Redirect::route('change-email')->withErrors($this->messageBag);
|
||||
}
|
||||
|
||||
// Update the user email
|
||||
$user->email = Input::get('email');
|
||||
$user->save();
|
||||
|
||||
// Redirect to the settings page
|
||||
return Redirect::route('change-email')->with('success', 'Email successfully updated');
|
||||
// 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);
|
||||
}
|
||||
|
||||
// Grab the user
|
||||
$user = Sentry::getUser();
|
||||
|
||||
// Check the user current password
|
||||
if ( ! $user->checkPassword(Input::get('current_password'))) {
|
||||
// Set the error message
|
||||
$this->messageBag->add('current_password', 'Your current password is incorrect');
|
||||
|
||||
// Redirect to the change email page
|
||||
return Redirect::route('change-email')->withErrors($this->messageBag);
|
||||
}
|
||||
|
||||
// Update the user email
|
||||
$user->email = Input::get('email');
|
||||
$user->save();
|
||||
|
||||
// Redirect to the settings page
|
||||
return Redirect::route('change-email')->with('success', 'Email successfully updated');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ use Redirect;
|
||||
use Sentry;
|
||||
use Validator;
|
||||
use View;
|
||||
use Config;
|
||||
use Lang;
|
||||
|
||||
class ChangePasswordController extends AuthorizedController
|
||||
{
|
||||
@@ -30,13 +32,19 @@ class ChangePasswordController extends AuthorizedController
|
||||
*/
|
||||
protected function postIndex()
|
||||
{
|
||||
// Declare the rules for the form validation
|
||||
|
||||
|
||||
if (Config::get('app.lock_passwords')) {
|
||||
return Redirect::route('change-password')->with('error', Lang::get('admin/users/table.lock_passwords'));
|
||||
} else {
|
||||
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
'old_password' => 'required|min:6',
|
||||
'password' => 'required|min:6',
|
||||
'password_confirm' => 'required|same:password',
|
||||
);
|
||||
|
||||
|
||||
// Create a new validator instance from our validation rules
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
@@ -61,6 +69,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');
|
||||
|
||||
@@ -7,6 +7,11 @@ use Sentry;
|
||||
use Validator;
|
||||
use Location;
|
||||
use View;
|
||||
use Asset;
|
||||
use Actionlog;
|
||||
use Lang;
|
||||
use Accessory;
|
||||
use DB;
|
||||
|
||||
class ViewAssetsController extends AuthorizedController
|
||||
{
|
||||
@@ -33,4 +38,127 @@ class ViewAssetsController extends AuthorizedController
|
||||
}
|
||||
|
||||
|
||||
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('frontend/account/view-assets')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
|
||||
} else {
|
||||
|
||||
|
||||
return View::make('frontend/account/view-assets', 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/view-assets')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
|
||||
}
|
||||
|
||||
|
||||
if ($findlog->accepted_id!='') {
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('account/view-assets')->with('error', Lang::get('admin/users/message.error.asset_already_accepted'));
|
||||
}
|
||||
|
||||
$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');
|
||||
|
||||
|
||||
$update_checkout = DB::table('asset_logs')
|
||||
->where('id',$findlog->id)
|
||||
->update(array('accepted_id' => $logaction->id));
|
||||
|
||||
if ($update_checkout ) {
|
||||
return Redirect::to('account/view-assets')->with('success', 'You have successfully accept this asset.');
|
||||
|
||||
} else {
|
||||
return Redirect::to('account/view-assets')->with('error', 'Something went wrong ');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
493
app/controllers/admin/AccessoriesController.php
Executable file
493
app/controllers/admin/AccessoriesController.php
Executable file
@@ -0,0 +1,493 @@
|
||||
<?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;
|
||||
use Datatable;
|
||||
use Slack;
|
||||
use Config;
|
||||
|
||||
class AccessoriesController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Show a list of all the accessories.
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
|
||||
public function getIndex()
|
||||
{
|
||||
return View::make('backend/accessories/index');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Accessory create.
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function getCreate()
|
||||
{
|
||||
// Show the page
|
||||
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','accessory')->whereNull('deleted_at')->orderBy('name','ASC')->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')->orderBy('name','ASC')->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'));
|
||||
}
|
||||
|
||||
$admin_user = Sentry::getUser();
|
||||
$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'));
|
||||
|
||||
$settings = Setting::getSettings();
|
||||
|
||||
if ($settings->slack_endpoint) {
|
||||
|
||||
|
||||
$slack_settings = [
|
||||
'username' => $settings->botname,
|
||||
'channel' => $settings->slack_channel,
|
||||
'link_names' => true
|
||||
];
|
||||
|
||||
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
|
||||
|
||||
try {
|
||||
$client->attach([
|
||||
'color' => 'good',
|
||||
'fields' => [
|
||||
[
|
||||
'title' => 'Checked Out:',
|
||||
'value' => strtoupper($logaction->asset_type).' <'.Config::get('app.url').'/admin/accessories/'.$accessory->id.'/view'.'|'.$accessory->name.'> checked out to <'.Config::get('app.url').'/admin/users/'.$user->id.'/view|'.$user->fullName().'> by <'.Config::get('app.url').'/admin/users/'.$admin_user->id.'/view'.'|'.$admin_user->fullName().'>.'
|
||||
],
|
||||
[
|
||||
'title' => 'Note:',
|
||||
'value' => e($logaction->note)
|
||||
],
|
||||
|
||||
|
||||
|
||||
]
|
||||
])->send('Accessory Checked Out');
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$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 = null, $backto = null)
|
||||
{
|
||||
// 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'))->with('backto',$backto);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check in the item so that it can be checked out again to someone else
|
||||
*
|
||||
* @param int $accessoryId
|
||||
* @return View
|
||||
**/
|
||||
public function postCheckin($accessoryUserId = null, $backto = null)
|
||||
{
|
||||
// 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;
|
||||
$return_to = $accessory_user->assigned_to;
|
||||
$admin_user = Sentry::getUser();
|
||||
|
||||
|
||||
// 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 = $admin_user->id;
|
||||
$logaction->note = e(Input::get('note'));
|
||||
|
||||
$settings = Setting::getSettings();
|
||||
|
||||
if ($settings->slack_endpoint) {
|
||||
|
||||
|
||||
$slack_settings = [
|
||||
'username' => $settings->botname,
|
||||
'channel' => $settings->slack_channel,
|
||||
'link_names' => true
|
||||
];
|
||||
|
||||
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
|
||||
|
||||
try {
|
||||
$client->attach([
|
||||
'color' => 'good',
|
||||
'fields' => [
|
||||
[
|
||||
'title' => 'Checked In:',
|
||||
'value' => strtoupper($logaction->asset_type).' <'.Config::get('app.url').'/admin/accessories/'.$accessory->id.'/view'.'|'.$accessory->name.'> checked in by <'.Config::get('app.url').'/admin/users/'.$admin_user->id.'/view'.'|'.$admin_user->fullName().'>.'
|
||||
],
|
||||
[
|
||||
'title' => 'Note:',
|
||||
'value' => e($logaction->note)
|
||||
],
|
||||
|
||||
]
|
||||
])->send('Accessory Checked In');
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$log = $logaction->logaction('checkin from');
|
||||
|
||||
if ($backto=='user') {
|
||||
return Redirect::to("admin/users/".$return_to.'/view')->with('success', Lang::get('admin/accessories/message.checkin.success'));
|
||||
} else {
|
||||
return Redirect::to("admin/accessories/".$accessory->id."/view")->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'));
|
||||
}
|
||||
|
||||
public function getDatatable()
|
||||
{
|
||||
$accessories = Accessory::select(array('id','name','qty'))
|
||||
->whereNull('deleted_at')
|
||||
->orderBy('created_at', 'DESC');
|
||||
|
||||
$accessories = $accessories->get();
|
||||
|
||||
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions',function($accessories)
|
||||
{
|
||||
return '<a href="'.route('checkout/accessory', $accessories->id).'" style="margin-right:5px;" class="btn btn-info btn-sm" '.(($accessories->numRemaining() > 0 ) ? '' : ' disabled').'>'.Lang::get('general.checkout').'</a><a href="'.route('update/accessory', $accessories->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/accessory', $accessories->id).'" data-content="'.Lang::get('admin/accessories/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($accessories->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
|
||||
});
|
||||
|
||||
return Datatable::collection($accessories)
|
||||
->addColumn('name',function($accessories)
|
||||
{
|
||||
return link_to('admin/accessories/'.$accessories->id.'/view', $accessories->name);
|
||||
})
|
||||
->addColumn('qty',function($accessories)
|
||||
{
|
||||
return $accessories->qty;
|
||||
})
|
||||
->addColumn('numRemaining',function($accessories)
|
||||
{
|
||||
return $accessories->numRemaining();
|
||||
})
|
||||
->addColumn($actions)
|
||||
->searchColumns('name','qty','numRemaining','actions')
|
||||
->orderColumns('name','qty','numRemaining','actions')
|
||||
->make();
|
||||
}
|
||||
|
||||
public function getDataView($accessoryID)
|
||||
{
|
||||
$accessory = Accessory::find($accessoryID);
|
||||
$accessory_users = $accessory->users;
|
||||
|
||||
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions',function($accessory_users){
|
||||
return '<a href="'.route('checkin/accessory', $accessory_users->pivot->id).'" class="btn-flat info">Checkin</a>';
|
||||
});
|
||||
|
||||
return Datatable::collection($accessory_users)
|
||||
->addColumn('name',function($accessory_users)
|
||||
{
|
||||
return link_to('/admin/users/'.$accessory_users->id.'/view', $accessory_users->fullName());
|
||||
})
|
||||
->addColumn($actions)
|
||||
->make();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,12 +21,15 @@ use Response;
|
||||
use Config;
|
||||
use Location;
|
||||
use Log;
|
||||
|
||||
use BaconQrCode\Renderer\Image as QrImage;
|
||||
use DNS2D;
|
||||
use Mail;
|
||||
use Datatable;
|
||||
use TCPDF;
|
||||
use Slack;
|
||||
|
||||
class AssetsController extends AdminController
|
||||
{
|
||||
protected $qrCodeDimensions = array( 'height' => 170, 'width' => 170);
|
||||
protected $qrCodeDimensions = array( 'height' => 3.5, 'width' => 3.5);
|
||||
|
||||
/**
|
||||
* Show a list of all the assets.
|
||||
@@ -36,55 +39,11 @@ class AssetsController extends AdminController
|
||||
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the assets
|
||||
|
||||
// Filter results
|
||||
if (Input::get('Pending')) {
|
||||
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')
|
||||
->whereNull('status_id','and')
|
||||
->where('assigned_to','=','0')
|
||||
->where('physical', '=', 1)
|
||||
->get();
|
||||
} elseif (Input::get('RTD')) {
|
||||
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')
|
||||
->where('status_id', '=', 0)
|
||||
->where('assigned_to', '=', '0')
|
||||
->where('physical', '=', 1)
|
||||
->orderBy('asset_tag', 'ASC')
|
||||
->get();
|
||||
} elseif (Input::get('Undeployable')) {
|
||||
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')
|
||||
->where('status_id', '>', 1)
|
||||
->where('physical', '=', 1)
|
||||
->orderBy('asset_tag', 'ASC')
|
||||
->get();
|
||||
} elseif (Input::get('Deployed')) {
|
||||
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')
|
||||
->where('status_id', '=', 0)
|
||||
->where('physical', '=', 1)
|
||||
->where('assigned_to','>','0')
|
||||
->orderBy('asset_tag', 'ASC')
|
||||
->get();
|
||||
} else {
|
||||
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc')
|
||||
->where('physical', '=', 1)
|
||||
->orderBy('asset_tag', 'ASC')
|
||||
->get();
|
||||
}
|
||||
|
||||
// Paginate the users
|
||||
/**$assets = $assets->paginate(Setting::getSettings()->per_page)
|
||||
->appends(array(
|
||||
'Pending' => Input::get('Pending'),
|
||||
'RTD' => Input::get('RTD'),
|
||||
'Undeployable' => Input::get('Undeployable'),
|
||||
'Deployed' => Input::get('Deployed'),
|
||||
));
|
||||
**/
|
||||
|
||||
return View::make('backend/hardware/index', compact('assets'));
|
||||
return View::make('backend/hardware/index');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Asset create.
|
||||
*
|
||||
@@ -95,22 +54,28 @@ class AssetsController extends AdminController
|
||||
public function getCreate($model_id = null)
|
||||
{
|
||||
|
||||
/*
|
||||
// Grab the dropdown list of models
|
||||
//$model_list = array('' => 'Select a Model') + Model::orderBy('name', 'asc')->lists('name'.' '. 'modelno', 'id');
|
||||
|
||||
$model_list = array('' => 'Select a Model') + DB::table('models')
|
||||
$model_list = Model::select(DB::raw('concat(manufacturers.name," ",name) as name, id'))->orderBy('name', 'asc')->with('manufacturer')->lists('name', 'id');
|
||||
//$model_list = array('' => Lang::get('general.select_model'));
|
||||
*/
|
||||
|
||||
$model_list = array('' => Lang::get('general.select_model')) + DB::table('models')
|
||||
->select(DB::raw('concat(name," / ",modelno) as name, id'))->orderBy('name', 'asc')
|
||||
->orderBy('modelno', 'asc')
|
||||
->whereNull('deleted_at')
|
||||
->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');
|
||||
$supplier_list = array('' => Lang::get('general.select_supplier')) + Supplier::orderBy('name', 'asc')->lists('name', 'id');
|
||||
$assigned_to = array('' => Lang::get('general.select_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('' => Lang::get('general.select_location')) + Location::orderBy('name', 'asc')->lists('name', 'id');
|
||||
|
||||
|
||||
// Grab the dropdown list of status
|
||||
$statuslabel_list = array('' => Lang::get('general.pending')) + array('0' => Lang::get('general.ready_to_deploy')) + Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
|
||||
$statuslabel_list = array('' => Lang::get('general.select_statuslabel')) + Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
|
||||
|
||||
$view = View::make('backend/hardware/edit');
|
||||
$view->with('supplier_list',$supplier_list);
|
||||
@@ -197,6 +162,9 @@ class AssetsController extends AdminController
|
||||
$asset->rtd_location_id = e(Input::get('rtd_location_id'));
|
||||
}
|
||||
|
||||
$checkModel = Config::get('app.url').'/api/models/'.e(Input::get('model_id')).'/check';
|
||||
$asset->mac_address = ($checkModel == true) ? e(Input::get('mac_address')) : NULL;
|
||||
|
||||
// Save the asset data
|
||||
$asset->name = e(Input::get('name'));
|
||||
$asset->serial = e(Input::get('serial'));
|
||||
@@ -204,7 +172,6 @@ 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->user_id = Sentry::getId();
|
||||
$asset->archived = '0';
|
||||
$asset->physical = '1';
|
||||
@@ -250,12 +217,15 @@ class AssetsController extends AdminController
|
||||
|
||||
|
||||
// Grab the dropdown list of models
|
||||
$model_list = array('' => '') + Model::orderBy('name', 'asc')->lists('name', 'id');
|
||||
$supplier_list = array('' => '') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
|
||||
$location_list = array('' => '') + Location::orderBy('name', 'asc')->lists('name', 'id');
|
||||
$model_list = array('' => Lang::get('general.select_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('' => Lang::get('general.select_supplier')) + Supplier::orderBy('name', 'asc')->lists('name', 'id');
|
||||
$location_list = array('' => Lang::get('general.select_location')) + Location::orderBy('name', 'asc')->lists('name', 'id');
|
||||
|
||||
// Grab the dropdown list of status
|
||||
$statuslabel_list = array('' => Lang::get('general.pending')) + array('0' => Lang::get('general.ready_to_deploy')) + Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
|
||||
$statuslabel_list = Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
|
||||
|
||||
return View::make('backend/hardware/edit', compact('asset'))->with('model_list',$model_list)->with('supplier_list',$supplier_list)->with('location_list',$location_list)->with('statuslabel_list',$statuslabel_list);
|
||||
}
|
||||
@@ -317,7 +287,7 @@ class AssetsController extends AdminController
|
||||
$asset->supplier_id = e(Input::get('supplier_id'));
|
||||
}
|
||||
|
||||
if (e(Input::get('requestable')) == '') {
|
||||
if (e(Input::get('requestable')) == '') {
|
||||
$asset->requestable = 0;
|
||||
} else {
|
||||
$asset->requestable = e(Input::get('requestable'));
|
||||
@@ -329,11 +299,14 @@ class AssetsController extends AdminController
|
||||
$asset->rtd_location_id = e(Input::get('rtd_location_id'));
|
||||
}
|
||||
|
||||
$checkModel = Config::get('app.url').'/api/models/'.e(Input::get('model_id')).'/check';
|
||||
$asset->mac_address = ($checkModel == true) ? e(Input::get('mac_address')) : NULL;
|
||||
|
||||
// Update the asset data
|
||||
$asset->name = e(Input::get('name'));
|
||||
$asset->serial = e(Input::get('serial'));
|
||||
$asset->model_id = e(Input::get('model_id'));
|
||||
$asset->order_number = e(Input::get('order_number'));
|
||||
$asset->order_number = e(Input::get('order_number'));
|
||||
$asset->asset_tag = e(Input::get('asset_tag'));
|
||||
$asset->notes = e(Input::get('notes'));
|
||||
$asset->physical = '1';
|
||||
@@ -374,6 +347,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
|
||||
@@ -396,7 +375,7 @@ class AssetsController extends AdminController
|
||||
}
|
||||
|
||||
// Get the dropdown of users and then pass it to the checkout view
|
||||
$users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name) as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id');
|
||||
$users_list = array('' => Lang::get('general.select_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/hardware/checkout', compact('asset'))->with('users_list',$users_list);
|
||||
|
||||
@@ -416,6 +395,7 @@ class AssetsController extends AdminController
|
||||
$assigned_to = e(Input::get('assigned_to'));
|
||||
|
||||
|
||||
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
'assigned_to' => 'required|min:1',
|
||||
@@ -433,7 +413,7 @@ class AssetsController extends AdminController
|
||||
|
||||
|
||||
// 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'));
|
||||
}
|
||||
@@ -444,14 +424,75 @@ class AssetsController extends AdminController
|
||||
// Was the asset updated?
|
||||
if($asset->save()) {
|
||||
$logaction = new Actionlog();
|
||||
|
||||
if (Input::has('checkout_at')) {
|
||||
if (Input::get('checkout_at')!= date("Y-m-d")){
|
||||
$logaction->created_at = e(Input::get('checkout_at')).' 00:00:00';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$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->showAssetName();
|
||||
$data['require_acceptance'] = $asset->requireAcceptance();
|
||||
|
||||
$settings = Setting::getSettings();
|
||||
|
||||
if ($settings->slack_endpoint) {
|
||||
|
||||
|
||||
$slack_settings = [
|
||||
'username' => $settings->botname,
|
||||
'channel' => $settings->slack_channel,
|
||||
'link_names' => true
|
||||
];
|
||||
|
||||
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
|
||||
|
||||
try {
|
||||
$client->attach([
|
||||
'color' => 'good',
|
||||
'fields' => [
|
||||
[
|
||||
'title' => 'Checked Out:',
|
||||
'value' => strtoupper($logaction->asset_type).' asset <'.Config::get('app.url').'/hardware/'.$asset->id.'/view'.'|'.$asset->showAssetName().'> checked out to <'.Config::get('app.url').'/admin/users/'.$user->id.'/view|'.$user->fullName().'> by <'.Config::get('app.url').'/hardware/'.$asset->id.'/view'.'|'.Sentry::getUser()->fullName().'>.'
|
||||
],
|
||||
[
|
||||
'title' => 'Note:',
|
||||
'value' => e($logaction->note)
|
||||
],
|
||||
|
||||
|
||||
|
||||
]
|
||||
])->send('Asset Checked Out');
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
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'));
|
||||
}
|
||||
@@ -467,7 +508,7 @@ class AssetsController extends AdminController
|
||||
* @param int $assetId
|
||||
* @return View
|
||||
**/
|
||||
public function getCheckin($assetId)
|
||||
public function getCheckin($assetId, $backto = null)
|
||||
{
|
||||
// Check if the asset exists
|
||||
if (is_null($asset = Asset::find($assetId))) {
|
||||
@@ -475,7 +516,7 @@ class AssetsController extends AdminController
|
||||
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.not_found'));
|
||||
}
|
||||
|
||||
return View::make('backend/hardware/checkin', compact('asset'));
|
||||
return View::make('backend/hardware/checkin', compact('asset'))->with('backto', $backto);
|
||||
}
|
||||
|
||||
|
||||
@@ -485,7 +526,7 @@ class AssetsController extends AdminController
|
||||
* @param int $assetId
|
||||
* @return View
|
||||
**/
|
||||
public function postCheckin($assetId)
|
||||
public function postCheckin($assetId = null, $backto = null)
|
||||
{
|
||||
// Check if the asset exists
|
||||
if (is_null($asset = Asset::find($assetId))) {
|
||||
@@ -497,15 +538,28 @@ class AssetsController extends AdminController
|
||||
$user = User::find($asset->assigned_to);
|
||||
}
|
||||
|
||||
// This is just used for the redirect
|
||||
$return_to = $asset->assigned_to;
|
||||
|
||||
$logaction = new Actionlog();
|
||||
$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 (Input::has('checkin_at')) {
|
||||
|
||||
if (!strtotime(Input::get('checkin_at'))) {
|
||||
$logaction->created_at = date("Y-m-d h:i:s");
|
||||
} elseif (Input::get('checkin_at')!= date("Y-m-d")) {
|
||||
$logaction->created_at = e(Input::get('checkin_at')).' 00:00:00';
|
||||
}
|
||||
}
|
||||
|
||||
$logaction->asset_id = $asset->id;
|
||||
$logaction->location_id = NULL;
|
||||
$logaction->asset_type = 'hardware';
|
||||
@@ -513,8 +567,47 @@ class AssetsController extends AdminController
|
||||
$logaction->user_id = Sentry::getUser()->id;
|
||||
$log = $logaction->logaction('checkin from');
|
||||
|
||||
// Redirect to the new asset page
|
||||
return Redirect::to("hardware")->with('success', Lang::get('admin/hardware/message.checkin.success'));
|
||||
$settings = Setting::getSettings();
|
||||
|
||||
if ($settings->slack_endpoint) {
|
||||
|
||||
|
||||
$slack_settings = [
|
||||
'username' => $settings->botname,
|
||||
'channel' => $settings->slack_channel,
|
||||
'link_names' => true
|
||||
];
|
||||
|
||||
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
|
||||
|
||||
try {
|
||||
$client->attach([
|
||||
'color' => 'good',
|
||||
'fields' => [
|
||||
[
|
||||
'title' => 'Checked In:',
|
||||
'value' => strtoupper($logaction->asset_type).' asset <'.Config::get('app.url').'/hardware/'.$asset->id.'/view'.'|'.$asset->showAssetName().'> checked in by <'.Config::get('app.url').'/hardware/'.$asset->id.'/view'.'|'.Sentry::getUser()->fullName().'>.'
|
||||
],
|
||||
[
|
||||
'title' => 'Note:',
|
||||
'value' => e($logaction->note)
|
||||
],
|
||||
|
||||
]
|
||||
])->send('Asset Checked In');
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($backto=='user') {
|
||||
return Redirect::to("admin/users/".$return_to.'/view')->with('success', Lang::get('admin/hardware/message.checkin.success'));
|
||||
} else {
|
||||
return Redirect::to("hardware")->with('success', Lang::get('admin/hardware/message.checkin.success'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Redirect to the asset management page with error
|
||||
@@ -530,7 +623,7 @@ class AssetsController extends AdminController
|
||||
**/
|
||||
public function getView($assetId = null)
|
||||
{
|
||||
$asset = Asset::find($assetId);
|
||||
$asset = Asset::withTrashed()->find($assetId);
|
||||
|
||||
if (isset($asset->id)) {
|
||||
|
||||
@@ -538,8 +631,6 @@ class AssetsController extends AdminController
|
||||
|
||||
$qr_code = (object) array(
|
||||
'display' => $settings->qr_code == '1',
|
||||
'height' => $this->qrCodeDimensions['height'],
|
||||
'width' => $this->qrCodeDimensions['width'],
|
||||
'url' => route('qr_code/hardware', $asset->id)
|
||||
);
|
||||
|
||||
@@ -549,7 +640,7 @@ class AssetsController extends AdminController
|
||||
$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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -566,15 +657,15 @@ class AssetsController extends AdminController
|
||||
|
||||
if ($settings->qr_code == '1') {
|
||||
$asset = Asset::find($assetId);
|
||||
if (isset($asset->id)) {
|
||||
|
||||
if (isset($asset->id,$asset->asset_tag)) {
|
||||
|
||||
$renderer = new \BaconQrCode\Renderer\Image\Png;
|
||||
$renderer->setWidth($this->qrCodeDimensions['height'])
|
||||
->setHeight($this->qrCodeDimensions['height']);
|
||||
$content = DNS2D::getBarcodePNG(route('view/hardware', $asset->id), $settings->barcode_type,
|
||||
$this->qrCodeDimensions['height'],$this->qrCodeDimensions['width']);
|
||||
|
||||
$writer = new \BaconQrCode\Writer($renderer);
|
||||
$content = $writer->writeString(route('view/hardware', $asset->id));
|
||||
$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);
|
||||
@@ -589,7 +680,7 @@ class AssetsController extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* Asset update.
|
||||
* Asset clone.
|
||||
*
|
||||
* @param int $assetId
|
||||
* @return View
|
||||
@@ -603,22 +694,454 @@ class AssetsController extends AdminController
|
||||
}
|
||||
|
||||
// Grab the dropdown list of models
|
||||
$model_list = array('' => '') + Model::lists('name', 'id');
|
||||
$model_list = array('' => Lang::get('general.select_model')) + 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');
|
||||
$location_list = array('' => Lang::get('general.select_location')) + 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');
|
||||
$supplier_list = array('' => Lang::get('general.select_supplier')) + Supplier::orderBy('name', 'asc')->lists('name', 'id');
|
||||
$assigned_to = array('' => Lang::get('general.select_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 = '';
|
||||
$asset->serial = '';
|
||||
$asset->assigned_to = '';
|
||||
$asset->mac_address = '';
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
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,zip,rar|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')) {
|
||||
return Redirect::back()->with('error', 'No assets selected');
|
||||
} else {
|
||||
$asset_raw_array = Input::get('edit_asset');
|
||||
foreach ($asset_raw_array as $asset_id => $value) {
|
||||
$asset_ids[] = $asset_id;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (Input::has('bulk_actions')) {
|
||||
|
||||
|
||||
// Create labels
|
||||
if (Input::get('bulk_actions')=='labels') {
|
||||
$assets = Asset::find($asset_ids);
|
||||
$assetcount = count($assets);
|
||||
$count = 0;
|
||||
|
||||
$settings = Setting::getSettings();
|
||||
return View::make('backend/hardware/labels')->with('assets',$assets)->with('settings',$settings)->with('count',$count);
|
||||
|
||||
|
||||
// Bulk edit
|
||||
} elseif (Input::get('bulk_actions')=='edit') {
|
||||
|
||||
$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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
return Redirect::back()->with('error', 'No action selected');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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('purchase_cost')) || (Input::has('supplier_id')) || (Input::has('order_number')) || (Input::has('warranty_months')) || (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('purchase_cost')) {
|
||||
$update_array['purchase_cost'] = e(Input::get('purchase_cost'));
|
||||
}
|
||||
|
||||
if (Input::has('supplier_id')) {
|
||||
$update_array['supplier_id'] = e(Input::get('supplier_id'));
|
||||
}
|
||||
|
||||
if (Input::has('order_number')) {
|
||||
$update_array['order_number'] = e(Input::get('order_number'));
|
||||
}
|
||||
|
||||
if (Input::has('warranty_months')) {
|
||||
$update_array['warranty_months'] = e(Input::get('warranty_months'));
|
||||
}
|
||||
|
||||
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");
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getDatatable($status = null)
|
||||
{
|
||||
|
||||
$assets = Asset::with('model','assigneduser','assigneduser.userloc','assetstatus','defaultLoc','assetlog','model','model.category')->Hardware()->select(array('id', 'name','model_id','assigned_to','asset_tag','serial','status_id','purchase_date','deleted_at','rtd_location_id'));
|
||||
|
||||
|
||||
switch ($status) {
|
||||
case 'Deleted':
|
||||
$assets->withTrashed()->Deleted();
|
||||
break;
|
||||
case 'Pending':
|
||||
$assets->Pending();
|
||||
break;
|
||||
case 'RTD':
|
||||
$assets->RTD();
|
||||
break;
|
||||
case 'Undeployable':
|
||||
$assets->Undeployable();
|
||||
break;
|
||||
case 'Archived':
|
||||
$assets->Archived();
|
||||
break;
|
||||
case 'Requestable':
|
||||
$assets->RequestableAssets();
|
||||
break;
|
||||
case 'Deployed':
|
||||
$assets->Deployed();
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
$assets = $assets->orderBy('asset_tag', 'ASC')->get();
|
||||
|
||||
|
||||
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($assets)
|
||||
{
|
||||
if ($assets->deleted_at=='') {
|
||||
return '<a href="'.route('update/hardware', $assets->id).'" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> <a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/hardware', $assets->id).'" data-content="'.Lang::get('admin/hardware/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($assets->asset_tag).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
|
||||
} elseif ($assets->model->deleted_at=='') {
|
||||
return '<a href="'.route('restore/hardware', $assets->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$inout = new \Chumper\Datatable\Columns\FunctionColumn('inout', function ($assets)
|
||||
{
|
||||
if ($assets->assetstatus->deployable != 0) {
|
||||
if (($assets->assigned_to !='') && ($assets->assigned_to > 0)) {
|
||||
return '<a href="'.route('checkin/hardware', $assets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
|
||||
} else {
|
||||
return '<a href="'.route('checkout/hardware', $assets->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
return Datatable::collection($assets)
|
||||
->addColumn('',function($assets)
|
||||
{
|
||||
return '<input type="checkbox" name="edit_asset['.$assets->id.']" class="one_required">';
|
||||
})
|
||||
->addColumn('name',function($assets)
|
||||
{
|
||||
return '<a title="'.$assets->name.'" href="hardware/'.$assets->id.'/view">'.$assets->name.'</a>';
|
||||
})
|
||||
->addColumn('asset_tag',function($assets)
|
||||
{
|
||||
return '<a title="'.$assets->asset_tag.'" href="hardware/'.$assets->id.'/view">'.$assets->asset_tag.'</a>';
|
||||
})
|
||||
|
||||
->showColumns('serial')
|
||||
|
||||
->addColumn('model',function($assets)
|
||||
{
|
||||
if ($assets->model) {
|
||||
return $assets->model->name;
|
||||
} else {
|
||||
return 'No model';
|
||||
}
|
||||
})
|
||||
|
||||
->addColumn('status',function($assets)
|
||||
{
|
||||
if ($assets->assigned_to!='') {
|
||||
return link_to('../admin/users/'.$assets->assigned_to.'/view', $assets->assigneduser->fullName());
|
||||
} else {
|
||||
if ($assets->assetstatus) {
|
||||
return $assets->assetstatus->name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
->addColumn('location',function($assets)
|
||||
{
|
||||
if ($assets->assigned_to && ($assets->assigneduser->userloc!='')) {
|
||||
return link_to('admin/settings/locations/'.$assets->assigneduser->userloc->id.'/edit', $assets->assigneduser->userloc->name);
|
||||
} elseif ($assets->defaultLoc){
|
||||
return link_to('admin/settings/locations/'.$assets->defaultLoc->id.'/edit', $assets->defaultLoc->name);
|
||||
}
|
||||
})
|
||||
->addColumn('category',function($assets)
|
||||
{
|
||||
if (isset($assets->model->category)) {
|
||||
return $assets->model->category->name;
|
||||
} else {
|
||||
return 'No category';
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
->addColumn('eol',function($assets)
|
||||
{
|
||||
return $assets->eol_date();
|
||||
})
|
||||
|
||||
|
||||
->addColumn('checkout_date',function($assets)
|
||||
{
|
||||
if (($assets->assigned_to!='') && ($assets->assetlog->first())) {
|
||||
return $assets->assetlog->first()->created_at->format('Y-m-d');
|
||||
}
|
||||
|
||||
})
|
||||
->addColumn($inout)
|
||||
->addColumn($actions)
|
||||
->searchColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','checkout_date', 'inout','category')
|
||||
->orderColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','checkout_date', 'inout')
|
||||
->make();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ use Sentry;
|
||||
use Str;
|
||||
use Validator;
|
||||
use View;
|
||||
use Datatable;
|
||||
|
||||
class CategoriesController extends AdminController
|
||||
{
|
||||
@@ -22,11 +23,8 @@ class CategoriesController extends AdminController
|
||||
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the categories
|
||||
$categories = Category::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/categories/index', compact('categories'));
|
||||
return View::make('backend/categories/index');
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +36,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', 'consumable' => 'Consumable');
|
||||
return View::make('backend/categories/edit')->with('category',new Category)
|
||||
->with('category_types',$category_types);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,26 +52,30 @@ class CategoriesController extends AdminController
|
||||
|
||||
// create a new model instance
|
||||
$category = new Category();
|
||||
|
||||
|
||||
$validator = Validator::make(Input::all(), $category->rules);
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
// 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->user_id = Sentry::getId();
|
||||
$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()) {
|
||||
// Redirect to the new category page
|
||||
return Redirect::to("admin/settings/categories")->with('success', Lang::get('admin/categories/message.create.success'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the category create page
|
||||
return Redirect::to('admin/settings/categories/create')->with('error', Lang::get('admin/categories/message.create.error'));
|
||||
@@ -97,7 +101,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', 'consumable' => 'Consumable');
|
||||
|
||||
return View::make('backend/categories/edit', compact('category'))
|
||||
->with('category_options',$category_options)
|
||||
->with('category_types',$category_types);
|
||||
}
|
||||
|
||||
|
||||
@@ -119,9 +127,9 @@ class CategoriesController extends AdminController
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
// attempt validation
|
||||
// attempt validation
|
||||
$validator = Validator::make(Input::all(), $category->validationRules($categoryId));
|
||||
|
||||
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
@@ -133,13 +141,17 @@ class CategoriesController extends AdminController
|
||||
|
||||
// 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()) {
|
||||
// Redirect to the new category page
|
||||
return Redirect::to("admin/settings/categories")->with('success', Lang::get('admin/categories/message.update.success'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the category management page
|
||||
return Redirect::to("admin/settings/categories/$categoryID/edit")->with('error', Lang::get('admin/categories/message.update.error'));
|
||||
@@ -154,7 +166,7 @@ class CategoriesController extends AdminController
|
||||
*/
|
||||
public function getDelete($categoryId)
|
||||
{
|
||||
// Check if the blog post exists
|
||||
// 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'));
|
||||
@@ -178,4 +190,88 @@ 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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function getDatatable()
|
||||
{
|
||||
// Grab all the categories
|
||||
$categories = Category::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function($categories) {
|
||||
return '<a href="'.route('update/category', $categories->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/category', $categories->id).'" data-content="'.Lang::get('admin/categories/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($categories->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
|
||||
});
|
||||
|
||||
return Datatable::collection($categories)
|
||||
->showColumns('name')
|
||||
->addColumn('category_type', function($categories) {
|
||||
return ucwords($categories->category_type);
|
||||
})
|
||||
->addColumn('count', function($categories) {
|
||||
return ($categories->category_type=='asset') ? link_to('/admin/settings/categories/'.$categories->id.'/view', $categories->assetscount()) : $categories->accessoriescount();
|
||||
})
|
||||
->addColumn('acceptance', function($categories) {
|
||||
return ($categories->require_acceptance=='1') ? '<i class="fa fa-check" style="margin-right:50%;margin-left:50%;"></i>' : '';
|
||||
})
|
||||
->addColumn('eula', function($categories) {
|
||||
return ($categories->getEula()) ? '<i class="fa fa-check" style="margin-right:50%;margin-left:50%;"></i></a>' : '';
|
||||
})
|
||||
->addColumn($actions)
|
||||
->searchColumns('name','category_type','count','acceptance','eula','actions')
|
||||
->orderColumns('name','category_type','count','acceptance','eula','actions')
|
||||
->make();
|
||||
}
|
||||
|
||||
public function getDataView($categoryID) {
|
||||
$category = Category::find($categoryID);
|
||||
$categoryassets = $category->assets;
|
||||
|
||||
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($categoryassets)
|
||||
{
|
||||
if (($categoryassets->assigned_to !='') && ($categoryassets->assigned_to > 0)) {
|
||||
return '<a href="'.route('checkin/hardware', $categoryassets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
|
||||
} else {
|
||||
return '<a href="'.route('checkout/hardware', $categoryassets->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
|
||||
}
|
||||
});
|
||||
|
||||
return Datatable::collection($categoryassets)
|
||||
->addColumn('name', function ($categoryassets) {
|
||||
return link_to('/hardware/'.$categoryassets->id.'/view', $categoryassets->name);
|
||||
})
|
||||
->addColumn('asset_tag', function ($categoryassets) {
|
||||
return link_to('/hardware/'.$categoryassets->id.'/view', $categoryassets->asset_tag);
|
||||
})
|
||||
->addColumn('assigned_to', function ($categoryassets) {
|
||||
if ($categoryassets->assigned_to) {
|
||||
return link_to('/admin/users/'.$categoryassets->assigned_to.'/view', $categoryassets->assigneduser->fullName());
|
||||
}
|
||||
})
|
||||
->addColumn($actions)
|
||||
->searchColumns('name','asset_tag','assigned_to','actions')
|
||||
->orderColumns('name','asset_tag','assigned_to','actions')
|
||||
->make();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
390
app/controllers/admin/ConsumablesController.php
Normal file
390
app/controllers/admin/ConsumablesController.php
Normal file
@@ -0,0 +1,390 @@
|
||||
<?php namespace Controllers\Admin;
|
||||
|
||||
use AdminController;
|
||||
use Input;
|
||||
use Lang;
|
||||
use Redirect;
|
||||
use Setting;
|
||||
use DB;
|
||||
use Sentry;
|
||||
use Consumable;
|
||||
use Str;
|
||||
use Validator;
|
||||
use View;
|
||||
use User;
|
||||
use Actionlog;
|
||||
use Mail;
|
||||
use Datatable;
|
||||
use Slack;
|
||||
use Config;
|
||||
|
||||
class ConsumablesController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Show a list of all the consumables.
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
|
||||
public function getIndex()
|
||||
{
|
||||
return View::make('backend/consumables/index');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Consumable create.
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function getCreate()
|
||||
{
|
||||
// Show the page
|
||||
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','consumable')->whereNull('deleted_at')->orderBy('name','ASC')->lists('name', 'id');
|
||||
return View::make('backend/consumables/edit')->with('consumable',new Consumable)->with('category_list',$category_list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Consumable create form processing.
|
||||
*
|
||||
* @return Redirect
|
||||
*/
|
||||
public function postCreate()
|
||||
{
|
||||
|
||||
// create a new model instance
|
||||
$consumable = new Consumable();
|
||||
|
||||
$validator = Validator::make(Input::all(), $consumable->rules);
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
else{
|
||||
|
||||
// Update the consumable data
|
||||
$consumable->name = e(Input::get('name'));
|
||||
$consumable->category_id = e(Input::get('category_id'));
|
||||
$consumable->qty = e(Input::get('qty'));
|
||||
$consumable->user_id = Sentry::getId();
|
||||
|
||||
// Was the consumable created?
|
||||
if($consumable->save()) {
|
||||
// Redirect to the new consumable page
|
||||
return Redirect::to("admin/consumables")->with('success', Lang::get('admin/consumables/message.create.success'));
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the consumable create page
|
||||
return Redirect::to('admin/consumables/create')->with('error', Lang::get('admin/consumables/message.create.error'));
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Consumable update.
|
||||
*
|
||||
* @param int $consumableId
|
||||
* @return View
|
||||
*/
|
||||
public function getEdit($consumableId = null)
|
||||
{
|
||||
// Check if the consumable exists
|
||||
if (is_null($consumable = Consumable::find($consumableId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.does_not_exist'));
|
||||
}
|
||||
|
||||
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','consumable')->whereNull('deleted_at')->orderBy('name','ASC')->lists('name', 'id');
|
||||
return View::make('backend/consumables/edit', compact('consumable'))->with('category_list',$category_list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Consumable update form processing page.
|
||||
*
|
||||
* @param int $consumableId
|
||||
* @return Redirect
|
||||
*/
|
||||
public function postEdit($consumableId = null)
|
||||
{
|
||||
// Check if the blog post exists
|
||||
if (is_null($consumable = Consumable::find($consumableId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.does_not_exist'));
|
||||
}
|
||||
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
// attempt validation
|
||||
$validator = Validator::make(Input::all(), $consumable->validationRules($consumableId));
|
||||
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
else {
|
||||
|
||||
// Update the consumable data
|
||||
$consumable->name = e(Input::get('name'));
|
||||
$consumable->category_id = e(Input::get('category_id'));
|
||||
$consumable->qty = e(Input::get('qty'));
|
||||
|
||||
// Was the consumable created?
|
||||
if($consumable->save()) {
|
||||
// Redirect to the new consumable page
|
||||
return Redirect::to("admin/consumables")->with('success', Lang::get('admin/consumables/message.update.success'));
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the consumable management page
|
||||
return Redirect::to("admin/consumables/$consumableID/edit")->with('error', Lang::get('admin/consumables/message.update.error'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the given consumable.
|
||||
*
|
||||
* @param int $consumableId
|
||||
* @return Redirect
|
||||
*/
|
||||
public function getDelete($consumableId)
|
||||
{
|
||||
// Check if the blog post exists
|
||||
if (is_null($consumable = Consumable::find($consumableId))) {
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.not_found'));
|
||||
}
|
||||
|
||||
|
||||
if ($consumable->hasUsers() > 0) {
|
||||
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.assoc_users', array('count'=> $consumable->hasUsers())));
|
||||
} else {
|
||||
$consumable->delete();
|
||||
|
||||
// Redirect to the locations management page
|
||||
return Redirect::to('admin/consumables')->with('success', Lang::get('admin/consumables/message.delete.success'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get the consumable information to present to the consumable view page
|
||||
*
|
||||
* @param int $consumableId
|
||||
* @return View
|
||||
**/
|
||||
public function getView($consumableID = null)
|
||||
{
|
||||
$consumable = Consumable::find($consumableID);
|
||||
|
||||
if (isset($consumable->id)) {
|
||||
return View::make('backend/consumables/view', compact('consumable'));
|
||||
} else {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/consumables/message.does_not_exist', compact('id'));
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('consumables')->with('error', $error);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Check out the consumable to a person
|
||||
**/
|
||||
public function getCheckout($consumableId)
|
||||
{
|
||||
// Check if the consumable exists
|
||||
if (is_null($consumable = Consumable::find($consumableId))) {
|
||||
// Redirect to the consumable management page with error
|
||||
return Redirect::to('consumables')->with('error', Lang::get('admin/consumables/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/consumables/checkout', compact('consumable'))->with('users_list',$users_list);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Check out the consumable to a person
|
||||
**/
|
||||
public function postCheckout($consumableId)
|
||||
{
|
||||
// Check if the consumable exists
|
||||
if (is_null($consumable = Consumable::find($consumableId))) {
|
||||
// Redirect to the consumable management page with error
|
||||
return Redirect::to('consumables')->with('error', Lang::get('admin/consumables/message.not_found'));
|
||||
}
|
||||
|
||||
$admin_user = Sentry::getUser();
|
||||
$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 consumable management page with error
|
||||
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.user_does_not_exist'));
|
||||
}
|
||||
|
||||
// Update the consumable data
|
||||
$consumable->assigned_to = e(Input::get('assigned_to'));
|
||||
|
||||
$consumable->users()->attach($consumable->id, array(
|
||||
'consumable_id' => $consumable->id,
|
||||
'assigned_to' => e(Input::get('assigned_to'))));
|
||||
|
||||
$logaction = new Actionlog();
|
||||
$logaction->consumable_id = $consumable->id;
|
||||
$logaction->checkedout_to = $consumable->assigned_to;
|
||||
$logaction->asset_type = 'consumable';
|
||||
$logaction->location_id = $user->location_id;
|
||||
$logaction->user_id = Sentry::getUser()->id;
|
||||
$logaction->note = e(Input::get('note'));
|
||||
|
||||
$settings = Setting::getSettings();
|
||||
|
||||
if ($settings->slack_endpoint) {
|
||||
|
||||
|
||||
$slack_settings = [
|
||||
'username' => $settings->botname,
|
||||
'channel' => $settings->slack_channel,
|
||||
'link_names' => true
|
||||
];
|
||||
|
||||
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
|
||||
|
||||
try {
|
||||
$client->attach([
|
||||
'color' => 'good',
|
||||
'fields' => [
|
||||
[
|
||||
'title' => 'Checked Out:',
|
||||
'value' => strtoupper($logaction->asset_type).' <'.Config::get('app.url').'/admin/consumables/'.$consumable->id.'/view'.'|'.$consumable->name.'> checked out to <'.Config::get('app.url').'/admin/users/'.$user->id.'/view|'.$user->fullName().'> by <'.Config::get('app.url').'/admin/users/'.$admin_user->id.'/view'.'|'.$admin_user->fullName().'>.'
|
||||
],
|
||||
[
|
||||
'title' => 'Note:',
|
||||
'value' => e($logaction->note)
|
||||
],
|
||||
|
||||
|
||||
|
||||
]
|
||||
])->send('Consumable Checked Out');
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$log = $logaction->logaction('checkout');
|
||||
|
||||
$consumable_user = DB::table('consumables_users')->where('assigned_to','=',$consumable->assigned_to)->where('consumable_id','=',$consumable->id)->first();
|
||||
|
||||
$data['log_id'] = $logaction->id;
|
||||
$data['eula'] = $consumable->getEula();
|
||||
$data['first_name'] = $user->first_name;
|
||||
$data['item_name'] = $consumable->name;
|
||||
$data['require_acceptance'] = $consumable->requireAcceptance();
|
||||
|
||||
|
||||
if (($consumable->requireAcceptance()=='1') || ($consumable->getEula())) {
|
||||
|
||||
Mail::send('emails.accept-asset', $data, function ($m) use ($user) {
|
||||
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
|
||||
$m->subject('Confirm consumable delivery');
|
||||
});
|
||||
}
|
||||
|
||||
// Redirect to the new consumable page
|
||||
return Redirect::to("admin/consumables")->with('success', Lang::get('admin/consumables/message.checkout.success'));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getDatatable()
|
||||
{
|
||||
$consumables = Consumable::select(array('id','name','qty'))
|
||||
->whereNull('deleted_at')
|
||||
->orderBy('created_at', 'DESC');
|
||||
|
||||
$consumables = $consumables->get();
|
||||
|
||||
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions',function($consumables)
|
||||
{
|
||||
return '<a href="'.route('checkout/consumable', $consumables->id).'" style="margin-right:5px;" class="btn btn-info btn-sm" '.(($consumables->numRemaining() > 0 ) ? '' : ' disabled').'>'.Lang::get('general.checkout').'</a><a href="'.route('update/consumable', $consumables->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/consumable', $consumables->id).'" data-content="'.Lang::get('admin/consumables/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($consumables->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
|
||||
});
|
||||
|
||||
return Datatable::collection($consumables)
|
||||
->addColumn('name',function($consumables)
|
||||
{
|
||||
return link_to('admin/consumables/'.$consumables->id.'/view', $consumables->name);
|
||||
})
|
||||
->addColumn('qty',function($consumables)
|
||||
{
|
||||
return $consumables->qty;
|
||||
})
|
||||
->addColumn('numRemaining',function($consumables)
|
||||
{
|
||||
return $consumables->numRemaining();
|
||||
})
|
||||
->addColumn($actions)
|
||||
->searchColumns('name','qty','numRemaining','actions')
|
||||
->orderColumns('name','qty','numRemaining','actions')
|
||||
->make();
|
||||
}
|
||||
|
||||
public function getDataView($consumableID)
|
||||
{
|
||||
$consumable = Consumable::find($consumableID);
|
||||
$consumable_users = $consumable->users;
|
||||
|
||||
|
||||
return Datatable::collection($consumable_users)
|
||||
->addColumn('name',function($consumable_users)
|
||||
{
|
||||
return link_to('/admin/users/'.$consumable_users->id.'/view', $consumable_users->fullName());
|
||||
})
|
||||
->make();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
use AdminController;
|
||||
use View;
|
||||
use Asset;
|
||||
use Actionlog;
|
||||
|
||||
class DashboardController extends AdminController
|
||||
{
|
||||
@@ -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')->with('accessorylog','consumablelog','licenselog','assetlog','adminlog','userlog')->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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -161,21 +161,27 @@ class GroupsController extends AdminController
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
|
||||
try {
|
||||
// Update the group data
|
||||
$group->name = Input::get('name');
|
||||
$group->permissions = Input::get('permissions');
|
||||
if (!Config::get('app.lock_passwords')) {
|
||||
|
||||
// Was the group updated?
|
||||
if ($group->save()) {
|
||||
// Redirect to the group page
|
||||
return Redirect::route('update/group', $id)->with('success', Lang::get('admin/groups/message.success.update'));
|
||||
} else {
|
||||
// Redirect to the group page
|
||||
return Redirect::route('update/group', $id)->with('error', Lang::get('admin/groups/message.error.update'));
|
||||
try {
|
||||
// Update the group data
|
||||
$group->name = Input::get('name');
|
||||
$group->permissions = Input::get('permissions');
|
||||
|
||||
// Was the group updated?
|
||||
if ($group->save()) {
|
||||
// Redirect to the group page
|
||||
return Redirect::route('update/group', $id)->with('success', Lang::get('admin/groups/message.success.update'));
|
||||
} else {
|
||||
// Redirect to the group page
|
||||
return Redirect::route('update/group', $id)->with('error', Lang::get('admin/groups/message.error.update'));
|
||||
}
|
||||
} catch (NameRequiredException $e) {
|
||||
$error = Lang::get('admin/group/message.group_name_required');
|
||||
}
|
||||
} catch (NameRequiredException $e) {
|
||||
$error = Lang::get('admin/group/message.group_name_required');
|
||||
|
||||
} else {
|
||||
return Redirect::route('update/group', $id)->withInput()->with('error', 'Denied! Editing groups is not allowed in the demo.');
|
||||
}
|
||||
|
||||
// Redirect to the group page
|
||||
|
||||
@@ -19,6 +19,10 @@ use Supplier;
|
||||
use Validator;
|
||||
use View;
|
||||
use Response;
|
||||
use Datatable;
|
||||
use Slack;
|
||||
use Config;
|
||||
use Session;
|
||||
|
||||
class LicensesController extends AdminController
|
||||
{
|
||||
@@ -33,11 +37,8 @@ class LicensesController extends AdminController
|
||||
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the licenses
|
||||
$licenses = License::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/licenses/index', compact('licenses'));
|
||||
return View::make('backend/licenses/index');
|
||||
}
|
||||
|
||||
|
||||
@@ -116,10 +117,8 @@ class LicensesController extends AdminController
|
||||
$license->seats = e(Input::get('seats'));
|
||||
$license->purchase_date = e(Input::get('purchase_date'));
|
||||
$license->purchase_order = e(Input::get('purchase_order'));
|
||||
//$license->purchase_cost = e(Input::get('purchase_cost'));
|
||||
$license->depreciation_id = e(Input::get('depreciation_id'));
|
||||
$license->expiration_date = e(Input::get('expiration_date'));
|
||||
//$license->asset_id = e(Input::get('asset_id'));
|
||||
$license->user_id = Sentry::getId();
|
||||
|
||||
if (($license->purchase_date == "") || ($license->purchase_date == "0000-00-00")) {
|
||||
@@ -136,13 +135,14 @@ class LicensesController extends AdminController
|
||||
|
||||
// Was the license created?
|
||||
if($license->save()) {
|
||||
|
||||
$insertedId = $license->id;
|
||||
// Save the license seat data
|
||||
for ($x=0; $x<$license->seats; $x++) {
|
||||
$license_seat = new LicenseSeat();
|
||||
$license_seat->license_id = $insertedId;
|
||||
$license_seat->user_id = Sentry::getId();
|
||||
$license_seat->assigned_to = 0;
|
||||
$license_seat->assigned_to = NULL;
|
||||
$license_seat->notes = NULL;
|
||||
$license_seat->save();
|
||||
}
|
||||
@@ -230,6 +230,7 @@ class LicensesController extends AdminController
|
||||
$license->depreciation_id = e(Input::get('depreciation_id'));
|
||||
$license->purchase_order = e(Input::get('purchase_order'));
|
||||
$license->maintained = e(Input::get('maintained'));
|
||||
$license->reassignable = e(Input::get('reassignable'));
|
||||
|
||||
if ( e(Input::get('supplier_id')) == '') {
|
||||
$license->supplier_id = NULL;
|
||||
@@ -270,6 +271,12 @@ class LicensesController extends AdminController
|
||||
$license->maintained = e(Input::get('maintained'));
|
||||
}
|
||||
|
||||
if ( e(Input::get('reassignable')) == '') {
|
||||
$license->reassignable = 0;
|
||||
} else {
|
||||
$license->reassignable = e(Input::get('reassignable'));
|
||||
}
|
||||
|
||||
if ( e(Input::get('purchase_order')) == '') {
|
||||
$license->purchase_order = '';
|
||||
} else {
|
||||
@@ -316,7 +323,7 @@ class LicensesController extends AdminController
|
||||
$license_seat = new LicenseSeat();
|
||||
$license_seat->license_id = $license->id;
|
||||
$license_seat->user_id = Sentry::getId();
|
||||
$license_seat->assigned_to = 0;
|
||||
$license_seat->assigned_to = NULL;
|
||||
$license_seat->notes = NULL;
|
||||
$license_seat->save();
|
||||
}
|
||||
@@ -370,11 +377,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'));
|
||||
}
|
||||
@@ -403,7 +416,7 @@ class LicensesController extends AdminController
|
||||
->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'))
|
||||
DB::raw('concat(first_name," ",last_name) as full_name, assets.id as id, models.name as modelname'))
|
||||
->whereNull('assets.deleted_at')
|
||||
->get();
|
||||
|
||||
@@ -437,6 +450,7 @@ class LicensesController extends AdminController
|
||||
|
||||
$assigned_to = e(Input::get('assigned_to'));
|
||||
$asset_id = e(Input::get('asset_id'));
|
||||
$user = Sentry::getUser();
|
||||
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
@@ -478,13 +492,13 @@ class LicensesController extends AdminController
|
||||
|
||||
|
||||
|
||||
// Check if the asset exists
|
||||
// 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')) == '') {
|
||||
if (Input::get('asset_id') == '') {
|
||||
$licenseseat->asset_id = NULL;
|
||||
} else {
|
||||
$licenseseat->asset_id = e(Input::get('asset_id'));
|
||||
@@ -507,14 +521,58 @@ class LicensesController extends AdminController
|
||||
$logaction->asset_type = 'software';
|
||||
$logaction->user_id = Sentry::getUser()->id;
|
||||
$logaction->note = e(Input::get('note'));
|
||||
$logaction->asset_id = $licenseseat->license_id;
|
||||
|
||||
|
||||
$license = License::find($licenseseat->license_id);
|
||||
$settings = Setting::getSettings();
|
||||
|
||||
|
||||
// Update the asset data
|
||||
if ( e(Input::get('assigned_to')) == '') {
|
||||
$logaction->checkedout_to = NULL;
|
||||
$logaction->checkedout_to = NULL;
|
||||
$slack_msg = strtoupper($logaction->asset_type).' license <'.Config::get('app.url').'/admin/licenses/'.$license->id.'/view'.'|'.$license->name.'> checked out to <'.Config::get('app.url').'/hardware/'.$is_asset_id->id.'/view|'.$is_asset_id->showAssetName().'> by <'.Config::get('app.url').'/admin/users/'.$user->id.'/view'.'|'.$user->fullName().'>.';
|
||||
} else {
|
||||
$logaction->checkedout_to = e(Input::get('assigned_to'));
|
||||
$logaction->checkedout_to = e(Input::get('assigned_to'));
|
||||
$slack_msg = strtoupper($logaction->asset_type).' license <'.Config::get('app.url').'/admin/licenses/'.$license->id.'/view'.'|'.$license->name.'> checked out to <'.Config::get('app.url').'/admin/users/'.$is_assigned_to->id.'/view|'.$is_assigned_to->fullName().'> by <'.Config::get('app.url').'/admin/users/'.$user->id.'/view'.'|'.$user->fullName().'>.';
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($settings->slack_endpoint) {
|
||||
|
||||
|
||||
$slack_settings = [
|
||||
'username' => $settings->botname,
|
||||
'channel' => $settings->slack_channel,
|
||||
'link_names' => true
|
||||
];
|
||||
|
||||
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
|
||||
|
||||
try {
|
||||
$client->attach([
|
||||
'color' => 'good',
|
||||
'fields' => [
|
||||
[
|
||||
'title' => 'Checked Out:',
|
||||
'value' => $slack_msg
|
||||
],
|
||||
[
|
||||
'title' => 'Note:',
|
||||
'value' => e($logaction->note)
|
||||
],
|
||||
|
||||
|
||||
|
||||
]
|
||||
])->send('License Checked Out');
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$log = $logaction->logaction('checkout');
|
||||
|
||||
@@ -531,14 +589,14 @@ class LicensesController extends AdminController
|
||||
/**
|
||||
* Check the license back into inventory
|
||||
**/
|
||||
public function getCheckin($seatId)
|
||||
public function getCheckin($seatId = null, $backto = null)
|
||||
{
|
||||
// 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'));
|
||||
}
|
||||
return View::make('backend/licenses/checkin', compact('licenseseat'));
|
||||
return View::make('backend/licenses/checkin', compact('licenseseat'))->with('backto',$backto);
|
||||
|
||||
}
|
||||
|
||||
@@ -547,14 +605,22 @@ class LicensesController extends AdminController
|
||||
/**
|
||||
* Check in the item so that it can be checked out again to someone else
|
||||
**/
|
||||
public function postCheckin($seatId)
|
||||
public function postCheckin($seatId = null, $backto = null)
|
||||
{
|
||||
// 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'));
|
||||
}
|
||||
|
||||
$license = License::find($licenseseat->license_id);
|
||||
|
||||
if(!$license->reassignable) {
|
||||
// Not allowed to checkin
|
||||
Session::flash('error', 'License not reassignable.');
|
||||
return Redirect::back()->withInput();
|
||||
}
|
||||
|
||||
// Declare the rules for the form validation
|
||||
$rules = array(
|
||||
'note' => 'alpha_space',
|
||||
@@ -569,25 +635,70 @@ class LicensesController extends AdminController
|
||||
// Ooops.. something went wrong
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
|
||||
$return_to = $licenseseat->assigned_to;
|
||||
$logaction = new Actionlog();
|
||||
$logaction->checkedout_to = $licenseseat->assigned_to;
|
||||
|
||||
// Update the asset data
|
||||
$licenseseat->assigned_to = '0';
|
||||
$licenseseat->assigned_to = NULL;
|
||||
$licenseseat->asset_id = NULL;
|
||||
|
||||
$user = Sentry::getUser();
|
||||
|
||||
// Was the asset updated?
|
||||
if($licenseseat->save()) {
|
||||
$logaction->asset_id = NULL;
|
||||
$logaction->asset_id = $licenseseat->license_id;
|
||||
$logaction->location_id = NULL;
|
||||
$logaction->asset_type = 'software';
|
||||
$logaction->note = e(Input::get('note'));
|
||||
$logaction->user_id = Sentry::getUser()->id;
|
||||
$log = $logaction->logaction('checkin from');
|
||||
$logaction->user_id = $user->id;
|
||||
|
||||
$settings = Setting::getSettings();
|
||||
|
||||
if ($settings->slack_endpoint) {
|
||||
|
||||
|
||||
$slack_settings = [
|
||||
'username' => $settings->botname,
|
||||
'channel' => $settings->slack_channel,
|
||||
'link_names' => true
|
||||
];
|
||||
|
||||
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
|
||||
|
||||
try {
|
||||
$client->attach([
|
||||
'color' => 'good',
|
||||
'fields' => [
|
||||
[
|
||||
'title' => 'Checked In:',
|
||||
'value' => strtoupper($logaction->asset_type).' <'.Config::get('app.url').'/admin/licenses/'.$license->id.'/view'.'|'.$license->name.'> checked in by <'.Config::get('app.url').'/admin/users/'.$user->id.'/view'.'|'.$user->fullName().'>.'
|
||||
],
|
||||
[
|
||||
'title' => 'Note:',
|
||||
'value' => e($logaction->note)
|
||||
],
|
||||
|
||||
]
|
||||
])->send('License Checked In');
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$log = $logaction->logaction('checkin from');
|
||||
|
||||
|
||||
|
||||
if ($backto=='user') {
|
||||
return Redirect::to("admin/users/".$return_to.'/view')->with('success', Lang::get('admin/licenses/message.checkin.success'));
|
||||
} else {
|
||||
return Redirect::to("admin/licenses/".$licenseseat->license_id."/view")->with('success', Lang::get('admin/licenses/message.checkin.success'));
|
||||
}
|
||||
|
||||
// Redirect to the license page
|
||||
return Redirect::to("admin/licenses")->with('success', Lang::get('admin/licenses/message.checkin.success'));
|
||||
}
|
||||
|
||||
// Redirect to the license page with error
|
||||
@@ -659,7 +770,7 @@ class LicensesController extends AdminController
|
||||
foreach(Input::file('licensefile') as $file) {
|
||||
|
||||
$rules = array(
|
||||
'licensefile' => 'required|mimes:png,gif,jpg,jpeg,doc,docx,pdf,txt|max:2000'
|
||||
'licensefile' => 'required|mimes:png,gif,jpg,jpeg,doc,docx,pdf,txt,zip,rar|max:2000'
|
||||
);
|
||||
$validator = Validator::make(array('licensefile'=> $file), $rules);
|
||||
|
||||
@@ -768,4 +879,33 @@ class LicensesController extends AdminController
|
||||
return Redirect::route('licenses')->with('error', $error);
|
||||
}
|
||||
}
|
||||
|
||||
public function getDatatable() {
|
||||
$licenses = License::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function($licenses) {
|
||||
return '<a href="'.route('update/license', $licenses->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/license', $licenses->id).'" data-content="'.Lang::get('admin/licenses/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($licenses->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
|
||||
});
|
||||
|
||||
return Datatable::collection($licenses)
|
||||
->addColumn('name', function($licenses) {
|
||||
return link_to('/admin/licenses/'.$licenses->id.'/view', $licenses->name);
|
||||
})
|
||||
->addColumn('serial', function($licenses) {
|
||||
return link_to('/admin/licenses/'.$licenses->id.'/view', mb_strimwidth($licenses->serial, 0, 50, "..."));
|
||||
})
|
||||
->addColumn('totalSeats', function($licenses) {
|
||||
return $licenses->totalSeatsByLicenseID();
|
||||
})
|
||||
->addColumn('remaining', function($licenses) {
|
||||
return $licenses->remaincount();
|
||||
})
|
||||
->addColumn('purchase_date', function($licenses) {
|
||||
return $licenses->purchase_date;
|
||||
})
|
||||
->addColumn($actions)
|
||||
->searchColumns('name','serial','totalSeats','remaining','purchase_date','actions')
|
||||
->orderColumns('name','serial','totalSeats','remaining','purchase_date','actions')
|
||||
->make();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class LocationsController extends AdminController
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the locations
|
||||
$locations = Location::orderBy('created_at', 'DESC')->get();
|
||||
$locations = Location::orderBy('created_at', 'DESC')->with('parent','assets','assignedassets')->get();
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/locations/index', compact('locations'));
|
||||
@@ -37,9 +37,15 @@ class LocationsController extends AdminController
|
||||
*/
|
||||
public function getCreate()
|
||||
{
|
||||
// Show the page
|
||||
$location_options = array('0' => 'Top Level') + Location::lists('name', 'id');
|
||||
return View::make('backend/locations/edit')->with('location_options',$location_options)->with('location',new Location);
|
||||
$locations = Location::orderBy('name','ASC')->get();
|
||||
|
||||
$location_options_array = Location::getLocationHierarchy($locations);
|
||||
$location_options = Location::flattenLocationsArray($location_options_array);
|
||||
$location_options = array('' => 'Top Level') + $location_options;
|
||||
|
||||
return View::make('backend/locations/edit')
|
||||
->with('location_options',$location_options)
|
||||
->with('location',new Location);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,12 +68,18 @@ class LocationsController extends AdminController
|
||||
|
||||
// Save the location data
|
||||
$location->name = e(Input::get('name'));
|
||||
if (Input::get('parent_id')=='') {
|
||||
$location->parent_id = null;
|
||||
} else {
|
||||
$location->parent_id = e(Input::get('parent_id'));
|
||||
}
|
||||
$location->currency = e(Input::get('currency'));
|
||||
$location->address = e(Input::get('address'));
|
||||
$location->address2 = e(Input::get('address2'));
|
||||
$location->city = e(Input::get('city'));
|
||||
$location->state = e(Input::get('state'));
|
||||
$location->country = e(Input::get('country'));
|
||||
$location->zip = e(Input::get('zip'));
|
||||
$location->zip = e(Input::get('zip'));
|
||||
$location->user_id = Sentry::getId();
|
||||
|
||||
// Was the asset created?
|
||||
@@ -97,14 +109,15 @@ class LocationsController extends AdminController
|
||||
{
|
||||
// Check if the location exists
|
||||
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'));
|
||||
}
|
||||
|
||||
// Show the page
|
||||
//$location_options = array('' => 'Top Level') + Location::lists('name', 'id');
|
||||
$locations = Location::orderBy('name','ASC')->get();
|
||||
$location_options_array = Location::getLocationHierarchy($locations);
|
||||
$location_options = Location::flattenLocationsArray($location_options_array);
|
||||
$location_options = array('' => 'Top Level') + $location_options;
|
||||
|
||||
$location_options = array('' => 'Top Level') + DB::table('locations')->where('id', '!=', $locationId)->lists('name', 'id');
|
||||
return View::make('backend/locations/edit', compact('location'))->with('location_options',$location_options);
|
||||
}
|
||||
|
||||
@@ -128,27 +141,33 @@ class LocationsController extends AdminController
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
// 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'));
|
||||
$location->name = e(Input::get('name'));
|
||||
if (Input::get('parent_id')=='') {
|
||||
$location->parent_id = null;
|
||||
} else {
|
||||
$location->parent_id = e(Input::get('parent_id',''));
|
||||
}
|
||||
$location->currency = e(Input::get('currency'));
|
||||
$location->address = e(Input::get('address'));
|
||||
$location->address2 = e(Input::get('address2'));
|
||||
$location->city = e(Input::get('city'));
|
||||
$location->state = e(Input::get('state'));
|
||||
$location->country = e(Input::get('country'));
|
||||
$location->zip = e(Input::get('zip'));
|
||||
$location->country = e(Input::get('country'));
|
||||
$location->zip = e(Input::get('zip'));
|
||||
|
||||
// Was the asset created?
|
||||
if($location->save()) {
|
||||
// Redirect to the saved location page
|
||||
return Redirect::to("admin/settings/locations/")->with('success', Lang::get('admin/locations/message.update.success'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the location management page
|
||||
return Redirect::to("admin/settings/locations/$locationId/edit")->with('error', Lang::get('admin/locations/message.update.error'));
|
||||
@@ -170,15 +189,12 @@ class LocationsController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
if ($location->has_users() > 0) {
|
||||
|
||||
// Redirect to the asset management page
|
||||
if ($location->has_users->count() > 0) {
|
||||
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.assoc_users'));
|
||||
} elseif ($location->childLocations->count() > 0) {
|
||||
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.assoc_users'));
|
||||
} else {
|
||||
|
||||
$location->delete();
|
||||
|
||||
// Redirect to the locations management page
|
||||
return Redirect::to('admin/settings/locations')->with('success', Lang::get('admin/locations/message.delete.success'));
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ class ManufacturersController extends AdminController
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
@@ -126,7 +126,7 @@ class ManufacturersController extends AdminController
|
||||
// Redirect to the new manufacturer page
|
||||
return Redirect::to("admin/settings/manufacturers")->with('success', Lang::get('admin/manufacturers/message.update.success'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the manufacturer management page
|
||||
return Redirect::to("admin/settings/manufacturers/$manufacturerId/edit")->with('error', Lang::get('admin/manufacturers/message.update.error'));
|
||||
@@ -169,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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ use Manufacturer;
|
||||
use Str;
|
||||
use Validator;
|
||||
use View;
|
||||
use Datatable;
|
||||
|
||||
class ModelsController extends AdminController
|
||||
{
|
||||
@@ -24,11 +25,8 @@ class ModelsController extends AdminController
|
||||
*/
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the models
|
||||
$models = Model::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/models/index', compact('models'));
|
||||
return View::make('backend/models/index');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -59,21 +57,26 @@ class ModelsController extends AdminController
|
||||
public function postCreate()
|
||||
{
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
// Create a new manufacturer
|
||||
$model = new Model;
|
||||
|
||||
$validator = Validator::make(Input::all(), $model->validationRules());
|
||||
|
||||
// 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 {
|
||||
@@ -83,11 +86,11 @@ class ModelsController extends AdminController
|
||||
// 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->eol = e(Input::get('eol'));
|
||||
$model->show_mac_address = e(Input::get('show_mac_address', '0'));
|
||||
|
||||
|
||||
if (Input::file('image')) {
|
||||
$image = Input::file('image');
|
||||
@@ -105,10 +108,6 @@ class ModelsController extends AdminController
|
||||
// Redirect to the new model page
|
||||
return Redirect::to("hardware/models")->with('success', Lang::get('admin/models/message.create.success'));
|
||||
}
|
||||
} else {
|
||||
// failure
|
||||
$errors = $model->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
}
|
||||
|
||||
// Redirect to the model create page
|
||||
@@ -160,18 +159,18 @@ class ModelsController extends AdminController
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
// 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 {
|
||||
@@ -180,9 +179,10 @@ class ModelsController extends AdminController
|
||||
|
||||
// Update the model data
|
||||
$model->name = e(Input::get('name'));
|
||||
$model->modelno = e(Input::get('modelno'));
|
||||
$model->modelno = e(Input::get('modelno'));
|
||||
$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');
|
||||
@@ -198,13 +198,13 @@ class ModelsController extends AdminController
|
||||
if (Input::get('image_delete') == 1 && Input::file('image') == "") {
|
||||
$model->image = NULL;
|
||||
}
|
||||
|
||||
|
||||
// Was it created?
|
||||
if($model->save()) {
|
||||
// Redirect to the new model page
|
||||
return Redirect::to("hardware/models")->with('success', Lang::get('admin/models/message.update.success'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the model create page
|
||||
return Redirect::to("hardware/models/$modelId/edit")->with('error', Lang::get('admin/models/message.update.error'));
|
||||
@@ -238,6 +238,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
|
||||
@@ -247,7 +270,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'));
|
||||
@@ -261,7 +284,7 @@ class ModelsController extends AdminController
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getClone($modelId = null)
|
||||
{
|
||||
// Check if the model exists
|
||||
@@ -269,10 +292,10 @@ class ModelsController extends AdminController
|
||||
// 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');
|
||||
@@ -284,8 +307,82 @@ class ModelsController extends AdminController
|
||||
$view->with('model',$model);
|
||||
$view->with('clone_model',$model_to_clone);
|
||||
return $view;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function getDatatable($status = null)
|
||||
{
|
||||
$models = Model::orderBy('created_at', 'DESC')->with('category','assets','depreciation');
|
||||
($status != 'Deleted') ?: $models->withTrashed()->Deleted();;
|
||||
$models = $models->get();
|
||||
|
||||
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function($models) {
|
||||
if($models->deleted_at=='') {
|
||||
return '<a href="'.route('update/model', $models->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/model', $models->id).'" data-content="'.Lang::get('admin/models/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($models->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
|
||||
} else {
|
||||
return '<a href="'.route('restore/model', $models->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
|
||||
}
|
||||
});
|
||||
|
||||
return Datatable::collection($models)
|
||||
->addColumn('manufacturer', function($models) {
|
||||
return $models->manufacturer->name;
|
||||
})
|
||||
->addColumn('name', function ($models) {
|
||||
return link_to('/hardware/models/'.$models->id.'/view', $models->name);
|
||||
})
|
||||
->showColumns('modelno')
|
||||
->addColumn('asset_count', function($models) {
|
||||
return $models->assets->count();
|
||||
})
|
||||
->addColumn('depreciation', function($models) {
|
||||
return (($models->depreciation)&&($models->depreciation->id > 0)) ? $models->depreciation->name.' ('.$models->depreciation->months.')' : Lang::get('general.no_depreciation');
|
||||
})
|
||||
->addColumn('category', function($models) {
|
||||
return ($models->category) ? $models->category->name : '';
|
||||
})
|
||||
->addColumn('eol', function($models) {
|
||||
return ($models->eol) ? $models->eol.' '.Lang::get('general.months') : '';
|
||||
})
|
||||
->addColumn($actions)
|
||||
->searchColumns('name','modelno','asset_count','depreciation','category','eol','actions')
|
||||
->orderColumns('name','modelno','asset_count','depreciation','category','eol','actions')
|
||||
->make();
|
||||
}
|
||||
|
||||
|
||||
public function getDataView($modelID)
|
||||
{
|
||||
$model = Model::withTrashed()->find($modelID);
|
||||
$modelassets = $model->assets;
|
||||
|
||||
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($modelassets)
|
||||
{
|
||||
if (($modelassets->assigned_to !='') && ($modelassets->assigned_to > 0)) {
|
||||
return '<a href="'.route('checkin/hardware', $modelassets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
|
||||
} else {
|
||||
return '<a href="'.route('checkout/hardware', $modelassets->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
|
||||
}
|
||||
});
|
||||
|
||||
return Datatable::collection($modelassets)
|
||||
->addColumn('name', function ($modelassets) {
|
||||
return link_to('/hardware/'.$modelassets->id.'/view', $modelassets->showAssetName());
|
||||
// return $modelassets->name;
|
||||
})
|
||||
->addColumn('asset_tag', function ($modelassets) {
|
||||
return link_to('/hardware/'.$modelassets->id.'/view', $modelassets->asset_tag);
|
||||
})
|
||||
->showColumns('serial')
|
||||
->addColumn('assigned_to', function ($modelassets) {
|
||||
if ($modelassets->assigned_to) {
|
||||
return link_to('/admin/users/'.$modelassets->assigned_to.'/view', $modelassets->assigneduser->fullName());
|
||||
}
|
||||
})
|
||||
->addColumn($actions)
|
||||
->searchColumns('name','asset_tag','serial','assigned_to','actions')
|
||||
->orderColumns('name','asset_tag','serial','assigned_to','actions')
|
||||
->make();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,10 @@ use View;
|
||||
use Location;
|
||||
use Redirect;
|
||||
use Response;
|
||||
use Actionlog;
|
||||
use Setting;
|
||||
use League\Csv\Writer;
|
||||
use League\Csv\Reader;
|
||||
|
||||
class ReportsController extends AdminController
|
||||
{
|
||||
@@ -45,13 +49,13 @@ class ReportsController extends AdminController
|
||||
Lang::get('general.model_no'),
|
||||
Lang::get('general.name'),
|
||||
Lang::get('admin/hardware/table.serial'),
|
||||
Lang::get('general.status'),
|
||||
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')
|
||||
Lang::get('admin/hardware/table.location')
|
||||
);
|
||||
$header = array_map('trim', $header);
|
||||
$rows[] = implode($header, ',');
|
||||
@@ -69,6 +73,11 @@ class ReportsController extends AdminController
|
||||
$row[] = '"'.$asset->model->modelno.'"';
|
||||
$row[] = $asset->name;
|
||||
$row[] = $asset->serial;
|
||||
if ($asset->assetstatus) {
|
||||
$row[] = $asset->assetstatus->name;
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
$row[] = $asset->purchase_date;
|
||||
$row[] = '"'.number_format($asset->purchase_cost).'"';
|
||||
if ($asset->order_number) {
|
||||
@@ -107,16 +116,6 @@ class ReportsController extends AdminController
|
||||
$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, ',');
|
||||
}
|
||||
|
||||
@@ -148,10 +147,11 @@ class ReportsController extends AdminController
|
||||
*/
|
||||
public function exportDeprecationReport()
|
||||
{
|
||||
// @todo - It may be worthwhile creating a separate controller for reporting
|
||||
|
||||
// Grab all the assets
|
||||
$assets = Asset::orderBy('created_at', 'DESC')->get();
|
||||
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')->orderBy('created_at', 'DESC')->get();
|
||||
|
||||
$csv = \League\Csv\Writer::createFromFileObject(new \SplTempFileObject());
|
||||
$csv->setOutputBOM(Reader::BOM_UTF16_BE);
|
||||
|
||||
$rows = array();
|
||||
|
||||
@@ -167,8 +167,9 @@ class ReportsController extends AdminController
|
||||
Lang::get('admin/hardware/table.book_value'),
|
||||
Lang::get('admin/hardware/table.diff')
|
||||
);
|
||||
$header = array_map('trim', $header);
|
||||
$rows[] = implode($header, ',');
|
||||
|
||||
//we insert the CSV header
|
||||
$csv->insertOne($header);
|
||||
|
||||
// Create a row per asset
|
||||
foreach ($assets as $asset) {
|
||||
@@ -188,7 +189,7 @@ class ReportsController extends AdminController
|
||||
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.'"';
|
||||
$row[] = $location->city . ', ' . $location->state;
|
||||
} elseif ($location->name) {
|
||||
$row[] = $location->name;
|
||||
} else {
|
||||
@@ -198,24 +199,46 @@ class ReportsController extends AdminController
|
||||
$row[] = ''; // Empty string if location is not set
|
||||
}
|
||||
|
||||
$depreciation = $asset->depreciate();
|
||||
|
||||
|
||||
if ($asset->assetloc) {
|
||||
$currency = $asset->assetloc->currency;
|
||||
} else {
|
||||
$currency = Setting::first()->default_currency;
|
||||
}
|
||||
|
||||
$row[] = $asset->purchase_date;
|
||||
$row[] = '"'.number_format($asset->purchase_cost).'"';
|
||||
$row[] = '"'.number_format($depreciation).'"';
|
||||
$row[] = '"'.number_format($asset->purchase_cost - $depreciation).'"';
|
||||
$rows[] = implode($row, ',');
|
||||
$row[] = $currency.number_format($asset->purchase_cost);
|
||||
$row[] = $currency.number_format($asset->getDepreciatedValue());
|
||||
$row[] = $currency.number_format(($asset->purchase_cost - $asset->getDepreciatedValue()));
|
||||
$csv->insertOne($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');
|
||||
$csv->output('depreciation-report-'.date('Y-m-d').'.csv');
|
||||
die;
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show Report for Activity
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
|
||||
public function getActivityReport()
|
||||
{
|
||||
$log_actions = Actionlog::orderBy('created_at', 'DESC')
|
||||
->with('adminlog')
|
||||
->with('accessorylog')
|
||||
->with('assetlog')
|
||||
->with('licenselog')
|
||||
->with('userlog')
|
||||
->orderBy('created_at','DESC')
|
||||
->get();
|
||||
return View::make('backend/reports/activity', compact('log_actions'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show Report for Licenses
|
||||
*
|
||||
@@ -371,7 +394,7 @@ class ReportsController extends AdminController
|
||||
if (e(Input::get('purchase_date')) == '1') {
|
||||
$row[] = $asset->purchase_date;
|
||||
}
|
||||
if ((e(Input::get('purchase_cost')) == '1') && (e(Input::get('depreciation')) == '0')) {
|
||||
if (e(Input::get('purchase_cost')) == '1') {
|
||||
$row[] = '"'.number_format($asset->purchase_cost).'"';
|
||||
}
|
||||
if (e(Input::get('order')) == '1') {
|
||||
@@ -436,7 +459,7 @@ class ReportsController extends AdminController
|
||||
}
|
||||
}
|
||||
if (e(Input::get('depreciation')) == '1') {
|
||||
$depreciation = $asset->depreciate();
|
||||
$depreciation = $asset->getDepreciatedValue();
|
||||
$row[] = '"'.number_format($asset->purchase_cost).'"';
|
||||
$row[] = '"'.number_format($depreciation).'"';
|
||||
$row[] = '"'.number_format($asset->purchase_cost - $depreciation).'"';
|
||||
@@ -455,4 +478,4 @@ class ReportsController extends AdminController
|
||||
return Redirect::to("reports/custom")->with('error', Lang::get('admin/reports/message.error'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,9 @@ use Sentry;
|
||||
use Str;
|
||||
use Validator;
|
||||
use View;
|
||||
use Image;
|
||||
use Config;
|
||||
use Response;
|
||||
|
||||
class SettingsController extends AdminController
|
||||
{
|
||||
@@ -62,11 +65,22 @@ class SettingsController extends AdminController
|
||||
|
||||
|
||||
// Declare the rules for the form validation
|
||||
|
||||
$rules = array(
|
||||
"site_name" => 'required|min:3',
|
||||
"per_page" => 'required|min:1|numeric',
|
||||
"qr_text" => 'min:1|max:31'
|
||||
);
|
||||
"per_page" => 'required|min:1|numeric',
|
||||
"qr_text" => 'min:1|max:31',
|
||||
"logo" => 'mimes:jpeg,bmp,png,gif',
|
||||
"alert_email" => 'email',
|
||||
"slack_endpoint" => 'url',
|
||||
"default_currency" => 'required',
|
||||
"slack_channel" => 'regex:/(?<!\w)#\w+/',
|
||||
"slack_botname" => 'alpha_dash',
|
||||
);
|
||||
|
||||
if (Config::get('app.lock_passwords')==false) {
|
||||
$rules['site_name'] = 'required|min:3';
|
||||
|
||||
}
|
||||
|
||||
// Create a new validator instance from our validation rules
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
@@ -78,17 +92,45 @@ class SettingsController extends AdminController
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
}
|
||||
|
||||
if (Input::get('clear_logo')=='1') {
|
||||
$setting->logo = NULL;
|
||||
} elseif (Input::file('logo')) {
|
||||
if (!Config::get('app.lock_passwords')) {
|
||||
$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'));
|
||||
|
||||
if (Config::get('app.lock_passwords')==false) {
|
||||
$setting->site_name = e(Input::get('site_name'));
|
||||
}
|
||||
|
||||
$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->barcode_type = e(Input::get('barcode_type'));
|
||||
$setting->load_remote = e(Input::get('load_remote', '0'));
|
||||
$setting->default_currency = e(Input::get('default_currency', '$'));
|
||||
$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'));
|
||||
$setting->slack_endpoint = e(Input::get('slack_endpoint'));
|
||||
$setting->slack_channel = e(Input::get('slack_channel'));
|
||||
$setting->slack_botname = e(Input::get('slack_botname'));
|
||||
|
||||
|
||||
// Was the asset updated?
|
||||
if($setting->save()) {
|
||||
@@ -102,6 +144,63 @@ class SettingsController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate the backup page
|
||||
*
|
||||
* @return View
|
||||
**/
|
||||
|
||||
public function getBackups()
|
||||
{
|
||||
$path = Config::get('backup::path');
|
||||
$files = array();
|
||||
|
||||
if ($handle = opendir($path)) {
|
||||
|
||||
/* This is the correct way to loop over the directory. */
|
||||
while (false !== ($entry = readdir($handle))) {
|
||||
clearstatcache();
|
||||
if (substr(strrchr($entry,'.'),1)=='zip') {
|
||||
$files[] = array(
|
||||
'filename' => $entry,
|
||||
'filesize' => Setting::fileSizeConvert(filesize(Config::get('backup::path').$entry)),
|
||||
'modified' => filemtime(Config::get('backup::path').$entry)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
|
||||
return View::make('backend/settings/backups', compact('path','files'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Download the dump file
|
||||
*
|
||||
* @param int $assetId
|
||||
* @return View
|
||||
**/
|
||||
public function downloadFile($filename = null)
|
||||
{
|
||||
|
||||
$file = Config::get('backup::path').'/'.$filename;
|
||||
|
||||
|
||||
// the license is valid
|
||||
if (file_exists($file)) {
|
||||
return Response::download($file);
|
||||
} else {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/settings/message.does_not_exist');
|
||||
|
||||
// Redirect to the licence management page
|
||||
return Redirect::route('settings/backups')->with('error', $error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,9 +64,15 @@ class StatuslabelsController extends AdminController
|
||||
// attempt validation
|
||||
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()) {
|
||||
@@ -94,8 +105,11 @@ class StatuslabelsController extends AdminController
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -118,20 +132,27 @@ class StatuslabelsController extends AdminController
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
// 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()) {
|
||||
// Redirect to the saved Statuslabel page
|
||||
return Redirect::to("admin/settings/statuslabels/")->with('success', Lang::get('admin/statuslabels/message.update.success'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the Statuslabel management page
|
||||
return Redirect::to("admin/settings/statuslabels/$statuslabelId/edit")->with('error', Lang::get('admin/statuslabels/message.update.error'));
|
||||
|
||||
@@ -20,7 +20,9 @@ use Redirect;
|
||||
use Sentry;
|
||||
use Validator;
|
||||
use View;
|
||||
use Chumper\Datatable\Facades\Datatable;
|
||||
use Datatable;
|
||||
use League\Csv\Reader;
|
||||
use Mail;
|
||||
|
||||
class UsersController extends AdminController
|
||||
{
|
||||
@@ -32,8 +34,9 @@ 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',
|
||||
'location_id' => 'numeric',
|
||||
'username' => 'required|min:2|unique:users,username',
|
||||
'email' => 'email|unique:users,email',
|
||||
'password' => 'required|min:6',
|
||||
'password_confirm' => 'required|min:6|same:password',
|
||||
);
|
||||
@@ -45,41 +48,9 @@ class UsersController extends AdminController
|
||||
*/
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the users - depending on the scope to include
|
||||
$users = Sentry::getUserProvider()->createModel();
|
||||
|
||||
// Do we want to include the deleted users?
|
||||
// the with and onlyTrashed calls currently do not work - returns an
|
||||
// inconsistent array which cannot be displayed by the blade output
|
||||
|
||||
if (Input::get('withTrashed')) {
|
||||
|
||||
$users = $users->withTrashed();
|
||||
//$users = Sentry::getUserProvider()->createModel()->paginate();
|
||||
|
||||
} elseif (Input::get('onlyTrashed')) {
|
||||
|
||||
// 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(100000)
|
||||
->appends(array(
|
||||
'withTrashed' => Input::get('withTrashed'),
|
||||
'onlyTrashed' => Input::get('onlyTrashed'),
|
||||
));
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/users/index', compact('users'));
|
||||
return View::make('backend/users/index');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,7 +120,7 @@ class UsersController extends AdminController
|
||||
// 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']=='') {
|
||||
@@ -174,6 +145,22 @@ class UsersController extends AdminController
|
||||
|
||||
// Redirect to the new user page
|
||||
//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);
|
||||
}
|
||||
|
||||
@@ -259,6 +246,11 @@ class UsersController extends AdminController
|
||||
$this->decodePermissions($permissions);
|
||||
app('request')->request->set('permissions', $permissions);
|
||||
|
||||
// Only update the email address if locking is set to false
|
||||
if (Config::get('app.lock_passwords')) {
|
||||
return Redirect::route('users')->with('error', 'Denied! You cannot update user information on the demo.');
|
||||
}
|
||||
|
||||
try {
|
||||
// Get the user information
|
||||
$user = Sentry::getUserProvider()->findById($id);
|
||||
@@ -270,8 +262,15 @@ class UsersController extends AdminController
|
||||
return Redirect::route('users')->with('error', $error);
|
||||
}
|
||||
|
||||
//
|
||||
$this->validationRules['email'] = "required|email|unique:users,email,{$user->email},email";
|
||||
//Check if username is the same then unset validationRules
|
||||
if (Input::get('username') == $user->username) {
|
||||
unset($this->validationRules['username']);
|
||||
}
|
||||
|
||||
//Check if email is the same then unset validationRules
|
||||
if ($user->email == Input::get('email')) {
|
||||
unset($this->validationRules['email']);
|
||||
}
|
||||
|
||||
// Do we want to update the user password?
|
||||
if ( ! $password = Input::get('password')) {
|
||||
@@ -293,9 +292,10 @@ class UsersController extends AdminController
|
||||
|
||||
try {
|
||||
// Update the user
|
||||
$user->first_name = Input::get('first_name');
|
||||
$user->first_name = Input::get('first_name');
|
||||
$user->last_name = Input::get('last_name');
|
||||
$user->email = Input::get('email');
|
||||
$user->username = Input::get('username');
|
||||
$user->email = Input::get('email');
|
||||
$user->employee_num = Input::get('employee_num');
|
||||
$user->activated = Input::get('activated', $user->activated);
|
||||
$user->permissions = Input::get('permissions');
|
||||
@@ -303,6 +303,7 @@ class UsersController extends AdminController
|
||||
$user->phone = Input::get('phone');
|
||||
$user->location_id = Input::get('location_id');
|
||||
$user->manager_id = Input::get('manager_id');
|
||||
$user->notes = Input::get('notes');
|
||||
|
||||
if ($user->manager_id == "") {
|
||||
$user->manager_id = NULL;
|
||||
@@ -314,7 +315,7 @@ class UsersController extends AdminController
|
||||
|
||||
|
||||
// Do we want to update the user password?
|
||||
if ($password) {
|
||||
if (($password) && (!Config::get('app.lock_passwords'))) {
|
||||
$user->password = $password;
|
||||
}
|
||||
|
||||
@@ -329,19 +330,21 @@ class UsersController extends AdminController
|
||||
$groupsToAdd = array_diff($selectedGroups, $userGroups);
|
||||
$groupsToRemove = array_diff($userGroups, $selectedGroups);
|
||||
|
||||
// Assign the user to groups
|
||||
foreach ($groupsToAdd as $groupId) {
|
||||
$group = Sentry::getGroupProvider()->findById($groupId);
|
||||
if (!Config::get('app.lock_passwords')) {
|
||||
|
||||
$user->addGroup($group);
|
||||
}
|
||||
// Assign the user to groups
|
||||
foreach ($groupsToAdd as $groupId) {
|
||||
$group = Sentry::getGroupProvider()->findById($groupId);
|
||||
$user->addGroup($group);
|
||||
}
|
||||
|
||||
// Remove the user from groups
|
||||
foreach ($groupsToRemove as $groupId) {
|
||||
$group = Sentry::getGroupProvider()->findById($groupId);
|
||||
// Remove the user from groups
|
||||
foreach ($groupsToRemove as $groupId) {
|
||||
$group = Sentry::getGroupProvider()->findById($groupId);
|
||||
|
||||
$user->removeGroup($group);
|
||||
}
|
||||
$user->removeGroup($group);
|
||||
}
|
||||
}
|
||||
|
||||
// Was the user updated?
|
||||
if ($user->save()) {
|
||||
@@ -385,7 +388,7 @@ class UsersController extends AdminController
|
||||
|
||||
|
||||
// Do we have permission to delete this user?
|
||||
if ($user->isSuperUser() and ! Sentry::getUser()->isSuperUser()) {
|
||||
if ((!Sentry::getUser()->isSuperUser()) || (Config::get('app.lock_passwords'))) {
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('users')->with('error', 'Insufficient permissions!');
|
||||
}
|
||||
@@ -458,10 +461,12 @@ class UsersController extends AdminController
|
||||
public function getView($userId = null)
|
||||
{
|
||||
|
||||
$user = Sentry::getUserProvider()->createModel()->withTrashed()->find($userId);
|
||||
$user = User::with('assets','assets.model','consumables','accessories','licenses','userloc')->find($userId);
|
||||
|
||||
$userlog = $user->userlog->load('assetlog','consumablelog','assetlog.model','licenselog','accessorylog','userlog','adminlog');
|
||||
|
||||
if (isset($user->id)) {
|
||||
return View::make('backend/users/view', compact('user'));
|
||||
return View::make('backend/users/view', compact('user','userlog'));
|
||||
} else {
|
||||
// Prepare the error message
|
||||
$error = Lang::get('admin/users/message.user_not_found', compact('id' ));
|
||||
@@ -472,33 +477,6 @@ 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="icon-ok"></i>' : '';
|
||||
return $activated;
|
||||
}
|
||||
)
|
||||
->make();
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsuspend the given user.
|
||||
@@ -602,4 +580,235 @@ class UsersController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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('username', $row[2])->first();
|
||||
if ($user) {
|
||||
$duplicates .= $row[2].', ';
|
||||
} else {
|
||||
|
||||
$newuser = array(
|
||||
'first_name' => $row[0],
|
||||
'last_name' => $row[1],
|
||||
'username' => $row[2],
|
||||
'email' => $row[3],
|
||||
'password' => $pass,
|
||||
'activated' => $activated,
|
||||
'location_id' => $row[4],
|
||||
'permissions' => '{"user":1}',
|
||||
'notes' => 'Imported user'
|
||||
);
|
||||
|
||||
DB::table('users')->insert($newuser);
|
||||
|
||||
$updateuser = Sentry::findUserByLogin($row[2]);
|
||||
|
||||
// Update the user details
|
||||
$updateuser->password = $pass;
|
||||
|
||||
// Update the user
|
||||
$updateuser->save();
|
||||
|
||||
|
||||
if (((Input::get('email_user')==1) && !Config::get('app.lock_passwords'))) {
|
||||
// Send the credentials through email
|
||||
if ($row[3]!='') {
|
||||
$data = array();
|
||||
$data['username'] = $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');
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getDatatable($status = null)
|
||||
{
|
||||
|
||||
$users = User::with('assets','accessories','consumables','licenses','manager','sentryThrottle','groups','userloc');
|
||||
|
||||
switch ($status) {
|
||||
case 'deleted':
|
||||
$users->GetDeleted();
|
||||
break;
|
||||
case '':
|
||||
$users->GetNotDeleted();
|
||||
break;
|
||||
}
|
||||
|
||||
$users = $users->orderBy('created_at', 'DESC')->get();
|
||||
|
||||
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($users)
|
||||
{
|
||||
$action_buttons = '';
|
||||
|
||||
|
||||
if ( ! is_null($users->deleted_at)) {
|
||||
$action_buttons .= '<a href="'.route('restore/user', $users->id).'" class="btn btn-warning btn-sm"><i class="fa fa-share icon-white"></i></a> ';
|
||||
} else {
|
||||
if ($users->accountStatus()=='suspended') {
|
||||
$action_buttons .= '<a href="'.route('unsuspend/user', $users->id).'" class="btn btn-warning btn-sm"><span class="fa fa-time icon-white"></span></a> ';
|
||||
}
|
||||
|
||||
$action_buttons .= '<a href="'.route('update/user', $users->id).'" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> ';
|
||||
|
||||
if ((Sentry::getId() !== $users->id) && (!Config::get('app.lock_passwords'))) {
|
||||
$action_buttons .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/user', $users->id).'" data-content="Are you sure you wish to delete this user?" data-title="Delete '.htmlspecialchars($users->first_name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a> ';
|
||||
} else {
|
||||
$action_buttons .= ' <span class="btn delete-asset btn-danger btn-sm disabled"><i class="fa fa-trash icon-white"></i></span>';
|
||||
}
|
||||
}
|
||||
return $action_buttons;
|
||||
|
||||
});
|
||||
|
||||
|
||||
return Datatable::collection($users)
|
||||
->addColumn('name',function($users)
|
||||
{
|
||||
return '<a title="'.$users->fullName().'" href="users/'.$users->id.'/view">'.$users->fullName().'</a>';
|
||||
})
|
||||
|
||||
->addColumn('email',function($users)
|
||||
{
|
||||
if ($users->email) {
|
||||
return '<div class="text-center"><a title="'.$users->email.'" href="mailto:'.$users->email.'"><i class="fa fa-envelope fa-lg"></i></div>';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
->addColumn('manager',function($users)
|
||||
{
|
||||
if ($users->manager) {
|
||||
return '<a title="'.$users->manager->fullName().'" href="users/'.$users->manager->id.'/view">'.$users->manager->fullName().'</a>';
|
||||
}
|
||||
})
|
||||
|
||||
->addColumn('location',function($users)
|
||||
{
|
||||
if ($users->userloc) {
|
||||
return $users->userloc->name;
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
->addColumn('assets',function($users)
|
||||
{
|
||||
return $users->assets->count();
|
||||
})
|
||||
|
||||
->addColumn('licenses',function($users)
|
||||
{
|
||||
return $users->licenses->count();
|
||||
})
|
||||
|
||||
->addColumn('accessories',function($users)
|
||||
{
|
||||
return $users->accessories->count();
|
||||
})
|
||||
->addColumn('consumables',function($users)
|
||||
{
|
||||
return $users->consumables->count();
|
||||
})
|
||||
|
||||
|
||||
->addColumn('groups',function($users)
|
||||
{
|
||||
$group_names = '';
|
||||
foreach ($users->groups as $group) {
|
||||
$group_names .= '<a href="'.Config::get('app.url').'/admin/groups/'.$group->id.'/edit" class="label label-default">'.$group->name.'</a> ';
|
||||
}
|
||||
return $group_names;
|
||||
})
|
||||
|
||||
|
||||
->addColumn($actions)
|
||||
->searchColumns('name','email','manager','activated','groups','location')
|
||||
->orderColumns('name','email','manager','activated', 'licenses','assets','accessories','consumables','groups','location')
|
||||
->make();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class FixBadAssignedToIds extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
DB::update('update ' . DB::getTablePrefix() . 'assets SET assigned_to=NULL where assigned_to=0');
|
||||
|
||||
Schema::table('status_labels', function ($table) {
|
||||
$table->boolean('deployable')->default(0);
|
||||
$table->boolean('pending')->default(0);
|
||||
$table->boolean('archived')->default(0);
|
||||
$table->text('notes')->nullable();
|
||||
});
|
||||
|
||||
DB::statement('INSERT into ' . DB::getTablePrefix() . 'status_labels (user_id, name, deployable, pending, archived, notes) VALUES (1,"Pending",0,1,0,"These assets are not yet ready to be deployed, usually because of configuration or waiting on parts.")');
|
||||
DB::statement('INSERT into ' . DB::getTablePrefix() . 'status_labels (user_id, name, deployable, pending, archived, notes) VALUES (1,"Ready to Deploy",1,0,0,"These assets are ready to deploy.")');
|
||||
DB::statement('INSERT into ' . DB::getTablePrefix() . 'status_labels (user_id, name, deployable, pending, archived, notes) VALUES (1,"Archived",0,0,1,"These assets are no longer in circulation or viable.")');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::table('status_labels', function ($table) {
|
||||
$table->dropColumn('deployable');
|
||||
$table->dropColumn('pending');
|
||||
$table->dropColumn('archived');
|
||||
$table->dropColumn('notes');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class MigrateDataToNewStatuses extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
// get newly added statuses from last migration
|
||||
$statuses = DB::select('select * from ' . DB::getTablePrefix() . 'status_labels where name="Pending" OR name="Ready to Deploy"');
|
||||
|
||||
|
||||
foreach ($statuses as $status) {
|
||||
if ($status->name =="Pending") {
|
||||
$pending_id = array($status->id);
|
||||
} elseif ($status->name =="Ready to Deploy") {
|
||||
$rtd_id = array($status->id);
|
||||
}
|
||||
}
|
||||
|
||||
// Pending
|
||||
$pendings = DB::select('select * from ' . DB::getTablePrefix() . 'assets where status_id IS NULL AND physical=1 ');
|
||||
|
||||
foreach ($pendings as $pending) {
|
||||
DB::update('update ' . DB::getTablePrefix() . 'assets set status_id = ? where status_id IS NULL AND physical=1',$pending_id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Ready to Deploy
|
||||
$rtds = DB::select('select * from ' . DB::getTablePrefix() . 'assets where status_id = 0 AND physical=1 ');
|
||||
|
||||
foreach ($rtds as $rtd) {
|
||||
//DB::update('update users set votes = 100 where name = ?', array('John'));
|
||||
DB::update('update ' . DB::getTablePrefix() . 'assets set status_id = ? where status_id = 0 AND physical=1',$rtd_id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class MigrateMakeLicenseAssignedNull extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
DB::update('update ' . DB::getTablePrefix() . 'license_seats SET assigned_to=NULL where assigned_to=0');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class MigrateCreateRequestsTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
Schema::create('requests', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->integer('asset_id');
|
||||
$table->integer('user_id');
|
||||
$table->text('request_code');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::drop('requests');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddMacAddressToAsset extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
Schema::table('assets', function ($table) {
|
||||
$table->string('mac_address')->nullable()->default(NULL);
|
||||
});
|
||||
|
||||
Schema::table('models', function ($table) {
|
||||
$table->boolean('show_mac_address')->default(0);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::table('assets', function ($table) {
|
||||
$table->dropColumn('mac_address');
|
||||
});
|
||||
|
||||
Schema::table('models', function ($table) {
|
||||
$table->dropColumn('show_mac_address');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
class ChangeLicenseNotesType extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
$prefix = DB::getTablePrefix();
|
||||
DB::statement('ALTER TABLE '.$prefix.'licenses MODIFY COLUMN notes TEXT');
|
||||
}
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
$prefix = DB::getTablePrefix();
|
||||
DB::statement('ALTER TABLE '.$prefix.'licenses MODIFY COLUMN notes VARCHAR(255)');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddLocalonlyToSettings extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
Schema::table('settings', function ($table) {
|
||||
$table->boolean('load_remote')->default(1);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::table('settings', function ($table) {
|
||||
$table->dropColumn('load_remote');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddLogoAndColorsToSettings extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
Schema::table('settings', function ($table) {
|
||||
$table->string('logo')->nullable()->default(NULL);
|
||||
$table->string('header_color')->nullable()->default(NULL);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::table('settings', function ($table) {
|
||||
$table->dropColumn('logo');
|
||||
$table->dropColumn('header_color');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddAlertsToSettings extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
Schema::table('settings', function ($table) {
|
||||
$table->string('alert_email')->nullable()->default(NULL);
|
||||
$table->boolean('alerts_enabled')->default(1);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::table('settings', function ($table) {
|
||||
$table->dropColumn('alert_email');
|
||||
$table->dropColumn('alerts_enabled');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddEulaFields extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
Schema::table('settings', function ($table) {
|
||||
$table->longText('default_eula_text')->nullable()->default(NULL);
|
||||
});
|
||||
|
||||
Schema::table('categories', function ($table) {
|
||||
$table->longText('eula_text')->nullable()->default(NULL);
|
||||
$table->boolean('use_default_eula')->default(0);
|
||||
$table->boolean('require_acceptance')->default(0);
|
||||
});
|
||||
|
||||
Schema::table('asset_logs', function ($table) {
|
||||
$table->dateTime('requested_at')->nullable()->default(NULL);
|
||||
$table->dateTime('accepted_at')->nullable()->default(NULL);
|
||||
});
|
||||
|
||||
|
||||
Schema::create('requested_assets', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->integer('asset_id')->default(NULL);
|
||||
$table->integer('user_id')->default(NULL);
|
||||
$table->dateTime('accepted_at')->nullable()->default(NULL);
|
||||
$table->dateTime('denied_at')->nullable()->default(NULL);
|
||||
$table->string('notes')->default(NULL);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::table('settings', function ($table) {
|
||||
$table->dropColumn('default_eula_text');
|
||||
});
|
||||
|
||||
Schema::table('categories', function ($table) {
|
||||
$table->dropColumn('eula_text');
|
||||
$table->dropColumn('use_default_eula');
|
||||
$table->dropColumn('require_acceptance');
|
||||
});
|
||||
|
||||
Schema::table('asset_logs', function ($table) {
|
||||
$table->dropColumn('requested_at');
|
||||
$table->dropColumn('accepted_at');
|
||||
});
|
||||
|
||||
Schema::drop('requested_assets');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddAccessoriesTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
Schema::create('accessories', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->string('name')->nullable()->default(NULL);
|
||||
$table->integer('category_id')->nullable()->default(NULL);
|
||||
$table->integer('user_id')->nullable()->default(NULL);
|
||||
$table->integer('qty')->default(0);
|
||||
$table->boolean('requestable')->default(0);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
|
||||
Schema::table('asset_logs', function ($table) {
|
||||
$table->integer('accessory_id')->nullable()->default(NULL);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::drop('accessories');
|
||||
|
||||
Schema::table('asset_logs', function ($table) {
|
||||
$table->dropColumn('accessory_id');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddAccessoriesUserTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
Schema::create('accessories_users', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->integer('user_id')->nullable()->default(NULL);
|
||||
$table->integer('accessory_id')->nullable()->default(NULL);
|
||||
$table->integer('assigned_to')->nullable()->default(NULL);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::table('accessories', function ($table) {
|
||||
$table->integer('location_id')->nullable()->default(NULL);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::drop('accessories_users');
|
||||
|
||||
Schema::table('accessories', function ($table) {
|
||||
$table->dropColumn('location_id');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddDeletedAtModels extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('models', function ($table){
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('models', function ($table){
|
||||
$table->dropColumn('deleted_at');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddCategoryType extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
Schema::table('categories', function ($table) {
|
||||
$table->string('category_type')->nullable()->default('asset');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::table('categories', function ($table) {
|
||||
$table->dropColumn('category_type');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class UpdateAcceptedAtToAcceptanceId extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
|
||||
Schema::table('asset_logs', function ($table) {
|
||||
$table->integer('accepted_id')->nullable()->default(NULL);
|
||||
});
|
||||
|
||||
$results = DB::select('select invitation.id AS invitation_id, acceptance.id AS acceptance_id FROM asset_logs invitation INNER JOIN asset_logs acceptance ON (invitation.checkedout_to=acceptance.checkedout_to AND invitation.asset_id=acceptance.asset_id) WHERE invitation.action_type="checkout" AND acceptance.action_type="accepted"');
|
||||
|
||||
|
||||
foreach ($results as $result) {
|
||||
$update = DB::update('update asset_logs set accepted_id=? where id=?', [$result->acceptance_id, $result->invitation_id]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::table('asset_logs', function ($table) {
|
||||
$table->dropColumn('accepted_id');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddQrTypeToSettings extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
Schema::table('settings', function ($table) {
|
||||
$table->string('barcode_type')->nullable()->default('QRCODE');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::table('settings', function ($table) {
|
||||
$table->dropColumn('barcode_type');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddNoteToUser extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function ($table) {
|
||||
$table->text('notes');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function ($table) {
|
||||
$table->dropColumn('notes');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddSlackToSettings extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('settings', function(Blueprint $table)
|
||||
{
|
||||
$table->string('slack_endpoint')->nullable()->default(NULL);
|
||||
$table->string('slack_channel')->nullable()->default(NULL);
|
||||
$table->string('slack_botname')->nullable()->default(NULL);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('settings', function(Blueprint $table)
|
||||
{
|
||||
//
|
||||
$table->dropColumn('slack_endpoint');
|
||||
$table->dropColumn('slack_channel');
|
||||
$table->dropColumn('slack_botname');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddParentIdToLocationsTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('locations', function(Blueprint $table)
|
||||
{
|
||||
//
|
||||
$table->integer('parent_id')->nullable()->default(NULL);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('locations', function(Blueprint $table)
|
||||
{
|
||||
//
|
||||
$table->dropColumn('parent_id');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddReassignableToLicenses extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('licenses', function(Blueprint $table)
|
||||
{
|
||||
$table->boolean('reassignable')->default(true);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('licenses', function(Blueprint $table)
|
||||
{
|
||||
//
|
||||
$table->dropColumn('reassignable');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class FixDefaultForUserNotes extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'users` MODIFY `notes` varchar(255) DEFAULT NULL;');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'users` MODIFY `notes` varchar(255);');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateConsumables extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
Schema::create('consumables', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->string('name')->nullable()->default(NULL);
|
||||
$table->integer('category_id')->nullable()->default(NULL);
|
||||
$table->integer('location_id')->nullable()->default(NULL);
|
||||
$table->integer('user_id')->nullable()->default(NULL);
|
||||
$table->integer('qty')->default(0);
|
||||
$table->boolean('requestable')->default(0);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
|
||||
Schema::table('asset_logs', function ($table) {
|
||||
$table->integer('consumable_id')->nullable()->default(NULL);
|
||||
});
|
||||
|
||||
Schema::create('consumables_users', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->integer('user_id')->nullable()->default(NULL);
|
||||
$table->integer('consumable_id')->nullable()->default(NULL);
|
||||
$table->integer('assigned_to')->nullable()->default(NULL);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::drop('consumables');
|
||||
|
||||
Schema::table('asset_logs', function ($table) {
|
||||
$table->dropColumn('consumable_id');
|
||||
});
|
||||
|
||||
Schema::drop('consumables_users');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class MoveEmailToUsername extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
DB::update('UPDATE `'.DB::getTablePrefix().'users` SET `username`=`email`');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
//DB::statement('ALTER TABLE `users` MODIFY `notes` varchar(255);');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class MakeEmailNullable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
|
||||
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'users` MODIFY `email` varchar(255) DEFAULT NULL;');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'users` MODIFY `email` varchar(255) NOT NULL;');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddCurrencyToSettingsAndLocations extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
|
||||
Schema::table('settings', function(Blueprint $table)
|
||||
{
|
||||
$table->string('default_currency',10)->nullable()->default(NULL);
|
||||
});
|
||||
|
||||
DB::update('UPDATE `'.DB::getTablePrefix().'settings` SET `default_currency`="'. Lang::get('general.currency').'"');
|
||||
|
||||
Schema::table('locations', function(Blueprint $table)
|
||||
{
|
||||
$table->string('currency',10)->nullable()->default(NULL);
|
||||
});
|
||||
|
||||
DB::update('UPDATE `'.DB::getTablePrefix().'locations` SET `currency`="'. Lang::get('general.currency').'"');
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::table('settings', function(Blueprint $table)
|
||||
{
|
||||
//
|
||||
$table->dropColumn('default_currency');
|
||||
});
|
||||
|
||||
Schema::table('locations', function(Blueprint $table)
|
||||
{
|
||||
//
|
||||
$table->dropColumn('currency');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,12 +10,12 @@ class ActionlogSeeder extends Seeder
|
||||
|
||||
$date = new DateTime;
|
||||
|
||||
// Pending (status_id is null, assigned_to = 0)
|
||||
|
||||
$assetlog[] = array(
|
||||
'user_id' => '1',
|
||||
'action_type' => 'checkout',
|
||||
'asset_id' => '1',
|
||||
'checkedout_to' => '2',
|
||||
'checkedout_to' => '1',
|
||||
'location_id' => '3',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'asset_type' => 'hardware',
|
||||
@@ -23,12 +23,12 @@ class ActionlogSeeder extends Seeder
|
||||
'filename' => NULL,
|
||||
);
|
||||
|
||||
// Pending (status_id is null, assigned_to = 0)
|
||||
|
||||
$assetlog[] = array(
|
||||
'user_id' => '1',
|
||||
'action_type' => 'checkin from',
|
||||
'asset_id' => '1',
|
||||
'checkedout_to' => '2',
|
||||
'checkedout_to' => '1',
|
||||
'location_id' => NULL,
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'asset_type' => 'hardware',
|
||||
@@ -36,7 +36,7 @@ class ActionlogSeeder extends Seeder
|
||||
'filename' => NULL,
|
||||
);
|
||||
|
||||
// Pending (status_id is null, assigned_to = 0)
|
||||
|
||||
$assetlog[] = array(
|
||||
'user_id' => '1',
|
||||
'action_type' => 'checkout',
|
||||
@@ -49,12 +49,12 @@ class ActionlogSeeder extends Seeder
|
||||
'filename' => NULL,
|
||||
);
|
||||
|
||||
// Pending (status_id is null, assigned_to = 0)
|
||||
|
||||
$assetlog[] = array(
|
||||
'user_id' => '1',
|
||||
'action_type' => 'checkin from',
|
||||
'asset_id' => '1',
|
||||
'checkedout_to' => '2',
|
||||
'checkedout_to' => '1',
|
||||
'location_id' => NULL,
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'asset_type' => 'software',
|
||||
|
||||
@@ -10,7 +10,7 @@ class AssetsSeeder extends Seeder
|
||||
|
||||
$date = new DateTime;
|
||||
|
||||
// Pending (status_id is null, assigned_to = 0)
|
||||
|
||||
$asset[] = array(
|
||||
'name' => 'Shanen MBP',
|
||||
'asset_tag' => 'NNY2878796',
|
||||
@@ -22,10 +22,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => NULL,
|
||||
'status_id' => 1,
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -45,10 +45,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => NULL,
|
||||
'status_id' => 1,
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -57,7 +57,7 @@ class AssetsSeeder extends Seeder
|
||||
);
|
||||
|
||||
|
||||
// RTD (status_id =0, assigned_to = 0)
|
||||
|
||||
$asset[] = array(
|
||||
'name' => 'Alison MBP',
|
||||
'asset_tag' => 'NNY287958796',
|
||||
@@ -69,10 +69,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => 0,
|
||||
'status_id' => 2,
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -80,7 +80,7 @@ class AssetsSeeder extends Seeder
|
||||
'depreciate' => '0',
|
||||
);
|
||||
|
||||
// RTD (status_id =0, assigned_to = 0)
|
||||
|
||||
$asset[] = array(
|
||||
'name' => 'Brady MBP',
|
||||
'asset_tag' => 'NNY78795566',
|
||||
@@ -92,10 +92,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => 0,
|
||||
'status_id' => 1,
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -103,7 +103,7 @@ class AssetsSeeder extends Seeder
|
||||
'depreciate' => '0',
|
||||
);
|
||||
|
||||
// RTD (status_id =0, assigned_to = 0)
|
||||
|
||||
$asset[] = array(
|
||||
'name' => 'Deborah MBP',
|
||||
'asset_tag' => 'NNY65756756775',
|
||||
@@ -115,10 +115,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 2,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => 0,
|
||||
'status_id' => 2,
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -127,7 +127,7 @@ class AssetsSeeder extends Seeder
|
||||
);
|
||||
|
||||
|
||||
// Deployed (status_id =0, assigned_to > 0)
|
||||
|
||||
$asset[] = array(
|
||||
'name' => 'Sara MBP',
|
||||
'asset_tag' => 'NNY6897856775',
|
||||
@@ -139,10 +139,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 2,
|
||||
'assigned_to' => 2,
|
||||
'assigned_to' => 1,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => 0,
|
||||
'status_id' => 1,
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -150,7 +150,7 @@ class AssetsSeeder extends Seeder
|
||||
'depreciate' => '0',
|
||||
);
|
||||
|
||||
// Deployed (status_id =0, assigned_to > 0)
|
||||
|
||||
$asset[] = array(
|
||||
'name' => 'Ben MBP',
|
||||
'asset_tag' => 'NNY67567775',
|
||||
@@ -162,10 +162,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 2,
|
||||
'assigned_to' => 2,
|
||||
'assigned_to' => 1,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => 0,
|
||||
'status_id' => 1,
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -173,10 +173,10 @@ class AssetsSeeder extends Seeder
|
||||
'depreciate' => '0',
|
||||
);
|
||||
|
||||
// Undeployable (status_id > 0, assigned_to = 0)
|
||||
|
||||
$asset[] = array(
|
||||
'name' => 'Broke-Ass Laptop',
|
||||
'asset_tag' => 'NNY67567775',
|
||||
'name' => 'Broken Laptop',
|
||||
'asset_tag' => 'NNY6756756775',
|
||||
'model_id' => 2,
|
||||
'serial' => 'WS89080890',
|
||||
'purchase_date' => '2012-01-02',
|
||||
@@ -185,7 +185,7 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 2,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => '3',
|
||||
@@ -196,7 +196,7 @@ class AssetsSeeder extends Seeder
|
||||
'depreciate' => '0',
|
||||
);
|
||||
|
||||
// Undeployable (status_id > 0, assigned_to = 0)
|
||||
|
||||
$asset[] = array(
|
||||
'name' => 'Maybe Broke-Ass Laptop',
|
||||
'asset_tag' => 'NNY6755667775',
|
||||
@@ -208,10 +208,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => '2',
|
||||
'status_id' => '2',
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -219,7 +219,7 @@ class AssetsSeeder extends Seeder
|
||||
'depreciate' => '0',
|
||||
);
|
||||
|
||||
// Undeployable (status_id > 0, assigned_to = 0)
|
||||
|
||||
$asset[] = array(
|
||||
'name' => 'Completely Facacta Laptop',
|
||||
'asset_tag' => 'NNY6564567775',
|
||||
@@ -231,10 +231,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 1,
|
||||
'status_id' => '4',
|
||||
'status_id' => '2',
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -242,10 +242,10 @@ class AssetsSeeder extends Seeder
|
||||
'depreciate' => '0',
|
||||
);
|
||||
|
||||
// Undeployable (status_id > 0, assigned_to = 0)
|
||||
|
||||
$asset[] = array(
|
||||
'name' => 'Drunken Shanenigans Laptop',
|
||||
'asset_tag' => 'NNY6564567775',
|
||||
'name' => 'Borked Laptop',
|
||||
'asset_tag' => 'NNY656456778975',
|
||||
'model_id' => 2,
|
||||
'serial' => 'WS99689080890',
|
||||
'purchase_date' => '2012-01-02',
|
||||
@@ -254,10 +254,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 1,
|
||||
'status_id' => '3',
|
||||
'status_id' => '2',
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -277,10 +277,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 2,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => 0,
|
||||
'status_id' => 1,
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
|
||||
@@ -12,7 +12,10 @@ class CategoriesSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'use_default_eula' => 0,
|
||||
'require_acceptance' => 0,
|
||||
'deleted_at' => NULL,
|
||||
'eula_text' => NULL,
|
||||
);
|
||||
|
||||
$date = new DateTime;
|
||||
@@ -21,7 +24,10 @@ class CategoriesSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'use_default_eula' => 0,
|
||||
'require_acceptance' => 0,
|
||||
'deleted_at' => NULL,
|
||||
'eula_text' => NULL,
|
||||
);
|
||||
|
||||
$date = new DateTime;
|
||||
@@ -30,7 +36,10 @@ class CategoriesSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'use_default_eula' => 0,
|
||||
'require_acceptance' => 0,
|
||||
'deleted_at' => NULL,
|
||||
'eula_text' => NULL,
|
||||
);
|
||||
|
||||
$date = new DateTime;
|
||||
@@ -39,7 +48,10 @@ class CategoriesSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'use_default_eula' => 0,
|
||||
'require_acceptance' => 0,
|
||||
'deleted_at' => NULL,
|
||||
'eula_text' => NULL,
|
||||
);
|
||||
|
||||
$date = new DateTime;
|
||||
@@ -48,7 +60,10 @@ class CategoriesSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'use_default_eula' => 0,
|
||||
'require_acceptance' => 0,
|
||||
'deleted_at' => NULL,
|
||||
'eula_text' => NULL,
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class LicenseSeatsSeeder extends Seeder
|
||||
|
||||
$date = new DateTime;
|
||||
|
||||
// Pending (status_id is null, assigned_to = 0)
|
||||
|
||||
$license_seats[] = array(
|
||||
'license_id' => '1',
|
||||
'assigned_to' => '1',
|
||||
@@ -24,7 +24,7 @@ class LicenseSeatsSeeder extends Seeder
|
||||
|
||||
$license_seats[] = array(
|
||||
'license_id' => '1',
|
||||
'assigned_to' => '2',
|
||||
'assigned_to' => '1',
|
||||
'created_at' => $date->modify('-10 day')->format('Y-m-d H:i:s'),
|
||||
'updated_at' => $date->modify('-3 day')->format('Y-m-d H:i:s'),
|
||||
'deleted_at' => NULL,
|
||||
@@ -35,7 +35,7 @@ class LicenseSeatsSeeder extends Seeder
|
||||
|
||||
$license_seats[] = array(
|
||||
'license_id' => '1',
|
||||
'assigned_to' => '2',
|
||||
'assigned_to' => '1',
|
||||
'created_at' => $date->modify('-10 day')->format('Y-m-d H:i:s'),
|
||||
'updated_at' => $date->modify('-3 day')->format('Y-m-d H:i:s'),
|
||||
'deleted_at' => NULL,
|
||||
@@ -46,7 +46,7 @@ class LicenseSeatsSeeder extends Seeder
|
||||
|
||||
$license_seats[] = array(
|
||||
'license_id' => '1',
|
||||
'assigned_to' => '0',
|
||||
'assigned_to' => NULL,
|
||||
'created_at' => $date->modify('-10 day')->format('Y-m-d H:i:s'),
|
||||
'updated_at' => $date->modify('-3 day')->format('Y-m-d H:i:s'),
|
||||
'deleted_at' => NULL,
|
||||
@@ -57,7 +57,7 @@ class LicenseSeatsSeeder extends Seeder
|
||||
|
||||
$license_seats[] = array(
|
||||
'license_id' => '1',
|
||||
'assigned_to' => '2',
|
||||
'assigned_to' => '1',
|
||||
'created_at' => $date->modify('-10 day')->format('Y-m-d H:i:s'),
|
||||
'updated_at' => $date->modify('-3 day')->format('Y-m-d H:i:s'),
|
||||
'deleted_at' => NULL,
|
||||
@@ -77,10 +77,10 @@ class LicenseSeatsSeeder extends Seeder
|
||||
'asset_id' => NULL,
|
||||
);
|
||||
|
||||
// Pending (status_id is null, assigned_to = 0)
|
||||
|
||||
$license_seats[] = array(
|
||||
'license_id' => '2',
|
||||
'assigned_to' => '0',
|
||||
'assigned_to' => NULL,
|
||||
'created_at' => $date->modify('-10 day')->format('Y-m-d H:i:s'),
|
||||
'updated_at' => $date->modify('-3 day')->format('Y-m-d H:i:s'),
|
||||
'deleted_at' => NULL,
|
||||
|
||||
@@ -10,7 +10,7 @@ class LicensesSeeder extends Seeder
|
||||
|
||||
$date = new DateTime;
|
||||
|
||||
// Pending (status_id is null, assigned_to = 0)
|
||||
|
||||
$license[] = array(
|
||||
'name' => 'Adobe Photoshop CS6',
|
||||
'serial' => 'ZOMG-WtF-BBQ-SRSLY',
|
||||
@@ -31,7 +31,7 @@ class LicensesSeeder extends Seeder
|
||||
'depreciate' => '0',
|
||||
);
|
||||
|
||||
// Pending (status_id is null, assigned_to = 0)
|
||||
|
||||
$license[] = array(
|
||||
'name' => 'Git Tower',
|
||||
'serial' => '98049890394-340485934',
|
||||
|
||||
@@ -10,12 +10,53 @@ class StatuslabelsSeeder extends Seeder
|
||||
|
||||
$date = new DateTime;
|
||||
|
||||
$status[] = array(
|
||||
'name' => 'Ready to Deploy',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'deleted_at' => NULL,
|
||||
'deployable' => 1,
|
||||
'pending' => 0,
|
||||
'archived' => 0,
|
||||
'notes' => ''
|
||||
);
|
||||
|
||||
$status[] = array(
|
||||
'name' => 'Pending',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'deleted_at' => NULL,
|
||||
'deployable' => 0,
|
||||
'pending' => 1,
|
||||
'archived' => 0,
|
||||
'notes' => ''
|
||||
);
|
||||
|
||||
$status[] = array(
|
||||
'name' => 'Archived',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'deleted_at' => NULL,
|
||||
'deployable' => 0,
|
||||
'pending' => 0,
|
||||
'archived' => 1,
|
||||
'notes' => 'These assets are permanently undeployable'
|
||||
);
|
||||
|
||||
|
||||
$status[] = array(
|
||||
'name' => 'Out for Diagnostics',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'deleted_at' => NULL,
|
||||
'deployable' => 0,
|
||||
'pending' => 0,
|
||||
'archived' => 0,
|
||||
'notes' => ''
|
||||
);
|
||||
|
||||
|
||||
@@ -25,6 +66,10 @@ class StatuslabelsSeeder extends Seeder
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'deleted_at' => NULL,
|
||||
'deployable' => 0,
|
||||
'pending' => 0,
|
||||
'archived' => 0,
|
||||
'notes' => ''
|
||||
);
|
||||
|
||||
|
||||
@@ -34,6 +79,10 @@ class StatuslabelsSeeder extends Seeder
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'deleted_at' => NULL,
|
||||
'deployable' => 0,
|
||||
'pending' => 0,
|
||||
'archived' => 1,
|
||||
'notes' => ''
|
||||
);
|
||||
|
||||
$status[] = array(
|
||||
@@ -42,6 +91,10 @@ class StatuslabelsSeeder extends Seeder
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'deleted_at' => NULL,
|
||||
'deployable' => 0,
|
||||
'pending' => 0,
|
||||
'archived' => 1,
|
||||
'notes' => '',
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'about_asset_categories' => 'crwdns634:0crwdne634:0',
|
||||
'about_categories' => 'crwdns635:0crwdne635:0',
|
||||
'asset_categories' => 'crwdns636:0crwdne636:0',
|
||||
'category_name' => 'crwdns637:0crwdne637:0',
|
||||
'create' => 'crwdns638:0crwdne638:0',
|
||||
'update' => 'crwdns639:0crwdne639:0',
|
||||
|
||||
);
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'does_not_exist' => 'crwdns625:0crwdne625:0',
|
||||
'assoc_users' => 'crwdns626:0crwdne626:0',
|
||||
|
||||
'create' => array(
|
||||
'error' => 'crwdns627:0crwdne627:0',
|
||||
'success' => 'crwdns628:0crwdne628:0'
|
||||
),
|
||||
|
||||
'update' => array(
|
||||
'error' => 'crwdns629:0crwdne629:0',
|
||||
'success' => 'crwdns630:0crwdne630:0'
|
||||
),
|
||||
|
||||
'delete' => array(
|
||||
'confirm' => 'crwdns631:0crwdne631:0',
|
||||
'error' => 'crwdns632:0crwdne632:0',
|
||||
'success' => 'crwdns633:0crwdne633:0'
|
||||
)
|
||||
|
||||
);
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'id' => 'crwdns622:0crwdne622:0',
|
||||
'parent' => 'crwdns623:0crwdne623:0',
|
||||
'title' => 'crwdns624:0crwdne624:0',
|
||||
|
||||
);
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'about_asset_depreciations' => 'crwdns819:0crwdne819:0',
|
||||
'about_depreciations' => 'crwdns820:0crwdne820:0',
|
||||
'asset_depreciations' => 'crwdns821:0crwdne821:0',
|
||||
'create_depreciation' => 'crwdns822:0crwdne822:0',
|
||||
'depreciation_name' => 'crwdns823:0crwdne823:0',
|
||||
'number_of_months' => 'crwdns824:0crwdne824:0',
|
||||
'update_depreciation' => 'crwdns825:0crwdne825:0',
|
||||
|
||||
);
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'does_not_exist' => 'crwdns810:0crwdne810:0',
|
||||
'assoc_users' => 'crwdns811:0crwdne811:0',
|
||||
|
||||
|
||||
'create' => array(
|
||||
'error' => 'crwdns812:0crwdne812:0',
|
||||
'success' => 'crwdns813:0crwdne813:0'
|
||||
),
|
||||
|
||||
'update' => array(
|
||||
'error' => 'crwdns814:0crwdne814:0',
|
||||
'success' => 'crwdns815:0crwdne815:0'
|
||||
),
|
||||
|
||||
'delete' => array(
|
||||
'confirm' => 'crwdns816:0crwdne816:0',
|
||||
'error' => 'crwdns817:0crwdne817:0',
|
||||
'success' => 'crwdns818:0crwdne818:0'
|
||||
)
|
||||
|
||||
);
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'id' => 'crwdns806:0crwdne806:0',
|
||||
'months' => 'crwdns807:0crwdne807:0',
|
||||
'term' => 'crwdns808:0crwdne808:0',
|
||||
'title' => 'crwdns809:0crwdne809:0',
|
||||
|
||||
);
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'group_exists' => 'crwdns880:0crwdne880:0',
|
||||
'group_not_found' => 'crwdns881:0crwdne881:0',
|
||||
'group_name_required' => 'crwdns882:0crwdne882:0',
|
||||
|
||||
'success' => array(
|
||||
'create' => 'crwdns883:0crwdne883:0',
|
||||
'update' => 'crwdns884:0crwdne884:0',
|
||||
'delete' => 'crwdns885:0crwdne885:0',
|
||||
),
|
||||
|
||||
'delete' => array(
|
||||
'confirm' => 'crwdns886:0crwdne886:0',
|
||||
'create' => 'crwdns887:0crwdne887:0',
|
||||
'update' => 'crwdns888:0crwdne888:0',
|
||||
'delete' => 'crwdns889:0crwdne889:0',
|
||||
),
|
||||
|
||||
);
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'id' => 'crwdns877:0crwdne877:0',
|
||||
'name' => 'crwdns878:0crwdne878:0',
|
||||
'users' => 'crwdns879:0crwdne879:0',
|
||||
|
||||
);
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'group_management' => 'crwdns870:0crwdne870:0',
|
||||
'create_group' => 'crwdns871:0crwdne871:0',
|
||||
'edit_group' => 'crwdns872:0crwdne872:0',
|
||||
'group_name' => 'crwdns873:0crwdne873:0',
|
||||
'group_admin' => 'crwdns874:0crwdne874:0',
|
||||
'allow' => 'crwdns875:0crwdne875:0',
|
||||
'deny' => 'crwdns876:0crwdne876:0',
|
||||
|
||||
);
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'checkedout_to' => 'crwdns695:0crwdne695:0',
|
||||
'checkout_to' => 'crwdns696:0crwdne696:0',
|
||||
'cost' => 'crwdns697:0crwdne697:0',
|
||||
'create' => 'crwdns698:0crwdne698:0',
|
||||
'date' => 'crwdns699:0crwdne699:0',
|
||||
'depreciates_on' => 'crwdns700:0crwdne700:0',
|
||||
'depreciation' => 'crwdns701:0crwdne701:0',
|
||||
'default_location' => 'crwdns702:0crwdne702:0',
|
||||
'eol_date' => 'crwdns703:0crwdne703:0',
|
||||
'eol_rate' => 'crwdns704:0crwdne704:0',
|
||||
'expires' => 'crwdns705:0crwdne705:0',
|
||||
'fully_depreciated' => 'crwdns706:0crwdne706:0',
|
||||
'help_checkout' => 'crwdns707:0crwdne707:0',
|
||||
'manufacturer' => 'crwdns708:0crwdne708:0',
|
||||
'model' => 'crwdns709:0crwdne709:0',
|
||||
'months' => 'crwdns710:0crwdne710:0',
|
||||
'name' => 'crwdns711:0crwdne711:0',
|
||||
'notes' => 'crwdns712:0crwdne712:0',
|
||||
'order' => 'crwdns713:0crwdne713:0',
|
||||
'qr' => 'crwdns714:0crwdne714:0',
|
||||
'requestable' => 'crwdns715:0crwdne715:0',
|
||||
'serial' => 'crwdns716:0crwdne716:0',
|
||||
'status' => 'crwdns717:0crwdne717:0',
|
||||
'supplier' => 'crwdns718:0crwdne718:0',
|
||||
'tag' => 'crwdns719:0crwdne719:0',
|
||||
'update' => 'crwdns720:0crwdne720:0',
|
||||
'warranty' => 'crwdns721:0crwdne721:0',
|
||||
'years' => 'crwdns722:0crwdne722:0',
|
||||
)
|
||||
;
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'asset' => 'crwdns755:0crwdne755:0',
|
||||
'checkin' => 'crwdns756:0crwdne756:0',
|
||||
'checkout' => 'crwdns757:0crwdne757:0',
|
||||
'clone' => 'crwdns758:0crwdne758:0',
|
||||
'edit' => 'crwdns759:0crwdne759:0',
|
||||
'pending' => 'crwdns760:0crwdne760:0',
|
||||
'view' => 'crwdns761:0crwdne761:0',
|
||||
);
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'undeployable' => 'crwdns739:0crwdne739:0',
|
||||
'does_not_exist' => 'crwdns740:0crwdne740:0',
|
||||
'assoc_users' => 'crwdns741:0crwdne741:0',
|
||||
|
||||
'create' => array(
|
||||
'error' => 'crwdns742:0crwdne742:0',
|
||||
'success' => 'crwdns743:0crwdne743:0'
|
||||
),
|
||||
|
||||
'update' => array(
|
||||
'error' => 'crwdns744:0crwdne744:0',
|
||||
'success' => 'crwdns745:0crwdne745:0'
|
||||
),
|
||||
|
||||
'delete' => array(
|
||||
'confirm' => 'crwdns746:0crwdne746:0',
|
||||
'error' => 'crwdns747:0crwdne747:0',
|
||||
'success' => 'crwdns748:0crwdne748:0'
|
||||
),
|
||||
|
||||
'checkout' => array(
|
||||
'error' => 'crwdns749:0crwdne749:0',
|
||||
'success' => 'crwdns750:0crwdne750:0',
|
||||
'user_does_not_exist' => 'crwdns751:0crwdne751:0'
|
||||
),
|
||||
|
||||
'checkin' => array(
|
||||
'error' => 'crwdns752:0crwdne752:0',
|
||||
'success' => 'crwdns753:0crwdne753:0',
|
||||
'user_does_not_exist' => 'crwdns754:0crwdne754:0'
|
||||
)
|
||||
|
||||
);
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'asset_tag' => 'crwdns723:0crwdne723:0',
|
||||
'asset_model' => 'crwdns724:0crwdne724:0',
|
||||
'book_value' => 'crwdns725:0crwdne725:0',
|
||||
'change' => 'crwdns726:0crwdne726:0',
|
||||
'checkout_date' => 'crwdns727:0crwdne727:0',
|
||||
'checkoutto' => 'crwdns728:0crwdne728:0',
|
||||
'diff' => 'crwdns729:0crwdne729:0',
|
||||
'dl_csv' => 'crwdns730:0crwdne730:0',
|
||||
'eol' => 'crwdns731:0crwdne731:0',
|
||||
'id' => 'crwdns732:0crwdne732:0',
|
||||
'location' => 'crwdns733:0crwdne733:0',
|
||||
'purchase_cost' => 'crwdns734:0crwdne734:0',
|
||||
'purchase_date' => 'crwdns735:0crwdne735:0',
|
||||
'serial' => 'crwdns736:0crwdne736:0',
|
||||
'status' => 'crwdns737:0crwdne737:0',
|
||||
'title' => 'crwdns738:0crwdne738:0',
|
||||
|
||||
);
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'asset' => 'crwdns904:0crwdne904:0',
|
||||
'checkin' => 'crwdns905:0crwdne905:0',
|
||||
'checkin' => 'crwdns905:0crwdne905:0',
|
||||
'cost' => 'crwdns907:0crwdne907:0',
|
||||
'cost' => 'crwdns907:0crwdne907:0',
|
||||
'create' => 'crwdns909:0crwdne909:0',
|
||||
'date' => 'crwdns910:0crwdne910:0',
|
||||
'date' => 'crwdns910:0crwdne910:0',
|
||||
'depreciation' => 'crwdns912:0crwdne912:0',
|
||||
'name' => 'crwdns913:0crwdne913:0',
|
||||
'no_depreciation' => 'crwdns914:0crwdne914:0',
|
||||
'notes' => 'crwdns915:0crwdne915:0',
|
||||
'order' => 'crwdns916:0crwdne916:0',
|
||||
'seats' => 'crwdns917:0crwdne917:0',
|
||||
'serial' => 'crwdns918:0crwdne918:0',
|
||||
'to_email' => 'crwdns919:0crwdne919:0',
|
||||
'to_name' => 'crwdns920:0crwdne920:0',
|
||||
'update' => 'crwdns921:0crwdne921:0',
|
||||
'checkout_help' => 'crwdns922:0crwdne922:0'
|
||||
);
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'checkin' => 'crwdns950:0crwdne950:0',
|
||||
'checkout_history' => 'crwdns951:0crwdne951:0',
|
||||
'checkout' => 'crwdns952:0crwdne952:0',
|
||||
'edit' => 'crwdns953:0crwdne953:0',
|
||||
'clone' => 'crwdns954:0crwdne954:0',
|
||||
'history_for' => 'crwdns955:0crwdne955:0',
|
||||
'in_out' => 'crwdns956:0crwdne956:0',
|
||||
'info' => 'crwdns957:0crwdne957:0',
|
||||
'license_seats' => 'crwdns958:0crwdne958:0',
|
||||
'seat' => 'crwdns959:0crwdne959:0',
|
||||
'seats' => 'crwdns960:0crwdne960:0',
|
||||
'software_licenses' => 'crwdns961:0crwdne961:0',
|
||||
'user' => 'crwdns962:0crwdne962:0',
|
||||
'view' => 'crwdns963:0crwdne963:0',
|
||||
);
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'does_not_exist' => 'crwdns934:0crwdne934:0',
|
||||
'user_does_not_exist' => 'crwdns935:0crwdne935:0',
|
||||
'asset_does_not_exist' => 'crwdns936:0crwdne936:0',
|
||||
'owner_doesnt_match_asset' => 'crwdns937:0crwdne937:0',
|
||||
'assoc_users' => 'crwdns938:0crwdne938:0',
|
||||
|
||||
|
||||
'create' => array(
|
||||
'error' => 'crwdns939:0crwdne939:0',
|
||||
'success' => 'crwdns940:0crwdne940:0'
|
||||
),
|
||||
|
||||
'update' => array(
|
||||
'error' => 'crwdns941:0crwdne941:0',
|
||||
'success' => 'crwdns942:0crwdne942:0'
|
||||
),
|
||||
|
||||
'delete' => array(
|
||||
'confirm' => 'crwdns943:0crwdne943:0',
|
||||
'error' => 'crwdns944:0crwdne944:0',
|
||||
'success' => 'crwdns945:0crwdne945:0'
|
||||
),
|
||||
|
||||
'checkout' => array(
|
||||
'error' => 'crwdns946:0crwdne946:0',
|
||||
'success' => 'crwdns947:0crwdne947:0'
|
||||
),
|
||||
|
||||
'checkin' => array(
|
||||
'error' => 'crwdns948:0crwdne948:0',
|
||||
'success' => 'crwdns949:0crwdne949:0'
|
||||
),
|
||||
|
||||
);
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'assigned_to' => 'crwdns923:0crwdne923:0',
|
||||
'checkout' => 'crwdns924:0crwdne924:0',
|
||||
'id' => 'crwdns925:0crwdne925:0',
|
||||
'license_email' => 'crwdns926:0crwdne926:0',
|
||||
'license_name' => 'crwdns927:0crwdne927:0',
|
||||
'purchase_date' => 'crwdns928:0crwdne928:0',
|
||||
'purchased' => 'crwdns929:0crwdne929:0',
|
||||
'seats' => 'crwdns930:0crwdne930:0',
|
||||
'hardware' => 'crwdns931:0crwdne931:0',
|
||||
'serial' => 'crwdns932:0crwdne932:0',
|
||||
'title' => 'crwdns933:0crwdne933:0',
|
||||
|
||||
);
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'does_not_exist' => 'crwdns650:0crwdne650:0',
|
||||
'assoc_users' => 'crwdns651:0crwdne651:0',
|
||||
|
||||
|
||||
'create' => array(
|
||||
'error' => 'crwdns652:0crwdne652:0',
|
||||
'success' => 'crwdns653:0crwdne653:0'
|
||||
),
|
||||
|
||||
'update' => array(
|
||||
'error' => 'crwdns654:0crwdne654:0',
|
||||
'success' => 'crwdns655:0crwdne655:0'
|
||||
),
|
||||
|
||||
'delete' => array(
|
||||
'confirm' => 'crwdns656:0crwdne656:0',
|
||||
'error' => 'crwdns657:0crwdne657:0',
|
||||
'success' => 'crwdns658:0crwdne658:0'
|
||||
)
|
||||
|
||||
);
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'id' => 'crwdns640:0crwdne640:0',
|
||||
'city' => 'crwdns641:0crwdne641:0',
|
||||
'state' => 'crwdns642:0crwdne642:0',
|
||||
'country' => 'crwdns643:0crwdne643:0',
|
||||
'create' => 'crwdns644:0crwdne644:0',
|
||||
'update' => 'crwdns645:0crwdne645:0',
|
||||
'name' => 'crwdns646:0crwdne646:0',
|
||||
'address' => 'crwdns647:0crwdne647:0',
|
||||
'zip' => 'crwdns648:0crwdne648:0',
|
||||
'locations' => 'crwdns649:0crwdne649:0',
|
||||
);
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'does_not_exist' => 'crwdns895:0crwdne895:0',
|
||||
'assoc_users' => 'crwdns896:0crwdne896:0',
|
||||
|
||||
'create' => array(
|
||||
'error' => 'crwdns897:0crwdne897:0',
|
||||
'success' => 'crwdns898:0crwdne898:0'
|
||||
),
|
||||
|
||||
'update' => array(
|
||||
'error' => 'crwdns899:0crwdne899:0',
|
||||
'success' => 'crwdns900:0crwdne900:0'
|
||||
),
|
||||
|
||||
'delete' => array(
|
||||
'confirm' => 'crwdns901:0crwdne901:0',
|
||||
'error' => 'crwdns902:0crwdne902:0',
|
||||
'success' => 'crwdns903:0crwdne903:0'
|
||||
)
|
||||
|
||||
);
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'asset_manufacturers' => 'crwdns890:0crwdne890:0',
|
||||
'create' => 'crwdns891:0crwdne891:0',
|
||||
'id' => 'crwdns892:0crwdne892:0',
|
||||
'name' => 'crwdns893:0crwdne893:0',
|
||||
'update' => 'crwdns894:0crwdne894:0',
|
||||
|
||||
);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user