Compare commits

...

175 Commits

Author SHA1 Message Date
snipe b4d6842a7c Minor formatting changes, added DB call for custom fields 2016-06-13 21:45:52 -07:00
snipe f3e42384c5 Hardcoded higher PHP execution limits 2016-06-13 21:41:09 -07:00
snipe c29984d0df Skip superuser check if the user isn't logged in 2016-06-13 19:05:29 -07:00
snipe 0fd43c0a5d Updated language strings 2016-06-13 12:16:43 -07:00
snipe 3ca81f4d73 Fixes #2140 2016-06-13 12:07:01 -07:00
snipe bfe4bc6ee5 Bypass company scoping if user is an admin 2016-06-13 11:40:22 -07:00
snipe dec95c3e06 Updated blade for box panel 2016-06-13 11:39:57 -07:00
snipe 2df71be321 No need to update the user again 2016-06-13 11:30:47 -07:00
snipe 396446a34b Updated namespace for collection 2016-06-13 10:54:28 -07:00
snipe 2daed3c271 Fix for custom fields not saving 2016-06-10 16:36:46 -07:00
snipe c1a3592059 Fixes #2130 2016-06-10 08:29:43 -07:00
snipe 57c9d506b8 Fix namespacing for actionlog 2016-06-10 07:57:54 -07:00
snipe 5904de8718 Remove asset tag requirement from form request
It donks the edit screen as it thinks the asset tag has already been taken
2016-06-10 05:54:20 -07:00
snipe ac15fb9be9 Merge pull request #2147 from dmeltzer/Fix-Asset-Creation-with-old-data
Fix editing assets.
2016-06-10 05:51:33 -07:00
Daniel Meltzer 2159d77fc2 No longer necessary. 2016-06-10 07:46:38 -05:00
Daniel Meltzer e9605891f3 Merge upstream and fix changes. 2016-06-10 07:44:45 -05:00
Daniel Meltzer 9c4c91063f Merge branch 'v3' into Fix-Asset-Creation-with-old-data 2016-06-10 07:35:30 -05:00
Daniel Meltzer 4e74c553bd Fix editing of assets. This also uses the asset form request for validation. 2016-06-10 07:33:33 -05:00
snipe 9e8b76d348 Use updated $request->input methods for 5.2 2016-06-10 05:16:27 -07:00
snipe 6fa4d1252d Fixes purchase date if no purchase date given 2016-06-10 05:00:49 -07:00
snipe 7a9cfb1a8f Fixed label weirdness when no serial 2016-06-10 04:43:17 -07:00
snipe a0901247a3 Let superadmins through companyable trait 2016-06-10 04:07:27 -07:00
snipe 02a9394cd9 Merge remote-tracking branch 'origin/v3' into v3-master 2016-06-10 03:41:03 -07:00
snipe ec4bc6c2af Allow superadmins to print labels 2016-06-10 03:40:49 -07:00
snipe 4e1472f66d Merge remote-tracking branch 'origin/v3' into v3-master 2016-06-10 00:48:33 -07:00
snipe c6ca1748cb Merge pull request #2146 from dmeltzer/Fix-Asset-Creation-with-old-data
Fix hardware creation error making old input disappear.
2016-06-10 00:47:30 -07:00
Daniel Meltzer 044695cb02 Fix hardware creation error making old input disappear. This should be redone to dynamically update on the client side based on a JSON response instead of flashing and reloading, but that's a lot of change for v3 at this point. 2016-06-09 20:28:49 -05:00
snipe f44d98924d Removed erroneous call to nonexistent model 2016-06-09 14:42:13 -07:00
snipe 66adffe6d9 Moved include 2016-06-09 14:41:58 -07:00
snipe c91c1f92cd Fixes #2132 2016-06-09 13:27:50 -07:00
snipe bbb116f29c Fixes #2142 2016-06-09 12:25:51 -07:00
snipe a04d6293d1 Proper hypenation of Snipe-IT in footer 2016-06-09 03:08:42 -07:00
snipe 845b182fdf Fixes format for users in category view 2016-06-09 02:26:43 -07:00
snipe 2b5fb04ba9 Allow admin to add user on checkout screen 2016-06-09 00:36:52 -07:00
snipe bb758d618b Merge branch 'v3' of github.com:snipe/snipe-it into v3 2016-06-08 23:28:53 -07:00
snipe 9b2c7d749b Fixed barcode descriptions 2016-06-08 23:28:44 -07:00
snipe 51742d66df Removed uneeded size array 2016-06-08 23:28:21 -07:00
snipe 3a101aa0c8 Merge pull request #2131 from dmeltzer/fix-license-checkout
Fix license Checkout.
2016-06-08 18:01:16 -07:00
Daniel Meltzer 9648c6f1d3 Fix license Checkout.
A mistake in the sqlite porting led to "Please select an asset"
disappearing.  This centralizes that code in Helper, and uses the code
in Licensescontroller and componentscontroller.

Also use the proper name on the components checkout page.

AssetMaintencesController reuses the same underlying code as
licensescontroller, but we don't want "Please select an asset" to be an
option there, so I'm not changing that code.
2016-06-07 07:58:08 -05:00
snipe 75eb2bbe09 Janky-ass form request stuff 2016-06-06 21:02:06 -07:00
snipe d4e231d5d4 Save permissions on new user 2016-06-06 18:56:43 -07:00
snipe 75dfb87671 Use form request for user add/edit to handle password and password confirmation 2016-06-06 14:15:50 -07:00
snipe 23936e465d Merge pull request #2123 from dmeltzer/fix-setup-on-windows
Fix missing posix_getpwuid on windows.
2016-06-06 12:31:30 -07:00
snipe 13d11bfdcc Merge pull request #2121 from dmeltzer/add-soft-pave
Add a 'soft' delete option to the pave tool.
2016-06-06 12:30:06 -07:00
snipe 21506f4101 Merge pull request #2120 from dmeltzer/add-clone-to-models-index
Add clone action to Assetmodels index page.
2016-06-06 12:29:54 -07:00
snipe 51ab8ce41c Merge pull request #2119 from dmeltzer/fix-category-lists
Modify Helper::categoryList() to take a category type parameter.
2016-06-06 12:29:31 -07:00
Daniel Meltzer ea3e11e011 Fix missing posix_getpwuid on windows.
This isn't a perfect solution.  It basically just nullifies the check on
windows.  I'm not sure if IIS can run as a nonelevated user though, so
perhaps thats the best choice.  Regardless, this fixes the setup.
2016-06-06 07:43:05 -05:00
Daniel Meltzer 6ba37a3a8d Add a 'soft' delete option to the pave tool. This leaves db structure and migrations in place but removes everything inside the db except the first user. 2016-06-05 10:24:42 -05:00
Daniel Meltzer a89511674b Add clone icon to Assetmodels index page. 2016-06-05 10:00:31 -05:00
Daniel Meltzer cd9cca9c6b Modify Helper::categoryList() to take a category type parameter.
This allows for centralizing the category fetching code more and fixes
an error in asset model viewing (#2118).  Also add a few translated
strings and standardize on a base of 'Select a *' for the default value
in our lists.
2016-06-05 09:47:44 -05:00
snipe 9f6eb02afc Don't purge users where show_in_list = 1
This is necessary so hosted customers can't hard-delete my account :-/
2016-06-03 12:13:59 -07:00
snipe f8ac9a3f77 Fixes #2110 2016-06-03 11:48:20 -07:00
snipe b28d966645 Merge branch 'v3' of github.com:snipe/snipe-it into v3 2016-06-02 21:16:48 -07:00
snipe 030b525535 Small readme changes 2016-06-02 21:16:43 -07:00
Brady Wetherington 093bcdfe4f Fix to Dockerfile build; backup path must've changed. 2016-06-02 21:10:50 -07:00
Brady Wetherington 5e0cc241a0 Forgot to add the new docker.env file 2016-06-02 20:35:05 -07:00
snipe 7d5c7991f4 Create backups directory 2016-06-02 19:45:59 -07:00
snipe 9ced24b127 Bumped version for RC-3 release 2016-06-02 19:06:54 -07:00
snipe fd32f6d4d5 New language strings 2016-06-02 19:01:09 -07:00
snipe c5d96812f3 Fixed erronerously removed save methods 2016-06-02 17:22:23 -07:00
snipe 6de6052185 Hardcoded page number to prevent error 2016-06-02 17:17:50 -07:00
snipe 402c955f1c Fixed title 2016-06-02 17:17:42 -07:00
snipe 2f8cbe4ac2 Better default mysqldump path 2016-06-02 17:17:33 -07:00
snipe 95f94c1cfb Fixed error when user has no permissions values 2016-06-02 17:16:22 -07:00
snipe 485fb26393 Fixes #1985 - disallow checkin/checkout if the asset is not in a deployable status 2016-06-02 14:04:54 -07:00
snipe 9551c07528 Fixes #2087 - bad route to maintenance edit 2016-06-02 11:18:17 -07:00
snipe 2d5a0deb31 Eager loading for requestable assets account page 2016-06-02 02:57:22 -07:00
snipe 7d2ea36997 Use permission gates on routes 2016-06-02 02:50:00 -07:00
snipe 97691726f0 Updates to permissions decoding 2016-06-02 02:49:32 -07:00
snipe dce549cc5c Updated debugbar prefs 2016-06-02 02:49:17 -07:00
snipe 049e13e365 Switch to gate for permission check 2016-06-02 02:48:52 -07:00
snipe dddb0f7267 Fixed group error message 2016-06-02 02:46:49 -07:00
snipe 5de6b8e016 Added gates to authservice provider for finer tuned permissions 2016-06-02 02:40:49 -07:00
snipe a3e9b3df86 Updated error page title 2016-06-02 02:39:44 -07:00
snipe 89e656e709 Switched to can/cannot for blade 2016-06-02 02:39:36 -07:00
snipe 5f5fddb7a4 Updated permissions array 2016-06-02 02:39:23 -07:00
snipe 46d3a784a2 Fixes groups for cloning users 2016-06-02 00:41:10 -07:00
snipe 4998b5ab1b Fixes #2080 2016-06-02 00:15:38 -07:00
snipe 368bb77cf0 Merge pull request #2102 from dmeltzer/layout-fixes
Improve navbar/header layout
2016-06-01 21:25:40 -07:00
Daniel Meltzer 37b416d5c7 Fix my git terrribleness. 2016-06-01 23:00:29 -05:00
Daniel Meltzer c7e695d3fe Revert "Move the breadcrumb thingy back inside the header. Remove it from a list item because it wasn't part of a list"
This reverts commit 9c77de6473.
2016-06-01 22:55:37 -05:00
Daniel Meltzer a152b0ae54 Center the logo text on small screens. It's looking more reasonable by the week... 2016-06-01 22:52:25 -05:00
Daniel Meltzer 9c77de6473 Move the breadcrumb thingy back inside the header. Remove it from a list item because it wasn't part of a list 2016-06-01 22:41:11 -05:00
Daniel Meltzer 71ca17649c Improvements? 2016-06-01 22:30:12 -05:00
Daniel Meltzer 41f3d5ccbc Add new css file 2016-06-01 21:42:48 -05:00
Daniel Meltzer e32d5490d3 Add updated gulp css for testing. Probably revert before merge. 2016-06-01 21:39:49 -05:00
Daniel Meltzer d85d3b14f7 More layout fixes for small devices. 2016-06-01 21:37:03 -05:00
snipe 1daa6abf48 Merge pull request #2101 from dmeltzer/importer-again
Case insensitive string comparison for items when importing
2016-06-01 18:13:02 -07:00
Daniel Meltzer 5d206f2c20 Fix navbar spacing on screen and mobile. Move the items on the left of the navbar to their own list. Style fixes. Move breadcrumb to outside navbar because it was breaking things and I think it looks better 2016-06-01 20:10:19 -05:00
Daniel Meltzer 2ff1ee4d33 Fix some indentaiton and a missing tag, no functionality changes here. 2016-06-01 20:10:19 -05:00
snipe 04610e7864 Just use model validation for new user 2016-06-01 18:04:11 -07:00
Daniel Meltzer da01591ab8 Case insensitive string comparison for items when comparing with existing items. Fixes some false errors. Also remove stray characters from manufacturer logging. 2016-06-01 19:31:24 -05:00
snipe cffa76e627 Find first record, instead of hardcoded id 1 2016-06-01 15:50:50 -07:00
snipe 9c4cd9c3ce Save email/username format in settings controller 2016-06-01 15:45:26 -07:00
snipe eacf70ee3f Updated validation 2016-06-01 15:45:05 -07:00
snipe 33a35ec7f5 Migration for for email/username format settings 2016-06-01 15:44:37 -07:00
snipe e0c07d8921 Language strings for email/username format 2016-06-01 15:44:29 -07:00
snipe 99f6207a69 Added macro for email/username format 2016-06-01 15:44:16 -07:00
snipe d786be4fc0 Use local fontawesome and added select2 2016-06-01 15:43:55 -07:00
snipe 8a7a659a87 Added email domain, email format and username format to settings/setup form 2016-06-01 15:43:39 -07:00
snipe f3c6275f8d Removed settings form request 2016-06-01 15:43:12 -07:00
snipe 0a2fb2ace7 Merge pull request #2099 from dmeltzer/sqlite-fixes
Fix a regression in Helper::usersList and ::managerList()
2016-06-01 11:49:51 -07:00
Daniel Meltzer 1c1ef951e9 Fix a regression in Helper::usersList and ::managerList() where the "Select a User" option disappeared. Also format names the way they used to be formatted. 2016-06-01 13:47:46 -05:00
snipe 45d3d90c94 Merge pull request #2067 from dmeltzer/ajax-mobile-upload-PR
Mobile-Friendly image capture/upload + Ajax rewrite of asset create
2016-06-01 11:34:42 -07:00
snipe a9870db83f Merge branch 'v3' of github.com:snipe/snipe-it into v3 2016-05-31 21:16:40 -07:00
snipe 697ed0d53c Fixes UAT for User
Needed to specify form name to prevent focus in asset tag search from being submitted
2016-05-31 21:16:30 -07:00
Daniel Meltzer 3ddaa88694 Fix image processing when editing an existing asset. Also reenable the image scaling on the server, but boost limit to 800x800 2016-05-31 19:50:58 -05:00
Daniel Meltzer b3454b1c24 Fix bug in image process logic that wouldn't resize the height. Also make it possible to choose files from android as well as pictures directly. 2016-05-31 19:50:58 -05:00
Daniel Meltzer fcc79456fd Play with a mobile friendly capture-image-from device when adding an asset. This also involved rewriting the upload to be all ajaxy and stuff 2016-05-31 19:50:58 -05:00
snipe 11c400f12b Merge pull request #2095 from dmeltzer/importer-improvements
Reduce Import error warnings in importer.
2016-05-31 17:45:29 -07:00
snipe 823273f565 Merge pull request #2092 from dmeltzer/installer
Fix installer for v3.  Tested with centos7 and ubuntu 16.4.
2016-05-31 17:45:18 -07:00
snipe a542b18a04 Merge pull request #2050 from dmeltzer/sqlite-fixes
Sqlite fixes
2016-05-31 17:45:04 -07:00
Daniel Meltzer f2a5337ad2 Simplify 2016-05-31 19:41:14 -05:00
Daniel Meltzer 4af5cdd64f asset_id is not allowed to be null in asset_log according to db schema. 0 it out here to make sqlite happy. 2016-05-31 19:41:14 -05:00
Daniel Meltzer 0fa82743a1 Remove remaining DB::Raw(concat) calls to make things more sqlite friendly. This adds one new method to the Asset Model to return the formatted string that was used by the license and asset maintence controller. It also fixes a potential sqlite-only issue where '' and null are different. 2016-05-31 19:41:14 -05:00
Daniel Meltzer 45d93ffa8c Use a transaction while creating license seats. Makes adding a license with a large number of seats much more managable. 2016-05-31 19:41:14 -05:00
Daniel Meltzer 4b98711e07 Replace the assorted concat() methods with a full_name method in the User model and adjust queries accordingly 2016-05-31 19:41:14 -05:00
Daniel Meltzer a729038ccd Fix typo. 2016-05-31 19:00:11 -05:00
Daniel Meltzer e5bd6a8a26 A bit more detailed message when starting the installer to share what version of OS we've detected. 2016-05-31 18:51:56 -05:00
Daniel Meltzer 5e03fe40a7 Fix some more centos6 stuff.
Fix for detecting centos6.  Not ideal, but hopefully no one has a fresh install of centos5 lying around..

Also fix some issues with code not being ported in the centos6 section.
2016-05-31 18:45:07 -05:00
Daniel Meltzer dab2a50982 Only display errors in import table if things actually prevent the asset from being created. Also some table formatting improvements. 2016-05-31 18:04:01 -05:00
snipe 0e0b31bba6 Company name length to 1 2016-05-31 15:04:13 -07:00
snipe c9d00b1f06 Merge branch 'v3' of github.com:snipe/snipe-it into v3 2016-05-31 14:27:39 -07:00
snipe 9bb258bb99 Updated alt tag 2016-05-31 14:27:33 -07:00
snipe ac10a199ea Merge pull request #2083 from dmeltzer/importer-improvements
Importer improvements
2016-05-31 14:25:33 -07:00
Daniel Meltzer 5952181454 Fix missing -p in mysql call on centos6. 2016-05-31 09:05:51 -05:00
Daniel Meltzer 0da1e186d7 Fix some weird bash issues caused when merging the v2 and v3 versions of the script. 2016-05-29 15:54:20 -05:00
Daniel Meltzer d92de14413 Fix installer for v3. Tested with centos7 and ubuntu 16.0.4.
This essentially just changes the configuration section to work with the
new .env file, and leaves almost everything else alone.  Some
reordering of code did occur to try and fix a number of issues I
encountered along the way.  This still really needs to be rewritten to
only run what it should as root, and not everything, but that should get
more testing than there is between now and v3.

One thing to note: This changes fetching master.zip to the v3 alpha2
tag, for obviousish reasons.  Once master goes back to v3, or there is a
way of downloading a v3 tarball on a regular basis, it should be changed
to do that again.
2016-05-28 20:35:28 -05:00
Daniel Meltzer 004c63cd5d Improve web imported. Show a list of all items with that were not imported correctly after import. Modify ObjectImporter and add a web-import parameter that causes it to spit out json errors exclusively. Long term I want to separate the console command and the logic so we aren't calling the console command directly, but rather a class that does everything. This would allow for easier progress reports and ajaxification. 2016-05-26 21:29:29 -05:00
Daniel Meltzer 715e385925 Two things. One, try to make the import uploads directory if it doesn't exist. Two, call the object importer instead of the old asset importer. TODO: Feed output from object importer back to import page. 2016-05-26 08:00:00 -05:00
Daniel Meltzer 891c37b2ed Add warranty months. Also fix a merge issue where things reverted back to comment instead of log. 2016-05-25 21:13:26 -05:00
Daniel Meltzer e353df588f Importer improvements. If user real name doesn't exist don't try to create the user. 2016-05-25 20:47:46 -05:00
Daniel Meltzer fd0d04eba4 Import status labels. 2016-05-25 20:46:01 -05:00
Daniel Meltzer 22c6f32e92 Instead of a field in the csv, set whether assets, consumables, or accessories are generated by an option on the command line. Also Adjustconsumables/accessories to function smoother. 2016-05-25 20:37:19 -05:00
Daniel Meltzer 04428d2d07 Replace console output in ObjectImporter with a logging mechanism. Also track all model/validation errors and output them at the end of the import, rather than inline. 2016-05-25 20:37:19 -05:00
snipe c89f357e4a Fixes #2082
LOL whoops
2016-05-25 13:32:33 -07:00
snipe 8a968b4dfb Responsive dashboard table 2016-05-24 19:04:56 -07:00
snipe 9aff515c0a More mobile fixes 2016-05-24 18:50:54 -07:00
snipe 5f91329397 Some responsive fixes
Still needs work tho :(
2016-05-24 17:59:02 -07:00
snipe 37be587c39 Make regular and highlight colors the same, since we're not using highlight colors in the pie chart yet 2016-05-24 16:19:44 -07:00
snipe 0c33575962 Merge branch 'v3' of github.com:snipe/snipe-it into v3 2016-05-24 16:10:45 -07:00
snipe 84edc9cf25 New generated JS 2016-05-24 16:10:04 -07:00
snipe 14dac9b371 Updated versioned js 2016-05-24 16:09:37 -07:00
snipe 8e18d02f7a Updated chartJS 2016-05-24 16:09:28 -07:00
snipe d0ebdd03bd Added legend template for chartJS, even though it doesn't seem to do a fucking thing 2016-05-24 16:08:56 -07:00
snipe bfc3f69adb Better comments on model methods 2016-05-24 16:08:18 -07:00
snipe cde0d49e18 Added assets method 2016-05-24 16:06:22 -07:00
snipe abf027059f Fixed comment 2016-05-24 16:06:15 -07:00
snipe 4edc2a7a66 Route and controller for dashboard chart 2016-05-24 16:06:09 -07:00
snipe 3b838ca867 Added static colors for charts 2016-05-24 16:05:51 -07:00
snipe 8b023adba3 Merge pull request #2078 from dmeltzer/fix-statuslabels-translations
Fix strings for StatusLabels, they still referenced locations.
2016-05-24 15:56:10 -07:00
Daniel Meltzer 293b8c0dea Fix strings for StatusLabels, they still referenced locations. 2016-05-24 17:54:44 -05:00
snipe d6dc57286f Merge pull request #2077 from dmeltzer/fix-settings-table-for-sqlite
Fix (for real this time?) the settings table option_name/option_value
2016-05-24 15:45:25 -07:00
Daniel Meltzer 52b61c9d49 Fix mistake in the settings table kerfuffle. 2016-05-24 17:41:59 -05:00
snipe 780c0e678d Changed min dimensions to 500 from 300 2016-05-24 13:21:18 -07:00
snipe 5bceb5ce52 Display escaped parsedown note 2016-05-24 10:21:45 -07:00
snipe de5e1ca86b Add persedown helper 2016-05-24 10:21:33 -07:00
snipe 6c6e65b8ca Fixes #2076 2016-05-24 09:46:43 -07:00
snipe 64d818e56e Fixed License and LicenseSeat namespaces for importer 2016-05-24 02:17:10 -07:00
snipe d6715914e1 Fixed supplier namespace 2016-05-24 02:13:28 -07:00
snipe f10b3b7cdb Fix for license importer 2016-05-24 01:51:47 -07:00
snipe f844bf4b41 Nicer focus handling for asset search 2016-05-24 01:10:05 -07:00
snipe 6e006a6873 Redundant top nav 2016-05-24 00:58:59 -07:00
snipe cb91829729 Fixed division by zero error 2016-05-24 00:49:56 -07:00
snipe fb35e40342 Search by asset tag
Compatible with barcode scanners
2016-05-20 17:02:28 -07:00
snipe b796e72faf Remove old search 2016-05-20 16:01:23 -07:00
snipe c56ceebb40 Default timezone back to UTC 2016-05-20 14:29:15 -07:00
snipe 78fc6dec3c Merge branch 'v3' of github.com:snipe/snipe-it into v3 2016-05-20 12:23:36 -07:00
snipe 7fd6051514 Fixes #2062 - old permissions masks to new 2016-05-20 12:23:31 -07:00
snipe 072923826d Merge pull request #2060 from dmeltzer/fix-settings-table-for-sqlite
Fix updates from v2
2016-05-20 10:52:00 -07:00
Daniel Meltzer c52e3b5f9c Check if the column exists before dropping. Also recreate the column in a rollback to make the migrations happy. Also break into two migrations to make sqlite happy. 2016-05-20 10:03:04 -05:00
snipe f6cdd90e41 New docs links in README 2016-05-20 01:44:24 -07:00
snipe 975b266cb0 Icon display on recent activity 2016-05-20 01:17:00 -07:00
snipe aad1ba4ab3 Updated language strings 2016-05-20 00:47:03 -07:00
snipe 6b5d0a5abf Translations and nicer formatting for login/password reset 2016-05-20 00:25:45 -07:00
424 changed files with 29015 additions and 6737 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ APP_ENV=production
APP_DEBUG=false
APP_KEY=ChangeMe
APP_URL=null
APP_TIMEZONE='US/Pacific'
APP_TIMEZONE='UTC'
APP_LOCALE=en
@@ -18,7 +18,7 @@ DB_DATABASE=null
DB_USERNAME=null
DB_PASSWORD=null
DB_PREFIX=null
DB_DUMP_PATH='/usr/local/bin'
DB_DUMP_PATH='/usr/bin'
# --------------------------------------------
# REQUIRED: OUTGOING MAIL SERVER SETTINGS
+1 -1
View File
@@ -59,7 +59,7 @@ RUN \
rm -rf "/var/www/html/public/uploads/avatars" && ln -fs "/var/lib/snipeit/data/uploads/avatars" "/var/www/html/public/uploads/avatars" && \
rm -rf "/var/www/html/public/uploads/models" && ln -fs "/var/lib/snipeit/data/uploads/models" "/var/www/html/public/uploads/models" && \
rm -rf "/var/www/html/public/uploads/suppliers" && ln -fs "/var/lib/snipeit/data/uploads/suppliers" "/var/www/html/public/uploads/suppliers" && \
rm -r "/var/www/html/storage/backups" && ln -fs "/var/lib/snipeit/dumps" "/var/www/html/storage/backups"
rm -r "/var/www/html/storage/app/backups" && ln -fs "/var/lib/snipeit/dumps" "/var/www/html/storage/app/backups"
############## DEPENDENCIES via COMPOSER ###################
+13 -19
View File
@@ -1,43 +1,38 @@
[![Build Status](https://travis-ci.org/snipe/snipe-it.svg?branch=develop)](https://travis-ci.org/snipe/snipe-it) [![Stories in Ready](https://badge.waffle.io/snipe/snipe-it.png?label=ready+for+dev&title=Ready+for+development)](http://waffle.io/snipe/snipe-it) [![Maintenance](https://img.shields.io/maintenance/yes/2016.svg)]() [![Crowdin](https://d322cqt584bo4o.cloudfront.net/snipe-it/localized.png)](https://crowdin.com/project/snipe-it)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/snipe/snipe-it?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Docker Pulls](https://img.shields.io/docker/pulls/snipe/snipe-it.svg)](https://hub.docker.com/r/snipe/snipe-it/)
[![Twitter Follow](https://img.shields.io/twitter/follow/snipeyhead.svg?style=social)](https://twitter.com/snipeyhead)
[![Zenhub](https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png)](https://zenhub.io)
[![Build Status](https://travis-ci.org/snipe/snipe-it.svg?branch=develop)](https://travis-ci.org/snipe/snipe-it) [![Stories in Ready](https://badge.waffle.io/snipe/snipe-it.png?label=ready+for+dev&title=Ready+for+development)](http://waffle.io/snipe/snipe-it) [![Maintenance](https://img.shields.io/maintenance/yes/2016.svg)]() [![Crowdin](https://d322cqt584bo4o.cloudfront.net/snipe-it/localized.png)](https://crowdin.com/project/snipe-it) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/snipe/snipe-it?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Docker Pulls](https://img.shields.io/docker/pulls/snipe/snipe-it.svg)](https://hub.docker.com/r/snipe/snipe-it/) [![Twitter Follow](https://img.shields.io/twitter/follow/snipeyhead.svg?style=social)](https://twitter.com/snipeyhead) [![Zenhub](https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png)](https://zenhub.io)
## Snipe-IT - Asset Management For the Rest of Us
## Snipe-IT - Open Source Asset Management System
This is a FOSS project for asset management in IT Operations. Knowing who has which laptop, when it was purchased in order to depreciate it correctly, handling software licenses, etc.
It is built on [Laravel 5.2](http://laravel.com).
This project is being actively developed and we're [releasing quite frequently](https://github.com/snipe/snipe-it/releases). ([Check out the live demo here](https://snipeitapp.com/demo/).)
Snipe-IT is actively developed and we're [releasing quite frequently](https://github.com/snipe/snipe-it/releases). ([Check out the live demo here](https://snipeitapp.com/demo/).)
__This is web-based software__. This means there there is no executable file (aka no .exe files), and it must be run on a web server and accessed through a web browser. It runs on any Mac OSX, flavor of Linux, as well as Windows.
__This is web-based software__. This means there there is no executable file (aka no .exe files), and it must be run on a web server and accessed through a web browser. It runs on any Mac OSX, flavor of Linux, as well as Windows, and we have a [Docker image](https://snipe-it.readme.io/docs/docker) available if that's what you're into.
-----
### Installation
__Installation and configuration documentation for this project has been moved to http://docs.snipeitapp.com.__
For instructions on installing and configuring Snipe-IT on your server, check out the [installation manual](https://snipe-it.readme.io/docs). (Please see the [requirements documentation](https://snipe-it.readme.io/docs/requirements) for full requirements.)
#### Server Requirements
Please see the [requirements documentation](http://docs.snipeitapp.com/requirements.html) for full requirements.
If you're having trouble with the installation, please check the [Common Issues](https://snipe-it.readme.io/docs/common-issues) and [Getting Help](https://snipe-it.readme.io/docs/getting-help) documentation, and search this repository's open *and* closed issues for help.
-----
### User's Manual
For help using Snipe-IT, check out the [user's manual](https://snipe-it-manual.readme.io/docs).
-----
### Bug Reports & Feature Requests
Feel free to check out the [GitHub Issues for this project](https://github.com/snipe/snipe-it/issues) to open a bug report or see what open issues you can help with. Please search through existing issues (open and closed) to see if your question hasn't already been answered before opening a new issue.
We use Waffle.io to help better communicate our roadmap with users. Our [project page there](http://waffle.io/snipe/snipe-it) will show you the backlog, what's ready to be worked on, what's in progress, and what's completed.
If you're having trouble with the installation, please check the [Common Issues](http://docs.snipeitapp.com/common-issues.html) and [Getting Help](http://docs.snipeitapp.com/getting-help.html) documentation.
-----
### Upgrading
Please see the [upgrading documentation](http://docs.snipeitapp.com/upgrading.html) for instructions on upgrading Snipe-IT.
Please see the [upgrading documentation](https://snipe-it.readme.io/docs/upgrading) for instructions on upgrading Snipe-IT.
------
### Announcement List
@@ -48,14 +43,13 @@ To be notified of important news (such as new releases, security advisories, etc
### Translations!
Please see the [translations documentation](http://docs.snipeitapp.com/translations.html) for information about available languages and how to add translations to Snipe-IT.
Please see the [translations documentation](https://snipe-it.readme.io/docs/translations) for information about available languages and how to add translations to Snipe-IT.
-----
### Contributing
Please see the documentation on [contributing and developing for Snipe-IT](http://docs.snipeitapp.com/contributing.html).
Please see the documentation on [contributing and developing for Snipe-IT](https://snipe-it.readme.io/docs/contributing).
[![Stories in Ready](https://badge.waffle.io/snipe/snipe-it.png?label=ready+for+dev&title=Ready+for+Development)](http://waffle.io/snipe/snipe-it)
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
+20 -18
View File
@@ -5,6 +5,10 @@ use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use League\Csv\Reader;
use App\Models\User;
use App\Models\Supplier;
use App\Models\License;
use App\Models\LicenseSeat;
class LicenseImportCommand extends Command {
@@ -240,26 +244,24 @@ class LicenseImportCommand extends Command {
if ($user = User::where('username', $user_username)->whereNotNull('username')->first()) {
$this->comment('User '.$user_username.' already exists');
} else {
// Create the user
$user = Sentry::createUser(array(
'first_name' => $first_name,
'last_name' => $last_name,
'email' => $user_email,
'username' => $user_username,
'password' => substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10),
'activated' => true,
'permissions' => array(
'admin' => 0,
'user' => 1,
),
'notes' => 'User importerd through license importer'
));
// Find the group using the group id
$userGroup = Sentry::findGroupById(3);
$user = new \App\Models\User;
$password = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 20);
$user->first_name = $first_name;
$user->last_name = $last_name;
$user->username = $user_username;
$user->email = $user_email;
$user->permissions = '{user":1}';
$user->password = bcrypt($password);
$user->activated = 1;
if ($user->save()) {
$this->comment('User '.$first_name.' created');
} else {
$this->error('ERROR CREATING User '.$first_name.' '.$last_name);
$this->error($user->getErrors());
}
// Assign the group to the user
$user->addGroup($userGroup);
$this->comment('User '.$first_name.' created');
}
} else {
+360 -125
View File
@@ -2,7 +2,6 @@
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Config;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use League\Csv\Reader;
@@ -14,9 +13,17 @@ use App\Models\Company;
use App\Models\Consumable;
use App\Models\Location;
use App\Models\Manufacturer;
use App\Models\Statuslabel;
use App\Models\Supplier;
use App\Models\User;
use App\Models\CustomField;
use DB;
use App\Models\Setting;
use Illuminate\Database\Eloquent\Model;
ini_set('max_execution_time', 600); //600 seconds = 10 minutes
ini_set('memory_limit', '500M');
/**
* Class ObjectImportCommand
*/
@@ -56,12 +63,16 @@ class ObjectImportCommand extends Command {
$filename = $this->argument('filename');
if ($this->option('testrun')) {
$this->comment('====== TEST ONLY Asset Import for '.$filename.' ====');
$this->comment('============== NO DATA WILL BE WRITTEN ==============');
} else {
if(!$this->option('web-importer')) {
$logFile = $this->option('logfile');
\Log::useFiles($logFile);
if ($this->option('testrun')) {
$this->comment('====== TEST ONLY Asset Import for '.$filename.' ====');
$this->comment('============== NO DATA WILL BE WRITTEN ==============');
} else {
$this->comment('======= Importing Assets from '.$filename.' =========');
$this->comment('======= Importing Assets from '.$filename.' =========');
}
}
if (! ini_get("auto_detect_line_endings")) {
@@ -70,27 +81,37 @@ class ObjectImportCommand extends Command {
$csv = Reader::createFromPath($this->argument('filename'));
$csv->setNewline("\r\n");
$results = $csv->fetchAssoc();
$newarray = NULL;
foreach( $results as $index => $arraytoNormalize) {
foreach ($results as $index => $arraytoNormalize)
{
$internalnewarray = array_change_key_case($arraytoNormalize);
$newarray[$index] = $internalnewarray;
}
$this->locations = Location::All(['name', 'id']);
$this->categories = Category::All(['name', 'category_type', 'id']);
$this->manufacturers = Manufacturer::All(['name', 'id']);
$this->asset_models = AssetModel::All(['name','modelno','category_id','manufacturer_id', 'id']);
$this->companies = Company::All(['name', 'id']);
$this->status_labels = Statuslabel::All(['name', 'id']);
$this->suppliers = Supplier::All(['name', 'id']);
$this->assets = Asset::all(['asset_tag']);
$this->suppliers = Supplier::All(['name']);
$this->accessories = Accessory::All(['name']);
$this->consumables = Consumable::All(['name']);
$this->customfields = CustomField::All(['name']);
$bar = $this->output->createProgressBar(count($newarray));
// Loop through the records
DB::transaction(function() use (&$newarray){
DB::transaction(function() use (&$newarray, $bar){
Model::unguard();
$item_type = strtolower($this->option('item-type'));
foreach( $newarray as $row ) {
// Let's just map some of these entries to more user friendly words
@@ -102,37 +123,53 @@ class ObjectImportCommand extends Command {
$item_company_name = $this->array_smart_fetch($row, "company");
$item_location = $this->array_smart_fetch($row, "location");
$item["item_type"] = strtolower($this->array_smart_fetch($row, "item type"));
if(empty($item["item_type"])) {
$this->comment("Item Type not set. Assuming asset");
$item["item_type"] = 'asset';
}
$item_status_name = $this->array_smart_fetch($row, "status");
$item["item_name"] = $this->array_smart_fetch($row, "item name");
$item["purchase_date"] = date("Y-m-d 00:00:01", strtotime($this->array_smart_fetch($row, "purchase date")));
if ($this->array_smart_fetch($row, "purchase date")!='') {
$item["purchase_date"] = date("Y-m-d 00:00:01", strtotime($this->array_smart_fetch($row, "purchase date")));
} else {
$item["purchase_date"] = null;
}
$item["purchase_cost"] = $this->array_smart_fetch($row, "purchase cost");
$item["order_number"] = $this->array_smart_fetch($row, "order number");
$item["notes"] = $this->array_smart_fetch($row, "notes");
$item["quantity"] = $this->array_smart_fetch($row, "quantity");
$item["requestable"] = $this->array_smart_fetch($row, "requestable");
$this->comment("Item Type: " . $item["item_type"]);
$this->comment('Category Name: ' . $item_category);
$this->comment('Location: ' . $item_location);
$this->comment('Purchase Date: ' . $item["purchase_date"]);
$this->comment('Purchase Cost: ' . $item["purchase_cost"]);
$this->comment('Company Name: ' . $item_company_name);
$this->current_assetId = $item["item_name"];
$this->log('Category: ' . $item_category);
$this->log('Location: ' . $item_location);
$this->log('Purchase Date: ' . $item["purchase_date"]);
$this->log('Purchase Cost: ' . $item["purchase_cost"]);
$this->log('Company Name: ' . $item_company_name);
$this->log('Status: ' . $item_status_name);
$item["user"] = $this->createOrFetchUser($row);
$item["location"] = $this->createOrFetchLocation($item_location);
$item["category"] = $this->createOrFetchCategory($item_category, $item["item_type"]);
$item["category"] = $this->createOrFetchCategory($item_category, $item_type);
$item["manufacturer"] = $this->createOrFetchManufacturer($row);
$item["company"] = $this->createOrFetchCompany($item_company_name);
switch ($item["item_type"]) {
$item["status_label"] = $this->createOrFetchStatusLabel($item_status_name);
switch ($item_type) {
case "asset":
// -----------------------------
// CUSTOM FIELDS
// -----------------------------
// Loop through custom fields in the database and see if we have any matches in the CSV
foreach ($this->customfields as $customfield) {
if ($item['custom_fields'][$customfield->db_column_name()] = $this->array_smart_custom_field_fetch($row, $customfield)) {
$this->log('Custom Field '. $customfield->name.': '.$this->array_smart_custom_field_fetch($row, $customfield));
}
}
$this->createAssetIfNotExists($row, $item);
break;
case "accessory":
@@ -142,28 +179,114 @@ class ObjectImportCommand extends Command {
$this->createConsumableIfNotExists($item);
break;
}
$this->comment('------------- Action Summary ----------------');
$bar->advance();
$this->log('------------- Action Summary ----------------');
}
});
$this->comment('=====================================');
$bar->finish();
return true;
$this->log('=====================================');
if(!$this->option('web-importer'))
{
if(!empty($this->errors)) {
$this->comment("The following Errors were encountered.");
foreach($this->errors as $asset => $error)
{
$this->comment('Error: Item: ' . $asset . 'failed validation: ' . json_encode($error));
}
} else {
$this->comment("All Items imported successfully!");
}
} else {
if(empty($this->errors))
return 0;
else {
$this->comment(json_encode($this->errors)); //Send a big string to the
return 1;
}
}
$this->comment("");
return 2;
}
// Tracks the current item for error messages
private $current_assetId;
// An array of errors encountered while parsing
private $errors;
public function jsonError($field, $errorString)
{
$this->errors[$this->current_assetId] = array($field => $errorString);
if($this->option('verbose'))
parent::error($errorString);
}
/**
* Log a message to file, configurable by the --log-file parameter.
* If a warning message is passed, we'll spit it to the console as well.
*
* @author Daniel Melzter
* @since 3.0
* @param string $string
* @param string $level
*/
private function log($string, $level = 'info')
{
if($this->option('web-importer'))
return;
if($level === 'warning')
{
\Log::warning($string);
$this->comment($string);
}
else {
\Log::Info($string);
if($this->option('verbose')) {
$this->comment($string);
}
}
}
/**
* Check to see if the given key exists in the array, and trim excess white space before returning it
*
* @author Daniel Melzter
* @since 3.0
* @param $array array
* @param $key string
* @param $default string
* @return string
*/
public function array_smart_fetch(Array $array, $key, $default = ''){
public function array_smart_fetch(Array $array, $key, $default = '') {
return array_key_exists($key,$array) ? e(trim($array[ $key ])) : $default;
}
/**
* Figure out the fieldname of the custom field
*
* @author A. Gianotto <snipe@snipe.net>
* @since 3.0
* @param $array array
* @return string
*/
public function array_smart_custom_field_fetch(Array $array, $key) {
$index_name = strtolower($key->name);
return array_key_exists($index_name,$array) ? e(trim($array[$index_name])) : '';
}
private $asset_models;
/**
* Select the asset model if it exists, otherwise create it.
*
* @author Daniel Melzter
* @since 3.0
* @param array
* @param $category Category
* @param $manufacturer Manufacturer
@@ -178,18 +301,18 @@ class ObjectImportCommand extends Command {
if(empty($asset_model_name))
$asset_model_name='Unknown';
if(empty($asset_modelno))
$asset_modelno=0;
$this->comment('Model Name: ' . $asset_model_name);
$this->comment('Model No: ' . $asset_modelno);
$asset_modelno='';
$this->log('Model Name: ' . $asset_model_name);
$this->log('Model No: ' . $asset_modelno);
foreach ($this->asset_models as $tempmodel) {
if ($tempmodel->name === $asset_model_name
if ((strcasecmp($tempmodel->name, $asset_model_name) == 0)
&& $tempmodel->modelno == $asset_modelno
&& $tempmodel->category_id == $category->id
&& $tempmodel->manufacturer_id == $manufacturer->id )
{
$this->comment('A matching model ' . $asset_model_name . ' with model number ' . $asset_modelno . ' already exists');
$this->log('A matching model ' . $asset_model_name . ' with model number ' . $asset_modelno . ' already exists');
return $tempmodel;
}
}
@@ -199,18 +322,19 @@ class ObjectImportCommand extends Command {
$asset_model->modelno = $asset_modelno;
$asset_model->category_id = $category->id;
$asset_model->user_id = 1;
$this->asset_models->add($asset_model);
if(!$this->option('testrun')) {
if ($asset_model->save()) {
$this->comment('Asset Model ' . $asset_model_name . ' with model number ' . $asset_modelno . ' was created');
$this->asset_models->add($asset_model);
$this->log('Asset Model ' . $asset_model_name . ' with model number ' . $asset_modelno . ' was created');
return $asset_model;
} else {
$this->comment('Something went wrong! Asset Model ' . $asset_model_name . ' was NOT created');
dd($asset_model);
$this->jsonError('Asset Model', $asset_model->getErrors());
return $asset_model;
}
} else {
$this->asset_models->add($asset_model);
return $asset_model;
}
@@ -220,6 +344,9 @@ class ObjectImportCommand extends Command {
/**
* Finds a category with the same name and item type in the database, otherwise creates it
*
* @author Daniel Melzter
* @since 3.0
* @param $asset_category string
* @param $item_type string
* @return Category
@@ -230,8 +357,8 @@ class ObjectImportCommand extends Command {
$asset_category = 'Unnamed Category';
foreach($this->categories as $tempcategory) {
if( $tempcategory->name === $asset_category && $tempcategory->category_type === $item_type) {
$this->comment('Category ' . $asset_category . ' already exists');
if( (strcasecmp($tempcategory->name, $asset_category) == 0) && $tempcategory->category_type === $item_type) {
$this->log('Category ' . $asset_category . ' already exists');
return $tempcategory;
}
}
@@ -241,18 +368,19 @@ class ObjectImportCommand extends Command {
$category->name = $asset_category;
$category->category_type = $item_type;
$category->user_id = 1;
$this->categories->add($category);
if(!$this->option('testrun')) {
if ($category->save()) {
$this->comment('Category ' . $asset_category . ' was created');
$this->categories->add($category);
$this->log('Category ' . $asset_category . ' was created');
return $category;
} else {
$this->comment('Something went wrong! Category ' . $asset_category . ' was NOT created');
dd($category);
return $category;
$this->jsonError('Category', $category->getErrors());
return $category;
}
} else {
$this->categories->add($category);
return $category;
}
@@ -261,40 +389,83 @@ class ObjectImportCommand extends Command {
private $companies;
/**
* Fetch an existing company, or create new if it doesn't exist
*
* @author Daniel Melzter
* @since 3.0
* @param $asset_company_name string
* @return Company
*/
public function createOrFetchCompany($asset_company_name)
{
foreach ($this->companies as $tempcompany) {
if ($tempcompany->name === $asset_company_name) {
$this->comment('A matching Company ' . $asset_company_name . ' already exists');
if (strcasecmp($tempcompany->name, $asset_company_name) == 0) {
$this->log('A matching Company ' . $asset_company_name . ' already exists');
return $tempcompany;
}
}
$company = new Company();
$company->name = $asset_company_name;
$this->companies->add($company);
if(!$this->option('testrun')) {
if ($company->save()) {
$this->comment('Company ' . $asset_company_name . ' was created');
$this->companies->add($company);
$this->log('Company ' . $asset_company_name . ' was created');
return $company;
} else {
$this->comment('Something went wrong! Company ' . $asset_company_name . ' was NOT created');
return $company;
$this->log('Company', $company->getErrors());
}
} else {
$this->companies->add($company);
return $company;
}
}
private $status_labels;
/**
* Fetch the existing status label or create new if it doesn't exist.
*
* @author Daniel Melzter
* @since 3.0
* @param string $asset_statuslabel_name
* @return Company
*/
public function createOrFetchStatusLabel($asset_statuslabel_name)
{
if(empty($asset_statuslabel_name))
return;
foreach ($this->status_labels as $tempstatus) {
if (strcasecmp($tempstatus->name, $asset_statuslabel_name) == 0 ) {
$this->log('A matching Status ' . $asset_statuslabel_name . ' already exists');
return $tempstatus;
}
}
$status = new Statuslabel();
$status->name = $asset_statuslabel_name;
if(!$this->option('testrun')) {
if ($status->save()) {
$this->status_labels->add($status);
$this->log('Status ' . $asset_statuslabel_name . ' was created');
return $status;
} else {
$this->jsonError('Status', $status->getErrors());
return $status;
}
} else {
$this->status_labels->add($status);
return $status;
}
}
private $manufacturers;
/**
* Finds a manufacturer with matching name, otherwise create it.
*
* @author Daniel Melzter
* @since 3.0
* @param $row array
* @return Manufacturer
* @internal param $asset_mfgr string
@@ -307,11 +478,11 @@ class ObjectImportCommand extends Command {
if(empty($asset_mfgr)) {
$asset_mfgr='Unknown';
}
$this->comment('Manufacturer ID: ' . $asset_mfgr);
$this->log('Manufacturer ID: ' . $asset_mfgr);
foreach ($this->manufacturers as $tempmanufacturer) {
if ($tempmanufacturer->name === $asset_mfgr) {
$this->comment('Manufacturer ' . $asset_mfgr . ' already exists');
if (strcasecmp($tempmanufacturer->name, $asset_mfgr) == 0 ) {
$this->log('Manufacturer ' . $asset_mfgr . ' already exists') ;
return $tempmanufacturer;
}
}
@@ -321,37 +492,40 @@ class ObjectImportCommand extends Command {
$manufacturer = new Manufacturer();
$manufacturer->name = $asset_mfgr;
$manufacturer->user_id = 1;
$this->manufacturers->add($manufacturer);
if (!$this->option('testrun')) {
if ($manufacturer->save()) {
$this->comment('Manufacturer ' . $manufacturer->name . ' was created');
$this->manufacturers->add($manufacturer);
$this->log('Manufacturer ' . $manufacturer->name . ' was created');
return $manufacturer;
} else {
$this->comment('Something went wrong! Manufacturer ' . $asset_mfgr . ' was NOT created');
dd($manufacturer);
$this->jsonError('Manufacturer', $manufacturer->getErrors());
return $manufacturer;
}
} else {
$this->manufacturers->add($manufacturer);
return $manufacturer;
}
}
/**
/**
* @var
*/
private $locations;
/**
* Checks the DB to see if a location with the same name exists, otherwise create it
*
* @author Daniel Melzter
* @since 3.0
* @param $asset_location string
* @return Location
*/
public function createOrFetchLocation($asset_location)
{
foreach($this->locations as $templocation) {
if( $templocation->name === $asset_location ) {
$this->comment('Location ' . $asset_location . ' already exists');
if( strcasecmp($templocation->name, $asset_location) == 0 ) {
$this->log('Location ' . $asset_location . ' already exists');
return $templocation;
}
}
@@ -365,22 +539,22 @@ class ObjectImportCommand extends Command {
$location->state = '';
$location->country = '';
$location->user_id = 1;
$this->locations->add($location);
if (!$this->option('testrun')) {
if ($location->save()) {
$this->comment('Location ' . $asset_location . ' was created');
$this->locations->add($location);
$this->log('Location ' . $asset_location . ' was created');
return $location;
} else {
$this->comment('Something went wrong! Location ' . $asset_location . ' was NOT created');
dd($location);
$this->log('Location', $location->getErrors()) ;
return $location;
}
} else {
$this->locations->add($location);
return $location;
}
} else {
$this->comment('No location given, so none created.');
$this->log('No location given, so none created.');
return $location;
}
@@ -389,6 +563,10 @@ class ObjectImportCommand extends Command {
private $suppliers;
/**
* Fetch an existing supplier or create new if it doesn't exist
*
* @author Daniel Melzter
* @since 3.0
* @param $row array
* @return Supplier
*/
@@ -398,8 +576,8 @@ class ObjectImportCommand extends Command {
if(empty($supplier_name))
$supplier_name='Unknown';
foreach ($this->suppliers as $tempsupplier) {
if ($tempsupplier->name === $supplier_name) {
$this->comment('A matching Company ' . $supplier_name . ' already exists');
if (strcasecmp($tempsupplier->name, $supplier_name) == 0) {
$this->log('A matching Company ' . $supplier_name . ' already exists');
return $tempsupplier;
}
}
@@ -407,24 +585,27 @@ class ObjectImportCommand extends Command {
$supplier = new Supplier();
$supplier->name = $supplier_name;
$supplier->user_id = 1;
$this->suppliers->add($supplier);
if(!$this->option('testrun')) {
if ($supplier->save()) {
$this->comment('Supplier ' . $supplier_name . ' was created');
$this->suppliers->add($supplier);
$this->log('Supplier ' . $supplier_name . ' was created');
return $supplier;
} else {
$this->comment('Something went wrong! Supplier ' . $supplier_name . ' was NOT created');
dd($supplier);
return $supplier;
$this->log('Supplier', $supplier->getErrors());
return $supplier;
}
} else {
$this->suppliers->add($supplier);
return $supplier;
}
}
/**
/**
* Finds the user matching given data, or creates a new one if there is no match
*
* @author Daniel Melzter
* @since 3.0
* @param $row array
* @return User Model w/ matching name
* @internal param string $user_username Username extracted from CSV
@@ -440,44 +621,44 @@ class ObjectImportCommand extends Command {
// A number was given instead of a name
if (is_numeric($user_name)) {
$this->comment('User '.$user_name.' is not a name - assume this user already exists');
$this->log('User '.$user_name.' is not a name - assume this user already exists');
$user_username = '';
$first_name = '';
$last_name = '';
// No name was given
} elseif (empty($user_name)) {
$this->comment('No user data provided - skipping user creation, just adding asset');
$this->log('No user data provided - skipping user creation, just adding asset');
$first_name = '';
$last_name = '';
//$user_username = '';
} else {
$user_email_array = User::generateFormattedNameFromFullName($this->option('email_format'), $user_name);
$user_email_array = User::generateFormattedNameFromFullName(Setting::getSettings()->email_format, $user_name);
$first_name = $user_email_array['first_name'];
$last_name = $user_email_array['last_name'];
if ($user_email=='') {
$user_email = $user_email_array['username'].'@'.config('app.domain');
$user_email = $user_email_array['username'].'@'.Setting::getSettings()->email_domain;
}
if ($user_username=='') {
if ($this->option('username_format')=='email') {
$user_username = $user_email;
} else {
$user_name_array = User::generateFormattedNameFromFullName($this->option('username_format'), $user_name);
$user_name_array = User::generateFormattedNameFromFullName(Setting::getSettings()->username_format, $user_name);
$user_username = $user_name_array['username'];
}
}
}
$this->comment("--- User Data ---");
$this->comment('Full Name: ' . $user_name);
$this->comment('First Name: ' . $first_name);
$this->comment('Last Name: ' . $last_name);
$this->comment('Username: ' . $user_username);
$this->comment('Email: ' . $user_email);
$this->comment('--- End User Data ---');
$this->log("--- User Data ---");
$this->log('Full Name: ' . $user_name);
$this->log('First Name: ' . $first_name);
$this->log('Last Name: ' . $last_name);
$this->log('Username: ' . $user_username);
$this->log('Email: ' . $user_email);
$this->log('--- End User Data ---');
if($this->option('testrun'))
return new User;
@@ -485,8 +666,9 @@ class ObjectImportCommand extends Command {
if (!empty($user_username)) {
if ($user = User::MatchEmailOrUsername($user_username, $user_email)
->whereNotNull('username')->first()) {
$this->comment('User '.$user_username.' already exists');
} else {
$this->log('User '.$user_username.' already exists');
} else if(( $first_name != '') && ($last_name != '') && ($user_username != '')) {
$user = new \App\Models\User;
$password = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 20);
@@ -497,12 +679,13 @@ class ObjectImportCommand extends Command {
$user->password = bcrypt($password);
$user->activated = 1;
if ($user->save()) {
$this->comment('User '.$first_name.' created');
$this->log('User '.$first_name.' created');
} else {
$this->error('ERROR CREATING User '.$first_name.' '.$last_name);
$this->error($user->getErrors());
$this->jsonError('User', $user->getErrors());
}
} else {
$user = new User;
}
} else {
$user = new User;
@@ -513,30 +696,49 @@ class ObjectImportCommand extends Command {
private $assets;
/**
* Create the asset if it doesn't exist.
*
* @author Daniel Melzter
* @since 3.0
* @param array $row
* @param array $item
*/
public function createAssetIfNotExists(array $row, array $item )
{
$status_id = 1;
$asset_serial = $this->array_smart_fetch($row, "serial number");
$asset_tag = $this->array_smart_fetch($row, "asset tag");
$asset_image = $this->array_smart_fetch($row, "image");
$asset_warranty_months = intval($this->array_smart_fetch($row, "warranty months"));
if(empty($asset_warranty_months)) {
$asset_warranty_months = NULL;
}
// Check for the asset model match and create it if it doesn't exist
$asset_model = $this->createOrFetchAssetModel($row, $item["category"], $item["manufacturer"]);
$supplier = $this->createOrFetchSupplier($row);
$this->comment('Serial No: '.$asset_serial);
$this->comment('Asset Tag: '.$asset_tag);
$this->comment('Notes: '.$item["notes"]);
$this->current_assetId = $asset_tag;
$this->log('Serial No: '.$asset_serial);
$this->log('Asset Tag: '.$asset_tag);
$this->log('Notes: '.$item["notes"]);
foreach ($this->assets as $tempasset) {
if ($tempasset->asset_tag === $asset_tag ) {
$this->comment('A matching Asset ' . $asset_tag . ' already exists');
if (strcasecmp($tempasset->asset_tag, $asset_tag ) == 0 ) {
$this->log('A matching Asset ' . $asset_tag . ' already exists');
// $this->comment('A matching Asset ' . $asset_tag . ' already exists');
return;
}
}
if($item["status_label"]) {
$status_id = $item["status_label"]->id;
} else {
// FIXME: We're already grabbing the list of statuses, we should probably not hardcode here
$this->log("No status field found, defaulting to id 1.");
$status_id = 1;
}
$asset = new Asset();
$asset->name = $item["item_name"];
if ($item["purchase_date"] != '') {
@@ -545,32 +747,44 @@ class ObjectImportCommand extends Command {
$asset->purchase_date = NULL;
}
if (!empty($item_purchase_cost)) {
$asset->purchase_cost = number_format($item["purchase_cost"],2);
$this->comment("Asset cost parsed: " . $asset->purchase_cost);
foreach ($item['custom_fields'] as $custom_field => $val) {
$asset->{$custom_field} = $val;
}
if (!empty($item["purchase_cost"])) {
//TODO How to generalize this for not USD?
$purchase_cost = substr($item["purchase_cost"],0,1) === '$' ? substr($item["purchase_cost"],1) : $item["purchase_cost"];
$asset->purchase_cost = number_format($purchase_cost,2);
$this->log("Asset cost parsed: " . $asset->purchase_cost);
} else {
$asset->purchase_cost = 0.00;
}
$asset->serial = $asset_serial;
$asset->asset_tag = $asset_tag;
$asset->model_id = $asset_model->id;
$asset->assigned_to = $item["user"]->id;
$asset->rtd_location_id = $item["location"]->id;
if($asset_model)
$asset->model_id = $asset_model->id;
if($item["user"])
$asset->assigned_to = $item["user"]->id;
if($item["location"])
$asset->rtd_location_id = $item["location"]->id;
$asset->user_id = 1;
$this->log("status_id: " . $status_id);
$asset->status_id = $status_id;
$asset->company_id = $item["company"]->id;
if($item["company"])
$asset->company_id = $item["company"]->id;
$asset->order_number = $item["order_number"];
$asset->supplier_id = $supplier->id;
if($supplier)
$asset->supplier_id = $supplier->id;
$asset->notes = $item["notes"];
$asset->image = $asset_image;
$this->assets->add($asset);
if (!$this->option('testrun')) {
if ($asset->save()) {
$this->comment('Asset ' . $item["item_name"] . ' with serial number ' . $asset_serial . ' was created');
$this->log('Asset ' . $item["item_name"] . ' with serial number ' . $asset_serial . ' was created');
} else {
$this->comment('Something went wrong! Asset ' . $item["item_name"] . ' was NOT created');
// dd($asset);
$this->jsonError('Asset', $asset->getErrors());
}
} else {
@@ -582,14 +796,17 @@ class ObjectImportCommand extends Command {
/**
* Create an accessory if a duplicate does not exist
*
* @author Daniel Melzter
* @since 3.0
* @param $item array
*/
public function createAccessoryIfNotExists(array $item )
{
$this->comment("Creating Accessory");
$this->log("Creating Accessory");
foreach ($this->accessories as $tempaccessory) {
if ($tempaccessory->name === $item["item_name"] ) {
$this->comment('A matching Accessory ' . $item["item_name"] . ' already exists. ');
if (strcasecmp($tempaccessory->name, $item["item_name"] ) == 0 ) {
$this->log('A matching Accessory ' . $item["item_name"] . ' already exists. ');
// FUTURE: Adjust quantity on import maybe?
return;
}
@@ -597,6 +814,7 @@ class ObjectImportCommand extends Command {
$accessory = new Accessory();
$accessory->name = $item["item_name"];
if (!empty($item["purchase_date"])) {
$accessory->purchase_date = $item["purchase_date"];
} else {
@@ -607,11 +825,14 @@ class ObjectImportCommand extends Command {
} else {
$accessory->purchase_cost = 0.00;
}
$accessory->location_id = $item["location"]->id;
if($item["location"])
$accessory->location_id = $item["location"]->id;
$accessory->user_id = 1;
$accessory->company_id = $item["company"]->id;
if($item["company"])
$accessory->company_id = $item["company"]->id;
$accessory->order_number = $item["order_number"];
$accessory->category_id = $item["category"]->id;
if($item["category"])
$accessory->category_id = $item["category"]->id;
//TODO: Implement
// $accessory->notes = e($item_notes);
@@ -626,12 +847,14 @@ class ObjectImportCommand extends Command {
if (!$this->option('testrun')) {
if ($accessory->save()) {
$this->comment('Accessory ' . $item["item_name"] . ' was created');
$this->log('Accessory ' . $item["item_name"] . ' was created');
// $this->comment('Accessory ' . $item["item_name"] . ' was created');
} else {
$this->comment('Something went wrong! Accessory ' . $item["item_name"] . ' was NOT created');
$this->jsonError('Accessory', $accessory->getErrors()) ;
}
} else {
$this->comment('TEST RUN - Accessory ' . $item["item_name"] . ' not created');
$this->log('TEST RUN - Accessory ' . $item["item_name"] . ' not created');
}
}
@@ -639,14 +862,17 @@ class ObjectImportCommand extends Command {
/**
* Create a consumable if a duplicate does not exist
*
* @author Daniel Melzter
* @since 3.0
* @param $item array
*/
public function createConsumableIfNotExists(array $item)
{
$this->comment("Creating Consumable");
$this->log("Creating Consumable");
foreach($this->consumables as $tempconsumable) {
if($tempconsumable->name === $item["item_name"]) {
$this->comment("A matching sumable " . $item["item_name"] . " already exists");
if(strcasecmp($tempconsumable->name, $item["item_name"]) == 0) {
$this->log("A matching consumable " . $item["item_name"] . " already exists");
//TODO: Adjust quantity if different maybe?
return;
}
@@ -683,18 +909,22 @@ class ObjectImportCommand extends Command {
if(!$this->option("testrun")) {
if($consumable->save()) {
$this->comment("Consumable " . $item["item_name"] . ' was created');
$this->log("Consumable " . $item["item_name"] . ' was created');
// $this->comment("Consumable " . $item["item_name"] . ' was created');
} else {
$this->comment('Something went wrong! Consumable ' . $item["item_name"] . ' not created');
$this->jsonError('Consumable', $consumable->getErrors());
}
} else {
$this->comment('TEST RUN - Consumable ' . $item['item_name'] . ' not created');
$this->log('TEST RUN - Consumable ' . $item['item_name'] . ' not created');
}
}
/**
* Get the console command arguments.
*
* @author Daniel Melzter
* @since 3.0
* @return array
*/
protected function getArguments()
@@ -708,6 +938,8 @@ class ObjectImportCommand extends Command {
/**
* Get the console command options.
*
* @author Daniel Melzter
* @since 3.0
* @return array
*/
protected function getOptions()
@@ -716,10 +948,13 @@ class ObjectImportCommand extends Command {
array('email_format', null, InputOption::VALUE_REQUIRED, 'The format of the email addresses that should be generated. Options are firstname.lastname, firstname, filastname', null),
array('username_format', null, InputOption::VALUE_REQUIRED, 'The format of the username that should be generated. Options are firstname.lastname, firstname, filastname, email', null),
array('testrun', null, InputOption::VALUE_NONE, 'If set, will parse and output data without adding to database', null),
array('logfile', null, InputOption::VALUE_REQUIRED, 'The path to log output to. storage/logs/importer.log by default', storage_path('logs/importer.log') ),
array('item-type', null, InputOption::VALUE_REQUIRED, 'Item Type To import. Valid Options are Asset, Consumable, Or Accessory', 'Asset'),
array('web-importer', null, InputOption::VALUE_NONE, 'Internal: packages output for use with the web importer')
);
}
}
}
+87 -39
View File
@@ -5,6 +5,22 @@ namespace App\Console\Commands;
use Illuminate\Console\Command;
use DB;
use App\Models\Accessory;
use App\Models\Asset;
use App\Models\AssetModel;
use App\Models\Category;
use App\Models\Company;
use App\Models\Component;
use App\Models\Consumable;
use App\Models\Depreciation;
use App\Models\Group;
use App\Models\License;
use App\Models\LicenseSeat;
use App\Models\Location;
use App\Models\Manufacturer;
use App\Models\Statuslabel;
use App\Models\Supplier;
class PaveIt extends Command
{
/**
@@ -12,7 +28,8 @@ class PaveIt extends Command
*
* @var string
*/
protected $signature = 'snipeit:pave';
protected $signature = 'snipeit:pave
{--soft: Perform a "Soft" Delete, leaving all migrations, table structure, and the first user in place.}';
/**
* The console command description.
@@ -38,45 +55,76 @@ class PaveIt extends Command
*/
public function handle()
{
if ($this->confirm("\n****************************************************\nTHIS WILL DELETE ALL OF THE DATA IN YOUR DATABASE. \nThere is NO undo. This WILL destroy ALL of your data. \n****************************************************\n\nDo you wish to continue? No backsies! [y|N]"))
{
if( $this->option('soft'))
{
Accessory::getQuery()->delete();
Asset::getQuery()->delete();
Category::getQuery()->delete();
Company::getQuery()->delete();
Component::getQuery()->delete();
Consumable::getQuery()->delete();
Depreciation::getQuery()->delete();
License::getQuery()->delete();
LicenseSeat::getQuery()->delete();
Location::getQuery()->delete();
Manufacturer::getQuery()->delete();
AssetModel::getQuery()->delete();
Statuslabel::getQuery()->delete();
Supplier::getQuery()->delete();
Group::getQuery()->delete();
if ($this->confirm("\n****************************************************\nTHIS WILL DROP ALL OF THE TABLES IN YOUR DATABASE. \nThere is NO undo. This WILL destroy ALL of your data. \n****************************************************\n\nDo you wish to continue? No backsies! [y|N]")) {
\DB::statement('drop table IF EXISTS accessories_users');
\DB::statement('drop table IF EXISTS accessories');
\DB::statement('drop table IF EXISTS asset_logs');
\DB::statement('drop table IF EXISTS asset_maintenances');
\DB::statement('drop table IF EXISTS asset_uploads');
\DB::statement('drop table IF EXISTS assets');
\DB::statement('drop table IF EXISTS categories');
\DB::statement('drop table IF EXISTS companies');
\DB::statement('drop table IF EXISTS consumables_users');
\DB::statement('drop table IF EXISTS consumables');
\DB::statement('drop table IF EXISTS custom_field_custom_fieldset');
\DB::statement('drop table IF EXISTS custom_fields');
\DB::statement('drop table IF EXISTS custom_fieldsets');
\DB::statement('drop table IF EXISTS depreciations');
\DB::statement('drop table IF EXISTS groups');
\DB::statement('drop table IF EXISTS history');
\DB::statement('drop table IF EXISTS components');
\DB::statement('drop table IF EXISTS components_assets');
\DB::statement('drop table IF EXISTS license_seats');
\DB::statement('drop table IF EXISTS licenses');
\DB::statement('drop table IF EXISTS locations');
\DB::statement('drop table IF EXISTS manufacturers');
\DB::statement('drop table IF EXISTS models');
\DB::statement('drop table IF EXISTS migrations');
\DB::statement('drop table IF EXISTS password_resets');
\DB::statement('drop table IF EXISTS requested_assets');
\DB::statement('drop table IF EXISTS requests');
\DB::statement('drop table IF EXISTS settings');
\DB::statement('drop table IF EXISTS status_labels');
\DB::statement('drop table IF EXISTS suppliers');
\DB::statement('drop table IF EXISTS throttle');
\DB::statement('drop table IF EXISTS users_groups');
\DB::statement('drop table IF EXISTS users');
DB::statement('delete from accessories_users');
DB::statement('delete from asset_logs');
DB::statement('delete from asset_maintenances');
DB::statement('delete from asset_uploads');
DB::statement('delete from consumables_users');
DB::statement('delete from custom_field_custom_fieldset');
DB::statement('delete from custom_fields');
DB::statement('delete from custom_fieldsets');
DB::statement('delete from components_assets');
DB::statement('delete from password_resets');
DB::statement('delete from requested_assets');
DB::statement('delete from requests');
DB::statement('delete from throttle');
DB::statement('delete from users_groups');
DB::statement('delete from users WHERE id!=1');
} else {
\DB::statement('drop table IF EXISTS accessories_users');
\DB::statement('drop table IF EXISTS accessories');
\DB::statement('drop table IF EXISTS asset_logs');
\DB::statement('drop table IF EXISTS asset_maintenances');
\DB::statement('drop table IF EXISTS asset_uploads');
\DB::statement('drop table IF EXISTS assets');
\DB::statement('drop table IF EXISTS categories');
\DB::statement('drop table IF EXISTS companies');
\DB::statement('drop table IF EXISTS consumables_users');
\DB::statement('drop table IF EXISTS consumables');
\DB::statement('drop table IF EXISTS custom_field_custom_fieldset');
\DB::statement('drop table IF EXISTS custom_fields');
\DB::statement('drop table IF EXISTS custom_fieldsets');
\DB::statement('drop table IF EXISTS depreciations');
\DB::statement('drop table IF EXISTS groups');
\DB::statement('drop table IF EXISTS history');
\DB::statement('drop table IF EXISTS components');
\DB::statement('drop table IF EXISTS components_assets');
\DB::statement('drop table IF EXISTS license_seats');
\DB::statement('drop table IF EXISTS licenses');
\DB::statement('drop table IF EXISTS locations');
\DB::statement('drop table IF EXISTS manufacturers');
\DB::statement('drop table IF EXISTS models');
\DB::statement('drop table IF EXISTS migrations');
\DB::statement('drop table IF EXISTS password_resets');
\DB::statement('drop table IF EXISTS requested_assets');
\DB::statement('drop table IF EXISTS requests');
\DB::statement('drop table IF EXISTS settings');
\DB::statement('drop table IF EXISTS status_labels');
\DB::statement('drop table IF EXISTS suppliers');
\DB::statement('drop table IF EXISTS throttle');
\DB::statement('drop table IF EXISTS users_groups');
\DB::statement('drop table IF EXISTS users');
}
}
}
}
+1 -1
View File
@@ -140,7 +140,7 @@ class Purge extends Command
$supplier->forceDelete();
}
$users = User::whereNotNull('deleted_at')->withTrashed()->get();
$users = User::whereNotNull('deleted_at')->where('show_in_list','!=','0')->withTrashed()->get();
$this->info($users->count().' users purged.');
$user_assoc = 0;
foreach ($users as $user) {
+131 -57
View File
@@ -26,19 +26,67 @@ use App\Models\Asset;
class Helper
{
// This doesn't do anything yet
public static function parseEscapedMarkedown($str) {
$Parsedown = new \Parsedown();
if ($str) {
return $Parsedown->text(e($str));
}
}
// This doesn't do anything yet
public static function parseEmailList($emails)
{
$emails_array = explode(',', $emails);
return array_walk($emails_array, 'trim_value');
}
// This doesn't do anything yet
// This doesn't do anything yet
public static function trim_value(&$value)
{
return trim($value);
}
// Static colors for pie charts
public static function chartColors()
{
$colors = [
'#f56954',
'#00a65a',
'#f39c12',
'#00c0ef',
'#3c8dbc',
'#d2d6de',
'#3c8dbc',
'#3c8dbc',
'#3c8dbc',
];
return $colors;
}
// Static background (highlight) colors for pie charts
// This is not currently used, but might be in the near future.
public static function chartBackgroundColors()
{
$colors = [
'#f56954',
'#00a65a',
'#f39c12',
'#00c0ef',
'#3c8dbc',
'#d2d6de',
'#3c8dbc',
'#3c8dbc',
'#3c8dbc',
];
return $colors;
}
public static function ParseFloat($floatString)
{
@@ -63,48 +111,50 @@ class Helper
public static function companyList()
{
$company_list = array('0' => trans('general.select_company')) + DB::table('companies')
->orderBy('name', 'asc')
->pluck('name', 'id');
->orderBy('name', 'asc')
->pluck('name', 'id');
return $company_list;
}
public static function categoryList()
public static function categoryList($category_type = null)
{
$category_list = array('' => '') + Category::orderBy('name', 'asc')
->whereNull('deleted_at')
->orderBy('name', 'asc')
->pluck('name', 'id')->toArray();
$categories = Category::orderBy('name', 'asc')
->whereNull('deleted_at')
->orderBy('name', 'asc');
if(!empty($category_type))
$categories = $categories->where('category_type', '=', $category_type);
$category_list = array('' => trans('general.select_category')) + $categories->pluck('name', 'id')->toArray();
return $category_list;
}
public static function suppliersList()
{
$supplier_list = array('' => trans('general.select_supplier')) + Supplier::orderBy('name', 'asc')
->orderBy('name', 'asc')
->pluck('name', 'id')->toArray();
->orderBy('name', 'asc')
->pluck('name', 'id')->toArray();
return $supplier_list;
}
public static function statusLabelList()
{
$statuslabel_list = array('' => trans('general.select_statuslabel')) + Statuslabel::orderBy('name', 'asc')
->pluck('name', 'id')->toArray();
->pluck('name', 'id')->toArray();
return $statuslabel_list;
}
public static function locationsList()
{
$location_list = array('' => trans('general.select_location')) + Location::orderBy('name', 'asc')
->pluck('name', 'id')->toArray();
->pluck('name', 'id')->toArray();
return $location_list;
}
public static function manufacturerList()
{
$manufacturer_list = array('' => 'Select One') +
Manufacturer::orderBy('name', 'asc')
->pluck('name', 'id')->toArray();
$manufacturer_list = array('' => trans('general.select_manufacturer')) +
Manufacturer::orderBy('name', 'asc')
->pluck('name', 'id')->toArray();
return $manufacturer_list;
}
@@ -116,47 +166,55 @@ class Helper
public static function managerList()
{
$manager_list = array('' => '') + User::select(DB::raw('concat(last_name,", ",first_name," (",username,")") as full_name, id'))
->whereNull('deleted_at', 'and')
->orderBy('last_name', 'asc')
->orderBy('first_name', 'asc')
->pluck('full_name', 'id')->toArray();
$manager_list = array('' => trans('general.select_user')) +
User::where('deleted_at', '=', null)
->orderBy('last_name', 'asc')
->orderBy('first_name', 'asc')->get()
->lists('complete_name', 'id')->toArray();
return $manager_list;
}
public static function depreciationList()
{
$depreciation_list = ['' => 'Do Not Depreciate'] + Depreciation::orderBy('name', 'asc')
->pluck('name', 'id')->toArray();
->pluck('name', 'id')->toArray();
return $depreciation_list;
}
public static function categoryTypeList()
{
$category_types = array('' => '','accessory' => 'Accessory', 'asset' => 'Asset', 'consumable' => 'Consumable','component' => 'Component');
return $category_types;
$category_types = array('' => '','accessory' => 'Accessory', 'asset' => 'Asset', 'consumable' => 'Consumable','component' => 'Component');
return $category_types;
}
public static function usersList()
{
$users_list = array('' => trans('general.select_user')) + DB::table('users')
->select(DB::raw('concat(last_name,", ",first_name," (",username,")") as full_name, id'))
->whereNull('deleted_at')
->where('show_in_list','=',1)
->orderBy('last_name', 'asc')
->orderBy('first_name', 'asc')
->pluck('full_name', 'id');
$users_list = array( '' => trans('general.select_user')) +
User::where('deleted_at', '=', null)
->where('show_in_list','=',1)
->orderBy('last_name', 'asc')
->orderBy('first_name', 'asc')->get()
->lists('complete_name', 'id')->toArray();
return $users_list;
}
public static function assetsList()
{
$assets_list = array('' => trans('general.select_asset')) + Asset::orderBy('name', 'asc')
->whereNull('deleted_at')
->pluck('name', 'id')->toArray();
->whereNull('deleted_at')
->pluck('name', 'id')->toArray();
return $assets_list;
}
public static function detailedAssetList()
{
$assets = array('' => trans('general.select_asset')) + Company::scopeCompanyables(Asset::all(), 'assets.company_id')->lists('detailed_name', 'id')->toArray();
return $assets;
}
public static function customFieldsetList()
{
@@ -197,10 +255,10 @@ class Helper
return $randomString;
}
/**
* This nasty little method gets the low inventory info for the
* alert dropdown
**/
/**
* This nasty little method gets the low inventory info for the
* alert dropdown
**/
public static function checkLowInventory()
{
$consumables = Consumable::with('users')->whereNotNull('min_amt')->get();
@@ -214,7 +272,12 @@ class Helper
foreach ($consumables as $consumable) {
$avail = $consumable->numRemaining();
if ($avail < ($consumable->min_amt) + \App\Models\Setting::getSettings()->alert_threshold) {
$percent = number_format((($consumable->numRemaining() / $consumable->qty) * 100), 0);
if ($consumable->total_qty > 0) {
$percent = number_format((($consumable->numRemaining() / $consumable->total_qty) * 100), 0);
} else {
$percent = 100;
}
$items_array[$all_count]['id'] = $consumable->id;
$items_array[$all_count]['name'] = $consumable->name;
$items_array[$all_count]['type'] = 'consumables';
@@ -230,7 +293,13 @@ class Helper
foreach ($accessories as $accessory) {
$avail = $accessory->numRemaining();
if ($avail < ($accessory->min_amt) + \App\Models\Setting::getSettings()->alert_threshold) {
$percent = number_format((($accessory->numRemaining() / $accessory->qty) * 100), 0);
if ($accessory->total_qty > 0) {
$percent = number_format((($accessory->numRemaining() / $accessory->total_qty) * 100), 0);
} else {
$percent = 100;
}
$items_array[$all_count]['id'] = $accessory->id;
$items_array[$all_count]['name'] = $accessory->name;
$items_array[$all_count]['type'] = 'accessories';
@@ -245,7 +314,12 @@ class Helper
foreach ($components as $component) {
$avail = $component->numRemaining();
if ($avail < ($component->min_amt) + \App\Models\Setting::getSettings()->alert_threshold) {
$percent = number_format((($component->numRemaining() / $component->total_qty) * 100), 0);
if ($component->total_qty > 0) {
$percent = number_format((($component->numRemaining() / $component->total_qty) * 100), 0);
} else {
$percent = 100;
}
$items_array[$all_count]['id'] = $component->id;
$items_array[$all_count]['name'] = $component->name;
$items_array[$all_count]['type'] = 'components';
@@ -280,22 +354,22 @@ class Helper
}
/**
* Walks through the permissions in the permissions config file and determines if
* permissions are granted based on a $selected_arr array.
*
* The $permissions array is a multidimensional array broke down by section.
* (Licenses, Assets, etc)
*
* The $selected_arr should be a flattened array that contains just the
* corresponding permission name and a true or false boolean to determine
* if that group/user has been granted that permission.
*
* @author [A. Gianotto] [<snipe@snipe.net]
* @param array $permissions
* @param array $selected_arr
* @since [v1.0]
* @return Array
*/
* Walks through the permissions in the permissions config file and determines if
* permissions are granted based on a $selected_arr array.
*
* The $permissions array is a multidimensional array broke down by section.
* (Licenses, Assets, etc)
*
* The $selected_arr should be a flattened array that contains just the
* corresponding permission name and a true or false boolean to determine
* if that group/user has been granted that permission.
*
* @author [A. Gianotto] [<snipe@snipe.net]
* @param array $permissions
* @param array $selected_arr
* @since [v1.0]
* @return Array
*/
public static function selectedPermissionsArray($permissions, $selected_arr = array())
{
@@ -324,7 +398,7 @@ class Helper
}
return $permissions_arr;
}
@@ -52,7 +52,7 @@ class AccessoriesController extends Controller
public function getCreate(Request $request)
{
// Show the page
$category_list = array('' => '') + DB::table('categories')->where('category_type', '=', 'accessory')->whereNull('deleted_at')->orderBy('name', 'ASC')->lists('name', 'id');
$category_list = Helper::categoryList('accessory');
$company_list = Helper::companyList();
$location_list = Helper::locationsList();
return View::make('accessories/edit')
@@ -125,7 +125,7 @@ class AccessoriesController extends Controller
return redirect()->to('admin/accessories')->with('error', trans('general.insufficient_permissions'));
}
$category_list = array('' => '') + DB::table('categories')->where('category_type', '=', 'accessory')->whereNull('deleted_at')->orderBy('name', 'ASC')->lists('name', 'id');
$category_list = Helper::categoryList('accessory');
$company_list = Helper::companyList();
$location_list = Helper::locationsList();
@@ -313,6 +313,7 @@ class AccessoriesController extends Controller
$logaction = new Actionlog();
$logaction->accessory_id = $accessory->id;
$logaction->asset_id = 0;
$logaction->checkedout_to = $accessory->assigned_to;
$logaction->asset_type = 'accessory';
$logaction->location_id = $user->location_id;
@@ -155,41 +155,14 @@ class AssetMaintenancesController extends Controller
] + AssetMaintenance::getImprovementOptions();
// Mark the selected asset, if it came in
$selectedAsset = $assetId;
// Get the possible assets using a left join to get a list of assets and some other helpful info
$asset = Company::scopeCompanyables(DB::table('assets'), 'assets.company_id')
->leftJoin('users', 'users.id', '=', 'assets.assigned_to')
->leftJoin('models', 'assets.model_id', '=', 'models.id')
->select(
'assets.id',
'assets.name',
'first_name',
'last_name',
'asset_tag',
DB::raw('concat(first_name," ",last_name) as full_name, assets.id as id, models.name as modelname')
)
->whereNull('assets.deleted_at')
->get();
$asset_array = json_decode(json_encode($asset), true);
$asset_element[ '' ] = 'Please select an asset';
// Build a list out of the data results
for ($x = 0; $x < count($asset_array); $x++) {
$assets = Company::scopeCompanyables(Asset::all(), 'assets.company_id')->lists('detailed_name', 'id');
if ($asset_array[ $x ][ 'full_name' ] != '') {
$full_name = ' (' . $asset_array[ $x ][ 'full_name' ] . ') ' . $asset_array[ $x ][ 'modelname' ];
} else {
$full_name = ' (Unassigned) ' . $asset_array[ $x ][ 'modelname' ];
}
$asset_element[ $asset_array[ $x ][ 'id' ] ] =
$asset_array[ $x ][ 'asset_tag' ] . ' - ' . $asset_array[ $x ][ 'name' ] . $full_name;
}
// Get Supplier List
$supplier_list = Helper::suppliersList();
// Render the view
return View::make('asset_maintenances/edit')
->with('asset_list', $asset_element)
->with('asset_list', $assets)
->with('selectedAsset', $selectedAsset)
->with('supplier_list', $supplier_list)
->with('assetMaintenanceType', $assetMaintenanceType)
@@ -321,40 +294,13 @@ class AssetMaintenancesController extends Controller
'' => 'Select an improvement type',
] + AssetMaintenance::getImprovementOptions();
// Get the possible assets using a left join to get a list of assets and some other helpful info
$asset = Company::scopeCompanyables(DB::table('assets'), 'assets.company_id')
->leftJoin('users', 'users.id', '=', 'assets.assigned_to')
->leftJoin('models', 'assets.model_id', '=', 'models.id')
->select(
'assets.id',
'assets.name',
'first_name',
'last_name',
'asset_tag',
DB::raw('concat(first_name," ",last_name) as full_name, assets.id as id, models.name as modelname')
)
->whereNull('assets.deleted_at')
->get();
$asset_array = json_decode(json_encode($asset), true);
$asset_element[ '' ] = 'Please select an asset';
// Build a list out of the data results
for ($x = 0; $x < count($asset_array); $x++) {
if ($asset_array[ $x ][ 'full_name' ] != '') {
$full_name = ' (' . $asset_array[ $x ][ 'full_name' ] . ') ' . $asset_array[ $x ][ 'modelname' ];
} else {
$full_name = ' (Unassigned) ' . $asset_array[ $x ][ 'modelname' ];
}
$asset_element[ $asset_array[ $x ][ 'id' ] ] =
$asset_array[ $x ][ 'asset_tag' ] . ' - ' . $asset_array[ $x ][ 'name' ] . $full_name;
}
$assets = Company::scopeCompanyables(Asset::all(), 'assets.company_id')->lists('detailed_name', 'id');
// Get Supplier List
$supplier_list = Helper::suppliersList();
// Render the view
return View::make('asset_maintenances/edit')
->with('asset_list', $asset_element)
->with('asset_list', $assets)
->with('selectedAsset', null)
->with('supplier_list', $supplier_list)
->with('assetMaintenanceType', $assetMaintenanceType)
+14 -14
View File
@@ -55,9 +55,9 @@ class AssetModelsController extends Controller
public function getCreate()
{
// Show the page
$depreciation_list = \App\Helpers\Helper::depreciationList();
$manufacturer_list = \App\Helpers\Helper::manufacturerList();
$category_list = \App\Helpers\Helper::categoryList();
$depreciation_list = Helper::depreciationList();
$manufacturer_list = Helper::manufacturerList();
$category_list = Helper::categoryList('asset');
return View::make('models/edit')
->with('category_list', $category_list)
->with('depreciation_list', $depreciation_list)
@@ -110,10 +110,10 @@ class AssetModelsController extends Controller
$image = Input::file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
$path = public_path('uploads/models/'.$file_name);
// Image::make($image->getRealPath())->resize(300, null, function ($constraint) {
// $constraint->aspectRatio();
// $constraint->upsize();
// })->save($path);
Image::make($image->getRealPath())->resize(500, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$model->image = $file_name;
}
@@ -181,9 +181,9 @@ class AssetModelsController extends Controller
return redirect()->to('assets/models')->with('error', trans('admin/models/message.does_not_exist'));
}
$depreciation_list = \App\Helpers\Helper::depreciationList();
$manufacturer_list = \App\Helpers\Helper::manufacturerList();
$category_list = \App\Helpers\Helper::categoryList();
$depreciation_list = Helper::depreciationList();
$manufacturer_list = Helper::manufacturerList();
$category_list = Helper::categoryList('asset');
$view = View::make('models/edit', compact('model'));
$view->with('category_list', $category_list);
$view->with('depreciation_list', $depreciation_list);
@@ -371,9 +371,9 @@ class AssetModelsController extends Controller
$model->id = null;
// Show the page
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
$manufacturer_list = array('' => 'Select One') + Manufacturer::lists('name', 'id');
$category_list = array('' => '') + DB::table('categories')->whereNull('deleted_at')->lists('name', 'id');
$depreciation_list = Helper::depreciationList();
$manufacturer_list = Helper::manufacturerList();
$category_list = Helper::categoryList('asset');
$view = View::make('models/edit');
$view->with('category_list', $category_list);
$view->with('depreciation_list', $depreciation_list);
@@ -452,7 +452,7 @@ class AssetModelsController extends Controller
foreach ($models as $model) {
if ($model->deleted_at == '') {
$actions = '<div style=" white-space: nowrap;"><a href="'.route('update/model', $model->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/model', $model->id).'" data-content="'.trans('admin/models/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($model->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';
$actions = '<div style=" white-space: nowrap;"><a href="'.route('clone/model', $model->id).'" class="btn btn-info btn-sm" title="Clone Model" data-toggle="tooltip"><i class="fa fa-clone"></i></a> <a href="'.route('update/model', $model->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/model', $model->id).'" data-content="'.trans('admin/models/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($model->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';
} else {
$actions = '<a href="'.route('restore/model', $model->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
}
+134 -75
View File
@@ -10,7 +10,6 @@ use App\Models\Actionlog;
use App\Models\Asset;
use App\Models\AssetMaintenance;
use App\Models\AssetModel;
use App\Models\AssetModels;
use App\Models\Company;
use App\Models\CustomField;
use App\Models\Depreciation;
@@ -35,6 +34,7 @@ use Redirect;
use Response;
use Slack;
use Str;
use Illuminate\Http\Request;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\HttpFoundation\JsonResponse;
use TCPDF;
@@ -59,7 +59,6 @@ class AssetsController extends Controller
parent::__construct();
}
/**
* Returns a view that invokes the ajax tables which actually contains
* the content for the assets listing, which is generated in getDatatable.
@@ -74,6 +73,26 @@ class AssetsController extends Controller
return View::make('hardware/index');
}
/**
* Searches the assets table by asset tag, and redirects if it finds one
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v3.0]
* @return Redirect
*/
public function getAssetByTag() {
if (Input::get('topsearch')=="true") {
$topsearch = true;
} else {
$topsearch = false;
}
if ($asset = Asset::where('asset_tag','=',Input::get('assetTag'))->first()) {
return redirect()->route('view/hardware', $asset->id)->with('topsearch', $topsearch);
}
return redirect()->to('hardware')->with('error',trans('admin/hardware/message.does_not_exist'));
}
/**
* Returns a view that presents a form to create a new asset.
*
@@ -88,7 +107,7 @@ class AssetsController extends Controller
$statuslabel_list = Helper::statusLabelList();
$location_list = Helper::locationsList();
$manufacturer_list = Helper::manufacturerList();
$category_list = Helper::categoryList();
$category_list = Helper::categoryList('asset');
$supplier_list = Helper::suppliersList();
$company_list = Helper::companyList();
$assigned_to = Helper::usersList();
@@ -189,18 +208,36 @@ class AssetsController extends Controller
}
// Create the image (if one was chosen.)
if (Input::file('image')) {
$image = Input::file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
if (Input::has('image')) {
$image = Input::get('image');
$header = explode(';', $image, 2)[0];
$extension = substr( $header, strpos($header, '/')+1);
$image = substr( $image, strpos($image, ',')+1);
$file_name = str_random(25).".".$extension;
$path = public_path('uploads/assets/'.$file_name);
Image::make($image->getRealPath())->resize(300, null, function ($constraint) {
//Currently resizing happens on Client. Maybe use this for thumbnails in the future?
Image::make($image)->resize(500, 500, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$asset->image = $file_name;
$asset->image = $file_name;
}
// Update custom fields in the database.
// Validation for these fields is handlded 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)
{
foreach($model->fieldset->fields as $field) {
$asset->{\App\Models\CustomField::name_to_db_name($field->name)} = e($request->input(\App\Models\CustomField::name_to_db_name($field->name)));
}
}
// Was the asset created?
if ($asset->save()) {
@@ -214,11 +251,11 @@ class AssetsController extends Controller
$log = $logaction->logaction('checkout');
}
// Redirect to the asset listing page
return redirect()->to("hardware")->with('success', trans('admin/hardware/message.create.success'));
\Session::flash('success', trans('admin/hardware/message.create.success'));
return response()->json(['redirect_url' => route('hardware')]);
}
return redirect()->back()->withInput()->withErrors($asset->getErrors());
return response()->json(['errors' => $asset->getErrors()]);
}
/**
@@ -231,8 +268,9 @@ class AssetsController extends Controller
*/
public function getEdit($assetId = null)
{
// Check if the asset exists
if (is_null($asset = Asset::find($assetId))) {
if (!$asset = Asset::find($assetId)) {
// Redirect to the asset management page
return redirect()->to('hardware')->with('error', trans('admin/hardware/message.does_not_exist'));
} elseif (!Company::isCurrentUserHasAccess($asset)) {
@@ -244,11 +282,11 @@ class AssetsController extends Controller
$statuslabel_list = Helper::statusLabelList();
$location_list = Helper::locationsList();
$manufacturer_list = Helper::manufacturerList();
$category_list = Helper::categoryList();
$category_list = Helper::categoryList('asset');
$supplier_list = Helper::suppliersList();
$company_list = Helper::companyList();
$assigned_to = Helper::usersList();
$statuslabel_types =Helper:: statusTypeList();
$statuslabel_types =Helper::statusTypeList();
return View::make('hardware/edit', compact('asset'))
->with('model_list', $model_list)
@@ -271,98 +309,116 @@ class AssetsController extends Controller
* @since [v1.0]
* @return Redirect
*/
public function postEdit($assetId = null)
public function postEdit(AssetRequest $request, $assetId = null)
{
// Check if the asset exists
if (is_null($asset = Asset::find($assetId))) {
if (!$asset = Asset::find($assetId)) {
// Redirect to the asset management page with error
return redirect()->to('hardware')->with('error', trans('admin/hardware/message.does_not_exist'));
} elseif (!Company::isCurrentUserHasAccess($asset)) {
return redirect()->to('hardware')->with('error', trans('general.insufficient_permissions'));
}
if (e(Input::get('status_id')) == '') {
if ($request->has('status_id')) {
$asset->status_id = e($request->input('status_id'));
} else {
$asset->status_id = null;
} else {
$asset->status_id = e(Input::get('status_id'));
}
if (e(Input::get('warranty_months')) == '') {
if ($request->has('warranty_months')) {
$asset->warranty_months = e($request->input('warranty_months'));
} else {
$asset->warranty_months = null;
} else {
$asset->warranty_months = e(Input::get('warranty_months'));
}
if (e(Input::get('purchase_cost')) == '') {
if ($request->has('purchase_cost')) {
$asset->purchase_cost = e($request->input('purchase_cost'));
} else {
$asset->purchase_cost = null;
} else {
$asset->purchase_cost = e(Input::get('purchase_cost'));
}
if (e(Input::get('purchase_date')) == '') {
if ($request->has('purchase_date')) {
$asset->purchase_date = e($request->input('purchase_date'));
} else {
$asset->purchase_date = null;
} else {
$asset->purchase_date = e(Input::get('purchase_date'));
}
if (e(Input::get('supplier_id')) == '') {
if ($request->has('supplier_id')) {
$asset->supplier_id = e($request->input('supplier_id'));
} else {
$asset->supplier_id = null;
} else {
$asset->supplier_id = e(Input::get('supplier_id'));
}
if (e(Input::get('requestable')) == '') {
$asset->requestable = 0;
if ($request->has('requestable')) {
$asset->requestable = e($request->input('requestable'));
} else {
$asset->requestable = e(Input::get('requestable'));
$asset->requestable = null;
}
if (e(Input::get('rtd_location_id')) == '') {
$asset->rtd_location_id = 0;
if ($request->has('rtd_location_id')) {
$asset->rtd_location_id = e($request->input('rtd_location_id'));
} else {
$asset->rtd_location_id = e(Input::get('rtd_location_id'));
$asset->requestable = null;
}
if (Input::has('image_delete')) {
if ($request->has('image_delete')) {
unlink(public_path().'/uploads/assets/'.$asset->image);
$asset->image = '';
}
$checkModel = config('app.url').'/api/models/'.e(Input::get('model_id')).'/check';
// Update the asset data
$asset->name = e(Input::get('name'));
$asset->serial = e(Input::get('serial'));
$asset->company_id = Company::getIdForCurrentUser(e(Input::get('company_id')));
$asset->model_id = e(Input::get('model_id'));
$asset->order_number = e(Input::get('order_number'));
$asset->asset_tag = e(Input::get('asset_tag'));
$asset->notes = e(Input::get('notes'));
$asset->name = e($request->input('name'));
$asset->serial = e($request->input('serial'));
$asset->company_id = Company::getIdForCurrentUser(e($request->input('company_id')));
$asset->model_id = e($request->input('model_id'));
$asset->order_number = e($request->input('order_number'));
$asset->asset_tag = e($request->input('asset_tag'));
$asset->notes = e($request->input('notes'));
$asset->physical = '1';
// Update the image
if (Input::file('image')) {
$image = Input::file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
// Update the image
if (Input::has('image')) {
$image = $request->input('image');
$header = explode(';', $image, 2)[0];
$extension = substr( $header, strpos($header, '/')+1);
$image = substr( $image, strpos($image, ',')+1);
$file_name = str_random(25).".".$extension;
$path = public_path('uploads/assets/'.$file_name);
Image::make($image->getRealPath())->resize(300, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
Image::make($image)->resize(500, 500, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$asset->image = $file_name;
}
// Update custom fields in the database.
// Validation for these fields is handlded 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)
{
foreach($model->fieldset->fields as $field) {
$asset->{\App\Models\CustomField::name_to_db_name($field->name)} = e($request->input(\App\Models\CustomField::name_to_db_name($field->name)));
// LOG::debug($field->name);
// LOG::debug(\App\Models\CustomField::name_to_db_name($field->name));
// LOG::debug($field->db_column_name());
// Was the asset updated?
if ($asset->save()) {
// Redirect to the new asset page
return redirect()->to("hardware/$assetId/view")->with('success', trans('admin/hardware/message.update.success'));
}
}
return redirect()->back()->withInput()->withErrors($asset->getErrors());
if ($asset->save()) {
// Redirect to the new asset page
\Session::flash('success', trans('admin/hardware/message.update.success'));
return response()->json(['redirect_url' => route("view/hardware", $assetId)]);
}
return response()->json(['errors' => $asset->getErrors()]);
}
@@ -665,9 +721,7 @@ class AssetsController extends Controller
$asset = Asset::find($assetId);
$size = Helper::barcodeDimensions($settings->barcode_type);
if (!Company::isCurrentUserHasAccess($asset)) {
return redirect()->to('hardware')->with('error', trans('general.insufficient_permissions'));
}
if (isset($asset->id,$asset->asset_tag)) {
$barcode = new \Com\Tecnick\Barcode\Barcode();
@@ -694,13 +748,9 @@ class AssetsController extends Controller
$settings = Setting::getSettings();
$asset = Asset::find($assetId);
if (!Company::isCurrentUserHasAccess($asset)) {
return redirect()->to('hardware')->with('error', trans('general.insufficient_permissions'));
}
if (isset($asset->id,$asset->asset_tag)) {
$barcode = new \Com\Tecnick\Barcode\Barcode();
$size = Helper::barcodeDimensions($settings->alt_barcode_type);
$barcode_obj = $barcode->getBarcodeObj($settings->alt_barcode, $asset->asset_tag, 250, 20);
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
}
@@ -725,6 +775,9 @@ class AssetsController extends Controller
return redirect()->to('hardware')->with('error', trans('general.insufficient_permissions'));
}
// Check if the uploads directory exists. If not, try to create it.
if(!file_exists($path))
mkdir($path, 0755);
if ($handle = opendir($path)) {
/* This is the correct way to loop over the directory. */
@@ -821,14 +874,20 @@ class AssetsController extends Controller
return redirect()->to('hardware')->with('error', trans('general.insufficient_permissions'));
}
$output = new BufferedOutput;
Artisan::call('asset-import:csv', ['filename'=> config('app.private_uploads').'/imports/assets/'.$filename, '--email_format'=>'firstname.lastname', '--username_format'=>'firstname.lastname'], $output);
$display_output = $output->fetch();
$return = Artisan::call('snipeit:import',
['filename'=> config('app.private_uploads').'/imports/assets/'.$filename,
'--email_format'=>'firstname.lastname',
'--username_format'=>'firstname.lastname',
'--web-importer' => true
]);
$display_output = Artisan::output();
$file = config('app.private_uploads').'/imports/assets/'.str_replace('.csv', '', $filename).'-output-'.date("Y-m-d-his").'.txt';
file_put_contents($file, $display_output);
return redirect()->to('hardware')->with('success', 'Your file has been imported');
if( $return === 0) //Success
return redirect()->to('hardware')->with('success', trans('admin/hardware/message.import.success'));
else if( $return === 1) // Failure
return redirect()->back()->with('import_errors', json_decode($display_output))->with('error', trans('admin/hardware/message.import.error'));
dd("Shouldn't be here");
}
@@ -855,7 +914,7 @@ class AssetsController extends Controller
$statuslabel_list = Helper::statusLabelList();
$location_list = Helper::locationsList();
$manufacturer_list = Helper::manufacturerList();
$category_list = Helper::categoryList();
$category_list = Helper::categoryList('asset');
$supplier_list = Helper::suppliersList();
$assigned_to =Helper::usersList();
$statuslabel_types = Helper::statusTypeList();
@@ -303,7 +303,7 @@ class CategoriesController extends Controller
public function getDataViewAssets($categoryID) {
$category = Category::with('assets.company')->find($categoryID);
$category_assets = $category->assets;
$category_assets = $category->assets();
if (Input::has('search')) {
$category_assets = $category_assets->TextSearch(e(Input::get('search')));
@@ -356,7 +356,7 @@ class CategoriesController extends Controller
'model' => $asset->model->name,
'asset_tag' => $asset->asset_tag,
'serial' => $asset->serial,
'assigned_to' => ($asset->assigneduser) ? link_to('/admin/users/'.$asset->assigneduser->id.'/view', $asset->assigneduser->fullName()): '',
'assigned_to' => ($asset->assigneduser) ? (string)link_to('/admin/users/'.$asset->assigneduser->id.'/view', $asset->assigneduser->fullName()): '',
'change' => $inout,
'actions' => $actions,
'companyName' => Company::getName($asset),
@@ -54,7 +54,7 @@ class ComponentsController extends Controller
public function getCreate()
{
// Show the page
$category_list = array('' => '') + DB::table('categories')->where('category_type', '=', 'component')->whereNull('deleted_at')->orderBy('name', 'ASC')->lists('name', 'id');
$category_list = Helper::categoryList('component');
$company_list = Helper::companyList();
$location_list = Helper::locationsList();
@@ -133,7 +133,7 @@ class ComponentsController extends Controller
return redirect()->to('admin/components')->with('error', trans('general.insufficient_permissions'));
}
$category_list = Helper::categoryList();
$category_list = Helper::categoryList('component');
$company_list = Helper::companyList();
$location_list = Helper::locationsList();
@@ -287,7 +287,7 @@ class ComponentsController extends Controller
}
// Get the dropdown of assets and then pass it to the checkout view
$assets_list = Helper::assetsList();
$assets_list = Helper::detailedAssetList();
return View::make('components/checkout', compact('component'))->with('assets_list', $assets_list);
@@ -52,7 +52,7 @@ class ConsumablesController extends Controller
public function getCreate()
{
// Show the page
$category_list = array('' => '') + DB::table('categories')->where('category_type', '=', 'consumable')->whereNull('deleted_at')->orderBy('name', 'ASC')->lists('name', 'id');
$category_list = Helper::categoryList('consumable');
$company_list = Helper::companyList();
$location_list = Helper::locationsList();
$manufacturer_list = Helper::manufacturerList();
@@ -132,7 +132,7 @@ class ConsumablesController extends Controller
return redirect()->to('admin/consumables')->with('error', trans('general.insufficient_permissions'));
}
$category_list = Helper::categoryList();
$category_list = Helper::categoryList('consumable');
$company_list = Helper::companyList();
$location_list = Helper::locationsList();
$manufacturer_list = Helper::manufacturerList();
@@ -319,6 +319,7 @@ class ConsumablesController extends Controller
$logaction->consumable_id = $consumable->id;
$logaction->checkedout_to = $consumable->assigned_to;
$logaction->asset_type = 'consumable';
$logaction->asset_id = 0;
$logaction->location_id = $user->location_id;
$logaction->user_id = Auth::user()->id;
$logaction->note = e(Input::get('note'));
+8 -8
View File
@@ -47,11 +47,11 @@ class GroupsController extends Controller
$group = new Group;
// Get all the available permissions
$permissions = config('permissions');
$selectedPermissions = Input::old('permissions', array());
$groupPermissions = array();
$selectedPermissions = Input::old('permissions', $groupPermissions);
// Show the page
return View::make('groups/edit', compact('permissions', 'selectedPermissions'))->with('group', $group);
return View::make('groups/edit', compact('permissions', 'selectedPermissions', 'groupPermissions'))->with('group', $group);
}
/**
@@ -70,7 +70,7 @@ class GroupsController extends Controller
$group->permissions = json_encode(Input::get('permission'));
if ($group->save()) {
return redirect()->to("admin/groups")->with('success', trans('admin/groups/message.create.success'));
return redirect()->to("admin/groups")->with('success', trans('admin/groups/message.success.create'));
}
return redirect()->back()->withInput()->withErrors($group->getErrors());
@@ -91,9 +91,9 @@ class GroupsController extends Controller
{
$group = Group::find($id);
$permissions = config('permissions');
$group->permissions = $group->decodePermissions();
$selected_array = Helper::selectedPermissionsArray($permissions, $group->permissions);
return View::make('groups/edit', compact('group', 'permissions','selected_array'));
$groupPermissions = $group->decodePermissions();
$selected_array = Helper::selectedPermissionsArray($permissions, $groupPermissions);
return View::make('groups/edit', compact('group', 'permissions','selected_array','groupPermissions'));
}
/**
@@ -119,7 +119,7 @@ class GroupsController extends Controller
if (!config('app.lock_passwords')) {
if ($group->save()) {
return redirect()->to("admin/groups")->with('success', trans('admin/groups/message.create.success'));
return redirect()->to("admin/groups")->with('success', trans('admin/groups/message.success.update'));
}
return redirect()->back()->withInput()->withErrors($group->getErrors());
+10 -36
View File
@@ -156,6 +156,7 @@ class LicensesController extends Controller
$insertedId = $license->id;
// Save the license seat data
DB::transaction(function() use (&$insertedId,&$license) {
for ($x=0; $x<$license->seats; $x++) {
$license_seat = new LicenseSeat();
$license_seat->license_id = $insertedId;
@@ -164,6 +165,7 @@ class LicensesController extends Controller
$license_seat->notes = null;
$license_seat->save();
}
});
// Redirect to the new license page
@@ -435,40 +437,12 @@ class LicensesController extends Controller
}
// Get the dropdown of users and then pass it to the checkout view
$users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name," (",username,")") as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id');
$users_list = Helper::usersList();
// Left join to get a list of assets and some other helpful info
$asset = DB::table('assets')
->leftJoin('users', 'users.id', '=', 'assets.assigned_to')
->leftJoin('models', 'assets.model_id', '=', 'models.id')
->select(
'assets.id',
'assets.name',
'first_name',
'last_name',
'asset_tag',
DB::raw('concat(first_name," ",last_name) as full_name, assets.id as id, models.name as modelname')
)
->whereNull('assets.deleted_at')
->get();
$asset_array = json_decode(json_encode($asset), true);
$asset_element[''] = 'Please select an asset';
// Build a list out of the data results
for ($x=0; $x<count($asset_array); $x++) {
if ($asset_array[$x]['full_name']!='') {
$full_name = ' ('.$asset_array[$x]['full_name'].') '.$asset_array[$x]['modelname'];
} else {
$full_name = ' (Unassigned) '.$asset_array[$x]['modelname'];
}
$asset_element[$asset_array[$x]['id']] = $asset_array[$x]['asset_tag'].' - '.$asset_array[$x]['name'].$full_name;
}
return View::make('licenses/checkout', compact('licenseseat'))->with('users_list', $users_list)->with('asset_list', $asset_element);
$assets = Helper::detailedAssetList();
return View::make('licenses/checkout', compact('licenseseat'))
->with('users_list', $users_list)
->with('asset_list', $assets);
}
@@ -525,8 +499,8 @@ class LicensesController extends Controller
// Redirect to the asset management page with error
return redirect()->to('admin/licenses')->with('error', trans('admin/licenses/message.asset_does_not_exist'));
}
if (($is_asset_id->assigned_to!=$assigned_to) && ($assigned_to!='')) {
$was_assigned_to = $is_asset_id->assigned_to;
if (($was_assigned_to!=$assigned_to) && !is_null($was_assigned_to) && ($was_assigned_to != '')) {
//echo 'asset assigned to: '.$is_asset_id->assigned_to.'<br>license assigned to: '.$assigned_to;
return redirect()->to('admin/licenses')->with('error', trans('admin/licenses/message.owner_doesnt_match_asset'));
}
@@ -1009,7 +983,7 @@ class LicensesController extends Controller
$rows = array();
foreach ($licenses as $license) {
$actions = '<span style="white-space: nowrap;"><a href="'.route('freecheckout/license', $license->id).'" class="btn btn-primary btn-sm" style="margin-right:5px;" '.(($license->remaincount() > 0) ? '' : 'disabled').'>'.trans('general.checkout').'</a> <a href="'.route('clone/license', $license->id).'" class="btn btn-info btn-sm" style="margin-right:5px;" title="Clone asset"><i class="fa fa-files-o"></i></a><a href="'.route('update/license', $license->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/license', $license->id).'" data-content="'.trans('admin/licenses/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($license->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></span>';
$actions = '<span style="white-space: nowrap;"><a href="'.route('freecheckout/license', $license->id).'" class="btn btn-primary btn-sm'.(($license->remaincount() > 0) ? '' : ' disabled').'" style="margin-right:5px;">'.trans('general.checkout').'</a> <a href="'.route('clone/license', $license->id).'" class="btn btn-info btn-sm" style="margin-right:5px;" title="Clone asset"><i class="fa fa-files-o"></i></a><a href="'.route('update/license', $license->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/license', $license->id).'" data-content="'.trans('admin/licenses/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($license->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></span>';
$rows[] = array(
'id' => $license->id,
+24 -10
View File
@@ -16,7 +16,6 @@ use Crypt;
use Mail;
use App\Models\User;
use App\Http\Requests\SetupUserRequest;
use App\Http\Requests\SettingRequest;
/**
* This controller handles all actions related to Settings for
@@ -98,10 +97,17 @@ class SettingsController extends Controller
}
$owner = posix_getpwuid(fileowner($_SERVER["SCRIPT_FILENAME"]));
$start_settings['owner'] = $owner['name'];
if(function_exists('posix_getpwuid')) { // Probably Linux
$owner = posix_getpwuid(fileowner($_SERVER["SCRIPT_FILENAME"]));
$start_settings['owner'] = $owner['name'];
} else { // Windows
// TODO: Is there a way of knowing if a windows user has elevated permissions
// This just gets the user name, which likely isn't 'root'
// $start_settings['owner'] = getenv('USERNAME');
$start_settings['owner'] = '';
}
if (($start_settings['owner']=='root') || ($start_settings['owner']=='0') || ($start_settings['owner']=='root')) {
if (($start_settings['owner']==='root') || ($start_settings['owner']==='0')) {
$start_settings['owner_is_admin'] = true;
} else {
$start_settings['owner_is_admin'] = false;
@@ -176,15 +182,19 @@ class SettingsController extends Controller
$settings->alert_email = e(Input::get('email'));
$settings->alerts_enabled = 1;
$settings->brand = 1;
$settings->locale = 'en';
$settings->default_currency = 'USD';
$settings->user_id = 1;
$settings->email_domain = e(Input::get('email_domain'));
$settings->email_format = e(Input::get('email_format'));
if ((!$user->isValid('initial')) && (!$settings->isValid('initial'))) {
if ((!$user->isValid()) || (!$settings->isValid())) {
return redirect()->back()->withInput()->withErrors($user->getErrors())->withErrors($settings->getErrors());
} else {
$user->save();
$settings->save();
if (Input::get('email_creds')=='1') {
Mail::send(['text' => 'emails.firstadmin'], $data, function ($m) use ($data) {
$m->to($data['email'], $data['first_name']);
@@ -192,6 +202,7 @@ class SettingsController extends Controller
});
}
return redirect()->route('setup.done');
}
@@ -288,11 +299,11 @@ class SettingsController extends Controller
* @since [v1.0]
* @return Redirect
*/
public function postEdit(SettingRequest $request)
public function postEdit()
{
// Check if the asset exists
if (is_null($setting = Setting::find(1))) {
if (is_null($setting = Setting::first())) {
// Redirect to the asset management page with error
return redirect()->to('admin')->with('error', trans('admin/settings/message.update.error'));
}
@@ -311,8 +322,7 @@ class SettingsController extends Controller
$setting->logo = $file_name;
}
}
$setting->id = '1';
if (config('app.lock_passwords')==false) {
$setting->site_name = e(Input::get('site_name'));
@@ -328,6 +338,7 @@ class SettingsController extends Controller
$setting->locale = e(Input::get('locale', 'en'));
$setting->qr_code = e(Input::get('qr_code', '0'));
$setting->full_multiple_companies_support = e(Input::get('full_multiple_companies_support', '0'));
$setting->alt_barcode = e(Input::get('alt_barcode'));
$setting->alt_barcode_enabled = e(Input::get('alt_barcode_enabled', '0'));
$setting->barcode_type = e(Input::get('barcode_type'));
@@ -338,6 +349,9 @@ class SettingsController extends Controller
$setting->auto_increment_assets = e(Input::get('auto_increment_assets', '0'));
$setting->alert_interval = e(Input::get('alert_interval'));
$setting->alert_threshold = e(Input::get('alert_threshold'));
$setting->email_domain = e(Input::get('email_domain'));
$setting->email_format = e(Input::get('email_format'));
$setting->username_format = e(Input::get('username_format'));
$setting->labels_per_page = e(Input::get('labels_per_page'));
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use Input;
use Lang;
use App\Models\Statuslabel;
use App\Models\Asset;
use Redirect;
use DB;
use App\Models\Setting;
@@ -35,6 +36,39 @@ class StatuslabelsController extends Controller
}
/**
* Show a count of assets by status label
*
* @return View
*/
public function getAssetCountByStatuslabel()
{
$colors = [];
$statuslabels = Statuslabel::get();
$labels=[];
$points=[];
foreach ($statuslabels as $statuslabel) {
$labels[]=$statuslabel->name;
$points[]=$statuslabel->assets()->whereNull('assigned_to')->count();
}
$labels[]='Deployed';
$points[]=Asset::whereNotNull('assigned_to')->count();
$result= [
"labels" => $labels,
"datasets" => [ [
"data" => $points,
"backgroundColor" => Helper::chartColors(),
"hoverBackgroundColor" => Helper::chartColors()
]]
];
return $result;
}
/**
* Statuslabel create.
*
@@ -193,7 +227,7 @@ class StatuslabelsController extends Controller
if ($statuslabel->has_assets() > 0) {
// Redirect to the asset management page
return redirect()->to('admin/settings/statuslabels')->with('error', trans('admin/statuslabels/message.assoc_users'));
return redirect()->to('admin/settings/statuslabels')->with('error', trans('admin/statuslabels/message.assoc_assets'));
} else {
$statuslabel->delete();
+80 -65
View File
@@ -1,7 +1,6 @@
<?php
namespace App\Http\Controllers;
use App\Http\Requests\SetupUserRequest;
use App\Http\Requests\AssetFileRequest;
use App\Helpers\Helper;
use App\Models\Accessory;
@@ -13,6 +12,8 @@ use App\Models\Company;
use App\Models\Location;
use App\Models\Setting;
use App\Models\Statuslabel;
use App\Http\Requests\SaveUserRequest;
use App\Http\Requests\UpdateUserRequest;
use App\Models\User;
use Auth;
use Config;
@@ -30,7 +31,8 @@ use Str;
use Symfony\Component\HttpFoundation\JsonResponse;
use URL;
use View;
use Request;
use Illuminate\Http\Request;
/**
* This controller handles all actions related to Users for
@@ -65,7 +67,6 @@ class UsersController extends Controller
*/
public function getCreate()
{
$user = new User;
$groups = Group::pluck('name', 'id');
@@ -96,31 +97,39 @@ class UsersController extends Controller
* @since [v1.0]
* @return Redirect
*/
public function postCreate(SetupUserRequest $request)
public function postCreate(SaveUserRequest $request)
{
$user = new User;
$user->first_name = $data['first_name']= e(Input::get('first_name'));
$user->last_name = e(Input::get('last_name'));
$user->email = $data['email'] = e(Input::get('email'));
$user->first_name = $data['first_name']= e($request->input('first_name'));
$user->last_name = e($request->input('last_name'));
$user->email = $data['email'] = e($request->input('email'));
$user->activated = 1;
$user->locale = e(Input::get('locale'));
$user->username = $data['username'] = e(Input::get('username'));
$user->password = bcrypt(Input::get('password'));
$data['password'] = Input::get('password');
$user->locale = e($request->input('locale'));
$user->username = $data['username'] = e($request->input('username'));
$user->permissions = json_encode($request->input('permission'));
if ($request->has('password')) {
$user->password = bcrypt($request->input('password'));
$data['password'] = $request->input('password');
}
if ($request->has('groups')) {
$user->groups()->sync($request->input('groups'));
} else {
$user->groups()->sync(array());
}
if ($user->save()) {
if (Input::has('groups')) {
$user->groups()->sync(Input::get('groups'));
}
if ((Input::get('email_user') == 1) && (Input::has('email'))) {
if (($request->input('email_user') == 1) && ($request->has('email'))) {
// Send the credentials through email
$data = array();
$data['email'] = e(Input::get('email'));
$data['username'] = e(Input::get('username'));
$data['first_name'] = e(Input::get('first_name'));
$data['password'] = e(Input::get('password'));
$data['email'] = e($request->input('email'));
$data['username'] = e($request->input('username'));
$data['first_name'] = e($request->input('first_name'));
$data['password'] = e($request->input('password'));
Mail::send('emails.send-login', $data, function ($m) use ($user) {
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
@@ -128,27 +137,41 @@ class UsersController extends Controller
});
}
return redirect::route('users')->with('success', trans('admin/users/message.success.create'));
} else {
redirect()->back()->withInput()->withInput()->withErrors($user->getErrors())->withErrors($settings->getErrors());
}
return redirect()->route('create/user')->withInput()->with('error', $error);
return redirect()->back()->withInput()->withErrors($user->getErrors());
}
/**
* JSON handler for creating a user through a modal popup
*
* @todo Handle validation more graciously
* @author [B. Wetherington] [<uberbrady@gmail.com>]
* @since [v1.8]
* @return string JSON
*/
public function store()
{
$user = new User;
$user = new User;
$inputs = Input::except('csrf_token', 'password_confirm', 'groups', 'email_user');
$inputs['activated'] = true;
$user->first_name = e(Input::get('first_name'));
$user->last_name = e(Input::get('last_name'));
$user->username = e(Input::get('username'));
$user->email = e(Input::get('email'));
if (Input::has('password')) {
$user->password = bcrypt(Input::get('password'));
}
$user->activated = true;
// Was the user created?
if ($user->save()) {
@@ -157,6 +180,7 @@ class UsersController extends Controller
$data = array();
$data['email'] = e(Input::get('email'));
$data['first_name'] = e(Input::get('first_name'));
$data['last_name'] = e(Input::get('last_name'));
$data['password'] = e(Input::get('password'));
Mail::send('emails.send-login', $data, function ($m) use ($user) {
@@ -170,7 +194,6 @@ class UsersController extends Controller
} else {
return JsonResponse::create(["error" => "Failed validation: " . print_r($user->getErrors(), true)], 500);
}
return JsonResponse::create(["error" => "Couldn't save User"], 500);
@@ -227,12 +250,11 @@ class UsersController extends Controller
* @param int $id
* @return Redirect
*/
public function postEdit($id = null)
public function postEdit(UpdateUserRequest $request, $id = null)
{
// We need to reverse the UI specific logic for our
// permissions here before we update the user.
$permissions = Input::get('permissions', array());
//$this->decodePermissions($permissions);
$permissions = $request->input('permissions', array());
app('request')->request->set('permissions', $permissions);
// Only update the email address if locking is set to false
@@ -255,26 +277,31 @@ class UsersController extends Controller
return redirect()->route('users')->with('error', $error);
}
$user_groups = array ($request->input('groups'));
// Update the user
$user->first_name = e(Input::get('first_name'));
$user->last_name = e(Input::get('last_name'));
$user->locale = e(Input::get('locale'));
$user->first_name = e($request->input('first_name'));
$user->last_name = e($request->input('last_name'));
$user->locale = e($request->input('locale'));
if (Input::has('username')) {
$user->username = e(Input::get('username'));
$user->username = e($request->input('username'));
}
$user->email = e($request->input('email'));
$user->employee_num = e($request->input('employee_num'));
$user->activated = e($request->input('activated', $user->activated));
$user->jobtitle = e($request->input('jobtitle'));
$user->phone = e($request->input('phone'));
$user->location_id = e($request->input('location_id'));
$user->company_id = e(Company::getIdForUser($request->input('company_id')));
$user->manager_id = e($request->input('manager_id'));
$user->notes = e($request->input('notes'));
$user->permissions = json_encode($request->input('permission'));
if ($request->has('groups')) {
$user->groups()->sync($request->input('groups'));
} else {
$user->groups()->sync(array());
}
$user->email = e(Input::get('email'));
$user->employee_num = e(Input::get('employee_num'));
$user->activated = e(Input::get('activated', $user->activated));
$user->jobtitle = e(Input::get('jobtitle'));
$user->phone = e(Input::get('phone'));
$user->location_id = e(Input::get('location_id'));
$user->company_id = e(Company::getIdForUser(Input::get('company_id')));
$user->manager_id = e(Input::get('manager_id'));
$user->notes = e(Input::get('notes'));
$user->permissions = json_encode(Input::get('permission'));
$user->groups()->sync(Input::get('groups'));
if ($user->manager_id == "") {
$user->manager_id = null;
@@ -286,13 +313,13 @@ class UsersController extends Controller
// Do we want to update the user password?
if ((Input::has('password')) && (!config('app.lock_passwords'))) {
$user->password = bcrypt(Input::get('password'));
if (($request->has('password')) && (!config('app.lock_passwords'))) {
$user->password = bcrypt($request->input('password'));
}
// Do we want to update the user email?
if (!config('app.lock_passwords')) {
$user->email = Input::get('email');
$user->email = e($request->input('email'));
}
@@ -642,14 +669,13 @@ class UsersController extends Controller
$user->id = null;
// Get this user groups
$userGroups = $user_to_clone->groups()->lists('group_id', 'name');
$userGroups = $user_to_clone->groups()->lists('name', 'id');
// Get this user permissions
$userPermissions = null;
//$this->encodePermissions($userPermissions);
// Get a list of all the available groups
//$groups = Sentry::getGroupProvider()->findAll();
$groups = Group::pluck('name', 'id');
// Get all the available permissions
$permissions = config('permissions');
@@ -657,13 +683,7 @@ class UsersController extends Controller
$location_list = Helper::locationsList();
$company_list = Helper::companyList();
$manager_list = array('' => 'Select a User') + DB::table('users')
->select(DB::raw('concat(last_name,", ",first_name," (",email,")") as full_name, id'))
->whereNull('deleted_at')
->where('id', '!=', $id)
->orderBy('last_name', 'asc')
->orderBy('first_name', 'asc')
->lists('full_name', 'id');
$manager_list = Helper::managerList();
// Show the page
return View::make('users/edit', compact('groups', 'userGroups', 'permissions', 'userPermissions'))
@@ -671,6 +691,8 @@ class UsersController extends Controller
->with('company_list', $company_list)
->with('manager_list', $manager_list)
->with('user', $user)
->with('groups',$groups)
->with('userGroups',$userGroups)
->with('clone_user', $user_to_clone);
} catch (UserNotFoundException $e) {
// Prepare the error message
@@ -761,7 +783,7 @@ class UsersController extends Controller
'last_name' => trim(e($row[1])),
'username' => trim(e($row[2])),
'email' => trim(e($row[3])),
'password' => $pass,
'password' => bcrypt($pass),
'activated' => $activated,
'location_id' => trim(e($user_location_id)),
'phone' => trim(e($row[5])),
@@ -771,17 +793,10 @@ class UsersController extends Controller
'permissions' => '{"user":1}',
'notes' => 'Imported user'
);
//dd($newuser);
DB::table('users')->insert($newuser);
$updateuser = User::find($row[2]);
// Update the user details
$updateuser->password = $pass;
// Update the user
$updateuser->save();
if (((Input::get('email_user') == 1) && !config('app.lock_passwords'))) {
// Send the credentials through email
+29 -11
View File
@@ -6,6 +6,7 @@ use App\Models\Actionlog;
use App\Models\Asset;
use App\Models\Company;
use App\Models\Consumable;
use App\Models\Component;
use App\Models\Location;
use App\Models\Setting;
use App\Models\User;
@@ -58,7 +59,7 @@ class ViewAssetsController extends Controller
public function getRequestableIndex()
{
$assets = Asset::with('model', 'defaultLoc')->Hardware()->RequestableAssets()->get();
$assets = Asset::with('model', 'defaultLoc', 'assetloc','assigneduser')->Hardware()->RequestableAssets()->get();
return View::make('account/requestable-assets', compact('user', 'assets'));
}
@@ -142,11 +143,12 @@ class ViewAssetsController extends Controller
public function getAcceptAsset($logID = null)
{
if (is_null($findlog = Actionlog::find($logID))) {
// Redirect to the asset management page
return redirect()->to('account')->with('error', trans('admin/hardware/message.does_not_exist'));
if (!$findlog = DB::table('asset_logs')->where('id','=',$logID)->first()) {
echo 'no record';
//return redirect()->to('account')->with('error', trans('admin/hardware/message.does_not_exist'));
}
$user = Auth::user();
if ($user->id != $findlog->checkedout_to) {
@@ -163,6 +165,12 @@ class ViewAssetsController extends Controller
// accessories
} elseif ($findlog->accessory_id!='') {
$item = Accessory::find($findlog->accessory_id);
// consumable
} elseif ($findlog->consumable_id!='') {
$item = Consumable::find($findlog->consumable_id);
// components
} elseif ($findlog->component_id!='') {
$item = Component::find($findlog->component_id);
}
// Check if the asset exists
@@ -181,16 +189,11 @@ class ViewAssetsController extends Controller
{
// Check if the asset exists
if (is_null($findlog = Actionlog::find($logID))) {
if (is_null($findlog = DB::table('asset_logs')->where('id','=',$logID)->first())) {
// Redirect to the asset management page
return redirect()->to('account/view-assets')->with('error', trans('admin/hardware/message.does_not_exist'));
}
// NOTE: make sure the global scope is applied
$is_unauthorized = is_null(Actionlog::where('id', '=', $logID)->first());
if ($is_unauthorized) {
return redirect()->route('requestable-assets')->with('error', trans('general.insufficient_permissions'));
}
if ($findlog->accepted_id!='') {
// Redirect to the asset management page
@@ -236,13 +239,28 @@ class ViewAssetsController extends Controller
} elseif (($findlog->asset_id!='') && ($findlog->asset_type=='software')) {
$logaction->asset_id = $findlog->asset_id;
$logaction->accessory_id = null;
$logaction->component_id = null;
$logaction->asset_type = 'software';
// accessories
} elseif ($findlog->accessory_id!='') {
$logaction->asset_id = null;
$logaction->component_id = null;
$logaction->accessory_id = $findlog->accessory_id;
$logaction->asset_type = 'accessory';
// accessories
} elseif ($findlog->consumable_id!='') {
$logaction->asset_id = null;
$logaction->accessory_id = null;
$logaction->component_id = null;
$logaction->consumable_id = $findlog->consumable_id;
$logaction->asset_type = 'consumable';
} elseif ($findlog->component_id!='') {
$logaction->asset_id = null;
$logaction->accessory_id = null;
$logaction->consumable_id = null;
$logaction->component_id = $findlog->component_id;
$logaction->asset_type = 'component';
}
$logaction->checkedout_to = $findlog->checkedout_to;
+8 -4
View File
@@ -5,6 +5,7 @@ namespace App\Http\Middleware;
use Closure;
use Config;
use Route;
use Gate;
class CheckPermissions
{
@@ -13,19 +14,22 @@ class CheckPermissions
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @param string|null $section
* @return mixed
*/
public function handle($request, Closure $next, $section = null, $guard = null)
public function handle($request, Closure $next, $section = null)
{
if (($request->user()->hasAccess($section)) || ($request->user()->isSuperUser())) {
if (Gate::allows($section)) {
return $next($request);
}
return response()->view('layouts/basic', [
'content' => view('errors/403')
'content' => view('errors/403')
]);
}
}
+8 -6
View File
@@ -4,7 +4,7 @@ namespace App\Http\Requests;
use App\Http\Requests\Request;
use App\Models\AssetModel;
use Session;
class AssetRequest extends Request
{
/**
@@ -31,11 +31,11 @@ class AssetRequest extends Request
'company_id' => 'integer',
'warranty_months' => 'integer|min:0|max:240',
'physical' => 'integer',
'checkout_date' => 'date|max:10|min:10',
'checkin_date' => 'date|max:10|min:10',
'checkout_date' => 'date',
'checkin_date' => 'date',
'supplier_id' => 'integer',
'asset_tag' => 'required|min:2|max:255|unique:assets,asset_tag,NULL,deleted_at',
'status' => 'integer',
'asset_tag' => 'required',
];
$model = AssetModel::find($this->request->get('model_id'));
@@ -46,13 +46,15 @@ class AssetRequest extends Request
}
return $rules;
}
public function response(array $errors)
{
return $this->redirector->back()->withInput()->withErrors($errors, $this->errorBag);
$this->session()->flash('errors', Session::get('errors', new \Illuminate\Support\ViewErrorBag)
->put('default', new \Illuminate\Support\MessageBag($errors)));
\Input::flash();
return parent::response($errors);
}
}
+5 -5
View File
@@ -13,9 +13,9 @@ abstract class Request extends FormRequest
return $this->rules;
}
public function response(array $errors)
{
$this->session->flash('errorMessages', $errors);
return $this->redirector->back()->withErrors($errors)->withInput();
}
// public function response(array $errors)
// {
// $this->session->flash('errorMessages', $errors);
// return $this->redirector->back()->withErrors($errors)->withInput();
// }
}
+35
View File
@@ -0,0 +1,35 @@
<?php
namespace App\Http\Requests;
use App\Http\Requests\Request;
class SaveUserRequest extends Request
{
/**
* 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()
{
return [
'first_name' => 'required|string|min:1',
'last_name' => 'required|string|min:1',
'username' => 'required|string|min:2|unique:users,username,NULL,deleted_at',
'email' => 'email',
'password' => 'required|min:6',
'password_confirm' => 'sometimes|required_with:password',
];
}
}
-64
View File
@@ -1,64 +0,0 @@
<?php
namespace App\Http\Requests;
use App\Http\Requests\Request;
class SettingRequest extends Request
{
/**
* 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()
{
return [
"brand" => 'required|min:1|numeric',
"qr_text" => 'min:1|max:31',
"logo_img" => 'mimes:jpeg,bmp,png,gif',
"custom_css" => 'string',
"alert_email" => 'email_array',
"slack_endpoint" => 'url',
"default_currency" => 'required',
"locale" => 'required',
"slack_channel" => 'regex:/(?<!\w)#\w+/',
"slack_botname" => 'string',
'labels_per_page' => 'numeric',
'labels_width' => 'numeric',
'labels_height' => 'numeric',
'labels_pmargin_left' => 'numeric',
'labels_pmargin_right' => 'numeric',
'labels_pmargin_top' => 'numeric',
'labels_pmargin_bottom' => 'numeric',
'labels_display_bgutter' => 'numeric',
'labels_display_sgutter' => 'numeric',
'labels_fontsize' => 'numeric|min:5',
'labels_pagewidth' => 'numeric',
'labels_pageheight' => 'numeric',
"ldap_server" => 'sometimes|required_if:ldap_enabled,1|url',
"ldap_uname" => 'sometimes|required_if:ldap_enabled,1',
"ldap_basedn" => 'sometimes|required_if:ldap_enabled,1',
"ldap_filter" => 'sometimes|required_if:ldap_enabled,1',
"ldap_username_field" => 'sometimes|required_if:ldap_enabled,1',
"ldap_lname_field" => 'sometimes|required_if:ldap_enabled,1',
"ldap_auth_filter_query" => 'sometimes|required_if:ldap_enabled,1',
"ldap_version" => 'sometimes|required_if:ldap_enabled,1',
];
}
public function response(array $errors)
{
return $this->redirector->back()->withInput()->withErrors($errors, $this->errorBag);
}
}
+2 -2
View File
@@ -24,14 +24,14 @@ class SetupUserRequest extends Request
public function rules()
{
return [
'site_name' => 'required|string|min:1',
'first_name' => 'required|string|min:1',
'last_name' => 'required|string|min:1',
'location_id' => 'numeric',
'username' => 'required|string|min:2|unique:users,username,NULL,deleted_at',
'email' => 'email|unique:users,email',
'password' => 'required|min:6',
'password_confirm' => 'required|min:6|same:password',
'company_id' => 'integer',
'email_domain' => 'required|min:4',
];
}
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Http\Requests;
use App\Http\Requests\Request;
class UpdateUserRequest extends Request
{
/**
* 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()
{
return [
'first_name' => 'required|string|min:1',
'last_name' => 'required|string|min:1',
'email' => 'email',
'password_confirm' => 'sometimes|required_with:password',
];
}
}
+16 -12
View File
@@ -10,7 +10,7 @@ use App\Models\Location;
Route::group([ 'prefix' => 'api', 'middleware' => 'auth' ], function () {
/*---Hardware API---*/
Route::group([ 'prefix' => 'hardware','middleware' => ['web','auth','authorize:hardware']], function () {
Route::group([ 'prefix' => 'hardware','middleware' => ['web','auth','authorize:assets.view']], function () {
Route::get('list/{status?}', [ 'as' => 'api.hardware.list', 'uses' => 'AssetsController@getDatatable' ]);
@@ -35,6 +35,7 @@ Route::group([ 'prefix' => 'api', 'middleware' => 'auth' ], function () {
});
Route::get('list', [ 'as' => 'api.statuslabels.list', 'uses' => 'StatuslabelsController@getDatatable' ]);
Route::get('assets', [ 'as' => 'api.statuslabels.assets', 'uses' => 'StatuslabelsController@getAssetCountByStatuslabel' ]);
});
@@ -161,7 +162,6 @@ Route::group([ 'prefix' => 'api', 'middleware' => 'auth' ], function () {
);
});
});
/*
@@ -177,7 +177,7 @@ Route::group(
[ 'prefix' => 'hardware',
'middleware' => ['web',
'auth',
'authorize:hardware']],
'authorize:assets.view']],
function () {
Route::get('create/{model?}', [
@@ -194,6 +194,10 @@ Route::group(
'as' => 'update/hardware',
'uses' => 'AssetsController@getEdit'
]);
Route::get('/bytag', [
'as' => 'findbytag/hardware',
'uses' => 'AssetsController@getAssetByTag'
]);
Route::get('{assetId}/clone', [ 'as' => 'clone/hardware', 'uses' => 'AssetsController@getClone' ]);
Route::post('{assetId}/clone', 'AssetsController@postCreate');
@@ -296,10 +300,10 @@ Route::group(
|
*/
Route::group([ 'prefix' => 'admin','middleware' => ['web','auth','authorize:admin']], function () {
Route::group([ 'prefix' => 'admin','middleware' => ['web','auth']], function () {
# Licenses
Route::group([ 'prefix' => 'licenses' ], function () {
Route::group([ 'prefix' => 'licenses', 'middleware'=>'authorize:licenses.view' ], function () {
Route::get('create', [ 'as' => 'create/licenses', 'uses' => 'LicensesController@getCreate' ]);
Route::post('create', 'LicensesController@postCreate');
@@ -339,7 +343,7 @@ Route::group([ 'prefix' => 'admin','middleware' => ['web','auth','authorize:admi
});
# Asset Maintenances
Route::group([ 'prefix' => 'asset_maintenances' ], function () {
Route::group([ 'prefix' => 'asset_maintenances', 'middleware'=>'authorize:assets.view' ], function () {
Route::get(
'create/{assetId?}',
@@ -363,7 +367,7 @@ Route::group([ 'prefix' => 'admin','middleware' => ['web','auth','authorize:admi
});
# Accessories
Route::group([ 'prefix' => 'accessories' ], function () {
Route::group([ 'prefix' => 'accessories', 'middleware'=>'authorize:accessories.view' ], function () {
Route::get('create', [ 'as' => 'create/accessory', 'uses' => 'AccessoriesController@getCreate' ]);
Route::post('create', 'AccessoriesController@postCreate');
@@ -392,7 +396,7 @@ Route::group([ 'prefix' => 'admin','middleware' => ['web','auth','authorize:admi
});
# Consumables
Route::group([ 'prefix' => 'consumables' ], function () {
Route::group([ 'prefix' => 'consumables', 'middleware'=>'authorize:consumables.view' ], function () {
Route::get('create', [ 'as' => 'create/consumable', 'uses' => 'ConsumablesController@getCreate' ]);
Route::post('create', 'ConsumablesController@postCreate');
@@ -418,7 +422,7 @@ Route::group([ 'prefix' => 'admin','middleware' => ['web','auth','authorize:admi
});
# Components
Route::group([ 'prefix' => 'components' ], function () {
Route::group([ 'prefix' => 'components', 'middleware'=>'authorize:components.view' ], function () {
Route::get('create', [ 'as' => 'create/component', 'uses' => 'ComponentsController@getCreate' ]);
Route::post('create', 'ComponentsController@postCreate');
@@ -446,7 +450,7 @@ Route::group([ 'prefix' => 'admin','middleware' => ['web','auth','authorize:admi
});
# Admin Settings Routes (for categories, maufactureres, etc)
Route::group([ 'prefix' => 'settings'], function () {
Route::group([ 'prefix' => 'settings', 'middleware'=>'authorize:superuser'], function () {
@@ -722,12 +726,12 @@ Route::group([ 'prefix' => 'account', 'middleware' => ['web', 'auth']], function
);
# Account Dashboard
Route::get('/', [ 'as' => 'account', 'uses' => 'ProfileController@getDashboard' ]);
Route::get('/', [ 'as' => 'account', 'uses' => 'ViewAssetsController@getIndex' ]);
});
Route::group(['middleware' => ['web','auth','authorize:reports']], function () {
Route::group(['middleware' => ['web','auth','authorize:reports.view']], function () {
Route::get(
'reports/depreciation',
+12 -4
View File
@@ -50,7 +50,7 @@ class Asset extends Depreciable
'checkout_date' => 'date|max:10|min:10',
'checkin_date' => 'date|max:10|min:10',
'supplier_id' => 'integer',
'asset_tag' => 'required|min:2|max:255|unique:assets,asset_tag,NULL,deleted_at',
'asset_tag' => 'required|min:1|max:255|unique:assets,asset_tag,NULL,deleted_at',
'status' => 'integer',
];
@@ -97,10 +97,10 @@ class Asset extends Depreciable
if ($this->save()) {
// $action, $admin, $user, $expected_checkin = null, $note = null, $checkout_at = null
$log_id = $this->createLogRecord('checkout', $this, $admin, $user, $expected_checkin, $note, $checkout_at);
$log = $this->createLogRecord('checkout', $this, $admin, $user, $expected_checkin, $note, $checkout_at);
if ((($this->requireAcceptance()=='1') || ($this->getEula())) && ($user->email!='')) {
$this->checkOutNotifyMail($log_id, $user, $checkout_at, $expected_checkin, $note);
$this->checkOutNotifyMail($log->id, $user, $checkout_at, $expected_checkin, $note);
}
if ($settings->slack_endpoint) {
@@ -172,6 +172,14 @@ class Asset extends Depreciable
}
public function getDetailedNameAttribute() {
if($this->assigned_user) {
$user_name = $user->fullName();
} else {
$user_name = "Unassigned";
}
return $this->asset_tag . ' - ' . $this->name . ' (' . $user_name . ') ' . $this->model->name;
}
public function validationRules($id = '0')
{
return $this->rules;
@@ -348,7 +356,7 @@ class Asset extends Depreciable
}
/**
* Get total assets
* Get asset status
*/
public function assetstatus()
{
+6 -6
View File
@@ -3,6 +3,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Watson\Validating\ValidatingTrait;
use Auth;
/**
* Model for Companies.
@@ -14,8 +15,7 @@ final class Company extends Model
protected $table = 'companies';
// Declare the rules for the model validation
protected $rules = ['name' => 'required|min:2|max:255|unique:companies,name'];
protected $rules = ['name' => 'required|min:1|max:255|unique:companies,name'];
/**
* Whether the model should inject it's identifier to the unique
* validation rules before attempting validation. If this property
@@ -102,14 +102,14 @@ final class Company extends Model
} else {
$current_user_company_id = Auth::user()->company_id;
$companyable_company_id = $companyable->company_id;
return ($current_user_company_id == null || $current_user_company_id == $companyable_company_id);
return ($current_user_company_id == null || $current_user_company_id == $companyable_company_id || Auth::user()->isSuperUser());
}
}
public static function isCurrentUserAuthorized()
{
return (!static::isFullMultipleCompanySupportEnabled() || Auth::user()->company_id == null);
return ((!static::isFullMultipleCompanySupportEnabled()) || (Auth::user()->company_id == null) || (Auth::user()->isSuperUser()));
}
public static function canManageUsersCompanies()
@@ -129,7 +129,7 @@ final class Company extends Model
public static function scopeCompanyables($query, $column = 'company_id')
{
if (!static::isFullMultipleCompanySupportEnabled()) {
if (!static::isFullMultipleCompanySupportEnabled() || (Auth::check() && Auth::user()->isSuperUser())) {
return $query;
} else {
return static::scopeCompanyablesDirectly($query, $column);
+31 -20
View File
@@ -11,28 +11,39 @@ class Setting extends Model
use ValidatingTrait;
protected $rules = [
"site_name" => 'required|min:1',
"brand" => 'required|min:1|numeric',
"alert_threshold" => 'numeric',
"alert_interval" => 'numeric',
"qr_text" => 'min:1|max:31',
"custom_css" => 'string',
"slack_endpoint" => 'url',
"default_currency" => 'required',
"slack_channel" => 'regex:/(?<!\w)#\w+/',
"slack_botname" => 'string',
"ldap_server" => 'sometimes|required_if:ldap_enabled,1|url',
"ldap_uname" => 'sometimes|required_if:ldap_enabled,1',
"ldap_pword" => 'sometimes|required_if:ldap_enabled,1',
"ldap_basedn" => 'sometimes|required_if:ldap_enabled,1',
"ldap_filter" => 'sometimes|required_if:ldap_enabled,1',
"ldap_username_field" => 'sometimes|required_if:ldap_enabled,1',
"ldap_lname_field" => 'sometimes|required_if:ldap_enabled,1',
"ldap_auth_filter_query" => 'sometimes|required_if:ldap_enabled,1',
"ldap_version" => 'sometimes|required_if:ldap_enabled,1',
"brand" => 'required|min:1|numeric',
"qr_text" => 'min:1|max:31',
"logo_img" => 'mimes:jpeg,bmp,png,gif',
"custom_css" => 'string',
"alert_email" => 'email_array',
"slack_endpoint" => 'url',
"default_currency" => 'required',
"locale" => 'required',
"slack_channel" => 'regex:/(?<!\w)#\w+/',
"slack_botname" => 'string',
'labels_per_page' => 'numeric',
'labels_width' => 'numeric',
'labels_height' => 'numeric',
'labels_pmargin_left' => 'numeric',
'labels_pmargin_right' => 'numeric',
'labels_pmargin_top' => 'numeric',
'labels_pmargin_bottom' => 'numeric',
'labels_display_bgutter' => 'numeric',
'labels_display_sgutter' => 'numeric',
'labels_fontsize' => 'numeric|min:5',
'labels_pagewidth' => 'numeric',
'labels_pageheight' => 'numeric',
"ldap_server" => 'sometimes|required_if:ldap_enabled,1|url',
"ldap_uname" => 'sometimes|required_if:ldap_enabled,1',
"ldap_basedn" => 'sometimes|required_if:ldap_enabled,1',
"ldap_filter" => 'sometimes|required_if:ldap_enabled,1',
"ldap_username_field" => 'sometimes|required_if:ldap_enabled,1',
"ldap_lname_field" => 'sometimes|required_if:ldap_enabled,1',
"ldap_auth_filter_query" => 'sometimes|required_if:ldap_enabled,1',
"ldap_version" => 'sometimes|required_if:ldap_enabled,1',
];
protected $fillable = ['site_name'];
protected $fillable = ['site_name','email_domain','email_format','username_format'];
public static function getSettings()
{
+16
View File
@@ -23,11 +23,27 @@ class Statuslabel extends Model
protected $fillable = ['name'];
/**
* Show count of assets with status label
*
* @todo Remove this. It's dumb.
* @return \Illuminate\Support\Collection
*/
public function has_assets()
{
return $this->hasMany('\App\Models\Asset', 'status_id')->count();
}
/**
* Get assets with associated status label
*
* @return \Illuminate\Support\Collection
*/
public function assets()
{
return $this->hasMany('\App\Models\Asset', 'status_id');
}
public function getStatuslabelType()
{
+142 -128
View File
@@ -24,48 +24,50 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
protected $fillable = ['first_name', 'last_name', 'email','password','username'];
/**
* Model validation rules
*
* @var array
*/
/**
* Model validation rules
*
* @var array
*/
protected $rules = [
'first_name' => 'required|string|min:1',
'last_name' => 'required|string|min:1',
'username' => 'required|string|min:2|unique:users,username,NULL,deleted_at',
'email' => 'email',
'password' => 'required|min:6',
'first_name' => 'required|string|min:1',
'last_name' => 'required|string|min:1',
'username' => 'required|string|min:2|unique:users,username,NULL,deleted_at',
'email' => 'email',
'password' => 'required|min:6',
];
// This is very coarse and should be changed
public function hasAccess($section)
{
if ($this->isSuperUser()) {
return true;
}
$permitted = false;
$user_groups = $this->groups;
if ($this->permissions=='') {
if (($this->permissions=='') && (count($user_groups) == 0)) {
return false;
}
$user_permissions = json_decode($this->permissions, true);
$user_groups = $this->groups();
if (((array_key_exists($section, $user_permissions)) && ($user_permissions[$section]=='1')) ||
((array_key_exists('admin', $user_permissions)) && ($user_permissions['admin']=='1'))) {
return true;
$user_permissions = json_decode($this->permissions, true);
if (($user_permissions!='') && ((array_key_exists($section, $user_permissions)) && ($user_permissions[$section]=='1')) ) {
$permitted = true;
}
foreach ($user_groups as $user_group) {
$group_permissions = json_decode($user_group->permissions, true);
if (((array_key_exists($section, $group_permissions)) && ($group_permissions[$section]=='1')) ||
((array_key_exists('admin', $group_permissions)) && ($group_permissions['admin']=='1'))) {
return true;
if (((array_key_exists($section, $group_permissions)) && ($group_permissions[$section]=='1'))) {
$permitted = true;
}
}
return false;
return $permitted;
}
public function isSuperUser() {
@@ -73,22 +75,19 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
return false;
}
$group_array = array();
foreach ($this->groups() as $user_group) {
foreach ($this->groups as $user_group) {
$group_permissions = json_decode($user_group->permissions, true);
$group_array[] = $group_permissions;
$group_array = $group_permissions;
if ((array_key_exists('superuser', $group_array)) && ($group_permissions['superuser']=='1')) {
return true;
}
}
if ((array_key_exists('superuser', $user_permissions)) && ($user_permissions['superuser']=='1')) {
return true;
} else {
if ((array_key_exists('superuser', $group_array)) && ($group_array['superuser']=='1')) {
return true;
}
return false;
}
return false;
}
@@ -107,23 +106,32 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
}
/**
* Returns the user full name, it simply concatenates
* the user first and last name.
*
* @return string
*/
/**
* Returns the user full name, it simply concatenates
* the user first and last name.
*
* @return string
*/
public function fullName()
{
return "{$this->first_name} {$this->last_name}";
}
public function getFullNameAttribute()
{
return $this->first_name . " " . $this->last_name;
}
/**
* Returns the user Gravatar image url.
*
* @return string
*/
public function getCompleteNameAttribute()
{
return $this->last_name . ", " . $this->first_name . " (" . $this->username . ")";
}
/**
* Returns the user Gravatar image url.
*
* @return string
*/
public function gravatar()
{
@@ -132,9 +140,9 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
}
if ($this->email) {
// Generate the Gravatar hash
// Generate the Gravatar hash
$gravatar = md5(strtolower(trim($this->email)));
// Return the Gravatar url
// Return the Gravatar url
return "//gravatar.com/avatar/".$gravatar;
}
@@ -142,68 +150,74 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
}
/**
* Get assets assigned to this user
*/
/**
* Get assets assigned to this user
*/
public function assets()
{
return $this->hasMany('\App\Models\Asset', 'assigned_to')->withTrashed();
}
/**
* Get accessories assigned to this user
*/
/**
* Get accessories assigned to this user
*/
public function accessories()
{
return $this->belongsToMany('\App\Models\Accessory', 'accessories_users', 'assigned_to', 'accessory_id')->withPivot('id')->withTrashed();
}
/**
* Get consumables assigned to this user
*/
/**
* Get consumables assigned to this user
*/
public function consumables()
{
return $this->belongsToMany('\App\Models\Consumable', 'consumables_users', 'assigned_to', 'consumable_id')->withPivot('id')->withTrashed();
}
/**
* Get licenses assigned to this user
*/
/**
* Get licenses assigned to this user
*/
public function licenses()
{
return $this->belongsToMany('\App\Models\License', 'license_seats', 'assigned_to', 'license_id')->withPivot('id');
}
/**
* Get action logs for this user
*/
/**
* Get action logs for this user
*/
public function userlog()
{
return $this->hasMany('\App\Models\Actionlog', 'checkedout_to')->orderBy('created_at', 'DESC')->withTrashed();
}
/**
* Get the asset's location based on the assigned user
**/
/**
* Get the asset's location based on the assigned user
**/
public function userloc()
{
return $this->belongsTo('\App\Models\Location', 'location_id')->withTrashed();
}
/**
* Get the user's manager based on the assigned user
**/
/**
* Get the user's manager based on the assigned user
**/
public function manager()
{
return $this->belongsTo('\App\Models\User', 'manager_id')->withTrashed();
}
/**
* Get user groups
*/
/**
* Get user groups
*/
public function groups()
{
return $this->belongsToMany('\App\Models\Group', 'users_groups');
static $static_cache = null;
if (!$static_cache) {
$static_cache = $this->belongsToMany('\App\Models\Group', 'users_groups');
}
return $static_cache;
//return $this->belongsToMany('\App\Models\Group', 'users_groups');
}
@@ -227,16 +241,16 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
return $this->hasMany('\App\Models\Asset', 'id')->withTrashed();
}
/**
* Get uploads for this asset
*/
/**
* Get uploads for this asset
*/
public function uploads()
{
return $this->hasMany('\App\Models\Actionlog', 'asset_id')
->where('asset_type', '=', 'user')
->where('action_type', '=', 'uploaded')
->whereNotNull('filename')
->orderBy('created_at', 'desc');
->where('asset_type', '=', 'user')
->where('action_type', '=', 'uploaded')
->whereNotNull('filename')
->orderBy('created_at', 'desc');
}
public function sentryThrottle()
@@ -254,10 +268,10 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
return $query->whereNull('deleted_at');
}
/**
* Override the SentryUser getPersistCode method for
* multiple logins at one time
**/
/**
* Override the SentryUser getPersistCode method for
* multiple logins at one time
**/
public function getPersistCode()
{
@@ -275,8 +289,8 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
public function scopeMatchEmailOrUsername($query, $user_username, $user_email)
{
return $query->where('email', '=', $user_email)
->orWhere('username', '=', $user_username)
->orWhere('username', '=', $user_email);
->orWhere('username', '=', $user_username)
->orWhere('username', '=', $user_email);
}
@@ -294,7 +308,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
$email_last_name = $last_name;
$user_username = $first_name;
// There is a last name given
// There is a last name given
} else {
$last_name = str_replace($first_name, '', $users_name);
@@ -330,46 +344,46 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
return json_decode($this->permissions, true);
}
/**
* Query builder scope to search on text
*
* @param Illuminate\Database\Query\Builder $query Query builder instance
* @param text $search Search term
*
* @return Illuminate\Database\Query\Builder Modified query builder
*/
/**
* Query builder scope to search on text
*
* @param Illuminate\Database\Query\Builder $query Query builder instance
* @param text $search Search term
*
* @return Illuminate\Database\Query\Builder Modified query builder
*/
public function scopeTextsearch($query, $search)
{
return $query->where(function ($query) use ($search) {
$query->where('users.first_name', 'LIKE', "%$search%")
->orWhere('users.last_name', 'LIKE', "%$search%")
->orWhere('users.email', 'LIKE', "%$search%")
->orWhere('users.username', 'LIKE', "%$search%")
->orWhere('users.notes', 'LIKE', "%$search%")
->orWhere('users.employee_num', 'LIKE', "%$search%")
->orWhere(function ($query) use ($search) {
$query->whereHas('userloc', function ($query) use ($search) {
$query->where('locations.name', 'LIKE', '%'.$search.'%');
});
})
->orWhere('users.last_name', 'LIKE', "%$search%")
->orWhere('users.email', 'LIKE', "%$search%")
->orWhere('users.username', 'LIKE', "%$search%")
->orWhere('users.notes', 'LIKE', "%$search%")
->orWhere('users.employee_num', 'LIKE', "%$search%")
->orWhere(function ($query) use ($search) {
$query->whereHas('userloc', function ($query) use ($search) {
$query->where('locations.name', 'LIKE', '%'.$search.'%');
});
})
// 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."%') ");
});
// 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 builder scope for Deleted users
*
* @param Illuminate\Database\Query\Builder $query Query builder instance
*
* @return Illuminate\Database\Query\Builder Modified query builder
*/
/**
* Query builder scope for Deleted users
*
* @param Illuminate\Database\Query\Builder $query Query builder instance
*
* @return Illuminate\Database\Query\Builder Modified query builder
*/
public function scopeDeleted($query)
{
@@ -377,28 +391,28 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
}
/**
* Query builder scope to order on manager
*
* @param Illuminate\Database\Query\Builder $query Query builder instance
* @param text $order Order
*
* @return Illuminate\Database\Query\Builder Modified query builder
*/
/**
* Query builder scope to order on manager
*
* @param Illuminate\Database\Query\Builder $query Query builder instance
* @param text $order Order
*
* @return Illuminate\Database\Query\Builder Modified query builder
*/
public function scopeOrderManager($query, $order)
{
// Left join here, or it will only return results with parents
// 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);
}
/**
* Query builder scope to order on company
*
* @param Illuminate\Database\Query\Builder $query Query builder instance
* @param text $order Order
*
* @return Illuminate\Database\Query\Builder Modified query builder
*/
/**
* Query builder scope to order on company
*
* @param Illuminate\Database\Query\Builder $query Query builder instance
* @param text $order Order
*
* @return Illuminate\Database\Query\Builder Modified query builder
*/
public function scopeOrderLocation($query, $order)
{
return $query->leftJoin('locations', 'users.location_id', '=', 'locations.id')->orderBy('locations.name', $order);
+244 -2
View File
@@ -13,7 +13,6 @@ class AuthServiceProvider extends ServiceProvider
* @var array
*/
protected $policies = [
'App\Model' => 'App\Policies\ModelPolicy',
];
/**
@@ -26,6 +25,249 @@ class AuthServiceProvider extends ServiceProvider
{
$this->registerPolicies($gate);
//
// --------------------------------
// BEFORE ANYTHING ELSE
// --------------------------------
// If this condition is true, ANYTHING else below will be asssumed
// to be true. This can cause weird blade behavior.
$gate->before(function ($user) {
if ($user->isSuperUser()) {
return true;
}
});
// --------------------------------
// GENERAL GATES
// These control general sections of the admin
// --------------------------------
$gate->define('admin', function ($user) {
if ($user->hasAccess('admin')) {
return true;
}
});
# -----------------------------------------
# Reports
# -----------------------------------------
$gate->define('reports.view', function ($user) {
if ($user->hasAccess('reports.view')) {
return true;
}
});
# -----------------------------------------
# Assets
# -----------------------------------------
$gate->define('assets.view', function ($user) {
if (($user->hasAccess('assets.view')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('assets.view.requestable', function ($user) {
if (($user->hasAccess('assets.view.requestable')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('assets.create', function ($user) {
if (($user->hasAccess('assets.create')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('assets.checkout', function ($user) {
if (($user->hasAccess('assets.checkout')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('assets.checkin', function ($user) {
if (($user->hasAccess('assets.checkin')) || ($user->hasAccess('admin'))) {
return true;
}
});
# -----------------------------------------
# Accessories
# -----------------------------------------
$gate->define('accessories.view', function ($user) {
if (($user->hasAccess('accessories.view')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('accessories.create', function ($user) {
if (($user->hasAccess('accessories.create')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('accessories.edit', function ($user) {
if (($user->hasAccess('accessories.edit')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('accessories.delete', function ($user) {
if (($user->hasAccess('accessories.delete')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('accessories.checkout', function ($user) {
if (($user->hasAccess('accessories.checkout')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('accessories.checkin', function ($user) {
if (($user->hasAccess('accessories.checkin')) || ($user->hasAccess('admin'))) {
return true;
}
});
# -----------------------------------------
# Consumables
# -----------------------------------------
$gate->define('consumables.view', function ($user) {
if (($user->hasAccess('consumables.view')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('consumables.create', function ($user) {
if (($user->hasAccess('consumables.create')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('consumables.edit', function ($user) {
if (($user->hasAccess('consumables.edit')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('consumables.delete', function ($user) {
if (($user->hasAccess('consumables.delete')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('consumables.checkout', function ($user) {
if (($user->hasAccess('consumables.checkout')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('consumables.checkin', function ($user) {
if (($user->hasAccess('consumables.checkin')) || ($user->hasAccess('admin'))) {
return true;
}
});
# -----------------------------------------
# Users
# -----------------------------------------
$gate->define('users.view', function ($user) {
if (($user->hasAccess('users.view')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('users.create', function ($user) {
if (($user->hasAccess('users.create')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('users.edit', function ($user) {
if (($user->hasAccess('users.edit')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('users.delete', function ($user) {
if (($user->hasAccess('users.delete')) || ($user->hasAccess('admin'))) {
return true;
}
});
# -----------------------------------------
# Components
# -----------------------------------------
$gate->define('components.view', function ($user) {
if (($user->hasAccess('components.create')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('components.create', function ($user) {
if (($user->hasAccess('components.create')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('components.edit', function ($user) {
if (($user->hasAccess('components.edit')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('components.delete', function ($user) {
if (($user->hasAccess('components.delete')) || ($user->hasAccess('admin'))) {
return true;
}
});
# -----------------------------------------
# Licenses
# -----------------------------------------
$gate->define('licenses.view', function ($user) {
if (($user->hasAccess('licenses.view')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('licenses.create', function ($user) {
if (($user->hasAccess('licenses.create')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('licenses.edit', function ($user) {
if (($user->hasAccess('licenses.edit')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('licenses.delete', function ($user) {
if (($user->hasAccess('licenses.delete')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('licenses.checkout', function ($user) {
if (($user->hasAccess('licenses.checkout')) || ($user->hasAccess('admin'))) {
return true;
}
});
$gate->define('licenses.checkin', function ($user) {
if (($user->hasAccess('licenses.checkin')) || ($user->hasAccess('admin'))) {
return true;
}
});
}
}
+4 -4
View File
@@ -99,8 +99,8 @@ return array(
'logs' => false, // Add the latest log messages
'files' => false, // Show the included files
'config' => false, // Display config settings
'auth' => false, // Display Laravel authentication status
'gate' => false, // Display Laravel Gate checks
'auth' => true, // Display Laravel authentication status
'gate' => true, // Display Laravel Gate checks
'session' => true, // Display session data
),
@@ -119,8 +119,8 @@ return array(
),
'db' => array(
'with_params' => true, // Render SQL with the parameters substituted
'timeline' => false, // Add the queries to the timeline
'backtrace' => false, // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.
'timeline' => true, // Add the queries to the timeline
'backtrace' => true, // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.
'explain' => array( // EXPERIMENTAL: Show EXPLAIN output on queries
'enabled' => false,
'types' => array('SELECT'), // array('SELECT', 'INSERT', 'UPDATE', 'DELETE'); for MySQL 5.6.3+
+68 -28
View File
@@ -6,7 +6,7 @@ return array(
array(
'permission' => 'superuser',
'label' => 'Super User',
'note' => 'Determines whether the user has full access to all aspects of the admin. ',
'note' => 'Determines whether the user has full access to all aspects of the admin. This setting overrides any more specific permissions throughout the system. ',
'display' => true,
),
),
@@ -15,16 +15,22 @@ return array(
array(
'permission' => 'admin',
'label' => '',
'note' => 'Determines whether the user has access to most aspects of the admin.',
'note' => 'Determines whether the user has access to most aspects of the admin. ',
'display' => true,
),
array(
'permission' => 'admin.api_key',
'label' => 'Create API Key',
'note' => 'Determines whether the user can access the API via API key.',
'display' => false,
),
),
'Reports' => array(
array(
'permission' => 'reports.view',
'label' => '',
'note' => 'Determines whether the user has the abiity to view reports.',
'label' => 'View',
'note' => 'Determines whether the user has the ability to view reports.',
'display' => true,
),
),
@@ -32,64 +38,92 @@ return array(
'Assets' => array(
array(
'permission' => 'assets.view',
'label' => '',
'label' => 'View ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'assets.create',
'label' => 'Create Assets',
'label' => 'Create ',
'note' => '',
'display' => false,
),
array(
'permission' => 'assets.edit',
'label' => 'Edit Assets',
'label' => 'Edit ',
'note' => '',
'display' => false,
),
array(
'permission' => 'assets.delete',
'label' => 'Delete Assets',
'label' => 'Delete ',
'note' => '',
'display' => false,
),
array(
'permission' => 'assets.checkout',
'label' => 'View Assets',
'label' => 'Checkout ',
'note' => '',
'display' => false,
),
array(
'permission' => 'assets.checkin',
'label' => 'Checkin ',
'note' => '',
'display' => false,
),
array(
'permission' => 'assets.audit',
'label' => 'Audit ',
'note' => '',
'display' => false,
),
array(
'permission' => 'assets.view.requestable',
'label' => 'View Requestable Assets',
'note' => '',
'display' => true,
),
),
'Accessories' => array(
array(
'permission' => 'accessories.view',
'label' => '',
'label' => 'View ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'accessory.create',
'label' => 'Create Assets',
'label' => 'Create ',
'note' => '',
'display' => false,
),
array(
'permission' => 'accessories.edit',
'label' => 'Edit Assets',
'label' => 'Edit ',
'note' => '',
'display' => false,
),
array(
'permission' => 'accessories.delete',
'label' => 'Delete Assets',
'label' => 'Delete ',
'note' => '',
'display' => false,
),
array(
'permission' => 'accessories.checkout',
'label' => 'View Assets',
'label' => 'Checkout ',
'note' => '',
'display' => false,
),
array(
'permission' => 'accessories.checkin',
'label' => 'Checkin ',
'note' => '',
'display' => false,
),
@@ -98,31 +132,31 @@ return array(
'Consumables' => array(
array(
'permission' => 'consumables.view',
'label' => '',
'label' => 'View',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'consumables.create',
'label' => 'Create Consumables',
'label' => 'Create ',
'note' => '',
'display' => false,
),
array(
'permission' => 'consumables.edit',
'label' => 'Edit Consumables',
'label' => 'Edit ',
'note' => '',
'display' => false,
),
array(
'permission' => 'consumables.delete',
'label' => 'Delete Consumables',
'label' => 'Delete ',
'note' => '',
'display' => false,
),
array(
'permission' => 'consumables.checkout',
'label' => 'Checkout Consumables',
'label' => 'Checkout ',
'note' => '',
'display' => false,
),
@@ -132,9 +166,9 @@ return array(
'Licenses' => array(
array(
'permission' => 'licenses.view',
'label' => '',
'label' => 'View',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'licenses.create',
@@ -172,9 +206,9 @@ return array(
'Components' => array(
array(
'permission' => 'components.view',
'label' => '',
'label' => 'View',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'components.create',
@@ -200,15 +234,21 @@ return array(
'note' => '',
'display' => false,
),
array(
'permission' => 'components.checkin',
'label' => 'Checkin Components',
'note' => '',
'display' => false,
),
),
'Users' => array(
array(
'permission' => 'users.view',
'label' => 'View Users',
'label' => 'View ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'users.create',
+2 -2
View File
@@ -1,5 +1,5 @@
<?php
return array (
'app_version' => 'v3.0.0-dev',
'hash_version' => 'v3.0.0-dev-g6d810a9',
'app_version' => 'v3.0.0-dev-3',
'hash_version' => 'v3.0.0-dev-3-g6d810a9',
);
@@ -2,6 +2,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use App\Models\Actionlog;
class AddThreadIdToAssetLogsTable extends Migration
{
@@ -14,8 +14,8 @@ class RemoveOptionKeysFromSettingsTable extends Migration
{
Schema::table('settings', function (Blueprint $table) {
//
$table->dropColumn('option_name');
$table->dropColumn('option_value');
if(Schema::hasColumn('settings', 'option_name'))
$table->dropColumn('option_name');
});
}
@@ -28,6 +28,7 @@ class RemoveOptionKeysFromSettingsTable extends Migration
{
Schema::table('Settings', function (Blueprint $table) {
//
$table->string('option_name')->nullable();
});
}
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RemoveOptionValueFromSettingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
//
if(Schema::hasColumn('settings', 'option_value'))
$table->dropColumn('option_value');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::table('settings', function (Blueprint $table) {
$table->string('option_value')->nullable();
});
}
}
@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddEmailDomainAndFormatToSettings extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
$table->string('email_domain')->nullable()->default(NULL);
$table->string('email_format')->nullable()->default('filastname');
$table->string('username_format')->nullable()->default('filastname');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function ($table) {
$table->dropColumn(
'email_domain',
'email_format',
'username_format'
);
});
}
}
+59
View File
@@ -0,0 +1,59 @@
# --------------------------------------------
# REQUIRED: BASIC APP SETTINGS
# --------------------------------------------
#APP_ENV=develop
#APP_DEBUG=false
#APP_KEY=Change_this_key_or_snipe_will_get_ya
#APP_URL=http://127.0.0.1:32782
#APP_TIMEZONE=US/Pacific
#APP_LOCALE=en
# --------------------------------------------
# REQUIRED: DATABASE SETTINGS
# --------------------------------------------
DB_CONNECTION=mysql
DB_HOST=${MYSQL_PORT_3306_TCP_ADDR}
DB_DATABASE=${MYSQL_DATABASE}
DB_USERNAME=${MYSQL_USER}
DB_PASSWORD=${MYSQL_PASSWORD}
DB_PREFIX=null
# --------------------------------------------
# REQUIRED: OUTGOING MAIL SERVER SETTINGS
# --------------------------------------------
MAIL_DRIVER=smtp
MAIL_HOST=${MAIL_PORT_587_TCP_ADDR}
MAIL_PORT=${MAIL_PORT_587_TCP_PORT}
MAIL_USERNAME=${MAIL_ENV_USERNAME}
MAIL_PASSWORD=${MAIL_ENV_PASSWORD}
MAIL_ENCRYPTION=${MAIL_ENV_ENCRYPTION}
MAIL_FROM_ADDR=${MAIL_ENV_FROM_ADDR}
MAIL_FROM_NAME=${MAIL_ENV_FROM_NAME}
# --------------------------------------------
# REQUIRED: IMAGE LIBRARY
# This should be gd or imagick
# --------------------------------------------
IMAGE_LIB=gd
# --------------------------------------------
# OPTIONAL: SESSION SETTINGS
# --------------------------------------------
SESSION_LIFETIME=12000
EXPIRE_ON_CLOSE=false
ENCRYPT=false
COOKIE_NAME=snipeit_session
COOKIE_DOMAIN=null
SECURE_COOKIES=false
# --------------------------------------------
# OPTIONAL: CACHE SETTINGS
# --------------------------------------------
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
+35 -400
View File
@@ -57,7 +57,6 @@ body {
.content-wrapper,
.right-side,
.main-footer {
transition: -webkit-transform 0.3s ease-in-out, margin 0.3s ease-in-out;
transition: transform 0.3s ease-in-out, margin 0.3s ease-in-out;
margin-left: 230px;
z-index: 820;
@@ -85,7 +84,6 @@ body {
.sidebar-open .content-wrapper,
.sidebar-open .right-side,
.sidebar-open .main-footer {
-webkit-transform: translate(230px, 0);
transform: translate(230px, 0);
}
}
@@ -399,6 +397,21 @@ a:focus {
right: 40px;
}
}
@media (max-width: 991px) {
.content-header {
padding-top: 110px;
}
}
@media (max-width: 991px) {
ul.sidebar-menu {
padding-top: 120px;
}
}
@media (max-width: 991px) {
.sidebar-toggle-mobile a {
color: white;
}
}
/*
* Component: Sidebar
* ------------------
@@ -412,7 +425,6 @@ a:focus {
min-height: 100%;
width: 230px;
z-index: 810;
transition: -webkit-transform 0.3s ease-in-out, width 0.3s ease-in-out;
transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
}
@media (max-width: 767px) {
@@ -424,21 +436,18 @@ a:focus {
@media (max-width: 767px) {
.main-sidebar,
.left-side {
-webkit-transform: translate(-230px, 0);
transform: translate(-230px, 0);
}
}
@media (min-width: 768px) {
.sidebar-collapse .main-sidebar,
.sidebar-collapse .left-side {
-webkit-transform: translate(-230px, 0);
transform: translate(-230px, 0);
}
}
@media (max-width: 767px) {
.sidebar-open .main-sidebar,
.sidebar-open .left-side {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
}
@@ -524,7 +533,6 @@ a:focus {
margin-top: 3px;
}
.sidebar-menu li.active > a > .fa-angle-left {
-webkit-transform: rotate(-90deg);
transform: rotate(-90deg);
}
.sidebar-menu li.active > .treeview-menu {
@@ -568,7 +576,6 @@ a:focus {
z-index: 840;
}
.sidebar-mini.sidebar-collapse .main-sidebar {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
width: 50px!important;
z-index: 850;
@@ -1135,58 +1142,30 @@ a:focus {
/* Add fade animation to dropdown menus by appending
the class .animated-dropdown-menu to the .dropdown-menu ul (or ol)*/
.open:not(.dropup) > .animated-dropdown-menu {
-webkit-backface-visibility: visible !important;
backface-visibility: visible !important;
-webkit-animation: flipInX 0.7s both;
animation: flipInX 0.7s both;
}
@keyframes flipInX {
0% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
transition-timing-function: ease-in;
opacity: 0;
}
40% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
transition-timing-function: ease-in;
}
60% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
opacity: 1;
}
80% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
}
100% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
}
@-webkit-keyframes flipInX {
0% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
-webkit-transition-timing-function: ease-in;
opacity: 0;
}
40% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
-webkit-transition-timing-function: ease-in;
}
60% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
opacity: 1;
}
80% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
}
100% {
-webkit-transform: perspective(400px);
}
}
/* Fix dropdown menu in navbars */
.navbar-custom-menu > .navbar-nav > li {
position: relative;
@@ -2029,102 +2008,6 @@ a:focus {
.progress-description {
margin: 0;
}
/*
* Component: Timeline
* -------------------
*/
.timeline {
position: relative;
margin: 0 0 30px 0;
padding: 0;
list-style: none;
}
.timeline:before {
content: '';
position: absolute;
top: 0;
bottom: 0;
width: 4px;
background: #ddd;
left: 31px;
margin: 0;
border-radius: 2px;
}
.timeline > li {
position: relative;
margin-right: 10px;
margin-bottom: 15px;
}
.timeline > li:before,
.timeline > li:after {
content: " ";
display: table;
}
.timeline > li:after {
clear: both;
}
.timeline > li > .timeline-item {
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
border-radius: 3px;
margin-top: 0;
background: #fff;
color: #444;
margin-left: 60px;
margin-right: 15px;
padding: 0;
position: relative;
}
.timeline > li > .timeline-item > .time {
color: #999;
float: right;
padding: 10px;
font-size: 12px;
}
.timeline > li > .timeline-item > .timeline-header {
margin: 0;
color: #555;
border-bottom: 1px solid #f4f4f4;
padding: 10px;
font-size: 16px;
line-height: 1.1;
}
.timeline > li > .timeline-item > .timeline-header > a {
font-weight: 600;
}
.timeline > li > .timeline-item > .timeline-body,
.timeline > li > .timeline-item > .timeline-footer {
padding: 10px;
}
.timeline > li > .fa,
.timeline > li > .glyphicon,
.timeline > li > .ion {
width: 30px;
height: 30px;
font-size: 15px;
line-height: 30px;
position: absolute;
color: #666;
background: #d2d6de;
border-radius: 50%;
text-align: center;
left: 18px;
top: 0;
}
.timeline > .time-label > span {
font-weight: 600;
padding: 5px;
display: inline-block;
background-color: #fff;
border-radius: 4px;
}
.timeline-inverse > li > .timeline-item {
background: #f0f0f0;
border: 1px solid #ddd;
box-shadow: none;
}
.timeline-inverse > li > .timeline-item > .timeline-header {
border-bottom-color: #ddd;
}
/*
* Component: Button
* -----------------
@@ -2576,11 +2459,9 @@ table.text-center th {
padding: 0;
}
.direct-chat.chat-pane-open .direct-chat-contacts {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
.direct-chat-messages {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
padding: 10px;
height: 250px;
@@ -2603,7 +2484,6 @@ table.text-center th {
}
.direct-chat-messages,
.direct-chat-contacts {
transition: -webkit-transform 0.5s ease-in-out;
transition: transform 0.5s ease-in-out;
}
.direct-chat-text {
@@ -2667,11 +2547,9 @@ table.text-center th {
color: #999;
}
.direct-chat-contacts-open .direct-chat-contacts {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
.direct-chat-contacts {
-webkit-transform: translate(101%, 0);
transform: translate(101%, 0);
position: absolute;
top: 0;
@@ -4024,11 +3902,9 @@ fieldset[disabled] .btn-yahoo.active {
line-height: 30px;
}
.fc-color-picker > li .fa {
transition: -webkit-transform linear 0.3s;
transition: transform linear 0.3s;
}
.fc-color-picker > li .fa:hover {
-webkit-transform: rotate(30deg);
transform: rotate(30deg);
}
#add-new-event {
@@ -4723,7 +4599,6 @@ fieldset[disabled] .btn-yahoo.active {
.main-footer {
margin-left: 0!important;
min-height: 0!important;
-webkit-transform: translate(0, 0) !important;
transform: translate(0, 0) !important;
}
.fixed .content-wrapper,
@@ -4793,14 +4668,6 @@ fieldset[disabled] .btn-yahoo.active {
background: #367fa9;
}
}
.skin-blue .main-header .logo {
background-color: #367fa9;
color: #fff;
border-bottom: 0 solid transparent;
}
.skin-blue .main-header .logo:hover {
background-color: #357ca5;
}
.skin-blue .main-header li.user-header {
background-color: #3c8dbc;
}
@@ -4881,13 +4748,8 @@ fieldset[disabled] .btn-yahoo.active {
border-bottom-right-radius: 2px;
border-bottom-left-radius: 0;
}
.skin-blue.layout-top-nav .main-header > .logo {
background-color: #3c8dbc;
color: #fff;
border-bottom: 0 solid transparent;
}
.skin-blue.layout-top-nav .main-header > .logo:hover {
background-color: #3b8ab8;
.skin-blue.layout-top-nav .main-header > .logo .logo-variant {
background-color: none;
}
/*!
@@ -4947,8 +4809,11 @@ fieldset[disabled] .btn-yahoo.active {
background-color: inherit;
}
.main-header .logo {
min-width: 430px;
width: 100% !important;
white-space: nowrap;
text-align: left;
display: block;
clear: both;
}
.huge {
font-size: 40px;
@@ -5235,114 +5100,66 @@ a.accordion-header {
pointer-events: none;
}
/*END Form Wizard*/
.left-navblock {
display: inline-block;
float: left;
text-align: left;
color: white;
padding: 0px;
/* adjust based on your layout */
}
.skin-blue .main-header .navbar .dropdown-menu li a {
color: #333;
}
a.logo.no-hover a:hover {
background-color: transparent;
}
/* WRENCHING */
@-webkit-keyframes wrench {
0% {
-webkit-transform: rotate(-12deg);
}
8% {
-webkit-transform: rotate(12deg);
}
10% {
-webkit-transform: rotate(24deg);
}
18% {
-webkit-transform: rotate(-24deg);
}
20% {
-webkit-transform: rotate(-24deg);
}
28% {
-webkit-transform: rotate(24deg);
}
30% {
-webkit-transform: rotate(24deg);
}
38% {
-webkit-transform: rotate(-24deg);
}
40% {
-webkit-transform: rotate(-24deg);
}
48% {
-webkit-transform: rotate(24deg);
}
50% {
-webkit-transform: rotate(24deg);
}
58% {
-webkit-transform: rotate(-24deg);
}
60% {
-webkit-transform: rotate(-24deg);
}
68% {
-webkit-transform: rotate(24deg);
}
75% {
-webkit-transform: rotate(0deg);
}
}
@keyframes wrench {
0% {
-webkit-transform: rotate(-12deg);
transform: rotate(-12deg);
}
8% {
-webkit-transform: rotate(12deg);
transform: rotate(12deg);
}
10% {
-webkit-transform: rotate(24deg);
transform: rotate(24deg);
}
18% {
-webkit-transform: rotate(-24deg);
transform: rotate(-24deg);
}
20% {
-webkit-transform: rotate(-24deg);
transform: rotate(-24deg);
}
28% {
-webkit-transform: rotate(24deg);
transform: rotate(24deg);
}
30% {
-webkit-transform: rotate(24deg);
transform: rotate(24deg);
}
38% {
-webkit-transform: rotate(-24deg);
transform: rotate(-24deg);
}
40% {
-webkit-transform: rotate(-24deg);
transform: rotate(-24deg);
}
48% {
-webkit-transform: rotate(24deg);
transform: rotate(24deg);
}
50% {
-webkit-transform: rotate(24deg);
transform: rotate(24deg);
}
58% {
-webkit-transform: rotate(-24deg);
transform: rotate(-24deg);
}
60% {
-webkit-transform: rotate(-24deg);
transform: rotate(-24deg);
}
68% {
-webkit-transform: rotate(24deg);
transform: rotate(24deg);
}
75% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
}
@@ -5360,91 +5177,44 @@ a.accordion-header {
-ms-transform-origin-x: 90%;
-ms-transform-origin-y: 35%;
-ms-transform-origin-z: initial;
-webkit-animation: wrench 2.5s ease infinite;
animation: wrench 2.5s ease infinite;
transform-origin-x: 90%;
transform-origin-y: 35%;
transform-origin-z: initial;
}
/* BELL */
@-webkit-keyframes ring {
0% {
-webkit-transform: rotate(-15deg);
}
2% {
-webkit-transform: rotate(15deg);
}
4% {
-webkit-transform: rotate(-18deg);
}
6% {
-webkit-transform: rotate(18deg);
}
8% {
-webkit-transform: rotate(-22deg);
}
10% {
-webkit-transform: rotate(22deg);
}
12% {
-webkit-transform: rotate(-18deg);
}
14% {
-webkit-transform: rotate(18deg);
}
16% {
-webkit-transform: rotate(-12deg);
}
18% {
-webkit-transform: rotate(12deg);
}
20% {
-webkit-transform: rotate(0deg);
}
}
@keyframes ring {
0% {
-webkit-transform: rotate(-15deg);
transform: rotate(-15deg);
}
2% {
-webkit-transform: rotate(15deg);
transform: rotate(15deg);
}
4% {
-webkit-transform: rotate(-18deg);
transform: rotate(-18deg);
}
6% {
-webkit-transform: rotate(18deg);
transform: rotate(18deg);
}
8% {
-webkit-transform: rotate(-22deg);
transform: rotate(-22deg);
}
10% {
-webkit-transform: rotate(22deg);
transform: rotate(22deg);
}
12% {
-webkit-transform: rotate(-18deg);
transform: rotate(-18deg);
}
14% {
-webkit-transform: rotate(18deg);
transform: rotate(18deg);
}
16% {
-webkit-transform: rotate(-12deg);
transform: rotate(-12deg);
}
18% {
-webkit-transform: rotate(12deg);
transform: rotate(12deg);
}
20% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
}
@@ -5462,142 +5232,68 @@ a.accordion-header {
-ms-transform-origin-x: 50%;
-ms-transform-origin-y: 0px;
-ms-transform-origin-z: initial;
-webkit-animation: ring 2s ease infinite;
animation: ring 2s ease infinite;
transform-origin-x: 50%;
transform-origin-y: 0px;
transform-origin-z: initial;
}
/* VERTICAL */
@-webkit-keyframes vertical {
0% {
-webkit-transform: translate(0, -3px);
}
4% {
-webkit-transform: translate(0, 3px);
}
8% {
-webkit-transform: translate(0, -3px);
}
12% {
-webkit-transform: translate(0, 3px);
}
16% {
-webkit-transform: translate(0, -3px);
}
20% {
-webkit-transform: translate(0, 3px);
}
22% {
-webkit-transform: translate(0, 0);
}
}
@keyframes vertical {
0% {
-webkit-transform: translate(0, -3px);
transform: translate(0, -3px);
}
4% {
-webkit-transform: translate(0, 3px);
transform: translate(0, 3px);
}
8% {
-webkit-transform: translate(0, -3px);
transform: translate(0, -3px);
}
12% {
-webkit-transform: translate(0, 3px);
transform: translate(0, 3px);
}
16% {
-webkit-transform: translate(0, -3px);
transform: translate(0, -3px);
}
20% {
-webkit-transform: translate(0, 3px);
transform: translate(0, 3px);
}
22% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
}
.faa-vertical.animated,
.faa-vertical.animated-hover:hover {
-webkit-animation: vertical 2s ease infinite;
animation: vertical 2s ease infinite;
}
/* HORIZONTAL */
@-webkit-keyframes horizontal {
0% {
-webkit-transform: translate(0, 0);
}
6% {
-webkit-transform: translate(5px, 0);
}
12% {
-webkit-transform: translate(0, 0);
}
18% {
-webkit-transform: translate(5px, 0);
}
24% {
-webkit-transform: translate(0, 0);
}
30% {
-webkit-transform: translate(5px, 0);
}
36% {
-webkit-transform: translate(0, 0);
}
}
@keyframes horizontal {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
6% {
-webkit-transform: translate(5px, 0);
transform: translate(5px, 0);
}
12% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
18% {
-webkit-transform: translate(5px, 0);
transform: translate(5px, 0);
}
24% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
30% {
-webkit-transform: translate(5px, 0);
transform: translate(5px, 0);
}
36% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
}
.faa-horizontal.animated,
.faa-horizontal.animated-hover:hover {
-webkit-animation: horizontal 2s ease infinite;
animation: horizontal 2s ease infinite;
}
/* FLASHING */
@-webkit-keyframes flash {
0%,
100%,
50% {
opacity: 1;
}
25%,
75% {
opacity: 0;
}
}
@keyframes flash {
0%,
100%,
@@ -5611,132 +5307,71 @@ a.accordion-header {
}
.faa-flash.animated,
.faa-flash.animated-hover:hover {
-webkit-animation: flash 2s ease infinite;
animation: flash 2s ease infinite;
}
/* BOUNCE */
@-webkit-keyframes bounce {
0%,
100%,
20%,
50%,
80% {
-webkit-transform: translateY(0);
}
40% {
-webkit-transform: translateY(-15px);
}
60% {
-webkit-transform: translateY(-15px);
}
}
@keyframes bounce {
0%,
10%,
20%,
50%,
80% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
40% {
-webkit-transform: translateY(-15px);
transform: translateY(-15px);
}
60% {
-webkit-transform: translateY(-15px);
transform: translateY(-15px);
}
}
.faa-bounce.animated,
.faa-bounce.animated-hover:hover {
-webkit-animation: bounce 2s ease infinite;
animation: bounce 2s ease infinite;
}
/* SPIN */
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
}
}
@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
.faa-spin.animated,
.faa-spin.animated-hover:hover {
-webkit-animation: spin 1.5s linear infinite;
animation: spin 1.5s linear infinite;
}
/* FLOAT */
@-webkit-keyframes float {
0% {
-webkit-transform: translateY(0);
}
50% {
-webkit-transform: translateY(-6px);
}
100% {
-webkit-transform: translateY(0);
}
}
@keyframes float {
0% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
50% {
-webkit-transform: translateY(-6px);
transform: translateY(-6px);
}
100% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
}
.faa-float.animated,
.faa-float.animated-hover:hover {
-webkit-animation: float 2s linear infinite;
animation: float 2s linear infinite;
}
/* PULSE */
@-webkit-keyframes pulse {
0% {
-webkit-transform: scale(1);
}
50% {
-webkit-transform: scale(0.8);
}
100% {
-webkit-transform: scale(1);
}
}
@keyframes pulse {
0% {
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
50% {
-webkit-transform: scale(0.8);
transform: scale(0.8);
}
100% {
-webkit-transform: scale(1);
transform: scale(1);
}
}
.faa-pulse.animated,
.faa-pulse.animated-hover:hover {
-webkit-animation: pulse 2s linear infinite;
animation: pulse 2s linear infinite;
}
/* SHAKE */
File diff suppressed because one or more lines are too long
+54
View File
@@ -34217,6 +34217,47 @@ License: https://github.com/ashleydw/lightbox/blob/master/LICENSE
* @param {JSON} settings Insulated `window.snipeit.settings` object.
* @return {IIFE} Immediately invoked. Returns self.
*/
var pieOptions = {
//Boolean - Whether we should show a stroke on each segment
segmentShowStroke: true,
//String - The colour of each segment stroke
segmentStrokeColor: "#fff",
//Number - The width of each segment stroke
segmentStrokeWidth: 1,
//Number - The percentage of the chart that we cut out of the middle
percentageInnerCutout: 50, // This is 0 for Pie charts
//Number - Amount of animation steps
animationSteps: 100,
//String - Animation easing effect
animationEasing: "easeOutBounce",
//Boolean - Whether we animate the rotation of the Doughnut
animateRotate: true,
//Boolean - Whether we animate scaling the Doughnut from the centre
animateScale: false,
//Boolean - whether to make the chart responsive to window resizing
responsive: true,
// Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
maintainAspectRatio: false,
//String - A legend template
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li>" +
"<i class='fa fa-circle-o' style='color: <%=segments[i].fillColor%>'></i>" +
"<%if(segments[i].label){%><%=segments[i].label%><%}%> foo</li><%}%></ul>",
//String - A tooltip template
tooltipTemplate: "<%=value %> <%=label%> "
};
console.dir(pieOptions);
//Create pie or douhnut chart
// You can switch between pie and douhnut using the method below.
//pieChart.Doughnut(PieData, pieOptions);
//-----------------
//- END PIE CHART -
//-----------------
(function($, settings) {
var Components = {};
Components.modals = {};
@@ -34262,6 +34303,9 @@ License: https://github.com/ashleydw/lightbox/blob/master/LICENSE
});
}(jQuery, window.snipeit.settings));
/*! AdminLTE app.js
* ================
* Main JS application file for AdminLTE v2. This file
@@ -34280,6 +34324,7 @@ if (typeof jQuery === "undefined") {
throw new Error("AdminLTE requires jQuery");
}
/* AdminLTE
*
* @type Object
@@ -35008,4 +35053,13 @@ function _init() {
});
};
}(jQuery));
//-------------
//- PIE CHART -
//-------------
// Get context with jQuery - using jQuery's .get() method.
//# sourceMappingURL=all.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+9376 -3046
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -57,7 +57,6 @@ body {
.content-wrapper,
.right-side,
.main-footer {
transition: -webkit-transform 0.3s ease-in-out, margin 0.3s ease-in-out;
transition: transform 0.3s ease-in-out, margin 0.3s ease-in-out;
margin-left: 230px;
z-index: 820;
@@ -85,7 +84,6 @@ body {
.sidebar-open .content-wrapper,
.sidebar-open .right-side,
.sidebar-open .main-footer {
-webkit-transform: translate(230px, 0);
transform: translate(230px, 0);
}
}
@@ -399,6 +397,21 @@ a:focus {
right: 40px;
}
}
@media (max-width: 991px) {
.content-header {
padding-top: 110px;
}
}
@media (max-width: 991px) {
ul.sidebar-menu {
padding-top: 120px;
}
}
@media (max-width: 991px) {
.sidebar-toggle-mobile a {
color: white;
}
}
/*
* Component: Sidebar
* ------------------
@@ -412,7 +425,6 @@ a:focus {
min-height: 100%;
width: 230px;
z-index: 810;
transition: -webkit-transform 0.3s ease-in-out, width 0.3s ease-in-out;
transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
}
@media (max-width: 767px) {
@@ -424,21 +436,18 @@ a:focus {
@media (max-width: 767px) {
.main-sidebar,
.left-side {
-webkit-transform: translate(-230px, 0);
transform: translate(-230px, 0);
}
}
@media (min-width: 768px) {
.sidebar-collapse .main-sidebar,
.sidebar-collapse .left-side {
-webkit-transform: translate(-230px, 0);
transform: translate(-230px, 0);
}
}
@media (max-width: 767px) {
.sidebar-open .main-sidebar,
.sidebar-open .left-side {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
}
@@ -524,7 +533,6 @@ a:focus {
margin-top: 3px;
}
.sidebar-menu li.active > a > .fa-angle-left {
-webkit-transform: rotate(-90deg);
transform: rotate(-90deg);
}
.sidebar-menu li.active > .treeview-menu {
@@ -568,7 +576,6 @@ a:focus {
z-index: 840;
}
.sidebar-mini.sidebar-collapse .main-sidebar {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
width: 50px!important;
z-index: 850;
@@ -1135,58 +1142,30 @@ a:focus {
/* Add fade animation to dropdown menus by appending
the class .animated-dropdown-menu to the .dropdown-menu ul (or ol)*/
.open:not(.dropup) > .animated-dropdown-menu {
-webkit-backface-visibility: visible !important;
backface-visibility: visible !important;
-webkit-animation: flipInX 0.7s both;
animation: flipInX 0.7s both;
}
@keyframes flipInX {
0% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
transition-timing-function: ease-in;
opacity: 0;
}
40% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
transition-timing-function: ease-in;
}
60% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
opacity: 1;
}
80% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
}
100% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
}
@-webkit-keyframes flipInX {
0% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
-webkit-transition-timing-function: ease-in;
opacity: 0;
}
40% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
-webkit-transition-timing-function: ease-in;
}
60% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
opacity: 1;
}
80% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
}
100% {
-webkit-transform: perspective(400px);
}
}
/* Fix dropdown menu in navbars */
.navbar-custom-menu > .navbar-nav > li {
position: relative;
@@ -2029,102 +2008,6 @@ a:focus {
.progress-description {
margin: 0;
}
/*
* Component: Timeline
* -------------------
*/
.timeline {
position: relative;
margin: 0 0 30px 0;
padding: 0;
list-style: none;
}
.timeline:before {
content: '';
position: absolute;
top: 0;
bottom: 0;
width: 4px;
background: #ddd;
left: 31px;
margin: 0;
border-radius: 2px;
}
.timeline > li {
position: relative;
margin-right: 10px;
margin-bottom: 15px;
}
.timeline > li:before,
.timeline > li:after {
content: " ";
display: table;
}
.timeline > li:after {
clear: both;
}
.timeline > li > .timeline-item {
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
border-radius: 3px;
margin-top: 0;
background: #fff;
color: #444;
margin-left: 60px;
margin-right: 15px;
padding: 0;
position: relative;
}
.timeline > li > .timeline-item > .time {
color: #999;
float: right;
padding: 10px;
font-size: 12px;
}
.timeline > li > .timeline-item > .timeline-header {
margin: 0;
color: #555;
border-bottom: 1px solid #f4f4f4;
padding: 10px;
font-size: 16px;
line-height: 1.1;
}
.timeline > li > .timeline-item > .timeline-header > a {
font-weight: 600;
}
.timeline > li > .timeline-item > .timeline-body,
.timeline > li > .timeline-item > .timeline-footer {
padding: 10px;
}
.timeline > li > .fa,
.timeline > li > .glyphicon,
.timeline > li > .ion {
width: 30px;
height: 30px;
font-size: 15px;
line-height: 30px;
position: absolute;
color: #666;
background: #d2d6de;
border-radius: 50%;
text-align: center;
left: 18px;
top: 0;
}
.timeline > .time-label > span {
font-weight: 600;
padding: 5px;
display: inline-block;
background-color: #fff;
border-radius: 4px;
}
.timeline-inverse > li > .timeline-item {
background: #f0f0f0;
border: 1px solid #ddd;
box-shadow: none;
}
.timeline-inverse > li > .timeline-item > .timeline-header {
border-bottom-color: #ddd;
}
/*
* Component: Button
* -----------------
@@ -2576,11 +2459,9 @@ table.text-center th {
padding: 0;
}
.direct-chat.chat-pane-open .direct-chat-contacts {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
.direct-chat-messages {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
padding: 10px;
height: 250px;
@@ -2603,7 +2484,6 @@ table.text-center th {
}
.direct-chat-messages,
.direct-chat-contacts {
transition: -webkit-transform 0.5s ease-in-out;
transition: transform 0.5s ease-in-out;
}
.direct-chat-text {
@@ -2667,11 +2547,9 @@ table.text-center th {
color: #999;
}
.direct-chat-contacts-open .direct-chat-contacts {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
.direct-chat-contacts {
-webkit-transform: translate(101%, 0);
transform: translate(101%, 0);
position: absolute;
top: 0;
@@ -4024,11 +3902,9 @@ fieldset[disabled] .btn-yahoo.active {
line-height: 30px;
}
.fc-color-picker > li .fa {
transition: -webkit-transform linear 0.3s;
transition: transform linear 0.3s;
}
.fc-color-picker > li .fa:hover {
-webkit-transform: rotate(30deg);
transform: rotate(30deg);
}
#add-new-event {
@@ -4723,7 +4599,6 @@ fieldset[disabled] .btn-yahoo.active {
.main-footer {
margin-left: 0!important;
min-height: 0!important;
-webkit-transform: translate(0, 0) !important;
transform: translate(0, 0) !important;
}
.fixed .content-wrapper,
@@ -4793,14 +4668,6 @@ fieldset[disabled] .btn-yahoo.active {
background: #367fa9;
}
}
.skin-blue .main-header .logo {
background-color: #367fa9;
color: #fff;
border-bottom: 0 solid transparent;
}
.skin-blue .main-header .logo:hover {
background-color: #357ca5;
}
.skin-blue .main-header li.user-header {
background-color: #3c8dbc;
}
@@ -4881,13 +4748,8 @@ fieldset[disabled] .btn-yahoo.active {
border-bottom-right-radius: 2px;
border-bottom-left-radius: 0;
}
.skin-blue.layout-top-nav .main-header > .logo {
background-color: #3c8dbc;
color: #fff;
border-bottom: 0 solid transparent;
}
.skin-blue.layout-top-nav .main-header > .logo:hover {
background-color: #3b8ab8;
.skin-blue.layout-top-nav .main-header > .logo .logo-variant {
background-color: none;
}
/*!
@@ -4947,8 +4809,11 @@ fieldset[disabled] .btn-yahoo.active {
background-color: inherit;
}
.main-header .logo {
min-width: 430px;
width: 100% !important;
white-space: nowrap;
text-align: left;
display: block;
clear: both;
}
.huge {
font-size: 40px;
@@ -5235,114 +5100,66 @@ a.accordion-header {
pointer-events: none;
}
/*END Form Wizard*/
.left-navblock {
display: inline-block;
float: left;
text-align: left;
color: white;
padding: 0px;
/* adjust based on your layout */
}
.skin-blue .main-header .navbar .dropdown-menu li a {
color: #333;
}
a.logo.no-hover a:hover {
background-color: transparent;
}
/* WRENCHING */
@-webkit-keyframes wrench {
0% {
-webkit-transform: rotate(-12deg);
}
8% {
-webkit-transform: rotate(12deg);
}
10% {
-webkit-transform: rotate(24deg);
}
18% {
-webkit-transform: rotate(-24deg);
}
20% {
-webkit-transform: rotate(-24deg);
}
28% {
-webkit-transform: rotate(24deg);
}
30% {
-webkit-transform: rotate(24deg);
}
38% {
-webkit-transform: rotate(-24deg);
}
40% {
-webkit-transform: rotate(-24deg);
}
48% {
-webkit-transform: rotate(24deg);
}
50% {
-webkit-transform: rotate(24deg);
}
58% {
-webkit-transform: rotate(-24deg);
}
60% {
-webkit-transform: rotate(-24deg);
}
68% {
-webkit-transform: rotate(24deg);
}
75% {
-webkit-transform: rotate(0deg);
}
}
@keyframes wrench {
0% {
-webkit-transform: rotate(-12deg);
transform: rotate(-12deg);
}
8% {
-webkit-transform: rotate(12deg);
transform: rotate(12deg);
}
10% {
-webkit-transform: rotate(24deg);
transform: rotate(24deg);
}
18% {
-webkit-transform: rotate(-24deg);
transform: rotate(-24deg);
}
20% {
-webkit-transform: rotate(-24deg);
transform: rotate(-24deg);
}
28% {
-webkit-transform: rotate(24deg);
transform: rotate(24deg);
}
30% {
-webkit-transform: rotate(24deg);
transform: rotate(24deg);
}
38% {
-webkit-transform: rotate(-24deg);
transform: rotate(-24deg);
}
40% {
-webkit-transform: rotate(-24deg);
transform: rotate(-24deg);
}
48% {
-webkit-transform: rotate(24deg);
transform: rotate(24deg);
}
50% {
-webkit-transform: rotate(24deg);
transform: rotate(24deg);
}
58% {
-webkit-transform: rotate(-24deg);
transform: rotate(-24deg);
}
60% {
-webkit-transform: rotate(-24deg);
transform: rotate(-24deg);
}
68% {
-webkit-transform: rotate(24deg);
transform: rotate(24deg);
}
75% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
}
@@ -5360,91 +5177,44 @@ a.accordion-header {
-ms-transform-origin-x: 90%;
-ms-transform-origin-y: 35%;
-ms-transform-origin-z: initial;
-webkit-animation: wrench 2.5s ease infinite;
animation: wrench 2.5s ease infinite;
transform-origin-x: 90%;
transform-origin-y: 35%;
transform-origin-z: initial;
}
/* BELL */
@-webkit-keyframes ring {
0% {
-webkit-transform: rotate(-15deg);
}
2% {
-webkit-transform: rotate(15deg);
}
4% {
-webkit-transform: rotate(-18deg);
}
6% {
-webkit-transform: rotate(18deg);
}
8% {
-webkit-transform: rotate(-22deg);
}
10% {
-webkit-transform: rotate(22deg);
}
12% {
-webkit-transform: rotate(-18deg);
}
14% {
-webkit-transform: rotate(18deg);
}
16% {
-webkit-transform: rotate(-12deg);
}
18% {
-webkit-transform: rotate(12deg);
}
20% {
-webkit-transform: rotate(0deg);
}
}
@keyframes ring {
0% {
-webkit-transform: rotate(-15deg);
transform: rotate(-15deg);
}
2% {
-webkit-transform: rotate(15deg);
transform: rotate(15deg);
}
4% {
-webkit-transform: rotate(-18deg);
transform: rotate(-18deg);
}
6% {
-webkit-transform: rotate(18deg);
transform: rotate(18deg);
}
8% {
-webkit-transform: rotate(-22deg);
transform: rotate(-22deg);
}
10% {
-webkit-transform: rotate(22deg);
transform: rotate(22deg);
}
12% {
-webkit-transform: rotate(-18deg);
transform: rotate(-18deg);
}
14% {
-webkit-transform: rotate(18deg);
transform: rotate(18deg);
}
16% {
-webkit-transform: rotate(-12deg);
transform: rotate(-12deg);
}
18% {
-webkit-transform: rotate(12deg);
transform: rotate(12deg);
}
20% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
}
@@ -5462,142 +5232,68 @@ a.accordion-header {
-ms-transform-origin-x: 50%;
-ms-transform-origin-y: 0px;
-ms-transform-origin-z: initial;
-webkit-animation: ring 2s ease infinite;
animation: ring 2s ease infinite;
transform-origin-x: 50%;
transform-origin-y: 0px;
transform-origin-z: initial;
}
/* VERTICAL */
@-webkit-keyframes vertical {
0% {
-webkit-transform: translate(0, -3px);
}
4% {
-webkit-transform: translate(0, 3px);
}
8% {
-webkit-transform: translate(0, -3px);
}
12% {
-webkit-transform: translate(0, 3px);
}
16% {
-webkit-transform: translate(0, -3px);
}
20% {
-webkit-transform: translate(0, 3px);
}
22% {
-webkit-transform: translate(0, 0);
}
}
@keyframes vertical {
0% {
-webkit-transform: translate(0, -3px);
transform: translate(0, -3px);
}
4% {
-webkit-transform: translate(0, 3px);
transform: translate(0, 3px);
}
8% {
-webkit-transform: translate(0, -3px);
transform: translate(0, -3px);
}
12% {
-webkit-transform: translate(0, 3px);
transform: translate(0, 3px);
}
16% {
-webkit-transform: translate(0, -3px);
transform: translate(0, -3px);
}
20% {
-webkit-transform: translate(0, 3px);
transform: translate(0, 3px);
}
22% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
}
.faa-vertical.animated,
.faa-vertical.animated-hover:hover {
-webkit-animation: vertical 2s ease infinite;
animation: vertical 2s ease infinite;
}
/* HORIZONTAL */
@-webkit-keyframes horizontal {
0% {
-webkit-transform: translate(0, 0);
}
6% {
-webkit-transform: translate(5px, 0);
}
12% {
-webkit-transform: translate(0, 0);
}
18% {
-webkit-transform: translate(5px, 0);
}
24% {
-webkit-transform: translate(0, 0);
}
30% {
-webkit-transform: translate(5px, 0);
}
36% {
-webkit-transform: translate(0, 0);
}
}
@keyframes horizontal {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
6% {
-webkit-transform: translate(5px, 0);
transform: translate(5px, 0);
}
12% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
18% {
-webkit-transform: translate(5px, 0);
transform: translate(5px, 0);
}
24% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
30% {
-webkit-transform: translate(5px, 0);
transform: translate(5px, 0);
}
36% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
}
.faa-horizontal.animated,
.faa-horizontal.animated-hover:hover {
-webkit-animation: horizontal 2s ease infinite;
animation: horizontal 2s ease infinite;
}
/* FLASHING */
@-webkit-keyframes flash {
0%,
100%,
50% {
opacity: 1;
}
25%,
75% {
opacity: 0;
}
}
@keyframes flash {
0%,
100%,
@@ -5611,132 +5307,71 @@ a.accordion-header {
}
.faa-flash.animated,
.faa-flash.animated-hover:hover {
-webkit-animation: flash 2s ease infinite;
animation: flash 2s ease infinite;
}
/* BOUNCE */
@-webkit-keyframes bounce {
0%,
100%,
20%,
50%,
80% {
-webkit-transform: translateY(0);
}
40% {
-webkit-transform: translateY(-15px);
}
60% {
-webkit-transform: translateY(-15px);
}
}
@keyframes bounce {
0%,
10%,
20%,
50%,
80% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
40% {
-webkit-transform: translateY(-15px);
transform: translateY(-15px);
}
60% {
-webkit-transform: translateY(-15px);
transform: translateY(-15px);
}
}
.faa-bounce.animated,
.faa-bounce.animated-hover:hover {
-webkit-animation: bounce 2s ease infinite;
animation: bounce 2s ease infinite;
}
/* SPIN */
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
}
}
@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
.faa-spin.animated,
.faa-spin.animated-hover:hover {
-webkit-animation: spin 1.5s linear infinite;
animation: spin 1.5s linear infinite;
}
/* FLOAT */
@-webkit-keyframes float {
0% {
-webkit-transform: translateY(0);
}
50% {
-webkit-transform: translateY(-6px);
}
100% {
-webkit-transform: translateY(0);
}
}
@keyframes float {
0% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
50% {
-webkit-transform: translateY(-6px);
transform: translateY(-6px);
}
100% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
}
.faa-float.animated,
.faa-float.animated-hover:hover {
-webkit-animation: float 2s linear infinite;
animation: float 2s linear infinite;
}
/* PULSE */
@-webkit-keyframes pulse {
0% {
-webkit-transform: scale(1);
}
50% {
-webkit-transform: scale(0.8);
}
100% {
-webkit-transform: scale(1);
}
}
@keyframes pulse {
0% {
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
50% {
-webkit-transform: scale(0.8);
transform: scale(0.8);
}
100% {
-webkit-transform: scale(1);
transform: scale(1);
}
}
.faa-pulse.animated,
.faa-pulse.animated-hover:hover {
-webkit-animation: pulse 2s linear infinite;
animation: pulse 2s linear infinite;
}
/* SHAKE */
File diff suppressed because one or more lines are too long
@@ -34217,6 +34217,47 @@ License: https://github.com/ashleydw/lightbox/blob/master/LICENSE
* @param {JSON} settings Insulated `window.snipeit.settings` object.
* @return {IIFE} Immediately invoked. Returns self.
*/
var pieOptions = {
//Boolean - Whether we should show a stroke on each segment
segmentShowStroke: true,
//String - The colour of each segment stroke
segmentStrokeColor: "#fff",
//Number - The width of each segment stroke
segmentStrokeWidth: 1,
//Number - The percentage of the chart that we cut out of the middle
percentageInnerCutout: 50, // This is 0 for Pie charts
//Number - Amount of animation steps
animationSteps: 100,
//String - Animation easing effect
animationEasing: "easeOutBounce",
//Boolean - Whether we animate the rotation of the Doughnut
animateRotate: true,
//Boolean - Whether we animate scaling the Doughnut from the centre
animateScale: false,
//Boolean - whether to make the chart responsive to window resizing
responsive: true,
// Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
maintainAspectRatio: false,
//String - A legend template
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li>" +
"<i class='fa fa-circle-o' style='color: <%=segments[i].fillColor%>'></i>" +
"<%if(segments[i].label){%><%=segments[i].label%><%}%> foo</li><%}%></ul>",
//String - A tooltip template
tooltipTemplate: "<%=value %> <%=label%> "
};
console.dir(pieOptions);
//Create pie or douhnut chart
// You can switch between pie and douhnut using the method below.
//pieChart.Doughnut(PieData, pieOptions);
//-----------------
//- END PIE CHART -
//-----------------
(function($, settings) {
var Components = {};
Components.modals = {};
@@ -34262,6 +34303,9 @@ License: https://github.com/ashleydw/lightbox/blob/master/LICENSE
});
}(jQuery, window.snipeit.settings));
/*! AdminLTE app.js
* ================
* Main JS application file for AdminLTE v2. This file
@@ -34280,6 +34324,7 @@ if (typeof jQuery === "undefined") {
throw new Error("AdminLTE requires jQuery");
}
/* AdminLTE
*
* @type Object
@@ -35008,4 +35053,13 @@ function _init() {
});
};
}(jQuery));
//-------------
//- PIE CHART -
//-------------
// Get context with jQuery - using jQuery's .get() method.
//# sourceMappingURL=all.js.map
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -1,4 +1,4 @@
{
"assets/css/app.css": "assets/css/app-060dd24c8f.css",
"assets/js/all.js": "assets/js/all-640cf0ee36.js"
"assets/css/app.css": "assets/css/app-ec8e97e7ca.css",
"assets/js/all.js": "assets/js/all-edd914620a.js"
}
+10 -1
View File
@@ -16,6 +16,7 @@ if (typeof jQuery === "undefined") {
throw new Error("AdminLTE requires jQuery");
}
/* AdminLTE
*
* @type Object
@@ -743,4 +744,12 @@ function _init() {
}
});
};
}(jQuery));
}(jQuery));
//-------------
//- PIE CHART -
//-------------
// Get context with jQuery - using jQuery's .get() method.
+44
View File
@@ -4,6 +4,47 @@
* @param {JSON} settings Insulated `window.snipeit.settings` object.
* @return {IIFE} Immediately invoked. Returns self.
*/
var pieOptions = {
//Boolean - Whether we should show a stroke on each segment
segmentShowStroke: true,
//String - The colour of each segment stroke
segmentStrokeColor: "#fff",
//Number - The width of each segment stroke
segmentStrokeWidth: 1,
//Number - The percentage of the chart that we cut out of the middle
percentageInnerCutout: 50, // This is 0 for Pie charts
//Number - Amount of animation steps
animationSteps: 100,
//String - Animation easing effect
animationEasing: "easeOutBounce",
//Boolean - Whether we animate the rotation of the Doughnut
animateRotate: true,
//Boolean - Whether we animate scaling the Doughnut from the centre
animateScale: false,
//Boolean - whether to make the chart responsive to window resizing
responsive: true,
// Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
maintainAspectRatio: false,
//String - A legend template
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li>" +
"<i class='fa fa-circle-o' style='color: <%=segments[i].fillColor%>'></i>" +
"<%if(segments[i].label){%><%=segments[i].label%><%}%> foo</li><%}%></ul>",
//String - A tooltip template
tooltipTemplate: "<%=value %> <%=label%> "
};
console.dir(pieOptions);
//Create pie or douhnut chart
// You can switch between pie and douhnut using the method below.
//pieChart.Doughnut(PieData, pieOptions);
//-----------------
//- END PIE CHART -
//-----------------
(function($, settings) {
var Components = {};
Components.modals = {};
@@ -48,3 +89,6 @@
new Components.modals.confirmDelete().render();
});
}(jQuery, window.snipeit.settings));
-1
View File
@@ -33,7 +33,6 @@
@import "small-box.less";
@import "boxes.less";
@import "info-box.less";
@import "timeline.less";
@import "buttons.less";
@import "callout.less";
@import "alerts.less";
+24
View File
@@ -242,3 +242,27 @@
}
}
}
// Collapse header
@media (max-width: @screen-sm-max) {
.content-header {
padding-top: 110px;
}
}
// Collapse header
@media (max-width: @screen-sm-max) {
ul.sidebar-menu {
padding-top: 120px;
}
}
// Collapse header
@media (max-width: @screen-sm-max) {
.sidebar-toggle-mobile a {
color: white;
}
}
+24 -1
View File
@@ -2,8 +2,12 @@
background-color: inherit;
}
.main-header .logo {
min-width: 430px;
width: 100% !important;
white-space: nowrap;
text-align: left;
display: block;
clear: both;
//text-overflow: hidden;
}
.huge {
font-size: 40px;
@@ -260,3 +264,22 @@ a.accordion-header {
.bs-wizard > .bs-wizard-step:last-child > .progress {width: 50%;}
.bs-wizard > .bs-wizard-step.disabled a.bs-wizard-dot{ pointer-events: none; }
/*END Form Wizard*/
.left-navblock{
display: inline-block;
float: left;
text-align: left;
color: white;
padding: 0px;
/* adjust based on your layout */
}
.skin-blue .main-header .navbar .dropdown-menu li a {
color: #333;
}
a.logo.no-hover a:hover {
background-color: transparent;
}
+3 -4
View File
@@ -35,9 +35,6 @@
}
}
//Logo
.logo {
.logo-variant(darken(@light-blue, 5%));
}
li.user-header {
background-color: @light-blue;
@@ -54,5 +51,7 @@
}
.skin-blue.layout-top-nav .main-header > .logo {
.logo-variant(@light-blue);
.logo-variant {
background-color: none;
}
}
@@ -36,6 +36,12 @@ return array(
'invalidfiles' => 'One or more of your files is too large or is a filetype that is not allowed. Allowed filetypes are png, gif, jpg, doc, docx, pdf, and txt.',
),
'import' => array(
'error' => 'Some Items did not import Correctly.',
'errorDetail' => 'The Following Items were not imported because of errors.',
'success' => "Your File has been imported",
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this asset?',
@@ -9,6 +9,7 @@ return array(
'date' => 'Purchase Date',
'depreciation' => 'Depreciation',
'expiration' => 'Expiration Date',
'license_key' => 'Product Key',
'maintained' => 'Maintained',
'name' => 'Software Name',
'no_depreciation' => 'Do Not Depreciate',
+3 -4
View File
@@ -10,7 +10,6 @@ return array(
'auto_increment_prefix' => 'Prefix (optional)',
'auto_incrementing_help' => 'Enable auto-incrementing asset IDs first to set this',
'backups' => 'Backups',
'barcode_type' => 'Barcode Type',
'barcode_settings' => 'Barcode Settings',
'confirm_purge' => 'Confirm Purge',
'confirm_purge_help' => 'Enter the text "DELETE" in the box below to purge your deleted records. This action cannot be undone.',
@@ -24,9 +23,9 @@ return array(
'display_checkout_date' => 'Display Checkout Date',
'display_eol' => 'Display EOL in table view',
'display_qr' => 'Display Square Codes',
'display_alt_barcode' => 'Display 2D barcode',
'barcode_type' => 'Barcode Type',
'alt_barcode_type' => '2D barcode type',
'display_alt_barcode' => 'Display 1D barcode',
'barcode_type' => '2D Barcode Type',
'alt_barcode_type' => '1D barcode type',
'eula_settings' => 'EULA Settings',
'eula_markdown' => 'This EULA allows <a href="https://help.github.com/articles/github-flavored-markdown/">Github flavored markdown</a>.',
'general_settings' => 'General Settings',
@@ -2,24 +2,24 @@
return array(
'does_not_exist' => 'Location does not exist.',
'assoc_users' => 'This location is currently associated with at least one user and cannot be deleted. Please update your users to no longer reference this location and try again. ',
'does_not_exist' => 'Status Label does not exist.',
'assoc_assets' => 'This Status Label is currently associated with at least one Asset and cannot be deleted. Please update your assets to no longer reference this status and try again. ',
'create' => array(
'error' => 'Location was not created, please try again.',
'success' => 'Location created successfully.'
'error' => 'Status Label was not created, please try again.',
'success' => 'Status Label created successfully.'
),
'update' => array(
'error' => 'Location was not updated, please try again',
'success' => 'Location updated successfully.'
'error' => 'Status Label was not updated, please try again',
'success' => 'Status Label updated successfully.'
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this status label?',
'error' => 'There was an issue deleting the location. Please try again.',
'success' => 'The location was deleted successfully.'
'confirm' => 'Are you sure you wish to delete this Status Label?',
'error' => 'There was an issue deleting the Status Label. Please try again.',
'success' => 'The Status Label was deleted successfully.'
)
);
+12
View File
@@ -0,0 +1,12 @@
<?php
return [
'send_password_link' => 'Send Password Reset Link',
'email_reset_password' => 'Email Password Reset',
'reset_password' => 'Reset Password',
'login' => 'Login',
'login_prompt' => 'Please Login',
'forgot_password' => 'I forgot my password',
'remember_me' => 'Remember Me',
];
+12 -3
View File
@@ -56,8 +56,14 @@
'depreciation' => 'الإستهلاك',
'editprofile' => 'تعديل الملف الشخصي',
'eol' => 'الحياة',
'email_domain' => 'Email Domain',
'email_format' => 'Email Format',
'email_domain_help' => 'This is used to generate email addresses when importing',
'filastname_format' => 'First Initial Last Name (jsmith@example.com)',
'firstname_lastname_format' => 'First Name Last Name (jane.smith@example.com)',
'first' => 'First',
'first_name' => 'الإسم الأول',
'first_name_format' => 'First Name (jane@example.com)',
'file_name' => 'File',
'file_uploads' => 'File Uploads',
'generate' => 'Generate',
@@ -88,6 +94,7 @@
'location' => 'الموقع',
'locations' => 'المواقع',
'logout' => 'تسجيل خروج',
'lookup_by_tag' => 'Lookup by Asset Tag',
'manufacturer' => 'الشركة المصنعة',
'manufacturers' => 'الشركات المصنعة',
'markdown' => 'This field allows <a href="https://help.github.com/articles/github-flavored-markdown/">Github flavored markdown</a>.',
@@ -114,12 +121,13 @@
'quantity' => 'Quantity',
'ready_to_deploy' => 'جاهزة للتوزيع',
'recent_activity' => 'Recent Activity',
'remove_company' => 'Remove Company Association',
'remove_company' => 'Remove Company Association',
'reports' => 'التقارير',
'requested' => 'Requested',
'save' => 'حفظ',
'select' => 'Select',
'search' => 'Search',
'select_category' => 'Select a Category',
'select_depreciation' => 'Select a Depreciation Type',
'select_location' => 'Select a Location',
'select_manufacturer' => 'Select a Manufacturer',
@@ -128,8 +136,8 @@
'select_user' => 'Select a User',
'select_date' => 'Select Date',
'select_statuslabel' => 'Select Status',
'select_company' => 'Select Company',
'select_asset' => 'Select Asset',
'select_company' => 'Select Company',
'select_asset' => 'Select Asset',
'settings' => 'الإعدادات',
'sign_in' => 'تسجيل الدخول',
'site_name' => 'إسم الموقع',
@@ -142,6 +150,7 @@
'type' => 'Type',
'undeployable' => 'غير قابلة للتوزيع',
'unknown_admin' => 'إداري غير معروف',
'username_format' => 'Username Format',
'update' => 'Update',
'uploaded' => 'Uploaded',
'user' => 'المستخدم',
+7
View File
@@ -0,0 +1,7 @@
<?php
return [
'sent' => 'Your password link has been sent!',
'user' => 'That user does not exist or does not have an email address associated',
];
@@ -35,6 +35,12 @@ return array(
'invalidfiles' => 'Един или повече файлове са твърде големи или с непозволен тип. Разрешените файлови типове за качване са png, gif, jpg, doc, docx, pdf и txt.',
),
'import' => array(
'error' => 'Some Items did not import Correctly.',
'errorDetail' => 'The Following Items were not imported because of errors.',
'success' => "Your File has been imported",
),
'delete' => array(
'confirm' => 'Сигурни ли сте, че желаете изтриване на актива?',
@@ -9,6 +9,7 @@ return array(
'date' => 'Дата на закупуване',
'depreciation' => 'Амортизация',
'expiration' => 'Срок на валидност',
'license_key' => 'Product Key',
'maintained' => 'В поддръжка',
'name' => 'Софтуерен продукт',
'no_depreciation' => 'Без амортизация',
+3 -4
View File
@@ -10,7 +10,6 @@ return array(
'auto_increment_prefix' => 'Префикс (незадължително)',
'auto_incrementing_help' => 'Първо включете автоматично генериране на инвентарни номера, за да включите тази опция.',
'backups' => 'Архивиране',
'barcode_type' => 'Тип на баркод',
'barcode_settings' => 'Настройки на баркод',
'confirm_purge' => 'Confirm Purge',
'confirm_purge_help' => 'Enter the text "DELETE" in the box below to purge your deleted records. This action cannot be undone.',
@@ -24,9 +23,9 @@ return array(
'display_checkout_date' => 'Визуализиране на дата на изписване',
'display_eol' => 'Визуализиране на EOL в таблиците',
'display_qr' => 'Display Square Codes',
'display_alt_barcode' => 'Display 2D barcode',
'barcode_type' => 'Тип на баркод',
'alt_barcode_type' => '2D barcode type',
'display_alt_barcode' => 'Display 1D barcode',
'barcode_type' => '2D Barcode Type',
'alt_barcode_type' => '1D barcode type',
'eula_settings' => 'Настройки на EULA',
'eula_markdown' => 'Съдържанието на EULA може да бъде форматирано с <a href="https://help.github.com/articles/github-flavored-markdown/">Github flavored markdown</a>.',
'general_settings' => 'Общи настройки',
@@ -2,24 +2,24 @@
return array(
'does_not_exist' => 'Местоположението не съществува.',
'assoc_users' => 'Местоположението е свързано с поне един потребител и не може да бъде изтрито. Моля, актуализирайте потребителите, така че да не са свързани с това местоположение и опитайте отново. ',
'does_not_exist' => 'Status Label does not exist.',
'assoc_assets' => 'This Status Label is currently associated with at least one Asset and cannot be deleted. Please update your assets to no longer reference this status and try again. ',
'create' => array(
'error' => 'Местоположението не беше създадено. Моля опитайте отново.',
'success' => 'Местоположението създадено успешно.'
'error' => 'Status Label was not created, please try again.',
'success' => 'Status Label created successfully.'
),
'update' => array(
'error' => 'Местоположението не беше обновено. Моля опитайте отново.',
'success' => 'Местоположението обновено успешно.'
'error' => 'Status Label was not updated, please try again',
'success' => 'Status Label updated successfully.'
),
'delete' => array(
'confirm' => 'Сигурни ли сте, че желаете изтриване на този статус етикет?',
'error' => 'Проблем при изтриване на местоположението. Моля опитайте отново.',
'success' => 'Местоположението изтрито успешно.'
'confirm' => 'Are you sure you wish to delete this Status Label?',
'error' => 'There was an issue deleting the Status Label. Please try again.',
'success' => 'The Status Label was deleted successfully.'
)
);
+12
View File
@@ -0,0 +1,12 @@
<?php
return [
'send_password_link' => 'Send Password Reset Link',
'email_reset_password' => 'Email Password Reset',
'reset_password' => 'Reset Password',
'login' => 'Login',
'login_prompt' => 'Please Login',
'forgot_password' => 'I forgot my password',
'remember_me' => 'Remember Me',
];
+12 -3
View File
@@ -56,8 +56,14 @@
'depreciation' => 'Амортизация',
'editprofile' => 'Редакция на профила',
'eol' => 'EOL',
'email_domain' => 'Email Domain',
'email_format' => 'Email Format',
'email_domain_help' => 'This is used to generate email addresses when importing',
'filastname_format' => 'First Initial Last Name (jsmith@example.com)',
'firstname_lastname_format' => 'First Name Last Name (jane.smith@example.com)',
'first' => 'Първа',
'first_name' => 'Собствено име',
'first_name_format' => 'First Name (jane@example.com)',
'file_name' => 'Файл',
'file_uploads' => 'Качени файлове',
'generate' => 'Генериране',
@@ -88,6 +94,7 @@
'location' => 'Местоположение',
'locations' => 'Местоположения',
'logout' => 'Изход',
'lookup_by_tag' => 'Lookup by Asset Tag',
'manufacturer' => 'Производител',
'manufacturers' => 'Производители',
'markdown' => 'This field allows <a href="https://help.github.com/articles/github-flavored-markdown/">Github flavored markdown</a>.',
@@ -114,12 +121,13 @@
'quantity' => 'Kоличество',
'ready_to_deploy' => 'Готово за предоставяне',
'recent_activity' => 'Последни действия',
'remove_company' => 'Премахване на асоциация към компания',
'remove_company' => 'Премахване на асоциация към компания',
'reports' => 'Справки',
'requested' => 'Изискан',
'save' => 'Запис',
'select' => 'Избор',
'search' => 'Търсене',
'select_category' => 'Select a Category',
'select_depreciation' => 'Избор на вид амортизация',
'select_location' => 'Избор на местоположение',
'select_manufacturer' => 'Избор на производител',
@@ -128,8 +136,8 @@
'select_user' => 'Избор на потребител',
'select_date' => 'Избор на дата',
'select_statuslabel' => 'Избор на статус',
'select_company' => 'Изберете компания',
'select_asset' => 'Select Asset',
'select_company' => 'Изберете компания',
'select_asset' => 'Select Asset',
'settings' => 'Настройки',
'sign_in' => 'Вход',
'site_name' => 'Име на системата',
@@ -142,6 +150,7 @@
'type' => 'Тип',
'undeployable' => 'Не може да бъде предоставян',
'unknown_admin' => 'Непознат администратор',
'username_format' => 'Username Format',
'update' => 'Обновяване',
'uploaded' => 'Качен',
'user' => 'Потребител',
+7
View File
@@ -0,0 +1,7 @@
<?php
return [
'sent' => 'Your password link has been sent!',
'user' => 'That user does not exist or does not have an email address associated',
];
@@ -36,6 +36,12 @@ return array(
'invalidfiles' => 'One or more of your files is too large or is a filetype that is not allowed. Allowed filetypes are png, gif, jpg, doc, docx, pdf, and txt.',
),
'import' => array(
'error' => 'Some Items did not import Correctly.',
'errorDetail' => 'The Following Items were not imported because of errors.',
'success' => "Your File has been imported",
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this asset?',
@@ -9,6 +9,7 @@ return array(
'date' => 'Datum pořízení',
'depreciation' => 'Amortizace',
'expiration' => 'Expirace',
'license_key' => 'Product Key',
'maintained' => 'Údržba',
'name' => 'Software',
'no_depreciation' => 'Do Not Depreciate',
+3 -4
View File
@@ -10,7 +10,6 @@ return array(
'auto_increment_prefix' => 'Předpona (volitnelná)',
'auto_incrementing_help' => 'Nastavte nejdříve automaticky se zvyšující ID majetku pro nastavení tohoto',
'backups' => 'Zálohy',
'barcode_type' => 'Tyo čárového kódu',
'barcode_settings' => 'Nastavení čárového kódu',
'confirm_purge' => 'Confirm Purge',
'confirm_purge_help' => 'Enter the text "DELETE" in the box below to purge your deleted records. This action cannot be undone.',
@@ -24,9 +23,9 @@ return array(
'display_checkout_date' => 'Zobrazit den převzetí',
'display_eol' => 'Zobrazit EOL v tabulkovém zobrazení',
'display_qr' => 'Display Square Codes',
'display_alt_barcode' => 'Display 2D barcode',
'barcode_type' => 'Tyo čárového kódu',
'alt_barcode_type' => '2D barcode type',
'display_alt_barcode' => 'Display 1D barcode',
'barcode_type' => '2D Barcode Type',
'alt_barcode_type' => '1D barcode type',
'eula_settings' => 'Nastavení EULA',
'eula_markdown' => 'Tato EULA umožňuje <a href="https://help.github.com/articles/github-flavored-markdown/">Github markdown</a>.',
'general_settings' => 'Obecné nastavení',
@@ -2,24 +2,24 @@
return array(
'does_not_exist' => 'Místo neexistuje.',
'assoc_users' => 'Toto místo je spojeno s alespoň jedním uživatelem a nemůže být smazáno. Aktualizujte uživatele aby nenáleželi k tomuto místu a zkuste to znovu. ',
'does_not_exist' => 'Status Label does not exist.',
'assoc_assets' => 'This Status Label is currently associated with at least one Asset and cannot be deleted. Please update your assets to no longer reference this status and try again. ',
'create' => array(
'error' => 'Místo nebylo vytvořeno, zkuste to znovu.',
'success' => 'Místo úspěšně vytvořeno.'
'error' => 'Status Label was not created, please try again.',
'success' => 'Status Label created successfully.'
),
'update' => array(
'error' => 'Místo nebylo aktualizováno, zkuste to znovu',
'success' => 'Místo aktualizováno.'
'error' => 'Status Label was not updated, please try again',
'success' => 'Status Label updated successfully.'
),
'delete' => array(
'confirm' => 'Opravdu chcete smazat tento typ stavu?',
'error' => 'Vyskytl se problém při mazání místa. Zkuste to znovu.',
'success' => 'Místo bylo úspěšně smazáno.'
'confirm' => 'Are you sure you wish to delete this Status Label?',
'error' => 'There was an issue deleting the Status Label. Please try again.',
'success' => 'The Status Label was deleted successfully.'
)
);
+12
View File
@@ -0,0 +1,12 @@
<?php
return [
'send_password_link' => 'Send Password Reset Link',
'email_reset_password' => 'Email Password Reset',
'reset_password' => 'Reset Password',
'login' => 'Login',
'login_prompt' => 'Please Login',
'forgot_password' => 'I forgot my password',
'remember_me' => 'Remember Me',
];
+12 -3
View File
@@ -56,8 +56,14 @@
'depreciation' => 'Amortizace',
'editprofile' => 'Upravit profil',
'eol' => 'Konec životnosti',
'email_domain' => 'Email Domain',
'email_format' => 'Email Format',
'email_domain_help' => 'This is used to generate email addresses when importing',
'filastname_format' => 'First Initial Last Name (jsmith@example.com)',
'firstname_lastname_format' => 'First Name Last Name (jane.smith@example.com)',
'first' => 'První',
'first_name' => 'Jméno',
'first_name_format' => 'First Name (jane@example.com)',
'file_name' => 'Soubor',
'file_uploads' => 'Nahrání souboru',
'generate' => 'Vytvořit',
@@ -88,6 +94,7 @@
'location' => 'Lokalita',
'locations' => 'Umístění',
'logout' => 'Odhlásit',
'lookup_by_tag' => 'Lookup by Asset Tag',
'manufacturer' => 'Výrobce',
'manufacturers' => 'Výrobci',
'markdown' => 'This field allows <a href="https://help.github.com/articles/github-flavored-markdown/">Github flavored markdown</a>.',
@@ -114,12 +121,13 @@
'quantity' => 'Quantity',
'ready_to_deploy' => 'Připraveno k přidělení',
'recent_activity' => 'Nedávná aktivita',
'remove_company' => 'Remove Company Association',
'remove_company' => 'Remove Company Association',
'reports' => 'Reporty',
'requested' => 'Požadováno',
'save' => 'Uložit',
'select' => 'Zvolit',
'search' => 'Hledat',
'select_category' => 'Select a Category',
'select_depreciation' => 'Zvolit typ amortizace',
'select_location' => 'Zvolit místo',
'select_manufacturer' => 'Zvolit výrobce',
@@ -128,8 +136,8 @@
'select_user' => 'Zvolit uživatele',
'select_date' => 'Zvolit datum',
'select_statuslabel' => 'Vybrat stav',
'select_company' => 'Select Company',
'select_asset' => 'Select Asset',
'select_company' => 'Select Company',
'select_asset' => 'Select Asset',
'settings' => 'Nastavení',
'sign_in' => 'Přihlásit se',
'site_name' => 'Název lokality',
@@ -142,6 +150,7 @@
'type' => 'Typ',
'undeployable' => 'Ne-přiřaditelné',
'unknown_admin' => 'Neznámy správce',
'username_format' => 'Username Format',
'update' => 'Aktualizace',
'uploaded' => 'Nahráno',
'user' => 'Uživatel',
+7
View File
@@ -0,0 +1,7 @@
<?php
return [
'sent' => 'Your password link has been sent!',
'user' => 'That user does not exist or does not have an email address associated',
];
@@ -36,6 +36,12 @@ return array(
'invalidfiles' => 'One or more of your files is too large or is a filetype that is not allowed. Allowed filetypes are png, gif, jpg, doc, docx, pdf, and txt.',
),
'import' => array(
'error' => 'Some Items did not import Correctly.',
'errorDetail' => 'The Following Items were not imported because of errors.',
'success' => "Your File has been imported",
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this asset?',
@@ -9,6 +9,7 @@ return array(
'date' => 'Købsdato',
'depreciation' => 'Depreciation',
'expiration' => 'Udløbsdato',
'license_key' => 'Product Key',
'maintained' => 'Maintained',
'name' => 'Software navn',
'no_depreciation' => 'Do Not Depreciate',
+3 -4
View File
@@ -10,7 +10,6 @@ return array(
'auto_increment_prefix' => 'Prefix (optional)',
'auto_incrementing_help' => 'Enable auto-incrementing asset IDs first to set this',
'backups' => 'Backups',
'barcode_type' => 'Barcode Type',
'barcode_settings' => 'Barcode Settings',
'confirm_purge' => 'Confirm Purge',
'confirm_purge_help' => 'Enter the text "DELETE" in the box below to purge your deleted records. This action cannot be undone.',
@@ -24,9 +23,9 @@ return array(
'display_checkout_date' => 'Display Checkout Date',
'display_eol' => 'Display EOL in table view',
'display_qr' => 'Display Square Codes',
'display_alt_barcode' => 'Display 2D barcode',
'barcode_type' => 'Barcode Type',
'alt_barcode_type' => '2D barcode type',
'display_alt_barcode' => 'Display 1D barcode',
'barcode_type' => '2D Barcode Type',
'alt_barcode_type' => '1D barcode type',
'eula_settings' => 'EULA Settings',
'eula_markdown' => 'This EULA allows <a href="https://help.github.com/articles/github-flavored-markdown/">Github flavored markdown</a>.',
'general_settings' => 'General Settings',
@@ -2,24 +2,24 @@
return array(
'does_not_exist' => 'Location does not exist.',
'assoc_users' => 'This location is currently associated with at least one user and cannot be deleted. Please update your users to no longer reference this location and try again. ',
'does_not_exist' => 'Status Label does not exist.',
'assoc_assets' => 'This Status Label is currently associated with at least one Asset and cannot be deleted. Please update your assets to no longer reference this status and try again. ',
'create' => array(
'error' => 'Location was not created, please try again.',
'success' => 'Location created successfully.'
'error' => 'Status Label was not created, please try again.',
'success' => 'Status Label created successfully.'
),
'update' => array(
'error' => 'Location was not updated, please try again',
'success' => 'Location updated successfully.'
'error' => 'Status Label was not updated, please try again',
'success' => 'Status Label updated successfully.'
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this status label?',
'error' => 'There was an issue deleting the location. Please try again.',
'success' => 'The location was deleted successfully.'
'confirm' => 'Are you sure you wish to delete this Status Label?',
'error' => 'There was an issue deleting the Status Label. Please try again.',
'success' => 'The Status Label was deleted successfully.'
)
);
+12
View File
@@ -0,0 +1,12 @@
<?php
return [
'send_password_link' => 'Send Password Reset Link',
'email_reset_password' => 'Email Password Reset',
'reset_password' => 'Reset Password',
'login' => 'Login',
'login_prompt' => 'Please Login',
'forgot_password' => 'I forgot my password',
'remember_me' => 'Remember Me',
];
+12 -3
View File
@@ -56,8 +56,14 @@
'depreciation' => 'Afskrivning',
'editprofile' => 'Ret Din Profil',
'eol' => 'EOL',
'email_domain' => 'Email Domain',
'email_format' => 'Email Format',
'email_domain_help' => 'This is used to generate email addresses when importing',
'filastname_format' => 'First Initial Last Name (jsmith@example.com)',
'firstname_lastname_format' => 'First Name Last Name (jane.smith@example.com)',
'first' => 'First',
'first_name' => 'Fornavn',
'first_name_format' => 'First Name (jane@example.com)',
'file_name' => 'Fil',
'file_uploads' => 'Filoverførsel',
'generate' => 'Skab',
@@ -88,6 +94,7 @@
'location' => 'Lokation',
'locations' => 'Lokationer',
'logout' => 'Log ud',
'lookup_by_tag' => 'Lookup by Asset Tag',
'manufacturer' => 'Producent',
'manufacturers' => 'Producenter',
'markdown' => 'This field allows <a href="https://help.github.com/articles/github-flavored-markdown/">Github flavored markdown</a>.',
@@ -114,12 +121,13 @@
'quantity' => 'Quantity',
'ready_to_deploy' => 'Klar til Implementering',
'recent_activity' => 'Recent Activity',
'remove_company' => 'Remove Company Association',
'remove_company' => 'Remove Company Association',
'reports' => 'Rapporter',
'requested' => 'Requested',
'save' => 'Gem',
'select' => 'Select',
'search' => 'Search',
'select_category' => 'Select a Category',
'select_depreciation' => 'Select a Depreciation Type',
'select_location' => 'Select a Location',
'select_manufacturer' => 'Select a Manufacturer',
@@ -128,8 +136,8 @@
'select_user' => 'Select a User',
'select_date' => 'Select Date',
'select_statuslabel' => 'Select Status',
'select_company' => 'Select Company',
'select_asset' => 'Select Asset',
'select_company' => 'Select Company',
'select_asset' => 'Select Asset',
'settings' => 'Instillinger',
'sign_in' => 'Log ind',
'site_name' => 'Site Navn',
@@ -142,6 +150,7 @@
'type' => 'Type',
'undeployable' => 'Ikke implementerbar',
'unknown_admin' => 'Ukendt Admin',
'username_format' => 'Username Format',
'update' => 'Update',
'uploaded' => 'Uploaded',
'user' => 'Bruger',
+7
View File
@@ -0,0 +1,7 @@
<?php
return [
'sent' => 'Your password link has been sent!',
'user' => 'That user does not exist or does not have an email address associated',
];
@@ -3,8 +3,8 @@
return array(
'does_not_exist' => 'Diese Kategorie existiert nicht.',
'assoc_models' => 'This category is currently associated with at least one model and cannot be deleted. Please update your models to no longer reference this category and try again. ',
'assoc_items' => 'This category is currently associated with at least one :asset_type and cannot be deleted. Please update your :asset_type to no longer reference this category and try again. ',
'assoc_models' => 'Diese Kategorie kann nicht gelöscht werden da sie bereits mit einem Modell verbunden ist. Bitte trennen Sie diese Kategorie von Ihren Modellen und versuchen Sie es erneut. ',
'assoc_items' => 'Diese Kategorie kann nicht gelöscht werden da sie bereits mit einem :asset_type verbunden ist. Bitte trennen Sie diese Kategorie von Ihrem :asset_type und versuchen Sie es erneut. ',
'create' => array(
'error' => 'Die Kategorie konnte nicht erstellt werden, bitte versuchen sie es erneut.',
@@ -7,7 +7,7 @@ return array(
'cost' => 'Einkaufspreis',
'create' => 'Verbrauchsmaterial erstellen',
'date' => 'Kaufdatum',
'item_no' => 'Item No.',
'item_no' => 'Artikel Nr.',
'order' => 'Bestellnummer',
'remaining' => 'übrig',
'total' => 'Gesamt',
@@ -36,6 +36,12 @@ return array(
'invalidfiles' => 'Eine oder mehrere Ihrer Dateien ist zu groß oder deren Dateityp ist nicht zugelassen. Zugelassene Dateitypen sind png, gif, jpg, doc, docx, pdf, und txt.',
),
'import' => array(
'error' => 'Some Items did not import Correctly.',
'errorDetail' => 'The Following Items were not imported because of errors.',
'success' => "Your File has been imported",
),
'delete' => array(
'confirm' => 'Sind Sie sicher, dass Sie dieses Asset entfernen möchten?',
@@ -9,6 +9,7 @@ return array(
'date' => 'Kaufdatum',
'depreciation' => 'Abschreibung',
'expiration' => 'Ablaufdatum',
'license_key' => 'Product Key',
'maintained' => 'Verwaltet',
'name' => 'Software Name',
'no_depreciation' => 'Nicht abschreiben',
+7 -8
View File
@@ -2,15 +2,14 @@
return array(
'alert_email' => 'Alarme senden an',
'alerts_enabled' => 'Alerts Enabled',
'alert_interval' => 'Expiring Alerts Threshold (in days)',
'alert_inv_threshold' => 'Inventory Alert Threshold',
'alerts_enabled' => 'Alarme aktiviert',
'alert_interval' => 'Ablauf Alarmschwelle (in Tagen)',
'alert_inv_threshold' => 'Inventar Alarmschwelle',
'asset_ids' => 'Asset IDs',
'auto_increment_assets' => 'Erzeugen von fortlaufenden Asset IDs',
'auto_increment_prefix' => 'Präfix (optional)',
'auto_incrementing_help' => 'Aktiviere zuerst fortlaufende Asset IDs um dies zu setzen',
'backups' => 'Sicherungen',
'barcode_type' => 'Barcode Typ',
'barcode_settings' => 'Barcode Einstellungen',
'confirm_purge' => 'Bereinigung bestätigen',
'confirm_purge_help' => 'Geben Sie das Wort "Löschen" in das untere Feld ein um die gelöschten Einträge zu bereinigen. Dies kann nicht rückgängig gemacht werden.',
@@ -23,10 +22,10 @@ return array(
'display_asset_name' => 'Zeige Assetname an',
'display_checkout_date' => 'Zeige Herausgabedatum',
'display_eol' => 'Zeige EOL in der Tabellenansicht',
'display_qr' => 'Display Square Codes',
'display_alt_barcode' => 'Display 2D barcode',
'barcode_type' => 'Barcode Typ',
'alt_barcode_type' => '2D barcode type',
'display_qr' => 'Zeige quadratische Codes',
'display_alt_barcode' => 'Display 1D barcode',
'barcode_type' => '2D Barcode Type',
'alt_barcode_type' => '1D barcode type',
'eula_settings' => 'EULA Einstellungen',
'eula_markdown' => 'Diese EULA <a href="https://help.github.com/articles/github-flavored-markdown/"> erlaubt Github Flavored Markdown</a>.',
'general_settings' => 'Generelle Einstellungen',
@@ -2,24 +2,24 @@
return array(
'does_not_exist' => 'Standort nicht verfügbar.',
'assoc_users' => 'Dieser Ort ist mit mindestens einem Benutzer verknüpft und kann nicht gelöscht werden. Bitte Benutzer updaten, so dass dieser Standort nicht mehr verknüpft ist und erneut versuchen. ',
'does_not_exist' => 'Status Label does not exist.',
'assoc_assets' => 'This Status Label is currently associated with at least one Asset and cannot be deleted. Please update your assets to no longer reference this status and try again. ',
'create' => array(
'error' => 'Ort wurde nicht erstellt, bitte versuchen Sie es erneut.',
'success' => 'Ort erfolgreich erstellt.'
'error' => 'Status Label was not created, please try again.',
'success' => 'Status Label created successfully.'
),
'update' => array(
'error' => 'Ort wurde nicht aktualisiert, bitte erneut versuchen',
'success' => 'Ort erfolgreich aktualisiert.'
'error' => 'Status Label was not updated, please try again',
'success' => 'Status Label updated successfully.'
),
'delete' => array(
'confirm' => 'Bist du sicher, dass du diesen Status entfernen möchtest?',
'error' => 'Es gab einen Fehler beim Löschen des Orts. Bitte versuchen Sie es erneut.',
'success' => 'Der Ort wurde erfolgreich gelöscht.'
'confirm' => 'Are you sure you wish to delete this Status Label?',
'error' => 'There was an issue deleting the Status Label. Please try again.',
'success' => 'The Status Label was deleted successfully.'
)
);
+12
View File
@@ -0,0 +1,12 @@
<?php
return [
'send_password_link' => 'E-Mail zum Zurücksetzen des Passworts senden',
'email_reset_password' => 'Passwort zurücksetzen',
'reset_password' => 'Passwort zurücksetzen',
'login' => 'Login',
'login_prompt' => 'Melden Sie sich bitte an',
'forgot_password' => 'Ich habe mein Passwort vergessen',
'remember_me' => 'Angemeldet bleiben',
];
+1 -1
View File
@@ -5,7 +5,7 @@ return array(
'actions' => 'Aktionen',
'add' => 'Hinzufügen',
'cancel' => 'Abbrechen',
'checkin_and_delete' => 'Checkin & Delete User',
'checkin_and_delete' => 'Einchecken & User löschen',
'delete' => 'Löschen',
'edit' => 'Bearbeiten',
'restore' => 'Wiederherstellen',
+13 -4
View File
@@ -56,14 +56,20 @@
'depreciation' => 'Abschreibung',
'editprofile' => 'Profil bearbeiten',
'eol' => 'EOL',
'email_domain' => 'Email Domain',
'email_format' => 'Email Format',
'email_domain_help' => 'This is used to generate email addresses when importing',
'filastname_format' => 'First Initial Last Name (jsmith@example.com)',
'firstname_lastname_format' => 'First Name Last Name (jane.smith@example.com)',
'first' => 'Erstes',
'first_name' => 'Vorname',
'first_name_format' => 'First Name (jane@example.com)',
'file_name' => 'Datei',
'file_uploads' => 'Datei-Uploads',
'generate' => 'Generieren',
'groups' => 'Gruppen',
'gravatar_email' => 'Gravatar E-Mail Adresse',
'history' => 'History',
'history' => 'Historie',
'history_for' => 'Verlauf für',
'id' => 'Id',
'image_delete' => 'Bild löschen',
@@ -88,6 +94,7 @@
'location' => 'Standort',
'locations' => 'Standorte',
'logout' => 'Abmelden',
'lookup_by_tag' => 'Lookup by Asset Tag',
'manufacturer' => 'Hersteller',
'manufacturers' => 'Hersteller',
'markdown' => 'Dieses Feld erlaubt <a href="https://help.github.com/articles/github-flavored-markdown/"> Github Flavored Markdown</a>.',
@@ -114,12 +121,13 @@
'quantity' => 'Anzahl',
'ready_to_deploy' => 'Fertig zum herausgeben',
'recent_activity' => 'Letzte Aktivität',
'remove_company' => 'Firmenzuordnung entfernen',
'remove_company' => 'Firmenzuordnung entfernen',
'reports' => 'Berichte',
'requested' => 'Angefragt',
'save' => 'Speichern',
'select' => 'auswählen',
'search' => 'Suche',
'select_category' => 'Select a Category',
'select_depreciation' => 'Wähle einen Abschreibungstyp',
'select_location' => 'Wählen Sie einen Standort',
'select_manufacturer' => 'Wählen Sie einen Hersteller',
@@ -128,8 +136,8 @@
'select_user' => 'wähle einen Benutzer',
'select_date' => 'Datum auswählen',
'select_statuslabel' => 'Status auswählen',
'select_company' => 'Firma auswählen',
'select_asset' => 'Asset auswählen',
'select_company' => 'Firma auswählen',
'select_asset' => 'Asset auswählen',
'settings' => 'Einstellungen',
'sign_in' => 'Einloggen',
'site_name' => 'Seitenname',
@@ -142,6 +150,7 @@
'type' => 'Typ',
'undeployable' => 'Nicht herausgebbar',
'unknown_admin' => 'Unbekannter Administrator',
'username_format' => 'Username Format',
'update' => 'Aktualisieren',
'uploaded' => 'Hochgeladen',
'user' => 'Nutzer',
+7
View File
@@ -0,0 +1,7 @@
<?php
return [
'sent' => 'Ihr Link wurde verschickt!',
'user' => 'Dieser Benutzer existiert nicht oder hat keine E-Mail Adresse angegeben',
];

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