Compare commits
253 Commits
settings-l
...
#18172-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc0c95acb0 | ||
|
|
5d0807110e | ||
|
|
33e72f6183 | ||
|
|
3aa046bfa7 | ||
|
|
9454ff677b | ||
|
|
a5c7b8f609 | ||
|
|
9365d1adc6 | ||
|
|
ddd2a96ac5 | ||
|
|
bf8ff51234 | ||
|
|
7891f52bd4 | ||
|
|
baa4a8a461 | ||
|
|
34daffcdf4 | ||
|
|
21baea27a8 | ||
|
|
e1d3714445 | ||
|
|
8b7e0a0d78 | ||
|
|
a1cc427c9c | ||
|
|
5dc675040d | ||
|
|
1258eb6533 | ||
|
|
83abfc9ca6 | ||
|
|
b42d6677cc | ||
|
|
e8c644a600 | ||
|
|
9f6a73b290 | ||
|
|
4d38bd1c62 | ||
|
|
138262114d | ||
|
|
4073c9e638 | ||
|
|
f1b4877a98 | ||
|
|
c39c92d0d7 | ||
|
|
90fc48d959 | ||
|
|
7f10a53105 | ||
|
|
7ae1b7a765 | ||
|
|
22a43a0463 | ||
|
|
dea399398a | ||
|
|
7434dd9458 | ||
|
|
88e532dbc4 | ||
|
|
c5ad451c39 | ||
|
|
44bfceeb0f | ||
|
|
37eb63837b | ||
|
|
4ada47e3b0 | ||
|
|
e5c55c9ab3 | ||
|
|
547b3df7b4 | ||
|
|
4100f2600c | ||
|
|
a9574e8fd6 | ||
|
|
c6269d6bbc | ||
|
|
c1204a5301 | ||
|
|
cc5ac65909 | ||
|
|
9ddc48e3d7 | ||
|
|
4a39d7c67a | ||
|
|
b7a6706591 | ||
|
|
ddb031f091 | ||
|
|
e906d25776 | ||
|
|
27d7449459 | ||
|
|
5d8905c997 | ||
|
|
517f4ce121 | ||
|
|
6809bbd3d5 | ||
|
|
ab555d05e1 | ||
|
|
f7bc538fdf | ||
|
|
2de66ad5db | ||
|
|
30e16b6213 | ||
|
|
92b50ca7ae | ||
|
|
9ee36df979 | ||
|
|
46d1c14e1a | ||
|
|
61895011fb | ||
|
|
32d43034bd | ||
|
|
dfc6cdc127 | ||
|
|
16e93f9e18 | ||
|
|
7395b1a4eb | ||
|
|
fa98557225 | ||
|
|
894606b62e | ||
|
|
f0a6a0026a | ||
|
|
070e0c93be | ||
|
|
2b27b733e5 | ||
|
|
0355c2b642 | ||
|
|
3bad19fb56 | ||
|
|
0f84d51a48 | ||
|
|
2e8572d9c5 | ||
|
|
df53d5d966 | ||
|
|
23838959ca | ||
|
|
6dbb836a01 | ||
|
|
3426afe5a8 | ||
|
|
4bbf923eb6 | ||
|
|
e2c3480194 | ||
|
|
73159076f6 | ||
|
|
90d040573d | ||
|
|
155481a442 | ||
|
|
2f31bfc5fe | ||
|
|
8d0c88dc74 | ||
|
|
07256fd833 | ||
|
|
776cd43a58 | ||
|
|
acb5309aab | ||
|
|
c68f81db3c | ||
|
|
ac8e341b37 | ||
|
|
36122b3966 | ||
|
|
79bcf472f0 | ||
|
|
55d86da846 | ||
|
|
e4f8c1ba3f | ||
|
|
c36236b7dc | ||
|
|
63994333d0 | ||
|
|
da4c7d8934 | ||
|
|
186721eca0 | ||
|
|
f53d939c86 | ||
|
|
23e6909708 | ||
|
|
cf421fe1c1 | ||
|
|
4d80e806e4 | ||
|
|
60a7b7f7ff | ||
|
|
90263eab06 | ||
|
|
9d8f251fc4 | ||
|
|
2b4986571c | ||
|
|
890d13bd52 | ||
|
|
e698e71137 | ||
|
|
d064a5530a | ||
|
|
ab4fbf6c19 | ||
|
|
728afa8361 | ||
|
|
b77019c16e | ||
|
|
6703448b80 | ||
|
|
776ba19a1f | ||
|
|
1f499e0d44 | ||
|
|
0a6eb61103 | ||
|
|
32a2eed5ec | ||
|
|
40a70d39d0 | ||
|
|
5697054e98 | ||
|
|
def5969e1c | ||
|
|
78a418630d | ||
|
|
6d76e7b2d4 | ||
|
|
f052c8b44c | ||
|
|
0e6991d56d | ||
|
|
06eab5f8a4 | ||
|
|
4a481e79c4 | ||
|
|
ee4abbcbaa | ||
|
|
dcc82d742f | ||
|
|
19cb2089d7 | ||
|
|
04923b06b0 | ||
|
|
e16755d491 | ||
|
|
742b0769a4 | ||
|
|
df68dca9dc | ||
|
|
4a5bf78d58 | ||
|
|
7947237489 | ||
|
|
1115205164 | ||
|
|
d5d01136c4 | ||
|
|
3d47277614 | ||
|
|
b937bea04f | ||
|
|
fff14632bc | ||
|
|
9bdf1a620f | ||
|
|
60099aa989 | ||
|
|
f3976e5dd8 | ||
|
|
d7d6893304 | ||
|
|
99549ce805 | ||
|
|
7eb15fe04d | ||
|
|
e2019a13ab | ||
|
|
4b7a06761a | ||
|
|
b96e2fb52c | ||
|
|
8f4a1f5801 | ||
|
|
891bec9cdb | ||
|
|
c5252ea583 | ||
|
|
82d553c180 | ||
|
|
71e34355b9 | ||
|
|
2bad8c72e4 | ||
|
|
6134ca01ac | ||
|
|
be8193ebff | ||
|
|
430ee46645 | ||
|
|
76fbbf29e8 | ||
|
|
3108159d95 | ||
|
|
f282a1ead7 | ||
|
|
324bc4957d | ||
|
|
c3b5c4dfae | ||
|
|
4ab5d97e86 | ||
|
|
b4696ef11e | ||
|
|
294ffb72a4 | ||
|
|
8c534d29d3 | ||
|
|
d6cb262f9d | ||
|
|
5211e2ae20 | ||
|
|
90832fd1ad | ||
|
|
889cbc69e1 | ||
|
|
15948370d4 | ||
|
|
63c5177b37 | ||
|
|
4fbfaf6b9f | ||
|
|
9e68497b63 | ||
|
|
0b9e13bf1e | ||
|
|
485d343e0f | ||
|
|
07f0e8a3be | ||
|
|
cc5afb1cd8 | ||
|
|
c69f1c0890 | ||
|
|
a8733bdedf | ||
|
|
4222e4eb51 | ||
|
|
5db4441f5c | ||
|
|
2bcfe97211 | ||
|
|
4e74c97c84 | ||
|
|
71a46c9bd6 | ||
|
|
1a7c7fdebf | ||
|
|
65ff3d414a | ||
|
|
9fa38b70c8 | ||
|
|
470172f53f | ||
|
|
81261d9e36 | ||
|
|
3ab2e20119 | ||
|
|
b773d576ea | ||
|
|
23feb64b5a | ||
|
|
87fe9d9d3d | ||
|
|
b1ef3f51cb | ||
|
|
e1b6488f8e | ||
|
|
a472dede2b | ||
|
|
263cc3f7a1 | ||
|
|
598612d4bf | ||
|
|
a07d83e583 | ||
|
|
d355812433 | ||
|
|
1afc14f5ab | ||
|
|
8947b667ae | ||
|
|
6b41796d44 | ||
|
|
6efe8eb55b | ||
|
|
4c8f8918e8 | ||
|
|
4cb5bb1855 | ||
|
|
eb007e025a | ||
|
|
18aefa9dee | ||
|
|
2ec540bd36 | ||
|
|
1374ec408a | ||
|
|
8f8fed2b79 | ||
|
|
a1e6f01fe9 | ||
|
|
d7496f22e5 | ||
|
|
7de25a1c37 | ||
|
|
78da89340c | ||
|
|
60606115fe | ||
|
|
6e90c8f6e6 | ||
|
|
a3bd58bda6 | ||
|
|
df3e8ec0f3 | ||
|
|
3fc651d659 | ||
|
|
c0a99d6b52 | ||
|
|
cba090f8eb | ||
|
|
3c81257325 | ||
|
|
b082fb6692 | ||
|
|
a384245368 | ||
|
|
ca44ee94a4 | ||
|
|
3ae7a77032 | ||
|
|
881c789a75 | ||
|
|
fea0189479 | ||
|
|
6ca0e19819 | ||
|
|
bf6964ee62 | ||
|
|
9ac2ea2a52 | ||
|
|
0ce20c1edd | ||
|
|
d31d99b40f | ||
|
|
3527c357cc | ||
|
|
2b5254e68f | ||
|
|
6f3323c195 | ||
|
|
5af85bfe7d | ||
|
|
20adad3c6b | ||
|
|
ca8eae4064 | ||
|
|
7077faaf4a | ||
|
|
ab30df10ff | ||
|
|
a6cb75c481 | ||
|
|
51ce570eb3 | ||
|
|
dcbb09bbd7 | ||
|
|
58eac619ea | ||
|
|
1b397cd780 | ||
|
|
120316bae0 | ||
|
|
7571ff007f | ||
|
|
7afd7da2b4 |
@@ -4235,6 +4235,33 @@
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "smarsching",
|
||||
"name": "Sebastian Marsching",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/2880129?v=4",
|
||||
"profile": "http://sebastian.marsching.com/",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "mohammad-ahmadi1",
|
||||
"name": "Mo",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/40658372?v=4",
|
||||
"profile": "https://github.com/mohammad-ahmadi1",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "MarvelousAnything",
|
||||
"name": "Owen V. Hayes",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/20994684?v=4",
|
||||
"profile": "https://github.com/MarvelousAnything",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -190,6 +190,7 @@ APP_ALLOW_INSECURE_HOSTS=false
|
||||
GOOGLE_MAPS_API=
|
||||
LDAP_MEM_LIM=500M
|
||||
LDAP_TIME_LIM=600
|
||||
BACKUP_TIME_LIMIT=600
|
||||
IMPORT_TIME_LIMIT=600
|
||||
IMPORT_MEMORY_LIMIT=500M
|
||||
REPORT_TIME_LIMIT=12000
|
||||
|
||||
2
.github/workflows/tests-mysql.yml
vendored
2
.github/workflows/tests-mysql.yml
vendored
@@ -82,7 +82,7 @@ jobs:
|
||||
|
||||
- name: Upload Laravel logs as artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: laravel-logs-php-${{ matrix.php-version }}-run-${{ github.run_attempt }}
|
||||
path: |
|
||||
|
||||
2
.github/workflows/tests-postgres.yml
vendored
2
.github/workflows/tests-postgres.yml
vendored
@@ -81,7 +81,7 @@ jobs:
|
||||
|
||||
- name: Upload Laravel logs as artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: laravel-logs-php-${{ matrix.php-version }}-run-${{ github.run_attempt }}
|
||||
path: |
|
||||
|
||||
2
.github/workflows/tests-sqlite.yml
vendored
2
.github/workflows/tests-sqlite.yml
vendored
@@ -67,7 +67,7 @@ jobs:
|
||||
|
||||
- name: Upload Laravel logs as artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: laravel-logs-php-${{ matrix.php-version }}-run-${{ github.run_attempt }}
|
||||
path: |
|
||||
|
||||
@@ -68,7 +68,8 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken
|
||||
| [<img src="https://avatars.githubusercontent.com/u/181059?v=4" width="110px;"/><br /><sub>Juan Font</sub>](https://github.com/juanfont)<br />[💻](https://github.com/snipe/snipe-it/commits?author=juanfont "Code") | [<img src="https://avatars.githubusercontent.com/u/13137708?v=4" width="110px;"/><br /><sub>Juho Taipale</sub>](https://github.com/juhotaipale)<br />[💻](https://github.com/snipe/snipe-it/commits?author=juhotaipale "Code") | [<img src="https://avatars.githubusercontent.com/u/1007419?v=4" width="110px;"/><br /><sub>Korvin Szanto</sub>](https://github.com/KorvinSzanto)<br />[💻](https://github.com/snipe/snipe-it/commits?author=KorvinSzanto "Code") | [<img src="https://avatars.githubusercontent.com/u/8513053?v=4" width="110px;"/><br /><sub>Lewis Foster</sub>](https://lewisfoster.foo/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sniff122 "Code") | [<img src="https://avatars.githubusercontent.com/u/33877541?v=4" width="110px;"/><br /><sub>Logan Swartzendruber</sub>](https://github.com/loganswartz)<br />[💻](https://github.com/snipe/snipe-it/commits?author=loganswartz "Code") | [<img src="https://avatars.githubusercontent.com/u/1156208?v=4" width="110px;"/><br /><sub>Lorenzo P.</sub>](https://github.com/lopezio)<br />[💻](https://github.com/snipe/snipe-it/commits?author=lopezio "Code") | [<img src="https://avatars.githubusercontent.com/u/33946590?v=4" width="110px;"/><br /><sub>Lukas Jung</sub>](https://github.com/m4us1ne)<br />[💻](https://github.com/snipe/snipe-it/commits?author=m4us1ne "Code") |
|
||||
| [<img src="https://avatars.githubusercontent.com/u/10965027?v=4" width="110px;"/><br /><sub>Ellie</sub>](https://leafedfox.xyz/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=LeafedFox "Code") | [<img src="https://avatars.githubusercontent.com/u/20960555?v=4" width="110px;"/><br /><sub>GA Stamper</sub>](https://github.com/gastamper)<br />[💻](https://github.com/snipe/snipe-it/commits?author=gastamper "Code") | [<img src="https://avatars.githubusercontent.com/u/206553556?v=4" width="110px;"/><br /><sub>Guillaume Lefranc</sub>](https://github.com/gl-pup)<br />[💻](https://github.com/snipe/snipe-it/commits?author=gl-pup "Code") | [<img src="https://avatars.githubusercontent.com/u/733892?v=4" width="110px;"/><br /><sub>Hajo Möller</sub>](https://github.com/dasjoe)<br />[💻](https://github.com/snipe/snipe-it/commits?author=dasjoe "Code") | [<img src="https://avatars.githubusercontent.com/u/3420063?v=4" width="110px;"/><br /><sub>Istvan Basa</sub>](https://github.com/pottom)<br />[💻](https://github.com/snipe/snipe-it/commits?author=pottom "Code") | [<img src="https://avatars.githubusercontent.com/u/810824?v=4" width="110px;"/><br /><sub>JJ Asghar</sub>](https://jjasghar.github.io/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jjasghar "Code") | [<img src="https://avatars.githubusercontent.com/u/40404495?v=4" width="110px;"/><br /><sub>James E. Msenga</sub>](https://github.com/JemCdo)<br />[💻](https://github.com/snipe/snipe-it/commits?author=JemCdo "Code") |
|
||||
| [<img src="https://avatars.githubusercontent.com/u/6865786?v=4" width="110px;"/><br /><sub>Jan Felix Wiebe</sub>](https://github.com/jfwiebe)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jfwiebe "Code") | [<img src="https://avatars.githubusercontent.com/u/43412008?v=4" width="110px;"/><br /><sub>Jo Drexl</sub>](https://www.nfon.com/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=drexljo "Code") | [<img src="https://avatars.githubusercontent.com/u/4807843?v=4" width="110px;"/><br /><sub>Austin Sasko</sub>](https://github.com/austinsasko)<br />[💻](https://github.com/snipe/snipe-it/commits?author=austinsasko "Code") | [<img src="https://avatars.githubusercontent.com/u/4875039?v=4" width="110px;"/><br /><sub>Jasson</sub>](http://jassoncordones.github.io)<br />[💻](https://github.com/snipe/snipe-it/commits?author=JassonCordones "Code") | [<img src="https://avatars.githubusercontent.com/u/76069640?v=4" width="110px;"/><br /><sub>Okean</sub>](https://github.com/Tinyblargon)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Tinyblargon "Code") | [<img src="https://avatars.githubusercontent.com/u/6515064?v=4" width="110px;"/><br /><sub>Alejandro Medrano</sub>](https://www.lst.tfo.upm.es/alejandro-medrano/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=amedranogil "Code") | [<img src="https://avatars.githubusercontent.com/u/58696401?v=4" width="110px;"/><br /><sub>Lukas Kraic</sub>](https://github.com/lukaskraic)<br />[💻](https://github.com/snipe/snipe-it/commits?author=lukaskraic "Code") |
|
||||
| [<img src="https://avatars.githubusercontent.com/u/1571724?v=4" width="110px;"/><br /><sub>Герхард PICCORO Lenz McKAY </sub>](https://github-readme-stats.vercel.app/api?username=mckaygerhard)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mckaygerhard "Code") | [<img src="https://avatars.githubusercontent.com/u/15015119?v=4" width="110px;"/><br /><sub>Johannes Pollitt</sub>](https://github.com/FlorestanII)<br />[💻](https://github.com/snipe/snipe-it/commits?author=FlorestanII "Code") | [<img src="https://avatars.githubusercontent.com/u/14185442?v=4" width="110px;"/><br /><sub>Michael Strobel</sub>](https://strobelm.de)<br />[💻](https://github.com/snipe/snipe-it/commits?author=strobelm "Code") | [<img src="https://avatars.githubusercontent.com/u/634790?v=4" width="110px;"/><br /><sub>Nicky West</sub>](http://nickwest.me)<br />[💻](https://github.com/snipe/snipe-it/commits?author=nickwest "Code") | [<img src="https://avatars.githubusercontent.com/u/1347327?v=4" width="110px;"/><br /><sub>akaspeh1</sub>](https://github.com/akaspeh1)<br />[💻](https://github.com/snipe/snipe-it/commits?author=akaspeh1 "Code") |
|
||||
| [<img src="https://avatars.githubusercontent.com/u/1571724?v=4" width="110px;"/><br /><sub>Герхард PICCORO Lenz McKAY </sub>](https://github-readme-stats.vercel.app/api?username=mckaygerhard)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mckaygerhard "Code") | [<img src="https://avatars.githubusercontent.com/u/15015119?v=4" width="110px;"/><br /><sub>Johannes Pollitt</sub>](https://github.com/FlorestanII)<br />[💻](https://github.com/snipe/snipe-it/commits?author=FlorestanII "Code") | [<img src="https://avatars.githubusercontent.com/u/14185442?v=4" width="110px;"/><br /><sub>Michael Strobel</sub>](https://strobelm.de)<br />[💻](https://github.com/snipe/snipe-it/commits?author=strobelm "Code") | [<img src="https://avatars.githubusercontent.com/u/634790?v=4" width="110px;"/><br /><sub>Nicky West</sub>](http://nickwest.me)<br />[💻](https://github.com/snipe/snipe-it/commits?author=nickwest "Code") | [<img src="https://avatars.githubusercontent.com/u/1347327?v=4" width="110px;"/><br /><sub>akaspeh1</sub>](https://github.com/akaspeh1)<br />[💻](https://github.com/snipe/snipe-it/commits?author=akaspeh1 "Code") | [<img src="https://avatars.githubusercontent.com/u/2880129?v=4" width="110px;"/><br /><sub>Sebastian Marsching</sub>](http://sebastian.marsching.com/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=smarsching "Code") | [<img src="https://avatars.githubusercontent.com/u/40658372?v=4" width="110px;"/><br /><sub>Mo</sub>](https://github.com/mohammad-ahmadi1)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mohammad-ahmadi1 "Code") |
|
||||
| [<img src="https://avatars.githubusercontent.com/u/20994684?v=4" width="110px;"/><br /><sub>Owen V. Hayes</sub>](https://github.com/MarvelousAnything)<br />[💻](https://github.com/snipe/snipe-it/commits?author=MarvelousAnything "Code") |
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
|
||||
|
||||
@@ -8,8 +8,6 @@ use Symfony\Component\Console\Input\InputOption;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Symfony\Component\Console\Helper\ProgressIndicator;
|
||||
|
||||
ini_set('max_execution_time', env('IMPORT_TIME_LIMIT', 600)); //600 seconds = 10 minutes
|
||||
ini_set('memory_limit', env('IMPORT_MEMORY_LIMIT', '500M'));
|
||||
|
||||
/**
|
||||
* Class ObjectImportCommand
|
||||
@@ -52,6 +50,9 @@ class ObjectImportCommand extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
ini_set('max_execution_time', env('IMPORT_TIME_LIMIT', 600)); //600 seconds = 10 minutes
|
||||
ini_set('memory_limit', env('IMPORT_MEMORY_LIMIT', '500M'));
|
||||
|
||||
$this->progressIndicator = new ProgressIndicator($this->output);
|
||||
|
||||
$filename = $this->argument('filename');
|
||||
|
||||
@@ -3,13 +3,18 @@
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Mail\UnacceptedAssetReminderMail;
|
||||
use App\Models\Accessory;
|
||||
use App\Models\Asset;
|
||||
use App\Models\CheckoutAcceptance;
|
||||
use App\Models\Component;
|
||||
use App\Models\Consumable;
|
||||
use App\Models\LicenseSeat;
|
||||
use App\Models\Setting;
|
||||
use App\Models\User;
|
||||
use App\Notifications\CheckoutAssetNotification;
|
||||
use App\Notifications\CurrentInventory;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
class SendAcceptanceReminder extends Command
|
||||
@@ -26,7 +31,7 @@ class SendAcceptanceReminder extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'This will resend users with unaccepted assets a reminder to accept or decline them.';
|
||||
protected $description = 'This will resend users with unaccepted items a reminder to accept or decline them.';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
@@ -45,19 +50,30 @@ class SendAcceptanceReminder extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$pending = CheckoutAcceptance::pending()->where('checkoutable_type', 'App\Models\Asset')
|
||||
->whereHas('checkoutable', function($query) {
|
||||
$query->where('accepted_at', null)
|
||||
->where('declined_at', null);
|
||||
})
|
||||
->with(['assignedTo', 'checkoutable.assignedTo', 'checkoutable.model', 'checkoutable.adminuser'])
|
||||
->get();
|
||||
$pending = CheckoutAcceptance::query()
|
||||
->with([
|
||||
'checkoutable' => function (MorphTo $morph) {
|
||||
$morph->morphWith([
|
||||
Asset::class => ['model.category', 'assignedTo', 'adminuser', 'company', 'checkouts'],
|
||||
Accessory::class => ['category', 'company', 'checkouts'],
|
||||
LicenseSeat::class => ['user', 'license', 'checkouts'],
|
||||
Component::class => ['assignedTo', 'company', 'checkouts'],
|
||||
Consumable::class => ['company', 'checkouts'],
|
||||
]);
|
||||
},
|
||||
'assignedTo',
|
||||
])
|
||||
->whereHasMorph(
|
||||
'checkoutable',
|
||||
[Asset::class, Accessory::class, LicenseSeat::class, Component::class, Consumable::class],
|
||||
fn ($q) => $q->whereNull('accepted_at')
|
||||
->whereNull('declined_at')
|
||||
)
|
||||
->pending()
|
||||
->get();
|
||||
|
||||
$count = 0;
|
||||
$unacceptedAssetGroups = $pending
|
||||
->filter(function($acceptance) {
|
||||
return $acceptance->checkoutable_type == 'App\Models\Asset';
|
||||
})
|
||||
->map(function($acceptance) {
|
||||
return ['assetItem' => $acceptance->checkoutable, 'acceptance' => $acceptance];
|
||||
})
|
||||
|
||||
@@ -52,7 +52,9 @@ class SendInventoryAlerts extends Command
|
||||
return new AlertRecipient($item);
|
||||
});
|
||||
|
||||
\Notification::send($recipients, new InventoryAlert($items, $settings->alert_threshold));
|
||||
Notification::send($recipients, new InventoryAlert($items, $settings->alert_threshold));
|
||||
} else {
|
||||
$this->info('No low inventory items found. No mail sent.');
|
||||
}
|
||||
} else {
|
||||
if ($settings->alert_email == '') {
|
||||
|
||||
@@ -16,7 +16,7 @@ class SendUpcomingAuditReport extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'snipeit:upcoming-audits';
|
||||
protected $signature = 'snipeit:upcoming-audits {--with-output : Display the results in a table in your console in addition to sending the email}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
@@ -47,43 +47,69 @@ class SendUpcomingAuditReport extends Command
|
||||
$today = Carbon::now();
|
||||
$interval_date = $today->copy()->addDays($interval);
|
||||
|
||||
$assets = Asset::whereNull('deleted_at')->dueOrOverdueForAudit($settings)->orderBy('assets.next_audit_date', 'asc')->get();
|
||||
$this->info($assets->count() . ' assets must be audited in on or before ' . $interval_date . ' is deadline');
|
||||
|
||||
|
||||
if ((count($assets) !== 0) && ($assets->count() > 0) && ($settings->alert_email != '')) {
|
||||
// Send a rollup to the admin, if settings dictate
|
||||
$recipients = collect(explode(',', $settings->alert_email))
|
||||
->map(fn($item) => trim($item))
|
||||
->filter(fn($item) => !empty($item))
|
||||
->all();
|
||||
|
||||
|
||||
$this->info('Sending Admin SendUpcomingAuditNotification to: ' . $settings->alert_email);
|
||||
Mail::to($recipients)->send(new SendUpcomingAuditMail($assets, $settings->audit_warning_days));
|
||||
|
||||
$this->table(
|
||||
[
|
||||
trans('general.id'),
|
||||
trans('general.name'),
|
||||
trans('general.last_audit'),
|
||||
trans('general.next_audit_date'),
|
||||
trans('mail.Days'),
|
||||
trans('mail.supplier'),
|
||||
trans('mail.assigned_to'),
|
||||
|
||||
],
|
||||
$assets->map(fn($item) => [
|
||||
trans('general.id') => $item->id,
|
||||
trans('general.name') => $item->display_name,
|
||||
trans('general.last_audit') => $item->last_audit_formatted_date,
|
||||
trans('general.next_audit_date') => $item->next_audit_formatted_date,
|
||||
trans('mail.Days') => round($item->next_audit_diff_in_days),
|
||||
trans('mail.supplier') => $item->supplier ? $item->supplier->name : '',
|
||||
trans('mail.assigned_to') => $item->assignedTo ? $item->assignedTo->display_name : '',
|
||||
])
|
||||
);
|
||||
$assets_query = Asset::whereNull('deleted_at')->dueOrOverdueForAudit($settings)->orderBy('assets.next_audit_date', 'asc')->with('supplier');
|
||||
$asset_count = $assets_query->count();
|
||||
$this->info(number_format($asset_count) . ' assets must be audited on or before ' . $interval_date);
|
||||
if (!$this->option('with-output')) {
|
||||
$this->info('Run this command with the --with-output option to see the full list in the console.');
|
||||
}
|
||||
|
||||
|
||||
if ($asset_count > 0) {
|
||||
|
||||
$assets_for_email = $assets_query->limit(30)->get();
|
||||
|
||||
// Send a rollup to the admin, if settings dictate
|
||||
if ($settings->alert_email != '') {
|
||||
|
||||
$recipients = collect(explode(',', $settings->alert_email))
|
||||
->map(fn($item) => trim($item))
|
||||
->filter(fn($item) => !empty($item))
|
||||
->all();
|
||||
|
||||
Mail::to($recipients)->send(new SendUpcomingAuditMail($assets_for_email, $settings->audit_warning_days, $asset_count));
|
||||
$this->info('Audit notification sent to: ' . $settings->alert_email);
|
||||
|
||||
} else {
|
||||
$this->info('There is no admin alert email set so no email will be sent.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($this->option('with-output')) {
|
||||
|
||||
|
||||
// Get the full list if the user wants output in the console
|
||||
$assets_for_output = $assets_query->limit(null)->get();
|
||||
|
||||
$this->table(
|
||||
[
|
||||
trans('general.id'),
|
||||
trans('general.name'),
|
||||
trans('general.last_audit'),
|
||||
trans('general.next_audit_date'),
|
||||
trans('mail.Days'),
|
||||
trans('mail.supplier'),
|
||||
trans('mail.assigned_to'),
|
||||
|
||||
],
|
||||
$assets_for_output->map(fn($item) => [
|
||||
trans('general.id') => $item->id,
|
||||
trans('general.name') => $item->display_name,
|
||||
trans('general.last_audit') => $item->last_audit_formatted_date,
|
||||
trans('general.next_audit_date') => $item->next_audit_formatted_date,
|
||||
trans('mail.Days') => round($item->next_audit_diff_in_days),
|
||||
trans('mail.supplier') => $item->supplier ? $item->supplier->name : '',
|
||||
trans('mail.assigned_to') => $item->assignedTo ? $item->assignedTo->display_name : '',
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->info('There are no assets due for audit in the next ' . $interval . ' days.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,8 @@ class SystemBackup extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
ini_set('max_execution_time', env('BACKUP_TIME_LIMIT', 600)); //600 seconds = 10 minutes
|
||||
|
||||
if ($this->option('filename')) {
|
||||
$filename = $this->option('filename');
|
||||
|
||||
|
||||
33
app/Enums/ActionType.php
Normal file
33
app/Enums/ActionType.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
enum ActionType: string
|
||||
{
|
||||
// General
|
||||
case Create = 'create';
|
||||
case Update = 'update';
|
||||
case Delete = 'delete';
|
||||
case Restore = 'restore';
|
||||
|
||||
// Assets/Accessories/Components/Licenses/Consumables
|
||||
case Checkout = 'checkout';
|
||||
case CheckinFrom = 'checkin from';
|
||||
case Requested = 'requested';
|
||||
case RequestCanceled = 'request canceled';
|
||||
case Accepted = 'accepted';
|
||||
case Declined = 'declined';
|
||||
case Audit = 'audit';
|
||||
case NoteAdded = 'note added';
|
||||
|
||||
// Users
|
||||
case TwoFactorReset = '2FA reset';
|
||||
case Merged = 'merged';
|
||||
|
||||
// Licenses
|
||||
case DeleteSeats = 'delete seats';
|
||||
case AddSeats = 'add seats';
|
||||
|
||||
// File Uploads
|
||||
case Uploaded = 'uploaded';
|
||||
case UploadDeleted = 'upload deleted';
|
||||
}
|
||||
@@ -40,6 +40,8 @@ class IconHelper
|
||||
return 'fa-solid fa-trash-arrow-up';
|
||||
case 'external-link':
|
||||
return 'fa fa-external-link';
|
||||
case 'link':
|
||||
return 'fa fa-link';
|
||||
case 'email':
|
||||
return 'fa-regular fa-envelope';
|
||||
case 'phone':
|
||||
@@ -195,6 +197,12 @@ class IconHelper
|
||||
case 'note':
|
||||
case 'notes':
|
||||
return 'fas fa-sticky-note';
|
||||
case 'tip':
|
||||
return 'fa-solid fa-lightbulb';
|
||||
case 'highlight':
|
||||
return 'fa-solid fa-highlighter';
|
||||
case 'inherit':
|
||||
return 'fa-solid fa-layer-group';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +182,11 @@ class AccessoriesController extends Controller
|
||||
|
||||
$accessory = $request->handleImages($accessory);
|
||||
|
||||
session()->put(['redirect_option' => $request->get('redirect_option')]);
|
||||
if($request->get('redirect_option') === 'back'){
|
||||
session()->put(['redirect_option' => 'index']);
|
||||
} else {
|
||||
session()->put(['redirect_option' => $request->get('redirect_option')]);
|
||||
}
|
||||
|
||||
if ($accessory->save()) {
|
||||
return Helper::getRedirectOption($request, $accessory->id, 'Accessories')
|
||||
|
||||
@@ -116,8 +116,6 @@ class AcceptanceController extends Controller
|
||||
|
||||
$item = $acceptance->checkoutable_type::find($acceptance->checkoutable_id);
|
||||
|
||||
|
||||
|
||||
// If signatures are required, make sure we have one
|
||||
if (Setting::getSettings()->require_accept_signature == '1') {
|
||||
|
||||
@@ -164,11 +162,9 @@ class AcceptanceController extends Controller
|
||||
'signature' => (($sig_filename && array_key_exists('1', $encoded_image))) ? $encoded_image[1] : null,
|
||||
'logo' => ($encoded_logo) ?? null,
|
||||
'date_settings' => $settings->date_display_format,
|
||||
'admin' => auth()->user()->present()?->fullName,
|
||||
'qty' => $acceptance->qty ?? 1,
|
||||
];
|
||||
|
||||
|
||||
if ($request->input('asset_acceptance') == 'accepted') {
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\Helpers\Helper;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\StoreDepartmentRequest;
|
||||
use App\Http\Transformers\DepartmentsTransformer;
|
||||
use App\Http\Transformers\SelectlistTransformer;
|
||||
use App\Models\Department;
|
||||
@@ -26,18 +27,19 @@ class DepartmentsController extends Controller
|
||||
$allowed_columns = ['id', 'name', 'image', 'users_count', 'notes'];
|
||||
|
||||
$departments = Department::select(
|
||||
'departments.id',
|
||||
'departments.name',
|
||||
'departments.phone',
|
||||
'departments.fax',
|
||||
'departments.location_id',
|
||||
'departments.company_id',
|
||||
'departments.manager_id',
|
||||
'departments.created_at',
|
||||
'departments.updated_at',
|
||||
'departments.image',
|
||||
'departments.notes',
|
||||
)->with('users')->with('location')->with('manager')->with('company')->withCount('users as users_count');
|
||||
[
|
||||
'departments.id',
|
||||
'departments.name',
|
||||
'departments.phone',
|
||||
'departments.fax',
|
||||
'departments.location_id',
|
||||
'departments.company_id',
|
||||
'departments.manager_id',
|
||||
'departments.created_at',
|
||||
'departments.updated_at',
|
||||
'departments.image',
|
||||
'departments.notes'
|
||||
])->with('users')->with('location')->with('manager')->with('company')->withCount('users as users_count');
|
||||
|
||||
if ($request->filled('search')) {
|
||||
$departments = $departments->TextSearch($request->input('search'));
|
||||
@@ -94,18 +96,17 @@ class DepartmentsController extends Controller
|
||||
* @since [v4.0]
|
||||
* @param \App\Http\Requests\ImageUploadRequest $request
|
||||
*/
|
||||
public function store(ImageUploadRequest $request) : JsonResponse
|
||||
public function store(StoreDepartmentRequest $request): JsonResponse
|
||||
{
|
||||
$this->authorize('create', Department::class);
|
||||
$department = new Department;
|
||||
$department->fill($request->all());
|
||||
$department->fill($request->validated());
|
||||
$department = $request->handleImages($department);
|
||||
|
||||
$department->created_by = auth()->id();
|
||||
$department->manager_id = ($request->filled('manager_id') ? $request->input('manager_id') : null);
|
||||
|
||||
if ($department->save()) {
|
||||
return response()->json(Helper::formatStandardApiResponse('success', $department, trans('admin/departments/message.create.success')));
|
||||
return response()->json(Helper::formatStandardApiResponse('success', (new DepartmentsTransformer)->transformDepartment($department), trans('admin/departments/message.create.success')));
|
||||
}
|
||||
return response()->json(Helper::formatStandardApiResponse('error', null, $department->getErrors()));
|
||||
|
||||
@@ -121,7 +122,7 @@ class DepartmentsController extends Controller
|
||||
public function show($id) : array
|
||||
{
|
||||
$this->authorize('view', Department::class);
|
||||
$department = Department::findOrFail($id);
|
||||
$department = Department::withCount('users as users_count')->findOrFail($id);
|
||||
return (new DepartmentsTransformer)->transformDepartment($department);
|
||||
}
|
||||
|
||||
@@ -141,7 +142,7 @@ class DepartmentsController extends Controller
|
||||
$department = $request->handleImages($department);
|
||||
|
||||
if ($department->save()) {
|
||||
return response()->json(Helper::formatStandardApiResponse('success', $department, trans('admin/departments/message.update.success')));
|
||||
return response()->json(Helper::formatStandardApiResponse('success', (new DepartmentsTransformer)->transformDepartment($department), trans('admin/departments/message.update.success')));
|
||||
}
|
||||
|
||||
return response()->json(Helper::formatStandardApiResponse('error', null, $department->getErrors()));
|
||||
|
||||
@@ -24,7 +24,7 @@ class GroupsController extends Controller
|
||||
|
||||
$this->authorize('view', Group::class);
|
||||
|
||||
$groups = Group::select('id', 'name', 'permissions', 'notes', 'created_at', 'updated_at', 'created_by')->with('adminuser')->withCount('users as users_count');
|
||||
$groups = Group::select(['id', 'name', 'permissions', 'notes', 'created_at', 'updated_at', 'created_by'])->with('adminuser')->withCount('users as users_count');
|
||||
|
||||
if ($request->filled('search')) {
|
||||
$groups = $groups->TextSearch($request->input('search'));
|
||||
@@ -50,6 +50,7 @@ class GroupsController extends Controller
|
||||
'id',
|
||||
'name',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'users_count',
|
||||
];
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@ class LicenseSeatsController extends Controller
|
||||
if ($license = License::find($licenseId)) {
|
||||
$this->authorize('view', $license);
|
||||
|
||||
$seats = LicenseSeat::with('license', 'user', 'asset', 'user.department')
|
||||
$seats = LicenseSeat::with('license', 'user', 'asset', 'user.department', 'user.company', 'asset.company')
|
||||
->where('license_seats.license_id', $licenseId);
|
||||
|
||||
if ($request->input('status') == 'available') {
|
||||
$seats->whereNull('license_seats.assigned_to');
|
||||
$seats->whereNull('license_seats.assigned_to')->whereNull('license_seats.asset_id');
|
||||
}
|
||||
|
||||
if ($request->input('status') == 'assigned') {
|
||||
@@ -40,8 +40,10 @@ class LicenseSeatsController extends Controller
|
||||
|
||||
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
|
||||
|
||||
if ($request->input('sort') == 'department') {
|
||||
if ($request->input('sort') == 'assigned_user.department') {
|
||||
$seats->OrderDepartments($order);
|
||||
} elseif ($request->input('sort') == 'assigned_user.company') {
|
||||
$seats->OrderCompany($order);
|
||||
} else {
|
||||
$seats->orderBy('updated_at', $order);
|
||||
}
|
||||
@@ -83,7 +85,7 @@ class LicenseSeatsController extends Controller
|
||||
return response()->json(Helper::formatStandardApiResponse('error', null, 'Seat not found'));
|
||||
}
|
||||
// 2. does the seat belong to the specified license?
|
||||
if (! $license = $licenseSeat->license()->first() || $license->id != intval($licenseId)) {
|
||||
if (! $licenseSeat = $licenseSeat->license()->first() || $licenseSeat->id != intval($licenseId)) {
|
||||
return response()->json(Helper::formatStandardApiResponse('error', null, 'Seat does not belong to the specified license'));
|
||||
}
|
||||
|
||||
|
||||
@@ -240,10 +240,6 @@ class BulkAssetsController extends Controller
|
||||
$custom_fields_to_null[str_replace('null', '', $key)] = $value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (! $request->filled('ids') || count($request->input('ids')) == 0) {
|
||||
return redirect($bulk_back_url)->with('error', trans('admin/hardware/message.update.no_assets_selected'));
|
||||
@@ -274,6 +270,7 @@ class BulkAssetsController extends Controller
|
||||
|| ($request->filled('company_id'))
|
||||
|| ($request->filled('status_id'))
|
||||
|| ($request->filled('model_id'))
|
||||
|| ($request->filled('notes'))
|
||||
|| ($request->filled('next_audit_date'))
|
||||
|| ($request->filled('asset_eol_date'))
|
||||
|| ($request->filled('null_name'))
|
||||
|
||||
@@ -30,6 +30,7 @@ use App\Models\Consumable;
|
||||
use App\Models\License;
|
||||
use App\Models\Location;
|
||||
use App\Models\Maintenance;
|
||||
use App\Models\Supplier;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
@@ -45,12 +46,14 @@ abstract class Controller extends BaseController
|
||||
'accessories' => Accessory::class,
|
||||
'maintenances' => Maintenance::class,
|
||||
'assets' => Asset::class,
|
||||
'audits' => Asset::class,
|
||||
'components' => Component::class,
|
||||
'consumables' => Consumable::class,
|
||||
'hardware' => Asset::class,
|
||||
'licenses' => License::class,
|
||||
'locations' => Location::class,
|
||||
'models' => AssetModel::class,
|
||||
'suppliers' => Supplier::class,
|
||||
'users' => User::class,
|
||||
];
|
||||
|
||||
@@ -58,12 +61,14 @@ abstract class Controller extends BaseController
|
||||
'accessories' => 'private_uploads/accessories/',
|
||||
'maintenances' => 'private_uploads/maintenances/',
|
||||
'assets' => 'private_uploads/assets/',
|
||||
'audits' => 'private_uploads/audits/',
|
||||
'components' => 'private_uploads/components/',
|
||||
'consumables' => 'private_uploads/consumables/',
|
||||
'hardware' => 'private_uploads/assets/',
|
||||
'licenses' => 'private_uploads/licenses/',
|
||||
'locations' => 'private_uploads/locations/',
|
||||
'models' => 'private_uploads/models/',
|
||||
'suppliers' => 'private_uploads/suppliers/',
|
||||
'users' => 'private_uploads/users/',
|
||||
];
|
||||
|
||||
@@ -71,12 +76,14 @@ abstract class Controller extends BaseController
|
||||
'accessories' => 'accessory',
|
||||
'maintenances' => 'maintenance',
|
||||
'assets' => 'asset',
|
||||
'audits' => 'audits',
|
||||
'components' => 'component',
|
||||
'consumables' => 'consumable',
|
||||
'hardware' => 'asset',
|
||||
'licenses' => 'license',
|
||||
'locations' => 'location',
|
||||
'models' => 'model',
|
||||
'suppliers' => 'supplier',
|
||||
'users' => 'user',
|
||||
];
|
||||
|
||||
|
||||
@@ -43,9 +43,12 @@ class GroupsController extends Controller
|
||||
$permissions = config('permissions');
|
||||
$groupPermissions = Helper::selectedPermissionsArray($permissions, $permissions);
|
||||
$selectedPermissions = $request->old('permissions', $groupPermissions);
|
||||
|
||||
$users = \App\Models\User::orderBy('first_name', 'asc')->orderBy('last_name', 'asc')->get();
|
||||
// Show the page
|
||||
return view('groups/edit', compact('permissions', 'selectedPermissions', 'groupPermissions'))->with('group', $group);
|
||||
return view('groups/edit', compact('permissions', 'selectedPermissions', 'groupPermissions'))
|
||||
->with('group', $group)
|
||||
->with('associated_users', [])
|
||||
->with('unselected_users', $users);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,11 +63,23 @@ class GroupsController extends Controller
|
||||
// create a new group instance
|
||||
$group = new Group();
|
||||
$group->name = $request->input('name');
|
||||
|
||||
if ($request->filled('permission')) {
|
||||
$group->permissions = json_encode($request->array('permission'));
|
||||
} else {
|
||||
$group->permissions = null;
|
||||
}
|
||||
|
||||
$group->permissions = json_encode($request->input('permission'));
|
||||
$group->created_by = auth()->id();
|
||||
$group->notes = $request->input('notes');
|
||||
|
||||
if ($group->save()) {
|
||||
|
||||
if ($request->filled('users_to_sync')) {
|
||||
$associated_users = explode(',',$request->input('users_to_sync'));
|
||||
$group->users()->sync($associated_users);
|
||||
}
|
||||
return redirect()->route('groups.index')->with('success', trans('admin/groups/message.success.create'));
|
||||
}
|
||||
|
||||
@@ -88,7 +103,12 @@ class GroupsController extends Controller
|
||||
$groupPermissions = [];
|
||||
}
|
||||
$selected_array = Helper::selectedPermissionsArray($permissions, $groupPermissions);
|
||||
return view('groups.edit', compact('group', 'permissions', 'selected_array', 'groupPermissions'));
|
||||
$associated_users = $group->users()->orderBy('first_name', 'asc')->orderBy('last_name', 'asc')->get();
|
||||
|
||||
// Get the unselected users
|
||||
$unselected_users = \App\Models\User::whereNotIn('id', $associated_users->pluck('id')->toArray())->orderBy('first_name', 'asc')->orderBy('last_name', 'asc')->get();
|
||||
|
||||
return view('groups.edit', compact('group', 'permissions', 'selected_array', 'groupPermissions'))->with('associated_users', $associated_users)->with('unselected_users', $unselected_users);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,11 +122,24 @@ class GroupsController extends Controller
|
||||
public function update(Request $request, Group $group) : RedirectResponse
|
||||
{
|
||||
$group->name = $request->input('name');
|
||||
$group->permissions = json_encode($request->input('permission'));
|
||||
|
||||
if ($request->filled('permission')) {
|
||||
$group->permissions = json_encode($request->array('permission'));
|
||||
} else {
|
||||
$group->permissions = null;
|
||||
}
|
||||
|
||||
$group->notes = $request->input('notes');
|
||||
|
||||
|
||||
if (! config('app.lock_passwords')) {
|
||||
if ($group->save()) {
|
||||
|
||||
if ($request->filled('users_to_sync')) {
|
||||
$associated_users = explode(',',$request->input('users_to_sync'));
|
||||
$group->users()->sync($associated_users);
|
||||
}
|
||||
|
||||
return redirect()->route('groups.index')->with('success', trans('admin/groups/message.success.update'));
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,21 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Helpers\Helper;
|
||||
use App\Mail\CheckoutAccessoryMail;
|
||||
use App\Mail\CheckoutAssetMail;
|
||||
use App\Mail\CheckoutComponentMail;
|
||||
use App\Mail\CheckoutConsumableMail;
|
||||
use App\Mail\CheckoutLicenseMail;
|
||||
use App\Models\Accessory;
|
||||
use App\Models\AccessoryCheckout;
|
||||
use App\Models\Actionlog;
|
||||
use App\Models\Asset;
|
||||
use App\Models\AssetModel;
|
||||
use App\Models\Category;
|
||||
use App\Models\Checkoutable;
|
||||
use App\Models\Component;
|
||||
use App\Models\Consumable;
|
||||
use App\Models\LicenseSeat;
|
||||
use App\Models\Maintenance;
|
||||
use App\Models\CheckoutAcceptance;
|
||||
use App\Models\Company;
|
||||
@@ -18,9 +27,11 @@ use App\Models\License;
|
||||
use App\Models\ReportTemplate;
|
||||
use App\Models\Setting;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use \Illuminate\Contracts\View\View;
|
||||
use League\Csv\Reader;
|
||||
@@ -436,10 +447,8 @@ class ReportsController extends Controller
|
||||
// Open output stream
|
||||
$handle = fopen('php://output', 'w');
|
||||
stream_set_timeout($handle, 2000);
|
||||
|
||||
if ($request->filled('use_bom')) {
|
||||
fprintf($handle, chr(0xEF).chr(0xBB).chr(0xBF));
|
||||
}
|
||||
|
||||
fprintf($handle, chr(0xEF).chr(0xBB).chr(0xBF));
|
||||
|
||||
$header = [];
|
||||
|
||||
@@ -1118,34 +1127,30 @@ class ReportsController extends Controller
|
||||
$this->authorize('reports.view');
|
||||
$showDeleted = $deleted == 'deleted';
|
||||
|
||||
$query = CheckoutAcceptance::pending()
|
||||
->where('checkoutable_type', 'App\Models\Asset')
|
||||
$query = CheckoutAcceptance::Pending()
|
||||
->with([
|
||||
'checkoutable' => function (MorphTo $query) {
|
||||
$query->morphWith([
|
||||
AssetModel::class => ['model'],
|
||||
Company::class => ['company'],
|
||||
Asset::class => ['assignedTo'],
|
||||
])->with('model.category');
|
||||
$query->withTrashed()->morphWith([
|
||||
Asset::class => ['model.category', 'assignedTo', 'company'],
|
||||
Accessory::class => ['category','checkouts', 'company'],
|
||||
LicenseSeat::class => ['user', 'license'],
|
||||
Component::class => ['assignedTo', 'company'],
|
||||
Consumable::class => ['company'],
|
||||
]);
|
||||
},
|
||||
'assignedTo' => function($query){
|
||||
$query->withTrashed();
|
||||
}
|
||||
]);
|
||||
])->orderByDesc('checkout_acceptances.created_at');
|
||||
|
||||
|
||||
if ($showDeleted) {
|
||||
$query->withTrashed();
|
||||
}
|
||||
|
||||
$assetsForReport = $query->get()
|
||||
->map(function ($acceptance) {
|
||||
return [
|
||||
'assetItem' => $acceptance->checkoutable,
|
||||
'acceptance' => $acceptance,
|
||||
];
|
||||
});
|
||||
$itemsForReport = $query->get()->map(fn ($unaccepted) => Checkoutable::fromAcceptance($unaccepted));
|
||||
|
||||
return view('reports/unaccepted_assets', compact('assetsForReport','showDeleted' ));
|
||||
return view('reports/unaccepted_assets', compact('itemsForReport','showDeleted' ));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1157,41 +1162,77 @@ class ReportsController extends Controller
|
||||
public function sentAssetAcceptanceReminder(Request $request) : RedirectResponse
|
||||
{
|
||||
$this->authorize('reports.view');
|
||||
|
||||
if (!$acceptance = CheckoutAcceptance::pending()->find($request->input('acceptance_id'))) {
|
||||
$id = $request->input('acceptance_id');
|
||||
$query = CheckoutAcceptance::query()
|
||||
->with([
|
||||
'checkoutable' => function (MorphTo $query) {
|
||||
$query->withTrashed()->morphWith([
|
||||
Asset::class => ['model.category', 'assignedTo', 'company', 'checkouts'],
|
||||
Accessory::class => ['category', 'company', 'checkouts'],
|
||||
LicenseSeat::class => ['user', 'license', 'checkouts'],
|
||||
Component::class => ['assignedTo', 'company', 'checkouts'],
|
||||
Consumable::class => ['company', 'checkouts'],
|
||||
]);
|
||||
},
|
||||
'assignedTo' => fn ($q) => $q->withTrashed(),
|
||||
])
|
||||
->pending();
|
||||
$acceptance = $query->find($id);
|
||||
if (!$acceptance) {
|
||||
Log::debug('No pending acceptances');
|
||||
// Redirect to the unaccepted assets report page with error
|
||||
// Redirect to the unaccepted items report page with error
|
||||
return redirect()->route('reports/unaccepted_assets')->with('error', trans('general.bad_data'));
|
||||
}
|
||||
$item = $acceptance->checkoutable;
|
||||
$assignee = $acceptance->assignedTo ?? $item->assignedTo ?? null;
|
||||
$email = $assignee?->email;
|
||||
$locale = $assignee?->locale;
|
||||
|
||||
$assetItem = $acceptance->checkoutable;
|
||||
|
||||
Log::debug(print_r($assetItem, true));
|
||||
Log::debug(print_r($acceptance, true));
|
||||
|
||||
if (is_null($acceptance->created_at)){
|
||||
Log::debug('No acceptance created_at');
|
||||
return redirect()->route('reports/unaccepted_assets')->with('error', trans('general.bad_data'));
|
||||
} else {
|
||||
$logItem_res = $assetItem->checkouts()->where('created_at', '=', $acceptance->created_at)->get();
|
||||
|
||||
if($item instanceof LicenseSeat){
|
||||
$logItem_res = $item->license->checkouts()->with('adminuser')->where('created_at', '=', $acceptance->created_at)->get();
|
||||
}
|
||||
else{
|
||||
$logItem_res = $item->checkouts()->with('adminuser')->where('created_at', '=', $acceptance->created_at)->get();
|
||||
}
|
||||
if ($logItem_res->isEmpty()){
|
||||
Log::debug('Acceptance date mismatch');
|
||||
return redirect()->route('reports/unaccepted_assets')->with('error', trans('general.bad_data'));
|
||||
}
|
||||
$logItem = $logItem_res[0];
|
||||
}
|
||||
$email = $assetItem->assignedTo?->email;
|
||||
$locale = $assetItem->assignedTo?->locale;
|
||||
|
||||
if (is_null($email) || $email === '') {
|
||||
return redirect()->route('reports/unaccepted_assets')->with('error', trans('general.no_email'));
|
||||
}
|
||||
|
||||
Mail::to($email)->send((new CheckoutAssetMail($assetItem, $assetItem->assignedTo, $logItem->user, $acceptance, $logItem->note, firstTimeSending: false))->locale($locale));
|
||||
$mailable = $this->getCheckoutMailType($acceptance, $logItem);
|
||||
Mail::to($email)->send($mailable->locale($locale));
|
||||
|
||||
return redirect()->route('reports/unaccepted_assets')->with('success', trans('admin/reports/general.reminder_sent'));
|
||||
}
|
||||
private function getCheckoutMailType(CheckoutAcceptance $acceptance, $logItem) : Mailable
|
||||
{
|
||||
$lookup = [
|
||||
Accessory::class => CheckoutAccessoryMail::class,
|
||||
Asset::class => CheckoutAssetMail::class,
|
||||
LicenseSeat::class => CheckoutLicenseMail::class,
|
||||
Consumable::class => CheckoutConsumableMail::class,
|
||||
Component::class => CheckoutComponentMail::class,
|
||||
];
|
||||
$mailable= $lookup[get_class($acceptance->checkoutable)];
|
||||
|
||||
return new $mailable($acceptance->checkoutable,
|
||||
$acceptance->checkedOutTo ?? $acceptance->assignedTo,
|
||||
$logItem->adminuser,
|
||||
$acceptance,
|
||||
$acceptance->note);
|
||||
|
||||
}
|
||||
/**
|
||||
* sentAssetAcceptanceReminder
|
||||
*
|
||||
@@ -1223,31 +1264,41 @@ class ReportsController extends Controller
|
||||
public function postAssetAcceptanceReport($deleted = false) : Response
|
||||
{
|
||||
$this->authorize('reports.view');
|
||||
$showDeleted = $deleted == 'deleted';
|
||||
$showDeleted = request('deleted') === 'deleted';;
|
||||
|
||||
/**
|
||||
* Get all assets with pending checkout acceptances
|
||||
*/
|
||||
if($showDeleted) {
|
||||
$acceptances = CheckoutAcceptance::pending()->where('checkoutable_type', 'App\Models\Asset')->withTrashed()->with(['assignedTo', 'checkoutable.assignedTo', 'checkoutable.model'])->get();
|
||||
} else {
|
||||
$acceptances = CheckoutAcceptance::pending()->where('checkoutable_type', 'App\Models\Asset')->with(['assignedTo', 'checkoutable.assignedTo', 'checkoutable.model'])->get();
|
||||
}
|
||||
|
||||
$assetsForReport = $acceptances
|
||||
->filter(function($acceptance) {
|
||||
return $acceptance->checkoutable_type == 'App\Models\Asset';
|
||||
})
|
||||
->map(function($acceptance) {
|
||||
return ['assetItem' => $acceptance->checkoutable, 'acceptance' => $acceptance];
|
||||
});
|
||||
$acceptances = CheckoutAcceptance::pending()
|
||||
->with([
|
||||
'checkoutable' => function (MorphTo $acceptance) {
|
||||
$acceptance->withTrashed()->morphWith([
|
||||
Asset::class => ['model.category', 'assignedTo', 'company'],
|
||||
Accessory::class => ['category','checkouts', 'company'],
|
||||
LicenseSeat::class => ['user', 'license'],
|
||||
Component::class => ['assignedTo', 'company'],
|
||||
Consumable::class => ['company'],
|
||||
]);
|
||||
},
|
||||
'assignedTo',
|
||||
])->orderByDesc('checkout_acceptances.created_at');
|
||||
|
||||
if ($showDeleted) {
|
||||
$acceptances->withTrashed();
|
||||
}
|
||||
|
||||
$itemsForReport = $acceptances->get()->map(fn ($unaccepted) => Checkoutable::fromAcceptance($unaccepted));
|
||||
|
||||
$rows = [];
|
||||
|
||||
$header = [
|
||||
trans('general.date'),
|
||||
trans('general.type'),
|
||||
trans('admin/companies/table.title'),
|
||||
trans('general.category'),
|
||||
trans('admin/hardware/form.model'),
|
||||
trans('admin/hardware/form.name'),
|
||||
trans('general.name'),
|
||||
trans('admin/hardware/table.asset_tag'),
|
||||
trans('admin/hardware/table.checkoutto'),
|
||||
];
|
||||
@@ -1255,16 +1306,19 @@ class ReportsController extends Controller
|
||||
$header = array_map('trim', $header);
|
||||
$rows[] = implode(',', $header);
|
||||
|
||||
foreach ($assetsForReport as $item) {
|
||||
foreach ($itemsForReport as $item) {
|
||||
|
||||
if ($item['assetItem'] != null){
|
||||
if ($item != null){
|
||||
|
||||
$row = [ ];
|
||||
$row[] = str_replace(',', '', e($item['assetItem']->model->category->name));
|
||||
$row[] = str_replace(',', '', e($item['assetItem']->model->name));
|
||||
$row[] = str_replace(',', '', e($item['assetItem']->name));
|
||||
$row[] = str_replace(',', '', e($item['assetItem']->asset_tag));
|
||||
$row[] = str_replace(',', '', e(($item['acceptance']->assignedTo) ? $item['acceptance']->assignedTo->display_name : trans('admin/reports/general.deleted_user')));
|
||||
$row[] = str_replace(',', '', $item->acceptance->created_at);
|
||||
$row[] = str_replace(',', '', $item->type);
|
||||
$row[] = str_replace(',', '', $item->plain_text_company);
|
||||
$row[] = str_replace(',', '', $item->plain_text_category);
|
||||
$row[] = str_replace(',', '', $item->plain_text_model);
|
||||
$row[] = str_replace(',', '', $item->plain_text_name);
|
||||
$row[] = str_replace(',', '', $item->asset_tag);
|
||||
$row[] = str_replace(',', '', ($item->acceptance->assignedto) ? $item->acceptance->assignedto->display_name : trans('admin/reports/general.deleted_user'));
|
||||
$rows[] = implode(',', $row);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -772,6 +772,7 @@ class SettingsController extends Controller
|
||||
$setting->label2_asset_logo = $request->input('label2_asset_logo');
|
||||
$setting->label2_1d_type = $request->input('label2_1d_type');
|
||||
$setting->label2_2d_type = $request->input('label2_2d_type');
|
||||
$setting->label2_2d_prefix = $request->input('label2_2d_prefix');
|
||||
$setting->label2_2d_target = $request->input('label2_2d_target');
|
||||
$setting->label2_fields = $request->input('label2_fields');
|
||||
$setting->label2_empty_row_count = $request->input('label2_empty_row_count');
|
||||
|
||||
@@ -308,6 +308,13 @@ class UsersController extends Controller
|
||||
$permissions_array['superuser'] = $orig_superuser;
|
||||
}
|
||||
|
||||
// Unset any of the inherited user permissions (0), since that behavior is the default anyway
|
||||
foreach ($permissions_array as $permission => $value) {
|
||||
if ($value == '0') {
|
||||
unset($permissions_array[$permission]);
|
||||
}
|
||||
|
||||
}
|
||||
$user->permissions = json_encode($permissions_array);
|
||||
|
||||
// Only save groups if the user is a superuser
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Actions\CheckoutRequests\CancelCheckoutRequestAction;
|
||||
use App\Actions\CheckoutRequests\CreateCheckoutRequestAction;
|
||||
use App\Enums\ActionType;
|
||||
use App\Exceptions\AssetNotRequestable;
|
||||
use App\Models\Actionlog;
|
||||
use App\Models\Asset;
|
||||
@@ -201,7 +202,7 @@ class ViewAssetsController extends Controller
|
||||
if (($item_request = $item->isRequestedBy($user)) || $cancel_by_admin) {
|
||||
$item->cancelRequest($requestingUser);
|
||||
$data['item_quantity'] = ($item_request) ? $item_request->qty : 1;
|
||||
$logaction->logaction('request_canceled');
|
||||
$logaction->logaction(ActionType::RequestCanceled);
|
||||
|
||||
if (($settings->alert_email != '') && ($settings->alerts_enabled == '1') && (! config('app.lock_passwords'))) {
|
||||
$settings->notify(new RequestAssetCancelation($data));
|
||||
|
||||
@@ -109,7 +109,7 @@ class SettingsSamlRequest extends FormRequest
|
||||
];
|
||||
|
||||
$pkey = openssl_pkey_new([
|
||||
'private_key_bits' => config('app.saml_key_size'),
|
||||
'private_key_bits' => (int) config('app.saml_key_size'),
|
||||
'private_key_type' => OPENSSL_KEYTYPE_RSA,
|
||||
]);
|
||||
|
||||
|
||||
32
app/Http/Requests/StoreDepartmentRequest.php
Normal file
32
app/Http/Requests/StoreDepartmentRequest.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\Department;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
||||
class StoreDepartmentRequest extends ImageUploadRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return Gate::allows('create', new Department);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$modelRules = (new Department)->getRules();
|
||||
|
||||
return array_merge(
|
||||
$modelRules,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,7 @@ class StoreLabelSettings extends FormRequest
|
||||
'labels_pagewidth' => 'numeric|nullable',
|
||||
'labels_pageheight' => 'numeric|nullable',
|
||||
'qr_text' => 'max:31|nullable',
|
||||
'label2_2d_prefix' => 'nullable|max:191',
|
||||
'label2_template' => [
|
||||
'required',
|
||||
Rule::in($names),
|
||||
|
||||
@@ -32,7 +32,7 @@ class StoreNotificationSettings extends FormRequest
|
||||
],
|
||||
'alert_threshold' => 'numeric|nullable',
|
||||
'alert_interval' => 'numeric|nullable|gt:0',
|
||||
'audit_warning_days' => 'numeric|nullable',
|
||||
'audit_warning_days' => 'numeric|nullable|gte:0',
|
||||
'due_checkin_days' => 'numeric|nullable|gt:0',
|
||||
'audit_interval' => 'numeric|nullable|gt:0',
|
||||
];
|
||||
|
||||
@@ -28,23 +28,31 @@ class UpdateAssetRequest extends ImageUploadRequest
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
$setting = Setting::getSettings();
|
||||
|
||||
$rules = array_merge(
|
||||
parent::rules(),
|
||||
(new Asset)->getRules(),
|
||||
// this is to overwrite rulesets that include required, and rewrite unique_undeleted
|
||||
// This overwrites the rulesets that are set at the model level (via Watson) but are not necessarily required at the request level when doing a PATCH update.
|
||||
// Confusingly, this skips the unique_undeleted validator at the model level (and therefore the UniqueUndeletedTrait), so we have to re-add those
|
||||
// rules here without the requiredness, since those values will already exist if you're updating an existing asset.
|
||||
[
|
||||
'model_id' => ['integer', 'exists:models,id,deleted_at,NULL', 'not_array'],
|
||||
'status_id' => ['integer', 'exists:status_labels,id'],
|
||||
'asset_tag' => [
|
||||
'min:1', 'max:255', 'not_array',
|
||||
Rule::unique('assets', 'asset_tag')->ignore($this->asset)->withoutTrashed()
|
||||
Rule::unique('assets', 'asset_tag')->ignore($this->asset)->withoutTrashed(),
|
||||
],
|
||||
'serial' => [
|
||||
'string', 'max:255', 'not_array',
|
||||
$setting->unique_serial=='1' ? Rule::unique('assets', 'serial')->ignore($this->asset)->withoutTrashed() : 'nullable',
|
||||
],
|
||||
],
|
||||
);
|
||||
|
||||
// if the purchase cost is passed in as a string **and** the digit_separator is ',' (as is common in the EU)
|
||||
// then we tweak the purchase_cost rule to make it a string
|
||||
if (Setting::getSettings()->digit_separator === '1.234,56' && is_string($this->input('purchase_cost'))) {
|
||||
if ($setting->digit_separator === '1.234,56' && is_string($this->input('purchase_cost'))) {
|
||||
$rules['purchase_cost'] = ['nullable', 'string'];
|
||||
}
|
||||
|
||||
|
||||
@@ -149,6 +149,7 @@ class ActionlogsTransformer
|
||||
'filename' => $actionlog->filename,
|
||||
'inlineable' => StorageHelper::allowSafeInline($actionlog->uploads_file_path()),
|
||||
'exists_on_disk' => Storage::exists($actionlog->uploads_file_path()) ? true : false,
|
||||
'mediatype' => StorageHelper::getMediaType($actionlog->uploads_file_path()),
|
||||
] : null,
|
||||
|
||||
'item' => ($actionlog->item) ? [
|
||||
|
||||
@@ -68,7 +68,7 @@ class AssetModelsTransformer
|
||||
'default_fieldset_values' => $default_field_values,
|
||||
'eol' => ($assetmodel->eol > 0) ? $assetmodel->eol.' months' : 'None',
|
||||
'requestable' => ($assetmodel->requestable == '1') ? true : false,
|
||||
'require_serial' => $assetmodel->require_serial,
|
||||
'require_serial' => ($assetmodel->require_serial == '1') ? true : false,
|
||||
'notes' => Helper::parseEscapedMarkedownInline($assetmodel->notes),
|
||||
'created_by' => ($assetmodel->adminuser) ? [
|
||||
'id' => (int) $assetmodel->adminuser->id,
|
||||
|
||||
@@ -43,7 +43,7 @@ class DepartmentsTransformer
|
||||
'id' => (int) $department->location->id,
|
||||
'name' => e($department->location->name),
|
||||
] : null,
|
||||
'users_count' => e($department->users_count),
|
||||
'users_count' => (int) ($department->users_count),
|
||||
'notes' => Helper::parseEscapedMarkedownInline($department->notes),
|
||||
'created_at' => Helper::getFormattedDateObject($department->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($department->updated_at, 'datetime'),
|
||||
|
||||
@@ -36,6 +36,12 @@ class LicenseSeatsTransformer
|
||||
'name' => e($seat->user->department->name),
|
||||
|
||||
] : null,
|
||||
'company'=> ($seat->user->company) ?
|
||||
[
|
||||
'id' => (int) $seat->user->company->id,
|
||||
'name' => e($seat->user->company->name),
|
||||
|
||||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($seat->created_at, 'datetime'),
|
||||
] : null,
|
||||
'assigned_asset' => ($seat->asset) ? [
|
||||
|
||||
@@ -68,7 +68,8 @@ class UsersTransformer
|
||||
] : null,
|
||||
'notes'=> Helper::parseEscapedMarkedownInline($user->notes),
|
||||
'role' => $role,
|
||||
'permissions' => $user->decodePermissions(),
|
||||
'user_permissions' => $user->decodePermissions(),
|
||||
'effective_permissions' => $user->getEffectivePermissions('true'),
|
||||
'activated' => ($user->activated == '1') ? true : false,
|
||||
'autoassign_licenses' => ($user->autoassign_licenses == '1') ? true : false,
|
||||
'ldap_import' => ($user->ldap_import == '1') ? true : false,
|
||||
|
||||
@@ -44,7 +44,7 @@ class AssetImporter extends ItemImporter
|
||||
foreach ($this->customFields as $customField) {
|
||||
$customFieldValue = $this->array_smart_custom_field_fetch($row, $customField);
|
||||
|
||||
if ($customFieldValue) {
|
||||
if (!is_null($customFieldValue)) {
|
||||
if ($customField->field_encrypted == 1) {
|
||||
$this->item['custom_fields'][$customField->db_column_name()] = Crypt::encrypt($customFieldValue);
|
||||
$this->log('Custom Field '.$customField->name.': '.Crypt::encrypt($customFieldValue));
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use Livewire\Attributes\Computed;
|
||||
use Livewire\Component;
|
||||
|
||||
class CategoryEditForm extends Component
|
||||
@@ -12,43 +13,25 @@ class CategoryEditForm extends Component
|
||||
|
||||
public $eulaText;
|
||||
|
||||
public $originalSendCheckInEmailValue;
|
||||
|
||||
public bool $requireAcceptance;
|
||||
|
||||
public bool $sendCheckInEmail;
|
||||
|
||||
public bool $useDefaultEula;
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->originalSendCheckInEmailValue = $this->sendCheckInEmail;
|
||||
|
||||
if ($this->eulaText || $this->useDefaultEula) {
|
||||
$this->sendCheckInEmail = 1;
|
||||
}
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.category-edit-form');
|
||||
}
|
||||
|
||||
public function updated($property, $value)
|
||||
{
|
||||
if (! in_array($property, ['eulaText', 'useDefaultEula'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->sendCheckInEmail = $this->eulaText || $this->useDefaultEula ? 1 : $this->originalSendCheckInEmailValue;
|
||||
}
|
||||
|
||||
public function getShouldDisplayEmailMessageProperty(): bool
|
||||
#[Computed]
|
||||
public function emailWillBeSendDueToEula(): bool
|
||||
{
|
||||
return $this->eulaText || $this->useDefaultEula;
|
||||
}
|
||||
|
||||
public function getEmailMessageProperty(): string
|
||||
#[Computed]
|
||||
public function emailMessage(): string
|
||||
{
|
||||
if ($this->useDefaultEula) {
|
||||
return trans('admin/categories/general.email_will_be_sent_due_to_global_eula');
|
||||
@@ -57,13 +40,9 @@ class CategoryEditForm extends Component
|
||||
return trans('admin/categories/general.email_will_be_sent_due_to_category_eula');
|
||||
}
|
||||
|
||||
public function getEulaTextDisabledProperty()
|
||||
#[Computed]
|
||||
public function eulaTextDisabled()
|
||||
{
|
||||
return (bool)$this->useDefaultEula;
|
||||
}
|
||||
|
||||
public function getSendCheckInEmailDisabledProperty()
|
||||
{
|
||||
return $this->eulaText || $this->useDefaultEula;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ class SlackSettingsForm extends Component
|
||||
]);
|
||||
|
||||
try {
|
||||
$test = $webhook->post($this->webhook_endpoint, ['body' => $payload, ['headers' => ['Content-Type' => 'application/json']]]);
|
||||
$test = $webhook->post($this->webhook_endpoint, ['body' => $payload, 'headers' => ['Content-Type' => 'application/json']]);
|
||||
|
||||
if(($test->getStatusCode() == 302)||($test->getStatusCode() == 301)){
|
||||
return session()->flash('error' , trans('admin/settings/message.webhook.error_redirect', ['endpoint' => $this->webhook_endpoint]));
|
||||
|
||||
@@ -87,7 +87,7 @@ class CheckoutAssetMail extends Mailable
|
||||
$name = $this->target->assignedto?->display_name;
|
||||
}
|
||||
else if($this->target instanceof Location){
|
||||
$name = $this->target->manager->name;
|
||||
$name = $this->target->manager?->name;
|
||||
}
|
||||
|
||||
// Check if the item has custom fields associated with it
|
||||
|
||||
@@ -17,10 +17,11 @@ class SendUpcomingAuditMail extends Mailable
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct($params, $threshold)
|
||||
public function __construct($params, $threshold, $total)
|
||||
{
|
||||
$this->assets = $params;
|
||||
$this->threshold = $threshold;
|
||||
$this->total = $total;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,7 +33,7 @@ class SendUpcomingAuditMail extends Mailable
|
||||
|
||||
return new Envelope(
|
||||
from: $from,
|
||||
subject: trans_choice('mail.upcoming-audits', $this->assets->count(), ['count' => $this->assets->count(), 'threshold' => $this->threshold]),
|
||||
subject: trans_choice('mail.upcoming-audits', $this->total, ['count' => $this->total, 'threshold' => $this->threshold]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -49,6 +50,7 @@ class SendUpcomingAuditMail extends Mailable
|
||||
with: [
|
||||
'assets' => $this->assets,
|
||||
'threshold' => $this->threshold,
|
||||
'total' => $this->total,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ use App\Helpers\Helper;
|
||||
use App\Models\Traits\Acceptable;
|
||||
use App\Models\Traits\CompanyableTrait;
|
||||
use App\Models\Traits\HasUploads;
|
||||
use App\Models\Traits\Loggable;
|
||||
use App\Models\Traits\Searchable;
|
||||
use App\Presenters\Presentable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
@@ -9,6 +9,7 @@ use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Enums\ActionType;
|
||||
|
||||
/**
|
||||
* Model for the Actionlog (the table that keeps a historical log of
|
||||
@@ -335,9 +336,12 @@ class Actionlog extends SnipeModel
|
||||
* @since [v3.0]
|
||||
* @return bool
|
||||
*/
|
||||
public function logaction($actiontype)
|
||||
public function logaction(string|ActionType $actiontype)
|
||||
{
|
||||
$this->action_type = $actiontype;
|
||||
if (is_string($actiontype)) {
|
||||
$actiontype = ActionType::from($actiontype);
|
||||
}
|
||||
$this->action_type = $actiontype->value;
|
||||
$this->remote_ip = request()->ip();
|
||||
$this->user_agent = request()->header('User-Agent');
|
||||
$this->action_source = $this->determineActionSource();
|
||||
@@ -360,7 +364,7 @@ class Actionlog extends SnipeModel
|
||||
{
|
||||
$now = Carbon::now();
|
||||
$last_audit_date = $this->created_at; // this is the action log's created at, not the asset itself
|
||||
$next_audit = $last_audit_date->addMonth($monthInterval); // this actually *modifies* the $last_audit_date
|
||||
$next_audit = $last_audit_date->addMonth((int) $monthInterval); // this actually *modifies* the $last_audit_date
|
||||
$next_audit_days = (int) round($now->diffInDays($next_audit, true));
|
||||
$override_default_next = $next_audit;
|
||||
|
||||
@@ -478,6 +482,10 @@ class Actionlog extends SnipeModel
|
||||
$object = 'models';
|
||||
}
|
||||
|
||||
if ($this->action_type == 'audit') {
|
||||
$object = 'audits';
|
||||
}
|
||||
|
||||
return route('ui.files.show', [
|
||||
'object_type' => $object,
|
||||
'id' => $this->item_id,
|
||||
@@ -514,6 +522,8 @@ class Actionlog extends SnipeModel
|
||||
return 'private_uploads/locations/'.$this->filename;
|
||||
case Maintenance::class:
|
||||
return 'private_uploads/maintenances/'.$this->filename;
|
||||
case Supplier::class:
|
||||
return 'private_uploads/suppliers/'.$this->filename;
|
||||
case User::class:
|
||||
return 'private_uploads/users/'.$this->filename;
|
||||
default:
|
||||
|
||||
@@ -9,6 +9,8 @@ use App\Http\Traits\UniqueUndeletedTrait;
|
||||
use App\Models\Traits\Acceptable;
|
||||
use App\Models\Traits\CompanyableTrait;
|
||||
use App\Models\Traits\HasUploads;
|
||||
use App\Models\Traits\Loggable;
|
||||
use App\Models\Traits\Requestable;
|
||||
use App\Models\Traits\Searchable;
|
||||
use App\Presenters\AssetPresenter;
|
||||
use App\Presenters\Presentable;
|
||||
@@ -280,7 +282,7 @@ class Asset extends Depreciable
|
||||
protected function warrantyExpires(): Attribute
|
||||
{
|
||||
return Attribute:: make(
|
||||
get: fn(mixed $value, array $attributes) => ($attributes['warranty_months'] && $attributes['purchase_date']) ? Carbon::parse($attributes['purchase_date'])->addMonths($attributes['warranty_months']) : null,
|
||||
get: fn(mixed $value, array $attributes) => ($attributes['warranty_months'] && $attributes['purchase_date']) ? Carbon::parse($attributes['purchase_date'])->addMonths((int)$attributes['warranty_months']) : null,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -399,6 +401,12 @@ class Asset extends Depreciable
|
||||
|
||||
}
|
||||
|
||||
protected function expectedCheckinFormattedDate(): Attribute
|
||||
{
|
||||
return Attribute:: make(
|
||||
get: fn(mixed $value, array $attributes) => array_key_exists('expected_checkin', $attributes) ? Helper::getFormattedDateObject($attributes['expected_checkin'], 'date', false) : null,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Establishes the asset -> company relationship
|
||||
@@ -931,25 +939,37 @@ class Asset extends Depreciable
|
||||
*/
|
||||
public static function getExpiringWarrantyOrEol($days = 30)
|
||||
{
|
||||
|
||||
return self::where('archived', '=', '0')
|
||||
$now = now();
|
||||
$end = now()->addDays($days);
|
||||
|
||||
$expired_assets = self::query()
|
||||
->where('archived', '=', '0')
|
||||
->NotArchived()
|
||||
->whereNull('deleted_at')
|
||||
->where(function ($query) use ($days) {
|
||||
// Check for manual asset EOL first
|
||||
$query->where(function ($query) use ($days) {
|
||||
$query->whereNotNull('asset_eol_date')
|
||||
->whereBetween('asset_eol_date', [Carbon::now(), Carbon::now()->addDays($days)]);
|
||||
// Otherwise use the warranty months + purchase date + threshold
|
||||
})->orWhere(function ($query) use ($days) {
|
||||
$query->whereNotNull('purchase_date')
|
||||
->whereNotNull('warranty_months')
|
||||
->whereBetween('purchase_date', [Carbon::now(), Carbon::now()->addMonths('assets.warranty_months')->addDays($days)]);
|
||||
});
|
||||
})
|
||||
->orderBy('asset_eol_date', 'ASC')
|
||||
->orderBy('purchase_date', 'ASC')
|
||||
->whereNotNull('asset_eol_date')
|
||||
->whereBetween('asset_eol_date', [$now, $end])
|
||||
->get();
|
||||
|
||||
$assets_with_warranties = self::query()
|
||||
->where('archived', '=', '0')
|
||||
->NotArchived()
|
||||
->whereNull('deleted_at')
|
||||
->whereNotNull('purchase_date')
|
||||
->whereNotNull('warranty_months')
|
||||
->get();
|
||||
|
||||
$expired_warranties = $assets_with_warranties->filter(function ($asset) use ($now, $end) {
|
||||
$expiration_window = Carbon::parse($asset->purchase_date)->addMonths((int) $asset->warranty_months);
|
||||
|
||||
return $expiration_window->betweenIncluded($now, $end);
|
||||
});
|
||||
return $expired_assets->concat($expired_warranties)
|
||||
->unique('id')
|
||||
->sortBy([
|
||||
['asset_eol_date', 'ASC'],
|
||||
['purchase_date', 'ASC']
|
||||
])
|
||||
->values();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,16 +2,18 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Http\Traits\TwoColumnUniqueUndeletedTrait;
|
||||
use App\Models\Traits\HasUploads;
|
||||
use App\Models\Traits\Loggable;
|
||||
use App\Models\Traits\Requestable;
|
||||
use App\Models\Traits\Searchable;
|
||||
use App\Presenters\AssetModelPresenter;
|
||||
use App\Presenters\Presentable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
use \App\Presenters\AssetModelPresenter;
|
||||
use App\Http\Traits\TwoColumnUniqueUndeletedTrait;
|
||||
|
||||
/**
|
||||
* Model for Asset Models. Asset Models contain higher level
|
||||
|
||||
@@ -190,6 +190,11 @@ class CheckoutAcceptance extends Model
|
||||
}
|
||||
|
||||
$pdf->Ln();
|
||||
|
||||
// Check for CJK in the translation string for date. (This is a good proxy for the rest of the document)
|
||||
Helper::hasRtl(trans('general.date')) ? $pdf->setRTL(true) : $pdf->setRTL(false);
|
||||
Helper::isCjk(trans('general.date')) ? $pdf->SetFont('cid0cs', '', 9) : $pdf->SetFont('dejavusans', '', 8, '', true);
|
||||
|
||||
$pdf->writeHTML(trans('general.date') . ': ' . Helper::getFormattedDateObject(now(), 'datetime', false), true, 0, true, 0, '');
|
||||
|
||||
if ($data['company_name'] != null) {
|
||||
@@ -224,7 +229,6 @@ class CheckoutAcceptance extends Model
|
||||
foreach ($eula_lines as $eula_line) {
|
||||
Helper::hasRtl($eula_line) ? $pdf->setRTL(true) : $pdf->setRTL(false);
|
||||
Helper::isCjk($eula_line) ? $pdf->SetFont('cid0cs', '', 9) : $pdf->SetFont('dejavusans', '', 8, '', true);
|
||||
|
||||
$pdf->writeHTML(Helper::parseEscapedMarkedown($eula_line), true, 0, true, 0, '');
|
||||
}
|
||||
$pdf->Ln();
|
||||
@@ -239,8 +243,11 @@ class CheckoutAcceptance extends Model
|
||||
$pdf->Ln();
|
||||
}
|
||||
|
||||
Helper::hasRtl(trans('general.notes')) ? $pdf->setRTL(true) : $pdf->setRTL(false);
|
||||
Helper::isCjk(trans('general.notes')) ? $pdf->SetFont('cid0cs', '', 9) : $pdf->SetFont('dejavusans', '', 8, '', true);
|
||||
|
||||
if ($data['note'] != null) {
|
||||
Helper::isCjk($data['note']) ? $pdf->SetFont('cid0cs', '', 9) : $pdf->SetFont('dejavusans', '', 8, '', true);
|
||||
Helper::isCjk(trans('general.notes')) ? $pdf->SetFont('cid0cs', '', 9) : $pdf->SetFont('dejavusans', '', 8, '', true);
|
||||
$pdf->writeHTML(trans('general.notes') . ': ' . e($data['note']), true, 0, true, 0, '');
|
||||
$pdf->Ln();
|
||||
}
|
||||
|
||||
79
app/Models/Checkoutable.php
Normal file
79
app/Models/Checkoutable.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class Checkoutable
|
||||
{
|
||||
public function __construct(
|
||||
public int $acceptance_id,
|
||||
public string $company,
|
||||
public string $category,
|
||||
public string $model,
|
||||
public string $asset_tag,
|
||||
public string $name,
|
||||
public string $type,
|
||||
public object $acceptance,
|
||||
public object $assignee,
|
||||
public readonly string $plain_text_category,
|
||||
public readonly string $plain_text_model,
|
||||
public readonly string $plain_text_name,
|
||||
public readonly string $plain_text_company,
|
||||
){}
|
||||
|
||||
public static function fromAcceptance(CheckoutAcceptance $unaccepted): self
|
||||
{
|
||||
$unaccepted_row = $unaccepted->checkoutable;
|
||||
$acceptance = $unaccepted;
|
||||
|
||||
$assignee = $acceptance->assignedTo;
|
||||
$company = $unaccepted_row->company ? optional($unaccepted_row->company)->present()->nameUrl() : '';
|
||||
$category = $model = $name = $tag = '';
|
||||
$type = $acceptance->checkoutable_item_type ?? '';
|
||||
|
||||
|
||||
if($unaccepted_row instanceof Asset){
|
||||
$category = optional($unaccepted_row->model?->category?->present())->nameUrl() ?? '';
|
||||
$model = optional($unaccepted_row->present())->modelUrl() ?? '';
|
||||
$name = optional($unaccepted_row->present())->nameUrl() ?? '';
|
||||
$tag = (string) ($unaccepted_row->asset_tag ?? '');
|
||||
}
|
||||
if($unaccepted_row instanceof Accessory){
|
||||
$category = optional($unaccepted_row->category?->present())->nameUrl() ?? '';
|
||||
$model = $unaccepted_row->model_number ?? '';
|
||||
$name = optional($unaccepted_row->present())->nameUrl() ?? '';
|
||||
}
|
||||
if($unaccepted_row instanceof LicenseSeat){
|
||||
$category = optional($unaccepted_row->license->category?->present())->nameUrl() ?? '';
|
||||
$company = optional($unaccepted_row->license->company?->present())?->nameUrl() ?? '';
|
||||
$model = '';
|
||||
$name = $unaccepted_row->license->present()->nameUrl() ?? '';
|
||||
}
|
||||
if($unaccepted_row instanceof Consumable){
|
||||
$category = optional($unaccepted_row->category?->present())->nameUrl() ?? '';
|
||||
$model = $unaccepted_row->model_number ?? '';
|
||||
$name = $unaccepted_row?->present()?->nameUrl() ?? '';
|
||||
}
|
||||
if($unaccepted_row instanceof Component){
|
||||
$category = optional($unaccepted_row->category?->present())->nameUrl() ?? '';
|
||||
$model = $unaccepted_row->model_number ?? '';
|
||||
$name = $unaccepted_row?->present()?->nameUrl() ?? '';
|
||||
}
|
||||
|
||||
return new self(
|
||||
acceptance_id: $acceptance->id,
|
||||
company: $company,
|
||||
category: $category,
|
||||
model: $model,
|
||||
asset_tag: $tag,
|
||||
name: $name,
|
||||
type: $type,
|
||||
acceptance: $acceptance,
|
||||
assignee: $assignee,
|
||||
//plain text for CSVs
|
||||
plain_text_category: ($unaccepted_row->model?->category?->name ?? $unaccepted_row->license->category?->name ?? $unaccepted_row->category?->name ?? ''),
|
||||
plain_text_model: ($unaccepted_row->model?->name ?? $unaccepted_row->model_number ?? ''),
|
||||
plain_text_name: ($unaccepted_row->name ?? $unaccepted_row->license?->name ?? ''),
|
||||
plain_text_company: ($unaccepted_row->company)->name ?? $unaccepted_row->license->company?->name ?? '',
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ namespace App\Models;
|
||||
use App\Helpers\Helper;
|
||||
use App\Models\Traits\CompanyableTrait;
|
||||
use App\Models\Traits\HasUploads;
|
||||
use App\Models\Traits\Loggable;
|
||||
use App\Models\Traits\Searchable;
|
||||
use App\Presenters\Presentable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
@@ -274,7 +275,19 @@ class Component extends SnipeModel
|
||||
{
|
||||
return $this->category?->checkin_email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of checkouts for this License
|
||||
*
|
||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @since [v2.0]
|
||||
* @return \Illuminate\Database\Eloquent\Relations\Relation
|
||||
*/
|
||||
public function checkouts()
|
||||
{
|
||||
return $this->assetlog()->where('action_type', '=', 'checkout')
|
||||
->orderBy('created_at', 'desc')
|
||||
->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check how many items within a component are remaining
|
||||
|
||||
@@ -6,6 +6,7 @@ use App\Helpers\Helper;
|
||||
use App\Models\Traits\Acceptable;
|
||||
use App\Models\Traits\CompanyableTrait;
|
||||
use App\Models\Traits\HasUploads;
|
||||
use App\Models\Traits\Loggable;
|
||||
use App\Models\Traits\Searchable;
|
||||
use App\Presenters\ConsumablePresenter;
|
||||
use App\Presenters\Presentable;
|
||||
@@ -316,6 +317,20 @@ class Consumable extends SnipeModel
|
||||
|
||||
return $this->purchase_cost !== null ? $this->qty * $this->purchase_cost : null;
|
||||
}
|
||||
/**
|
||||
* Get the list of checkouts for this consumable
|
||||
*
|
||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @since [v2.0]
|
||||
* @return \Illuminate\Database\Eloquent\Relations\Relation
|
||||
*/
|
||||
public function checkouts()
|
||||
{
|
||||
return $this->assetlog()->where('action_type', '=', 'checkout')
|
||||
->orderBy('created_at', 'desc')
|
||||
->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* -----------------------------------------------
|
||||
* BEGIN MUTATORS
|
||||
|
||||
@@ -31,10 +31,13 @@ class Department extends SnipeModel
|
||||
];
|
||||
|
||||
protected $rules = [
|
||||
'name' => 'required|max:255|is_unique_department',
|
||||
'location_id' => 'numeric|nullable',
|
||||
'company_id' => 'numeric|nullable',
|
||||
'manager_id' => 'numeric|nullable',
|
||||
'name' => 'required|max:255|is_unique_across_company_and_location:departments,name',
|
||||
'location_id' => 'numeric|nullable|exists:locations,id',
|
||||
'company_id' => 'numeric|nullable|exists:companies,id',
|
||||
'manager_id' => 'numeric|nullable|exists:users,id',
|
||||
'phone' => 'string|max:255|nullable',
|
||||
'fax' => 'string|max:255|nullable',
|
||||
'notes' => 'string|max:255|nullable',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -93,6 +93,9 @@ class Group extends SnipeModel
|
||||
|
||||
if (!is_integer($permission)) {
|
||||
$permissions[$permission] = (int) $value;
|
||||
if ($permission == 'superuser') {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
\Log::info('Weird data here - skipping it');
|
||||
unset($permissions[$permission]);
|
||||
|
||||
@@ -4,15 +4,15 @@ namespace App\Models\Labels\Tapes\Brother;
|
||||
|
||||
class TZe_24mm_E extends TZe_24mm
|
||||
{
|
||||
private const BARCODE_MARGIN = 1.50;
|
||||
private const BARCODE_MARGIN = 1.75;
|
||||
private const TAG_SIZE = 2.00;
|
||||
private const TITLE_SIZE = 2.80;
|
||||
private const TITLE_MARGIN = 0.50;
|
||||
private const LABEL_SIZE = 2.00;
|
||||
private const LABEL_MARGIN = - 0.35;
|
||||
private const LABEL_MARGIN = - 0.75;
|
||||
private const FIELD_SIZE = 2.80;
|
||||
private const FIELD_MARGIN = 0.15;
|
||||
private const BARCODE1D_SIZE = - 1.00;
|
||||
private const BARCODE1D_SIZE = - 2.25;
|
||||
|
||||
public function getUnit() { return 'mm'; }
|
||||
public function getWidth() { return 45.0; }
|
||||
|
||||
@@ -104,6 +104,78 @@ class Ldap extends Model
|
||||
return $connection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds user via Admin search *first*, and _then_ try to bind as that user, returning the user attributes on success,
|
||||
* or false on failure. This enables login when the DN is harder to programmatically 'guess' due to having users in
|
||||
* various different OU's or other LDAP entities.
|
||||
*/
|
||||
public static function findAndBindMultiOU(string $baseDn, string $filterQuery, string $password, int $slow_failure = 3): array|false
|
||||
{
|
||||
/**
|
||||
* If you *don't* set the slow_failure variable, do note that we might permit timing attacks in here - if
|
||||
* your find results come back 'slow' when a user *does* exist, but fast if they *don't* exist, then you
|
||||
* can use this to enumerate users.
|
||||
*
|
||||
* Even if that's *not* true, we still might have an issue: if we don't find the user, then we don't even _try_
|
||||
* to bind as them. Again, that could permit a timing attack.
|
||||
*
|
||||
* Instead of checking every little thing, we just wrap everything in a try/catch in order to unify the
|
||||
* 'slow_failure' treatment. All failures are re-raised as exceptions so that all failures exit from the
|
||||
* same place.
|
||||
*/
|
||||
$connection = null;
|
||||
$admin_conn = null;
|
||||
try {
|
||||
/**
|
||||
* First we get an 'admin' connection, which will need search permissions. That was already a requirement
|
||||
* here, so that's not a big lift. But it _is_ possible to configure LDAP to only login, and *not* to be
|
||||
* able to import lists of users. In that case, this function *will not work* - and you should use the
|
||||
* legacy 'findAndBindUserLdap' method, below. Otherwise, it looks like this would attempt an anonymous
|
||||
* bind - which you might want, but you probably don't.
|
||||
*
|
||||
**/
|
||||
$admin_conn = self::connectToLdap();
|
||||
self::bindAdminToLdap($admin_conn);
|
||||
$results = ldap_search($admin_conn, $baseDn, $filterQuery);
|
||||
$entry_count = ldap_count_entries($admin_conn, $results);
|
||||
if ($entry_count != 1) {
|
||||
throw new \Exception('Wrong number of entries found: ' . $entry_count);
|
||||
}
|
||||
$entry = ldap_first_entry($admin_conn, $results);
|
||||
$user = ldap_get_attributes($admin_conn, $entry);
|
||||
$userDn = ldap_get_dn($admin_conn, $entry);
|
||||
if (!$userDn) {
|
||||
throw new \Exception("No user DN found");
|
||||
}
|
||||
\Log::debug("FOUND DN IS: $userDn");
|
||||
// The temptation now is to do ldap_unbind on the $admin_conn, but that gets handled in the 'finally' below.
|
||||
// I don't know if that means a separate 'connection' is maintained to the LDAP server or not, and would
|
||||
// definitely prefer to not do that if we can avoid it. But I don't know enough about the LDAP protocol to
|
||||
// be certain that that happens.
|
||||
|
||||
//now we try to log in (bind) as that found user
|
||||
$connection = self::connectToLdap();
|
||||
$bind_results = ldap_bind($connection, $userDn, $password);
|
||||
if (!$bind_results) {
|
||||
throw new \Exception("Unable to bind as user");
|
||||
}
|
||||
return array_change_key_case($user);
|
||||
} catch (\Exception $e) {
|
||||
\Log::debug("Exception on fast find-and-bind: " . $e->getMessage());
|
||||
if ($slow_failure) {
|
||||
sleep($slow_failure);
|
||||
}
|
||||
return false; //TODO - make this null instead for a slightly nicer type signature
|
||||
} finally {
|
||||
if ($admin_conn) {
|
||||
ldap_unbind($admin_conn);
|
||||
}
|
||||
if ($connection) {
|
||||
ldap_unbind($connection);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Binds/authenticates the user to LDAP, and returns their attributes.
|
||||
@@ -147,25 +219,27 @@ class Ldap extends Model
|
||||
|
||||
Log::debug('Filter query: '.$filterQuery);
|
||||
|
||||
// only try this if we have an Admin username set; otherwise use the 'legacy' method
|
||||
if (($settings->ldap_uname) && ($baseDn)) {
|
||||
// in the fallowing call, we pick a slow-failure of 0 because we might need to fall through to 'legacy'
|
||||
$fast_bind = self::findAndBindMultiOU($baseDn, $filterQuery, $password, 0);
|
||||
if ($fast_bind) {
|
||||
\Log::debug("Fast bind worked");
|
||||
return $fast_bind;
|
||||
}
|
||||
\Log::debug("Fast bind failed; falling through to legacy bind");
|
||||
}
|
||||
|
||||
if (! $ldapbind = @ldap_bind($connection, $userDn, $password)) {
|
||||
Log::debug("Status of binding user: $userDn to directory: (directly!) ".($ldapbind ? "success" : "FAILURE"));
|
||||
if (! $ldapbind = self::bindAdminToLdap($connection)) {
|
||||
/*
|
||||
* TODO PLEASE:
|
||||
*
|
||||
* this isn't very clear, so it's important to note: the $ldapbind value is never correctly returned - we never 'return true' from self::bindAdminToLdap() (the function
|
||||
* just "falls off the end" without ever explictly returning 'true')
|
||||
*
|
||||
* but it *does* have an interesting side-effect of checking for the LDAP password being incorrectly encrypted with the wrong APP_KEY, so I'm leaving it in for now.
|
||||
*
|
||||
* If it *did* correctly return 'true' on a succesful bind, it would _probably_ allow users to log in with an incorrect password. Which would be horrible!
|
||||
*
|
||||
* Let's definitely fix this at the next refactor!!!!
|
||||
*
|
||||
*/
|
||||
Log::debug("Status of binding Admin user: $userDn to directory instead: ".($ldapbind ? "success" : "FAILURE"));
|
||||
return false;
|
||||
// replicate the old bad-decryption-key detection behavior here
|
||||
try {
|
||||
Crypt::decrypt(Setting::getSettings()->ldap_pword);
|
||||
} catch (\Exception $e) {
|
||||
throw new \Exception('Your app key has changed! Could not decrypt LDAP password using your current app key, so LDAP authentication has been disabled. Login with a local account, update the LDAP password and re-enable it in Admin > Settings.');
|
||||
}
|
||||
//regardless of anything else; stuff isn't working. Return false.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! $results = ldap_search($connection, $baseDn, $filterQuery)) {
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Models;
|
||||
use App\Helpers\Helper;
|
||||
use App\Models\Traits\CompanyableTrait;
|
||||
use App\Models\Traits\HasUploads;
|
||||
use App\Models\Traits\Loggable;
|
||||
use App\Models\Traits\Searchable;
|
||||
use App\Presenters\Presentable;
|
||||
use Carbon\Carbon;
|
||||
@@ -415,7 +416,12 @@ class License extends Depreciable
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkouts()
|
||||
{
|
||||
return $this->assetlog()->where('action_type', '=', 'checkout')
|
||||
->orderBy('created_at', 'desc')
|
||||
->withTrashed();
|
||||
}
|
||||
/**
|
||||
* Determine whether the user should be required to accept the license
|
||||
*
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use App\Models\Traits\Acceptable;
|
||||
use App\Models\Traits\CompanyableChildTrait;
|
||||
use App\Models\Traits\Loggable;
|
||||
use App\Notifications\CheckinLicenseNotification;
|
||||
use App\Notifications\CheckoutLicenseNotification;
|
||||
use App\Presenters\Presentable;
|
||||
@@ -75,7 +76,7 @@ class LicenseSeat extends SnipeModel implements ICompanyableChild
|
||||
protected function displayName(): Attribute
|
||||
{
|
||||
return Attribute:: make(
|
||||
get: fn(mixed $value) => $this->license->name,
|
||||
get: fn(mixed $value) => $this->license?->name,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -134,7 +135,31 @@ class LicenseSeat extends SnipeModel implements ICompanyableChild
|
||||
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Get the list of checkouts for this License
|
||||
*
|
||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @since [v2.0]
|
||||
* @return \Illuminate\Database\Eloquent\Relations\Relation
|
||||
*/
|
||||
public function checkouts()
|
||||
{
|
||||
return $this->assetlog()->where('action_type', '=', 'checkout')
|
||||
->orderBy('created_at', 'desc')
|
||||
->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Establishes the license -> action logs relationship
|
||||
*
|
||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @since [v3.0]
|
||||
* @return \Illuminate\Database\Eloquent\Relations\Relation
|
||||
*/
|
||||
public function assetlog()
|
||||
{
|
||||
return $this->hasMany(Actionlog::class, 'item_id')->where('item_type', self::class)->orderBy('created_at', 'desc')->withTrashed();
|
||||
}
|
||||
/**
|
||||
* Query builder scope to order on department
|
||||
*
|
||||
@@ -152,17 +177,24 @@ class LicenseSeat extends SnipeModel implements ICompanyableChild
|
||||
}
|
||||
|
||||
|
||||
public function scopeOrderCompany($query, $order)
|
||||
{
|
||||
|
||||
|
||||
return $query->leftJoin('users as license_seat_users', 'license_seats.assigned_to', '=', 'license_seat_users.id')
|
||||
->leftJoin('companies as license_user_company', 'license_user_company.id', '=', 'license_seat_users.company_id')
|
||||
->whereNotNull('license_seats.assigned_to')
|
||||
->orderBy('license_user_company.name', $order);
|
||||
}
|
||||
|
||||
|
||||
public function scopeByAssigned($query)
|
||||
{
|
||||
|
||||
return $query->where(
|
||||
function ($query) {
|
||||
$query->whereNotNull('assigned_to')
|
||||
->orWhere(
|
||||
function ($query) {
|
||||
$query->whereNotNull('asset_id');
|
||||
}
|
||||
);
|
||||
->orWhereNotNull('asset_id');
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Models;
|
||||
use App\Http\Traits\UniqueUndeletedTrait;
|
||||
use App\Models\Traits\CompanyableTrait;
|
||||
use App\Models\Traits\HasUploads;
|
||||
use App\Models\Traits\Loggable;
|
||||
use App\Models\Traits\Searchable;
|
||||
use App\Presenters\Presentable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Models;
|
||||
use App\Helpers\Helper;
|
||||
use App\Models\Traits\CompanyableChildTrait;
|
||||
use App\Models\Traits\HasUploads;
|
||||
use App\Models\Traits\Loggable;
|
||||
use App\Models\Traits\Searchable;
|
||||
use App\Presenters\Presentable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
@@ -3,15 +3,18 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Http\Traits\UniqueUndeletedTrait;
|
||||
use App\Models\Traits\HasUploads;
|
||||
use App\Models\Traits\Searchable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
use \Illuminate\Database\Eloquent\Relations\Relation;
|
||||
use App\Models\Traits\Loggable;
|
||||
class Supplier extends SnipeModel
|
||||
{
|
||||
use HasFactory;
|
||||
use SoftDeletes;
|
||||
use HasUploads;
|
||||
|
||||
protected $table = 'suppliers';
|
||||
|
||||
@@ -42,6 +45,7 @@ class Supplier extends SnipeModel
|
||||
use ValidatingTrait;
|
||||
use UniqueUndeletedTrait;
|
||||
use Searchable;
|
||||
use Loggable;
|
||||
|
||||
/**
|
||||
* The attributes that should be included when searching the model.
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
namespace App\Models\Traits;
|
||||
|
||||
use App\Models\Actionlog;
|
||||
use App\Models\Asset;
|
||||
use App\Models\License;
|
||||
use App\Models\LicenseSeat;
|
||||
use App\Models\Location;
|
||||
use App\Models\Setting;
|
||||
use App\Models\User;
|
||||
use App\Notifications\AuditNotification;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
namespace App\Models\Traits;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use App\Models\CheckoutRequest;
|
||||
use App\Models\User;
|
||||
|
||||
// $asset->requests
|
||||
// $asset->isRequestedBy($user)
|
||||
@@ -5,6 +5,7 @@ namespace App\Models;
|
||||
use App\Http\Traits\UniqueUndeletedTrait;
|
||||
use App\Models\Traits\CompanyableTrait;
|
||||
use App\Models\Traits\HasUploads;
|
||||
use App\Models\Traits\Loggable;
|
||||
use App\Models\Traits\Searchable;
|
||||
use App\Presenters\Presentable;
|
||||
use App\Presenters\UserPresenter;
|
||||
@@ -224,15 +225,41 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
||||
return false;
|
||||
}
|
||||
|
||||
public function hasIndividualPermissions()
|
||||
{
|
||||
$permissions = [];
|
||||
|
||||
if (is_object($this->permissions)) {
|
||||
$permissions = json_decode(json_encode($this->permissions), true);
|
||||
}
|
||||
|
||||
if (is_string($this->permissions)) {
|
||||
$permissions = json_decode($this->permissions, true);
|
||||
}
|
||||
|
||||
if (($permissions) && (is_array($permissions))) {
|
||||
foreach ($permissions as $permission) {
|
||||
if ($permission != 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internally check the user permission for the given section
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function checkPermissionSection($section)
|
||||
protected function checkPermissionSection($section, $return_explicit = false)
|
||||
{
|
||||
$user_groups = $this->groups;
|
||||
if (($this->permissions == '') && (count($user_groups) == 0)) {
|
||||
|
||||
|
||||
// The user has no permissions and is not in any groups
|
||||
if ((($this->permissions == '') || ($this->permissions == 'null')) && (count($user_groups) == 0)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -247,11 +274,14 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
||||
}
|
||||
|
||||
|
||||
$is_user_section_permissions_set = ($user_permissions != '') && array_key_exists($section, $user_permissions);
|
||||
//If the user is explicitly granted, return true
|
||||
$is_user_section_permissions_set = array_key_exists($section, $user_permissions);
|
||||
|
||||
|
||||
// If the user is explicitly granted, return true
|
||||
if ($is_user_section_permissions_set && ($user_permissions[$section] == '1')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// If the user is explicitly denied, return false
|
||||
if ($is_user_section_permissions_set && ($user_permissions[$section] == '-1')) {
|
||||
return false;
|
||||
@@ -261,6 +291,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
||||
foreach ($user_groups as $user_group) {
|
||||
$group_permissions = (array) json_decode($user_group->permissions, true);
|
||||
if (((array_key_exists($section, $group_permissions)) && ($group_permissions[$section] == '1'))) {
|
||||
\Log::debug('user '.$this->id.' is granted '.$section.' permission via group membership');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -268,6 +299,64 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
||||
return false;
|
||||
}
|
||||
|
||||
// This gets the permissions including group associations
|
||||
|
||||
public function getEffectivePermissions($return_explicit = false) : array{
|
||||
|
||||
// The user has no permissions and is not in any groups
|
||||
if (($this->permissions == '') || ($this->permissions == 'null')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$user_permissions = $this->permissions;
|
||||
|
||||
if (is_object($this->permissions)) {
|
||||
$user_permissions = json_decode(json_encode($this->permissions), true);
|
||||
}
|
||||
|
||||
if (is_string($this->permissions)) {
|
||||
$user_permissions = json_decode($this->permissions, true);
|
||||
}
|
||||
|
||||
$effective_permissions_array = [];
|
||||
|
||||
foreach (config('permissions') as $section => $section_permissions) {
|
||||
|
||||
for ($x = 0; $x < count($section_permissions); $x++) {
|
||||
$permission_from_config = $section_permissions[$x]['permission'];
|
||||
|
||||
\Log::debug(print_r($user_permissions, true));
|
||||
if ($user_permissions && array_key_exists($permission_from_config, $user_permissions)) {
|
||||
|
||||
// If the user has an explicit permission set, use that
|
||||
if ($return_explicit) {
|
||||
|
||||
\Log::debug('using explicit');
|
||||
if ($user_permissions[$permission_from_config] == '1') {
|
||||
$effective_permissions_array[$permission_from_config] = 'grant';
|
||||
} elseif ($user_permissions[$permission_from_config] == '-1') {
|
||||
$effective_permissions_array[$permission_from_config] = 'deny';
|
||||
} else {
|
||||
$effective_permissions_array[$permission_from_config] = $this->hasAccess($permission_from_config) ? 'inherit-grant' : 'inherit-deny';
|
||||
// $effective_permissions_array[$permission_from_config] = 'inherit';
|
||||
}
|
||||
|
||||
} else {
|
||||
$effective_permissions_array[$permission_from_config] = $this->hasAccess($permission_from_config) ? 'grant' : 'deny';
|
||||
}
|
||||
|
||||
} else {
|
||||
\Log::debug('fallthrough');
|
||||
//$effective_permissions_array[$permission_from_config] = 'not in user perms';
|
||||
$effective_permissions_array[$permission_from_config] = $this->hasAccess($permission_from_config) ? 'inherit-grant' : 'inherit-deny';
|
||||
}
|
||||
// $effective_permissions_array[$permission_from_config] = $this->hasAccess($permission_from_config) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
return $effective_permissions_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check user permissions
|
||||
*
|
||||
@@ -278,13 +367,17 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
||||
* @since [v1.0]
|
||||
* @return bool
|
||||
*/
|
||||
public function hasAccess($section)
|
||||
public function hasAccess($section, $return_explicit = false)
|
||||
{
|
||||
if ($this->isSuperUser()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->checkPermissionSection($section);
|
||||
if (($section!='superuser') && ($this->isAdmin())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->checkPermissionSection($section, $return_explicit);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,14 +27,13 @@ use Illuminate\Notifications\Notification;
|
||||
$this->item_model = $params['item_model'];
|
||||
$this->item_serial = $params['item_serial'];
|
||||
$this->item_status = $params['item_status'];
|
||||
$this->accepted_date = Helper::getFormattedDateObject($params['accepted_date'], 'datetime', false);
|
||||
$this->accepted_date = $params['accepted_date'];
|
||||
$this->assigned_to = $params['assigned_to'];
|
||||
$this->company_name = $params['company_name'];
|
||||
$this->settings = Setting::getSettings();
|
||||
$this->file = $params['file'] ?? null;
|
||||
$this->qty = $params['qty'] ?? null;
|
||||
$this->note = $params['note'] ?? null;
|
||||
$this->admin = $params['admin'] ?? null;
|
||||
|
||||
}
|
||||
|
||||
@@ -77,7 +76,6 @@ use Illuminate\Notifications\Notification;
|
||||
'accepted_date' => $this->accepted_date,
|
||||
'assigned_to' => $this->assigned_to,
|
||||
'company_name' => $this->company_name,
|
||||
'admin' => $this->admin,
|
||||
'qty' => $this->qty,
|
||||
'intro_text' => trans('mail.acceptance_asset_accepted'),
|
||||
])
|
||||
|
||||
@@ -32,7 +32,6 @@ use Illuminate\Notifications\Notification;
|
||||
$this->settings = Setting::getSettings();
|
||||
$this->file = $params['file'] ?? null;
|
||||
$this->qty = $params['qty'] ?? null;
|
||||
$this->admin = $params['admin'] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,7 +69,6 @@ use Illuminate\Notifications\Notification;
|
||||
'accepted_date' => $this->accepted_date,
|
||||
'assigned_to' => $this->assigned_to,
|
||||
'company_name' => $this->company_name,
|
||||
'admin' => $this->admin,
|
||||
'qty' => $this->qty,
|
||||
'intro_text' => trans_choice('mail.acceptance_asset_accepted_to_user', $this->qty, ['qty' => $this->qty, 'site_name' => $this->settings->site_name]),
|
||||
])
|
||||
|
||||
@@ -25,12 +25,13 @@ class AcceptanceAssetDeclinedNotification extends Notification
|
||||
$this->item_model = $params['item_model'];
|
||||
$this->item_serial = $params['item_serial'];
|
||||
$this->item_status = $params['item_status'];
|
||||
$this->declined_date = Helper::getFormattedDateObject($params['declined_date'], 'date', false);
|
||||
$this->declined_date = $params['declined_date'];
|
||||
$this->note = $params['note'];
|
||||
$this->assigned_to = $params['assigned_to'];
|
||||
$this->company_name = $params['company_name'];
|
||||
$this->settings = Setting::getSettings();
|
||||
$this->qty = $params['qty'] ?? null;
|
||||
$this->admin = $params['admin'] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,7 +71,8 @@ class AcceptanceAssetDeclinedNotification extends Notification
|
||||
'declined_date' => $this->declined_date,
|
||||
'assigned_to' => $this->assigned_to,
|
||||
'company_name' => $this->company_name,
|
||||
'qty' => $this->qty,
|
||||
'qty' => $this->qty,
|
||||
'admin' => $this->admin,
|
||||
'intro_text' => trans('mail.acceptance_asset_declined'),
|
||||
])
|
||||
->subject(trans('mail.acceptance_asset_declined'));
|
||||
|
||||
@@ -93,8 +93,8 @@ class CheckoutAssetNotification extends Notification
|
||||
$channel = ($this->settings->webhook_channel) ? $this->settings->webhook_channel : '';
|
||||
|
||||
$fields = [
|
||||
trans('general.to') => '<'.$target->present()->viewUrl().'|'.$target->display_name.'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->display_name.'>',
|
||||
trans('general.to_user') => '<'.$target->present()->viewUrl().'|'.$target->display_name.'>',
|
||||
trans('general.by_user') => '<'.$admin->present()->viewUrl().'|'.$admin->display_name.'>',
|
||||
];
|
||||
|
||||
if ($item->location) {
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use AllowDynamicProperties;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
#[AllowDynamicProperties]
|
||||
class InventoryAlert extends Notification
|
||||
{
|
||||
use Queueable;
|
||||
@@ -32,9 +34,8 @@ class InventoryAlert extends Notification
|
||||
*/
|
||||
public function via()
|
||||
{
|
||||
$notifyBy = ['mail'];
|
||||
return (!empty($this->items) && $this->threshold !== null) ? ['mail'] : [];
|
||||
|
||||
return $notifyBy;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -49,7 +49,8 @@ class UserObserver
|
||||
'end_date',
|
||||
'autoassign_licenses',
|
||||
'vip',
|
||||
'password'
|
||||
'password',
|
||||
'permissions'
|
||||
];
|
||||
|
||||
$changed = [];
|
||||
|
||||
@@ -102,7 +102,7 @@ class ActionlogPresenter extends Presenter
|
||||
return 'fa-solid fa-rotate-right';
|
||||
}
|
||||
|
||||
if ($this->action_type == 'note_added') {
|
||||
if ($this->action_type == 'note added') {
|
||||
return 'fas fa-sticky-note';
|
||||
}
|
||||
|
||||
|
||||
@@ -248,10 +248,20 @@ class LicensePresenter extends Presenter
|
||||
'title' => trans('admin/users/table.email'),
|
||||
'visible' => true,
|
||||
'formatter' => 'emailFormatter',
|
||||
], [
|
||||
'field' => 'department',
|
||||
],
|
||||
[
|
||||
'field' => 'assigned_user.company',
|
||||
'searchable' => false,
|
||||
'sortable' => true,
|
||||
'sortable' => false,
|
||||
'switchable' => true,
|
||||
'title' => trans('general.company'),
|
||||
'visible' => true,
|
||||
'formatter' => 'companiesLinkObjFormatter',
|
||||
],
|
||||
[
|
||||
'field' => 'assigned_user.department',
|
||||
'searchable' => false,
|
||||
'sortable' => false,
|
||||
'switchable' => true,
|
||||
'title' => trans('general.department'),
|
||||
'visible' => false,
|
||||
|
||||
@@ -342,7 +342,8 @@ class BreadcrumbsServiceProvider extends ServiceProvider
|
||||
|
||||
Breadcrumbs::for('groups.edit', fn (Trail $trail, Group $group) =>
|
||||
$trail->parent('groups.index', route('groups.index'))
|
||||
->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $group->name]), route('groups.edit', $group))
|
||||
->push($group->name, route('groups.show', $group))
|
||||
->push(trans('general.breadcrumb_button_actions.edit'), route('groups.edit', $group))
|
||||
);
|
||||
|
||||
|
||||
@@ -590,7 +591,6 @@ class BreadcrumbsServiceProvider extends ServiceProvider
|
||||
);
|
||||
|
||||
|
||||
|
||||
Breadcrumbs::for('users.show', fn (Trail $trail, User $user) =>
|
||||
$trail->parent('users.index', route('users.index'))
|
||||
->push($user->display_name ?? 'Missing Username!', route('users.show', $user))
|
||||
@@ -598,6 +598,7 @@ class BreadcrumbsServiceProvider extends ServiceProvider
|
||||
|
||||
Breadcrumbs::for('users.edit', fn (Trail $trail, User $user) =>
|
||||
$trail->parent('users.index', route('users.index'))
|
||||
->push($user->display_name, route('users.show', $user))
|
||||
->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $user->name]), route('users.edit', $user))
|
||||
);
|
||||
|
||||
|
||||
@@ -283,41 +283,36 @@ class ValidationServiceProvider extends ServiceProvider
|
||||
}
|
||||
});
|
||||
|
||||
Validator::extend('is_unique_department', function ($attribute, $value, $parameters, $validator) {
|
||||
/**
|
||||
* Check that the 'name' field is unique in the table while within both company_id and location_id
|
||||
* This is only used by Departments right now, but could be used elsewhere in the future.
|
||||
*/
|
||||
Validator::extend('is_unique_across_company_and_location', function ($attribute, $value, $parameters, $validator) {
|
||||
$data = $validator->getData();
|
||||
$table = array_get($parameters, 0);
|
||||
|
||||
if (
|
||||
array_key_exists('location_id', $data) && $data['location_id'] !== null &&
|
||||
array_key_exists('company_id', $data) && $data['company_id'] !== null
|
||||
) {
|
||||
//for updating existing departments
|
||||
if(array_key_exists('id', $data) && $data['id'] !== null){
|
||||
$count = Department::where('name', $data['name'])
|
||||
->where('location_id', $data['location_id'])
|
||||
->where('company_id', $data['company_id'])
|
||||
->whereNotNull('company_id')
|
||||
->whereNotNull('location_id')
|
||||
->where('id', '!=', $data['id'])
|
||||
->count('name');
|
||||
$count = DB::table($table)->select($attribute)
|
||||
->where($attribute, $value)
|
||||
->whereNull('deleted_at');
|
||||
|
||||
return $count < 1;
|
||||
}else // for entering in new departments
|
||||
{
|
||||
$count = Department::where('name', $data['name'])
|
||||
->where('location_id', $data['location_id'])
|
||||
->where('company_id', $data['company_id'])
|
||||
->whereNotNull('company_id')
|
||||
->whereNotNull('location_id')
|
||||
->count('name');
|
||||
|
||||
return $count < 1;
|
||||
if (array_key_exists('id', $data) && $data['id'] !== null) {
|
||||
$count = $count->where('id', '!=', $data['id']);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (array_key_exists('location_id', $data) && $data['location_id'] !== null) {
|
||||
$count = $count->where('location_id', $data['location_id']);
|
||||
}
|
||||
|
||||
if (array_key_exists('company_id', $data) && $data['company_id'] !== null) {
|
||||
$count = $count->where('company_id', $data['company_id']);
|
||||
}
|
||||
|
||||
$count = $count->count('name');
|
||||
return $count < 1;
|
||||
|
||||
});
|
||||
|
||||
|
||||
Validator::extend('not_array', function ($attribute, $value, $parameters, $validator) {
|
||||
return !is_array($value);
|
||||
});
|
||||
|
||||
@@ -140,18 +140,32 @@ class Label implements View
|
||||
if ($template->getSupport2DBarcode()) {
|
||||
$barcode2DType = $settings->label2_2d_type;
|
||||
if (($barcode2DType != 'none') && (!is_null($barcode2DType))) {
|
||||
|
||||
$label2_2d_prefix = $settings->label2_2d_prefix ? e($settings->label2_2d_prefix) : '';
|
||||
switch ($settings->label2_2d_target) {
|
||||
case 'ht_tag':
|
||||
$barcode2DTarget = route('ht/assetTag', $asset->asset_tag);
|
||||
break;
|
||||
case 'plain_asset_id':
|
||||
$barcode2DTarget = (string) $asset->id;
|
||||
$barcode2DTarget = $label2_2d_prefix.(string) $asset->id;
|
||||
break;
|
||||
case 'plain_asset_tag':
|
||||
$barcode2DTarget = $asset->asset_tag;
|
||||
$barcode2DTarget = $label2_2d_prefix.$asset->asset_tag;
|
||||
break;
|
||||
case 'plain_serial_number':
|
||||
$barcode2DTarget = $asset->serial;
|
||||
$barcode2DTarget = $label2_2d_prefix.$asset->serial;
|
||||
break;
|
||||
case 'plain_model_number':
|
||||
$barcode2DTarget = $label2_2d_prefix.$asset->model->model_number ?? '';
|
||||
break;
|
||||
case 'plain_model_name':
|
||||
$barcode2DTarget = $label2_2d_prefix.$asset->model->display_name ?? '';
|
||||
break;
|
||||
case 'plain_manufacturer_name':
|
||||
$barcode2DTarget = $label2_2d_prefix.$asset->model->display_name;
|
||||
break;
|
||||
case 'plain_location_name':
|
||||
$barcode2DTarget = $label2_2d_prefix.$asset->location->name;
|
||||
break;
|
||||
case 'location':
|
||||
$barcode2DTarget = $asset->location_id
|
||||
|
||||
@@ -18,9 +18,10 @@ $dump_options = [
|
||||
//'add_extra_option' => '--optionname=optionvalue',
|
||||
];
|
||||
|
||||
// Some versions of mysql do not support the --skip-ssl option and will fail if it is even set
|
||||
// For modern versions of mysqldump, use --ssl-mode=DISABLED
|
||||
if (env('DB_DUMP_SKIP_SSL') == 'true') {
|
||||
$dump_options['skip_ssl'] = true;
|
||||
// Correctly add the option as a string to the 'add_extra_option' key.
|
||||
$dump_options['add_extra_option'] = '--ssl-mode=DISABLED';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,11 +9,9 @@
|
||||
|
||||
return [
|
||||
|
||||
'Global' => [
|
||||
'Superuser' => [
|
||||
[
|
||||
'permission' => 'superuser',
|
||||
'label' => 'Super User',
|
||||
'note' => 'Determines whether the user has full access to all aspects of the admin. This setting overrides any more specific permissions throughout the system. ',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
@@ -21,17 +19,13 @@ return [
|
||||
'Admin' => [
|
||||
[
|
||||
'permission' => 'admin',
|
||||
'label' => '',
|
||||
'note' => 'Determines whether the user has access to most aspects of the admin. ',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
|
||||
'CSV Import' => [
|
||||
'Import' => [
|
||||
[
|
||||
'permission' => 'import',
|
||||
'label' => '',
|
||||
'note' => 'This will allow users to import even if access to users, assets, etc is denied elsewhere.',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
@@ -39,8 +33,6 @@ return [
|
||||
'Reports' => [
|
||||
[
|
||||
'permission' => 'reports.view',
|
||||
'label' => 'View',
|
||||
'note' => 'Determines whether the user has the ability to view reports.',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
@@ -48,68 +40,48 @@ return [
|
||||
'Assets' => [
|
||||
[
|
||||
'permission' => 'assets.view',
|
||||
'label' => 'View ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'assets.create',
|
||||
'label' => 'Create ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'assets.edit',
|
||||
'label' => 'Edit ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'assets.delete',
|
||||
'label' => 'Delete ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'assets.checkout',
|
||||
'label' => 'Checkout ',
|
||||
'note' => '',
|
||||
'display' => false,
|
||||
],
|
||||
|
||||
[
|
||||
'permission' => 'assets.checkin',
|
||||
'label' => 'Checkin ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
[
|
||||
'permission' => 'assets.checkout',
|
||||
'label' => 'Checkout ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
[
|
||||
'permission' => 'assets.audit',
|
||||
'label' => 'Audit ',
|
||||
'note' => 'Allows the user to mark an asset as physically inventoried.',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
|
||||
[
|
||||
'permission' => 'assets.view.requestable',
|
||||
'label' => 'View Requestable Assets',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
[
|
||||
'permission' => 'assets.view.encrypted_custom_fields',
|
||||
'label' => 'View and Modify Encrypted Custom Fields',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
@@ -118,44 +90,30 @@ return [
|
||||
'Accessories' => [
|
||||
[
|
||||
'permission' => 'accessories.view',
|
||||
'label' => 'View ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'accessories.create',
|
||||
'label' => 'Create ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'accessories.edit',
|
||||
'label' => 'Edit ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'accessories.delete',
|
||||
'label' => 'Delete ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'accessories.checkout',
|
||||
'label' => 'Checkout ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'accessories.checkin',
|
||||
'label' => 'Checkin ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'accessories.files',
|
||||
'label' => 'View and Modify Accessory Files',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
@@ -164,38 +122,26 @@ return [
|
||||
'Consumables' => [
|
||||
[
|
||||
'permission' => 'consumables.view',
|
||||
'label' => 'View',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'consumables.create',
|
||||
'label' => 'Create ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'consumables.edit',
|
||||
'label' => 'Edit ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'consumables.delete',
|
||||
'label' => 'Delete ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'consumables.checkout',
|
||||
'label' => 'Checkout ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'consumables.files',
|
||||
'label' => 'View and Modify Consumable Files',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
@@ -204,50 +150,34 @@ return [
|
||||
'Licenses' => [
|
||||
[
|
||||
'permission' => 'licenses.view',
|
||||
'label' => 'View',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'licenses.create',
|
||||
'label' => 'Create ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'licenses.edit',
|
||||
'label' => 'Edit ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'licenses.delete',
|
||||
'label' => 'Delete ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'licenses.checkout',
|
||||
'label' => 'Checkout ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'licenses.checkin',
|
||||
'label' => 'Checkin ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'licenses.keys',
|
||||
'label' => 'View License Keys',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'licenses.files',
|
||||
'label' => 'View and Modify License Files',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
@@ -256,44 +186,30 @@ return [
|
||||
'Components' => [
|
||||
[
|
||||
'permission' => 'components.view',
|
||||
'label' => 'View',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'components.create',
|
||||
'label' => 'Create ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'components.edit',
|
||||
'label' => 'Edit ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'components.delete',
|
||||
'label' => 'Delete ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'components.checkout',
|
||||
'label' => 'Checkout ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'components.checkin',
|
||||
'label' => 'Checkin ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'components.files',
|
||||
'label' => 'View and Modify Component Files',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
@@ -302,26 +218,18 @@ return [
|
||||
'Kits' => [
|
||||
[
|
||||
'permission' => 'kits.view',
|
||||
'label' => 'View ',
|
||||
'note' => 'These are predefined kits that can be used to quickly checkout assets, licenses, etc.',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'kits.create',
|
||||
'label' => 'Create ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'kits.edit',
|
||||
'label' => 'Edit ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'kits.delete',
|
||||
'label' => 'Delete ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
@@ -329,26 +237,18 @@ return [
|
||||
'Users' => [
|
||||
[
|
||||
'permission' => 'users.view',
|
||||
'label' => 'View ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'users.create',
|
||||
'label' => 'Create Users',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'users.edit',
|
||||
'label' => 'Edit Users',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'users.delete',
|
||||
'label' => 'Delete Users',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
@@ -357,26 +257,18 @@ return [
|
||||
'Models' => [
|
||||
[
|
||||
'permission' => 'models.view',
|
||||
'label' => 'View ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'models.create',
|
||||
'label' => 'Create ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'models.edit',
|
||||
'label' => 'Edit ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'models.delete',
|
||||
'label' => 'Delete ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
@@ -385,26 +277,18 @@ return [
|
||||
'Categories' => [
|
||||
[
|
||||
'permission' => 'categories.view',
|
||||
'label' => 'View ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'categories.create',
|
||||
'label' => 'Create ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'categories.edit',
|
||||
'label' => 'Edit ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'categories.delete',
|
||||
'label' => 'Delete ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
@@ -412,26 +296,18 @@ return [
|
||||
'Departments' => [
|
||||
[
|
||||
'permission' => 'departments.view',
|
||||
'label' => 'View ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'departments.create',
|
||||
'label' => 'Create ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'departments.edit',
|
||||
'label' => 'Edit ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'departments.delete',
|
||||
'label' => 'Delete ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
@@ -439,26 +315,18 @@ return [
|
||||
'Status Labels' => [
|
||||
[
|
||||
'permission' => 'statuslabels.view',
|
||||
'label' => 'View ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'statuslabels.create',
|
||||
'label' => 'Create ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'statuslabels.edit',
|
||||
'label' => 'Edit ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'statuslabels.delete',
|
||||
'label' => 'Delete ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
@@ -466,26 +334,18 @@ return [
|
||||
'Custom Fields' => [
|
||||
[
|
||||
'permission' => 'customfields.view',
|
||||
'label' => 'View',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'customfields.create',
|
||||
'label' => 'Create',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'customfields.edit',
|
||||
'label' => 'Edit',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'customfields.delete',
|
||||
'label' => 'Delete',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
@@ -493,26 +353,18 @@ return [
|
||||
'Suppliers' => [
|
||||
[
|
||||
'permission' => 'suppliers.view',
|
||||
'label' => 'View ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'suppliers.create',
|
||||
'label' => 'Create ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'suppliers.edit',
|
||||
'label' => 'Edit ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'suppliers.delete',
|
||||
'label' => 'Delete ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
@@ -521,26 +373,18 @@ return [
|
||||
'Manufacturers' => [
|
||||
[
|
||||
'permission' => 'manufacturers.view',
|
||||
'label' => 'View ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'manufacturers.create',
|
||||
'label' => 'Create ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'manufacturers.edit',
|
||||
'label' => 'Edit ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'manufacturers.delete',
|
||||
'label' => 'Delete ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
@@ -548,26 +392,18 @@ return [
|
||||
'Depreciations' => [
|
||||
[
|
||||
'permission' => 'depreciations.view',
|
||||
'label' => 'View ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'depreciations.create',
|
||||
'label' => 'Create ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'depreciations.edit',
|
||||
'label' => 'Edit ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'depreciations.delete',
|
||||
'label' => 'Delete ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
@@ -575,26 +411,18 @@ return [
|
||||
'Locations' => [
|
||||
[
|
||||
'permission' => 'locations.view',
|
||||
'label' => 'View ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'locations.create',
|
||||
'label' => 'Create ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'locations.edit',
|
||||
'label' => 'Edit ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'locations.delete',
|
||||
'label' => 'Delete ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
@@ -602,66 +430,46 @@ return [
|
||||
'Companies' => [
|
||||
[
|
||||
'permission' => 'companies.view',
|
||||
'label' => 'View ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'companies.create',
|
||||
'label' => 'Create ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'companies.edit',
|
||||
'label' => 'Edit ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'companies.delete',
|
||||
'label' => 'Delete ',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
|
||||
|
||||
|
||||
|
||||
'Self' => [
|
||||
'User (Self) Accounts' => [
|
||||
[
|
||||
'permission' => 'self.two_factor',
|
||||
'label' => 'Two-Factor Authentication',
|
||||
'note' => 'The user may disable/enable two-factor authentication themselves if two-factor is enabled and set to selective.',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
[
|
||||
'permission' => 'self.api',
|
||||
'label' => 'Create API Keys',
|
||||
'note' => 'The user create personal API keys to utilize the REST API.',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
[
|
||||
'permission' => 'self.edit_location',
|
||||
'label' => 'Profile Edit Location',
|
||||
'note' => 'The user may update their own location in their profile. Note that this is not affected by any additional Users permissions you grant to this user or group.',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
[
|
||||
'permission' => 'self.checkout_assets',
|
||||
'label' => 'Self-Checkout',
|
||||
'note' => 'This user may check out assets that are marked for self-checkout.',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
[
|
||||
'permission' => 'self.view_purchase_cost',
|
||||
'label' => 'View Purchase-Cost Column',
|
||||
'note' => 'This user can see the purchase cost column of items assigned to them.',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
return array (
|
||||
'app_version' => 'v8.3.3',
|
||||
'full_app_version' => 'v8.3.3 - build 20183-g3339d1999',
|
||||
'build_version' => '20183',
|
||||
'app_version' => 'v8.3.5',
|
||||
'full_app_version' => 'v8.3.5 - build 20406-gf92f76b48',
|
||||
'build_version' => '20406',
|
||||
'prerelease_version' => '',
|
||||
'hash_version' => 'g3339d1999',
|
||||
'full_hash' => 'v8.3.3-114-g3339d1999',
|
||||
'hash_version' => 'gf92f76b48',
|
||||
'full_hash' => 'v8.3.5-183-gf92f76b48',
|
||||
'branch' => 'develop',
|
||||
);
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
|
||||
/**
|
||||
* We actually *do* have an index on action_type, so this query shouldn't take too terribly long. I don't know
|
||||
* that we have a ton of people canceling requests (and only certain types of request-cancellation use this
|
||||
* erroneous action_type), so I feel pretty comfortable with this fixup. Fingers crossed!
|
||||
* */
|
||||
|
||||
DB::table('action_logs')->where('action_type', 'request_canceled')->update(['action_type' => 'request canceled']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// no down migration for this one
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
if (!Schema::hasColumn('settings', 'label2_2d_prefix')) {
|
||||
$table->char('label2_2d_prefix', 191)->after('label2_2d_type')->nullable()->default(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
if (Schema::hasColumn('settings', 'label2_2d_prefix')) {
|
||||
$table->dropColumn('label2_2d_prefix');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('suppliers', function (Blueprint $table) {
|
||||
$table->text('notes')->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('suppliers', function (Blueprint $table) {
|
||||
$table->text('notes')->nullable()->default(null)->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
@@ -68,7 +68,7 @@ class UserSeeder extends Seeder
|
||||
]))
|
||||
->create();
|
||||
|
||||
User::factory()->count(50)->viewAssets()
|
||||
User::factory()->count(2000)->viewAssets()
|
||||
->state(new Sequence(fn($sequence) => [
|
||||
'company_id' => $companyIds->random(),
|
||||
'department_id' => $departmentIds->random(),
|
||||
|
||||
19
package-lock.json
generated
19
package-lock.json
generated
@@ -3643,11 +3643,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/cipher-base": {
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.7.tgz",
|
||||
"integrity": "sha512-Mz9QMT5fJe7bKI7MH31UilT5cEK5EHHRCccw/YRFsRY47AuNgaV6HY3rscp0/I4Q+tTW/5zoqpSeRRI54TkDWA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.1",
|
||||
"safe-buffer": "^5.0.1"
|
||||
"inherits": "^2.0.4",
|
||||
"safe-buffer": "^5.2.1",
|
||||
"to-buffer": "^1.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/ckeditor": {
|
||||
@@ -10293,9 +10299,10 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/to-buffer": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.2.1.tgz",
|
||||
"integrity": "sha512-tB82LpAIWjhLYbqjx3X4zEeHN6M8CiuOEy2JY8SEQVdYRe3CCHOFaqrBW1doLDrfpWhplcW7BL+bO3/6S3pcDQ==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.2.2.tgz",
|
||||
"integrity": "sha512-db0E3UJjcFhpDhAF4tLo03oli3pwl3dbnzXOUIlRKrp+ldk/VUxzpWYZENsw2SZiuBjHAk7DfB0VU7NKdpb6sw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"isarray": "^2.0.5",
|
||||
"safe-buffer": "^5.2.1",
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
24630
public/css/dist/all.css
vendored
24630
public/css/dist/all.css
vendored
File diff suppressed because one or more lines are too long
391
public/css/dist/bootstrap-table.css
vendored
391
public/css/dist/bootstrap-table.css
vendored
File diff suppressed because one or more lines are too long
136
public/css/dist/signature-pad.min.css
vendored
136
public/css/dist/signature-pad.min.css
vendored
@@ -1 +1,135 @@
|
||||
#signature-pad{padding-top:250px;margin:auto}.m-signature-pad{position:relative;font-size:10px;width:100%;height:300px;border:1px solid #e8e8e8;background-color:#fff;box-shadow:0 1px 4px rgba(0,0,0,.27),0 0 40px rgba(0,0,0,.08) inset;border-radius:4px}.m-signature-pad:after,.m-signature-pad:before{position:absolute;z-index:-1;content:"";width:40%;height:10px;left:20px;bottom:10px;background:0 0;-webkit-transform:skew(-3deg) rotate(-3deg);-moz-transform:skew(-3deg) rotate(-3deg);-ms-transform:skew(-3deg) rotate(-3deg);-o-transform:skew(-3deg) rotate(-3deg);transform:skew(-3deg) rotate(-3deg);box-shadow:0 8px 12px rgba(0,0,0,.4)}.m-signature-pad:after{left:auto;right:20px;-webkit-transform:skew(3deg) rotate(3deg);-moz-transform:skew(3deg) rotate(3deg);-ms-transform:skew(3deg) rotate(3deg);-o-transform:skew(3deg) rotate(3deg);transform:skew(3deg) rotate(3deg)}.m-signature-pad--body{position:absolute;top:20px;bottom:60px;border:1px solid #f4f4f4;background-color:#fff}.m-signature-pad--body canvas{position:absolute;left:0;top:0;width:100%;height:100%;border-radius:4px;box-shadow:0 0 5px rgba(0,0,0,.02) inset}.m-signature-pad--footer{position:absolute;left:20px;right:20px;bottom:20px;height:40px}.m-signature-pad--footer .description{color:#c3c3c3;text-align:center;font-size:1.2em;margin-top:1.8em}.m-signature-pad--footer .button{position:absolute;bottom:0}.m-signature-pad--footer .button.clear{left:0}.m-signature-pad--footer .button.save{right:0}@media screen and (max-width:1024px){.m-signature-pad{top:0;left:0;right:0;bottom:0;width:auto;height:auto;min-width:250px;min-height:140px;margin:5%}}@media screen and (min-device-width:768px) and (max-device-width:1024px){.m-signature-pad{margin:10%}}@media screen and (max-height:320px){.m-signature-pad--body{left:0;right:0;top:0;bottom:32px}.m-signature-pad--footer{left:20px;right:20px;bottom:4px;height:28px}.m-signature-pad--footer .description{font-size:1em;margin-top:1em}}
|
||||
|
||||
#signature-pad {
|
||||
padding-top: 250px;
|
||||
margin: auto;
|
||||
}
|
||||
.m-signature-pad {
|
||||
|
||||
position: relative;
|
||||
font-size: 10px;
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
border: 1px solid #e8e8e8;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.08) inset;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.m-signature-pad:before, .m-signature-pad:after {
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
content: "";
|
||||
width: 40%;
|
||||
height: 10px;
|
||||
left: 20px;
|
||||
bottom: 10px;
|
||||
background: transparent;
|
||||
-webkit-transform: skew(-3deg) rotate(-3deg);
|
||||
-moz-transform: skew(-3deg) rotate(-3deg);
|
||||
-ms-transform: skew(-3deg) rotate(-3deg);
|
||||
-o-transform: skew(-3deg) rotate(-3deg);
|
||||
transform: skew(-3deg) rotate(-3deg);
|
||||
box-shadow: 0 8px 12px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.m-signature-pad:after {
|
||||
left: auto;
|
||||
right: 20px;
|
||||
-webkit-transform: skew(3deg) rotate(3deg);
|
||||
-moz-transform: skew(3deg) rotate(3deg);
|
||||
-ms-transform: skew(3deg) rotate(3deg);
|
||||
-o-transform: skew(3deg) rotate(3deg);
|
||||
transform: skew(3deg) rotate(3deg);
|
||||
}
|
||||
|
||||
.m-signature-pad--body {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
bottom: 60px;
|
||||
border: 1px solid #f4f4f4;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.m-signature-pad--body
|
||||
canvas {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 0 5px rgba(0, 0, 0, 0.02) inset;
|
||||
}
|
||||
|
||||
.m-signature-pad--footer {
|
||||
position: absolute;
|
||||
left: 20px;
|
||||
right: 20px;
|
||||
bottom: 20px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.m-signature-pad--footer
|
||||
.description {
|
||||
color: #C3C3C3;
|
||||
text-align: center;
|
||||
font-size: 1.2em;
|
||||
margin-top: 1.8em;
|
||||
}
|
||||
|
||||
.m-signature-pad--footer
|
||||
.button {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.m-signature-pad--footer
|
||||
.button.clear {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.m-signature-pad--footer
|
||||
.button.save {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1024px) {
|
||||
.m-signature-pad {
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: auto;
|
||||
height: auto;
|
||||
min-width: 250px;
|
||||
min-height: 140px;
|
||||
margin: 5%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media screen and (min-device-width: 768px) and (max-device-width: 1024px) {
|
||||
.m-signature-pad {
|
||||
margin: 10%;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-height: 320px) {
|
||||
.m-signature-pad--body {
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 32px;
|
||||
}
|
||||
.m-signature-pad--footer {
|
||||
left: 20px;
|
||||
right: 20px;
|
||||
bottom: 4px;
|
||||
height: 28px;
|
||||
}
|
||||
.m-signature-pad--footer
|
||||
.description {
|
||||
font-size: 1em;
|
||||
margin-top: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
5511
public/css/dist/skins/_all-skins.css
vendored
5511
public/css/dist/skins/_all-skins.css
vendored
File diff suppressed because one or more lines are too long
2
public/css/dist/skins/_all-skins.css.map
vendored
2
public/css/dist/skins/_all-skins.css.map
vendored
File diff suppressed because one or more lines are too long
5513
public/css/dist/skins/_all-skins.min.css
vendored
5513
public/css/dist/skins/_all-skins.min.css
vendored
File diff suppressed because one or more lines are too long
563
public/css/dist/skins/skin-black-dark.css
vendored
563
public/css/dist/skins/skin-black-dark.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
565
public/css/dist/skins/skin-black-dark.min.css
vendored
565
public/css/dist/skins/skin-black-dark.min.css
vendored
File diff suppressed because one or more lines are too long
220
public/css/dist/skins/skin-black.css
vendored
220
public/css/dist/skins/skin-black.css
vendored
@@ -1,3 +1,221 @@
|
||||
.skin-black .main-header .navbar{background-color:#111}.skin-black .main-header .navbar .nav>li>a{color:#fff}.skin-black .main-header .navbar .nav .open>a,.skin-black .main-header .navbar .nav .open>a:focus,.skin-black .main-header .navbar .nav .open>a:hover,.skin-black .main-header .navbar .nav>.active>a,.skin-black .main-header .navbar .nav>li>a:active,.skin-black .main-header .navbar .nav>li>a:focus,.skin-black .main-header .navbar .nav>li>a:hover,.skin-black .main-header .navbar .sidebar-toggle:hover{background:rgba(0,0,0,.1);color:#f6f6f6}.skin-black .main-header .navbar .sidebar-toggle{color:#fff}.skin-black .main-header .navbar .sidebar-toggle:hover{background-color:#040404}@media (max-width:767px){.skin-black .main-header .navbar .dropdown-menu li.divider{background-color:hsla(0,0%,100%,.1)}.skin-black .main-header .navbar .dropdown-menu li a{color:#333}.skin-black .main-header .navbar .dropdown-menu li a:hover{background:#040404}}.skin-black .main-header li.user-header{background-color:#111}.skin-black .content-header{background:transparent}.skin-black .left-side,.skin-black .main-sidebar,.skin-black .wrapper{background-color:#222d32}.skin-black .user-panel>.info,.skin-black .user-panel>.info>a{color:#fff}.skin-black .sidebar-menu>li.header{background:#1a2226;color:#4b646f}.skin-black .sidebar-menu>li>a{border-left:3px solid transparent}.skin-black .sidebar-menu>li.active>a,.skin-black .sidebar-menu>li:hover>a{background:#1e282c;border-left-color:#111;color:#fff}.skin-black .sidebar-menu>li>.treeview-menu{background:#2c3b41;margin:0 1px}.skin-black .sidebar a{color:#b8c7ce}.skin-black .sidebar a:hover{text-decoration:none}.skin-black .treeview-menu>li>a{color:#8aa4af}.skin-black .treeview-menu>li.active>a,.skin-black .treeview-menu>li>a:hover{color:#fff}.skin-black .sidebar-form{border:1px solid #374850;border-radius:3px;margin:10px}.skin-black .sidebar-form .btn,.skin-black .sidebar-form input[type=text]{background-color:#374850;border:1px solid transparent;box-shadow:none;height:35px;transition:all .3s ease-in-out}.skin-black .sidebar-form input[type=text]{border-bottom-left-radius:2px;border-bottom-right-radius:0;border-top-left-radius:2px;border-top-right-radius:0;color:#666}.skin-black .sidebar-form input[type=text]:focus,.skin-black .sidebar-form input[type=text]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-black .sidebar-form input[type=text]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-black .sidebar-form .btn{border-bottom-left-radius:0;border-bottom-right-radius:2px;border-top-left-radius:0;border-top-right-radius:2px;color:#999}.skin-black.layout-top-nav .main-header>.logo .logo-variant{background-color:none}.btn,.btn:hover{color:#000}.btn .btn-primary:link,.btn.btn-primary,.btn:hover .btn-primary:link,.btn:hover.btn-primary{background-color:#505156;border-color:#fff;color:#fff}.btn:hovera.btn-primary:hover,.btna.btn-primary:hover{background-color:#111;border-color:#1f1f21;color:#fff}.btn.btn-white:hover,.btn.btn-white:link,.btn.btn-white:visited,.btn:hover.btn-white:hover,.btn:hover.btn-white:link,.btn:hover.btn-white:visited{color:#fff}a{color:var(--link)}a:hover{color:var(--hover-link)}a:visited{color:var(--visited-link)}.text-primary{color:#000}:root{--button-default:#000;--button-primary:#000;--button-hover:#000;--header:#111;--text-main:#bbb;--text-sub:#9b9b9b;--link:#black;--visited-link:#111;--hover-link:#999;--nav-link:#fff;--light-link:#fff}.btn-danger.btn-sm.disabled,a.btn-danger:link,a.btn-danger:visited,a.btn-info:link,a.btn-info:visited,a.btn-warning:link,a.btn-warning:visited{color:#fff}.far fa-life-ring{color:var(--link)}.sidebar-toggle-mobile{color:#fff!important}.skin-black .main-header .navbar .nav>li>a{text-decoration:none}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#111}.search-highlight,.search-highlight:hover{background-color:#e9d15b}
|
||||
/*
|
||||
* Skin: Black
|
||||
* ----------
|
||||
*/
|
||||
.skin-black .main-header .navbar {
|
||||
background-color: #111;
|
||||
}
|
||||
.skin-black .main-header .navbar .nav > li > a {
|
||||
color: #fff;
|
||||
}
|
||||
.skin-black .main-header .navbar .nav > li > a:hover,
|
||||
.skin-black .main-header .navbar .nav > li > a:active,
|
||||
.skin-black .main-header .navbar .nav > li > a:focus,
|
||||
.skin-black .main-header .navbar .nav .open > a,
|
||||
.skin-black .main-header .navbar .nav .open > a:hover,
|
||||
.skin-black .main-header .navbar .nav .open > a:focus,
|
||||
.skin-black .main-header .navbar .nav > .active > a {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
color: #f6f6f6;
|
||||
}
|
||||
.skin-black .main-header .navbar .sidebar-toggle {
|
||||
color: #fff;
|
||||
}
|
||||
.skin-black .main-header .navbar .sidebar-toggle:hover {
|
||||
color: #f6f6f6;
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.skin-black .main-header .navbar .sidebar-toggle {
|
||||
color: #fff;
|
||||
}
|
||||
.skin-black .main-header .navbar .sidebar-toggle:hover {
|
||||
background-color: #040404;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.skin-black .main-header .navbar .dropdown-menu li.divider {
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
.skin-black .main-header .navbar .dropdown-menu li a {
|
||||
color: #333;
|
||||
}
|
||||
.skin-black .main-header .navbar .dropdown-menu li a:hover {
|
||||
background: #040404;
|
||||
}
|
||||
}
|
||||
.skin-black .main-header li.user-header {
|
||||
background-color: #111;
|
||||
}
|
||||
.skin-black .content-header {
|
||||
background: transparent;
|
||||
}
|
||||
.skin-black .wrapper,
|
||||
.skin-black .main-sidebar,
|
||||
.skin-black .left-side {
|
||||
background-color: #222d32;
|
||||
}
|
||||
.skin-black .user-panel > .info,
|
||||
.skin-black .user-panel > .info > a {
|
||||
color: #fff;
|
||||
}
|
||||
.skin-black .sidebar-menu > li.header {
|
||||
color: #4b646f;
|
||||
background: #1a2226;
|
||||
}
|
||||
.skin-black .sidebar-menu > li > a {
|
||||
border-left: 3px solid transparent;
|
||||
}
|
||||
.skin-black .sidebar-menu > li:hover > a,
|
||||
.skin-black .sidebar-menu > li.active > a {
|
||||
color: #fff;
|
||||
background: #1e282c;
|
||||
border-left-color: #111;
|
||||
}
|
||||
.skin-black .sidebar-menu > li > .treeview-menu {
|
||||
margin: 0 1px;
|
||||
background: #2c3b41;
|
||||
}
|
||||
.skin-black .sidebar a {
|
||||
color: #b8c7ce;
|
||||
}
|
||||
.skin-black .sidebar a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.skin-black .treeview-menu > li > a {
|
||||
color: #8aa4af;
|
||||
}
|
||||
.skin-black .treeview-menu > li.active > a,
|
||||
.skin-black .treeview-menu > li > a:hover {
|
||||
color: #fff;
|
||||
}
|
||||
.skin-black .sidebar-form {
|
||||
border-radius: 3px;
|
||||
border: 1px solid #374850;
|
||||
margin: 10px 10px;
|
||||
}
|
||||
.skin-black .sidebar-form input[type="text"],
|
||||
.skin-black .sidebar-form .btn {
|
||||
box-shadow: none;
|
||||
background-color: #374850;
|
||||
border: 1px solid transparent;
|
||||
height: 35px;
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
.skin-black .sidebar-form input[type="text"] {
|
||||
color: #666;
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 2px;
|
||||
}
|
||||
.skin-black .sidebar-form input[type="text"]:focus,
|
||||
.skin-black .sidebar-form input[type="text"]:focus + .input-group-btn .btn {
|
||||
background-color: #fff;
|
||||
color: #666;
|
||||
}
|
||||
.skin-black .sidebar-form input[type="text"]:focus + .input-group-btn .btn {
|
||||
border-left-color: #fff;
|
||||
}
|
||||
.skin-black .sidebar-form .btn {
|
||||
color: #999;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 2px;
|
||||
border-bottom-right-radius: 2px;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.skin-black.layout-top-nav .main-header > .logo .logo-variant {
|
||||
background-color: none;
|
||||
}
|
||||
.btn,
|
||||
.btn:hover {
|
||||
color: #000;
|
||||
}
|
||||
.btn.btn-primary,
|
||||
.btn:hover.btn-primary,
|
||||
.btn .btn-primary:link,
|
||||
.btn:hover .btn-primary:link {
|
||||
background-color: #505156;
|
||||
border-color: #FFF;
|
||||
color: #FFF;
|
||||
}
|
||||
.btna.btn-primary:hover,
|
||||
.btn:hovera.btn-primary:hover {
|
||||
background-color: #111;
|
||||
border-color: #1f1f21;
|
||||
color: #fff;
|
||||
}
|
||||
.btn.btn-white:link,
|
||||
.btn:hover.btn-white:link {
|
||||
color: #fff;
|
||||
}
|
||||
.btn.btn-white:hover,
|
||||
.btn:hover.btn-white:hover {
|
||||
color: #fff;
|
||||
}
|
||||
.btn.btn-white:visited,
|
||||
.btn:hover.btn-white:visited {
|
||||
color: #fff;
|
||||
}
|
||||
a {
|
||||
color: var(--link);
|
||||
}
|
||||
a:hover {
|
||||
color: var(--hover-link);
|
||||
}
|
||||
a:visited {
|
||||
color: var(--visited-link);
|
||||
}
|
||||
.text-primary {
|
||||
color: #000000;
|
||||
}
|
||||
:root {
|
||||
--button-default: #000000;
|
||||
--button-primary: #000000;
|
||||
--button-hover: #000000;
|
||||
--header: #111;
|
||||
/* Use same as Header picker */
|
||||
--text-main: #BBB;
|
||||
--text-sub: #9b9b9b;
|
||||
--link: #black;
|
||||
/* Use same as Header picker, lighten by 70% */
|
||||
--visited-link: #111;
|
||||
/* Use same as Header picker, lighten by 70% */
|
||||
--hover-link: #999999;
|
||||
/* Use same as Header picker, lighten by 70% */
|
||||
--nav-link: #FFF;
|
||||
/* Use same as Header picker */
|
||||
--light-link: #fff;
|
||||
/* Use same as Header picker */
|
||||
}
|
||||
a.btn-info:link,
|
||||
a.btn-warning:link,
|
||||
a.btn-danger:link {
|
||||
color: #FFF;
|
||||
}
|
||||
a.btn-info:visited,
|
||||
a.btn-warning:visited,
|
||||
a.btn-danger:visited {
|
||||
color: #FFF;
|
||||
}
|
||||
.btn-danger.btn-sm.disabled {
|
||||
color: #FFF;
|
||||
}
|
||||
.far fa-life-ring {
|
||||
color: var(--link);
|
||||
}
|
||||
.sidebar-toggle-mobile {
|
||||
color: #FFF !important;
|
||||
}
|
||||
.skin-black .main-header .navbar .nav > li > a,
|
||||
.skin-black .main-header .navbar .nav > li > a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
||||
background-color: #111;
|
||||
}
|
||||
.search-highlight,
|
||||
.search-highlight:hover {
|
||||
background-color: #e9d15b;
|
||||
}
|
||||
|
||||
|
||||
/*# sourceMappingURL=skin-black.css.map*/
|
||||
2
public/css/dist/skins/skin-black.css.map
vendored
2
public/css/dist/skins/skin-black.css.map
vendored
File diff suppressed because one or more lines are too long
222
public/css/dist/skins/skin-black.min.css
vendored
222
public/css/dist/skins/skin-black.min.css
vendored
@@ -1 +1,221 @@
|
||||
.skin-black .main-header .navbar{background-color:#111}.skin-black .main-header .navbar .nav>li>a{color:#fff}.skin-black .main-header .navbar .nav .open>a,.skin-black .main-header .navbar .nav .open>a:focus,.skin-black .main-header .navbar .nav .open>a:hover,.skin-black .main-header .navbar .nav>.active>a,.skin-black .main-header .navbar .nav>li>a:active,.skin-black .main-header .navbar .nav>li>a:focus,.skin-black .main-header .navbar .nav>li>a:hover,.skin-black .main-header .navbar .sidebar-toggle:hover{background:rgba(0,0,0,.1);color:#f6f6f6}.skin-black .main-header .navbar .sidebar-toggle{color:#fff}.skin-black .main-header .navbar .sidebar-toggle:hover{background-color:#040404}@media (max-width:767px){.skin-black .main-header .navbar .dropdown-menu li.divider{background-color:hsla(0,0%,100%,.1)}.skin-black .main-header .navbar .dropdown-menu li a{color:#333}.skin-black .main-header .navbar .dropdown-menu li a:hover{background:#040404}}.skin-black .main-header li.user-header{background-color:#111}.skin-black .content-header{background:0 0}.skin-black .left-side,.skin-black .main-sidebar,.skin-black .wrapper{background-color:#222d32}.skin-black .user-panel>.info,.skin-black .user-panel>.info>a{color:#fff}.skin-black .sidebar-menu>li.header{background:#1a2226;color:#4b646f}.skin-black .sidebar-menu>li>a{border-left:3px solid transparent}.skin-black .sidebar-menu>li.active>a,.skin-black .sidebar-menu>li:hover>a{background:#1e282c;border-left-color:#111;color:#fff}.skin-black .sidebar-menu>li>.treeview-menu{background:#2c3b41;margin:0 1px}.skin-black .sidebar a{color:#b8c7ce}.skin-black .sidebar a:hover{text-decoration:none}.skin-black .treeview-menu>li>a{color:#8aa4af}.skin-black .treeview-menu>li.active>a,.skin-black .treeview-menu>li>a:hover{color:#fff}.skin-black .sidebar-form{border:1px solid #374850;border-radius:3px;margin:10px}.skin-black .sidebar-form .btn,.skin-black .sidebar-form input[type=text]{background-color:#374850;border:1px solid transparent;box-shadow:none;height:35px;transition:all .3s ease-in-out}.skin-black .sidebar-form input[type=text]{border-bottom-left-radius:2px;border-bottom-right-radius:0;border-top-left-radius:2px;border-top-right-radius:0;color:#666}.skin-black .sidebar-form input[type=text]:focus,.skin-black .sidebar-form input[type=text]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-black .sidebar-form input[type=text]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-black .sidebar-form .btn{border-bottom-left-radius:0;border-bottom-right-radius:2px;border-top-left-radius:0;border-top-right-radius:2px;color:#999}.skin-black.layout-top-nav .main-header>.logo .logo-variant{background-color:none}.btn,.btn:hover{color:#000}.btn .btn-primary:link,.btn.btn-primary,.btn:hover .btn-primary:link,.btn:hover.btn-primary{background-color:#505156;border-color:#fff;color:#fff}.btn:hovera.btn-primary:hover,.btna.btn-primary:hover{background-color:#111;border-color:#1f1f21;color:#fff}.btn.btn-white:hover,.btn.btn-white:link,.btn.btn-white:visited,.btn:hover.btn-white:hover,.btn:hover.btn-white:link,.btn:hover.btn-white:visited{color:#fff}a{color:var(--link)}a:hover{color:var(--hover-link)}a:visited{color:var(--visited-link)}.text-primary{color:#000}:root{--button-default:#000;--button-primary:#000;--button-hover:#000;--header:#111;--text-main:#bbb;--text-sub:#9b9b9b;--link:#black;--visited-link:#111;--hover-link:#999;--nav-link:#fff;--light-link:#fff}.btn-danger.btn-sm.disabled,a.btn-danger:link,a.btn-danger:visited,a.btn-info:link,a.btn-info:visited,a.btn-warning:link,a.btn-warning:visited{color:#fff}.far fa-life-ring{color:var(--link)}.sidebar-toggle-mobile{color:#fff!important}.skin-black .main-header .navbar .nav>li>a{text-decoration:none}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#111}.search-highlight,.search-highlight:hover{background-color:#e9d15b}
|
||||
/*
|
||||
* Skin: Black
|
||||
* ----------
|
||||
*/
|
||||
.skin-black .main-header .navbar {
|
||||
background-color: #111;
|
||||
}
|
||||
.skin-black .main-header .navbar .nav > li > a {
|
||||
color: #fff;
|
||||
}
|
||||
.skin-black .main-header .navbar .nav > li > a:hover,
|
||||
.skin-black .main-header .navbar .nav > li > a:active,
|
||||
.skin-black .main-header .navbar .nav > li > a:focus,
|
||||
.skin-black .main-header .navbar .nav .open > a,
|
||||
.skin-black .main-header .navbar .nav .open > a:hover,
|
||||
.skin-black .main-header .navbar .nav .open > a:focus,
|
||||
.skin-black .main-header .navbar .nav > .active > a {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
color: #f6f6f6;
|
||||
}
|
||||
.skin-black .main-header .navbar .sidebar-toggle {
|
||||
color: #fff;
|
||||
}
|
||||
.skin-black .main-header .navbar .sidebar-toggle:hover {
|
||||
color: #f6f6f6;
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.skin-black .main-header .navbar .sidebar-toggle {
|
||||
color: #fff;
|
||||
}
|
||||
.skin-black .main-header .navbar .sidebar-toggle:hover {
|
||||
background-color: #040404;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.skin-black .main-header .navbar .dropdown-menu li.divider {
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
.skin-black .main-header .navbar .dropdown-menu li a {
|
||||
color: #333;
|
||||
}
|
||||
.skin-black .main-header .navbar .dropdown-menu li a:hover {
|
||||
background: #040404;
|
||||
}
|
||||
}
|
||||
.skin-black .main-header li.user-header {
|
||||
background-color: #111;
|
||||
}
|
||||
.skin-black .content-header {
|
||||
background: transparent;
|
||||
}
|
||||
.skin-black .wrapper,
|
||||
.skin-black .main-sidebar,
|
||||
.skin-black .left-side {
|
||||
background-color: #222d32;
|
||||
}
|
||||
.skin-black .user-panel > .info,
|
||||
.skin-black .user-panel > .info > a {
|
||||
color: #fff;
|
||||
}
|
||||
.skin-black .sidebar-menu > li.header {
|
||||
color: #4b646f;
|
||||
background: #1a2226;
|
||||
}
|
||||
.skin-black .sidebar-menu > li > a {
|
||||
border-left: 3px solid transparent;
|
||||
}
|
||||
.skin-black .sidebar-menu > li:hover > a,
|
||||
.skin-black .sidebar-menu > li.active > a {
|
||||
color: #fff;
|
||||
background: #1e282c;
|
||||
border-left-color: #111;
|
||||
}
|
||||
.skin-black .sidebar-menu > li > .treeview-menu {
|
||||
margin: 0 1px;
|
||||
background: #2c3b41;
|
||||
}
|
||||
.skin-black .sidebar a {
|
||||
color: #b8c7ce;
|
||||
}
|
||||
.skin-black .sidebar a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.skin-black .treeview-menu > li > a {
|
||||
color: #8aa4af;
|
||||
}
|
||||
.skin-black .treeview-menu > li.active > a,
|
||||
.skin-black .treeview-menu > li > a:hover {
|
||||
color: #fff;
|
||||
}
|
||||
.skin-black .sidebar-form {
|
||||
border-radius: 3px;
|
||||
border: 1px solid #374850;
|
||||
margin: 10px 10px;
|
||||
}
|
||||
.skin-black .sidebar-form input[type="text"],
|
||||
.skin-black .sidebar-form .btn {
|
||||
box-shadow: none;
|
||||
background-color: #374850;
|
||||
border: 1px solid transparent;
|
||||
height: 35px;
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
.skin-black .sidebar-form input[type="text"] {
|
||||
color: #666;
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 2px;
|
||||
}
|
||||
.skin-black .sidebar-form input[type="text"]:focus,
|
||||
.skin-black .sidebar-form input[type="text"]:focus + .input-group-btn .btn {
|
||||
background-color: #fff;
|
||||
color: #666;
|
||||
}
|
||||
.skin-black .sidebar-form input[type="text"]:focus + .input-group-btn .btn {
|
||||
border-left-color: #fff;
|
||||
}
|
||||
.skin-black .sidebar-form .btn {
|
||||
color: #999;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 2px;
|
||||
border-bottom-right-radius: 2px;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.skin-black.layout-top-nav .main-header > .logo .logo-variant {
|
||||
background-color: none;
|
||||
}
|
||||
.btn,
|
||||
.btn:hover {
|
||||
color: #000;
|
||||
}
|
||||
.btn.btn-primary,
|
||||
.btn:hover.btn-primary,
|
||||
.btn .btn-primary:link,
|
||||
.btn:hover .btn-primary:link {
|
||||
background-color: #505156;
|
||||
border-color: #FFF;
|
||||
color: #FFF;
|
||||
}
|
||||
.btna.btn-primary:hover,
|
||||
.btn:hovera.btn-primary:hover {
|
||||
background-color: #111;
|
||||
border-color: #1f1f21;
|
||||
color: #fff;
|
||||
}
|
||||
.btn.btn-white:link,
|
||||
.btn:hover.btn-white:link {
|
||||
color: #fff;
|
||||
}
|
||||
.btn.btn-white:hover,
|
||||
.btn:hover.btn-white:hover {
|
||||
color: #fff;
|
||||
}
|
||||
.btn.btn-white:visited,
|
||||
.btn:hover.btn-white:visited {
|
||||
color: #fff;
|
||||
}
|
||||
a {
|
||||
color: var(--link);
|
||||
}
|
||||
a:hover {
|
||||
color: var(--hover-link);
|
||||
}
|
||||
a:visited {
|
||||
color: var(--visited-link);
|
||||
}
|
||||
.text-primary {
|
||||
color: #000000;
|
||||
}
|
||||
:root {
|
||||
--button-default: #000000;
|
||||
--button-primary: #000000;
|
||||
--button-hover: #000000;
|
||||
--header: #111;
|
||||
/* Use same as Header picker */
|
||||
--text-main: #BBB;
|
||||
--text-sub: #9b9b9b;
|
||||
--link: #black;
|
||||
/* Use same as Header picker, lighten by 70% */
|
||||
--visited-link: #111;
|
||||
/* Use same as Header picker, lighten by 70% */
|
||||
--hover-link: #999999;
|
||||
/* Use same as Header picker, lighten by 70% */
|
||||
--nav-link: #FFF;
|
||||
/* Use same as Header picker */
|
||||
--light-link: #fff;
|
||||
/* Use same as Header picker */
|
||||
}
|
||||
a.btn-info:link,
|
||||
a.btn-warning:link,
|
||||
a.btn-danger:link {
|
||||
color: #FFF;
|
||||
}
|
||||
a.btn-info:visited,
|
||||
a.btn-warning:visited,
|
||||
a.btn-danger:visited {
|
||||
color: #FFF;
|
||||
}
|
||||
.btn-danger.btn-sm.disabled {
|
||||
color: #FFF;
|
||||
}
|
||||
.far fa-life-ring {
|
||||
color: var(--link);
|
||||
}
|
||||
.sidebar-toggle-mobile {
|
||||
color: #FFF !important;
|
||||
}
|
||||
.skin-black .main-header .navbar .nav > li > a,
|
||||
.skin-black .main-header .navbar .nav > li > a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
||||
background-color: #111;
|
||||
}
|
||||
.search-highlight,
|
||||
.search-highlight:hover {
|
||||
background-color: #e9d15b;
|
||||
}
|
||||
|
||||
|
||||
/*# sourceMappingURL=skin-black.css.map*/
|
||||
543
public/css/dist/skins/skin-blue-dark.css
vendored
543
public/css/dist/skins/skin-blue-dark.css
vendored
File diff suppressed because one or more lines are too long
2
public/css/dist/skins/skin-blue-dark.css.map
vendored
2
public/css/dist/skins/skin-blue-dark.css.map
vendored
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user