Compare commits

...

501 Commits

Author SHA1 Message Date
snipe ba39cbb5e0 Merge remote-tracking branch 'origin/develop' 2015-11-25 03:50:08 -08:00
snipe 34276984f3 Bumped version 2015-11-25 03:49:47 -08:00
snipe 2195e27d61 Added company_list to license clone 2015-11-25 03:48:05 -08:00
snipe 948be5c74b Updated language strings 2015-11-25 03:37:48 -08:00
snipe 93c582970c Merge remote-tracking branch 'origin/develop' 2015-11-25 03:19:34 -08:00
snipe 9624388522 Added company_list to clone asset 2015-11-25 03:19:13 -08:00
snipe 6abfb1b968 Merge remote-tracking branch 'origin/develop' 2015-11-25 02:47:48 -08:00
snipe 59b2b8c63e Switch to hash version for more consistent cookie resets 2015-11-25 02:47:21 -08:00
snipe 658462cda5 Merge remote-tracking branch 'origin/develop' 2015-11-25 02:39:13 -08:00
snipe dad1ffb355 Specify table name in select to prevent id overwriting 2015-11-25 02:38:13 -08:00
snipe 12b82d6679 Merge remote-tracking branch 'origin/develop' 2015-11-25 00:22:31 -08:00
snipe 20490986c6 Fixes #1325 - zenbra striping and borders on table for money value clarity 2015-11-24 23:43:10 -08:00
snipe 64eecc8df7 Added image to model listing view for #1370 2015-11-24 23:24:20 -08:00
snipe 0f33bad1b6 Commented out version of export all
This still works sorta wonky, and only exports 50 per page. Possibly related to https://github.com/wenzhixin/bootstrap-table/issues/1576
2015-11-24 23:15:01 -08:00
snipe 632fa92f92 Fixes #1333 - hide checkout button if asset status is not deployable 2015-11-24 22:49:31 -08:00
snipe 99391d0179 Fixes #1332 - added location to accessories 2015-11-24 22:43:13 -08:00
snipe c6c6bd02bb Possible fix for weird UTF-8 issues 2015-11-24 22:30:00 -08:00
snipe 904ddddce9 Removed consumable search sicne it doesn't do anything yet 2015-11-24 22:20:13 -08:00
snipe d34e7178b3 Order consumable assignments by most recent 2015-11-24 22:18:28 -08:00
snipe 0428d21c5e Order consumable assignments by most recent 2015-11-24 22:18:16 -08:00
snipe d8b43215b0 Fix for missing admin ID 2015-11-24 22:00:29 -08:00
snipe b39c53a5ea Closes #1375 - More data in consumables detail view 2015-11-24 21:58:30 -08:00
snipe 67e968b032 Fixed attach() timestamps 2015-11-24 21:52:29 -08:00
snipe 032aabeadd Bumped version 2015-11-24 20:34:16 -08:00
snipe 1202ce4a81 Compound search for consumables 2015-11-24 20:34:10 -08:00
snipe 406e077c1e Fixed indenting 2015-11-24 20:34:00 -08:00
snipe 4be046a675 Fixes #1387 - adds server-side compound search 2015-11-24 20:33:51 -08:00
snipe 535263788d Fixed dumb indenting 2015-11-24 20:20:34 -08:00
snipe 29bb6a3c4f Fixed issue where deleted asset tags could not be re-used
This was by-design to start off with, since it would b weird to re-use an asset tag that legitimately belonged to someone else, however sometimes when assets are accidentally deleted and users don't restore them (or if there were weird duplicates), this can be problematic.
2015-11-24 20:20:28 -08:00
snipe f04e4b1fb4 Bumped version 2015-11-24 19:38:23 -08:00
snipe c8c755f8c3 Fixed filename renaming 2015-11-24 19:38:13 -08:00
snipe 287c7735b6 Added CSRF token for upload 2015-11-24 19:37:59 -08:00
snipe 2a28c73845 Importer fixes - check for asset before inserting 2015-11-24 19:37:37 -08:00
snipe 3dc0381e2b Updated contributing docs 2015-11-24 18:05:48 -08:00
snipe a3dbd87f9f Fixed weird company table styles 2015-11-24 13:47:43 -08:00
snipe 6d42d2c614 Fixed bootstrap class for button 2015-11-24 13:44:58 -08:00
snipe e910b532c7 Account for invalid categories 2015-11-24 13:31:54 -08:00
snipe a777499c0b Fixes #1376 - added new fields to consumables view 2015-11-24 13:30:05 -08:00
snipe b99c138cb0 Fixes #1369 - fixed searching/sorting on location 2015-11-24 12:48:41 -08:00
snipe cbb2151f1a Allow re-use of usernames 2015-11-24 12:29:25 -08:00
snipe 256f33e6b4 Company/category search on accessories 2015-11-24 12:08:49 -08:00
snipe 59315878c3 Bumped version 2015-11-24 11:47:40 -08:00
snipe f6e2654609 Added searching on company name, ordering on company name for PR #1321 2015-11-24 11:47:34 -08:00
snipe 4ad241e65e Merge pull request #1386 from RealEnder/develop
Add Bulgarian lev and replace tabs
2015-11-24 10:51:55 -08:00
snipe 808b66b9f5 Merge pull request #1384 from merid14/develop
Moved installer to snipeit.sh for logging
2015-11-24 10:50:46 -08:00
Walter edbfdc6eb1 pointed wget to snipe master 2015-11-24 09:13:01 -05:00
Alex Stanev 716c459985 Fix ident 2015-11-24 12:30:28 +02:00
Alex Stanev ef011cdf7e Add Bulgarian lev 2015-11-24 12:25:57 +02:00
snipe b93f36a856 Bumped version 2015-11-23 21:04:47 -08:00
snipe e60c0e3b4d Warning message about EOL 2015-11-23 21:04:41 -08:00
snipe 407b341510 Updated bootstrap tables 2015-11-23 20:57:18 -08:00
snipe 120c8394bb Fixes #1380 - groups pagination 2015-11-23 19:18:00 -08:00
snipe cc17862eae Back out the encryption constructor for now 2015-11-23 18:18:49 -08:00
snipe c24f1721d7 Bumped version 2015-11-23 17:44:00 -08:00
snipe c80f1789d4 Set default hasher in constructor 2015-11-23 17:43:53 -08:00
snipe 4a49e6f471 Added popover code 2015-11-23 17:43:43 -08:00
snipe e9f4be711a Added required fields 2015-11-23 17:43:35 -08:00
snipe 1bccb6127e Merge branch 'develop' of github.com:snipe/snipe-it into develop 2015-11-23 15:18:22 -08:00
snipe 61107769e8 Add user ID and make company name hidden by default 2015-11-23 15:18:10 -08:00
snipe 4e96a5a793 Merge pull request #1374 from vabue/features/ukrainian-currency
Add ukrainian and russian currencies for #1373
2015-11-23 15:17:24 -08:00
snipe f87a25bf3f Moved company down further, since it's not used as often 2015-11-23 14:44:08 -08:00
snipe 4ae02c1fb3 Merge pull request #1321 from Ahimta/multiple-companies
Add support for multiple companies
2015-11-23 14:40:37 -08:00
snipe 9ec132acde Small fixed for LDAP in settings table 2015-11-23 14:33:00 -08:00
snipe 318b4b48c6 Fixes null value for LDAP settings 2015-11-23 14:11:55 -08:00
snipe 329a2282e4 Merge pull request #1357 from merid14/features/ldap-settings
Features/ldap settings
2015-11-23 14:10:44 -08:00
Wahlstedt, Walter f8014c4677 Insure running as root. added comment
added comment to ubuntu installer so people know to wait.
2015-11-23 16:37:54 -05:00
Walter 7a07c07e29 removed password insert to database 2015-11-23 16:16:05 -05:00
Wahlstedt, Walter 4b926f015b fixed typo in installer 2015-11-23 16:08:02 -05:00
Wahlstedt, Walter aa834aa72b Merged changes to new snipeit.sh install file. 2015-11-23 16:04:12 -05:00
Wahlstedt, Walter 400b97c40a Merge remote-tracking branch 'refs/remotes/snipe/develop' into develop
Conflicts:
	install.sh
2015-11-23 16:02:59 -05:00
Wahlstedt, Walter 8394212df7 update tzone for centos7 2015-11-23 15:49:08 -05:00
Wahlstedt, Walter 2487ce42e3 remove installers 2015-11-23 15:22:39 -05:00
Wahlstedt, Walter fb59ad9fe6 remove force root 2015-11-23 15:15:08 -05:00
Wahlstedt, Walter 8af5fd0384 Merge remote-tracking branch 'origin/develop' into develop
Conflicts:
	snipeit.sh
2015-11-23 14:43:00 -05:00
Wahlstedt, Walter 4de42f69ba adding some IO redirection 2015-11-23 14:40:15 -05:00
Walter 620d4754c0 install epel repo before IUS 2015-11-22 23:15:01 -05:00
Walter 6ea3bedb9e set decryption and set pword in migraiton 2015-11-22 23:08:18 -05:00
Walter 840e5b1523 Revert "begin work on idap import button"
This reverts commit 3942fd1869.
2015-11-22 11:10:36 -05:00
Walter 1ee3f29d2e Revert "working on ldap import button"
This reverts commit 113dfc9c24.
2015-11-22 11:02:19 -05:00
Walter 6b26640077 Merge remote-tracking branch 'refs/remotes/snipe/develop' into features/ldap-settings 2015-11-22 11:01:07 -05:00
Val Budkin 964d2bc463 Add ukrainian and russian currencies for #1373 2015-11-22 17:50:08 +02:00
Abdullah Alansari e4a634a8a3 Merge remote-tracking branch 'upstream/develop' into multiple-companies 2015-11-21 11:27:00 +03:00
Abdullah Alansari 5445a7d16b Scope users like other companyables
Note that the User model doesn't use global scope,
global models can have unexpected results that
would very likely break many parts of the application
2015-11-21 11:23:42 +03:00
Abdullah Alansari 86a174201e Only users with no company or supers can manage users' companies 2015-11-21 04:30:15 +03:00
Abdullah Alansari 7a03a56498 Fix: company field required 2015-11-21 03:59:12 +03:00
snipe 01b574069a Fixes #1362 - status labels losing type on edit 2015-11-20 09:20:14 -08:00
snipe cc930fc5b8 Fixed links to getting help and common issues 2015-11-20 09:19:45 -08:00
snipe 67a58221eb Fixes #1368 - typos in installer 2015-11-20 07:30:40 -08:00
Walter a0f2ad5d54 point to dev 2015-11-19 21:32:58 -05:00
Walter 2c7553e81e Setting up logging for the install script 2015-11-19 21:15:47 -05:00
Abdullah Alansari e82ede5d44 Fix: some Company functions throw when seeding the DB 2015-11-19 09:44:06 +03:00
Abdullah Alansari e91a22fce0 Fix assumeng Setting::getSettings() is not null in Company
Breaks the TravisCI build:
> php artisan db:seed --no-interaction -vvv
[ErrorException]
Trying to get property of non-object
2015-11-19 09:32:36 +03:00
Abdullah Alansari 31ecd165a3 Merge remote-tracking branch 'upstream/develop' into multiple-companies 2015-11-19 09:24:57 +03:00
Abdullah Alansari fe44846c1b Fix: only super users can change multiple companies support option 2015-11-19 09:17:50 +03:00
Abdullah Alansari c708a24657 Restrict backups to super users 2015-11-19 09:13:20 +03:00
Abdullah Alansari dbdc2c8e64 Fix some typos (e.g: companayable) 2015-11-19 08:48:43 +03:00
Abdullah Alansari e66e2e42d3 Use global scope for companyable children 2015-11-19 08:42:17 +03:00
Abdullah Alansari a598fdcb59 Add global scope for companyable children 2015-11-19 08:03:19 +03:00
Abdullah Alansari 177fadba8a Add better scoping for companayable children 2015-11-19 07:41:32 +03:00
snipe 1fe5bd3770 Merge remote-tracking branch 'origin/develop' 2015-11-18 14:29:53 -08:00
snipe 2b26fd7e20 Fixed string in gh-changelog 2015-11-18 14:29:29 -08:00
snipe 7a0598dfc3 Pulled naughty language from changelog 2015-11-18 13:56:13 -08:00
snipe 5ebb267a53 Updated changelog script 2015-11-18 13:52:57 -08:00
Wahlstedt, Walter 638a7773bd syntax error 2015-11-18 16:36:02 -05:00
Wahlstedt, Walter 113dfc9c24 working on ldap import button
add route for button
added button and open/close for form
2015-11-18 16:22:04 -05:00
Walter 3942fd1869 begin work on idap import button 2015-11-18 12:11:42 -05:00
Abdullah Alansari d2423b2fc8 Show company name for the remaining entities 2015-11-18 19:15:56 +03:00
Abdullah Alansari 08781a561b Fix: use global scope for companies support
Use Eloquent ORM global scope instead of using
Company::scopeCompanayables() all over the place.

In addition, this makes it harder to for a user
that is assigned to a company to access unauthorized
assets through other entities (e.g: license seats)
2015-11-18 16:49:34 +03:00
Abdullah Alansari 8fb7d82bab Fix no admin/consumables route 2015-11-18 16:46:29 +03:00
Abdullah Alansari ced2a99031 Add Eloquent global scope for companayables 2015-11-18 09:29:35 +03:00
Abdullah Alansari 0a97c626e7 Fix $inout used when undefined 2015-11-18 07:16:53 +03:00
Abdullah Alansari 6478425be6 Fix dashboard shows all companies
Fix dashboard page shows statistics of all companies
even when the user is assigned to a company
and full multiple companies support is enabled
2015-11-18 06:14:08 +03:00
Abdullah Alansari 999910f31f Fix 'use' used with non-compound
Fix "The use statement with non-compound name '{Lang,Sentry,Setting}' has no effect"
2015-11-18 05:35:27 +03:00
Wahlstedt, Walter 73a183677d Revert "add escaping to ldap fields in blades"
This reverts commit 1d24450dcd.
2015-11-17 16:12:24 -05:00
Wahlstedt, Walter 1d24450dcd add escaping to ldap fields in blades 2015-11-17 16:06:55 -05:00
Wahlstedt, Walter 6f338e573c set required_if ldap_enabled box has been checked. 2015-11-17 16:00:52 -05:00
Wahlstedt, Walter 8e44421788 added Crypt class and set ldap_pword field to longText 2015-11-17 15:20:55 -05:00
Wahlstedt, Walter e031239cf0 Removed escaping, add sometimes required, add encrypt ldap password 2015-11-17 13:49:59 -05:00
snipe 21a280676b Merge pull request #1356 from merid14/develop
Set default to not seed DB
2015-11-17 09:34:38 -08:00
Wahlstedt, Walter ac44140d83 fix edit blades 2015-11-17 10:50:39 -05:00
Wahlstedt, Walter c8ecddba54 Revert "Set required fields if ldap is enabled"
This reverts commit 2f69be03d3.
2015-11-17 10:47:59 -05:00
Wahlstedt, Walter 2f69be03d3 Set required fields if ldap is enabled 2015-11-17 10:46:29 -05:00
Wahlstedt, Walter 7e8a0af6e5 Set default to not seed DB 2015-11-17 10:12:26 -05:00
Wahlstedt, Walter 63cd0c1ae1 Merge remote-tracking branch 'refs/remotes/snipe/develop' into features/ldap-settings 2015-11-17 10:11:38 -05:00
Wahlstedt, Walter 8a014d4bd3 update ldap integration 2015-11-17 10:00:06 -05:00
Wahlstedt, Walter 8793a04869 add ldap integration to settings page. 2015-11-17 09:59:20 -05:00
Wahlstedt, Walter d72df21b3b Update migration and blades 2015-11-16 16:31:43 -05:00
Wahlstedt, Walter 08d0fe5118 change tables from text to string/int 2015-11-16 13:21:00 -05:00
Wahlstedt, Walter 2ec5f340e8 update validators and lang 2015-11-16 13:08:51 -05:00
Wahlstedt, Walter 3e1e9b0077 syntax errors 2015-11-16 12:48:41 -05:00
Wahlstedt, Walter 937249b960 enable ldap import if data exists in database 2015-11-16 12:38:47 -05:00
Wahlstedt, Walter 50ea6c66f9 LDAP Settings update
update ldap field names
add ldap fields to controllers
add ldap fields to migration
add lang fields
update edit page
2015-11-16 11:30:51 -05:00
Wahlstedt, Walter 0910d9cf8c correct name of migration 2015-11-16 09:44:06 -05:00
Walter 30e8555148 updating users controller to work with database fields 2015-11-15 22:48:56 -05:00
Walter 8f6c37c301 add ldap to en lang 2015-11-15 22:22:42 -05:00
Abdullah Alansari b202e01205 Add full multiple companies support
Added as an option in settings.
When enabled, users (including admins) who are assigned
to companies have access only to their companies' assets.
2015-11-16 06:03:27 +03:00
Walter 7f9fab0055 adjusted settings 2015-11-15 21:42:49 -05:00
snipe b210d90148 Merge remote-tracking branch 'origin/develop' 2015-11-13 12:07:34 -08:00
Abdullah Alansari 23d10a8f7f Make company field optional
Company field is now optional for the user,
although still required in the controllers.
2015-11-13 09:19:18 +03:00
Abdullah Alansari d8df61bd32 Merge remote-tracking branch 'upstream/develop' into multiple-companies
Conflicts:
	app/controllers/admin/UsersController.php
	app/views/backend/hardware/index.blade.php
2015-11-12 09:30:11 +03:00
Walter 12912b3e27 adjusting the migration 2015-11-11 23:43:02 -05:00
Walter d9cd4a4da0 setting up views for ldap 2015-11-11 23:03:46 -05:00
snipe 2afc252549 Link to category listing from accessories 2015-11-11 17:43:24 -08:00
snipe aa05d041bd Fixes #1324 - missing $inout variable when if/else not met 2015-11-11 17:22:28 -08:00
snipe bbe0189be2 CSS for max image size on asset view 2015-11-11 16:06:17 -08:00
snipe a0599712a6 Show model image if available and no asset image 2015-11-11 16:06:07 -08:00
snipe 1a4926ce13 Sort by asset image for PR #1330 2015-11-11 15:57:41 -08:00
snipe 3c8959e92d Bumped version 2015-11-11 15:56:10 -08:00
snipe ab3871f678 Small changes for PR #1330 2015-11-11 15:56:01 -08:00
snipe 7297a6031e Merge pull request #1330 from mtucker6784/develop
Images for devices on the Assets datatable page.
2015-11-11 15:51:31 -08:00
snipe 75bd29b027 Added cookie expiration for sorting/filtering 2015-11-11 14:50:17 -08:00
snipe b77b9c0434 Merge pull request #1323 from merid14/develop
Enhancements for installer
2015-11-10 18:02:47 -08:00
snipe b9c36f8638 Fixes #1335 - editing maintenance 2015-11-10 18:02:06 -08:00
Walter ecae451ebf form validation 2015-11-09 22:34:18 -05:00
Walter 9627f15412 update settings controller to add ldap field validation 2015-11-09 22:32:00 -05:00
Walter 464f11c398 setting up bones for ldap settings
add migration
add ldap settings to settings controller
add ldap fields edit settings views
2015-11-09 22:09:09 -05:00
mtucker6784 90009db1b5 Image is now recorded upon initial asset creation. 2015-11-09 12:01:31 -07:00
mtucker6784 d7f8d0fc04 Changed image save location in AssetsController 2015-11-09 09:35:10 -07:00
mtucker6784 effad46cc0 create assets image directory 2015-11-09 09:16:53 -07:00
mtucker6784 4509631921 Add image column migration 2015-11-09 08:47:05 -07:00
mtucker6784 d1a306cfd8 Yay, asset image progress! 2015-11-09 08:25:29 -07:00
Walter 2de4741170 Add password confirmation, hide password and set default database seed to no 2015-11-07 22:21:07 -05:00
Walter fc609ece12 Merge remote-tracking branch 'refs/remotes/snipe/develop' into develop 2015-11-07 22:13:48 -05:00
snipe ecfd1b2693 Merge remote-tracking branch 'origin/develop' 2015-11-07 15:54:37 -08:00
snipe a8da68d3fd Fixes #1320 - added name for cookie table 2015-11-07 15:53:39 -08:00
snipe 69970d1296 Merge remote-tracking branch 'origin/develop' 2015-11-07 15:44:27 -08:00
snipe ef7c7da4e5 Merge pull request #1302 from merid14/develop
Reworked the Installer
2015-11-07 15:42:06 -08:00
snipe 306d8ebaf7 Fixes #1317 - regression issue in bulk delete 2015-11-07 15:40:25 -08:00
snipe 250880c6f3 Include default text in status label helper 2015-11-07 15:39:03 -08:00
Abdullah Alansari 6bf2a2875f Add initial support for multiple companies
You can find screenshots and other files
related to the feature on Dropbox here:
https://www.dropbox.com/sh/wugnzqepwgzwlnh/AAAwNWA5hIKrP0y2VTu-LMHHa?dl=0

https://github.com/snipe/snipe-it/issues/23
2015-11-07 15:22:10 +03:00
Walter 9f43b6af9f fixed apache config file 2015-11-06 15:17:54 -05:00
Walter a47a4e83e2 fixed issues with sed command and / 2015-11-06 11:53:07 -05:00
Walter ca1384504a fixed tzone variable assignment 2015-11-06 10:03:58 -05:00
Walter fc6bb7f056 sets the timezone automatically 2015-11-06 09:02:51 -05:00
Walter 62cee46a83 update webdir for debian and fix the error logs 2015-11-06 08:30:51 -05:00
Walter c94ece2925 changed replace for sed command 2015-11-05 21:42:20 -05:00
Walter 5d5882ea5b moved the permissions changes to the end 2015-11-05 21:40:51 -05:00
Walter 61fc912c47 moving permisions block and some mysql stuff 2015-11-05 16:25:03 -05:00
Walter e54bbcd37f working on debian installer 2015-11-04 21:14:19 -05:00
snipe c1961c0e40 Merge pull request #1313 from mtucker6784/develop
Make Model column a hyperlink to access the model page.
2015-11-04 15:26:25 -08:00
Michael T 11c2fcd094 Remove new window target 2015-11-04 16:10:27 -07:00
Michael T b856e7f2c6 Make Model column a hyperlink to access the model page. 2015-11-04 15:55:41 -07:00
snipe 7a84d1061b Merge remote-tracking branch 'origin/develop' 2015-11-04 14:04:23 -08:00
Walter 56b50468d2 fixed packages for centos6 2015-11-04 16:01:25 -05:00
Walter c7057f550f removed a var 2015-11-04 10:08:04 -05:00
Walter 037cda36b2 formatting 2015-11-04 09:17:16 -05:00
Walter f3de39efd6 syncing centos 6 and centos 7
wasnt replacing production.yourserver.com with the fdqn. took out
http://
changed .conf file name to $name.conf instead of $fdqn.conf
2015-11-04 09:06:48 -05:00
snipe af5c221385 Updated language strings 2015-11-04 03:42:37 -08:00
snipe feb74806a8 Removed models override 2015-11-04 01:08:17 -08:00
snipe 14ba5a3b77 Fixes #1310 - adds version hash to table name to prevent cookie issues for folks who pull from dev 2015-11-04 01:08:05 -08:00
snipe bc8c8e4225 Fixes #1012 - more consistency in manufacturer view 2015-11-04 00:48:53 -08:00
snipe dc64ad55ee Fixed link to manufacturers view 2015-11-04 00:37:43 -08:00
snipe 7e2b4183f6 Added in/out to categories 2015-11-04 00:37:27 -08:00
snipe 0a843fa856 OMFG really? 2015-11-04 00:18:22 -08:00
snipe 5a687f280f One more currency tweak 2015-11-04 00:15:35 -08:00
snipe 4b2e7b9b06 Fixes #1013 - show location name on asset view page 2015-11-04 00:13:48 -08:00
snipe 1ac41a72ec Link to asset in asset maintenance screen 2015-11-04 00:07:00 -08:00
snipe 6e117efebd Fixed dumb indenting 2015-11-03 23:58:12 -08:00
snipe 17207ddea1 Fixed table cookie name 2015-11-03 23:57:58 -08:00
snipe 130b1b4f4a Converted category asset listing to bootstrap tables for #1266 2015-11-03 23:57:31 -08:00
snipe 8a7981a4ae Updated currency array 2015-11-03 22:49:34 -08:00
snipe 90513b06f5 Removed duplicate UK/GB 2015-11-03 22:23:33 -08:00
snipe 750fc84592 Updated seeder with currency 2015-11-03 22:22:10 -08:00
snipe 2a43491792 Fixes #1291 on the asset view as well 2015-11-03 22:19:58 -08:00
snipe f4331f4498 Fixes #1291 - use location currency and fall back to defaul currency for asset maintenances 2015-11-03 22:04:57 -08:00
Walter 0d1544c3d6 Fixing some package issues and syntax errors 2015-11-03 16:29:18 -05:00
Walter 958672dfd3 Fixed missing vars and typos 2015-11-03 14:12:21 -05:00
Walter 7355fd9ebe Merge remote-tracking branch 'origin/develop' into develop
Conflicts:
	install.sh
2015-11-03 13:39:12 -05:00
Walter 5df26f9b0a Fixed the ubuntu install portion that i broke 2015-11-03 13:33:03 -05:00
snipe a587b72c71 Fixed dumb indenting 2015-11-02 20:11:26 -08:00
snipe 0b0b55619b Fixes #1291 - Use current currency, or sane fallback 2015-11-02 20:06:06 -08:00
snipe a760a7575a Added user notes back in 2015-11-02 19:28:51 -08:00
snipe a86f0e6178 Bumped version 2015-11-02 19:27:23 -08:00
snipe 577c193661 Fixed bug in location import 2015-11-02 19:27:07 -08:00
snipe f147a0ff02 Fixed user table name 2015-11-02 19:26:33 -08:00
snipe 0745ec1502 Fixed scope for users 2015-11-02 19:26:10 -08:00
snipe 5bed0482b6 Bumped version 2015-11-02 19:17:33 -08:00
snipe 9731727095 Sorting for #1266 2015-11-02 19:17:20 -08:00
snipe 769fb13282 Search on manager name for #1266 2015-11-02 18:37:16 -08:00
snipe a9e1283a17 Added search on location parent for #1266 2015-11-02 18:36:49 -08:00
snipe 5bb94c4b4e Added fields to location assets display 2015-11-02 17:42:47 -08:00
snipe 67a113cbf4 Additional fields for location assets display 2015-11-02 17:41:58 -08:00
snipe d0eed67c42 Fixed relationship to return actual assets 2015-11-02 17:41:33 -08:00
snipe 9cc542aea9 Merge branch 'develop' of github.com:snipe/snipe-it into develop 2015-11-02 16:45:44 -08:00
snipe 725ca04ac8 Bumped version 2015-11-02 16:45:30 -08:00
snipe e07dcf2598 Added location detail view 2015-11-02 16:45:19 -08:00
snipe 712e415f4d Updated deleted seats language 2015-11-02 16:45:02 -08:00
snipe c8551367cb Moved sample file so people can't accidentally import it 2015-11-02 16:44:46 -08:00
snipe 5c820d49a6 Fixes #1305 2015-11-02 16:44:17 -08:00
Walter 9f12b6a084 Should be read to merge! 2015-11-01 11:35:33 -05:00
Walter 187ab53c18 centos > ubuntu :) 2015-11-01 11:03:02 -05:00
Walter e35de90806 Version checking should work now 2015-11-01 10:57:25 -05:00
Walter 800100c0cc working on centos 6 switch case 2015-10-30 21:26:59 -04:00
snipe fbd79fc943 Merge pull request #1298 from MicaelRodrigues/snipeMike
Create user on the fly from sucessful LDAP authentication, if it does not already exist.
2015-10-30 16:22:12 -07:00
Walter 7e6d142c1f Moving more stuff to the tmp dir 2015-10-30 00:00:07 -04:00
Walter da17603be1 use tmp dir and set mariadb root pass
use /tmp/snipeit for working with files and clean that up at the end.
also use mysql_secure_installation to set the root password instead of
setting it and making the user input it again.
2015-10-29 23:41:22 -04:00
Walter 34530b209f working on case statement 2015-10-29 22:54:26 -04:00
Walter 760e2fca01 Changed from if/else to case statement
I changed the if/else statement to a case statement so that we can do
multiple os/versions. Also added the working code for CentOS 7 that I
will backport to CentOS 6. Need to add OS version detection.
2015-10-29 22:31:45 -04:00
Walter d1e977b85a force sudo 2015-10-29 22:10:56 -04:00
Walter 21cc1e9aec more formatting 2015-10-29 22:04:28 -04:00
Walter 346090ebff removing un-needed echo 2015-10-29 21:51:44 -04:00
Walter 40ca02481d Working on formatting
Added a banner and made the formatting a little easier to follow
2015-10-29 20:54:49 -04:00
Micael Rodrigues b39944b2d7 Create user on the fly from sucessful LDAP authentication, if it does not already exists. 2015-10-28 23:01:45 +00:00
snipe e0fccc8fc9 Possible fix for #1296? Can't reproduce locally 2015-10-28 05:53:28 -07:00
snipe 76968f7d48 Fixes asset model table sorting 2015-10-28 03:23:55 -07:00
snipe 5436d54aa0 Fixes #1290 - datatable broken for assets in model 2015-10-28 02:10:04 -07:00
snipe b6f4080b97 Fixes consumable detail view 2015-10-26 14:36:55 -07:00
snipe 09bcb137c4 Ugly fix for preventing errors if there is an invalid model (therefore no category) 2015-10-23 21:22:42 -07:00
snipe 8ec6b7e03a Basic location ordering for #1266 2015-10-23 21:19:22 -07:00
snipe efddda8665 Fixed expected_checkin error on asset view 2015-10-23 18:28:06 -07:00
snipe 48e6ebe306 Make EOL not sortable anymore, since that sort doesn't work 2015-10-23 18:15:27 -07:00
snipe eb1335405b Order by last_checkout and expected_checkin for #1266 2015-10-23 17:59:21 -07:00
snipe 8a1ffb9014 Save de-normed values for last checkout and expected_checkin 2015-10-23 17:55:03 -07:00
snipe ec4b2f114d Merge pull request #1283 from snipe/features/checkout_time
Migration to add last_checkout and expected_checkin fields to Asset
2015-10-23 17:47:45 -07:00
Brady Wetherington 9a5edb3db7 Migration to add last_checkout and expected_checkin fields to Asset 2015-10-23 17:40:04 -07:00
snipe f0557f8e1c Added expected Checkin scope
Neither this nor the methd above actually work tho. Need to spend some time on the complex joins and sorting
2015-10-23 15:25:02 -07:00
snipe 2953b395f2 Added order number to allowed sort columns 2015-10-23 15:12:06 -07:00
snipe e9050826ec Added order number if one is being searched on 2015-10-23 14:49:58 -07:00
snipe 20e7888bd9 Fixed expected checkin on view 2015-10-23 14:36:20 -07:00
snipe e93b53ad4c Updated maintenance mode message 2015-10-23 14:35:42 -07:00
snipe 0a3843393d Addec expected_checkout, fixed language calls to use blade syntax 2015-10-23 14:35:31 -07:00
snipe 60f403f555 Expected checkin is a date, not a datetime 2015-10-23 14:29:00 -07:00
snipe cf49920564 Fixes #1235 - 24 hour format for log 2015-10-23 12:39:22 -07:00
snipe aaf2c6fbce Updated licenses and unaccepted assets to use bootstrap tables for #1266 2015-10-22 03:28:12 -07:00
snipe 9a63cbbd6c Removed download button 2015-10-22 03:22:59 -07:00
snipe 0aeab1ab7e Remove CSV export button 2015-10-22 03:13:30 -07:00
snipe 4c3a5a99df Use client-side bootstrap tables for reports 2015-10-22 03:11:34 -07:00
snipe 60370b9627 Added acceptance methods back in 2015-10-22 03:10:43 -07:00
snipe df986c7cfe Minor indenting edits 2015-10-22 03:10:25 -07:00
snipe a3f5dc331d Fixes #1007 and #1053 2015-10-22 02:11:39 -07:00
snipe af6a3dcccd Updated sample data 2015-10-22 01:14:21 -07:00
snipe 7901b49503 Updated sample file 2015-10-22 00:18:44 -07:00
snipe 8ea40d4e6d Fixes default value for strict mode 2015-10-22 00:17:45 -07:00
snipe 1bdd5886e6 Select * because reasons 2015-10-21 23:58:07 -07:00
snipe 9c71d34761 Merge pull request #1276 from madd15/patch-5
return getEdit to correct method
2015-10-21 23:40:53 -07:00
madd15 79a69d7633 return getEdit to correct method 2015-10-22 17:10:02 +10:30
snipe 27799dc78a Nicer activity report display
(This needs the API/Bootstrap tables treatment soon)
2015-10-21 23:39:45 -07:00
snipe 4cb19d1aae More eager loading, pass $statuslabel_types to view 2015-10-21 23:31:28 -07:00
snipe c91113ac95 Eager load accessories 2015-10-21 23:25:33 -07:00
snipe eb5649d0b3 Eager load assets 2015-10-21 23:25:23 -07:00
snipe f06af97364 Account for no limit or offset passed 2015-10-21 23:23:22 -07:00
snipe b1d5812ae2 Fixed categorys page 2015-10-21 23:19:27 -07:00
snipe 2e044bf0a3 Fixed category bug 2015-10-21 23:18:40 -07:00
snipe bd418d1422 Eager load some models 2015-10-21 23:17:22 -07:00
snipe 440bc1a4b4 Fixes bug in people display 2015-10-21 23:15:35 -07:00
snipe dba7983189 Added new fields to index view 2015-10-21 23:07:23 -07:00
snipe 5ff75e7f42 Merge remote-tracking branch 'origin/develop-bootstrap-tables-integration' into develop
# Conflicts:
#	app/controllers/admin/CategoriesController.php
#	app/views/backend/accessories/view.blade.php
#	app/views/backend/categories/index.blade.php
#	app/views/backend/settings/edit.blade.php
2015-10-21 23:06:43 -07:00
snipe 69c95f1f73 Merge pull request #1225 from ddreier/1088-acc-prices
Accessory and Consumable Price info #1088
2015-10-21 22:44:14 -07:00
snipe 30bbc9ad46 Merge pull request #1238 from Miliamber/develop
Added fixed icon width in navbar and new branding options
2015-10-21 22:43:30 -07:00
snipe 059993b064 Make groups table responsive 2015-10-21 22:41:50 -07:00
snipe ed612287ee Merge pull request #1273 from ddreier/ldap-auth-harden
Change LDAP auth to better handle no user found
2015-10-21 22:38:02 -07:00
snipe ba7b56f5d7 Merge pull request #1274 from patgmac/patch-2
Typo in package name
2015-10-21 22:37:07 -07:00
snipe 5b5d262d3c Merge pull request #1275 from ddreier/custom-report-purchase-cost
Fixes Purchase Cost not showing up on custom reports
2015-10-21 22:36:38 -07:00
snipe 9d6608c8f1 Asset maintenances for #1266 2015-10-21 22:19:02 -07:00
snipe 28fcd2b8ab Fixed indenting 2015-10-21 21:31:38 -07:00
snipe 7087e86ca5 Nicer (tho non-ajaxy) table 2015-10-21 21:23:58 -07:00
snipe bf32e89e0c Corrected delete modal string for #1266 2015-10-21 19:46:50 -07:00
snipe 7a306cd0f0 Depreciations bootstrap tables for #1266 2015-10-21 19:43:09 -07:00
snipe 95b033bdb8 Load table export helpers locally 2015-10-21 19:33:22 -07:00
snipe ea4dfdd50c Status labels for #1266 2015-10-21 19:24:01 -07:00
snipe 0b87357f3b Search text method for #1266 2015-10-21 19:10:00 -07:00
snipe 9c914e7ef5 New API routes for #1266 2015-10-21 19:09:47 -07:00
snipe 68e7941c21 Added hidden ID field for #1266 2015-10-21 19:09:35 -07:00
snipe f761b2e953 Suppliers for #1266 2015-10-21 19:09:20 -07:00
snipe e03f07bb44 Manufacturers for #1266 2015-10-21 19:09:02 -07:00
snipe 0c830fa564 Added hidden ID column 2015-10-21 19:08:30 -07:00
Daniel Dreier 8ad220701e Fixes Purchase Cost not showing up on custom reports 2015-10-21 20:24:07 -05:00
Patrick Gallagher 7087a191c6 Typo in package name
php-gd should be php5-gd.
2015-10-21 21:18:06 -04:00
snipe d1192095d0 Fix for showing deleted items 2015-10-21 18:05:27 -07:00
snipe 348a566f89 More responsive fixes 2015-10-21 18:05:03 -07:00
Daniel Dreier 9724d118e6 Changing the comparison to not care about type allows for auth to fail when no user is found in the LDAP directory. 2015-10-21 19:17:55 -05:00
snipe b18be5aee8 Fixed relationshop again? 2015-10-21 16:14:15 -07:00
snipe 7dc0039c3b Fixed parent relationship 2015-10-21 16:01:54 -07:00
snipe 218c76592c Added currency to display table for #1266 2015-10-21 16:01:44 -07:00
snipe b5b8865b36 Locations in bootstrap tables for #1266 2015-10-21 15:43:12 -07:00
snipe a896bb0eff Updated categories with cookie and export stuff for #1266 2015-10-21 15:42:59 -07:00
snipe 36a3d655ad Added cookie name to make column cookies work 2015-10-21 15:15:04 -07:00
snipe e12e2f2c7c Updated BS tables library 2015-10-21 14:49:58 -07:00
snipe cab5dba7c2 Only show manager name if a manager is listed 2015-10-21 14:49:39 -07:00
snipe b25b3321f9 Fixes skip/offset for #1266 2015-10-21 14:49:24 -07:00
snipe 4e3c196664 Manager search for #1266 2015-10-21 14:49:09 -07:00
snipe 27735a8821 Asset model text search for #1266 2015-10-21 14:48:59 -07:00
snipe 6800559596 Fixed dumb braces 2015-10-21 14:41:00 -07:00
snipe 47d6682098 Updated cookie.js for #1266 2015-10-21 14:40:46 -07:00
snipe def6b4ff50 Categories for accessories in #1266 2015-10-21 13:48:52 -07:00
snipe d9ea718d51 Added back missing div 2015-10-21 13:36:35 -07:00
snipe cf7571d3a6 Fixed inline display od checkboxes 2015-10-21 13:27:40 -07:00
snipe 21982a1d51 Additional fields for text search on licenses 2015-10-21 13:14:56 -07:00
snipe 87adb5e0ca Use old Datatables for maintenances until we can build the bootstrap tables API 2015-10-21 13:11:27 -07:00
snipe dfca1386ac Accessories bootstrap tables for #1266 2015-10-21 13:05:14 -07:00
snipe 1d12104eef Merge remote-tracking branch 'origin/develop' 2015-10-21 12:40:18 -07:00
snipe 03e36736c2 Nicer responsive display 2015-10-20 22:11:06 -07:00
snipe 644cfee086 Merge branch 'develop-bootstrap-tables-integration' of github.com:snipe/snipe-it into develop-bootstrap-tables-integration 2015-10-20 21:51:23 -07:00
snipe c346dbaff6 Location search, deleted users for #1266 2015-10-20 21:50:58 -07:00
snipe fc458e571b Merge pull request #1269 from madd15/patch-4
Change Models tables and category text search
2015-10-20 21:08:38 -07:00
madd15 d61983efdf Change to Bootstrap Table 2015-10-21 14:35:51 +10:30
madd15 07f1c5774e Add scopeTextSearch 2015-10-21 14:31:26 +10:30
madd15 f96e4ebd4c Add scopeTextSearch 2015-10-21 14:30:32 +10:30
madd15 de0e1627c7 Change Models Datatables - #1266 2015-10-21 14:28:20 +10:30
madd15 46a02b25da Update getDatatable and getDataView 2015-10-21 14:24:25 +10:30
snipe 3095af4a8e Merge pull request #1268 from madd15/patch-3
Categories Index table view
2015-10-20 20:46:41 -07:00
snipe a90f7218de Revert "Change Categories Datatables - #1266"
This reverts commit ca625418fe.
2015-10-20 20:45:52 -07:00
snipe 84c12e5f01 Revert "Change Categories Datatables - #1266"
This reverts commit 4beb3b024d.
2015-10-20 20:45:52 -07:00
snipe 8f02e0e26f Merge branch 'develop' of github.com:snipe/snipe-it into develop 2015-10-20 20:42:10 -07:00
snipe 50abb87276 Merge pull request #1267 from madd15/patch-3
Categories Index table view
2015-10-20 20:34:05 -07:00
madd15 ca625418fe Change Categories Datatables - #1266 2015-10-21 13:54:05 +10:30
madd15 4beb3b024d Change Categories Datatables - #1266
Convert categories index to new table.

EULA is still not working correctly
2015-10-21 13:49:30 +10:30
snipe b39e617e96 Added inelegant nobr for actions column for #1266 2015-10-20 20:02:18 -07:00
snipe 93bd9120cc Updated orderby for #1266 2015-10-20 19:57:31 -07:00
snipe 2171e668fe Bumped version 2015-10-20 19:51:52 -07:00
snipe 103c61d936 Updated users view with bootstrap tables 2015-10-20 19:51:46 -07:00
snipe f4d882606a New getDataTable method for Bootstrap tables 2015-10-20 19:51:28 -07:00
snipe b56aba3cc2 Added basic text search - this needs to be fleshed out more with more search options 2015-10-20 19:51:10 -07:00
snipe 377e4c06a1 Standardizing BS tables options for #1266
(should be made into a macro)
2015-10-20 18:58:21 -07:00
snipe 58911cd10e Use moar_scripts to limit unnecessary loading 2015-10-20 18:51:21 -07:00
snipe 9264e7bdc4 Fixed missing limit 2015-10-20 18:08:53 -07:00
snipe 78143cbd1c Bumped version 2015-10-20 17:52:20 -07:00
snipe 01f00cfe51 Updated ignore for LDAP 2015-10-20 17:52:14 -07:00
snipe b492ac4950 Merge branch 'bootstrap-table-experiment' into develop-bootstrap-tables-integration
# Conflicts:
#	.gitignore
#	app/controllers/admin/AccessoriesController.php
#	app/controllers/admin/AssetsController.php
#	app/controllers/admin/LicensesController.php
#	app/models/Accessory.php
#	app/models/Asset.php
#	app/routes.php
#	app/views/backend/accessories/index.blade.php
#	app/views/backend/accessories/view.blade.php
#	app/views/backend/hardware/index.blade.php
#	app/views/backend/licenses/index.blade.php
2015-10-20 17:52:02 -07:00
snipe 03daecdfed Merge remote-tracking branch 'origin/develop' 2015-10-19 14:11:26 -07:00
snipe 2dcb59dd8f Bumped version 2015-10-19 14:10:46 -07:00
snipe e7f14f66dc Fixes #1260 - removed domain from cli list
The web upload form is still in beta, and shouldn't be used in production. Still need to add email/username formatting options to the form.
2015-10-19 11:23:02 -07:00
snipe d0aab3e2c7 Merge pull request #1261 from patgmac/patch-1
Include installation of php-gd for Ubuntu
2015-10-19 11:08:01 -07:00
Patrick Gallagher 58f323721c Include installation of php-gd for Ubuntu
php-gd is installed for RH distros, but not Ubuntu.
2015-10-19 11:50:38 -04:00
snipe 923d1d34de Merge remote-tracking branch 'origin/develop' 2015-10-16 01:27:33 -07:00
snipe cf767d255d Bumped version 2015-10-16 01:26:44 -07:00
snipe daa6943cfc Added username column to sample CSV 2015-10-16 01:26:34 -07:00
snipe 707e5c50e4 Merge remote-tracking branch 'origin/develop' 2015-10-16 01:21:05 -07:00
snipe a7ea98ad93 Use domain from config 2015-10-16 01:20:38 -07:00
snipe 52a60bd6a5 Removed extra method 2015-10-16 01:20:31 -07:00
snipe e75cebafeb Added domain config option for email 2015-10-16 01:08:38 -07:00
snipe 26c0e96e56 Merge remote-tracking branch 'origin/develop' 2015-10-16 00:36:00 -07:00
snipe 58c497adb7 Updated language strings 2015-10-16 00:35:39 -07:00
snipe d0ebaf3cb9 Merge remote-tracking branch 'origin/develop' 2015-10-16 00:33:04 -07:00
snipe c4f85fb74d Bumped version 2015-10-16 00:32:42 -07:00
snipe 71b85732b0 Updates to importer 2015-10-16 00:32:35 -07:00
Stefan 0db075cb13 fixes lang option for remote script 2015-10-12 21:00:27 +02:00
Stefan a6586b5919 Added option to select brand type text or logo or text + logo 2015-10-12 20:34:12 +02:00
Stefan 485b34b66e fixed layout and added branding option 2015-10-12 19:14:05 +02:00
Stefan Kittner e9e04e86da added fixed width for navbar icons (fa-fw) 2015-10-12 10:26:27 +02:00
snipe 66fd0c2315 Fixes #1232 - adds category to accessory listing view 2015-10-09 13:22:36 -07:00
Daniel Dreier 73d4c65daf Finished work on #1088. Added info to view, translation strings and logic to controllers. 2015-10-06 19:29:44 -05:00
snipe 0287821d44 Brought sidenav up higher for better layout 2015-10-06 16:30:18 -07:00
snipe 00b93883e4 Updated translations 2015-10-06 16:14:38 -07:00
snipe 89816d90b4 Corrected consumable string 2015-10-06 16:09:10 -07:00
snipe 4f74ad077a Fixes #1136 - allow consumables to be deleted, even if they have been assigned 2015-10-06 16:08:32 -07:00
snipe 75af50def1 Accessories fix for #1204 2015-10-06 15:58:03 -07:00
snipe ec80c99a48 Fixes #1204 2015-10-06 15:50:49 -07:00
snipe f6b57adda3 Fixes #1211 and duplicate column in view 2015-10-06 14:58:13 -07:00
snipe 76dc518846 Better output filename 2015-10-06 14:39:58 -07:00
snipe d149fb1a0f Change output file to text 2015-10-06 14:36:00 -07:00
Daniel Dreier 3ecfff94ef Created the migration, copied view stuff from asset edit to acc. and consumable. 2015-09-30 22:44:55 -05:00
snipe d15ef5c79d Addd user_id to suppliers seeder 2015-09-28 16:32:56 -07:00
snipe 10909a21cd Fixes #1206 - updated seeder with is_warranty value 2015-09-28 16:30:51 -07:00
snipe 141c77fed7 Fixed #1205 set default nullable in purchase order for strict mode 2015-09-28 14:08:45 -07:00
snipe 9027ed8864 More aggressive autocomplete blocking on user edit/create 2015-09-27 21:39:38 -07:00
snipe 4c662b7136 Fixes #1196 - added licensed to name and email in list view 2015-09-25 16:56:12 -07:00
snipe 9ba2779e5f Simpler results output for now 2015-09-23 20:37:30 -07:00
snipe 6500af5125 Temp placeholder file - need to ajaxify this 2015-09-23 20:37:06 -07:00
snipe ff6fe331f3 Add the newly uploaded row to the table 2015-09-23 19:18:28 -07:00
snipe 567cd4847b Added sample CSV 2015-09-23 18:37:29 -07:00
snipe 97d0d789f0 Updated gitkeep and gitignore for new dirs 2015-09-23 18:11:37 -07:00
snipe ba9f00365a Error checking on filetype 2015-09-23 16:57:27 -07:00
snipe 6f6427a298 fa-icon instead of glyphicon 2015-09-23 16:56:58 -07:00
snipe b943ace21b Fixed wrong model type reference 2015-09-23 09:58:09 -07:00
snipe 4abe93ae2e Call the artisan command to do import, show output 2015-09-23 02:36:16 -07:00
snipe 64c5ea033c Bumped version 2015-09-22 20:23:46 -07:00
snipe bedb97c0d8 jQUery File Upload libraries 2015-09-22 20:23:35 -07:00
snipe 586c04354e Starter asset import routes 2015-09-22 20:23:00 -07:00
snipe e13bbb1b6b Updated composer 2015-09-22 20:22:43 -07:00
snipe 999b237ed7 Added asset import to nav 2015-09-22 20:22:36 -07:00
snipe 505d46d49f Fixed typo 2015-09-22 20:22:21 -07:00
snipe 515e70b97c Merge pull request #1180 from hawk554/patch-1
Set replace for http on url in app.php
2015-09-21 20:23:47 -07:00
snipe 53b5ec64e0 Fixes #514 - adds RM as currency 2015-09-21 20:07:36 -07:00
snipe 2df8c6a3d1 Merge pull request #1186 from snipe/docker_fix2
Fix for #1052 - hopefully make it less brittle in future as well.
2015-09-21 14:00:47 -07:00
Brady Wetherington 49a20c75ed Fix for #1052 - hopefully make it less brittle in future as well. 2015-09-21 13:15:26 -07:00
snipe 49a8b7b83c Merge branch 'bootstrap-table-experiment' of github.com:snipe/snipe-it into bootstrap-table-experiment 2015-09-21 00:17:30 -07:00
snipe 6bfa5837c5 Updated gitignore to ignore sql dumps 2015-09-21 00:17:22 -07:00
snipe d41c3fde10 Updated bulgarian and thai translation strings 2015-09-20 23:58:00 -07:00
snipe 8fcf907050 Updated demo url to https 2015-09-20 23:54:55 -07:00
snipe 0cb4b9e00b Fixes #1181 - add title to maintenances in asset view 2015-09-20 23:51:56 -07:00
snipe 7a57fd73e5 Merge remote-tracking branch 'origin/develop' 2015-09-20 18:11:08 -07:00
snipe 41b3f5b5c8 Bumped version 2015-09-20 18:10:37 -07:00
snipe fbbe24f197 Fixes #1184 because package authors can't seem to keep their stuff from breaking 2015-09-20 18:10:30 -07:00
snipe 9b0495453d Merge pull request #1147 from jotterbot/develop
Adding Purchase Cost to AssetImporterCommand
2015-09-18 16:17:59 -07:00
hawk554 0511b0777f Set replace for http on url in app.php
The script keeps the "url" variable set as https in $dir/app/config/production/app.php but the script sets up the apache for http. The only problem this caused for me was the "Dashboard" and "Snipe-IT" button's href was set to https.
2015-09-18 09:13:29 -05:00
snipe fe765b3c9c Fixed not found error message string 2015-09-17 13:59:43 -07:00
snipe 740967e4f2 Additional translations 2015-09-17 11:02:43 -07:00
snipe cffd87c5a3 Fix user display if no location was provided 2015-09-15 10:52:12 -07:00
snipe c8526a6be0 Merge remote-tracking branch 'origin/develop' 2015-09-15 09:59:55 -07:00
snipe abd0acbe9d Add username to user's list view 2015-09-15 09:58:56 -07:00
snipe 3719f9a5a8 Added supplier ID to asset seeder 2015-09-15 03:45:00 -07:00
snipe f9dc5766a7 Suppliers seeder 2015-09-15 03:41:37 -07:00
snipe c6b6ccc814 More seeders 2015-09-15 03:31:20 -07:00
snipe bd7a043ab0 Merge remote-tracking branch 'origin/develop' 2015-09-15 03:00:49 -07:00
snipe 611da2ffbd Only show location map if $user->userloc is valid 2015-09-15 02:59:19 -07:00
snipe 911e9092f9 Prevent group altering from trolling douchebags 2015-09-15 02:46:40 -07:00
snipe 06c9076c2f Prevent generating backups, deleting files and file downloads in demo mode 2015-09-15 02:32:19 -07:00
snipe b8fa5abadf Disable manual backup on demo 2015-09-15 02:25:53 -07:00
snipe dac2747c01 Updated localization for new backup strings 2015-09-15 02:10:01 -07:00
snipe db44430870 Generate button localization 2015-09-15 02:08:39 -07:00
snipe c12139e624 Added generate and delete backups 2015-09-15 02:05:51 -07:00
snipe a2f6d8f72e Change to #1174 - pull other functions out of if statement 2015-09-14 21:52:51 -07:00
snipe 39f82e546f Fixes #1174 - broken migration if asset_logs table has uploads 2015-09-14 21:40:05 -07:00
snipe 6e6661a72b Merge remote-tracking branch 'origin/develop' 2015-09-14 16:47:43 -07:00
snipe d79e2a0864 Allow > tags for custom CSS to modify bootstrap 2015-09-14 16:47:16 -07:00
snipe 0110cd3c55 Merge remote-tracking branch 'origin/develop' 2015-09-14 15:50:02 -07:00
snipe 3b359d7c6e Merge branch 'develop' of github.com:snipe/snipe-it into develop 2015-09-14 15:49:00 -07:00
snipe 3da5c15249 Bumped version 2015-09-14 15:48:49 -07:00
snipe fcec12f3b2 Allow asset-level EOL to override model level if given 2015-09-14 15:48:42 -07:00
snipe 924c23b5ae Merge pull request #1173 from jbirdkerr/jbirdkerr-checkin-template
Update checkin-asset.blade.php
2015-09-11 19:51:08 -07:00
jbirdkerr d70aa42cc9 Update checkin-asset.blade.php 2015-09-11 21:48:05 -05:00
James Otter c59122a125 Adding Purchase Cost to AssetImporterCommand 2015-09-04 16:03:20 +10:00
snipe f3e7f06dc5 Merge pull request #1116 from madd15/bootstrap-table-experiment
Add base for Licenses with bootstrap tables
2015-08-31 13:57:18 -07:00
madd15 0074e1abcc Add name text search 2015-08-25 16:37:10 +09:30
madd15 3f5dad7789 Change to Bootstrap Table 2015-08-25 16:36:32 +09:30
madd15 a365cdc2cc Switch to new method 2015-08-25 16:34:51 +09:30
snipe 2aac977d57 Merge pull request #1072 from madd15/bootstrap-table-experiment
Add base for Consumables with bootstrap tables
2015-08-19 17:16:31 -07:00
madd15 5aff3d9380 remove search explode 2015-08-18 16:17:46 +09:30
madd15 a1c6ea798a matching wording.....so damn picky :P 2015-08-18 16:15:41 +09:30
madd15 e0bf6ee390 Change to Bootstrap Table 2015-08-18 16:14:10 +09:30
madd15 93fe9a2799 Change to Bootstrap Table 2015-08-18 16:13:49 +09:30
madd15 611f59b507 Add name text search 2015-08-18 16:13:05 +09:30
madd15 899e543173 Switch to new method 2015-08-18 16:12:23 +09:30
snipe 132f17b0af Merge pull request #1071 from madd15/bootstrap-table-experiment
Add base for Accessories with bootstrap tables
2015-08-17 22:01:19 -07:00
madd15 5568f7fc5f Add name text search 2015-08-18 14:15:03 +09:30
madd15 d35f8e6244 Change to Bootstrap Table 2015-08-18 14:13:59 +09:30
madd15 6a2016685e Change to Bootstrap Table 2015-08-18 14:13:28 +09:30
madd15 567ad6c3bb Switch to new method 2015-08-18 14:11:03 +09:30
snipe 920708fb6c Merge branch 'features/license-import' 2015-08-14 14:09:22 -07:00
snipe ccc20cbf18 Merge pull request #1032 from madd15/patch-4
additional search and order functionality
2015-08-11 11:58:07 -07:00
madd15 fd9cf29459 Additional changes for search and order functions 2015-08-07 09:44:23 +09:30
madd15 b9e3dd10b4 Additional Search and Order 2015-08-07 09:42:49 +09:30
snipe 75c073ee51 Merge pull request #992 from madd15/patch-4
MOAR SEARCH
2015-07-29 23:13:43 -07:00
madd15 0fcf33ed8c MOAR SEARCH 2015-07-30 15:22:58 +09:30
snipe 0cf3ae95d4 Merge pull request #991 from madd15/patch-5
Fix user firstname/lastname search
2015-07-29 21:47:02 -07:00
madd15 78e0af383d Fix user firstname/lastname search 2015-07-30 14:08:03 +09:30
snipe 8bedaf7439 Merge pull request #990 from madd15/patch-4
Table search experiments
2015-07-29 21:18:52 -07:00
madd15 032d79593a quick fix $inout/$action issue 2015-07-30 13:47:43 +09:30
madd15 f152841e81 quick fix $inout/$action issue 2015-07-30 13:46:59 +09:30
madd15 e66ea4dcd1 Build out search and add Model order scope 2015-07-30 13:45:46 +09:30
madd15 c513007b36 Add sort to table, missing most columns still 2015-07-30 13:44:32 +09:30
snipe 43af451709 Merge pull request #971 from madd15/patch-3
Small EOL fix if no value returned
2015-07-28 20:59:42 -07:00
snipe 9122b49ecc Merge pull request #984 from madd15/patch-2
Fix missing lists causing modal errors
2015-07-28 18:20:02 -07:00
madd15 35f97cceb7 Fix missing lists causing modal errors 2015-07-29 10:34:21 +09:30
snipe 6c3d9048cf Merge pull request #982 from madd15/patch-4
Correct Asset Count
2015-07-28 16:57:17 -07:00
madd15 2507c1aa70 Correct Asset Count 2015-07-29 09:26:44 +09:30
madd15 679b9f6def Small EOL fix 2015-07-28 17:03:39 +09:30
snipe 87cd77b4df Merge remote-tracking branch 'origin/2.0' into bootstrap-table-experiment
# Conflicts:
#	app/controllers/admin/AssetsController.php
2015-07-27 23:41:22 -07:00
snipe d235ae19dc Merge pull request #968 from madd15/patch-3
Remove remnants of dataTables
2015-07-27 23:29:44 -07:00
madd15 ed02d7daae Remove remnants of dataTables 2015-07-28 15:57:21 +09:30
snipe 4af635df28 NEVERMIND. 2015-07-27 22:59:36 -07:00
snipe a6d4b30df8 Make checkall work 2015-07-27 22:50:01 -07:00
snipe 4a51ff9ba5 Duh 2015-07-27 22:46:13 -07:00
snipe 22be076504 More experiments 2015-07-27 22:39:47 -07:00
madd15 b85e9bb97f Add bootstrap extensions and export libs 2015-07-28 13:59:34 +09:30
madd15 5eedd7810f Create bootstrap-table.js 2015-07-28 13:55:06 +09:30
madd15 1ba798a35d Add bootstrap-table.css 2015-07-28 13:53:29 +09:30
madd15 fc22c3884b Add bootstrap table js and css 2015-07-28 13:51:53 +09:30
madd15 0dc2a0ffac Change to bootstrap table compatable method 2015-07-28 13:50:48 +09:30
madd15 ae91f829e1 Change to bootstrap table compatable method 2015-07-28 13:50:10 +09:30
703 changed files with 24147 additions and 6334 deletions
+3 -5
View File
@@ -10,6 +10,7 @@ composer.phar
/app/config/*/session.php
/app/config/*/database.php
/app/config/*/app.php
/app/config/*/ldap.php
public/packages/*
public/uploads/models/*
public/uploads/avatars/*
@@ -25,10 +26,7 @@ public/uploads/logo.png
public/assets/.siteflow
app/config/local/session.php
.couscous
app/storage/dumps/*
tests/_support/_generated/*
tests/_data/scenarios
nbproject/*
app/config/local/ldap.php
app/storage/dumps/*
app/config/packages/schickling/backup/config.php
app/config/app.backup.php
public/uploads/assets/*
+689 -886
View File
File diff suppressed because it is too large Load Diff
+2 -26
View File
@@ -1,31 +1,7 @@
# Contribution Guidelines
**Before opening an issue to report a bug or request help, make sure you've checked the [Common Issues](http://snipeitapp.com/documentation/common-issues/) and [Getting Help](http://snipeitapp.com/documentation/getting-help/) pages.**
**Before opening an issue to report a bug or request help, make sure you've checked the [Common Issues](http://docs.snipeitapp.com/common-issues.html) and [Getting Help](http://docs.snipeitapp.com/getting-help.html) pages.**
## Developing on Snipe-IT
Please submit all pull requests to the [snipe/snipe-it](http://github.com/snipe/snipe-it) repository in the `develop` branch!
**As you're working on bug-fixes or features, please break them out into their own feature branches and open the pull request against your feature branch**. It makes it _much_ easier to decipher down the road, as you open multiple pull requests over time, and makes it much easier for me to approve pull requests quickly.
If you don't have a feature in mind, but would like to contribute back to the project, check out the [open issues](https://github.com/snipe/snipe-it/issues?state=open) and see if there are any you can tackle.
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.
[![Stories in Ready](https://badge.waffle.io/snipe/snipe-it.png?label=ready&title=Ready)](http://waffle.io/snipe/snipe-it)
The labels we use in GitHub Issues and Waffle.io indicate whether we've confirmed an issue as a bug, whether we're considering the issue as a potential feature, and whether it's ready for someone to work on it. We also provide labels such as "n00b", "intermediate" and "advanced" for the experience level we think it requires for contributors who want to help.
-----
## Translations!
If you're not a coder but want to give back to the project and you're fluent in other languages, that's okay too. We use [CrowdIn](https://crowdin.com) to manage translations, and it makes it super-simple for you to add translations (or validate proposed translations) to the project without messing with code. __Check out [the Snipe-IT CrowdIn translation project here](https://crowdin.com/project/snipe-it/)__.
Thanks!
-----
## Contributor Code of Conduct
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
Please see the [Contributing guidelines in the documentation](http://docs.snipeitapp.com/contributing.html).
+2 -4
View File
@@ -33,12 +33,10 @@ RUN a2enmod rewrite
############ INITIAL APPLICATION SETUP #####################
COPY docker/app_start.patch /tmp/app_start.patch
WORKDIR /var/www/html
#Patch bootstrap file
RUN patch -p1 < /tmp/app_start.patch
#Append to bootstrap file (less brittle than 'patch')
RUN sed -i 's/return $app;/$env="production";\nreturn $app;/' bootstrap/start.php
#copy all configuration files
COPY docker/*.php /var/www/html/app/config/production/
+1 -1
View File
@@ -9,7 +9,7 @@ This is a FOSS project for asset management in IT Operations. Knowing who has wh
It is built on [Laravel 4.2](http://laravel.com) and uses the [Sentry 2](https://github.com/cartalyst/sentry) package.
This project is being actively developed and we're [releasing quite frequently](https://github.com/snipe/snipe-it/releases). ([Check out the live demo here](http://snipeitapp.com/demo/).)
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/).)
__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.
+26 -15
View File
@@ -32,7 +32,7 @@ class AppCommand extends Command
'password' => null
);
protected $dummyData = true;
protected $dummyData = false;
/**
* Create a new command instance.
@@ -222,12 +222,23 @@ class AppCommand extends Command
{
do {
// Ask the user to input the user password
$password = $this->ask('Please enter your user password (at least 8 characters): ');
$password = $this->secret('Please enter your user password (at least 8 characters): ');
$password1 = $this->secret('Please confirm your user password: ');
// Check if password is valid
if ($password == '') {
if ($password == '' || $password1 == '') {
// Return an error message
$this->error('Password is invalid. Please try again.');
$password = '';
$password1 = '';
}
else{
// Verify the user password
if ($password != $password1){
$this->error('Password do not match. Please try again.');
$password = '';
$password1 = '';
}
}
// Store the password
@@ -235,19 +246,19 @@ class AppCommand extends Command
} while( ! $password);
}
/**
* Asks the user to create dummy data
*
* @return void
* @todo Use the Laravel Validator
*/
protected function askUserDummyData()
{
// Ask the user to input the user password
$dummydata = $this->ask('Do you want to seed your database with dummy data? Y/n (default is yes): ');
/**
* Asks the user to create dummy data
*
* @return void
* @todo Use the Laravel Validator
*/
protected function askUserDummyData()
{
// Ask the user to input the user password
$dummydata = $this->ask('Do you want to seed your database with dummy data? y/N (default is no): ');
$this->dummyData = ( strstr($dummydata, 'Y' ) || empty($dummydata) ) ? true : false;
}
$this->dummyData = ( strstr($dummydata, 'N' ) || empty($dummydata) ) ? true : false;
}
/**
* Runs all the necessary Sentry commands.
+133 -102
View File
@@ -77,66 +77,80 @@ class AssetImportCommand extends Command {
$user_email = '';
}
// Asset Category
// User's email
if (array_key_exists('2',$row)) {
$user_asset_category = trim($row[2]);
$user_username = trim($row[2]);
} else {
$user_username = '';
}
// Asset Name
if (array_key_exists('3',$row)) {
$user_asset_asset_name = trim($row[3]);
} else {
$user_asset_asset_name = '';
}
// Asset Category
if (array_key_exists('4',$row)) {
$user_asset_category = trim($row[4]);
} else {
$user_asset_category = '';
}
// Asset Name
if (array_key_exists('3',$row)) {
$user_asset_name = trim($row[3]);
if (array_key_exists('5',$row)) {
$user_asset_name = trim($row[5]);
} else {
$user_asset_name = '';
}
// Asset Manufacturer
if (array_key_exists('4',$row)) {
$user_asset_mfgr = trim($row[4]);
if (array_key_exists('6',$row)) {
$user_asset_mfgr = trim($row[6]);
} else {
$user_asset_mfgr = '';
}
// Asset model number
if (array_key_exists('5',$row)) {
$user_asset_modelno = trim($row[5]);
if (array_key_exists('7',$row)) {
$user_asset_modelno = trim($row[7]);
} else {
$user_asset_modelno = '';
}
// Asset serial number
if (array_key_exists('6',$row)) {
$user_asset_serial = trim($row[6]);
if (array_key_exists('8',$row)) {
$user_asset_serial = trim($row[8]);
} else {
$user_asset_serial = '';
}
// Asset tag
if (array_key_exists('7',$row)) {
$user_asset_tag = trim($row[7]);
if (array_key_exists('9',$row)) {
$user_asset_tag = trim($row[9]);
} else {
$user_asset_tag = '';
}
// Asset location
if (array_key_exists('8',$row)) {
$user_asset_location = trim($row[8]);
if (array_key_exists('10',$row)) {
$user_asset_location = trim($row[10]);
} else {
$user_asset_location = '';
}
// Asset notes
if (array_key_exists('9',$row)) {
$user_asset_notes = trim($row[9]);
if (array_key_exists('11',$row)) {
$user_asset_notes = trim($row[11]);
} else {
$user_asset_notes = '';
}
// Asset purchase date
if (array_key_exists('10',$row)) {
if ($row[10]!='') {
$user_asset_purchase_date = date("Y-m-d 00:00:01", strtotime($row[10]));
if (array_key_exists('12',$row)) {
if ($row[12]!='') {
$user_asset_purchase_date = date("Y-m-d 00:00:01", strtotime($row[12]));
} else {
$user_asset_purchase_date = '';
}
@@ -144,6 +158,17 @@ class AssetImportCommand extends Command {
$user_asset_purchase_date = '';
}
// Asset purchase cost
if (array_key_exists('13',$row)) {
if ($row[13]!='') {
$user_asset_purchase_cost = trim($row[13]);
} else {
$user_asset_purchase_cost = '';
}
} else {
$user_asset_purchase_cost = '';
}
// 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');
@@ -157,46 +182,24 @@ class AssetImportCommand extends Command {
$user_username = '';
} else {
$user_email_array = User::generateFormattedNameFromFullName($this->option('email_format'), $user_name);
$first_name = $user_email_array['first_name'];
$last_name = $user_email_array['last_name'];
$name = explode(" ", $user_name);
$first_name = $name[0];
$email_last_name = '';
$email_prefix = $first_name;
if ($user_email=='') {
$user_email = $user_email_array['username'].'@'.Config::get('app.domain');
}
if (!array_key_exists(1, $name)) {
$last_name='';
$email_last_name = $last_name;
$email_prefix = $first_name;
if ($user_username=='') {
if ($this->option('username_format')=='email') {
$user_username = $user_email;
} else {
$last_name = str_replace($first_name,'',$user_name);
if ($this->option('email_format')=='filastname') {
$email_last_name.=str_replace(' ','',$last_name);
$email_prefix = $first_name[0].$email_last_name;
} elseif ($this->option('email_format')=='firstname.lastname') {
$email_last_name.=str_replace(' ','',$last_name);
$email_prefix = $first_name.'.'.$email_last_name;
} elseif ($this->option('email_format')=='firstname') {
$email_last_name.=str_replace(' ','',$last_name);
$email_prefix = $first_name;
}
$user_name_array = User::generateFormattedNameFromFullName($this->option('username_format'), $user_name);
$user_username = $user_name_array['username'];
}
}
$user_username = $email_prefix;
// Generate an email based on their name if no email address is given
if ($user_email=='') {
if ($first_name=='Unknown') {
$status_id = 7;
}
$email = strtolower($email_prefix).'@'.$this->option('domain');
$user_email = str_replace("'",'',$email);
}
}
$this->comment('Full Name: '.$user_name);
@@ -212,12 +215,14 @@ class AssetImportCommand extends Command {
$this->comment('Asset Tag: '.$user_asset_tag);
$this->comment('Location: '.$user_asset_location);
$this->comment('Purchase Date: '.$user_asset_purchase_date);
$this->comment('Purchase Cost: '.$user_asset_purchase_cost);
$this->comment('Notes: '.$user_asset_notes);
$this->comment('------------- Action Summary ----------------');
if ($user_username!='') {
if ($user = User::where('username', $user_username)->whereNotNull('username')->first()) {
if ($user = User::MatchEmailOrUsername($user_username, $user_email)
->whereNotNull('username')->first()) {
$this->comment('User '.$user_username.' already exists');
} else {
// Create the user
@@ -226,7 +231,7 @@ class AssetImportCommand extends Command {
'last_name' => $last_name,
'email' => $user_email,
'username' => $user_username,
'password' => substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10),
'password' => substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 12),
'activated' => true,
'permissions' => array(
'admin' => 0,
@@ -250,34 +255,50 @@ class AssetImportCommand extends Command {
if ($location = Location::where('name', $user_asset_location)->first()) {
$this->comment('Location '.$user_asset_location.' already exists');
} else {
$location = new Location();
$location->name = e($user_asset_location);
$location->address = '';
$location->city = '';
$location->state = '';
$location->country = '';
$location->user_id = 1;
if (!$this->option('testrun')=='true') {
$location = new Location();
if ($location->save()) {
$this->comment('Location '.$user_asset_location.' was created');
} else {
$this->comment('Something went wrong! Location '.$user_asset_location.' was NOT created');
if ($user_asset_location!='') {
$location->name = e($user_asset_location);
$location->address = '';
$location->city = '';
$location->state = '';
$location->country = '';
$location->user_id = 1;
if (!$this->option('testrun')=='true') {
if ($location->save()) {
$this->comment('Location '.$user_asset_location.' was created');
} else {
$this->comment('Something went wrong! Location '.$user_asset_location.' was NOT created');
}
} else {
$this->comment('Location '.$user_asset_location.' was (not) created - test run only');
}
} else {
$this->comment('Location '.$user_asset_location.' was (not) created - test run only');
$this->comment('No location given, so none created.');
}
}
if (e($user_asset_category)=='') {
$category_name = 'Unnamed Category';
} else {
$category_name = e($user_asset_category);
}
// Check for the category match and create it if it doesn't exist
if ($category = Category::where('name', $user_asset_category)->where('category_type', 'asset')->first()) {
$this->comment('Category '.$user_asset_category.' already exists');
if ($category = Category::where('name', $category_name)->where('category_type', 'asset')->first()) {
$this->comment('Category '.$category_name.' already exists');
} else {
$category = new Category();
$category->name = e($user_asset_category);
$category->name = $category_name;
$category->category_type = 'asset';
$category->user_id = 1;
@@ -325,33 +346,43 @@ class AssetImportCommand extends Command {
}
// Check for the asset match and create it if it doesn't exist
if ($asset = Asset::where('asset_tag', $user_asset_tag)->first()) {
$this->comment('The Asset with asset tag '.$user_asset_tag.' already exists');
} else {
$asset = new Asset();
$asset->name = e($user_asset_asset_name);
if ($user_asset_purchase_date!='') {
$asset->purchase_date = $user_asset_purchase_date;
} else {
$asset->purchase_date = NULL;
}
if ($user_asset_purchase_cost!='') {
$asset->purchase_cost = ParseFloat(e($user_asset_purchase_cost));
} else {
$asset->purchase_cost = 0.00;
}
$asset->serial = e($user_asset_serial);
$asset->asset_tag = e($user_asset_tag);
$asset->model_id = $asset_model->id;
$asset->assigned_to = $user->id;
$asset->rtd_location_id = $location->id;
$asset->user_id = 1;
$asset->status_id = $status_id;
if ($user_asset_purchase_date!='') {
$asset->purchase_date = $user_asset_purchase_date;
} else {
$asset->purchase_date = NULL;
}
$asset->notes = e($user_asset_notes);
$asset = new Asset();
$asset->name = e($user_asset_name);
if ($user_asset_purchase_date!='') {
$asset->purchase_date = $user_asset_purchase_date;
} else {
$asset->purchase_date = NULL;
}
$asset->serial = e($user_asset_serial);
$asset->asset_tag = e($user_asset_tag);
$asset->model_id = $asset_model->id;
$asset->assigned_to = $user->id;
$asset->rtd_location_id = $location->id;
$asset->user_id = 1;
$asset->status_id = $status_id;
if ($user_asset_purchase_date!='') {
$asset->purchase_date = $user_asset_purchase_date;
} else {
$asset->purchase_date = NULL;
}
$asset->notes = e($user_asset_notes);
if ($asset->save()) {
$this->comment('Asset '.$user_asset_name.' with serial number '.$user_asset_serial.' was created');
} else {
$this->comment('Something went wrong! Asset '.$user_asset_name.' was NOT created');
}
}
if ($asset->save()) {
$this->comment('Asset '.$user_asset_name.' with serial number '.$user_asset_serial.' was created');
} else {
$this->comment('Something went wrong! Asset '.$user_asset_name.' was NOT created');
}
$this->comment('=====================================');
@@ -383,11 +414,11 @@ class AssetImportCommand extends Command {
*/
protected function getOptions()
{
return array(
array('domain', null, InputOption::VALUE_REQUIRED, 'Email domain for generated email addresses.', null),
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('testrun', null, InputOption::VALUE_REQUIRED, 'Test the output without writing to the database or not.', null),
);
return array(
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_REQUIRED, 'Test the output without writing to the database or not.', null),
);
}
+14 -1
View File
@@ -28,6 +28,19 @@ return array(
'url' => 'http://snipe-it-laravel.local:8888',
/*
|--------------------------------------------------------------------------
| Organization Domain Name
|--------------------------------------------------------------------------
|
| The domain name of the organization, used when generating email addresses
| through the import tools.
|
*/
'domain' => 'yourserver.com',
/*
|--------------------------------------------------------------------------
| Encryption Key
@@ -37,7 +50,7 @@ return array(
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
| Run a php artisan key:generate to create a random one
| Run a php artisan key:generate --env=staging to create a random one
*/
'key' => 'Change_this_key_or_snipe_will_get_ya',
+13
View File
@@ -28,6 +28,19 @@ return array(
'url' => 'https://production.yourserver.com',
/*
|--------------------------------------------------------------------------
| Organization Domain Name
|--------------------------------------------------------------------------
|
| The domain name of the organization, used when generating email addresses
| through the import tools.
|
*/
'domain' => 'yourserver.com',
/*
|--------------------------------------------------------------------------
| Encryption Key
+14 -1
View File
@@ -13,7 +13,7 @@ return array(
|
*/
'debug' => true,
'debug' => false,
/*
|--------------------------------------------------------------------------
@@ -28,6 +28,19 @@ return array(
'url' => 'http://staging.yourserver.com',
/*
|--------------------------------------------------------------------------
| Organization Domain Name
|--------------------------------------------------------------------------
|
| The domain name of the organization, used when generating email addresses
| through the import tools.
|
*/
'domain' => 'yourserver.com',
/*
|--------------------------------------------------------------------------
| Encryption Key
+2 -2
View File
@@ -1,5 +1,5 @@
<?php
return array (
'app_version' => 'v2.0-95',
'hash_version' => 'v2.0-95-ge05baf1',
'app_version' => 'v2.0.5-pre',
'hash_version' => 'v2.0.5-pre-191-g948be5c',
);
+2
View File
@@ -14,6 +14,8 @@ class AdminController extends AuthorizedController
// Apply the admin auth filter
//$this->beforeFilter('admin-auth', array('except' => $this->whitelist));
// CSRF Protection
$this->beforeFilter('csrf', array('on' => 'post'));
}
+92 -19
View File
@@ -22,34 +22,39 @@ class AuthController extends BaseController
/**
* Authenticates a user to LDAP
*
* @return true if the username and/or password provided are valid
* false if the username and/or password provided are invalid
*
* @param $username
* @param $password
* @param bool|false $returnUser
* @return bool true if the username and/or password provided are valid
* false if the username and/or password provided are invalid
* array of ldap_attributes if $returnUser is true
*/
function ldap($username, $password) {
function ldap($username, $password, $returnUser = false) {
$ldaphost = Config::get('ldap.url');
$ldaprdn = Config::get('ldap.username');
$ldappass = Config::get('ldap.password');
$baseDn = Config::get('ldap.basedn');
$filterQuery = Config::get('ldap.authentication.filter.query') . $username;
$ldapversion = Config::get('ldap.version');
$ldaphost = Setting::getSettings()->ldap_server;
$ldaprdn = Setting::getSettings()->ldap_uname;
$ldappass = Crypt::decrypt(Setting::getSettings()->ldap_pword);
$baseDn = Setting::getSettings()->ldap_basedn;
$filterQuery = Setting::getSettings()->ldap_auth_filter_query . $username;
$ldapversion = Setting::getSettings()->ldap_version;
// Connecting to LDAP
$connection = ldap_connect($ldaphost) or die("Could not connect to {$ldaphost}");
// Needed for AD
ldap_set_option($connection, LDAP_OPT_REFERRALS, 0);
ldap_set_option($connection, LDAP_OPT_PROTOCOL_VERSION,$ldapversion);
// Connecting to LDAP
$connection = ldap_connect($ldaphost) or die("Could not connect to {$ldaphost}");
// Needed for AD
ldap_set_option($connection, LDAP_OPT_REFERRALS, 0);
ldap_set_option($connection, LDAP_OPT_PROTOCOL_VERSION,$ldapversion);
try {
if ($connection) {
// binding to ldap server
$ldapbind = ldap_bind($connection, $ldaprdn, $ldappass);
if ( ($results = @ldap_search($connection, $baseDn, $filterQuery)) !==false ) {
if ( ($results = @ldap_search($connection, $baseDn, $filterQuery)) != false ) {
$entry = ldap_first_entry($connection, $results);
if ( ($userDn = @ldap_get_dn($connection, $entry)) !== false ) {
if( ($isBound = ldap_bind($connection, $userDn, $password)) == "true") {
return true;
return $returnUser ?
array_change_key_case(ldap_get_attributes($connection, $entry),CASE_LOWER)
: true;
}
}
}
@@ -61,6 +66,65 @@ class AuthController extends BaseController
return false;
}
/**
* Create user from LDAP attributes
*
* @param $ldapatttibutes
* @return array|bool
*/
function createUserFromLdap($ldapatttibutes){
//Get LDAP attribute config
$ldap_result_username = Setting::getSettings()->ldap_username_field;
$ldap_result_emp_num = Setting::getSettings()->ldap_emp_num;
$ldap_result_last_name = Setting::getSettings()->ldap_lname_field;
$ldap_result_first_name = Setting::getSettings()->ldap_fname_field;
$ldap_result_email = Setting::getSettings()->ldap_email;
//Get LDAP user data
$item = array();
$item["username"] = isset( $ldapatttibutes[$ldap_result_username][0] ) ? $ldapatttibutes[$ldap_result_username][0] : "";
$item["employee_number"] = isset( $ldapatttibutes[$ldap_result_emp_num][0] ) ? $ldapatttibutes[$ldap_result_emp_num][0] : "";
$item["lastname"] = isset( $ldapatttibutes[$ldap_result_last_name][0] ) ? $ldapatttibutes[$ldap_result_last_name][0] : "";
$item["firstname"] = isset( $ldapatttibutes[$ldap_result_first_name][0] ) ? $ldapatttibutes[$ldap_result_first_name][0] : "";
$item["email"] = isset( $ldapatttibutes[$ldap_result_email][0] ) ? $ldapatttibutes[$ldap_result_email][0] : "" ;
//create user
if(!empty($item["username"]) && !empty($item['email'])) {
$pass = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10);
$newuser = array(
'first_name' => $item["firstname"],
'last_name' => $item["lastname"],
'username' => $item["username"],
'email' => $item["email"],
'employee_num' => $item["employee_number"],
'password' => $pass,
'activated' => 1,
'location_id' => null,
'permissions' => '{"user":1}',
'notes' => 'Imported from LDAP'
);
DB::table('users')->insert($newuser);
$updateuser = Sentry::findUserByLogin($item["username"]);
// Update the user details
$updateuser->password = $pass;
// Update the user
$updateuser->save();
} else {
throw new Cartalyst\Sentry\Users\UserNotFoundException();
}
//$item["note"] = "<strong>created</strong>";
$credentials = array(
'username' => $item["username"],
'password' => $pass,
);
return $credentials;
}
/**
* Account sign in form processing.
@@ -83,7 +147,6 @@ class AuthController extends BaseController
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
try {
/**
@@ -93,8 +156,18 @@ class AuthController extends BaseController
// Try to get the user from the database.
$user = (array) DB::table('users')->where('username', Input::get('username'))->first();
//If user does not exist and authenticates sucessfully with LDAP we will create it onf the fly and sign in with default permissions
if(!$user){
if($userattr = $this->ldap(Input::get('username'), Input::get('password'),true) ){
LOG::debug("Creating LDAP authenticated user.");
$credentials = $this->createUserFromLdap($userattr);
Sentry::authenticate($credentials, Input::get('remember-me', 0));
if ($user && strpos($user["notes"],'LDAP') !== false) {
}
}
else if ($user && strpos($user["notes"],'LDAP') !== false) {
LOG::debug("Authenticating user against LDAP.");
if( $this->ldap(Input::get('username'), Input::get('password')) ) {
LOG::debug("valid login");
@@ -9,6 +9,7 @@ use Location;
use View;
use Asset;
use Actionlog;
use Company;
use Lang;
use Accessory;
use DB;
@@ -44,6 +45,7 @@ class ViewAssetsController extends AuthorizedController
public function getRequestableIndex() {
$assets = Asset::with('model','defaultLoc')->Hardware()->RequestableAssets()->get();
return View::make('frontend/account/requestable-assets', compact('user','assets'));
}
@@ -56,7 +58,11 @@ class ViewAssetsController extends AuthorizedController
if (is_null($asset = Asset::RequestableAssets()->find($assetId))) {
// Redirect to the asset management page
return Redirect::route('requestable-assets')->with('error', Lang::get('admin/hardware/message.does_not_exist_or_not_requestable'));
} else {
}
else if (!Company::isCurrentUserHasAccess($asset)) {
return Redirect::route('requestable-assets')->with('error', Lang::get('general.insufficient_permissions'));
}
else {
$logaction = new Actionlog();
$logaction->asset_id = $asset->id;
@@ -133,24 +139,28 @@ class ViewAssetsController extends AuthorizedController
// Redirect to the asset management page
return Redirect::to('account')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
return View::make('frontend/account/accept-asset', compact('item'))->with('findlog', $findlog);
else if (!Company::isCurrentUserHasAccess($item)) {
return Redirect::route('requestable-assets')->with('error', Lang::get('general.insufficient_permissions'));
}
else {
return View::make('frontend/account/accept-asset', compact('item'))->with('findlog', $findlog);
}
}
// Save the acceptance
public function postAcceptAsset($logID = null) {
// Check if the asset exists
if (is_null($findlog = Actionlog::find($logID))) {
// Redirect to the asset management page
return Redirect::to('account/view-assets')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
// 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', Lang::get('general.insufficient_permissions'));
}
if ($findlog->accepted_id!='') {
// Redirect to the asset management page
@@ -208,11 +218,12 @@ class ViewAssetsController extends AuthorizedController
$log = $logaction->logaction($logaction_msg);
$update_checkout = DB::table('asset_logs')
->where('id',$findlog->id)
->update(array('accepted_id' => $logaction->id));
$affected_asset=$logaction->assetlog;
$affected_asset->accepted=$accepted;
$affected_asset->save();
->where('id',$findlog->id)
->update(array('accepted_id' => $logaction->id));
$affected_asset=$logaction->assetlog;
$affected_asset->accepted=$accepted;
$affected_asset->save();
if ($update_checkout ) {
return Redirect::to('account/view-assets')->with('success', $return_msg);
@@ -220,14 +231,5 @@ class ViewAssetsController extends AuthorizedController
} else {
return Redirect::to('account/view-assets')->with('error', 'Something went wrong ');
}
}
}
+161 -40
View File
@@ -13,6 +13,7 @@ use Validator;
use View;
use User;
use Actionlog;
use Company;
use Mail;
use Datatable;
use Slack;
@@ -41,7 +42,13 @@ class AccessoriesController extends AdminController
{
// Show the page
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','accessory')->whereNull('deleted_at')->orderBy('name','ASC')->lists('name', 'id');
return View::make('backend/accessories/edit')->with('accessory',new Accessory)->with('category_list',$category_list);
$company_list = Company::getSelectList();
$location_list = locationsList();
return View::make('backend/accessories/edit')
->with('accessory', new Accessory)
->with('category_list', $category_list)
->with('company_list', $company_list)
->with('location_list', $location_list);
}
@@ -68,6 +75,22 @@ class AccessoriesController extends AdminController
// Update the accessory data
$accessory->name = e(Input::get('name'));
$accessory->category_id = e(Input::get('category_id'));
$accessory->location_id = e(Input::get('location_id'));
$accessory->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
$accessory->order_number = e(Input::get('order_number'));
if (e(Input::get('purchase_date')) == '') {
$accessory->purchase_date = NULL;
} else {
$accessory->purchase_date = e(Input::get('purchase_date'));
}
if (e(Input::get('purchase_cost')) == '0.00') {
$accessory->purchase_cost = NULL;
} else {
$accessory->purchase_cost = ParseFloat(e(Input::get('purchase_cost')));
}
$accessory->qty = e(Input::get('qty'));
$accessory->user_id = Sentry::getId();
@@ -97,9 +120,18 @@ class AccessoriesController extends AdminController
// Redirect to the blogs management page
return Redirect::to('admin/accessories')->with('error', Lang::get('admin/accessories/message.does_not_exist'));
}
else if (!Company::isCurrentUserHasAccess($accessory)) {
return Redirect::to('admin/accessories')->with('error', Lang::get('general.insufficient_permissions'));
}
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','accessory')->whereNull('deleted_at')->orderBy('name','ASC')->lists('name', 'id');
return View::make('backend/accessories/edit', compact('accessory'))->with('category_list',$category_list);
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','accessory')->whereNull('deleted_at')->orderBy('name','ASC')->lists('name', 'id');
$company_list = Company::getSelectList();
$location_list = locationsList();
return View::make('backend/accessories/edit', compact('accessory'))
->with('category_list',$category_list)
->with('company_list', $company_list)
->with('location_list', $location_list);
}
@@ -116,6 +148,9 @@ class AccessoriesController extends AdminController
// Redirect to the blogs management page
return Redirect::to('admin/accessories')->with('error', Lang::get('admin/accessories/message.does_not_exist'));
}
else if (!Company::isCurrentUserHasAccess($accessory)) {
return Redirect::to('admin/accessories')->with('error', Lang::get('general.insufficient_permissions'));
}
// get the POST data
@@ -135,7 +170,23 @@ class AccessoriesController extends AdminController
// Update the accessory data
$accessory->name = e(Input::get('name'));
$accessory->location_id = e(Input::get('location_id'));
$accessory->category_id = e(Input::get('category_id'));
$accessory->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
$accessory->order_number = e(Input::get('order_number'));
if (e(Input::get('purchase_date')) == '') {
$accessory->purchase_date = NULL;
} else {
$accessory->purchase_date = e(Input::get('purchase_date'));
}
if (e(Input::get('purchase_cost')) == '0.00') {
$accessory->purchase_cost = NULL;
} else {
$accessory->purchase_cost = ParseFloat(e(Input::get('purchase_cost')));
}
$accessory->qty = e(Input::get('qty'));
// Was the accessory created?
@@ -163,6 +214,9 @@ class AccessoriesController extends AdminController
// Redirect to the blogs management page
return Redirect::to('admin/accessories')->with('error', Lang::get('admin/accessories/message.not_found'));
}
else if (!Company::isCurrentUserHasAccess($accessory)) {
return Redirect::to('admin/accessories')->with('error', Lang::get('general.insufficient_permissions'));
}
if ($accessory->hasUsers() > 0) {
@@ -194,7 +248,13 @@ class AccessoriesController extends AdminController
$accessory = Accessory::find($accessoryID);
if (isset($accessory->id)) {
if (!Company::isCurrentUserHasAccess($accessory)) {
return Redirect::to('admin/accessories')->with('error', Lang::get('general.insufficient_permissions'));
}
else {
return View::make('backend/accessories/view', compact('accessory'));
}
} else {
// Prepare the error message
$error = Lang::get('admin/accessories/message.does_not_exist', compact('id'));
@@ -216,6 +276,9 @@ class AccessoriesController extends AdminController
// Redirect to the accessory management page with error
return Redirect::to('accessories')->with('error', Lang::get('admin/accessories/message.not_found'));
}
else if (!Company::isCurrentUserHasAccess($accessory)) {
return Redirect::to('admin/accessories')->with('error', Lang::get('general.insufficient_permissions'));
}
// 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');
@@ -234,6 +297,9 @@ class AccessoriesController extends AdminController
// Redirect to the accessory management page with error
return Redirect::to('accessories')->with('error', Lang::get('admin/accessories/message.not_found'));
}
else if (!Company::isCurrentUserHasAccess($accessory)) {
return Redirect::to('admin/accessories')->with('error', Lang::get('general.insufficient_permissions'));
}
$admin_user = Sentry::getUser();
$assigned_to = e(Input::get('assigned_to'));
@@ -360,7 +426,13 @@ class AccessoriesController extends AdminController
}
$accessory = Accessory::find($accessory_user->accessory_id);
return View::make('backend/accessories/checkin', compact('accessory'))->with('backto',$backto);
if (!Company::isCurrentUserHasAccess($accessory)) {
return Redirect::to('admin/accessories')->with('error', Lang::get('general.insufficient_permissions'));
}
else {
return View::make('backend/accessories/checkin', compact('accessory'))->with('backto',$backto);
}
}
@@ -380,6 +452,11 @@ class AccessoriesController extends AdminController
$accessory = Accessory::find($accessory_user->accessory_id);
if (!Company::isCurrentUserHasAccess($accessory)) {
return Redirect::to('admin/accessories')->with('error', Lang::get('general.insufficient_permissions'));
}
$logaction = new Actionlog();
$logaction->checkedout_to = $accessory_user->assigned_to;
$return_to = $accessory_user->assigned_to;
@@ -432,7 +509,7 @@ class AccessoriesController extends AdminController
$log = $logaction->logaction('checkin from');
if(!is_null($accessory_user->assigned_to)) {
$user = User::find($accessory_user->assigned_to);
}
@@ -465,52 +542,96 @@ class AccessoriesController extends AdminController
public function getDatatable()
{
$accessories = Accessory::select(array('id','name','qty'))
->whereNull('deleted_at')
->orderBy('created_at', 'DESC');
$accessories = Accessory::select('accessories.*')->with('category', 'company')
->whereNull('accessories.deleted_at');
$accessories = $accessories->get();
if (Input::has('search')) {
$accessories = $accessories->TextSearch(Input::get('search'));
}
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions',function($accessories)
{
return '<a href="'.route('checkout/accessory', $accessories->id).'" style="margin-right:5px;" class="btn btn-info btn-sm" '.(($accessories->numRemaining() > 0 ) ? '' : ' disabled').'>'.Lang::get('general.checkout').'</a><a href="'.route('update/accessory', $accessories->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/accessory', $accessories->id).'" data-content="'.Lang::get('admin/accessories/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($accessories->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
});
if (Input::has('offset')) {
$offset = e(Input::get('offset'));
} else {
$offset = 0;
}
return Datatable::collection($accessories)
->addColumn('name',function($accessories)
{
return link_to('admin/accessories/'.$accessories->id.'/view', $accessories->name);
})
->addColumn('qty',function($accessories)
{
return $accessories->qty;
})
->addColumn('numRemaining',function($accessories)
{
return $accessories->numRemaining();
})
->addColumn($actions)
->searchColumns('name','qty','numRemaining','actions')
->orderColumns('name','qty','numRemaining','actions')
->make();
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
$allowed_columns = ['name','order_number','purchase_date','purchase_cost','companyName','category'];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
switch ($sort)
{
case 'category':
$accessories = $accessories->OrderCategory($order);
break;
case 'companyName':
$accessories = $accessories->OrderCompany($order);
break;
default:
$accessories = $accessories->orderBy($sort, $order);
break;
}
$accessCount = $accessories->count();
$accessories = $accessories->skip($offset)->take($limit)->get();
$rows = array();
foreach ($accessories as $accessory) {
$actions = '<nobr><a href="'.route('checkout/accessory', $accessory->id).'" style="margin-right:5px;" class="btn btn-info btn-sm" '.(($accessory->numRemaining() > 0 ) ? '' : ' disabled').'>'.Lang::get('general.checkout').'</a><a href="'.route('update/accessory', $accessory->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/accessory', $accessory->id).'" data-content="'.Lang::get('admin/accessories/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($accessory->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></nobr>';
$company = $accessory->company;
$rows[] = array(
'name' => link_to('admin/accessories/'.$accessory->id.'/view', $accessory->name),
'category' => link_to('admin/settings/categories/'.$accessory->category->id.'/view', $accessory->category->name),
'qty' => $accessory->qty,
'order_number' => $accessory->order_number,
'location' => ($accessory->location) ? $accessory->location->name: '',
'purchase_date' => $accessory->purchase_date,
'purchase_cost' => $accessory->purchase_cost,
'numRemaining' => $accessory->numRemaining(),
'actions' => $actions,
'companyName' => is_null($company) ? '' : e($company->name)
);
}
$data = array('total'=>$accessCount, 'rows'=>$rows);
return $data;
}
public function getDataView($accessoryID)
{
$accessory = Accessory::find($accessoryID);
if (!Company::isCurrentUserHasAccess($accessory)) {
return ['total' => 0, 'rows' => []];
}
$accessory_users = $accessory->users;
$count = $accessory_users->count();
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions',function($accessory_users){
return '<a href="'.route('checkin/accessory', $accessory_users->pivot->id).'" class="btn-flat info">Checkin</a>';
});
$rows = array();
return Datatable::collection($accessory_users)
->addColumn('name',function($accessory_users)
{
return link_to('/admin/users/'.$accessory_users->id.'/view', $accessory_users->fullName());
})
->addColumn($actions)
->make();
foreach ($accessory_users as $user) {
$actions = '<a href="'.route('checkin/accessory', $user->pivot->id).'" class="btn-flat info">Checkin</a>';
$rows[] = array(
'name' => link_to('/admin/users/'.$user->id.'/view', $user->fullName()),
'actions' => $actions
);
}
$data = array('total'=>$count, 'rows'=>$rows);
return $data;
}
}
@@ -5,7 +5,7 @@
use AdminController;
use AssetMaintenance;
use Carbon\Carbon;
use Datatable;
use Company;
use DB;
use Input;
use Lang;
@@ -20,9 +20,15 @@
use TCPDF;
use Validator;
use View;
use Setting;
class AssetMaintenancesController extends AdminController
{
private static function getInsufficientPermissionsRedirect()
{
return Redirect::to( 'admin/asset_maintenances')
->with('error', Lang::get( 'general.insufficient_permissions' ) );
}
/**
* getIndex
@@ -45,71 +51,73 @@
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function getDatatable()
{
$assetMaintenances = AssetMaintenance::orderBy( 'created_at', 'DESC' )
->get();
public function getDatatable()
{
$maintenances = AssetMaintenance::with('asset','supplier','asset.company')
->whereNull('deleted_at');
$actions = new \Chumper\Datatable\Columns\FunctionColumn( 'actions', function ( $assetMaintenances ) {
if (Input::has('search')) {
$maintenances = $maintenances->TextSearch(e(Input::get('search')));
}
return '<a href="' . route( 'update/asset_maintenance', $assetMaintenances->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/asset_maintenance', $assetMaintenances->id ) . '" data-content="'
. Lang::get( 'admin/asset_maintenances/message.delete.confirm' ) . '" data-title="'
. Lang::get( 'general.delete' ) . ' ' . htmlspecialchars( $assetMaintenances->title )
. '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
} );
if (Input::has('offset')) {
$offset = e(Input::get('offset'));
} else {
$offset = 0;
}
return Datatable::collection( $assetMaintenances )
->addColumn( 'asset', function ( $assetMaintenances ) {
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
return link_to( '/hardware/' . $assetMaintenances->asset_id . '/view',
mb_strimwidth( $assetMaintenances->asset->name, 0, 50, "..." ) );
} )
->addColumn( 'supplier', function ( $assetMaintenances ) {
$allowed_columns = ['id','title','asset_maintenance_time','asset_maintenance_type','cost','start_date','completion_date','notes'];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
return link_to( '/admin/settings/suppliers/' . $assetMaintenances->supplier_id
. '/view',
mb_strimwidth( $assetMaintenances->supplier->name, 0, 50, "..." ) );
} )
->addColumn( 'asset_maintenance_type', function ( $assetMaintenances ) {
$maintenances->orderBy($sort, $order);
return $assetMaintenances->asset_maintenance_type;
} )
->addColumn( 'title', function ( $assetMaintenances ) {
$maintenancesCount = $maintenances->count();
$maintenances = $maintenances->skip($offset)->take($limit)->get();
return link_to( '/admin/asset_maintenances/' . $assetMaintenances->id . '/view',
mb_strimwidth( $assetMaintenances->title, 0, 50, "..." ) );
} )
->addColumn( 'start_date', function ( $assetMaintenances ) {
$rows = array();
$settings = Setting::getSettings();
return $assetMaintenances->start_date;
} )
->addColumn( 'completion_date', function ( $assetMaintenances ) {
foreach($maintenances as $maintenance) {
return $assetMaintenances->completion_date;
} )
->addColumn( 'asset_maintenance_time', function ( $assetMaintenances ) {
$actions = '<nobr><a href="'.route('update/asset_maintenance', $maintenance->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/statuslabel', $maintenance->id).'" data-content="'.Lang::get('admin/asset_maintenances/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($maintenance->title).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></nobr>';
if (is_null( $assetMaintenances->asset_maintenance_time )) {
$assetMaintenances->asset_maintenance_time = Carbon::now()
->diffInDays( Carbon::parse( $assetMaintenances->start_date ) );
}
if (($maintenance->cost) && ($maintenance->asset->assetloc) && ($maintenance->asset->assetloc->currency!='')) {
$maintenance_cost = $maintenance->asset->assetloc->currency.$maintenance->cost;
} else {
$maintenance_cost = $settings->default_currency.$maintenance->cost;
}
return intval( $assetMaintenances->asset_maintenance_time );
} )
->addColumn( 'cost', function ( $assetMaintenances ) {
$company = $maintenance->asset->company;
return sprintf( Lang::get( 'general.currency' ) . '%01.2f', $assetMaintenances->cost );
} )
->addColumn( $actions )
->searchColumns( 'asset', 'supplier', 'asset_maintenance_type', 'title', 'start_date',
'completion_date', 'asset_maintenance_time', 'cost', 'actions' )
->orderColumns( 'asset', 'supplier', 'asset_maintenance_type', 'title', 'start_date',
'completion_date', 'asset_maintenance_time', 'cost', 'actions' )
->make();
}
$rows[] = array(
'id' => $maintenance->id,
'asset_name' => link_to('/hardware/'.$maintenance->asset->id.'/view', $maintenance->asset->showAssetName()) ,
'title' => $maintenance->title,
'notes' => $maintenance->notes,
'supplier' => $maintenance->supplier->name,
'cost' => $maintenance_cost,
'asset_maintenance_type' => e($maintenance->asset_maintenance_type),
'start_date' => $maintenance->start_date,
'time' => $maintenance->asset_maintenance_time,
'completion_date' => $maintenance->completion_date,
'actions' => $actions,
'companyName' => is_null($company) ? '' : $company->name
);
}
$data = array('total' => $maintenancesCount, 'rows' => $rows);
return $data;
}
/**
* getCreate
@@ -122,7 +130,6 @@
*/
public function getCreate( $assetId = null )
{
// Prepare Asset Maintenance Type List
$assetMaintenanceType = [
'' => 'Select an asset maintenance type',
@@ -130,7 +137,7 @@
// 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 = DB::table( 'assets' )
$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',
@@ -206,6 +213,12 @@
$assetMaintenance->notes = e( Input::get( 'notes' ) );
}
$asset = Asset::find( e( Input::get( 'asset_id' ) ) );
if (!Company::isCurrentUserHasAccess($asset)) {
return static::getInsufficientPermissionsRedirect();
}
// Save the asset maintenance data
$assetMaintenance->asset_id = e( Input::get( 'asset_id' ) );
$assetMaintenance->asset_maintenance_type = e( Input::get( 'asset_maintenance_type' ) );
@@ -253,13 +266,15 @@
*/
public function getEdit( $assetMaintenanceId = null )
{
// Check if the asset maintenance exists
if (is_null( $assetMaintenance = AssetMaintenance::find( $assetMaintenanceId ) )) {
// Redirect to the improvement management page
return Redirect::to( 'admin/asset_maintenances' )
->with( 'error', Lang::get( 'admin/asset_maintenances/message.not_found' ) );
}
else if (!Company::isCurrentUserHasAccess( $assetMaintenance->asset )) {
return static::getInsufficientPermissionsRedirect();
}
if ($assetMaintenance->completion_date == '0000-00-00') {
$assetMaintenance->completion_date = null;
@@ -279,7 +294,7 @@
] + AssetMaintenance::getImprovementOptions();
// Get the possible assets using a left join to get a list of assets and some other helpful info
$asset = DB::table( 'assets' )
$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',
@@ -334,6 +349,9 @@
return Redirect::to( 'admin/asset_maintenances' )
->with( 'error', Lang::get( 'admin/asset_maintenances/message.not_found' ) );
}
else if (!Company::isCurrentUserHasAccess( $assetMaintenance->asset )) {
return static::getInsufficientPermissionsRedirect();
}
// attempt validation
if ($assetMaintenance->validate( $new )) {
@@ -362,6 +380,12 @@
$assetMaintenance->notes = e( Input::get( 'notes' ) );
}
$asset = Asset::find( e( Input::get( 'asset_id' ) ) );
if (!Company::isCurrentUserHasAccess($asset)) {
return static::getInsufficientPermissionsRedirect();
}
// Save the asset maintenance data
$assetMaintenance->asset_id = e( Input::get( 'asset_id' ) );
$assetMaintenance->asset_maintenance_type = e( Input::get( 'asset_maintenance_type' ) );
@@ -424,13 +448,16 @@
*/
public function getDelete( $assetMaintenanceId )
{
// Check if the asset maintenance exists
if (is_null( $assetMaintenance = AssetMaintenance::find( $assetMaintenanceId ) )) {
// Redirect to the asset maintenance management page
return Redirect::to( 'admin/asset_maintenances' )
->with( 'error', Lang::get( 'admin/asset_maintenances/message.not_found' ) );
}
else if (!Company::isCurrentUserHasAccess( $assetMaintenance->asset )) {
return static::getInsufficientPermissionsRedirect();
}
// Delete the asset maintenance
$assetMaintenance->delete();
@@ -450,15 +477,17 @@
*/
public function getView( $assetMaintenanceId )
{
// Check if the asset maintenance exists
if (is_null( $assetMaintenance = AssetMaintenance::find( $assetMaintenanceId ) )) {
// Redirect to the asset maintenance management page
return Redirect::to( 'admin/asset_maintenances' )
->with( 'error', Lang::get( 'admin/asset_maintenances/message.not_found' ) );
}
else if (!Company::isCurrentUserHasAccess( $assetMaintenance->asset )) {
return static::getInsufficientPermissionsRedirect();
}
return View::make( 'backend/asset_maintenances/view')->with('assetMaintenance', $assetMaintenance);
}
}
}
+373 -152
View File
@@ -2,6 +2,7 @@
use AdminController;
use Input;
use Image;
use Lang;
use Asset;
use Supplier;
@@ -12,6 +13,7 @@ use Setting;
use Redirect;
use DB;
use Actionlog;
use Company;
use Model;
use Depreciation;
use Sentry;
@@ -23,10 +25,14 @@ use Config;
use Location;
use Log;
use Mail;
use Datatable;
use TCPDF;
use Slack;
use Paginator;
use Manufacturer; //for embedded-create
use Artisan;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\HttpFoundation\JsonResponse;
class AssetsController extends AdminController
{
@@ -60,11 +66,13 @@ class AssetsController extends AdminController
$manufacturer_list = manufacturerList();
$category_list = categoryList();
$supplier_list = suppliersList();
$company_list = Company::getSelectList();
$assigned_to = usersList();
$statuslabel_types = statusTypeList();
$view = View::make('backend/hardware/edit');
$view->with('supplier_list',$supplier_list);
$view->with('company_list',$company_list);
$view->with('model_list',$model_list);
$view->with('statuslabel_list',$statuslabel_list);
$view->with('assigned_to',$assigned_to);
@@ -157,7 +165,8 @@ class AssetsController extends AdminController
// Save the asset data
$asset->name = e(Input::get('name'));
$asset->serial = e(Input::get('serial'));
$asset->model_id = e(Input::get('model_id'));
$asset->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
$asset->model_id = e(Input::get('model_id'));
$asset->order_number = e(Input::get('order_number'));
$asset->notes = e(Input::get('notes'));
$asset->asset_tag = e(Input::get('asset_tag'));
@@ -166,6 +175,19 @@ class AssetsController extends AdminController
$asset->physical = '1';
$asset->depreciate = '0';
// Create the image (if one was chosen.)
if (Input::file('image')) {
$image = Input::file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
$path = public_path('uploads/assets/'.$file_name);
Image::make($image->getRealPath())->resize(300, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$asset->image = $file_name;
}
// Was the asset created?
if($asset->save()) {
@@ -178,7 +200,6 @@ class AssetsController extends AdminController
$logaction->note = e(Input::get('note'));
$log = $logaction->logaction('checkout');
}
// Redirect to the asset listing page
return Redirect::to("hardware")->with('success', Lang::get('admin/hardware/message.create.success'));
}
@@ -203,6 +224,9 @@ class AssetsController extends AdminController
// Redirect to the asset management page
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
else if (!Company::isCurrentUserHasAccess($asset)) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
// Grab the dropdown lists
$model_list = modelList();
@@ -211,12 +235,14 @@ class AssetsController extends AdminController
$manufacturer_list = manufacturerList();
$category_list = categoryList();
$supplier_list = suppliersList();
$company_list = Company::getSelectList();
$assigned_to = usersList();
$statuslabel_types = statusTypeList();
return View::make('backend/hardware/edit', compact('asset'))
->with('model_list',$model_list)
->with('supplier_list',$supplier_list)
->with('company_list',$company_list)
->with('location_list',$location_list)
->with('statuslabel_list',$statuslabel_list)
->with('assigned_to',$assigned_to)
@@ -239,6 +265,9 @@ class AssetsController extends AdminController
// Redirect to the asset management page with error
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
else if (!Company::isCurrentUserHasAccess($asset)) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
//attempt to validate
$validator = Validator::make(Input::all(), $asset->validationRules($assetId));
@@ -298,13 +327,28 @@ class AssetsController extends AdminController
$asset->mac_address = ($checkModel == true) ? e(Input::get('mac_address')) : NULL;
// Update the asset data
$asset->name = e(Input::get('name'));
$asset->serial = e(Input::get('serial'));
$asset->model_id = e(Input::get('model_id'));
$asset->order_number = e(Input::get('order_number'));
$asset->asset_tag = e(Input::get('asset_tag'));
$asset->notes = e(Input::get('notes'));
$asset->physical = '1';
$asset->name = e(Input::get('name'));
$asset->serial = e(Input::get('serial'));
$asset->company_id = Company::getIdForCurrentUser(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->physical = '1';
// Update the image
if (Input::file('image')) {
$image = Input::file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
$path = public_path('uploads/assets/'.$file_name);
Image::make($image->getRealPath())->resize(300, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$asset->image = $file_name;
}
// Was the asset updated?
if($asset->save()) {
@@ -334,7 +378,10 @@ class AssetsController extends AdminController
// Check if the asset exists
if (is_null($asset = Asset::find($assetId))) {
// Redirect to the asset management page with error
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.not_found'));
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
else if (!Company::isCurrentUserHasAccess($asset)) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
if (isset($asset->assigneduser->id) && ($asset->assigneduser->id!=0)) {
@@ -366,7 +413,10 @@ class AssetsController extends AdminController
// Check if the asset exists
if (is_null($asset = Asset::find($assetId))) {
// Redirect to the asset management page with error
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.not_found'));
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
else if (!Company::isCurrentUserHasAccess($asset)) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
// Get the dropdown of users and then pass it to the checkout view
@@ -384,7 +434,10 @@ class AssetsController extends AdminController
// Check if the asset exists
if (!$asset = Asset::find($assetId)) {
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.not_found'));
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
else if (!Company::isCurrentUserHasAccess($asset)) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
// Declare the rules for the form validation
@@ -413,13 +466,13 @@ class AssetsController extends AdminController
if (Input::get('checkout_at')!= date("Y-m-d")){
$checkout_at = e(Input::get('checkout_at')).' 00:00:00';
} else {
$checkout_at = date("Y-m-d h:i:s");
$checkout_at = date("Y-m-d H:i:s");
}
if (Input::has('expected_checkin')) {
if (Input::get('expected_checkin')!= date("Y-m-d")){
$expected_checkin = e(Input::get('expected_checkin')).' 00:00:00';
}
$expected_checkin = e(Input::get('expected_checkin'));
}
} else {
$expected_checkin = null;
}
@@ -446,7 +499,10 @@ class AssetsController extends AdminController
// Check if the asset exists
if (is_null($asset = Asset::find($assetId))) {
// Redirect to the asset management page with error
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.not_found'));
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
else if (!Company::isCurrentUserHasAccess($asset)) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
return View::make('backend/hardware/checkin', compact('asset'))->with('backto', $backto);
@@ -464,7 +520,10 @@ class AssetsController extends AdminController
// Check if the asset exists
if (is_null($asset = Asset::find($assetId))) {
// Redirect to the asset management page with error
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.not_found'));
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
else if (!Company::isCurrentUserHasAccess($asset)) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
// Check for a valid user to checkout fa-random
@@ -492,7 +551,7 @@ class AssetsController extends AdminController
if (Input::has('checkin_at')) {
if (!strtotime(Input::get('checkin_at'))) {
$logaction->created_at = date("Y-m-d h:i:s");
$logaction->created_at = date("Y-m-d H:i:s");
} elseif (Input::get('checkin_at')!= date("Y-m-d")) {
$logaction->created_at = e(Input::get('checkin_at')).' 00:00:00';
}
@@ -575,17 +634,36 @@ class AssetsController extends AdminController
public function getView($assetId = null)
{
$asset = Asset::withTrashed()->find($assetId);
$settings = Setting::getSettings();
if (!Company::isCurrentUserHasAccess($asset)) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
else if ($asset->userloc) {
$use_currency = $asset->userloc->currency;
} elseif ($asset->assetloc) {
$use_currency = $asset->assetloc->currency;
} else {
$default_currency = Setting::first()->default_currency;
if ($settings->default_currency!='') {
$use_currency = $settings->default_currency;
} else {
$use_currency = Lang::get('general.currency');
}
}
if (isset($asset->id)) {
$settings = Setting::getSettings();
$qr_code = (object) array(
'display' => $settings->qr_code == '1',
'url' => route('qr_code/hardware', $asset->id)
);
return View::make('backend/hardware/view', compact('asset', 'qr_code'));
return View::make('backend/hardware/view', compact('asset', 'qr_code','settings'))->with('use_currency',$use_currency);
} else {
// Prepare the error message
$error = Lang::get('admin/hardware/message.does_not_exist', compact('id'));
@@ -610,6 +688,10 @@ class AssetsController extends AdminController
$asset = Asset::find($assetId);
$size = barcodeDimensions($settings->barcode_type);
if (!Company::isCurrentUserHasAccess($asset)) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
if (isset($asset->id,$asset->asset_tag)) {
$barcode = new \Com\Tecnick\Barcode\Barcode();
$barcode_obj = $barcode->getBarcodeObj($settings->barcode_type, route('view/hardware', $asset->id), $size['height'], $size['width'], 'black', array(-2, -2, -2, -2));
@@ -619,6 +701,114 @@ class AssetsController extends AdminController
}
public function getImportUpload() {
$path = app_path().'/private_uploads/imports/assets';
$files = array();
if (!Company::isCurrentUserAuthorized()) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
if ($handle = opendir($path)) {
/* This is the correct way to loop over the directory. */
while (false !== ($entry = readdir($handle))) {
clearstatcache();
if (substr(strrchr($entry,'.'),1)=='csv') {
$files[] = array(
'filename' => $entry,
'filesize' => Setting::fileSizeConvert(filesize($path.'/'.$entry)),
'modified' => filemtime($path.'/'.$entry)
);
}
}
closedir($handle);
$files = array_reverse($files);
}
return View::make('backend/hardware/import')->with('files',$files);
}
public function postAPIImportUpload() {
if (!Company::isCurrentUserAuthorized()) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
elseif (!Config::get('app.lock_passwords')) {
$rules = array(
'files' => 'required'
);
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
$messages = $validator->messages();
$results['error']=$messages->first('files');
return $results;
} else {
$files = Input::file('files');
$path = app_path().'/private_uploads/imports/assets';
$results = array();
foreach ($files as $file) {
if (!in_array($file->getMimeType(), array(
'application/vnd.ms-excel',
'text/csv',
'text/plain',
'text/comma-separated-values',
'text/tsv'))) {
$results['error']='File type must be CSV';
return $results;
}
$date = date('Y-m-d-his');
$fixed_filename = str_replace(' ','-',$file->getClientOriginalName());
$file->move($path, $date.'-'.$fixed_filename);
$name = date('Y-m-d-his').'-'.$fixed_filename;
$filesize = Setting::fileSizeConvert(filesize($path.'/'.$name));
$results[] = compact('name', 'filesize');
}
}
} else {
$results['error']=Lang::get('general.feature_disabled');
return $results;
}
return array(
'files' => $results
);
}
public function getProcessImportFile($filename) {
// php artisan asset-import:csv path/to/your/file.csv --domain=yourdomain.com --email_format=firstname.lastname
if (!Company::isCurrentUserAuthorized()) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
$output = new BufferedOutput;
Artisan::call('asset-import:csv', ['filename'=> app_path().'/private_uploads/imports/assets/'.$filename, '--email_format'=>'firstname.lastname', '--username_format'=>'firstname.lastname'], $output);
$display_output = $output->fetch();
$file = app_path().'/private_uploads/imports/assets/'.str_replace('.csv','',$filename).'-output-'.date("Y-m-d-his").'.txt';
file_put_contents($file, $display_output);
return View::make('backend/hardware/import-status');
}
/**
* Asset clone.
*
@@ -632,6 +822,9 @@ class AssetsController extends AdminController
// Redirect to the asset management page
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
else if (!Company::isCurrentUserHasAccess($asset_to_clone)) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
// Grab the dropdown lists
$model_list = modelList();
@@ -642,6 +835,7 @@ class AssetsController extends AdminController
$supplier_list = suppliersList();
$assigned_to = usersList();
$statuslabel_types = statusTypeList();
$company_list = Company::getSelectList();
$asset = clone $asset_to_clone;
$asset->id = null;
@@ -658,7 +852,8 @@ class AssetsController extends AdminController
->with('asset',$asset)
->with('location_list',$location_list)
->with('manufacturer',$manufacturer_list)
->with('category',$category_list);
->with('category',$category_list)
->with('company_list',$company_list);
}
@@ -669,7 +864,10 @@ class AssetsController extends AdminController
// Get user information
$asset = Asset::withTrashed()->find($assetId);
if (isset($asset->id)) {
if (!Company::isCurrentUserHasAccess($asset)) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
else if (isset($asset->id)) {
// Restore the user
$asset->restore();
@@ -681,7 +879,7 @@ class AssetsController extends AdminController
return Redirect::route('hardware')->with('success', $success);
} else {
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.not_found'));
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
}
@@ -702,6 +900,10 @@ class AssetsController extends AdminController
if (isset($asset->id)) {
if (!Company::isCurrentUserHasAccess($asset)) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
if (Input::hasFile('assetfile')) {
foreach(Input::file('assetfile') as $file) {
@@ -725,7 +927,7 @@ class AssetsController extends AdminController
$logaction->user_id = Sentry::getUser()->id;
$logaction->note = e(Input::get('notes'));
$logaction->checkedout_to = NULL;
$logaction->created_at = date("Y-m-d h:i:s");
$logaction->created_at = date("Y-m-d H:i:s");
$logaction->filename = $filename;
$log = $logaction->logaction('uploaded');
} else {
@@ -773,6 +975,11 @@ class AssetsController extends AdminController
// the asset is valid
if (isset($asset->id)) {
if (!Company::isCurrentUserHasAccess($asset)) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
$log = Actionlog::find($fileId);
$full_filename = $destinationPath.'/'.$log->filename;
if (file_exists($full_filename)) {
@@ -805,9 +1012,28 @@ class AssetsController extends AdminController
// the asset is valid
if (isset($asset->id)) {
$log = Actionlog::find($fileId);
$file = $log->get_src();
return Response::download($file);
if (!Company::isCurrentUserHasAccess($asset)) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
$log = Actionlog::find($fileId);
$file = $log->get_src();
$filetype = Asset::checkUploadIsImage($file);
if ($filetype) {
$contents = file_get_contents($file);
$response = Response::make($contents);
$response->header('Content-Type', $filetype);
return $response;
} else {
return Response::download($file);
}
} else {
// Prepare the error message
$error = Lang::get('admin/hardware/message.does_not_exist', compact('id'));
@@ -828,7 +1054,10 @@ class AssetsController extends AdminController
public function postBulkEdit($assets = null)
{
if (!Input::has('edit_asset')) {
if (!Company::isCurrentUserAuthorized()) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
else if (!Input::has('edit_asset')) {
return Redirect::back()->with('error', 'No assets selected');
} else {
$asset_raw_array = Input::get('edit_asset');
@@ -884,7 +1113,10 @@ class AssetsController extends AdminController
public function postBulkSave($assets = null)
{
if (Input::has('bulk_edit')) {
if (!Company::isCurrentUserAuthorized()) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
else if (Input::has('bulk_edit')) {
$assets = Input::get('bulk_edit');
@@ -936,7 +1168,7 @@ class AssetsController extends AdminController
$logaction = new Actionlog();
$logaction->asset_id = $key;
$logaction->asset_type = 'hardware';
$logaction->created_at = date("Y-m-d h:i:s");
$logaction->created_at = date("Y-m-d H:i:s");
if (Input::has('rtd_location_id')) {
$logaction->location_id = e(Input::get('rtd_location_id'));
@@ -967,8 +1199,29 @@ class AssetsController extends AdminController
public function getDatatable($status = null)
{
$assets = Asset::with('model','assigneduser','assigneduser.userloc','assetstatus','defaultLoc','assetlog','model','model.category')->Hardware()->select(array('id', 'name','model_id','assigned_to','asset_tag','serial','status_id','purchase_date','deleted_at','rtd_location_id','notes','order_number','mac_address'));
$assets = Asset::select('assets.*')->with('model','assigneduser','assigneduser.userloc','assetstatus','defaultLoc','assetlog','model','model.category','assetstatus','assetloc', 'company')
->Hardware();
if (Input::has('search')) {
$assets = $assets->TextSearch(Input::get('search'));
}
if (Input::has('offset')) {
$offset = e(Input::get('offset'));
} else {
$offset = 0;
}
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
if (Input::has('order_number')) {
$assets->where('order_number','=',e(Input::get('order_number')));
}
switch ($status) {
case 'Deleted':
@@ -995,127 +1248,95 @@ class AssetsController extends AdminController
}
if (Input::has('order_number')) {
$assets->where('order_number','=',e(Input::get('order_number')));
$allowed_columns = [
'id',
'name',
'asset_tag',
'serial',
'model',
'last_checkout',
'category',
'notes',
'expected_checkin',
'order_number',
'companyName',
'location',
'image',
];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'asset_tag';
switch ($sort)
{
case 'model':
$assets = $assets->OrderModels($order);
break;
case 'category':
$assets = $assets->OrderCategory($order);
break;
case 'companyName':
$assets = $assets->OrderCompany($order);
break;
case 'location':
$assets = $assets->OrderLocation($order);
break;
case 'status':
$assets = $assets->OrderCategory($order);
break;
default:
$assets = $assets->orderBy($sort, $order);
break;
}
$assetCount = $assets->count();
$assets = $assets->skip($offset)->take($limit)->get();
$rows = array();
foreach ($assets as $asset) {
$inout = '';
$actions = '';
if ($asset->deleted_at=='') {
$actions = '<div style=" white-space: nowrap;"><a href="'.route('clone/hardware', $asset->id).'" class="btn btn-info btn-sm" title="Clone asset"><i class="fa fa-files-o"></i></a> <a href="'.route('update/hardware', $asset->id).'" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> <a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/hardware', $asset->id).'" data-content="'.Lang::get('admin/hardware/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($asset->asset_tag).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';
} elseif ($asset->model->deleted_at=='') {
$actions = '<a href="'.route('restore/hardware', $asset->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
}
if ($asset->assetstatus) {
if ($asset->assetstatus->deployable != 0) {
if (($asset->assigned_to !='') && ($asset->assigned_to > 0)) {
$inout = '<a href="'.route('checkin/hardware', $asset->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
} else {
$inout = '<a href="'.route('checkout/hardware', $asset->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
}
}
}
$rows[] = array(
'checkbox' =>'<div class="text-center"><input type="checkbox" name="edit_asset['.$asset->id.']" class="one_required"></div>',
'id' => $asset->id,
'image' => ($asset->image!='') ? '<img src="'.Config::get('app.url').'/uploads/assets/'.$asset->image.'" height=50 width=50>' : (($asset->model->image!='') ? '<img src="'.Config::get('app.url').'/uploads/models/'.$asset->model->image.'" height=40 width=50>' : ''),
'name' => '<a title="'.$asset->name.'" href="hardware/'.$asset->id.'/view">'.$asset->name.'</a>',
'asset_tag' => '<a title="'.$asset->asset_tag.'" href="hardware/'.$asset->id.'/view">'.$asset->asset_tag.'</a>',
'serial' => $asset->serial,
'model' => ($asset->model) ? link_to('/hardware/models/'.$asset->model->id.'/view', $asset->model->name) : 'No model',
'status' => ($asset->assigneduser) ? link_to('../admin/users/'.$asset->assigned_to.'/view', $asset->assigneduser->fullName()) : (($asset->assetstatus) ? $asset->assetstatus->name : ''),
'location' => (($asset->assigneduser) && ($asset->assigneduser->userloc!='')) ? link_to('admin/settings/locations/'.$asset->assigneduser->userloc->id.'/edit', $asset->assigneduser->userloc->name) : (($asset->defaultLoc!='') ? link_to('admin/settings/locations/'.$asset->defaultLoc->id.'/edit', $asset->defaultLoc->name) : ''),
'category' => (($asset->model) && ($asset->model->category)) ? $asset->model->category->name : '',
'eol' => ($asset->eol_date()) ? $asset->eol_date() : '',
'notes' => $asset->notes,
'order_number' => ($asset->order_number!='') ? '<a href="../hardware/?order_number='.$asset->order_number.'">'.$asset->order_number.'</a>' : '',
'last_checkout' => ($asset->last_checkout!='') ? $asset->last_checkout : '',
'expected_checkin' => ($asset->expected_checkin!='') ? $asset->expected_checkin : '',
'change' => ($inout) ? $inout : '',
'actions' => ($actions) ? $actions : '',
'companyName' => is_null($asset->company) ? '' : e($asset->company->name)
);
}
$assets = $assets->orderBy('asset_tag', 'ASC')->get();
$data = array('total'=>$assetCount, 'rows'=>$rows);
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($assets)
{
if ($assets->deleted_at=='') {
return '<div style=" white-space: nowrap;"><a href="'.route('clone/hardware', $assets->id).'" class="btn btn-info btn-sm" title="Clone asset"><i class="fa fa-files-o"></i></a> <a href="'.route('update/hardware', $assets->id).'" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> <a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/hardware', $assets->id).'" data-content="'.Lang::get('admin/hardware/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($assets->asset_tag).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';
} elseif ($assets->deleted_at!='') {
return '<a href="'.route('restore/hardware', $assets->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
}
});
$inout = new \Chumper\Datatable\Columns\FunctionColumn('inout', function ($assets)
{
if ($assets->assetstatus) {
if ($assets->assetstatus->deployable != 0) {
if (($assets->assigned_to !='') && ($assets->assigned_to > 0)) {
return '<a href="'.route('checkin/hardware', $assets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
} else {
return '<a href="'.route('checkout/hardware', $assets->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
}
}
}
});
return Datatable::collection($assets)
->addColumn('',function($assets)
{
return '<div class="text-center"><input type="checkbox" name="edit_asset['.$assets->id.']" class="one_required"></div>';
})
->addColumn('name',function($assets)
{
return '<a title="'.$assets->name.'" href="hardware/'.$assets->id.'/view">'.$assets->name.'</a>';
})
->addColumn('asset_tag',function($assets)
{
return '<a title="'.$assets->asset_tag.'" href="hardware/'.$assets->id.'/view">'.$assets->asset_tag.'</a>';
})
->showColumns('serial')
->addColumn('model',function($assets)
{
if ($assets->model) {
return $assets->model->name;
} else {
return 'No model';
}
})
->addColumn('status',function($assets)
{
if ($assets->assigned_to!='') {
return link_to(Config::get('app.url').'/admin/users/'.$assets->assigned_to.'/view', $assets->assigneduser->fullName());
} else {
if ($assets->assetstatus) {
return $assets->assetstatus->name;
}
}
})
->addColumn('location',function($assets)
{
if ($assets->assigned_to && ($assets->assigneduser->userloc!='')) {
return link_to('admin/settings/locations/'.$assets->assigneduser->userloc->id.'/edit', $assets->assigneduser->userloc->name);
} elseif ($assets->defaultLoc){
return link_to('admin/settings/locations/'.$assets->defaultLoc->id.'/edit', $assets->defaultLoc->name);
}
})
->addColumn('category',function($assets)
{
if (isset($assets->model->category)) {
return $assets->model->category->name;
} else {
return 'No category';
}
})
->addColumn('eol',function($assets)
{
return $assets->eol_date();
})
->addColumn('notes',function($assets)
{
return $assets->notes;
})
->addColumn('mac_address',function($assets)
{
return $assets->mac_address;
})
->addColumn('order_number',function($assets)
{
return '<a href="../hardware/?order_number='.$assets->order_number.'">'.$assets->order_number.'';
})
->addColumn('checkout_date',function($assets)
{
if (($assets->assigned_to!='') && ($assets->assetlog->first())) {
return $assets->assetlog->first()->created_at->format('Y-m-d');
}
})
->addColumn($inout)
->addColumn($actions)
->searchColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','checkout_date', 'inout','category','notes','order_number','mac_address')
->orderColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','notes','order_number','checkout_date', 'inout','mac_address')
->make();
}
return $data;
}
}
+107 -47
View File
@@ -4,6 +4,7 @@ use AdminController;
use Input;
use Lang;
use Category;
use Company;
use Redirect;
use Setting;
use DB;
@@ -11,7 +12,6 @@ use Sentry;
use Str;
use Validator;
use View;
use Datatable;
class CategoriesController extends AdminController
{
@@ -218,61 +218,121 @@ class CategoriesController extends AdminController
public function getDatatable()
{
// Grab all the categories
$categories = Category::orderBy('created_at', 'DESC')->get();
$categories = Category::with('assets', 'accessories');
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function($categories) {
return '<a href="'.route('update/category', $categories->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/category', $categories->id).'" data-content="'.Lang::get('admin/categories/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($categories->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
});
if (Input::has('search')) {
$categories = $categories->TextSearch(e(Input::get('search')));
}
return Datatable::collection($categories)
->showColumns('name')
->addColumn('category_type', function($categories) {
return ucwords($categories->category_type);
})
->addColumn('count', function($categories) {
return ($categories->category_type=='asset') ? link_to('/admin/settings/categories/'.$categories->id.'/view', $categories->assetscount()) : $categories->accessoriescount();
})
->addColumn('acceptance', function($categories) {
return ($categories->require_acceptance=='1') ? '<i class="fa fa-check" style="margin-right:50%;margin-left:50%;"></i>' : '';
})
->addColumn('eula', function($categories) {
return ($categories->getEula()) ? '<i class="fa fa-check" style="margin-right:50%;margin-left:50%;"></i></a>' : '';
})
->addColumn($actions)
->searchColumns('name','category_type','count','acceptance','eula','actions')
->orderColumns('name','category_type','count','acceptance','eula','actions')
->make();
if (Input::has('offset')) {
$offset = e(Input::get('offset'));
} else {
$offset = 0;
}
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
$allowed_columns = ['id','name','category_type'];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
$categories = $categories->orderBy($sort, $order);
$catCount = $categories->count();
$categories = $categories->skip($offset)->take($limit)->get();
$rows = array();
foreach ($categories as $category) {
$actions = '<a href="'.route('update/category', $category->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/category', $category->id).'" data-content="'.Lang::get('admin/categories/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($category->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
$rows[] = array(
'id' => $category->id,
'name' => link_to('/admin/settings/categories/'.$category->id.'/view', $category->name) ,
'category_type' => ucwords($category->category_type),
'count' => ($category->category_type=='asset') ? $category->assetscount() : $category->accessoriescount(),
'acceptance' => ($category->require_acceptance=='1') ? '<i class="fa fa-check"></i>' : '',
//EULA is still not working correctly
'eula' => ($category->getEula()) ? '<i class="fa fa-check"></i>' : '',
'actions' => $actions
);
}
$data = array('total' => $catCount, 'rows' => $rows);
return $data;
}
public function getDataView($categoryID) {
$category = Category::find($categoryID);
$categoryassets = $category->assets;
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($categoryassets)
{
if (($categoryassets->assigned_to !='') && ($categoryassets->assigned_to > 0)) {
return '<a href="'.route('checkin/hardware', $categoryassets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
$category = Category::with('assets.company')->find($categoryID);
$category_assets = $category->assets;
if (Input::has('search')) {
$category_assets = $category_assets->TextSearch(e(Input::get('search')));
}
if (Input::has('offset')) {
$offset = e(Input::get('offset'));
} else {
$offset = 0;
}
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$allowed_columns = ['id','name','serial','asset_tag'];
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
$count = $category_assets->count();
$rows = array();
foreach ($category_assets as $asset) {
$actions = '';
$inout='';
if ($asset->deleted_at=='') {
$actions = '<div style=" white-space: nowrap;"><a href="'.route('clone/hardware', $asset->id).'" class="btn btn-info btn-sm" title="Clone asset"><i class="fa fa-files-o"></i></a> <a href="'.route('update/hardware', $asset->id).'" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> <a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/hardware', $asset->id).'" data-content="'.Lang::get('admin/hardware/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($asset->asset_tag).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';
} elseif ($asset->deleted_at!='') {
$actions = '<a href="'.route('restore/hardware', $asset->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
}
if ($asset->assetstatus) {
if ($asset->assetstatus->deployable != 0) {
if (($asset->assigned_to !='') && ($asset->assigned_to > 0)) {
$inout = '<a href="'.route('checkin/hardware', $asset->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
} else {
return '<a href="'.route('checkout/hardware', $categoryassets->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
$inout = '<a href="'.route('checkout/hardware', $asset->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
}
});
return Datatable::collection($categoryassets)
->addColumn('name', function ($categoryassets) {
return link_to('/hardware/'.$categoryassets->id.'/view', $categoryassets->name);
})
->addColumn('asset_tag', function ($categoryassets) {
return link_to('/hardware/'.$categoryassets->id.'/view', $categoryassets->asset_tag);
})
->addColumn('assigned_to', function ($categoryassets) {
if ($categoryassets->assigned_to) {
return link_to('/admin/users/'.$categoryassets->assigned_to.'/view', $categoryassets->assigneduser->fullName());
}
})
->addColumn($actions)
->searchColumns('name','asset_tag','assigned_to','actions')
->orderColumns('name','asset_tag','assigned_to','actions')
->make();
}
$rows[] = array(
'id' => $asset->id,
'name' => link_to('/hardware/'.$asset->id.'/view', $asset->showAssetName()),
'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()): '',
'change' => $inout,
'actions' => $actions,
'companyName' => Company::getName($asset),
);
}
$data = array('total' => $count, 'rows' => $rows);
return $data;
}
@@ -0,0 +1,127 @@
<?php namespace Controllers\Admin;
use AdminController;
use Company;
use Input;
use Lang;
use Redirect;
use Validator;
use View;
final class CompaniesController extends AdminController
{
public function getIndex()
{
return View::make('backend/companies/index')->with('companies', Company::all());
}
public function getCreate()
{
return View::make('backend/companies/edit')->with('company', new Company);
}
public function postCreate()
{
$company = new Company;
if ($company->validate(Input::all()))
{
$company->name = e(Input::get('name'));
if($company->save())
{
return Redirect::to('admin/settings/companies')
->with('success', Lang::get('admin/companies/message.create.success'));
}
else
{
return Redirect::to('admin/settings/companies/create')
->with('error', Lang::get('admin/companies/message.create.error'));
}
}
else
{
return Redirect::back()->withInput()->withErrors($company->errors());
}
}
public function getEdit($companyId)
{
if (is_null($company = Company::find($companyId)))
{
return Redirect::to('admin/settings/companies')
->with('error', Lang::get('admin/companies/message.does_not_exist'));
}
else
{
return View::make('backend/companies/edit')->with('company', $company);
}
}
public function postEdit($companyId)
{
if (is_null($company = Company::find($companyId)))
{
return Redirect::to('admin/settings/companies')->with('error', Lang::get('admin/companies/message.does_not_exist'));
}
else
{
$validator = Validator::make(Input::all(), $company->validationRules($companyId));
if ($validator->fails())
{
return Redirect::back()->withInput()->withErrors($validator->messages());
}
else
{
$company->name = e(Input::get('name'));
if($company->save())
{
return Redirect::to('admin/settings/companies')
->with('success', Lang::get('admin/companies/message.update.success'));
}
else
{
return Redirect::to("admin/settings/companies/$companyId/edit")
->with('error', Lang::get('admin/companies/message.update.error'));
}
}
}
}
public function postDelete($companyId)
{
if (is_null($company = Company::find($companyId)))
{
return Redirect::to('admin/settings/companies')
->with('error', Lang::get('admin/companies/message.not_found'));
}
else
{
try
{
$company->delete();
return Redirect::to('admin/settings/companies')
->with('success', Lang::get('admin/companies/message.delete.success'));
}
catch (\Illuminate\Database\QueryException $exception)
{
/*
* NOTE: This happens when there's a foreign key constraint violation
* For example when rows in other tables are referencing this company
*/
if ($exception->getCode() == 23000)
{
return Redirect::to('admin/settings/companies')
->with('error', Lang::get('admin/companies/message.assoc_users'));
}
else
{
throw $exception;
}
}
}
}
}
+223 -113
View File
@@ -8,6 +8,7 @@ use Setting;
use DB;
use Sentry;
use Consumable;
use Company;
use Str;
use Validator;
use View;
@@ -41,7 +42,14 @@ class ConsumablesController extends AdminController
{
// Show the page
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','consumable')->whereNull('deleted_at')->orderBy('name','ASC')->lists('name', 'id');
return View::make('backend/consumables/edit')->with('consumable',new Consumable)->with('category_list',$category_list);
$company_list = Company::getSelectList();
$location_list = locationsList();
return View::make('backend/consumables/edit')
->with('consumable', new Consumable)
->with('category_list', $category_list)
->with('company_list', $company_list)
->with('location_list', $location_list);
}
@@ -66,10 +74,26 @@ class ConsumablesController extends AdminController
else{
// Update the consumable data
$consumable->name = e(Input::get('name'));
$consumable->category_id = e(Input::get('category_id'));
$consumable->qty = e(Input::get('qty'));
$consumable->user_id = Sentry::getId();
$consumable->name = e(Input::get('name'));
$consumable->category_id = e(Input::get('category_id'));
$consumable->location_id = e(Input::get('location_id'));
$consumable->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
$consumable->order_number = e(Input::get('order_number'));
if (e(Input::get('purchase_date')) == '') {
$consumable->purchase_date = NULL;
} else {
$consumable->purchase_date = e(Input::get('purchase_date'));
}
if (e(Input::get('purchase_cost')) == '0.00') {
$consumable->purchase_cost = NULL;
} else {
$consumable->purchase_cost = ParseFloat(e(Input::get('purchase_cost')));
}
$consumable->qty = e(Input::get('qty'));
$consumable->user_id = Sentry::getId();
// Was the consumable created?
if($consumable->save()) {
@@ -97,9 +121,18 @@ class ConsumablesController extends AdminController
// Redirect to the blogs management page
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.does_not_exist'));
}
else if (!Company::isCurrentUserHasAccess($consumable)) {
return Redirect::to('admin/consumables')->with('error', Lang::get('general.insufficient_permissions'));
}
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','consumable')->whereNull('deleted_at')->orderBy('name','ASC')->lists('name', 'id');
return View::make('backend/consumables/edit', compact('consumable'))->with('category_list',$category_list);
$company_list = Company::getSelectList();
$location_list = locationsList();
return View::make('backend/consumables/edit', compact('consumable'))
->with('category_list', $category_list)
->with('company_list', $company_list)
->with('location_list', $location_list);
}
@@ -116,6 +149,9 @@ class ConsumablesController extends AdminController
// Redirect to the blogs management page
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.does_not_exist'));
}
else if (!Company::isCurrentUserHasAccess($consumable)) {
return Redirect::to('admin/consumables')->with('error', Lang::get('general.insufficient_permissions'));
}
// get the POST data
@@ -134,9 +170,25 @@ class ConsumablesController extends AdminController
else {
// Update the consumable data
$consumable->name = e(Input::get('name'));
$consumable->category_id = e(Input::get('category_id'));
$consumable->qty = e(Input::get('qty'));
$consumable->name = e(Input::get('name'));
$consumable->category_id = e(Input::get('category_id'));
$consumable->location_id = e(Input::get('location_id'));
$consumable->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
$consumable->order_number = e(Input::get('order_number'));
if (e(Input::get('purchase_date')) == '') {
$consumable->purchase_date = NULL;
} else {
$consumable->purchase_date = e(Input::get('purchase_date'));
}
if (e(Input::get('purchase_cost')) == '0.00') {
$consumable->purchase_cost = NULL;
} else {
$consumable->purchase_cost = ParseFloat(e(Input::get('purchase_cost')));
}
$consumable->qty = e(Input::get('qty'));
// Was the consumable created?
if($consumable->save()) {
@@ -163,22 +215,15 @@ class ConsumablesController extends AdminController
// Redirect to the blogs management page
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.not_found'));
}
else if (!Company::isCurrentUserHasAccess($consumable)) {
return Redirect::to('admin/consumables')->with('error', Lang::get('general.insufficient_permissions'));
}
if ($consumable->hasUsers() > 0) {
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.assoc_users', array('count'=> $consumable->hasUsers())));
} else {
$consumable->delete();
// Redirect to the locations management page
return Redirect::to('admin/consumables')->with('success', Lang::get('admin/consumables/message.delete.success'));
}
}
@@ -194,7 +239,14 @@ class ConsumablesController extends AdminController
$consumable = Consumable::find($consumableID);
if (isset($consumable->id)) {
if (!Company::isCurrentUserHasAccess($consumable)) {
return Redirect::to('admin/consumables')->with('error', Lang::get('general.insufficient_permissions'));
}
else {
return View::make('backend/consumables/view', compact('consumable'));
}
} else {
// Prepare the error message
$error = Lang::get('admin/consumables/message.does_not_exist', compact('id'));
@@ -216,6 +268,9 @@ class ConsumablesController extends AdminController
// Redirect to the consumable management page with error
return Redirect::to('consumables')->with('error', Lang::get('admin/consumables/message.not_found'));
}
else if (!Company::isCurrentUserHasAccess($consumable)) {
return Redirect::to('admin/consumables')->with('error', Lang::get('general.insufficient_permissions'));
}
// 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');
@@ -229,57 +284,60 @@ class ConsumablesController extends AdminController
**/
public function postCheckout($consumableId)
{
// Check if the consumable exists
if (is_null($consumable = Consumable::find($consumableId))) {
// Redirect to the consumable management page with error
return Redirect::to('consumables')->with('error', Lang::get('admin/consumables/message.not_found'));
}
// Check if the consumable exists
if (is_null($consumable = Consumable::find($consumableId))) {
// Redirect to the consumable management page with error
return Redirect::to('consumables')->with('error', Lang::get('admin/consumables/message.not_found'));
}
else if (!Company::isCurrentUserHasAccess($consumable)) {
return Redirect::to('admin/consumables')->with('error', Lang::get('general.insufficient_permissions'));
}
$admin_user = Sentry::getUser();
$assigned_to = e(Input::get('assigned_to'));
$admin_user = Sentry::getUser();
$assigned_to = e(Input::get('assigned_to'));
// Declare the rules for the form validation
$rules = array(
'assigned_to' => 'required|min:1'
);
// Declare the rules for the form validation
$rules = array(
'assigned_to' => 'required|min:1'
);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// Check if the user exists
if (is_null($user = User::find($assigned_to))) {
// Redirect to the consumable management page with error
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.user_does_not_exist'));
}
// Check if the user exists
if (is_null($user = User::find($assigned_to))) {
// Redirect to the consumable management page with error
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.user_does_not_exist'));
}
// Update the consumable data
$consumable->assigned_to = e(Input::get('assigned_to'));
// Update the consumable data
$consumable->assigned_to = e(Input::get('assigned_to'));
$consumable->users()->attach($consumable->id, array(
'consumable_id' => $consumable->id,
'assigned_to' => e(Input::get('assigned_to'))));
$consumable->users()->attach($consumable->id, array(
'consumable_id' => $consumable->id,
'user_id' => $admin_user->id,
'assigned_to' => e(Input::get('assigned_to'))));
$logaction = new Actionlog();
$logaction->consumable_id = $consumable->id;
$logaction->checkedout_to = $consumable->assigned_to;
$logaction->asset_type = 'consumable';
$logaction->location_id = $user->location_id;
$logaction->user_id = Sentry::getUser()->id;
$logaction->note = e(Input::get('note'));
$logaction = new Actionlog();
$logaction->consumable_id = $consumable->id;
$logaction->checkedout_to = $consumable->assigned_to;
$logaction->asset_type = 'consumable';
$logaction->location_id = $user->location_id;
$logaction->user_id = Sentry::getUser()->id;
$logaction->note = e(Input::get('note'));
$settings = Setting::getSettings();
$settings = Setting::getSettings();
if ($settings->slack_endpoint) {
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
@@ -300,45 +358,40 @@ class ConsumablesController extends AdminController
'title' => 'Note:',
'value' => e($logaction->note)
],
]
])->send('Consumable Checked Out');
} catch (Exception $e) {
}
}
$log = $logaction->logaction('checkout');
$log = $logaction->logaction('checkout');
$consumable_user = DB::table('consumables_users')->where('assigned_to','=',$consumable->assigned_to)->where('consumable_id','=',$consumable->id)->first();
$consumable_user = DB::table('consumables_users')->where('assigned_to','=',$consumable->assigned_to)->where('consumable_id','=',$consumable->id)->first();
$data['log_id'] = $logaction->id;
$data['eula'] = $consumable->getEula();
$data['first_name'] = $user->first_name;
$data['item_name'] = $consumable->name;
$data['checkout_date'] = $logaction->created_at;
$data['item_tag'] = '';
$data['expected_checkin'] = '';
$data['note'] = $logaction->note;
$data['require_acceptance'] = $consumable->requireAcceptance();
$data['log_id'] = $logaction->id;
$data['eula'] = $consumable->getEula();
$data['first_name'] = $user->first_name;
$data['item_name'] = $consumable->name;
$data['checkout_date'] = $logaction->created_at;
$data['item_tag'] = '';
$data['expected_checkin'] = '';
$data['note'] = $logaction->note;
$data['require_acceptance'] = $consumable->requireAcceptance();
if (($consumable->requireAcceptance()=='1') || ($consumable->getEula())) {
if (($consumable->requireAcceptance()=='1') || ($consumable->getEula())) {
Mail::send('emails.accept-asset', $data, function ($m) use ($user) {
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->subject('Confirm consumable delivery');
});
}
Mail::send('emails.accept-asset', $data, function ($m) use ($user) {
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->subject('Confirm consumable delivery');
});
}
// Redirect to the new consumable page
return Redirect::to("admin/consumables")->with('success', Lang::get('admin/consumables/message.checkout.success'));
// Redirect to the new consumable page
return Redirect::to("admin/consumables")->with('success', Lang::get('admin/consumables/message.checkout.success'));
@@ -347,48 +400,105 @@ class ConsumablesController extends AdminController
public function getDatatable()
{
$consumables = Consumable::select(array('id','name','qty'))
->whereNull('deleted_at')
->orderBy('created_at', 'DESC');
$consumables = Consumable::select('consumables.*')->whereNull('consumables.deleted_at')
->with('company','location','category','users');
$consumables = $consumables->get();
if (Input::has('search')) {
$consumables = $consumables->TextSearch(Input::get('search'));
}
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions',function($consumables)
{
return '<a href="'.route('checkout/consumable', $consumables->id).'" style="margin-right:5px;" class="btn btn-info btn-sm" '.(($consumables->numRemaining() > 0 ) ? '' : ' disabled').'>'.Lang::get('general.checkout').'</a><a href="'.route('update/consumable', $consumables->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/consumable', $consumables->id).'" data-content="'.Lang::get('admin/consumables/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($consumables->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
});
if (Input::has('offset')) {
$offset = e(Input::get('offset'));
} else {
$offset = 0;
}
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
$allowed_columns = ['id','name','order_number','purchase_date','purchase_cost','companyName','category'];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
switch ($sort)
{
case 'category':
$consumables = $consumables->OrderCategory($order);
break;
case 'location':
$consumables = $consumables->OrderLocation($order);
break;
case 'companyName':
$consumables = $consumables->OrderCompany($order);
break;
default:
$consumables = $consumables->orderBy($sort, $order);
break;
}
$consumCount = $consumables->count();
$consumables = $consumables->skip($offset)->take($limit)->get();
$rows = array();
foreach($consumables as $consumable) {
$actions = '<nobr><a href="'.route('checkout/consumable', $consumable->id).'" style="margin-right:5px;" class="btn btn-info btn-sm" '.(($consumable->numRemaining() > 0 ) ? '' : ' disabled').'>'.Lang::get('general.checkout').'</a><a href="'.route('update/consumable', $consumable->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/consumable', $consumable->id).'" data-content="'.Lang::get('admin/consumables/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($consumable->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></nobr>';
$company = $consumable->company;
$rows[] = array(
'id' => $consumable->id,
'name' => link_to('admin/consumables/'.$consumable->id.'/view', $consumable->name),
'location' => ($consumable->location) ? e($consumable->location->name) : '',
'qty' => $consumable->qty,
'category' => ($consumable->category) ? $consumable->category->name : 'Missing category',
'order_number' => $consumable->order_number,
'purchase_date' => $consumable->purchase_date,
'purchase_cost' => ($consumable->purchase_cost!='') ? number_format($consumable->purchase_cost,2): '' ,
'numRemaining' => $consumable->numRemaining(),
'actions' => $actions,
'companyName' => is_null($company) ? '' : e($company->name),
);
}
$data = array('total' => $consumCount, 'rows' => $rows);
return $data;
return Datatable::collection($consumables)
->addColumn('name',function($consumables)
{
return link_to('admin/consumables/'.$consumables->id.'/view', $consumables->name);
})
->addColumn('qty',function($consumables)
{
return $consumables->qty;
})
->addColumn('numRemaining',function($consumables)
{
return $consumables->numRemaining();
})
->addColumn($actions)
->searchColumns('name','qty','numRemaining','actions')
->orderColumns('name','qty','numRemaining','actions')
->make();
}
public function getDataView($consumableID)
{
$consumable = Consumable::find($consumableID);
$consumable_users = $consumable->users;
//$consumable = Consumable::find($consumableID);
$consumable = Consumable::with(array('consumableAssigments'=>
function($query) {
$query->orderBy('created_at','DESC');
},
'consumableAssigments.admin'=> function($query) {},
'consumableAssigments.user'=> function($query) {},
))->find($consumableID);
// $consumable->load('consumableAssigments.admin','consumableAssigments.user');
return Datatable::collection($consumable_users)
->addColumn('name',function($consumable_users)
{
return link_to('/admin/users/'.$consumable_users->id.'/view', $consumable_users->fullName());
})
->make();
if (!Company::isCurrentUserHasAccess($consumable)) {
return ['total' => 0, 'rows' => []];
}
$rows = array();
foreach ($consumable->consumableAssigments as $consumable_assignment) {
$rows[] = array(
'name' => link_to('/admin/users/'.$consumable_assignment->user->id.'/view', $consumable_assignment->user->fullName()),
'created_at' => ($consumable_assignment->created_at->format('Y-m-d H:i:s')=='-0001-11-30 00:00:00') ? '' : $consumable_assignment->created_at->format('Y-m-d H:i:s'),
'admin' => ($consumable_assignment->admin) ? $consumable_assignment->admin->fullName() : '',
);
}
$consumableCount = $consumable->users->count();
$data = array('total' => $consumableCount, 'rows' => $rows);
return $data;
}
}
@@ -4,6 +4,7 @@ use AdminController;
use View;
use Asset;
use Actionlog;
use Company;
class DashboardController extends AdminController
{
@@ -16,7 +17,10 @@ class DashboardController extends AdminController
{
// Show the page
$recent_activity = Actionlog::orderBy('created_at','DESC')->with('accessorylog','consumablelog','licenselog','assetlog','adminlog','userlog')->take(7)->get();
$recent_activity = Actionlog::orderBy('created_at','DESC')
->with('accessorylog','consumablelog','licenselog','assetlog','adminlog','userlog')
->take(7)
->get();
$asset_stats['total'] = Asset::Hardware()->count();
@@ -22,9 +22,6 @@ class DepreciationsController extends AdminController
public function getIndex()
{
// Grab all the depreciations
$depreciations = Depreciation::orderBy('created_at', 'DESC')->get();
// Show the page
return View::make('backend/depreciations/index', compact('depreciations'));
}
@@ -123,7 +120,7 @@ class DepreciationsController extends AdminController
if ($validator->fails())
{
// The given data did not pass validation
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
// attempt validation
@@ -137,7 +134,7 @@ class DepreciationsController extends AdminController
// Redirect to the depreciation page
return Redirect::to("admin/settings/depreciations/")->with('success', Lang::get('admin/depreciations/message.update.success'));
}
}
}
// Redirect to the depreciation management page
return Redirect::to("admin/settings/depreciations/$depreciationId/edit")->with('error', Lang::get('admin/depreciations/message.update.error'));
@@ -174,5 +171,55 @@ class DepreciationsController extends AdminController
}
public function getDatatable()
{
$depreciations = Depreciation::select(array('id','name','months'));
if (Input::has('search')) {
$depreciations = $depreciations->TextSearch(e(Input::get('search')));
}
if (Input::has('offset')) {
$offset = e(Input::get('offset'));
} else {
$offset = 0;
}
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
$allowed_columns = ['id','name','months'];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
$depreciations->orderBy($sort, $order);
$depreciationsCount = $depreciations->count();
$depreciations = $depreciations->skip($offset)->take($limit)->get();
$rows = array();
foreach($depreciations as $depreciation) {
$actions = '<a href="'.route('update/depreciations', $depreciation->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/depreciations', $depreciation->id).'" data-content="'.Lang::get('admin/depreciations/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($depreciation->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
$rows[] = array(
'id' => $depreciation->id,
'name' => $depreciation->name,
'months' => $depreciation->months,
'actions' => $actions
);
}
$data = array('total' => $depreciationsCount, 'rows' => $rows);
return $data;
}
}
+89 -14
View File
@@ -22,9 +22,6 @@ class GroupsController extends AdminController
*/
public function getIndex()
{
// Grab all the groups
$groups = Sentry::getGroupProvider()->createModel()->paginate();
// Show the page
return View::make('backend/groups/index', compact('groups'));
}
@@ -163,7 +160,7 @@ class GroupsController extends AdminController
if (!Config::get('app.lock_passwords')) {
try {
try {
// Update the group data
$group->name = Input::get('name');
$group->permissions = Input::get('permissions');
@@ -196,19 +193,97 @@ class GroupsController extends AdminController
*/
public function getDelete($id = null)
{
try {
// Get group information
$group = Sentry::getGroupProvider()->findById($id);
if (!Config::get('app.lock_passwords')) {
try {
// Get group information
$group = Sentry::getGroupProvider()->findById($id);
// Delete the group
$group->delete();
// Delete the group
$group->delete();
// Redirect to the group management page
return Redirect::route('groups')->with('success', Lang::get('admin/groups/message.success.delete'));
} catch (GroupNotFoundException $e) {
// Redirect to the group management page
return Redirect::route('groups')->with('error', Lang::get('admin/groups/message.group_not_found', compact('id')));
// Redirect to the group management page
return Redirect::route('groups')->with('success', Lang::get('admin/groups/message.success.delete'));
} catch (GroupNotFoundException $e) {
// Redirect to the group management page
return Redirect::route('groups')->with('error', Lang::get('admin/groups/message.group_not_found', compact('id')));
}
} else {
return Redirect::route('groups')->with('error', Lang::get('general.feature_disabled'));
}
}
public function getDatatable($status = null)
{
if (Input::has('offset')) {
$offset = e(Input::get('offset'));
} else {
$offset = 0;
}
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
if (Input::get('sort')=='name') {
$sort = 'first_name';
} else {
$sort = e(Input::get('sort'));
}
// Grab all the groups
$groups = Sentry::getGroupProvider()->createModel();
//$users = Company::scopeCompanyables($users);
if (Input::has('search')) {
$groups = $users->TextSearch(Input::get('search'));
}
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$allowed_columns =
[
'name','created_at'
];
$sort = in_array($sort, $allowed_columns) ? $sort : 'name';
$groups = $groups->orderBy($sort, $order);
$groupsCount = $groups->count();
$groups = $groups->skip($offset)->take($limit)->get();
$rows = array();
foreach ($groups as $group)
{
$group_names = '';
$inout = '';
$actions = '<nobr>';
$actions .= '<a href="' . route('update/group', $group->id) . '" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> ';
if (!Config::get('app.lock_passwords')) {
$actions .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="' . route('delete/group', $group->id) . '" data-content="'.Lang::get('admin/groups/message.delete.confirm').'" data-title="Delete ' . htmlspecialchars($group->name) . '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a> ';
} else {
$actions .= ' <span class="btn delete-asset btn-danger btn-sm disabled"><i class="fa fa-trash icon-white"></i></span>';
}
$actions .= '</nobr>';
$rows[] = array(
'id' => $group->id,
'name' => $group->name,
'users' => $group->users->count(),
'created_at' => $group->created_at->format('Y-m-d H:i:s'),
'actions' => ($actions) ? $actions : '',
);
}
$data = array('total'=>$groupsCount, 'rows'=>$rows);
return $data;
}
}
+98 -31
View File
@@ -12,6 +12,7 @@ use DB;
use Redirect;
use LicenseSeat;
use Depreciation;
use Company;
use Setting;
use Sentry;
use Str;
@@ -55,11 +56,14 @@ class LicensesController extends AdminController
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
$supplier_list = array('' => 'Select Supplier') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No');
$company_list = Company::getSelectList();
return View::make('backend/licenses/edit')
->with('license_options',$license_options)
->with('depreciation_list',$depreciation_list)
->with('supplier_list',$supplier_list)
->with('maintained_list',$maintained_list)
->with('company_list', $company_list)
->with('license',new License);
}
@@ -124,6 +128,7 @@ class LicensesController extends AdminController
$license->purchase_date = e(Input::get('purchase_date'));
$license->purchase_order = e(Input::get('purchase_order'));
$license->depreciation_id = e(Input::get('depreciation_id'));
$license->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
$license->expiration_date = e(Input::get('expiration_date'));
$license->user_id = Sentry::getId();
@@ -181,6 +186,9 @@ class LicensesController extends AdminController
// Redirect to the blogs management page
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.does_not_exist'));
}
else if (!Company::isCurrentUserHasAccess($license)) {
return Redirect::to('admin/licenses')->with('error', Lang::get('general.insufficient_permissions'));
}
if ($license->purchase_date == "0000-00-00") {
$license->purchase_date = NULL;
@@ -195,10 +203,13 @@ class LicensesController extends AdminController
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
$supplier_list = array('' => 'Select Supplier') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No');
$company_list = Company::getSelectList();
return View::make('backend/licenses/edit', compact('license'))
->with('license_options',$license_options)
->with('depreciation_list',$depreciation_list)
->with('supplier_list',$supplier_list)
->with('company_list', $company_list)
->with('maintained_list',$maintained_list);
}
@@ -216,6 +227,9 @@ class LicensesController extends AdminController
// Redirect to the blogs management page
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.does_not_exist'));
}
else if (!Company::isCurrentUserHasAccess($license)) {
return Redirect::to('admin/licenses')->with('error', Lang::get('general.insufficient_permissions'));
}
// get the POST data
@@ -234,6 +248,7 @@ class LicensesController extends AdminController
$license->notes = e(Input::get('notes'));
$license->order_number = e(Input::get('order_number'));
$license->depreciation_id = e(Input::get('depreciation_id'));
$license->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
$license->purchase_order = e(Input::get('purchase_order'));
$license->maintained = e(Input::get('maintained'));
$license->reassignable = e(Input::get('reassignable'));
@@ -374,6 +389,9 @@ class LicensesController extends AdminController
// Redirect to the license management page
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
else if (!Company::isCurrentUserHasAccess($license)) {
return Redirect::to('admin/licenses')->with('error', Lang::get('general.insufficient_permissions'));
}
if (($license->assignedcount()) && ($license->assignedcount() > 0)) {
@@ -412,6 +430,9 @@ class LicensesController extends AdminController
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
else if (!Company::isCurrentUserHasAccess($licenseseat->license)) {
return Redirect::to('admin/licenses')->with('error', Lang::get('general.insufficient_permissions'));
}
// 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');
@@ -453,11 +474,15 @@ class LicensesController extends AdminController
public function postCheckout($seatId)
{
$licenseseat = LicenseSeat::find($seatId);
$assigned_to = e(Input::get('assigned_to'));
$asset_id = e(Input::get('asset_id'));
$user = Sentry::getUser();
if (!Company::isCurrentUserHasAccess($licenseseat->license)) {
return Redirect::to('admin/licenses')->with('error', Lang::get('general.insufficient_permissions'));
}
// Declare the rules for the form validation
$rules = array(
@@ -499,7 +524,7 @@ class LicensesController extends AdminController
// Check if the asset exists
if (is_null($licenseseat = LicenseSeat::find($seatId))) {
if (is_null($licenseseat)) {
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
@@ -602,6 +627,9 @@ class LicensesController extends AdminController
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
else if (!Company::isCurrentUserHasAccess($licenseseat->license)) {
return Redirect::to('admin/licenses')->with('error', Lang::get('general.insufficient_permissions'));
}
return View::make('backend/licenses/checkin', compact('licenseseat'))->with('backto',$backto);
}
@@ -621,6 +649,10 @@ class LicensesController extends AdminController
$license = License::find($licenseseat->license_id);
if (!Company::isCurrentUserHasAccess($license)) {
return Redirect::to('admin/licenses')->with('error', Lang::get('general.insufficient_permissions'));
}
if(!$license->reassignable) {
// Not allowed to checkin
Session::flash('error', 'License not reassignable.');
@@ -722,6 +754,10 @@ class LicensesController extends AdminController
$license = License::find($licenseId);
if (isset($license->id)) {
if (!Company::isCurrentUserHasAccess($license)) {
return Redirect::to('admin/licenses')->with('error', Lang::get('general.insufficient_permissions'));
}
return View::make('backend/licenses/view', compact('license'));
} else {
// Prepare the error message
@@ -739,10 +775,14 @@ class LicensesController extends AdminController
// Redirect to the blogs management page
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.does_not_exist'));
}
else if (!Company::isCurrentUserHasAccess($license_to_clone)) {
return Redirect::to('admin/licenses')->with('error', Lang::get('general.insufficient_permissions'));
}
// Show the page
$license_options = array('0' => 'Top Level') + License::lists('name', 'id');
$maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No');
$maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No');
$company_list = Company::getSelectList();
//clone the orig
$license = clone $license_to_clone;
$license->id = null;
@@ -751,7 +791,13 @@ class LicensesController extends AdminController
// Show the page
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
$supplier_list = array('' => 'Select Supplier') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
return View::make('backend/licenses/edit')->with('license_options',$license_options)->with('depreciation_list',$depreciation_list)->with('supplier_list',$supplier_list)->with('license',$license)->with('maintained_list',$maintained_list);
return View::make('backend/licenses/edit')
->with('license_options',$license_options)
->with('depreciation_list',$depreciation_list)
->with('supplier_list',$supplier_list)
->with('license',$license)
->with('maintained_list',$maintained_list)
->with('company_list',$company_list);
}
@@ -771,6 +817,11 @@ class LicensesController extends AdminController
if (isset($license->id)) {
if (!Company::isCurrentUserHasAccess($license)) {
return Redirect::to('admin/licenses')->with('error', Lang::get('general.insufficient_permissions'));
}
if (Input::hasFile('licensefile')) {
foreach(Input::file('licensefile') as $file) {
@@ -842,6 +893,11 @@ class LicensesController extends AdminController
// the license is valid
if (isset($license->id)) {
if (!Company::isCurrentUserHasAccess($license)) {
return Redirect::to('admin/licenses')->with('error', Lang::get('general.insufficient_permissions'));
}
$log = Actionlog::find($fileId);
$full_filename = $destinationPath.'/'.$log->filename;
if (file_exists($full_filename)) {
@@ -874,6 +930,11 @@ class LicensesController extends AdminController
// the license is valid
if (isset($license->id)) {
if (!Company::isCurrentUserHasAccess($license)) {
return Redirect::to('admin/licenses')->with('error', Lang::get('general.insufficient_permissions'));
}
$log = Actionlog::find($fileId);
$file = $log->get_src();
return Response::download($file);
@@ -887,35 +948,41 @@ class LicensesController extends AdminController
}
public function getDatatable() {
$licenses = License::orderBy('created_at', 'DESC')->get();
$licenses = License::select('id','name','serial','purchase_date','seats', 'company_id')->with('company');
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function($licenses) {
return '<span style="white-space: nowrap;"><a href="'.route('freecheckout/license', $licenses->id).'" class="btn btn-primary btn-sm" style="margin-right:5px;" '.(($licenses->remaincount() > 0) ? '' : 'disabled').'>'.Lang::get('general.checkout').'</a> <a href="'.route('clone/license', $licenses->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', $licenses->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/license', $licenses->id).'" data-content="'.Lang::get('admin/licenses/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($licenses->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></span>';
});
if (Input::has('search')) {
$licenses = $licenses->TextSearch(Input::get('search'));
}
return Datatable::collection($licenses)
->addColumn('name', function($licenses) {
return link_to('/admin/licenses/'.$licenses->id.'/view', $licenses->name);
})
->addColumn('serial', function($licenses) {
return link_to('/admin/licenses/'.$licenses->id.'/view', mb_strimwidth($licenses->serial, 0, 50, "..."));
})
->addColumn('totalSeats', function($licenses) {
return $licenses->totalSeatsByLicenseID();
})
->addColumn('remaining', function($licenses) {
return $licenses->remaincount();
})
->addColumn('purchase_date', function($licenses) {
return $licenses->purchase_date;
})
->addColumn('notes', function($licenses) {
return $licenses->notes;
})
->addColumn($actions)
->searchColumns('name','serial','totalSeats','remaining','purchase_date','actions','notes')
->orderColumns('name','serial','totalSeats','remaining','purchase_date','actions','notes')
->make();
$allowed_columns = ['id','name'];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
$licenses = $licenses->orderBy($sort, $order);
$licenseCount = $licenses->count();
$licenses = $licenses->skip(Input::get('offset'))->take(Input::get('limit'))->get();
$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').'>'.Lang::get('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="'.Lang::get('admin/licenses/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($license->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></span>';
$rows[] = array(
'id' => $license->id,
'name' => link_to('/admin/licenses/'.$license->id.'/view', $license->name),
'serial' => link_to('/admin/licenses/'.$license->id.'/view', mb_strimwidth($license->serial, 0, 50, "...")),
'totalSeats' => $license->totalSeatsByLicenseID(),
'remaining' => $license->remaincount(),
'purchase_date' => ($license->purchase_date) ? $license->purchase_date : '',
'actions' => $actions,
'companyName' => is_null($license->company) ? '' : e($license->company->name)
);
}
$data = array('total' => $licenseCount, 'rows' => $rows);
return $data;
}
public function getFreeLicense($licenseId) {
@@ -255,5 +255,159 @@ class LocationsController extends AdminController
}
/**
* Get the location page detail page
*
* @param int $locationID
* @return View
**/
public function getView($locationId = null)
{
$location = Location::find($locationId);
if (isset($location->id)) {
return View::make('backend/locations/view', compact('location'));
} else {
// Prepare the error message
$error = Lang::get('admin/locations/message.does_not_exist', compact('id'));
// Redirect to the user management page
return Redirect::route('locations')->with('error', $error);
}
}
/**
* Get the locations API information to present to the location view page
*
* @param int $locationID
* @return JSON
**/
public function getDatatable()
{
$locations = Location::select(array('locations.id','locations.name','locations.address','locations.address2','locations.city','locations.state','locations.zip','locations.country','locations.parent_id','locations.currency'))->with('assets');
if (Input::has('search')) {
$locations = $locations->TextSearch(e(Input::get('search')));
}
if (Input::has('offset')) {
$offset = e(Input::get('offset'));
} else {
$offset = 0;
}
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
switch (Input::get('sort'))
{
case 'parent':
$locations = $locations->OrderParent($order);
break;
default:
$allowed_columns = ['id','name','address','city','state','country','currency'];
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
$locations = $locations->orderBy($sort, $order);
break;
}
$locationsCount = $locations->count();
$locations = $locations->skip($offset)->take($limit)->get();
$rows = array();
foreach($locations as $location) {
$actions = '<nobr><a href="'.route('update/location', $location->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/location', $location->id).'" data-content="'.Lang::get('admin/locations/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($location->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></nobr>';
$rows[] = array(
'id' => $location->id,
'name' => link_to('admin/settings/locations/'.$location->id.'/view', $location->name),
'parent' => ($location->parent) ? $location->parent->name : '',
// 'assets' => ($location->assets->count() + $location->assignedassets->count()),
'assets_default' => $location->assignedassets->count(),
'assets_checkedout' => $location->assets->count(),
'address' => ($location->address) ? $location->address: '',
'city' => $location->city,
'state' => $location->state,
'country' => $location->country,
'currency' => $location->currency,
'actions' => $actions
);
}
$data = array('total' => $locationsCount, 'rows' => $rows);
return $data;
}
/**
* Get the location user listing information to present to the location details page
*
* @param int $locationID
* @return JSON
**/
public function getDataViewUsers($locationID)
{
$location = Location::find($locationID);
$location_users = $location->users;
$count = $location_users->count();
$rows = array();
foreach ($location_users as $user) {
$rows[] = array(
'name' => link_to('/admin/users/'.$user->id.'/view', $user->fullName())
);
}
$data = array('total' => $count, 'rows' => $rows);
return $data;
}
/**
* Get the location asset information to present to the location details page
*
* @param int $locationID
* @return JSON
**/
public function getDataViewAssets($locationID)
{
$location = Location::find($locationID);
$count = $location->assets->count();
$rows = array();
foreach ($location->assets as $asset) {
$rows[] = array(
'name' => link_to('/hardware/'.$asset->id.'/view', $asset->showAssetName()),
'asset_tag' => $asset->asset_tag,
'serial' => $asset->serial,
'model' => $asset->model->name,
);
}
$data = array('total' => $count, 'rows' => $rows);
return $data;
}
}
@@ -1,6 +1,7 @@
<?php namespace Controllers\Admin;
use AdminController;
use Company;
use Input;
use Lang;
use Manufacturer;
@@ -20,9 +21,6 @@ class ManufacturersController extends AdminController
*/
public function getIndex()
{
// Grab all the manufacturers
$manufacturers = Manufacturer::orderBy('created_at', 'DESC')->get();
// Show the page
return View::make('backend/manufacturers/index', compact('manufacturers'));
}
@@ -192,7 +190,124 @@ class ManufacturersController extends AdminController
}
public function getDatatable()
{
$manufacturers = Manufacturer::select(array('id','name'))->with('assets')
->whereNull('deleted_at');
if (Input::has('search')) {
$manufacturers = $manufacturers->TextSearch(e(Input::get('search')));
}
if (Input::has('offset')) {
$offset = e(Input::get('offset'));
} else {
$offset = 0;
}
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
$allowed_columns = ['id','name'];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
$manufacturers->orderBy($sort, $order);
$manufacturersCount = $manufacturers->count();
$manufacturers = $manufacturers->skip($offset)->take($limit)->get();
$rows = array();
foreach($manufacturers as $manufacturer) {
$actions = '<a href="'.route('update/manufacturer', $manufacturer->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/location', $manufacturer->id).'" data-content="'.Lang::get('admin/manufacturers/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($manufacturer->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
$rows[] = array(
'id' => $manufacturer->id,
'name' => link_to('admin/settings/manufacturers/'.$manufacturer->id.'/view', $manufacturer->name),
'assets' => $manufacturer->assetscount(),
'actions' => $actions
);
}
$data = array('total' => $manufacturersCount, 'rows' => $rows);
return $data;
}
public function getDataView($manufacturerID) {
$manufacturer = Manufacturer::with('assets.company')->find($manufacturerID);
$manufacturer_assets = $manufacturer->assets;
if (Input::has('search')) {
$manufacturer_assets = $manufacturer_assets->TextSearch(e(Input::get('search')));
}
if (Input::has('offset')) {
$offset = e(Input::get('offset'));
} else {
$offset = 0;
}
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$allowed_columns = ['id','name','serial','asset_tag'];
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
$count = $manufacturer_assets->count();
$rows = array();
foreach ($manufacturer_assets as $asset) {
$actions = '';
if ($asset->deleted_at=='') {
$actions = '<div style=" white-space: nowrap;"><a href="'.route('clone/hardware', $asset->id).'" class="btn btn-info btn-sm" title="Clone asset"><i class="fa fa-files-o"></i></a> <a href="'.route('update/hardware', $asset->id).'" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> <a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/hardware', $asset->id).'" data-content="'.Lang::get('admin/hardware/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($asset->asset_tag).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';
} elseif ($asset->deleted_at!='') {
$actions = '<a href="'.route('restore/hardware', $asset->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
}
if ($asset->assetstatus) {
if ($asset->assetstatus->deployable != 0) {
if (($asset->assigned_to !='') && ($asset->assigned_to > 0)) {
$inout = '<a href="'.route('checkin/hardware', $asset->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
} else {
$inout = '<a href="'.route('checkout/hardware', $asset->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
}
}
}
$row = array(
'id' => $asset->id,
'name' => link_to('/hardware/'.$asset->id.'/view', $asset->showAssetName()),
'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()): '',
'actions' => $actions,
'companyName' => Company::getName($asset),
);
if (isset($inout)) { $row['change'] = $inout; }
$rows[] = $row;
}
$data = array('total' => $count, 'rows' => $rows);
return $data;
}
}
+131 -61
View File
@@ -15,6 +15,9 @@ use Str;
use Validator;
use View;
use Datatable;
use Asset;
use Company;
use Config;
//use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
@@ -317,7 +320,7 @@ class ModelsController extends AdminController
/**
* Get the asset information to present to the model view page
* Get the model information to present to the model view page
*
* @param int $assetId
* @return View
@@ -339,7 +342,14 @@ class ModelsController extends AdminController
}
public function getClone($modelId = null)
/**
* Get the clone page to clone a model
*
* @param int $modelId
* @return View
**/
public function getClone($modelId = null)
{
// Check if the model exists
if (is_null($model_to_clone = Model::find($modelId))) {
@@ -364,79 +374,139 @@ class ModelsController extends AdminController
}
/**
* Get the JSON response for the bootstrap table list view
*
* @param string $status
* @return JSON
**/
public function getDatatable($status = null)
{
$models = Model::orderBy('created_at', 'DESC')->with('category','assets','depreciation');
($status != 'Deleted') ?: $models->withTrashed()->Deleted();;
$models = $models->get();
$models = Model::with('category','assets','depreciation');
($status != 'Deleted') ?: $models->withTrashed()->Deleted();
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function($models) {
if($models->deleted_at=='') {
return '<a href="'.route('update/model', $models->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/model', $models->id).'" data-content="'.Lang::get('admin/models/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($models->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
if (Input::has('search')) {
$models = $models->TextSearch(Input::get('search'));
}
if (Input::has('offset')) {
$offset = e(Input::get('offset'));
} else {
$offset = 0;
}
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
$allowed_columns = ['id','name','modelno'];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
$models = $models->orderBy($sort, $order);
$modelCount = $models->count();
$models = $models->skip($offset)->take($limit)->get();
$rows = array();
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="'.Lang::get('admin/models/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($model->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';
} else {
return '<a href="'.route('restore/model', $models->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
$actions = '<a href="'.route('restore/model', $model->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
}
});
return Datatable::collection($models)
->addColumn('manufacturer', function($models) {
return $models->manufacturer->name;
})
->addColumn('name', function ($models) {
return link_to('/hardware/models/'.$models->id.'/view', $models->name);
})
->showColumns('modelno')
->addColumn('asset_count', function($models) {
return $models->assets->count();
})
->addColumn('depreciation', function($models) {
return (($models->depreciation)&&($models->depreciation->id > 0)) ? $models->depreciation->name.' ('.$models->depreciation->months.')' : Lang::get('general.no_depreciation');
})
->addColumn('category', function($models) {
return ($models->category) ? $models->category->name : '';
})
->addColumn('eol', function($models) {
return ($models->eol) ? $models->eol.' '.Lang::get('general.months') : '';
})
->addColumn($actions)
->searchColumns('name','modelno','asset_count','depreciation','category','eol','actions')
->orderColumns('name','modelno','asset_count','depreciation','category','eol','actions')
->make();
$rows[] = array(
'id' => $model->id,
'manufacturer' => link_to('/admin/settings/manufacturers/'.$model->manufacturer->id.'/view', $model->manufacturer->name),
'name' => link_to('/hardware/models/'.$model->id.'/view', $model->name),
'image' => ($model->image!='') ? '<img src="'.Config::get('app.url').'/uploads/models/'.$model->image.'" height=50 width=50>' : '',
'modelnumber' => $model->modelno,
'numassets' => $model->assets->count(),
'depreciation' => (($model->depreciation)&&($model->depreciation->id > 0)) ? $model->depreciation->name.' ('.$model->depreciation->months.')' : Lang::get('general.no_depreciation'),
'category' => ($model->category) ? $model->category->name : '',
'eol' => ($model->eol) ? $model->eol.' '.Lang::get('general.months') : '',
'actions' => $actions
);
}
$data = array('total' => $modelCount, 'rows' => $rows);
return $data;
}
/**
* Get the asset information to present to the model view page
*
* @param int $modelID
* @return View
**/
public function getDataView($modelID)
{
$model = Model::withTrashed()->find($modelID);
$modelassets = $model->assets;
$assets = Asset::where('model_id','=',$modelID)->withTrashed()->with('company');
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($modelassets)
{
if (($modelassets->assigned_to !='') && ($modelassets->assigned_to > 0)) {
return '<a href="'.route('checkin/hardware', $modelassets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
} else {
return '<a href="'.route('checkout/hardware', $modelassets->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
if (Input::has('search')) {
$assets = $assets->TextSearch(Input::get('search'));
}
if (Input::has('offset')) {
$offset = e(Input::get('offset'));
} else {
$offset = 0;
}
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
$allowed_columns = ['name', 'serial','asset_tag'];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
$assets = $assets->orderBy($sort, $order);
$assetsCount = $assets->count();
$assets = $assets->skip($offset)->take($limit)->get();
$rows = array();
$actions = '';
foreach ($assets as $asset) {
if ($asset->assetstatus) {
if ($asset->assetstatus->deployable != 0) {
if (($asset->assigned_to !='') && ($asset->assigned_to > 0)) {
$actions = '<a href="'.route('checkin/hardware', $asset->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
} else {
$actions = '<a href="'.route('checkout/hardware', $asset->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
}
}
});
return Datatable::collection($modelassets)
->addColumn('name', function ($modelassets) {
return link_to('/hardware/'.$modelassets->id.'/view', $modelassets->showAssetName());
// return $modelassets->name;
})
->addColumn('asset_tag', function ($modelassets) {
return link_to('/hardware/'.$modelassets->id.'/view', $modelassets->asset_tag);
})
->showColumns('serial')
->addColumn('assigned_to', function ($modelassets) {
if ($modelassets->assigned_to) {
return link_to('/admin/users/'.$modelassets->assigned_to.'/view', $modelassets->assigneduser->fullName());
}
})
->addColumn($actions)
->searchColumns('name','asset_tag','serial','assigned_to','actions')
->orderColumns('name','asset_tag','serial','assigned_to','actions')
->make();
$rows[] = array(
'id' => $asset->id,
'name' => link_to('/hardware/'.$asset->id.'/view', $asset->showAssetName()),
'asset_tag' => link_to('hardware/'.$asset->id.'/view', $asset->asset_tag),
'serial' => $asset->serial,
'assigned_to' => ($asset->assigned_to) ? link_to('/admin/users/'.$asset->assigned_to.'/view', $asset->assigneduser->fullName()) : '',
'actions' => $actions,
'companyName' => Company::getName($asset)
);
}
$data = array('total' => $assetsCount, 'rows' => $rows);
return $data;
}
}
+22 -32
View File
@@ -7,6 +7,7 @@ use Asset;
use AssetMaintenance;
use Carbon\Carbon;
use Category;
use Company;
use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Response;
@@ -30,7 +31,8 @@ class ReportsController extends AdminController
*/
public function getAccessoryReport()
{
$accessories = Accessory::orderBy('created_at', 'DESC')->get();
$accessories = Accessory::orderBy('created_at', 'DESC')->with('company')->get();
return View::make('backend/reports/accessories', compact('accessories'));
}
@@ -42,6 +44,7 @@ class ReportsController extends AdminController
public function exportAccessoryReport()
{
$accessories = Accessory::orderBy('created_at', 'DESC')->get();
$rows = array();
$header = array(
Lang::get('admin/accessories/table.title'),
@@ -78,10 +81,9 @@ class ReportsController extends AdminController
*/
public function getAssetsReport()
{
// Grab all the assets
$assets = Asset::with( 'model', 'assigneduser.userLoc', 'assetstatus', 'defaultLoc', 'assetlog', 'supplier',
'model.manufacturer' )
'model.manufacturer', 'company' )
->orderBy( 'created_at', 'DESC' )
->get();
@@ -95,10 +97,8 @@ class ReportsController extends AdminController
*/
public function exportAssetReport()
{
// Grab all the assets
$assets = Asset::orderBy( 'created_at', 'DESC' )
->get();
$assets = Asset::orderBy( 'created_at', 'DESC' )->get();
$rows = [ ];
@@ -205,9 +205,8 @@ class ReportsController extends AdminController
{
// Grab all the assets
$assets = Asset::with( 'model', 'assigneduser', 'assetstatus', 'defaultLoc', 'assetlog' )
->orderBy( 'created_at', 'DESC' )
->get();
$assets = Asset::with( 'model', 'assigneduser', 'assetstatus', 'defaultLoc', 'assetlog', 'company' )
->orderBy( 'created_at', 'DESC' )->get();
return View::make( 'backend/reports/depreciation', compact( 'assets' ) );
}
@@ -222,8 +221,7 @@ class ReportsController extends AdminController
// Grab all the assets
$assets = Asset::with( 'model', 'assigneduser', 'assetstatus', 'defaultLoc', 'assetlog' )
->orderBy( 'created_at', 'DESC' )
->get();
->orderBy( 'created_at', 'DESC' )->get();
$csv = \League\Csv\Writer::createFromFileObject( new \SplTempFileObject() );
$csv->setOutputBOM( Reader::BOM_UTF16_BE );
@@ -296,10 +294,8 @@ class ReportsController extends AdminController
*
* @return View
*/
public function getActivityReport()
{
$log_actions = Actionlog::orderBy( 'created_at', 'DESC' )
->with( 'adminlog' )
->with( 'accessorylog' )
@@ -321,6 +317,7 @@ class ReportsController extends AdminController
{
$licenses = License::orderBy( 'created_at', 'DESC' )
->with( 'company' )
->get();
return View::make( 'backend/reports/licenses', compact( 'licenses' ) );
@@ -333,9 +330,8 @@ class ReportsController extends AdminController
*/
public function exportLicenseReport()
{
$licenses = License::orderBy( 'created_at', 'DESC' )->get();
$licenses = License::orderBy( 'created_at', 'DESC' )
->get();
$rows = [ ];
$header = [
Lang::get( 'admin/licenses/table.title' ),
@@ -380,9 +376,8 @@ class ReportsController extends AdminController
public function postCustom()
{
$assets = Asset::orderBy( 'created_at', 'DESC' )->get();
$assets = Asset::orderBy( 'created_at', 'DESC' )
->get();
$rows = [ ];
$header = [ ];
@@ -405,7 +400,7 @@ class ReportsController extends AdminController
if (e( Input::get( 'purchase_date' ) ) == '1') {
$header[] = 'Purchase Date';
}
if (( e( Input::get( 'purchase_cost' ) ) == '1' ) && ( e( Input::get( 'depreciation' ) ) == '0' )) {
if (( e( Input::get( 'purchase_cost' ) ) == '1' ) && ( e( Input::get( 'depreciation' ) ) != '1' )) {
$header[] = 'Purchase Cost';
}
if (e( Input::get( 'order' ) ) == '1') {
@@ -461,7 +456,7 @@ class ReportsController extends AdminController
if (e( Input::get( 'purchase_date' ) ) == '1') {
$row[] = $asset->purchase_date;
}
if (e( Input::get( 'purchase_cost' ) ) == '1') {
if (e( Input::get( 'purchase_cost' ) ) == '1' && ( e( Input::get( 'depreciation' ) ) != '1' )) {
$row[] = '"' . number_format( $asset->purchase_cost ) . '"';
}
if (e( Input::get( 'order' ) ) == '1') {
@@ -557,9 +552,8 @@ class ReportsController extends AdminController
*/
public function getAssetMaintenancesReport()
{
// Grab all the improvements
$assetMaintenances = \AssetMaintenance::with( 'asset', 'supplier' )
$assetMaintenances = \AssetMaintenance::with( 'asset', 'supplier', 'asset.company' )
->orderBy( 'created_at', 'DESC' )
->get();
@@ -576,7 +570,6 @@ class ReportsController extends AdminController
*/
public function exportAssetMaintenancesReport()
{
// Grab all the improvements
$assetMaintenances = AssetMaintenance::with( 'asset', 'supplier' )
->orderBy( 'created_at', 'DESC' )
@@ -635,12 +628,9 @@ class ReportsController extends AdminController
*/
public function getAssetAcceptanceReport()
{
$assetsForReport = Asset::notYetAccepted()
->get();
$assetsForReport = Asset::notYetAccepted()->with( 'company' )->get();
return View::make( 'backend/reports/unaccepted_assets', compact( 'assetsForReport' ) );
}
/**
@@ -701,12 +691,13 @@ class ReportsController extends AdminController
*/
protected function getCheckedOutAssetsRequiringAcceptance( $modelsInCategoriesThatRequireAcceptance )
{
$assets = Asset::deployed()
->inModelList( $modelsInCategoriesThatRequireAcceptance )
->select( 'id' )
->get()
->toArray();
return array_pluck( Asset::deployed()
->inModelList( $modelsInCategoriesThatRequireAcceptance )
->select( 'id' )
->get()
->toArray(), 'id' );
return array_pluck( $assets, 'id' );
}
/**
@@ -767,7 +758,6 @@ class ReportsController extends AdminController
*/
protected function getAssetsNotAcceptedYet()
{
return Asset::unaccepted();
}
}
+105 -16
View File
@@ -13,6 +13,9 @@ use View;
use Image;
use Config;
use Response;
use Artisan;
use Crypt;
class SettingsController extends AdminController
{
@@ -40,9 +43,20 @@ class SettingsController extends AdminController
*/
public function getEdit()
{
$settings = Setting::orderBy('created_at', 'DESC')->paginate(10);
$setting = Setting::first();
$is_gd_installed = extension_loaded('gd');
return View::make('backend/settings/edit', compact('settings', 'is_gd_installed'));
// echo '<pre>';
// print_r($settings);
// echo '</pre>';
// exit;
if ($setting->ldap_pword!='') {
$show_ldap_pword = Crypt::decrypt($setting->ldap_pword);
} else {
$show_ldap_pword = '';
}
return View::make('backend/settings/edit', compact('setting'))->with('is_gd_installed',$is_gd_installed)->with('show_ldap_pword',$show_ldap_pword);
}
@@ -67,7 +81,8 @@ class SettingsController extends AdminController
// Declare the rules for the form validation
$rules = array(
"per_page" => 'required|min:1|numeric',
"brand" => 'required|min:1|numeric',
"per_page" => 'required|min:1|numeric',
"qr_text" => 'min:1|max:31',
"logo" => 'mimes:jpeg,bmp,png,gif',
"custom_css" => 'alpha_space',
@@ -76,12 +91,20 @@ class SettingsController extends AdminController
"default_currency" => 'required',
"slack_channel" => 'regex:/(?<!\w)#\w+/',
"slack_botname" => 'alpha_dash',
"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',
);
if (Config::get('app.lock_passwords')==false) {
$rules['site_name'] = 'required|min:3';
}
}
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
@@ -114,6 +137,7 @@ class SettingsController extends AdminController
if (Config::get('app.lock_passwords')==false) {
$setting->site_name = e(Input::get('site_name'));
$setting->brand = e(Input::get('brand'));
$setting->custom_css = e(Input::get('custom_css'));
}
@@ -132,6 +156,24 @@ class SettingsController extends AdminController
$setting->slack_endpoint = e(Input::get('slack_endpoint'));
$setting->slack_channel = e(Input::get('slack_channel'));
$setting->slack_botname = e(Input::get('slack_botname'));
$setting->ldap_enabled = Input::get('ldap_enabled', '0');
$setting->ldap_server = Input::get('ldap_server');
$setting->ldap_uname = Input::get('ldap_uname');
$setting->ldap_pword = Crypt::encrypt(Input::get('ldap_pword'));
$setting->ldap_basedn = Input::get('ldap_basedn');
$setting->ldap_filter = Input::get('ldap_filter');
$setting->ldap_username_field = Input::get('ldap_username_field');
$setting->ldap_lname_field = Input::get('ldap_lname_field');
$setting->ldap_fname_field = Input::get('ldap_fname_field');
$setting->ldap_auth_filter_query = Input::get('ldap_auth_filter_query');
$setting->ldap_version = Input::get('ldap_version');
$setting->ldap_active_flag = Input::get('ldap_active_flag');
$setting->ldap_emp_num = Input::get('ldap_emp_num');
$setting->ldap_email = Input::get('ldap_email');
if (Sentry::getUser()->isSuperUser()) {
$setting->full_multiple_companies_support = e(Input::get('full_multiple_companies_support', '0'));
}
// Was the asset updated?
@@ -172,12 +214,34 @@ class SettingsController extends AdminController
}
closedir($handle);
$files = array_reverse($files);
}
return View::make('backend/settings/backups', compact('path','files'));
}
/**
* Generate the backup page
*
* @return View
**/
public function postBackups()
{
if (!Config::get('app.lock_passwords')) {
Artisan::call('snipe:backup');
return Redirect::to("admin/settings/backups")->with('success', Lang::get('admin/settings/message.backup.generated'));
} else {
Artisan::call('snipe:backup');
return Redirect::to("admin/settings/backups")->with('error', Lang::get('general.feature_disabled'));
}
}
/**
* Download the dump file
*
@@ -186,20 +250,45 @@ class SettingsController extends AdminController
**/
public function downloadFile($filename = null)
{
if (!Config::get('app.lock_passwords')) {
$file = Config::get('backup::path').'/'.$filename;
if (file_exists($file)) {
return Response::download($file);
} else {
$file = Config::get('backup::path').'/'.$filename;
// the license is valid
if (file_exists($file)) {
return Response::download($file);
// Redirect to the backup page
return Redirect::route('settings/backups')->with('error', Lang::get('admin/settings/message.backup.file_not_found'));
}
} else {
// Prepare the error message
$error = Lang::get('admin/settings/message.does_not_exist');
// Redirect to the licence management page
return Redirect::route('settings/backups')->with('error', $error);
// Redirect to the backup page
return Redirect::route('settings/backups')->with('error', Lang::get('general.feature_disabled'));
}
}
/**
* Download the dump file
*
* @param int $assetId
* @return View
**/
public function deleteFile($filename = null)
{
if (!Config::get('app.lock_passwords')) {
$file = Config::get('backup::path').'/'.$filename;
if (file_exists($file)) {
unlink($file);
return Redirect::route('settings/backups')->with('success', Lang::get('admin/settings/message.backup.file_deleted'));
} else {
return Redirect::route('settings/backups')->with('error', Lang::get('admin/settings/message.backup.file_not_found'));
}
} else {
return Redirect::route('settings/backups')->with('error', Lang::get('general.feature_disabled'));
}
}
@@ -24,9 +24,6 @@ class StatuslabelsController extends AdminController
public function getIndex()
{
// Grab all the statuslabels
$statuslabels = Statuslabel::orderBy('created_at', 'DESC')->get();
// Show the page
return View::make('backend/statuslabels/index', compact('statuslabels'));
}
@@ -230,5 +227,67 @@ class StatuslabelsController extends AdminController
}
public function getDatatable()
{
$statuslabels = Statuslabel::select(array('id','name','deployable','pending','archived'))
->whereNull('deleted_at');
if (Input::has('search')) {
$statuslabels = $statuslabels->TextSearch(e(Input::get('search')));
}
if (Input::has('offset')) {
$offset = e(Input::get('offset'));
} else {
$offset = 0;
}
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
$allowed_columns = ['id','name'];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
$statuslabels->orderBy($sort, $order);
$statuslabelsCount = $statuslabels->count();
$statuslabels = $statuslabels->skip($offset)->take($limit)->get();
$rows = array();
foreach($statuslabels as $statuslabel) {
if ($statuslabel->deployable == 1) {
$label_type = Lang::get('admin/statuslabels/table.deployable');
} elseif ($statuslabel->pending == 1) {
$label_type = Lang::get('admin/statuslabels/table.pending');
} elseif ($statuslabel->archived == 1) {
$label_type = Lang::get('admin/statuslabels/table.archived');
} else {
$label_type = Lang::get('admin/statuslabels/table.undeployable');
}
$actions = '<a href="'.route('update/statuslabel', $statuslabel->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/statuslabel', $statuslabel->id).'" data-content="'.Lang::get('admin/statuslabels/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($statuslabel->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
$rows[] = array(
'id' => $statuslabel->id,
'type' => $label_type,
'name' => e($statuslabel->name),
'actions' => $actions
);
}
$data = array('total' => $statuslabelsCount, 'rows' => $rows);
return $data;
}
}
+59 -4
View File
@@ -103,7 +103,7 @@ class SuppliersController extends AdminController
return Redirect::to('admin/settings/suppliers/create')->with('error', Lang::get('admin/suppliers/message.create.error'));
}
public function store()
{
$supplier=new Supplier;
@@ -115,7 +115,7 @@ class SuppliersController extends AdminController
//$supplier->fill($new);
$supplier->name=$new['name'];
$supplier->user_id = Sentry::getId();
if($supplier->save()) {
return JsonResponse::create($supplier);
} else {
@@ -163,7 +163,7 @@ class SuppliersController extends AdminController
if ($validator->fails())
{
// The given data did not pass validation
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
// attempt validation
@@ -204,7 +204,7 @@ class SuppliersController extends AdminController
// Redirect to the new supplier page
return Redirect::to("admin/settings/suppliers")->with('success', Lang::get('admin/suppliers/message.update.success'));
}
}
}
// Redirect to the supplier management page
return Redirect::to("admin/settings/suppliers/$supplierId/edit")->with('error', Lang::get('admin/suppliers/message.update.error'));
@@ -264,6 +264,61 @@ class SuppliersController extends AdminController
}
public function getDatatable()
{
$suppliers = Supplier::select(array('id','name','address','address2','city','state','country','fax', 'phone','email','contact'))
->whereNull('deleted_at');
if (Input::has('search')) {
$suppliers = $suppliers->TextSearch(e(Input::get('search')));
}
if (Input::has('offset')) {
$offset = e(Input::get('offset'));
} else {
$offset = 0;
}
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
$allowed_columns = ['id','name','address','phone','contact','fax','email'];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
$suppliers->orderBy($sort, $order);
$suppliersCount = $suppliers->count();
$suppliers = $suppliers->skip($offset)->take($limit)->get();
$rows = array();
foreach($suppliers as $supplier) {
$actions = '<a href="'.route('update/supplier', $supplier->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/location', $supplier->id).'" data-content="'.Lang::get('admin/suppliers/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($supplier->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
$rows[] = array(
'id' => $supplier->id,
'name' => link_to('admin/settings/suppliers/'.$supplier->id.'/view', $supplier->name),
'contact' => $supplier->contact,
'address' => $supplier->address.' '.$supplier->address2.' '.$supplier->city.' '.$supplier->state.' '.$supplier->country,
'phone' => $supplier->phone,
'fax' => $supplier->fax,
'email' => ($supplier->email!='') ? '<a href="mailto:'.$supplier->email.'">'.$supplier->email.'</a>' : '',
'assets' => $supplier->num_assets(),
'licenses' => $supplier->num_licenses(),
'actions' => $actions
);
}
$data = array('total' => $suppliersCount, 'rows' => $rows);
return $data;
}
}
+209 -119
View File
@@ -14,6 +14,7 @@ use DB;
use Input;
use User;
use Asset;
use Company;
use Lang;
use Actionlog;
use Location;
@@ -31,6 +32,8 @@ use Mail;
use Accessory;
use Symfony\Component\HttpFoundation\JsonResponse;
use Illuminate\Support\Facades\Log;
use Crypt;
class UsersController extends AdminController {
@@ -40,13 +43,14 @@ class UsersController extends AdminController {
* @var array
*/
protected $validationRules = array(
'first_name' => 'required|alpha_space|min:2',
'last_name' => 'required|alpha_space|min:2',
'location_id' => 'numeric',
'username' => 'required|min:2|unique:users,username',
'email' => 'email|unique:users,email',
'password' => 'required|min:6',
'password_confirm' => 'required|min:6|same:password',
'first_name' => 'required|alpha_space|min:2',
'last_name' => 'required|alpha_space|min:2',
'location_id' => 'numeric',
'username' => 'required|min:2|unique:users,deleted_at,NULL',
'email' => 'email|unique:users,email',
'password' => 'required|min:6',
'password_confirm' => 'required|min:6|same:password',
'company_id' => 'integer',
);
/**
@@ -82,6 +86,7 @@ class UsersController extends AdminController {
$location_list = locationsList();
$manager_list = managerList();
$company_list = Company::getSelectList();
/* echo '<pre>';
print_r($userPermissions);
@@ -93,6 +98,7 @@ class UsersController extends AdminController {
return View::make('backend/users/edit', compact('groups', 'userGroups', 'permissions', 'userPermissions'))
->with('location_list', $location_list)
->with('manager_list', $manager_list)
->with('company_list', $company_list)
->with('user', new User);
}
@@ -102,6 +108,12 @@ class UsersController extends AdminController {
* @return Redirect
*/
public function postCreate() {
// echo '<pre>';
// print_r($this->validationRules);
// echo '</pre>';
// exit;
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $this->validationRules);
$permissions = Input::get('permissions', array());
@@ -120,6 +132,8 @@ class UsersController extends AdminController {
// Get the inputs, with some exceptions
$inputs = Input::except('csrf_token', 'password_confirm', 'groups', 'email_user');
$inputs['company_id'] = Company::getIdForUser(Input::get('company_id'));
// @TODO: Figure out WTF I need to do this.
if ($inputs['manager_id'] == '') {
unset($inputs['manager_id']);
@@ -252,6 +266,10 @@ class UsersController extends AdminController {
// Get the user information
$user = Sentry::getUserProvider()->findById($id);
if (!Company::isCurrentUserHasAccess($user)) {
return Redirect::route('users')->with('error', Lang::get('general.insufficient_permissions'));
}
// Get this user groups
$userGroups = $user->groups()->lists('group_id', 'name');
@@ -267,6 +285,7 @@ class UsersController extends AdminController {
$this->encodeAllPermissions($permissions);
$location_list = array('' => '') + Location::lists('name', 'id');
$company_list = Company::getSelectList();
$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')
@@ -285,6 +304,7 @@ class UsersController extends AdminController {
// Show the page
return View::make('backend/users/edit', compact('user', 'groups', 'userGroups', 'permissions', 'userPermissions'))
->with('location_list', $location_list)
->with('company_list', $company_list)
->with('manager_list', $manager_list);
}
@@ -309,6 +329,10 @@ class UsersController extends AdminController {
try {
// Get the user information
$user = Sentry::getUserProvider()->findById($id);
if (!Company::isCurrentUserHasAccess($user)) {
return Redirect::route('users')->with('error', Lang::get('general.insufficient_permissions'));
}
} catch (UserNotFoundException $e) {
// Prepare the error message
$error = Lang::get('admin/users/message.user_not_found', compact('id'));
@@ -357,6 +381,7 @@ class UsersController extends AdminController {
$user->jobtitle = Input::get('jobtitle');
$user->phone = Input::get('phone');
$user->location_id = Input::get('location_id');
$user->company_id = Company::getIdForUser(Input::get('company_id'));
$user->manager_id = Input::get('manager_id');
$user->notes = Input::get('notes');
@@ -486,9 +511,12 @@ class UsersController extends AdminController {
if ((!Input::has('edit_user')) || (count(Input::has('edit_user')) == 0)) {
return Redirect::back()->with('error', 'No users selected');
} else {
$statuslabel_list = array('' => Lang::get('general.select_statuslabel')) + Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
$user_raw_array = Input::get('edit_user');
$users = User::whereIn('id', $user_raw_array)->with('groups')->get();
$statuslabel_list = statusLabelList();
$user_raw_array = array_keys(Input::get('edit_user'));
$users = User::whereIn('id', $user_raw_array)->with('groups');
$users = Company::scopeCompanyables($users)->get();
return View::make('backend/users/confirm-bulk-delete', compact('users', 'statuslabel_list'));
}
}
@@ -512,7 +540,9 @@ class UsersController extends AdminController {
$assets = Asset::whereIn('assigned_to', $user_raw_array)->get();
$accessories = DB::table('accessories_users')->whereIn('assigned_to', $user_raw_array)->get();
$users = User::whereIn('id', $user_raw_array)->delete();
$users = User::whereIn('id', $user_raw_array);
$users = Company::scopeCompanyables($users)->delete();
foreach ($assets as $asset) {
@@ -530,7 +560,7 @@ class UsersController extends AdminController {
$update_assets = Asset::whereIn('id', $asset_array)->update(
array(
'status_id' => e(Input::get('status_id')),
'assigned_to' => '',
'assigned_to' => null,
));
}
@@ -545,9 +575,9 @@ class UsersController extends AdminController {
$logaction->note = 'Bulk checkin';
$log = $logaction->logaction('checkin from');
$update_assets = DB::table('accessories_users')->whereIn('id', $accessory_array)->update(
$update_accessories = DB::table('accessories_users')->whereIn('id', $accessory_array)->update(
array(
'assigned_to' => '',
'assigned_to' => null,
));
}
@@ -572,14 +602,20 @@ class UsersController extends AdminController {
// Get user information
$user = Sentry::getUserProvider()->createModel()->withTrashed()->find($id);
// Restore the user
$user->restore();
if (!Company::isCurrentUserHasAccess($user)) {
return Redirect::route('users')->with('error', Lang::get('general.insufficient_permissions'));
}
else
{
// Restore the user
$user->restore();
// Prepare the success message
$success = Lang::get('admin/users/message.success.restored');
// Prepare the success message
$success = Lang::get('admin/users/message.success.restored');
// Redirect to the user management page
return Redirect::route('users')->with('success', $success);
// Redirect to the user management page
return Redirect::route('users')->with('success', $success);
}
} catch (UserNotFoundException $e) {
// Prepare the error message
$error = Lang::get('admin/users/message.user_not_found', compact('id'));
@@ -602,7 +638,12 @@ class UsersController extends AdminController {
$userlog = $user->userlog->load('assetlog', 'consumablelog', 'assetlog.model', 'licenselog', 'accessorylog', 'userlog', 'adminlog');
if (isset($user->id)) {
return View::make('backend/users/view', compact('user', 'userlog'));
if (!Company::isCurrentUserHasAccess($user)) {
return Redirect::route('users')->with('error', Lang::get('general.insufficient_permissions'));
} else {
return View::make('backend/users/view', compact('user', 'userlog'));
}
} else {
// Prepare the error message
$error = Lang::get('admin/users/message.user_not_found', compact('id'));
@@ -689,6 +730,7 @@ class UsersController extends AdminController {
$this->encodeAllPermissions($permissions);
$location_list = array('' => '') + Location::lists('name', 'id');
$company_list = Company::getSelectList();
$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')
@@ -700,6 +742,7 @@ class UsersController extends AdminController {
// Show the page
return View::make('backend/users/edit', compact('groups', 'userGroups', 'permissions', 'userPermissions'))
->with('location_list', $location_list)
->with('company_list', $company_list)
->with('manager_list', $manager_list)
->with('user', $user)
->with('clone_user', $user_to_clone);
@@ -781,6 +824,7 @@ class UsersController extends AdminController {
'password' => $pass,
'activated' => $activated,
'location_id' => $row[4],
'company_id' => Company::getIdForUser($row[5]),
'permissions' => '{"user":1}',
'notes' => 'Imported user'
);
@@ -824,91 +868,122 @@ class UsersController extends AdminController {
return Redirect::route('users')->with('duplicates', $duplicates)->with('success', 'Success');
}
public function getDatatable($status = null) {
public function getDatatable($status = null)
{
$users = User::with('assets', 'accessories', 'consumables', 'licenses', 'manager', 'sentryThrottle', 'groups', 'userloc');
switch ($status) {
case 'deleted':
$users->GetDeleted();
break;
case '':
$users->GetNotDeleted();
break;
if (Input::has('offset')) {
$offset = e(Input::get('offset'));
} else {
$offset = 0;
}
$users = $users->orderBy('created_at', 'DESC')->get();
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($users) {
$action_buttons = '';
if (Input::get('sort')=='name') {
$sort = 'first_name';
} else {
$sort = e(Input::get('sort'));
}
$users = User::select(array('users.id','users.email','users.username','users.location_id','users.manager_id','users.first_name','users.last_name','users.created_at','users.notes','users.company_id'))
->with('assets','accessories','consumables','licenses','manager','sentryThrottle','groups','userloc','company');
$users = Company::scopeCompanyables($users);
switch ($status) {
case 'deleted':
$users = $users->withTrashed()->Deleted();
break;
}
if (Input::has('search')) {
$users = $users->TextSearch(Input::get('search'));
}
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
switch (Input::get('sort'))
{
case 'manager':
$users = $users->OrderManager($order);
break;
case 'location':
$users = $users->OrderLocation($order);
break;
default:
$allowed_columns =
[
'last_name','first_name','email','username',
'assets','accessories', 'consumables','licenses','groups'
];
$sort = in_array($sort, $allowed_columns) ? $sort : 'first_name';
$users = $users->orderBy($sort, $order);
break;
}
$userCount = $users->count();
$users = $users->skip($offset)->take($limit)->get();
$rows = array();
foreach ($users as $user)
{
$group_names = '';
$inout = '';
$actions = '<nobr>';
foreach ($user->groups as $group) {
$group_names .= '<a href="' . Config::get('app.url') . '/admin/groups/' . $group->id . '/edit" class="label label-default">' . $group->name . '</a> ';
}
if (!is_null($users->deleted_at)) {
$action_buttons .= '<a href="' . route('restore/user', $users->id) . '" class="btn btn-warning btn-sm"><i class="fa fa-share icon-white"></i></a> ';
if (!is_null($user->deleted_at)) {
$actions .= '<a href="' . route('restore/user', $user->id) . '" class="btn btn-warning btn-sm"><i class="fa fa-share icon-white"></i></a> ';
} else {
if ($users->accountStatus() == 'suspended') {
$action_buttons .= '<a href="' . route('unsuspend/user', $users->id) . '" class="btn btn-default btn-sm"><span class="fa fa-clock-o"></span></a> ';
if ($user->accountStatus() == 'suspended') {
$actions .= '<a href="' . route('unsuspend/user', $user->id) . '" class="btn btn-default btn-sm"><span class="fa fa-clock-o"></span></a> ';
}
$action_buttons .= '<a href="' . route('update/user', $users->id) . '" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> ';
$actions .= '<a href="' . route('update/user', $user->id) . '" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> ';
if ((Sentry::getId() !== $users->id) && (!Config::get('app.lock_passwords'))) {
$action_buttons .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="' . route('delete/user', $users->id) . '" data-content="Are you sure you wish to delete this user?" data-title="Delete ' . htmlspecialchars($users->first_name) . '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a> ';
if ((Sentry::getId() !== $user->id) && (!Config::get('app.lock_passwords'))) {
$actions .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="' . route('delete/user', $user->id) . '" data-content="Are you sure you wish to delete this user?" data-title="Delete ' . htmlspecialchars($user->first_name) . '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a> ';
} else {
$action_buttons .= ' <span class="btn delete-asset btn-danger btn-sm disabled"><i class="fa fa-trash icon-white"></i></span>';
$actions .= ' <span class="btn delete-asset btn-danger btn-sm disabled"><i class="fa fa-trash icon-white"></i></span>';
}
}
return $action_buttons;
});
$actions .= '</nobr>';
$rows[] = array(
'id' => $user->id,
'checkbox' =>'<div class="text-center hidden-xs hidden-sm"><input type="checkbox" name="edit_user['.$user->id.']" class="one_required"></div>',
'name' => '<a title="'.$user->fullName().'" href="../admin/users/'.$user->id.'/view">'.$user->fullName().'</a>',
'email' => ($user->email!='') ?
'<a href="mailto:'.$user->email.'" class="hidden-md hidden-lg">'.$user->email.'</a>'
.'<a href="mailto:'.$user->email.'" class="hidden-xs hidden-sm"><i class="fa fa-envelope"></i></a>'
.'</span>' : '',
'username' => $user->username,
'location' => ($user->userloc) ? $user->userloc->name : '',
'manager' => ($user->manager) ? '<a title="' . $user->manager->fullName() . '" href="users/' . $user->manager->id . '/view">' . $user->manager->fullName() . '</a>' : '',
'assets' => $user->assets->count(),
'licenses' => $user->licenses->count(),
'accessories' => $user->accessories->count(),
'consumables' => $user->consumables->count(),
'groups' => $group_names,
'notes' => $user->notes,
'actions' => ($actions) ? $actions : '',
'companyName' => is_null($user->company) ? '' : e($user->company->name)
);
}
return Datatable::collection($users)
->addColumn('', function($users) {
return '<div class="text-center"><input type="checkbox" name="edit_user[]" value="' . $users->id . '" class="one_required"></div>';
})
->addColumn('name', function($users) {
return '<a title="' . $users->fullName() . '" href="users/' . $users->id . '/view">' . $users->fullName() . '</a>';
})
->addColumn('email', function($users) {
if ($users->email) {
return '<div class="text-center"><a title="' . $users->email . '" href="mailto:' . $users->email . '"><i class="fa fa-envelope fa-lg"></i></div>';
} else {
return '';
}
})
->addColumn('manager', function($users) {
if ($users->manager) {
return '<a title="' . $users->manager->fullName() . '" href="users/' . $users->manager->id . '/view">' . $users->manager->fullName() . '</a>';
}
})
->addColumn('location', function($users) {
if ($users->userloc) {
return $users->userloc->name;
}
})
->addColumn('assets', function($users) {
return $users->assets->count();
})
->addColumn('licenses', function($users) {
return $users->licenses->count();
})
->addColumn('accessories', function($users) {
return $users->accessories->count();
})
->addColumn('consumables', function($users) {
return $users->consumables->count();
})
->addColumn('groups', function($users) {
$group_names = '';
foreach ($users->groups as $group) {
$group_names .= '<a href="' . Config::get('app.url') . '/admin/groups/' . $group->id . '/edit" class="label label-default">' . $group->name . '</a> ';
}
return $group_names;
})
->addColumn($actions)
->searchColumns('name', 'email', 'manager', 'activated', 'groups', 'location')
->orderColumns('name', 'email', 'manager', 'activated', 'licenses', 'assets', 'accessories', 'consumables', 'groups', 'location')
->make();
$data = array('total'=>$userCount, 'rows'=>$rows);
return $data;
}
/**
@@ -925,7 +1000,10 @@ class UsersController extends AdminController {
if (isset($user->id)) {
if (Input::hasFile('userfile')) {
if (!Company::isCurrentUserHasAccess($user)) {
return Redirect::route('users')->with('error', Lang::get('general.insufficient_permissions'));
}
else if (Input::hasFile('userfile')) {
foreach (Input::file('userfile') as $file) {
@@ -986,13 +1064,19 @@ class UsersController extends AdminController {
// the license is valid
if (isset($user->id)) {
$log = Actionlog::find($fileId);
$full_filename = $destinationPath . '/' . $log->filename;
if (file_exists($full_filename)) {
unlink($destinationPath . '/' . $log->filename);
if (!Company::isCurrentUserHasAccess($user)) {
return Redirect::route('users')->with('error', Lang::get('general.insufficient_permissions'));
}
else
{
$log = Actionlog::find($fileId);
$full_filename = $destinationPath . '/' . $log->filename;
if (file_exists($full_filename)) {
unlink($destinationPath . '/' . $log->filename);
}
$log->delete();
return Redirect::back()->with('success', Lang::get('admin/users/message.deletefile.success'));
}
$log->delete();
return Redirect::back()->with('success', Lang::get('admin/users/message.deletefile.success'));
} else {
// Prepare the error message
$error = Lang::get('admin/users/message.does_not_exist', compact('id'));
@@ -1014,9 +1098,15 @@ class UsersController extends AdminController {
// the license is valid
if (isset($user->id)) {
$log = Actionlog::find($fileId);
$file = $log->get_src();
return Response::download($file);
if (!Company::isCurrentUserHasAccess($user)) {
return Redirect::route('users')->with('error', Lang::get('general.insufficient_permissions'));
}
else
{
$log = Actionlog::find($fileId);
$file = $log->get_src();
return Response::download($file);
}
} else {
// Prepare the error message
$error = Lang::get('admin/users/message.does_not_exist', compact('id'));
@@ -1043,13 +1133,13 @@ class UsersController extends AdminController {
// Selected permissions
$selectedPermissions = Input::old('permissions', array('superuser' => -1));
$this->encodePermissions($selectedPermissions);
$location_list = locationsList();
// Show the page
return View::make('backend/users/ldap', compact('groups', 'selectedGroups', 'permissions', 'selectedPermissions'))
->with('location_list', $location_list);
}
/**
@@ -1064,7 +1154,7 @@ class UsersController extends AdminController {
'username' => 'required|min:2|unique:users,username',
'email' => 'email|unique:users,email',
);
/**
* Declare the rules for the form validation.
*
@@ -1083,28 +1173,28 @@ class UsersController extends AdminController {
public function postLDAP() {
$location_id = Input::get('location_id');
$formValidator = Validator::make(Input::all(), $this->ldapFormInputValidationRules);
// If validation fails, we'll exit the operation now.
if ($formValidator->fails()) {
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($formValidator);
}
$ldap_version = Config::get('ldap.version');
$url = Config::get('ldap.url');
$username = Config::get('ldap.username');
$password = Config::get('ldap.password');
$base_dn = Config::get('ldap.basedn');
$filter = Config::get('ldap.filter');
$ldap_result_username = Config::get('ldap.result.username');
$ldap_result_emp_num = Config::get('ldap.result.emp.num');
$ldap_result_last_name = Config::get('ldap.result.last.name');
$ldap_result_first_name = Config::get('ldap.result.first.name');
$ldap_result_email = Config::get('ldap.result.email');
$ldap_result_active_flag = Config::get('ldap.result.active.flag');
$ldap_version = Setting::getSettings()->ldap_version;
$url = Setting::getSettings()->ldap_server;
$username = Setting::getSettings()->ldap_uname;
$password = Crypt::decrypt(Setting::getSettings()->ldap_pword);
$base_dn = Setting::getSettings()->ldap_basedn;
$filter = Setting::getSettings()->ldap_filter;
$ldap_result_username = Setting::getSettings()->ldap_username_field;
$ldap_result_last_name = Setting::getSettings()->ldap_lname_field;
$ldap_result_first_name = Setting::getSettings()->ldap_fname_field;
$ldap_result_active_flag = Setting::getSettings()->ldap_active_flag_field;
$ldap_result_emp_num = Setting::getSettings()->ldap_emp_num_field;
$ldap_result_email = Setting::getSettings()->ldap_email_field;
// Connect to LDAP server
$ldapconn = @ldap_connect($url);
@@ -63,13 +63,16 @@
public function up()
{
Schema::table( 'asset_logs', function ( Blueprint $table ) {
if (!Schema::hasColumn('asset_logs', 'thread_id')) {
$table->integer( 'thread_id' )
->nullable()
->default( null );
$table->index( 'thread_id' );
} );
Schema::table( 'asset_logs', function ( Blueprint $table ) {
$table->integer( 'thread_id' )
->nullable()
->default( null );
$table->index( 'thread_id' );
} );
}
$this->actionlog = new Actionlog();
$this->assetLogs = $this->actionlog->getListingOfActionLogsChronologicalOrder();
@@ -93,9 +96,10 @@
}
}
}
/**
* Reverse the migrations.
*
@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class FixDefaultPurchaseOrder extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'licenses` MODIFY `purchase_order` varchar(255) DEFAULT NULL;');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'licenses` MODIFY `purchase_order` varchar(255);');
}
}
@@ -0,0 +1,48 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddAccessoryConsumablePriceInfo extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('accessories', function ($table) {
$table->date('purchase_date')->nullable();
$table->decimal('purchase_cost', 13, 4)->nullable();
$table->string('order_number');
});
Schema::table('consumables', function ($table) {
$table->date('purchase_date')->nullable();
$table->decimal('purchase_cost', 13, 4)->nullable();
$table->string('order_number');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('accessories', function ($table) {
$table->dropColumn('purchase_date');
$table->dropColumn('purchase_cost');
$table->dropColumn('order_number');
});
Schema::table('consumables', function ($table) {
$table->dropColumn('purchase_date');
$table->dropColumn('purchase_cost');
$table->dropColumn('order_number');
});
}
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddBrandToSettings extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function(Blueprint $table)
{
$table->tinyInteger('brand')->default(1);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function(Blueprint $table)
{
$table->dropColumn('brand');
});
}
}
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class FixDefaultsAccessories extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'accessories` MODIFY `order_number` varchar(255) DEFAULT NULL;');
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'consumables` MODIFY `order_number` varchar(255) DEFAULT NULL;');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'accessories` MODIFY `order_number` varchar(255);');
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'consumables` MODIFY `order_number` varchar(255);');
}
}
@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddCheckoutTimeAndExpectedCheckoutDateToAssets extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function(Blueprint $table)
{
//
$answer=$table->dateTime('last_checkout')->nullable();
$table->date('expected_checkin')->nullable();
});
DB::statement("UPDATE assets SET last_checkout=(SELECT MAX(created_at) FROM asset_logs WHERE asset_logs.id=assets.id AND action_type='checkout') WHERE assigned_to IS NOT NULL");
DB::statement("UPDATE assets SET expected_checkin=(SELECT expected_checkin FROM asset_logs WHERE asset_logs.id=assets.id AND action_type='checkout' ORDER BY id DESC limit 1) WHERE assigned_to IS NOT NULL");
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('assets', function(Blueprint $table)
{
//
$table->dropColumn('last_checkout');
$table->dropColumn('expected_checkin');
});
}
}
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCompaniesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('companies', function(Blueprint $table)
{
$table->increments('id');
$table->string('name')->unique();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('companies');
}
}
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddCompanyIdToConsumablesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('consumables', function(Blueprint $table)
{
$table->integer('company_id')->unsigned()->nullable();
$table->foreign('company_id')->references('id')->on('companies');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('consumables', function(Blueprint $table)
{
$table->dropForeign('consumables_company_id_foreign');
$table->dropColumn('company_id');
});
}
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class Image extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function(Blueprint $table)
{
$table->text('image')->after('notes')->nullable()->default(NULL);
//
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('assets', function ($table) {
$table->dropColumn('image');
});
}
}
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddCompanyIdToAccessoriesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('accessories', function(Blueprint $table)
{
$table->integer('company_id')->unsigned()->nullable();
$table->foreign('company_id')->references('id')->on('companies');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('accessories', function(Blueprint $table)
{
$table->dropForeign('accessories_company_id_foreign');
$table->dropColumn('company_id');
});
}
}
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddCompanyIdToUsersTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function(Blueprint $table)
{
$table->integer('company_id')->unsigned()->nullable();
$table->foreign('company_id')->references('id')->on('companies');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function(Blueprint $table)
{
$table->dropForeign('users_company_id_foreign');
$table->dropColumn('company_id');
});
}
}
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddCompanyIdToLicensesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('licenses', function(Blueprint $table)
{
$table->integer('company_id')->unsigned()->nullable();
$table->foreign('company_id')->references('id')->on('companies');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('licenses', function(Blueprint $table)
{
$table->dropForeign('licenses_company_id_foreign');
$table->dropColumn('company_id');
});
}
}
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddCompanyIdToAssetsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function(Blueprint $table)
{
$table->integer('company_id')->unsigned()->nullable();
$table->foreign('company_id')->references('id')->on('companies');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('assets', function(Blueprint $table)
{
$table->dropForeign('assets_company_id_foreign');
$table->dropColumn('company_id');
});
}
}
@@ -0,0 +1,60 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddLdapFieldsToSettings extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function(Blueprint $table)
{
$table->string('ldap_enabled')->nullable()->default(NULL);
$table->string('ldap_server')->nullable()->default(NULL);
$table->string('ldap_uname')->nullable()->default(NULL);
$table->longText('ldap_pword')->nullable()->default(NULL);
$table->string('ldap_basedn')->nullable()->default(NULL);
$table->string('ldap_filter')->nullable()->default('cn=*');
$table->string('ldap_username_field')->nullable()->default('samaccountname');
$table->string('ldap_lname_field')->nullable()->default('sn');
$table->string('ldap_fname_field')->nullable()->default('givenname');
$table->string('ldap_auth_filter_query')->nullable()->default('uid=samaccountname');
$table->integer('ldap_version')->nullable()->default(3);
$table->string('ldap_active_flag')->nullable()->default(NULL);
$table->string('ldap_emp_num')->nullable()->default(NULL);
$table->string('ldap_email')->nullable()->default(NULL);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function(Blueprint $table)
{
$table->dropColumn('ldap_enabled');
$table->dropColumn('ldap_server');
$table->dropColumn('ldap_uname');
$table->longText('ldap_pword');
$table->dropColumn('ldap_basedn');
$table->dropColumn('ldap_filter');
$table->dropColumn('ldap_username_field');
$table->dropColumn('ldap_lname_field');
$table->dropColumn('ldap_fname_field');
$table->dropColumn('ldap_auth_filter_query');
$table->dropColumn('ldap_version');
$table->dropColumn('ldap_active_flag');
$table->dropColumn('ldap_emp_num');
$table->dropColumn('ldap_email');
});
}
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddFullMultipleCompaniesSupportToSettingsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function(Blueprint $table)
{
$table->boolean('full_multiple_companies_support')->default(FALSE);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function(Blueprint $table)
{
$table->dropColumn('full_multiple_companies_support');
});
}
}
+39
View File
@@ -0,0 +1,39 @@
<?php
class AccessoriesSeeder extends Seeder
{
public function run()
{
// Initialize empty array
$accessory = array();
$date = new DateTime;
$accessory[] = array(
'name' => 'Cisco Desktop Phone',
'category_id' => 4,
'qty' => '20',
'requestable' => '0',
'user_id' => 1,
);
$accessory[] = array(
'name' => 'ASUS 23-inch',
'category_id' => 5,
'qty' => '20',
'requestable' => '0',
'user_id' => 1,
);
// Delete all the old data
DB::table('accessories')->truncate();
// Insert the new posts
Accessory::insert($accessory);
}
}
+1 -1
View File
@@ -30,7 +30,7 @@ class ActionlogSeeder extends Seeder
'asset_id' => '1',
'checkedout_to' => '1',
'location_id' => NULL,
'created_at' => $date->modify('-10 day'),
'created_at' => $date->modify('-10 day'),
'asset_type' => 'hardware',
'note' => NULL,
'filename' => NULL,
@@ -0,0 +1,35 @@
<?php
class AssetMaintenancesSeeder extends Seeder
{
public function run()
{
// Initialize empty array
$asset_maintenances = array();
$date = new DateTime;
$asset_maintenances[] = array(
'asset_id' => 1,
'supplier_id' => 1,
'asset_maintenance_type' => 'Maintenance',
'title' => 'Test Maintenance',
'start_date' => $date->modify('-10 day'),
'cost' => '200.99',
'is_warranty' => '0',
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
);
// Delete all the old data
DB::table('asset_maintenances')->truncate();
// Insert the new posts
AssetMaintenance::insert($asset_maintenances);
}
}
+12
View File
@@ -15,6 +15,7 @@ class AssetsSeeder extends Seeder
'name' => 'Shanen MBP',
'asset_tag' => 'NNY2878796',
'model_id' => 1,
'supplier_id' => 1,
'serial' => 'WS90585666669',
'purchase_date' => '2013-10-02',
'purchase_cost' => '2435.99',
@@ -38,6 +39,7 @@ class AssetsSeeder extends Seeder
'name' => 'Michael MBP',
'asset_tag' => 'NNY28633396',
'model_id' => 1,
'supplier_id' => 1,
'serial' => 'WS905823226669',
'purchase_date' => '2013-10-02',
'purchase_cost' => '2435.99',
@@ -62,6 +64,7 @@ class AssetsSeeder extends Seeder
'name' => 'Alison MBP',
'asset_tag' => 'NNY287958796',
'model_id' => 1,
'supplier_id' => 1,
'serial' => 'WS905869046069',
'purchase_date' => '2013-10-02',
'purchase_cost' => '2435.99',
@@ -85,6 +88,7 @@ class AssetsSeeder extends Seeder
'name' => 'Brady MBP',
'asset_tag' => 'NNY78795566',
'model_id' => 2,
'supplier_id' => 2,
'serial' => 'WS9078686069',
'purchase_date' => '2012-01-02',
'purchase_cost' => '1999.99',
@@ -108,6 +112,7 @@ class AssetsSeeder extends Seeder
'name' => 'Deborah MBP',
'asset_tag' => 'NNY65756756775',
'model_id' => 2,
'supplier_id' => 2,
'serial' => 'WS9078686069',
'purchase_date' => '2012-01-02',
'purchase_cost' => '699.99',
@@ -132,6 +137,7 @@ class AssetsSeeder extends Seeder
'name' => 'Sara MBP',
'asset_tag' => 'NNY6897856775',
'model_id' => 2,
'supplier_id' => 2,
'serial' => 'WS87897998Q',
'purchase_date' => '2012-01-02',
'purchase_cost' => '1999.99',
@@ -155,6 +161,7 @@ class AssetsSeeder extends Seeder
'name' => 'Ben MBP',
'asset_tag' => 'NNY67567775',
'model_id' => 2,
'supplier_id' => 2,
'serial' => 'WS89080890',
'purchase_date' => '2012-01-02',
'purchase_cost' => '1999.99',
@@ -178,6 +185,7 @@ class AssetsSeeder extends Seeder
'name' => 'Broken Laptop',
'asset_tag' => 'NNY6756756775',
'model_id' => 2,
'supplier_id' => 2,
'serial' => 'WS89080890',
'purchase_date' => '2012-01-02',
'purchase_cost' => '1999.99',
@@ -201,6 +209,7 @@ class AssetsSeeder extends Seeder
'name' => 'Maybe Broke-Ass Laptop',
'asset_tag' => 'NNY6755667775',
'model_id' => 2,
'supplier_id' => 1,
'serial' => 'WS45689080890',
'purchase_date' => '2012-01-02',
'purchase_cost' => '1999.99',
@@ -224,6 +233,7 @@ class AssetsSeeder extends Seeder
'name' => 'Completely Facacta Laptop',
'asset_tag' => 'NNY6564567775',
'model_id' => 2,
'supplier_id' => 2,
'serial' => 'WS99689080890',
'purchase_date' => '2012-01-02',
'purchase_cost' => '1999.99',
@@ -247,6 +257,7 @@ class AssetsSeeder extends Seeder
'name' => 'Borked Laptop',
'asset_tag' => 'NNY656456778975',
'model_id' => 2,
'supplier_id' => 1,
'serial' => 'WS99689080890',
'purchase_date' => '2012-01-02',
'purchase_cost' => '1999.99',
@@ -270,6 +281,7 @@ class AssetsSeeder extends Seeder
'name' => 'Noah MBP',
'asset_tag' => 'NNY98056775',
'model_id' => 2,
'supplier_id' => 1,
'serial' => 'WS909098888',
'purchase_date' => '2011-12-20',
'purchase_cost' => '699.99',
+18
View File
@@ -16,6 +16,7 @@ class CategoriesSeeder extends Seeder
'require_acceptance' => 0,
'deleted_at' => NULL,
'eula_text' => NULL,
'category_type' => 'asset',
);
$date = new DateTime;
@@ -28,6 +29,7 @@ class CategoriesSeeder extends Seeder
'require_acceptance' => 0,
'deleted_at' => NULL,
'eula_text' => NULL,
'category_type' => 'asset',
);
$date = new DateTime;
@@ -40,6 +42,7 @@ class CategoriesSeeder extends Seeder
'require_acceptance' => 0,
'deleted_at' => NULL,
'eula_text' => NULL,
'category_type' => 'asset',
);
$date = new DateTime;
@@ -52,6 +55,7 @@ class CategoriesSeeder extends Seeder
'require_acceptance' => 0,
'deleted_at' => NULL,
'eula_text' => NULL,
'category_type' => 'accessory',
);
$date = new DateTime;
@@ -64,6 +68,20 @@ class CategoriesSeeder extends Seeder
'require_acceptance' => 0,
'deleted_at' => NULL,
'eula_text' => NULL,
'category_type' => 'accessory',
);
$date = new DateTime;
$category[] = array(
'name' => 'Printer Ink',
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
'user_id' => 1,
'use_default_eula' => 0,
'require_acceptance' => 0,
'deleted_at' => NULL,
'eula_text' => NULL,
'category_type' => 'consumable',
);
+3
View File
@@ -22,6 +22,9 @@ class DatabaseSeeder extends Seeder
$this->call('LicensesSeeder');
$this->call('LicenseSeatsSeeder');
$this->call('ActionlogSeeder');
$this->call('AccessoriesSeeder');
$this->call('AssetMaintenancesSeeder');
$this->call('SuppliersSeeder');
}
}
+4
View File
@@ -17,6 +17,7 @@ class LocationsSeeder extends Seeder
'state' => 'NY',
'country' => 'US',
'zip' => '10004',
'currency' => '$',
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
'user_id' => 1,
@@ -31,6 +32,7 @@ class LocationsSeeder extends Seeder
'state' => 'NY',
'country' => 'US',
'zip' => '10004',
'currency' => '$',
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
'user_id' => 1,
@@ -45,6 +47,7 @@ class LocationsSeeder extends Seeder
'state' => 'CA',
'country' => 'US',
'zip' => '94111',
'currency' => '$',
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
'user_id' => 1,
@@ -59,6 +62,7 @@ class LocationsSeeder extends Seeder
'state' => 'CA',
'country' => 'US',
'zip' => '90028',
'currency' => '$',
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
'user_id' => 1,
+37
View File
@@ -0,0 +1,37 @@
<?php
class SuppliersSeeder extends Seeder
{
public function run()
{
// Initialize empty array
$supplier = array();
$date = new DateTime;
$supplier[] = array(
'name' => 'New Egg',
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
'user_id' => 1,
);
$supplier[] = array(
'name' => 'Microsoft',
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
'user_id' => 1,
);
// Delete all the old data
DB::table('suppliers')->truncate();
// Insert the new posts
Supplier::insert($supplier);
}
}
+7
View File
@@ -116,6 +116,13 @@ Route::filter('reporting-auth', function () {
}
});
Route::filter('backup-auth', function () {
if (!Sentry::getUser()->isSuperUser()) {
return Redirect::route('home')->with('error', Lang::get('general.insufficient_permissions'));
}
});
/*
+1 -1
View File
@@ -39,7 +39,7 @@ function suppliersList() {
}
function statusLabelList() {
$statuslabel_list = Statuslabel::orderBy('name', 'asc')
$statuslabel_list = array('' => Lang::get('general.select_statuslabel')) + Statuslabel::orderBy('name', 'asc')
->lists('name', 'id');
return $statuslabel_list;
}
@@ -5,11 +5,14 @@ return array(
'about_accessories_text' => 'الملحقات هي أي شيء تقوم بتسليمه للمستخدمين لكنه لا يحتوي على رقم تسلسلي (أو أنك لست بحاجة إلى تتبعه بشكل خاص). مثال: فأرة الحاسوب أو لوحة المفاتيح.',
'accessory_category' => 'فئة الملحق',
'accessory_name' => 'اسم الملحق',
'cost' => 'Purchase Cost',
'create' => 'Create Accessory',
'date' => 'Purchase Date',
'eula_text' => 'إنشاء اتفاقية جديدة',
'eula_text_help' => 'يسمح لك هذا الحقل بتخصيص الاتفاقيات لأنواع معينة من الأصول. اذا كنت تمتلك اتفاقية واحدة لجميع أصولك يمكنك أن تقوم بتأشير المربع في الأسفل لاستخدام الاتفاقية الافتراضية.',
'require_acceptance' => 'مطالبة المستخدمين بتأكيد قبولهم الأصول في هذه الفئة.',
'no_default_eula' => 'ليس هناك اتفاقيات. قم باضافة واحدة من "الاعدادات".',
'order' => 'Order Number',
'qty' => 'الكمية',
'total' => 'المجموع',
'remaining' => 'المتاح',
+6 -6
View File
@@ -2,17 +2,17 @@
return array(
'does_not_exist' => 'هذه الفئة غير موجودة.',
'does_not_exist' => 'Accessory does not exist.',
'assoc_users' => 'تم إخراج :count عنصر من هذا الملحق للمستخدمين، الرجاء إيداع الملحقات ثم حاول مرة أخرى. ',
'create' => array(
'error' => 'فشل إنشاء التصنيف، الرجاء المحاولة مرة أخرى.',
'success' => 'تم إنشاء الفئة بنجاح.'
'error' => 'Accessory was not created, please try again.',
'success' => 'Accessory created successfully.'
),
'update' => array(
'error' => 'فشل تحديث التصنيف، الرجاء المحاولة مرة أخرى',
'success' => 'Category updated successfully.'
'error' => 'Accessory was not updated, please try again',
'success' => 'Accessory updated successfully.'
),
'delete' => array(
@@ -20,7 +20,7 @@ return array(
'error' => 'There was an issue deleting the category. Please try again.',
'success' => 'The category was deleted successfully.'
),
'checkout' => array(
'error' => 'لم يتم إخراج الملحق، الرجاء المحاولة مرة أخرى',
'success' => 'تم إخراج الملحق بنجاح.',
@@ -1,14 +1,14 @@
<?php
return [
'asset_maintenance_type' => 'Asset Maintenance Type',
'asset_maintenance_type' => 'Maintenance Type',
'title' => 'Title',
'start_date' => 'Start Date',
'completion_date' => 'Completion Date',
'start_date' => 'Started',
'completion_date' => 'Completed',
'cost' => 'Cost',
'is_warranty' => 'Warranty Improvement',
'asset_maintenance_time' => 'Asset Maintenance Time (in days)',
'asset_maintenance_time' => 'Days',
'notes' => 'Notes',
'update' => 'Update Asset Maintenance',
'create' => 'Create Asset Maintenance'
'update' => 'Update',
'create' => 'Create'
];
@@ -2,8 +2,8 @@
return [
'title' => 'Asset Maintenance',
'asset_name' => 'Asset Name',
'supplier_name' => 'Supplier Name',
'asset_name' => 'Asset',
'supplier_name' => 'Supplier',
'is_warranty' => 'Warranty',
'dl_csv' => 'Download CSV'
];
];
@@ -4,7 +4,10 @@ return array(
'about_consumables_title' => 'About Consumables',
'about_consumables_text' => 'Consumables are anything purchased that will be used up over time. For example, printer ink or copier paper.',
'consumable_name' => 'Consumable Name',
'cost' => 'Purchase Cost',
'create' => 'Create Consumable',
'date' => 'Purchase Date',
'order' => 'Order Number',
'remaining' => 'Remaining',
'total' => 'Total',
'update' => 'Update Consumable',
+2 -2
View File
@@ -15,9 +15,9 @@ return array(
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this accessory?',
'confirm' => 'Are you sure you wish to delete this consumable?',
'error' => 'There was an issue deleting the consumable. Please try again.',
'success' => 'The accessory was deleted successfully.'
'success' => 'The consumable was deleted successfully.'
),
'checkout' => array(
+1
View File
@@ -18,6 +18,7 @@ return array(
'serial' => 'Serial',
'status' => 'Status',
'title' => 'Asset ',
'image' => 'Device Image',
'days_without_acceptance' => 'Days Without Acceptance'
);
+3 -2
View File
@@ -1,7 +1,8 @@
<?php
return array(
'assets_rtd' => 'Assets RTD',
'assets_checkedout' => 'Assets Assigned',
'id' => 'ID',
'city' => 'City',
'state' => 'State',
@@ -13,5 +14,5 @@ return array(
'zip' => 'Postal Code',
'locations' => 'Locations',
'parent' => 'Parent',
'currency' => 'Location Currency', // this is deprecated
'currency' => 'Location Currency',
);
+24 -1
View File
@@ -22,11 +22,31 @@ return array(
'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',
'generate_backup' => 'Generate Backup',
'header_color' => 'Header Color',
'info' => 'These settings let you customize certain aspects of your installation.',
'laravel' => 'Laravel Version',
'load_remote' => 'This Snipe-IT install can load scripts from the outside world.',
'ldap_enabled' => 'LDAP enabled',
'ldap_integration' => 'LDAP Integration',
'ldap_settings' => 'LDAP Settings',
'ldap_server' => 'LDAP Server',
'ldap_uname' => 'LDAP Bind Username',
'ldap_pword' => 'LDAP Bind Password',
'ldap_basedn' => 'Base Bind DN',
'ldap_filter' => 'LDAP Filter',
'ldap_username_field' => 'Username Field',
'ldap_lname_field' => 'Last Name',
'ldap_fname_field' => 'LDAP First Name',
'ldap_auth_filter_query' => 'LDAP Authentication query',
'ldap_version' => 'LDAP Version',
'ldap_active_flag' => 'LDAP Active Flag',
'ldap_emp_num' => 'LDAP Employee Number',
'ldap_email' => 'LDAP Email',
'load_remote_text' => 'Remote Scripts',
'load_remote_help_text' => 'This Snipe-IT install can load scripts from the outside world.',
'logo' => 'Logo',
'full_multiple_companies_support_help_text' => 'Restricting users (including admins) assigned to companies to their company\'s assets.',
'full_multiple_companies_support_text' => 'Full Multiple Companies Support',
'optional' => 'optional',
'per_page' => 'Results Per Page',
'php' => 'PHP Version',
@@ -46,4 +66,7 @@ return array(
'system' => 'System Information',
'update' => 'Update Settings',
'value' => 'Value',
'brand' => 'Branding',
'about_settings_title' => 'About Settings',
'about_settings_text' => 'These settings let you customize certain aspects of your installation.',
);
+8 -2
View File
@@ -4,8 +4,14 @@ return array(
'update' => array(
'error' => 'An error has occurred while updating. ',
'success' => 'Settings updated successfully.'
'error' => 'An error has occurred while updating. ',
'success' => 'Settings updated successfully.'
),
'backup' => array(
'delete_confirm' => 'Are you sure you would like to delete this backup file? This action cannot be undone. ',
'file_deleted' => 'The backup file was successfully deleted. ',
'generated' => 'A new backup file was successfully created.',
'file_not_found' => 'That backup file could not be found on the server.',
),
);
+6 -1
View File
@@ -30,6 +30,8 @@
'checkin_from' => 'Checkin from',
'checkout' => 'ترجيع',
'city' => 'المدينة',
'companies' => 'Companies',
'company' => 'Company',
'consumable' => 'Consumable',
'consumables' => 'Consumables',
'country' => 'الدولة',
@@ -43,6 +45,7 @@
'date' => 'التاريخ',
'delete' => 'حذف',
'deleted' => 'تم حذفها',
'delete_seats' => 'Deleted Seats',
'deployed' => 'مُوزعة',
'depreciation_report' => 'تقرير الإستهلاك',
'download' => 'Download',
@@ -65,8 +68,9 @@
'asset_maintenance_report' => 'Asset Maintenance Report',
'asset_maintenances' => 'Asset Maintenances',
'item' => 'Item',
'insufficient_permissions' => 'Insufficient permissions!',
'last' => 'Last',
'last_name' => 'الإسم الأخير',
'last_name' => 'الإسم الأخير',
'license' => 'الرخص',
'license_report' => 'License Report',
'licenses_available' => 'الرخص المتاحة',
@@ -139,4 +143,5 @@
'years' => 'سنوات',
'yes' => 'نعم',
'zip' => 'الرمز البريدي',
'noimage' => 'No image uploaded or image not found.',
];
+17 -14
View File
@@ -1,20 +1,23 @@
<?php
return array(
'about_accessories_title' => 'About Accessories',
'about_accessories_text' => 'Accessories are anything you issue to users but that do not have a serial number (or you do not care about tracking them uniquely). For example, computer mice or keyboards.',
'accessory_category' => 'Accessory Category',
'accessory_name' => 'Accessory Name',
'create' => 'Create Accessory',
'eula_text' => 'Category EULA',
'eula_text_help' => 'This field allows you to customize your EULAs for specific types of assets. If you only have one EULA for all of your assets, you can check the box below to use the primary default.',
'require_acceptance' => 'Require users to confirm acceptance of assets in this category.',
'no_default_eula' => 'No primary default EULA found. Add one in Settings.',
'qty' => 'QTY',
'about_accessories_title' => 'Относно аксесоарите',
'about_accessories_text' => 'Аксесоарите са всички неща, които се изписват на потребителите, но нямат сериен номер (или няма нужда да бъдат конкретно проследявани). Например, това са мишки, клавиатури и др.',
'accessory_category' => 'Категория аксесоари',
'accessory_name' => 'Аксесоар',
'cost' => 'Стойност на закупуване',
'create' => 'Създаване на аксесоар',
'date' => 'Дата на закупуване',
'eula_text' => 'EULA на категорията',
'eula_text_help' => 'Това поле позволява да задавате различни EULA за всеки тип активи. Ако имате обща EULA за всички активи, можете да използвате кутийката по-долу за да използвате една обща по подразбиране.',
'require_acceptance' => 'Задължаване на потребителите да потвърждават приемането на активи от тази категория.',
'no_default_eula' => 'Няма EULA по подразбиране. Добавете я в Настройки.',
'order' => 'Номер на поръчка',
'qty' => 'Количество',
'total' => 'Oбщо',
'remaining' => 'Avail',
'update' => 'Update Accessory',
'use_default_eula' => 'Use the <a href="#" data-toggle="modal" data-target="#eulaModal">primary default EULA</a> instead.',
'use_default_eula_disabled' => '<del>Use the primary default EULA instead.</del> No primary default EULA is set. Please add one in Settings.',
'remaining' => 'Наличност',
'update' => 'Обновяване на аксесоар',
'use_default_eula' => 'Използване на <a href="#" data-toggle="modal" data-target="#eulaModal">EULA по подразбиране</a>.',
'use_default_eula_disabled' => '<del>Използване на EULA по подразбиране</del> Няма EULA по подразбиране. Добавете я в Настройки.',
);
+13 -13
View File
@@ -2,35 +2,35 @@
return array(
'does_not_exist' => 'Няма такава категория.',
'assoc_users' => 'This accessory currently has :count items checked out to users. Please check in the accessories and and try again. ',
'does_not_exist' => 'Accessory does not exist.',
'assoc_users' => 'От този аксесоар са предадени :count броя на потребителите. Моля впишете обратно нови или върнати и опитайте отново.',
'create' => array(
'error' => 'Category was not created, please try again.',
'success' => 'Категорията е създадена.'
'error' => 'Accessory was not created, please try again.',
'success' => 'Accessory created successfully.'
),
'update' => array(
'error' => 'Category was not updated, please try again',
'success' => 'Категорията е обновена.'
'error' => 'Accessory was not updated, please try again',
'success' => 'Accessory updated successfully.'
),
'delete' => array(
'confirm' => 'Сигурни ли сте, че желаете изтриване на категорията?',
'error' => 'There was an issue deleting the category. Please try again.',
'error' => 'Проблем при изтриване на категорията. Моля опитайте отново.',
'success' => 'Категорията бе изтрита успешно.'
),
'checkout' => array(
'error' => 'Accessory was not checked out, please try again',
'success' => 'Accessory checked out successfully.',
'error' => 'Аксесоарът не беше изписан. Моля опитайте отново.',
'success' => 'Аксесоарът изписан успешно.',
'user_does_not_exist' => 'Невалиден потребител. Моля опитайте отново.'
),
'checkin' => array(
'error' => 'Accessory was not checked in, please try again',
'success' => 'Accessory checked in successfully.',
'user_does_not_exist' => 'That user is invalid. Please try again.'
'error' => 'Аксесоарът не беше вписан. Моля опитайте отново.',
'success' => 'Аксесоарът вписан успешно.',
'user_does_not_exist' => 'Невалиден потребител. Моля опитайте отново.'
)
+3 -3
View File
@@ -1,11 +1,11 @@
<?php
return array(
'dl_csv' => 'Download CSV',
'dl_csv' => 'Сваляне на CSV',
'eula_text' => 'EULA',
'id' => 'ID',
'require_acceptance' => 'Acceptance',
'title' => 'Accessory Name',
'require_acceptance' => 'Утвърждаване',
'title' => 'Аксесоар',
);
@@ -1,15 +1,15 @@
<?php
return [
'not_found' => 'Asset Maintenance you were looking for was not found!',
'not_found' => 'Поддръжката на актив, която търсите не бе открита!',
'delete' => [
'confirm' => 'Are you sure you wish to delete this asset maintenance?',
'error' => 'There was an issue deleting the asset maintenance. Please try again.',
'success' => 'The asset maintenance was deleted successfully.'
'confirm' => 'Потвърдете изтриването на поддръжката на актив.',
'error' => 'Проблем при изтриването на поддръжка на актив. Моля опитайте отново.',
'success' => 'Поддръжката на актив изтрита успешно.'
],
'create' => [
'error' => 'Asset Maintenance was not created, please try again.',
'success' => 'Asset Maintenance created successfully.'
'error' => 'Поддръжката на актив не бе създадена. Моля опитайте отново.',
'success' => 'Поддръжката на актив създадена успешно.'
],
'asset_maintenance_incomplete' => 'Все още неприключила',
'warranty' => 'Гаранция',
@@ -6,4 +6,4 @@
'supplier_name' => 'Доставчик',
'is_warranty' => 'Гаранция',
'dl_csv' => 'Сваляне на CSV'
];
];
+11 -11
View File
@@ -1,22 +1,22 @@
<?php
return array(
'about_asset_categories' => 'About Asset Categories',
'about_categories' => 'Asset categories help you organize your assets. Some example categories might be &quot;Desktops&quot;, &quot;Laptops&quot;, &quot;Mobile Phones&quot;, &quot;Tablets&quot;, and so on, but you can use asset categories any way that makes sense for you.',
'asset_categories' => 'Asset Categories',
'about_asset_categories' => 'Относно категориите на активи',
'about_categories' => 'Категориите помагат организирането на активите. Примерни категории могат да бъдат &quot;Стационарни PC&quot;, &quot;Лаптопи&quot;, &quot;Мобилни телефони&quot;, &quot;Таблети&quot; и т.н., но можете да използвате всяка категория, имаща смисъл за организацията Ви.',
'asset_categories' => 'Категории на активи',
'category_name' => 'Име на категория',
'checkin_email' => 'Send email to user on checkin.',
'checkin_email' => 'Изпращане на email до потребителя при вписване на активи.',
'clone' => 'Копиране на категория',
'create' => 'Създаване на категория',
'edit' => 'Редакция на категория',
'eula_text' => 'Категория EULA',
'eula_text_help' => 'This field allows you to customize your EULAs for specific types of assets. If you only have one EULA for all of your assets, you can check the box below to use the primary default.',
'require_acceptance' => 'Require users to confirm acceptance of assets in this category.',
'required_acceptance' => 'This user will be emailed with a link to confirm acceptance of this item.',
'required_eula' => 'This user will be emailed a copy of the EULA',
'no_default_eula' => 'No primary default EULA found. Add one in Settings.',
'eula_text_help' => 'Това поле позволява да задавате различни EULA за всеки тип активи. Ако имате обща EULA за всички активи, можете да използвате кутийката по-долу за да използвате една обща по подразбиране.',
'require_acceptance' => 'Задължаване на потребителите да потвърждават приемането на активи от тази категория.',
'required_acceptance' => 'Потребителят ще получи email с връзка за потвърждаване получаването на актива.',
'required_eula' => 'Потребителят ще получи копие на EULA.',
'no_default_eula' => 'Няма EULA по подразбиране. Добавете я в Настройки.',
'update' => 'Обновяване на категория',
'use_default_eula' => 'Use the <a href="#" data-toggle="modal" data-target="#eulaModal">primary default EULA</a> instead.',
'use_default_eula_disabled' => '<del>Use the primary default EULA instead.</del> No primary default EULA is set. Please add one in Settings.',
'use_default_eula' => 'Използване на <a href="#" data-toggle="modal" data-target="#eulaModal">EULA по подразбиране</a>.',
'use_default_eula_disabled' => '<del>Използване на EULA по подразбиране</del> Няма EULA по подразбиране. Добавете я в Настройки.',
);
+4 -4
View File
@@ -3,15 +3,15 @@
return array(
'does_not_exist' => 'Категорията не съществува.',
'assoc_users' => '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_users' => 'Тази категория е асоциирана с поне един модел и не може да бъде изтрита. Моля обновете връзките с моделите и опитайте отново.',
'create' => array(
'error' => 'Category was not created, please try again.',
'success' => 'Category created successfully.'
'error' => 'Категорията не беше създадена. Моля опитайте отново.',
'success' => 'Категорията е създадена.'
),
'update' => array(
'error' => 'Category was not updated, please try again',
'error' => 'Категорията не беше обновена. Моля опитайте отново',
'success' => 'Категорията е обновена успешно.'
),
+1 -1
View File
@@ -3,7 +3,7 @@
return array(
'eula_text' => 'EULA',
'id' => 'ID',
'parent' => 'Parent',
'parent' => 'Горна категория',
'require_acceptance' => 'Утвърждаване',
'title' => 'Категория на актива',
@@ -4,7 +4,10 @@ return array(
'about_consumables_title' => 'Относно консумативите',
'about_consumables_text' => 'Консумативите са всички неща, купувани във времето. Например тонер за принтер или хартия.',
'consumable_name' => 'Консуматив',
'cost' => 'Стойност на закупуване',
'create' => 'Създаване на консуматив',
'date' => 'Дата на закупуване',
'order' => 'Номер на поръчка',
'remaining' => 'Остава',
'total' => 'Oбщо',
'update' => 'Обновяване на консуматив',
+14 -14
View File
@@ -2,34 +2,34 @@
return array(
'does_not_exist' => 'Consumable does not exist.',
'does_not_exist' => 'Консуматива не съществува.',
'create' => array(
'error' => 'Consumable was not created, please try again.',
'success' => 'Consumable created successfully.'
'error' => 'Консумативът не беше създаден. Моля опитайте отново.',
'success' => 'Консумативът създаден успешно.'
),
'update' => array(
'error' => 'Consumable was not updated, please try again',
'success' => 'Consumable updated successfully.'
'error' => 'Консумативът не беше обновен. Моля опитайте отново.',
'success' => 'Консумативът обновен успешно.'
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this accessory?',
'error' => 'There was an issue deleting the consumable. Please try again.',
'success' => 'The accessory was deleted successfully.'
'confirm' => 'Желаете ли изтриване на консуматива?',
'error' => 'Проблем при изтриването на консуматива. Моля опитайте отново.',
'success' => 'Консумативът изтрит успешно.'
),
'checkout' => array(
'error' => 'Consumable was not checked out, please try again',
'success' => 'Consumable checked out successfully.',
'user_does_not_exist' => 'That user is invalid. Please try again.'
'error' => 'Консумативът не беше изписан. Моля опитайте отново.',
'success' => 'Консумативът изписан успешно.',
'user_does_not_exist' => 'Невалиден потребител. Моля опитайте отново.'
),
'checkin' => array(
'error' => 'Consumable was not checked in, please try again',
'success' => 'Consumable checked in successfully.',
'user_does_not_exist' => 'That user is invalid. Please try again.'
'error' => 'Консумативът не беше вписан. Моля опитайте отново.',
'success' => 'Консумативът вписан успешно.',
'user_does_not_exist' => 'Невалиден потребител. Моля опитайте отново.'
)
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
return array(
'title' => 'Consumable Name',
'title' => 'Консуматив',
);
+6 -6
View File
@@ -2,11 +2,11 @@
return array(
'about_asset_depreciations' => 'Относно амортизацията на активи',
'about_depreciations' => 'You can set up asset depreciations to depreciate assets based on straight-line depreciation.',
'asset_depreciations' => 'Asset Depreciations',
'create_depreciation' => 'Create Depreciation',
'depreciation_name' => 'Depreciation Name',
'number_of_months' => 'Number of Months',
'update_depreciation' => 'Update Depreciation',
'about_depreciations' => 'Тук можете да конфигурирате линейна амортизация на активи във времето.',
'asset_depreciations' => 'Амортизация на активи',
'create_depreciation' => 'Създаване на амортизация',
'depreciation_name' => 'Амортизация',
'number_of_months' => 'Брой месеци',
'update_depreciation' => 'Обновяване на амортизация',
);
+9 -9
View File
@@ -2,24 +2,24 @@
return array(
'does_not_exist' => 'Depreciation class does not exist.',
'assoc_users' => 'This depreciation is currently associated with one or more models and cannot be deleted. Please delete the models, and then try deleting again. ',
'does_not_exist' => 'Амортизацията не съществува.',
'assoc_users' => 'Тази амортизация е асоциирана с един или повече модели и не може да бъде изтрита. Моля изтрийте моделите и опитайте отново.',
'create' => array(
'error' => 'Depreciation class was not created, please try again. :(',
'success' => 'Depreciation class created successfully. :)'
'error' => 'Класът на амортизация не беше създаден. Моля опитайте отново.',
'success' => 'Класът на амортизация създаден успешно.'
),
'update' => array(
'error' => 'Depreciation class was not updated, please try again',
'success' => 'Depreciation class updated successfully.'
'error' => 'Класът на амортизация не беше обновен. Моля опитайте отново.',
'success' => 'Класът на амортизация обновен успешно.'
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this depreciation class?',
'error' => 'There was an issue deleting the depreciation class. Please try again.',
'success' => 'The depreciation class was deleted successfully.'
'confirm' => 'Сигурни ли сте, че желаете изтриване на класът на амортизация?',
'error' => 'Проблем при изтриването на класа на амортизация. Моля опитайте отново.',
'success' => 'Класът на амортизация изтрит успешно.'
)
);
+10 -10
View File
@@ -2,21 +2,21 @@
return array(
'group_exists' => 'Group already exists!',
'group_not_found' => 'Group [:id] does not exist.',
'group_name_required' => 'The name field is required',
'group_exists' => 'Групата вече съществува!',
'group_not_found' => 'Групата [:id] не съществува.',
'group_name_required' => 'Полето име е задължително',
'success' => array(
'create' => 'Group was successfully created.',
'update' => 'Group was successfully updated.',
'delete' => 'Group was successfully deleted.',
'create' => 'Групата създадена успешно.',
'update' => 'Групата обновена успешно.',
'delete' => 'Групата изтрита успешно.',
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this group?',
'create' => 'There was an issue creating the group. Please try again.',
'update' => 'There was an issue updating the group. Please try again.',
'delete' => 'There was an issue deleting the group. Please try again.',
'confirm' => 'Сигурни ли сте, че желаете да изтриете групата?',
'create' => 'Проблем при създаване на групата. Моля опитайте отново.',
'update' => 'Проблем при обновяването на групата. Моля опитайте отново.',
'delete' => 'Проблем при изтриване на групата. Моля опитайте отново.',
),
);
+3 -3
View File
@@ -2,8 +2,8 @@
return array(
'id' => 'Id',
'name' => 'Name',
'users' => '# of Users',
'id' => 'ID',
'name' => 'Име',
'users' => 'Брой потребители',
);
+7 -7
View File
@@ -2,12 +2,12 @@
return array(
'group_management' => 'Group Management',
'create_group' => 'Create New Group',
'edit_group' => 'Edit Group',
'group_name' => 'Group Name',
'group_admin' => 'Group Admin',
'allow' => 'Allow',
'deny' => 'Deny',
'group_management' => 'Управление на групи',
'create_group' => 'Нова група',
'edit_group' => 'Редакция на група',
'group_name' => 'Име на група',
'group_admin' => 'Администратор на група',
'allow' => 'Разрешаване',
'deny' => 'Отказ',
);
+36 -36
View File
@@ -2,41 +2,41 @@
return array(
'bulk_update' => 'Bulk Update Assets',
'bulk_update_help' => 'This form allows you to update multiple assets at once. Only fill in the fields you need to change. Any fields left blank will remain unchanged. ',
'bulk_update_warn' => 'You are about to edit the properties of :asset_count assets.',
'checkedout_to' => 'Checked Out To',
'checkout_date' => 'Checkout Date',
'checkin_date' => 'Checkin Date',
'checkout_to' => 'Checkout to',
'cost' => 'Purchase Cost',
'create' => 'Create Asset',
'date' => 'Purchase Date',
'depreciates_on' => 'Depreciates On',
'depreciation' => 'Depreciation',
'default_location' => 'Default Location',
'eol_date' => 'EOL Date',
'eol_rate' => 'EOL Rate',
'expected_checkin' => 'Expected Checkin Date',
'expires' => 'Expires',
'fully_depreciated' => 'Fully Depreciated',
'help_checkout' => 'If you wish to assign this asset immediately, select "Ready to Deploy" from the status list above. ',
'mac_address' => 'MAC Address',
'manufacturer' => 'Manufacturer',
'model' => 'Model',
'months' => 'months',
'name' => 'Asset Name',
'notes' => 'Notes',
'order' => 'Order Number',
'qr' => 'QR Code',
'requestable' => 'Users may request this asset',
'select_statustype' => 'Select Status Type',
'serial' => 'Serial',
'status' => 'Status',
'supplier' => 'Supplier',
'tag' => 'Asset Tag',
'update' => 'Asset Update',
'warranty' => 'Warranty',
'years' => 'years',
'bulk_update' => 'Масово обновяване на активи',
'bulk_update_help' => 'Тук можете да обновите множество активи едновременно. Попълнете единствено полетата, които желаете да промените. Всички празни полета няма да бъдат променени.',
'bulk_update_warn' => 'Ще бъдат променени записите за :asset_count актива.',
'checkedout_to' => 'Изписано на',
'checkout_date' => 'Дата на изписване',
'checkin_date' => 'Дата на вписване',
'checkout_to' => 'Изпиши на',
'cost' => 'Стойност на закупуване',
'create' => 'Създаване на актив',
'date' => 'Дата на закупуване',
'depreciates_on' => 'Амортизира се на',
'depreciation' => 'Амортизация',
'default_location' => 'Местоположение по подразбиране',
'eol_date' => 'EOL дата',
'eol_rate' => 'EOL съотношение',
'expected_checkin' => 'Очаквана дата на вписване',
'expires' => 'Изтича',
'fully_depreciated' => 'Напълно амортизиран',
'help_checkout' => 'Ако желаете да присвоите актив на момента, изберете "Готово за предаване" от списъка по-горе.',
'mac_address' => 'MAC адрес',
'manufacturer' => 'Производител',
'model' => 'Модел',
'months' => 'месеца',
'name' => 'Име на актив',
'notes' => 'Бележки',
'order' => 'Номер на поръчка',
'qr' => 'QR код',
'requestable' => 'Потребителите могат да изписват актива',
'select_statustype' => 'Избиране на тип на статуса',
'serial' => 'Сериен номер',
'status' => 'Статус',
'supplier' => 'Доставчик',
'tag' => 'Инвентарен номер',
'update' => 'Обновяване на актив',
'warranty' => 'Гаранция',
'years' => 'години',
)
;
+15 -15
View File
@@ -1,19 +1,19 @@
<?php
return array(
'archived' => 'Archived',
'asset' => 'Asset',
'checkin' => 'Checkin Asset',
'checkout' => 'Checkout Asset to User',
'clone' => 'Clone Asset',
'deployable' => 'Deployable',
'deleted' => 'This asset has been deleted. <a href="/hardware/:asset_id/restore">Click here to restore it</a>.',
'edit' => 'Edit Asset',
'filetype_info' => 'Allowed filetypes are png, gif, jpg, jpeg, doc, docx, pdf, txt, zip, and rar.',
'model_deleted' => 'This Assets model has been deleted. You must restore the model before you can restore the Asset.<br/> <a href="/hardware/models/:model_id/restore">Click here to restore the model</a>.',
'requestable' => 'Requestable',
'restore' => 'Restore Asset',
'pending' => 'Pending',
'undeployable' => 'Undeployable',
'view' => 'View Asset',
'archived' => 'Архивиран',
'asset' => 'Актив',
'checkin' => 'Връщане на актив',
'checkout' => 'Изписване на актив към потребител',
'clone' => 'Копиране на актив',
'deployable' => 'Може да бъде предоставен',
'deleted' => 'Активът беше изтрит. <a href="/hardware/:asset_id/restore">Възстановяване</a>.',
'edit' => 'Редакция на актив',
'filetype_info' => 'Позволените типове файлове са png, gif, jpg, jpeg, doc, docx, pdf, txt, zip, и rar.',
'model_deleted' => 'Моделът актив беше изтрит.Необходимо е да възстановите моделът, преди да възстановите актива.<br/> <a href="/hardware/models/:model_id/restore">Възстановяване на модел</a>.',
'requestable' => 'Може да бъде изискван',
'restore' => 'Възстановяване на актив',
'pending' => 'Предстоящ',
'undeployable' => 'Не може да бъде предоставян',
'view' => 'Преглед на актив',
);
+26 -27
View File
@@ -2,57 +2,56 @@
return array(
'undeployable' => '<strong>Warning: </strong> This asset has been marked as currently undeployable.
If this status has changed, please update the asset status.',
'does_not_exist' => 'Asset does not exist.',
'does_not_exist_or_not_requestable' => 'Nice try. That asset does not exist or is not requestable.',
'assoc_users' => 'This asset is currently checked out to a user and cannot be deleted. Please check the asset in first, and then try deleting again. ',
'undeployable' => '<strong>Внимание:</strong> Този актив е маркиран като невъзможен за предоставяне. Ако статусът е променен, моля обновете актива.',
'does_not_exist' => 'Активът не съществува.',
'does_not_exist_or_not_requestable' => 'Добър опит. Активът не съществува или не може а бъде предоставян.',
'assoc_users' => 'Активът е изписан на потребител и не може да бъде изтрит. Моля впишете го обратно и след това опитайте да го изтриете отново.',
'create' => array(
'error' => 'Asset was not created, please try again. :(',
'success' => 'Asset created successfully. :)'
'error' => 'Активът не беше създаден. Моля опитайте отново.',
'success' => 'Активът създаден успешно.'
),
'update' => array(
'error' => 'Asset was not updated, please try again',
'success' => 'Asset updated successfully.',
'nothing_updated' => 'No fields were selected, so nothing was updated.',
'error' => 'Активът не беше обновен. Моля опитайте отново.',
'success' => 'Активът обновен успешно.',
'nothing_updated' => 'Няма избрани полета, съответно нищо не беше обновено.',
),
'restore' => array(
'error' => 'Asset was not restored, please try again',
'success' => 'Asset restored successfully.'
'error' => 'Активът не беше възстановен. Моля опитайте отново.',
'success' => 'Активът възстановен успешно.'
),
'deletefile' => array(
'error' => 'File not deleted. Please try again.',
'success' => 'File successfully deleted.',
'error' => 'Файлът не беше изтрит. Моля опитайте отново.',
'success' => 'Файлът изтрит успешно.',
),
'upload' => array(
'error' => 'File(s) not uploaded. Please try again.',
'success' => 'File(s) successfully uploaded.',
'nofiles' => 'You did not select any files for upload, or the file you are trying to upload is too large',
'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.',
'error' => 'Качването неуспешно. Моля опитайте отново.',
'success' => 'Качването успешно.',
'nofiles' => 'Не сте избрали файлове за качване или са твърде големи.',
'invalidfiles' => 'Един или повече файлове са твърде големи или с непозволен тип. Разрешените файлови типове за качване са png, gif, jpg, doc, docx, pdf и txt.',
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this asset?',
'error' => 'There was an issue deleting the asset. Please try again.',
'success' => 'The asset was deleted successfully.'
'confirm' => 'Сигурни ли сте, че желаете изтриване на актива?',
'error' => 'Проблем при изтриване на актива. Моля опитайте отново.',
'success' => 'Активът е изтрит успешно.'
),
'checkout' => array(
'error' => 'Asset was not checked out, please try again',
'success' => 'Asset checked out successfully.',
'user_does_not_exist' => 'That user is invalid. Please try again.'
'error' => 'Активът не беше изписан. Моля опитайте отново.',
'success' => 'Активът изписан успешно.',
'user_does_not_exist' => 'Невалиден потребител. Моля опитайте отново.'
),
'checkin' => array(
'error' => 'Asset was not checked in, please try again',
'success' => 'Asset checked in successfully.',
'user_does_not_exist' => 'That user is invalid. Please try again.'
'error' => 'Активът не беше вписан. Моля опитайте отново.',
'success' => 'Активът вписан успешно.',
'user_does_not_exist' => 'Невалиден потребител. Моля опитайте отново.'
)
);
+16 -15
View File
@@ -2,22 +2,23 @@
return array(
'asset_tag' => 'Asset Tag',
'asset_model' => 'Model',
'book_value' => 'Value',
'change' => 'In/Out',
'checkout_date' => 'Checkout Date',
'checkoutto' => 'Checked Out',
'diff' => 'Diff',
'dl_csv' => 'Download CSV',
'asset_tag' => 'Инвентарен номер',
'asset_model' => 'Модел',
'book_value' => 'Стойност',
'change' => 'Предоставяне',
'checkout_date' => 'Дата на изписване',
'checkoutto' => 'Изписан',
'diff' => 'Разлика',
'dl_csv' => 'Сваляне на CSV',
'eol' => 'EOL',
'id' => 'ID',
'location' => 'Location',
'purchase_cost' => 'Cost',
'purchase_date' => 'Purchased',
'serial' => 'Serial',
'status' => 'Status',
'title' => 'Asset ',
'days_without_acceptance' => 'Days Without Acceptance'
'location' => 'Местоположение',
'purchase_cost' => 'Стойност',
'purchase_date' => 'Закупен',
'serial' => 'Сериен номер',
'status' => 'Статус',
'title' => 'Актив ',
'image' => 'Device Image',
'days_without_acceptance' => 'Дни без да е предаден'
);
+23 -23
View File
@@ -2,27 +2,27 @@
return array(
'asset' => 'Asset',
'checkin' => 'Checkin',
'cost' => 'Purchase Cost',
'create' => 'Create License',
'date' => 'Purchase Date',
'depreciation' => 'Depreciation',
'expiration' => 'Expiration Date',
'maintained' => 'Maintained',
'name' => 'Software Name',
'no_depreciation' => 'Do Not Depreciate',
'notes' => 'Notes',
'order' => 'Order No.',
'purchase_order' => 'Purchase Order Number',
'reassignable' => 'Reassignable',
'remaining_seats' => 'Remaining Seats',
'seats' => 'Seats',
'serial' => 'Serial',
'supplier' => 'Supplier',
'termination_date' => 'Termination Date',
'to_email' => 'Licensed to Email',
'to_name' => 'Licensed to Name',
'update' => 'Update License',
'checkout_help' => 'You must check a license out to a hardware asset or a person. You can select both, but the owner of the asset must match the person you\'re checking the asset out to.'
'asset' => 'Актив',
'checkin' => 'Вписване',
'cost' => 'Стойност на закупуване',
'create' => 'Добавяне на лиценз',
'date' => 'Дата на закупуване',
'depreciation' => 'Амортизация',
'expiration' => 'Срок на валидност',
'maintained' => 'В поддръжка',
'name' => 'Софтуерен продукт',
'no_depreciation' => 'Без амортизация',
'notes' => 'Бележки',
'order' => 'Номер на заявка',
'purchase_order' => 'Номер на заявка за закупуване',
'reassignable' => 'Може да бъде сменян ползвателя',
'remaining_seats' => 'Оставащи потребителски лицензи',
'seats' => 'Потребителски лицензи',
'serial' => 'Сериен номер',
'supplier' => 'Доставчик',
'termination_date' => 'Дата на валидност',
'to_email' => 'Лиценз към e-mail',
'to_name' => 'Лиценз към име',
'update' => 'Обновяване на лиценз',
'checkout_help' => 'Можете да изпишете лиценз към конкретен хардуер или потребител. Един лиценз може да бъде изписан едновременно и на хардуер и на потребител, но потребителя трябва да бъде собственик на съответния хардуерен актив.'
);
+15 -15
View File
@@ -2,19 +2,19 @@
return array(
'checkin' => 'Checkin License Seat',
'checkout_history' => 'Checkout History',
'checkout' => 'Checkout License Seat',
'edit' => 'Edit License',
'filetype_info' => 'Allowed filetypes are png, gif, jpg, jpeg, doc, docx, pdf, txt, zip, and rar.',
'clone' => 'Clone License',
'history_for' => 'History for ',
'in_out' => 'In/Out',
'info' => 'License Info',
'license_seats' => 'License Seats',
'seat' => 'Seat',
'seats' => 'Seats',
'software_licenses' => 'Software Licenses',
'user' => 'User',
'view' => 'View License',
'checkin' => 'Вписване на потребителски лиценз',
'checkout_history' => 'История на изписванията',
'checkout' => 'Изписване на потребителски лиценз',
'edit' => 'Редакция на лиценз',
'filetype_info' => 'Позволените типове файлове са png, gif, jpg, jpeg, doc, docx, pdf, txt, zip, и rar.',
'clone' => 'Копиране на лиценз',
'history_for' => 'История за ',
'in_out' => 'Предоставяне',
'info' => 'Информация за лиценз',
'license_seats' => 'Потребителски лицензи',
'seat' => 'Потребителски лиценз',
'seats' => 'Потребителски лицензи',
'software_licenses' => 'Софтуерни лицензи',
'user' => 'Потребител',
'view' => 'Преглед на лиценз',
);
+22 -22
View File
@@ -2,49 +2,49 @@
return array(
'does_not_exist' => 'License does not exist.',
'user_does_not_exist' => 'User does not exist.',
'asset_does_not_exist' => 'The asset you are trying to associate with this license does not exist.',
'owner_doesnt_match_asset' => 'The asset you are trying to associate with this license is owned by somene other than the person selected in the assigned to dropdown.',
'assoc_users' => 'This license is currently checked out to a user and cannot be deleted. Please check the license in first, and then try deleting again. ',
'does_not_exist' => 'Лицензът не съществува.',
'user_does_not_exist' => 'Потребителят не съществува.',
'asset_does_not_exist' => 'Активът, който се опитвате да свържете с този лиценз не съществува.',
'owner_doesnt_match_asset' => 'Активът, който се опитвате да свържете с този лиценз е притежание на друго лице, различно от това, което е определено в падащия списък.',
'assoc_users' => 'Този лиценз понастоящем е изписан на потребител и не може да бъде изтрит. Моля, първо впишете лиценза и тогава опитайте отново да го изтриете. ',
'create' => array(
'error' => 'License was not created, please try again.',
'success' => 'License created successfully.'
'error' => 'Лицензът не беше създаден. Моля, опитайте отново.',
'success' => 'Лицензът е създаден.'
),
'deletefile' => array(
'error' => 'File not deleted. Please try again.',
'success' => 'File successfully deleted.',
'error' => 'Файлът не е изтрит. Моля, опитайте отново.',
'success' => 'Файлът е изтрит.',
),
'upload' => array(
'error' => 'File(s) not uploaded. Please try again.',
'success' => 'File(s) successfully uploaded.',
'nofiles' => 'You did not select any files for upload, or the file you are trying to upload is too large',
'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.',
'error' => 'Файлът (файловете) не е качен. Моля, опитайте отново.',
'success' => 'Файлът (файловете) е качен.',
'nofiles' => 'Не сте избрали файл за качване или файлът, който се опитвате да качите е твърде голям',
'invalidfiles' => 'Един или повече файлове са твърде големи или с неразрешен тип. Разрешените типове файлове са png, gif, jpg, doc, docx, pdf, и txt.',
),
'update' => array(
'error' => 'License was not updated, please try again',
'success' => 'License updated successfully.'
'error' => 'Лицензът не беше обновен. Моля, опитайте отново',
'success' => 'Лицензът е обновен.'
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this license?',
'error' => 'There was an issue deleting the license. Please try again.',
'success' => 'The license was deleted successfully.'
'confirm' => 'Сигурни ли сте, че искате да изтриете този лиценз?',
'error' => 'Възникна проблем при изтриването на този лиценз. Моля, опитайте отново.',
'success' => 'Лицензът е изтрит.'
),
'checkout' => array(
'error' => 'There was an issue checking out the license. Please try again.',
'success' => 'The license was checked out successfully'
'error' => 'Възникна проблем при изписването на лиценза. Моля, опитайте отново.',
'success' => 'Лицензът е изписан'
),
'checkin' => array(
'error' => 'There was an issue checking in the license. Please try again.',
'success' => 'The license was checked in successfully'
'error' => 'Възникна проблем при вписването на лиценза. Моля, опитайте отново.',
'success' => 'Лицензът е вписан'
),
);
+10 -10
View File
@@ -2,16 +2,16 @@
return array(
'assigned_to' => 'Assigned To',
'checkout' => 'In/Out',
'assigned_to' => 'Предоставен на',
'checkout' => 'Предоставяне',
'id' => 'ID',
'license_email' => 'License Email',
'license_name' => 'Licensed To',
'purchase_date' => 'Purchase Date',
'purchased' => 'Purchased',
'seats' => 'Seats',
'hardware' => 'Hardware',
'serial' => 'Serial',
'title' => 'License',
'license_email' => 'Лицензиран на Email',
'license_name' => 'Лицензиран на',
'purchase_date' => 'Дата на закупуване',
'purchased' => 'Закупен',
'seats' => 'Потребителски лицензи',
'hardware' => 'Хардуер',
'serial' => 'Сериен номер',
'title' => 'Лиценз',
);
+11 -11
View File
@@ -2,26 +2,26 @@
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. ',
'assoc_assets' => 'This location is currently associated with at least one asset and cannot be deleted. Please update your assets to no longer reference this location and try again. ',
'assoc_child_loc' => 'This location is currently the parent of at least one child location and cannot be deleted. Please update your locations to no longer reference this location and try again. ',
'does_not_exist' => 'Местоположението не съществува.',
'assoc_users' => 'Местоположението е свързано с поне един потребител и не може да бъде изтрито. Моля, актуализирайте потребителите, така че да не са свързани с това местоположение и опитайте отново. ',
'assoc_assets' => 'Местоположението е свързано с поне един актив и не може да бъде изтрито. Моля, актуализирайте активите, така че да не са свързани с това местоположение и опитайте отново. ',
'assoc_child_loc' => 'В избраното местоположение е присъединено едно или повече местоположения. Моля преместете ги в друго и опитайте отново.',
'create' => array(
'error' => 'Location was not created, please try again.',
'success' => 'Location created successfully.'
'error' => 'Местоположението не е създадено. Моля, опитайте отново.',
'success' => 'Местоположението е създадено.'
),
'update' => array(
'error' => 'Location was not updated, please try again',
'success' => 'Location updated successfully.'
'error' => 'Местоположението не е обновено. Моля, опитайте отново',
'success' => 'Местоположението е обновено.'
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this location?',
'error' => 'There was an issue deleting the location. Please try again.',
'success' => 'The location was deleted successfully.'
'confirm' => 'Сигурни ли сте, че искате да изтриете това местоположение?',
'error' => 'Възникна проблем при изтриване на местоположението. Моля, опитайте отново.',
'success' => 'Местоположението е изтрито.'
)
);
+8 -7
View File
@@ -1,17 +1,18 @@
<?php
return array(
'assets_rtd' => 'Бракувани активи',
'assets_checkedout' => 'Изписани активи',
'id' => 'ID',
'city' => 'Град',
'state' => 'Област',
'country' => 'Държава',
'create' => 'Create Location',
'update' => 'Update Location',
'name' => 'Location Name',
'create' => 'Създаване на местоположение',
'update' => 'Обновяване на местоположение',
'name' => 'Местоположение',
'address' => 'Aдрес',
'zip' => 'Пощенски код',
'locations' => 'Locations',
'parent' => 'Parent',
'currency' => 'Location Currency', // this is deprecated
'locations' => 'Местоположения',
'parent' => 'Присъединено към',
'currency' => 'Валута на местоположението',
);
+9 -9
View File
@@ -2,23 +2,23 @@
return array(
'does_not_exist' => 'Manufacturer does not exist.',
'assoc_users' => 'This manufacturer is currently associated with at least one model and cannot be deleted. Please update your models to no longer reference this manufacturer and try again. ',
'does_not_exist' => 'Несъществуващ производител.',
'assoc_users' => 'Този производител е асоцииран с поне един от моделите и не може да бъде изтрит. Моля, променете връзките на моделите по отношение на този производител и опитайте отново. ',
'create' => array(
'error' => 'Manufacturer was not created, please try again.',
'success' => 'Manufacturer created successfully.'
'error' => 'Производителят не беше създаден. Моля, опитайте отново.',
'success' => 'Производителят е създаден.'
),
'update' => array(
'error' => 'Manufacturer was not updated, please try again',
'success' => 'Manufacturer updated successfully.'
'error' => 'Производителят не е обновен. Моля, опитайте отново',
'success' => 'Производителят е обновен.'
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this manufacturer?',
'error' => 'There was an issue deleting the manufacturer. Please try again.',
'success' => 'The Manufacturer was deleted successfully.'
'confirm' => 'Сигурни ли сте, че искате да изтриете този производител?',
'error' => 'Възникна проблем при изтриването на проиводителя. Моля, опитайте отново.',
'success' => 'Производителят е изтрит.'
)
);
+4 -4
View File
@@ -2,10 +2,10 @@
return array(
'asset_manufacturers' => 'Asset Manufacturers',
'create' => 'Create Manufacturer',
'asset_manufacturers' => 'Производители',
'create' => 'Създаване на производител',
'id' => 'ID',
'name' => 'Manufacturer Name',
'update' => 'Update Manufacturer',
'name' => 'Име на производител',
'update' => 'Обновяване на производител',
);
+5 -5
View File
@@ -2,10 +2,10 @@
return array(
'deleted' => 'This model has been deleted. <a href="/hardware/models/:model_id/restore">Click here to restore it</a>.',
'restore' => 'Restore Model',
'show_mac_address' => 'Show MAC address field in assets in this model',
'view_deleted' => 'View Deleted',
'view_models' => 'View Models',
'deleted' => 'Моделът беше изтрит. <a href="/hardware/models/:model_id/restore">Възстановяване</a>.',
'restore' => 'Възстановяване на модел',
'show_mac_address' => 'Визуализиране на поле за MAC адрес в активите за този модел',
'view_deleted' => 'Преглед на изтритите',
'view_models' => 'Преглед на моделите',
);
+12 -12
View File
@@ -2,30 +2,30 @@
return array(
'does_not_exist' => 'Model does not exist.',
'assoc_users' => 'This model is currently associated with one or more assets and cannot be deleted. Please delete the assets, and then try deleting again. ',
'does_not_exist' => 'Моделът не съществува.',
'assoc_users' => 'Този модел е асоцииран с един или повече активи и не може да бъде изтрит. Моля изтрийте активите и опитайте отново.',
'create' => array(
'error' => 'Model was not created, please try again.',
'success' => 'Model created successfully.',
'duplicate_set' => 'An asset model with that name, manufacturer and model number already exists.',
'error' => 'Моделът не беше създаден. Моля опитайте отново.',
'success' => 'Моделът създаден успешно.',
'duplicate_set' => 'Актив с това име, производител и номер на модел вече е въведен.',
),
'update' => array(
'error' => 'Model was not updated, please try again',
'success' => 'Model updated successfully.'
'error' => 'Моделът не беше обновен. Моля опитайте отново.',
'success' => 'Моделът обновен успешно.'
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this asset model?',
'error' => 'There was an issue deleting the model. Please try again.',
'success' => 'The model was deleted successfully.'
'confirm' => 'Желаете ли изтриване на модела?',
'error' => 'Проблем при изтриване на модела. Моля опитайте отново.',
'success' => 'Моделът изтрит успешно.'
),
'restore' => array(
'error' => 'Model was not restored, please try again',
'success' => 'Model restored successfully.'
'error' => 'Моделът не беше възстановен. Моля опитайте отново.',
'success' => 'Моделът възстановен успешно.'
),
);
+8 -8
View File
@@ -2,16 +2,16 @@
return array(
'create' => 'Create Asset Model',
'created_at' => 'Created at',
'create' => 'Създаване на модел на актив',
'created_at' => 'Създаден в',
'eol' => 'EOL',
'modelnumber' => 'Модел №',
'name' => 'Asset Model Name',
'name' => 'Модел на актив',
'numassets' => 'Активи',
'title' => 'Модели на активи',
'update' => 'Update Asset Model',
'view' => 'View Asset Model',
'update' => 'Update Asset Model',
'clone' => 'Clone Model',
'edit' => 'Edit Model',
'update' => 'Обновяване на модел на актив',
'view' => 'Преглед на модел на актив',
'update' => 'Обновяване на модел на актив',
'clone' => 'Копиране на модел',
'edit' => 'Редакция на модел',
);
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
return array(
'info' => 'Select the options you want for your asset report.'
'info' => 'Изберете опциите, които желаете за справката за активи.'
);

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