Compare commits

...

164 Commits

Author SHA1 Message Date
snipe e433b0f9d8 Merge branch 'develop'
# Conflicts:
#	config/version.php
2017-11-14 16:50:05 -08:00
snipe f137e516a6 Bumped version 2017-11-14 16:49:18 -08:00
snipe ba38b841cb Constrain accessory by category ID if one is passed 2017-11-14 16:47:21 -08:00
snipe f7c6697a69 Merge branch 'develop' 2017-11-14 01:32:43 -08:00
snipe 498fc3762d Fixed #4437 - pagination for maintenances 2017-11-14 01:32:25 -08:00
snipe eb24eb1fff Merge branch 'develop' 2017-11-14 00:04:27 -08:00
snipe 3e5e6ba99a Use table alias for models join in search/order by models 2017-11-14 00:04:03 -08:00
snipe 0396267388 Fixed #4412 - use select2 ajax list for asset maintenances 2017-11-12 17:22:16 -08:00
snipe 4577ba39d7 Merge branch 'develop' 2017-11-10 15:56:34 -08:00
snipe 7eef1b4bcf Fixed #4418 - order models by name asc in selectlist 2017-11-10 15:56:14 -08:00
snipe 578da128e9 Merge branch 'develop' 2017-11-09 18:59:25 -08:00
snipe bb4d49690f Add purchase date to dates array so it’s treated as a Carbon date 2017-11-09 18:59:05 -08:00
snipe 7eb94d16a1 Merge branch 'develop' 2017-11-09 14:42:19 -08:00
snipe 65bd33c274 Make sure the user isn’t deleted before trying to display the name 2017-11-09 14:42:03 -08:00
snipe 0f7aa21a59 Merge branch 'develop' 2017-11-09 13:41:17 -08:00
snipe ee0814716a Only format ecpected checkin date if one exists 2017-11-09 13:40:55 -08:00
snipe f56e1768b6 Merge branch 'develop' 2017-11-09 13:28:12 -08:00
snipe 012afe99e2 Set purchase date to date type 2017-11-09 13:27:58 -08:00
snipe 0c02b6d24e Use —no-dev flag in upgrade 2017-11-09 13:25:44 -08:00
snipe 2f34336f2b Merge branch 'develop' 2017-11-09 11:18:21 -08:00
snipe afe6f43a1b Exclude manufacturer on filter sort 2017-11-09 11:18:04 -08:00
snipe 738e33b165 Merge branch 'develop' 2017-11-09 11:06:50 -08:00
snipe 566fd4d2e1 Only format purchase date if one exists 2017-11-09 11:06:37 -08:00
snipe c61887da21 Merge branch 'develop'
# Conflicts:
#	upgrade.php
2017-11-09 10:52:46 -08:00
snipe 6852b74317 Removed gates from selectlist method 2017-11-09 10:51:55 -08:00
snipe 4c266fdcf4 Merge branch 'develop' of github.com:snipe/snipe-it into develop 2017-11-08 20:28:23 -08:00
snipe c26a2f8291 Patching #4402 into develop 2017-11-08 20:28:18 -08:00
uknzaeinozpas a994e54726 Update upgrade.php (#4402)
posix_* are not supported on Windows platform
2017-11-08 20:13:35 -08:00
madd15 172c7c75a8 Fixed #4374 - Add option to display company names to labels (#4405)
* Migration - Labels Display Company Name setting

* Add Company Name to Labels

Add company name if it is turned on in settings and asset has a valid company

* Add Company Name checkbox to Label settings

* Add Company Name Lang

* Add display company name to postLabels

* Revert Add Company Name Lang

* Fix display company name in postLabels

* Change tinyInt to boolean for display company name

* Simplify checking for company and getting the name

* Change to square brackets for array notation

* Move divs inside if statements on optional fields
2017-11-08 20:05:39 -08:00
snipe 487fd17ce3 Fixed ambiguous query when selecting by model_id 2017-11-08 20:03:26 -08:00
snipe 65353fa422 Nicer styling for purchase cost in edit form
Made it more consistent with the warranty months foeld below it
2017-11-08 18:06:51 -08:00
snipe 4f4920615c Format expected checkin as Y-m-d in form 2017-11-08 18:06:14 -08:00
snipe c162c02304 Force expected checkin to be formatted as a date (not datetime) since it’s a date field in the DB 2017-11-08 18:03:47 -08:00
snipe 1bb1480f67 Added a comment around protected dates so we know wtf 2017-11-08 18:03:27 -08:00
snipe 8dceacc2b4 Merge branch 'develop' 2017-11-08 17:09:19 -08:00
snipe ffae537400 Check that the models are valid being trying to return a value in the ajax partials 2017-11-08 17:07:57 -08:00
snipe 5ce7882bf5 Merge branch 'develop' of github.com:snipe/snipe-it into develop 2017-11-08 17:01:50 -08:00
snipe b36594f508 Check that the company is valid in select ajax 2017-11-08 17:01:46 -08:00
madd15 59c9c22a59 Small UI Changes (#4404)
* Small ui change to settings nav

* Remove min-height

Removed min-height from Assets by Status

* Add min-height to box-body
2017-11-08 13:12:03 -08:00
snipe 9097681c13 Changed log fomrat in example env to single 2017-11-08 11:08:11 -08:00
snipe 567f741d95 Merge branch 'develop' 2017-11-08 10:59:29 -08:00
snipe 9b1fb90519 Change default log type back to single 2017-11-08 10:58:56 -08:00
snipe b567ffdcfe Fixed #2855 - checkin for components 2017-11-08 06:06:05 -08:00
snipe 9d44607b8f Added UI fade out when bootstrap alerts are dismissed 2017-11-08 03:13:18 -08:00
snipe 35ee52212f Added ability to disable the alert icon in the top menu 2017-11-08 03:08:17 -08:00
snipe e9e32fdb00 Merge branch 'develop' of github.com:snipe/snipe-it into develop 2017-11-08 02:46:40 -08:00
snipe 6c130ce8ac Apply patch #4354 2017-11-08 02:46:33 -08:00
Sorvani dd7db0de93 Moved firewall commands from CentOS 7 to a routine and called form both CentOS 7 and Fedora. (#4366) 2017-11-08 02:37:34 -08:00
snipe 70efac8fa7 Production js 2017-11-08 02:24:34 -08:00
snipe 6e2556eefd Production assets 2017-11-08 02:24:06 -08:00
snipe fb6a545cc6 Slightly nicer styling 2017-11-08 02:11:33 -08:00
snipe e5c1e41966 Nicer icheck for user menu 2017-11-08 01:52:35 -08:00
snipe 61617a2629 Slightly less fugly groups permission styling 2017-11-08 01:19:20 -08:00
snipe a3e80882c1 Better error handling for qr codes on invalid assets 2017-11-08 01:04:14 -08:00
snipe 31980c55de Merge branch 'develop'
# Conflicts:
#	config/version.php
2017-11-08 00:58:16 -08:00
snipe d1022e8ff7 Fixed #4390 - results couldn’t be loaded error
The baseUrl in the javascript routes is already appending a trailing slash, so don’t prepend a slash in front of api call
2017-11-08 00:57:43 -08:00
snipe e6ff447ee8 Bumped hash 2017-11-07 23:12:59 -08:00
snipe 1123272ae8 Bumped hash 2017-11-07 23:12:10 -08:00
snipe 74aa562a3b Merge branch 'develop' 2017-11-07 23:10:49 -08:00
snipe 74773ac912 Fixed incorrect policy reference in consumables listing 2017-11-07 23:05:29 -08:00
snipe 9764d2ad24 Removed commented code 2017-11-07 22:25:32 -08:00
snipe d03b8c6528 Error handling for when log ID has no match on asset accept 2017-11-07 22:25:24 -08:00
snipe 99a355145e Removed empty comments 2017-11-07 22:24:57 -08:00
snipe 7233e2dded Merge branch 'develop' 2017-11-07 18:21:47 -08:00
snipe eed50112d5 Better fallback for local that won’t break migrations 2017-11-07 18:18:27 -08:00
snipe 5aee5a3f3d Update location on checkout, error if bad target 2017-11-07 17:37:08 -08:00
snipe f21c7ba312 Merge branch 'develop' 2017-11-07 11:28:41 -08:00
snipe 9d7455f022 Fixed handling deleting old images better 2017-11-07 11:28:13 -08:00
snipe b748e7ed5e Fixed transformers to use new singleton upload urls 2017-11-07 11:11:47 -08:00
snipe 84a717c6ad Fixed deleted ordering scope 2017-11-07 11:06:38 -08:00
snipe a202e1657c Fixed path for singletons 2017-11-06 21:58:28 -08:00
snipe 30ec919048 Remove AWS package
We unfortunately can’t use it right now because it requires a symlink from the storage/app directory. Until we have a better way of checking for configuration issues and/or automatically handling that symlink creation, we’re pulling it for now, since it’s not used anywhere.
2017-11-06 21:45:31 -08:00
snipe 4ae4083b7b Removed unused $matches variable 2017-11-06 21:26:30 -08:00
snipe dec9ac1ac8 Fixed lowercase false 2017-11-06 21:25:40 -08:00
snipe 8776d28d3b Remove fastclick from package.json
We’re not using it anymore because of conflicts with select2. Select2 is more important for our UX than fastclick is.
2017-11-06 21:22:18 -08:00
snipe 231dea0ebc Break out service providers by responsibility 2017-11-06 21:17:17 -08:00
snipe cceeb5c8a2 Disable Fastclick - conflicts with Select2, per #4392 2017-11-06 21:16:20 -08:00
snipe 579334b5fc Fixed - name should always be required in custom fields 2017-11-06 20:05:40 -08:00
snipe 3a82fbe714 Switch to rollbar’s official package 2017-11-06 20:04:50 -08:00
snipe 143071fa0c Merge branch 'develop' 2017-11-06 17:18:18 -08:00
snipe 0589652edb Fixed #4392 - select2 + fastclick incompatibility
This is a workaround fix - should upgrade both to latest after testing extensively
2017-11-06 17:17:48 -08:00
snipe b772d8e527 Fix for IIS+ Chrome not showing webfonts
Thanks, @BrettFagerlund!
2017-11-06 16:51:46 -08:00
snipe b96d4dcf1f Don’t show ANY in custom regex field if empty 2017-11-06 16:43:27 -08:00
snipe dc32e4bdb0 Fixed form request ffor custom fields 2017-11-06 16:42:37 -08:00
snipe 43f2a530f5 Merge branch 'develop' 2017-11-06 12:39:00 -08:00
snipe 6ece593629 Fixed #4381 - asset uploads 2017-11-06 12:38:31 -08:00
snipe 33de0ec8a9 Merge branch 'develop' 2017-11-06 12:19:48 -08:00
snipe 8e17714c12 Fixed #4384 - bulk checkout of assets 2017-11-06 12:19:22 -08:00
snipe 32fc052c3b Fixed #4391 - companies now listing correct assets 2017-11-06 12:01:54 -08:00
snipe 17febca466 Merge branch 'develop' 2017-11-06 10:55:42 -08:00
snipe 8572a9771b Only return location name if find is valid 2017-11-06 10:55:20 -08:00
snipe 3ea294c0e6 Merge branch 'develop' 2017-11-06 10:45:14 -08:00
snipe 2b3b2e3197 Removed presenter references in custom report 2017-11-06 10:44:57 -08:00
snipe a9d9234fb3 One more fix for custom reports 2017-11-06 10:44:18 -08:00
snipe a11d9b84a4 Merge branch 'develop' 2017-11-06 10:42:48 -08:00
snipe 936ff707c7 Fixed custom report bug if assignedTo has no value 2017-11-06 10:42:34 -08:00
snipe def69b1aaa Merge branch 'develop' 2017-11-06 10:30:42 -08:00
snipe 4818e1b8ca Fixed sorting for filtered items by location 2017-11-06 10:26:09 -08:00
snipe 623f21e51f Merge branch 'develop' 2017-11-04 18:21:09 -07:00
snipe bd524ff2f3 Removed buggy migration code switched to artisan command 2017-11-04 18:20:41 -07:00
snipe 04ab522ee3 Fixes #4236 - validate the regex custom validation (#4380)
* More helpful text on how the custom validator works

* Clarified language of custom format, fixed regex example

* Fixed regex example in placeholder

* Added comments to custom fields

* Added regex validation string

* Added valid_regex validator in format requirements

* Removed useles comments

* Fixes #4236 - validate the regex custom validation
2017-11-04 17:06:14 -07:00
snipe f672b14468 Ignore deleted assets and check for valid location in artisan command 2017-11-04 16:20:31 -07:00
snipe b0973de1a6 Merge branch 'develop' 2017-11-04 01:24:23 -07:00
snipe fe06ef10f1 Set the items array variable for no results 2017-11-04 01:23:50 -07:00
snipe 14ca690441 Merge branch 'develop' 2017-11-04 01:11:41 -07:00
snipe 2de0a3669e Check that there is a valid array before unshifting 2017-11-04 01:11:11 -07:00
snipe c7c63e8432 Merge branch 'develop' 2017-11-04 00:49:19 -07:00
snipe adf6afbb43 Moved delay back to 250 on ajax menus 2017-11-04 00:48:54 -07:00
snipe 69b90fb65e Merge branch 'develop' 2017-11-04 00:46:22 -07:00
snipe 97ea68b15c Updated translations 2017-11-04 00:45:50 -07:00
snipe badc763c06 Bumped version 2017-11-04 00:32:33 -07:00
snipe b6a14d2c9c Production assets 2017-11-04 00:20:06 -07:00
snipe d59dd0f636 Reduced rate limit from 250 to 100 2017-11-04 00:20:00 -07:00
snipe d68d95a915 Fixed - Added a “clear selection” option to select2 ajax lists 2017-11-04 00:19:16 -07:00
snipe 15d4344efb Comments in the JS 2017-11-04 00:15:23 -07:00
snipe dc10f18188 Merge branch 'develop' 2017-11-03 21:53:13 -07:00
snipe 2522bfee9c Only return mnon-archived assets by location 2017-11-03 21:46:11 -07:00
snipe d7f8615964 Fixed query for location ID 2017-11-03 20:10:36 -07:00
snipe 88dff754b1 Fixed swapped asset total headings 2017-11-03 20:10:16 -07:00
snipe ecd21074fb Commented out erroneous fixme 2017-11-03 20:10:05 -07:00
snipe 12caa48390 Uncommented info output 2017-11-03 19:42:54 -07:00
snipe cc7be5f947 Added location to checkout in API 2017-11-03 19:42:45 -07:00
snipe 5b489e003d Set the location_id on save/update to rtd if one is given 2017-11-03 19:41:26 -07:00
snipe 8c1f4b006e Removed comment 2017-11-03 19:40:55 -07:00
snipe 3a52c19428 Updated fieldname in Locations transformer and API 2017-11-03 19:40:40 -07:00
snipe 279ad6d80a Updasted fieldname in locations table 2017-11-03 19:40:04 -07:00
snipe b786791401 Added location to checkout method 2017-11-03 19:39:48 -07:00
snipe 1c12b6e13b Added artisan command to sync locations 2017-11-03 19:00:36 -07:00
snipe c06539dee3 Update the location ID if there is an rtd_location given 2017-11-03 17:36:18 -07:00
snipe 3b9544d1f3 Remove commented code 2017-11-03 17:35:46 -07:00
snipe da9bb07041 Add a default legacy cipher of rijndael-256 2017-11-03 16:27:03 -07:00
snipe 5d9b9ad590 Merge branch 'develop' 2017-11-03 15:05:07 -07:00
snipe f95502ae35 Fixed search by model on adsvanced search for assets 2017-11-03 15:04:21 -07:00
snipe 877daba096 Merge branch 'develop' 2017-11-03 14:59:38 -07:00
snipe b3b8ab493e Switch to the reply_to address 2017-11-03 14:58:49 -07:00
snipe 1859c8f5ab Reply to seems to be overwritten 2017-11-03 14:55:03 -07:00
snipe 87ba042b2d Fixed manager name subquery on user search
Self-joins in Laravel make baby jesus cry :(
2017-11-03 14:47:31 -07:00
snipe 6fb0ef908d Fixed issue sorting when viewing users by department 2017-11-03 14:29:04 -07:00
snipe c4a30cc646 Merge branch 'develop' 2017-11-03 13:29:33 -07:00
snipe cf56f70b3a Added table alias for sorting 2017-11-03 13:28:57 -07:00
snipe f84e6a34cc Merge branch 'develop' 2017-11-03 13:04:18 -07:00
snipe 85360a7c7f Removed gates on selectlists
They can’t access the API directly unless they have been granted API accesses anyway
2017-11-03 13:03:57 -07:00
snipe 9e0b3afa91 Merge branch 'develop' 2017-11-03 12:48:17 -07:00
snipe 416455fe01 Fixes weird manager_id validation
This is a shit fix - need to find out what’s happening here.
2017-11-03 12:48:00 -07:00
snipe 53a1511cac No idea why this is needed, but… 2017-11-03 12:20:11 -07:00
snipe 733921f1f9 Added optional required parameter 2017-11-03 12:17:41 -07:00
snipe 3ecaa99990 Fixed only undeployed assets in checkout to list 2017-11-03 11:33:36 -07:00
Kasey ab9729c39a fix to availCount() (licenseSeatRelation) (#4378)
`license_seats`.`user_id` represents an overall "owner" of the license
2017-11-03 09:51:15 -07:00
snipe 104cc2bf11 Make sure the seat hasn’t been deleted 2017-11-02 21:07:59 -07:00
snipe 1659c3f1a6 Fixed inconsistent color type on checkin/checkout 2017-11-02 20:42:07 -07:00
snipe caa8ec3178 Fixed checkout on license view page 2017-11-02 20:23:17 -07:00
snipe 0c794c103b Return an integer value for free seats if null 2017-11-02 20:23:04 -07:00
snipe 53175d5035 Fixed sorting issue on company/manufacturer/supplier 2017-11-02 20:01:39 -07:00
snipe 0bd09f9c46 Added sorting on available and total seats 2017-11-02 19:37:30 -07:00
snipe 27d795508d Fixed n+1 query, changed checkout behavior to just ask for a license ID
We’re offloading the freeSeat() to the checkout page now
2017-11-02 19:16:09 -07:00
snipe 368ac5b85d First stab at handling the n+1 issue on licenses 2017-11-02 18:20:42 -07:00
snipe d5635f32e5 Merge branch 'develop' 2017-11-02 17:23:14 -07:00
snipe f47075c180 Removed depreciation from Licenses transformer 2017-11-02 17:18:53 -07:00
snipe 0a5e4b9b7b Fixed inconsistent required field indicator 2017-11-02 17:13:06 -07:00
snipe 85624205b4 Updated Lang::get to trans 2017-11-02 17:12:51 -07:00
snipe 2330e5ee57 Merge branch 'develop' 2017-11-02 16:20:48 -07:00
snipe c9c5ce6ee0 Return Deleted User if the user is invalid for some reason 2017-11-02 16:20:01 -07:00
snipe fc3a59d193 Merge branch 'develop' 2017-11-02 13:47:52 -07:00
snipe 950519be5d Added a few more table aliases for ordering complex results 2017-11-02 13:47:37 -07:00
330 changed files with 2471 additions and 1416 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ LOGIN_LOCKOUT_DURATION=60
# --------------------------------------------
# OPTIONAL: MISC
# --------------------------------------------
APP_LOG=daily
APP_LOG=single
APP_LOG_MAX_FILES=10
APP_LOCKED=false
FILESYSTEM_DISK=local
+1 -1
View File
@@ -49,7 +49,7 @@ class RecryptFromMcrypt extends Command
// If not, we can try to use the current APP_KEY if looks like it's old
$legacy_key = env('LEGACY_APP_KEY');
$key_parts = explode(':', $legacy_key);
$legacy_cipher = env('LEGACY_CIPHER');
$legacy_cipher = env('LEGACY_CIPHER', 'rijndael-256');
$errors = array();
if (!$legacy_key) {
+148
View File
@@ -0,0 +1,148 @@
<?php
namespace App\Console\Commands;
use App\Models\CustomField;
use Illuminate\Console\Command;
use App\Models\Asset;
use Illuminate\Support\Facades\Storage;
class SyncAssetLocations extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:sync-asset-locations {--output= : info|warn|error|all} ';
/**
* The console command description.
*
* @var string
*/
protected $description = 'This utility will sync the location_id of assets based on current state. It should not normally be needed, but is a safeguard in case we missed something in the Great Migration when flattening the assets to location relationship.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$output['info'] = [];
$output['warn'] = [];
$output['error'] = [];
$total_assets = Asset::whereNull('deleted_at')->get();
$bar = $this->output->createProgressBar(count($total_assets));
// Unassigned
$rtd_assets = Asset::whereNull('assigned_to')->whereNull('deleted_at')->with('defaultLoc')->get();
$output['info'][] = 'There are '.$rtd_assets->count().' unassigned assets.';
foreach ($rtd_assets as $rtd_asset) {
$output['info'][] = 'Setting Unassigned Asset ' . $rtd_asset->id . ' ('.$rtd_asset->asset_tag.') to location: ' . $rtd_asset->rtd_location_id . " because their default location is: " . $rtd_asset->rtd_location_id;
$rtd_asset->location_id=$rtd_asset->rtd_location_id;
$rtd_asset->unsetEventDispatcher();
$rtd_asset->save();
$bar->advance();
}
$assigned_user_assets = Asset::where('assigned_type','App\Models\User')->whereNotNull('assigned_to')->whereNull('deleted_at')->get();
$output['info'][] = 'There are '.$assigned_user_assets->count().' assets checked out to users.';
foreach ($assigned_user_assets as $assigned_user_asset) {
if (($assigned_user_asset->assignedTo) && ($assigned_user_asset->assignedTo->userLoc)) {
$new_location=$assigned_user_asset->assignedTo->userloc->id;
$output['info'][] ='Setting User Asset ' . $assigned_user_asset->id . ' ('.$assigned_user_asset->asset_tag.') to ' . $assigned_user_asset->assignedTo->userLoc->name . ' which is id: ' . $new_location;
} else {
$output['warn'][] ='Asset ' . $assigned_user_asset->id . ' ('.$assigned_user_asset->asset_tag.') still has no location! ';
$new_location = $assigned_user_asset->rtd_location_id;
}
$assigned_user_asset->location_id=$new_location;
$assigned_user_asset->unsetEventDispatcher();
$assigned_user_asset->save();
$bar->advance();
}
$assigned_location_assets = Asset::where('assigned_type','App\Models\Location')
->whereNotNull('assigned_to')->whereNull('deleted_at')->get();
$output['info'][] = 'There are '.$assigned_location_assets->count().' assets checked out to locations.';
foreach ($assigned_location_assets as $assigned_location_asset) {
if ($assigned_location_asset->assignedTo) {
$assigned_location_asset->location_id = $assigned_location_asset->assignedTo->id;
$output['info'][] ='Setting Location Assigned asset ' . $assigned_location_asset->id . ' ('.$assigned_location_asset->asset_tag.') that is checked out to '.$assigned_location_asset->assignedTo->name.' (#'.$assigned_location_asset->assignedTo->id.') to location: ' . $assigned_location_asset->assetLoc()->id;
$assigned_location_asset->unsetEventDispatcher();
$assigned_location_asset->save();
} else {
$output['warn'][] ='Asset ' . $assigned_location_asset->id . ' ('.$assigned_location_asset->asset_tag.') did not return a valid associated location - perhaps it was deleted?';
}
$bar->advance();
}
// Assigned to assets
$assigned_asset_assets = Asset::where('assigned_type','App\Models\Asset')
->whereNotNull('assigned_to')->whereNull('deleted_at')->get();
$output['info'][] ='Asset-assigned assets: '.$assigned_asset_assets->count();
foreach ($assigned_asset_assets as $assigned_asset_asset) {
// Check to make sure there aren't any invalid relationships
if ($assigned_asset_asset->assetLoc()) {
$assigned_asset_asset->location_id = $assigned_asset_asset->assetLoc()->id;
$output['info'][] ='Setting Asset Assigned asset ' . $assigned_asset_asset->assetLoc()->id. ' ('.$assigned_asset_asset->asset_tag.') location to: ' . $assigned_asset_asset->assetLoc()->id;
$assigned_asset_asset->unsetEventDispatcher();
$assigned_asset_asset->save();
} else {
$output['warn'][] ='Asset Assigned asset ' . $assigned_asset_asset->assetLoc()->id. ' ('.$assigned_asset_asset->asset_tag.') does not seem to have a valid location';
}
$bar->advance();
}
$unlocated_assets = Asset::whereNull("location_id")->whereNull('deleted_at')->get();
$output['info'][] ='Assets still without a location: '.$unlocated_assets->count();
foreach($unlocated_assets as $unlocated_asset) {
$output['warn'][] ='Asset: '.$unlocated_asset->id.' still has no location. ';
$bar->advance();
}
$bar->finish();
$this->info("\n");
if (($this->option('output')=='all') || ($this->option('output')=='info')) {
foreach ($output['info'] as $key => $output_text) {
$this->info($output_text);
}
}
if (($this->option('output')=='all') || ($this->option('output')=='warn')) {
foreach ($output['warn'] as $key => $output_text) {
$this->warn($output_text);
}
}
if (($this->option('output')=='all') || ($this->option('output')=='error')) {
foreach ($output['error'] as $key => $output_text) {
$this->error($output_text);
}
}
}
}
+2 -1
View File
@@ -26,7 +26,8 @@ class Kernel extends ConsoleKernel
Commands\LdapSync::class,
Commands\FixDoubleEscape::class,
Commands\RecryptFromMcrypt::class,
Commands\ResetDemoSettings::class
Commands\ResetDemoSettings::class,
Commands\SyncAssetLocations::class,
];
/**
@@ -34,6 +34,10 @@ class AccessoriesController extends Controller
$accessories->where('company_id','=',$request->input('company_id'));
}
if ($request->has('category_id')) {
$accessories->where('category_id','=',$request->input('category_id'));
}
if ($request->has('manufacturer_id')) {
$accessories->where('manufacturer_id','=',$request->input('manufacturer_id'));
}
@@ -56,11 +56,9 @@ class AssetMaintenancesController extends Controller
break;
}
$total = $maintenances->count();
$maintenances = $maintenances->skip($offset)->take($limit)->get();
return (new AssetMaintenancesTransformer())->transformAssetMaintenances($maintenances, $maintenances->count());
return (new AssetMaintenancesTransformer())->transformAssetMaintenances($maintenances, $total);
}
@@ -182,21 +182,20 @@ class AssetModelsController extends Controller
*/
public function selectlist(Request $request)
{
$this->authorize('view', AssetModel::class);
$assetmodels = AssetModel::select([
'models.id',
'models.name',
'models.image',
'models.model_number',
]);
])->with('manufacturer');
if ($request->has('search')) {
$assetmodels = $assetmodels->where('models.name', 'LIKE', '%'.$request->get('search').'%')
->orWhere('models.model_number', 'LIKE', '%'.$request->get('search').'%');
}
$assetmodels = $assetmodels->paginate(50);
$assetmodels = $assetmodels->orderby('models.name', 'asc')->orderby('models.model_number', 'asc')->paginate(50);
foreach ($assetmodels as $assetmodel) {
$assetmodel->use_text = $assetmodel->present()->modelName;
+28 -10
View File
@@ -112,7 +112,7 @@ class AssetsController extends Controller
}
if ($request->has('location_id')) {
$assets->ByLocationId($request->input('location_id'));
$assets->where('assets.location_id', '=', $request->input('location_id'));
}
if ($request->has('supplier_id')) {
@@ -275,14 +275,14 @@ class AssetsController extends Controller
*/
public function selectlist(Request $request)
{
$this->authorize('view', Asset::class);
$assets = Company::scopeCompanyables(Asset::select([
'assets.id',
'assets.name',
'assets.asset_tag',
'assets.model_id',
]))->with('model')->RTD();
'assets.status_id'
])->with('model', 'assetstatus')->NotArchived());
if ($request->has('search')) {
@@ -300,6 +300,10 @@ class AssetsController extends Controller
// they may not have a ->name value but we want to display something anyway
foreach ($assets as $asset) {
$asset->use_text = $asset->present()->fullName;
if ($asset->assetstatus->getStatuslabelType()=='pending') {
$asset->use_text = $asset->present()->fullName.' ('.$asset->assetstatus->getStatuslabelType().')';
}
$asset->use_image = ($asset->getImageUrl()) ? $asset->getImageUrl() : null;
}
@@ -417,6 +421,8 @@ class AssetsController extends Controller
$asset->requestable = $request->get('requestable') : '';
($request->has('rtd_location_id')) ?
$asset->rtd_location_id = $request->get('rtd_location_id') : '';
($request->has('rtd_location_id')) ?
$asset->location_id = $request->get('rtd_location_id') : '';
($request->has('company_id')) ?
$asset->company_id = Company::getIdForCurrentUser($request->get('company_id')) : '';
@@ -434,14 +440,17 @@ class AssetsController extends Controller
if ($request->get('assigned_user')) {
$target = User::find(request('assigned_user'));
$location = $target->location_id;
} elseif ($request->get('assigned_asset')) {
$target = Asset::find(request('assigned_asset'));
$location = $target->location_id;
} elseif ($request->get('assigned_location')) {
$target = Location::find(request('assigned_location'));
$location = $target->id;
}
if (isset($target)) {
$asset->checkOut($target, Auth::user(), date('Y-m-d H:i:s'), '', 'Checked out on asset update', e($request->get('name')));
$asset->checkOut($target, Auth::user(), date('Y-m-d H:i:s'), '', 'Checked out on asset update', e($request->get('name')), $location);
}
return response()->json(Helper::formatStandardApiResponse('success', $asset, trans('admin/hardware/message.update.success')));
@@ -508,14 +517,18 @@ class AssetsController extends Controller
];
if ($request->has('user_id')) {
$target = User::find($request->input('user_id'));
$location = $target->location_id;
$error_payload['target_id'] = $request->input('user_id');
$error_payload['target_type'] = User::class;
// Don't let the user check an asset out to itself
} elseif ($request->has('asset_id')) {
$target = Asset::where('id','!=',$asset_id)->find($request->input('asset_id'));
$location = $target->location_id;
$error_payload['target_id'] = $request->input('asset_id');
$error_payload['target_type'] = Asset::class;
} elseif ($request->has('location_id')) {
$target = Location::find($request->input('location_id'));
$location = $target->id;
$target = Location::find($request->input('location_id'));
$error_payload['target_id'] = $request->input('location_id');
$error_payload['target_type'] = Location::class;
@@ -537,13 +550,11 @@ class AssetsController extends Controller
$asset->location_id = $target->rtd_location_id;
}
// Overwrite that if the target has a location ID though
if ($target->location_id!='') {
$asset->location_id = $target->location_id;
}
$asset->location_id = $location;
if ($asset->checkOut($target, Auth::user(), $checkout_at, $expected_checkin, $note, $asset_name)) {
if ($asset->checkOut($target, Auth::user(), $checkout_at, $expected_checkin, $note, $asset_name, $location)) {
return response()->json(Helper::formatStandardApiResponse('success', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkout.success')));
}
@@ -559,7 +570,7 @@ class AssetsController extends Controller
* @since [v4.0]
* @return JsonResponse
*/
public function checkin($asset_id)
public function checkin(Request $request, $asset_id)
{
$this->authorize('checkin', Asset::class);
$asset = Asset::findOrFail($asset_id);
@@ -577,6 +588,13 @@ class AssetsController extends Controller
$asset->assignedTo()->disassociate($asset);
$asset->accepted = null;
$asset->name = e(Input::get('name'));
$asset->location_id = $asset->rtd_location_id;
if ($request->has('location_id')) {
$asset->location_id = $request->input('location_id');
}
$asset->location_id = $asset->rtd_location_id;
if (Input::has('status_id')) {
$asset->status_id = e(Input::get('status_id'));
@@ -153,7 +153,6 @@ class CompaniesController extends Controller
*/
public function selectlist(Request $request)
{
$this->authorize('view', Company::class);
$companies = Company::select([
'companies.id',
@@ -160,7 +160,6 @@ class ConsumablesController extends Controller
*/
public function getDataView($consumableId)
{
//$consumable = Consumable::find($consumableID);
$consumable = Consumable::with(array('consumableAssignments'=>
function ($query) {
$query->orderBy('created_at', 'DESC');
@@ -171,17 +170,15 @@ class ConsumablesController extends Controller
},
))->find($consumableId);
// $consumable->load('consumableAssignments.admin','consumableAssignments.user');
if (!Company::isCurrentUserHasAccess($consumable)) {
return ['total' => 0, 'rows' => []];
}
$this->authorize('view', Component::class);
$this->authorize('view', Consumable::class);
$rows = array();
foreach ($consumable->consumableAssignments as $consumable_assignment) {
$rows[] = [
'name' => $consumable_assignment->user->present()->nameUrl(),
'name' => ($consumable_assignment->user) ? $consumable_assignment->user->present()->nameUrl() : 'Deleted User',
'created_at' => ($consumable_assignment->created_at->format('Y-m-d H:i:s')=='-0001-11-30 00:00:00') ? '' : $consumable_assignment->created_at->format('Y-m-d H:i:s'),
'admin' => ($consumable_assignment->admin) ? $consumable_assignment->admin->present()->nameUrl() : '',
];
@@ -122,7 +122,6 @@ class DepartmentsController extends Controller
*/
public function selectlist(Request $request)
{
$this->authorize('view', Department::class);
$departments = Department::select([
'id',
@@ -21,7 +21,7 @@ class LicensesController extends Controller
public function index(Request $request)
{
$this->authorize('view', License::class);
$licenses = Company::scopeCompanyables(License::with('company', 'licenseSeatsRelation', 'manufacturer', 'supplier'));
$licenses = Company::scopeCompanyables(License::with('company', 'manufacturer', 'freeSeats', 'supplier')->withCount('freeSeats'));
if ($request->has('search')) {
$licenses = $licenses->TextSearch($request->input('search'));
@@ -77,17 +77,17 @@ class LicensesController extends Controller
switch ($request->input('sort')) {
case 'manufacturer':
$licenses = $licenses->OrderManufacturer($order);
case 'manufacturer':
$licenses = $licenses->leftJoin('manufacturers', 'licenses.manufacturer_id', '=', 'manufacturers.id')->orderBy('manufacturers.name', $order);
break;
case 'supplier':
$licenses = $licenses->OrderSupplier($order);
$licenses = $licenses->leftJoin('suppliers', 'licenses.supplier_id', '=', 'suppliers.id')->orderBy('suppliers.name', $order);
break;
case 'company':
$licenses = $licenses->OrderCompany($order);
$licenses = $licenses->leftJoin('companies', 'licenses.company_id', '=', 'companies.id')->orderBy('companies.name', $order);
break;
default:
$allowed_columns = ['id','name','purchase_cost','expiration_date','purchase_order','order_number','notes','purchase_date','serial','company','license_name','license_email'];
$allowed_columns = ['id','name','purchase_cost','expiration_date','purchase_order','order_number','notes','purchase_date','serial','company','license_name','license_email','free_seats_count','seats'];
$sort = in_array($request->input('sort'), $allowed_columns) ? e($request->input('sort')) : 'created_at';
$licenses = $licenses->orderBy($sort, $order);
break;
@@ -95,6 +95,7 @@ class LicensesController extends Controller
$total = $licenses->count();
$licenses = $licenses->skip($offset)->take($limit)->get();
return (new LicensesTransformer)->transformLicenses($licenses, $total);
@@ -24,7 +24,7 @@ class LocationsController extends Controller
$allowed_columns = [
'id','name','address','address2','city','state','country','zip','created_at',
'updated_at','parent_id', 'manager_id','image',
'rtd_assets_count','users_count','assets_count'];
'assigned_assets_count','users_count','assets_count'];
$locations = Location::with('parent', 'manager', 'childLocations')->select([
'locations.id',
@@ -41,7 +41,7 @@ class LocationsController extends Controller
'locations.updated_at',
'locations.image',
'locations.currency'
])->withCount('rtd_assets')
])->withCount('assignedAssets')
->withCount('assets')
->withCount('users');
@@ -152,7 +152,6 @@ class LocationsController extends Controller
*/
public function selectlist(Request $request)
{
$this->authorize('view', Location::class);
$locations = Location::select([
'locations.id',
@@ -132,7 +132,6 @@ class ManufacturersController extends Controller
*/
public function selectlist(Request $request)
{
$this->authorize('view', Manufacturers::class);
$manufacturers = Manufacturer::select([
'id',
@@ -108,11 +108,11 @@ class SettingsController extends Controller
if (!config('app.lock_passwords')) {
try {
Mail::send('emails.test', [], function ($m) {
$m->to(config('mail.from.address'), config('mail.from.name'));
$m->to(config('mail.reply_to.address'), config('mail.reply_to.name'));
$m->replyTo(config('mail.reply_to.address'), config('mail.reply_to.name'));
$m->subject(trans('mail.test_email'));
});
return response()->json(['message' => 'Mail sent to '.config('mail.from.address')], 200);
return response()->json(['message' => 'Mail sent to '.config('mail.reply_to.address')], 200);
} catch (Exception $e) {
return response()->json(['message' => $e->getMessage()], 500);
}
@@ -146,7 +146,6 @@ class SuppliersController extends Controller
*/
public function selectlist(Request $request)
{
$this->authorize('view', Supplier::class);
$suppliers = Supplier::select([
'id',
+5 -2
View File
@@ -80,7 +80,7 @@ class UsersController extends Controller
}
if ($request->has('department_id')) {
$users = $users->where('department_id','=',$request->input('department_id'));
$users = $users->where('users.department_id','=',$request->input('department_id'));
}
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
@@ -127,7 +127,6 @@ class UsersController extends Controller
*/
public function selectlist(Request $request)
{
$this->authorize('view', User::class);
$users = User::select(
[
@@ -225,6 +224,10 @@ class UsersController extends Controller
$user = User::findOrFail($id);
$user->fill($request->all());
if ($user->id == $request->input('manager_id')) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'You cannot be your own manager'));
}
if ($request->has('password')) {
$user->password = bcrypt($request->input('password'));
}
@@ -154,16 +154,21 @@ class AssetMaintenancesController extends Controller
*/
public function create()
{
$asset = null;
if ($asset = Asset::find(request('asset_id'))) {
// We have to set this so that the correct property is set in the select2 ajax dropdown
$asset->asset_id = $asset->id;
}
// Prepare Asset Maintenance Type List
$assetMaintenanceType = [
'' => 'Select an asset maintenance type',
] + AssetMaintenance::getImprovementOptions();
// Mark the selected asset, if it came in
// Render the view
return view('asset_maintenances/edit')
->with('asset_list', Helper::detailedAssetList())
->with('selectedAsset', request('asset_id'))
->with('supplier_list', Helper::suppliersList())
->with('asset', $asset)
->with('assetMaintenanceType', $assetMaintenanceType)
->with('item', new AssetMaintenance);
}
+21 -19
View File
@@ -91,7 +91,7 @@ class AssetModelsController extends Controller
$image = Input::file('image');
$file_name = str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
$path = public_path('uploads/models/');
$path = app('models_upload_path');
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(500, null, function ($constraint) {
@@ -191,15 +191,14 @@ class AssetModelsController extends Controller
return redirect()->route('models.index')->with('error', trans('admin/models/message.does_not_exist'));
}
$model->depreciation_id = $request->input('depreciation_id');
$model->eol = $request->input('eol');
$model->depreciation_id = $request->input('depreciation_id');
$model->eol = $request->input('eol');
$model->name = $request->input('name');
$model->model_number = $request->input('model_number');
$model->manufacturer_id = $request->input('manufacturer_id');
$model->category_id = $request->input('category_id');
$model->notes = $request->input('notes');
$model->requestable = Input::has('requestable');
$model->requestable = $request->input('requestable', '0');
if ($request->input('custom_fieldset')=='') {
$model->fieldset_id = null;
@@ -207,35 +206,38 @@ class AssetModelsController extends Controller
$model->fieldset_id = $request->input('custom_fieldset');
}
if (Input::file('image')) {
$old_image = $model->image;
$image = Input::file('image');
$file_name = str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
$path = public_path('uploads/models/');
$old_image = $path.$model->image;
// Set the model's image property to null if the image is being deleted
if ($request->input('image_delete') == 1) {
$model->image = null;
}
try {
unlink($old_image);
} catch (\Exception $e) {
\Log::error($e);
}
if ($request->file('image')) {
$image = $request->file('image');
$file_name = $model->id.'-'.str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(500, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path.'/'.$file_name);
})->save(app('models_upload_path').$file_name);
} else {
$image->move($path, $file_name);
$image->move(app('models_upload_path'), $file_name);
}
$model->image = $file_name;
}
if ($request->input('image_delete') == 1 && Input::file('image') == "") {
$model->image = null;
if ((($request->file('image')) && (isset($old_image)) && ($old_image!='')) || ($request->input('image_delete') == 1)) {
try {
unlink(app('models_upload_path').$old_image);
} catch (\Exception $e) {
\Log::error($e);
}
}
if ($model->save()) {
return redirect()->route("models.index")->with('success', trans('admin/models/message.update.success'));
}
+53 -27
View File
@@ -160,6 +160,10 @@ class AssetsController extends Controller
$asset->requestable = request('requestable', 0);
$asset->rtd_location_id = request('rtd_location_id', null);
if ($asset->assigned_to=='') {
$asset->location_id = $request->input('rtd_location_id', null);
}
// Create the image (if one was chosen.)
if ($request->has('image')) {
$image = $request->input('image');
@@ -199,8 +203,6 @@ class AssetsController extends Controller
// Update custom fields in the database.
// Validation for these fields is handled through the AssetRequest form request
// FIXME: No idea why this is returning a Builder error on db_column_name.
// Need to investigate and fix. Using static method for now.
$model = AssetModel::find($request->get('model_id'));
if ($model->fieldset) {
@@ -218,15 +220,20 @@ class AssetsController extends Controller
// Was the asset created?
if ($asset->save()) {
$asset->logCreate();
if (request('assigned_user')) {
$target = User::find(request('assigned_user'));
$location = $target->location_id;
} elseif (request('assigned_asset')) {
$target = Asset::find(request('assigned_asset'));
$location = $target->location_id;
} elseif (request('assigned_location')) {
$target = Location::find(request('assigned_location'));
$location = $target->id;
}
if (isset($target)) {
$asset->checkOut($target, Auth::user(), date('Y-m-d H:i:s'), '', 'Checked out on asset creation', e(Input::get('name')));
$asset->checkOut($target, Auth::user(), date('Y-m-d H:i:s'), '', 'Checked out on asset creation', e(Input::get('name')), $location);
}
// Redirect to the asset listing page
\Session::flash('success', trans('admin/hardware/message.create.success'));
@@ -289,6 +296,11 @@ class AssetsController extends Controller
$asset->requestable = $request->has('requestable');
$asset->rtd_location_id = $request->input('rtd_location_id', null);
if ($asset->assigned_to=='') {
$asset->location_id = $request->input('rtd_location_id', null);
}
if ($request->has('image_delete')) {
unlink(public_path().'/uploads/assets/'.$asset->image);
$asset->image = '';
@@ -442,14 +454,32 @@ class AssetsController extends Controller
}
$this->authorize('checkout', $asset);
// Fetch the target and set the asset's new location_id
if (request('assigned_user')) {
$target = User::find(request('assigned_user'));
$asset->location_id = ($target) ? $target->location_id : '';
} elseif (request('assigned_asset')) {
$target = Asset::where('id','!=',$assetId)->find(request('assigned_asset'));
$asset->location_id = $target->rtd_location_id;
// Override with the asset's location_id if it has one
if ($target->location_id!='') {
$asset->location_id = ($target) ? $target->location_id : '';
}
} elseif (request('assigned_location')) {
$target = Location::find(request('assigned_location'));
$asset->location_id = ($target) ? $target->id : '';
}
// $user = User::find(Input::get('assigned_to'));
// No valid target was found - error out
if (!$target) {
return redirect()->to("hardware/$assetId/checkout")->with('error', trans('admin/hardware/message.checkout.error'))->withErrors($asset->getErrors());
}
$admin = Auth::user();
if ((Input::has('checkout_at')) && (Input::get('checkout_at')!= date("Y-m-d"))) {
@@ -464,22 +494,13 @@ class AssetsController extends Controller
$expected_checkin = '';
}
// Set the location ID to the RTD location id if there is one
if ($asset->rtd_location_id!='') {
$asset->location_id = $target->rtd_location_id;
}
// Overwrite that if the target has a location ID though
if ($target->location_id!='') {
$asset->location_id = $target->location_id;
}
if ($asset->checkOut($target, $admin, $checkout_at, $expected_checkin, e(Input::get('note')), Input::get('name'))) {
// Redirect to the new asset page
return redirect()->route("hardware.index")->with('success', trans('admin/hardware/message.checkout.success'));
}
// Redirect to the asset management page with error
// Redirect to the asset management page with error
return redirect()->to("hardware/$assetId/checkout")->with('error', trans('admin/hardware/message.checkout.error'))->withErrors($asset->getErrors());
}
@@ -546,6 +567,8 @@ class AssetsController extends Controller
$asset->status_id = e(Input::get('status_id'));
}
$asset->location_id = $asset->rtd_location_id;
if (Input::has('location_id')) {
$asset->location_id = e(Input::get('location_id'));
}
@@ -643,20 +666,23 @@ class AssetsController extends Controller
if ($settings->qr_code == '1') {
$asset = Asset::withTrashed()->find($assetId);
$size = Helper::barcodeDimensions($settings->barcode_type);
$qr_file = public_path().'/uploads/barcodes/qr-'.str_slug($asset->asset_tag).'-'.str_slug($asset->id).'.png';
if ($asset) {
$size = Helper::barcodeDimensions($settings->barcode_type);
$qr_file = public_path().'/uploads/barcodes/qr-'.str_slug($asset->asset_tag).'-'.str_slug($asset->id).'.png';
if (isset($asset->id, $asset->asset_tag)) {
if (file_exists($qr_file)) {
$header = ['Content-type' => 'image/png'];
return response()->file($qr_file, $header);
} else {
$barcode = new \Com\Tecnick\Barcode\Barcode();
$barcode_obj = $barcode->getBarcodeObj($settings->barcode_type, route('hardware.show', $asset->id), $size['height'], $size['width'], 'black', array(-2, -2, -2, -2));
file_put_contents($qr_file, $barcode_obj->getPngData());
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
if (isset($asset->id, $asset->asset_tag)) {
if (file_exists($qr_file)) {
$header = ['Content-type' => 'image/png'];
return response()->file($qr_file, $header);
} else {
$barcode = new \Com\Tecnick\Barcode\Barcode();
$barcode_obj = $barcode->getBarcodeObj($settings->barcode_type, route('hardware.show', $asset->id), $size['height'], $size['width'], 'black', array(-2, -2, -2, -2));
file_put_contents($qr_file, $barcode_obj->getPngData());
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
}
}
}
return 'That asset is invalid';
}
}
@@ -916,8 +942,8 @@ class AssetsController extends Controller
$destinationPath = config('app.private_uploads').'/assets';
if ($request->hasFile('image')) {
foreach ($request->file('image') as $file) {
if ($request->hasFile('assetfile')) {
foreach ($request->file('assetfile') as $file) {
$extension = $file->getClientOriginalExtension();
$filename = 'hardware-'.$asset->id.'-'.str_random(8);
$filename .= '-'.str_slug($file->getClientOriginalName()).'.'.$extension;
+26 -10
View File
@@ -71,9 +71,7 @@ class CategoriesController extends Controller
*/
public function store(ImageUploadRequest $request)
{
// create a new model instance
$category = new Category();
// Update the category data
$category->name = $request->input('name');
$category->category_type = $request->input('category_type');
$category->eula_text = $request->input('eula_text');
@@ -150,17 +148,35 @@ class CategoriesController extends Controller
$category->require_acceptance = $request->input('require_acceptance', '0');
$category->checkin_email = $request->input('checkin_email', '0');
$old_image = $category->image;
// Set the model's image property to null if the image is being deleted
if ($request->input('image_delete') == 1) {
$category->image = null;
}
if ($request->file('image')) {
$image = $request->file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
$path = public_path('uploads/categories/'.$file_name);
Image::make($image->getRealPath())->resize(200, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$file_name = $category->id.'-'.str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(500, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save(app('categories_upload_path').$file_name);
} else {
$image->move(app('categories_upload_path'), $file_name);
}
$category->image = $file_name;
} elseif ($request->input('image_delete')=='1') {
$category->image = null;
}
if ((($request->file('image')) && (isset($old_image)) && ($old_image!='')) || ($request->input('image_delete') == 1)) {
try {
unlink(app('categories_upload_path').$old_image);
} catch (\Exception $e) {
\Log::error($e);
}
}
+26 -8
View File
@@ -110,17 +110,35 @@ final class CompaniesController extends Controller
$company->name = $request->input('name');
$old_image = $company->image;
// Set the model's image property to null if the image is being deleted
if ($request->input('image_delete') == 1) {
$company->image = null;
}
if ($request->file('image')) {
$image = $request->file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
$path = public_path('uploads/companies/'.$file_name);
Image::make($image->getRealPath())->resize(200, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$file_name = $company->id.'-'.str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(500, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save(app('companies_upload_path').$file_name);
} else {
$image->move(app('companies_upload_path'), $file_name);
}
$company->image = $file_name;
} elseif ($request->input('image_delete')=='1') {
$company->image = null;
}
if ((($request->file('image')) && (isset($old_image)) && ($old_image!='')) || ($request->input('image_delete') == 1)) {
try {
unlink(app('companies_upload_path').$old_image);
} catch (\Exception $e) {
\Log::error($e);
}
}
@@ -3,6 +3,7 @@ namespace App\Http\Controllers;
use App\Helpers\Helper;
use App\Http\Requests\ImageUploadRequest;
use App\Models\Actionlog;
use App\Models\Company;
use App\Models\Component;
use App\Models\CustomField;
@@ -313,5 +314,97 @@ class ComponentsController extends Controller
return redirect()->route('components.index')->with('success', trans('admin/components/message.checkout.success'));
}
/**
* Returns a view that allows the checkin of a component from an asset.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @see ComponentsController::postCheckout() method that stores the data.
* @since [v4.1.4]
* @param int $componentId
* @return \Illuminate\Contracts\View\View
*/
public function getCheckin($component_asset_id)
{
// This could probably be done more cleanly but I am very tired. - @snipe
if ($component_assets = DB::table('components_assets')->find($component_asset_id)) {
if (is_null($component = Component::find($component_assets->component_id))) {
return redirect()->route('components.index')->with('error', trans('admin/components/messages.not_found'));
}
if (is_null($asset = Asset::find($component_assets->asset_id))) {
return redirect()->route('components.index')->with('error',
trans('admin/components/message.not_found'));
}
$this->authorize('checkin', $component_assets);
return view('components/checkin', compact('component_assets','component','asset'));
}
return redirect()->route('components.index')->with('error', trans('admin/components/messages.not_found'));
}
/**
* Validate and store checkin data.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @see ComponentsController::getCheckout() method that returns the form.
* @since [v4.1.4]
* @param Request $request
* @param int $componentId
* @return \Illuminate\Http\RedirectResponse
*/
public function postCheckin(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 redirect()->route('components.index')->with('error',
trans('admin/components/message.not_found'));
}
$this->authorize('checkin', $component);
$max_to_checkin = $component_assets->assigned_qty;
$validator = Validator::make($request->all(), [
"checkin_qty" => "required|numeric|between:1,$max_to_checkin"
]);
if ($validator->fails()) {
return redirect()->back()
->withErrors($validator)
->withInput();
}
// 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'));
// We have to modify the record to reflect the new qty that's
// actually checked out.
$component_assets->assigned_qty = $qty_remaining_in_checkout;
DB::table('components_assets')->where('id',
$component_asset_id)->update(['assigned_qty' => $qty_remaining_in_checkout]);
$log = new Actionlog();
$log->user_id = Auth::user()->id;
$log->action_type = 'checkin from';
$log->target_type = Asset::class;
$log->target_id = $component_assets->asset_id;
$log->item_id = $component_assets->component_id;
$log->item_type = Component::class;
$log->note = $request->input('note');
$log->save();
// 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();
}
return redirect()->route('components.index')->with('success',
trans('admin/components/message.checkout.success'));
}
return redirect()->route('components.index')->with('error', trans('admin/components/message.not_found'));
}
}
@@ -1,6 +1,7 @@
<?php
namespace App\Http\Controllers;
use App\Http\Requests\CustomFieldRequest;
use View;
use App\Models\CustomFieldset;
use App\Models\CustomField;
@@ -69,7 +70,7 @@ class CustomFieldsController extends Controller
* @since [v1.8]
* @return Redirect
*/
public function store(Request $request)
public function store(CustomFieldRequest $request)
{
$field = new CustomField([
"name" => $request->get("name"),
@@ -81,27 +82,19 @@ class CustomFieldsController extends Controller
]);
if (!in_array(Input::get('format'), array_keys(CustomField::$PredefinedFormats))) {
$field->format = e($request->get("custom_format"));
} else {
$field->format = e($request->get("format"));
}
$validator = Validator::make(Input::all(), $field->rules);
if ($validator->passes()) {
$results = $field->save();
if ($results) {
return redirect()->route("fields.index")->with("success", trans('admin/custom_fields/message.field.create.success'));
} else {
dd($field);
return redirect()->back()->withInput()->with('error', trans('admin/custom_fields/message.field.create.error'));
}
if ($field->save()) {
return redirect()->route("fields.index")->with("success", trans('admin/custom_fields/message.field.create.success'));
} else {
return redirect()->back()->withInput()->withErrors($validator);
// dd($field);
return redirect()->back()->withInput()->with('error', trans('admin/custom_fields/message.field.create.error'));
}
}
@@ -169,7 +162,7 @@ class CustomFieldsController extends Controller
* @since [v4.0]
* @return Redirect
*/
public function update(Request $request, $id)
public function update(CustomFieldRequest $request, $id)
{
$field = CustomField::find($id);
@@ -186,13 +179,12 @@ class CustomFieldsController extends Controller
$field->format = e($request->get("format"));
}
$validator = Validator::make(Input::all(), $field->rules);
if ($field->save()) {
return redirect()->route("fields.index")->with("success", trans('admin/custom_fields/message.field.update.success'));
}
return redirect()->back()->withInput()->withErrors($validator);
return redirect()->back()->withInput()->with('error', trans('admin/custom_fields/message.field.update.error'));
}
+28 -11
View File
@@ -152,21 +152,38 @@ class DepartmentsController extends Controller
}
$department->fill($request->all());
$department->manager_id = ($request->has('manager_id' ) ? $request->input('manager_id') : null);
if ($request->file('image')) {
$image = $request->file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
$path = public_path('uploads/departments/'.$file_name);
Image::make($image->getRealPath())->resize(200, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$department->image = $file_name;
} elseif ($request->input('image_delete')=='1') {
$old_image = $department->image;
// Set the model's image property to null if the image is being deleted
if ($request->input('image_delete') == 1) {
$department->image = null;
}
$department->manager_id = ($request->has('manager_id' ) ? $request->input('manager_id') : null);
if ($request->file('image')) {
$image = $request->file('image');
$file_name = $department->id.'-'.str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(500, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save(app('departments_upload_path').$file_name);
} else {
$image->move(app('departments_upload_path'), $file_name);
}
$department->image = $file_name;
}
if ((($request->file('image')) && (isset($old_image)) && ($old_image!='')) || ($request->input('image_delete') == 1)) {
try {
unlink(app('departments_upload_path').$old_image);
} catch (\Exception $e) {
\Log::error($e);
}
}
if ($department->save()) {
return redirect()->route("departments.index")->with('success', trans('admin/departments/message.update.success'));
+83 -63
View File
@@ -239,16 +239,19 @@ class LicensesController extends Controller
* @param int $seatId
* @return \Illuminate\Contracts\View\View
*/
public function getCheckout($seatId)
public function getCheckout($licenceId)
{
// Check if the license seat exists
if (is_null($licenseSeat = LicenseSeat::find($seatId))) {
// Redirect to the asset management page with error
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.not_found'));
// Check that the license is valid
if ($license = License::where('id',$licenceId)->first()) {
// If the license is valid, check that there is an available seat
if ($license->getAvailSeatsCountAttribute() < 1) {
return redirect()->route('licenses.index')->with('error', 'There are no available seats for this license');
}
}
$this->authorize('checkout', $licenseSeat);
return view('licenses/checkout', compact('licenseSeat'));
$this->authorize('checkout', $license);
return view('licenses/checkout', compact('license'));
}
@@ -262,78 +265,95 @@ class LicensesController extends Controller
* @param int $seatId
* @return \Illuminate\Http\RedirectResponse
*/
public function postCheckout(Request $request, $seatId)
public function postCheckout(Request $request, $licenseId)
{
$licenseSeat = LicenseSeat::find($seatId);
$assigned_to = e($request->input('assigned_to'));
$asset_id = e($request->input('asset_id'));
$this->authorize('checkout', $licenseSeat);
// Check that the license is valid
if ($license = License::where('id',$licenseId)->first()) {
// Declare the rules for the form validation
$rules = [
'note' => 'string|nullable',
'asset_id' => 'required_without:assigned_to',
];
// If the license is valid, check that there is an available seat
if ($license->getAvailSeatsCountAttribute() < 1) {
return redirect()->route('licenses.index')->with('error', 'There are no available seats for this license');
}
$next = $license->freeSeat();
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return redirect()->back()->withInput()->withErrors($validator);
}
$target = null;
if ($assigned_to!='') {
// Check if the user exists
if (is_null($target = User::find($assigned_to))) {
$licenseSeat = LicenseSeat::where('license_id',$license->id)->find($next)->first();
$assigned_to = $request->input('assigned_to');
$asset_id = $request->input('asset_id');
$this->authorize('checkout', $licenseSeat);
// Declare the rules for the form validation
$rules = [
'note' => 'string|nullable',
'asset_id' => 'required_without:assigned_to',
];
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return redirect()->back()->withInput()->withErrors($validator);
}
$target = null;
if ($assigned_to!='') {
// Check if the user exists
if (is_null($target = User::find($assigned_to))) {
// Redirect to the asset management page with error
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.user_does_not_exist'));
}
}
if ($asset_id!='') {
if (is_null($target = Asset::find($asset_id))) {
// Redirect to the asset management page with error
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.asset_does_not_exist'));
}
if (($request->has('assigned_to')) && ($request->has('asset_id'))) {
return redirect()->back()->withInput()->with('error', trans('admin/licenses/message.select_asset_or_person'));
}
}
// Check if the asset exists
if (is_null($licenseSeat)) {
// Redirect to the asset management page with error
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.user_does_not_exist'));
}
}
if ($asset_id!='') {
if (is_null($target = Asset::find($asset_id))) {
// Redirect to the asset management page with error
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.asset_does_not_exist'));
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.not_found'));
}
if (($request->has('assigned_to')) && ($request->has('asset_id'))) {
return redirect()->back()->withInput()->with('error', trans('admin/licenses/message.select_asset_or_person'));
if ($request->input('asset_id') == '') {
$licenseSeat->asset_id = null;
} else {
$licenseSeat->asset_id = $request->input('asset_id');
}
}
// Check if the asset exists
if (is_null($licenseSeat)) {
// Redirect to the asset management page with error
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.not_found'));
}
if ($request->input('asset_id') == '') {
$licenseSeat->asset_id = null;
} else {
$licenseSeat->asset_id = $request->input('asset_id');
}
// Update the asset data
if ($request->input('assigned_to') == '') {
// Update the asset data
if ($request->input('assigned_to') == '') {
$licenseSeat->assigned_to = null;
} else {
} else {
$licenseSeat->assigned_to = $request->input('assigned_to');
}
// Was the asset updated?
if ($licenseSeat->save()) {
$licenseSeat->logCheckout($request->input('note'), $target);
$data['license_id'] = $licenseSeat->license_id;
$data['note'] = $request->input('note');
// Redirect to the new asset page
return redirect()->route("licenses.index")->with('success', trans('admin/licenses/message.checkout.success'));
}
}
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.not_found'));
// Was the asset updated?
if ($licenseSeat->save()) {
$licenseSeat->logCheckout($request->input('note'), $target);
$data['license_id'] = $licenseSeat->license_id;
$data['note'] = $request->input('note');
// Redirect to the new asset page
return redirect()->route("licenses.index")->with('success', trans('admin/licenses/message.checkout.success'));
}
return redirect()->route("licenses.index")->with('error', trans('admin/licenses/message.checkout.error'));
}
+26 -8
View File
@@ -204,17 +204,35 @@ class LocationsController extends Controller
$location->ldap_ou = $request->input('ldap_ou');
$location->manager_id = $request->input('manager_id');
$old_image = $location->image;
// Set the model's image property to null if the image is being deleted
if ($request->input('image_delete') == 1) {
$location->image = null;
}
if ($request->file('image')) {
$image = $request->file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
$path = public_path('uploads/locations/'.$file_name);
Image::make($image->getRealPath())->resize(200, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$file_name = $location->id.'-'.str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(500, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save(app('locations_upload_path').$file_name);
} else {
$image->move(app('locations_upload_path'), $file_name);
}
$location->image = $file_name;
} elseif ($request->input('image_delete')=='1') {
$location->image = null;
}
if ((($request->file('image')) && (isset($old_image)) && ($old_image!='')) || ($request->input('image_delete') == 1)) {
try {
unlink(app('locations_upload_path').$old_image);
} catch (\Exception $e) {
\Log::error($e);
}
}
@@ -138,26 +138,35 @@ class ManufacturersController extends Controller
$manufacturer->support_phone = $request->input('support_phone');
$manufacturer->support_email = $request->input('support_email');
$old_image = $manufacturer->image;
// Set the model's image property to null if the image is being deleted
if ($request->input('image_delete') == 1) {
$manufacturer->image = null;
}
if ($request->file('image')) {
$image = $request->file('image');
$file_name = str_slug($image->getClientOriginalName()).".".$image->getClientOriginalExtension();
$path = public_path('uploads/manufacturers/'.$file_name);
$old_image = $path.$manufacturer->image;
$file_name = $manufacturer->id.'-'.str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(500, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save(app('manufacturers_upload_path').$file_name);
} else {
$image->move(app('manufacturers_upload_path'), $file_name);
}
$manufacturer->image = $file_name;
}
if ((($request->file('image')) && (isset($old_image)) && ($old_image!='')) || ($request->input('image_delete') == 1)) {
try {
unlink($old_image);
unlink(app('manufacturers_upload_path').$old_image);
} catch (\Exception $e) {
\Log::error($e);
}
Image::make($image->getRealPath())->resize(200, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$manufacturer->image = $file_name;
} elseif ($request->input('image_delete')=='1') {
$manufacturer->image = null;
}
+2 -2
View File
@@ -108,12 +108,12 @@ class ProfileController extends Controller
{
if (config('app.lock_passwords')) {
return redirect()->route('account.password.index')->with('error', Lang::get('admin/users/table.lock_passwords'));
return redirect()->route('account.password.index')->with('error', trans('admin/users/table.lock_passwords'));
}
$user = Auth::user();
if ($user->ldap_import=='1') {
return redirect()->route('account.password.index')->with('error', Lang::get('admin/users/message.error.password_ldap'));
return redirect()->route('account.password.index')->with('error', trans('admin/users/message.error.password_ldap'));
}
$rules = array(
+13 -3
View File
@@ -182,7 +182,7 @@ class ReportsController extends Controller
($asset->supplier) ? e($asset->supplier->name) : '',
($asset->assignedTo) ? e($asset->assignedTo->present()->name()) : '',
($asset->last_checkout!='') ? e($asset->last_checkout) : '',
($asset->location) ? e($asset->location->present()->name()) : '',
($asset->location) ? e($asset->location->name) : '',
($asset->notes) ? e($asset->notes) : '',
];
foreach ($customfields as $field) {
@@ -582,7 +582,12 @@ class ReportsController extends Controller
if (e(Input::get('username')) == '1') {
// Only works if we're checked out to a user, not anything else.
if ($asset->checkedOutToUser()) {
$row[] = '"' .e($asset->assignedto->username). '"';
if ($asset->assignedto) {
$row[] = '"' .e($asset->assignedto->username). '"';
} else {
$row[] = ''; // Empty string if unassigned
}
} else {
$row[] = ''; // Empty string if unassigned
}
@@ -591,7 +596,12 @@ class ReportsController extends Controller
if (e(Input::get('employee_num')) == '1') {
// Only works if we're checked out to a user, not anything else.
if ($asset->checkedOutToUser()) {
$row[] = '"' .e($asset->assignedto->employee_num). '"';
if ($asset->assignedto) {
$row[] = '"' .e($asset->assignedto->employee_num). '"';
} else {
$row[] = ''; // Empty string if unassigned
}
} else {
$row[] = ''; // Empty string if unassigned
}
@@ -552,6 +552,7 @@ class SettingsController extends Controller
$setting->alert_threshold = $request->input('alert_threshold');
$setting->audit_interval = $request->input('audit_interval');
$setting->audit_warning_days = $request->input('audit_warning_days');
$setting->show_alerts_in_menu = $request->input('show_alerts_in_menu', '0');
if ($setting->save()) {
return redirect()->route('settings.index')
@@ -747,6 +748,7 @@ class SettingsController extends Controller
$setting->labels_fontsize = $request->input('labels_fontsize');
$setting->labels_pagewidth = $request->input('labels_pagewidth');
$setting->labels_pageheight = $request->input('labels_pageheight');
$setting->labels_display_company_name = $request->input('labels_display_company_name', '0');
+29 -10
View File
@@ -159,19 +159,38 @@ class SuppliersController extends Controller
$supplier->notes = request('notes');
if ($request->file('image')) {
$image = $request->file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
$path = public_path('uploads/suppliers/'.$file_name);
Image::make($image->getRealPath())->resize(200, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$supplier->image = $file_name;
} elseif ($request->input('image_delete')=='1') {
$old_image = $supplier->image;
// Set the model's image property to null if the image is being deleted
if ($request->input('image_delete') == 1) {
$supplier->image = null;
}
if ($request->file('image')) {
$image = $request->file('image');
$file_name = $supplier->id.'-'.str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(500, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save(app('suppliers_upload_path').$file_name);
} else {
$image->move(app('suppliers_upload_path'), $file_name);
}
$supplier->image = $file_name;
}
if ((($request->file('image')) && (isset($old_image)) && ($old_image!='')) || ($request->input('image_delete') == 1)) {
try {
unlink(app('suppliers_upload_path').$old_image);
} catch (\Exception $e) {
\Log::error($e);
}
}
if ($supplier->save()) {
return redirect()->route('suppliers.index')->with('success', trans('admin/suppliers/message.update.success'));
}
+4 -1
View File
@@ -106,7 +106,6 @@ class UsersController extends Controller
$user->password = bcrypt($request->input('password'));
$data['password'] = $request->input('password');
}
// Update the user
$user->first_name = $request->input('first_name');
$user->last_name = $request->input('last_name');
$user->locale = $request->input('locale');
@@ -278,6 +277,10 @@ class UsersController extends Controller
try {
$user = User::find($id);
if ($user->id == $request->input('manager_id')) {
return redirect()->back()->withInput()->with('error', 'You cannot be your own manager.');
}
$this->authorize('update', $user);
// Figure out of this user was an admin before this edit
$orig_permissions_array = $user->decodePermissions();
@@ -284,9 +284,10 @@ class ViewAssetsController extends Controller
public function getAcceptAsset($logID = null)
{
if (!$findlog = Actionlog::where('id', $logID)->first()) {
echo 'no record';
//return redirect()->to('account')->with('error', trans('admin/hardware/message.does_not_exist'));
$findlog = Actionlog::where('id', $logID)->first();
if (!$findlog) {
return redirect()->to('account/view-assets')->with('error', 'No matching record.');
}
if ($findlog->accepted_id!='') {
+59
View File
@@ -0,0 +1,59 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Request;
class CustomFieldRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules(Request $request)
{
$rules = [];
switch($this->method())
{
// Brand new
case 'POST':
{
$rules['name'] = "required|unique:custom_fields";
break;
}
// Save all fields
case 'PUT':
$rules['name'] = "required";
break;
// Save only what's passed
case 'PATCH':
{
$rules['name'] = "required";
break;
}
default:break;
}
$rules['custom_format'] = 'valid_regex';
return $rules;
}
}
@@ -28,7 +28,7 @@ class AssetModelsTransformer
'id' => (int) $assetmodel->manufacturer->id,
'name'=> e($assetmodel->manufacturer->name)
] : null,
'image' => ($assetmodel->image!='') ? url('/').'/uploads/models/'.e($assetmodel->image) : null,
'image' => ($assetmodel->image!='') ? app('models_upload_url').e($assetmodel->image) : null,
'model_number' => e($assetmodel->model_number),
'depreciation' => ($assetmodel->depreciation) ? [
'id' => (int) $assetmodel->depreciation->id,
@@ -25,7 +25,7 @@ class CategoriesTransformer
$array = [
'id' => (int) $category->id,
'name' => e($category->name),
'image' => ($category->image) ? e(url('/').'/uploads/categories/'.e($category->image)) : null,
'image' => ($category->image) ? app('categories_upload_url').e($category->image) : null,
'type' => e($category->category_type),
'eula' => ($category->getEula()) ? true : false,
'checkin_email' => ($category->checkin_email =='1') ? true : false,
@@ -25,7 +25,7 @@ class CompaniesTransformer
$array = [
'id' => (int) $company->id,
'name' => e($company->name),
'image' => ($company->image) ? e(url('/').'/uploads/companies/'.e($company->image)) : null,
'image' => ($company->image) ? app('companies_upload_url').e($company->image) : null,
"created_at" => Helper::getFormattedDateObject($company->created_at, 'datetime'),
"updated_at" => Helper::getFormattedDateObject($company->updated_at, 'datetime'),
"assets_count" => (int) $company->assets_count,
@@ -25,7 +25,7 @@ class DepartmentsTransformer
$array = [
'id' => (int) $department->id,
'name' => e($department->name),
'image' => ($department->image) ? e(url('/').'/uploads/departments/'.e($department->image)) : null,
'image' => ($department->image) ? app('departments_upload_url').e($department->image) : null,
'company' => ($department->company) ? [
'id' => (int) $department->company->id,
'name'=> e($department->company->name)
@@ -30,20 +30,17 @@ class LicensesTransformer
'purchase_order' => e($license->purchase_order),
'purchase_date' => Helper::getFormattedDateObject($license->purchase_date, 'date'),
'purchase_cost' => e($license->purchase_cost),
'depreciation' => ($license->depreciation) ? ['id' => (int) $license->depreciation->id,'name'=> e($license->depreciation->name)] : null,
'notes' => e($license->notes),
'expiration_date' => Helper::getFormattedDateObject($license->expiration_date, 'date'),
'total_seats' => (int) $license->seats,
'next_seat' => ($license->freeSeat()) ? (int) $license->freeSeat()->id : null,
'remaining_qty' => (int) $license->remaincount(),
'min_qty' => $license->remaincount(),
'seats' => (int) $license->seats,
'free_seats_count' => (int) $license->free_seats_count,
'license_name' => e($license->license_name),
'license_email' => e($license->license_email),
'maintained' => ($license->maintained == 1) ? true : false,
'supplier' => ($license->supplier) ? ['id' => (int) $license->supplier->id,'name'=> e($license->supplier->name)] : null,
'created_at' => Helper::getFormattedDateObject($license->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($license->updated_at, 'datetime'),
'user_can_checkout' => (bool) ($license->remaincount() > 0),
'user_can_checkout' => (bool) ($license->free_seats_count > 0),
];
$permissions_array['available_actions'] = [
@@ -33,14 +33,14 @@ class LocationsTransformer
$array = [
'id' => (int) $location->id,
'name' => e($location->name),
'image' => ($location->image) ? e(url('/').'/uploads/locations/'.e($location->image)) : null,
'image' => ($location->image) ? app('locations_upload_url').e($location->image) : null,
'address' => e($location->address),
'city' => e($location->city),
'state' => e($location->state),
'country' => e($location->country),
'zip' => e($location->zip),
'assets_count' => (int) $location->assets_count,
'rtd_assets_count' => (int) $location->rtd_assets_count,
'assigned_assets_count' => (int) $location->assigned_assets_count,
'assets_count' => (int) $location->assets_count,
'users_count' => (int) $location->users_count,
'created_at' => Helper::getFormattedDateObject($location->created_at, 'datetime'),
@@ -26,7 +26,7 @@ class ManufacturersTransformer
'id' => (int) $manufacturer->id,
'name' => e($manufacturer->name),
'url' => e($manufacturer->url),
'image' => ($manufacturer->image) ? e(url('/').'/uploads/manufacturers/'.e($manufacturer->image)) : null,
'image' => ($manufacturer->image) ? app('manufacturers_upload_url').e($manufacturer->image) : null,
'support_url' => e($manufacturer->support_url),
'support_phone' => e($manufacturer->support_phone),
'support_email' => e($manufacturer->support_email),
@@ -19,7 +19,7 @@ class SelectlistTransformer
public function transformSelectlist (LengthAwarePaginator $select_items)
{
$items_array = [];
$items_array=[];
// Loop through the paginated collection to set the array values
foreach ($select_items as $select_item) {
@@ -32,6 +32,12 @@ class SelectlistTransformer
}
// This is weird and awful, but the only way I can find to allow the user to
// clear the selection - @snipe
if (count($items_array) > 0) {
array_unshift($items_array, ['id' =>'', 'text'=> trans('general.clear_selection')]);
}
$results = [
'items' => $items_array,
'pagination' =>
@@ -25,7 +25,7 @@ class SuppliersTransformer
$array = [
'id' => (int) $supplier->id,
'name' => e($supplier->name),
'image' => ($supplier->image) ? e(url('/').'/uploads/suppliers/'.e($supplier->image)) : null,
'image' => ($supplier->image) ? app('suppliers_upload_url').e($supplier->image) : null,
'address' => ($supplier->address) ? e($supplier->address) : null,
'address2' => ($supplier->address2) ? e($supplier->address2) : null,
'city' => ($supplier->city) ? e($supplier->city) : null,
+1 -1
View File
@@ -17,7 +17,7 @@ class Accessory extends SnipeModel
use Loggable, Presentable;
use SoftDeletes;
protected $dates = ['deleted_at'];
protected $dates = ['deleted_at', 'purchase_date'];
protected $table = 'accessories';
protected $casts = [
'requestable' => 'boolean'
+22 -23
View File
@@ -42,6 +42,7 @@ class Asset extends Depreciable
*/
protected $injectUniqueIdentifier = true;
// We set these as protected dates so that they will be easily accessible via Carbon
protected $dates = [
'created_at',
'updated_at',
@@ -138,13 +139,13 @@ class Asset extends Depreciable
* @param User $user
* @param User $admin
* @param Carbon $checkout_at
* @param null $expected_checkin
* @param Carbon $expected_checkin
* @param string $note
* @param null $name
* @return bool
*/
//FIXME: The admin parameter is never used. Can probably be removed.
public function checkOut($target, $admin = null, $checkout_at = null, $expected_checkin = null, $note = null, $name = null)
public function checkOut($target, $admin = null, $checkout_at = null, $expected_checkin = null, $note = null, $name = null, $location = null)
{
if (!$target) {
return false;
@@ -163,6 +164,10 @@ class Asset extends Depreciable
$this->name = $name;
}
if ($location != null) {
$this->location_id = $location;
}
if ($this->requireAcceptance()) {
if(get_class($target) != User::class) {
throw new CheckoutNotAllowed;
@@ -690,7 +695,7 @@ class Asset extends Depreciable
public function scopeDeleted($query)
{
return $query->whereNotNull('deleted_at');
return $query->whereNotNull('assets.deleted_at');
}
/**
@@ -706,7 +711,7 @@ class Asset extends Depreciable
*/
public function scopeInModelList($query, array $modelIdListing)
{
return $query->whereIn('model_id', $modelIdListing);
return $query->whereIn('assets.model_id', $modelIdListing);
}
/**
@@ -935,8 +940,9 @@ class Asset extends Depreciable
}
}
if (($fieldname!='category') && ($fieldname!='status_label')) {
$query->orWhere('assets.'.$fieldname, 'LIKE', '%' . $search_val . '%');
if (($fieldname!='category') && ($fieldname!='location')
&& ($fieldname!='status_label') && ($fieldname!='model') && ($fieldname!='manufacturer')) {
$query->orWhere('assets.'.$fieldname, 'LIKE', '%' . $search_val . '%');
}
@@ -957,7 +963,7 @@ class Asset extends Depreciable
*/
public function scopeOrderModels($query, $order)
{
return $query->join('models', 'assets.model_id', '=', 'models.id')->orderBy('models.name', $order);
return $query->join('models as asset_models', 'assets.model_id', '=', 'models.id')->orderBy('models.name', $order);
}
/**
@@ -984,7 +990,7 @@ class Asset extends Depreciable
*/
public function scopeOrderAssigned($query, $order)
{
return $query->leftJoin('users', 'assets.assigned_to', '=', 'users.id')->select('assets.*')->orderBy('users.first_name', $order)->orderBy('users.last_name', $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);
}
/**
@@ -997,7 +1003,7 @@ class Asset extends Depreciable
*/
public function scopeOrderStatus($query, $order)
{
return $query->join('status_labels', 'assets.status_id', '=', 'status_labels.id')->orderBy('status_labels.name', $order);
return $query->join('status_labels as status_sort', 'assets.status_id', '=', 'status_sort.id')->orderBy('status_sort.name', $order);
}
/**
@@ -1010,7 +1016,7 @@ class Asset extends Depreciable
*/
public function scopeOrderCompany($query, $order)
{
return $query->leftJoin('companies', 'assets.company_id', '=', 'companies.id')->orderBy('companies.name', $order);
return $query->leftJoin('companies as company_sort', 'assets.company_id', '=', 'company_sort.id')->orderBy('company_sort.name', $order);
}
@@ -1054,9 +1060,9 @@ class Asset extends Depreciable
*/
public function scopeOrderCategory($query, $order)
{
return $query->join('models', 'assets.model_id', '=', 'models.id')
->join('categories', 'models.category_id', '=', 'categories.id')
->orderBy('categories.name', $order);
return $query->join('models as order_model_category', 'assets.model_id', '=', 'order_model_category.id')
->join('categories as category_order', 'order_model_category.category_id', '=', 'category_order.id')
->orderBy('category_order.name', $order);
}
@@ -1085,7 +1091,7 @@ class Asset extends Depreciable
*/
public function scopeOrderLocation($query, $order)
{
return $query->leftJoin('locations', 'locations.id', '=', 'assets.rtd_location_id')->orderBy('locations.name', $order);
return $query->leftJoin('locations as asset_locations', 'asset_locations.id', '=', 'assets.rtd_location_id')->orderBy('asset_locations.name', $order);
}
@@ -1099,7 +1105,7 @@ class Asset extends Depreciable
*/
public function scopeOrderSupplier($query, $order)
{
return $query->leftJoin('suppliers', 'assets.supplier_id', '=', 'suppliers.id')->orderBy('suppliers.name', $order);
return $query->leftJoin('suppliers as suppliers_assets', 'assets.supplier_id', '=', 'suppliers_assets.id')->orderBy('suppliers_assets.name', $order);
}
/**
@@ -1117,14 +1123,7 @@ class Asset extends Depreciable
$query->where('locations.id', '=', $search);
});
});
// FIXME: This needs porting to checkout to non-user.
// ->orWhere(function ($query) use ($search) {
// $query->whereHas('assigneduser', function ($query) use ($search) {
// $query->whereHas('userloc', function ($query) use ($search) {
// $query->where('locations.id', '=', $search);
// });
// });
// });
}
+1 -1
View File
@@ -17,7 +17,7 @@ class Component extends SnipeModel
use Loggable, Presentable;
use SoftDeletes;
protected $dates = ['deleted_at'];
protected $dates = ['deleted_at', 'purchase_date'];
protected $table = 'components';
/**
* Category validation rules
+2 -1
View File
@@ -12,13 +12,14 @@ class Consumable extends SnipeModel
use Loggable, Presentable;
use SoftDeletes;
protected $dates = ['deleted_at'];
protected $dates = ['deleted_at', 'purchase_date'];
protected $table = 'consumables';
protected $casts = [
'requestable' => 'boolean'
];
/**
* Category validation rules
*/
+12 -5
View File
@@ -25,10 +25,13 @@ class CustomField extends Model
];
public $rules = [
"name" => "required|unique:custom_fields"
"name" => "required|unique:custom_fields"
];
public static $table_name="assets";
// This is confusing, since it's actually the custom fields table that
// we're usually modifying, but since we alter the assets table, we have to
// say that here
public static $table_name = "assets";
public static function name_to_db_name($name)
{
@@ -39,7 +42,6 @@ class CustomField extends Model
{
self::created(function ($custom_field) {
// column exists - nothing to do here
if (Schema::hasColumn(CustomField::$table_name, $custom_field->convertUnicodeDbSlug())) {
return false;
@@ -62,14 +64,17 @@ class CustomField extends Model
return true;
}
// This is just a dumb thing we have to include because Laraval/Doctrine doesn't
// play well with enums or a table that EVER had enums. :(
$platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
$platform->registerDoctrineTypeMapping('enum', 'string');
// Rename the field if the name has changed
Schema::table(CustomField::$table_name, function ($table) use ($custom_field) {
$table->renameColumn($custom_field->convertUnicodeDbSlug($custom_field->getOriginal("name")), $custom_field->convertUnicodeDbSlug());
});
// Save the updated column name to the custom fields table
$custom_field->db_column = $custom_field->convertUnicodeDbSlug();
$custom_field->save();
@@ -78,6 +83,8 @@ class CustomField extends Model
return true;
});
// Drop the assets column if we've deleted it from custom fields
self::deleting(function ($custom_field) {
return Schema::table(CustomField::$table_name, function ($table) use ($custom_field) {
$table->dropColumn($custom_field->convertUnicodeDbSlug());
+20 -2
View File
@@ -22,7 +22,14 @@ class License extends Depreciable
protected $injectUniqueIdentifier = true;
use ValidatingTrait;
protected $dates = ['deleted_at'];
// We set these as protected dates so that they will be easily accessible via Carbon
protected $dates = [
'created_at',
'updated_at',
'deleted_at',
'purchase_date'
];
public $timestamps = true;
@@ -266,7 +273,9 @@ class License extends Depreciable
public function availCount()
{
return $this->licenseSeatsRelation()
->whereNull('asset_id');
->whereNull('asset_id')
->whereNull('assigned_to')
->whereNull('deleted_at');
}
public function getAvailSeatsCountAttribute()
@@ -345,6 +354,15 @@ class License extends Depreciable
->first();
}
/*
* Get the next available free seat - used by
* the API to populate next_seat
*/
public function freeSeats()
{
return $this->hasMany('\App\Models\LicenseSeat')->whereNull('assigned_to')->whereNull('deleted_at')->whereNull('asset_id');
}
public static function getExpiringLicenses($days = 60)
{
+6 -2
View File
@@ -54,7 +54,12 @@ class Location extends SnipeModel
public function assets()
{
return $this->hasMany('\App\Models\Asset', 'location_id');
return $this->hasMany('\App\Models\Asset', 'location_id')
->whereHas('assetstatus', function ($query) {
$query->where('status_labels.deployable', '=', 1)
->orWhere('status_labels.pending', '=', 1)
->orWhere('status_labels.archived', '=', 0);
});
}
public function rtd_assets()
@@ -92,7 +97,6 @@ class Location extends SnipeModel
public function assignedAssets()
{
return $this->morphMany('App\Models\Asset', 'assigned', 'assigned_type', 'assigned_to')->withTrashed();
// return $this->hasMany('\App\Models\Asset', 'assigned_to')->withTrashed();
}
public function setLdapOuAttribute($ldap_ou)
+7 -6
View File
@@ -61,7 +61,6 @@ class User extends SnipeModel implements AuthenticatableContract, CanResetPasswo
'email' => 'email|nullable',
'password' => 'required|min:6',
'locale' => 'max:10|nullable',
'manager_id' => 'nullable|different:id',
];
@@ -440,10 +439,12 @@ class User extends SnipeModel implements AuthenticatableContract, CanResetPasswo
});
})
// Ugly, ugly code because Laravel sucks at self-joins
//Ugly, ugly code because Laravel sucks at self-joins
->orWhere(function ($query) use ($search) {
$query->whereRaw("users.manager_id IN (select id from users where first_name LIKE '%".$search."%' OR last_name LIKE '%".$search."%') ");
$query->whereRaw("users.manager_id IN (select id from users where first_name LIKE ? OR last_name LIKE ?)", ["%$search%", "%$search%"]);
});
});
}
@@ -474,7 +475,7 @@ class User extends SnipeModel implements AuthenticatableContract, CanResetPasswo
public function scopeOrderManager($query, $order)
{
// Left join here, or it will only return results with parents
return $query->leftJoin('users as manager', 'users.manager_id', '=', 'manager.id')->orderBy('manager.first_name', $order)->orderBy('manager.last_name', $order);
return $query->leftJoin('users as users_manager', 'users.manager_id', '=', 'users_manager.id')->orderBy('users_manager.first_name', $order)->orderBy('users_manager.last_name', $order);
}
/**
@@ -487,7 +488,7 @@ class User extends SnipeModel implements AuthenticatableContract, CanResetPasswo
*/
public function scopeOrderLocation($query, $order)
{
return $query->leftJoin('locations', 'users.location_id', '=', 'locations.id')->orderBy('locations.name', $order);
return $query->leftJoin('locations as locations_users', 'users.location_id', '=', 'locations_users.id')->orderBy('locations_users.name', $order);
}
@@ -501,6 +502,6 @@ class User extends SnipeModel implements AuthenticatableContract, CanResetPasswo
*/
public function scopeOrderDepartment($query, $order)
{
return $query->leftJoin('departments', 'users.department_id', '=', 'departments.id')->orderBy('departments.name', $order);
return $query->leftJoin('departments as departments_users', 'users.department_id', '=', 'departments_users.id')->orderBy('departments_users.name', $order);
}
}
+1 -1
View File
@@ -93,7 +93,7 @@ class CheckoutNotification extends Notification
'first_name' => $target->present()->fullName(),
'item_name' => $item->present()->name(),
'checkout_date' => $item->last_checkout,
'expected_checkin' => $item->expected_checkin,
'expected_checkin' => ($item->expected_checkin) ? $item->expected_checkin->format('Y-m-d') : '',
'item_tag' => $item->asset_tag,
'note' => $this->params['note'],
'item_serial' => $item->serial,
-5
View File
@@ -26,7 +26,6 @@ abstract class SnipePermissionsPolicy
public function index(User $user)
{
// dd('here');
return $user->hasAccess($this->columnName().'.view');
}
/**
@@ -37,7 +36,6 @@ abstract class SnipePermissionsPolicy
*/
public function view(User $user, $item = null)
{
//
return $user->hasAccess($this->columnName().'.view');
}
@@ -49,7 +47,6 @@ abstract class SnipePermissionsPolicy
*/
public function create(User $user)
{
//
return $user->hasAccess($this->columnName().'.create');
}
@@ -61,7 +58,6 @@ abstract class SnipePermissionsPolicy
*/
public function update(User $user, $item = null)
{
//
return $user->hasAccess($this->columnName().'.edit');
}
@@ -73,7 +69,6 @@ abstract class SnipePermissionsPolicy
*/
public function delete(User $user, $item = null)
{
//
return $user->hasAccess($this->columnName().'.delete');
}
+4 -4
View File
@@ -76,14 +76,14 @@ class LicensePresenter extends Presenter
"title" => trans('general.manufacturer'),
"formatter" => "manufacturersLinkObjFormatter",
], [
"field" => "total_seats",
"field" => "seats",
"searchable" => false,
"sortable" => false,
"sortable" => true,
"title" => trans('admin/accessories/general.total'),
], [
"field" => "remaining_qty",
"field" => "free_seats_count",
"searchable" => false,
"sortable" => false,
"sortable" => true,
"title" => trans('admin/accessories/general.remaining'),
], [
"field" => "purchase_date",
+3 -44
View File
@@ -1,9 +1,8 @@
<?php
namespace App\Providers;
use Validator;
use Illuminate\Support\ServiceProvider;
use DB;
use Log;
use Illuminate\Support\Facades\Schema;
use App\Observers\AssetObserver;
@@ -19,7 +18,7 @@ use App\Models\Component;
/**
* This service provider handles a few custom validation rules.
* This service provider handles setting the observers on models
*
* PHP version 5.5.9
* @version v3.0
@@ -42,47 +41,7 @@ class AppServiceProvider extends ServiceProvider
Component::observe(ComponentObserver::class);
Consumable::observe(ConsumableObserver::class);
License::observe(LicenseObserver::class);
// Email array validator
Validator::extend('email_array', function ($attribute, $value, $parameters, $validator) {
$value = str_replace(' ', '', $value);
$array = explode(',', $value);
foreach ($array as $email) { //loop over values
$email_to_validate['alert_email'][]=$email;
}
$rules = array('alert_email.*'=>'email');
$messages = array(
'alert_email.*'=>trans('validation.email_array')
);
$validator = Validator::make($email_to_validate, $rules, $messages);
return $validator->passes();
});
// Unique only if undeleted
// This works around the use case where multiple deleted items have the same unique attribute.
// (I think this is a bug in Laravel's validator?)
Validator::extend('unique_undeleted', function ($attribute, $value, $parameters, $validator) {
if (count($parameters)) {
$count = DB::table($parameters[0])->select('id')->where($attribute, '=', $value)->whereNull('deleted_at')->where('id', '!=', $parameters[1])->count();
return $count < 1;
}
});
// Share common setting variables with all views.
view()->composer('*', function ($view) {
$view->with('snipeSettings', \App\Models\Setting::getSettings());
});
// Set the monetary locale to the configured locale to make helper::parseFloat work.
setlocale(LC_MONETARY, config('app.locale'));
setlocale(LC_NUMERIC, config('app.locale'));
}
@@ -97,7 +56,7 @@ class AppServiceProvider extends ServiceProvider
$log_level = config('app.log_level');
if (($this->app->environment('production')) && (config('services.rollbar.access_token'))){
$this->app->register(\Jenssegers\Rollbar\RollbarServiceProvider::class);
$this->app->register(\Rollbar\Laravel\RollbarServiceProvider::class);
}
foreach ($monolog->getHandlers() as $handler) {
+131
View File
@@ -0,0 +1,131 @@
<?php
namespace App\Providers;
use Validator;
use Illuminate\Support\ServiceProvider;
use DB;
use Log;
/**
* This service provider handles sharing the snipeSettings variable, and sets
* some common upload path and image urls.
*
* PHP version 5.5.9
* @version v3.0
*/
class SettingsServiceProvider extends ServiceProvider
{
/**
* Custom email array validation
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v3.0]
* @return void
*/
public function boot()
{
// Share common setting variables with all views.
view()->composer('*', function ($view) {
$view->with('snipeSettings', \App\Models\Setting::getSettings());
});
/**
* Set some common variables so that they're globally available.
* The paths should always be public (versus private uploads)
*/
// Model paths and URLs
\App::singleton('models_upload_path', function(){
return public_path('/uploads/models/');
});
\App::singleton('models_upload_url', function(){
return url('/').'/uploads/models/';
});
// Categories
\App::singleton('categories_upload_path', function(){
return public_path('/uploads/categories/');
});
\App::singleton('categories_upload_url', function(){
return url('/').'/uploads/categories/';
});
// Locations
\App::singleton('locations_upload_path', function(){
return public_path('/uploads/locations/');
});
\App::singleton('locations_upload_url', function(){
return url('/').'/uploads/locations/';
});
// Users
\App::singleton('users_upload_path', function(){
return public_path('/uploads/users/');
});
\App::singleton('users_upload_url', function(){
return url('/').'/uploads/users/';
});
// Manufacturers
\App::singleton('manufacturers_upload_path', function(){
return public_path('/uploads/manufacturers/');
});
\App::singleton('manufacturers_upload_url', function(){
return url('/').'/uploads/manufacturers/';
});
// Suppliers
\App::singleton('suppliers_upload_path', function(){
return public_path('/uploads/suppliers/');
});
\App::singleton('suppliers_upload_url', function(){
return url('/').'/uploads/suppliers/';
});
// Departments
\App::singleton('departments_upload_path', function(){
return public_path('/uploads/departments/');
});
\App::singleton('departments_upload_url', function(){
return url('/').'/uploads/departments/';
});
// Company paths and URLs
\App::singleton('companies_upload_path', function(){
return public_path('/uploads/companies/');
});
\App::singleton('companies_upload_url', function(){
return url('/').'/uploads/companies/';
});
// Set the monetary locale to the configured locale to make helper::parseFloat work.
setlocale(LC_MONETARY, config('app.locale'));
setlocale(LC_NUMERIC, config('app.locale'));
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
}
}
+117
View File
@@ -0,0 +1,117 @@
<?php
namespace App\Providers;
use Validator;
use Illuminate\Support\ServiceProvider;
use DB;
use Log;
use Illuminate\Support\Facades\Schema;
use App\Observers\AssetObserver;
use App\Observers\LicenseObserver;
use App\Observers\AccessoryObserver;
use App\Observers\ConsumableObserver;
use App\Observers\ComponentObserver;
use App\Models\Asset;
use App\Models\License;
use App\Models\Accessory;
use App\Models\Consumable;
use App\Models\Component;
/**
* This service provider handles a few custom validation rules.
*
* PHP version 5.5.9
* @version v3.0
*/
class ValidationServiceProvider extends ServiceProvider
{
/**
* Custom email array validation
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v3.0]
* @return void
*/
public function boot()
{
// Email array validator
Validator::extend('email_array', function ($attribute, $value, $parameters, $validator) {
$value = str_replace(' ', '', $value);
$array = explode(',', $value);
foreach ($array as $email) { //loop over values
$email_to_validate['alert_email'][]=$email;
}
$rules = array('alert_email.*'=>'email');
$messages = array(
'alert_email.*'=>trans('validation.email_array')
);
$validator = Validator::make($email_to_validate, $rules, $messages);
return $validator->passes();
});
// Unique only if undeleted
// This works around the use case where multiple deleted items have the same unique attribute.
// (I think this is a bug in Laravel's validator?)
Validator::extend('unique_undeleted', function ($attribute, $value, $parameters, $validator) {
if (count($parameters)) {
$count = DB::table($parameters[0])->select('id')->where($attribute, '=', $value)->whereNull('deleted_at')->where('id', '!=', $parameters[1])->count();
return $count < 1;
}
});
// Yo dawg. I heard you like validators.
// This validates the custom validator regex in custom fields.
// We're just checking that the regex won't throw an exception, not
// that it's actually correct for what the user intended.
Validator::extend('valid_regex', function ($attribute, $value, $parameters, $validator) {
// Make sure it's not just an ANY format
if ($value!='') {
// Check that the string starts with regex:
if (strpos($value, 'regex:') === false) {
return false;
}
$test_string = 'My hovercraft is full of eels';
// We have to stip out the regex: part here to check with preg_match
$test_pattern = str_replace('regex:','', $value);
try {
preg_match($test_pattern, $test_string);
return true;
} catch (\Exception $e) {
return false;
}
}
return true;
});
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
}
}
+2 -3
View File
@@ -4,9 +4,8 @@
"keywords": ["assets", "asset-management", "laravel"],
"license": "AGPL-3",
"type": "project",
"require": {
"require": {
"php": ">=5.6.4",
"aws/aws-sdk-php-laravel": "^3.1",
"barryvdh/laravel-debugbar": "^2.4",
"doctrine/cache": "^1.6",
"doctrine/common": "^2.7",
@@ -17,7 +16,6 @@
"fideloper/proxy": "^3.1",
"intervention/image": "^2.3",
"javiereguiluz/easyslugger": "^1.0",
"jenssegers/rollbar": "^1.5",
"laravel/framework": "5.4.29",
"laravel/passport": "^3.0",
"laravel/tinker": "^1.0",
@@ -30,6 +28,7 @@
"phpspec/prophecy": "1.6.2",
"pragmarx/google2fa": "^1.0",
"predis/predis": "^1.1",
"rollbar/rollbar-laravel": "^2.2",
"schuppo/password-strength": "~1.5",
"spatie/laravel-backup": "^3.0.0",
"tecnickcom/tc-lib-barcode": "^1.15",
Generated
+105 -271
View File
@@ -4,144 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "a1fc66ea043e149e85b4d708f852adbe",
"content-hash": "53bd9d88d11d74732ab302b7ebd01af3",
"packages": [
{
"name": "aws/aws-sdk-php",
"version": "3.36.32",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "7ba49dbd24366647a41cd4a13eab972b2264b8db"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/7ba49dbd24366647a41cd4a13eab972b2264b8db",
"reference": "7ba49dbd24366647a41cd4a13eab972b2264b8db",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-pcre": "*",
"ext-simplexml": "*",
"ext-spl": "*",
"guzzlehttp/guzzle": "^5.3.1|^6.2.1",
"guzzlehttp/promises": "~1.0",
"guzzlehttp/psr7": "^1.4.1",
"mtdowling/jmespath.php": "~2.2",
"php": ">=5.5"
},
"require-dev": {
"andrewsville/php-token-reflection": "^1.4",
"aws/aws-php-sns-message-validator": "~1.0",
"behat/behat": "~3.0",
"doctrine/cache": "~1.4",
"ext-dom": "*",
"ext-openssl": "*",
"nette/neon": "^2.3",
"phpunit/phpunit": "^4.8.35|^5.4.0",
"psr/cache": "^1.0"
},
"suggest": {
"aws/aws-php-sns-message-validator": "To validate incoming SNS notifications",
"doctrine/cache": "To use the DoctrineCacheAdapter",
"ext-curl": "To send requests using cURL",
"ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"autoload": {
"psr-4": {
"Aws\\": "src/"
},
"files": [
"src/functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Amazon Web Services",
"homepage": "http://aws.amazon.com"
}
],
"description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project",
"homepage": "http://aws.amazon.com/sdkforphp",
"keywords": [
"amazon",
"aws",
"cloud",
"dynamodb",
"ec2",
"glacier",
"s3",
"sdk"
],
"time": "2017-10-23T20:40:28+00:00"
},
{
"name": "aws/aws-sdk-php-laravel",
"version": "3.1.0",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php-laravel.git",
"reference": "3b946892d493b91b4920ec4facc4a0ad7195fb86"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php-laravel/zipball/3b946892d493b91b4920ec4facc4a0ad7195fb86",
"reference": "3b946892d493b91b4920ec4facc4a0ad7195fb86",
"shasum": ""
},
"require": {
"aws/aws-sdk-php": "~3.0",
"illuminate/support": "~5.1",
"php": ">=5.5.9"
},
"require-dev": {
"phpunit/phpunit": "~4.0|~5.0"
},
"suggest": {
"laravel/framework": "To test the Laravel bindings",
"laravel/lumen-framework": "To test the Lumen bindings"
},
"type": "library",
"autoload": {
"psr-4": {
"Aws\\Laravel\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Amazon Web Services",
"homepage": "http://aws.amazon.com"
}
],
"description": "A simple Laravel 5 service provider for including the AWS SDK for PHP.",
"homepage": "http://aws.amazon.com/sdkforphp2",
"keywords": [
"amazon",
"aws",
"dynamodb",
"ec2",
"laravel",
"laravel 5",
"s3",
"sdk"
],
"time": "2016-01-18T06:57:07+00:00"
},
{
"name": "barryvdh/laravel-debugbar",
"version": "v2.4.3",
@@ -1375,58 +1239,6 @@
"description": "A fast and easy to use slugger with full UTF-8 support.",
"time": "2015-04-12T19:57:10+00:00"
},
{
"name": "jenssegers/rollbar",
"version": "v1.5.1",
"source": {
"type": "git",
"url": "https://github.com/jenssegers/laravel-rollbar.git",
"reference": "d61d6797884df95f6928dee1e23d886ac7086265"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jenssegers/laravel-rollbar/zipball/d61d6797884df95f6928dee1e23d886ac7086265",
"reference": "d61d6797884df95f6928dee1e23d886ac7086265",
"shasum": ""
},
"require": {
"illuminate/support": "^4.0|^5.0",
"php": ">=5.4",
"rollbar/rollbar": "~0.15"
},
"require-dev": {
"mockery/mockery": "^0.9",
"orchestra/testbench": "^3.0",
"phpunit/phpunit": "~4.0|~5.0",
"satooshi/php-coveralls": "^1.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Jenssegers\\Rollbar\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jens Segers",
"homepage": "https://jenssegers.com"
}
],
"description": "Rollbar error monitoring integration for Laravel projects",
"homepage": "https://github.com/jenssegers/laravel-rollbar",
"keywords": [
"error",
"laravel",
"logging",
"monitoring",
"rollbar"
],
"time": "2017-01-25T08:34:12+00:00"
},
{
"name": "laravel/framework",
"version": "v5.4.29",
@@ -2248,7 +2060,7 @@
},
{
"name": "mtdowling/cron-expression",
"version": "v1.2.0",
"version": "v1.2.1",
"source": {
"type": "git",
"url": "https://github.com/mtdowling/cron-expression.git",
@@ -2290,61 +2102,6 @@
],
"time": "2017-01-23T04:29:33+00:00"
},
{
"name": "mtdowling/jmespath.php",
"version": "2.4.0",
"source": {
"type": "git",
"url": "https://github.com/jmespath/jmespath.php.git",
"reference": "adcc9531682cf87dfda21e1fd5d0e7a41d292fac"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/adcc9531682cf87dfda21e1fd5d0e7a41d292fac",
"reference": "adcc9531682cf87dfda21e1fd5d0e7a41d292fac",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"bin": [
"bin/jp.php"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-4": {
"JmesPath\\": "src/"
},
"files": [
"src/JmesPath.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "Declaratively specify how to extract elements from a JSON document",
"keywords": [
"json",
"jsonpath"
],
"time": "2016-12-03T22:08:25+00:00"
},
{
"name": "neitanod/forceutf8",
"version": "v2.0.1",
@@ -2434,16 +2191,16 @@
},
{
"name": "nikic/php-parser",
"version": "v3.1.1",
"version": "v3.1.2",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "a1e8e1a30e1352f118feff1a8481066ddc2f234a"
"reference": "08131e7ff29de6bb9f12275c7d35df71f25f4d89"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a1e8e1a30e1352f118feff1a8481066ddc2f234a",
"reference": "a1e8e1a30e1352f118feff1a8481066ddc2f234a",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/08131e7ff29de6bb9f12275c7d35df71f25f4d89",
"reference": "08131e7ff29de6bb9f12275c7d35df71f25f4d89",
"shasum": ""
},
"require": {
@@ -2481,7 +2238,7 @@
"parser",
"php"
],
"time": "2017-09-02T17:10:46+00:00"
"time": "2017-11-04T11:48:34+00:00"
},
{
"name": "paragonie/random_compat",
@@ -3101,16 +2858,16 @@
},
{
"name": "psy/psysh",
"version": "v0.8.13",
"version": "v0.8.14",
"source": {
"type": "git",
"url": "https://github.com/bobthecow/psysh.git",
"reference": "cdb5593c3684bab74e10fcfffe4a0c8d1c39695d"
"reference": "91e53c16560bdb8b9592544bb38429ae00d6baee"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/cdb5593c3684bab74e10fcfffe4a0c8d1c39695d",
"reference": "cdb5593c3684bab74e10fcfffe4a0c8d1c39695d",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/91e53c16560bdb8b9592544bb38429ae00d6baee",
"reference": "91e53c16560bdb8b9592544bb38429ae00d6baee",
"shasum": ""
},
"require": {
@@ -3170,7 +2927,7 @@
"interactive",
"shell"
],
"time": "2017-10-19T06:13:20+00:00"
"time": "2017-11-04T16:06:49+00:00"
},
{
"name": "ramsey/uuid",
@@ -3256,31 +3013,40 @@
},
{
"name": "rollbar/rollbar",
"version": "v0.18.2",
"version": "v1.3.3",
"source": {
"type": "git",
"url": "https://github.com/rollbar/rollbar-php.git",
"reference": "fafe13f8beb669d6bba0137f3703fa808d50cbb7"
"reference": "2e092656f49b5bd52eb5ee381b5eece58d82e30e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rollbar/rollbar-php/zipball/fafe13f8beb669d6bba0137f3703fa808d50cbb7",
"reference": "fafe13f8beb669d6bba0137f3703fa808d50cbb7",
"url": "https://api.github.com/repos/rollbar/rollbar-php/zipball/2e092656f49b5bd52eb5ee381b5eece58d82e30e",
"reference": "2e092656f49b5bd52eb5ee381b5eece58d82e30e",
"shasum": ""
},
"require": {
"ext-curl": "*"
"ext-curl": "*",
"psr/log": "~1.0.2"
},
"require-dev": {
"codeclimate/php-test-reporter": "dev-master",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "4.5.*"
"monolog/monolog": "*",
"packfire/php5.3-compat": "*",
"phpmd/phpmd": "@stable",
"phpunit/phpunit": "4.8.*",
"squizlabs/php_codesniffer": "2.*"
},
"suggest": {
"fluent/logger": "Needed to use the 'fluent' handler for fluentd support",
"packfire/php5.3-compat": "for backward compatibility with PHP 5.3"
},
"type": "library",
"autoload": {
"classmap": [
"src/Level.php",
"src/rollbar.php"
]
"psr-4": {
"Rollbar\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -3302,7 +3068,75 @@
"logging",
"monitoring"
],
"time": "2016-07-05T15:50:29+00:00"
"time": "2017-10-27T17:40:44+00:00"
},
{
"name": "rollbar/rollbar-laravel",
"version": "v2.2.1",
"source": {
"type": "git",
"url": "https://github.com/rollbar/rollbar-php-laravel.git",
"reference": "8d46138367cc2a45aa9e1097258847cfc6eddbe2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rollbar/rollbar-php-laravel/zipball/8d46138367cc2a45aa9e1097258847cfc6eddbe2",
"reference": "8d46138367cc2a45aa9e1097258847cfc6eddbe2",
"shasum": ""
},
"require": {
"illuminate/support": "^4.0|^5.0",
"php": ">=5.4",
"rollbar/rollbar": "^1.3.1"
},
"require-dev": {
"mockery/mockery": "^0.9",
"orchestra/testbench": "~3.0",
"phpunit/phpunit": "~4.0|~5.0",
"satooshi/php-coveralls": "^1.0",
"squizlabs/php_codesniffer": "2.*"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Rollbar\\Laravel\\RollbarServiceProvider"
],
"aliases": {
"Rollbar": "Rollbar\\Laravel\\Facades\\Rollbar"
}
}
},
"autoload": {
"psr-4": {
"Rollbar\\Laravel\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jens Segers",
"homepage": "https://jenssegers.com"
},
{
"name": "Artur Moczulski",
"email": "artur.moczulski@gmail.com",
"role": "Contractor @ Rollbar, Inc."
}
],
"description": "Rollbar error monitoring integration for Laravel projects",
"homepage": "https://github.com/rollbar/rollbar-php-laravel",
"keywords": [
"error",
"laravel",
"logging",
"monitoring",
"rollbar"
],
"time": "2017-09-19T00:20:37+00:00"
},
{
"name": "schuppo/password-strength",
@@ -5036,16 +4870,16 @@
},
{
"name": "watson/validating",
"version": "3.1.1",
"version": "3.1.2",
"source": {
"type": "git",
"url": "https://github.com/dwightwatson/validating.git",
"reference": "ade13078bf2e820e244603446114a28eda51b08c"
"reference": "22edd06d45893f5d4f79c9e901bd7fbce174a79f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dwightwatson/validating/zipball/ade13078bf2e820e244603446114a28eda51b08c",
"reference": "ade13078bf2e820e244603446114a28eda51b08c",
"url": "https://api.github.com/repos/dwightwatson/validating/zipball/22edd06d45893f5d4f79c9e901bd7fbce174a79f",
"reference": "22edd06d45893f5d4f79c9e901bd7fbce174a79f",
"shasum": ""
},
"require": {
@@ -5082,7 +4916,7 @@
"laravel",
"validation"
],
"time": "2017-10-08T22:42:01+00:00"
"time": "2017-11-06T21:35:49+00:00"
},
{
"name": "webmozart/assert",
+4 -3
View File
@@ -78,7 +78,7 @@ return [
|
*/
'locale' => env('APP_LOCALE', 'en_US.UTF-8'),
'locale' => env('APP_LOCALE', 'en'),
/*
|--------------------------------------------------------------------------
@@ -121,7 +121,7 @@ return [
|
*/
'log' => env('APP_LOG', 'daily'),
'log' => env('APP_LOG', 'single'),
/*
|--------------------------------------------------------------------------
@@ -278,7 +278,6 @@ return [
*/
Barryvdh\Debugbar\ServiceProvider::class,
Aws\Laravel\AwsServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
Spatie\Backup\BackupServiceProvider::class,
@@ -297,6 +296,8 @@ return [
App\Providers\AuthServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
App\Providers\SettingsServiceProvider::class,
App\Providers\ValidationServiceProvider::class,
/*
-25
View File
@@ -1,25 +0,0 @@
<?php
use Aws\Laravel\AwsServiceProvider;
return [
/*
|--------------------------------------------------------------------------
| AWS SDK Configuration
|--------------------------------------------------------------------------
|
| The configuration options set in this file will be passed directly to the
| `Aws\Sdk` object, from which all client objects are created. The minimum
| required options are declared here, but the full set of possible options
| are documented at:
| http://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/configuration.html
|
*/
'region' => env('AWS_REGION', 'us-east-1'),
'version' => 'latest',
'ua_append' => [
'L5MOD/' . AwsServiceProvider::VERSION,
],
];
+7 -3
View File
@@ -61,7 +61,11 @@ return [
|
*/
'from' => ['address' => env('MAIL_FROM_ADDR', null), 'name' => env('MAIL_FROM_NAME', null)],
'from' =>
[
'address' => env('MAIL_FROM_ADDR', null),
'name' => env('MAIL_FROM_NAME', null)
],
/*
@@ -76,8 +80,8 @@ return [
*/
'reply_to' => [
'address' => env('MAIL_REPLYTO_ADDR', env('MAIL_FROM_ADDR', null)),
'name' => env('MAIL_REPLYTO_NAME', env('MAIL_FROM_NAME', null))
'address' => env('MAIL_REPLYTO_ADDR',null),
'name' => env('MAIL_REPLYTO_NAME', null)
],
/*
+4 -4
View File
@@ -1,7 +1,7 @@
<?php
return array (
'app_version' => 'v4.1.2',
'build_version' => '48',
'hash_version' => 'gd21c92f',
'full_hash' => 'v4.1.2-48-gd21c92f',
'app_version' => 'v4.1.4',
'build_version' => '173',
'hash_version' => 'gba38b84',
'full_hash' => 'v4.1.4-173-gba38b84',
);
@@ -1,11 +1,6 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use App\Models\Asset;
use App\Models\User;
use App\Models\Location;
class MigrateDenormedAssetLocations extends Migration
{
@@ -16,77 +11,11 @@ class MigrateDenormedAssetLocations extends Migration
*/
public function up()
{
// Unassigned
$rtd_assets = Asset::whereNull('assigned_to')->with('defaultLoc')->get();
\Log::info('Unasigned assets: ');
foreach ($rtd_assets as $rtd_asset) {
\Log::info('Setting asset '.$rtd_asset->id.' to location: '.$rtd_asset->rtd_location_id." Because asset's default location is: ".$rtd_asset->rtd_location_id);
$rtd_asset->location_id=$rtd_asset->rtd_location_id;
$rtd_asset->unsetEventDispatcher();
$rtd_asset->save();
}
// Assigned to users - ::with('assignedTo') //can't eager-load polymorphic relations?
$assigned_user_assets = Asset::where('assigned_type',User::class)->whereNotNull('assigned_to')->get();
\Log::debug('User-assigned assets:');
foreach ($assigned_user_assets as $assigned_user_asset) {
if ($assigned_user_asset->assignedTo->userLoc) {
$new_location=$assigned_user_asset->assignedTo->userloc->id;
\Log::info(' They are in '.$assigned_user_asset->assignedTo->userloc->name.' which is id: '.$new_location);
} else {
\Log::info('They have no location! ');
$new_location=$assigned_user_asset->rtd_location_id;
}
$assigned_user_asset->location_id=$new_location;
$assigned_user_asset->unsetEventDispatcher();
$assigned_user_asset->save();
}
// Assigned to locations // with('assetloc')-> //can't eager-load polymorphic relationships
$assigned_location_assets = Asset::where('assigned_type',Location::class)->whereNotNull('assigned_to')->get();
\Log::info('Location-assigned assets: ');
foreach ($assigned_location_assets as $assigned_location_asset) {
$assigned_location_asset->location_id=$assigned_location_asset->assignedTo->id;
\Log::info('(calculated to be: '.$assigned_location_asset->assetLoc());
$assigned_location_asset->unsetEventDispatcher();
$assigned_location_asset->save();
}
// Assigned to assets
$assigned_asset_assets = Asset::where('assigned_type',Asset::class)->whereNotNull('assigned_to')->with('assetloc')->get();
\Log::info('Asset-assigned assets: ');
foreach ($assigned_asset_assets as $assigned_asset_asset) {
\Log::info('This asset is: '.$assigned_asset_asset->assignedTo->asset_tag);
if (($assigned_asset_asset->assignedTo) && ($assigned_asset_asset->assignedTo->location)) {
\Log::info('They are in '.$assigned_asset_asset->assignedTo->location->name);
}
if ($assigned_asset_asset->assetloc) {
\Log::info('User location is: '.$assigned_asset_asset->assetloc->name);
\Log::info('Setting asset '.$assigned_asset_asset->id.' location to '.$assigned_asset_asset->assetloc->id.' ('.$assigned_asset_asset->assetloc->name.')');
$assigned_asset_asset->location_id=$assigned_asset_asset->assetloc->id;
}
}
$unassigned_assets=Asset::whereNull("location_id")->get();
foreach($unassigned_assets as $unassigned_asset) {
\Log::info('Asset: '.$unassigned_asset->id.' still has no location');
}
$assets = Asset::get();
foreach ($assets as $asset) {
if (($asset) && ($asset->assetLoc()) && ($asset->location_id != $asset->assetLoc()->id)) {
\Log::info('MISMATCH MISMATCH '.$asset->id. "doesn't match its location");
}
}
// the contents of this migration have moved to the `php artisan snipeit:sync-asset-locations` script
// I know its gross to edit a migration, but we had to do this for support purposes. - @snipe
Artisan::call('snipeit:sync-asset-locations', ['--output' => 'all']);
$output = Artisan::output();
\Log::info($output);
}
/**
@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddAlertMenuSetting extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
$table->boolean('show_alerts_in_menu')->default(1);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function (Blueprint $table) {
$table->dropColumn('show_alerts_in_menu');
});
}
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class LabelsDisplayCompanyName extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
$table->boolean('labels_display_company_name')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function ($table) {
$table->dropColumn(
'labels_display_company_name'
);
});
}
}
+1 -1
View File
@@ -26,8 +26,8 @@
"bootstrap-datepicker": "^1.6.4",
"bootstrap-less": "^3.3.8",
"ekko-lightbox": "^5.1.1",
"fastclick": "^1.0.6",
"font-awesome": "^4.7.0",
"icheck": "^1.0.2",
"jquery-slimscroll": "^1.3.8",
"jquery-ui": "^1.12.1",
"jquery-ui-bundle": "^1.12.1",
+17 -17
View File
File diff suppressed because one or more lines are too long
+17 -17
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -8,7 +8,7 @@
"/css/app.css.map": "/css/app.css.map?id=bdbe05e6ecd70ccfac72",
"/css/overrides.css.map": "/css/overrides.css.map?id=898c91d4a425b01b589b",
"/css/dist/all.css": "/css/dist/all.css?id=7c3842d2639193ac7e88",
"/js/dist/all.js": "/js/dist/all.js?id=45f8944e6ec45cec9861",
"/js/dist/all.js": "/js/dist/all.js?id=0d558c3ed637f4c81a77",
"/css/build/all.css": "/css/build/all.css?id=7c3842d2639193ac7e88",
"/js/build/all.js": "/js/build/all.js?id=45f8944e6ec45cec9861"
"/js/build/all.js": "/js/build/all.js?id=0d558c3ed637f4c81a77"
}
+4
View File
@@ -19,5 +19,9 @@
</rule>
</rules>
</rewrite>
<staticContent>
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff2" />
</staticContent>
</system.webServer>
</configuration>
+1 -1
View File
@@ -63,7 +63,7 @@ $.AdminLTE.options = {
//native touch experience with touch devices. If you
//choose to enable the plugin, make sure you load the script
//before AdminLTE's app.js
enableFastclick: true,
enableFastclick: false,
//Control Sidebar Options
enableControlSidebar: true,
controlSidebarOptions: {
+3 -1
View File
@@ -194,7 +194,9 @@ $(document).ready(function () {
link.select2({
ajax: {
url: baseUrl + '/api/v1/' + endpoint + '/selectlist',
// the baseUrl includes a trailing slash
url: baseUrl + 'api/v1/' + endpoint + '/selectlist',
dataType: 'json',
delay: 250,
headers: {
+2 -1
View File
@@ -61,7 +61,8 @@ return array(
'error' => 'Bate is nie nagegaan nie, probeer asseblief weer',
'success' => 'Die bate is suksesvol nagegaan.',
'user_does_not_exist' => 'Die gebruiker is ongeldig. Probeer asseblief weer.',
'not_available' => 'Die bate is nie beskikbaar vir die kassa nie!'
'not_available' => 'Die bate is nie beskikbaar vir die kassa nie!',
'no_assets_selected' => 'You must select at least one asset from the list'
),
'checkin' => array(
@@ -23,6 +23,8 @@ return array(
'confirm_purge_help' => 'Tik die teks "DELETE" in die onderstaande blokkie om jou geskrapde rekords te verwyder. Hierdie handeling kan nie ongedaan gemaak word nie.',
'custom_css' => 'Aangepaste CSS',
'custom_css_help' => 'Voer enige aangepaste CSS-oortredings in wat u graag wil gebruik. Moenie die &lt;style&gt;&lt;/style&gt;-etikette insluit nie.',
'custom_forgot_pass_url' => 'Custom Password Reset URL',
'custom_forgot_pass_url_help' => 'This replaces the built-in forgotten password URL on the login screen, useful to direct people to internal or hosted LDAP password reset functionality. It will effectively disable local user forgotten password functionality.',
'default_currency' => 'Verstek Geld',
'default_eula_text' => 'Standaard EULA',
'default_language' => 'Verstek taal',
@@ -44,6 +46,8 @@ return array(
'ldap_enabled' => 'LDAP aangeskakel',
'ldap_integration' => 'LDAP-integrasie',
'ldap_settings' => 'LDAP-instellings',
'ldap_login_test_help' => 'Enter a valid LDAP username and password from the base DN you specified above to test whether your LDAP login is configured correctly. YOU MUST SAVE YOUR UPDATED LDAP SETTINGS FIRST.',
'ldap_login_sync_help' => 'This only tests that LDAP can sync correctly. If your LDAP Authentication query is not correct, users may still not be able to login. YOU MUST SAVE YOUR UPDATED LDAP SETTINGS FIRST.',
'ldap_server' => 'LDAP-bediener',
'ldap_server_help' => 'Dit moet begin met ldap: // (vir unencrypted of TLS) of ldaps: // (vir SSL)',
'ldap_server_cert' => 'LDAP SSL-sertifikaat-validering',
@@ -3,7 +3,7 @@
return array(
'does_not_exist' => 'Verskaffer bestaan nie.',
'assoc_users' => 'Hierdie verskaffer is tans geassosieer met ten minste een model en kan nie uitgevee word nie. Dateer asseblief jou modelle op om nie langer hierdie verskaffer te verwys nie en probeer weer.',
'create' => array(
'error' => 'Verskaffer is nie geskep nie, probeer asseblief weer.',
@@ -18,7 +18,10 @@ return array(
'delete' => array(
'confirm' => 'Is jy seker jy wil hierdie verskaffer uitvee?',
'error' => 'Daar was \'n probleem met die verwydering van die verskaffer. Probeer asseblief weer.',
'success' => 'Verskaffer is suksesvol verwyder.'
'success' => 'Verskaffer is suksesvol verwyder.',
'assoc_assets' => 'This supplier is currently associated with :asset_count asset(s) and cannot be deleted. Please update your assets to no longer reference this supplier and try again. ',
'assoc_licenses' => 'This supplier is currently associated with :licenses_count licences(s) and cannot be deleted. Please update your licenses to no longer reference this supplier and try again. ',
'assoc_maintenances' => 'This supplier is currently associated with :asset_maintenances_count asset maintenances(s) and cannot be deleted. Please update your asset maintenances to no longer reference this supplier and try again. ',
)
);
+9 -7
View File
@@ -2,14 +2,14 @@
return [
'accessories' => 'bykomstighede',
'activated' => 'geaktiveer',
'activated' => 'geaktiveer',
'accessory' => 'Bykomstigheid',
'accessory_report' => 'Toebehoreverslag',
'accessory_report' => 'Toebehoreverslag',
'action' => 'aksie',
'activity_report' => 'Aktiwiteitsverslag',
'address' => 'adres',
'admin' => 'admin',
'add_seats' => 'Bykomende sitplekke',
'add_seats' => 'Bykomende sitplekke',
'all_assets' => 'Alle bates',
'all' => 'Almal',
'archived' => 'argief',
@@ -40,9 +40,10 @@
'checkout' => 'Uitteken',
'city' => 'Stad',
'click_here' => 'Klik hier',
'companies' => 'maatskappye',
'clear_selection' => 'Clear Selection',
'companies' => 'maatskappye',
'company' => 'maatskappy',
'component' => 'komponent',
'component' => 'komponent',
'components' => 'komponente',
'complete' => 'volledige',
'consumable' => 'verbruikbare',
@@ -58,10 +59,10 @@
'custom_report' => 'Aangepaste bateverslag',
'dashboard' => 'Dashboard',
'days' => 'dae',
'days_to_next_audit' => 'Dae na Volgende Oudit',
'days_to_next_audit' => 'Dae na Volgende Oudit',
'date' => 'datum',
'debug_warning' => 'Waarskuwing!',
'debug_warning_text' => 'Hierdie program word uitgevoer in die produksiemodus met debugging aangeskakel. Dit kan sensitiewe data blootstel indien u aansoek vir die buitewêreld toeganklik is. Deaktiveer debug-modus deur die <code>APP_DEBUG</code>-waarde in jou <code>.env</code>-lêer te stel na <code>false</code>.',
'debug_warning_text' => 'Hierdie program word uitgevoer in die produksiemodus met debugging aangeskakel. Dit kan sensitiewe data blootstel indien u aansoek vir die buitewêreld toeganklik is. Deaktiveer debug-modus deur die <code>APP_DEBUG</code>-waarde in jou <code>.env</code>-lêer te stel na <code>false</code>.',
'delete' => 'verwyder',
'deleted' => 'geskrap',
'delete_seats' => 'Plekke verwyder',
@@ -89,6 +90,7 @@
'history' => 'Geskiedenis',
'history_for' => 'Geskiedenis vir',
'id' => 'ID',
'image' => 'Image',
'image_delete' => 'Vee prent uit',
'image_upload' => 'Laai prent op',
'import' => 'invoer',
+1 -1
View File
@@ -87,6 +87,7 @@ return array(
'unique' => 'Die: Attribuut is reeds geneem.',
'uploaded' => 'Die: kenmerk kon nie opgelaai word nie.',
'url' => 'Die: Attribuutformaat is ongeldig.',
"unique_undeleted" => "The :attribute must be unique.",
/*
|--------------------------------------------------------------------------
@@ -117,7 +118,6 @@ return array(
"hashed_pass" => "Jou huidige wagwoord is verkeerd",
'dumbpwd' => 'Daardie wagwoord is te algemeen.',
"statuslabel_type" => "U moet 'n geldige statusetiket tipe kies",
"unique_undeleted" => "Die: Attribuut moet uniek wees.",
],
/*
+2 -1
View File
@@ -62,7 +62,8 @@ return array(
'error' => 'لم يتم سحب مادة العرض، يرجى إعادة المحاولة',
'success' => 'تم التحقق من الأصول بنجاح.',
'user_does_not_exist' => 'هذا المستخدم غير صالح. حاول مرة اخرى.',
'not_available' => 'هذا الأصل غير متاح للخروج!'
'not_available' => 'هذا الأصل غير متاح للخروج!',
'no_assets_selected' => 'You must select at least one asset from the list'
),
'checkin' => array(
@@ -23,6 +23,8 @@ return array(
'confirm_purge_help' => 'أدخل النص "ديليت" في المربع أدناه لتطهير السجلات المحذوفة. لا يمكن التراجع عن هذا الإجراء.',
'custom_css' => 'CSS مخصص',
'custom_css_help' => 'أدخل أي كس مخصص يلغي رغبتك في استخدامه. لا تضمن علامات &lt;style&gt;&lt;/style&gt;.',
'custom_forgot_pass_url' => 'Custom Password Reset URL',
'custom_forgot_pass_url_help' => 'This replaces the built-in forgotten password URL on the login screen, useful to direct people to internal or hosted LDAP password reset functionality. It will effectively disable local user forgotten password functionality.',
'default_currency' => 'العملة الافتراضية',
'default_eula_text' => 'اتفاقية ترخيص المستخدم النهائي',
'default_language' => 'اللغة الافتراضية',
@@ -44,6 +46,8 @@ return array(
'ldap_enabled' => 'تم تمكين لداب',
'ldap_integration' => 'دمج لداب',
'ldap_settings' => 'إعدادات لداب',
'ldap_login_test_help' => 'Enter a valid LDAP username and password from the base DN you specified above to test whether your LDAP login is configured correctly. YOU MUST SAVE YOUR UPDATED LDAP SETTINGS FIRST.',
'ldap_login_sync_help' => 'This only tests that LDAP can sync correctly. If your LDAP Authentication query is not correct, users may still not be able to login. YOU MUST SAVE YOUR UPDATED LDAP SETTINGS FIRST.',
'ldap_server' => 'خادم لداب',
'ldap_server_help' => 'يجب أن يبدأ هذا مع لداب: // (لغير مشفرة أو تلس) أو لدابس: // (ل سل)',
'ldap_server_cert' => 'التحقق من صحة شهادة سل لداب',
@@ -3,7 +3,7 @@
return array(
'does_not_exist' => 'المورد غير مجود.',
'assoc_users' => 'هذا المورد مرتبط حاليا بنموذج واحد على الأقل ولا يمكن حذفه. يرجى تحديث النماذج لم تعد تشير إلى هذا المورد ثم أعد المحاولة.',
'create' => array(
'error' => 'لم يتم إنشاء المورد، الرجاء المحاولة مرة أخرى.',
@@ -18,7 +18,10 @@ return array(
'delete' => array(
'confirm' => 'هل أنت متأكد من رغبتك في حذف هذا المورد؟',
'error' => 'حدثت مشكلة أثناء حذف المورد. حاول مرة اخرى.',
'success' => 'تم حذف المورد بنجاح.'
'success' => 'تم حذف المورد بنجاح.',
'assoc_assets' => 'This supplier is currently associated with :asset_count asset(s) and cannot be deleted. Please update your assets to no longer reference this supplier and try again. ',
'assoc_licenses' => 'This supplier is currently associated with :licenses_count licences(s) and cannot be deleted. Please update your licenses to no longer reference this supplier and try again. ',
'assoc_maintenances' => 'This supplier is currently associated with :asset_maintenances_count asset maintenances(s) and cannot be deleted. Please update your asset maintenances to no longer reference this supplier and try again. ',
)
);
+9 -7
View File
@@ -2,14 +2,14 @@
return [
'accessories' => 'ملحقات',
'activated' => 'مفعل',
'activated' => 'مفعل',
'accessory' => 'ملحق',
'accessory_report' => 'تقرير الملحقات',
'accessory_report' => 'تقرير الملحقات',
'action' => 'الإجراء',
'activity_report' => 'تقرير الأنشطة',
'address' => 'العنوان',
'admin' => 'الإدارة',
'add_seats' => 'المقاعد المضافة',
'add_seats' => 'المقاعد المضافة',
'all_assets' => 'كل الأصول',
'all' => 'الكل',
'archived' => 'مؤرشف',
@@ -40,9 +40,10 @@
'checkout' => 'ترجيع',
'city' => 'المدينة',
'click_here' => 'انقر هنا',
'companies' => 'الشركات',
'clear_selection' => 'Clear Selection',
'companies' => 'الشركات',
'company' => 'شركة',
'component' => 'مكون',
'component' => 'مكون',
'components' => 'المكونات',
'complete' => 'اكتمال',
'consumable' => 'مستهلكات',
@@ -58,10 +59,10 @@
'custom_report' => 'تقرير مخصص للأصول',
'dashboard' => 'لوحة القيادة',
'days' => 'أيام',
'days_to_next_audit' => 'أيام إلى التدقيق التالي',
'days_to_next_audit' => 'أيام إلى التدقيق التالي',
'date' => 'التاريخ',
'debug_warning' => 'تحذير!',
'debug_warning_text' => 'هذا التطبيق يعمل في وضع الإنتاج مع تمكين التصحيح. هذا يمكن أن يعرض البيانات الحساسة إذا كان التطبيق الخاص بك هو في متناول العالم الخارجي. تعطيل وضع التصحيح عن طريق تعيين قيمة <code>APP_DEBUG</code> في ملف <code>.env</code> إلى <code>false</code>.',
'debug_warning_text' => 'هذا التطبيق يعمل في وضع الإنتاج مع تمكين التصحيح. هذا يمكن أن يعرض البيانات الحساسة إذا كان التطبيق الخاص بك هو في متناول العالم الخارجي. تعطيل وضع التصحيح عن طريق تعيين قيمة <code>APP_DEBUG</code> في ملف <code>.env</code> إلى <code>false</code>.',
'delete' => 'حذف',
'deleted' => 'تم حذفها',
'delete_seats' => 'المقاعد المحذوفة',
@@ -89,6 +90,7 @@
'history' => 'التاريخ',
'history_for' => 'السجل لـ',
'id' => 'الرقم',
'image' => 'Image',
'image_delete' => 'حذف الصورة',
'image_upload' => 'رفع صورة',
'import' => 'استيراد',
+1 -1
View File
@@ -87,6 +87,7 @@ return array(
'unique' => 'تم أخذ السمة: بالفعل.',
'uploaded' => 'أخفق تحميل السمة:.',
'url' => 'تنسيق السمة: غير صالح.',
"unique_undeleted" => "The :attribute must be unique.",
/*
|--------------------------------------------------------------------------
@@ -117,7 +118,6 @@ return array(
"hashed_pass" => "كلمة المرور الحالية غير صحيحة",
'dumbpwd' => 'كلمة المرور هذه شائعة جدا.',
"statuslabel_type" => "يجب تحديد نوع تصنيف حالة صالح",
"unique_undeleted" => "يجب أن تكون السمة فريدة.",
],
/*
+2 -1
View File
@@ -61,7 +61,8 @@ return array(
'error' => 'Активът не беше изписан. Моля опитайте отново.',
'success' => 'Активът изписан успешно.',
'user_does_not_exist' => 'Невалиден потребител. Моля опитайте отново.',
'not_available' => 'Този актив не е наличен за отписване!'
'not_available' => 'Този актив не е наличен за отписване!',
'no_assets_selected' => 'You must select at least one asset from the list'
),
'checkin' => array(
@@ -23,6 +23,8 @@ return array(
'confirm_purge_help' => 'Въдете текста "DELETE" в клетката отдолу за да пречистите изтритите записи. Това действие не може да бъде отменено.',
'custom_css' => 'Потребителски CSS',
'custom_css_help' => 'Включете вашите CSS правила тук. Не използвайте &lt;style&gt;&lt;/style&gt; тагове.',
'custom_forgot_pass_url' => 'Custom Password Reset URL',
'custom_forgot_pass_url_help' => 'This replaces the built-in forgotten password URL on the login screen, useful to direct people to internal or hosted LDAP password reset functionality. It will effectively disable local user forgotten password functionality.',
'default_currency' => 'Валута по подразбиране',
'default_eula_text' => 'EULA по подразбиране',
'default_language' => 'Език по подразбиране',
@@ -44,6 +46,8 @@ return array(
'ldap_enabled' => 'LDAP включен',
'ldap_integration' => 'LDAP интеграция',
'ldap_settings' => 'LDAP настройки',
'ldap_login_test_help' => 'Enter a valid LDAP username and password from the base DN you specified above to test whether your LDAP login is configured correctly. YOU MUST SAVE YOUR UPDATED LDAP SETTINGS FIRST.',
'ldap_login_sync_help' => 'This only tests that LDAP can sync correctly. If your LDAP Authentication query is not correct, users may still not be able to login. YOU MUST SAVE YOUR UPDATED LDAP SETTINGS FIRST.',
'ldap_server' => 'LDAP сървър',
'ldap_server_help' => 'Това трябва да започва с Idap:// (for unencrypted or TLS) или Idaps:// (for SSL)',
'ldap_server_cert' => 'Валидация на LDAP SSL сертификата',
@@ -3,7 +3,7 @@
return array(
'does_not_exist' => 'Несъществуващ доставчик.',
'assoc_users' => 'Този доставчик е асоцииран с поне един от моделите и не може да бъде изтрит. Моля, променете връзките на моделите по отношение на този доставчик и опитайте отново. ',
'create' => array(
'error' => 'Доставчикът не беше създаден. Моля, опитайте отново.',
@@ -18,7 +18,10 @@ return array(
'delete' => array(
'confirm' => 'Сигурни ли сте, че искате да изтриете този доставчик?',
'error' => 'Възникна проблем при изтриване на доставчика. Моля, опитайте отново.',
'success' => 'Доставчикът е изтрит.'
'success' => 'Доставчикът е изтрит.',
'assoc_assets' => 'This supplier is currently associated with :asset_count asset(s) and cannot be deleted. Please update your assets to no longer reference this supplier and try again. ',
'assoc_licenses' => 'This supplier is currently associated with :licenses_count licences(s) and cannot be deleted. Please update your licenses to no longer reference this supplier and try again. ',
'assoc_maintenances' => 'This supplier is currently associated with :asset_maintenances_count asset maintenances(s) and cannot be deleted. Please update your asset maintenances to no longer reference this supplier and try again. ',
)
);
+9 -7
View File
@@ -2,14 +2,14 @@
return [
'accessories' => 'Аксесоари',
'activated' => 'Активирано',
'activated' => 'Активирано',
'accessory' => 'Аксесоар',
'accessory_report' => 'Справка за аксесоарите',
'accessory_report' => 'Справка за аксесоарите',
'action' => 'Действие',
'activity_report' => 'Справка за дейностите',
'address' => 'Aдрес',
'admin' => 'Администриране',
'add_seats' => 'Добавени работни места',
'add_seats' => 'Добавени работни места',
'all_assets' => 'Всички активи',
'all' => 'Всички',
'archived' => 'Архивирани',
@@ -40,9 +40,10 @@
'checkout' => 'Изписване',
'city' => 'Град',
'click_here' => 'Натиснете тук',
'companies' => 'Компании',
'clear_selection' => 'Clear Selection',
'companies' => 'Компании',
'company' => 'Компания',
'component' => 'Компонент',
'component' => 'Компонент',
'components' => 'Компоненти',
'complete' => 'Завърши',
'consumable' => 'Консуматив',
@@ -58,10 +59,10 @@
'custom_report' => 'Потребителски справки за активи',
'dashboard' => 'Табло',
'days' => 'дни',
'days_to_next_audit' => 'Дни до следващия одит',
'days_to_next_audit' => 'Дни до следващия одит',
'date' => 'Дата',
'debug_warning' => 'Предупреждение!',
'debug_warning_text' => 'Това приложение се изпълнява в режим на производство с разрешено отстраняване на грешки. Това може да изложи чувствителни данни, ако приложението ви е достъпно за външния свят. Забранете режим отстраняване на грешки чрез задаване на стойността <code>APP_DEBUF</code> <code>.env</code> във файла <code>false</code>.',
'debug_warning_text' => 'Това приложение се изпълнява в режим на производство с разрешено отстраняване на грешки. Това може да изложи чувствителни данни, ако приложението ви е достъпно за външния свят. Забранете режим отстраняване на грешки чрез задаване на стойността <code>APP_DEBUF</code> <code>.env</code> във файла <code>false</code>.',
'delete' => 'Изтриване',
'deleted' => 'Изтрито',
'delete_seats' => 'Изтрити работни места за лиценз',
@@ -89,6 +90,7 @@
'history' => 'История',
'history_for' => 'История за',
'id' => 'ID',
'image' => 'Image',
'image_delete' => 'Изтриване на изображението',
'image_upload' => 'Качване на изображение',
'import' => 'Зареждане',
+1 -1
View File
@@ -87,6 +87,7 @@ return array(
'unique' => ':attribute вече е вписан.',
'uploaded' => 'Атрибутът: не успя да качи.',
'url' => 'Форматът на :attribute е невалиден.',
"unique_undeleted" => "The :attribute must be unique.",
/*
|--------------------------------------------------------------------------
@@ -117,7 +118,6 @@ return array(
"hashed_pass" => "Текущата ви парола е неправилна",
'dumbpwd' => 'Тази парола е твърде често срещана.',
"statuslabel_type" => "Трябва да изберете валиден тип етикет на състоянието",
"unique_undeleted" => "Атрибутът: трябва да е уникален.",
],
/*
+2 -1
View File
@@ -62,7 +62,8 @@ return array(
'error' => 'Majetek nebyl předán, zkuste to prosím znovu',
'success' => 'Majetek byl v pořádku předán.',
'user_does_not_exist' => 'Tento uživatel je neplatný. Zkuste to prosím znovu.',
'not_available' => 'Tento majetek není k dispozici pro výdej!'
'not_available' => 'Tento majetek není k dispozici pro výdej!',
'no_assets_selected' => 'You must select at least one asset from the list'
),
'checkin' => array(
@@ -23,6 +23,8 @@ return array(
'confirm_purge_help' => 'Do rámečku níže zadejte text "DELETE", čímž odstraníte odstraněné záznamy. Tuto akci nelze vrátit zpět.',
'custom_css' => 'Vlastní CSS',
'custom_css_help' => 'Zadejte libovolné vlastní CSS, které chcete použít. Nezahrnujte &lt;style&gt;&lt;/style&gt; tagy.',
'custom_forgot_pass_url' => 'Custom Password Reset URL',
'custom_forgot_pass_url_help' => 'This replaces the built-in forgotten password URL on the login screen, useful to direct people to internal or hosted LDAP password reset functionality. It will effectively disable local user forgotten password functionality.',
'default_currency' => 'Výchozí měna',
'default_eula_text' => 'Výchozí EULA',
'default_language' => 'Výchozí jazyk',
@@ -44,6 +46,8 @@ return array(
'ldap_enabled' => 'LDAP povoleno',
'ldap_integration' => 'LDAP integrace',
'ldap_settings' => 'Nastavení LDAP',
'ldap_login_test_help' => 'Enter a valid LDAP username and password from the base DN you specified above to test whether your LDAP login is configured correctly. YOU MUST SAVE YOUR UPDATED LDAP SETTINGS FIRST.',
'ldap_login_sync_help' => 'This only tests that LDAP can sync correctly. If your LDAP Authentication query is not correct, users may still not be able to login. YOU MUST SAVE YOUR UPDATED LDAP SETTINGS FIRST.',
'ldap_server' => 'LDAP server',
'ldap_server_help' => 'Toto by mělo začít s ldap: // (pro nešifrované nebo TLS) nebo ldaps: // (pro SSL)',
'ldap_server_cert' => 'Validace certifikátů LDAP SSL',
@@ -3,7 +3,7 @@
return array(
'does_not_exist' => 'Dodavatel neexistuje.',
'assoc_users' => 'Tento dodavatel je právě přiřazena alespoň k jednomu modelu majetku a nemůže tak být odstraněn. Odeberte jeho vazbu z patřičných modelů a akci opakujte. ',
'create' => array(
'error' => 'Dodavatel nebyl vytvořen, zkuste to prosím znovu.',
@@ -18,7 +18,10 @@ return array(
'delete' => array(
'confirm' => 'Opravdu si přejete odstranit tohoto dodavatele?',
'error' => 'Vyskytl se problém při mazání dodavatele. Zkuste to prosím znovu.',
'success' => 'Dodavatel byl úspěšně smazán.'
'success' => 'Dodavatel byl úspěšně smazán.',
'assoc_assets' => 'This supplier is currently associated with :asset_count asset(s) and cannot be deleted. Please update your assets to no longer reference this supplier and try again. ',
'assoc_licenses' => 'This supplier is currently associated with :licenses_count licences(s) and cannot be deleted. Please update your licenses to no longer reference this supplier and try again. ',
'assoc_maintenances' => 'This supplier is currently associated with :asset_maintenances_count asset maintenances(s) and cannot be deleted. Please update your asset maintenances to no longer reference this supplier and try again. ',
)
);
+9 -7
View File
@@ -2,14 +2,14 @@
return [
'accessories' => 'Příslušenství',
'activated' => 'Aktivováno',
'activated' => 'Aktivováno',
'accessory' => 'Příslušenství',
'accessory_report' => 'Zpráva o doplňcích',
'accessory_report' => 'Zpráva o doplňcích',
'action' => 'Akce',
'activity_report' => 'Report aktivity',
'address' => 'Adresa',
'admin' => 'Admin',
'add_seats' => 'Přidaná licenční místa',
'add_seats' => 'Přidaná licenční místa',
'all_assets' => 'Všechna zařízení',
'all' => 'Vše',
'archived' => 'Archivováno',
@@ -40,9 +40,10 @@
'checkout' => 'Výdej',
'city' => 'Město',
'click_here' => 'Klikněte zde',
'companies' => 'Firmy',
'clear_selection' => 'Clear Selection',
'companies' => 'Firmy',
'company' => 'Společnost',
'component' => 'Komponent',
'component' => 'Komponent',
'components' => 'Komponenty',
'complete' => 'Dokončit',
'consumable' => 'Spotřební materiál',
@@ -58,10 +59,10 @@
'custom_report' => 'Vlastní report majetku',
'dashboard' => 'Nástěnka',
'days' => 'dnů',
'days_to_next_audit' => 'Dny k dalšímu auditu',
'days_to_next_audit' => 'Dny k dalšímu auditu',
'date' => 'Datum',
'debug_warning' => 'Varování!',
'debug_warning_text' => 'Tato aplikace běží ve výrobním režimu s povoleným laděním. To znamená že citlivá data mohou být přístupná vnějšímu světu. Deaktivujte režim ladění nastavením hodnoty <code>APP_DEBUG</code> v souboru <code>.env</code> na <code>false</code>.',
'debug_warning_text' => 'Tato aplikace běží ve výrobním režimu s povoleným laděním. To znamená že citlivá data mohou být přístupná vnějšímu světu. Deaktivujte režim ladění nastavením hodnoty <code>APP_DEBUG</code> v souboru <code>.env</code> na <code>false</code>.',
'delete' => 'Odstranit',
'deleted' => 'Odstraněno',
'delete_seats' => 'Vymazaná licenční místa',
@@ -89,6 +90,7 @@
'history' => 'Historie',
'history_for' => 'Historie uživatele',
'id' => 'ID',
'image' => 'Image',
'image_delete' => 'Smazat obrázek',
'image_upload' => 'Nahrát obrázek',
'import' => 'Import',
+1 -1
View File
@@ -87,6 +87,7 @@ return array(
'unique' => ':attribute byl již vybrán.',
'uploaded' => 'Atribut: se nepodařilo nahrát.',
'url' => 'Formát :attribute je neplatný.',
"unique_undeleted" => "The :attribute must be unique.",
/*
|--------------------------------------------------------------------------
@@ -117,7 +118,6 @@ return array(
"hashed_pass" => "Vaše současné heslo je nesprávné",
'dumbpwd' => 'Toto heslo je příliš běžné.',
"statuslabel_type" => "Musíte vybrat platný typ štítku stavu",
"unique_undeleted" => "Atribut musí být jedinečný.",
],
/*
+2 -1
View File
@@ -61,7 +61,8 @@ return array(
'error' => 'Akten blev ikke tjekket ud, prøv igen',
'success' => 'Asset tjekket ud med succes.',
'user_does_not_exist' => 'Denne bruger er ugyldig. Prøv igen.',
'not_available' => 'Det aktiv er ikke tilgængeligt for kassen!'
'not_available' => 'Det aktiv er ikke tilgængeligt for kassen!',
'no_assets_selected' => 'You must select at least one asset from the list'
),
'checkin' => array(
@@ -23,6 +23,8 @@ return array(
'confirm_purge_help' => 'Indtast teksten "DELETE" i boksen nedenfor for at rense dine slettede poster. Denne handling kan ikke fortrydes.',
'custom_css' => 'Brugerdefineret CSS',
'custom_css_help' => 'Indtast eventuelle brugerdefinerede CSS overskridelser, du gerne vil bruge. Indsæt ikke de &lt;style&gt;&lt;/style&gt; tags.',
'custom_forgot_pass_url' => 'Custom Password Reset URL',
'custom_forgot_pass_url_help' => 'This replaces the built-in forgotten password URL on the login screen, useful to direct people to internal or hosted LDAP password reset functionality. It will effectively disable local user forgotten password functionality.',
'default_currency' => 'Standardvaluta',
'default_eula_text' => 'Standard EULA',
'default_language' => 'Standard sprog',
@@ -44,6 +46,8 @@ return array(
'ldap_enabled' => 'LDAP aktiveret',
'ldap_integration' => 'LDAP Integration',
'ldap_settings' => 'LDAP-indstillinger',
'ldap_login_test_help' => 'Enter a valid LDAP username and password from the base DN you specified above to test whether your LDAP login is configured correctly. YOU MUST SAVE YOUR UPDATED LDAP SETTINGS FIRST.',
'ldap_login_sync_help' => 'This only tests that LDAP can sync correctly. If your LDAP Authentication query is not correct, users may still not be able to login. YOU MUST SAVE YOUR UPDATED LDAP SETTINGS FIRST.',
'ldap_server' => 'LDAP-server',
'ldap_server_help' => 'Dette skal starte med ldap: // (for ukrypteret eller TLS) eller ldaps: // (for SSL)',
'ldap_server_cert' => 'Validering af LDAP SSL-certifikat',
@@ -3,7 +3,7 @@
return array(
'does_not_exist' => 'Leverandør findes ikke.',
'assoc_users' => 'Denne leverandør er i øjeblikket forbundet med mindst en model og kan ikke slettes. Opdater dine modeller for ikke længere at henvise til denne leverandør, og prøv igen.',
'create' => array(
'error' => 'Leverandøren blev ikke oprettet, prøv igen.',
@@ -18,7 +18,10 @@ return array(
'delete' => array(
'confirm' => 'Er du sikker på, at du ønsker at slette denne leverandør?',
'error' => 'Der opstod et problem ved at slette leverandøren. Prøv igen.',
'success' => 'Leverandøren blev slettet med succes.'
'success' => 'Leverandøren blev slettet med succes.',
'assoc_assets' => 'This supplier is currently associated with :asset_count asset(s) and cannot be deleted. Please update your assets to no longer reference this supplier and try again. ',
'assoc_licenses' => 'This supplier is currently associated with :licenses_count licences(s) and cannot be deleted. Please update your licenses to no longer reference this supplier and try again. ',
'assoc_maintenances' => 'This supplier is currently associated with :asset_maintenances_count asset maintenances(s) and cannot be deleted. Please update your asset maintenances to no longer reference this supplier and try again. ',
)
);
+9 -7
View File
@@ -2,14 +2,14 @@
return [
'accessories' => 'Tilbehør',
'activated' => 'Aktiveret',
'activated' => 'Aktiveret',
'accessory' => 'Tilbehør',
'accessory_report' => 'Tilbehørsrapport',
'accessory_report' => 'Tilbehørsrapport',
'action' => 'Handling',
'activity_report' => 'Aktivitetsrapport',
'address' => 'Addresse',
'admin' => 'Admin',
'add_seats' => 'Tilføjede pladser',
'add_seats' => 'Tilføjede pladser',
'all_assets' => 'Alle aktiver',
'all' => 'Alle',
'archived' => 'Arkiveret',
@@ -40,9 +40,10 @@
'checkout' => 'Tjek Ud',
'city' => 'By',
'click_here' => 'Klik her',
'companies' => 'Selskaber',
'clear_selection' => 'Clear Selection',
'companies' => 'Selskaber',
'company' => 'Selskab',
'component' => 'Komponent',
'component' => 'Komponent',
'components' => 'Komponenter',
'complete' => 'Komplet',
'consumable' => 'forbrugsmateriale',
@@ -58,10 +59,10 @@
'custom_report' => 'Tilpasset Aktiv Rapport',
'dashboard' => 'Oversigtspanel',
'days' => 'dage',
'days_to_next_audit' => 'Dage til næste revision',
'days_to_next_audit' => 'Dage til næste revision',
'date' => 'Dato',
'debug_warning' => 'Advarsel!',
'debug_warning_text' => 'Denne applikation kører i produktionstilstand med debugging aktiveret. Dette kan udsætte følsomme data, hvis din ansøgning er tilgængelig for omverdenen. Deaktiver fejlsøgningsmodus ved at indstille værdien <code>APP_DEBUG</code> i din <code>.env</code> fil til <code>false</code>.',
'debug_warning_text' => 'Denne applikation kører i produktionstilstand med debugging aktiveret. Dette kan udsætte følsomme data, hvis din ansøgning er tilgængelig for omverdenen. Deaktiver fejlsøgningsmodus ved at indstille værdien <code>APP_DEBUG</code> i din <code>.env</code> fil til <code>false</code>.',
'delete' => 'Slet',
'deleted' => 'Slettet',
'delete_seats' => 'Slettede pladser',
@@ -89,6 +90,7 @@
'history' => 'Historik',
'history_for' => 'Historie for',
'id' => 'ID',
'image' => 'Image',
'image_delete' => 'Slet billede',
'image_upload' => 'Upload billede',
'import' => 'Importér',
+1 -1
View File
@@ -87,6 +87,7 @@ return array(
'unique' => ':attribute er allerede taget.',
'uploaded' => 'Attributtet kunne ikke uploades.',
'url' => ':attribute formatet er ugyldigt.',
"unique_undeleted" => "The :attribute must be unique.",
/*
|--------------------------------------------------------------------------
@@ -117,7 +118,6 @@ return array(
"hashed_pass" => "Din nuværende adgangskode er forkert",
'dumbpwd' => 'Denne adgangskode er for almindelig.',
"statuslabel_type" => "Du skal vælge en gyldig statusetiketype",
"unique_undeleted" => "Attributten skal være unik.",
],
/*
+2 -1
View File
@@ -62,7 +62,8 @@ return array(
'error' => 'Asset konnte nicht herausgegeben werden. Bitte versuchen Sie es erneut',
'success' => 'Asset wurde erfolgreich herausgegeben.',
'user_does_not_exist' => 'Dieser Benutzer existiert nicht. Bitte versuchen Sie es erneut.',
'not_available' => 'Dieses Asset kann nicht herausgegeben werden!'
'not_available' => 'Dieses Asset kann nicht herausgegeben werden!',
'no_assets_selected' => 'You must select at least one asset from the list'
),
'checkin' => array(

Some files were not shown because too many files have changed in this diff Show More