Compare commits

...

368 Commits

Author SHA1 Message Date
snipe 9a84497fb0 Updated changelog 2016-01-21 19:37:30 -08:00
snipe e4cb237bfe Updated version for 2.1.0 2016-01-21 18:12:05 -08:00
snipe 28b89f3ddb Use location list helper for dropdown 2016-01-15 15:21:34 -08:00
snipe 9ad9e1d5a5 Fixes #1566 - use config url for upload images 2016-01-15 15:21:19 -08:00
snipe 39f40a3f6d Bumped version 2016-01-13 18:00:11 -08:00
snipe 0d3a4813ce Fixes #1631 - delete image on asset edit 2016-01-13 18:00:06 -08:00
snipe 51e480661d Fixes uploads directory for sub-dirctories 2016-01-13 17:59:48 -08:00
snipe 77632cdfb0 Allow optional status change on checkin 2016-01-13 08:04:52 -08:00
snipe 19d6f33770 RTD does NOT mean "Retired" - It means Ready to Deploy. 2016-01-13 07:51:40 -08:00
snipe c779034e41 Better fix for model uniqueness 2016-01-13 07:44:00 -08:00
snipe 8ff7a6ce21 Fixes #1572 - remove unique constraint for models 2016-01-13 07:41:11 -08:00
snipe 1908499379 Fixes #1626 - correctly show deleted models 2016-01-13 07:34:02 -08:00
snipe 348c8f62d1 Fixes #1610 - hide license keys if user doesn't have permission 2016-01-13 07:04:45 -08:00
snipe 7da0ffc325 Fixes #1623 - disallow admins to edit permissions on users 2016-01-13 06:51:56 -08:00
snipe 33b05b071d Shitty, hacky workaround for getting password managers to leave the form fields alone 2016-01-13 06:12:46 -08:00
snipe f98b4095a2 Better explanation of roles 2016-01-13 04:52:26 -08:00
snipe b30edfd9d6 Use locations dropdown 2016-01-13 04:50:55 -08:00
snipe b16ea61da8 Added license_keys as permission 2016-01-13 04:39:26 -08:00
snipe a5e2e7e285 Removed date field until I have time to handle this more efficiently 2016-01-13 04:11:23 -08:00
snipe 456e586e02 Bumped version 2016-01-13 03:58:08 -08:00
snipe 4c4e0ce5c5 Get assetlog with user 2016-01-13 03:58:01 -08:00
snipe 8ea23e6773 Hide extra fields by default (or else endless scrolling) 2016-01-13 03:57:28 -08:00
snipe c9feff0757 Fixes #1580 - license showing as asset in profile view 2016-01-13 03:56:28 -08:00
snipe f1b2ba5c51 Additional comments 2016-01-13 03:56:05 -08:00
snipe 76220b7884 Fixes #1601 - bulk update now honors un-requestable 2016-01-12 20:00:51 -08:00
snipe bb88b85a02 Removed erroneous blade that led to confusing UX 2016-01-11 18:48:49 -08:00
snipe dad816ba25 Removed debugging echo 2016-01-11 18:48:33 -08:00
snipe 4037200fad Additional fields for user import 2016-01-11 18:39:40 -08:00
snipe 326d0cc764 Bumped version 2016-01-11 18:17:01 -08:00
snipe 9800786485 Fixes #1597 and allows non-numeric employee number 2016-01-11 18:16:52 -08:00
snipe ce6b2f2e5f Merge pull request #1598 from ddreier/1597-ldap-email
Updated the LDAP import to get the correct email field setting.
2016-01-07 08:14:57 -08:00
Daniel Dreier 3e2fc13af5 Updated the LDAP import to get the correct email field setting. 2016-01-07 10:03:42 -06:00
snipe 73317f14a0 Bumped version 2016-01-06 21:05:11 -08:00
snipe 6bc2af6e71 Fix for missing company 2016-01-06 21:04:59 -08:00
snipe 962e7531a6 Fix for changing asset model from model with custom fields to one without 2016-01-06 18:04:55 -08:00
snipe e8e8e8f4f3 Bugfix for importer not recognizing existing entries with quotes 2016-01-06 16:21:10 -08:00
snipe 218fe72e16 Fixes #1500: Use the currency setting rather than the localization label 2016-01-05 19:45:40 -08:00
snipe 2b13641661 Fixes #1574 - added Chinese Yuan 2016-01-05 19:33:14 -08:00
snipe 66fe626d51 Fixes #1560 - added AED 2016-01-05 19:31:46 -08:00
snipe ca9ab681b9 Update url for #1566 2016-01-05 19:26:37 -08:00
snipe 0f07f12d35 Merge pull request #1582 from merid14/patch-1
Patch for #1561
2016-01-05 15:16:48 -07:00
snipe 03efe0b3e2 Merge pull request #1585 from snipe/null_custom_fieldset_ok
Allow setting 'no custom fields' from having a customfieldset enabled
2016-01-05 14:56:58 -07:00
Brady Wetherington d7b91d88d6 Allow setting 'no custom fields' from having a customfieldset enabled
in a model.
2016-01-05 13:53:09 -08:00
snipe 298a938db2 Fix for company scoping bug 2016-01-05 13:20:49 -08:00
snipe 6c389298f8 Suppress errors when the file doesn't exist 2016-01-05 13:20:38 -08:00
snipe d4685ec037 Merge branch 'develop' of github.com:snipe/snipe-it into develop 2016-01-05 13:12:57 -08:00
snipe 602501b4a3 Bumped version 2016-01-05 13:12:14 -08:00
snipe e93aebc27b Make first user a super admin 2016-01-05 13:09:55 -08:00
Brady Wetherington e392c87250 Experimental fix for Company scope issue. 2016-01-05 13:08:14 -08:00
Walter 2707742518 Patch for #1561
Added -p back to the db setup to provide password input. #1561
2016-01-05 09:16:59 -05:00
snipe 738dc1fdf0 Bumped version to 2.1.0-pre 2015-12-30 17:08:34 -08:00
snipe 6f04cf9f61 Merge pull request #1554 from snipe/final_custom_fields_tweaks
Final custom fields tweaks
2015-12-30 16:32:16 -08:00
Brady Wetherington 4be3f2700c Make this migration run correctly in the past, before the schema has been changed 2015-12-30 16:23:13 -08:00
Brady Wetherington 4cb0e40abb Eager-Load CustomFieldsets and CustomFields with relations 2015-12-30 16:08:40 -08:00
Brady Wetherington ad144e127c Pertains to one of the elements in #1397 - timestamps and user_id's for Custom Fields 2015-12-30 15:58:51 -08:00
snipe 2f4e54c8a6 Merge remote-tracking branch 'origin/develop' 2015-12-30 15:47:00 -08:00
snipe 7c06cba647 More LDAP login fixes 2015-12-30 14:53:49 -08:00
snipe 5eb506b9c3 Bumped version 2015-12-30 12:57:55 -08:00
snipe 4aa376826f Added dashboard back as string 2015-12-30 12:57:49 -08:00
snipe 1d9e014bfa More auth tweaks :( 2015-12-30 12:57:41 -08:00
snipe 506af72d83 Superadmin check in bulk delete users 2015-12-29 20:03:08 -08:00
snipe 1ce205a579 Fixes #1502 - load tableexport and jquery base64 locally 2015-12-29 19:45:46 -08:00
snipe a7a82e5fbc Fixes #1541 2015-12-29 19:41:50 -08:00
snipe 23da312fff Put deleted_at back in users collection for restore functionality 2015-12-29 19:35:31 -08:00
snipe faf2e464fa Fixes #1526 2015-12-29 19:32:15 -08:00
snipe 79c5d3f7d6 Fixes #1537 and #1524 2015-12-29 19:21:54 -08:00
snipe 2888103d1a More updates for #1433
This is a paired down version of the previous auth. Rather than trying to authenticatr with Sentry at every turn, check for valid LDAP and then once all those LDAP additions/updates are set, then try to auth with the credentials the user provided.
2015-12-29 19:12:22 -08:00
snipe f89176d500 WTF I don't even. 2015-12-29 18:48:06 -08:00
snipe 5eb95272ee Merge pull request #1546 from snipe/docker_fix_2
Enable/Disable SSL based on existence of SSL cert data
2015-12-29 16:46:14 -08:00
Brady Wetherington 6c7e265921 Enable/Disable SSL based on existence of SSL cert data 2015-12-29 16:41:54 -08:00
snipe 76955ec064 Merge branch 'develop' of github.com:snipe/snipe-it into develop 2015-12-29 15:46:52 -08:00
snipe de9a15a33b Bumped version 2015-12-29 15:46:37 -08:00
snipe f9cf2b2558 Updated translations 2015-12-29 15:46:20 -08:00
snipe e4627cee96 Updated language 2015-12-29 15:41:18 -08:00
snipe 36eb51d6e4 Fixed typo in string 2015-12-29 15:41:05 -08:00
snipe 689832036e Merge pull request #1517 from dmeltzer/for-asset-maintence-and-consum
Fix Asset Maintenance date and consumable counts
2015-12-29 15:10:14 -08:00
snipe 8cfcb2aed8 Merge pull request #1544 from snipe/docker_fix_2
Docker fix 2
2015-12-29 15:08:59 -08:00
Brady Wetherington 27962d5439 Merge branch 'develop' into docker_fix_2 2015-12-29 12:36:45 -08:00
Brady Wetherington f4af607d1a Point instead to the formal documentation, instead of having it here. 2015-12-29 12:35:14 -08:00
snipe 90340a7111 Merge pull request #1535 from dmeltzer/fix-1531-proper
Clear checkout and checkin fields when returning an asset.
2015-12-29 11:38:07 -08:00
snipe 8742bf26b4 Merge pull request #1521 from twistedR/enhancement/ldap-self-signed-cert-support
Add option to allow ignoring SSL Cert verification.
2015-12-29 11:34:07 -08:00
snipe 8eb31a9a82 Merge pull request #1523 from thehereward/fix-up-some-php-docs
Fix PHPDocs that contained incorrect params tags.
2015-12-29 11:32:50 -08:00
snipe aeeb273d4c Merge pull request #1423 from thehereward/develop
TidyUp: Remove unreachable code.
2015-12-29 10:15:36 -08:00
Daniel Meltzer 5f6ba2a148 Clear the expected checkin and last checkout dates when checking an item back in. Fixes #1531 2015-12-28 12:41:24 -05:00
Hereward Mills 0cb3a9265e Fix PHPDocs that contained incorrect params tags. 2015-12-24 11:20:05 +00:00
Raveesh 96a5f437f2 Add option to allow ignoring SSL Cert verification. 2015-12-24 02:17:06 -05:00
Daniel Meltzer 4b92cdf684 Use the same values/calculations in the view as the index. Should fix #1140 I believe 2015-12-23 20:32:48 -05:00
Daniel Meltzer 50be3eed4a Fix Two issues with Asset Maintenance.
1) If a start and end date were given when creating an asset, asset_maintenance_time was not set.
2) AssetMaintenancesController::getDataTable would return 'time' instead of 'asset_maintenance_time', causing the field not to display.
2015-12-23 20:02:20 -05:00
Daniel Meltzer 3b7da8f379 Fix consumable count in categories. This adds new methods to Category, consumables consumablesCount and a generic count. It also refactors CatgoriesController to use the count method rather than having it determine the category type. 2015-12-23 20:02:09 -05:00
snipe 90b00b02cc Merge pull request #1516 from dmeltzer/develop
Add Company name to Asset Importer.  Tested on one set of data.
2015-12-22 13:32:24 -08:00
Daniel Meltzer 9eee73d2e5 I accidentallyied a bracket. 2015-12-22 16:24:21 -05:00
snipe 6639bc1300 Fix overwriting of username if no first/last name 2015-12-22 13:21:51 -08:00
Daniel Meltzer e272cab82f Add Company name to Asset Importer. Tested on one set of data. 2015-12-22 16:13:30 -05:00
snipe 5967dbae64 Company helper, updated bulk view to show model number 2015-12-22 11:39:42 -08:00
snipe f42a3c8918 Added company to bulk edit 2015-12-22 11:12:26 -08:00
snipe d3b3ed0d16 Merge branch 'develop' of github.com:snipe/snipe-it into develop 2015-12-22 10:56:37 -08:00
snipe 0484924490 Merge pull request #1513 from adamdunson/quantity_is_misspelled
Quantity is misspelled
2015-12-22 10:55:34 -08:00
Adam Dunson 894579314c s/([Qq])uanitity/\1uantity/g 2015-12-22 11:11:11 -05:00
snipe b76f014669 Better handling for invalid locations 2015-12-22 02:40:31 -08:00
snipe f03d1cd4cc Simplified currency display until we can fix it on a broader level 2015-12-22 00:25:30 -08:00
snipe a0db241ac8 Merge pull request #1504 from ddreier/1143-acceptance-by-incorrect-user
Added check and error message for trying to accept an asset that was not checked out to that user.
2015-12-18 16:18:34 -05:00
Daniel Dreier 0c27717c20 Added check and error message for trying to accept an asset that was not
checked out to that user.
2015-12-18 14:51:51 -06:00
snipe ce1565a545 Re-commented mac address - bad merge :-/ 2015-12-18 12:08:08 -05:00
snipe ac5527e7d3 Merge branch 'hotfixes/custom_reports_fix' into develop 2015-12-18 12:06:35 -05:00
snipe 865468d091 Fix for location error 2015-12-18 12:06:11 -05:00
snipe b20f4d245e Fixes #1494 - uncommented mac_address fields 2015-12-17 20:09:47 -05:00
snipe 927c368235 Fix for weird location info in asset report 2015-12-17 19:37:20 -05:00
snipe eacd4ee2b0 Fix for bad data in asset report 2015-12-17 18:59:58 -05:00
snipe 8dab50edc6 Fixes #1498 - better regex for characters in custom field name 2015-12-17 18:19:35 -05:00
snipe ee097dd1da Bumped version 2015-12-15 05:36:04 -08:00
snipe 775ea95458 Fix inability to edit models (unique constraint) 2015-12-15 05:35:14 -08:00
snipe 73f0a19adb Fixes #1459 - fieldset_id error if null 2015-12-15 05:34:54 -08:00
snipe a68cbcf767 Fixes #1472 - only fire DB seeder if the user inputs 'y' 2015-12-15 05:24:15 -08:00
snipe 5c698d7cfd Fixes #1469 - don't require currency at model level 2015-12-15 05:17:44 -08:00
snipe efc06f4b31 Bumped version 2015-12-15 04:15:51 -08:00
snipe bac1b313f6 Added the 2x2 gif to stop stupid 404s 2015-12-15 04:15:42 -08:00
snipe cac254ded6 Fixes #1371 - problem saving new models with non-latin characters 2015-12-15 04:15:28 -08:00
snipe e217d354dc Fixed bug in strict mode for fieldsets 2015-12-15 04:14:19 -08:00
snipe e1837069da Allow bulk model update for #1462, fixes #1442 2015-12-09 20:35:24 -08:00
snipe eb83d9c486 Add header banner if app is running in production mode with debug on 2015-12-09 16:37:34 -08:00
snipe 25338c00e5 Fixes #1456 - email notification when asset requested 2015-12-09 01:40:13 -08:00
snipe 599ea20d65 Fixes #1449 - full link to order number 2015-12-09 01:06:25 -08:00
snipe 72f3b459c5 Merge branch 'hotfixes/user_import_company_id' into develop
Conflicts:
	app/config/version.php
2015-12-08 23:00:27 -08:00
snipe c34c9438da Bumped version 2015-12-08 22:59:33 -08:00
snipe 3d8733c612 Comment out company ID for now until we can handle it more smartly 2015-12-08 22:59:22 -08:00
snipe cab1642ead Small extra logging for LDAP 2015-12-08 21:06:54 -08:00
Hereward Mills 6aa3e21b4c TidyUp: Surpress errors on unreachable statements with link to discussion on github. 2015-12-04 08:09:01 +00:00
snipe b1e48b7054 More debugging 2015-12-03 13:33:28 -08:00
snipe 2686dd640c Additional debugging info 2015-12-03 13:30:56 -08:00
snipe bb7b8f3964 Show error if LDAP failed and local auth failed because user doesn't exist 2015-12-03 04:14:05 -08:00
snipe 5bed0bd7ed Fixes #1437 - set expected checkout correctly 2015-12-03 03:14:29 -08:00
snipe be3c8e4515 Fixes #1440 - make employee number searchable/sortable 2015-12-03 02:07:20 -08:00
snipe 784d1995d8 Added auth login log note 2015-12-03 02:06:34 -08:00
snipe 7802af837b One more fix for LDAP and local users working together 2015-12-02 22:47:22 -08:00
snipe 6f8a76246e LDAP fix for local users 2015-12-02 21:22:56 -08:00
snipe 66e9203b97 Save fieldset on create 2015-12-02 19:21:09 -08:00
snipe b41461698d Fix for error on asset create 2015-12-02 19:03:08 -08:00
Brady Wetherington 8cdb032a14 Fixes error messages, and re-filling old input on failed asset create 2015-12-02 17:57:28 -08:00
snipe 3417d833ba Save on create for custom fields 2015-12-02 17:12:17 -08:00
snipe aff7b99d91 Nicer add/edit formatting putting required fields at the top 2015-12-02 16:31:57 -08:00
snipe 3944553bfc Commented out show_mac_address field in model creation 2015-12-02 16:11:45 -08:00
snipe 3dc79197c3 Fix for LDAP error if username is wrong 2015-12-02 15:59:01 -08:00
snipe f1b00853c6 Final localization and UI improvemets for #1397 2015-12-02 15:21:18 -08:00
snipe 7f46a48173 Attempting to fix #1430 - commented out FK drop to prevent collisions, remove FK creation for new installs 2015-12-02 13:59:20 -08:00
snipe ae8c9f420d Set table engine specifically to InnoDB
It's declasse to alter migrations after the fact, but for some folks with MyISAM set as a default
2015-12-02 12:23:54 -08:00
snipe aa385571cf Additional refinements for #1397 2015-12-01 20:50:54 -08:00
snipe 9920cb2744 Nicer detail view for #1397 2015-12-01 18:17:02 -08:00
snipe 179f96c8e8 More strings for #1397 2015-12-01 18:16:44 -08:00
snipe 7562552f7a More UI nice-ifications for #1397 2015-12-01 17:56:03 -08:00
snipe 5f9d5ae836 More laguage strings for #1397 2015-12-01 17:55:42 -08:00
snipe 639d6214d8 Switch to fa-icons from glyphicon 2015-12-01 17:55:02 -08:00
snipe dad492d131 Fixed back/cancel urls for #1397 2015-12-01 17:33:31 -08:00
snipe 6e78fc0a2d Merge pull request #1427 from snipe/ajax_custom_fields_asset
Add new form partial and AJAX endpoint for custom fields.
2015-12-01 17:27:11 -08:00
snipe e98020fa89 Starter UI improvements and localization for #1397 2015-12-01 17:26:20 -08:00
Brady Wetherington 6ec4f605f4 Handle selecting 'no model' without JS errors. 2015-12-01 17:22:09 -08:00
Brady Wetherington e88f5629df Add new form partial and AJAX endpoint for custom fields. 2015-12-01 17:17:32 -08:00
snipe 475fc4855c Merge pull request #1414 from madd15/patch-6
Fix incorrect routes for update and delete in Asset Maintenance
2015-12-01 14:38:17 -08:00
madd15 edb2a0b1b7 Readd <nobr> 2015-12-02 07:49:47 +10:30
snipe e81fe52aa8 Merge branch 'hotfixes/asset_maintenances_create' into develop 2015-12-01 11:59:49 -08:00
snipe 74ed75dd24 Fixes #1426 - use Asset class for asset maintenances 2015-12-01 11:59:10 -08:00
snipe 17e681ba7c Merge branch 'hotfixes/backup_CSRF' into develop
# Conflicts:
#	app/config/version.php
2015-12-01 11:47:56 -08:00
snipe 4e065e8df7 Bumped version 2015-12-01 11:47:27 -08:00
snipe 9e0f7089c4 Fixes #1415 - Added CSRF token to backup form 2015-12-01 11:47:13 -08:00
snipe c22dcdafa4 Show used in column regardless for Custom Fields 2015-12-01 04:16:31 -08:00
snipe e5cc6d32d1 More small UI tweaks for Custom Fields
Still lots of work to be done here, this is just a rough improvement
2015-12-01 04:14:36 -08:00
snipe 54655faf83 Bumped version 2015-12-01 04:11:13 -08:00
snipe 3b42738a2d Custom field enhancements for UI 2015-12-01 04:11:01 -08:00
snipe 65feb00ea4 Merge pull request #1420 from snipe/delete_custom_fields
Deletion support for fields and fieldsets
2015-12-01 03:12:41 -08:00
snipe 82a3560f27 Merge branch 'hotfixes/image_fix' into develop 2015-11-30 22:02:32 -08:00
snipe e8ca98a37d Fixes issue with assets without a model (which should never happen, but can occur from imports) 2015-11-30 22:01:42 -08:00
Brady Wetherington 9316af7ed8 Deletion support for fields and fieldsets 2015-11-30 17:09:57 -08:00
snipe bbdb576519 Merge branch 'hotfixes/remove_fk' into develop
# Conflicts:
#	app/config/version.php
2015-11-30 12:28:14 -08:00
snipe 43c26f853b Bumped version 2015-11-30 12:27:25 -08:00
snipe 1cd7f10f10 Remove foreign key constraint for #1411 2015-11-30 12:27:06 -08:00
snipe e4ceddd6ce Fix for merge conflict on routes 2015-11-30 10:19:37 -08:00
madd15 bb83a14707 Fix incorrect routes for update and delete 2015-11-30 12:41:37 +10:30
snipe fffc8ed644 Merge pull request #1412 from snipe/same_field_twice
Custom Fields - shouldn't be able to add the same field twice to the same fieldset
2015-11-29 17:25:11 -08:00
snipe c6db29e6c4 Merge pull request #1408 from snipe/custom_fields_adminify
Custom fields adminify
2015-11-29 17:24:54 -08:00
snipe 948e9c2a2b Merge branch 'develop' into custom_fields_adminify
# Conflicts:
#	app/routes.php
2015-11-29 17:24:26 -08:00
snipe 62fe4b8cd3 Merge branch 'hotfixes/1403' into develop 2015-11-29 17:20:42 -08:00
snipe 9b46a5b0f6 Fixes #1403 - hide checkout on asset model listing assets when nt deployable 2015-11-29 17:20:03 -08:00
snipe 8158c12242 Merge branch 'hotfixes/EOL' into develop
# Conflicts:
#	app/controllers/admin/AssetsController.php
2015-11-29 17:11:55 -08:00
snipe 36ecf3032f Fixes #1402 - remoe warranty date from EOL calc 2015-11-29 17:09:02 -08:00
snipe 19820db0cc Fixes #1406 - Fixes link to suppliers delete 2015-11-29 16:55:30 -08:00
snipe fc06caded5 Fixes #1406 - Fixes link to suppliers delete 2015-11-29 16:54:48 -08:00
snipe a44c56c937 Merge branch 'hotfixes/fix_1413' into develop
# Conflicts:
#	app/config/version.php
#	app/models/Company.php
2015-11-29 16:49:34 -08:00
snipe 2accfab79e Fixes #1413 - wrong link for manufacturers delete 2015-11-29 16:45:55 -08:00
Brady Wetherington 418be7f5de Fix to adding same custom field twice. Helps with #1397. Requires
PR #1408 to be merged first.
2015-11-29 13:16:03 -08:00
Brady Wetherington beeb28bf09 Fix routes for custom fields, fix admin access. Helps with #1397 2015-11-28 18:18:53 -08:00
snipe 92410ba054 Bumped version 2015-11-26 14:12:06 -08:00
snipe 078750726f Set default value for company_id to fix seeder 2015-11-26 14:11:56 -08:00
snipe 7d2ae0d10d CSRF for ajax 2015-11-26 14:11:38 -08:00
snipe d8a9d2d3eb Bumped version 2015-11-26 14:08:24 -08:00
snipe b925c5766f Set company_id to null if no logged in user to fix seeder 2015-11-26 14:03:29 -08:00
snipe 6bedaa903a CSRF token for ajax 2015-11-26 13:53:51 -08:00
Brady Wetherington 4f3cdc20f5 Start of moving custom fields to the /admin/ space 2015-11-26 13:47:09 -08:00
snipe 1efb1f7038 Remove MAC address fields since they are now custom fields 2015-11-26 13:42:13 -08:00
snipe 6708911d5d Remove mac address (now custom field) 2015-11-26 13:33:01 -08:00
snipe 3bbcbf5f47 Merge branch 'hotfixes/ldap_settings' into develop 2015-11-26 13:11:47 -08:00
snipe 989ce59a5b Fixes #1399 - Import LDAP config into database 2015-11-26 13:10:28 -08:00
snipe 774b1cb28b Merge pull request #1398 from snipe/custom_fields_erroring
Custom fields erroring
2015-11-25 20:45:02 -08:00
Brady Wetherington 10086479b7 Better erroring, return previous input on error. 2015-11-25 20:38:22 -08:00
Brady Wetherington c0e988b6b1 Basic validation on customFieldset 2015-11-25 20:14:26 -08:00
snipe 93cf37336d Merge pull request #1277 from snipe/custom_fields
Basic custom fields support - needs UI refinements
2015-11-25 19:14:53 -08:00
Brady Wetherington 924f61fce9 Cache custom field listing for assets, custom fields are sortable 2015-11-25 16:09:16 -08:00
Brady Wetherington c6f8d3e6f2 A little bit of basic, terrible navigation for Custom Fields. 2015-11-25 15:40:58 -08:00
Brady Wetherington a212abee1d Strip out stale comments 2015-11-25 15:30:06 -08:00
Brady Wetherington 4508225d65 Add default layout basic styling to custom fields 2015-11-25 15:16:20 -08:00
Brady Wetherington e3ec2ae3ec Style the drop-down for custom fieldset to match 2015-11-25 14:55:49 -08:00
Brady Wetherington d653126a2a Merge branch 'develop' into custom_fields
Conflicts:
	app/controllers/admin/AssetsController.php
	app/views/backend/hardware/index.blade.php
	app/views/backend/hardware/view.blade.php
2015-11-25 14:22:22 -08:00
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
Bjarne K 31c4a63ec0 Added copy for apache SSL file and commands to enable SSL in apache 2015-11-20 11:55:57 +01: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
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
bmk a8e686cdf7 added SSL config for apache 2015-11-18 15:58:17 +01: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
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 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
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
Brady Wetherington 6d365157e7 Changed to using Entrypoint instead of CMD for better start/stop 2015-11-12 21:50:58 -08:00
Brady Wetherington 3a99136f73 More documentation fixes 2015-11-12 21:14:10 -08:00
Brady Wetherington 50170dd774 Improve start script, add entrypoint script 2015-11-12 20:05:39 -08:00
Brady Wetherington 5e1bec71f2 Start to move README over to emphasize running docker pull snipe/snipe-it 2015-11-12 14:07:05 -08:00
Brady Wetherington d73134f32d Merge branch 'develop' into docker_enhancements 2015-11-12 13:44:40 -08: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
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
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
Brady Wetherington a955d57c20 When edit blade is used for New Asset, need to account for no model
being selected.
2015-10-22 11:21:15 -07:00
Brady Wetherington 63eca44789 Custom fields can be shown on the hardware list page. They can also
be searched for.
2015-10-22 03:33:27 -07:00
Brady Wetherington a67951fbce Merge branch 'develop' into custom_fields
Conflicts:
	app/controllers/admin/AssetsController.php
	app/views/backend/hardware/index.blade.php
2015-10-22 02:30:30 -07:00
Brady Wetherington 0f6de6a477 Asset editing works. 2015-10-22 01:06:35 -07:00
Brady Wetherington 5890d26545 Terribly rough Custom Fields creation 2015-10-22 00:38:07 -07:00
Brady Wetherington 20c35fd0bb Okay, most migrations are kinda-sorta working now, but validations aren't 2015-10-20 20:26:18 -07:00
Brady Wetherington bdc0619016 Merge branch 'develop' into custom_fields
Conflicts:
	app/helpers.php
2015-10-20 17:11:04 -07:00
Brady Wetherington 273d838a42 Wide swing at custom fields 2015-10-20 17:06:07 -07:00
Brady Wetherington 22ea008bb4 New documentation on Docker method of running Snipe-IT. New environment
variables available to customize how Snipe-IT ought to work under
Docker. Locale, timezone, and custom-URL support. Documentation pushes
users to move more towards 'env-files' rather than environment variables.

Fixes #1020
2015-09-21 16:44:17 -07:00
Brady Wetherington 86c620df3d Typo in the word 'language' 2015-09-21 16:41:48 -07:00
Brady Wetherington 4b68efb80b use CustomModel; is stupid, and doesn't mean anything. 2015-08-12 15:52:25 -07:00
Brady Wetherington 2645acd827 First stab at custom fields - model side only, to start 2015-07-06 20:09:47 -07:00
516 changed files with 12975 additions and 3590 deletions
+183 -61
View File
@@ -1,5 +1,132 @@
### v2.1.0-pre - Released Dec 31, 2015 12:32:16
#### This is a pre-release
* <a href="http://github.com/snipe/snipe-it/commit/3a99136f73ec5589c9b9e0bae29a16e6418f62a7">view</a> &bull; More documentation fixes
* <a href="http://github.com/snipe/snipe-it/commit/989ce59a5b63eea0e25a2bb7917b44c14d0f6235">view</a> &bull; Fixes #1399 - Import LDAP config into database
* <a href="http://github.com/snipe/snipe-it/commit/3bbcbf5f47e95ef031d521ff840a0ba7197356ed">view</a> &bull; Merge branch 'hotfixes/ldap_settings' into develop
* <a href="http://github.com/snipe/snipe-it/commit/b925c5766f15d678702ad2ae245cc76a66b235ec">view</a> &bull; Set company_id to null if no logged in user to fix seeder
* <a href="http://github.com/snipe/snipe-it/commit/078750726fd5f1f2d8ea35e25b366a95d15d7075">view</a> &bull; Set default value for company_id to fix seeder
* <a href="http://github.com/snipe/snipe-it/commit/beeb28bf09a36604820ae111b3e171aec3746444">view</a> &bull; Fix routes for custom fields, fix admin access. Helps with #1397
* <a href="http://github.com/snipe/snipe-it/commit/418be7f5dee1224526bf9037cc6d3ab464cacca2">view</a> &bull; Fix to adding same custom field twice. Helps with #1397. Requires PR #1408 to be merged first.
* <a href="http://github.com/snipe/snipe-it/commit/2accfab79ede9fd3905d0ed383b5a50999340944">view</a> &bull; Fixes #1413 - wrong link for manufacturers delete
* <a href="http://github.com/snipe/snipe-it/commit/a44c56c93713a8de20981e0a876b579b5845f6ff">view</a> &bull; Merge branch 'hotfixes/fix_1413' into develop
* <a href="http://github.com/snipe/snipe-it/commit/fc06caded5c6d8c2554146f986752ad1fe2e1e5a">view</a> &bull; Fixes #1406 - Fixes link to suppliers delete
* <a href="http://github.com/snipe/snipe-it/commit/19820db0cc41086971c9458dc5c8f0ca37a90777">view</a> &bull; Fixes #1406 - Fixes link to suppliers delete
* <a href="http://github.com/snipe/snipe-it/commit/36ecf3032f0bd9e37054898912469c6efd83529a">view</a> &bull; Fixes #1402 - remoe warranty date from EOL calc
* <a href="http://github.com/snipe/snipe-it/commit/8158c12242b5f2f37488a5db9cffefd0b5ec52ef">view</a> &bull; Merge branch 'hotfixes/EOL' into develop
* <a href="http://github.com/snipe/snipe-it/commit/9b46a5b0f6f19543d4799dd88673695445317650">view</a> &bull; Fixes #1403 - hide checkout on asset model listing assets when nt deployable
* <a href="http://github.com/snipe/snipe-it/commit/62fe4b8cd391cadf690be4a27ec4bd7eea017165">view</a> &bull; Merge branch 'hotfixes/1403' into develop
* <a href="http://github.com/snipe/snipe-it/commit/bb83a1470744fe94fa8793f6b1af3bfee8613042">view</a> &bull; Fix incorrect routes for update and delete
* <a href="http://github.com/snipe/snipe-it/commit/e4ceddd6ce246d5864b075a1dd0c1f891ef2f8b1">view</a> &bull; Fix for merge conflict on routes
* <a href="http://github.com/snipe/snipe-it/commit/bbdb576519ab8f73a24ca6082c9172ddafdca665">view</a> &bull; Merge branch 'hotfixes/remove_fk' into develop
* <a href="http://github.com/snipe/snipe-it/commit/e8ca98a37d744a899dcd77360b9590ae99950301">view</a> &bull; Fixes issue with assets without a model (which should never happen, but can occur from imports)
* <a href="http://github.com/snipe/snipe-it/commit/82a3560f276353a2eccdb6be69f559ff9908f2c5">view</a> &bull; Merge branch 'hotfixes/image_fix' into develop
* <a href="http://github.com/snipe/snipe-it/commit/9e0f7089c46dcec72d0b24f35f2ef4ef96c6823c">view</a> &bull; Fixes #1415 - Added CSRF token to backup form
* <a href="http://github.com/snipe/snipe-it/commit/17e681ba7c72647288f0777daeaf6a96a1e72767">view</a> &bull; Merge branch 'hotfixes/backup_CSRF' into develop
* <a href="http://github.com/snipe/snipe-it/commit/74ed75dd24fbaa69589e7bb8e89f68a8fce28a66">view</a> &bull; Fixes #1426 - use Asset class for asset maintenances
* <a href="http://github.com/snipe/snipe-it/commit/e81fe52aa8b60c13d8d477db1fa6df6d6690ff0d">view</a> &bull; Merge branch 'hotfixes/asset_maintenances_create' into develop
* <a href="http://github.com/snipe/snipe-it/commit/dad492d131b2fb4c9ac83433661706addd92d623">view</a> &bull; Fixed back/cancel urls for #1397
* <a href="http://github.com/snipe/snipe-it/commit/7f46a48173c2a65f2aee5aae0af22bab3e8714f8">view</a> &bull; Attempting to fix #1430 - commented out FK drop to prevent collisions, remove FK creation for new installs
* <a href="http://github.com/snipe/snipe-it/commit/3dc79197c3140528f2443107c7f3757ede66d7c2">view</a> &bull; Fix for LDAP error if username is wrong
* <a href="http://github.com/snipe/snipe-it/commit/8cdb032a14b92b79f52514d0c806d602cc47db12">view</a> &bull; Fixes error messages, and re-filling old input on failed asset create
* <a href="http://github.com/snipe/snipe-it/commit/b41461698ddc316d80fde921a7be0d69ae4df909">view</a> &bull; Fix for error on asset create
* <a href="http://github.com/snipe/snipe-it/commit/6f8a76246ec014457452109ac07c6aa98b478996">view</a> &bull; LDAP fix for local users
* <a href="http://github.com/snipe/snipe-it/commit/7802af837b2894b04c8ad690aeb7053f632f7767">view</a> &bull; One more fix for LDAP and local users working together
* <a href="http://github.com/snipe/snipe-it/commit/be3c8e451522988bfd6f19767061a538dcc248e2">view</a> &bull; Fixes #1440 - make employee number searchable/sortable
* <a href="http://github.com/snipe/snipe-it/commit/5bed0bd7ed3415a58833218b59a81b061712671a">view</a> &bull; Fixes #1437 - set expected checkout correctly
* <a href="http://github.com/snipe/snipe-it/commit/72f3b459c5172fb30865c6d708ecd57d0ff1eee8">view</a> &bull; Merge branch 'hotfixes/user_import_company_id' into develop
* <a href="http://github.com/snipe/snipe-it/commit/599ea20d65695e3e3cd5dfd929003c3c39620968">view</a> &bull; Fixes #1449 - full link to order number
* <a href="http://github.com/snipe/snipe-it/commit/25338c00e50d854a62ee86240489cf23d178302b">view</a> &bull; Fixes #1456 - email notification when asset requested
* <a href="http://github.com/snipe/snipe-it/commit/e1837069da97f1dfcbbd0007c2eda0ddd1ee3d2e">view</a> &bull; Allow bulk model update for #1462, fixes #1442
* <a href="http://github.com/snipe/snipe-it/commit/e217d354dc3b5d078a91cff7a9d6e9ba11bd55c8">view</a> &bull; Fixed bug in strict mode for fieldsets
* <a href="http://github.com/snipe/snipe-it/commit/cac254ded6685ef1e087b803e28cd14ff93047ca">view</a> &bull; Fixes #1371 - problem saving new models with non-latin characters
* <a href="http://github.com/snipe/snipe-it/commit/5c698d7cfd4e0bb93e1c1483e41504057397a2c5">view</a> &bull; Fixes #1469 - don't require currency at model level
* <a href="http://github.com/snipe/snipe-it/commit/a68cbcf7674a315268ec082386db30199e97f211">view</a> &bull; Fixes #1472 - only fire DB seeder if the user inputs 'y'
* <a href="http://github.com/snipe/snipe-it/commit/73f0a19adbf595f82e6110dec7eb685181dc0993">view</a> &bull; Fixes #1459 - fieldset_id error if null
* <a href="http://github.com/snipe/snipe-it/commit/775ea9545824c2bf1bc55b0e7a5423dcec66caa1">view</a> &bull; Fix inability to edit models (unique constraint)
* <a href="http://github.com/snipe/snipe-it/commit/8dab50edc64a59cbdae2c424fb36678ea4852324">view</a> &bull; Fixes #1498 - better regex for characters in custom field name
* <a href="http://github.com/snipe/snipe-it/commit/eacd4ee2b09b21b465947b0acae2292cf54e1982">view</a> &bull; Fix for bad data in asset report
* <a href="http://github.com/snipe/snipe-it/commit/927c36823526e68a83e2898033fea1ebe0112b4a">view</a> &bull; Fix for weird location info in asset report
* <a href="http://github.com/snipe/snipe-it/commit/b20f4d245e39d640aac3de9b34c2c79b855f06f4">view</a> &bull; Fixes #1494 - uncommented mac_address fields
* <a href="http://github.com/snipe/snipe-it/commit/865468d0910a39d0a891de3225e383e6afd08ead">view</a> &bull; Fix for location error
* <a href="http://github.com/snipe/snipe-it/commit/ac5527e7d30c3df805302a92c3d8d48bf54c6cb5">view</a> &bull; Merge branch 'hotfixes/custom_reports_fix' into develop
* <a href="http://github.com/snipe/snipe-it/commit/f03d1cd4ccc1d47b4b6297b7a2c6bcbbfc686e87">view</a> &bull; Simplified currency display until we can fix it on a broader level
* <a href="http://github.com/snipe/snipe-it/commit/6639bc1300163f5e4c079101682b27a5ef33f8e6">view</a> &bull; Fix overwriting of username if no first/last name
* <a href="http://github.com/snipe/snipe-it/commit/3b7da8f379ca9e57a07c968bcf0917b4dae7daa4">view</a> &bull; Fix consumable count in categories. This adds new methods to Category, consumables consumablesCount and a generic count. It also refactors CatgoriesController to use the count method rather than having it determine the category type.
* <a href="http://github.com/snipe/snipe-it/commit/50be3eed4abce136af1e244402893f7cff389e3f">view</a> &bull; Fix Two issues with Asset Maintenance.
* <a href="http://github.com/snipe/snipe-it/commit/4b92cdf684cf64958bc2b1f1194fa6ad2a67dcd7">view</a> &bull; Use the same values/calculations in the view as the index. Should fix #1140 I believe
* <a href="http://github.com/snipe/snipe-it/commit/0cb3a9265e0eb46294f2bd534e672dc226ce11ca">view</a> &bull; Fix PHPDocs that contained incorrect params tags.
* <a href="http://github.com/snipe/snipe-it/commit/5f6ba2a1480a9383c10c5222e368b6c219f4bd2c">view</a> &bull; Clear the expected checkin and last checkout dates when checking an item back in. Fixes #1531
* <a href="http://github.com/snipe/snipe-it/commit/8eb31a9a820ce2033a585b35d7d17d618e6aa831">view</a> &bull; Merge pull request #1523 from thehereward/fix-up-some-php-docs
* <a href="http://github.com/snipe/snipe-it/commit/90340a71119ab72b45c34a4a328877d363cabae1">view</a> &bull; Merge pull request #1535 from dmeltzer/fix-1531-proper
* <a href="http://github.com/snipe/snipe-it/commit/27962d5439ccd587dfbb945149693cf81a6cb944">view</a> &bull; Merge branch 'develop' into docker_fix_2
* <a href="http://github.com/snipe/snipe-it/commit/8cfcb2aed8a69070686f2d23f8b6c7fcf4596797">view</a> &bull; Merge pull request #1544 from snipe/docker_fix_2
* <a href="http://github.com/snipe/snipe-it/commit/36eb51d6e484586c9da3b90dc86fac6774e22218">view</a> &bull; Fixed typo in string
* <a href="http://github.com/snipe/snipe-it/commit/5eb95272eeac1183fe47972e7d8cf01976efe3a0">view</a> &bull; Merge pull request #1546 from snipe/docker_fix_2
* <a href="http://github.com/snipe/snipe-it/commit/79c5d3f7d69ac34e98e1b4e925ced54b1ab2f612">view</a> &bull; Fixes #1537 and #1524
* <a href="http://github.com/snipe/snipe-it/commit/faf2e464faff6fb2ac8decd3889d1c60bfcf954f">view</a> &bull; Fixes #1526
* <a href="http://github.com/snipe/snipe-it/commit/a7a82e5fbcab028c618b40d839a121325508490e">view</a> &bull; Fixes #1541
* <a href="http://github.com/snipe/snipe-it/commit/1ce205a5798be9b69d8750af9bb0fa7c96752a1e">view</a> &bull; Fixes #1502 - load tableexport and jquery base64 locally
* <a href="http://github.com/snipe/snipe-it/commit/7c06cba6477dc7e7902841b48ffb3089bd198a8e">view</a> &bull; More LDAP login fixes
### v2.0.6 - Released Nov 25, 2015 11:50:08
* <a href="http://github.com/snipe/snipe-it/commit/ac44140d835da40b44193ddfdbe2af0539a6aa5d">view</a> &bull; fix edit blades
* <a href="http://github.com/snipe/snipe-it/commit/999910f31fac58f1d7b1e5b45de296e911c88e6e">view</a> &bull; Fix 'use' used with non-compound
* <a href="http://github.com/snipe/snipe-it/commit/6478425be6fa02322aac276bd31c0bc6472b7fd3">view</a> &bull; Fix dashboard shows all companies
* <a href="http://github.com/snipe/snipe-it/commit/0a97c626e7955af7240b8084f90b249daf53a5e7">view</a> &bull; Fix $inout used when undefined
* <a href="http://github.com/snipe/snipe-it/commit/8fb7d82babd8deb136e71734e3a7fa37d2b05b08">view</a> &bull; Fix no admin/consumables route
* <a href="http://github.com/snipe/snipe-it/commit/08781a561b828198b62cf14a8f2608f23a52c3ef">view</a> &bull; Fix: use global scope for companies support
* <a href="http://github.com/snipe/snipe-it/commit/dbdc2c8e64b8d27ac3111d2308c0582b05992561">view</a> &bull; Fix some typos (e.g: companayable)
* <a href="http://github.com/snipe/snipe-it/commit/fe44846c1ba583156358de48fefe3ed3e63ef8f6">view</a> &bull; Fix: only super users can change multiple companies support option
* <a href="http://github.com/snipe/snipe-it/commit/e91a22fce0232ffd24976c214b12a7ff784d60ff">view</a> &bull; Fix assumeng Setting::getSettings() is not null in Company
* <a href="http://github.com/snipe/snipe-it/commit/e82ede5d44000ee337fad329cf5ac18052cfe52b">view</a> &bull; Fix: some Company functions throw when seeding the DB
* <a href="http://github.com/snipe/snipe-it/commit/67a58221eb93ffb6a1e827ab1dc745c27e8d81fe">view</a> &bull; Fixes #1368 - typos in installer
* <a href="http://github.com/snipe/snipe-it/commit/cc930fc5b8bcfdf972b35fb9460c0b2c82a1e9d0">view</a> &bull; Fixed links to getting help and common issues
* <a href="http://github.com/snipe/snipe-it/commit/01b574069af2ae8cda5ab9716de58d8e39a3da79">view</a> &bull; Fixes #1362 - status labels losing type on edit
* <a href="http://github.com/snipe/snipe-it/commit/7a03a5649863bc44af2459abf1d9fcfe0ffad21a">view</a> &bull; Fix: company field required
* <a href="http://github.com/snipe/snipe-it/commit/4b926f015b5b69c4e3180e996ab489e179589be5">view</a> &bull; fixed typo in installer
* <a href="http://github.com/snipe/snipe-it/commit/318b4b48c64e2dbfcbbbf9f024e9f6b20bc7a0db">view</a> &bull; Fixes null value for LDAP settings
* <a href="http://github.com/snipe/snipe-it/commit/9ec132acde7238963ffb3cb042e65e49e929eb7c">view</a> &bull; Small fixed for LDAP in settings table
* <a href="http://github.com/snipe/snipe-it/commit/120c8394bbc0141a2ca6d2cd7124d8fbad459073">view</a> &bull; Fixes #1380 - groups pagination
* <a href="http://github.com/snipe/snipe-it/commit/716c459985c78301998fe60fc8c274edb4f945c0">view</a> &bull; Fix ident
* <a href="http://github.com/snipe/snipe-it/commit/b99c138cb040c92e6988c40307bd871514fb39f8">view</a> &bull; Fixes #1369 - fixed searching/sorting on location
* <a href="http://github.com/snipe/snipe-it/commit/a777499c0bec415566c9360b6239600c9d6d0f74">view</a> &bull; Fixes #1376 - added new fields to consumables view
* <a href="http://github.com/snipe/snipe-it/commit/6d42d2c6142075124c453b75315db1b0fca0fdc9">view</a> &bull; Fixed bootstrap class for button
* <a href="http://github.com/snipe/snipe-it/commit/a3dbd87f9ffacc0ac1f48f758f87316bab831fe6">view</a> &bull; Fixed weird company table styles
* <a href="http://github.com/snipe/snipe-it/commit/2a28c73845e5e90947e207392c4b7b12e7e91e7c">view</a> &bull; Importer fixes - check for asset before inserting
* <a href="http://github.com/snipe/snipe-it/commit/c8c755f8c35983adaad6a3ba1868021acb2e3583">view</a> &bull; Fixed filename renaming
* <a href="http://github.com/snipe/snipe-it/commit/29bb6a3c4f839e96f79d02473221673aed401898">view</a> &bull; Fixed issue where deleted asset tags could not be re-used
* <a href="http://github.com/snipe/snipe-it/commit/535263788dac198cf79562efe7df4671fd1e755b">view</a> &bull; Fixed dumb indenting
* <a href="http://github.com/snipe/snipe-it/commit/4be046a6753315fb88858ea264acec10d66b4938">view</a> &bull; Fixes #1387 - adds server-side compound search
* <a href="http://github.com/snipe/snipe-it/commit/406e077c1e1a279c588e1506c2ce75f1e79dbbb1">view</a> &bull; Fixed indenting
* <a href="http://github.com/snipe/snipe-it/commit/67e968b03276d563a920a09cd4cec5258e62d016">view</a> &bull; Fixed attach() timestamps
* <a href="http://github.com/snipe/snipe-it/commit/b39c53a5ea355c91d5ef4adf1a03a342697039ae">view</a> &bull; Closes #1375 - More data in consumables detail view
* <a href="http://github.com/snipe/snipe-it/commit/d8b43215b0109ab7f548a0dc46dee3d12a271a77">view</a> &bull; Fix for missing admin ID
* <a href="http://github.com/snipe/snipe-it/commit/c6c6bd02bb32a22da7d30a0cca81516f99a9f5b0">view</a> &bull; Possible fix for weird UTF-8 issues
* <a href="http://github.com/snipe/snipe-it/commit/99391d01796bfe6b1e63e8e979fa010397405236">view</a> &bull; Fixes #1332 - added location to accessories
* <a href="http://github.com/snipe/snipe-it/commit/632fa92f9239d7f701efd29461ebf24746246be8">view</a> &bull; Fixes #1333 - hide checkout button if asset status is not deployable
* <a href="http://github.com/snipe/snipe-it/commit/20490986c634c7fa260fd952a7311ca18aae8605">view</a> &bull; Fixes #1325 - zenbra striping and borders on table for money value clarity
### v2.0.5 - Released Nov 18, 2015 10:29:53
* <a href="http://github.com/snipe/snipe-it/commit/67e0e14a12d49fc190daae553332a6c008f89314">view</a> &bull; License importer, small fixes for asset imporer
* <a href="http://github.com/snipe/snipe-it/commit/5df26f9b0ae7708e2f221ee873126bf1d7cd91dc">view</a> &bull; Fixed the ubuntu install portion that i broke
* <a href="http://github.com/snipe/snipe-it/commit/958672dfd36d220ea242d7772626916c748063e3">view</a> &bull; Fixed missing vars and typos
* <a href="http://github.com/snipe/snipe-it/commit/0d1544c3d65bf27a3e64e8ec258fb8dfaf961438">view</a> &bull; Fixing some package issues and syntax errors
* <a href="http://github.com/snipe/snipe-it/commit/56b50468d2bc14d33dbad17357664cd68937ee00">view</a> &bull; fixed packages for centos6
* <a href="http://github.com/snipe/snipe-it/commit/62cee46a83d9d9dcf9e12884563918bab0adb61a">view</a> &bull; update webdir for debian and fix the error logs
* <a href="http://github.com/snipe/snipe-it/commit/ca1384504a6a3802cea8bacc7fce2413f65a3681">view</a> &bull; fixed tzone variable assignment
* <a href="http://github.com/snipe/snipe-it/commit/a47a4e83e2fb90fb7e6d55c34ca9d515f4316c7e">view</a> &bull; fixed issues with sed command and /
* <a href="http://github.com/snipe/snipe-it/commit/9f43b6af9f355f6d8de6b5b9689ffdb6904fd5eb">view</a> &bull; fixed apache config file
* <a href="http://github.com/snipe/snipe-it/commit/306d8ebaf72076cbccadae7d214eed68276d65f5">view</a> &bull; Fixes #1317 - regression issue in bulk delete
* <a href="http://github.com/snipe/snipe-it/commit/a8da68d3fda0be7d8533dcecadbe758d24bacf12">view</a> &bull; Fixes #1320 - added name for cookie table
* <a href="http://github.com/snipe/snipe-it/commit/b9c36f863833188bd0462d809985bd876f36c6d7">view</a> &bull; Fixes #1335 - editing maintenance
* <a href="http://github.com/snipe/snipe-it/commit/aa05d041bd7abd193ea580c0928326d4855b522f">view</a> &bull; Fixes #1324 - missing $inout variable when if/else not met
* <a href="http://github.com/snipe/snipe-it/commit/2b26fd7e20e0636cee068a7804eb82ece780f5a2">view</a> &bull; Fixed string in gh-changelog
### v2.0.5-pre - Released Nov 04, 2015 11:42:37
#### This is a pre-release
* <a href="http://github.com/snipe/snipe-it/commit/679b9f6def461ae5e2c0fa1223368d5838ac2945">view</a> &bull; Small EOL fix
@@ -91,6 +218,8 @@
* <a href="http://github.com/snipe/snipe-it/commit/46fb12f5dcd5a37e8aecdf585ee892c6816f2bb0">view</a> &bull; Fixed acceptance suite yaml to make it work for travis-ci as well as local testing
* <a href="http://github.com/snipe/snipe-it/commit/33178adeedb37773c7b830582b167d1b5063127c">view</a> &bull; Fixed issue in travis yaml file
* <a href="http://github.com/snipe/snipe-it/commit/1fadabaf2f4a15ffdd26d426fb814d970b7e62f4">view</a> &bull; Fixed stupid mistake in the travis yaml file
* <a href="http://github.com/snipe/snipe-it/commit/1bed711f0e7462d5b4875b8c014d15690648049d">view</a> &bull; Another tweak getting closer
* <a href="http://github.com/snipe/snipe-it/commit/41c257829ed8d7019b5fe4761fcdf7560167cc74">view</a> &bull; Another tweak - getting close
* <a href="http://github.com/snipe/snipe-it/commit/1927f131aa1e59f81caf35999eaaab2bd0dc1f14">view</a> &bull; Fix broken Docker build
* <a href="http://github.com/snipe/snipe-it/commit/49e898fd263cc1fb7fb80dcb7aa11058c305ed21">view</a> &bull; Merge pull request #1122 from irasnyd/docker-fixes
* <a href="http://github.com/snipe/snipe-it/commit/dd2b9e15a60c402be914747979e27ca8a7c1c496">view</a> &bull; Fix #1109 - Asset names are missing when viewing user history
@@ -100,6 +229,8 @@
* <a href="http://github.com/snipe/snipe-it/commit/00aba507f7a4f5daaa57b9ccd5e7730bb5e9f63d">view</a> &bull; Fixed acceptance suite yaml to make it work for travis-ci as well as local testing
* <a href="http://github.com/snipe/snipe-it/commit/be402a9d7d3d039666f1c8110b8d1e1697d28092">view</a> &bull; Fixed issue in travis yaml file
* <a href="http://github.com/snipe/snipe-it/commit/b1d6d4da3777505d51310780fe393a874a24358e">view</a> &bull; Fixed stupid mistake in the travis yaml file
* <a href="http://github.com/snipe/snipe-it/commit/f836f88e38fb4bb0b682d301081254bb59923bf6">view</a> &bull; Another tweak getting closer
* <a href="http://github.com/snipe/snipe-it/commit/309ce7d0bd6758c186d9f002ebc9924b72542f4f">view</a> &bull; Another tweak - getting close
* <a href="http://github.com/snipe/snipe-it/commit/7bd5ddc516cc3130f4eb5e7ac53a7c9d4e67be87">view</a> &bull; Fixes incorrect title for unaccepted assets report
@@ -562,67 +693,6 @@
### v1.2.0 - Released Jan 22, 2015 09:24:01
* <a href="http://github.com/snipe/snipe-it/commit/8699a90093bd27c0502dcc25f6e7d55344d54a3b">view</a> &bull; Fixed changelog
* <a href="http://github.com/snipe/snipe-it/commit/cff24309a1514f9ea991881ca72898c7a6358562">view</a> &bull; Possibly fixes #343
* <a href="http://github.com/snipe/snipe-it/commit/b2d5dc9ec5460ff1f02db6c1a31ea87d224de4c9">view</a> &bull; Fix #342
* <a href="http://github.com/snipe/snipe-it/commit/74ae2fceea68d18514e87edc008cb3016361beee">view</a> &bull; Fix class on th
* <a href="http://github.com/snipe/snipe-it/commit/fc2d472ed350d7d63fb97942d00a97b62d4bed55">view</a> &bull; Fixed english language string
* <a href="http://github.com/snipe/snipe-it/commit/89c7159c56f88bcf8459a5eb02d79d636335cb28">view</a> &bull; Fix array check for empty rows
* <a href="http://github.com/snipe/snipe-it/commit/7ddc6d497af13e7894031ac763939be9863889a4">view</a> &bull; Fix Report Langs
* <a href="http://github.com/snipe/snipe-it/commit/13b173409fcd5b5ce8e79566b5110eadcf51c233">view</a> &bull; Fix License form langs
* <a href="http://github.com/snipe/snipe-it/commit/b73ae3147a60b29ac455063ecf419a609cce2cac">view</a> &bull; Fixes #362, reduced asset name to 2 char min
* <a href="http://github.com/snipe/snipe-it/commit/637009054cc74b17e2dd226c6f8c467eed5b0962">view</a> &bull; Fixed typo in english
* <a href="http://github.com/snipe/snipe-it/commit/6905d82fc48998f9c95c454c8bf37a34e30c002e">view</a> &bull; Fixes #374 to keep the requirement to PHP 5.4
* <a href="http://github.com/snipe/snipe-it/commit/102481631330fbed894bf72510845bff6c88e59e">view</a> &bull; Fix #377 - Checkout users last_name, first_name
* <a href="http://github.com/snipe/snipe-it/commit/d6a0249c60cbb026b2e3190285d50723a76f22ee">view</a> &bull; Fixed #373 - added ability to auto-increment asset tags
* <a href="http://github.com/snipe/snipe-it/commit/1b41c974cf67c550b2cae39eeec8f90cb2da79e0">view</a> &bull; Fixes #348 - remove constraints on license keys
* <a href="http://github.com/snipe/snipe-it/commit/89a2b87e42c18b308835ef71d196b91002b451ef">view</a> &bull; Fixes #367 - added model number to dropdown
* <a href="http://github.com/snipe/snipe-it/commit/64c16a0bacfcde7c4d92971f2129f1b1aeac2c0e">view</a> &bull; Fixes #386 and #273 - altered column type to text
* <a href="http://github.com/snipe/snipe-it/commit/daefc86e5878a21f9909806599f22198360c1f9b">view</a> &bull; Formattig fixes for #386
* <a href="http://github.com/snipe/snipe-it/commit/73dd339772fcc35e50603ded115f67714620da69">view</a> &bull; Fix #388 - License not showing checked out in view
* <a href="http://github.com/snipe/snipe-it/commit/0663ccb99fa926ff944dded330ba1f0cd95abbb3">view</a> &bull; Check if ->adminuser->id isset before trying to print the fullName so we can catch when a user that created an asset has been deleted. Fixes #349
* <a href="http://github.com/snipe/snipe-it/commit/533be7f942cb6dfccd1e8a79c043d61791e4c54b">view</a> &bull; fixed #435. using namespace with route groups to increase the readability
* <a href="http://github.com/snipe/snipe-it/commit/e434616db83a8d693af63b4705e1b24476fc3c17">view</a> &bull; Merge pull request #436 from rashivkp/fix-435
* <a href="http://github.com/snipe/snipe-it/commit/5e496672c66428a1bbd37772aabd44f8bb1cb0fa">view</a> &bull; Fixes #469
* <a href="http://github.com/snipe/snipe-it/commit/3c141e8f5017e8f161b6fd1fb82b288283b8450c">view</a> &bull; Fixes #467
* <a href="http://github.com/snipe/snipe-it/commit/548de1a1a217e6b5c6fcbbf6cd4918f078e64542">view</a> &bull; Fixes #468 - updated ordering on license checkout
### v1.1 - Released Nov 06, 2014 02:16:26
* <a href="http://github.com/snipe/snipe-it/commit/fafd03f00f49cb9ffe81d50aa9ca3d1f1fa1d043">view</a> &bull; Added DB Prefix to Migrations
* <a href="http://github.com/snipe/snipe-it/commit/309772e67d62989f1f60141a4a10d724a44c6baa">view</a> &bull; Fixed operator for setting bool display
* <a href="http://github.com/snipe/snipe-it/commit/22f81912e416cfe1227a08b5d8b6323e32e1ef36">view</a> &bull; Fixes #299
* <a href="http://github.com/snipe/snipe-it/commit/86b7b6946f1e1bd404127e228c615e4abe0b20fb">view</a> &bull; Fixes #316 - added model name back to view
* <a href="http://github.com/snipe/snipe-it/commit/9e85dcb9fcb4cc932ecddd23caa6b51e83110543">view</a> &bull; Fixes #315 - add EOL as display option in settings (run migrations)
* <a href="http://github.com/snipe/snipe-it/commit/ee35948980c22f9256241c02d7febd90275f6229">view</a> &bull; fix div issues
* <a href="http://github.com/snipe/snipe-it/commit/0022389463e251e73402450cfbc280cb05633bd1">view</a> &bull; Fix dropdown menu position
* <a href="http://github.com/snipe/snipe-it/commit/343798d241172707145ef365445062db9bb6b99a">view</a> &bull; Merge pull request #322 from madd15/fix-js-delete-asset
* <a href="http://github.com/snipe/snipe-it/commit/1078dbf5c5f6a5bec1a2ef864cebfcc7883d31e6">view</a> &bull; Fixes #324
* <a href="http://github.com/snipe/snipe-it/commit/6b2d3efe3e76429c9c2f5de78f04c4f7e2748a3d">view</a> &bull; Fixes #237 - reporting-only group
* <a href="http://github.com/snipe/snipe-it/commit/e04cc806d9209b54a1833172ebb66ab55b5f0c06">view</a> &bull; Fixes #327
### v1.0 - Released Oct 16, 2014 09:46:47
* <a href="http://github.com/snipe/snipe-it/commit/a4b220d6c31c97f6504023f0b52527825a4cd897">view</a> &bull; Fixed #191 - allow admins to assign a user during asset creation
* <a href="http://github.com/snipe/snipe-it/commit/dc1033025a0bc1b2d657e06c89058c3ab95f2c59">view</a> &bull; Fixed #151 - more complete translations
* <a href="http://github.com/snipe/snipe-it/commit/56d619b218794b43d8c6b182c89c75f83af9dcd9">view</a> &bull; Fixed missing language string
* <a href="http://github.com/snipe/snipe-it/commit/69fca5d1eda0e5f26d2085f7eebc08fafd84a3ae">view</a> &bull; Fixed #58
* <a href="http://github.com/snipe/snipe-it/commit/8197e6174e9f12bcfddd94c6bf606ee36e6801bf">view</a> &bull; Fixes #200
* <a href="http://github.com/snipe/snipe-it/commit/cb8369e9de96aaf1cf9108e22f4038fa6486b881">view</a> &bull; Initial QA Patch to fix errors Add License Add Asset Show Deleted Users License Assign
* <a href="http://github.com/snipe/snipe-it/commit/62a3ed671bbd957075563933f49e8a5445042737">view</a> &bull; DB migration, layout and clone fixes
* <a href="http://github.com/snipe/snipe-it/commit/9ccc7d756f9361757eafc1dce9684ee9f5ecc1c3">view</a> &bull; A0.4.2: Added asset, license, user, model cloning and fixed some bugs.
* <a href="http://github.com/snipe/snipe-it/commit/652f1c746c4757dce9d33d7bd90a9357822c4656">view</a> &bull; Fixes Travis CI build
* <a href="http://github.com/snipe/snipe-it/commit/363d084bd623f778cd72ca7d385a4fb2f67ef474">view</a> &bull; Fixed DB name in travis CI
* <a href="http://github.com/snipe/snipe-it/commit/49c5607e1c8a82a3111123ad84b537644546ebb3">view</a> &bull; Fixes #222
* <a href="http://github.com/snipe/snipe-it/commit/96e40d72b9ac3f74b94b0e39b6f296f0f0b2a1f4">view</a> &bull; fix typo: artisand -> artisan
* <a href="http://github.com/snipe/snipe-it/commit/e978038cc044f60c2eca71b6319063009a57886f">view</a> &bull; Merge pull request #234 from burlito/typo-fix
* <a href="http://github.com/snipe/snipe-it/commit/a829fcf52f933d087c3776993b42311ec9a8988e">view</a> &bull; fix: Use the old asset tag when cloning
* <a href="http://github.com/snipe/snipe-it/commit/ee7d9bec7082dc2e60a4797dea84a0b7443c8090">view</a> &bull; Fixes #279 - QR checkbox not staying checked
* <a href="http://github.com/snipe/snipe-it/commit/bf1e07555160ede517d41f649d6b1d0911f89dd2">view</a> &bull; Fixes #87 - made datatables responsive
### v0.3.11-alpha - Released Jul 19, 2014 05:16:53
#### This is a pre-release
* <a href="http://github.com/snipe/snipe-it/commit/14972f894bb0e761e2d0170a2c93c9aac4edfca6">view</a> &bull; fixed typo
* <a href="http://github.com/snipe/snipe-it/commit/79da13dff767d57f6f4fbb12f195e25f409ee5ec">view</a> &bull; Fixed layout for category view
* <a href="http://github.com/snipe/snipe-it/commit/0e4e26206bdcc164e5df586368ed45edd45b9a74">view</a> &bull; fixed broken redirect route
@@ -712,6 +782,7 @@
* <a href="http://github.com/snipe/snipe-it/commit/d591c1ea0495de091eb0f71daa8572929096c897">view</a> &bull; Fixed bug where RTD = 1 instead of 0
* <a href="http://github.com/snipe/snipe-it/commit/e49420f62d26405b2fa0385f0ae7b3009b3beeaf">view</a> &bull; Fixed bug in depreciation display
* <a href="http://github.com/snipe/snipe-it/commit/1dc7fd1bdf8852fed6d886938f632c8ea69d4798">view</a> &bull; Fixed depreciation display on asset view
* <a href="http://github.com/snipe/snipe-it/commit/cc275367bffa3965a229e1527f6cd8cffd3415f1">view</a> &bull; Removed close button on 'no results' error
* <a href="http://github.com/snipe/snipe-it/commit/211a527ae176df667f6f8fbc95901c53a368d8e2">view</a> &bull; Fixed FK
* <a href="http://github.com/snipe/snipe-it/commit/aaebaa8d36158aafc61988a6370239e85f2e75e5">view</a> &bull; Bugfix to put custom title in the page title
* <a href="http://github.com/snipe/snipe-it/commit/194150bbf0493512018390d011e8d88d144e9763">view</a> &bull; Hacky shit to fix pagination weirdness - will come back to this
@@ -768,3 +839,54 @@
* <a href="http://github.com/snipe/snipe-it/commit/ac4c905c42d920d2cf8455d644f4c65332a81d0d">view</a> &bull; Fixed #140
* <a href="http://github.com/snipe/snipe-it/commit/4a13cded607415d749151cef495332c48c58cf86">view</a> &bull; Fixed path for Travis composer
* <a href="http://github.com/snipe/snipe-it/commit/ddf946ad5eb6dd8480eeaa709f82af75e0c61444">view</a> &bull; Tried to fix failing build caused by travis composer
* <a href="http://github.com/snipe/snipe-it/commit/a4b220d6c31c97f6504023f0b52527825a4cd897">view</a> &bull; Fixed #191 - allow admins to assign a user during asset creation
* <a href="http://github.com/snipe/snipe-it/commit/dc1033025a0bc1b2d657e06c89058c3ab95f2c59">view</a> &bull; Fixed #151 - more complete translations
* <a href="http://github.com/snipe/snipe-it/commit/56d619b218794b43d8c6b182c89c75f83af9dcd9">view</a> &bull; Fixed missing language string
* <a href="http://github.com/snipe/snipe-it/commit/69fca5d1eda0e5f26d2085f7eebc08fafd84a3ae">view</a> &bull; Fixed #58
* <a href="http://github.com/snipe/snipe-it/commit/8197e6174e9f12bcfddd94c6bf606ee36e6801bf">view</a> &bull; Fixes #200
* <a href="http://github.com/snipe/snipe-it/commit/cb8369e9de96aaf1cf9108e22f4038fa6486b881">view</a> &bull; Initial QA Patch to fix errors Add License Add Asset Show Deleted Users License Assign
* <a href="http://github.com/snipe/snipe-it/commit/62a3ed671bbd957075563933f49e8a5445042737">view</a> &bull; DB migration, layout and clone fixes
* <a href="http://github.com/snipe/snipe-it/commit/9ccc7d756f9361757eafc1dce9684ee9f5ecc1c3">view</a> &bull; A0.4.2: Added asset, license, user, model cloning and fixed some bugs.
* <a href="http://github.com/snipe/snipe-it/commit/652f1c746c4757dce9d33d7bd90a9357822c4656">view</a> &bull; Fixes Travis CI build
* <a href="http://github.com/snipe/snipe-it/commit/363d084bd623f778cd72ca7d385a4fb2f67ef474">view</a> &bull; Fixed DB name in travis CI
* <a href="http://github.com/snipe/snipe-it/commit/49c5607e1c8a82a3111123ad84b537644546ebb3">view</a> &bull; Fixes #222
* <a href="http://github.com/snipe/snipe-it/commit/96e40d72b9ac3f74b94b0e39b6f296f0f0b2a1f4">view</a> &bull; fix typo: artisand -> artisan
* <a href="http://github.com/snipe/snipe-it/commit/e978038cc044f60c2eca71b6319063009a57886f">view</a> &bull; Merge pull request #234 from burlito/typo-fix
* <a href="http://github.com/snipe/snipe-it/commit/a829fcf52f933d087c3776993b42311ec9a8988e">view</a> &bull; fix: Use the old asset tag when cloning
* <a href="http://github.com/snipe/snipe-it/commit/ee7d9bec7082dc2e60a4797dea84a0b7443c8090">view</a> &bull; Fixes #279 - QR checkbox not staying checked
* <a href="http://github.com/snipe/snipe-it/commit/bf1e07555160ede517d41f649d6b1d0911f89dd2">view</a> &bull; Fixes #87 - made datatables responsive
* <a href="http://github.com/snipe/snipe-it/commit/fafd03f00f49cb9ffe81d50aa9ca3d1f1fa1d043">view</a> &bull; Added DB Prefix to Migrations
* <a href="http://github.com/snipe/snipe-it/commit/309772e67d62989f1f60141a4a10d724a44c6baa">view</a> &bull; Fixed operator for setting bool display
* <a href="http://github.com/snipe/snipe-it/commit/22f81912e416cfe1227a08b5d8b6323e32e1ef36">view</a> &bull; Fixes #299
* <a href="http://github.com/snipe/snipe-it/commit/86b7b6946f1e1bd404127e228c615e4abe0b20fb">view</a> &bull; Fixes #316 - added model name back to view
* <a href="http://github.com/snipe/snipe-it/commit/9e85dcb9fcb4cc932ecddd23caa6b51e83110543">view</a> &bull; Fixes #315 - add EOL as display option in settings (run migrations)
* <a href="http://github.com/snipe/snipe-it/commit/ee35948980c22f9256241c02d7febd90275f6229">view</a> &bull; fix div issues
* <a href="http://github.com/snipe/snipe-it/commit/0022389463e251e73402450cfbc280cb05633bd1">view</a> &bull; Fix dropdown menu position
* <a href="http://github.com/snipe/snipe-it/commit/343798d241172707145ef365445062db9bb6b99a">view</a> &bull; Merge pull request #322 from madd15/fix-js-delete-asset
* <a href="http://github.com/snipe/snipe-it/commit/1078dbf5c5f6a5bec1a2ef864cebfcc7883d31e6">view</a> &bull; Fixes #324
* <a href="http://github.com/snipe/snipe-it/commit/6b2d3efe3e76429c9c2f5de78f04c4f7e2748a3d">view</a> &bull; Fixes #237 - reporting-only group
* <a href="http://github.com/snipe/snipe-it/commit/e04cc806d9209b54a1833172ebb66ab55b5f0c06">view</a> &bull; Fixes #327
* <a href="http://github.com/snipe/snipe-it/commit/8699a90093bd27c0502dcc25f6e7d55344d54a3b">view</a> &bull; Fixed changelog
* <a href="http://github.com/snipe/snipe-it/commit/cff24309a1514f9ea991881ca72898c7a6358562">view</a> &bull; Possibly fixes #343
* <a href="http://github.com/snipe/snipe-it/commit/b2d5dc9ec5460ff1f02db6c1a31ea87d224de4c9">view</a> &bull; Fix #342
* <a href="http://github.com/snipe/snipe-it/commit/74ae2fceea68d18514e87edc008cb3016361beee">view</a> &bull; Fix class on th
* <a href="http://github.com/snipe/snipe-it/commit/fc2d472ed350d7d63fb97942d00a97b62d4bed55">view</a> &bull; Fixed english language string
* <a href="http://github.com/snipe/snipe-it/commit/89c7159c56f88bcf8459a5eb02d79d636335cb28">view</a> &bull; Fix array check for empty rows
* <a href="http://github.com/snipe/snipe-it/commit/7ddc6d497af13e7894031ac763939be9863889a4">view</a> &bull; Fix Report Langs
* <a href="http://github.com/snipe/snipe-it/commit/13b173409fcd5b5ce8e79566b5110eadcf51c233">view</a> &bull; Fix License form langs
* <a href="http://github.com/snipe/snipe-it/commit/b73ae3147a60b29ac455063ecf419a609cce2cac">view</a> &bull; Fixes #362, reduced asset name to 2 char min
* <a href="http://github.com/snipe/snipe-it/commit/637009054cc74b17e2dd226c6f8c467eed5b0962">view</a> &bull; Fixed typo in english
* <a href="http://github.com/snipe/snipe-it/commit/6905d82fc48998f9c95c454c8bf37a34e30c002e">view</a> &bull; Fixes #374 to keep the requirement to PHP 5.4
* <a href="http://github.com/snipe/snipe-it/commit/102481631330fbed894bf72510845bff6c88e59e">view</a> &bull; Fix #377 - Checkout users last_name, first_name
* <a href="http://github.com/snipe/snipe-it/commit/d6a0249c60cbb026b2e3190285d50723a76f22ee">view</a> &bull; Fixed #373 - added ability to auto-increment asset tags
* <a href="http://github.com/snipe/snipe-it/commit/1b41c974cf67c550b2cae39eeec8f90cb2da79e0">view</a> &bull; Fixes #348 - remove constraints on license keys
* <a href="http://github.com/snipe/snipe-it/commit/89a2b87e42c18b308835ef71d196b91002b451ef">view</a> &bull; Fixes #367 - added model number to dropdown
* <a href="http://github.com/snipe/snipe-it/commit/64c16a0bacfcde7c4d92971f2129f1b1aeac2c0e">view</a> &bull; Fixes #386 and #273 - altered column type to text
* <a href="http://github.com/snipe/snipe-it/commit/daefc86e5878a21f9909806599f22198360c1f9b">view</a> &bull; Formattig fixes for #386
* <a href="http://github.com/snipe/snipe-it/commit/73dd339772fcc35e50603ded115f67714620da69">view</a> &bull; Fix #388 - License not showing checked out in view
* <a href="http://github.com/snipe/snipe-it/commit/0663ccb99fa926ff944dded330ba1f0cd95abbb3">view</a> &bull; Check if ->adminuser->id isset before trying to print the fullName so we can catch when a user that created an asset has been deleted. Fixes #349
* <a href="http://github.com/snipe/snipe-it/commit/533be7f942cb6dfccd1e8a79c043d61791e4c54b">view</a> &bull; fixed #435. using namespace with route groups to increase the readability
* <a href="http://github.com/snipe/snipe-it/commit/e434616db83a8d693af63b4705e1b24476fc3c17">view</a> &bull; Merge pull request #436 from rashivkp/fix-435
* <a href="http://github.com/snipe/snipe-it/commit/5e496672c66428a1bbd37772aabd44f8bb1cb0fa">view</a> &bull; Fixes #469
* <a href="http://github.com/snipe/snipe-it/commit/3c141e8f5017e8f161b6fd1fb82b288283b8450c">view</a> &bull; Fixes #467
* <a href="http://github.com/snipe/snipe-it/commit/548de1a1a217e6b5c6fcbbf6cd4918f078e64542">view</a> &bull; Fixes #468 - updated ordering on license checkout
+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).
+12 -1
View File
@@ -27,6 +27,13 @@ RUN echo export APACHE_RUN_GROUP=staff >> /etc/apache2/envvars
COPY docker/000-default.conf /etc/apache2/sites-enabled/000-default.conf
#SSL
COPY docker/001-default-ssl.conf /etc/apache2/sites-enabled/001-default-ssl.conf
#COPY docker/001-default-ssl.conf /etc/apache2/sites-available/001-default-ssl.conf
RUN a2enmod ssl
#RUN a2ensite 001-default-ssl.conf
COPY . /var/www/html
RUN a2enmod rewrite
@@ -62,6 +69,10 @@ RUN cd /var/www/html;composer install
##### START SERVER
CMD . /etc/apache2/envvars ;apache2 -DFOREGROUND
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 80
EXPOSE 443
+4 -3
View File
@@ -70,7 +70,7 @@ class AppCommand extends Command
$this->askUserEmail();
$this->askUserPassword();
$this->askUserDummyData();
$this->askUserDummyData();
$this->comment('');
$this->comment('');
@@ -256,8 +256,7 @@ class AppCommand extends Command
{
// 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, 'N' ) || empty($dummydata) ) ? true : false;
$this->dummyData = (strstr($dummydata, 'y' )) ? true : false;
}
/**
@@ -360,6 +359,8 @@ class AppCommand extends Command
'permissions' => array(
'admin' => 1,
'user' => 1,
'superuser' => 1,
'reports' => 1,
),
));
+85 -40
View File
@@ -169,6 +169,18 @@ class AssetImportCommand extends Command {
$user_asset_purchase_cost = '';
}
// Asset Company Name
if (array_key_exists('14',$row)) {
if ($row[14]!='') {
$user_asset_company_name = trim($row[14]);
} else {
$user_asset_company_name= '';
}
} else {
$user_asset_company_name = '';
}
// 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');
@@ -179,7 +191,7 @@ class AssetImportCommand extends Command {
$this->comment('No user data provided - skipping user creation, just adding asset');
$first_name = '';
$last_name = '';
$user_username = '';
//$user_username = '';
} else {
$user_email_array = User::generateFormattedNameFromFullName($this->option('email_format'), $user_name);
@@ -217,6 +229,7 @@ class AssetImportCommand extends Command {
$this->comment('Purchase Date: '.$user_asset_purchase_date);
$this->comment('Purchase Cost: '.$user_asset_purchase_cost);
$this->comment('Notes: '.$user_asset_notes);
$this->comment('Company Name: '.$user_asset_company_name);
$this->comment('------------- Action Summary ----------------');
@@ -252,7 +265,7 @@ class AssetImportCommand extends Command {
}
// Check for the location match and create it if it doesn't exist
if ($location = Location::where('name', $user_asset_location)->first()) {
if ($location = Location::where('name', e($user_asset_location))->first()) {
$this->comment('Location '.$user_asset_location.' already exists');
} else {
@@ -285,25 +298,32 @@ class AssetImportCommand extends Command {
}
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', e($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 = e($category_name);
$category->category_type = 'asset';
$category->user_id = 1;
if ($category->save()) {
$this->comment('Category '.$user_asset_category.' was created');
} else {
} else {
$this->comment('Something went wrong! Category '.$user_asset_category.' was NOT created');
}
}
// Check for the manufacturer match and create it if it doesn't exist
if ($manufacturer = Manufacturer::where('name', $user_asset_mfgr)->first()) {
if ($manufacturer = Manufacturer::where('name', e($user_asset_mfgr))->first()) {
$this->comment('Manufacturer '.$user_asset_mfgr.' already exists');
} else {
$manufacturer = new Manufacturer();
@@ -312,14 +332,14 @@ class AssetImportCommand extends Command {
if ($manufacturer->save()) {
$this->comment('Manufacturer '.$user_asset_mfgr.' was created');
} else {
} else {
$this->comment('Something went wrong! Manufacturer '.$user_asset_mfgr.' was NOT created');
}
}
// Check for the asset model match and create it if it doesn't exist
if ($asset_model = Model::where('name', $user_asset_name)->where('modelno', $user_asset_modelno)->where('category_id', $category->id)->where('manufacturer_id', $manufacturer->id)->first()) {
if ($asset_model = Model::where('name', e($user_asset_name))->where('modelno', e($user_asset_modelno))->where('category_id', $category->id)->where('manufacturer_id', $manufacturer->id)->first()) {
$this->comment('The Asset Model '.$user_asset_name.' with model number '.$user_asset_modelno.' already exists');
} else {
$asset_model = new Model();
@@ -331,45 +351,70 @@ class AssetImportCommand extends Command {
if ($asset_model->save()) {
$this->comment('Asset Model '.$user_asset_name.' with model number '.$user_asset_modelno.' was created');
} else {
} else {
$this->comment('Something went wrong! Asset Model '.$user_asset_name.' was NOT created');
}
}
// Check for the asset company match and create it if it doesn't exist
if ($user_asset_company_name!='') {
if ($company = Company::where('name', e($user_asset_company_name))->first()) {
$this->comment('Company '.$user_asset_company_name.' already exists');
} else {
$company = new Company();
$company->name = e($user_asset_company_name);
if ($company->save()) {
$this->comment('Company '.$user_asset_company_name.' was created');
} else {
$this->comment('Something went wrong! Company '.$user_asset_company_name.' was NOT created');
}
}
} else {
$company = new Company();
}
// Check for the asset match and create it if it doesn't exist
if ($asset = Asset::where('asset_tag', e($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;
$asset->company_id = $company->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_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);
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('=====================================');
+1 -1
View File
@@ -20,7 +20,7 @@ return array(
| Application Locale
|--------------------------------------------------------------------------
|
| This locale ties into the languaage files in app/lang, which contain the
| This locale ties into the language files in app/lang, which contain the
| language files for each translation.
|
*/
+11
View File
@@ -6,6 +6,7 @@ return array(
array(
'permission' => 'superuser',
'label' => 'Super User',
'note' => 'Determines whether the user has full access to all aspects of the admin. ',
),
),
@@ -13,6 +14,7 @@ return array(
array(
'permission' => 'admin',
'label' => 'Admin Rights',
'note' => 'Determines whether the user has access to most aspects of the admin.',
),
),
@@ -20,6 +22,15 @@ return array(
array(
'permission' => 'reports',
'label' => 'View Reports',
'note' => 'Determines whether the user has the abiity to view reports.',
),
),
'Licenses' => array(
array(
'permission' => 'license_keys',
'label' => 'View License Keys',
'note' => 'Determines whether the user has the ability to view the license keys assigned to them in their own profile. (Usually granted for lower-level permissions that wouldn\'t normally have access.)',
),
),
+3 -3
View File
@@ -1,5 +1,5 @@
<?php
return array (
'app_version' => 'v2.0.5-pre',
'hash_version' => 'v2.0.5-pre-57-g5ebb267',
);
'app_version' => 'v2.1.0',
'hash_version' => 'v2.1.0-47-g39f40a3',
);
+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'));
}
+81 -56
View File
@@ -31,12 +31,19 @@ class AuthController extends BaseController
*/
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;
$ldap_server_cert_ignore = Setting::getSettings()->ldap_server_cert_ignore;
// If we are ignoring the SSL cert we need to setup the environment variable
// before we create the connection
if($ldap_server_cert_ignore) {
putenv('LDAPTLS_REQCERT=never');
}
// Connecting to LDAP
$connection = ldap_connect($ldaphost) or die("Could not connect to {$ldaphost}");
@@ -50,7 +57,7 @@ class AuthController extends BaseController
$ldapbind = ldap_bind($connection, $ldaprdn, $ldappass);
if ( ($results = @ldap_search($connection, $baseDn, $filterQuery)) != false ) {
$entry = ldap_first_entry($connection, $results);
if ( ($userDn = @ldap_get_dn($connection, $entry)) !== false ) {
if ( ($userDn = @ldap_get_dn($connection, $entry)) != false ) {
if( ($isBound = ldap_bind($connection, $userDn, $password)) == "true") {
return $returnUser ?
array_change_key_case(ldap_get_attributes($connection, $entry),CASE_LOWER)
@@ -74,11 +81,11 @@ class AuthController extends BaseController
*/
function createUserFromLdap($ldapatttibutes){
//Get LDAP attribute config
$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_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();
@@ -89,8 +96,8 @@ class AuthController extends BaseController
$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);
if(!empty($item["username"])) {
//$pass = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10);
$newuser = array(
'first_name' => $item["firstname"],
@@ -98,21 +105,22 @@ class AuthController extends BaseController
'username' => $item["username"],
'email' => $item["email"],
'employee_num' => $item["employee_number"],
'password' => $pass,
'password' => Input::get("password"), //$pass,
'activated' => 1,
'location_id' => null,
'permissions' => '{"user":1}',
'permissions' => ["user" => 1], //'{"user":1}',
'notes' => 'Imported from LDAP'
);
DB::table('users')->insert($newuser);
Sentry::createUser($newuser);
/*DB::table('users')->insert($newuser);
$updateuser = Sentry::findUserByLogin($item["username"]);
$updateuser->setHasher(new Cartalyst\Sentry\Hashing\BcryptHasher);
// Update the user details
$updateuser->password = $pass;
$updateuser->password = Input::get('password');
// Update the user
$updateuser->save();
$updateuser->save(); */
} else {
throw new Cartalyst\Sentry\Users\UserNotFoundException();
}
@@ -120,7 +128,7 @@ class AuthController extends BaseController
//$item["note"] = "<strong>created</strong>";
$credentials = array(
'username' => $item["username"],
'password' => $pass,
'password' => Input::get("password")//$pass,
);
return $credentials;
}
@@ -149,47 +157,52 @@ class AuthController extends BaseController
}
try {
/**
* =================================================================
* Hack in LDAP authentication
*/
// Should we even check for LDAP users?
if (Setting::getSettings()->ldap_enabled=='1') {
// 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.");
LOG::debug("LDAP is enabled.");
// Check if the user exists in the database
$user = User::where('username','=',Input::get('username'))->whereNull('deleted_at')->first();
LOG::debug("Sentry lookup complete");
// The user does not exist in the database. Try to get them from LDAP.
// If user does not exist and authenticates sucessfully with LDAP we
// will create it on the fly and sign in with default permissions
if(!$user){
LOG::debug("Local user ".Input::get('username')." does not exist");
if($userattr = $this->ldap(Input::get('username'), Input::get('password'),true) ){
LOG::debug("Creating local user from authenticated LDAP user.");
$credentials = $this->createUserFromLdap($userattr);
Sentry::authenticate($credentials, Input::get('remember-me', 0));
} else {
LOG::debug("User did not authenticate correctly against LDAP. No local user was created.");
}
// If the user exists and they were imported from LDAP already
} else {
}
LOG::debug("Local user ".Input::get('username')." exists in database. Authenticating existing user against LDAP.");
if ($this->ldap(Input::get('username'), Input::get('password')) ) {
LOG::debug("Valid LDAP login. Updating the local data.");
$sentryuser=Sentry::findUserById($user->id); //need the Sentry object, not the Eloquent object, to access critical password hashing functions
$sentryuser->password = Input::get('password');
$sentryuser->save();
} else {
LOG::debug("User did not authenticate correctly against LDAP. Local user was not updated.");
}// End LDAP auth
} // End if(!user)
// NO LDAP enabled - just try to login the user normally
}
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");
$pass = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10);
$user = Sentry::findUserByLogin( Input::get('username') );
$user->password = $pass;
$user->save();
$credentials = array(
'username' => Input::get('username'),
'password' => $pass,
);
Sentry::authenticate($credentials, Input::get('remember-me', 0));
}
else {
throw new Cartalyst\Sentry\Users\UserNotFoundException();
}
}
/* ============================================================== */
else {
LOG::debug("Authenticating user against database.");
// Try to log the user in
Sentry::authenticate(Input::only('username', 'password'), Input::get('remember-me', 0));
LOG::debug("Authenticating user against database.");
// Try to log the user in
if (!Sentry::authenticate(Input::only('username', 'password'), Input::get('remember-me', 0))) {
LOG::debug("Local authentication failed.");
throw new Cartalyst\Sentry\Users\UserNotFoundException();
}
// Get the page we were before
@@ -200,13 +213,25 @@ class AuthController extends BaseController
// Redirect to the users page
return Redirect::to($redirect)->with('success', Lang::get('auth/message.signin.success'));
} catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
LOG::debug("Local authentication: User ".Input::get('username')." not found");
$this->messageBag->add('username', Lang::get('auth/message.account_not_found'));
} catch (Cartalyst\Sentry\Users\WrongPasswordException $e) {
LOG::debug("Local authentication: Password for ".Input::get('username')." is incorrect.");
$this->messageBag->add('username', Lang::get('auth/message.account_not_found'));
} catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
LOG::debug("Local authentication: User not activated");
$this->messageBag->add('username', Lang::get('auth/message.account_not_activated'));
} catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
LOG::debug("Local authentication: Account suspended");
$this->messageBag->add('username', Lang::get('auth/message.account_suspended'));
} catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
LOG::debug("Local authentication: Account banned.");
$this->messageBag->add('username', Lang::get('auth/message.account_banned'));
}
@@ -20,12 +20,7 @@ class ProfileController extends AuthorizedController
{
// Get the user information
$user = Sentry::getUser();
// Show the page
$location_list = array('' => 'Select One') + Location::lists('name', 'id');
// Show the page
$location_list = locationsList();
return View::make('frontend/account/profile', compact('user'))->with('location_list',$location_list);
}
@@ -63,7 +58,7 @@ class ProfileController extends AuthorizedController
$user->website = Input::get('website');
$user->location_id = Input::get('location_id');
$user->gravatar = Input::get('gravatar');
if (Input::file('avatar')) {
$image = Input::file('avatar');
$file_name = $user->first_name."-".$user->last_name.".".$image->getClientOriginalExtension();
@@ -75,7 +70,7 @@ class ProfileController extends AuthorizedController
if (Input::get('avatar_delete') == 1 && Input::file('avatar') == "") {
$user->avatar = NULL;
}
$user->save();
// Redirect to the settings page
@@ -9,12 +9,16 @@ use Location;
use View;
use Asset;
use Actionlog;
use Company;
use Lang;
use Accessory;
use DB;
use Slack;
use Setting;
use Config;
use Mail;
use User;
class ViewAssetsController extends AuthorizedController
{
@@ -25,18 +29,22 @@ class ViewAssetsController extends AuthorizedController
*/
public function getIndex()
{
$user = Sentry::getUser();
$user = User::with('assets', 'assets.model', 'consumables', 'accessories', 'licenses', 'userloc')->withTrashed()->find(Sentry::getUser()->id);
$userlog = $user->userlog->load('assetlog', 'consumablelog', 'assetlog.model', 'licenselog', 'accessorylog', 'userlog', 'adminlog');
if (isset($user->id)) {
return View::make('frontend/account/view-assets', compact('user'));
} else {
// Prepare the error message
$error = Lang::get('admin/users/message.user_not_found', compact('id' ));
// Redirect to the user management page
return Redirect::route('users')->with('error', $error);
}
if (isset($user->id)) {
return View::make('frontend/account/view-assets', compact('user', 'userlog'));
} else {
// Prepare the error message
$error = Lang::get('admin/users/message.user_not_found', compact('id' ));
// Redirect to the user management page
return Redirect::route('users')->with('error', $error);
}
}
@@ -44,6 +52,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,49 +65,64 @@ 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;
$logaction->asset_type = 'hardware';
$logaction->created_at = date("Y-m-d h:i:s");
$logaction->asset_id = $data['asset_id'] = $asset->id;
$logaction->asset_type = $data['asset_type'] = 'hardware';
$logaction->created_at = $data['requested_date'] = date("Y-m-d h:i:s");
if ($user->location_id) {
$logaction->location_id = $user->location_id;
}
$logaction->user_id = Sentry::getUser()->id;
$logaction->user_id = $data['user_id'] = Sentry::getUser()->id;
$log = $logaction->logaction('requested');
$data['requested_by'] = $user->fullName();
$data['asset_name'] = $asset->showAssetName();
$settings = Setting::getSettings();
if ($settings->slack_endpoint) {
if (($settings->alert_email!='') && ($settings->alerts_enabled=='1') && (!Config::get('app.lock_passwords'))) {
Mail::send('emails.asset-requested', $data, function ($m) use ($user, $settings) {
$m->to($settings->alert_email, $settings->site_name);
$m->subject('Asset Requested');
});
}
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
'link_names' => true
];
if ($settings->slack_endpoint) {
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
try {
$client->attach([
'color' => 'good',
'fields' => [
[
'title' => 'REQUESTED:',
'value' => strtoupper($logaction->asset_type).' asset <'.Config::get('app.url').'/hardware/'.$asset->id.'/view'.'|'.$asset->showAssetName().'> requested by <'.Config::get('app.url').'/hardware/'.$asset->id.'/view'.'|'.Sentry::getUser()->fullName().'>.'
]
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
'link_names' => true
];
]
])->send('Asset Requested');
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
} catch (Exception $e) {
try {
$client->attach([
'color' => 'good',
'fields' => [
[
'title' => 'REQUESTED:',
'value' => strtoupper($logaction->asset_type).' asset <'.Config::get('app.url').'/hardware/'.$asset->id.'/view'.'|'.$asset->showAssetName().'> requested by <'.Config::get('app.url').'/hardware/'.$asset->id.'/view'.'|'.Sentry::getUser()->fullName().'>.'
]
}
]
])->send('Asset Requested');
}
} catch (Exception $e) {
}
}
return Redirect::route('requestable-assets')->with('success')->with('success', Lang::get('admin/hardware/message.requests.success'));
}
@@ -116,6 +140,12 @@ class ViewAssetsController extends AuthorizedController
return Redirect::to('account')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
$user = Sentry::getUser();
if ($user->id != $findlog->checkedout_to) {
return Redirect::to('account/view-assets')->with('error', Lang::get('admin/users/message.error.incorrect_user_accepted'));
}
// Asset
if (($findlog->asset_id!='') && ($findlog->asset_type=='hardware')) {
$item = Asset::find($findlog->asset_id);
@@ -133,24 +163,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
@@ -162,6 +196,11 @@ class ViewAssetsController extends AuthorizedController
}
$user = Sentry::getUser();
if ($user->id != $findlog->checkedout_to) {
return Redirect::to('account/view-assets')->with('error', Lang::get('admin/users/message.error.incorrect_user_accepted'));
}
$logaction = new Actionlog();
if (Input::get('asset_acceptance')=='accepted') {
@@ -221,14 +260,5 @@ class ViewAssetsController extends AuthorizedController
} else {
return Redirect::to('account/view-assets')->with('error', 'Something went wrong ');
}
}
}
+87 -13
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,8 @@ 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')) == '') {
@@ -111,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);
}
@@ -130,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
@@ -149,7 +170,15 @@ class AccessoriesController extends AdminController
// Update the accessory data
$accessory->name = e(Input::get('name'));
if (e(Input::get('location_id')) == '') {
$accessory->location_id = NULL;
} else {
$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')) == '') {
@@ -191,6 +220,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) {
@@ -222,7 +254,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'));
@@ -244,6 +282,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');
@@ -262,6 +303,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'));
@@ -388,7 +432,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);
}
}
@@ -408,6 +458,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;
@@ -493,8 +548,8 @@ class AccessoriesController extends AdminController
public function getDatatable()
{
$accessories = Accessory::with('category')
->whereNull('deleted_at');
$accessories = Accessory::select('accessories.*')->with('category', 'company')
->whereNull('accessories.deleted_at');
if (Input::has('search')) {
$accessories = $accessories->TextSearch(Input::get('search'));
@@ -513,11 +568,22 @@ class AccessoriesController extends AdminController
}
$allowed_columns = ['name','order_number','purchase_date','purchase_cost'];
$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';
$accessories = $accessories->orderBy($sort, $order);
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();
@@ -525,18 +591,21 @@ class AccessoriesController extends AdminController
$rows = array();
foreach ($accessories as $accessory) {
$actions = '<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>';
$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,
'purchase_date' => $accessory->purchase_date,
'purchase_cost' => $accessory->purchase_cost,
'location' => ($accessory->location) ? $accessory->location->name: '',
'purchase_date' => $accessory->purchase_date,
'purchase_cost' => $accessory->purchase_cost,
'numRemaining' => $accessory->numRemaining(),
'actions' => $actions
);
'actions' => $actions,
'companyName' => is_null($company) ? '' : e($company->name)
);
}
$data = array('total'=>$accessCount, 'rows'=>$rows);
@@ -547,6 +616,11 @@ class AccessoriesController extends AdminController
public function getDataView($accessoryID)
{
$accessory = Accessory::find($accessoryID);
if (!Company::isCurrentUserHasAccess($accessory)) {
return ['total' => 0, 'rows' => []];
}
$accessory_users = $accessory->users;
$count = $accessory_users->count();
@@ -5,6 +5,7 @@
use AdminController;
use AssetMaintenance;
use Carbon\Carbon;
use Company;
use DB;
use Input;
use Lang;
@@ -20,9 +21,15 @@
use Validator;
use View;
use Setting;
use Asset;
class AssetMaintenancesController extends AdminController
{
private static function getInsufficientPermissionsRedirect()
{
return Redirect::to( 'admin/asset_maintenances')
->with('error', Lang::get( 'general.insufficient_permissions' ) );
}
/**
* getIndex
@@ -48,9 +55,7 @@
public function getDatatable()
{
$maintenances = AssetMaintenance::with('asset','supplier')
$maintenances = AssetMaintenance::with('asset','supplier','asset.company')
->whereNull('deleted_at');
if (Input::has('search')) {
@@ -83,7 +88,7 @@
foreach($maintenances as $maintenance) {
$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>';
$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/asset_maintenance', $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 (($maintenance->cost) && ($maintenance->asset->assetloc) && ($maintenance->asset->assetloc->currency!='')) {
$maintenance_cost = $maintenance->asset->assetloc->currency.$maintenance->cost;
@@ -91,6 +96,8 @@
$maintenance_cost = $settings->default_currency.$maintenance->cost;
}
$company = $maintenance->asset->company;
$rows[] = array(
'id' => $maintenance->id,
'asset_name' => link_to('/hardware/'.$maintenance->asset->id.'/view', $maintenance->asset->showAssetName()) ,
@@ -100,9 +107,10 @@
'cost' => $maintenance_cost,
'asset_maintenance_type' => e($maintenance->asset_maintenance_type),
'start_date' => $maintenance->start_date,
'time' => $maintenance->asset_maintenance_time,
'asset_maintenance_time' => $maintenance->asset_maintenance_time,
'completion_date' => $maintenance->completion_date,
'actions' => $actions
'actions' => $actions,
'companyName' => is_null($company) ? '' : $company->name
);
}
@@ -123,7 +131,6 @@
*/
public function getCreate( $assetId = null )
{
// Prepare Asset Maintenance Type List
$assetMaintenanceType = [
'' => 'Select an asset maintenance type',
@@ -131,7 +138,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',
@@ -207,6 +214,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' ) );
@@ -220,6 +233,16 @@
$assetMaintenance->completion_date = null;
}
if (( $assetMaintenance->completion_date !== "" )
&& ( $assetMaintenance->completion_date !== "0000-00-00" )
&& ( $assetMaintenance->start_date !== "" )
&& ( $assetMaintenance->start_date !== "0000-00-00" )
) {
$startDate = Carbon::parse( $assetMaintenance->start_date );
$completionDate = Carbon::parse( $assetMaintenance->completion_date );
$assetMaintenance->asset_maintenance_time = $completionDate->diffInDays( $startDate );
}
// Was the asset maintenance created?
if ($assetMaintenance->save()) {
@@ -254,13 +277,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;
@@ -280,7 +305,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',
@@ -335,6 +360,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 )) {
@@ -363,6 +391,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' ) );
@@ -425,13 +459,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();
@@ -451,13 +488,15 @@
*/
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);
}
+284 -65
View File
@@ -13,6 +13,7 @@ use Setting;
use Redirect;
use DB;
use Actionlog;
use Company;
use Model;
use Depreciation;
use Sentry;
@@ -30,7 +31,9 @@ use Paginator;
use Manufacturer; //for embedded-create
use Artisan;
use Symfony\Component\Console\Output\BufferedOutput;
use CustomField;
use Symfony\Component\HttpFoundation\JsonResponse;
use Models;
class AssetsController extends AdminController
@@ -65,11 +68,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);
@@ -96,9 +101,25 @@ class AssetsController extends AdminController
{
// create a new model instance
$asset = new Asset();
$asset->model()->associate(Model::find(e(Input::get('model_id'))));
//attempt to validate
$validator = Validator::make(Input::all(), $asset->validationRules());
$input=Input::all();
$rules=$asset->validationRules();
if($asset->model->fieldset)
{
foreach($asset->model->fieldset->fields AS $field) {
$input[$field->db_column_name()]=$input['fields'][$field->db_column_name()];
$asset->{$field->db_column_name()}=$input[$field->db_column_name()];
}
$rules+=$asset->model->fieldset->validation_rules();
unset($input['fields']);
}
$validator = Validator::make($input, $rules );
$custom_errors=[];
if ($validator->fails())
{
@@ -157,12 +178,13 @@ class AssetsController extends AdminController
}
$checkModel = Config::get('app.url').'/api/models/'.e(Input::get('model_id')).'/check';
$asset->mac_address = ($checkModel == true) ? e(Input::get('mac_address')) : NULL;
//$asset->mac_address = ($checkModel == true) ? e(Input::get('mac_address')) : NULL;
// 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'));
@@ -220,6 +242,10 @@ 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();
$statuslabel_list = statusLabelList();
@@ -227,12 +253,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)
@@ -255,9 +283,30 @@ 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'));
}
$input=Input::all();
// return "INPUT IS: <pre>".print_r($input,true)."</pre>";
$rules=$asset->validationRules($assetId);
$model=Model::find(e(Input::get('model_id'))); //validate by the NEW model's custom fields, not the current one
if($model->fieldset)
{
foreach($model->fieldset->fields AS $field) {
$input[$field->db_column_name()]=$input['fields'][$field->db_column_name()];
$asset->{$field->db_column_name()}=$input[$field->db_column_name()];
}
$rules+=$model->fieldset->validation_rules();
unset($input['fields']);
}
//return "Rules: <pre>".print_r($rules,true)."</pre>";
//attempt to validate
$validator = Validator::make(Input::all(), $asset->validationRules($assetId));
$validator = Validator::make($input, $rules );
$custom_errors=[];
if ($validator->fails())
{
@@ -277,7 +326,7 @@ class AssetsController extends AdminController
if (e(Input::get('warranty_months')) == '') {
$asset->warranty_months = NULL;
} else {
$asset->warranty_months = e(Input::get('warranty_months'));
$asset->warranty_months = e(Input::get('warranty_months'));
}
if (e(Input::get('purchase_cost')) == '') {
@@ -310,17 +359,25 @@ class AssetsController extends AdminController
$asset->rtd_location_id = e(Input::get('rtd_location_id'));
}
if (Input::has('image_delete')) {
unlink(public_path().'/uploads/assets/'.$asset->image);
$asset->image = '';
}
$checkModel = Config::get('app.url').'/api/models/'.e(Input::get('model_id')).'/check';
$asset->mac_address = ($checkModel == true) ? e(Input::get('mac_address')) : NULL;
//$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')) {
@@ -349,6 +406,7 @@ class AssetsController extends AdminController
// Redirect to the asset management page with error
/** @noinspection PhpUnreachableStatementInspection Known to be unreachable but kept following discussion: https://github.com/snipe/snipe-it/pull/1423 */
return Redirect::to("hardware/$assetId/edit")->with('error', Lang::get('admin/hardware/message.update.error'));
}
@@ -366,6 +424,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'));
}
if (isset($asset->assigneduser->id) && ($asset->assigneduser->id!=0)) {
// Redirect to the asset management page
@@ -398,6 +459,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'));
}
// Get the dropdown of users and then pass it to the checkout view
$users_list = usersList();
@@ -416,6 +480,9 @@ class AssetsController extends AdminController
if (!$asset = Asset::find($assetId)) {
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
$rules = array(
@@ -441,17 +508,15 @@ class AssetsController extends AdminController
if (Input::get('checkout_at')!= date("Y-m-d")){
$checkout_at = e(Input::get('checkout_at')).' 00:00:00';
$checkout_at = e(Input::get('checkout_at')).' 00:00:00';
} else {
$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'));
}
} else {
$expected_checkin = null;
$expected_checkin = e(Input::get('expected_checkin'));
} else {
$expected_checkin = '';
}
@@ -478,8 +543,11 @@ 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'));
}
return View::make('backend/hardware/checkin', compact('asset'))->with('backto', $backto);
else if (!Company::isCurrentUserHasAccess($asset)) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
$statusLabel_list = statusLabelList();
return View::make('backend/hardware/checkin', compact('asset'))->with('statusLabel_list',$statusLabel_list)->with('backto', $backto);
}
@@ -496,6 +564,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'));
}
// Check for a valid user to checkout fa-random
// This will need to be tweaked for checkout to location
@@ -515,7 +586,12 @@ class AssetsController extends AdminController
$asset->assigned_to = NULL;
$asset->accepted = NULL;
$asset->expected_checkin = NULL;
$asset->last_checkout = NULL;
if (Input::has('status_id')) {
$asset->status_id = e(Input::get('status_id'));
}
// Was the asset updated?
if($asset->save()) {
@@ -607,8 +683,10 @@ class AssetsController extends AdminController
$asset = Asset::withTrashed()->find($assetId);
$settings = Setting::getSettings();
if ($asset->userloc) {
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;
@@ -657,6 +735,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));
@@ -672,6 +754,10 @@ class AssetsController extends AdminController
$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. */
@@ -697,7 +783,10 @@ class AssetsController extends AdminController
public function postAPIImportUpload() {
if (!Config::get('app.lock_passwords')) {
if (!Company::isCurrentUserAuthorized()) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
elseif (!Config::get('app.lock_passwords')) {
$rules = array(
'files' => 'required'
@@ -727,8 +816,9 @@ class AssetsController extends AdminController
return $results;
}
$date = date('Y-m-d-his');
$fixed_filename = str_replace(' ','-',$file->getClientOriginalName());
$file->move($path, date('Y-m-d-his').'-'.$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');
@@ -751,6 +841,10 @@ class AssetsController extends AdminController
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();
@@ -758,7 +852,7 @@ class AssetsController extends AdminController
file_put_contents($file, $display_output);
return View::make('backend/hardware/import-status');
return Redirect::to('hardware')->with('success','Your file has been imported');
}
@@ -775,6 +869,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();
@@ -785,13 +882,14 @@ 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;
$asset->asset_tag = '';
$asset->serial = '';
$asset->assigned_to = '';
$asset->mac_address = '';
return View::make('backend/hardware/edit')
->with('supplier_list',$supplier_list)
->with('model_list',$model_list)
@@ -801,7 +899,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);
}
@@ -812,7 +911,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();
@@ -836,15 +938,19 @@ class AssetsController extends AdminController
* @param int $assetId
* @return View
**/
public function postUpload($assetID = null)
public function postUpload($assetId = null)
{
$asset = Asset::find($assetID);
$asset = Asset::find($assetId);
// the asset is valid
$destinationPath = app_path().'/private_uploads';
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) {
@@ -906,16 +1012,22 @@ class AssetsController extends AdminController
* Delete the associated file
*
* @param int $assetId
* @param int $fileId
* @return View
**/
public function getDeleteFile($assetID = null, $fileId = null)
public function getDeleteFile($assetId = null, $fileId = null)
{
$asset = Asset::find($assetID);
$asset = Asset::find($assetId);
$destinationPath = app_path().'/private_uploads';
// 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)) {
@@ -939,16 +1051,22 @@ class AssetsController extends AdminController
* Display/download the uploaded file
*
* @param int $assetId
* @param int $fileId
* @return View
**/
public function displayFile($assetID = null, $fileId = null)
public function displayFile($assetId = null, $fileId = null)
{
$asset = Asset::find($assetID);
$asset = Asset::find($assetId);
// 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);
$file = $log->get_src();
@@ -985,40 +1103,63 @@ class AssetsController extends AdminController
public function postBulkEdit($assets = null)
{
if (!Input::has('edit_asset')) {
return Redirect::back()->with('error', 'No assets selected');
} else {
$asset_raw_array = Input::get('edit_asset');
foreach ($asset_raw_array as $asset_id => $value) {
$asset_ids[] = $asset_id;
if (!Company::isCurrentUserAuthorized()) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
}
} elseif (!Input::has('edit_asset')) {
return Redirect::back()->with('error', 'No assets selected');
}
} else {
$asset_raw_array = Input::get('edit_asset');
foreach ($asset_raw_array as $asset_id => $value) {
$asset_ids[] = $asset_id;
}
}
if (Input::has('bulk_actions')) {
// Create labels
if (Input::get('bulk_actions')=='labels') {
$assets = Asset::find($asset_ids);
$assetcount = count($assets);
$count = 0;
$settings = Setting::getSettings();
if ($settings->qr_code=='1') {
$settings = Setting::getSettings();
return View::make('backend/hardware/labels')->with('assets',$assets)->with('settings',$settings)->with('count',$count);
$assets = Asset::find($asset_ids);
$assetcount = count($assets);
$count = 0;
return View::make('backend/hardware/labels')->with('assets',$assets)->with('settings',$settings)->with('count',$count);
} else {
// QR codes are not enabled
return Redirect::to("hardware")->with('error','Barcodes are not enabled in Admin > Settings');
}
} elseif (Input::get('bulk_actions')=='delete') {
$assets = Asset::with('assigneduser','assetloc')->find($asset_ids);
return View::make('backend/hardware/bulk-delete')->with('assets',$assets);
// Bulk edit
} elseif (Input::get('bulk_actions')=='edit') {
$assets = Input::get('edit_asset');
$supplier_list = array('' => '') + suppliersList();
$statuslabel_list = array('' => '') + statusLabelList();
$location_list = array('' => '') + locationsList();
$models_list = array('' => '') + modelList();
$companies_list = array('' => '') + array('clear' => Lang::get('general.remove_company')) + companyList();
$supplier_list = array('' => '') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$statuslabel_list = array('' => '') + Statuslabel::lists('name', 'id');
$location_list = array('' => '') + Location::lists('name', 'id');
return View::make('backend/hardware/bulk')->with('assets',$assets)->with('supplier_list',$supplier_list)->with('statuslabel_list',$statuslabel_list)->with('location_list',$location_list);
return View::make('backend/hardware/bulk')
->with('assets',$assets)
->with('supplier_list',$supplier_list)
->with('statuslabel_list',$statuslabel_list)
->with('location_list',$location_list)
->with('models_list',$models_list)
->with('companies_list',$companies_list);
}
@@ -1041,11 +1182,14 @@ 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'));
} elseif (Input::has('bulk_edit')) {
$assets = Input::get('bulk_edit');
if ( (Input::has('purchase_date')) || (Input::has('purchase_cost')) || (Input::has('supplier_id')) || (Input::has('order_number')) || (Input::has('warranty_months')) || (Input::has('rtd_location_id')) || (Input::has('requestable')) || (Input::has('status_id')) ) {
if ( (Input::has('purchase_date')) || (Input::has('purchase_cost')) || (Input::has('supplier_id')) || (Input::has('order_number')) || (Input::has('warranty_months')) || (Input::has('rtd_location_id')) || (Input::has('requestable')) || (Input::has('company_id')) || (Input::has('status_id')) || (Input::has('model_id')) ) {
foreach ($assets as $key => $value) {
@@ -1063,6 +1207,19 @@ class AssetsController extends AdminController
$update_array['supplier_id'] = e(Input::get('supplier_id'));
}
if (Input::has('model_id')) {
$update_array['model_id'] = e(Input::get('model_id'));
}
if (Input::has('company_id')) {
if (Input::get('company_id')=="clear") {
$update_array['company_id'] = null;
} else {
$update_array['company_id'] = e(Input::get('company_id'));
}
}
if (Input::has('order_number')) {
$update_array['order_number'] = e(Input::get('order_number'));
}
@@ -1079,11 +1236,9 @@ class AssetsController extends AdminController
$update_array['status_id'] = e(Input::get('status_id'));
}
if (Input::get('requestable')=='1') {
$update_array['requestable'] = 1;
} else {
$update_array['requestable'] = 0;
}
if (Input::has('requestable')) {
$update_array['requestable'] = e(Input::get('requestable'));
}
if (DB::table('assets')
@@ -1120,12 +1275,61 @@ class AssetsController extends AdminController
}
/**
* Save bulk edits
*
* @return View
**/
public function postBulkDelete($assets = null)
{
if (!Company::isCurrentUserAuthorized()) {
return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
} elseif (Input::has('bulk_edit')) {
//$assets = Input::get('bulk_edit');
$assets = Asset::find(Input::get('bulk_edit'));
//print_r($assets);
foreach ($assets as $asset) {
//echo '<li>'.$asset;
$update_array['deleted_at'] = date('Y-m-d h:i:s');
$update_array['assigned_to'] = NULL;
if (DB::table('assets')
->where('id', $asset->id)
->update($update_array)) {
$logaction = new Actionlog();
$logaction->asset_id = $asset->id;
$logaction->asset_type = 'hardware';
$logaction->created_at = date("Y-m-d H:i:s");
$logaction->user_id = Sentry::getUser()->id;
$log = $logaction->logaction('deleted');
}
} // endforeach
return Redirect::to("hardware")->with('success', Lang::get('admin/hardware/message.delete.success'));
// no values given, nothing to update
} else {
return Redirect::to("hardware")->with('info',Lang::get('admin/hardware/message.delete.nothing_updated'));
}
// Something weird happened here - default to hardware
return Redirect::to("hardware");
}
public function getDatatable($status = null)
{
$assets = Asset::with('model','assigneduser','assigneduser.userloc','assetstatus','defaultLoc','assetlog','model','model.category','assetstatus','assetloc')
$assets = Asset::select('assets.*')->with('model','assigneduser','assigneduser.userloc','assetstatus','defaultLoc','assetlog','model','model.category','model.fieldset','assetstatus','assetloc', 'company')
->Hardware();
if (Input::has('search')) {
@@ -1184,10 +1388,17 @@ class AssetsController extends AdminController
'notes',
'expected_checkin',
'order_number',
'companyName',
'location',
'image',
];
$all_custom_fields=CustomField::all(); //used as a 'cache' of custom fields throughout this page load
foreach($all_custom_fields AS $field) {
$allowed_columns[]=$field->db_column_name();
}
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'asset_tag';
@@ -1199,6 +1410,9 @@ class AssetsController extends AdminController
case 'category':
$assets = $assets->OrderCategory($order);
break;
case 'companyName':
$assets = $assets->OrderCompany($order);
break;
case 'location':
$assets = $assets->OrderLocation($order);
break;
@@ -1234,10 +1448,10 @@ class AssetsController extends AdminController
}
}
$rows[] = array(
$row = 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>' : ''),
'image' => (($asset->image) && ($asset->image!='')) ? '<img src="'.Config::get('app.url').'/uploads/assets/'.$asset->image.'" height=50 width=50>' : ((($asset->model) && ($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,
@@ -1247,12 +1461,17 @@ class AssetsController extends AdminController
'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>' : '',
'order_number' => ($asset->order_number!='') ? '<a href="'.Config::get('app.url').'/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 : ''
'actions' => ($actions) ? $actions : '',
'companyName' => is_null($asset->company) ? '' : e($asset->company->name)
);
foreach($all_custom_fields AS $field) {
$row[$field->db_column_name()]=$asset->{$field->db_column_name()};
}
$rows[]=$row;
}
$data = array('total'=>$assetCount, 'rows'=>$rows);
@@ -4,6 +4,7 @@ use AdminController;
use Input;
use Lang;
use Category;
use Company;
use Redirect;
use Setting;
use DB;
@@ -249,12 +250,11 @@ class CategoriesController extends AdminController
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(),
'count' => $category->itemCount(),
'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>' : '',
@@ -269,7 +269,7 @@ class CategoriesController extends AdminController
public function getDataView($categoryID) {
$category = Category::find($categoryID);
$category = Category::with('assets.company')->find($categoryID);
$category_assets = $category->assets;
if (Input::has('search')) {
@@ -300,7 +300,7 @@ class CategoriesController extends AdminController
$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!='') {
@@ -326,8 +326,7 @@ class CategoriesController extends AdminController
'assigned_to' => ($asset->assigneduser) ? link_to('/admin/users/'.$asset->assigneduser->id.'/view', $asset->assigneduser->fullName()): '',
'change' => $inout,
'actions' => $actions,
'companyName' => Company::getName($asset),
);
}
@@ -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;
}
}
}
}
}
+152 -83
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);
}
@@ -68,6 +76,8 @@ class ConsumablesController extends AdminController
// Update the consumable data
$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')) == '') {
@@ -111,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);
}
@@ -130,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
@@ -150,6 +172,8 @@ class ConsumablesController extends AdminController
// Update the consumable data
$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')) == '') {
@@ -191,6 +215,9 @@ 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'));
}
$consumable->delete();
@@ -212,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'));
@@ -234,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');
@@ -247,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,
@@ -318,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'));
@@ -365,8 +400,8 @@ class ConsumablesController extends AdminController
public function getDatatable()
{
$consumables = Consumable::select(array('id','name','qty'))
->whereNull('deleted_at');
$consumables = Consumable::select('consumables.*')->whereNull('consumables.deleted_at')
->with('company','location','category','users');
if (Input::has('search')) {
$consumables = $consumables->TextSearch(Input::get('search'));
@@ -384,11 +419,25 @@ class ConsumablesController extends AdminController
$limit = 50;
}
$allowed_columns = ['id','name'];
$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';
$consumables->orderBy($sort, $order);
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();
@@ -396,14 +445,21 @@ class ConsumablesController extends AdminController
$rows = array();
foreach($consumables as $consumable) {
$actions = '<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>';
$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,
'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
'actions' => $actions,
'companyName' => is_null($company) ? '' : e($company->name),
);
}
@@ -415,21 +471,34 @@ class ConsumablesController extends AdminController
public function getDataView($consumableID)
{
$consumable = Consumable::find($consumableID);
$consumable_users = $consumable->users;
$count = $consumable_users->count();
//$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);
$rows = array();
// $consumable->load('consumableAssigments.admin','consumableAssigments.user');
foreach ($consumable_users as $user) {
$rows[] = array(
'name' => link_to('/admin/users/'.$user->id.'/view', $user->fullName())
);
}
$data = array('total' => $count, 'rows' => $rows);
return $data;
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;
}
}
@@ -0,0 +1,194 @@
<?php namespace Controllers\Admin;
use View;
use CustomFieldset;
use CustomField;
use Input;
use Validator;
use Redirect;
use Model;
use Lang;
use Sentry;
class CustomFieldsController extends \BaseController {
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
//
$fieldsets=CustomFieldset::with("fields","models")->get();
//$fieldsets=CustomFieldset::all();
$fields=CustomField::with("fieldset")->get();
//$fields=CustomField::all();
return View::make("backend.custom_fields.index")->with("custom_fieldsets",$fieldsets)->with("custom_fields",$fields);
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
//
return View::make("backend.custom_fields.create");
}
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
//
$cfset=new CustomFieldset(["name" => Input::get("name"),"user_id" => Sentry::getUser()->id]);
$validator=Validator::make(Input::all(),$cfset->rules);
if($validator->passes()) {
$cfset->save();
return Redirect::route("admin.custom_fields.show",[$cfset->id])->with('success',Lang::get('admin/custom_fields/message.fieldset.create.success'));
} else {
return Redirect::back()->withInput()->withErrors($validator);
}
}
public function associate($id)
{
$set = CustomFieldset::find($id);
foreach($set->fields AS $field) {
if($field->id == Input::get('field_id')) {
return Redirect::route("admin.custom_fields.show",[$id])->withInput()->withErrors(['field_id' => Lang::get('admin/custom_fields/message.field.already_added')]);
}
}
$results=$set->fields()->attach(Input::get('field_id'),["required" => (Input::get('required') == "on"),"order" => Input::get('order')]);
return Redirect::route("admin.custom_fields.show",[$id])->with("success",Lang::get('admin/custom_fields/message.field.create.assoc_success'));
}
public function createField()
{
return View::make("backend.custom_fields.create_field");
}
public function storeField()
{
$field=new CustomField(["name" => Input::get("name"),"element" => Input::get("element"),"user_id" => Sentry::getUser()->id]);
if(!in_array(Input::get('format'),["ALPHA","NUMERIC","MAC","IP"])) {
$field->format=Input::get("custom_format");
} else {
$field->format=Input::get('format');
}
$validator=Validator::make(Input::all(),$field->rules);
if($validator->passes()) {
$results=$field->save();
//return "postCreateField: $results";
if ($results) {
return Redirect::route("admin.custom_fields.index")->with("success",Lang::get('admin/custom_fields/message.field.create.success'));
} else {
return Redirect::back()->withInput()->with('error', Lang::get('admin/custom_fields/message.field.create.error'));
}
} else {
return Redirect::back()->withInput()->withErrors($validator);
}
}
public function deleteField($field_id)
{
$field=CustomField::find($field_id);
if($field->fieldset->count()>0) {
return Redirect::back()->withErrors(['message' => "Field is in-use"]);
} else {
$field->delete();
return Redirect::route("admin.custom_fields.index")->with("success",Lang::get('admin/custom_fields/message.field.delete.success'));
}
}
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
//$id=$parameters[0];
$cfset=CustomFieldset::find($id);
//print_r($parameters);
//
$custom_fields_list=["" => "Add New Field to Fieldset"] + CustomField::lists("name","id");
// print_r($custom_fields_list);
$maxid=0;
foreach($cfset->fields AS $field) {
// print "Looking for: ".$field->id;
if($field->pivot->order > $maxid) {
$maxid=$field->pivot->order;
}
if(isset($custom_fields_list[$field->id])) {
// print "Found ".$field->id.", so removing it.<br>";
unset($custom_fields_list[$field->id]);
}
}
return View::make("backend.custom_fields.show")->with("custom_fieldset",$cfset)->with("maxid",$maxid+1)->with("custom_fields_list",$custom_fields_list);
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
//
$fieldset=CustomFieldset::find($id);
$models=Model::where("fieldset_id","=",$id);
if($models->count()==0) {
$fieldset->delete();
return Redirect::route("admin.custom_fields.index")->with("success",Lang::get('admin/custom_fields/message.fieldset.delete.success'));
}
else {
return Redirect::route("admin.custom_fields.index")->with("error",Lang::get('admin/custom_fields/message.fieldset.delete.in_use')); //->with("models",$models);
}
}
}
@@ -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();
+74 -3
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'));
}
@@ -215,4 +212,78 @@ class GroupsController extends AdminController
}
}
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;
}
}
+75 -11
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.');
@@ -714,7 +746,7 @@ class LicensesController extends AdminController
/**
* Get the asset information to present to the asset view page
*
* @param int $assetId
* @param int $licenseId
* @return View
**/
public function getView($licenseId = null)
@@ -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);
}
@@ -759,7 +805,7 @@ class LicensesController extends AdminController
/**
* Upload the file to the server
*
* @param int $assetId
* @param int $licenseId
* @return View
**/
public function postUpload($licenseId = null)
@@ -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) {
@@ -831,7 +882,8 @@ class LicensesController extends AdminController
/**
* Delete the associated file
*
* @param int $assetId
* @param int $licenseId
* @param int $fileId
* @return View
**/
public function getDeleteFile($licenseId = null, $fileId = null)
@@ -842,6 +894,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)) {
@@ -864,7 +921,8 @@ class LicensesController extends AdminController
/**
* Display/download the uploaded file
*
* @param int $assetId
* @param int $licenseId
* @param int $fileId
* @return View
**/
public function displayFile($licenseId = null, $fileId = null)
@@ -874,6 +932,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,7 +950,7 @@ class LicensesController extends AdminController
}
public function getDatatable() {
$licenses = License::select('id','name','serial','purchase_date','seats');
$licenses = License::select('id','name','serial','purchase_date','seats', 'company_id')->with('company');
if (Input::has('search')) {
$licenses = $licenses->TextSearch(Input::get('search'));
@@ -914,8 +977,9 @@ class LicensesController extends AdminController
'totalSeats' => $license->totalSeatsByLicenseID(),
'remaining' => $license->remaincount(),
'purchase_date' => ($license->purchase_date) ? $license->purchase_date : '',
'actions' => $actions
);
'actions' => $actions,
'companyName' => is_null($license->company) ? '' : e($license->company->name)
);
}
$data = array('total' => $licenseCount, 'rows' => $rows);
@@ -143,6 +143,7 @@ class LocationsController extends AdminController
}
// Redirect to the location create page
/** @noinspection PhpUnreachableStatementInspection Known to be unreachable but kept following discussion: https://github.com/snipe/snipe-it/pull/1423 */
return Redirect::to('admin/settings/locations/create')->with('error', Lang::get('admin/locations/message.create.error'));
}
@@ -1,6 +1,7 @@
<?php namespace Controllers\Admin;
use AdminController;
use Company;
use Input;
use Lang;
use Manufacturer;
@@ -222,7 +223,7 @@ class ManufacturersController extends AdminController
$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>';
$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/manufacturer', $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,
@@ -242,7 +243,7 @@ class ManufacturersController extends AdminController
public function getDataView($manufacturerID) {
$manufacturer = Manufacturer::find($manufacturerID);
$manufacturer = Manufacturer::with('assets.company')->find($manufacturerID);
$manufacturer_assets = $manufacturer->assets;
if (Input::has('search')) {
@@ -288,18 +289,20 @@ class ManufacturersController extends AdminController
}
}
$rows[] = array(
$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()): '',
'change' => $inout,
'actions' => $actions,
'companyName' => Company::getName($asset),
);
if (isset($inout)) { $row['change'] = $inout; }
$rows[] = $row;
}
$data = array('total' => $count, 'rows' => $rows);
+45 -12
View File
@@ -16,6 +16,8 @@ use Validator;
use View;
use Datatable;
use Asset;
use Company;
use Config;
//use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
@@ -80,7 +82,7 @@ class ModelsController extends AdminController
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->with('error', Lang::get('admin/models/message.create.duplicate_set'));;
return Redirect::back()->withInput()->with('error', Lang::get('admin/models/message.create.duplicate_set'));
}
@@ -114,7 +116,11 @@ class ModelsController extends AdminController
$model->manufacturer_id = e(Input::get('manufacturer_id'));
$model->category_id = e(Input::get('category_id'));
$model->user_id = Sentry::getId();
$model->show_mac_address = e(Input::get('show_mac_address', '0'));
if (Input::get('custom_fieldset')!='') {
$model->fieldset_id = e(Input::get('custom_fieldset'));
}
//$model->show_mac_address = e(Input::get('show_mac_address', '0'));
if (Input::file('image')) {
@@ -237,7 +243,11 @@ class ModelsController extends AdminController
$model->modelno = e(Input::get('modelno'));
$model->manufacturer_id = e(Input::get('manufacturer_id'));
$model->category_id = e(Input::get('category_id'));
$model->show_mac_address = e(Input::get('show_mac_address', '0'));
if (Input::get('custom_fieldset')=='') {
$model->fieldset_id = null;
} else {
$model->fieldset_id = e(Input::get('custom_fieldset'));
}
if (Input::file('image')) {
$image = Input::file('image');
@@ -320,7 +330,7 @@ class ModelsController extends AdminController
/**
* Get the model information to present to the model view page
*
* @param int $assetId
* @param int $modelId
* @return View
**/
public function getView($modelId = null)
@@ -373,6 +383,14 @@ class ModelsController extends AdminController
}
public function getCustomFields($modelId)
{
$model=Model::find($modelId);
return View::make("backend.models.custom_fields_form")->with("model",$model);
}
/**
* Get the JSON response for the bootstrap table list view
*
@@ -383,7 +401,13 @@ class ModelsController extends AdminController
public function getDatatable($status = null)
{
$models = Model::with('category','assets','depreciation');
($status != 'Deleted') ?: $models->withTrashed()->Deleted();;
switch ($status) {
case 'Deleted':
$models->withTrashed()->Deleted();
break;
}
if (Input::has('search')) {
$models = $models->TextSearch(Input::get('search'));
@@ -424,6 +448,7 @@ class ModelsController extends AdminController
'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'),
@@ -447,7 +472,7 @@ class ModelsController extends AdminController
**/
public function getDataView($modelID)
{
$assets = Asset::where('model_id','=',$modelID)->withTrashed();
$assets = Asset::where('model_id','=',$modelID)->withTrashed()->with('company');
if (Input::has('search')) {
$assets = $assets->TextSearch(Input::get('search'));
@@ -477,11 +502,18 @@ class ModelsController extends AdminController
$rows = array();
foreach ($assets as $asset) {
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>';
$actions = '';
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>';
}
}
}
$rows[] = array(
@@ -490,8 +522,9 @@ class ModelsController extends AdminController
'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
);
'actions' => $actions,
'companyName' => Company::getName($asset)
);
}
$data = array('total' => $assetsCount, 'rows' => $rows);
+33 -41
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 = [ ];
@@ -162,7 +162,7 @@ class ReportsController extends AdminController
if (( $asset->assigned_to > 0 ) && ( $asset->assigneduser->location_id > 0 )) {
$location = Location::find( $asset->assigneduser->location_id );
if ($location->name) {
if ($location) {
$row[] = $location->name;
} else {
$row[] = '';
@@ -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 = [ ];
@@ -479,23 +474,25 @@ class ReportsController extends AdminController
}
}
if (e( Input::get( 'location' ) ) == '1') {
if (( $asset->assigned_to > 0 ) && ( $asset->assigneduser->location_id > 0 )) {
$show_loc = '';
if (( $asset->assigned_to > 0 ) && ( $asset->assigneduser->location_id !='' )) {
$location = Location::find( $asset->assigneduser->location_id );
if ($location->name) {
$row[] = $location->name;
if ($location) {
$show_loc .= $location->name;
} else {
$row[] = '';
$show_loc .= 'User location '.$asset->assigneduser->location_id.' is invalid';
}
} elseif ($asset->rtd_location_id) {
} elseif ($asset->rtd_location_id!='') {
$location = Location::find( $asset->rtd_location_id );
if ($location->name) {
$row[] = $location->name;
if ($location) {
$show_loc .= $location->name;
} else {
$row[] = '';
$show_loc .= 'Default location '.$asset->rtd_location_id.' is invalid';
}
} else {
$row[] = ''; // Empty string if location is not set
}
$row[] = $show_loc;
}
if (e( Input::get( 'assigned_to' ) ) == '1') {
if ($asset->assigned_to > 0) {
@@ -557,9 +554,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 +572,6 @@ class ReportsController extends AdminController
*/
public function exportAssetMaintenancesReport()
{
// Grab all the improvements
$assetMaintenances = AssetMaintenance::with( 'asset', 'supplier' )
->orderBy( 'created_at', 'DESC' )
@@ -635,12 +630,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 +693,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 +760,6 @@ class ReportsController extends AdminController
*/
protected function getAssetsNotAcceptedYet()
{
return Asset::unaccepted();
}
}
+54 -17
View File
@@ -14,6 +14,8 @@ use Image;
use Config;
use Response;
use Artisan;
use Crypt;
class SettingsController extends AdminController
{
@@ -35,22 +37,30 @@ class SettingsController extends AdminController
/**
* Setting update.
*
* @param int $settingId
* @return View
*/
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);
}
/**
* Setting update form processing page.
*
* @param int $settingId
* @return Redirect
*/
public function postEdit()
@@ -78,12 +88,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);
@@ -135,6 +153,25 @@ 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_server_cert_ignore = Input::get('ldap_server_cert_ignore', false);
$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?
@@ -204,11 +241,11 @@ class SettingsController extends AdminController
/**
* Download the dump file
*
* @param int $assetId
* @return View
**/
* Download the dump file
*
* @param string|null $filename
* @return View
*/
public function downloadFile($filename = null)
{
if (!Config::get('app.lock_passwords')) {
@@ -229,11 +266,11 @@ class SettingsController extends AdminController
}
/**
* Download the dump file
*
* @param int $assetId
* @return View
**/
* Download the dump file
*
* @param string|null $filename
* @return View
*/
public function deleteFile($filename = null)
{
@@ -297,7 +297,7 @@ class SuppliersController extends AdminController
$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>';
$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/supplier', $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,
+146 -50
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');
@@ -266,7 +284,8 @@ class UsersController extends AdminController {
$permissions = Config::get('permissions');
$this->encodeAllPermissions($permissions);
$location_list = array('' => '') + Location::lists('name', 'id');
$location_list = locationsList();
$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'));
@@ -353,10 +377,13 @@ class UsersController extends AdminController {
$user->email = Input::get('email');
$user->employee_num = Input::get('employee_num');
$user->activated = Input::get('activated', $user->activated);
$user->permissions = Input::get('permissions');
if (Sentry::getUser()->hasAccess('superuser')) {
$user->permissions = Input::get('permissions');
}
$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');
@@ -488,7 +515,10 @@ class UsersController extends AdminController {
} else {
$statuslabel_list = statusLabelList();
$user_raw_array = array_keys(Input::get('edit_user'));
$users = User::whereIn('id', $user_raw_array)->with('groups')->get();
$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'));
}
}
@@ -508,11 +538,17 @@ class UsersController extends AdminController {
unset($user_raw_array[$key]);
}
if (!Sentry::getUser()->isSuperUser()) {
return Redirect::route('users')->with('error', Lang::get('admin/users/message.insufficient_permissions'));
}
if (!Config::get('app.lock_passwords')) {
$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) {
@@ -557,6 +593,7 @@ class UsersController extends AdminController {
return Redirect::route('users')->with('error', 'Bulk delete is not enabled in this installation');
}
/** @noinspection PhpUnreachableStatementInspection Known to be unreachable but kept following discussion: https://github.com/snipe/snipe-it/pull/1423 */
return Redirect::route('users')->with('error', 'An error has occurred');
}
}
@@ -572,14 +609,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 +645,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 +737,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 +749,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);
@@ -762,7 +812,15 @@ class UsersController extends AdminController {
$activated = '0';
}
$pass = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10);
$pass = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 15);
// Location
if (array_key_exists('4',$row)) {
$user_location_id = trim($row[4]);
if ($user_location_id=='') {
$user_location_id = null;
}
}
@@ -780,7 +838,11 @@ class UsersController extends AdminController {
'email' => $row[3],
'password' => $pass,
'activated' => $activated,
'location_id' => $row[4],
'location_id' => $user_location_id,
'phone' => $row[5],
'jobtitle' => $row[6],
'employee_num' => $row[7],
//'company_id' => Company::getIdForUser($row[8]),
'permissions' => '{"user":1}',
'notes' => 'Imported user'
);
@@ -845,7 +907,9 @@ class UsersController extends AdminController {
$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'))->with('assets', 'accessories', 'consumables', 'licenses', 'manager', 'sentryThrottle', 'groups', 'userloc');
$users = User::select(array('users.id','users.employee_num','users.email','users.username','users.location_id','users.manager_id','users.first_name','users.last_name','users.created_at','users.notes','users.company_id', 'users.deleted_at'))
->with('assets','accessories','consumables','licenses','manager','sentryThrottle','groups','userloc','company');
$users = Company::scopeCompanyables($users);
switch ($status) {
case 'deleted':
@@ -862,12 +926,15 @@ class UsersController extends AdminController {
switch (Input::get('sort'))
{
case 'manager':
$users = $users->OrderManager($order);
$users = $users->OrderManager($order);
break;
case 'location':
$users = $users->OrderLocation($order);
break;
default:
$allowed_columns =
[
'last_name','first_name','email','username','location',
'last_name','first_name','email','username','employee_num',
'assets','accessories', 'consumables','licenses','groups'
];
@@ -912,6 +979,7 @@ class UsersController extends AdminController {
$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!='') ?
@@ -922,12 +990,14 @@ class UsersController extends AdminController {
'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(),
'employee_num' => $user->employee_num,
'licenses' => $user->licenses->count(),
'accessories' => $user->accessories->count(),
'consumables' => $user->consumables->count(),
'groups' => $group_names,
'notes' => $user->notes,
'actions' => ($actions) ? $actions : ''
'actions' => ($actions) ? $actions : '',
'companyName' => is_null($user->company) ? '' : e($user->company->name)
);
}
@@ -938,7 +1008,7 @@ class UsersController extends AdminController {
/**
* Upload the file to the server
*
* @param int $assetId
* @param int $userId
* @return View
* */
public function postUpload($userId = null) {
@@ -949,7 +1019,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) {
@@ -1000,7 +1073,8 @@ class UsersController extends AdminController {
/**
* Delete the associated file
*
* @param int $assetId
* @param int $userId
* @param int $fileId
* @return View
* */
public function getDeleteFile($userId = null, $fileId = null) {
@@ -1010,13 +1084,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'));
@@ -1029,7 +1109,8 @@ class UsersController extends AdminController {
/**
* Display/download the uploaded file
*
* @param int $assetId
* @param int $userId
* @param int $fileId
* @return View
* */
public function displayFile($userId = null, $fileId = null) {
@@ -1038,9 +1119,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'));
@@ -1084,7 +1171,7 @@ class UsersController extends AdminController {
protected $ldapValidationRules = array(
'firstname' => 'required|alpha_space|min:2',
'lastname' => 'required|alpha_space|min:2',
'employee_number' => 'numeric',
'employee_number' => 'alpha_space',
'username' => 'required|min:2|unique:users,username',
'email' => 'email|unique:users,email',
);
@@ -1115,20 +1202,27 @@ class UsersController extends AdminController {
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_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 = 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_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;
$ldap_result_email = Setting::getSettings()->ldap_email;
$ldap_server_cert_ignore = Setting::getSettings()->ldap_server_cert_ignore;
// If we are ignoring the SSL cert we need to setup the environment variable
// before we create the connection
if($ldap_server_cert_ignore) {
putenv('LDAPTLS_REQCERT=never');
}
// Connect to LDAP server
$ldapconn = @ldap_connect($url);
@@ -1148,6 +1242,8 @@ class UsersController extends AdminController {
// Binding to ldap server
$ldapbind = @ldap_bind($ldapconn, $username, $password);
Log::error(ldap_errno($ldapconn));
if (!$ldapbind) {
return Redirect::route('users')->with('error', Lang::get('admin/users/message.error.ldap_could_not_bind').ldap_error($ldapconn));
}
@@ -18,6 +18,7 @@ class CreateModelsTable extends Migration
$table->integer('manufacturer_id')->nullable();
$table->integer('category_id')->nullable();
$table->timestamps();
$table->engine = 'InnoDB';
});
}
@@ -16,6 +16,7 @@ class CreateCategoriesTable extends Migration
$table->string('name');
$table->integer('parent')->default(0);
$table->timestamps();
$table->engine = 'InnoDB';
});
}
@@ -15,6 +15,7 @@ class CreateManufacturersTable extends Migration
$table->increments('id');
$table->string('name');
$table->timestamps();
$table->engine = 'InnoDB';
});
}
@@ -24,6 +24,7 @@ class CreateAssetsTable extends Migration
$table->text('notes');
$table->integer('user_id');
$table->timestamps();
$table->engine = 'InnoDB';
});
}
@@ -25,6 +25,7 @@ class CreateLicensesTable extends Migration
$table->text('notes');
$table->integer('user_id');
$table->timestamps();
$table->engine = 'InnoDB';
});
}
@@ -17,6 +17,7 @@ class CreateDepreciationsTable extends Migration
$table->integer('months');
$table->timestamps();
$table->integer('user_id');
$table->engine = 'InnoDB';
//$table->foreign('user_id')->references('id')->on('users');
});
}
@@ -19,6 +19,7 @@ class CreateLocationsTable extends Migration
$table->string('country',2);
$table->timestamps();
$table->integer('user_id');
$table->engine = 'InnoDB';
});
}
@@ -17,6 +17,7 @@ class CreateHistoryTable extends Migration
$table->integer('location_id')->nullable;
$table->timestamps();
$table->integer('user_id');
$table->engine = 'InnoDB';
});
}
@@ -18,6 +18,7 @@ class CreateSettingsTable extends Migration
$table->string('option_value');
$table->timestamps();
$table->integer('user_id');
$table->engine = 'InnoDB';
});
}
@@ -17,6 +17,7 @@ class CreateStatusLabels extends Migration
$table->integer('user_id');
$table->timestamps();
$table->softDeletes();
$table->engine = 'InnoDB';
});
}
@@ -19,6 +19,7 @@ class AddUploadsTable extends Migration
$table->string('filenotes')->nullable;
$table->timestamps();
$table->softDeletes();
$table->engine = 'InnoDB';
});
}
@@ -25,6 +25,7 @@ class ReCreateLicensesTable extends Migration
$table->integer('depreciation_id');
$table->timestamps();
$table->softDeletes();
$table->engine = 'InnoDB';
});
}
@@ -20,6 +20,7 @@ class CreateLicenseSeatsTable extends Migration
$table->integer('user_id');
$table->timestamps();
$table->softDeletes();
$table->engine = 'InnoDB';
});
}
@@ -25,6 +25,7 @@ class CreateNewLicensesTable extends Migration
$table->integer('depreciation_id');
$table->timestamps();
$table->softDeletes();
$table->engine = 'InnoDB';
});
}
@@ -28,6 +28,7 @@ class AddSuppliers extends Migration
$table->timestamps();
$table->integer('user_id');
$table->softDeletes();
$table->engine = 'InnoDB';
});
}
@@ -29,15 +29,15 @@ class AddEulaFields extends Migration {
});
Schema::create('requested_assets', function ($table) {
$table->increments('id');
$table->integer('asset_id')->default(NULL);
$table->integer('user_id')->default(NULL);
$table->dateTime('accepted_at')->nullable()->default(NULL);
$table->dateTime('denied_at')->nullable()->default(NULL);
$table->string('notes')->default(NULL);
$table->timestamps();
});
Schema::create('requested_assets', function ($table) {
$table->increments('id');
$table->integer('asset_id')->default(NULL);
$table->integer('user_id')->default(NULL);
$table->dateTime('accepted_at')->nullable()->default(NULL);
$table->dateTime('denied_at')->nullable()->default(NULL);
$table->string('notes')->default(NULL);
$table->timestamps();
});
}
/**
@@ -22,6 +22,7 @@ class AddAccessoriesTable extends Migration {
$table->boolean('requestable')->default(0);
$table->timestamps();
$table->softDeletes();
$table->engine = 'InnoDB';
});
Schema::table('asset_logs', function ($table) {
@@ -17,12 +17,13 @@ class CreateConsumables extends Migration {
$table->increments('id');
$table->string('name')->nullable()->default(NULL);
$table->integer('category_id')->nullable()->default(NULL);
$table->integer('location_id')->nullable()->default(NULL);
$table->integer('location_id')->nullable()->default(NULL);
$table->integer('user_id')->nullable()->default(NULL);
$table->integer('qty')->default(0);
$table->boolean('requestable')->default(0);
$table->timestamps();
$table->softDeletes();
$table->engine = 'InnoDB';
});
Schema::table('asset_logs', function ($table) {
@@ -0,0 +1,36 @@
<?php
//use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCustomFieldsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('custom_fields', function ($table) {
$table->increments('id');
$table->string('name');
$table->string('format');
$table->string('element');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::drop('custom_fields');
}
}
@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCustomFieldCustomFieldset extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('custom_field_custom_fieldset', function(Blueprint $table)
{
$table->integer('custom_field_id');
$table->integer('custom_fieldset_id');
$table->integer('order');
$table->boolean('required');
$table->engine = 'InnoDB';
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('custom_field_custom_fieldset');
}
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCustomFieldsets extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('custom_fieldsets', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->engine = 'InnoDB';
//
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('custom_fieldsets');
}
}
@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddFieldsetIdToAssets extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('models', function (Blueprint $table) {
$table->integer('fieldset_id')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('models',function (Blueprint $table) {
$table->dropColumn('fieldset_id');
});
}
}
@@ -0,0 +1,57 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class MigrateMacAddress extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
$f2=new CustomFieldset(['name' => "Asset with MAC Address"]);
$f2->timestamps=false; //when this model was first created, it had no timestamps. But later on it gets them.
if(!$f2->save()) {
throw new Exception("couldn't save customfieldset");
}
$macid=DB::table('custom_fields')->insertGetId([
'name' => "MAC Address",
'format' => CustomField::$PredefinedFormats['MAC'],
'element'=>'text']);
if(!$macid) {
throw new Exception("Can't save MAC Custom field: $macid");
}
$f2->fields()->attach($macid,['required' => false, 'order' => 1]);
Model::where(["show_mac_address" => true])->update(["fieldset_id"=>$f2->id]);
DB::statement("ALTER TABLE assets CHANGE mac_address _snipeit_mac_address varchar(255)");
$ans=Schema::table("models",function (Blueprint $table) {
$table->renameColumn('show_mac_address','deprecated_mac_address');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
$f=CustomFieldset::where(["name" => "Asset with MAC Address"])->first();
$f->fields()->delete();
$f->delete();
Schema::table("models",function(Blueprint $table) {
$table->renameColumn("deprecated_mac_address","show_mac_address");
});
DB::statement("ALTER TABLE assets CHANGE _snipeit_mac_address mac_address varchar(255)");
}
}
@@ -0,0 +1,33 @@
<?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();
$table->engine = 'InnoDB';
});
}
/**
* 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,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');
});
}
}
@@ -0,0 +1,77 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ImportLdapSettings extends Migration {
/**
* Migration to pull in LDAP settings from ldap.config into database.
*
* @return void
*/
public function up()
{
$settings = Setting::first();
// Only update the settings record if there IS an LDAP Config
// AND the Settings table doesn't already have LDAP settings in it
if ((Config::get('ldap.url')) && ($settings->ldap_server=='')) {
$settings->ldap_enabled = 1;
$settings->ldap_server = Config::get('ldap.url');
$settings->ldap_uname = Config::get('ldap.username');
$settings->ldap_pword = Crypt::encrypt(Config::get('ldap.password'));
$settings->ldap_basedn = Config::get('ldap.basedn');
$settings->ldap_filter = Config::get('ldap.filter');
$settings->ldap_username_field = Config::get('ldap.result.username');
$settings->ldap_lname_field = Config::get('ldap.result.last.name');
$settings->ldap_fname_field = Config::get('ldap.result.first.name');
$settings->ldap_auth_filter_query = Config::get('ldap.authentication.filter.query');
$settings->ldap_version = Config::get('ldap.version');
$settings->ldap_active_flag = Config::get('ldap.result.active.flag');
$settings->ldap_emp_num = Config::get('ldap.result.emp.num');
$settings->ldap_email = Config::get('ldap.result.email');
// Save the imported settings
if ($settings->save()) {
echo 'LDAP settings imported into database'."\n";
// Copy the old LDAP config file to prevent any future confusion
if (@copy(app_path().'/config/'.app()->environment().'/ldap.php', app_path().'/config/'.app()->environment().'/deprecated.ldap.php')) {
if (@unlink(app_path().'/config/'.app()->environment().'/ldap.php')) {
echo 'Original LDAP file archived to '.app_path().'/config/'.app()->environment().'/deprecated.ldap.php'."\n";
} else {
echo 'Could not archive LDAP config file'."\n";
}
} else {
echo 'Could not archive LDAP config file'."\n";
}
}
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
if (@copy(app_path().'/config/'.app()->environment().'/deprecated.ldap.php', app_path().'/config/'.app()->environment().'/ldap.php')) {
echo 'Un-archived LDAP config file'."\n";
@unlink(app_path().'/config/'.app()->environment().'/deprecated.ldap.php');
} else {
echo 'Could not un-archive LDAP config file. Manually rename it instead.'."\n";
}
}
}
@@ -0,0 +1,54 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RemoveFkCompanyId extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
// Schema::table('users', function(Blueprint $table)
// {
// $table->dropForeign('users_company_id_foreign');
// });
//
// Schema::table('accessories', function(Blueprint $table)
// {
// $table->dropForeign('accessories_company_id_foreign');
// });
//
// Schema::table('assets', function(Blueprint $table)
// {
// $table->dropForeign('assets_company_id_foreign');
// });
//
// Schema::table('consumables', function(Blueprint $table)
// {
// $table->dropForeign('consumables_company_id_foreign');
// });
//
// Schema::table('licenses', function(Blueprint $table)
// {
// $table->dropForeign('licenses_company_id_foreign');
// });
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddLdapServerCertIgnoreToSettingsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function(Blueprint $table)
{
$table->boolean('ldap_server_cert_ignore')->default(FALSE);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function(Blueprint $table)
{
$table->dropColumn('ldap_server_cert_ignore');
});
}
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddTimestampAndUserIdToCustomFields extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('custom_fields', function(Blueprint $table)
{
$table->integer("user_id")->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('custom_fields', function(Blueprint $table)
{
$table->dropColumn("user_id");
});
}
}
@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddTimestampAndUserIdToCustomFieldsets extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::table('custom_fieldsets', function(Blueprint $table)
{
$table->timestamps();
$table->integer("user_id")->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('custom_fieldsets', function(Blueprint $table)
{
$table->dropTimestamps();
$table->dropColumn("user_id");
});
}
}
+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'));
}
});
/*
+28 -6
View File
@@ -5,13 +5,16 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
function ParseFloat($floatString){
// use comma for thousands until local info is property used
$LocaleInfo = localeconv();
$floatString = str_replace("," , "", $floatString);
$floatString = str_replace($LocaleInfo["decimal_point"] , ".", $floatString);
return floatval($floatString);
if(!function_exists("ParseFloat")) {
//this may be only necessary to run tests?
function ParseFloat($floatString){
// use comma for thousands until local info is property used
$LocaleInfo = localeconv();
$floatString = str_replace("," , "", $floatString);
$floatString = str_replace($LocaleInfo["decimal_point"] , ".", $floatString);
return floatval($floatString);
}
}
function modelList() {
@@ -23,6 +26,14 @@ function modelList() {
return $model_list;
}
function companyList() {
$company_list = array('' => '') + DB::table('companies')
->orderBy('name', 'asc')
->lists('name', 'id');
return $company_list;
}
function categoryList() {
$category_list = array('' => '') + DB::table('categories')
->whereNull('deleted_at')
@@ -86,6 +97,17 @@ function usersList() {
return $users_list;
}
function customFieldsetList() {
$customfields=CustomFieldset::lists('name','id');
return array('' => Lang::get('admin/models/general.no_custom_field')) + $customfields;
}
function predefined_formats() {
$keys=array_keys(CustomField::$PredefinedFormats);
$stuff=array_combine($keys,$keys);
return $stuff+["" => "Custom Format..."];
}
function barcodeDimensions ($barcode_type = 'QRCODE') {
if ($barcode_type == 'C128') {
$size['height'] = '-1';
+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' => 'تم إخراج الملحق بنجاح.',
+3 -1
View File
@@ -1,7 +1,9 @@
<?php
return array(
'bulk_delete' => 'Confrm Bulk Delete Assets',
'bulk_delete_help' => 'Review the assets for bulk deletion below. Once deleted, these assets can be restored, but they will no longer be associated with any users they are currently assigned to.',
'bulk_delete_warn' => 'You are about to delete :asset_count assets.',
'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.',
+6 -1
View File
@@ -52,7 +52,12 @@ return array(
'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.'
'user_does_not_exist' => 'That user is invalid.. Please try again.'
),
'requests' => array(
'error' => 'Asset was not requested, please try again',
'success' => 'Asset requested successfully.',
)
);
+1
View File
@@ -18,6 +18,7 @@ return array(
'serial' => 'Serial',
'status' => 'Status',
'title' => 'Asset ',
'image' => 'Device Image',
'days_without_acceptance' => 'Days Without Acceptance'
);
+4 -2
View File
@@ -2,10 +2,12 @@
return array(
'deleted' => 'This model has been deleted. <a href="/hardware/models/:model_id/restore">Click here to restore it</a>.',
'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',
'show_mac_address' => 'Show MAC address field in assets in this model',
'view_deleted' => 'View Deleted',
'view_models' => 'View Models',
'fieldset' => 'Fieldset',
'no_custom_field' => 'No custom fields',
);
+22 -1
View File
@@ -26,9 +26,30 @@ return array(
'header_color' => 'Header Color',
'info' => 'These settings let you customize certain aspects of your installation.',
'laravel' => 'Laravel Version',
'ldap_enabled' => 'LDAP enabled',
'ldap_integration' => 'LDAP Integration',
'ldap_settings' => 'LDAP Settings',
'ldap_server' => 'LDAP Server',
'ldap_server_cert' => 'LDAP SSL certificate validation',
'ldap_server_cert_ignore' => 'Allow invalid SSL Certificate',
'ldap_server_cert_help' => 'Select this checkbox if you are using a self signed SSL cert and would like to accept an invalid SSL certificate.',
'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',
@@ -50,5 +71,5 @@ return array(
'value' => 'Value',
'brand' => 'Branding',
'about_settings_title' => 'About Settings',
'about_settings_text' => 'These settings let you customize certain aspects of your installation.',
'about_settings_text' => 'These settings let you customize certain aspects of your installation.',
);
+1
View File
@@ -33,6 +33,7 @@ return array(
'import' => 'حدث خطأ أثناء استيراد المستخدمين. حاول مرة أخرى.',
'asset_already_accepted' => 'هذا الجهاز تم قبوله مسبقاً.',
'accept_or_decline' => 'You must either accept or decline this asset.',
'incorrect_user_accepted' => 'The asset you have attempted to accept was not checked out to you.',
'ldap_could_not_connect' => 'Could not connect to the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server:',
'ldap_could_not_bind' => 'Could not bind to the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server: ',
'ldap_could_not_search' => 'Could not search the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server:',
+8 -2
View File
@@ -8,6 +8,7 @@
'activity_report' => 'Activity Report',
'address' => 'العنوان',
'admin' => 'الإدارة',
'add_seats' => 'Added seats',
'all_assets' => 'كل الأصول',
'all' => 'الكل',
'archived' => 'Archived',
@@ -30,6 +31,8 @@
'checkin_from' => 'Checkin from',
'checkout' => 'ترجيع',
'city' => 'المدينة',
'companies' => 'Companies',
'company' => 'Company',
'consumable' => 'Consumable',
'consumables' => 'Consumables',
'country' => 'الدولة',
@@ -66,8 +69,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' => 'الرخص المتاحة',
@@ -99,9 +103,10 @@
'processing' => 'Processing',
'profile' => 'ملفك الشخصي',
'qty' => 'QTY',
'quanitity' => 'Quanitity',
'quantity' => 'Quantity',
'ready_to_deploy' => 'جاهزة للتوزيع',
'recent_activity' => 'Recent Activity',
'remove_company' => 'Remove Company Association',
'reports' => 'التقارير',
'requested' => 'Requested',
'save' => 'حفظ',
@@ -140,4 +145,5 @@
'years' => 'سنوات',
'yes' => 'نعم',
'zip' => 'الرمز البريدي',
'noimage' => 'No image uploaded or image not found.',
];
+3 -3
View File
@@ -5,14 +5,14 @@ return array(
'about_accessories_text' => 'Аксесоарите са всички неща, които се изписват на потребителите, но нямат сериен номер (или няма нужда да бъдат конкретно проследявани). Например, това са мишки, клавиатури и др.',
'accessory_category' => 'Категория аксесоари',
'accessory_name' => 'Аксесоар',
'cost' => 'Purchase Cost',
'cost' => 'Стойност на закупуване',
'create' => 'Създаване на аксесоар',
'date' => 'Purchase Date',
'date' => 'Дата на закупуване',
'eula_text' => 'EULA на категорията',
'eula_text_help' => 'Това поле позволява да задавате различни EULA за всеки тип активи. Ако имате обща EULA за всички активи, можете да използвате кутийката по-долу за да използвате една обща по подразбиране.',
'require_acceptance' => 'Задължаване на потребителите да потвърждават приемането на активи от тази категория.',
'no_default_eula' => 'Няма EULA по подразбиране. Добавете я в Настройки.',
'order' => 'Order Number',
'order' => 'Номер на поръчка',
'qty' => 'Количество',
'total' => 'Oбщо',
'remaining' => 'Наличност',
+6 -6
View File
@@ -2,17 +2,17 @@
return array(
'does_not_exist' => 'Няма такава категория.',
'does_not_exist' => 'Аксесоарът на съществува.',
'assoc_users' => 'От този аксесоар са предадени :count броя на потребителите. Моля впишете обратно нови или върнати и опитайте отново.',
'create' => array(
'error' => 'Категорията не беше създадена. Моля опитайте отново.',
'success' => 'Категорията е създадена.'
'error' => 'Аксесоарът не беше създаден. Моля опитайте отново.',
'success' => 'Аксесоарът създаден успешно.'
),
'update' => array(
'error' => 'Категорията не беше обновена. Моля опитайте отново.',
'success' => 'Категорията е обновена.'
'error' => 'Аксесоарът не беше обновен. Моля опитайте отново.',
'success' => 'Аксесоарът обновен успешно.'
),
'delete' => array(
@@ -20,7 +20,7 @@ return array(
'error' => 'Проблем при изтриване на категорията. Моля опитайте отново.',
'success' => 'Категорията бе изтрита успешно.'
),
'checkout' => array(
'error' => 'Аксесоарът не беше изписан. Моля опитайте отново.',
'success' => 'Аксесоарът изписан успешно.',
+3 -3
View File
@@ -4,10 +4,10 @@ return array(
'about_consumables_title' => 'Относно консумативите',
'about_consumables_text' => 'Консумативите са всички неща, купувани във времето. Например тонер за принтер или хартия.',
'consumable_name' => 'Консуматив',
'cost' => 'Purchase Cost',
'cost' => 'Стойност на закупуване',
'create' => 'Създаване на консуматив',
'date' => 'Purchase Date',
'order' => 'Order Number',
'date' => 'Дата на закупуване',
'order' => 'Номер на поръчка',
'remaining' => 'Остава',
'total' => 'Oбщо',
'update' => 'Обновяване на консуматив',
+3 -1
View File
@@ -1,7 +1,9 @@
<?php
return array(
'bulk_delete' => 'Confrm Bulk Delete Assets',
'bulk_delete_help' => 'Review the assets for bulk deletion below. Once deleted, these assets can be restored, but they will no longer be associated with any users they are currently assigned to.',
'bulk_delete_warn' => 'You are about to delete :asset_count assets.',
'bulk_update' => 'Масово обновяване на активи',
'bulk_update_help' => 'Тук можете да обновите множество активи едновременно. Попълнете единствено полетата, които желаете да промените. Всички празни полета няма да бъдат променени.',
'bulk_update_warn' => 'Ще бъдат променени записите за :asset_count актива.',
+5
View File
@@ -52,6 +52,11 @@ return array(
'error' => 'Активът не беше вписан. Моля опитайте отново.',
'success' => 'Активът вписан успешно.',
'user_does_not_exist' => 'Невалиден потребител. Моля опитайте отново.'
),
'requests' => array(
'error' => 'Asset was not requested, please try again',
'success' => 'Asset requested successfully.',
)
);
+1
View File
@@ -18,6 +18,7 @@ return array(
'serial' => 'Сериен номер',
'status' => 'Статус',
'title' => 'Актив ',
'image' => 'Изображение на устройството',
'days_without_acceptance' => 'Дни без да е предаден'
);
+2 -2
View File
@@ -1,8 +1,8 @@
<?php
return array(
'assets_rtd' => 'Assets RTD',
'assets_checkedout' => 'Assets Assigned',
'assets_rtd' => 'Бракувани активи',
'assets_checkedout' => 'Изписани активи',
'id' => 'ID',
'city' => 'Град',
'state' => 'Област',
+4 -2
View File
@@ -2,10 +2,12 @@
return array(
'deleted' => 'Моделът беше изтрит. <a href="/hardware/models/:model_id/restore">Възстановяване</a>.',
'deleted' => 'Моделът беше изтрит. <a href="/hardware/models/:model_id/restore">Възстановяване</a>.',
'restore' => 'Възстановяване на модел',
'show_mac_address' => 'Визуализиране на поле за MAC адрес в активите за този модел',
'show_mac_address' => 'Визуализиране на поле за MAC адрес в активите за този модел',
'view_deleted' => 'Преглед на изтритите',
'view_models' => 'Преглед на моделите',
'fieldset' => 'Fieldset',
'no_custom_field' => 'No custom fields',
);
+26 -5
View File
@@ -26,9 +26,30 @@ return array(
'header_color' => 'Цвят на хедъра',
'info' => 'Тези настройки позволяват да конфигурирате различни аспекти на Вашата инсталация.',
'laravel' => 'Версия на Laravel',
'load_remote_text' => 'Remote Scripts',
'load_remote_help_text' => 'This Snipe-IT install can load scripts from the outside world.',
'ldap_enabled' => 'LDAP включен',
'ldap_integration' => 'LDAP интеграция',
'ldap_settings' => 'LDAP настройки',
'ldap_server' => 'LDAP сървър',
'ldap_server_cert' => 'LDAP SSL certificate validation',
'ldap_server_cert_ignore' => 'Allow invalid SSL Certificate',
'ldap_server_cert_help' => 'Select this checkbox if you are using a self signed SSL cert and would like to accept an invalid SSL certificate.',
'ldap_uname' => 'LDAP потребител за връзка',
'ldap_pword' => 'LDAP парола на потребител за връзка',
'ldap_basedn' => 'Базов DN',
'ldap_filter' => 'LDAP филтър',
'ldap_username_field' => 'Поле за потребителско име',
'ldap_lname_field' => 'Фамилия',
'ldap_fname_field' => 'LDAP собствено име',
'ldap_auth_filter_query' => 'LDAP оторизационна заявка',
'ldap_version' => 'LDAP версия',
'ldap_active_flag' => 'LDAP флаг за активност',
'ldap_emp_num' => 'LDAP номер на служител',
'ldap_email' => 'LDAP електронна поща',
'load_remote_text' => 'Отдалечени скриптове',
'load_remote_help_text' => 'Тази Snipe-IT инсталация може да зарежда и изпълнява външни скриптове.',
'logo' => 'Лого',
'full_multiple_companies_support_help_text' => 'Ограничаване на потребителите (включително административните) до активите на собствената им компания.',
'full_multiple_companies_support_text' => 'Поддръжка на множество компании',
'optional' => 'незадължително',
'per_page' => 'Резултати на страница',
'php' => 'PHP версия',
@@ -48,7 +69,7 @@ return array(
'system' => 'Информация за системата',
'update' => 'Обновяване на настройките',
'value' => 'Стойност',
'brand' => 'Branding',
'about_settings_title' => 'About Settings',
'about_settings_text' => 'These settings let you customize certain aspects of your installation.',
'brand' => 'Брандиране',
'about_settings_title' => 'Относно настройките',
'about_settings_text' => 'Тези настройки позволяват да конфигурирате различни аспекти на Вашата инсталация.',
);
+1
View File
@@ -33,6 +33,7 @@ return array(
'import' => 'Проблем при зареждането на потребителите. Моля опитайте отново.',
'asset_already_accepted' => 'Този актив е вече приет.',
'accept_or_decline' => 'Трябва да приемете или да откажете този актив.',
'incorrect_user_accepted' => 'The asset you have attempted to accept was not checked out to you.',
'ldap_could_not_connect' => 'Проблем при комуникацията с LDAP сървъра. Моля прегледайте конфигурацията на LDAP.<br/>Грешка от LDAP сървъра: ',
'ldap_could_not_bind' => 'Проблем при връзката с LDAP сървъра. Моля прегледайте конфигурацията на LDAP.<br/>Грешка от LDAP сървъра: ',
'ldap_could_not_search' => 'Проблем при търсенето в LDAP сървъра. Моля прегледайте конфигурацията на LDAP.<br/>Грешка от LDAP сървъра: ',
+9 -3
View File
@@ -8,6 +8,7 @@
'activity_report' => 'Справка за дейностите',
'address' => 'Aдрес',
'admin' => 'Администриране',
'add_seats' => 'Added seats',
'all_assets' => 'Всички активи',
'all' => 'Всички',
'archived' => 'Архивирани',
@@ -30,6 +31,8 @@
'checkin_from' => 'Форма за вписване',
'checkout' => 'Изписване',
'city' => 'Град',
'companies' => 'Компании',
'company' => 'Компания',
'consumable' => 'Консуматив',
'consumables' => 'Консумативи',
'country' => 'Държава',
@@ -43,7 +46,7 @@
'date' => 'Дата',
'delete' => 'Изтриване',
'deleted' => 'Изтрито',
'delete_seats' => 'Deleted Seats',
'delete_seats' => 'Изтрити работни места за лиценз',
'deployed' => 'Изписани',
'depreciation_report' => 'Справка за амортизации',
'download' => 'Изтегляне',
@@ -66,8 +69,9 @@
'asset_maintenance_report' => 'Справка за поддръжка на активи',
'asset_maintenances' => 'Поддръжки на активи',
'item' => 'Информация',
'insufficient_permissions' => 'Нямате необходимите права!',
'last' => 'Последна',
'last_name' => 'Фамилия',
'last_name' => 'Фамилия',
'license' => 'Лиценз',
'license_report' => 'Справка за лицензите',
'licenses_available' => 'налични лицензи',
@@ -99,9 +103,10 @@
'processing' => 'Обработка',
'profile' => 'Вашият профил',
'qty' => 'Количество',
'quanitity' => 'Количество',
'quantity' => 'Quantity',
'ready_to_deploy' => 'Готово за предоставяне',
'recent_activity' => 'Последни действия',
'remove_company' => 'Remove Company Association',
'reports' => 'Справки',
'requested' => 'Изискан',
'save' => 'Запис',
@@ -140,4 +145,5 @@
'years' => 'години',
'yes' => 'Да',
'zip' => 'Пощенски код',
'noimage' => 'Липсва изображение или не е качено.',
];
+3 -3
View File
@@ -5,14 +5,14 @@ return array(
'about_accessories_text' => 'Příslušenství je cokoliv, co předáte uživatelům, ale nemá to sérivoé číslo (nebo to neevidujete). Např. myš, klávesnice.',
'accessory_category' => 'Kategorie příslušenství',
'accessory_name' => 'Název příslušenství',
'cost' => 'Purchase Cost',
'cost' => 'Pořizovací cena',
'create' => 'Vytvoř příslušenství',
'date' => 'Purchase Date',
'date' => 'Datum pořízení',
'eula_text' => 'Kategorie EULA',
'eula_text_help' => 'Toto pole umožňuje upravit EULA pro různé druhy majetku. Pokud máte pouze jeden typ pro všechen majetek, můžete zaškrtnout položku níže pro použití jako výchozí.',
'require_acceptance' => 'Požadovat potvrzení převzetí majetku v této kategorii.',
'no_default_eula' => 'Žádná primární EULA. Přidat novou v Nastavení.',
'order' => 'Order Number',
'order' => 'Číslo objednávky',
'qty' => 'Množství',
'total' => 'CELKEM',
'remaining' => 'Dostupný',
+6 -6
View File
@@ -2,17 +2,17 @@
return array(
'does_not_exist' => 'Kategorie neexistuje.',
'does_not_exist' => 'Doplněk neexistuje.',
'assoc_users' => 'Tato kategorie má nyní :count položek k předání uživatelům. Zkontrolujte převzetí příslušenství a zkuste to znovu. ',
'create' => array(
'error' => 'Kategorie nevytvořena, zkuste to znovu.',
'success' => 'Kategorie úspěšně vytvořena.'
'error' => 'Doplněk nebyl vytvořen, prosím zkuste to znovu.',
'success' => 'Doplněk byl úspěšně vytvořen.'
),
'update' => array(
'error' => 'Kategorie neaktualizována, zkuste to znovu',
'success' => 'Kategorie úspěšně aktualizována.'
'error' => 'Doplněk nebyl upraven, prosím zkuste to znovu',
'success' => 'Doplněk byl úspěšně upraven.'
),
'delete' => array(
@@ -20,7 +20,7 @@ return array(
'error' => 'Vyskytl se problém při mazání kategorie. Zkuste to znovu.',
'success' => 'Kategorie byla úspěšně smazána.'
),
'checkout' => array(
'error' => 'Příslušenství nebylo převzato, zkuste to znovu',
'success' => 'Příslušenství úspěšně předáno.',
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
return array(
'dl_csv' => 'Download CSV',
'dl_csv' => 'Stáhnout CSV',
'eula_text' => 'EULA',
'id' => 'ID',
'require_acceptance' => 'Přijetí',
@@ -1,14 +1,14 @@
<?php
return [
'asset_maintenance_type' => 'Maintenance Type',
'title' => 'Title',
'asset_maintenance_type' => 'Druh údržby',
'title' => 'Název',
'start_date' => 'Začátek',
'completion_date' => 'Completed',
'completion_date' => 'Dokončeno',
'cost' => 'Cena',
'is_warranty' => 'Warranty Improvement',
'asset_maintenance_time' => 'Days',
'is_warranty' => 'Rozšíření záruky',
'asset_maintenance_time' => 'D',
'notes' => 'Poznámky',
'update' => 'Update',
'create' => 'Create'
'update' => 'Aktualizace',
'create' => 'Vytvořit'
];
@@ -1,10 +1,10 @@
<?php
return [
'asset_maintenances' => 'Asset Maintenances',
'edit' => 'Edit Asset Maintenance',
'delete' => 'Delete Asset Maintenance',
'view' => 'View Asset Maintenance Details',
'asset_maintenances' => 'Záznamy o údržbě zařízení',
'edit' => 'Upravit záznam o údržbě zařízení',
'delete' => 'Odstranit záznam o údržbě zařízení',
'view' => 'Zobrazit podrobnosti o údržbě zařízení',
'repair' => 'Oprava',
'maintenance' => 'Údržba',
'upgrade' => 'Upgradovat'
@@ -1,7 +1,7 @@
<?php
return [
'title' => 'Asset Maintenance',
'title' => 'Údržba zařízení',
'asset_name' => 'Název majetku',
'supplier_name' => 'Dodavatel',
'is_warranty' => 'Záruka',
+3 -1
View File
@@ -1,7 +1,9 @@
<?php
return array(
'bulk_delete' => 'Confrm Bulk Delete Assets',
'bulk_delete_help' => 'Review the assets for bulk deletion below. Once deleted, these assets can be restored, but they will no longer be associated with any users they are currently assigned to.',
'bulk_delete_warn' => 'You are about to delete :asset_count assets.',
'bulk_update' => 'Hromadná aktualizace majetku',
'bulk_update_help' => 'Tento formulář umožňuje hromadnou editaci majetku. Vyplňte pouze položky, které chcete změnit. Jakékoliv prázné položky zůstanou nezměněny. ',
'bulk_update_warn' => 'Budou se editovat vlastnosti :asset_count assets.',
+6 -1
View File
@@ -52,7 +52,12 @@ return array(
'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.'
'user_does_not_exist' => 'That user is invalid.. Please try again.'
),
'requests' => array(
'error' => 'Asset was not requested, please try again',
'success' => 'Asset requested successfully.',
)
);
+1
View File
@@ -18,6 +18,7 @@ return array(
'serial' => 'Sériové číslo',
'status' => 'Stav',
'title' => 'Majetek ',
'image' => 'Device Image',
'days_without_acceptance' => 'Days Without Acceptance'
);
+4 -2
View File
@@ -2,10 +2,12 @@
return array(
'deleted' => 'Model byl vymazán. <a href="/hardware/models/:model_id/restore">Klikněte sem pro jeho obnovení</a>.',
'deleted' => 'Model byl vymazán. <a href="/hardware/models/:model_id/restore">Klikněte sem pro jeho obnovení</a>.',
'restore' => 'Obnovení Modelu',
'show_mac_address' => 'Show MAC address field in assets in this model',
'show_mac_address' => 'Show MAC address field in assets in this model',
'view_deleted' => 'Zobrazit smazané',
'view_models' => 'Zobrazit Modely',
'fieldset' => 'Fieldset',
'no_custom_field' => 'No custom fields',
);
+22 -1
View File
@@ -26,9 +26,30 @@ return array(
'header_color' => 'Barva záhlaví',
'info' => 'Tato nastavení umožňují zvolit určité prvky instalace.',
'laravel' => 'Verze Laravel',
'ldap_enabled' => 'LDAP enabled',
'ldap_integration' => 'LDAP Integration',
'ldap_settings' => 'LDAP Settings',
'ldap_server' => 'LDAP Server',
'ldap_server_cert' => 'LDAP SSL certificate validation',
'ldap_server_cert_ignore' => 'Allow invalid SSL Certificate',
'ldap_server_cert_help' => 'Select this checkbox if you are using a self signed SSL cert and would like to accept an invalid SSL certificate.',
'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' => 'volitelný',
'per_page' => 'Výsledků na stránku',
'php' => 'Verze PHP',
@@ -50,5 +71,5 @@ return array(
'value' => 'Hodnota',
'brand' => 'Branding',
'about_settings_title' => 'About Settings',
'about_settings_text' => 'These settings let you customize certain aspects of your installation.',
'about_settings_text' => 'These settings let you customize certain aspects of your installation.',
);
+1
View File
@@ -33,6 +33,7 @@ return array(
'import' => 'There was an issue importing users. Please try again.',
'asset_already_accepted' => 'This asset has already been accepted.',
'accept_or_decline' => 'You must either accept or decline this asset.',
'incorrect_user_accepted' => 'The asset you have attempted to accept was not checked out to you.',
'ldap_could_not_connect' => 'Could not connect to the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server:',
'ldap_could_not_bind' => 'Could not bind to the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server: ',
'ldap_could_not_search' => 'Could not search the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server:',
+3 -3
View File
@@ -4,7 +4,7 @@ return array(
'activated' => 'Aktivní',
'allow' => 'Povolit',
'checkedout' => 'Assets',
'checkedout' => 'Zařízení',
'created_at' => 'Vytvořeno',
'createuser' => 'Nový uživatel',
'deny' => 'Zakázat',
@@ -25,8 +25,8 @@ return array(
'password_confirm' => 'Potvrzení hesla',
'password' => 'Heslo',
'phone' => 'Telefon',
'show_current' => 'Show Current Users',
'show_deleted' => 'Show Deleted Users',
'show_current' => 'Zobraz aktuální uživatele',
'show_deleted' => 'Zobraz smazané uživatele',
'title' => 'Title',
'updateuser' => 'Update User',
'username' => 'Uživatelské jméno',
+1 -1
View File
@@ -8,7 +8,7 @@ return array(
'delete' => 'Smazat',
'edit' => 'Upravit',
'restore' => 'Obnovit',
'request' => 'Request',
'request' => 'Požadavek',
'submit' => 'Odeslat',
'upload' => 'Nahrát',

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