Skip to content

A free open source IT asset/license management system

Merge branch 'develop-v6-integration' into develop-v6-rc1

snipee27065fe1625
diff --cc .all-contributorsrc
index 5f8d82c140,c7c7603040..d5278f911f
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@@ -2362,31 -2362,13 +2362,40 @@@
]
},
{
+ "login": "Delta5",
+ "name": "Evan Taylor",
+ "avatar_url": "https://avatars.githubusercontent.com/u/1975640?v=4",
+ "profile": "https://github.com/Delta5",
+ "contributions": [
+ "code"
+ ]
++ },
++ {
+ "login": "PetriAsi",
+ "name": "Petri Asikainen",
+ "avatar_url": "https://avatars.githubusercontent.com/u/8735148?v=4",
+ "profile": "https://github.com/PetriAsi",
+ "contributions": [
+ "code"
+ ]
+ },
+ {
+ "login": "derdeagle",
+ "name": "derdeagle",
+ "avatar_url": "https://avatars.githubusercontent.com/u/11424540?v=4",
+ "profile": "https://github.com/derdeagle",
+ "contributions": [
+ "code"
+ ]
+ },
+ {
+ "login": "vapier",
+ "name": "Mike Frysinger",
+ "avatar_url": "https://avatars.githubusercontent.com/u/176950?v=4",
+ "profile": "https://wh0rd.org/",
+ "contributions": [
+ "code"
+ ]
}
]
}
diff --cc README.md
index b4ad390ef8,4f4c55d3ce..ee2978e947
--- a/README.md
+++ b/README.md
@@@ -128,7 -126,7 +128,8 @@@ Thanks goes to all of these wonderful p
| [<img src="https://avatars.githubusercontent.com/u/9255772?v=4" width="110px;"/><br /><sub>Mark Stenglein</sub>](https://markstenglein.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=ocelotsloth "Code") | [<img src="https://avatars.githubusercontent.com/u/35658596?v=4" width="110px;"/><br /><sub>ajsy</sub>](https://github.com/ajsy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=ajsy "Code") | [<img src="https://avatars.githubusercontent.com/u/3628035?v=4" width="110px;"/><br /><sub>Jan Kiesewetter</sub>](https://github.com/t3easy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=t3easy "Code") | [<img src="https://avatars.githubusercontent.com/u/79449630?v=4" width="110px;"/><br /><sub>Tetrachloromethane250</sub>](https://github.com/Tetrachloromethane250)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Tetrachloromethane250 "Code") | [<img src="https://avatars.githubusercontent.com/u/22004482?v=4" width="110px;"/><br /><sub>Lars Kajes</sub>](https://www.kajes.se/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=kajes "Code") | [<img src="https://avatars.githubusercontent.com/u/13993216?v=4" width="110px;"/><br /><sub>Joly0</sub>](https://github.com/Joly0)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Joly0 "Code") | [<img src="https://avatars.githubusercontent.com/u/1501022?v=4" width="110px;"/><br /><sub>theburger</sub>](https://github.com/limeless)<br />[💻](https://github.com/snipe/snipe-it/commits?author=limeless "Code") |
| [<img src="https://avatars.githubusercontent.com/u/36065681?v=4" width="110px;"/><br /><sub>David Valin Alonso</sub>](https://github.com/deivishome)<br />[💻](https://github.com/snipe/snipe-it/commits?author=deivishome "Code") | [<img src="https://avatars.githubusercontent.com/u/8290389?v=4" width="110px;"/><br /><sub>andreaci</sub>](https://github.com/andreaci)<br />[💻](https://github.com/snipe/snipe-it/commits?author=andreaci "Code") | [<img src="https://avatars.githubusercontent.com/u/1828542?v=4" width="110px;"/><br /><sub>Jelle Sebreghts</sub>](http://www.jellesebreghts.be)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Jelle-S "Code") | [<img src="https://avatars.githubusercontent.com/u/11180862?v=4" width="110px;"/><br /><sub>Michael Pietsch</sub>](https://github.com/Skywalker-11)<br /> | [<img src="https://avatars.githubusercontent.com/u/22068886?v=4" width="110px;"/><br /><sub>Masudul Haque Shihab</sub>](https://github.com/sh1hab)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sh1hab "Code") | [<img src="https://avatars.githubusercontent.com/u/16099942?v=4" width="110px;"/><br /><sub>Supapong Areeprasertkul</sub>](http://www.freedomdive.com/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=zybersup "Code") | [<img src="https://avatars.githubusercontent.com/u/207358?v=4" width="110px;"/><br /><sub>Peter Sarossy</sub>](https://github.com/psarossy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=psarossy "Code") |
| [<img src="https://avatars.githubusercontent.com/u/11823649?v=4" width="110px;"/><br /><sub>Renee Margaret McConahy</sub>](https://github.com/nepella)<br />[💻](https://github.com/snipe/snipe-it/commits?author=nepella "Code") | [<img src="https://avatars.githubusercontent.com/u/5553884?v=4" width="110px;"/><br /><sub>JohnnyPicnic</sub>](https://github.com/JohnnyPicnic)<br />[💻](https://github.com/snipe/snipe-it/commits?author=JohnnyPicnic "Code") | [<img src="https://avatars.githubusercontent.com/u/8799594?v=4" width="110px;"/><br /><sub>markbrule</sub>](https://github.com/markbrule)<br />[💻](https://github.com/snipe/snipe-it/commits?author=markbrule "Code") | [<img src="https://avatars.githubusercontent.com/u/1962801?v=4" width="110px;"/><br /><sub>Mike Campbell</sub>](https://github.com/mikecmpbll)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mikecmpbll "Code") | [<img src="https://avatars.githubusercontent.com/u/11973217?v=4" width="110px;"/><br /><sub>tbrconnect</sub>](https://github.com/tbrconnect)<br />[💻](https://github.com/snipe/snipe-it/commits?author=tbrconnect "Code") | [<img src="https://avatars.githubusercontent.com/u/12447225?v=4" width="110px;"/><br /><sub>kcoyo</sub>](https://github.com/kcoyo)<br />[💻](https://github.com/snipe/snipe-it/commits?author=kcoyo "Code") | [<img src="https://avatars.githubusercontent.com/u/494017?v=4" width="110px;"/><br /><sub>Travis Miller</sub>](https://travismiller.com/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=travismiller "Code") |
+| [<img src="https://avatars.githubusercontent.com/u/8735148?v=4" width="110px;"/><br /><sub>Petri Asikainen</sub>](https://github.com/PetriAsi)<br />[💻](https://github.com/snipe/snipe-it/commits?author=PetriAsi "Code") | [<img src="https://avatars.githubusercontent.com/u/11424540?v=4" width="110px;"/><br /><sub>derdeagle</sub>](https://github.com/derdeagle)<br />[💻](https://github.com/snipe/snipe-it/commits?author=derdeagle "Code") | [<img src="https://avatars.githubusercontent.com/u/176950?v=4" width="110px;"/><br /><sub>Mike Frysinger</sub>](https://wh0rd.org/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=vapier "Code") |
+ | [<img src="https://avatars.githubusercontent.com/u/1975640?v=4" width="110px;"/><br /><sub>Evan Taylor</sub>](https://github.com/Delta5)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Delta5 "Code") |
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
diff --cc app/Console/Commands/RestoreFromBackup.php
index 06c99ec08c,d1b934e9cd..8f8114229e
--- a/app/Console/Commands/RestoreFromBackup.php
+++ b/app/Console/Commands/RestoreFromBackup.php
@@@ -61,24 -60,23 +60,23 @@@ class RestoreFromBackup extends Comman
$za = new ZipArchive();
- $errcode = $za->open($filename, ZipArchive::RDONLY);
+ $errcode = $za->open($filename/* , ZipArchive::RDONLY */); // that constant only exists in PHP 7.4 and higher
if ($errcode !== true) {
$errors = [
- ZipArchive::ER_EXISTS => "File already exists.",
- ZipArchive::ER_INCONS => "Zip archive inconsistent.",
- ZipArchive::ER_INVAL => "Invalid argument.",
- ZipArchive::ER_MEMORY => "Malloc failure.",
- ZipArchive::ER_NOENT => "No such file.",
- ZipArchive::ER_NOZIP => "Not a zip archive.",
+ ZipArchive::ER_EXISTS => 'File already exists.',
+ ZipArchive::ER_INCONS => 'Zip archive inconsistent.',
+ ZipArchive::ER_INVAL => 'Invalid argument.',
+ ZipArchive::ER_MEMORY => 'Malloc failure.',
+ ZipArchive::ER_NOENT => 'No such file.',
+ ZipArchive::ER_NOZIP => 'Not a zip archive.',
ZipArchive::ER_OPEN => "Can't open file.",
- ZipArchive::ER_READ => "Read error.",
- ZipArchive::ER_SEEK => "Seek error."
+ ZipArchive::ER_READ => 'Read error.',
+ ZipArchive::ER_SEEK => 'Seek error.',
];
- return $this->error("Could not access file: ".$filename." - ".array_key_exists($errcode,$errors) ? $errors[$errcode] : " Unknown reason: $errcode");
+ return $this->error('Could not access file: '.$filename.' - '.array_key_exists($errcode, $errors) ? $errors[$errcode] : " Unknown reason: $errcode");
}
-
$private_dirs = [
'storage/private_uploads/assets', // these are asset _files_, not the pictures.
'storage/private_uploads/audits',
@@@ -248,22 -248,17 +248,22 @@@
}
fclose($pipes[0]);
fclose($sql_contents);
+
+ $this->line(stream_get_contents($pipes[1]));
fclose($pipes[1]);
+
+ $this->error(stream_get_contents($pipes[2]));
fclose($pipes[2]);
+
//wait, have to do fclose() on all pipes first?
$close_results = proc_close($proc_results);
- if($close_results != 0) {
- return $this->error("There may have been a problem with the database import: Error number ".$close_results);
+ if ($close_results != 0) {
+ return $this->error('There may have been a problem with the database import: Error number '.$close_results);
}
-
+
//and now copy the files over too (right?)
//FIXME - we don't prune the filesystem space yet!!!!
- if($this->option('no-progress')) {
+ if ($this->option('no-progress')) {
$bar = null;
} else {
$bar = $this->output->createProgressBar(count($interesting_files));
diff --cc app/Helpers/Helper.php
index d331ea36f5,bda5eba325..f67f676313
--- a/app/Helpers/Helper.php
+++ b/app/Helpers/Helper.php
@@@ -66,278 -64,275 +65,277 @@@ class Helpe
public static function defaultChartColors($index = 0)
{
$colors = [
- "#008941",
- "#FF851B",
- "#006FA6",
- "#A30059",
- "#1CE6FF",
- "#FFDBE5",
- "#7A4900",
- "#0000A6",
- "#63FFAC",
- "#B79762",
- "#004D43",
- "#8FB0FF",
- "#997D87",
- "#5A0007",
- "#809693",
- "#FEFFE6",
- "#1B4400",
- "#4FC601",
- "#3B5DFF",
- "#4A3B53",
- "#FF2F80",
- "#61615A",
- "#BA0900",
- "#6B7900",
- "#00C2A0",
- "#FFAA92",
- "#FF90C9",
- "#B903AA",
- "#D16100",
- "#DDEFFF",
- "#000035",
- "#7B4F4B",
- "#A1C299",
- "#300018",
- "#0AA6D8",
- "#013349",
- "#00846F",
- "#372101",
- "#FFB500",
- "#C2FFED",
- "#A079BF",
- "#CC0744",
- "#C0B9B2",
- "#C2FF99",
- "#001E09",
- "#00489C",
- "#6F0062",
- "#0CBD66",
- "#EEC3FF",
- "#456D75",
- "#B77B68",
- "#7A87A1",
- "#788D66",
- "#885578",
- "#FAD09F",
- "#FF8A9A",
- "#D157A0",
- "#BEC459",
- "#456648",
- "#0086ED",
- "#886F4C",
- "#34362D",
- "#B4A8BD",
- "#00A6AA",
- "#452C2C",
- "#636375",
- "#A3C8C9",
- "#FF913F",
- "#938A81",
- "#575329",
- "#00FECF",
- "#B05B6F",
- "#8CD0FF",
- "#3B9700",
- "#04F757",
- "#C8A1A1",
- "#1E6E00",
- "#7900D7",
- "#A77500",
- "#6367A9",
- "#A05837",
- "#6B002C",
- "#772600",
- "#D790FF",
- "#9B9700",
- "#549E79",
- "#FFF69F",
- "#201625",
- "#72418F",
- "#BC23FF",
- "#99ADC0",
- "#3A2465",
- "#922329",
- "#5B4534",
- "#FDE8DC",
- "#404E55",
- "#0089A3",
- "#CB7E98",
- "#A4E804",
- "#324E72",
- "#6A3A4C",
- "#83AB58",
- "#001C1E",
- "#D1F7CE",
- "#004B28",
- "#C8D0F6",
- "#A3A489",
- "#806C66",
- "#222800",
- "#BF5650",
- "#E83000",
- "#66796D",
- "#DA007C",
- "#FF1A59",
- "#8ADBB4",
- "#1E0200",
- "#5B4E51",
- "#C895C5",
- "#320033",
- "#FF6832",
- "#66E1D3",
- "#CFCDAC",
- "#D0AC94",
- "#7ED379",
- "#012C58",
- "#7A7BFF",
- "#D68E01",
- "#353339",
- "#78AFA1",
- "#FEB2C6",
- "#75797C",
- "#837393",
- "#943A4D",
- "#B5F4FF",
- "#D2DCD5",
- "#9556BD",
- "#6A714A",
- "#001325",
- "#02525F",
- "#0AA3F7",
- "#E98176",
- "#DBD5DD",
- "#5EBCD1",
- "#3D4F44",
- "#7E6405",
- "#02684E",
- "#962B75",
- "#8D8546",
- "#9695C5",
- "#E773CE",
- "#D86A78",
- "#3E89BE",
- "#CA834E",
- "#518A87",
- "#5B113C",
- "#55813B",
- "#E704C4",
- "#00005F",
- "#A97399",
- "#4B8160",
- "#59738A",
- "#FF5DA7",
- "#F7C9BF",
- "#643127",
- "#513A01",
- "#6B94AA",
- "#51A058",
- "#A45B02",
- "#1D1702",
- "#E20027",
- "#E7AB63",
- "#4C6001",
- "#9C6966",
- "#64547B",
- "#97979E",
- "#006A66",
- "#391406",
- "#F4D749",
- "#0045D2",
- "#006C31",
- "#DDB6D0",
- "#7C6571",
- "#9FB2A4",
- "#00D891",
- "#15A08A",
- "#BC65E9",
- "#FFFFFE",
- "#C6DC99",
- "#203B3C",
- "#671190",
- "#6B3A64",
- "#F5E1FF",
- "#FFA0F2",
- "#CCAA35",
- "#374527",
- "#8BB400",
- "#797868",
- "#C6005A",
- "#3B000A",
- "#C86240",
- "#29607C",
- "#402334",
- "#7D5A44",
- "#CCB87C",
- "#B88183",
- "#AA5199",
- "#B5D6C3",
- "#A38469",
- "#9F94F0",
- "#A74571",
- "#B894A6",
- "#71BB8C",
- "#00B433",
- "#789EC9",
- "#6D80BA",
- "#953F00",
- "#5EFF03",
- "#E4FFFC",
- "#1BE177",
- "#BCB1E5",
- "#76912F",
- "#003109",
- "#0060CD",
- "#D20096",
- "#895563",
- "#29201D",
- "#5B3213",
- "#A76F42",
- "#89412E",
- "#1A3A2A",
- "#494B5A",
- "#A88C85",
- "#F4ABAA",
- "#A3F3AB",
- "#00C6C8",
- "#EA8B66",
- "#958A9F",
- "#BDC9D2",
- "#9FA064",
- "#BE4700",
- "#658188",
- "#83A485",
- "#453C23",
- "#47675D",
- "#3A3F00",
- "#061203",
- "#DFFB71",
- "#868E7E",
- "#98D058",
- "#6C8F7D",
- "#D7BFC2",
- "#3C3E6E",
- "#D83D66",
- "#2F5D9B",
- "#6C5E46",
- "#D25B88",
- "#5B656C",
- "#00B57F",
- "#545C46",
- "#866097",
- "#365D25",
- "#252F99",
- "#00CCFF",
- "#674E60",
- "#FC009C",
- "#92896B",
+ '#008941',
+ '#FF4A46',
+ '#006FA6',
+ '#A30059',
+ '#1CE6FF',
+ '#FFDBE5',
+ '#7A4900',
+ '#0000A6',
+ '#63FFAC',
+ '#B79762',
+ '#004D43',
+ '#8FB0FF',
+ '#997D87',
+ '#5A0007',
+ '#809693',
+ '#FEFFE6',
+ '#1B4400',
+ '#4FC601',
+ '#3B5DFF',
+ '#4A3B53',
+ '#FF2F80',
+ '#61615A',
+ '#BA0900',
+ '#6B7900',
+ '#00C2A0',
+ '#FFAA92',
+ '#FF90C9',
+ '#B903AA',
+ '#D16100',
+ '#DDEFFF',
+ '#000035',
+ '#7B4F4B',
+ '#A1C299',
+ '#300018',
+ '#0AA6D8',
+ '#013349',
+ '#00846F',
+ '#372101',
+ '#FFB500',
+ '#C2FFED',
+ '#A079BF',
+ '#CC0744',
+ '#C0B9B2',
+ '#C2FF99',
+ '#001E09',
+ '#00489C',
+ '#6F0062',
+ '#0CBD66',
+ '#EEC3FF',
+ '#456D75',
+ '#B77B68',
+ '#7A87A1',
+ '#788D66',
+ '#885578',
+ '#FAD09F',
+ '#FF8A9A',
+ '#D157A0',
+ '#BEC459',
+ '#456648',
+ '#0086ED',
+ '#886F4C',
+ '#34362D',
+ '#B4A8BD',
+ '#00A6AA',
+ '#452C2C',
+ '#636375',
+ '#A3C8C9',
+ '#FF913F',
+ '#938A81',
+ '#575329',
+ '#00FECF',
+ '#B05B6F',
+ '#8CD0FF',
+ '#3B9700',
+ '#04F757',
+ '#C8A1A1',
+ '#1E6E00',
+ '#7900D7',
+ '#A77500',
+ '#6367A9',
+ '#A05837',
+ '#6B002C',
+ '#772600',
+ '#D790FF',
+ '#9B9700',
+ '#549E79',
+ '#FFF69F',
+ '#201625',
+ '#72418F',
+ '#BC23FF',
+ '#99ADC0',
+ '#3A2465',
+ '#922329',
+ '#5B4534',
+ '#FDE8DC',
+ '#404E55',
+ '#0089A3',
+ '#CB7E98',
+ '#A4E804',
+ '#324E72',
+ '#6A3A4C',
+ '#83AB58',
+ '#001C1E',
+ '#D1F7CE',
+ '#004B28',
+ '#C8D0F6',
+ '#A3A489',
+ '#806C66',
+ '#222800',
+ '#BF5650',
+ '#E83000',
+ '#66796D',
+ '#DA007C',
+ '#FF1A59',
+ '#8ADBB4',
+ '#1E0200',
+ '#5B4E51',
+ '#C895C5',
+ '#320033',
+ '#FF6832',
+ '#66E1D3',
+ '#CFCDAC',
+ '#D0AC94',
+ '#7ED379',
+ '#012C58',
+ '#7A7BFF',
+ '#D68E01',
+ '#353339',
+ '#78AFA1',
+ '#FEB2C6',
+ '#75797C',
+ '#837393',
+ '#943A4D',
+ '#B5F4FF',
+ '#D2DCD5',
+ '#9556BD',
+ '#6A714A',
+ '#001325',
+ '#02525F',
+ '#0AA3F7',
+ '#E98176',
+ '#DBD5DD',
+ '#5EBCD1',
+ '#3D4F44',
+ '#7E6405',
+ '#02684E',
+ '#962B75',
+ '#8D8546',
+ '#9695C5',
+ '#E773CE',
+ '#D86A78',
+ '#3E89BE',
+ '#CA834E',
+ '#518A87',
+ '#5B113C',
+ '#55813B',
+ '#E704C4',
+ '#00005F',
+ '#A97399',
+ '#4B8160',
+ '#59738A',
+ '#FF5DA7',
+ '#F7C9BF',
+ '#643127',
+ '#513A01',
+ '#6B94AA',
+ '#51A058',
+ '#A45B02',
+ '#1D1702',
+ '#E20027',
+ '#E7AB63',
+ '#4C6001',
+ '#9C6966',
+ '#64547B',
+ '#97979E',
+ '#006A66',
+ '#391406',
+ '#F4D749',
+ '#0045D2',
+ '#006C31',
+ '#DDB6D0',
+ '#7C6571',
+ '#9FB2A4',
+ '#00D891',
+ '#15A08A',
+ '#BC65E9',
+ '#FFFFFE',
+ '#C6DC99',
+ '#203B3C',
+ '#671190',
+ '#6B3A64',
+ '#F5E1FF',
+ '#FFA0F2',
+ '#CCAA35',
+ '#374527',
+ '#8BB400',
+ '#797868',
+ '#C6005A',
+ '#3B000A',
+ '#C86240',
+ '#29607C',
+ '#402334',
+ '#7D5A44',
+ '#CCB87C',
+ '#B88183',
+ '#AA5199',
+ '#B5D6C3',
+ '#A38469',
+ '#9F94F0',
+ '#A74571',
+ '#B894A6',
+ '#71BB8C',
+ '#00B433',
+ '#789EC9',
+ '#6D80BA',
+ '#953F00',
+ '#5EFF03',
+ '#E4FFFC',
+ '#1BE177',
+ '#BCB1E5',
+ '#76912F',
+ '#003109',
+ '#0060CD',
+ '#D20096',
+ '#895563',
+ '#29201D',
+ '#5B3213',
+ '#A76F42',
+ '#89412E',
+ '#1A3A2A',
+ '#494B5A',
+ '#A88C85',
+ '#F4ABAA',
+ '#A3F3AB',
+ '#00C6C8',
+ '#EA8B66',
+ '#958A9F',
+ '#BDC9D2',
+ '#9FA064',
+ '#BE4700',
+ '#658188',
+ '#83A485',
+ '#453C23',
+ '#47675D',
+ '#3A3F00',
+ '#061203',
+ '#DFFB71',
+ '#868E7E',
+ '#98D058',
+ '#6C8F7D',
+ '#D7BFC2',
+ '#3C3E6E',
+ '#D83D66',
+ '#2F5D9B',
+ '#6C5E46',
+ '#D25B88',
+ '#5B656C',
+ '#00B57F',
+ '#545C46',
+ '#866097',
+ '#365D25',
+ '#252F99',
+ '#00CCFF',
+ '#674E60',
+ '#FC009C',
+ '#92896B',
];
+
+
return $colors[$index];
-
}
/**
@@@ -799,19 -780,16 +784,16 @@@
} catch (DecryptException $e) {
return 'Error Decrypting: '.$e->getMessage();
}
- }
++ }
- }
return $string;
-
}
-
+ public static function formatStandardApiResponse($status, $payload = null, $messages = null)
+
-
-
- public static function formatStandardApiResponse($status, $payload = null, $messages = null) {
-
+ {
$array['status'] = $status;
$array['messages'] = $messages;
- if (($messages) && (is_array($messages)) && (count($messages) > 0)) {
+ if (($messages) && (is_array($messages)) && (count($messages) > 0)) {
$array['messages'] = $messages;
}
($payload) ? $array['payload'] = $payload : $array['payload'] = null;
@@@ -889,9 -868,8 +872,9 @@@
// If upload_max_size is less, then reduce. Except if upload_max_size is
// zero, which indicates no limit.
- $upload_max = Helper::parse_size(ini_get('upload_max_filesize'));
+ $upload_max = self::parse_size(ini_get('upload_max_filesize'));
- if ($upload_max > 0 && $upload_max < $max_size) {
+
+ if ($upload_max > 0 && $upload_max < $post_max_size) {
$max_size = ini_get('upload_max_filesize');
}
}
diff --cc app/Http/Controllers/Api/AccessoriesController.php
index 5ff8622f41,7096f388d2..4ff90b837b
--- a/app/Http/Controllers/Api/AccessoriesController.php
+++ b/app/Http/Controllers/Api/AccessoriesController.php
@@@ -27,23 -27,9 +27,24 @@@ class AccessoriesController extends Con
public function index(Request $request)
{
$this->authorize('view', Accessory::class);
+ $allowed_columns = ['id', 'name', 'model_number', 'eol', 'notes', 'created_at', 'min_amt', 'company_id'];
-
- $accessories = Accessory::with('category', 'company', 'manufacturer', 'users', 'location');
+
+ // This array is what determines which fields should be allowed to be sorted on ON the table itself, no relations
+ // Relations will be handled in query scopes a little further down.
+ $allowed_columns =
+ [
+ 'id',
+ 'name',
+ 'model_number',
+ 'eol',
+ 'notes',
+ 'created_at',
+ 'min_amt',
+ 'company_id'
+ ];
+
+
+ $accessories = Accessory::select('accessories.*')->with('category', 'company', 'manufacturer', 'users', 'location', 'supplier');
if ($request->filled('search')) {
$accessories = $accessories->TextSearch($request->input('search'));
@@@ -62,13 -48,9 +63,13 @@@
}
if ($request->filled('supplier_id')) {
- $accessories->where('supplier_id','=',$request->input('supplier_id'));
+ $accessories->where('supplier_id', '=', $request->input('supplier_id'));
}
+ if ($request->filled('location_id')) {
+ $accessories->where('location_id','=',$request->input('location_id'));
+ }
+
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($accessories) && ($request->get('offset') > $accessories->count())) ? $accessories->count() : $request->get('offset', 0);
@@@ -87,23 -68,16 +88,23 @@@
case 'company':
$accessories = $accessories->OrderCompany($order);
break;
+ case 'location':
+ $accessories = $accessories->OrderLocation($order);
+ break;
+ case 'manufacturer':
+ $accessories = $accessories->OrderManufacturer($order);
+ break;
+ case 'supplier':
+ $accessories = $accessories->OrderSupplier($order);
+ break;
default:
- $accessories = $accessories->orderBy($sort, $order);
+ $accessories = $accessories->orderBy($column_sort, $order);
break;
}
--
-
- $accessories->orderBy($sort, $order);
-
++
$total = $accessories->count();
$accessories = $accessories->skip($offset)->take($limit)->get();
+
return (new AccessoriesTransformer)->transformAccessories($accessories, $total);
}
@@@ -126,8 -98,8 +127,9 @@@
if ($accessory->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $accessory, trans('admin/accessories/message.create.success')));
}
+
return response()->json(Helper::formatStandardApiResponse('error', null, $accessory->getErrors()));
+
}
/**
@@@ -249,11 -216,10 +253,11 @@@
}
$accessory->delete();
- return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.delete.success')));
+ return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.delete.success')));
}
+
/**
* Save the Accessory checkout information.
*
@@@ -273,10 -239,8 +277,10 @@@
$this->authorize('checkout', $accessory);
+
if ($accessory->numRemaining() > 0) {
+
- if (!$user = User::find($request->input('assigned_to'))) {
+ if (! $user = User::find($request->input('assigned_to'))) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.checkout.user_does_not_exist')));
}
@@@ -336,26 -299,22 +340,26 @@@
$data['item_tag'] = '';
$data['note'] = $logaction->note;
- return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.checkin.success')));
+ return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.checkin.success')));
}
- return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.checkin.error')));
+ return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.checkin.error')));
+
}
+
/**
- * Gets a paginated collection for the select2 menus
- *
- * @see \App\Http\Transformers\SelectlistTransformer
- */
+ * Gets a paginated collection for the select2 menus
+ *
+ * @see \App\Http\Transformers\SelectlistTransformer
+ *
+ */
public function selectlist(Request $request)
{
+
$accessories = Accessory::select([
'accessories.id',
- 'accessories.name'
+ 'accessories.name',
]);
if ($request->filled('search')) {
@@@ -364,10 -323,6 +368,7 @@@
$accessories = $accessories->orderBy('name', 'ASC')->paginate(50);
-
return (new SelectlistTransformer)->transformSelectlist($accessories);
}
+
-
-
}
diff --cc app/Http/Controllers/Api/AssetsController.php
index 7a333e7086,0cfef5eb99..f03f242a50
--- a/app/Http/Controllers/Api/AssetsController.php
+++ b/app/Http/Controllers/Api/AssetsController.php
@@@ -1,8 -1,7 +1,9 @@@
<?php
+
namespace App\Http\Controllers\Api;
+use App\Events\CheckoutableCheckedIn;
+use Illuminate\Support\Facades\Gate;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Requests\AssetCheckoutRequest;
@@@ -30,9 -28,7 +32,8 @@@ use Slack
use Str;
use TCPDF;
use Validator;
+use Route;
-
/**
* This class controls all actions related to assets for
* the Snipe-IT Asset Management application.
@@@ -254,17 -221,16 +249,17 @@@ class AssetsController extends Controll
->where('status_alias.archived', '=', 0);
});
- // If there is a status ID, don't take show_archived_in_list into consideration
+ // If there is a status ID, don't take show_archived_in_list into consideration
} else {
- $assets->join('status_labels AS status_alias',function ($join) {
- $join->on('status_alias.id', "=", "assets.status_id");
+ $assets->join('status_labels AS status_alias', function ($join) {
+ $join->on('status_alias.id', '=', 'assets.status_id');
});
}
}
+
- if ((!is_null($filter)) && (count($filter)) > 0) {
+ if ((! is_null($filter)) && (count($filter)) > 0) {
$assets->ByFilter($filter);
} elseif ($request->filled('search')) {
$assets->TextSearch($request->input('search'));
@@@ -316,18 -280,12 +311,17 @@@
break;
}
+
$total = $assets->count();
$assets = $assets->skip($offset)->take($limit)->get();
- // dd($assets);
- return (new AssetsTransformer)->transformAssets($assets, $total);
+
+ /**
+ * Here we're just determining which Transformer (via $transformer) to use based on the
+ * variables we set earlier on in this method - we default to AssetsTransformer.
+ */
+ return (new $transformer)->transformAssets($assets, $total);
}
-
/**
* Returns JSON with information about an asset (by tag) for detail view.
*
@@@ -358,14 -317,13 +353,14 @@@
{
$this->authorize('index', Asset::class);
if ($assets = Asset::with('assetstatus')->with('assignedTo')
- ->withTrashed()->where('serial',$serial)->get()) {
+ ->withTrashed()->where('serial', $serial)->get()) {
- return (new AssetsTransformer)->transformAssets($assets, $assets->count());
+ return (new AssetsTransformer)->transformAssets($assets, $assets->count());
}
- return response()->json(Helper::formatStandardApiResponse('error', null, 'Asset not found'), 200);
+ return response()->json(Helper::formatStandardApiResponse('error', null, 'Asset not found'), 200);
}
+
/**
* Returns JSON with information about an asset for detail view.
*
@@@ -379,20 -337,20 +374,23 @@@
if ($asset = Asset::with('assetstatus')->with('assignedTo')->withTrashed()
->withCount('checkins as checkins_count', 'checkouts as checkouts_count', 'userRequests as user_requests_count')->findOrFail($id)) {
$this->authorize('view', $asset);
+
return (new AssetsTransformer)->transformAsset($asset);
}
+
+
}
+
public function licenses($id)
{
$this->authorize('view', Asset::class);
$this->authorize('view', License::class);
$asset = Asset::where('id', $id)->withTrashed()->first();
$licenses = $asset->licenses()->get();
+
return (new LicensesTransformer())->transformLicenses($licenses, $licenses->count());
- }
+ }
+
/**
* Gets a paginated collection for the select2 menus
@@@ -438,9 -391,8 +436,9 @@@
$asset->use_text .= ' → '.$asset->assigned->getFullNameAttribute();
}
+
- if ($asset->assetstatus->getStatuslabelType()=='pending') {
- $asset->use_text .= '('.$asset->assetstatus->getStatuslabelType().')';
+ if ($asset->assetstatus->getStatuslabelType() == 'pending') {
+ $asset->use_text .= '('.$asset->assetstatus->getStatuslabelType().')';
}
$asset->use_image = ($asset->getImageUrl()) ? $asset->getImageUrl() : null;
@@@ -467,27 -416,27 +462,27 @@@
$asset = new Asset();
$asset->model()->associate(AssetModel::find((int) $request->get('model_id')));
- $asset->name = $request->get('name');
- $asset->serial = $request->get('serial');
- $asset->company_id = Company::getIdForCurrentUser($request->get('company_id'));
- $asset->model_id = $request->get('model_id');
- $asset->order_number = $request->get('order_number');
- $asset->notes = $request->get('notes');
- $asset->asset_tag = $request->get('asset_tag', Asset::autoincrement_asset());
- $asset->user_id = Auth::id();
- $asset->archived = '0';
- $asset->physical = '1';
- $asset->depreciate = '0';
- $asset->status_id = $request->get('status_id', 0);
- $asset->warranty_months = $request->get('warranty_months', null);
- $asset->purchase_cost = Helper::ParseFloat($request->get('purchase_cost'));
- $asset->purchase_date = $request->get('purchase_date', null);
- $asset->assigned_to = $request->get('assigned_to', null);
- $asset->supplier_id = $request->get('supplier_id', 0);
- $asset->requestable = $request->get('requestable', 0);
- $asset->rtd_location_id = $request->get('rtd_location_id', null);
- $asset->location_id = $request->get('rtd_location_id', null);
+ $asset->name = $request->get('name');
+ $asset->serial = $request->get('serial');
+ $asset->company_id = Company::getIdForCurrentUser($request->get('company_id'));
+ $asset->model_id = $request->get('model_id');
+ $asset->order_number = $request->get('order_number');
+ $asset->notes = $request->get('notes');
+ $asset->asset_tag = $request->get('asset_tag', Asset::autoincrement_asset());
+ $asset->user_id = Auth::id();
+ $asset->archived = '0';
+ $asset->physical = '1';
+ $asset->depreciate = '0';
+ $asset->status_id = $request->get('status_id', 0);
+ $asset->warranty_months = $request->get('warranty_months', null);
+ $asset->purchase_cost = Helper::ParseFloat($request->get('purchase_cost'));
+ $asset->purchase_date = $request->get('purchase_date', null);
+ $asset->assigned_to = $request->get('assigned_to', null);
+ $asset->supplier_id = $request->get('supplier_id', 0);
+ $asset->requestable = $request->get('requestable', 0);
+ $asset->rtd_location_id = $request->get('rtd_location_id', null);
+ $asset->location_id = $request->get('rtd_location_id', null);
-
+
/**
* this is here just legacy reasons. Api\AssetController
* used image_source once to allow encoded image uploads.
@@@ -530,9 -478,7 +524,8 @@@
}
}
+
$asset->{$field->convertUnicodeDbSlug()} = $field_val;
-
}
}
@@@ -610,11 -554,9 +601,10 @@@
}
}
+
if ($asset->save()) {
-
if (($request->filled('assigned_user')) && ($target = User::find($request->get('assigned_user')))) {
- $location = $target->location_id;
+ $location = $target->location_id;
} elseif (($request->filled('assigned_asset')) && ($target = Asset::find($request->get('assigned_asset')))) {
$location = $target->location_id;
@@@ -669,41 -610,6 +659,39 @@@
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')), 200);
}
-
-
+ /**
+ * Restore a soft-deleted asset.
+ *
+ * @author [A. Gianotto] [<[email protected]>]
+ * @param int $assetId
+ * @since [v5.1.18]
+ * @return JsonResponse
+ */
+ public function restore($assetId = null)
+ {
+ // Get asset information
+ $asset = Asset::withTrashed()->find($assetId);
+ $this->authorize('delete', $asset);
+ if (isset($asset->id)) {
+ // Restore the asset
+ Asset::withTrashed()->where('id', $assetId)->restore();
+
+ $logaction = new Actionlog();
+ $logaction->item_type = Asset::class;
+ $logaction->item_id = $asset->id;
+ $logaction->created_at = date("Y-m-d H:i:s");
+ $logaction->user_id = Auth::user()->id;
+ $logaction->logaction('restored');
+
+ return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/hardware/message.restore.success')));
+
+
+ }
+ return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')), 200);
+ }
+
+
+
/**
* Checkout an asset
*
@@@ -729,23 -635,20 +717,23 @@@
'asset_tag' => $asset->asset_tag,
];
+
// This item is checked out to a location
- if (request('checkout_to_type')=='location') {
+ if (request('checkout_to_type') == 'location') {
$target = Location::find(request('assigned_location'));
$asset->location_id = ($target) ? $target->id : '';
$error_payload['target_id'] = $request->input('assigned_location');
$error_payload['target_type'] = 'location';
+
- } elseif (request('checkout_to_type')=='asset') {
- $target = Asset::where('id','!=',$asset_id)->find(request('assigned_asset'));
+ } elseif (request('checkout_to_type') == 'asset') {
+ $target = Asset::where('id', '!=', $asset_id)->find(request('assigned_asset'));
$asset->location_id = $target->rtd_location_id;
// Override with the asset's location_id if it has one
$asset->location_id = (($target) && (isset($target->location_id))) ? $target->location_id : '';
$error_payload['target_id'] = $request->input('assigned_asset');
$error_payload['target_type'] = 'asset';
+
- } elseif (request('checkout_to_type')=='user') {
+ } elseif (request('checkout_to_type') == 'user') {
// Fetch the target and set the asset's new location_id
$target = User::find(request('assigned_user'));
$asset->location_id = (($target) && (isset($target->location_id))) ? $target->location_id : '';
@@@ -753,15 -656,11 +741,15 @@@
$error_payload['target_type'] = 'user';
}
+
+
- if (!isset($target)) {
+ if (! isset($target)) {
return response()->json(Helper::formatStandardApiResponse('error', $error_payload, 'Checkout target for asset '.e($asset->asset_tag).' is invalid - '.$error_payload['target_type'].' does not exist.'));
}
+
+
- $checkout_at = request('checkout_at', date("Y-m-d H:i:s"));
+ $checkout_at = request('checkout_at', date('Y-m-d H:i:s'));
$expected_checkin = request('expected_checkin', null);
$note = request('note', null);
$asset_name = request('name', null);
@@@ -814,11 -708,11 +802,11 @@@
if ($request->filled('name')) {
$asset->name = $request->input('name');
}
-
+
- $asset->location_id = $asset->rtd_location_id;
+ $asset->location_id = $asset->rtd_location_id;
if ($request->filled('location_id')) {
- $asset->location_id = $request->input('location_id');
+ $asset->location_id = $request->input('location_id');
}
if ($request->has('status_id')) {
@@@ -843,15 -736,14 +831,16 @@@
* @since [v4.0]
* @return JsonResponse
*/
- public function audit(Request $request) {
+ public function audit(Request $request)
+ {
+
+
$this->authorize('audit', Asset::class);
- $rules = array(
+ $rules = [
'asset_tag' => 'required',
'location_id' => 'exists:locations,id|nullable|numeric',
- 'next_audit_date' => 'date|nullable'
- );
+ 'next_audit_date' => 'date|nullable',
+ ];
$validator = Validator::make($request->all(), $rules);
if ($validator->fails()) {
@@@ -861,9 -753,8 +850,9 @@@
$settings = Setting::getSettings();
$dt = Carbon::now()->addMonths($settings->audit_interval)->toDateString();
- $asset = Asset::where('asset_tag','=', $request->input('asset_tag'))->first();
+ $asset = Asset::where('asset_tag', '=', $request->input('asset_tag'))->first();
+
if ($asset) {
// We don't want to log this as a normal update, so let's bypass that
$asset->unsetEventDispatcher();
diff --cc app/Http/Controllers/Api/CategoriesController.php
index 9b4fa51349,8c8bb317e2..b1e36b29e0
--- a/app/Http/Controllers/Api/CategoriesController.php
+++ b/app/Http/Controllers/Api/CategoriesController.php
@@@ -45,11 -45,10 +45,11 @@@ class CategoriesController extends Cont
$total = $categories->count();
$categories = $categories->skip($offset)->take($limit)->get();
+
return (new CategoriesTransformer)->transformCategories($categories, $total);
+
}
-
/**
* Store a newly created resource in storage.
*
diff --cc app/Http/Controllers/Api/ComponentsController.php
index ccd23570ed,493ef1e09a..b9712b2788
--- a/app/Http/Controllers/Api/ComponentsController.php
+++ b/app/Http/Controllers/Api/ComponentsController.php
@@@ -195,121 -175,7 +197,122 @@@ class ComponentsController extends Cont
$limit = $request->input('limit', 50);
$total = $assets->count();
$assets = $assets->skip($offset)->take($limit)->get();
+
return (new ComponentsTransformer)->transformCheckedoutComponents($assets, $total);
}
+
+
+ /**
+ * Validate and checkout the component.
+ *
+ * @author [A. Gianotto] [<[email protected]>]
+ * t
+ * @since [v5.1.8]
+ * @param Request $request
+ * @param int $componentId
+ * @return \Illuminate\Http\RedirectResponse
+ * @throws \Illuminate\Auth\Access\AuthorizationException
+ */
+ public function checkout(Request $request, $componentId)
+ {
+ // Check if the component exists
+ if (is_null($component = Component::find($componentId))) {
+ return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/components/message.does_not_exist')));
+ }
+
+ $this->authorize('checkout', $component);
+
+
+ if ($component->numRemaining() > $request->get('assigned_qty')) {
+
+ if (!$asset = Asset::find($request->input('assigned_to'))) {
+ return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')));
+ }
+
+ // Update the accessory data
+ $component->assigned_to = $request->input('assigned_to');
+
+ $component->assets()->attach($component->id, [
+ 'component_id' => $component->id,
+ 'created_at' => \Carbon::now(),
+ 'assigned_qty' => $request->get('assigned_qty', 1),
+ 'user_id' => \Auth::id(),
+ 'asset_id' => $request->get('assigned_to')
+ ]);
+
+ $component->logCheckout($request->input('note'), $asset);
+
+ return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/components/message.checkout.success')));
+ }
+
+ return response()->json(Helper::formatStandardApiResponse('error', null, 'Not enough components remaining: '.$component->numRemaining().' remaining, '.$request->get('assigned_qty').' requested.'));
+ }
+
+ /**
+ * Validate and store checkin data.
+ *
+ * @author [A. Gianotto] [<[email protected]>]
+ * @since [v5.1.8]
+ * @param Request $request
+ * @param $component_asset_id
+ * @return \Illuminate\Http\RedirectResponse
+ * @throws \Illuminate\Auth\Access\AuthorizationException
+ */
+ public function checkin(Request $request, $component_asset_id)
+ {
+ if ($component_assets = \DB::table('components_assets')->find($component_asset_id)) {
+
+ if (is_null($component = Component::find($component_assets->component_id))) {
+
+ return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/components/message.not_found')));
+ }
+
+ $this->authorize('checkin', $component);
+
+ $max_to_checkin = $component_assets->assigned_qty;
+
+ if ($max_to_checkin > 1) {
+
+ $validator = \Validator::make($request->all(), [
+ "checkin_qty" => "required|numeric|between:1,$max_to_checkin"
+ ]);
+
+ if ($validator->fails()) {
+ return response()->json(Helper::formatStandardApiResponse('error', null, 'Checkin quantity must be between 1 and '.$max_to_checkin));
+ }
+ }
+
+
+ // Validation passed, so let's figure out what we have to do here.
+ $qty_remaining_in_checkout = ($component_assets->assigned_qty - (int)$request->input('checkin_qty', 1));
+
+ // We have to modify the record to reflect the new qty that's
+ // actually checked out.
+ $component_assets->assigned_qty = $qty_remaining_in_checkout;
+
+ \Log::debug($component_asset_id.' - '.$qty_remaining_in_checkout.' remaining in record '.$component_assets->id);
+
+ \DB::table('components_assets')->where('id',
+ $component_asset_id)->update(['assigned_qty' => $qty_remaining_in_checkout]);
+
+ // If the checked-in qty is exactly the same as the assigned_qty,
+ // we can simply delete the associated components_assets record
+ if ($qty_remaining_in_checkout == 0) {
+ \DB::table('components_assets')->where('id', '=', $component_asset_id)->delete();
+ }
+
+
+ $asset = Asset::find($component_assets->asset_id);
+
+ event(new CheckoutableCheckedIn($component, $asset, \Auth::user(), $request->input('note'), \Carbon::now()));
+
+ return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/components/message.checkin.success')));
+
+ }
+
+ return response()->json(Helper::formatStandardApiResponse('error', null, 'No matching checkouts for that component join record'));
+
+
+ }
+
}
diff --cc app/Http/Controllers/Api/ConsumablesController.php
index 913bc1bd51,7089905fb4..032cc402c0
--- a/app/Http/Controllers/Api/ConsumablesController.php
+++ b/app/Http/Controllers/Api/ConsumablesController.php
@@@ -59,22 -39,13 +59,22 @@@ class ConsumablesController extends Con
}
if ($request->filled('category_id')) {
- $consumables->where('category_id','=',$request->input('category_id'));
+ $consumables->where('category_id', '=', $request->input('category_id'));
}
+ if ($request->filled('model_number')) {
+ $consumables->where('model_number','=',$request->input('model_number'));
+ }
+
if ($request->filled('manufacturer_id')) {
- $consumables->where('manufacturer_id','=',$request->input('manufacturer_id'));
+ $consumables->where('manufacturer_id', '=', $request->input('manufacturer_id'));
}
+ if ($request->filled('location_id')) {
+ $consumables->where('location_id','=',$request->input('location_id'));
+ }
+
+
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($consumables) && ($request->get('offset') > $consumables->count())) ? $consumables->count() : $request->get('offset', 0);
@@@ -82,14 -53,11 +82,14 @@@
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
-
+ $allowed_columns = ['id', 'name', 'order_number', 'min_amt', 'purchase_date', 'purchase_cost', 'company', 'category', 'model_number', 'item_no', 'manufacturer', 'location', 'qty', 'image'];
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
- $sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
- switch ($sort) {
+ $sort_override = $request->input('sort');
+ $column_sort = in_array($sort_override, $allowed_columns) ? $sort_override : 'created_at';
+
+
+ switch ($sort_override) {
case 'category':
$consumables = $consumables->OrderCategory($order);
break;
@@@ -284,17 -251,15 +283,15 @@@
}
/**
- * Gets a paginated collection for the select2 menus
- *
- * @see \App\Http\Transformers\SelectlistTransformer
- */
+ * Gets a paginated collection for the select2 menus
+ *
+ * @see \App\Http\Transformers\SelectlistTransformer
- *
+ */
public function selectlist(Request $request)
{
-
$consumables = Consumable::select([
'consumables.id',
- 'consumables.name'
+ 'consumables.name',
]);
if ($request->filled('search')) {
diff --cc app/Http/Controllers/Api/LocationsController.php
index 6d70e7aaf1,2655113c23..0bcc01b37f
--- a/app/Http/Controllers/Api/LocationsController.php
+++ b/app/Http/Controllers/Api/LocationsController.php
@@@ -2,13 -2,13 +2,14 @@@
namespace App\Http\Controllers\Api;
- use Illuminate\Http\Request;
+ use App\Helpers\Helper;
+use App\Http\Requests\ImageUploadRequest;
use App\Http\Controllers\Controller;
- use App\Helpers\Helper;
- use App\Models\Location;
use App\Http\Transformers\LocationsTransformer;
use App\Http\Transformers\SelectlistTransformer;
+ use App\Models\Location;
+ use Illuminate\Http\Request;
+ use App\Http\Requests\ImageUploadRequest;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
diff --cc app/Http/Controllers/Api/StatuslabelsController.php
index 534c49a568,f3d1deabde..91fe02b803
--- a/app/Http/Controllers/Api/StatuslabelsController.php
+++ b/app/Http/Controllers/Api/StatuslabelsController.php
@@@ -68,13 -68,9 +69,13 @@@ class StatuslabelsController extends Co
$statuslabel->fill($request->all());
$statusType = Statuslabel::getStatuslabelTypesForDB($request->input('type'));
- $statuslabel->deployable = $statusType['deployable'];
- $statuslabel->pending = $statusType['pending'];
- $statuslabel->archived = $statusType['archived'];
+ $statuslabel->deployable = $statusType['deployable'];
+ $statuslabel->pending = $statusType['pending'];
+ $statuslabel->archived = $statusType['archived'];
+ $statuslabel->color = $request->input('color');
+ $statuslabel->show_in_nav = $request->input('show_in_nav', 0);
+ $statuslabel->default_label = $request->input('default_label');
+
if ($statuslabel->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $statuslabel, trans('admin/statuslabels/message.create.success')));
@@@ -112,20 -108,19 +113,22 @@@
{
$this->authorize('update', Statuslabel::class);
$statuslabel = Statuslabel::findOrFail($id);
-
+
- $request->except('deployable', 'pending','archived');
-
+ $request->except('deployable', 'pending', 'archived');
+ if (! $request->filled('type')) {
+ return response()->json(Helper::formatStandardApiResponse('error', null, 'Status label type is required.'));
+ }
$statuslabel->fill($request->all());
$statusType = Statuslabel::getStatuslabelTypesForDB($request->input('type'));
- $statuslabel->deployable = $statusType['deployable'];
- $statuslabel->pending = $statusType['pending'];
- $statuslabel->archived = $statusType['archived'];
+ $statuslabel->deployable = $statusType['deployable'];
+ $statuslabel->pending = $statusType['pending'];
+ $statuslabel->archived = $statusType['archived'];
+ $statuslabel->color = $request->input('color');
+ $statuslabel->show_in_nav = $request->input('show_in_nav');
+ $statuslabel->default_label = $request->input('default_label');
if ($statuslabel->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $statuslabel, trans('admin/statuslabels/message.update.success')));
@@@ -155,12 -151,9 +159,9 @@@
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/statuslabels/message.assoc_assets')));
-
}
-
-
- /**
+ /**
* Show a count of assets by status label for pie chart
*
* @author [A. Gianotto] [<[email protected]>]
@@@ -172,12 -164,15 +172,12 @@@
{
$this->authorize('view', Statuslabel::class);
- $statuslabels = Statuslabel::with('assets')
- ->groupBy('id')
- ->withCount('assets as assets_count')
- ->get();
+ $statuslabels = Statuslabel::withCount('assets')->get();
- $labels=[];
- $points=[];
+ $labels = [];
+ $points = [];
$default_color_count = 0;
- $colors_array = array();
+ $colors_array = [];
foreach ($statuslabels as $statuslabel) {
if ($statuslabel->assets_count > 0) {
diff --cc app/Http/Controllers/Api/SuppliersController.php
index 54784a4e37,f1dc550ca2..e5668b6baa
--- a/app/Http/Controllers/Api/SuppliersController.php
+++ b/app/Http/Controllers/Api/SuppliersController.php
@@@ -23,13 -23,12 +23,13 @@@ class SuppliersController extends Contr
public function index(Request $request)
{
$this->authorize('view', Supplier::class);
- $allowed_columns = ['id','name','address','phone','contact','fax','email','image','assets_count','licenses_count', 'accessories_count','url'];
+ $allowed_columns = ['id', 'name', 'address', 'phone', 'contact', 'fax', 'email', 'image', 'assets_count', 'licenses_count', 'accessories_count', 'url'];
-
+
$suppliers = Supplier::select(
- array('id','name','address','address2','city','state','country','fax', 'phone','email','contact','created_at','updated_at','deleted_at','image','notes')
+ ['id', 'name', 'address', 'address2', 'city', 'state', 'country', 'fax', 'phone', 'email', 'contact', 'created_at', 'updated_at', 'deleted_at', 'image', 'notes']
)->withCount('assets as assets_count')->withCount('licenses as licenses_count')->withCount('accessories as accessories_count');
+
if ($request->filled('search')) {
$suppliers = $suppliers->TextSearch($request->input('search'));
}
diff --cc app/Http/Controllers/Api/UsersController.php
index 6893480466,a3109f5d27..ed6ab5bd62
--- a/app/Http/Controllers/Api/UsersController.php
+++ b/app/Http/Controllers/Api/UsersController.php
@@@ -124,13 -95,9 +123,13 @@@ class UsersController extends Controlle
}
if ($request->filled('department_id')) {
- $users = $users->where('users.department_id','=',$request->input('department_id'));
+ $users = $users->where('users.department_id', '=', $request->input('department_id'));
}
+ if ($request->filled('manager_id')) {
+ $users = $users->where('users.manager_id','=',$request->input('manager_id'));
+ }
+
if ($request->filled('search')) {
$users = $users->TextSearch($request->input('search'));
}
diff --cc app/Http/Controllers/AssetMaintenancesController.php
index c9fb3340ee,c00e0ea455..b1c28ea26a
--- a/app/Http/Controllers/AssetMaintenancesController.php
+++ b/app/Http/Controllers/AssetMaintenancesController.php
@@@ -21,16 -22,15 +22,15 @@@ use View
*/
class AssetMaintenancesController extends Controller
{
-
/**
- * Checks for permissions for this action.
- *
- * @todo This should be replaced with middleware and/or policies
- * @author Vincent Sposato <[email protected]>
- * @version v1.0
- * @since [v1.8]
- * @return View
- */
+ * Checks for permissions for this action.
+ *
+ * @todo This should be replaced with middleware and/or policies
+ * @author Vincent Sposato <[email protected]>
+ * @version v1.0
+ * @since [v1.8]
+ * @return View
+ */
private static function getInsufficientPermissionsRedirect()
{
return redirect()->route('maintenances.index')
diff --cc app/Http/Controllers/Auth/ForgotPasswordController.php
index 7c0348c194,74f5df4c1a..4f7e40998a
--- a/app/Http/Controllers/Auth/ForgotPasswordController.php
+++ b/app/Http/Controllers/Auth/ForgotPasswordController.php
@@@ -109,8 -95,6 +103,6 @@@ class ForgotPasswordController extends
// Regardless of response, we do not want to disclose the status of a user account,
// so we give them a generic "If this exists, we're TOTALLY gonna email you" response
- return redirect()->route('login')->with('success',trans('passwords.sent'));
+ return redirect()->route('login')->with('success', trans('passwords.sent'));
- }
+ }
-
-
}
diff --cc app/Http/Controllers/Licenses/LicenseCheckinController.php
index 7fa7bb8136,9acbbf4bc5..d585e6714c
--- a/app/Http/Controllers/Licenses/LicenseCheckinController.php
+++ b/app/Http/Controllers/Licenses/LicenseCheckinController.php
@@@ -81,16 -80,11 +81,16 @@@ class LicenseCheckinController extends
// Ooops.. something went wrong
return redirect()->back()->withInput()->withErrors($validator);
}
- $return_to = User::find($licenseSeat->assigned_to);
+
+ if($licenseSeat->assigned_to != null){
+ $return_to = User::find($licenseSeat->assigned_to);
+ } else {
+ $return_to = Asset::find($licenseSeat->asset_id);
+ }
// Update the asset data
- $licenseSeat->assigned_to = null;
- $licenseSeat->asset_id = null;
+ $licenseSeat->assigned_to = null;
+ $licenseSeat->asset_id = null;
// Was the asset updated?
if ($licenseSeat->save()) {
diff --cc app/Http/Controllers/ReportsController.php
index a8c38d77ab,c514bb531e..fac4699bba
--- a/app/Http/Controllers/ReportsController.php
+++ b/app/Http/Controllers/ReportsController.php
@@@ -179,12 -186,10 +182,11 @@@ class ReportsController extends Control
$csv->insertOne($row);
}
- $csv->output('depreciation-report-' . date('Y-m-d') . '.csv');
+ $csv->output('depreciation-report-'.date('Y-m-d').'.csv');
die;
-
}
+
/**
* Displays audit report.
*
@@@ -245,67 -249,57 +247,60 @@@
'Changed',
];
- $executionTime = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
+ $executionTime = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
\Log::debug('Starting headers: '.$executionTime);
fputcsv($handle, $header);
- $executionTime = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
+ $executionTime = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
\Log::debug('Added headers: '.$executionTime);
- $actionlogs = Actionlog::with('item', 'user', 'target','location')
+ $actionlogs = Actionlog::with('item', 'user', 'target', 'location')
->orderBy('created_at', 'DESC')
- ->chunk(20, function($actionlogs) use($handle) {
-
- $executionTime = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
+ ->chunk(20, function ($actionlogs) use ($handle) {
+ $executionTime = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
- \Log::debug('Walking results: '.$executionTime);
- $count = 0;
+ \Log::debug('Walking results: '.$executionTime);
+ $count = 0;
- foreach ($actionlogs as $actionlog) {
- $count++;
- $target_name = '';
+ foreach ($actionlogs as $actionlog) {
-
+ $count++;
+ $target_name = '';
- if ($actionlog->target) {
+ if ($actionlog->target) {
- if ($actionlog->targetType()=='user') {
- $target_name = $actionlog->target->getFullNameAttribute();
+ if ($actionlog->targetType() == 'user') {
+ $target_name = $actionlog->target->getFullNameAttribute();
- } else {
- $target_name = $actionlog->target->getDisplayNameAttribute();
- }
+ } else {
+ $target_name = $actionlog->target->getDisplayNameAttribute();
}
+ }
+
- $row = [
+ $row = [
$actionlog->created_at,
($actionlog->user) ? e($actionlog->user->getFullNameAttribute()) : '',
$actionlog->present()->actionType(),
e($actionlog->itemType()),
- ($actionlog->itemType()=='user') ? $actionlog->filename : e($actionlog->item->getDisplayNameAttribute()),
+ ($actionlog->itemType() == 'user') ? $actionlog->filename : e($actionlog->item->getDisplayNameAttribute()),
$target_name,
- ($actionlog->note) ? e($actionlog->note): '',
+ ($actionlog->note) ? e($actionlog->note) : '',
$actionlog->log_meta,
];
- fputcsv($handle, $row);
- }
- });
+ fputcsv($handle, $row);
-
+ }
+ });
// Close the output stream
fclose($handle);
- $executionTime = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
- \Log::debug('-- SCRIPT COMPLETED IN '. $executionTime);
-
+ $executionTime = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
+ \Log::debug('-- SCRIPT COMPLETED IN '.$executionTime);
}, 200, [
'Content-Type' => 'text/csv',
- 'Content-Disposition'
- => 'attachment; filename="activity-report-'.date('Y-m-d-his').'.csv"',
+ 'Content-Disposition' => 'attachment; filename="activity-report-'.date('Y-m-d-his').'.csv"',
]);
+
return $response;
-
-
}
+
/**
* Displays license report
*
@@@ -412,9 -405,9 +406,9 @@@
// 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 = [];
@@@ -564,17 -554,16 +558,16 @@@
}
}
- $executionTime = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
+ $executionTime = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
\Log::debug('Starting headers: '.$executionTime);
fputcsv($handle, $header);
- $executionTime = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
+ $executionTime = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
\Log::debug('Added headers: '.$executionTime);
-
$assets = \App\Models\Company::scopeCompanyables(Asset::select('assets.*'))->with(
- 'location', 'assetstatus', 'assetlog', 'company', 'defaultLoc','assignedTo',
- 'model.category', 'model.manufacturer','supplier');
+ 'location', 'assetstatus', 'assetlog', 'company', 'defaultLoc', 'assignedTo',
+ 'model.category', 'model.manufacturer', 'supplier');
-
+
if ($request->filled('by_location_id')) {
$assets->where('assets.location_id', $request->input('by_location_id'));
}
@@@ -636,10 -625,9 +629,9 @@@
if (($request->filled('next_audit_start')) && ($request->filled('next_audit_end'))) {
$assets->whereBetween('assets.next_audit_date', [$request->input('next_audit_start'), $request->input('next_audit_end')]);
}
-
+ $assets->orderBy('assets.id', 'ASC')->chunk(20, function ($assets) use ($handle, $customfields, $request) {
+
- $assets->orderBy('assets.id', 'ASC')->chunk(20, function($assets) use($handle, $customfields, $request) {
-
- $executionTime = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
+ $executionTime = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
\Log::debug('Walking results: '.$executionTime);
$count = 0;
foreach ($assets as $asset) {
@@@ -694,8 -682,7 +686,7 @@@
if ($request->filled('supplier')) {
$row[] = ($asset->supplier) ? $asset->supplier->name : '';
}
-
+
-
if ($request->filled('location')) {
$row[] = ($asset->location) ? $asset->location->present()->name() : '';
}
@@@ -773,13 -757,12 +761,12 @@@
$row[] = $asset->present()->warrantee_expires();
}
-
if ($request->filled('depreciation')) {
- $depreciation = $asset->getDepreciatedValue();
- $diff = ($asset->purchase_cost - $depreciation);
+ $depreciation = $asset->getDepreciatedValue();
+ $diff = ($asset->purchase_cost - $depreciation);
- $row[] = Helper::formatCurrencyOutput($depreciation);
- $row[] = Helper::formatCurrencyOutput($diff);
- $row[] = ($asset->depreciation) ? $asset->depreciated_date()->format('Y-m-d') : '';
+ $row[] = Helper::formatCurrencyOutput($depreciation);
+ $row[] = Helper::formatCurrencyOutput($diff);
+ $row[] = ($asset->depreciation) ? $asset->depreciated_date()->format('Y-m-d') : '';
}
if ($request->filled('checkout_date')) {
diff --cc app/Http/Controllers/SettingsController.php
index 090883b502,9ae83856c0..a52598592f
--- a/app/Http/Controllers/SettingsController.php
+++ b/app/Http/Controllers/SettingsController.php
@@@ -411,22 -408,19 +409,20 @@@ class SettingsController extends Contro
$setting->custom_css = $request->input('custom_css');
}
- $setting = $request->handleImages($setting,600,'logo','', 'logo');
-
+ $setting = $request->handleImages($setting, 600, 'logo', '', 'logo');
if ('1' == $request->input('clear_logo')) {
- Storage::disk('public')->delete($setting->logo);
+ Storage::disk('public')->delete($setting->logo);
- $setting->logo = null;
+ $setting->logo = null;
- $setting->brand = 1;
+ $setting->brand = 1;
}
-
- $setting = $request->handleImages($setting,600,'email_logo','', 'email_logo');
+ $setting = $request->handleImages($setting, 600, 'email_logo', '', 'email_logo');
- if ('1' == $request->input('clear_email_logo')) {
+
+ if ('1' == $request->input('clear_email_logo')) {
Storage::disk('public')->delete($setting->email_logo);
- $setting->email_logo = null;
+ $setting->email_logo = null;
// If they are uploading an image, validate it and upload it
}
@@@ -436,18 -428,16 +430,17 @@@
if ('1' == $request->input('clear_label_logo')) {
Storage::disk('public')->delete($setting->label_logo);
- $setting->label_logo = null;
-
+ $setting->label_logo = null;
}
+
// If the user wants to clear the favicon...
- if ($request->hasFile('favicon')) {
+ if ($request->hasFile('favicon')) {
- $favicon_image = $favicon_upload = $request->file('favicon');
- $favicon_ext = $favicon_image->getClientOriginalExtension();
- $setting->favicon = $favicon_file_name = 'favicon-uploaded.' . $favicon_ext;
+ $favicon_image = $favicon_upload = $request->file('favicon');
+ $favicon_ext = $favicon_image->getClientOriginalExtension();
+ $setting->favicon = $favicon_file_name = 'favicon-uploaded.'.$favicon_ext;
- if (($favicon_image->getClientOriginalExtension()!='ico') && ($favicon_image->getClientOriginalExtension()!='svg')) {
+ if (($favicon_image->getClientOriginalExtension() != 'ico') && ($favicon_image->getClientOriginalExtension() != 'svg')) {
$favicon_upload = Image::make($favicon_image->getRealPath())->resize(null, 36, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
@@@ -465,11 -454,11 +458,11 @@@
Storage::disk('public')->delete($favicon_file_name);
}
} elseif ('1' == $request->input('clear_favicon')) {
- Storage::disk('public')->delete($setting->clear_favicon);
+ Storage::disk('public')->delete($setting->clear_favicon);
- $setting->favicon = null;
+ $setting->favicon = null;
- // If they are uploading an image, validate it and upload it
- }
+ // If they are uploading an image, validate it and upload it
+ }
if ($setting->save()) {
return redirect()->route('settings.index')
@@@ -525,13 -512,12 +516,13 @@@
$setting->login_remote_user_header_name = $request->input('login_remote_user_header_name');
}
- $setting->pwd_secure_uncommon = (int) $request->input('pwd_secure_uncommon');
- $setting->pwd_secure_min = (int) $request->input('pwd_secure_min');
+ $setting->pwd_secure_uncommon = (int) $request->input('pwd_secure_uncommon');
+ $setting->pwd_secure_min = (int) $request->input('pwd_secure_min');
$setting->pwd_secure_complexity = '';
+
if ($request->filled('pwd_secure_complexity')) {
- $setting->pwd_secure_complexity = implode('|', $request->input('pwd_secure_complexity'));
+ $setting->pwd_secure_complexity = implode('|', $request->input('pwd_secure_complexity'));
}
if ($setting->save()) {
@@@ -927,30 -908,26 +913,30 @@@
if ($request->filled('ldap_pword')) {
$setting->ldap_pword = Crypt::encrypt($request->input('ldap_pword'));
}
- $setting->ldap_basedn = $request->input('ldap_basedn');
- $setting->ldap_filter = $request->input('ldap_filter');
- $setting->ldap_username_field = $request->input('ldap_username_field');
- $setting->ldap_lname_field = $request->input('ldap_lname_field');
- $setting->ldap_fname_field = $request->input('ldap_fname_field');
+ $setting->ldap_basedn = $request->input('ldap_basedn');
+ $setting->ldap_filter = $request->input('ldap_filter');
+ $setting->ldap_username_field = $request->input('ldap_username_field');
+ $setting->ldap_lname_field = $request->input('ldap_lname_field');
+ $setting->ldap_fname_field = $request->input('ldap_fname_field');
$setting->ldap_auth_filter_query = $request->input('ldap_auth_filter_query');
- $setting->ldap_version = $request->input('ldap_version');
- $setting->ldap_active_flag = $request->input('ldap_active_flag');
- $setting->ldap_emp_num = $request->input('ldap_emp_num');
- $setting->ldap_email = $request->input('ldap_email');
- $setting->ad_domain = $request->input('ad_domain');
- $setting->is_ad = $request->input('is_ad', '0');
- $setting->ad_append_domain = $request->input('ad_append_domain', '0');
- $setting->ldap_tls = $request->input('ldap_tls', '0');
- $setting->ldap_pw_sync = $request->input('ldap_pw_sync', '0');
+ $setting->ldap_version = $request->input('ldap_version');
+ $setting->ldap_active_flag = $request->input('ldap_active_flag');
+ $setting->ldap_emp_num = $request->input('ldap_emp_num');
+ $setting->ldap_email = $request->input('ldap_email');
+ $setting->ad_domain = $request->input('ad_domain');
+ $setting->is_ad = $request->input('is_ad', '0');
+ $setting->ad_append_domain = $request->input('ad_append_domain', '0');
+ $setting->ldap_tls = $request->input('ldap_tls', '0');
+ $setting->ldap_pw_sync = $request->input('ldap_pw_sync', '0');
$setting->custom_forgot_pass_url = $request->input('custom_forgot_pass_url');
- $setting->ldap_phone_field = $request->input('ldap_phone');
- $setting->ldap_jobtitle = $request->input('ldap_jobtitle');
- $setting->ldap_country = $request->input('ldap_country');
- $setting->ldap_dept = $request->input('ldap_dept');
+ $setting->ldap_phone_field = $request->input('ldap_phone');
+ $setting->ldap_jobtitle = $request->input('ldap_jobtitle');
+ $setting->ldap_country = $request->input('ldap_country');
+ $setting->ldap_dept = $request->input('ldap_dept');
+ $setting->ldap_client_tls_cert = $request->input('ldap_client_tls_cert');
+ $setting->ldap_client_tls_key = $request->input('ldap_client_tls_key');
+
+
}
if ($setting->save()) {
diff --cc app/Http/Requests/ImageUploadRequest.php
index 0ed4561ae6,3bf922722f..c492011110
--- a/app/Http/Requests/ImageUploadRequest.php
+++ b/app/Http/Requests/ImageUploadRequest.php
@@@ -125,11 -123,10 +123,10 @@@ class ImageUploadRequest extends Reques
$upload = Image::make($image->getRealPath())->resize(null, $w, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
- });
+ });
// This requires a string instead of an object, so we use ($string)
- Storage::disk('public')->put($path.'/'.$file_name, (string)$upload->encode());
-
+ Storage::disk('public')->put($path.'/'.$file_name, (string) $upload->encode());
} else {
// If the file is a webp, we need to just move it since webp support
// needs to be compiled into gd for resizing to be available
@@@ -154,35 -150,28 +150,28 @@@
}
}
-
- // Remove Current image if exists
+ // Remove Current image if exists
if (Storage::disk('public')->exists($path.'/'.$item->{$use_db_field})) {
-
\Log::debug('A file already exists that we are replacing - we should delete the old one.');
try {
- Storage::disk('public')->delete($path.'/'.$item->{$use_db_field});
- \Log::debug('Old file '.$path.'/'.$file_name.' has been deleted.');
+ Storage::disk('public')->delete($path.'/'.$item->{$use_db_field});
+ \Log::debug('Old file '.$path.'/'.$file_name.' has been deleted.');
} catch (\Exception $e) {
\Log::debug('Could not delete old file. '.$path.'/'.$file_name.' does not exist?');
-
}
}
$item->{$use_db_field} = $file_name;
-
}
- // If the user isn't uploading anything new but wants to delete their old image, do so
+ // If the user isn't uploading anything new but wants to delete their old image, do so
} else {
\Log::debug('No file passed for '.$form_fieldname);
- if ($this->input('image_delete')=='1') {
-
+ if ($this->input('image_delete') == '1') {
\Log::debug('Deleting image');
try {
-
- Storage::disk('public')->delete($path . '/' . $item->{$use_db_field});
+ Storage::disk('public')->delete($path.'/'.$item->{$use_db_field});
- $item->{$use_db_field} = null;
+ $item->{$use_db_field} = null;
-
} catch (\Exception $e) {
\Log::debug($e);
}
diff --cc app/Http/Transformers/ActionlogsTransformer.php
index 9618624ae0,b3a01d3b7b..8b8a260eb2
--- a/app/Http/Transformers/ActionlogsTransformer.php
+++ b/app/Http/Transformers/ActionlogsTransformer.php
@@@ -74,12 -68,10 +68,10 @@@ class ActionlogsTransforme
}
}
-
- $array = [
+ $array = [
'id' => (int) $actionlog->id,
'icon' => $icon,
- 'file' => ($actionlog->filename!='') ?
+ 'file' => ($actionlog->filename != '') ?
[
'url' => route('show/assetfile', ['assetId' => $actionlog->item->id, 'fileId' => $actionlog->id]),
'filename' => $actionlog->filename,
diff --cc app/Http/Transformers/CategoriesTransformer.php
index 0ecdb923d6,2c2f4c64d4..427cfaa299
--- a/app/Http/Transformers/CategoriesTransformer.php
+++ b/app/Http/Transformers/CategoriesTransformer.php
@@@ -29,9 -29,8 +29,9 @@@ class CategoriesTransforme
'image' => ($category->image) ? Storage::disk('public')->url('categories/'.e($category->image)) : null,
'category_type' => ucwords(e($category->category_type)),
'has_eula' => ($category->getEula() ? true : false),
+ 'use_default_eula' => ($category->use_default_eula=='1' ? true : false),
'eula' => ($category->getEula()),
- 'checkin_email' => ($category->checkin_email =='1'),
+ 'checkin_email' => ($category->checkin_email == '1'),
'require_acceptance' => ($category->require_acceptance == '1'),
'item_count' => (int) $category->itemCount(),
'assets_count' => (int) $category->assets_count,
diff --cc app/Http/Transformers/DepreciationsTransformer.php
index bd391adf6b,052f547107..abfbf151c6
--- a/app/Http/Transformers/DepreciationsTransformer.php
+++ b/app/Http/Transformers/DepreciationsTransformer.php
@@@ -23,10 -24,10 +24,11 @@@ class DepreciationsTransforme
$array = [
'id' => (int) $depreciation->id,
'name' => e($depreciation->name),
- 'months' => $depreciation->months . ' '. trans('general.months'),
+ 'months' => $depreciation->months.' '.trans('general.months'),
+ 'depreciation_min' => $depreciation->depreciation_min,
'created_at' => Helper::getFormattedDateObject($depreciation->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($depreciation->updated_at, 'datetime'),
+ 'depreciation_min' =>($depreciation->depreciation_min),
];
$permissions_array['available_actions'] = [
diff --cc app/Importer/AccessoryImporter.php
index 324d27e9e2,a9b940911d..f9c871fa7c
--- a/app/Importer/AccessoryImporter.php
+++ b/app/Importer/AccessoryImporter.php
@@@ -33,14 -34,13 +34,15 @@@ class AccessoryImporter extends ItemImp
}
$this->log('Updating Accessory');
+ $this->item['model_number'] = $this->findCsvMatch($row, "model_number");
$accessory->update($this->sanitizeItemForUpdating($accessory));
$accessory->save();
+
return;
}
- $this->log("No Matching Accessory, Creating a new one");
+ $this->log('No Matching Accessory, Creating a new one');
$accessory = new Accessory();
+ $this->item['model_number'] = $this->findCsvMatch($row, "model_number");
$accessory->fill($this->sanitizeItemForStoring($accessory));
//FIXME: this disables model validation. Need to find a way to avoid double-logs without breaking everything.
diff --cc app/Importer/UserImporter.php
index 7adaa3a086,14614c02a7..37d95688bf
--- a/app/Importer/UserImporter.php
+++ b/app/Importer/UserImporter.php
@@@ -123,8 -120,11 +120,9 @@@ class UserImporter extends ItemImporte
{
$department = Department::where(['name' => $department_name])->first();
if ($department) {
- $this->log('A matching department ' . $department_name . ' already exists');
+ $this->log('A matching department '.$department_name.' already exists');
+
return $department->id;
- } else {
- return null;
}
$department = new department();
diff --cc app/Listeners/CheckoutableListener.php
index ba21790f94,ad8c127398..c8acd65f11
--- a/app/Listeners/CheckoutableListener.php
+++ b/app/Listeners/CheckoutableListener.php
@@@ -38,11 -38,11 +38,11 @@@ class CheckoutableListene
/**
* Make a checkout acceptance and attach it in the notification
*/
- $acceptance = $this->getCheckoutAcceptance($event);
+ $acceptance = $this->getCheckoutAcceptance($event);
- if(!$event->checkedOutTo->locale){
+ if (! $event->checkedOutTo->locale) {
Notification::locale(Setting::getSettings()->locale)->send(
- $this->getNotifiables($event),
+ $this->getNotifiables($event),
$this->getCheckoutNotification($event, $acceptance)
);
} else {
@@@ -55,9 -55,9 +55,9 @@@
/**
* Notify the user about the checked in checkoutable
- */
+ */
- public function onCheckedIn($event) {
-
+ public function onCheckedIn($event)
+ {
\Log::debug('checkin fired');
/**
@@@ -71,17 -72,8 +72,17 @@@
/**
* Send the appropriate notification
*/
+ $acceptances = CheckoutAcceptance::where('checkoutable_id', $event->checkoutable->id)
+ ->where('assigned_to_id', $event->checkedOutTo->id)
+ ->get();
+
+ foreach($acceptances as $acceptance){
+ if($acceptance->isPending()){
+ $acceptance->delete();
+ }
+ }
\Log::debug('checked out to a user');
- if(!$event->checkedOutTo->locale){
+ if (! $event->checkedOutTo->locale) {
\Log::debug('Use default settings locale');
Notification::locale(Setting::getSettings()->locale)->send(
$this->getNotifiables($event),
@@@ -141,11 -135,12 +144,12 @@@
/**
* Get the appropriate notification for the event
- *
- * @param CheckoutableCheckedIn $event
+ *
+ * @param CheckoutableCheckedIn $event
* @return Notification
*/
- private function getCheckinNotification($event) {
+ private function getCheckinNotification($event)
+ {
// $model = get_class($event->checkoutable);
@@@ -166,17 -159,19 +170,19 @@@
}
\Log::debug('Notification class: '.$notificationClass);
+
- return new $notificationClass($event->checkoutable, $event->checkedOutTo, $event->checkedInBy, $event->note);
+ return new $notificationClass($event->checkoutable, $event->checkedOutTo, $event->checkedInBy, $event->note);
}
/**
* Get the appropriate notification for the event
- *
- * @param CheckoutableCheckedIn $event
- * @param CheckoutAcceptance $acceptance
+ *
+ * @param CheckoutableCheckedIn $event
+ * @param CheckoutAcceptance $acceptance
* @return Notification
*/
- private function getCheckoutNotification($event, $acceptance) {
+ private function getCheckoutNotification($event, $acceptance)
+ {
$notificationClass = null;
switch (get_class($event->checkoutable)) {
@@@ -205,14 -200,13 +211,13 @@@
public function subscribe($events)
{
$events->listen(
- 'App\Events\CheckoutableCheckedIn',
+ \App\Events\CheckoutableCheckedIn::class,
'App\Listeners\CheckoutableListener@onCheckedIn'
- );
+ );
$events->listen(
- 'App\Events\CheckoutableCheckedOut',
+ \App\Events\CheckoutableCheckedOut::class,
'App\Listeners\CheckoutableListener@onCheckedOut'
- );
+ );
}
-
- }
+ }
diff --cc app/Models/Accessory.php
index 1abac4f68c,09b2e11a17..bbb0917e5d
--- a/app/Models/Accessory.php
+++ b/app/Models/Accessory.php
@@@ -20,19 -24,17 +24,17 @@@ class Accessory extends SnipeMode
use Loggable, Presentable;
use SoftDeletes;
- protected $dates = ['deleted_at', 'purchase_date'];
protected $table = 'accessories';
protected $casts = [
- 'requestable' => 'boolean'
- ];
+ 'purchase_date' => 'datetime',
+ 'requestable' => 'boolean', ];
use Searchable;
-
use Acceptable;
-
+
/**
* The attributes that should be included when searching the model.
- *
+ *
* @var array
*/
protected $searchableAttributes = ['name', 'model_number', 'order_number', 'purchase_date'];
@@@ -51,25 -53,24 +53,24 @@@
];
/**
- * Accessory validation rules
- */
+ * Accessory validation rules
+ */
- public $rules = array(
+ public $rules = [
'name' => 'required|min:3|max:255',
'qty' => 'required|integer|min:1',
'category_id' => 'required|integer|exists:categories,id',
'company_id' => 'integer|nullable',
'min_amt' => 'integer|min:0|nullable',
'purchase_cost' => 'numeric|nullable',
- );
-
+ ];
/**
- * Whether the model should inject it's identifier to the unique
- * validation rules before attempting validation. If this property
- * is not set in the model it will default to true.
- *
+ * Whether the model should inject it's identifier to the unique
+ * validation rules before attempting validation. If this property
+ * is not set in the model it will default to true.
+ *
- * @var boolean
+ * @var bool
- */
+ */
protected $injectUniqueIdentifier = true;
use ValidatingTrait;
@@@ -91,12 -92,9 +92,12 @@@
'supplier_id',
'image',
'qty',
+ 'min_amt',
- 'requestable'
+ 'requestable',
];
+
+
/**
* Establishes the accessory -> supplier relationship
*
@@@ -202,11 -198,9 +201,10 @@@
*/
public function lastCheckout()
{
- return $this->assetlog()->where('action_type','=','checkout')->take(1);
+ return $this->assetlog()->where('action_type', '=', 'checkout')->take(1);
}
+
/**
* Sets the full image url
*
@@@ -303,10 -296,11 +300,11 @@@
if ($this->category->eula_text) {
return $Parsedown->text(e($this->category->eula_text));
- } elseif ((Setting::getSettings()->default_eula_text) && ($this->category->use_default_eula=='1')) {
+ } elseif ((Setting::getSettings()->default_eula_text) && ($this->category->use_default_eula == '1')) {
return $Parsedown->text(e(Setting::getSettings()->default_eula_text));
}
+
- return null;
+ return null;
}
/**
diff --cc app/Models/Asset.php
index fa506de7d9,472f01d8be..8ed9ac3782
--- a/app/Models/Asset.php
+++ b/app/Models/Asset.php
@@@ -37,32 -39,32 +39,32 @@@ class Asset extends Depreciabl
/**
* Run after the checkout acceptance was declined by the user
- *
+ *
* @param User $acceptedBy
* @param string $signature
- */
+ */
- public function declinedCheckout(User $declinedBy, $signature) {
+ public function declinedCheckout(User $declinedBy, $signature)
+ {
- $this->assigned_to = null;
- $this->assigned_type = null;
- $this->accepted = null;
- $this->save();
+ $this->assigned_to = null;
+ $this->assigned_type = null;
+ $this->accepted = null;
+ $this->save();
}
-
/**
- * The database table used by the model.
- *
- * @var string
- */
+ * The database table used by the model.
+ *
+ * @var string
+ */
protected $table = 'assets';
/**
- * Whether the model should inject it's identifier to the unique
- * validation rules before attempting validation. If this property
- * is not set in the model it will default to true.
- *
+ * Whether the model should inject it's identifier to the unique
+ * validation rules before attempting validation. If this property
+ * is not set in the model it will default to true.
+ *
- * @var boolean
+ * @var bool
- */
+ */
protected $injectUniqueIdentifier = true;
// We set these as protected dates so that they will be easily accessible via Carbon
@@@ -143,18 -139,18 +139,18 @@@
* @var array
*/
protected $searchableAttributes = [
- 'name',
- 'asset_tag',
- 'serial',
- 'order_number',
- 'purchase_cost',
- 'notes',
+ 'name',
+ 'asset_tag',
+ 'serial',
+ 'order_number',
+ 'purchase_cost',
+ 'notes',
'created_at',
- 'updated_at',
- 'purchase_date',
- 'expected_checkin',
- 'next_audit_date',
+ 'updated_at',
+ 'purchase_date',
+ 'expected_checkin',
+ 'next_audit_date',
- 'last_audit_date'
+ 'last_audit_date',
];
/**
@@@ -363,10 -355,9 +357,10 @@@
*/
public function depreciation()
{
- return $this->model->belongsTo('\App\Models\Depreciation', 'depreciation_id');
+ return $this->model->belongsTo(\App\Models\Depreciation::class, 'depreciation_id');
}
+
/**
* Get components assigned to this asset
*
@@@ -492,10 -478,9 +482,9 @@@
}
//this makes no sense
return $this->defaultLoc;
-
+ }
- }
+ }
- }
return $this->defaultLoc;
}
@@@ -856,12 -829,11 +834,11 @@@
return false;
}
-
/**
- * -----------------------------------------------
- * BEGIN QUERY SCOPES
- * -----------------------------------------------
- **/
+ * -----------------------------------------------
+ * BEGIN QUERY SCOPES
+ * -----------------------------------------------
+ **/
/**
* Run additional, advanced searches.
@@@ -886,8 -858,7 +863,7 @@@
->orWhere('assets_users.first_name', 'LIKE', '%'.$term.'%')
->orWhere('assets_users.last_name', 'LIKE', '%'.$term.'%')
->orWhere('assets_users.username', 'LIKE', '%'.$term.'%')
- ->orWhereRaw('CONCAT('.DB::getTablePrefix().'assets_users.first_name," ",'.DB::getTablePrefix().'assets_users.last_name) LIKE ?', ["%$term%", "%$term%"]);
+ ->orWhereRaw('CONCAT('.DB::getTablePrefix().'assets_users.first_name," ",'.DB::getTablePrefix().'assets_users.last_name) LIKE ?', ["%$term%"]);
-
}
/**
@@@ -921,28 -888,25 +893,25 @@@
return $query;
}
-
/**
- * Query builder scope for hardware
- *
- * @param \Illuminate\Database\Query\Builder $query Query builder instance
- *
- * @return \Illuminate\Database\Query\Builder Modified query builder
- */
+ * Query builder scope for hardware
+ *
+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
+ *
+ * @return \Illuminate\Database\Query\Builder Modified query builder
+ */
-
public function scopeHardware($query)
{
return $query->where('physical', '=', '1');
}
/**
- * Query builder scope for pending assets
- *
- * @param \Illuminate\Database\Query\Builder $query Query builder instance
- *
- * @return \Illuminate\Database\Query\Builder Modified query builder
- */
+ * Query builder scope for pending assets
+ *
+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
+ *
+ * @return \Illuminate\Database\Query\Builder Modified query builder
+ */
-
public function scopePending($query)
{
return $query->whereHas('assetstatus', function ($query) {
@@@ -952,15 -916,13 +921,13 @@@
});
}
-
/**
- * Query builder scope for searching location
- *
- * @param \Illuminate\Database\Query\Builder $query Query builder instance
- *
- * @return \Illuminate\Database\Query\Builder Modified query builder
- */
+ * Query builder scope for searching location
+ *
+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
+ *
+ * @return \Illuminate\Database\Query\Builder Modified query builder
+ */
-
public function scopeAssetsByLocation($query, $location)
{
return $query->where(function ($query) use ($location) {
@@@ -982,15 -944,13 +949,13 @@@
});
}
-
/**
- * Query builder scope for RTD assets
- *
- * @param \Illuminate\Database\Query\Builder $query Query builder instance
- *
- * @return \Illuminate\Database\Query\Builder Modified query builder
- */
+ * Query builder scope for RTD assets
+ *
+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
+ *
+ * @return \Illuminate\Database\Query\Builder Modified query builder
+ */
-
public function scopeRTD($query)
{
return $query->whereNull('assets.assigned_to')
@@@ -1001,14 -961,13 +966,13 @@@
});
}
- /**
- * Query builder scope for Undeployable assets
- *
- * @param \Illuminate\Database\Query\Builder $query Query builder instance
- *
- * @return \Illuminate\Database\Query\Builder Modified query builder
- */
+ /**
+ * Query builder scope for Undeployable assets
+ *
+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
+ *
+ * @return \Illuminate\Database\Query\Builder Modified query builder
+ */
-
public function scopeUndeployable($query)
{
return $query->whereHas('assetstatus', function ($query) {
@@@ -1113,15 -1068,13 +1073,13 @@@
->NotArchived();
}
-
- /**
- * Query builder scope for Archived assets
- *
- * @param \Illuminate\Database\Query\Builder $query Query builder instance
- *
- * @return \Illuminate\Database\Query\Builder Modified query builder
- */
+ /**
+ * Query builder scope for Archived assets
+ *
+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
+ *
+ * @return \Illuminate\Database\Query\Builder Modified query builder
+ */
-
public function scopeArchived($query)
{
return $query->whereHas('assetstatus', function ($query) {
@@@ -1131,27 -1084,25 +1089,25 @@@
});
}
- /**
- * Query builder scope for Deployed assets
- *
- * @param \Illuminate\Database\Query\Builder $query Query builder instance
- *
- * @return \Illuminate\Database\Query\Builder Modified query builder
- */
+ /**
+ * Query builder scope for Deployed assets
+ *
+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
+ *
+ * @return \Illuminate\Database\Query\Builder Modified query builder
+ */
-
public function scopeDeployed($query)
{
return $query->where('assigned_to', '>', '0');
}
- /**
- * Query builder scope for Requestable assets
- *
- * @param \Illuminate\Database\Query\Builder $query Query builder instance
- *
- * @return \Illuminate\Database\Query\Builder Modified query builder
- */
+ /**
+ * Query builder scope for Requestable assets
+ *
+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
+ *
+ * @return \Illuminate\Database\Query\Builder Modified query builder
+ */
-
public function scopeRequestableAssets($query)
{
return Company::scopeCompanyables($query->where('requestable', '=', 1))
@@@ -1162,58 -1113,56 +1118,56 @@@
});
}
-
/**
- * scopeInModelList
- * Get all assets in the provided listing of model ids
- *
- * @param $query
- * @param array $modelIdListing
- *
- * @return mixed
- * @author Vincent Sposato <[email protected]>
- * @version v1.0
- */
+ * scopeInModelList
+ * Get all assets in the provided listing of model ids
+ *
+ * @param $query
+ * @param array $modelIdListing
+ *
+ * @return mixed
+ * @author Vincent Sposato <[email protected]>
+ * @version v1.0
+ */
public function scopeInModelList($query, array $modelIdListing)
{
return $query->whereIn('assets.model_id', $modelIdListing);
}
- /**
- * Query builder scope to get not-yet-accepted assets
- *
- * @param \Illuminate\Database\Query\Builder $query Query builder instance
- *
- * @return \Illuminate\Database\Query\Builder Modified query builder
- */
+ /**
+ * Query builder scope to get not-yet-accepted assets
+ *
+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
+ *
+ * @return \Illuminate\Database\Query\Builder Modified query builder
+ */
public function scopeNotYetAccepted($query)
{
- return $query->where("accepted", "=", "pending");
+ return $query->where('accepted', '=', 'pending');
}
- /**
- * Query builder scope to get rejected assets
- *
- * @param \Illuminate\Database\Query\Builder $query Query builder instance
- *
- * @return \Illuminate\Database\Query\Builder Modified query builder
- */
+ /**
+ * Query builder scope to get rejected assets
+ *
+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
+ *
+ * @return \Illuminate\Database\Query\Builder Modified query builder
+ */
public function scopeRejected($query)
{
- return $query->where("accepted", "=", "rejected");
+ return $query->where('accepted', '=', 'rejected');
}
-
- /**
- * Query builder scope to get accepted assets
- *
- * @param \Illuminate\Database\Query\Builder $query Query builder instance
- *
- * @return \Illuminate\Database\Query\Builder Modified query builder
- */
+ /**
+ * Query builder scope to get accepted assets
+ *
+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
+ *
+ * @return \Illuminate\Database\Query\Builder Modified query builder
+ */
public function scopeAccepted($query)
{
- return $query->where("accepted", "=", "accepted");
+ return $query->where('accepted', '=', 'accepted');
}
/**
@@@ -1281,17 -1229,14 +1234,14 @@@
*/
public function scopeCheckedOutToTargetInDepartment($query, $search)
{
- return $query->leftJoin('users as assets_dept_users',function ($leftJoin) {
- $leftJoin->on("assets_dept_users.id", "=", "assets.assigned_to")
- ->where("assets.assigned_type", "=", User::class);
+ return $query->leftJoin('users as assets_dept_users', function ($leftJoin) {
+ $leftJoin->on('assets_dept_users.id', '=', 'assets.assigned_to')
+ ->where('assets.assigned_type', '=', User::class);
})->where(function ($query) use ($search) {
- $query->where('assets_dept_users.department_id', '=', $search);
+ $query->where('assets_dept_users.department_id', '=', $search);
-
- })->withTrashed()->whereNull("assets.deleted_at"); //workaround for laravel bug
+ })->withTrashed()->whereNull('assets.deleted_at'); //workaround for laravel bug
}
-
-
/**
* Query builder scope to search on text filters for complex Bootstrap Tables API
*
@@@ -1356,8 -1300,7 +1305,8 @@@
});
}
+
- if ($fieldname =='manufacturer') {
+ if ($fieldname == 'manufacturer') {
$query->whereHas('model', function ($query) use ($search_val) {
$query->whereHas('manufacturer', function ($query) use ($search_val) {
$query->where(function ($query) use ($search_val) {
@@@ -1432,30 -1374,23 +1380,23 @@@
* assets.location would fail, as that field doesn't exist -- plus we're already searching
* against those relationships earlier in this method.
*
- * - snipe
+ * - snipe
- *
*/
- if (($fieldname!='category') && ($fieldname!='model_number') && ($fieldname!='rtd_location') && ($fieldname!='location') && ($fieldname!='supplier')
- && ($fieldname!='status_label') && ($fieldname!='model') && ($fieldname!='company') && ($fieldname!='manufacturer')) {
- $query->orWhere('assets.'.$fieldname, 'LIKE', '%' . $search_val . '%');
+ if (($fieldname != 'category') && ($fieldname != 'model_number') && ($fieldname != 'rtd_location') && ($fieldname != 'location') && ($fieldname != 'supplier')
+ && ($fieldname != 'status_label') && ($fieldname != 'model') && ($fieldname != 'company') && ($fieldname != 'manufacturer')) {
+ $query->orWhere('assets.'.$fieldname, 'LIKE', '%'.$search_val.'%');
}
-
-
-
-
});
-
}
-
/**
- * Query builder scope to order on model
- *
- * @param \Illuminate\Database\Query\Builder $query Query builder instance
- * @param text $order Order
- *
- * @return \Illuminate\Database\Query\Builder Modified query builder
- */
+ * Query builder scope to order on model
+ *
+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
+ * @param text $order Order
+ *
+ * @return \Illuminate\Database\Query\Builder Modified query builder
+ */
public function scopeOrderModels($query, $order)
{
return $query->join('models as asset_models', 'assets.model_id', '=', 'asset_models.id')->orderBy('asset_models.name', $order);
@@@ -1474,15 -1409,14 +1415,14 @@@
return $query->join('models', 'assets.model_id', '=', 'models.id')->orderBy('models.model_number', $order);
}
-
/**
- * Query builder scope to order on assigned user
- *
- * @param \Illuminate\Database\Query\Builder $query Query builder instance
- * @param text $order Order
- *
- * @return \Illuminate\Database\Query\Builder Modified query builder
- */
+ * Query builder scope to order on assigned user
+ *
+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
+ * @param text $order Order
+ *
+ * @return \Illuminate\Database\Query\Builder Modified query builder
+ */
public function scopeOrderAssigned($query, $order)
{
return $query->leftJoin('users as users_sort', 'assets.assigned_to', '=', 'users_sort.id')->select('assets.*')->orderBy('users_sort.first_name', $order)->orderBy('users_sort.last_name', $order);
@@@ -1543,16 -1476,14 +1482,14 @@@
->join('manufacturers', 'models.manufacturer_id', '=', 'manufacturers.id')->where('models.manufacturer_id', '=', $manufacturer_id);
}
-
-
/**
- * Query builder scope to order on category
- *
- * @param \Illuminate\Database\Query\Builder $query Query builder instance
- * @param text $order Order
- *
- * @return \Illuminate\Database\Query\Builder Modified query builder
- */
+ * Query builder scope to order on category
+ *
+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
+ * @param text $order Order
+ *
+ * @return \Illuminate\Database\Query\Builder Modified query builder
+ */
public function scopeOrderCategory($query, $order)
{
return $query->join('models as order_model_category', 'assets.model_id', '=', 'order_model_category.id')
diff --cc app/Models/Company.php
index 99f6e3851d,26afdb032e..fadc2a1974
--- a/app/Models/Company.php
+++ b/app/Models/Company.php
@@@ -26,20 -30,19 +30,19 @@@ final class Company extends SnipeMode
use Presentable;
/**
- * Whether the model should inject it's identifier to the unique
- * validation rules before attempting validation. If this property
- * is not set in the model it will default to true.
- *
+ * Whether the model should inject it's identifier to the unique
+ * validation rules before attempting validation. If this property
+ * is not set in the model it will default to true.
+ *
- * @var boolean
+ * @var bool
- */
+ */
protected $injectUniqueIdentifier = true;
use ValidatingTrait;
-
use Searchable;
-
+
/**
* The attributes that should be included when searching the model.
- *
+ *
* @var array
*/
protected $searchableAttributes = ['name', 'created_at', 'updated_at'];
@@@ -78,10 -81,10 +81,10 @@@
$company_id = null;
}
- $table = ($table_name) ? $table_name.'.' : '';
+ $table = ($table_name) ? $table_name."." : $query->getModel()->getTable().".";
- if(\Schema::hasColumn($query->getModel()->getTable(), $column)){
+ if (\Schema::hasColumn($query->getModel()->getTable(), $column)) {
- return $query->where($table.$column, '=', $company_id);
+ return $query->where($table.$column, '=', $company_id);
} else {
return $query->join('users as users_comp', 'users_comp.id', 'user_id')->where('users_comp.company_id', '=', $company_id);
}
diff --cc app/Models/Consumable.php
index 65214961fc,3903081b76..2d456e12c4
--- a/app/Models/Consumable.php
+++ b/app/Models/Consumable.php
@@@ -72,13 -72,13 +72,13 @@@ class Consumable extends SnipeMode
];
use Searchable;
-
+
/**
* The attributes that should be included when searching the model.
- *
+ *
* @var array
*/
- protected $searchableAttributes = ['name', 'order_number', 'purchase_cost', 'purchase_date', 'item_no'];
+ protected $searchableAttributes = ['name', 'order_number', 'purchase_cost', 'purchase_date', 'item_no', 'model_number'];
/**
* The relations and their attributes that should be included when searching the model.
diff --cc app/Models/Ldap.php
index 619f083b06,bade1c0c00..6b23fd54ec
--- a/app/Models/Ldap.php
+++ b/app/Models/Ldap.php
@@@ -105,10 -93,9 +100,9 @@@ class Ldap extends Mode
\Log::debug('Filter query: '.$filterQuery);
-
- if (!$ldapbind = @ldap_bind($connection, $userDn, $password)) {
- if(!$ldapbind = Ldap::bindAdminToLdap($connection)){
+ if (! $ldapbind = @ldap_bind($connection, $userDn, $password)) {
+ if (! $ldapbind = self::bindAdminToLdap($connection)) {
- return false;
+ return false;
}
}
@@@ -138,29 -123,23 +130,26 @@@
* @param bool|false $user
* @return bool true if the username and/or password provided are valid
* false if the username and/or password provided are invalid
- *
*/
- static function bindAdminToLdap($connection)
+ public static function bindAdminToLdap($connection)
{
+ $ldap_username = Setting::getSettings()->ldap_uname;
+ $ldap_username = Setting::getSettings()->ldap_uname;
+
// Lets return some nicer messages for users who donked their app key, and disable LDAP
try {
- $ldap_pass = \Crypt::decrypt(Setting::getSettings()->ldap_pword);
+ $ldap_pass = \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.');
}
-
- if (!$ldapbind = @ldap_bind($connection, $ldap_username, $ldap_pass)) {
+ if (! $ldapbind = @ldap_bind($connection, $ldap_username, $ldap_pass)) {
throw new Exception('Could not bind to LDAP: '.ldap_error($connection));
}
-
}
+
/**
* Parse and map LDAP attributes based on settings
*
diff --cc app/Models/User.php
index 9f7ad20af2,d42ea740e4..492dece3ff
--- a/app/Models/User.php
+++ b/app/Models/User.php
@@@ -121,9 -122,8 +122,8 @@@ class User extends SnipeModel implement
protected function checkPermissionSection($section)
{
$user_groups = $this->groups;
-
+ if (($this->permissions == '') && (count($user_groups) == 0)) {
+
-
- if (($this->permissions=='') && (count($user_groups) == 0)) {
return false;
}
@@@ -505,33 -500,25 +502,25 @@@
// Assume filastname by default
$username = str_slug(substr($first_name, 0, 1).$last_name);
- if ($format=='firstname.lastname') {
- $username = str_slug($first_name) . '.' . str_slug($last_name);
-
- } elseif ($format=='lastnamefirstinitial') {
+ if ($format == 'firstname.lastname') {
+ $username = str_slug($first_name).'.'.str_slug($last_name);
+ } elseif ($format == 'lastnamefirstinitial') {
$username = str_slug($last_name.substr($first_name, 0, 1));
-
- } elseif ($format=='firstintial.lastname') {
+ } elseif ($format == 'firstintial.lastname') {
$username = substr($first_name, 0, 1).'.'.str_slug($last_name);
-
- } elseif ($format=='firstname_lastname') {
+ } elseif ($format == 'firstname_lastname') {
$username = str_slug($first_name).'_'.str_slug($last_name);
-
- } elseif ($format=='firstname') {
+ } elseif ($format == 'firstname') {
$username = str_slug($first_name);
- }
- elseif ($format=='firstinitial.lastname') {
- $username = str_slug(substr($first_name, 0, 1). '.' . str_slug($last_name));
- }
- elseif ($format=='lastname_firstinitial') {
+ } elseif ($format == 'firstinitial.lastname') {
+ $username = str_slug(substr($first_name, 0, 1).'.'.str_slug($last_name));
+ } elseif ($format == 'lastname_firstinitial') {
$username = str_slug($last_name).'_'.str_slug(substr($first_name, 0, 1));
- }
- elseif ($format=='firstnamelastname') {
- $username = str_slug($first_name) . str_slug($last_name);
- }
- elseif ($format=='firstnamelastinitial') {
+ } elseif ($format == 'firstnamelastname') {
+ $username = str_slug($first_name).str_slug($last_name);
+ } elseif ($format == 'firstnamelastinitial') {
$username = str_slug(($first_name.substr($last_name, 0, 1)));
- }
+ }
}
$user['first_name'] = $first_name;
@@@ -592,15 -576,13 +578,14 @@@
return true;
}
// If the 2FA is required for everyone and the user has enrolled
- elseif ((Setting::getSettings()->two_factor_enabled =='2') && ($this->two_factor_enrolled))
- {
+ elseif ((Setting::getSettings()->two_factor_enabled == '2') && ($this->two_factor_enrolled)) {
return true;
}
- return false;
+ return false;
}
+
public function decodePermissions()
{
return json_decode($this->permissions, true);
@@@ -615,16 -597,15 +600,16 @@@
* @param array $terms The search terms
* @return \Illuminate\Database\Query\Builder
*/
- public function scopeSimpleNameSearch($query, $search) {
-
+ public function scopeSimpleNameSearch($query, $search)
+ {
- $query = $query->where('first_name', 'LIKE', '%'.$search.'%')
+ $query = $query->where('first_name', 'LIKE', '%'.$search.'%')
->orWhere('last_name', 'LIKE', '%'.$search.'%')
- ->orWhereRaw('CONCAT('.DB::getTablePrefix().'users.first_name," ",'.DB::getTablePrefix().'users.last_name) LIKE ?', ["%$search%", "%$search%"]);
+ ->orWhereRaw('CONCAT('.DB::getTablePrefix().'users.first_name," ",'.DB::getTablePrefix().'users.last_name) LIKE ?', ["%$search%"]);
+
return $query;
}
+
-
/**
* Run additional, advanced searches.
*
diff --cc app/Presenters/CategoryPresenter.php
index 0b87b13e02,b45bd01609..5a93d12612
--- a/app/Presenters/CategoryPresenter.php
+++ b/app/Presenters/CategoryPresenter.php
@@@ -17,91 -15,84 +15,102 @@@ class CategoryPresenter extends Present
{
$layout = [
[
- "field" => "id",
- "searchable" => false,
- "sortable" => true,
- "switchable" => true,
- "title" => trans('general.id'),
- "visible" => false
+ 'field' => 'id',
+ 'searchable' => false,
+ 'sortable' => true,
+ 'switchable' => true,
+ 'title' => trans('general.id'),
+ 'visible' => false,
], [
- "field" => "name",
- "searchable" => true,
- "sortable" => true,
- "title" => trans('general.name'),
- "visible" => true,
- "formatter" => 'categoriesLinkFormatter',
- ],[
- "field" => "image",
- "searchable" => false,
- "sortable" => true,
- "title" => trans('general.image'),
- "visible" => true,
- "formatter" => 'imageFormatter',
- ],[
- "field" => "category_type",
- "searchable" => true,
- "sortable" => true,
- "title" => trans('general.type'),
- "visible" => true
- ],[
- "field" => "item_count",
- "searchable" => false,
- "sortable" => true,
- "title" => trans('general.qty'),
- "visible" => true
- ],[
- "field" => "has_eula",
- "searchable" => false,
- "sortable" => false,
- "title" => trans('admin/categories/table.eula_text'),
- "visible" => false,
- "formatter" => 'trueFalseFormatter',
+ 'field' => 'name',
+ 'searchable' => true,
+ 'sortable' => true,
+ 'title' => trans('general.name'),
+ 'visible' => true,
+ 'formatter' => 'categoriesLinkFormatter',
+ ], [
+ 'field' => 'image',
+ 'searchable' => false,
+ 'sortable' => true,
+ 'title' => trans('general.image'),
+ 'visible' => true,
+ 'formatter' => 'imageFormatter',
+ ], [
+ 'field' => 'category_type',
+ 'searchable' => true,
+ 'sortable' => true,
+ 'title' => trans('general.type'),
+ 'visible' => true,
+ ], [
+ 'field' => 'item_count',
+ 'searchable' => false,
+ 'sortable' => true,
+ 'title' => trans('general.qty'),
+ 'visible' => true,
+ ], [
+ 'field' => 'has_eula',
+ 'searchable' => false,
+ 'sortable' => false,
+ 'title' => trans('admin/categories/table.eula_text'),
+ 'visible' => false,
+ 'formatter' => 'trueFalseFormatter',
+ ], [
+ 'field' => 'checkin_email',
+ 'searchable' => false,
+ 'sortable' => true,
+ 'class' => 'css-envelope',
+ 'title' => 'Send Email',
+ 'visible' => true,
+ 'formatter' => 'trueFalseFormatter',
+ ], [
+ 'field' => 'require_acceptance',
+ 'searchable' => false,
+ 'sortable' => true,
+ 'title' => trans('admin/categories/table.require_acceptance'),
+ 'visible' => true,
+ 'formatter' => 'trueFalseFormatter',
+ ], [
+ 'field' => 'actions',
+ 'searchable' => false,
+ 'sortable' => false,
+ 'switchable' => false,
+ 'title' => trans('table.actions'),
+ ],[
+ "field" => "use_default_eula",
+ "searchable" => false,
+ "sortable" => true,
+ "title" => trans('admin/categories/general.use_default_eula_column'),
- "visible" => false,
+ 'visible' => true,
+ "formatter" => 'trueFalseFormatter',
+ ],[
+ "field" => "checkin_email",
+ "searchable" => false,
+ "sortable" => true,
+ "class" => 'css-envelope',
+ "title" => 'Send Email',
+ "visible" => true,
+ "formatter" => 'trueFalseFormatter',
+ ],[
+ "field" => "require_acceptance",
+ "searchable" => false,
+ "sortable" => true,
- "title" => trans('admin/categories/table.require_acceptance'),
- "visible" => true,
- "formatter" => 'trueFalseFormatter',
- ],[
- "field" => "actions",
- "searchable" => false,
- "sortable" => false,
- "switchable" => false,
- "title" => trans('table.actions'),
- "visible" => true,
- "formatter" => "categoriesActionsFormatter",
+ 'formatter' => 'categoriesActionsFormatter',
],
[
- "field" => "created_at",
- "searchable" => true,
- "sortable" => true,
- "visible" => false,
- "title" => trans('general.created_at'),
- "formatter" => "dateDisplayFormatter"
+ 'field' => 'created_at',
+ 'searchable' => true,
+ 'sortable' => true,
+ 'visible' => false,
+ 'title' => trans('general.created_at'),
+ 'formatter' => 'dateDisplayFormatter',
],
[
- "field" => "updated_at",
- "searchable" => true,
- "sortable" => true,
- "visible" => false,
- "title" => trans('general.updated_at'),
- "formatter" => "dateDisplayFormatter"
+ 'field' => 'updated_at',
+ 'searchable' => true,
+ 'sortable' => true,
+ 'visible' => false,
+ 'title' => trans('general.updated_at'),
+ 'formatter' => 'dateDisplayFormatter',
],
];
diff --cc database/migrations/2020_10_22_233743_move_accessory_checkout_note_to_join_table.php
index 7ff0b0af8b,feea0d95a1..e6398909d3
--- a/database/migrations/2020_10_22_233743_move_accessory_checkout_note_to_join_table.php
+++ b/database/migrations/2020_10_22_233743_move_accessory_checkout_note_to_join_table.php
@@@ -48,13 -40,11 +47,13 @@@ class MoveAccessoryCheckoutNoteToJoinTa
// Get the records from action_logs so we can copy the notes over to the new notes field
// on the accessories_users table
- $action_log_entries = Actionlog::where('created_at', '=',$join_log->created_at)
- ->where('target_id', '=',$join_log->assigned_to)
- ->where('item_id', '=',$accessory->id)
+ $action_log_entries = Actionlog::where('created_at', '=', $join_log->created_at)
+ ->where('target_id', '=', $join_log->assigned_to)
+ ->where('item_id', '=', $accessory->id)
+ ->where('target_type', '=', \App\Models\User::class)
+ ->where('item_type', '=','App\\Models\\Accessory')
- ->where('target_type', '=','App\\Models\\User')
->where('action_type', '=', 'checkout')
+ ->where('note', '!=', '')
->orderBy('created_at', 'DESC')->get();
\Log::debug($action_log_entries->count().' matching entries in the action_logs table');
diff --cc resources/lang/ar/auth/general.php
index 6d1360b7fa,79b895012b..b161e5297e
--- a/resources/lang/ar/auth/general.php
+++ b/resources/lang/ar/auth/general.php
@@@ -8,9 -8,7 +8,8 @@@ return
'login' => 'الدخول',
'login_prompt' => 'الرجاء تسجيل الدخول',
'forgot_password' => 'نسيت كلمة المرور',
+ 'ldap_reset_password' => 'الرجاء النقر هنا لإعادة تعيين كلمة مرور LDAP',
'remember_me' => 'تذكرني',
- 'username_help_top' => 'Enter your <strong>username</strong> to be emailed a password reset link.',
- 'username_help_bottom' => 'Your username and email address <em>may</em> be the same, but may not be, depending on your configuration. If you cannot remember your username, contact your administrator. <br><br><strong>Usernames without an associated email address will not be emailed a password reset link.</strong> ',
+ 'username_help_top' => 'أدخل اسم المستخدم الخاص بك <strong></strong> ليتم إرسال رابط إعادة تعيين كلمة المرور إلى البريد الإلكتروني.',
+ 'username_help_bottom' => 'قد يكون اسم المستخدم وعنوان البريد الإلكتروني الخاصين بك متماثلين، ولكن قد لا يكونا كذلك، بناءً على الإعدادات الخاصة بك. إذا كنت لا تستطيع تذكر اسم المستخدم الخاص بك، اتصل بالمسؤول. لن يتم إرسال رابط إعادة تعيين كلمة المرور عبر البريد الإلكتروني إلى أسماء المستخدمين التي لا تحتوي على عنوان بريد إلكتروني مرتبط بها ',
];
-
diff --cc resources/lang/ar/mail.php
index 7567f0eb06,cc471e1f9c..963b799fb5
--- a/resources/lang/ar/mail.php
+++ b/resources/lang/ar/mail.php
@@@ -69,11 -69,11 +69,11 @@@ return
'welcome' => 'مرحباً :name',
'welcome_to' => 'مرحبا بكم في :web!',
'your_credentials' => 'أوراق اعتماد قنص-إيت الخاص بك',
- 'Accessory_Checkin_Notification' => 'Accessory checked in',
- 'Asset_Checkin_Notification' => 'Asset checked in',
- 'License_Checkin_Notification' => 'License checked in',
- 'Expected_Checkin_Report' => 'Expected asset checkin report',
+ 'Accessory_Checkin_Notification' => 'تم تسحيل الملحق',
+ 'Asset_Checkin_Notification' => 'تم تسجيل الأصل',
+ 'License_Checkin_Notification' => 'تم تسجيل الرخصة',
+ 'Expected_Checkin_Report' => 'تقرير تسجيل الأصول المتوقع',
'Expected_Checkin_Notification' => 'تذكير: تاريخ تحقق :name يقترب من الموعد النهائي',
'Expected_Checkin_Date' => 'من المقرر أن يتم التحقق من الأصول التي تم إخراجها إليك في :date',
- 'your_assets' => 'عرض الأصول الخاصة بك'
- );
+ 'your_assets' => 'عرض الأصول الخاصة بك',
+ ];
diff --cc resources/lang/cy/admin/accessories/message.php
index e5be37a7e1,39d27c4971..a9568b90f7
--- a/resources/lang/cy/admin/accessories/message.php
+++ b/resources/lang/cy/admin/accessories/message.php
@@@ -1,37 -1,36 +1,36 @@@
<?php
- return array(
+ return [
- 'does_not_exist' => 'The accessory [:id] does not exist.',
+ 'does_not_exist' => 'Nid yw\'r ategolyn [:id] yn bodoli.',
'assoc_users' => 'Mae\'r ategolyn yma hefo :count eitem wedi nodi allan i defnyddwyr. Nodwch yr ategolion yn ol i fewn ac yna ceisiwch eto. ',
- 'create' => array(
+ 'create' => [
'error' => 'Ni crewyd yr ategolyn, ceisiwch eto o.g.y.dd.',
- 'success' => 'Ategolyn wedi creu yn llwyddiannus.'
- ),
+ 'success' => 'Ategolyn wedi creu yn llwyddiannus.',
+ ],
- 'update' => array(
+ 'update' => [
'error' => 'Ni diweddarwyd yr ategolyn, ceisiwch eto o.g.y.dd',
- 'success' => 'Diweddarwyd yr ategolyn yn llwyddiannus.'
- ),
+ 'success' => 'Diweddarwyd yr ategolyn yn llwyddiannus.',
+ ],
- 'delete' => array(
+ 'delete' => [
'confirm' => 'Ydych chi\'n sicr eich bod eisiau dileu\'r eitem hwn?',
'error' => 'Nid oedd yn bosib dileu\'r eitem. Ceisiwch eto o.g.y.dd.',
- 'success' => 'Ategolyn wedi dileu yn llwyddiannus.'
- ),
+ 'success' => 'Ategolyn wedi dileu yn llwyddiannus.',
+ ],
- 'checkout' => array(
+ 'checkout' => [
'error' => 'Ategolyn heb ei nodi allan, ceisiwch eto o. g. y. dd',
'success' => 'Ategolyn wedi nodi allan yn llwyddiannus.',
- 'user_does_not_exist' => 'Nid yw\'r defnyddiwr yna yn ddilys. Ceisiwch eto o.g.y.dd.'
- ),
+ 'user_does_not_exist' => 'Nid yw\'r defnyddiwr yna yn ddilys. Ceisiwch eto o.g.y.dd.',
+ ],
- 'checkin' => array(
+ 'checkin' => [
'error' => 'Nid oedd yn bosib nodi\'r ategolyn i fewn, ceisiwch eto o.g.y.dd',
'success' => 'Ategolyn wedi nodi i fewn yn llwyddiannus.',
- 'user_does_not_exist' => 'Nid yw\'r defnyddiwr yna yn ddilys. Ceisiwch eto o.g.y.dd.'
- )
+ 'user_does_not_exist' => 'Nid yw\'r defnyddiwr yna yn ddilys. Ceisiwch eto o.g.y.dd.',
+ ],
-
- );
+ ];
diff --cc resources/lang/cy/auth/message.php
index 370456e451,d963fedb65..9d152586ad
--- a/resources/lang/cy/auth/message.php
+++ b/resources/lang/cy/auth/message.php
@@@ -9,37 -9,36 +9,36 @@@ return
'account_banned' => 'Mae\'r cyfrif defnyddiwr hwn wedi\'i atal.',
'throttle' => 'Too many failed login attempts. Please try again in :minutes minutes.',
- 'two_factor' => array(
+ 'two_factor' => [
'already_enrolled' => 'Your device is already enrolled.',
- 'success' => 'You have successfully logged in.',
+ 'success' => 'Rydych wedi llwydo i fewngofnodi.',
'code_required' => 'Two-factor code is required.',
'invalid_code' => 'Two-factor code is invalid.',
- ),
+ ],
- 'signin' => array(
+ 'signin' => [
'error' => 'Roedd yna broblem wrth i chi fewngofnodi. Rhowch gynnig arall arni so gwelwch yn dda.',
'success' => 'Rydych wedi llwydo i fewngofnodi.',
- ),
+ ],
- 'logout' => array(
+ 'logout' => [
'error' => 'There was a problem while trying to log you out, please try again.',
'success' => 'You have successfully logged out.',
- ),
+ ],
- 'signup' => array(
+ 'signup' => [
'error' => 'Roedd yna broblem wrth creu eich cyfrif, rhowch gynnig arall arni so gwelwch yn dda.',
'success' => 'Cyfrif wedi\'i creu yn llwyddiannus.',
- ),
+ ],
- 'forgot-password' => array(
+ 'forgot-password' => [
'error' => 'Roedd yna broblem wrth ceisio cael côd newid cyfrinair, rhowch gynnig arall arni so gwelwch yn dda.',
'success' => 'If that email address exists in our system, a password recovery email has been sent.',
- ),
+ ],
- 'forgot-password-confirm' => array(
+ 'forgot-password-confirm' => [
'error' => 'Roedd yna broblem wrth ceisio newid cyfrinair, rhowch gynnig arall arni so gwelwch yn dda.',
'success' => 'Mae eich cyfrinair wedi\'i ailosod yn llwyddiannus.',
- ),
+ ],
-
- );
+ ];
diff --cc resources/lang/en-ID/admin/users/message.php
index a67ce0bdbc,04367599fe..e2aef9e26f
--- a/resources/lang/en-ID/admin/users/message.php
+++ b/resources/lang/en-ID/admin/users/message.php
@@@ -12,10 -12,9 +12,9 @@@ return
'insufficient_permissions' => 'Izin tidak cukup.',
'user_deleted_warning' => 'Pengguna ini sudah dihapus. Anda harus mengembalikan pengguna ini untuk menyuntingnya atau memberikannya aset baru.',
'ldap_not_configured' => 'Integrasi LDAP sudah tidak dikonfigurasikan untuk instalasi ini.',
- 'password_resets_sent' => 'The selected users who are activated and have a valid email addresses have been sent a password reset link.',
+ 'password_resets_sent' => 'Pengguna terpilih yang diaktifkan dan memiliki sebuah alamat email yang valid telah dikirimkan sebuah tautan pengaturan ulang kata sandi.',
-
- 'success' => array(
+ 'success' => [
'create' => 'Pengguna berhasil dibuat.',
'update' => 'Pengguna berhasil diperbarui.',
'update_bulk' => 'Pengguna berhasil diperbarui!',
diff --cc resources/lang/en/admin/categories/general.php
index c8385018d8,804bab6ec5..e9fdcf9921
--- a/resources/lang/en/admin/categories/general.php
+++ b/resources/lang/en/admin/categories/general.php
@@@ -17,7 -17,6 +17,7 @@@ return
'no_default_eula' => 'No primary default EULA found. Add one in Settings.',
'update' => 'Update Category',
'use_default_eula' => 'Use the <a href="#" data-toggle="modal" data-target="#eulaModal">primary default EULA</a> instead.',
+ 'use_default_eula_column' => 'Use default EULA',
'use_default_eula_disabled' => '<del>Use the primary default EULA instead.</del> No primary default EULA is set. Please add one in Settings.',
- );
+ ];
diff --cc resources/lang/en/admin/depreciations/general.php
index a5dec994c2,a17e1816eb..e188b2cc1a
--- a/resources/lang/en/admin/depreciations/general.php
+++ b/resources/lang/en/admin/depreciations/general.php
@@@ -6,8 -6,8 +6,9 @@@ return
'asset_depreciations' => 'Asset Depreciations',
'create' => 'Create Depreciation',
'depreciation_name' => 'Depreciation Name',
+ 'depreciation_min' => 'Floor Value of Depreciation',
'number_of_months' => 'Number of Months',
'update' => 'Update Depreciation',
+ 'depreciation_min' => 'Minimum Value after Depreciation'
- );
+ ];
diff --cc resources/lang/es-CO/admin/kits/general.php
index a175810944,5dd3c2ab19..e0f87e8d1a
--- a/resources/lang/es-CO/admin/kits/general.php
+++ b/resources/lang/es-CO/admin/kits/general.php
@@@ -1,8 -1,8 +1,8 @@@
<?php
- return array(
+ return [
'about_kits_title' => 'Acerca de kits predefinidos',
- 'about_kits_text' => 'Predefined Kits let you quickly check out a collection of items (assets, licenses, etc) to a user. This can be helpful when your onboarding process is consistent across many users and all users receive the same items.',
+ 'about_kits_text' => 'Los Kits predefinidos le permiten rápidamente entregar un conjunto de elementos (assets, licencias, etc) a un usuario. Esto puede ser útil cuando su proceso de aprovisionar a usuarios nuevos es consistente para varios usuarios y todos reciben los mismos ítems.',
'checkout' => 'Asignar kit ',
'create_success' => 'El kit se ha creado correctamente.',
'create' => 'Crear kit predefinido',
@@@ -10,8 -10,8 +10,8 @@@
'delete_success' => 'Kit eliminado correctamente.',
'update_success' => 'El kit se ha actualizado correctamente.',
'none_models' => 'No hay suficientes recursos disponibles para :model para asignar. :qty son requeridos. ',
- 'none_licenses' => 'There are not enough available seats for :license to checkout. :qty are required. ',
- 'none_consumables' => 'There are not enough available units of :consumable to checkout. :qty are required. ',
- 'none_accessory' => 'There are not enough available units of :accessory to checkout. :qty are required. ',
+ 'none_licenses' => 'No hay suficientes licencias disponibles de :license para entregar. Se requieren :qty . ',
+ 'none_consumables' => 'No hay suficientes unidades disponibles de :consumable para entregar. Se requieren :qty . ',
+ 'none_accessory' => 'No hay suficientes unidades disponibles de :accessory para entregar. Se necesitan :qty . ',
- );
+ ];
diff --cc resources/lang/es-CO/admin/manufacturers/message.php
index 342dd1e565,6b2b37a9e3..a55a8a9cae
--- a/resources/lang/es-CO/admin/manufacturers/message.php
+++ b/resources/lang/es-CO/admin/manufacturers/message.php
@@@ -1,29 -1,29 +1,29 @@@
<?php
- return array(
+ return [
- 'does_not_exist' => 'Fabricante inexistente.',
+ 'does_not_exist' => 'El fabricante no existe.',
'assoc_users' => 'Este Fabricante está asociado al menos a un modelo y no puede ser eliminado',
- 'create' => array(
+ 'create' => [
'error' => 'Fabricante no creado, Intentalo de nuevo.',
- 'success' => 'Fabricante creado.'
- ),
+ 'success' => 'Fabricante creado.',
+ ],
- 'update' => array(
+ 'update' => [
'error' => 'Fabricante no actualizado, Intentalo de nuevo',
- 'success' => 'Fabricante actualizado.'
- ),
+ 'success' => 'Fabricante actualizado.',
+ ],
- 'restore' => array(
+ 'restore' => [
'error' => 'El fabricante no fue restaurado, intente de nuevo',
- 'success' => 'Fabricante restaurado con éxito.'
- ),
+ 'success' => 'Fabricante restaurado con éxito.',
+ ],
- 'delete' => array(
+ 'delete' => [
'confirm' => 'Estás seguro que quieres eliminar Fabricante?',
'error' => 'Hubo un problema eliminando el fabricante. Por favor, inténtalo de nuevo.',
- 'success' => 'Fabricante Eliminado.'
- )
+ 'success' => 'Fabricante Eliminado.',
+ ],
- );
+ ];
diff --cc resources/lang/es-CO/mail.php
index b9f482defe,b02a5792b2..9635e65d46
--- a/resources/lang/es-CO/mail.php
+++ b/resources/lang/es-CO/mail.php
@@@ -72,8 -72,8 +72,8 @@@ return
'Accessory_Checkin_Notification' => 'Accesorio devuelto',
'Asset_Checkin_Notification' => 'Activo devuelto',
'License_Checkin_Notification' => 'Licencia devuelta',
- 'Expected_Checkin_Report' => 'Expected asset checkin report',
+ 'Expected_Checkin_Report' => 'Informe de devolución de activo esperado',
'Expected_Checkin_Notification' => 'Recordatorio: :name se acerca la fecha de devolución',
'Expected_Checkin_Date' => 'Un activo asignado a ti debe ser devuelto en :date',
- 'your_assets' => 'Ver tus activos'
- );
+ 'your_assets' => 'Ver tus activos',
+ ];
diff --cc resources/lang/es-ES/admin/kits/general.php
index a175810944,5dd3c2ab19..e0f87e8d1a
--- a/resources/lang/es-ES/admin/kits/general.php
+++ b/resources/lang/es-ES/admin/kits/general.php
@@@ -1,8 -1,8 +1,8 @@@
<?php
- return array(
+ return [
'about_kits_title' => 'Acerca de kits predefinidos',
- 'about_kits_text' => 'Predefined Kits let you quickly check out a collection of items (assets, licenses, etc) to a user. This can be helpful when your onboarding process is consistent across many users and all users receive the same items.',
+ 'about_kits_text' => 'Los Kits predefinidos le permiten rápidamente entregar un conjunto de elementos (assets, licencias, etc) a un usuario. Esto puede ser útil cuando su proceso de aprovisionar a usuarios nuevos es consistente para varios usuarios y todos reciben los mismos ítems.',
'checkout' => 'Asignar kit ',
'create_success' => 'El kit se ha creado correctamente.',
'create' => 'Crear kit predefinido',
@@@ -10,8 -10,8 +10,8 @@@
'delete_success' => 'Kit eliminado correctamente.',
'update_success' => 'El kit se ha actualizado correctamente.',
'none_models' => 'No hay suficientes recursos disponibles para :model para asignar. :qty son requeridos. ',
- 'none_licenses' => 'There are not enough available seats for :license to checkout. :qty are required. ',
- 'none_consumables' => 'There are not enough available units of :consumable to checkout. :qty are required. ',
- 'none_accessory' => 'There are not enough available units of :accessory to checkout. :qty are required. ',
+ 'none_licenses' => 'No hay suficientes licencias disponibles de :license para entregar. Se requieren :qty . ',
+ 'none_consumables' => 'No hay suficientes unidades disponibles de :consumable para entregar. Se requieren :qty . ',
+ 'none_accessory' => 'No hay suficientes unidades disponibles de :accessory para entregar. Se necesitan :qty . ',
- );
+ ];
diff --cc resources/lang/es-ES/mail.php
index b9f482defe,b02a5792b2..9635e65d46
--- a/resources/lang/es-ES/mail.php
+++ b/resources/lang/es-ES/mail.php
@@@ -72,8 -72,8 +72,8 @@@ return
'Accessory_Checkin_Notification' => 'Accesorio devuelto',
'Asset_Checkin_Notification' => 'Activo devuelto',
'License_Checkin_Notification' => 'Licencia devuelta',
- 'Expected_Checkin_Report' => 'Expected asset checkin report',
+ 'Expected_Checkin_Report' => 'Informe de devolución de activo esperado',
'Expected_Checkin_Notification' => 'Recordatorio: :name se acerca la fecha de devolución',
'Expected_Checkin_Date' => 'Un activo asignado a ti debe ser devuelto en :date',
- 'your_assets' => 'Ver tus activos'
- );
+ 'your_assets' => 'Ver tus activos',
+ ];
diff --cc resources/lang/es-VE/admin/kits/general.php
index a175810944,5dd3c2ab19..e0f87e8d1a
--- a/resources/lang/es-VE/admin/kits/general.php
+++ b/resources/lang/es-VE/admin/kits/general.php
@@@ -1,8 -1,8 +1,8 @@@
<?php
- return array(
+ return [
'about_kits_title' => 'Acerca de kits predefinidos',
- 'about_kits_text' => 'Predefined Kits let you quickly check out a collection of items (assets, licenses, etc) to a user. This can be helpful when your onboarding process is consistent across many users and all users receive the same items.',
+ 'about_kits_text' => 'Los Kits predefinidos le permiten rápidamente entregar un conjunto de elementos (assets, licencias, etc) a un usuario. Esto puede ser útil cuando su proceso de aprovisionar a usuarios nuevos es consistente para varios usuarios y todos reciben los mismos ítems.',
'checkout' => 'Asignar kit ',
'create_success' => 'El kit se ha creado correctamente.',
'create' => 'Crear kit predefinido',
@@@ -10,8 -10,8 +10,8 @@@
'delete_success' => 'Kit eliminado correctamente.',
'update_success' => 'El kit se ha actualizado correctamente.',
'none_models' => 'No hay suficientes recursos disponibles para :model para asignar. :qty son requeridos. ',
- 'none_licenses' => 'There are not enough available seats for :license to checkout. :qty are required. ',
- 'none_consumables' => 'There are not enough available units of :consumable to checkout. :qty are required. ',
- 'none_accessory' => 'There are not enough available units of :accessory to checkout. :qty are required. ',
+ 'none_licenses' => 'No hay suficientes licencias disponibles de :license para entregar. Se requieren :qty . ',
+ 'none_consumables' => 'No hay suficientes unidades disponibles de :consumable para entregar. Se requieren :qty . ',
+ 'none_accessory' => 'No hay suficientes unidades disponibles de :accessory para entregar. Se necesitan :qty . ',
- );
+ ];
diff --cc resources/lang/es-VE/mail.php
index ec2bded107,2712ef6cdf..883c33385e
--- a/resources/lang/es-VE/mail.php
+++ b/resources/lang/es-VE/mail.php
@@@ -72,8 -72,8 +72,8 @@@ return
'Accessory_Checkin_Notification' => 'Accesorio devuelto',
'Asset_Checkin_Notification' => 'Activo devuelto',
'License_Checkin_Notification' => 'Licencia devuelta',
- 'Expected_Checkin_Report' => 'Expected asset checkin report',
+ 'Expected_Checkin_Report' => 'Informe de devolución de activo esperado',
'Expected_Checkin_Notification' => 'Recordatorio: :name se acerca la fecha de devolución',
'Expected_Checkin_Date' => 'Un activo asignado a ti debe ser devuelto en :date',
- 'your_assets' => 'Ver tus activos'
- );
+ 'your_assets' => 'Ver tus activos',
+ ];
diff --cc resources/lang/hu/admin/kits/general.php
index 1a77fd8980,16069e3679..3e3cfce220
--- a/resources/lang/hu/admin/kits/general.php
+++ b/resources/lang/hu/admin/kits/general.php
@@@ -1,17 -1,17 +1,17 @@@
<?php
- return array(
+ return [
'about_kits_title' => 'Az előredefiniált csomagokról',
- 'about_kits_text' => 'Predefined Kits let you quickly check out a collection of items (assets, licenses, etc) to a user. This can be helpful when your onboarding process is consistent across many users and all users receive the same items.',
- 'checkout' => 'Checkout Kit ',
- 'create_success' => 'Kit was successfully created.',
- 'create' => 'Create Predefined Kit',
- 'update' => 'Update Predefined Kit',
- 'delete_success' => 'Kit was successfully deleted.',
- 'update_success' => 'Kit was successfully updated.',
- 'none_models' => 'There are not enough available assets for :model to checkout. :qty are required. ',
+ 'about_kits_text' => 'Az előre definiált csomagok lehetővé teszik, hogy egy felhasználó gyorsan ki tudjon adni egy eszközgyűjteményt (eszközök, licencek stb.). Ez akkor lehet hasznos, ha a belépési folyamat sok felhasználó számára egységes, és minden felhasználó ugyanazokat az eszközöket kapja meg.',
+ 'checkout' => 'Csomag kiadása ',
+ 'create_success' => 'Csomag sikeresen létrehozva.',
+ 'create' => 'Előre definiált csomag frissítése',
+ 'update' => 'Előre definiált csomag frissítése',
+ 'delete_success' => 'Csomag sikeresen törölve.',
+ 'update_success' => 'Csomag sikeresen frissítve.',
+ 'none_models' => 'Nincs elég rendelkezésre álló eszköz a :model kiadáshoz. :qty szükséges. ',
'none_licenses' => 'Nincs elegendő szabad felhasználói hely a :license licenceből a kiadáshoz. További :qty felhasználói helyre van még szükség. ',
- 'none_consumables' => 'There are not enough available units of :consumable to checkout. :qty are required. ',
- 'none_accessory' => 'There are not enough available units of :accessory to checkout. :qty are required. ',
+ 'none_consumables' => 'Nincs elég szabad egység :consumable-ból a kiadáshoz. :qty szükséges. ',
+ 'none_accessory' => 'Nem áll rendelkezésre elég egység a :accessory kiadáshoz. :qty szükséges. ',
- );
+ ];
diff --cc resources/lang/is/admin/asset_maintenances/table.php
index 60f461b96a,8dbb029a3c..aaed3ce30f
--- a/resources/lang/is/admin/asset_maintenances/table.php
+++ b/resources/lang/is/admin/asset_maintenances/table.php
@@@ -1,8 -1,8 +1,8 @@@
<?php
return [
- 'title' => 'Asset Maintenance',
- 'asset_name' => 'Asset Name',
+ 'title' => 'Viðhald eignar',
+ 'asset_name' => 'Heiti eignar',
'is_warranty' => 'Ábyrgð',
- 'dl_csv' => 'Sækja CSV'
+ 'dl_csv' => 'Sækja CSV',
];
diff --cc resources/lang/is/admin/companies/general.php
index 1804e7b2c5,318d188e3b..c7b11028e7
--- a/resources/lang/is/admin/companies/general.php
+++ b/resources/lang/is/admin/companies/general.php
@@@ -1,4 -1,5 +1,5 @@@
<?php
+
return [
- 'select_company' => 'Select Company',
+ 'select_company' => 'Veldu fyrirtæki',
];
diff --cc resources/lang/is/admin/consumables/general.php
index 2ead15a0a5,dc4ecb290f..8e82abd290
--- a/resources/lang/is/admin/consumables/general.php
+++ b/resources/lang/is/admin/consumables/general.php
@@@ -1,8 -1,8 +1,8 @@@
<?php
- return array(
+ return [
'checkout' => 'Checkout Consumable to User',
- 'consumable_name' => 'Consumable Name',
+ 'consumable_name' => 'Heiti rekstrarvöru',
'create' => 'Create Consumable',
'item_no' => 'Item No.',
'remaining' => 'Remaining',
diff --cc resources/lang/is/admin/departments/table.php
index 25e70c7eb6,b9e94f80cc..65e0b59dc6
--- a/resources/lang/is/admin/departments/table.php
+++ b/resources/lang/is/admin/departments/table.php
@@@ -5,7 -5,7 +5,7 @@@ return
'id' => 'ID',
'name' => 'Department Name',
'manager' => 'Manager',
- 'location' => 'Location',
+ 'location' => 'Staðsetning',
'create' => 'Create Department',
'update' => 'Update Department',
- );
+ ];
diff --cc resources/lang/is/admin/depreciations/table.php
index 7cf1588a6b,a0d32d968d..87dc6d11d9
--- a/resources/lang/is/admin/depreciations/table.php
+++ b/resources/lang/is/admin/depreciations/table.php
@@@ -1,10 -1,10 +1,10 @@@
<?php
- return array(
+ return [
'id' => 'ID',
- 'months' => 'Months',
- 'term' => 'Term',
- 'title' => 'Name ',
+ 'months' => 'Mánuðir',
+ 'term' => 'Tími',
+ 'title' => 'Heiti ',
- );
+ ];
diff --cc resources/lang/is/admin/groups/titles.php
index 18d28d2502,8807f5e54a..3a962e0b47
--- a/resources/lang/is/admin/groups/titles.php
+++ b/resources/lang/is/admin/groups/titles.php
@@@ -8,7 -8,7 +8,7 @@@ return
'update' => 'Edit Group',
'group_name' => 'Group Name',
'group_admin' => 'Group Admin',
- 'allow' => 'Allow',
- 'deny' => 'Deny',
+ 'allow' => 'Leyfa',
+ 'deny' => 'Hafna',
- );
+ ];
diff --cc resources/lang/is/admin/licenses/table.php
index 99fc32320e,f5520afe52..f681909359
--- a/resources/lang/is/admin/licenses/table.php
+++ b/resources/lang/is/admin/licenses/table.php
@@@ -1,17 -1,17 +1,17 @@@
<?php
- return array(
+ return [
- 'assigned_to' => 'Assigned To',
+ 'assigned_to' => 'Úthlutað til',
'checkout' => 'In/Out',
'id' => 'ID',
'license_email' => 'License Email',
'license_name' => 'Licensed To',
- 'purchase_date' => 'Purchase Date',
- 'purchased' => 'Purchased',
+ 'purchase_date' => 'Innkaups dagsetning',
+ 'purchased' => 'Keypt',
'seats' => 'Seats',
- 'hardware' => 'Hardware',
- 'serial' => 'Serial',
- 'title' => 'License',
+ 'hardware' => 'Vélbúnaður',
+ 'serial' => 'Raðnúmer',
+ 'title' => 'Leyfi',
- );
+ ];
diff --cc resources/lang/is/admin/locations/message.php
index 5c21f6a30d,2aac2141cb..bbcebf8238
--- a/resources/lang/is/admin/locations/message.php
+++ b/resources/lang/is/admin/locations/message.php
@@@ -1,8 -1,8 +1,8 @@@
<?php
- return array(
+ return [
- 'does_not_exist' => 'Location does not exist.',
+ 'does_not_exist' => 'Staðsetningin er ekki til.',
'assoc_users' => 'This location is currently associated with at least one user and cannot be deleted. Please update your users to no longer reference this location and try again. ',
'assoc_assets' => 'This location is currently associated with at least one asset and cannot be deleted. Please update your assets to no longer reference this location and try again. ',
'assoc_child_loc' => 'This location is currently the parent of at least one child location and cannot be deleted. Please update your locations to no longer reference this location and try again. ',
diff --cc resources/lang/is/admin/statuslabels/table.php
index 1741295201,ca62aed58a..1e458e6b54
--- a/resources/lang/is/admin/statuslabels/table.php
+++ b/resources/lang/is/admin/statuslabels/table.php
@@@ -1,19 -1,19 +1,19 @@@
<?php
- return array(
+ return [
'about' => 'About Status Labels',
- 'archived' => 'Archived',
+ 'archived' => 'Safnvistað',
'create' => 'Create Status Label',
'color' => 'Chart Color',
'default_label' => 'Default Label',
'default_label_help' => 'This is used to ensure your most commonly used status labels appear at the top of the select box when creating/editing assets.',
- 'deployable' => 'Deployable',
- 'info' => 'Status labels are used to describe the various states your assets could be in. They may be out for repair, lost/stolen, etc. You can create new status labels for deployable, pending and archived assets.',
+ 'deployable' => 'Nothæfar',
+ 'info' => 'Stöðumerkingar eru notaðar til að lýsa því ástandi sem eignir geta verið í. Þær geta verið í viðgerð, týndar/stolnar o. s. frv. Þú getur búið til nýjar stöðumerkingar fyrir eignir sem eru tilbúnar til ráðstöfunar, eru á bið eða hafa verið safnvistaðar.',
'name' => 'Status Name',
- 'pending' => 'Pending',
- 'status_type' => 'Status Type',
- 'show_in_nav' => 'Show in side nav',
+ 'pending' => 'Á bið',
+ 'status_type' => 'Tegund stöðu',
+ 'show_in_nav' => 'Sýna í hliðarvalmynd',
'title' => 'Status Labels',
- 'undeployable' => 'Undeployable',
+ 'undeployable' => 'Ónothæfar',
'update' => 'Update Status Label',
- );
+ ];
diff --cc resources/lang/is/admin/users/general.php
index 37593f089a,69d40d8bea..690279b16b
--- a/resources/lang/is/admin/users/general.php
+++ b/resources/lang/is/admin/users/general.php
@@@ -1,13 -1,12 +1,12 @@@
<?php
-
- return array(
+ return [
'activated_help_text' => 'This user can login',
'activated_disabled_help_text' => 'You cannot edit activation status for your own account.',
- 'assets_user' => 'Assets assigned to :name',
+ 'assets_user' => 'Eignum úthlutað til :name',
'bulk_update_warn' => 'You are about to edit the properties of :user_count users. Please note that you cannot change your own user attributes using this form, and must make edits to your own user individually.',
'bulk_update_help' => 'This form allows you to update multiple users at once. Only fill in the fields you need to change. Any fields left blank will remain unchanged.',
- 'current_assets' => 'Assets currently checked out to this user',
+ 'current_assets' => 'Eignir sem ráðstafað hefur verið til þessa notanda',
'clone' => 'Clone User',
'contact_user' => 'Contact :name',
'edit' => 'Edit User',
diff --cc resources/lang/is/admin/users/message.php
index 027ec5bb58,45f7def529..9cbb26594a
--- a/resources/lang/is/admin/users/message.php
+++ b/resources/lang/is/admin/users/message.php
@@@ -1,8 -1,8 +1,8 @@@
<?php
- return array(
+ return [
- 'accepted' => 'You have successfully accepted this asset.',
+ 'accepted' => 'Þú hefur samþykkt þessa eign.',
'declined' => 'You have successfully declined this asset.',
'bulk_manager_warn' => 'Your users have been successfully updated, however your manager entry was not saved because the manager you selected was also in the user list to be edited, and users may not be their own manager. Please select your users again, excluding the manager.',
'user_exists' => 'User already exists!',
diff --cc resources/lang/is/general.php
index 949da67848,6deab13c32..f0f52f0a12
--- a/resources/lang/is/general.php
+++ b/resources/lang/is/general.php
@@@ -40,23 -40,23 +40,23 @@@
'checkin' => 'Skrá inn',
'checkin_from' => 'Skráningarform',
'checkout' => 'Skrá út',
- 'checkouts_count' => 'Checkouts',
- 'checkins_count' => 'Checkins',
- 'user_requests_count' => 'Requests',
+ 'checkouts_count' => 'Ráðstafanir',
+ 'checkins_count' => 'Skil',
+ 'user_requests_count' => 'Beiðnir',
'city' => 'Borg',
- 'click_here' => 'Smelltu hér',
+ 'click_here' => 'Smelltu hér',
'clear_selection' => 'Hreinsa val',
'companies' => 'Fyrirtæki',
'company' => 'Fyrirtæki',
'component' => 'Eining',
'components' => 'Einingar',
- 'complete' => 'Lokið',
+ 'complete' => 'Lokið',
'consumable' => 'Consumable',
- 'consumables' => 'Consumables',
- 'country' => 'Country',
+ 'consumables' => 'Rekstrarvörur',
+ 'country' => 'Land',
'create' => 'Create New',
'created' => 'Item Created',
- 'created_asset' => 'created asset',
+ 'created_asset' => 'skráði eign',
'created_at' => 'Created at',
'record_created' => 'Record Created',
'updated_at' => 'Updated at',
diff --cc resources/lang/is/help.php
index b6cc21e4ad,ac0df59422..4a7510911f
--- a/resources/lang/is/help.php
+++ b/resources/lang/is/help.php
@@@ -13,11 -13,11 +13,11 @@@ return
|
*/
- "more_info_title" => "More Info",
+ 'more_info_title' => 'More Info',
- "audit_help" => "Checking this box will edit the asset record to reflect this new location. Leaving it unchecked will simply note the location in the audit log.<br><br>Note that is this asset is checked out, it will not change the location of the person, asset or location it is checked out to.",
+ 'audit_help' => 'Checking this box will edit the asset record to reflect this new location. Leaving it unchecked will simply note the location in the audit log.<br><br>Note that is this asset is checked out, it will not change the location of the person, asset or location it is checked out to.',
- 'assets' => 'Assets are items tracked by serial number or asset tag. They tend to be higher value items where identifying a specific item matters.',
+ 'assets' => 'Eignir eru hlutir sem hægt er að rekja með raðnúmeri eða öðrum merkingum. Þær eru alla jafna verðmætir hlutir sem mikilvægt er að geta aðgreint og borið kennsl á.',
'categories' => 'Categories help you organize your items. Some example categories might be &quot;Desktops&quot;, &quot;Laptops&quot;, &quot;Mobile Phones&quot;, &quot;Tablets&quot;, and so on, but you can use categories any way that makes sense for you.',
@@@ -27,10 -27,8 +27,8 @@@
'components' => 'Components are items that are part of an asset, for example HDD, RAM, etc.',
- 'consumables' => 'Consumables are anything purchased that will be used up over time. For example, printer ink or copier paper.',
+ 'consumables' => 'Rekstrarvörur er allt það sem eyðist eða rýrist við notkun, til dæmis blek í prentara eða ljósritunarpappír.',
- 'depreciations' => 'You can set up asset depreciations to depreciate assets based on straight-line depreciation.',
+ 'depreciations' => 'Þú getur búið til mismunandi fyrningarflokka til að afskrifa eignir eftir línulegu afskriftarferli.',
-
-
- );
+ ];
diff --cc resources/lang/is/pagination.php
index 4033984e92,b9940a133a..e373227d33
--- a/resources/lang/is/pagination.php
+++ b/resources/lang/is/pagination.php
@@@ -13,8 -13,8 +13,8 @@@ return
|
*/
- 'previous' => '&laquo; Previous',
+ 'previous' => '&laquo; Fyrri',
- 'next' => 'Next &raquo;',
+ 'next' => 'Næsta &raquo;',
- );
+ ];
diff --cc resources/lang/is/table.php
index 38ad9911a0,e5de4c440e..c929cdf3a2
--- a/resources/lang/is/table.php
+++ b/resources/lang/is/table.php
@@@ -1,10 -1,10 +1,10 @@@
<?php
- return array(
+ return [
- 'actions' => 'Actions',
- 'action' => 'Action',
- 'by' => 'By',
- 'item' => 'Item',
+ 'actions' => 'Aðgerðir',
+ 'action' => 'Aðgerð',
+ 'by' => 'Eftir',
+ 'item' => 'Atriði',
- );
+ ];
diff --cc resources/lang/it/mail.php
index 5a3c884d6a,965d4bfc1a..8f41b2b8b2
--- a/resources/lang/it/mail.php
+++ b/resources/lang/it/mail.php
@@@ -72,8 -72,8 +72,8 @@@ return
'Accessory_Checkin_Notification' => 'Checkin accessorio avvenuto',
'Asset_Checkin_Notification' => 'Checkin asset avvenuto',
'License_Checkin_Notification' => 'Checkin licenza avvenuto',
- 'Expected_Checkin_Report' => 'Expected asset checkin report',
- 'Expected_Checkin_Notification' => 'Reminder: :name checkin deadline approaching',
+ 'Expected_Checkin_Report' => 'Rapporto restituzione attesa del bene',
+ 'Expected_Checkin_Notification' => 'Promemoria: scadenza riconsegna :name in avvicinamento',
'Expected_Checkin_Date' => 'Un asset assegnato a te deve essere ricontrollato il :date',
- 'your_assets' => 'Visualizza i tuoi assets'
- );
+ 'your_assets' => 'Visualizza i tuoi assets',
+ ];
diff --cc resources/lang/ja/auth/general.php
index 62a9b5a2a8,228d57eac9..2fb1fe62b8
--- a/resources/lang/ja/auth/general.php
+++ b/resources/lang/ja/auth/general.php
@@@ -8,9 -8,7 +8,8 @@@ return
'login' => 'ログイン',
'login_prompt' => 'ログインしてください。',
'forgot_password' => 'パスワードを忘れました',
+ 'ldap_reset_password' => 'LDAPパスワードをリセットするにはここをクリックしてください',
'remember_me' => 'ログイン状態を維持する',
- 'username_help_top' => 'Enter your <strong>username</strong> to be emailed a password reset link.',
+ 'username_help_top' => 'パスワードリセットリンクを送信する対象の <strong>ユーザー名</strong> を入力してください。',
'username_help_bottom' => 'Your username and email address <em>may</em> be the same, but may not be, depending on your configuration. If you cannot remember your username, contact your administrator. <br><br><strong>Usernames without an associated email address will not be emailed a password reset link.</strong> ',
];
-
diff --cc resources/lang/pt-BR/admin/users/message.php
index 94ad2f00fc,d1a7c5edfb..abc50cebb9
--- a/resources/lang/pt-BR/admin/users/message.php
+++ b/resources/lang/pt-BR/admin/users/message.php
@@@ -12,10 -12,9 +12,9 @@@ return
'insufficient_permissions' => 'Permissões Insuficientes.',
'user_deleted_warning' => 'Este usuário foi deletado. Você terá que restaurar este usuário para editá-los ou atribui-lós novos bens.',
'ldap_not_configured' => 'Integração LDAP não foi configurada para esta instalação.',
- 'password_resets_sent' => 'The selected users who are activated and have a valid email addresses have been sent a password reset link.',
+ 'password_resets_sent' => 'Os usuários selecionados que são ativados e têm um endereço de e-mail válido receberam um link de redefinição de senha.',
-
- 'success' => array(
+ 'success' => [
'create' => 'O usuário foi criado com sucesso.',
'update' => 'O usuário foi atualizado com sucesso.',
'update_bulk' => 'Usuários atualizados com sucesso!',
diff --cc resources/lang/pt-BR/auth/general.php
index 47df7111de,310bef08ef..311e7ffa11
--- a/resources/lang/pt-BR/auth/general.php
+++ b/resources/lang/pt-BR/auth/general.php
@@@ -8,9 -8,7 +8,8 @@@ return
'login' => 'Nome de registro',
'login_prompt' => 'Faça o Login',
'forgot_password' => 'Esqueci minha senha',
+ 'ldap_reset_password' => 'Por favor clique aqui para redefinir sua senha LDAP',
'remember_me' => 'Lembrar-me',
'username_help_top' => 'Digite seu <strong>nome de usuário</strong> para receber um email com um link de redefinição de senha.',
- 'username_help_bottom' => 'Your username and email address <em>may</em> be the same, but may not be, depending on your configuration. If you cannot remember your username, contact your administrator. <br><br><strong>Usernames without an associated email address will not be emailed a password reset link.</strong> ',
+ 'username_help_bottom' => 'Seu nome de usuário e endereço de e-mail <em> podem </em> ser o mesmo, mas pode não ser, dependendo da sua configuração. Se você não conseguir lembrar seu nome de usuário, entre em contato com seu administrador. <br> <br> <strong> nomes de usuário sem um endereço de e-mail associado não será enviado por e-mail um link de redefinição de senha.</strong> ',
];
-
diff --cc resources/lang/sv-SE/auth/general.php
index a29241d65f,f154ad7b15..f738b55064
--- a/resources/lang/sv-SE/auth/general.php
+++ b/resources/lang/sv-SE/auth/general.php
@@@ -8,9 -8,7 +8,8 @@@ return
'login' => 'Logga in',
'login_prompt' => 'Vänligen logga in',
'forgot_password' => 'Jag har glömt mitt lösenord',
+ 'ldap_reset_password' => 'Klicka här för att återställa ditt LDAP-lösenord',
'remember_me' => 'Kom ihåg mig',
- 'username_help_top' => 'Enter your <strong>username</strong> to be emailed a password reset link.',
- 'username_help_bottom' => 'Your username and email address <em>may</em> be the same, but may not be, depending on your configuration. If you cannot remember your username, contact your administrator. <br><br><strong>Usernames without an associated email address will not be emailed a password reset link.</strong> ',
+ 'username_help_top' => 'Ange ditt <strong>användarnamn</strong> för att få en länk för att återställa lösenordet.',
+ 'username_help_bottom' => 'Ditt användarnamn och e-postadress <em>kan</em> vara samma, men kanske inte är beroende på din konfiguration. Om du inte kommer ihåg ditt användarnamn, kontakta din administratör. <br><br><strong>Användarnamn utan en associerad e-postadress kommer inte att få en länk för att återställa lösenordet.</strong> ',
];
-
diff --cc resources/views/depreciations/edit.blade.php
index 3a011cfb16,6e5a4ffe39..c523b21010
--- a/resources/views/depreciations/edit.blade.php
+++ b/resources/views/depreciations/edit.blade.php
@@@ -15,21 -15,21 +15,30 @@@
<label for="months" class="col-md-3 control-label">
{{ trans('admin/depreciations/general.number_of_months') }}
</label>
- <div class="col-md-7{{ (\App\Helpers\Helper::checkIfRequired($item, 'months')) ? ' required' : '' }}">
- <div class="col-md-2" style="padding-left:0px">
- <input class="form-control" type="text" name="months" id="months" value="{{ Request::old('months', $item->months) }}" style="width: 80px;" />
+ <div class="col-md-7 col-sm-12 {{ (\App\Helpers\Helper::checkIfRequired($item, 'months')) ? ' required' : '' }}">
+ <input class="form-control" type="text" name="months" aria-label="months" id="months" value="{{ Request::old('months', $item->months) }}" style="width: 80px;" />
+ {!! $errors->first('months', '<span class="alert-msg" aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
+ </div>
+
+ <!-- Depreciation Minimum -->
+ <div class="form-group {{ $errors->has('depreciation_min') ? ' has-error' : '' }}">
+ <label for="depreciation_min" class="col-md-3 control-label">
+ {{ trans('admin/depreciations/general.depreciation_min') }}
+ </label>
+ <div class="col-md-2" style="padding-left:0px">
+ <input class="form-control" name="depreciation_min" id="depreciation_min" value="{{ Request::old('depreciation_min', $item->depreciation_min) }}" style="width: 80px; margin-left:15px" />
</div>
- {!! $errors->first('months', '<span class="alert-msg" aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i> :message</span>') !!}
+ {!! $errors->first('depreciation_min', '<span class="alert-msg" aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
-
+<!-- Depreciation Minimum -->
+<div class="form-group {{ $errors->has('depreciation_min') ? ' has-error' : '' }}">
+ <label for="depreciation_min" class="col-md-3 control-label">
+ {{ trans('admin/depreciations/general.depreciation_min') }}
+ </label>
+ <div class="col-md-2" style="padding-left:0px">
+ <input class="form-control" name="depreciation_min" id="depreciation_min" value="{{ Request::old('depreciation_min', $item->depreciation_min) }}" style="width: 80px; margin-left:15px" />
+ </div>
+ {!! $errors->first('depreciation_min', '<span class="alert-msg" aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i> :message</span>') !!}
+</div>
@stop