Compare commits

...

589 Commits

Author SHA1 Message Date
snipe a4a29be868 Bumped version 2015-08-25 19:40:08 -07:00
snipe 2e7fd02f42 Updated language strings 2015-08-24 12:59:35 -07:00
snipe da6770c9d9 Fixes #1102 - default currency stored as htmlentities in the DB 2015-08-21 18:11:23 -07:00
snipe 7dd2b3d580 Fixes #1104 2015-08-21 16:00:03 -07:00
snipe e5b80ab423 Merge pull request #1105 from aalaily/develop
Remove hardcoded location in favour of a selection dropdown
2015-08-21 12:19:25 -07:00
Aladin Alaily 27efae93ac Add some explanation about the location field. 2015-08-21 10:42:37 -04:00
Aladin Alaily 960be7c5ae Replace hardcoded location with a user selection. 2015-08-21 10:40:18 -04:00
Aladin Alaily 0b5f83fc56 add a drop down of locations 2015-08-21 10:39:45 -04:00
snipe 89564b3d2a Merge pull request #1099 from kobie-chasehansen/fix-for-#1098
fix for #1098
2015-08-20 21:39:00 -07:00
Chase Hansen 610392777b fix 2015-08-21 00:30:55 -04:00
snipe e916fdcc89 Fixes #1092, setting LDAP_OPT_REFERRALS to 0 for Active Directory 2015-08-20 15:54:42 -07:00
snipe 70f7f65394 Fixed path for windows 2015-08-20 15:38:50 -07:00
snipe 8892feea62 Fixed typo 2015-08-20 15:38:35 -07:00
snipe c7b0ecfac8 Slack notification for requested assets 2015-08-19 17:51:35 -07:00
snipe d47198086f Added notes search to licenses 2015-08-19 17:23:55 -07:00
snipe 89f7f50901 Merge pull request #1074 from mtucker6784/develop
Installer modified for 2.0 (develop currently)
2015-08-19 17:16:53 -07:00
snipe 8339dd3db2 Fixes #1089 - checkout button on accessory view page 2015-08-19 17:13:14 -07:00
snipe e63d62d2c8 Fixes #1083 2015-08-19 12:33:16 -07:00
snipe 45c4624d5f Fixes #1081 2015-08-19 11:14:03 -07:00
snipe a27a98f4b3 Fixes #1081- include asset name on checkout 2015-08-19 11:13:51 -07:00
snipe 70a7a11324 Switched to user list 2015-08-19 10:54:50 -07:00
snipe e8f11919f7 Fixes #1077 - ordering of dropdown menus 2015-08-19 10:43:52 -07:00
snipe 1d976ff926 Fixes #1078 2015-08-19 10:23:01 -07:00
snipe 4a086cecfd Updated composer lock 2015-08-17 11:49:19 -07:00
snipe 890ef1eb1d Fixes #1038 - clickable links in dashboard 2015-08-17 11:24:10 -07:00
snipe 94e8b5f783 Fixed bug in expected checkin 2015-08-17 11:14:01 -07:00
snipe 21bb2f8b44 Updated language string for asset request 2015-08-17 11:11:09 -07:00
snipe aae7d4523f Don't need to float left there 2015-08-17 10:11:03 -07:00
snipe f7cc9036ea Added password generator to user creation 2015-08-17 10:06:37 -07:00
snipe 7dd50eddfa Nicer error messages on validation fail for LDAP 2015-08-14 22:57:32 -07:00
snipe c1642e3fe9 Examples included in example config files, moved email and employee number out of required fields 2015-08-14 22:27:10 -07:00
snipe 2036402742 Added filter string to default config 2015-08-14 22:20:22 -07:00
snipe e9e62fbfaf Updated sample LDAP config to include LDAP version number 2015-08-14 22:10:34 -07:00
snipe e49cfb4bde Fixed validation on LDAP 2015-08-14 22:10:05 -07:00
snipe db8ea88207 Updated example configs with acrive flag text 2015-08-14 21:38:42 -07:00
snipe 729795364b Merge branch 'develop' of https://github.com/aalaily/snipe-it into aalaily-develop
# Conflicts:
#	app/controllers/admin/UsersController.php
2015-08-14 21:36:09 -07:00
snipe ee46b223c9 Added LDAP options 2015-08-14 21:33:48 -07:00
snipe e7d7cc6fc2 Added space after error intro 2015-08-14 21:33:39 -07:00
Aladin Alaily 23bde13665 Corrected a typo and remove some testing code 2015-08-15 00:29:38 -04:00
Aladin Alaily 3dfbd8a4f0 Added a check for the "active" LDAP flag. Since this field is optional, it's important to check whether or not it's set, otherwise, the functionality will be unusable. 2015-08-15 00:27:56 -04:00
snipe 80fb7a4c13 Fixed author's name :P 2015-08-14 21:22:49 -07:00
Aladin Alaily b8ef6dfba4 Wrote more information about an optional field 2015-08-15 00:16:29 -04:00
snipe a57a465147 Removed port number 2015-08-14 20:58:47 -07:00
snipe e14ebd0daa Improved error messages and error handling 2015-08-14 20:50:01 -07:00
snipe 676bedc9be LDAP UI language strings 2015-08-14 20:15:24 -07:00
snipe 6b85bbfe65 Ignore the ldap config file 2015-08-14 19:41:36 -07:00
snipe b629fd36a0 Pull out LDAP config file. Derp 2015-08-14 19:41:12 -07:00
snipe 260abfc2d7 Only show LDAP stuff if the LDAP config has been set up in the config 2015-08-14 19:40:17 -07:00
snipe eb7017d5cb Example LDAP configs 2015-08-14 19:25:59 -07:00
snipe 4e86b590d4 Removed typo example script 2015-08-14 19:25:49 -07:00
snipe 95af577353 Merge pull request #1059 from aalaily/develop
User import with LDAP and LDAP authentication hook
2015-08-14 19:12:14 -07:00
snipe c4ba69b4b6 Only assign the first seat to the user 2015-08-14 15:08:18 -07:00
snipe 4b59a6cb5a License importer, small tweaks to asset importer 2015-08-14 14:08:34 -07:00
Aladin Alaily 229432af5e LDAP authentication hook 2015-08-14 14:30:38 -04:00
Aladin Alaily 43efe4e80b LDAP authentication hook 2015-08-14 14:29:32 -04:00
Aladin Alaily 286df911c0 LDAP authentication add query string 2015-08-14 14:29:14 -04:00
Aladin Alaily 54d95c510b Update the code to reflect a possible active flag in LDAP 2015-08-14 10:31:40 -04:00
Aladin Alaily 61a4b03aba Added the active flag. Some LDAP instances might have this flag set. 2015-08-14 10:31:22 -04:00
Aladin Alaily bebd569490 updated the sample config doc 2015-08-14 00:23:23 -04:00
Aladin Alaily 470b543910 Updated the view to match the controller 2015-08-14 00:17:50 -04:00
Aladin Alaily 07171498a9 Modified the code so that the LDAP field names can now be defined and fetched from the configuration file 2015-08-14 00:17:26 -04:00
Aladin Alaily 2dbeb1aeb5 Merge remote-tracking branch 'upstream/develop' into develop 2015-08-13 16:34:20 -04:00
snipe 4fcf70872f Fixes #1054 2015-08-13 13:24:38 -07:00
snipe ac7b5da711 Removed comments 2015-08-13 13:24:33 -07:00
Aladin Alaily 1fc83443db Check if the variables coming in from LDAP are set. 2015-08-13 15:48:03 -04:00
Aladin Alaily c17bbe9dfe Commented out the loop break. 2015-08-13 15:10:40 -04:00
Aladin Alaily 59617083c9 Fixed the break portion 2015-08-13 15:07:15 -04:00
Aladin Alaily d167f31af0 Fixed indents 2015-08-13 15:06:04 -04:00
Aladin Alaily 1343c09cd7 Made the user interface a little more neat. 2015-08-13 15:05:15 -04:00
Aladin Alaily 8e6621f332 Removed the ldap.php config file and added the example ldap config file. 2015-08-13 13:40:02 -04:00
Aladin Alaily 34b14f67c6 Fixed the formatting 2015-08-13 13:39:31 -04:00
Aladin Alaily 5574ea89bb Removed the references to the LOG class 2015-08-13 13:39:20 -04:00
Aladin Alaily d780f0f3cf Added some space between the Import and LDAP buttons 2015-08-13 13:32:19 -04:00
Aladin Alaily 03f5af29f2 Ignore netbeans config files 2015-08-13 13:29:20 -04:00
Aladin Alaily a531ea34bb Cleaned up the code 2015-08-13 13:27:24 -04:00
Aladin Alaily aa72b9c107 Added a button to the LDAP functionality 2015-08-13 13:27:05 -04:00
Aladin Alaily 176469294b Added routes to LDAP 2015-08-13 13:20:30 -04:00
Aladin Alaily afd94ff52a Added functions for LDAP 2015-08-13 13:20:13 -04:00
Aladin Alaily b2c2c1ee15 LDAP Sync 2015-08-13 13:14:11 -04:00
Aladin Alaily b004a7448b Merge remote-tracking branch 'upstream/develop' into develop 2015-08-13 12:26:10 -04:00
snipe c5e5930c1b Make sure lock passwords isn't true before emailing 2015-08-13 00:54:57 -07:00
snipe ed2d7310f8 Fixed unsuspend icon 2015-08-13 00:39:52 -07:00
snipe 547de2b9e3 Placeholder phpunit test 2015-08-13 00:26:26 -07:00
snipe 58abd15d93 Require_once (again) to try to handle local phpunit testing 2015-08-12 23:55:53 -07:00
snipe dd60976d51 Set errors to true 2015-08-12 23:52:44 -07:00
snipe 07b045007b Revert "Reverting to phpunit again"
This reverts commit 1159cdeab2.

# Conflicts:
#	.travis.yml
2015-08-12 23:39:16 -07:00
snipe 1f7e0a2893 Revert "More donking with testing"
This reverts commit 7f3ceea77b.

# Conflicts:
#	.travis.yml
2015-08-12 23:37:37 -07:00
snipe 1159cdeab2 Reverting to phpunit again 2015-08-12 23:32:38 -07:00
snipe 7f3ceea77b More donking with testing 2015-08-12 23:30:27 -07:00
snipe 1d89b78315 Nicer validation display 2015-08-12 22:34:44 -07:00
snipe 463469e7c7 Added validation for notes 2015-08-12 22:34:35 -07:00
snipe c839f0cbc8 Added ability to select status type 2015-08-12 22:33:56 -07:00
snipe a832346bfb Added statuslabel type helper 2015-08-12 22:33:31 -07:00
snipe 3d77666ad1 Nicer required field display 2015-08-12 21:55:23 -07:00
snipe 6ad7a9bb70 Replaced missing route from previous cleanup 2015-08-12 21:50:35 -07:00
snipe 7fa9e49880 Activate user created on modal create 2015-08-12 21:50:04 -07:00
snipe e2e070d5e1 Smaller min-height for tighter layout 2015-08-12 21:25:48 -07:00
snipe 9f4fca4238 Fixes #522 2015-08-12 21:25:36 -07:00
snipe b366dec983 Fix display for NULL entries created by previous model modal 2015-08-12 21:09:32 -07:00
snipe e91c1942f8 Save modelno in API 2015-08-12 20:58:44 -07:00
snipe 6f6b74b82c Add modelno to modal 2015-08-12 20:58:30 -07:00
snipe 315f02905a Pull all lists into helper functions for consistency 2015-08-12 20:58:18 -07:00
snipe 738e253375 Fixed Slack notifier 2015-08-12 18:37:48 -07:00
snipe 358cd1eaf9 More consistent formatting for maintenances 2015-08-12 18:24:38 -07:00
snipe e4284d20f3 Fixed error reporting 2015-08-12 18:19:59 -07:00
snipe f7874ec106 Refactored assets controller and model for cleaner code 2015-08-12 18:19:53 -07:00
snipe ad802cfead Squashed commit of the following:
commit 7ec9bec089408d5ec5e195b851b94568bee44627
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 14:43:11 2015 -0700

    Additional notes

commit 6c9d4c1b782c65f496828b289296304cdd75e01a
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 14:36:28 2015 -0700

    Deleted unused unit test

commit 9b1f0a8096c156927adf6cc8dad1df253b79707b
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 14:36:21 2015 -0700

    Switching back to require from require_once

commit 15db5e126d219e23180481d4559a7fd5e5d7e0d2
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 14:32:26 2015 -0700

    Commenting out the unit test for user because it's throwing hasher errors. Need to come back to this.

    This test is used when you call straight phpunit.

commit bc224f48e326babb4cd12296217e7665286102e9
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 14:29:31 2015 -0700

    Fuckit. phpunit it is.

commit e42801e436e3108e4db6ce38bec91be1ad8643f5
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 14:26:24 2015 -0700

    This will probably just trigger that damned curl error again :(

commit 8ad56fe92d6d86d78d8690a7a43ca17ea1ea6134
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 14:18:27 2015 -0700

    Removed phpbrowser

commit b72fc14cf4675523e7db9827602a9e6fbb1f1cfb
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 13:40:10 2015 -0700

    I don't know why route filters aren't working in the laravel module

commit 3226c687ac6538fd838710b601ba20a97bb23cb4
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 13:31:35 2015 -0700

    Require once in start?

commit 1cea92c4414689be7b411826ed4ce4e2b1768e61
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 13:16:32 2015 -0700

    Trying require_once

commit c8b9a2853cbb8bd65685c51b93fabccb15069b1a
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 13:13:35 2015 -0700

    Poking and hoping

commit e906d4daba8eb12be8b615dfadcedc3ea19eb58f
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 13:10:50 2015 -0700

    I cannot imagine that this will help, but whatever

commit 279be63f5a0c90278f961fde7228edddd65db612
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 12:53:11 2015 -0700

    Removing the laravel module returns the curl host error

commit ce3a2fc074fd597ebd274ad42925bcaebcd25ea4
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 12:51:25 2015 -0700

    Pulling laravel just to see

commit bd27268539b377d03031485e4e2c133ab02b4a1f
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 12:50:02 2015 -0700

    Turn off email notifications

commit 73d6f5cc6a2a5721acf686ad6a434a06cddcea38
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 12:49:14 2015 -0700

    Reverting the revert

commit 51a2f8f40e1b0240af2778076b21beb518b8909d
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 12:47:07 2015 -0700

    Reverting

commit aa36aff57fe734b0accd71eefe9b2f6b50b1f169
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 12:45:16 2015 -0700

    sigh.

commit a7241c0cf6b050768379e9b36c53584c29e1268a
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 12:38:14 2015 -0700

    Trying gitter again

commit 22b3190e0a
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 12:31:16 2015 -0700

    Missing a fucking semicolon

commit 637e4f03f3
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 12:26:23 2015 -0700

    Trying to fix parsefloat error

commit 70e086fb3d
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 12:22:51 2015 -0700

    Removed gitter

commit 65e6b1ad43
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 12:12:38 2015 -0700

    Removed extra comments, added route filter back in

commit c18e8747df
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 12:07:58 2015 -0700

    Removing sudo from codecept

commit 2c9c2fb2d6
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 12:06:18 2015 -0700

    Comment out ping debugging

commit 6eb57e43dc
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 12:04:23 2015 -0700

    Don't require sudo

commit 0c13c9e7bc
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 11:58:16 2015 -0700

    Use the Laravel 4 options instead of bootstrap

commit 8a3c672a82
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 11:51:30 2015 -0700

    Remove -vvv and -d for codeception

commit bd1e3cbc2a
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 11:50:12 2015 -0700

    Add gitter integration

commit 4eae1eb447
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 11:46:34 2015 -0700

    Try setting the hostname again and see if that fails

commit 01a6fbe19d
Merge: 8cdd44e f357e71
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 11 23:08:40 2015 -0700

    Merge branch 'travic-ci-misery' of github.com:snipe/snipe-it into travic-ci-misery

commit 8cdd44e650
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 11 23:08:34 2015 -0700

    Output dir

commit f357e71e20
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Tue Aug 11 22:54:32 2015 -0700

    blech

commit db2552ac2f
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Tue Aug 11 22:32:59 2015 -0700

    blech

commit 9a3d2c5130
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Tue Aug 11 22:29:52 2015 -0700

    wat

commit dd7864ac54
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Tue Aug 11 22:24:08 2015 -0700

    blech

commit 754aa2d0d8
Merge: 0ec8c87 d6d685c
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 11 22:19:14 2015 -0700

    Merge branch 'travic-ci-misery' of github.com:snipe/snipe-it into travic-ci-misery

commit 0ec8c87e8a
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 11 22:18:36 2015 -0700

    Slightly improved scenario description

commit d6d685c15e
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Tue Aug 11 22:15:32 2015 -0700

    blech

commit 58ac3b3fa4
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Tue Aug 11 22:10:00 2015 -0700

    blech

commit 89844a4017
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Tue Aug 11 22:05:13 2015 -0700

    blech

commit 4ccf1a513f
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Tue Aug 11 22:02:07 2015 -0700

    blech

commit 6ca0f6bdc4
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Tue Aug 11 21:59:45 2015 -0700

    blech

commit 1caa7fe28d
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Tue Aug 11 21:56:45 2015 -0700

    yuck

commit 24f7f3a892
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Tue Aug 11 21:52:53 2015 -0700

    try something else

commit f0c83ee253
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Tue Aug 11 21:47:51 2015 -0700

    trying to get phpinfo

commit 32336e7370
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 11 21:10:05 2015 -0700

    Verbose on coceception

commit ba29a13249
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 11 21:07:52 2015 -0700

    Remove codecoverage stuff just in case it's messing things up

commit 519ed11fc3
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 11 21:03:17 2015 -0700

    More poking and hoping

commit 9949d68341
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 11 20:55:24 2015 -0700

    Try forcing test env in codeception.yml

commit 4726639f85
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 11 20:49:23 2015 -0700

    Try switching back to the old instances

commit ce6e417a02
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 11 20:45:59 2015 -0700

    ...

commit c3767e25e4
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 11 20:42:32 2015 -0700

    Changed hostname for travis

commit d059511840
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 11 20:40:05 2015 -0700

    Try to echo out the hostname so I can have some idea of WTF is happening
2015-08-12 14:45:43 -07:00
snipe 41838f1e89 Trying worker-linux-docker- because why the hell not 2015-08-11 20:26:44 -07:00
snipe 8624931a88 Comment out initial test for now 2015-08-11 20:23:16 -07:00
snipe 8840e57ae7 Trying 'testing-worker-linux*' as hostname since nothing else is working 2015-08-11 20:23:00 -07:00
snipe 16cb4f6d05 Removed AlisonMPB hostname 2015-08-11 19:54:14 -07:00
snipe aa304375a6 Set default key 2015-08-11 19:54:03 -07:00
snipe b22789aa59 Unbreaking the dashboard :( 2015-08-11 19:44:02 -07:00
snipe f93e140ce1 Updated changelog 2015-08-11 19:43:51 -07:00
snipe de238f1551 Set testing hostname 2015-08-11 19:00:08 -07:00
snipe 4247904f19 Resolving hostname problems 2015-08-11 18:52:42 -07:00
snipe 75852bdb8b Derp 2015-08-11 18:40:16 -07:00
snipe 5cc1e7d3fe Trying to set hostname back so tests won't fail 2015-08-11 18:37:37 -07:00
snipe a98f4883be Merge branch 'develop' of github.com:snipe/snipe-it into JoeFaux-AccessoryReport 2015-08-11 18:27:35 -07:00
snipe d5a709a836 Improved testing stuff 2015-08-11 18:27:28 -07:00
snipe 4243270e7d Merge pull request #1049 from JoeFaux/AccessoryReport
Accessory report
2015-08-11 17:31:37 -07:00
root b576fce1f7 Modified files for accessory report. 2015-08-11 16:35:18 -07:00
root d7313543ef Changes to support an accessory report. 2015-08-11 16:32:48 -07:00
snipe 2636474120 Improved Welcome test 2015-08-11 15:57:58 -07:00
snipe 0c3b55a8b5 Upgrade to newer travis infrasructure 2015-08-11 15:49:25 -07:00
snipe d7dd35a2f2 Removed generated test files accidentally commited 2015-08-11 15:30:43 -07:00
snipe 0c8e3809f2 Starter acceptance tests 2015-08-11 15:29:44 -07:00
snipe 4538bca29f Allow 0 qty consumable 2015-08-11 14:34:54 -07:00
snipe eeda4366a3 Removed cruft from debugging 2015-08-11 14:32:14 -07:00
snipe fc31a828bc Exclude Snipe-IT from search engines 2015-08-11 14:19:51 -07:00
snipe 88e10516a9 Updated footer links 2015-08-11 14:19:13 -07:00
snipe 481b905331 Fixes #1045 - allow 0 value for accessories 2015-08-11 14:01:13 -07:00
snipe 959df613ae Updated language strings 2015-08-11 13:39:09 -07:00
snipe c476eda868 Removed link on location until location view is fixed 2015-08-11 13:20:58 -07:00
snipe b3249dcf48 Merge remote-tracking branch 'origin/develop' into 2.0
# Conflicts:
#	app/controllers/admin/UsersController.php
#	app/models/Model.php
#	app/views/backend/hardware/edit.blade.php
#	app/views/backend/users/index.blade.php
#	composer.lock
2015-08-11 13:20:25 -07:00
snipe 242e6ff030 Updated composer lock 2015-08-11 12:40:13 -07:00
snipe f026f886ae Removed unique constraint on model no 2015-08-11 12:37:57 -07:00
snipe 936d7dab1b Fixes #1043 2015-08-11 12:36:03 -07:00
snipe 38d774eb6a Merge pull request #1033 from vsposato/feature/865_fixIssuesFromSnipe
Feature/865 fix issues from snipe
2015-08-11 11:57:56 -07:00
Vincent Sposato d363a0deec Merge branch 'feature/865_fixIssuesFromSnipe' of github.com:vsposato/snipe-it into feature/865_fixIssuesFromSnipe 2015-08-07 18:52:58 -04:00
Vincent Sposato 3ebbd030e7 Fixed issue with Asset model 2015-08-07 18:52:19 -04:00
Brady Wetherington 7ae226635f First rough pass at asset acceptance report 2015-08-07 18:50:55 -04:00
Vincent Sposato afbe23c214 Attempting to make the unaccepted assets report use more Eloquent features rather than a raw query
Updated the migration to include the migration of existing data - still have issue with a fresh load, as seeded data isn't there until after the migrations occur
Removed the artisan command
2015-08-07 18:50:55 -04:00
Vincent Sposato 7f91f6e349 Completed the changes from uberbrady to make the report work correctly 2015-08-07 18:00:23 -04:00
Vincent Sposato 6db7001dd5 Merge pull request #1 from uberbrady/feature_865_plus_denorm
First rough pass at asset acceptance report
2015-08-07 17:39:47 -04:00
Aladin Alaily 9a763db2d9 Revert "added a simple change"
This reverts commit 99a591c970.
2015-08-06 23:49:02 -04:00
Aladin Alaily 99a591c970 added a simple change
added a simple change
2015-08-06 23:47:36 -04:00
snipe 9540db424a Fixes #948 - validate on model name+modelno+manufacturer combination 2015-08-06 05:58:50 -07:00
snipe 84d81184fa Fixes #1009 - Add MAC address to search 2015-08-06 05:13:27 -07:00
snipe 3c0cc94652 Fixed route
TODO:

- add modal button
2015-08-06 04:53:23 -07:00
snipe 5dcc795aa2 Fixes #1024 - delete option added to user dropdown 2015-08-06 04:33:34 -07:00
snipe 106ed6a9a0 Added location to user listing 2015-08-06 03:59:23 -07:00
Brady Wetherington daff0dbccb First rough pass at asset acceptance report 2015-08-06 01:55:17 -07:00
snipe 56f490cef9 Merge pull request #1029 from madd15/patch-4
Fix #1022 - Missing Lang on viewing deleted user
2015-08-05 18:06:17 -07:00
Vincent Sposato 145cf1093c Attempting to make the unaccepted assets report use more Eloquent features rather than a raw query
Updated the migration to include the migration of existing data - still have issue with a fresh load, as seeded data isn't there until after the migrations occur
Removed the artisan command
2015-08-05 20:50:35 -04:00
madd15 336858e4ed Fix #1022 - Missing Lang on viewing deleted user 2015-08-06 09:33:53 +09:30
snipe e3c1a9f80c Merge branch '2.0' of github.com:snipe/snipe-it into 2.0 2015-08-05 13:57:29 -07:00
snipe 66991ea663 Fixes #1018 - allow name re-use if deleted 2015-08-05 13:57:04 -07:00
snipe e253d611b4 Merge pull request #1027 from balticer/fix-validation-ampersand-and-sharp-s
Modifying validator to support & and ß
2015-08-05 13:27:24 -07:00
Kai Korla 7e76d8858e Modifying validator to support & and ß 2015-08-05 18:13:47 +02:00
snipe dc265ba2a8 Fixed back button on user create 2015-08-04 20:48:54 -07:00
snipe eb00acddfd Trying to fix the broken migration 2015-08-04 14:55:10 -07:00
snipe 449ad4f86b Fixes #1014 - error if no assets are unaccepted 2015-08-04 13:22:13 -07:00
snipe 77bff707fa English is hard :( 2015-08-04 12:54:45 -07:00
snipe 183f8ae1bf Merge remote-tracking branch 'origin/develop' into 2.0
# Conflicts:
#	app/commands/ImportCommand.php
#	app/lang/en/admin/users/message.php
#	app/lang/en/general.php
2015-08-04 12:51:35 -07:00
snipe fda6d60225 Merge pull request #1011 from goetzk/route-not-to
Change to using route in error message
2015-08-04 12:46:31 -07:00
snipe 3c730c691b Fixes #1010 - better errors on large file uploads 2015-08-04 12:45:17 -07:00
Karl Goetz cf4f178485 Change to using route in error message
When I've broken things and wound up with a 500 error the link back to home
produces a 404 error. I believe its because it uses 'to' instead of 'route' but
I'm not familiar enough with php to be sure of my theory.
2015-08-04 10:40:40 +10:00
snipe b20fecc2de Make thread_id default null 2015-08-03 12:35:54 -07:00
snipe 03e294b6d0 Merge pull request #1006 from mtucker6784/patch-1
Create install.sh
2015-08-03 12:23:13 -07:00
Michael T 85ba7c3a15 Create install.sh
This script will

1. Ask for Snipe it version 1.2.8 or 2.0
2. Detect distro version (between CentOS and Debian/Ubuntu)
3. Install all software and dependencies, create vhosts.

This isn't the smartest script, and it needs a little love, and I'm on the fence about SMTP settings.  Would love feedback about the SMTP part, and the whole script in general.  I'll be glad to fine tune it some more,  I just need a point in the right direction. Hopefully if this is merged in 2.0, it won't cause a huge influx of tickets.  This is the first time I've contributed to a project like this, so I don't know the social norms; if having my name at the top isn't appropriate (or fit in with the scope of Snipe It), we can remove it. No big deal, just wanted to have my name somewhere, but it's not a make-it-or-break-it thing for me :o)
2015-08-02 20:59:04 -07:00
snipe 889fa6b74d Merge pull request #1001 from vsposato/feature/865_AssetsNotAcceptedReport
Feature/865 assets not accepted report
2015-08-02 11:06:42 -07:00
snipe e63a07800f Merge pull request #994 from madd15/patch-4
Fix logo url
2015-08-02 11:05:07 -07:00
Vincent Sposato 4082957c85 Added phpdocs to the model 2015-08-01 14:41:09 -04:00
Vincent Sposato 24edf81b27 Merge branch 'feature/865_AssetsNotAcceptedReport' of github.com:vsposato/snipe-it into feature/865_AssetsNotAcceptedReport 2015-08-01 12:29:29 -04:00
Vincent Sposato 03818adc14 Added the new report to the sidebar of reports 2015-08-01 12:23:41 -04:00
Vincent Sposato b195934a4a Finished building out the report, and refactoring to make the code more expressive
Need to finish writing the code to track threads
2015-08-01 12:20:49 -04:00
Vincent Sposato 82a80b9ac8 Added ThreadAssetLogs to the available artisan commands 2015-08-01 12:20:48 -04:00
Vincent Sposato 7c7edcd191 Created a threading command that will allow all of the asset logs to be threaded into groups 2015-08-01 12:20:48 -04:00
Vincent Sposato 794dc5998a Working on the Actionlog and ReportsController - still having issues getting data back the way I want 2015-08-01 12:20:48 -04:00
Vincent Sposato a2aa05fcf9 Fixed the migration for adding thread_id to correct the table name and make thread_id nullable 2015-08-01 12:20:47 -04:00
Vincent Sposato 8f68bdb318 Working through getting the dataset correctly from the asset logs so that we can generate a report 2015-08-01 12:17:13 -04:00
Vincent Sposato 239f438a98 Added a scope to the Category model to pull back only categories that required acceptance 2015-08-01 12:14:21 -04:00
Vincent Sposato 41127bf5dd Added scope to the Asset model to pull all assets that belonged to a list of models 2015-08-01 12:14:21 -04:00
Vincent Sposato 64bff852bd Added a scope to the Model model to allow for selecting only models that belong to a list of categories 2015-08-01 12:14:20 -04:00
Vincent Sposato d0a8dda14f Added ThreadAssetLogs to the available artisan commands 2015-07-31 20:25:36 -04:00
Vincent Sposato cc5bec07ea Created a threading command that will allow all of the asset logs to be threaded into groups 2015-07-31 20:24:34 -04:00
Vincent Sposato e560cc2ee2 Working on the Actionlog and ReportsController - still having issues getting data back the way I want 2015-07-31 19:29:44 -04:00
snipe 37d4a0105e Fix for strict mode 2015-07-31 11:15:17 -07:00
Vincent Sposato c74c89a171 Fixed the migration for adding thread_id to correct the table name and make thread_id nullable 2015-07-30 21:02:57 -04:00
snipe 3bb296db78 Fixed language string for notes (when the hell did THAT break?) 2015-07-30 15:10:59 -07:00
snipe 305c22f72d Added request to dashboard 2015-07-30 14:59:24 -07:00
snipe 9f81792e70 Request button strings 2015-07-30 14:52:55 -07:00
snipe 57e21193c9 Added language strings for not requestable 2015-07-30 14:50:06 -07:00
snipe ce9d728c2d Updated controller to make sure the asset exists and is requestable 2015-07-30 14:48:32 -07:00
snipe 6bc2128c3e Added requestable button 2015-07-30 14:48:19 -07:00
snipe 78835a8b1f Add requestable as bulk-edit option 2015-07-30 14:32:25 -07:00
madd15 5297d699b3 Fix logo url 2015-07-30 18:32:43 +09:30
snipe 39da217a9e Fixed table nane for asset_logs in migration 2015-07-29 22:47:24 -07:00
snipe 948c443829 Fix for edit/clone 2015-07-29 20:50:23 -07:00
snipe 1a3bf10753 Merge pull request #989 from vsposato/feature/865_ThreadIdAddition
Feature/865 thread id addition
2015-07-29 16:22:19 -07:00
Vincent Sposato 7876ae462c Added the migration for the thread_id on the asset_logs table
Added the relationships for the self-referential links on thread_id
2015-07-29 19:16:57 -04:00
Vincent Sposato 8fbc77a844 Merge branch 'feature/865_AssetsNotAcceptedReport' of github.com:vsposato/snipe-it into feature/865_AssetsNotAcceptedReport 2015-07-29 19:13:12 -04:00
Vincent Sposato 87c493bf12 Added the migration for the thread_id on the asset_logs table
Added the relationships for the self-referential links on thread_id
2015-07-29 19:10:59 -04:00
Vincent Sposato 8c30c5d879 Fixed issue in routes file 2015-07-29 19:09:32 -04:00
Vincent Sposato d8df6a0982 Added a scope to the Category model to pull back only categories that required acceptance 2015-07-29 19:05:56 -04:00
Vincent Sposato d6382fb4a3 Added scope to the Asset model to pull all assets that belonged to a list of models 2015-07-29 19:05:56 -04:00
Vincent Sposato 9772039c4f Added a scope to the Model model to allow for selecting only models that belong to a list of categories 2015-07-29 19:05:56 -04:00
Vincent Sposato ad6cec080c Merge branch '2.0' of https://github.com/snipe/snipe-it into 2.0 2015-07-29 19:04:51 -04:00
snipe 028cde8738 Merge pull request #987 from mdaniels5757/2.0
Added Code128 Label Compatibility (to 2.0)
2015-07-29 12:06:14 -07:00
Michael Daniels 20f94ce418 Closing brackets are helpful 2015-07-29 14:27:03 -04:00
Michael Daniels cced7a93a5 Update AssetsController.php 2015-07-29 14:25:49 -04:00
Michael Daniels 6430f7a4a7 Update AssetsController.php 2015-07-29 14:24:30 -04:00
Michael Daniels 1fff9f6048 Update macros.php 2015-07-29 14:23:17 -04:00
Michael Daniels 85a9f1b71f Merge pull request #1 from snipe/2.0
2.0
2015-07-29 14:21:57 -04:00
mtucker6784 dfa0ddb49f Installer modified for 2.0 (develop currently) 2015-07-29 01:03:56 -07:00
snipe 480fd78c51 Disllow delete if parent 2015-07-28 20:45:32 -07:00
snipe 0c9018289b Fixes #970 2015-07-28 20:24:58 -07:00
snipe 65bf156da1 Better spacing for modal for elements 2015-07-28 18:40:06 -07:00
snipe a8624a736d Merge pull request #983 from madd15/patch-1
Fix #972 - Change back button to work
2015-07-28 17:59:59 -07:00
madd15 c1ae844308 Fix #972 - Change back button to work 2015-07-29 10:13:18 +09:30
snipe bb450e6bb6 Merge pull request #980 from snipe/inline_layout_fix
Fix to nicen up the layout for the inline-adding and Bootstrapify it.
2015-07-28 14:39:12 -07:00
Brady Wetherington 20eb2df9be Fix to nicen up the layout for the inline-adding and Bootstrapify it. 2015-07-28 14:25:47 -07:00
snipe 1e38ced885 Nicer display of "add new" inline functionality.
TODO:

Handle validation failures in a less fugly way
2015-07-28 11:58:45 -07:00
snipe fe2fb63007 Localization strings for inline modals 2015-07-28 11:31:08 -07:00
snipe b79841d481 Fix for @uberbrady's missing route on inline adding 2015-07-28 11:18:18 -07:00
snipe e4ad1011da Merge pull request #969 from snipe/inline_adding
Inline adding of dependent drop-down contents on asset-creation
2015-07-27 23:39:07 -07:00
Brady Wetherington de8180ec70 Abililty to inline-add things when you are creating a new asset 2015-07-27 23:27:45 -07:00
snipe 5455abfd16 Fix for importer 2015-07-27 23:10:03 -07:00
snipe 80145c699e One more because I have teh dumb and cannot brain today 2015-07-27 18:18:41 -07:00
snipe f99cafc101 Fix for 0000-00-00 purchase date 2015-07-27 17:16:28 -07:00
snipe 4014f5e15b Bug in purchase date 2015-07-27 17:11:46 -07:00
snipe 3460016c94 Another small readme tweak 2015-07-27 17:04:15 -07:00
snipe e49c33b56b Minor documentation updates 2015-07-27 17:02:55 -07:00
snipe fdb31ac19e Small tweaks to import script 2015-07-27 16:50:14 -07:00
snipe 9184dd5303 Fix for sad action column with button wrapping 2015-07-27 15:28:41 -07:00
snipe 26e081a2cb Fixes #909 again, because math is super hard 2015-07-27 15:26:53 -07:00
snipe 66a198a175 Merge pull request #966 from madd15/patch-2
Request #961 - Clone button on license list view
2015-07-27 15:07:52 -07:00
madd15 7aba5f3a84 Request #961 - Clone button on license list view 2015-07-28 07:33:51 +09:30
Vincent Sposato 78dcdb4dce Working through getting the dataset correctly from the asset logs so that we can generate a report 2015-07-27 16:31:53 -04:00
Vincent Sposato 3fdafe30c1 Added a scope to the Category model to pull back only categories that required acceptance 2015-07-27 15:48:36 -04:00
Vincent Sposato 39022c9766 Added scope to the Asset model to pull all assets that belonged to a list of models 2015-07-27 15:48:02 -04:00
Vincent Sposato e3a9145459 Added a scope to the Model model to allow for selecting only models that belong to a list of categories 2015-07-27 15:43:51 -04:00
snipe 8d48fddac4 Merge pull request #956 from madd15/patch-1
Fix missing ]
2015-07-27 10:27:53 -07:00
snipe 8b101b10ec Updated language files 2015-07-27 10:25:35 -07:00
snipe 8b5de894df Updated language files 2015-07-27 10:24:21 -07:00
snipe 5781a01311 Added English, Indonesian 2015-07-27 10:24:08 -07:00
snipe de1adf227b New language files 2015-07-27 10:18:40 -07:00
madd15 5e7bfe314a Fix missing ] 2015-07-27 21:20:19 +09:30
snipe 08ce08db62 Missing language strings for accept/decline 2015-07-26 23:01:31 -07:00
snipe 56504e07c9 More consistent language 2015-07-26 22:55:09 -07:00
snipe a901a648af Fixes #875 - allow user to decline asset and check asset back in if declined 2015-07-26 22:53:48 -07:00
snipe a099d16714 Only send email if an email address was given 2015-07-26 22:08:26 -07:00
snipe 464c83599b Nicer validation display on login screen 2015-07-26 22:01:45 -07:00
snipe c78355e39a Cleaned up login screen layout 2015-07-26 21:58:03 -07:00
snipe bc7c456f99 Added decline route 2015-07-26 21:22:28 -07:00
snipe 4f07818a2d Only activate "email users" checkbox if there is an email address given for the user 2015-07-26 21:22:09 -07:00
snipe 979212b2ed Sans serif in emails 2015-07-26 21:21:52 -07:00
snipe b32e3a3475 Shwo username instead of email 2015-07-26 21:21:42 -07:00
snipe 67e18cb110 Updates for switch to username 2015-07-26 19:56:03 -07:00
Brady Wetherington 28304556a9 First pass at this, the ugly way. Just to see wha it looks like. 2015-07-26 18:15:06 -07:00
snipe 6a5777816c Pulled extra route resources that weren't being used 2015-07-26 17:51:18 -07:00
snipe 2b2e6a8829 Additional localization strings 2015-07-25 00:20:17 -07:00
snipe 5701b4d38e Return accessories as well 2015-07-25 00:05:59 -07:00
snipe 23866bce26 Use redirect to route instead of back because POST 2015-07-24 23:08:33 -07:00
snipe ac5dd0dbf9 Remove unique constraint on email 2015-07-24 23:05:11 -07:00
snipe 0f0dab556d Fixes #807 - bad link for subfolders 2015-07-24 22:48:29 -07:00
snipe 6dea227c3e Fixes #851 - bulk user delete 2015-07-24 22:37:15 -07:00
snipe cf3619d766 Fixes #937 - bug in which type of asset 2015-07-24 18:09:11 -07:00
snipe 59b739c1c4 Fixes #902 - redirect to group listing page after group create 2015-07-24 17:43:33 -07:00
snipe 59963b88f5 Fixes #941 - looser restrictions on alpha_space custom validator 2015-07-24 17:29:47 -07:00
snipe 7d67b6a9ae Fixed forgotten password 2015-07-24 17:16:50 -07:00
snipe e944b2d1c3 Fixed blade path 2015-07-24 16:56:55 -07:00
snipe 442db4b5c8 Removed duplicate routes from previous merge 2015-07-24 16:56:44 -07:00
snipe 991a364a3d Updated form to use username 2015-07-24 16:56:31 -07:00
snipe eaf077f807 Fixes #946 - navbar custom color not working in FF 2015-07-24 16:29:54 -07:00
snipe fbb55c14d6 Merge remote-tracking branch 'origin/develop' into 2.0
# Conflicts:
#	app/controllers/admin/AssetsController.php
2015-07-24 15:56:10 -07:00
snipe e4bee3d372 Merge pull request #951 from madd15/fixes-1
Fix asset view duplicate file uploads and layout
2015-07-24 15:12:04 -07:00
snipe 42694f2e9f Merge pull request #950 from madd15/Feature-Checkin-Emails
Feature Checkin Emails #709
2015-07-24 15:11:22 -07:00
madd15 2835905398 Fix dup file uploads and layout 2015-07-24 12:24:10 +09:30
madd15 f9c7022bcc Add checkin_email() 2015-07-24 12:01:21 +09:30
madd15 60d05e1ae1 Add checkin_email() 2015-07-24 11:58:09 +09:30
madd15 b918ea88cc Add checkin email template 2015-07-24 10:29:44 +09:30
madd15 e8c8509ed3 Add checkin_email Lang 2015-07-24 10:25:52 +09:30
madd15 42e101291e Add Email on Checkin Field 2015-07-24 10:25:11 +09:30
madd15 00bcae7feb Add email to postCheckin 2015-07-24 10:24:14 +09:30
madd15 6d96d6cba4 Add email to postCheckin 2015-07-24 10:22:54 +09:30
madd15 e3f0815012 Add Checkin_email to Create and Edit 2015-07-24 10:21:51 +09:30
madd15 f154692dad Add Checkin_email to Catergories Table 2015-07-24 10:20:50 +09:30
Vincent Sposato b4e79592c4 Merge branch '2.0' of https://github.com/snipe/snipe-it into 2.0 2015-07-23 20:17:01 -04:00
snipe e779bf52d1 Merge pull request #949 from madd15/patch-1
Added on #944 - Additional Email Info
2015-07-23 17:03:43 -07:00
madd15 d62d6ebf05 Add extra fields for email 2015-07-24 09:28:17 +09:30
madd15 e4277b47e8 Add extra fields for email 2015-07-24 09:27:44 +09:30
madd15 fd9e8b712b Add flexibility if values not present 2015-07-24 09:26:34 +09:30
snipe 0de1d45492 Merge pull request #944 from madd15/Feature/Additional-Email-Info
WIP - Feature #709/#606 - Additional Email Info / Expected Checkin Date
2015-07-23 16:16:19 -07:00
snipe fdee3ee93e Merge pull request #933 from madd15/patch-4
#916 - Change Userlist identifier from email to username
2015-07-23 16:16:02 -07:00
snipe ef045c61ca Merge pull request #931 from madd15/patch-3
Fix #930 - Add reassignable to create
2015-07-23 16:15:53 -07:00
snipe 212800b074 Merge pull request #947 from madd15/patch-6
Fix edit model cat list showing deleted categories
2015-07-23 16:15:36 -07:00
madd15 6d1197a144 Fix edit model cat list showing deleted categories 2015-07-24 08:44:53 +09:30
snipe e455b2af6e Only update email if password locking isn't set to true 2015-07-23 12:30:44 -07:00
snipe d26c40b26e Fixed issue where email not saved on edit 2015-07-23 12:28:26 -07:00
madd15 8ba55b4bf2 Fix missing checkedout_at 2015-07-23 12:40:22 +09:30
madd15 4f1f21287c Add Expected Checkin Date 2015-07-23 12:37:45 +09:30
madd15 878a163d11 Create Expected Checkin Date Column 2015-07-23 11:55:35 +09:30
madd15 dea23bef45 Add Expected Checkin Date 2015-07-23 11:53:07 +09:30
madd15 d12d1f161f Add Expected Checkin Date 2015-07-23 11:52:04 +09:30
madd15 7afcd09651 Add Expected Checkin Date 2015-07-23 10:07:04 +09:30
madd15 4375d66d09 Add Expected Checkin Date 2015-07-23 10:05:16 +09:30
Vincent Sposato e2bb6cf6c6 Merge branch '2.0' of https://github.com/snipe/snipe-it into 2.0 2015-07-21 19:57:29 -04:00
Vincent Sposato 2e11a68c0d Merge branch 'feature/857_AssetRepairUpgradeTrackingFrom2.0' into 2.0 2015-07-21 19:57:16 -04:00
snipe 27fe904970 Merge pull request #936 from vsposato/feature/857_AssetRepairUpgradeTrackingFrom2.0
Feature/857 asset repair upgrade tracking from2.0
2015-07-20 22:45:59 -07:00
Vincent Sposato 130a041be0 Added Carbon to the uses statement for reports controller 2015-07-20 21:42:07 -04:00
Vincent Sposato a7a2f5f974 Minor change to reports controller to include the View facade 2015-07-20 21:41:29 -04:00
Vincent Sposato e47146faee Moved link for asset maintenances to the asset menu with the other items related to assets / hardware 2015-07-20 21:35:37 -04:00
Vincent Sposato d1d6fe26a6 Fixed all issues that were reported by @leobg
Also, renamed and fixed items of concern by @snipe
Renamed Improvements to Asset Maintenances
2015-07-20 21:34:19 -04:00
Vincent Sposato 3df0550b19 Built the report and the export for the Improvements report
Added the links on the navigation
2015-07-20 21:26:23 -04:00
Vincent Sposato 6eb296303f Working through attempts to get footer callback working 2015-07-20 21:17:04 -04:00
Vincent Sposato 5a2ca33d0f Minor changes to the index attempting to get footer callback to work 2015-07-20 21:16:54 -04:00
Vincent Sposato 215c21891b Updated start file to include my staging site 2015-07-20 21:16:25 -04:00
Vincent Sposato 4c37dcf5bb Finished off the edit and view pages 2015-07-20 21:16:15 -04:00
Vincent Sposato 2457003deb Fixed issue found with date being handled incorrectly
Updated multiple views to reflect this issue
2015-07-20 21:16:06 -04:00
Vincent Sposato 5ee4eb5871 Update the migration to fix an issue with the improvement_time so it would be an integer
Created the view for improvements
Updated messages in language pack for additional items needed
Updated the asset view and supplier view to fix an issue
2015-07-20 21:15:46 -04:00
Vincent Sposato c253000af1 Updated the ImprovementsController to support date formatting for start and completion date on the data table
Updated the supplier and hardware view views to include the date formatting for start and completion date
2015-07-20 21:15:33 -04:00
Vincent Sposato f0d9ba89df Created and built out the index and create functionality - still need to do the view and update 2015-07-20 21:15:17 -04:00
Vincent Sposato 05219e69c4 Created and updated the add / edit form for the Improvement 2015-07-20 21:15:08 -04:00
Vincent Sposato c3439b41b8 Updated the view for a hardware asset so that we could see the improvements on an asset 2015-07-20 21:14:51 -04:00
Vincent Sposato e479575825 Added all of the functionality for the Improvement to be linked to the Asset 2015-07-20 21:11:17 -04:00
Vincent Sposato 0282169703 Added all of the routing for the added improvement section 2015-07-20 21:10:59 -04:00
Vincent Sposato 0da0998e44 Made sure that all language files were there, even though they were blank 2015-07-20 21:04:46 -04:00
Vincent Sposato 60d3af7bb7 Added all of the language items needed 2015-07-20 21:03:51 -04:00
Vincent Sposato 8ddf035a9b Updated the left sidebar of the layout to include the new Improvements area 2015-07-20 21:03:36 -04:00
Vincent Sposato 0f5b8b5a90 Needed to fix nullable issues 2015-07-20 21:03:22 -04:00
Vincent Sposato 69a5c99396 Fixed the datetime fields to be date fields only 2015-07-20 21:03:12 -04:00
Vincent Sposato 3aa3d67675 Fixed the need to only be a date instead of a date time 2015-07-20 21:03:00 -04:00
Vincent Sposato cf46e322b9 Created the index page using datatables 2015-07-20 21:02:50 -04:00
Vincent Sposato 3a3c021a6a One last fix to the migration to add the supplier relationship 2015-07-20 21:02:41 -04:00
Vincent Sposato 4b3267649a Updated the Improvement and Supplier relationship 2015-07-20 21:02:31 -04:00
Vincent Sposato 1c4190bf22 Added the relation to the improvement to the model, so that we can reference these items 2015-07-20 21:02:21 -04:00
Vincent Sposato 3e2bd02ce5 Fixed issue with migration that left off the deleted_at field 2015-07-20 21:02:04 -04:00
Vincent Sposato 2f83f2aa52 Updated migration to reflect relation to the asset 2015-07-20 21:01:48 -04:00
Vincent Sposato 914b1cb628 Added the improvements table migration to create the improvements table 2015-07-20 21:01:33 -04:00
Vincent Sposato 6dae07be7d Updated start.php to reflect my local configuration 2015-07-20 21:00:45 -04:00
Brady Wetherington c683c1c57e Revert "Merge branch 'feature/857_AssetRepairUpgradeTracking' of https://github.com/vsposato/snipe-it into vsposato-feature/857_AssetRepairUpgradeTracking"
This reverts commit 41b711740a, reversing
changes made to 55309bfaef.

It also un-reverts reversions that were done inadvertently.
2015-07-20 17:12:28 -07:00
snipe 775a38880e Revert "Starter controller for bulk edit/delete"
This reverts commit 55309bfaef.
2015-07-20 16:35:16 -07:00
snipe 9d949a5b89 Merge branch '2.0' of github.com:snipe/snipe-it into 2.0 2015-07-20 16:34:55 -07:00
snipe 01c2968388 Revert "Fixes #863 - clickable order number in asset view"
This reverts commit 0c842fc772.
2015-07-20 16:34:14 -07:00
snipe 41b711740a Merge branch 'feature/857_AssetRepairUpgradeTracking' of https://github.com/vsposato/snipe-it into vsposato-feature/857_AssetRepairUpgradeTracking
# Conflicts:
#	app/controllers/admin/ReportsController.php
#	app/lang/en/general.php
#	app/routes.php
#	app/views/backend/hardware/view.blade.php
#	app/views/backend/layouts/default.blade.php
#	composer.lock
2015-07-20 16:12:35 -07:00
madd15 0d0589800a Add additional data for email fields 2015-07-20 14:35:07 +09:30
madd15 2f0f2c5002 Add additional Fields 2015-07-20 14:33:50 +09:30
madd15 abfb5bcd2e Change user list from email to username 2015-07-20 10:19:03 +09:30
madd15 5ff84d80b4 Change user list from email to username 2015-07-20 10:16:58 +09:30
madd15 e29ab6b0d6 Change user list from email to username 2015-07-20 10:16:26 +09:30
madd15 89df6fc6da Change user list from email to username 2015-07-20 10:15:28 +09:30
madd15 78a45d72d7 Add reassignable to create 2015-07-18 10:53:51 +09:30
snipe f8ecbed829 Added purchase date to importer 2015-07-17 16:25:20 -07:00
snipe 38c9d8d6ca Added notes/order number to asset view 2015-07-17 14:18:08 -07:00
snipe 4557502b1d Added notes/order number to controller 2015-07-17 14:15:08 -07:00
snipe 55309bfaef Starter controller for bulk edit/delete 2015-07-17 14:13:27 -07:00
snipe 0c842fc772 Fixes #863 - clickable order number in asset view 2015-07-16 21:21:09 -07:00
snipe 5210d7621e Merge remote-tracking branch 'origin/develop' into 2.0
# Conflicts:
#	.gitignore
#	app/config/version.php
2015-07-16 20:34:01 -07:00
snipe b85d972488 Added mod rewrite to force SSL 2015-07-16 20:32:10 -07:00
snipe 919df7ed56 Part of #863 - adds order number to asset listing 2015-07-16 19:54:56 -07:00
snipe de62db5e18 Fixes #901 - added notes field to list view 2015-07-16 19:45:10 -07:00
snipe 24b0d83387 Fixes #912 - added clon button to list view 2015-07-16 19:33:39 -07:00
snipe dec3f290d0 Merge branch '2.0' of github.com:snipe/snipe-it into 2.0 2015-07-16 19:28:07 -07:00
snipe 190b4cd010 Ignore couscous dir 2015-07-16 19:27:48 -07:00
snipe e447159d4a Added checks for missing fields, added email column, asset notes 2015-07-16 16:23:35 -07:00
snipe b191406a0c Ignore couscous 2015-07-16 14:58:22 -07:00
snipe d732b60a38 Merge pull request #921 from madd15/Unique-Identifier-User-Lists
#916 - Email as unique identifier in user lists
2015-07-15 18:00:52 -07:00
madd15 ba94a57e08 Adjust Manager and Location width 2015-07-16 10:26:53 +09:30
madd15 1fcd36e4ac Change user list to include email address 2015-07-16 10:25:13 +09:30
madd15 31362f3e07 Change user list to include email address 2015-07-16 10:23:54 +09:30
madd15 0fbccef759 Change user list to include email address 2015-07-16 10:23:28 +09:30
madd15 2659521dc9 Change user list to include email address 2015-07-16 10:22:57 +09:30
madd15 0f489b34b5 Change user list to include email address 2015-07-16 10:22:19 +09:30
snipe 0642b4b830 Merge pull request #920 from madd15/patch-3
Update for change to username on sign in
2015-07-15 17:34:59 -07:00
madd15 8b77be9da3 Update for change to username on sign in 2015-07-16 10:04:20 +09:30
snipe 56345b5743 Fixes #909 - expired licenses showing in email report 2015-07-13 20:59:02 -07:00
snipe f09ee24975 Merge pull request #908 from madd15/license-delete-modal
Add title and content to delete modal for License File Uploads
2015-07-13 09:22:51 -07:00
snipe aed7036595 Merge pull request #907 from madd15/user-fileuploads
Feature #746 - Add File Uploads to Users
2015-07-13 09:22:39 -07:00
snipe 9fbb9746bc Merge pull request #895 from madd15/patch-1
Add Checkout of first available license to license list view
2015-07-13 09:22:18 -07:00
snipe 0154f240f3 Fixes JavaScript for edited assets 2015-07-10 22:48:21 -07:00
Vincent Sposato a7abea692d Moved link for asset maintenances to the asset menu with the other items related to assets / hardware 2015-07-10 10:25:32 -04:00
madd15 f04b3f9b09 Change to LicenseSeat 2015-07-10 10:02:46 +09:30
madd15 2841eadc91 Add title and content to delete modal 2015-07-10 09:57:03 +09:30
madd15 616af831a7 Add title and content to delete modal 2015-07-10 09:54:14 +09:30
madd15 1e730078c1 Add file uploads to Users 2015-07-10 09:23:34 +09:30
snipe 0132360e49 Added spinner to show activity during ajax
TO DO:

- Account for the default state when the page is loaded on edit (currently using onchange)

- If no status or model is selected, return false or something else so that it doesn't try to make the ajax call with no ID
2015-07-09 08:45:06 -07:00
snipe 1c2a409e6a Check that there is an assetstatus 2015-07-09 07:08:33 -07:00
snipe 15e1774a13 Centered checkboxes for select all 2015-07-09 03:57:20 -07:00
snipe 16b49c25e1 Bringing back the spinner on processing screen 2015-07-09 03:56:18 -07:00
snipe c61adc7041 Partial fix for #851 datatables. Because clear error reporting is apparently for suckers 2015-07-09 03:20:57 -07:00
snipe 6524ac3678 Beginning of #851 - no controller methods yet, but still troubleshooting stupid datatables errors.
[Error] TypeError: undefined is not an object (evaluating 'f.nTf=a[b].cell')
	jb (jquery.dataTables.min.js, line 24)
	ga (jquery.dataTables.min.js, line 45)
	(anonymous function) (jquery.dataTables.min.js, line 92)
	each (jquery-latest.js, line 383)
	each (jquery-latest.js, line 136)
	o (jquery.dataTables.min.js, line 82)
	(anonymous function) (users, line 371)
	fire (jquery-latest.js, line 3119)
	fireWith (jquery-latest.js, line 3231)
	ready (jquery-latest.js, line 3443)
	completed (jquery-latest.js, line 3474)
2015-07-09 03:09:18 -07:00
snipe c8842a85ee Bumped version 2015-07-09 01:24:43 -07:00
snipe 7255a8bb0c Merge remote-tracking branch 'origin/develop' into 2.0
# Conflicts:
#	app/controllers/admin/AssetsController.php
2015-07-09 01:24:34 -07:00
snipe f5d4eb5842 Merge pull request #897 from madd15/patch-2
Fix #896 - Only show Checkout/Checkin if deployable
2015-07-09 01:19:57 -07:00
snipe 7e5f32c9d8 Merge pull request #898 from madd15/Default-Layout-fix
Small UI fixes
2015-07-09 01:17:02 -07:00
snipe e1724cf25f Merge remote-tracking branch 'origin/develop' into 2.0
# Conflicts:
#	.gitignore
#	app/config/production/session.example.php
#	app/config/staging/session.example.php
#	app/config/version.php
#	app/models/User.php
2015-07-09 01:02:49 -07:00
snipe 9936cf4a43 Better production default for #903 2015-07-09 00:53:58 -07:00
snipe e9443a244c Small fix to config value 2015-07-09 00:52:05 -07:00
snipe f8be47dfbf Fixes #903 - adds config variable for multi_login, overrides Sentry method 2015-07-09 00:41:46 -07:00
snipe 2d10931d6c Use league/csv for export 2015-07-08 23:42:17 -07:00
snipe 4a5066054b Display bugfixes for #819 2015-07-08 22:38:35 -07:00
snipe 84ffc1a728 Migration for location-specific currency, updated views for #819
This isn't done yet though. All kinds of busted stuff.
2015-07-08 20:35:40 -07:00
snipe 74429d9075 Merge remote-tracking branch 'origin/develop' into 2.0
# Conflicts:
#	app/lang/en/general.php
#	app/start/artisan.php
#	app/views/backend/hardware/edit.blade.php
#	app/views/backend/layouts/default.blade.php
2015-07-08 18:07:53 -07:00
snipe c2d63915c3 Fixed insecure font call 2015-07-08 17:48:59 -07:00
snipe fd59ca0802 Fixed spacing 2015-07-08 17:33:51 -07:00
snipe de23ec5785 Fixes #544 - disable checking an asset out to a user if it is not a deployable status 2015-07-08 17:18:46 -07:00
snipe 05f0b94bf6 Fixed language string 2015-07-08 13:05:17 -07:00
snipe f54c86db87 Command line asset importer 2015-07-08 13:05:05 -07:00
madd15 e714def74a Fix Reports showing class="active" 2015-07-08 11:46:11 +09:30
madd15 a9e169261c Add 5px margin to left of search box 2015-07-08 11:41:14 +09:30
madd15 665ffa6571 Update Hardware Submenu
Correctly identify the status from the url
2015-07-08 11:37:20 +09:30
madd15 a22687abc5 Fix #896 - Only show Checkout/Checkin if deployable 2015-07-07 14:38:28 +09:30
madd15 8335f10f8c Add Checkout Button 2015-07-07 12:38:53 +09:30
madd15 518680f23c Add freecheckout for getting first available seat 2015-07-07 12:33:53 +09:30
madd15 38c36699a7 Add freeSeat function 2015-07-07 12:32:33 +09:30
madd15 f363e742e6 Add getFreeLicense
Picks free seat for license and redirects to checkout specific seat
2015-07-07 12:30:55 +09:30
snipe 1edce0a4fa Merge branch '2.0' of github.com:snipe/snipe-it into 2.0 2015-07-06 19:29:22 -07:00
snipe 7da7907fbd Merge remote-tracking branch 'origin/develop' into 2.0
# Conflicts:
#	app/controllers/admin/AssetsController.php
2015-07-06 19:29:06 -07:00
snipe 32a0f6eb92 Merge pull request #892 from madd15/patch-4
Fix Model Validation for create and edit
2015-07-06 18:07:30 -07:00
madd15 1301119c9a Remove unique from modelno validation rule 2015-07-07 09:50:43 +09:30
madd15 c7f2dc83db Remove $new and replace with Input::all() 2015-07-07 09:50:00 +09:30
snipe 82892a38b8 Merge pull request #891 from madd15/patch-3
Fix #873 - Remove serial, assigned_to & macaddress when cloning asset
2015-07-06 16:50:58 -07:00
madd15 3664e75c47 Change validation to work correctly 2015-07-07 08:51:38 +09:30
madd15 61836f20c5 Clear Mac Address on Clone 2015-07-07 08:23:51 +09:30
madd15 62d382d704 Remove serial and assigned_to when cloning asset 2015-07-07 08:19:58 +09:30
snipe 3746bc333b Better checking for model name and category name 2015-07-06 14:12:49 -07:00
snipe ccde517c88 Use showAssetName to get asset name 2015-07-06 14:10:24 -07:00
snipe f855bfd4ef Better error checking for eol data 2015-07-06 14:09:48 -07:00
snipe 674348b5a5 Smaller text requirement for address2 2015-07-06 14:06:31 -07:00
Vincent Sposato 1b423f5b54 Fixed all issues that were reported by @leobg
Also, renamed and fixed items of concern by @snipe
Renamed Improvements to Asset Maintenances
2015-07-06 10:36:54 -04:00
snipe 7d5810b656 Merge remote-tracking branch 'origin/develop' into 2.0
# Conflicts:
#	app/config/version.php
#	app/controllers/admin/AssetsController.php
2015-07-02 17:23:06 -07:00
snipe 1601bdd4eb Added rtd_location_id back into selected columns 2015-07-02 16:52:08 -07:00
snipe 552bdfdc2d Switched defaultLoc to belongsTo relationship 2015-07-02 16:51:52 -07:00
snipe d4af197b0e Merge pull request #886 from madd15/Fix---Edit-user
Fix - Edit User
2015-07-01 19:51:33 -07:00
snipe be685467eb Merge pull request #883 from madd15/patch-2
Update Category Types Array to include Consumable
2015-07-01 19:50:36 -07:00
madd15 7a0b3a7350 Allow saving of Username and Email changes
I noted that i was unable to change the username or email fields, but also that the username validation would not allow the form to save as it was checking against itself for being unique.
2015-07-02 12:16:01 +09:30
madd15 55f544829d Update Category Types Array to include Consumable 2015-07-01 17:28:58 +09:30
snipe bb7ce83c48 Merge remote-tracking branch 'origin/develop' into 2.0 2015-06-30 22:42:00 -07:00
snipe 1d4cfcfd58 Only save uploaded logo if not in demo mode 2015-06-30 22:38:40 -07:00
snipe 6915987239 Added demo language string 2015-06-30 22:38:19 -07:00
snipe 3a44a7e8bb Disable logo upload for demo 2015-06-30 22:38:12 -07:00
snipe f2abbd0e8f Deny editing users on demo 2015-06-30 22:10:23 -07:00
snipe 62f8d002e3 Temp commented out some stuff 2015-06-30 22:05:21 -07:00
snipe 0766ae2d17 Disallow group edit for demo 2015-06-30 22:04:48 -07:00
snipe 95920be8ea Fixed weird commenting 2015-06-30 22:04:05 -07:00
snipe 588ff742fe Add manufacturer to models listing for clarity 2015-06-30 19:15:43 -07:00
snipe a8cb5c1e7d Beginning QR mobile interface 2015-06-30 19:07:44 -07:00
Vincent Sposato 269f73205a Built the report and the export for the Improvements report
Added the links on the navigation
2015-06-28 15:00:55 -04:00
Vincent Sposato 8147e64c48 Working through attempts to get footer callback working 2015-06-28 14:02:53 -04:00
Vincent Sposato d321dcf20b Minor changes to the index attempting to get footer callback to work 2015-06-28 14:02:09 -04:00
Vincent Sposato 59e72cd1c2 Updated start file to include my staging site 2015-06-28 07:40:42 -04:00
Vincent Sposato d67fe22b8d Finished off the edit and view pages 2015-06-27 19:47:05 -04:00
Vincent Sposato b2847811ef Fixed issue found with date being handled incorrectly
Updated multiple views to reflect this issue
2015-06-27 17:42:15 -04:00
Vincent Sposato b7f050aa3b Update the migration to fix an issue with the improvement_time so it would be an integer
Created the view for improvements
Updated messages in language pack for additional items needed
Updated the asset view and supplier view to fix an issue
2015-06-27 17:15:23 -04:00
Vincent Sposato cc67569425 Updated the ImprovementsController to support date formatting for start and completion date on the data table
Updated the supplier and hardware view views to include the date formatting for start and completion date
2015-06-27 15:55:56 -04:00
Vincent Sposato 7657d8680e Created and built out the index and create functionality - still need to do the view and update 2015-06-27 14:39:59 -04:00
Vincent Sposato 26927907cf Created and updated the add / edit form for the Improvement 2015-06-27 14:38:45 -04:00
Vincent Sposato e406dd02ed Updated the view for a hardware asset so that we could see the improvements on an asset 2015-06-27 14:38:12 -04:00
Vincent Sposato c90ea92a4e Added all of the functionality for the Improvement to be linked to the Asset 2015-06-27 14:37:40 -04:00
Vincent Sposato c28feb56a8 Added all of the routing for the added improvement section 2015-06-27 14:37:11 -04:00
Vincent Sposato 78f1c0f11f Made sure that all language files were there, even though they were blank 2015-06-27 14:36:07 -04:00
Vincent Sposato 95f8e9fbe8 Added all of the language items needed 2015-06-27 14:35:37 -04:00
Vincent Sposato 1befbfee6f Updated the left sidebar of the layout to include the new Improvements area 2015-06-27 13:51:39 -04:00
Vincent Sposato 9316b2bed0 Needed to fix nullable issues 2015-06-27 13:42:42 -04:00
Vincent Sposato 58ce44c935 Fixed the datetime fields to be date fields only 2015-06-27 13:16:25 -04:00
Vincent Sposato c59c5e35f8 Fixed the need to only be a date instead of a date time 2015-06-27 13:15:08 -04:00
Vincent Sposato 90da6ba364 Created the index page using datatables 2015-06-27 12:47:43 -04:00
Vincent Sposato 0f190e094d One last fix to the migration to add the supplier relationship 2015-06-27 12:41:40 -04:00
Vincent Sposato 0c63dac5e7 Updated the Improvement and Supplier relationship 2015-06-27 12:41:16 -04:00
Vincent Sposato 3a86c53b49 Added the relation to the improvement to the model, so that we can reference these items 2015-06-27 12:27:15 -04:00
Vincent Sposato a5292d4b71 Fixed issue with migration that left off the deleted_at field 2015-06-27 12:26:40 -04:00
Vincent Sposato cd7a7fa3d2 Updated migration to reflect relation to the asset 2015-06-27 11:02:41 -04:00
Vincent Sposato 255a492db6 Added the improvements table migration to create the improvements table 2015-06-27 10:51:22 -04:00
Vincent Sposato 6cff270d3d Updated start.php to reflect my local configuration
Also updated composer packages to latest versions
2015-06-26 17:13:03 -04:00
snipe 1fb2878772 Updated activity report for consumables 2015-06-25 18:47:03 -07:00
snipe 84e130d6aa Fixes #869 - compatibility mode for IE 2015-06-25 16:22:07 -07:00
snipe edfa064fd4 Disable emailing imported users if demo mode 2015-06-23 18:38:21 -07:00
snipe 3caded990a Added parent string 2015-06-23 18:32:06 -07:00
snipe 3bca2566d7 Added missing create/update consumable string 2015-06-23 16:35:38 -07:00
snipe 1aa4841868 Remove extra debugging 2015-06-23 16:30:29 -07:00
snipe fc1e8a4e4e Minor comment tweak 2015-06-23 15:05:21 -07:00
snipe bf3cb73070 Include location ID on user import 2015-06-23 15:05:11 -07:00
snipe d77e763f86 Change badge to label 2015-06-23 15:04:35 -07:00
snipe 8ef3d00f22 Fixed language string for users 2015-06-23 14:10:15 -07:00
snipe 5266c22890 Show consumable checkout date 2015-06-23 14:10:04 -07:00
snipe 26540b1aac Updated bad data string 2015-06-23 14:02:01 -07:00
snipe 39a3b93537 Pagination on user history 2015-06-23 14:01:48 -07:00
snipe ba13101f64 Bad data language string 2015-06-23 13:48:56 -07:00
snipe ce55b7ab2f Tightened up history snapshot on dashboard 2015-06-23 13:46:06 -07:00
snipe 28a9f90a72 Lazy eager load history for optimized queries 2015-06-23 13:44:49 -07:00
snipe f2a2ccdab4 Nicer display for profile 2015-06-23 12:59:55 -07:00
snipe f2e1ec0928 Fixed QR simple view route 2015-06-23 12:59:33 -07:00
snipe 17ca66f4a2 Added update string 2015-06-23 12:59:19 -07:00
snipe a43f075ff0 Wider profile box view 2015-06-23 12:46:08 -07:00
snipe c87d4ad801 Eager load dashboard queries 2015-06-23 11:52:18 -07:00
snipe d94cc1f17d Add consumables log 2015-06-23 11:52:07 -07:00
snipe f30285eaea Added text string for consumable name 2015-06-23 11:39:28 -07:00
snipe 20d35953f1 Remove consumable category 2015-06-23 11:39:17 -07:00
snipe 537630bae4 Removed unneeded stylesheet 2015-06-23 11:33:31 -07:00
snipe 85d6b062f3 Fixed checkbox alignment 2015-06-23 11:32:32 -07:00
snipe 74a9a176e9 New language strings 2015-06-23 10:25:44 -07:00
snipe 94f8c61720 Fixes #280, #64 and #860 - added license expiration alert 2015-06-23 01:52:06 -07:00
snipe 75b9b70a86 Fix email field so it's nullable, fix app command to add user 2015-06-23 00:11:54 -07:00
snipe 2e585f9cd2 Fixes #839 - bad seed data 2015-06-23 00:11:06 -07:00
snipe edddf6ae80 Fixes #833 - remove status label field if asset is checked out 2015-06-22 20:01:02 -07:00
snipe ea0f2c5f34 Fixes #833 - remove status label field if asset is checked out 2015-06-22 20:00:28 -07:00
snipe 826d3ccae8 Eager loading user info 2015-06-22 17:57:55 -07:00
snipe fd7d4eb3f2 Removed checkin for consumables 2015-06-22 17:57:44 -07:00
snipe e8e0c7bfe4 Missing filetype info string 2015-06-22 17:57:21 -07:00
snipe ccdda7b8e8 Missing reassignable string 2015-06-22 17:57:09 -07:00
snipe 9abafba180 Updates to consumables view 2015-06-22 17:56:58 -07:00
snipe 2ed47a6089 Removed old file 2015-06-22 17:56:42 -07:00
snipe 818d1769b8 Automated backup to dump SQL and zip uploaded files
Usage:

`php artisan snipeit:backup`

This can be set on a cron or scheduled task
2015-06-22 15:52:26 -07:00
snipe bf6674f6a0 Added table prefix for raw queries 2015-06-19 18:03:28 -07:00
snipe ee08586279 Trying to regain compatibility with PHP 5.4 2015-06-19 17:59:10 -07:00
snipe ef75880398 Added backups to topnav 2015-06-19 17:58:53 -07:00
snipe 221ae62ea5 Example configs 2015-06-19 17:38:06 -07:00
snipe 40c59e664b Backup language string 2015-06-19 17:37:58 -07:00
snipe 61e3381b24 Backup routes 2015-06-19 17:37:49 -07:00
snipe 3dfa1e1ea7 Backups blade 2015-06-19 17:37:40 -07:00
snipe c0fab2f425 Updated deps to still allow for 5.4 (I hope?) 2015-06-19 17:37:32 -07:00
snipe ffdd437e47 Ignore SQL dumps 2015-06-19 17:31:51 -07:00
snipe 76825441b9 Added session config to allow for forced SSL 2015-06-19 14:46:16 -07:00
snipe 8e83206556 Added dumps directory 2015-06-19 14:40:23 -07:00
snipe 2aa357f315 Added fideveloper proxy and DB backup 2015-06-19 14:28:40 -07:00
snipe df59e7f699 New strings 2015-06-19 11:44:19 -07:00
snipe d0216d76f8 Updated to generic strings 2015-06-18 15:00:41 -07:00
snipe ec10526d69 Center envelope in user listing 2015-06-18 15:00:32 -07:00
snipe 49b746a811 QTY strings 2015-06-18 15:00:23 -07:00
snipe 1013580236 Fixed typo 2015-06-18 15:00:16 -07:00
snipe 98d9a2e6f9 Bold current page number 2015-06-18 14:36:32 -07:00
snipe e4217af1ec Minified 2015-06-18 14:36:23 -07:00
snipe 3d4607ebd3 Fixes #858 - find admin group by name instead of ID for consideration of clustered DBs 2015-06-17 17:16:05 -07:00
snipe 2be1d64de3 Merge remote-tracking branch 'origin/develop' into 1.3.0 2015-06-16 12:56:14 -07:00
snipe 16ec68e0b6 Hide email icon if no email address is provided 2015-06-16 01:45:34 -07:00
snipe 3ce9500d75 Moved password up with other required fields 2015-06-16 00:20:43 -07:00
snipe c699452473 Bumped version 2015-06-15 18:39:42 -07:00
snipe d943408f44 Location and email not required, username required 2015-06-15 18:39:34 -07:00
snipe a7aee2fe1c Location no longer required for users 2015-06-15 18:39:02 -07:00
snipe 32f3740eda Update email for #165 to reflect username 2015-06-15 18:38:52 -07:00
snipe f42540fedf More fixes for #165 - added username field 2015-06-15 12:40:27 -07:00
snipe f25b90ee27 Set https as default app url 2015-06-15 12:39:43 -07:00
snipe fdef266089 Addresses #577 and fixes #165 - switch from email to username 2015-06-15 12:16:39 -07:00
snipe c4375f9fbc Merge remote-tracking branch 'origin/develop' into 1.3.0
# Conflicts:
#	app/controllers/admin/UsersController.php
2015-06-15 11:30:40 -07:00
snipe d0189fb076 Added consumables to user matrix for #782 2015-06-09 20:05:24 -07:00
snipe e4517a8782 Removed checkin for #782, since that doesn't exist in consumables 2015-06-09 19:58:22 -07:00
snipe 19604480bb Consumables section
TODO:

- Add checkout to location
- Drop Checkin (doesn't really exist in this context)
- Add missing strings - consolidate where possible. Lots of dupes :-/
2015-06-09 19:50:34 -07:00
snipe 704d66b6f3 Raw DB migration for nullable user notes 2015-06-09 17:45:11 -07:00
snipe 6315c343a7 Add consumables table 2015-06-09 17:44:59 -07:00
snipe 766b4b901f Fixes #822 - make user notes field nullable default null 2015-06-09 17:34:52 -07:00
snipe f671c89b14 Composer update for bin path 2015-06-09 17:31:28 -07:00
snipe 03bd1498e8 Added codeception 2015-06-09 16:52:08 -07:00
snipe f743bacd0f Updated language strings 2015-06-09 16:14:37 -07:00
snipe 309158352e Added Korean translation 2015-06-09 16:14:28 -07:00
snipe 2540ac09ec Fixes #822 2015-06-09 16:02:10 -07:00
snipe af2decea9d Merge remote-tracking branch 'origin/master' into 1.3.0
# Conflicts:
#	app/controllers/admin/AssetsController.php
2015-06-09 02:10:29 -07:00
snipe 9ea8316d74 Merge remote-tracking branch 'origin/develop' into 1.3.0
# Conflicts:
#	app/config/version.php
2015-06-01 17:52:39 -07:00
snipe 123caf42c2 Merge remote-tracking branch 'origin/develop' into 1.3.0
# Conflicts:
#	app/views/backend/hardware/labels.blade.php
#	app/views/backend/layouts/default.blade.php
2015-05-27 11:17:14 -07:00
snipe 5997dd9387 Missing string for action 2015-05-27 11:13:42 -07:00
snipe 9cf03e2e60 Better escaping on activity report page 2015-05-27 10:16:06 -07:00
snipe 212f09dd31 Fixes #806 2015-05-19 19:39:05 -07:00
snipe 8334e7b863 Removed extra open sans call 2015-05-19 19:37:34 -07:00
snipe a80d67c1ff Escaping on labels 2015-05-19 19:37:22 -07:00
snipe 7c95f4231e Fixes #799 - missing text in file delete confirmation 2015-05-14 20:52:19 -07:00
snipe 496a768013 Fixes #795 - add model name if no asset name 2015-05-11 19:23:11 -07:00
snipe 7415a5898f Twiddling column widths 2015-05-08 11:39:51 -07:00
snipe f1486bfee3 Nicer locations listing layout 2015-05-07 19:20:05 -07:00
snipe bc8521043b Bumped version 2015-05-07 18:21:48 -07:00
snipe 3597d71230 Eager load assigned asset locations 2015-05-07 18:21:39 -07:00
snipe d92e2eaebc Method for assigned asset locations 2015-05-07 18:21:27 -07:00
snipe 8cdea8a384 Fix for location totals 2015-05-07 18:21:10 -07:00
snipe 4457c7aec0 Removed extra commented stuff 2015-05-07 18:20:58 -07:00
snipe 95279f885b Fixes #759 - populate form with parent location info 2015-05-07 01:51:46 -07:00
snipe 75644eb894 Dashboard points to app url 2015-05-07 00:30:20 -07:00
snipe 2d7a348ab7 Fixed multi-level array nesting for locations 2015-05-07 00:15:44 -07:00
snipe 139dd13392 Super janky miulti-level menu on create - TODO: Fix this ish. 2015-05-04 18:13:26 -07:00
snipe 2f52369d07 Fixed location string 2015-05-04 15:13:04 -07:00
snipe aab52d0850 Fix for strict mode with location parent 2015-05-04 15:10:57 -07:00
snipe 71febc1c81 Added accessories and location 2015-05-04 13:31:47 -07:00
snipe 68d8b10b22 Changed text to icons for more compacted view 2015-05-04 13:31:38 -07:00
snipe 0d2333203a Display default location 2015-05-04 13:08:38 -07:00
snipe 3881e2e83e Fixes #784 - add "create accessory" to topnav 2015-05-04 11:24:25 -07:00
snipe 51eeee09d7 Fixes bug in #736 for new fields 2015-05-04 11:14:38 -07:00
snipe c487beeaca Asset counter for #759 (needs more work) 2015-05-04 03:05:22 -07:00
snipe f463cd6c8d Fixes for #759 - location heirarchy 2015-05-04 02:50:42 -07:00
snipe 5e7a4e8193 Fixes #599 - show groups in user list 2015-05-04 01:44:49 -07:00
snipe c8870ddcab Fixes #736 - more fields in bulk edit 2015-05-04 01:30:20 -07:00
1181 changed files with 27344 additions and 5894 deletions
+9
View File
@@ -7,6 +7,7 @@ composer.phar
/app/database/*.sqlite
/app/storage/meta/services.json
/app/config/*/mail.php
/app/config/*/session.php
/app/config/*/database.php
/app/config/*/app.php
public/packages/*
@@ -22,3 +23,11 @@ public/uploads/logo.gif
public/uploads/logo.png
.siteflow
public/assets/.siteflow
app/config/local/session.php
.couscous
tests/_support/_generated/*
tests/_data/scenarios
nbproject/*
app/config/local/ldap.php
app/storage/dumps/*
app/config/packages/schickling/backup/config.php
+12 -3
View File
@@ -1,6 +1,7 @@
addons:
hosts:
- AlisonMBP
hosts:
- snipe-it.dev
sudo: false
# see http://about.travis-ci.org/docs/user/languages/php/ for more hints
language: php
@@ -17,7 +18,7 @@ env:
# execute any number of scripts before the test run, custom env's are available as variables
before_script:
- if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS snipeit_laravel;" -utravis; fi
- if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS snipeit_unit;" -utravis; fi
- curl -s http://getcomposer.org/installer | php
- cp app/config/testing/app.example.php app/config/testing/app.php
- cp app/config/testing/database.example.php app/config/testing/database.php
@@ -32,9 +33,17 @@ before_script:
# omitting "script:" will default to phpunit
# use the $DB env variable to determine the phpunit.xml to use
# script: ./vendor/bin/codecept run
script: phpunit
# configure notifications (email, IRC, campfire etc)
notifications:
email: false
slack:
secure: vv9we1RxB9RsrMbomSdq6D7vz/okobw87pEkgIZjB+hj1QpQ2by90gsPsOa+NgsJEFaEP7e4KlT6SH8kK+zhbmuKaUd3d1//XdcancE22LZXi6tkiB5yuR/Jhhb1LLDqyGJTB4D92hMnnCPiUjpxNA3r437ttNeYRdYIEEP3drA=
webhooks:
urls:
- https://webhooks.gitter.im/e/5e136eb0c1965f3918d0
on_success: change # options: [always|never|change] default: always
on_failure: change # options: [always|never|change] default: always
on_start: false # default: false
+886 -325
View File
File diff suppressed because it is too large Load Diff
+19 -29
View File
@@ -14,13 +14,16 @@ This project is being actively developed and we're [releasing quite frequently](
__This is web-based software__. This means there there is no executable file (aka no .exe files), and it must be run on a web server and accessed through a web browser. It runs on any Mac OSX, flavor of Linux, as well as Windows.
-----
### Documentation & Installation
__Installation and configuration documentation for this project has been moved to http://snipeitapp.com/documentation/.__
### Installation
We'll be adding a long-overdue user's manual soon as well.
__Installation and configuration documentation for this project has been moved to http://docs.snipeitapp.com.__
__To deploy on Ubuntu using Ansible and Vagrant, be sure to check out the [Snipe-IT Installation scripts](https://github.com/GR360RY/snipeit-ansible) created by [@GR360RY](https://github.com/GR360RY/).__
#### Server Requirements
Please see the [requirements documentation](http://docs.snipeitapp.com/requirements.html) for full requirements.
To deploy on Ubuntu using Ansible and Vagrant, check out the [Snipe-IT Installation scripts](https://github.com/GR360RY/snipeit-ansible) created by [@GR360RY](https://github.com/GR360RY/).
-----
### Bug Reports & Feature Requests
@@ -29,44 +32,31 @@ Feel free to check out the [GitHub Issues for this project](https://github.com/s
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)
If you're having trouble with the installation, please check the [Common Issues](http://docs.snipeitapp.com/common-issues.html) and [Getting Help](http://docs.snipeitapp.com/getting-help.html) documentation.
-----
### Upgrading
Please see the [upgrading documentation](http://docs.snipeitapp.com/upgrading.html) for instructions on upgrading Snipe-IT.
------
### Announcement List
To be notified of important news (such as new releases, security advisories, etc), [sign up for our list](http://eepurl.com/XyZKz). We'll never sell or give away your info, and we'll only email you when it's important.
------
### Translations!
If you're not a coder but want to give back to the project and you're fluent in other languages, consider helping out with the translations. We use [CrowdIn](https://crowdin.com) to manage translations, and it makes it super-simple for you to add translations to the project without messing with code. Check out [the Snipe-IT CrowdIn translation project here](https://crowdin.com/project/snipe-it/).
We currently have English, Chinese, Finnish, Malay, Romanian and Spanish completed, and are looking for lots more!
-----
## Requirements
- PHP 5.4 or later
- MCrypt PHP Extension
- Fileinfo Extension
And _one_ of the following image libraries (for QR codes, asset model image and user avatar image uploads).
- GD Library (>=2.0) … or …
- Imagick PHP extension (>=6.3.8)
Please see the [translations documentation](http://docs.snipeitapp.com/translations.html) for information about available languages and how to add translations to Snipe-IT.
-----
## Important Notes on Updating
### Contributing
Whenever you pull down a new version from master or develop, when you grab the [latest official release](https://github.com/snipe/snipe-it/releases), make sure to run the following commands via command line:
Please see the documentation on [contributing and developing for Snipe-IT](http://docs.snipeitapp.com/contributing.html).
php composer.phar dump-autoload
php artisan migrate
Forgetting to do this can mean your DB might end up out of sync with the new files you just pulled, or you may have some funky cached autoloader values. It's a good idea to get into the habit of running these every time you pull anything new down. If there are no database changes to migrate, it won't hurt anything to run migrations anyway.
## Contributor Code of Conduct
[![Stories in Ready](https://badge.waffle.io/snipe/snipe-it.png?label=ready+for+dev&title=Ready+for+Development)](http://waffle.io/snipe/snipe-it)
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
+38 -10
View File
@@ -18,7 +18,7 @@ class AppCommand extends Command
*
* @var string
*/
protected $description = '';
protected $description = 'This command kicks off your database table creation and migration, and creates your first admin user.';
/**
* Holds the user information.
@@ -28,7 +28,7 @@ class AppCommand extends Command
protected $userData = array(
'first_name' => null,
'last_name' => null,
'email' => null,
'username' => null,
'password' => null
);
@@ -66,6 +66,7 @@ class AppCommand extends Command
// Let's ask the user some questions, shall we?
$this->askUserFirstName();
$this->askUserLastName();
$this->askUserUsername();
$this->askUserEmail();
$this->askUserPassword();
@@ -89,10 +90,10 @@ class AppCommand extends Command
$this->call('migrate:install');
// Run the Sentry Migrations
$this->call('migrate', array('--package' => 'cartalyst/sentry'));
$this->call('migrate', array('--package' => 'cartalyst/sentry','--force'=>true));
// Run the Migrations
$this->call('migrate');
$this->call('migrate', array('--force'=>true));
// Create the default user and default groups.
$this->sentryRunner();
@@ -162,7 +163,7 @@ class AppCommand extends Command
}
/**
* Asks the user for the user email address.
* Asks the user for the username address.
*
* @return void
* @todo Use the Laravel Validator
@@ -171,7 +172,7 @@ class AppCommand extends Command
{
do {
// Ask the user to input the email address
$email = $this->ask('Please enter your user email: ');
$email = $this->ask('Please enter your email: ');
// Check if email is valid
if ($email == '') {
@@ -185,6 +186,32 @@ class AppCommand extends Command
while ( ! $email);
}
/**
* Asks the user for the username address.
*
* @return void
* @todo Use the Laravel Validator
*/
protected function askUserUsername()
{
do {
// Ask the user to input the username
$username = $this->ask('Please enter your username: ');
// Check if username is valid
if ($username == '') {
// Return an error message
$this->error('Username is invalid. Please try again.');
}
// Store the username address
$this->userData['username'] = $username;
}
while ( ! $username);
}
/**
* Asks the user for the user password.
*
@@ -197,7 +224,7 @@ class AppCommand extends Command
// Ask the user to input the user password
$password = $this->ask('Please enter your user password (at least 8 characters): ');
// Check if email is valid
// Check if password is valid
if ($password == '') {
// Return an error message
$this->error('Password is invalid. Please try again.');
@@ -217,9 +244,9 @@ class AppCommand extends Command
protected function askUserDummyData()
{
// Ask the user to input the user password
$dummydata = $this->ask('Do you want to seed your database with dummy data? y/n (default is yes): ');
$dummydata = $this->ask('Do you want to seed your database with dummy data? Y/n (default is yes): ');
$this->dummyData = ( strstr($dummydata, 'y' ) || empty($dummydata) ) ? true : false;
$this->dummyData = ( strstr($dummydata, 'Y' ) || empty($dummydata) ) ? true : false;
}
/**
@@ -329,7 +356,7 @@ class AppCommand extends Command
$user = Sentry::getUserProvider()->create($data);
// Associate the Admin group to this user
$group = Sentry::getGroupProvider()->findById(1);
$group = Sentry::findGroupByName('Admin');
$user->addGroup($group);
// Show the success message
@@ -350,6 +377,7 @@ class AppCommand extends Command
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@example.com',
'username' => 'john.doe@example.com',
'password' => substr(str_shuffle(str_repeat('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', mt_rand(1,10))),1,10),
'notes' => 'Generated on install',
'activated' => 1,
+394
View File
@@ -0,0 +1,394 @@
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use League\Csv\Reader;
class AssetImportCommand extends Command {
/**
* The console command name.
*
* @var string
*/
protected $name = 'asset-import:csv';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Import Assets from CSV';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
$filename = $this->argument('filename');
if (!$this->option('testrun')=='true') {
$this->comment('======= Importing Assets from '.$filename.' =========');
} else {
$this->comment('====== TEST ONLY Asset Import for '.$filename.' ====');
$this->comment('============== NO DATA WILL BE WRITTEN ==============');
}
if (! ini_get("auto_detect_line_endings")) {
ini_set("auto_detect_line_endings", '1');
}
$csv = Reader::createFromPath($this->argument('filename'));
$csv->setNewline("\r\n");
$csv->setOffset(1);
$duplicates = '';
// Loop through the records
$nbInsert = $csv->each(function ($row) use ($duplicates) {
$status_id = 1;
// Let's just map some of these entries to more user friendly words
// User's name
if (array_key_exists('0',$row)) {
$user_name = trim($row[0]);
} else {
$user_name = '';
}
// User's email
if (array_key_exists('1',$row)) {
$user_email = trim($row[1]);
} else {
$user_email = '';
}
// Asset Category
if (array_key_exists('2',$row)) {
$user_asset_category = trim($row[2]);
} else {
$user_asset_category = '';
}
// Asset Name
if (array_key_exists('3',$row)) {
$user_asset_name = trim($row[3]);
} else {
$user_asset_name = '';
}
// Asset Manufacturer
if (array_key_exists('4',$row)) {
$user_asset_mfgr = trim($row[4]);
} else {
$user_asset_mfgr = '';
}
// Asset model number
if (array_key_exists('5',$row)) {
$user_asset_modelno = trim($row[5]);
} else {
$user_asset_modelno = '';
}
// Asset serial number
if (array_key_exists('6',$row)) {
$user_asset_serial = trim($row[6]);
} else {
$user_asset_serial = '';
}
// Asset tag
if (array_key_exists('7',$row)) {
$user_asset_tag = trim($row[7]);
} else {
$user_asset_tag = '';
}
// Asset location
if (array_key_exists('8',$row)) {
$user_asset_location = trim($row[8]);
} else {
$user_asset_location = '';
}
// Asset notes
if (array_key_exists('9',$row)) {
$user_asset_notes = trim($row[9]);
} else {
$user_asset_notes = '';
}
// Asset purchase date
if (array_key_exists('10',$row)) {
if ($row[10]!='') {
$user_asset_purchase_date = date("Y-m-d 00:00:01", strtotime($row[10]));
} else {
$user_asset_purchase_date = '';
}
} else {
$user_asset_purchase_date = '';
}
// 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');
$user_username = '';
// No name was given
} elseif ($user_name=='') {
$this->comment('No user data provided - skipping user creation, just adding asset');
$first_name = '';
$last_name = '';
$user_username = '';
} else {
$name = explode(" ", $user_name);
$first_name = $name[0];
$email_last_name = '';
$email_prefix = $first_name;
if (!array_key_exists(1, $name)) {
$last_name='';
$email_last_name = $last_name;
$email_prefix = $first_name;
} else {
$last_name = str_replace($first_name,'',$user_name);
if ($this->option('email_format')=='filastname') {
$email_last_name.=str_replace(' ','',$last_name);
$email_prefix = $first_name[0].$email_last_name;
} elseif ($this->option('email_format')=='firstname.lastname') {
$email_last_name.=str_replace(' ','',$last_name);
$email_prefix = $first_name.'.'.$email_last_name;
} elseif ($this->option('email_format')=='firstname') {
$email_last_name.=str_replace(' ','',$last_name);
$email_prefix = $first_name;
}
}
$user_username = $email_prefix;
// Generate an email based on their name if no email address is given
if ($user_email=='') {
if ($first_name=='Unknown') {
$status_id = 7;
}
$email = strtolower($email_prefix).'@'.$this->option('domain');
$user_email = str_replace("'",'',$email);
}
}
$this->comment('Full Name: '.$user_name);
$this->comment('First Name: '.$first_name);
$this->comment('Last Name: '.$last_name);
$this->comment('Username: '.$user_username);
$this->comment('Email: '.$user_email);
$this->comment('Category Name: '.$user_asset_category);
$this->comment('Item: '.$user_asset_name);
$this->comment('Manufacturer ID: '.$user_asset_mfgr);
$this->comment('Model No: '.$user_asset_modelno);
$this->comment('Serial No: '.$user_asset_serial);
$this->comment('Asset Tag: '.$user_asset_tag);
$this->comment('Location: '.$user_asset_location);
$this->comment('Purchase Date: '.$user_asset_purchase_date);
$this->comment('Notes: '.$user_asset_notes);
$this->comment('------------- Action Summary ----------------');
if ($user_username!='') {
if ($user = User::where('username', $user_username)->whereNotNull('username')->first()) {
$this->comment('User '.$user_username.' already exists');
} else {
// Create the user
$user = Sentry::createUser(array(
'first_name' => $first_name,
'last_name' => $last_name,
'email' => $user_email,
'username' => $user_username,
'password' => substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10),
'activated' => true,
'permissions' => array(
'admin' => 0,
'user' => 1,
),
'notes' => 'User imported through asset importer'
));
// Find the group using the group id
$userGroup = Sentry::findGroupById(3);
// Assign the group to the user
$user->addGroup($userGroup);
$this->comment('User '.$first_name.' created');
}
} else {
$user = new User;
}
// Check for the location match and create it if it doesn't exist
if ($location = Location::where('name', $user_asset_location)->first()) {
$this->comment('Location '.$user_asset_location.' already exists');
} else {
$location = new Location();
$location->name = e($user_asset_location);
$location->address = '';
$location->city = '';
$location->state = '';
$location->country = '';
$location->user_id = 1;
if (!$this->option('testrun')=='true') {
if ($location->save()) {
$this->comment('Location '.$user_asset_location.' was created');
} else {
$this->comment('Something went wrong! Location '.$user_asset_location.' was NOT created');
}
} else {
$this->comment('Location '.$user_asset_location.' was (not) created - test run only');
}
}
// 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');
} else {
$category = new Category();
$category->name = e($user_asset_category);
$category->category_type = 'asset';
$category->user_id = 1;
if ($category->save()) {
$this->comment('Category '.$user_asset_category.' was created');
} 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()) {
$this->comment('Manufacturer '.$user_asset_mfgr.' already exists');
} else {
$manufacturer = new Manufacturer();
$manufacturer->name = e($user_asset_mfgr);
$manufacturer->user_id = 1;
if ($manufacturer->save()) {
$this->comment('Manufacturer '.$user_asset_mfgr.' was created');
} 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()) {
$this->comment('The Asset Model '.$user_asset_name.' with model number '.$user_asset_modelno.' already exists');
} else {
$asset_model = new Model();
$asset_model->name = e($user_asset_name);
$asset_model->manufacturer_id = $manufacturer->id;
$asset_model->modelno = e($user_asset_modelno);
$asset_model->category_id = $category->id;
$asset_model->user_id = 1;
if ($asset_model->save()) {
$this->comment('Asset Model '.$user_asset_name.' with model number '.$user_asset_modelno.' was created');
} else {
$this->comment('Something went wrong! Asset Model '.$user_asset_name.' was NOT created');
}
}
// Check for the asset match and create it if it doesn't exist
$asset = new Asset();
$asset->name = e($user_asset_name);
if ($user_asset_purchase_date!='') {
$asset->purchase_date = $user_asset_purchase_date;
} else {
$asset->purchase_date = NULL;
}
$asset->serial = e($user_asset_serial);
$asset->asset_tag = e($user_asset_tag);
$asset->model_id = $asset_model->id;
$asset->assigned_to = $user->id;
$asset->rtd_location_id = $location->id;
$asset->user_id = 1;
$asset->status_id = $status_id;
if ($user_asset_purchase_date!='') {
$asset->purchase_date = $user_asset_purchase_date;
} else {
$asset->purchase_date = NULL;
}
$asset->notes = e($user_asset_notes);
if ($asset->save()) {
$this->comment('Asset '.$user_asset_name.' with serial number '.$user_asset_serial.' was created');
} else {
$this->comment('Something went wrong! Asset '.$user_asset_name.' was NOT created');
}
$this->comment('=====================================');
return true;
});
}
/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return array(
array('filename', InputArgument::REQUIRED, 'File for the CSV import.'),
);
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return array(
array('domain', null, InputOption::VALUE_REQUIRED, 'Email domain for generated email addresses.', null),
array('email_format', null, InputOption::VALUE_REQUIRED, 'The format of the email addresses that should be generated. Options are firstname.lastname, firstname, filastname', null),
array('testrun', null, InputOption::VALUE_REQUIRED, 'Test the output without writing to the database or not.', null),
);
}
}
+381
View File
@@ -0,0 +1,381 @@
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use League\Csv\Reader;
class LicenseImportCommand extends Command {
/**
* The console command name.
*
* @var string
*/
protected $name = 'license-import:csv';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Import Licenses from CSV';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
$filename = $this->argument('filename');
if (!$this->option('testrun')=='true') {
$this->comment('======= Importing Licenses from '.$filename.' =========');
} else {
$this->comment('====== TEST ONLY License Import for '.$filename.' ====');
$this->comment('============== NO DATA WILL BE WRITTEN ==============');
}
if (! ini_get("auto_detect_line_endings")) {
ini_set("auto_detect_line_endings", '1');
}
$csv = Reader::createFromPath($this->argument('filename'));
$csv->setNewline("\r\n");
$csv->setOffset(1);
$duplicates = '';
// Loop through the records
$nbInsert = $csv->each(function ($row) use ($duplicates) {
$status_id = 1;
// Let's just map some of these entries to more user friendly words
if (array_key_exists('0',$row)) {
$user_name = trim($row[0]);
} else {
$user_name = '';
}
if (array_key_exists('1',$row)) {
$user_email = trim($row[1]);
} else {
$user_email = '';
}
if (array_key_exists('2',$row)) {
$user_username = trim($row[2]);
} else {
$user_username = '';
}
if (array_key_exists('3',$row)) {
$user_license_name = trim($row[3]);
} else {
$user_license_name = '';
}
if (array_key_exists('4',$row)) {
$user_license_serial = trim($row[4]);
} else {
$user_license_serial = '';
}
if (array_key_exists('5',$row)) {
$user_licensed_to_name = trim($row[5]);
} else {
$user_licensed_to_name = '';
}
if (array_key_exists('6',$row)) {
$user_licensed_to_email = trim($row[6]);
} else {
$user_licensed_to_email = '';
}
if (array_key_exists('7',$row)) {
$user_license_seats = trim($row[7]);
} else {
$user_license_seats = '';
}
if (array_key_exists('8',$row)) {
$user_license_reassignable = trim($row[8]);
if ($user_license_reassignable!='') {
if ((strtolower($user_license_reassignable)=='yes') || (strtolower($user_license_reassignable)=='true') || ($user_license_reassignable=='1')) {
$user_license_reassignable = 1;
}
} else {
$user_license_reassignable = 0;
}
} else {
$user_license_reassignable = 0;
}
if (array_key_exists('9',$row)) {
$user_license_supplier = trim($row[9]);
} else {
$user_license_supplier = '';
}
if (array_key_exists('10',$row)) {
$user_license_maintained = trim($row[10]);
if ($user_license_maintained!='') {
if ((strtolower($user_license_maintained)=='yes') || (strtolower($user_license_maintained)=='true') || ($user_license_maintained=='1')) {
$user_license_maintained = 1;
}
} else {
$user_license_maintained = 0;
}
} else {
$user_license_maintained = '';
}
if (array_key_exists('11',$row)) {
$user_license_notes = trim($row[11]);
} else {
$user_license_notes = '';
}
if (array_key_exists('12',$row)) {
if ($row[12]!='') {
$user_license_purchase_date = date("Y-m-d 00:00:01", strtotime($row[12]));
} else {
$user_license_purchase_date = '';
}
} else {
$user_license_purchase_date = 0;
}
// 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');
$user_username = '';
// No name was given
} elseif ($user_name=='') {
$this->comment('No user data provided - skipping user creation, just adding license');
$first_name = '';
$last_name = '';
$user_username = '';
} else {
$name = explode(" ", $user_name);
$first_name = $name[0];
$email_last_name = '';
$email_prefix = $first_name;
if (!array_key_exists(1, $name)) {
$last_name='';
$email_last_name = $last_name;
$email_prefix = $first_name;
} else {
$last_name = str_replace($first_name,'',$user_name);
if ($this->option('email_format')=='filastname') {
$email_last_name.=str_replace(' ','',$last_name);
$email_prefix = $first_name[0].$email_last_name;
} elseif ($this->option('email_format')=='firstname.lastname') {
$email_last_name.=str_replace(' ','',$last_name);
$email_prefix = $first_name.'.'.$email_last_name;
} elseif ($this->option('email_format')=='firstname') {
$email_last_name.=str_replace(' ','',$last_name);
$email_prefix = $first_name;
}
}
$user_username = $email_prefix;
// Generate an email based on their name if no email address is given
if ($user_email=='') {
if ($first_name=='Unknown') {
$status_id = 7;
}
$email = strtolower($email_prefix).'@'.$this->option('domain');
$user_email = str_replace("'",'',$email);
}
}
$this->comment('Full Name: '.$user_name);
$this->comment('First Name: '.$first_name);
$this->comment('Last Name: '.$last_name);
$this->comment('Username: '.$user_username);
$this->comment('Email: '.$user_email);
$this->comment('License Name: '.$user_license_name);
$this->comment('Serial No: '.$user_license_serial);
$this->comment('Licensed To Name: '.$user_licensed_to_name);
$this->comment('Licensed To Email: '.$user_licensed_to_email);
$this->comment('Seats: '.$user_license_seats);
$this->comment('Reassignable: '.$user_license_reassignable);
$this->comment('Supplier: '.$user_license_supplier);
$this->comment('Maintained: '.$user_license_maintained);
$this->comment('Notes: '.$user_license_notes);
$this->comment('Purchase Date: '.$user_license_purchase_date);
$this->comment('------------- Action Summary ----------------');
if ($user_username!='') {
if ($user = User::where('username', $user_username)->whereNotNull('username')->first()) {
$this->comment('User '.$user_username.' already exists');
} else {
// Create the user
$user = Sentry::createUser(array(
'first_name' => $first_name,
'last_name' => $last_name,
'email' => $user_email,
'username' => $user_username,
'password' => substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10),
'activated' => true,
'permissions' => array(
'admin' => 0,
'user' => 1,
),
'notes' => 'User importerd through license importer'
));
// Find the group using the group id
$userGroup = Sentry::findGroupById(3);
// Assign the group to the user
$user->addGroup($userGroup);
$this->comment('User '.$first_name.' created');
}
} else {
$user = new User;
$user->user_id = NULL;
}
// Check for the supplier match and create it if it doesn't exist
if ($supplier = Supplier::where('name', $user_license_supplier)->first()) {
$this->comment('Supplier '.$user_license_supplier.' already exists');
} else {
$supplier = new Supplier();
$supplier->name = e($user_license_supplier);
$supplier->user_id = 1;
if ($supplier->save()) {
$this->comment('Supplier '.$user_license_supplier.' was created');
} else {
$this->comment('Something went wrong! Supplier '.$user_license_supplier.' was NOT created');
}
}
// Add the license
$license = new License();
$license->name = e($user_license_name);
if ($user_license_purchase_date!='') {
$license->purchase_date = $user_license_purchase_date;
} else {
$license->purchase_date = NULL;
}
$license->serial = e($user_license_serial);
$license->seats = e($user_license_seats);
$license->supplier_id = $supplier->id;
$license->user_id = 1;
if ($user_license_purchase_date!='') {
$license->purchase_date = $user_license_purchase_date;
} else {
$license->purchase_date = NULL;
}
$license->license_name = $user_licensed_to_name;
$license->license_email = $user_licensed_to_email;
$license->notes = e($user_license_notes);
if ($license->save()) {
$this->comment('License '.$user_license_name.' with serial number '.$user_license_serial.' was created');
$license_seat_created = 0;
for ($x = 0; $x < $user_license_seats; $x++) {
// Create the license seat entries
$license_seat = new LicenseSeat();
$license_seat->license_id = $license->id;
// Only assign the first seat to the user
if ($x==0) {
$license_seat->assigned_to = $user->id;
} else {
$license_seat->assigned_to = NULL;
}
if ($license_seat->save()) {
$license_seat_created++;
}
}
if ($license_seat_created > 0) {
$this->comment($license_seat_created.' seats were created');
} else {
$this->comment('Something went wrong! NO seats for '.$user_license_name.' were created');
}
} else {
$this->comment('Something went wrong! License '.$user_license_name.' was NOT created');
}
$this->comment('=====================================');
return true;
});
}
/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return array(
array('filename', InputArgument::REQUIRED, 'File for the CSV import.'),
);
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return array(
array('domain', null, InputOption::VALUE_REQUIRED, 'Email domain for generated email addresses.', null),
array('email_format', null, InputOption::VALUE_REQUIRED, 'The format of the email addresses that should be generated. Options are firstname.lastname, firstname, filastname', null),
array('testrun', null, InputOption::VALUE_REQUIRED, 'Test the output without writing to the database or not.', null),
);
}
}
+66 -30
View File
@@ -37,58 +37,94 @@ class SendExpirationAlerts extends Command {
*/
public function fire()
{
$expiring_assets = Asset::getExpiringWarrantee(60);
$data['count'] = count($expiring_assets);
$data['email_content'] ='';
// Expiring Assets
$expiring_assets = Asset::getExpiringWarrantee(60);
$this->info(count($expiring_assets).' expiring assets');
$asset_data['count'] = count($expiring_assets);
$asset_data['email_content'] ='';
$now = date("Y-m-d");
foreach ($expiring_assets as $asset) {
$now = date("Y-m-d");
$expires = $asset->warrantee_expires();
$difference = round(abs(strtotime($expires) - strtotime($now))/86400);
if ($difference > 30) {
$data['email_content'] .= '<tr style="background-color: #fcffa3;">';
$asset_data['email_content'] .= '<tr style="background-color: #fcffa3;">';
} else {
$data['email_content'] .= '<tr style="background-color:#d9534f;">';
$asset_data['email_content'] .= '<tr style="background-color:#d9534f;">';
}
$data['email_content'] .= '<td><a href="'.Config::get('app.url').'/hardware/'.$asset->id.'/view">';
$data['email_content'] .= $asset->name.'</a></td><td>'.$asset->asset_tag.'</td>';
$data['email_content'] .= '<td>'.$asset->warrantee_expires().'</td>';
$data['email_content'] .= '<td>'.$difference.' days</td>';
$data['email_content'] .= '</tr>';
$asset_data['email_content'] .= '<td><a href="'.Config::get('app.url').'/hardware/'.$asset->id.'/view">';
$asset_data['email_content'] .= $asset->showAssetName().'</a></td><td>'.$asset->asset_tag.'</td>';
$asset_data['email_content'] .= '<td>'.$asset->warrantee_expires().'</td>';
$asset_data['email_content'] .= '<td>'.$difference.' days</td>';
$asset_data['email_content'] .= '</tr>';
}
if ((Setting::getSettings()->alert_email!='') && (Setting::getSettings()->alerts_enabled==1)){
// Expiring licenses
$expiring_licenses = License::getExpiringLicenses(60);
$this->info(count($expiring_licenses).' expiring licenses');
$license_data['count'] = count($expiring_licenses);
$license_data['email_content'] = '';
foreach ($expiring_licenses as $license) {
$expires = $license->expiration_date;
$difference = round(abs(strtotime($expires) - strtotime($now))/86400);
if ($difference > 30) {
$license_data['email_content'] .= '<tr style="background-color: #fcffa3;">';
} else {
$license_data['email_content'] .= '<tr style="background-color:#d9534f;">';
}
$license_data['email_content'] .= '<td><a href="'.Config::get('app.url').'/admin/licenses/'.$license->id.'/view">';
$license_data['email_content'] .= $license->name.'</a></td>';
$license_data['email_content'] .= '<td>'.$license->expiration_date.'</td>';
$license_data['email_content'] .= '<td>'.$difference.' days</td>';
$license_data['email_content'] .= '</tr>';
}
if ((Setting::getSettings()->alert_email!='') && (Setting::getSettings()->alerts_enabled==1)) {
if (count($expiring_assets) > 0) {
Mail::send('emails.expiring-report', $data, function ($m) {
Mail::send('emails.expiring-assets-report', $asset_data, function ($m) {
$m->to(Setting::getSettings()->alert_email, Setting::getSettings()->site_name);
$m->subject('Expiring Assets Report');
});
});
}
if (count($expiring_licenses) > 0) {
Mail::send('emails.expiring-licenses-report', $license_data, function ($m) {
$m->to(Setting::getSettings()->alert_email, Setting::getSettings()->site_name);
$m->subject('Expiring Licenses Report');
});
}
} else {
if (Setting::getSettings()->alert_email=='') {
echo "Could not send email. No alert email configured in settings. \n";
} elseif (Setting::getSettings()->alerts_enabled!=1) {
echo "Alerts are disabled in the settings. No mail will be sent. \n";
}
}
}
}
}
+65
View File
@@ -0,0 +1,65 @@
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class SystemBackup extends Command {
/**
* The console command name.
*
* @var string
*/
protected $name = 'snipeit:backup';
/**
* The console command description.
*
* @var string
*/
protected $description = 'This command creates a database dump and zips up all of the uploaded files in the upload directories.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
//
$files['avatars'] = glob(public_path().'/uploads/avatars/*');
$files['models'] = glob(public_path().'/uploads/models/*');
$files['suppliers'] = glob(public_path().'/uploads/suppliers/*');
$files['private_uploads'] = glob(app_path().'/private_uploads/*');
$base_filename = date('Ymdgis');
$zip_file = app_path().'/storage/dumps/'.$base_filename.'-backup.zip';
$db_dump = Config::get('backup::path').$base_filename.'-db.sql';
$this->call('db:backup', array('filename' => $db_dump));
Zipper::make($zip_file)
->folder('avatars')->add($files['avatars'])
->folder('models')->add($files['models'])
->folder('suppliers')->add($files['suppliers'])
->folder('private_uploads')->add($files['private_uploads'])
->folder('database')->add($db_dump)->close();
$this->info('Backup file created at '.$zip_file);
$this->info('Removing SQL dump at '.$db_dump);
unlink($db_dump);
}
}
+4 -1
View File
@@ -43,7 +43,7 @@ return array(
*/
'cipher' => MCRYPT_RIJNDAEL_256,
/*
|--------------------------------------------------------------------------
| Prevent Password changes
@@ -103,6 +103,8 @@ return array(
'Chumper\Datatable\DatatableServiceProvider',
'Dinesh\Barcode\BarcodeServiceProvider',
'Maknz\Slack\SlackServiceProvider',
'Schickling\Backup\BackupServiceProvider',
'Chumper\Zipper\ZipperServiceProvider',
),
@@ -177,6 +179,7 @@ return array(
'DNS1D' => 'Dinesh\Barcode\Facades\DNS1DFacade',
'DNS2D' => 'Dinesh\Barcode\Facades\DNS2DFacade',
'Slack' => 'Maknz\Slack\Facades\Slack',
'Zipper' => 'Chumper\Zipper\Zipper',
),
+112
View File
@@ -0,0 +1,112 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| URL
|--------------------------------------------------------------------------
|
| URL for the LDAP server. This should start with ldap://, for example:
| ldap://ldap.yourserver.com
|
*/
'url' => "",
/*
|--------------------------------------------------------------------------
| Username
|--------------------------------------------------------------------------
|
| Username to use to connect authenticate to LDAP, for example:
| cn=read-only-admin,dc=example,dc=com
|
*/
'username' => "",
/*
|--------------------------------------------------------------------------
| Password
|--------------------------------------------------------------------------
|
| Password to use when authenticating to LDAP.
|
*/
'password' => "",
/*
|--------------------------------------------------------------------------
| Basedn
|--------------------------------------------------------------------------
|
| The base where the search for users will be executed, for example:
| dc=example,dc=com
|
*/
'basedn' => "",
/*
|--------------------------------------------------------------------------
| Filter
|--------------------------------------------------------------------------
|
| The search filter for the LDAP query. This probably does not have to be
| changed.
|
*/
'filter' => "&(cn=*)",
/*
|--------------------------------------------------------------------------
| LDAP field names that will be retrieved to create a user.
|
| Using the username as an example:
| If I set 'result.username' => 'my-org-username', the code will connect to
| LDAP as follows (where $results[$i] represents a row in the LDAP query:
| $username-to-insert-in-snipe-it = $results[$i]["my-org-username"][0]
|
| Note: all these fields are required.
|--------------------------------------------------------------------------
|
| The search filter for the LDAP query.
|
*/
'result.username' => "",
'result.last.name' => "",
'result.first.name' => "",
/*
| These fields are optional as not all LDAP directories will have it. If yours
| does not have them, just leave these blank and the extra check will
| be omitted.
*/
'result.active.flag' => "",
'result.emp.num' => "",
'result.email' => "",
/*
|--------------------------------------------------------------------------
| LDAP filter query for authentication
|--------------------------------------------------------------------------
|
| The LDAP query that we want to execute when authenticating a user. This
| should not have to be changed.
|
*/
'authentication.filter.query' => "uid=",
/*
|--------------------------------------------------------------------------
| LDAP Version
|--------------------------------------------------------------------------
|
| Version of LDAP you are using.
|
*/
'version' => 3,
);
+140
View File
@@ -0,0 +1,140 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "array"
|
*/
'driver' => 'file',
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => 12000,
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'files' => storage_path().'/sessions',
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => null,
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => array(2, 100),
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'cookie' => 'snipeit_session',
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => null,
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely.
|
*/
'secure' => false,
);
@@ -46,7 +46,7 @@ return array(
|
*/
'hasher' => 'native',
'hasher' => 'bcrypt',
/*
|--------------------------------------------------------------------------
@@ -134,7 +134,7 @@ return array(
|
*/
'login_attribute' => 'email',
'login_attribute' => 'username',
),
@@ -0,0 +1,31 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Trusted Proxies
|--------------------------------------------------------------------------
|
| Set an array of trusted proxies, so Laravel knows to grab the client's
| information via the X-Forwarded-* headers.
|
| To trust all proxies, use the value '*':
|
| 'proxies' => '*'
|
|
| To trust only specific proxies (recommended), set an array of those
| proxies' IP addresses:
|
| 'proxies' => array('192.168.1.1', '192.168.1.2')
|
|
| Or use CIDR notation:
|
| 'proxies' => array('192.168.12.0/23')
|
*/
'proxies' => '*',
);
@@ -0,0 +1,15 @@
<?php
return array(
'path' => 'app/storage/dumps/',
'mysql' => array(
'dump_command_path' => '',
'restore_command_path' => '',
),
's3' => array(
'path' => ''
),
'compress' => false,
);
+1
View File
@@ -1,3 +1,4 @@
app.php
mail.php
database.php
ldap.php
+1 -1
View File
@@ -26,7 +26,7 @@ return array(
|
*/
'url' => 'http://production.yourserver.com',
'url' => 'https://production.yourserver.com',
/*
|--------------------------------------------------------------------------
+112
View File
@@ -0,0 +1,112 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| URL
|--------------------------------------------------------------------------
|
| URL for the LDAP server. This should start with ldap://, for example:
| ldap://ldap.yourserver.com
|
*/
'url' => "",
/*
|--------------------------------------------------------------------------
| Username
|--------------------------------------------------------------------------
|
| Username to use to connect authenticate to LDAP, for example:
| cn=read-only-admin,dc=example,dc=com
|
*/
'username' => "",
/*
|--------------------------------------------------------------------------
| Password
|--------------------------------------------------------------------------
|
| Password to use when authenticating to LDAP.
|
*/
'password' => "",
/*
|--------------------------------------------------------------------------
| Basedn
|--------------------------------------------------------------------------
|
| The base where the search for users will be executed, for example:
| dc=example,dc=com
|
*/
'basedn' => "",
/*
|--------------------------------------------------------------------------
| Filter
|--------------------------------------------------------------------------
|
| The search filter for the LDAP query. This probably does not have to be
| changed.
|
*/
'filter' => "&(cn=*)",
/*
|--------------------------------------------------------------------------
| LDAP field names that will be retrieved to create a user.
|
| Using the username as an example:
| If I set 'result.username' => 'my-org-username', the code will connect to
| LDAP as follows (where $results[$i] represents a row in the LDAP query:
| $username-to-insert-in-snipe-it = $results[$i]["my-org-username"][0]
|
| Note: all these fields are required.
|--------------------------------------------------------------------------
|
| The search filter for the LDAP query.
|
*/
'result.username' => "",
'result.last.name' => "",
'result.first.name' => "",
/*
| These fields are optional as not all LDAP directories will have it. If yours
| does not have them, just leave these blank and the extra check will
| be omitted.
*/
'result.active.flag' => "",
'result.emp.num' => "",
'result.email' => "",
/*
|--------------------------------------------------------------------------
| LDAP filter query for authentication
|--------------------------------------------------------------------------
|
| The LDAP query that we want to execute when authenticating a user. This
| should not have to be changed.
|
*/
'authentication.filter.query' => "uid=",
/*
|--------------------------------------------------------------------------
| LDAP Version
|--------------------------------------------------------------------------
|
| Version of LDAP you are using.
|
*/
'version' => 3,
);
+154
View File
@@ -0,0 +1,154 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "array"
|
*/
'driver' => 'file',
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => 12000,
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'files' => storage_path().'/sessions',
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => null,
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => array(2, 100),
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'cookie' => 'snipeit_session',
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => null,
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely.
|
*/
'secure' => false,
/*
|--------------------------------------------------------------------------
| Allow multiple logins from different devices at the same time
|--------------------------------------------------------------------------
|
| By default, if a user logs into an account where someone is already
| logged in, the previous user will be logged out. We recommend leaving
| this set to false for security reasons.
|
*/
'multi_login' => false,
);
+112
View File
@@ -0,0 +1,112 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| URL
|--------------------------------------------------------------------------
|
| URL for the LDAP server. This should start with ldap://, for example:
| ldap://ldap.yourserver.com
|
*/
'url' => "",
/*
|--------------------------------------------------------------------------
| Username
|--------------------------------------------------------------------------
|
| Username to use to connect authenticate to LDAP, for example:
| cn=read-only-admin,dc=example,dc=com
|
*/
'username' => "",
/*
|--------------------------------------------------------------------------
| Password
|--------------------------------------------------------------------------
|
| Password to use when authenticating to LDAP.
|
*/
'password' => "",
/*
|--------------------------------------------------------------------------
| Basedn
|--------------------------------------------------------------------------
|
| The base where the search for users will be executed, for example:
| dc=example,dc=com
|
*/
'basedn' => "",
/*
|--------------------------------------------------------------------------
| Filter
|--------------------------------------------------------------------------
|
| The search filter for the LDAP query. This probably does not have to be
| changed.
|
*/
'filter' => "&(cn=*)",
/*
|--------------------------------------------------------------------------
| LDAP field names that will be retrieved to create a user.
|
| Using the username as an example:
| If I set 'result.username' => 'my-org-username', the code will connect to
| LDAP as follows (where $results[$i] represents a row in the LDAP query:
| $username-to-insert-in-snipe-it = $results[$i]["my-org-username"][0]
|
| Note: all these fields are required.
|--------------------------------------------------------------------------
|
| The search filter for the LDAP query.
|
*/
'result.username' => "",
'result.last.name' => "",
'result.first.name' => "",
/*
| These fields are optional as not all LDAP directories will have it. If yours
| does not have them, just leave these blank and the extra check will
| be omitted.
*/
'result.active.flag' => "",
'result.emp.num' => "",
'result.email' => "",
/*
|--------------------------------------------------------------------------
| LDAP filter query for authentication
|--------------------------------------------------------------------------
|
| The LDAP query that we want to execute when authenticating a user. This
| should not have to be changed.
|
*/
'authentication.filter.query' => "uid=",
/*
|--------------------------------------------------------------------------
| LDAP Version
|--------------------------------------------------------------------------
|
| Version of LDAP you are using.
|
*/
'version' => 3,
);
+154
View File
@@ -0,0 +1,154 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "array"
|
*/
'driver' => 'file',
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => 12000,
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'files' => storage_path().'/sessions',
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => null,
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => array(2, 100),
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'cookie' => 'snipeit_session',
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => null,
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely.
|
*/
'secure' => true,
/*
|--------------------------------------------------------------------------
| Allow multiple logins from different devices at the same time
|--------------------------------------------------------------------------
|
| By default, if a user logs into an account where someone is already
| logged in, the previous user will be logged out. We recommend leaving
| this set to false for security reasons.
|
*/
'multi_login' => true,
);
+2 -2
View File
@@ -26,7 +26,7 @@ return array(
|
*/
'url' => 'http://staging.yourserver.com',
'url' => 'http://snipe-it.dev',
/*
|--------------------------------------------------------------------------
@@ -40,6 +40,6 @@ return array(
| Run a php artisan key:generate --env=staging to create a random one
*/
'key' => 'Change_this_key_or_snipe_will_get_ya',
'key' => '8YHfiO4EyWBewqrpGHDA4Iuom2ZIahXQ',
);
+1 -1
View File
@@ -54,7 +54,7 @@ return array(
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'snipeit_laravel',
'database' => 'snipeit_unit',
'username' => 'travis',
'password' => '',
'charset' => 'utf8',
+112
View File
@@ -0,0 +1,112 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| URL
|--------------------------------------------------------------------------
|
| URL for the LDAP server. This should start with ldap://, for example:
| ldap://ldap.yourserver.com
|
*/
'url' => "",
/*
|--------------------------------------------------------------------------
| Username
|--------------------------------------------------------------------------
|
| Username to use to connect authenticate to LDAP, for example:
| cn=read-only-admin,dc=example,dc=com
|
*/
'username' => "",
/*
|--------------------------------------------------------------------------
| Password
|--------------------------------------------------------------------------
|
| Password to use when authenticating to LDAP.
|
*/
'password' => "",
/*
|--------------------------------------------------------------------------
| Basedn
|--------------------------------------------------------------------------
|
| The base where the search for users will be executed, for example:
| dc=example,dc=com
|
*/
'basedn' => "",
/*
|--------------------------------------------------------------------------
| Filter
|--------------------------------------------------------------------------
|
| The search filter for the LDAP query. This probably does not have to be
| changed.
|
*/
'filter' => "&(cn=*)",
/*
|--------------------------------------------------------------------------
| LDAP field names that will be retrieved to create a user.
|
| Using the username as an example:
| If I set 'result.username' => 'my-org-username', the code will connect to
| LDAP as follows (where $results[$i] represents a row in the LDAP query:
| $username-to-insert-in-snipe-it = $results[$i]["my-org-username"][0]
|
| Note: all these fields are required.
|--------------------------------------------------------------------------
|
| The search filter for the LDAP query.
|
*/
'result.username' => "",
'result.last.name' => "",
'result.first.name' => "",
/*
| These fields are optional as not all LDAP directories will have it. If yours
| does not have them, just leave these blank and the extra check will
| be omitted.
*/
'result.active.flag' => "",
'result.emp.num' => "",
'result.email' => "",
/*
|--------------------------------------------------------------------------
| LDAP filter query for authentication
|--------------------------------------------------------------------------
|
| The LDAP query that we want to execute when authenticating a user. This
| should not have to be changed.
|
*/
'authentication.filter.query' => "uid=",
/*
|--------------------------------------------------------------------------
| LDAP Version
|--------------------------------------------------------------------------
|
| Version of LDAP you are using.
|
*/
'version' => 3,
);
+3 -3
View File
@@ -1,5 +1,5 @@
<?php
return array (
'app_version' => 'v1.2.7-master',
'hash_version' => 'v1.2.7-master',
);
'app_version' => 'v2.0',
'hash_version' => 'v2.0-RC-1-11-gda6770c',
);
+96 -88
View File
@@ -18,6 +18,48 @@ class AuthController extends BaseController
return View::make('frontend.auth.signin');
}
/**
* Authenticates a user to LDAP
*
* @return true if the username and/or password provided are valid
* false if the username and/or password provided are invalid
*
*/
function ldap($username, $password) {
$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;
// Connecting to LDAP
$connection = ldap_connect($ldaphost) or die("Could not connect to {$ldaphost}");
// Needed for AD
ldap_set_option($connection, LDAP_OPT_REFERRALS, 0);
try {
if ($connection) {
// binding to ldap server
$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( ($isBound = ldap_bind($connection, $userDn, $password)) == "true") {
return true;
}
}
}
}
} catch (Exception $e) {
LOG::error($e->getMessage());
}
ldap_close($connection);
return false;
}
/**
* Account sign in form processing.
*
@@ -27,7 +69,7 @@ class AuthController extends BaseController
{
// Declare the rules for the form validation
$rules = array(
'email' => 'required|email',
'username' => 'required',
'password' => 'required',
);
@@ -41,8 +83,39 @@ class AuthController extends BaseController
}
try {
// Try to log the user in
Sentry::authenticate(Input::only('email', 'password'), Input::get('remember-me', 0));
/**
* =================================================================
* Hack in LDAP authentication
*/
// Try to get the user from the database.
$user = (array) DB::table('users')->where('username', Input::get('username'))->first();
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));
}
// Get the page we were before
$redirect = Session::get('loginRedirect', 'account');
@@ -53,91 +126,19 @@ 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) {
$this->messageBag->add('email', Lang::get('auth/message.account_not_found'));
$this->messageBag->add('username', Lang::get('auth/message.account_not_found'));
} catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
$this->messageBag->add('email', Lang::get('auth/message.account_not_activated'));
$this->messageBag->add('username', Lang::get('auth/message.account_not_activated'));
} catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
$this->messageBag->add('email', Lang::get('auth/message.account_suspended'));
$this->messageBag->add('username', Lang::get('auth/message.account_suspended'));
} catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
$this->messageBag->add('email', Lang::get('auth/message.account_banned'));
$this->messageBag->add('username', Lang::get('auth/message.account_banned'));
}
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($this->messageBag);
}
/**
* Account sign up.
*
* @return View
*/
public function getSignup()
{
// Is the user logged in?
if (Sentry::check()) {
return Redirect::route('account');
}
// Show the page
return View::make('frontend.auth.signup');
}
/**
* Account sign up form processing.
*
* @return Redirect
*/
public function postSignup()
{
// Declare the rules for the form validation
$rules = array(
'first_name' => 'required|min:2',
'last_name' => 'required|min:2',
'email' => 'required|email|unique:users',
'email_confirm' => 'required|email|same:email',
'password' => 'required|between:10,32',
'password_confirm' => 'required|same:password',
);
// 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);
}
try {
// Register the user
$user = Sentry::register(array(
'first_name' => Input::get('first_name'),
'last_name' => Input::get('last_name'),
'email' => Input::get('email'),
'password' => Input::get('password'),
));
// Data to be used on the email view
$data = array(
'user' => $user,
'activationUrl' => URL::route('activate', $user->getActivationCode()),
);
// Send the activation code through email
Mail::send('emails.register-activate', $data, function ($m) use ($user) {
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->subject('Welcome ' . $user->first_name);
});
// Redirect to the register page
return Redirect::back()->with('success', Lang::get('auth/message.signup.success'));
} catch (Cartalyst\Sentry\Users\UserExistsException $e) {
$this->messageBag->add('email', Lang::get('auth/message.account_already_exists'));
}
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($this->messageBag);
}
/**
* User account activation page.
@@ -192,7 +193,7 @@ class AuthController extends BaseController
{
// Declare the rules for the validator
$rules = array(
'email' => 'required|email',
'username' => 'required',
);
// Create a new validator instance from our dynamic rules
@@ -206,22 +207,28 @@ class AuthController extends BaseController
try {
// Get the user password recovery code
$user = Sentry::getUserProvider()->findByLogin(Input::get('email'));
$user = Sentry::getUserProvider()->findByLogin(Input::get('username'));
// Data to be used on the email view
$reset = $user->getResetPasswordCode();
// Data to be used on the username view
$data = array(
'user' => $user,
'forgotPasswordUrl' => URL::route('forgot-password-confirm', $user->getResetPasswordCode()),
'forgotPasswordUrl' => URL::route('forgot-password-confirm', $reset),
);
// Send the activation code through email
$user->reset_password_code = $reset;
$user->save();
// Send the activation code through username
Mail::send('emails.forgot-password', $data, function ($m) use ($user) {
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->to($user->username, $user->first_name . ' ' . $user->last_name);
$m->subject('Account Password Recovery');
});
} catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
// Even though the email was not found, we will pretend
// we have sent the password reset code through email,
// Even though the username was not found, we will pretend
// we have sent the password reset code through username,
// this is a security measure against hackers.
}
@@ -237,12 +244,13 @@ class AuthController extends BaseController
*/
public function getForgotPasswordConfirm($passwordResetCode = null)
{
try {
// Find the user using the password reset code
$user = Sentry::getUserProvider()->findByResetPasswordCode($passwordResetCode);
} catch(Cartalyst\Sentry\Users\UserNotFoundException $e) {
// Redirect to the forgot password page
return Redirect::route('forgot-password')->with('error', Lang::get('auth/message.account_not_found'));
//return Redirect::route('forgot-password')->with('error', Lang::get('auth/message.account_not_found'));
}
// Show the page
+115 -46
View File
@@ -12,6 +12,9 @@ use Actionlog;
use Lang;
use Accessory;
use DB;
use Slack;
use Setting;
use Config;
class ViewAssetsController extends AuthorizedController
{
@@ -47,117 +50,183 @@ class ViewAssetsController extends AuthorizedController
public function getRequestAsset($assetId = null) {
// Check if the asset exists
if (is_null($asset = Asset::find($assetId))) {
$user = Sentry::getUser();
// Check if the asset exists and is requestable
if (is_null($asset = Asset::RequestableAssets()->find($assetId))) {
// Redirect to the asset management page
return Redirect::to('frontend/account/view-assets')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
return Redirect::route('requestable-assets')->with('error', Lang::get('admin/hardware/message.does_not_exist_or_not_requestable'));
} else {
$logaction = new Actionlog();
$logaction->asset_id = $asset->id;
$logaction->asset_type = 'hardware';
$logaction->created_at = date("Y-m-d h:i:s");
return View::make('frontend/account/view-assets', compact('asset'));
if ($user->location_id) {
$logaction->location_id = $user->location_id;
}
$logaction->user_id = Sentry::getUser()->id;
$log = $logaction->logaction('requested');
$settings = Setting::getSettings();
if ($settings->slack_endpoint) {
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
'link_names' => true
];
$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().'>.'
]
]
])->send('Asset Requested');
} catch (Exception $e) {
}
}
return Redirect::route('requestable-assets')->with('success')->with('success', Lang::get('admin/hardware/message.requests.success'));
}
}
// Get the acceptance screen
public function getAcceptAsset($logID = null) {
if (is_null($findlog = Actionlog::find($logID))) {
// Redirect to the asset management page
return Redirect::to('account')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
// Asset
if (($findlog->asset_id!='') && ($findlog->asset_type=='hardware')) {
$item = Asset::find($findlog->asset_id);
// software
} elseif (($findlog->asset_id!='') && ($findlog->asset_type=='software')) {
// software
} elseif (($findlog->asset_id!='') && ($findlog->asset_type=='software')) {
$item = License::find($findlog->asset_id);
// accessories
// accessories
} elseif ($findlog->accessory_id!='') {
$item = Accessory::find($findlog->accessory_id);
$item = Accessory::find($findlog->accessory_id);
}
// Check if the asset exists
if (is_null($item)) {
// 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);
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'));
}
if ($findlog->accepted_id!='') {
// Redirect to the asset management page
return Redirect::to('account/view-assets')->with('error', Lang::get('admin/users/message.error.asset_already_accepted'));
}
if (!Input::has('asset_acceptance')) {
return Redirect::to('account/view-assets')->with('error', Lang::get('admin/users/message.error.accept_or_decline'));
}
$user = Sentry::getUser();
$logaction = new Actionlog();
if (Input::get('asset_acceptance')=='accepted') {
$logaction_msg = 'accepted';
$accepted="accepted";
$return_msg = Lang::get('admin/users/message.accepted');
} else {
$logaction_msg = 'declined';
$accepted="rejected";
$return_msg = Lang::get('admin/users/message.declined');
}
// Asset
if (($findlog->asset_id!='') && ($findlog->asset_type=='hardware')) {
$logaction->asset_id = $findlog->asset_id;
$logaction->accessory_id = NULL;
$logaction->asset_type = 'hardware';
// software
} elseif (($findlog->asset_id!='') && ($findlog->asset_type=='software')) {
if (Input::get('asset_acceptance')!='accepted') {
DB::table('assets')
->where('id', $findlog->asset_id)
->update(array('assigned_to' => null));
}
// software
} elseif (($findlog->asset_id!='') && ($findlog->asset_type=='software')) {
$logaction->asset_id = $findlog->asset_id;
$logaction->accessory_id = NULL;
$logaction->asset_type = 'software';
// accessories
// accessories
} elseif ($findlog->accessory_id!='') {
$logaction->asset_id = NULL;
$logaction->accessory_id = $findlog->accessory_id;
$logaction->asset_type = 'accessory';
$logaction->asset_type = 'accessory';
}
$logaction->checkedout_to = $findlog->checkedout_to;
$logaction->note = e(Input::get('note'));
$logaction->user_id = $user->id;
$logaction->accepted_at = date("Y-m-d h:i:s");
$log = $logaction->logaction('accepted');
$log = $logaction->logaction($logaction_msg);
$update_checkout = DB::table('asset_logs')
->where('id',$findlog->id)
->update(array('accepted_id' => $logaction->id));
$affected_asset=$logaction->assetlog;
$affected_asset->accepted=$accepted;
$affected_asset->save();
if ($update_checkout ) {
return Redirect::to('account/view-assets')->with('success', 'You have successfully accept this asset.');
return Redirect::to('account/view-assets')->with('success', $return_msg);
} else {
return Redirect::to('account/view-assets')->with('error', 'Something went wrong ');
}
}
+44 -21
View File
@@ -218,7 +218,7 @@ class AccessoriesController extends AdminController
}
// 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) as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id');
$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');
return View::make('backend/accessories/checkout', compact('accessory'))->with('users_list',$users_list);
@@ -274,20 +274,20 @@ class AccessoriesController extends AdminController
$logaction->location_id = $user->location_id;
$logaction->user_id = Sentry::getUser()->id;
$logaction->note = e(Input::get('note'));
$settings = Setting::getSettings();
if ($settings->slack_endpoint) {
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
'link_names' => true
];
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
try {
$client->attach([
'color' => 'good',
@@ -301,13 +301,13 @@ class AccessoriesController extends AdminController
'value' => e($logaction->note)
],
]
])->send('Accessory Checked Out');
} catch (Exception $e) {
}
}
@@ -322,6 +322,10 @@ class AccessoriesController extends AdminController
$data['eula'] = $accessory->getEula();
$data['first_name'] = $user->first_name;
$data['item_name'] = $accessory->name;
$data['checkout_date'] = $logaction->created_at;
$data['item_tag'] = '';
$data['expected_checkin'] = '';
$data['note'] = $logaction->note;
$data['require_acceptance'] = $accessory->requireAcceptance();
@@ -390,20 +394,20 @@ class AccessoriesController extends AdminController
$logaction->asset_type = 'accessory';
$logaction->user_id = $admin_user->id;
$logaction->note = e(Input::get('note'));
$settings = Setting::getSettings();
if ($settings->slack_endpoint) {
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
'link_names' => true
];
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
try {
$client->attach([
'color' => 'good',
@@ -416,18 +420,37 @@ class AccessoriesController extends AdminController
'title' => 'Note:',
'value' => e($logaction->note)
],
]
])->send('Accessory Checked In');
} catch (Exception $e) {
}
}
$log = $logaction->logaction('checkin from');
if(!is_null($accessory_user->assigned_to)) {
$user = User::find($accessory_user->assigned_to);
}
$data['log_id'] = $logaction->id;
$data['first_name'] = $user->first_name;
$data['item_name'] = $accessory->name;
$data['checkin_date'] = $logaction->created_at;
$data['item_tag'] = '';
$data['note'] = $logaction->note;
if (($accessory->checkin_email()=='1')) {
Mail::send('emails.checkin-asset', $data, function ($m) use ($user) {
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->subject('Confirm Accessory Checkin');
});
}
if ($backto=='user') {
return Redirect::to("admin/users/".$return_to.'/view')->with('success', Lang::get('admin/accessories/message.checkin.success'));
@@ -0,0 +1,464 @@
<?php
namespace Controllers\Admin;
use AdminController;
use AssetMaintenance;
use Carbon\Carbon;
use Datatable;
use DB;
use Input;
use Lang;
use Log;
use Mail;
use Redirect;
use Response;
use Sentry;
use Slack;
use Str;
use Supplier;
use TCPDF;
use Validator;
use View;
class AssetMaintenancesController extends AdminController
{
/**
* getIndex
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function getIndex()
{
return View::make( 'backend/asset_maintenances/index' );
}
/**
* getDatatable
* Gets the datatable for the index page
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function getDatatable()
{
$assetMaintenances = AssetMaintenance::orderBy( 'created_at', 'DESC' )
->get();
$actions = new \Chumper\Datatable\Columns\FunctionColumn( 'actions', function ( $assetMaintenances ) {
return '<a href="' . route( 'update/asset_maintenance', $assetMaintenances->id )
. '" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'
. route( 'delete/asset_maintenance', $assetMaintenances->id ) . '" data-content="'
. Lang::get( 'admin/asset_maintenances/message.delete.confirm' ) . '" data-title="'
. Lang::get( 'general.delete' ) . ' ' . htmlspecialchars( $assetMaintenances->title )
. '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
} );
return Datatable::collection( $assetMaintenances )
->addColumn( 'asset', function ( $assetMaintenances ) {
return link_to( '/hardware/' . $assetMaintenances->asset_id . '/view',
mb_strimwidth( $assetMaintenances->asset->name, 0, 50, "..." ) );
} )
->addColumn( 'supplier', function ( $assetMaintenances ) {
return link_to( '/admin/settings/suppliers/' . $assetMaintenances->supplier_id
. '/view',
mb_strimwidth( $assetMaintenances->supplier->name, 0, 50, "..." ) );
} )
->addColumn( 'asset_maintenance_type', function ( $assetMaintenances ) {
return $assetMaintenances->asset_maintenance_type;
} )
->addColumn( 'title', function ( $assetMaintenances ) {
return link_to( '/admin/asset_maintenances/' . $assetMaintenances->id . '/view',
mb_strimwidth( $assetMaintenances->title, 0, 50, "..." ) );
} )
->addColumn( 'start_date', function ( $assetMaintenances ) {
return $assetMaintenances->start_date;
} )
->addColumn( 'completion_date', function ( $assetMaintenances ) {
return $assetMaintenances->completion_date;
} )
->addColumn( 'asset_maintenance_time', function ( $assetMaintenances ) {
if (is_null( $assetMaintenances->asset_maintenance_time )) {
$assetMaintenances->asset_maintenance_time = Carbon::now()
->diffInDays( Carbon::parse( $assetMaintenances->start_date ) );
}
return intval( $assetMaintenances->asset_maintenance_time );
} )
->addColumn( 'cost', function ( $assetMaintenances ) {
return sprintf( Lang::get( 'general.currency' ) . '%01.2f', $assetMaintenances->cost );
} )
->addColumn( $actions )
->searchColumns( 'asset', 'supplier', 'asset_maintenance_type', 'title', 'start_date',
'completion_date', 'asset_maintenance_time', 'cost', 'actions' )
->orderColumns( 'asset', 'supplier', 'asset_maintenance_type', 'title', 'start_date',
'completion_date', 'asset_maintenance_time', 'cost', 'actions' )
->make();
}
/**
* getCreate
*
* @param null $assetId
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function getCreate( $assetId = null )
{
// Prepare Asset Maintenance Type List
$assetMaintenanceType = [
'' => 'Select an asset maintenance type',
] + AssetMaintenance::getImprovementOptions();
// Mark the selected asset, if it came in
$selectedAsset = $assetId;
// Get the possible assets using a left join to get a list of assets and some other helpful info
$asset = DB::table( 'assets' )
->leftJoin( 'users', 'users.id', '=', 'assets.assigned_to' )
->leftJoin( 'models', 'assets.model_id', '=', 'models.id' )
->select( 'assets.id', 'assets.name', 'first_name', 'last_name', 'asset_tag',
DB::raw( 'concat(first_name," ",last_name) as full_name, assets.id as id, models.name as modelname' ) )
->whereNull( 'assets.deleted_at' )
->get();
$asset_array = json_decode( json_encode( $asset ), true );
$asset_element[ '' ] = 'Please select an asset';
// Build a list out of the data results
for ($x = 0; $x < count( $asset_array ); $x++) {
if ($asset_array[ $x ][ 'full_name' ] != '') {
$full_name = ' (' . $asset_array[ $x ][ 'full_name' ] . ') ' . $asset_array[ $x ][ 'modelname' ];
} else {
$full_name = ' (Unassigned) ' . $asset_array[ $x ][ 'modelname' ];
}
$asset_element[ $asset_array[ $x ][ 'id' ] ] =
$asset_array[ $x ][ 'asset_tag' ] . ' - ' . $asset_array[ $x ][ 'name' ] . $full_name;
}
// Get Supplier List
$supplier_list = [ '' => 'Select Supplier' ] + Supplier::orderBy( 'name', 'asc' )
->lists( 'name', 'id' );
// Render the view
return View::make( 'backend/asset_maintenances/edit' )
->with( 'asset_list', $asset_element )
->with( 'selectedAsset', $selectedAsset )
->with( 'supplier_list', $supplier_list )
->with( 'assetMaintenanceType', $assetMaintenanceType )
->with( 'assetMaintenance', new AssetMaintenance );
}
/**
* postCreate
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function postCreate()
{
// get the POST data
$new = Input::all();
// create a new model instance
$assetMaintenance = new AssetMaintenance();
// attempt validation
if ($assetMaintenance->validate( $new )) {
if (e( Input::get( 'supplier_id' ) ) == '') {
$assetMaintenance->supplier_id = null;
} else {
$assetMaintenance->supplier_id = e( Input::get( 'supplier_id' ) );
}
if (e( Input::get( 'is_warranty' ) ) == '') {
$assetMaintenance->is_warranty = 0;
} else {
$assetMaintenance->is_warranty = e( Input::get( 'is_warranty' ) );
}
if (e( Input::get( 'cost' ) ) == '') {
$assetMaintenance->cost = '';
} else {
$assetMaintenance->cost = ParseFloat( e( Input::get( 'cost' ) ) );
}
if (e( Input::get( 'notes' ) ) == '') {
$assetMaintenance->notes = null;
} else {
$assetMaintenance->notes = e( Input::get( 'notes' ) );
}
// Save the asset maintenance data
$assetMaintenance->asset_id = e( Input::get( 'asset_id' ) );
$assetMaintenance->asset_maintenance_type = e( Input::get( 'asset_maintenance_type' ) );
$assetMaintenance->title = e( Input::get( 'title' ) );
$assetMaintenance->start_date = e( Input::get( 'start_date' ) );
$assetMaintenance->completion_date = e( Input::get( 'completion_date' ) );
if (( $assetMaintenance->completion_date == "" )
|| ( $assetMaintenance->completion_date == "0000-00-00" )
) {
$assetMaintenance->completion_date = null;
}
// Was the asset maintenance created?
if ($assetMaintenance->save()) {
// Redirect to the new asset maintenance page
return Redirect::to( "admin/asset_maintenances" )
->with( 'success', Lang::get( 'admin/asset_maintenances/message.create.success' ) );
}
} else {
// failure
$errors = $assetMaintenance->errors();
return Redirect::back()
->withInput()
->withErrors( $errors );
}
// Redirect to the asset maintenance create page
return Redirect::to( 'admin/asset_maintenances/edit' )
->with( 'error', Lang::get( 'admin/asset_maintenances/message.create.error' ) )
->with( 'assetMaintenance', new AssetMaintenance );
}
/**
* getEdit
*
* @param null $assetMaintenanceId
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
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' ) );
}
if ($assetMaintenance->completion_date == '0000-00-00') {
$assetMaintenance->completion_date = null;
}
if ($assetMaintenance->start_date == '0000-00-00') {
$assetMaintenance->start_date = null;
}
if ($assetMaintenance->cost == '0.00') {
$assetMaintenance->cost = null;
}
// Prepare Improvement Type List
$assetMaintenanceType = [
'' => 'Select an improvement type',
] + AssetMaintenance::getImprovementOptions();
// Get the possible assets using a left join to get a list of assets and some other helpful info
$asset = DB::table( 'assets' )
->leftJoin( 'users', 'users.id', '=', 'assets.assigned_to' )
->leftJoin( 'models', 'assets.model_id', '=', 'models.id' )
->select( 'assets.id', 'assets.name', 'first_name', 'last_name', 'asset_tag',
DB::raw( 'concat(first_name," ",last_name) as full_name, assets.id as id, models.name as modelname' ) )
->whereNull( 'assets.deleted_at' )
->get();
$asset_array = json_decode( json_encode( $asset ), true );
$asset_element[ '' ] = 'Please select an asset';
// Build a list out of the data results
for ($x = 0; $x < count( $asset_array ); $x++) {
if ($asset_array[ $x ][ 'full_name' ] != '') {
$full_name = ' (' . $asset_array[ $x ][ 'full_name' ] . ') ' . $asset_array[ $x ][ 'modelname' ];
} else {
$full_name = ' (Unassigned) ' . $asset_array[ $x ][ 'modelname' ];
}
$asset_element[ $asset_array[ $x ][ 'id' ] ] =
$asset_array[ $x ][ 'asset_tag' ] . ' - ' . $asset_array[ $x ][ 'name' ] . $full_name;
}
// Get Supplier List
$supplier_list = [ '' => 'Select Supplier' ] + Supplier::orderBy( 'name', 'asc' )
->lists( 'name', 'id' );
// Render the view
return View::make( 'backend/asset_maintenances/edit' )
->with( 'asset_list', $asset_element )
->with( 'selectedAsset', null )
->with( 'supplier_list', $supplier_list )
->with( 'assetMaintenanceType', $assetMaintenanceType )
->with( 'assetMaintenance', $assetMaintenance );
}
/**
* postEdit
*
* @param null $assetMaintenanceId
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function postEdit( $assetMaintenanceId = null )
{
// get the POST data
$new = Input::all();
// 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' ) );
}
// attempt validation
if ($assetMaintenance->validate( $new )) {
if (e( Input::get( 'supplier_id' ) ) == '') {
$assetMaintenance->supplier_id = null;
} else {
$assetMaintenance->supplier_id = e( Input::get( 'supplier_id' ) );
}
if (e( Input::get( 'is_warranty' ) ) == '') {
$assetMaintenance->is_warranty = 0;
} else {
$assetMaintenance->is_warranty = e( Input::get( 'is_warranty' ) );
}
if (e( Input::get( 'cost' ) ) == '') {
$assetMaintenance->cost = '';
} else {
$assetMaintenance->cost = ParseFloat( e( Input::get( 'cost' ) ) );
}
if (e( Input::get( 'notes' ) ) == '') {
$assetMaintenance->notes = null;
} else {
$assetMaintenance->notes = e( Input::get( 'notes' ) );
}
// Save the asset maintenance data
$assetMaintenance->asset_id = e( Input::get( 'asset_id' ) );
$assetMaintenance->asset_maintenance_type = e( Input::get( 'asset_maintenance_type' ) );
$assetMaintenance->title = e( Input::get( 'title' ) );
$assetMaintenance->start_date = e( Input::get( 'start_date' ) );
$assetMaintenance->completion_date = e( Input::get( 'completion_date' ) );
if (( $assetMaintenance->completion_date == "" )
|| ( $assetMaintenance->completion_date == "0000-00-00" )
) {
$assetMaintenance->completion_date = null;
if (( $assetMaintenance->asset_maintenance_time !== 0 )
|| ( !is_null( $assetMaintenance->asset_maintenance_time ) )
) {
$assetMaintenance->asset_maintenance_time = 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()) {
// Redirect to the new asset maintenance page
return Redirect::to( "admin/asset_maintenances" )
->with( 'success', Lang::get( 'admin/asset_maintenances/message.create.success' ) );
}
} else {
// failure
$errors = $assetMaintenance->errors();
return Redirect::back()
->withInput()
->withErrors( $errors );
}
// Redirect to the improvement create page
return Redirect::to( 'admin/asset_maintenances/edit' )
->with( 'error', Lang::get( 'admin/asset_maintenances/message.create.error' ) )
->with( 'assetMaintenance', $assetMaintenance );
}
/**
* getDelete
*
* @param $assetMaintenanceId
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
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' ) );
}
// Delete the asset maintenance
$assetMaintenance->delete();
// Redirect to the asset_maintenance management page
return Redirect::to( 'admin/asset_maintenances' )
->with( 'success', Lang::get( 'admin/asset_maintenances/message.delete.success' ) );
}
/**
* getView
*
* @param $assetMaintenanceId
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
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' ) );
}
return View::make( 'backend/asset_maintenances/view')->with('assetMaintenance', $assetMaintenance);
}
}
+228 -201
View File
@@ -5,6 +5,7 @@ use Input;
use Lang;
use Asset;
use Supplier;
use AssetMaintenance;
use Statuslabel;
use User;
use Setting;
@@ -21,15 +22,18 @@ use Response;
use Config;
use Location;
use Log;
use DNS1D;
use DNS2D;
use Mail;
use Datatable;
use TCPDF;
use Slack;
use Manufacturer; //for embedded-create
class AssetsController extends AdminController
{
protected $qrCodeDimensions = array( 'height' => 3.5, 'width' => 3.5);
protected $barCodeDimensions = array( 'height' => 2, 'width' => 22);
/**
* Show a list of all the assets.
@@ -42,8 +46,6 @@ class AssetsController extends AdminController
return View::make('backend/hardware/index');
}
/**
* Asset create.
*
@@ -53,24 +55,15 @@ class AssetsController extends AdminController
*/
public function getCreate($model_id = null)
{
// Grab the dropdown list of models
//$model_list = array('' => 'Select a Model') + Model::orderBy('name', 'asc')->lists('name'.' '. 'modelno', 'id');
$model_list = array('' => Lang::get('general.select_model')) + DB::table('models')
->select(DB::raw('concat(name," / ",modelno) as name, id'))->orderBy('name', 'asc')
->orderBy('modelno', 'asc')
->whereNull('deleted_at')
->lists('name', 'id');
$supplier_list = array('' => Lang::get('general.select_supplier')) + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$assigned_to = array('' => Lang::get('general.select_user')) + DB::table('users')->select(DB::raw('concat(first_name," ",last_name) as full_name, id'))->whereNull('deleted_at')->lists('full_name', 'id');
$location_list = array('' => Lang::get('general.select_location')) + Location::orderBy('name', 'asc')->lists('name', 'id');
// Grab the dropdown list of status
$statuslabel_list = Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
// Grab the dropdown lists
$model_list = modelList();
$statuslabel_list = statusLabelList();
$location_list = locationsList();
$manufacturer_list = manufacturerList();
$category_list = categoryList();
$supplier_list = suppliersList();
$assigned_to = usersList();
$statuslabel_types = statusTypeList();
$view = View::make('backend/hardware/edit');
$view->with('supplier_list',$supplier_list);
@@ -79,6 +72,9 @@ class AssetsController extends AdminController
$view->with('assigned_to',$assigned_to);
$view->with('location_list',$location_list);
$view->with('asset',new Asset);
$view->with('manufacturer',$manufacturer_list);
$view->with('category',$category_list);
$view->with('statuslabel_types',$statuslabel_types);
if (!is_null($model_id)) {
$selected_model = Model::find($model_id);
@@ -210,19 +206,25 @@ class AssetsController extends AdminController
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
// Grab the dropdown lists
$model_list = modelList();
$statuslabel_list = statusLabelList();
$location_list = locationsList();
$manufacturer_list = manufacturerList();
$category_list = categoryList();
$supplier_list = suppliersList();
$assigned_to = usersList();
$statuslabel_types = statusTypeList();
// Grab the dropdown list of models
$model_list = array('' => Lang::get('general.select_model')) + DB::table('models')
->select(DB::raw('concat(name," / ",modelno) as name, id'))->orderBy('name', 'asc')
->orderBy('modelno', 'asc')
->lists('name', 'id');
$supplier_list = array('' => Lang::get('general.select_supplier')) + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$location_list = array('' => Lang::get('general.select_location')) + Location::orderBy('name', 'asc')->lists('name', 'id');
// Grab the dropdown list of status
$statuslabel_list = Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
return View::make('backend/hardware/edit', compact('asset'))->with('model_list',$model_list)->with('supplier_list',$supplier_list)->with('location_list',$location_list)->with('statuslabel_list',$statuslabel_list);
return View::make('backend/hardware/edit', compact('asset'))
->with('model_list',$model_list)
->with('supplier_list',$supplier_list)
->with('location_list',$location_list)
->with('statuslabel_list',$statuslabel_list)
->with('assigned_to',$assigned_to)
->with('manufacturer',$manufacturer_list)
->with('statuslabel_types',$statuslabel_types)
->with('category',$category_list);
}
@@ -370,7 +372,7 @@ class AssetsController extends AdminController
}
// Get the dropdown of users and then pass it to the checkout view
$users_list = array('' => Lang::get('general.select_user')) + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name) as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id');
$users_list = usersList();
return View::make('backend/hardware/checkout', compact('asset'))->with('users_list',$users_list);
@@ -381,113 +383,51 @@ class AssetsController extends AdminController
**/
public function postCheckout($assetId)
{
// Check if the asset exists
if (is_null($asset = Asset::find($assetId))) {
// Redirect to the asset management page with error
if (!$asset = Asset::find($assetId)) {
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.not_found'));
}
$assigned_to = e(Input::get('assigned_to'));
// Declare the rules for the form validation
$rules = array(
'assigned_to' => 'required|min:1',
'checkout_at' => 'required|date',
'note' => 'alpha_space',
);
// 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);
}
// Check if the user exists
if (is_null($user = User::find($assigned_to))) {
// Redirect to the asset management page with error
if (!$user = User::find(e(Input::get('assigned_to')))) {
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.user_does_not_exist'));
}
// Update the asset data
$asset->assigned_to = e(Input::get('assigned_to'));
// Was the asset updated?
if($asset->save()) {
$logaction = new Actionlog();
if (Input::has('checkout_at')) {
if (Input::get('checkout_at')!= date("Y-m-d")){
$logaction->created_at = e(Input::get('checkout_at')).' 00:00:00';
}
}
if (!$admin = Sentry::getUser()) {
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.admin_user_does_not_exist'));
}
if (Input::get('checkout_at')!= date("Y-m-d")){
$checkout_at = e(Input::get('checkout_at')).' 00:00:00';
} else {
$checkout_at = date("Y-m-d h:i:s");
}
$logaction->asset_id = $asset->id;
$logaction->checkedout_to = $asset->assigned_to;
$logaction->asset_type = 'hardware';
$logaction->location_id = $user->location_id;
$logaction->user_id = Sentry::getUser()->id;
$logaction->note = e(Input::get('note'));
$log = $logaction->logaction('checkout');
$data['log_id'] = $logaction->id;
$data['eula'] = $asset->getEula();
$data['first_name'] = $user->first_name;
$data['item_name'] = $asset->showAssetName();
$data['require_acceptance'] = $asset->requireAcceptance();
$settings = Setting::getSettings();
if ($settings->slack_endpoint) {
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
'link_names' => true
];
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
try {
$client->attach([
'color' => 'good',
'fields' => [
[
'title' => 'Checked Out:',
'value' => strtoupper($logaction->asset_type).' asset <'.Config::get('app.url').'/hardware/'.$asset->id.'/view'.'|'.$asset->showAssetName().'> checked out to <'.Config::get('app.url').'/admin/users/'.$user->id.'/view|'.$user->fullName().'> by <'.Config::get('app.url').'/hardware/'.$asset->id.'/view'.'|'.Sentry::getUser()->fullName().'>.'
],
[
'title' => 'Note:',
'value' => e($logaction->note)
],
]
])->send('Asset Checked Out');
} catch (Exception $e) {
}
if (Input::has('expected_checkin')) {
if (Input::get('expected_checkin')!= date("Y-m-d")){
$expected_checkin = e(Input::get('expected_checkin')).' 00:00:00';
}
} else {
$expected_checkin = null;
}
if (($asset->requireAcceptance()=='1') || ($asset->getEula())) {
Mail::send('emails.accept-asset', $data, function ($m) use ($user) {
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->subject('Confirm asset delivery');
});
}
if ($asset->checkOutToUser($user, $admin, $checkout_at, $expected_checkin, e(Input::get('note')), e(Input::get('name')))) {
// Redirect to the new asset page
return Redirect::to("hardware")->with('success', Lang::get('admin/hardware/message.checkout.success'));
}
@@ -541,6 +481,7 @@ class AssetsController extends AdminController
// Update the asset data to null, since it's being checked in
$asset->assigned_to = NULL;
$asset->accepted = NULL;
// Was the asset updated?
@@ -597,6 +538,20 @@ class AssetsController extends AdminController
}
$data['log_id'] = $logaction->id;
$data['first_name'] = $user->first_name;
$data['item_name'] = $asset->showAssetName();
$data['checkin_date'] = $logaction->created_at;
$data['item_tag'] = $asset->asset_tag;
$data['note'] = $logaction->note;
if ((($asset->checkin_email()=='1')) && (!Config::get('app.lock_passwords'))) {
Mail::send('emails.checkin-asset', $data, function ($m) use ($user) {
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->subject('Confirm Asset Checkin');
});
}
if ($backto=='user') {
return Redirect::to("admin/users/".$return_to.'/view')->with('success', Lang::get('admin/hardware/message.checkin.success'));
} else {
@@ -655,9 +610,14 @@ class AssetsController extends AdminController
if (isset($asset->id,$asset->asset_tag)) {
if ($settings->barcode_type == 'C128'){
$content = DNS1D::getBarcodePNG(route('view/hardware', $asset->id), $settings->barcode_type,
$this->barCodeDimensions['height'],$this->barCodeDimensions['width']);
}
else{
$content = DNS2D::getBarcodePNG(route('view/hardware', $asset->id), $settings->barcode_type,
$this->qrCodeDimensions['height'],$this->qrCodeDimensions['width']);
}
$img = imagecreatefromstring(base64_decode($content));
imagepng($img);
imagedestroy($img);
@@ -688,22 +648,32 @@ class AssetsController extends AdminController
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
// Grab the dropdown list of models
$model_list = array('' => Lang::get('general.select_model')) + Model::lists('name', 'id');
// Grab the dropdown list of status
$statuslabel_list = Statuslabel::lists('name', 'id');
$location_list = array('' => Lang::get('general.select_location')) + Location::lists('name', 'id');
// get depreciation list
$supplier_list = array('' => Lang::get('general.select_supplier')) + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$assigned_to = array('' => Lang::get('general.select_user')) + DB::table('users')->select(DB::raw('concat(first_name," ",last_name) as full_name, id'))->whereNull('deleted_at')->lists('full_name', 'id');
// Grab the dropdown lists
$model_list = modelList();
$statuslabel_list = statusLabelList();
$location_list = locationsList();
$manufacturer_list = manufacturerList();
$category_list = categoryList();
$supplier_list = suppliersList();
$assigned_to = usersList();
$statuslabel_types = statusTypeList();
$asset = clone $asset_to_clone;
$asset->id = null;
$asset->asset_tag = '';
return View::make('backend/hardware/edit')->with('supplier_list',$supplier_list)->with('model_list',$model_list)->with('statuslabel_list',$statuslabel_list)->with('assigned_to',$assigned_to)->with('asset',$asset)->with('location_list',$location_list);
$asset->serial = '';
$asset->assigned_to = '';
$asset->mac_address = '';
return View::make('backend/hardware/edit')
->with('supplier_list',$supplier_list)
->with('model_list',$model_list)
->with('statuslabel_list',$statuslabel_list)
->with('statuslabel_types',$statuslabel_types)
->with('assigned_to',$assigned_to)
->with('asset',$asset)
->with('location_list',$location_list)
->with('manufacturer',$manufacturer_list)
->with('category',$category_list);
}
@@ -787,7 +757,7 @@ class AssetsController extends AdminController
}
} else {
return Redirect::back()->with('success', Lang::get('admin/hardware/message.upload.nofiles'));
return Redirect::back()->with('error', Lang::get('admin/hardware/message.upload.nofiles'));
}
@@ -903,10 +873,10 @@ class AssetsController extends AdminController
$assets = Input::get('edit_asset');
$supplier_list = array('' => '') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$statuslabel_list = array('' => '') + Statuslabel::lists('name', 'id');
$location_list = array('' => '') + Location::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);
}
@@ -933,7 +903,7 @@ class AssetsController extends AdminController
$assets = Input::get('bulk_edit');
if ( (Input::has('purchase_date')) || (Input::has('rtd_location_id')) || (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('status_id')) ) {
foreach ($assets as $key => $value) {
@@ -943,6 +913,22 @@ class AssetsController extends AdminController
$update_array['purchase_date'] = e(Input::get('purchase_date'));
}
if (Input::has('purchase_cost')) {
$update_array['purchase_cost'] = e(Input::get('purchase_cost'));
}
if (Input::has('supplier_id')) {
$update_array['supplier_id'] = e(Input::get('supplier_id'));
}
if (Input::has('order_number')) {
$update_array['order_number'] = e(Input::get('order_number'));
}
if (Input::has('warranty_months')) {
$update_array['warranty_months'] = e(Input::get('warranty_months'));
}
if (Input::has('rtd_location_id')) {
$update_array['rtd_location_id'] = e(Input::get('rtd_location_id'));
}
@@ -951,6 +937,12 @@ 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 (DB::table('assets')
->where('id', $key)
@@ -990,62 +982,72 @@ class AssetsController extends AdminController
public function getDatatable($status = null)
{
$assets = Asset::with('model','assigneduser','assigneduser.userloc','assetstatus','defaultLoc','assetlog','model','model.category')->Hardware()->select(array('id', 'name','model_id','assigned_to','asset_tag','serial','status_id','purchase_date','deleted_at'));
$assets = Asset::with('model','assigneduser','assigneduser.userloc','assetstatus','defaultLoc','assetlog','model','model.category')->Hardware()->select(array('id', 'name','model_id','assigned_to','asset_tag','serial','status_id','purchase_date','deleted_at','rtd_location_id','notes','order_number','mac_address'));
switch ($status) {
case 'Pending':
$assets->Pending();
break;
case 'RTD':
$assets->RTD();
break;
case 'Undeployable':
$assets->Undeployable();
break;
case 'Archived':
$assets->Archived();
break;
case 'Requestable':
$assets->RequestableAssets();
break;
case 'Deployed':
$assets->Deployed();
break;
case 'Deleted':
$assets->withTrashed()->Deleted();
break;
}
switch ($status) {
case 'Deleted':
$assets->withTrashed()->Deleted();
break;
case 'Pending':
$assets->Pending();
break;
case 'RTD':
$assets->RTD();
break;
case 'Undeployable':
$assets->Undeployable();
break;
case 'Archived':
$assets->Archived();
break;
case 'Requestable':
$assets->RequestableAssets();
break;
case 'Deployed':
$assets->Deployed();
break;
}
if (Input::has('order_number')) {
$assets->where('order_number','=',e(Input::get('order_number')));
}
$assets = $assets->orderBy('asset_tag', 'ASC')->get();
$assets = $assets->orderBy('asset_tag', 'ASC')->get();
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($assets)
{
if ($assets->deleted_at=='') {
return '<div style=" white-space: nowrap;"><a href="'.route('clone/hardware', $assets->id).'" class="btn btn-info btn-sm" title="Clone asset"><i class="fa fa-files-o"></i></a> <a href="'.route('update/hardware', $assets->id).'" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> <a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/hardware', $assets->id).'" data-content="'.Lang::get('admin/hardware/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($assets->asset_tag).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';
} elseif ($assets->deleted_at!='') {
return '<a href="'.route('restore/hardware', $assets->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
}
});
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($assets)
{
if ($assets->deleted_at=='') {
return '<a href="'.route('update/hardware', $assets->id).'" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> <a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/hardware', $assets->id).'" data-content="'.Lang::get('admin/hardware/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($assets->asset_tag).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
} elseif ($assets->model->deleted_at=='') {
return '<a href="'.route('restore/hardware', $assets->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
}
$inout = new \Chumper\Datatable\Columns\FunctionColumn('inout', function ($assets)
{
});
if ($assets->assetstatus) {
$inout = new \Chumper\Datatable\Columns\FunctionColumn('inout', function ($assets)
{
if (($assets->assigned_to !='') && ($assets->assigned_to > 0)) {
return '<a href="'.route('checkin/hardware', $assets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
} else {
return '<a href="'.route('checkout/hardware', $assets->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
}
});
if ($assets->assetstatus->deployable != 0) {
if (($assets->assigned_to !='') && ($assets->assigned_to > 0)) {
return '<a href="'.route('checkin/hardware', $assets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
} else {
return '<a href="'.route('checkout/hardware', $assets->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
}
}
}
});
return Datatable::collection($assets)
->addColumn('',function($assets)
{
return '<input type="checkbox" name="edit_asset['.$assets->id.']" class="one_required">';
return '<div class="text-center"><input type="checkbox" name="edit_asset['.$assets->id.']" class="one_required"></div>';
})
->addColumn('name',function($assets)
{
@@ -1056,25 +1058,32 @@ class AssetsController extends AdminController
return '<a title="'.$assets->asset_tag.'" href="hardware/'.$assets->id.'/view">'.$assets->asset_tag.'</a>';
})
->showColumns('serial')
->showColumns('serial')
->addColumn('model',function($assets)
{
return $assets->model->name;
if ($assets->model) {
return $assets->model->name;
} else {
return 'No model';
}
})
->addColumn('status',function($assets)
{
if ($assets->assigned_to!='') {
return link_to('../admin/users/'.$assets->assigned_to.'/view', $assets->assigneduser->fullName());
} else {
return $assets->assetstatus->name;
}
->addColumn('status',function($assets)
{
if ($assets->assigned_to!='') {
return link_to(Config::get('app.url').'/admin/users/'.$assets->assigned_to.'/view', $assets->assigneduser->fullName());
} else {
if ($assets->assetstatus) {
return $assets->assetstatus->name;
}
}
})
->addColumn('location',function($assets)
{
if ($assets->assigned_to && $assets->assigneduser->userloc) {
if ($assets->assigned_to && ($assets->assigneduser->userloc!='')) {
return link_to('admin/settings/locations/'.$assets->assigneduser->userloc->id.'/edit', $assets->assigneduser->userloc->name);
} elseif ($assets->defaultLoc){
return link_to('admin/settings/locations/'.$assets->defaultLoc->id.'/edit', $assets->defaultLoc->name);
@@ -1082,28 +1091,46 @@ class AssetsController extends AdminController
})
->addColumn('category',function($assets)
{
return $assets->model->category->name;
if (isset($assets->model->category)) {
return $assets->model->category->name;
} else {
return 'No category';
}
})
})
->addColumn('eol',function($assets)
{
return $assets->eol_date();
})
->addColumn('eol',function($assets)
{
return $assets->eol_date();
})
->addColumn('notes',function($assets)
{
return $assets->notes;
})
->addColumn('mac_address',function($assets)
{
return $assets->mac_address;
})
->addColumn('order_number',function($assets)
{
return '<a href="../hardware/?order_number='.$assets->order_number.'">'.$assets->order_number.'';
})
->addColumn('checkout_date',function($assets)
{
if (($assets->assigned_to!='') && ($assets->assetlog->first())) {
return $assets->assetlog->first()->created_at->format('Y-m-d');
}
->addColumn('checkout_date',function($assets)
{
if (($assets->assigned_to!='') && ($assets->assetlog->first())) {
return $assets->assetlog->first()->created_at->format('Y-m-d');
}
})
->addColumn($inout)
->addColumn($actions)
->searchColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','checkout_date', 'inout','category')
->orderColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','checkout_date', 'inout')
->make();
})
->addColumn($inout)
->addColumn($actions)
->searchColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','checkout_date', 'inout','category','notes','order_number','mac_address')
->orderColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','notes','order_number','checkout_date', 'inout','mac_address')
->make();
}
}
+12 -10
View File
@@ -36,7 +36,7 @@ class CategoriesController extends AdminController
public function getCreate()
{
// Show the page
$category_types= array('' => '', 'asset' => 'Asset', 'accessory' => 'Accessory');
$category_types= categoryTypeList();
return View::make('backend/categories/edit')->with('category',new Category)
->with('category_types',$category_types);
}
@@ -66,8 +66,9 @@ class CategoriesController extends AdminController
$category->name = e(Input::get('name'));
$category->category_type = e(Input::get('category_type'));
$category->eula_text = e(Input::get('eula_text'));
$category->use_default_eula = e(Input::get('use_default_eula', '0'));
$category->require_acceptance = e(Input::get('require_acceptance', '0'));
$category->use_default_eula = e(Input::get('use_default_eula', '0'));
$category->require_acceptance = e(Input::get('require_acceptance', '0'));
$category->checkin_email = e(Input::get('checkin_email', '0'));
$category->user_id = Sentry::getId();
// Was the asset created?
@@ -101,8 +102,8 @@ class CategoriesController extends AdminController
//$category_options = array('' => 'Top Level') + Category::lists('name', 'id');
$category_options = array('' => 'Top Level') + DB::table('categories')->where('id', '!=', $categoryId)->lists('name', 'id');
$category_types= array('' => '', 'asset' => 'Asset', 'accessory' => 'Accessory');
$category_types= array('' => '', 'asset' => 'Asset', 'accessory' => 'Accessory', 'consumable' => 'Consumable');
return View::make('backend/categories/edit', compact('category'))
->with('category_options',$category_options)
->with('category_types',$category_types);
@@ -143,8 +144,9 @@ class CategoriesController extends AdminController
$category->name = e(Input::get('name'));
$category->category_type = e(Input::get('category_type'));
$category->eula_text = e(Input::get('eula_text'));
$category->use_default_eula = e(Input::get('use_default_eula', '0'));
$category->require_acceptance = e(Input::get('require_acceptance', '0'));
$category->use_default_eula = e(Input::get('use_default_eula', '0'));
$category->require_acceptance = e(Input::get('require_acceptance', '0'));
$category->checkin_email = e(Input::get('checkin_email', '0'));
// Was the asset created?
if($category->save()) {
@@ -241,13 +243,13 @@ class CategoriesController extends AdminController
->orderColumns('name','category_type','count','acceptance','eula','actions')
->make();
}
public function getDataView($categoryID) {
$category = Category::find($categoryID);
$categoryassets = $category->assets;
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($categoryassets)
{
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($categoryassets)
{
if (($categoryassets->assigned_to !='') && ($categoryassets->assigned_to > 0)) {
return '<a href="'.route('checkin/hardware', $categoryassets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
} else {
@@ -0,0 +1,394 @@
<?php namespace Controllers\Admin;
use AdminController;
use Input;
use Lang;
use Redirect;
use Setting;
use DB;
use Sentry;
use Consumable;
use Str;
use Validator;
use View;
use User;
use Actionlog;
use Mail;
use Datatable;
use Slack;
use Config;
class ConsumablesController extends AdminController
{
/**
* Show a list of all the consumables.
*
* @return View
*/
public function getIndex()
{
return View::make('backend/consumables/index');
}
/**
* Consumable create.
*
* @return View
*/
public function getCreate()
{
// Show the page
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','consumable')->whereNull('deleted_at')->orderBy('name','ASC')->lists('name', 'id');
return View::make('backend/consumables/edit')->with('consumable',new Consumable)->with('category_list',$category_list);
}
/**
* Consumable create form processing.
*
* @return Redirect
*/
public function postCreate()
{
// create a new model instance
$consumable = new Consumable();
$validator = Validator::make(Input::all(), $consumable->rules);
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
else{
// Update the consumable data
$consumable->name = e(Input::get('name'));
$consumable->category_id = e(Input::get('category_id'));
$consumable->qty = e(Input::get('qty'));
$consumable->user_id = Sentry::getId();
// Was the consumable created?
if($consumable->save()) {
// Redirect to the new consumable page
return Redirect::to("admin/consumables")->with('success', Lang::get('admin/consumables/message.create.success'));
}
}
// Redirect to the consumable create page
return Redirect::to('admin/consumables/create')->with('error', Lang::get('admin/consumables/message.create.error'));
}
/**
* Consumable update.
*
* @param int $consumableId
* @return View
*/
public function getEdit($consumableId = null)
{
// Check if the consumable exists
if (is_null($consumable = Consumable::find($consumableId))) {
// Redirect to the blogs management page
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.does_not_exist'));
}
$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);
}
/**
* Consumable update form processing page.
*
* @param int $consumableId
* @return Redirect
*/
public function postEdit($consumableId = null)
{
// Check if the blog post exists
if (is_null($consumable = Consumable::find($consumableId))) {
// Redirect to the blogs management page
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.does_not_exist'));
}
// get the POST data
$new = Input::all();
// attempt validation
$validator = Validator::make(Input::all(), $consumable->validationRules($consumableId));
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
// attempt validation
else {
// Update the consumable data
$consumable->name = e(Input::get('name'));
$consumable->category_id = e(Input::get('category_id'));
$consumable->qty = e(Input::get('qty'));
// Was the consumable created?
if($consumable->save()) {
// Redirect to the new consumable page
return Redirect::to("admin/consumables")->with('success', Lang::get('admin/consumables/message.update.success'));
}
}
// Redirect to the consumable management page
return Redirect::to("admin/consumables/$consumableID/edit")->with('error', Lang::get('admin/consumables/message.update.error'));
}
/**
* Delete the given consumable.
*
* @param int $consumableId
* @return Redirect
*/
public function getDelete($consumableId)
{
// Check if the blog post exists
if (is_null($consumable = Consumable::find($consumableId))) {
// Redirect to the blogs management page
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.not_found'));
}
if ($consumable->hasUsers() > 0) {
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.assoc_users', array('count'=> $consumable->hasUsers())));
} else {
$consumable->delete();
// Redirect to the locations management page
return Redirect::to('admin/consumables')->with('success', Lang::get('admin/consumables/message.delete.success'));
}
}
/**
* Get the consumable information to present to the consumable view page
*
* @param int $consumableId
* @return View
**/
public function getView($consumableID = null)
{
$consumable = Consumable::find($consumableID);
if (isset($consumable->id)) {
return View::make('backend/consumables/view', compact('consumable'));
} else {
// Prepare the error message
$error = Lang::get('admin/consumables/message.does_not_exist', compact('id'));
// Redirect to the user management page
return Redirect::route('consumables')->with('error', $error);
}
}
/**
* Check out the consumable to a person
**/
public function getCheckout($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'));
}
// 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');
return View::make('backend/consumables/checkout', compact('consumable'))->with('users_list',$users_list);
}
/**
* Check out the consumable to a person
**/
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'));
}
$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'
);
// 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);
}
// 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'));
$consumable->users()->attach($consumable->id, array(
'consumable_id' => $consumable->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'));
$settings = Setting::getSettings();
if ($settings->slack_endpoint) {
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
'link_names' => true
];
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
try {
$client->attach([
'color' => 'good',
'fields' => [
[
'title' => 'Checked Out:',
'value' => strtoupper($logaction->asset_type).' <'.Config::get('app.url').'/admin/consumables/'.$consumable->id.'/view'.'|'.$consumable->name.'> checked out to <'.Config::get('app.url').'/admin/users/'.$user->id.'/view|'.$user->fullName().'> by <'.Config::get('app.url').'/admin/users/'.$admin_user->id.'/view'.'|'.$admin_user->fullName().'>.'
],
[
'title' => 'Note:',
'value' => e($logaction->note)
],
]
])->send('Consumable Checked Out');
} catch (Exception $e) {
}
}
$log = $logaction->logaction('checkout');
$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();
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');
});
}
// Redirect to the new consumable page
return Redirect::to("admin/consumables")->with('success', Lang::get('admin/consumables/message.checkout.success'));
}
public function getDatatable()
{
$consumables = Consumable::select(array('id','name','qty'))
->whereNull('deleted_at')
->orderBy('created_at', 'DESC');
$consumables = $consumables->get();
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions',function($consumables)
{
return '<a href="'.route('checkout/consumable', $consumables->id).'" style="margin-right:5px;" class="btn btn-info btn-sm" '.(($consumables->numRemaining() > 0 ) ? '' : ' disabled').'>'.Lang::get('general.checkout').'</a><a href="'.route('update/consumable', $consumables->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/consumable', $consumables->id).'" data-content="'.Lang::get('admin/consumables/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($consumables->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
});
return Datatable::collection($consumables)
->addColumn('name',function($consumables)
{
return link_to('admin/consumables/'.$consumables->id.'/view', $consumables->name);
})
->addColumn('qty',function($consumables)
{
return $consumables->qty;
})
->addColumn('numRemaining',function($consumables)
{
return $consumables->numRemaining();
})
->addColumn($actions)
->searchColumns('name','qty','numRemaining','actions')
->orderColumns('name','qty','numRemaining','actions')
->make();
}
public function getDataView($consumableID)
{
$consumable = Consumable::find($consumableID);
$consumable_users = $consumable->users;
return Datatable::collection($consumable_users)
->addColumn('name',function($consumable_users)
{
return link_to('/admin/users/'.$consumable_users->id.'/view', $consumable_users->fullName());
})
->make();
}
}
+18 -18
View File
@@ -15,56 +15,56 @@ class DashboardController extends AdminController
public function getIndex()
{
// Show the page
$recent_activity = Actionlog::orderBy('created_at','DESC')->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();
$asset_stats['rtd']['total'] = Asset::Hardware()->RTD()->count();
if ($asset_stats['rtd']['total'] > 0) {
$asset_stats['rtd']['percent'] = round(($asset_stats['rtd']['total']/$asset_stats['total']) * 100);
} else {
$asset_stats['rtd']['percent'] = 0;
}
$asset_stats['pending']['total'] = Asset::Hardware()->Pending()->count();
if ($asset_stats['pending']['total'] > 0) {
$asset_stats['pending']['percent'] = round(($asset_stats['pending']['total']/$asset_stats['total']) * 100);
} else {
$asset_stats['pending']['percent'] = 0;
}
$asset_stats['deployed']['total'] = Asset::Hardware()->Deployed()->count();
if ($asset_stats['deployed']['total'] > 0) {
$asset_stats['deployed']['percent'] = round(($asset_stats['deployed']['total']/$asset_stats['total']) * 100);
} else {
$asset_stats['deployed']['percent'] = 0;
}
$asset_stats['undeployable']['total'] = Asset::Hardware()->Undeployable()->count();
if ($asset_stats['undeployable']['total'] > 0) {
$asset_stats['undeployable']['percent'] = round(($asset_stats['undeployable']['total']/$asset_stats['total']) * 100);
} else {
$asset_stats['undeployable']['percent'] = 0;
}
$asset_stats['archived']['total'] = Asset::Hardware()->Archived()->count();
if ($asset_stats['archived']['total'] > 0) {
$asset_stats['archived']['percent'] = round(($asset_stats['archived']['total']/$asset_stats['total']) * 100);
} else {
$asset_stats['archived']['percent'] = 0;
}
return View::make('backend/dashboard')->with('asset_stats',$asset_stats)->with('recent_activity',$recent_activity);
}
+20 -14
View File
@@ -81,7 +81,7 @@ class GroupsController extends AdminController
// Was the group created?
if ($group = Sentry::getGroupProvider()->create($inputs)) {
// Redirect to the new group page
return Redirect::route('update/group', $group->id)->with('success', Lang::get('admin/groups/message.success.create'));
return Redirect::route('groups')->with('success', Lang::get('admin/groups/message.success.create'));
}
// Redirect to the new group page
@@ -161,21 +161,27 @@ class GroupsController extends AdminController
return Redirect::back()->withInput()->withErrors($validator);
}
try {
// Update the group data
$group->name = Input::get('name');
$group->permissions = Input::get('permissions');
if (!Config::get('app.lock_passwords')) {
// Was the group updated?
if ($group->save()) {
// Redirect to the group page
return Redirect::route('update/group', $id)->with('success', Lang::get('admin/groups/message.success.update'));
} else {
// Redirect to the group page
return Redirect::route('update/group', $id)->with('error', Lang::get('admin/groups/message.error.update'));
try {
// Update the group data
$group->name = Input::get('name');
$group->permissions = Input::get('permissions');
// Was the group updated?
if ($group->save()) {
// Redirect to the group page
return Redirect::route('update/group', $id)->with('success', Lang::get('admin/groups/message.success.update'));
} else {
// Redirect to the group page
return Redirect::route('update/group', $id)->with('error', Lang::get('admin/groups/message.error.update'));
}
} catch (NameRequiredException $e) {
$error = Lang::get('admin/group/message.group_name_required');
}
} catch (NameRequiredException $e) {
$error = Lang::get('admin/group/message.group_name_required');
} else {
return Redirect::route('update/group', $id)->withInput()->with('error', 'Denied! Editing groups is not allowed in the demo.');
}
// Redirect to the group page
+52 -33
View File
@@ -101,6 +101,12 @@ class LicensesController extends AdminController
$license->maintained = e(Input::get('maintained'));
}
if ( e(Input::get('reassignable')) == '') {
$license->reassignable = 0;
} else {
$license->reassignable = e(Input::get('reassignable'));
}
if ( e(Input::get('purchase_order')) == '') {
$license->purchase_order = '';
} else {
@@ -135,7 +141,7 @@ class LicensesController extends AdminController
// Was the license created?
if($license->save()) {
$insertedId = $license->id;
// Save the license seat data
for ($x=0; $x<$license->seats; $x++) {
@@ -408,7 +414,7 @@ class LicensesController extends AdminController
}
// 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) as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id');
$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');
// Left join to get a list of assets and some other helpful info
@@ -524,7 +530,7 @@ class LicensesController extends AdminController
$logaction->asset_id = $licenseseat->license_id;
$license = License::find($licenseseat->license_id);
$license = License::find($licenseseat->license_id);
$settings = Setting::getSettings();
@@ -533,23 +539,23 @@ class LicensesController extends AdminController
$logaction->checkedout_to = NULL;
$slack_msg = strtoupper($logaction->asset_type).' license <'.Config::get('app.url').'/admin/licenses/'.$license->id.'/view'.'|'.$license->name.'> checked out to <'.Config::get('app.url').'/hardware/'.$is_asset_id->id.'/view|'.$is_asset_id->showAssetName().'> by <'.Config::get('app.url').'/admin/users/'.$user->id.'/view'.'|'.$user->fullName().'>.';
} else {
$logaction->checkedout_to = e(Input::get('assigned_to'));
$logaction->checkedout_to = e(Input::get('assigned_to'));
$slack_msg = strtoupper($logaction->asset_type).' license <'.Config::get('app.url').'/admin/licenses/'.$license->id.'/view'.'|'.$license->name.'> checked out to <'.Config::get('app.url').'/admin/users/'.$is_assigned_to->id.'/view|'.$is_assigned_to->fullName().'> by <'.Config::get('app.url').'/admin/users/'.$user->id.'/view'.'|'.$user->fullName().'>.';
}
if ($settings->slack_endpoint) {
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
'link_names' => true
];
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
try {
$client->attach([
'color' => 'good',
@@ -563,13 +569,13 @@ class LicensesController extends AdminController
'value' => e($logaction->note)
],
]
])->send('License Checked Out');
} catch (Exception $e) {
}
}
@@ -612,7 +618,7 @@ 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'));
}
$license = License::find($licenseseat->license_id);
if(!$license->reassignable) {
@@ -620,7 +626,7 @@ class LicensesController extends AdminController
Session::flash('error', 'License not reassignable.');
return Redirect::back()->withInput();
}
// Declare the rules for the form validation
$rules = array(
'note' => 'alpha_space',
@@ -642,7 +648,7 @@ class LicensesController extends AdminController
// Update the asset data
$licenseseat->assigned_to = NULL;
$licenseseat->asset_id = NULL;
$user = Sentry::getUser();
// Was the asset updated?
@@ -652,20 +658,20 @@ class LicensesController extends AdminController
$logaction->asset_type = 'software';
$logaction->note = e(Input::get('note'));
$logaction->user_id = $user->id;
$settings = Setting::getSettings();
if ($settings->slack_endpoint) {
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
'link_names' => true
];
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
try {
$client->attach([
'color' => 'good',
@@ -678,20 +684,20 @@ class LicensesController extends AdminController
'title' => 'Note:',
'value' => e($logaction->note)
],
]
])->send('License Checked In');
} catch (Exception $e) {
}
}
$log = $logaction->logaction('checkin from');
if ($backto=='user') {
return Redirect::to("admin/users/".$return_to.'/view')->with('success', Lang::get('admin/licenses/message.checkin.success'));
@@ -805,7 +811,7 @@ class LicensesController extends AdminController
}
} else {
return Redirect::back()->with('success', Lang::get('admin/licenses/message.upload.nofiles'));
return Redirect::back()->with('error', Lang::get('admin/licenses/message.upload.nofiles'));
}
@@ -884,7 +890,7 @@ class LicensesController extends AdminController
$licenses = License::orderBy('created_at', 'DESC')->get();
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function($licenses) {
return '<a href="'.route('update/license', $licenses->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/license', $licenses->id).'" data-content="'.Lang::get('admin/licenses/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($licenses->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
return '<span style="white-space: nowrap;"><a href="'.route('freecheckout/license', $licenses->id).'" class="btn btn-primary btn-sm" style="margin-right:5px;" '.(($licenses->remaincount() > 0) ? '' : 'disabled').'>'.Lang::get('general.checkout').'</a> <a href="'.route('clone/license', $licenses->id).'" class="btn btn-info btn-sm" style="margin-right:5px;" title="Clone asset"><i class="fa fa-files-o"></i></a><a href="'.route('update/license', $licenses->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/license', $licenses->id).'" data-content="'.Lang::get('admin/licenses/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($licenses->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></span>';
});
return Datatable::collection($licenses)
@@ -903,9 +909,22 @@ class LicensesController extends AdminController
->addColumn('purchase_date', function($licenses) {
return $licenses->purchase_date;
})
->addColumn('notes', function($licenses) {
return $licenses->notes;
})
->addColumn($actions)
->searchColumns('name','serial','totalSeats','remaining','purchase_date','actions')
->orderColumns('name','serial','totalSeats','remaining','purchase_date','actions')
->searchColumns('name','serial','totalSeats','remaining','purchase_date','actions','notes')
->orderColumns('name','serial','totalSeats','remaining','purchase_date','actions','notes')
->make();
}
public function getFreeLicense($licenseId) {
// Check if the asset exists
if (is_null($license = License::find($licenseId))) {
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
$seatId = $license->freeSeat($licenseId);
return Redirect::to('admin/licenses/'.$seatId.'/checkout');
}
}
+87 -19
View File
@@ -12,6 +12,8 @@ use Str;
use Validator;
use View;
use Symfony\Component\HttpFoundation\JsonResponse;
class LocationsController extends AdminController
{
/**
@@ -23,7 +25,7 @@ class LocationsController extends AdminController
public function getIndex()
{
// Grab all the locations
$locations = Location::orderBy('created_at', 'DESC')->get();
$locations = Location::orderBy('created_at', 'DESC')->with('parent','assets','assignedassets')->get();
// Show the page
return View::make('backend/locations/index', compact('locations'));
@@ -37,9 +39,15 @@ class LocationsController extends AdminController
*/
public function getCreate()
{
// Show the page
$location_options = array('0' => 'Top Level') + Location::lists('name', 'id');
return View::make('backend/locations/edit')->with('location_options',$location_options)->with('location',new Location);
$locations = Location::orderBy('name','ASC')->get();
$location_options_array = Location::getLocationHierarchy($locations);
$location_options = Location::flattenLocationsArray($location_options_array);
$location_options = array('' => 'Top Level') + $location_options;
return View::make('backend/locations/edit')
->with('location_options',$location_options)
->with('location',new Location);
}
@@ -62,12 +70,18 @@ class LocationsController extends AdminController
// Save the location data
$location->name = e(Input::get('name'));
if (Input::get('parent_id')=='') {
$location->parent_id = null;
} else {
$location->parent_id = e(Input::get('parent_id'));
}
$location->currency = Input::get('currency','$');
$location->address = e(Input::get('address'));
$location->address2 = e(Input::get('address2'));
$location->city = e(Input::get('city'));
$location->state = e(Input::get('state'));
$location->country = e(Input::get('country'));
$location->zip = e(Input::get('zip'));
$location->zip = e(Input::get('zip'));
$location->user_id = Sentry::getId();
// Was the asset created?
@@ -86,6 +100,52 @@ class LocationsController extends AdminController
}
public function store()
{
$new = Input::all();
$new['currency']=Setting::first()->default_currency;
// create a new location instance
$location = new Location();
// attempt validation
if ($location->validate($new)) {
// Save the location data
$location->name = e(Input::get('name'));
// if (Input::get('parent_id')=='') {
// $location->parent_id = null;
// } else {
// $location->parent_id = e(Input::get('parent_id'));
// }
$location->currency = Setting::first()->default_currency; //e(Input::get('currency'));
$location->address = ''; //e(Input::get('address'));
// $location->address2 = e(Input::get('address2'));
$location->city = e(Input::get('city'));
$location->state = '';//e(Input::get('state'));
$location->country = e(Input::get('country'));
// $location->zip = e(Input::get('zip'));
$location->user_id = Sentry::getId();
// Was the asset created?
if($location->save()) {
// Redirect to the new location page
return JsonResponse::create($location);
//return Redirect::to("admin/settings/locations")->with('success', Lang::get('admin/locations/message.create.success'));
} else {
return JsonResponse::create(["error" => "Couldn't save Location"],500);
}
} else {
// failure
$errors = $location->errors();
return JsonResponse::create(["error" => "Failed validation: ".print_r($errors->all('<li>:message</li>'),true)],500);
}
// Redirect to the location create page
return Redirect::to('admin/settings/locations/create')->with('error', Lang::get('admin/locations/message.create.error'));
}
/**
* Location update.
@@ -97,14 +157,15 @@ class LocationsController extends AdminController
{
// Check if the location exists
if (is_null($location = Location::find($locationId))) {
// Redirect to the blogs management page
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.does_not_exist'));
}
// Show the page
//$location_options = array('' => 'Top Level') + Location::lists('name', 'id');
$locations = Location::orderBy('name','ASC')->get();
$location_options_array = Location::getLocationHierarchy($locations);
$location_options = Location::flattenLocationsArray($location_options_array);
$location_options = array('' => 'Top Level') + $location_options;
$location_options = array('' => 'Top Level') + DB::table('locations')->where('id', '!=', $locationId)->lists('name', 'id');
return View::make('backend/locations/edit', compact('location'))->with('location_options',$location_options);
}
@@ -128,27 +189,33 @@ class LocationsController extends AdminController
if ($validator->fails())
{
// The given data did not pass validation
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
// attempt validation
else {
// Update the location data
$location->name = e(Input::get('name'));
$location->name = e(Input::get('name'));
if (Input::get('parent_id')=='') {
$location->parent_id = null;
} else {
$location->parent_id = e(Input::get('parent_id',''));
}
$location->currency = Input::get('currency','$');
$location->address = e(Input::get('address'));
$location->address2 = e(Input::get('address2'));
$location->city = e(Input::get('city'));
$location->state = e(Input::get('state'));
$location->country = e(Input::get('country'));
$location->zip = e(Input::get('zip'));
$location->country = e(Input::get('country'));
$location->zip = e(Input::get('zip'));
// Was the asset created?
if($location->save()) {
// Redirect to the saved location page
return Redirect::to("admin/settings/locations/")->with('success', Lang::get('admin/locations/message.update.success'));
}
}
}
// Redirect to the location management page
return Redirect::to("admin/settings/locations/$locationId/edit")->with('error', Lang::get('admin/locations/message.update.error'));
@@ -170,15 +237,16 @@ class LocationsController extends AdminController
}
if ($location->has_users() > 0) {
// Redirect to the asset management page
if ($location->users->count() > 0) {
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.assoc_users'));
} elseif ($location->childLocations->count() > 0) {
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.assoc_child_loc'));
} elseif ($location->assets->count() > 0) {
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.assoc_assets'));
} elseif ($location->assignedassets->count() > 0) {
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.assoc_assets'));
} else {
$location->delete();
// Redirect to the locations management page
return Redirect::to('admin/settings/locations')->with('success', Lang::get('admin/locations/message.delete.success'));
}
+79 -20
View File
@@ -16,6 +16,9 @@ use Validator;
use View;
use Datatable;
//use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
class ModelsController extends AdminController
{
/**
@@ -37,9 +40,9 @@ class ModelsController extends AdminController
public function getCreate()
{
// Show the page
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
$manufacturer_list = array('' => 'Select One') + Manufacturer::lists('name', 'id');
$category_list = array('' => '') + DB::table('categories')->whereNull('deleted_at')->lists('name', 'id');
$depreciation_list = depreciationList();
$manufacturer_list = manufacturerList();
$category_list = categoryList();
$view = View::make('backend/models/edit');
$view->with('category_list',$category_list);
$view->with('depreciation_list',$depreciation_list);
@@ -57,14 +60,40 @@ class ModelsController extends AdminController
public function postCreate()
{
// get the POST data
$new = Input::all();
// Create a new manufacturer
$model = new Model;
$validator = Validator::make(
// Validator data goes here
array(
'unique_fields' => array(Input::get('name'), Input::get('modelno'), Input::get('manufacturer_id'))
),
// Validator rules go here
array(
'unique_fields' => 'unique_multiple:models,name,modelno,manufacturer_id'
)
);
// attempt validation
if ($model->validate($new)) {
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->with('error', Lang::get('admin/models/message.create.duplicate_set'));;
}
$validator = Validator::make(Input::all(), $model->validationRules());
// attempt validation
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
// attempt validation
else {
if ( e(Input::get('depreciation_id')) == '') {
$model->depreciation_id = 0;
@@ -72,7 +101,7 @@ class ModelsController extends AdminController
$model->depreciation_id = e(Input::get('depreciation_id'));
}
if ( e(Input::get('eol')) == '') {
if ( e(Input::get('eol')) == '') {
$model->eol = 0;
} else {
$model->eol = e(Input::get('eol'));
@@ -103,10 +132,6 @@ class ModelsController extends AdminController
// Redirect to the new model page
return Redirect::to("hardware/models")->with('success', Lang::get('admin/models/message.create.success'));
}
} else {
// failure
$errors = $model->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Redirect to the model create page
@@ -114,6 +139,36 @@ class ModelsController extends AdminController
}
public function store()
{
//COPYPASTA!!!! FIXME
$model = new Model;
$settings=Input::all();
$settings['eol']=0;
//
$validator = Validator::make($settings, $model->validationRules());
if ($validator->fails())
{
// The given data did not pass validation
return JsonResponse::create(["error" => "Failed validation: ".print_r($validator->messages()->all('<li>:message</li>'),true)],500);
} else {
$model->name=e(Input::get('name'));
$model->manufacturer_id = e(Input::get('manufacturer_id'));
$model->category_id = e(Input::get('category_id'));
$model->modelno = e(Input::get('modelno'));
$model->user_id = Sentry::getUser()->id;
$model->eol=0;
if($model->save()) {
return JsonResponse::create($model);
} else {
return JsonResponse::create(["error" => "Couldn't save Model"],500);
}
}
}
/**
* Model update.
*
@@ -130,7 +185,7 @@ class ModelsController extends AdminController
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
$manufacturer_list = array('' => 'Select One') + Manufacturer::lists('name', 'id');
$category_list = array('' => '') + DB::table('categories')->lists('name', 'id');
$category_list = array('' => '') + DB::table('categories')->whereNull('deleted_at')->lists('name', 'id');
$view = View::make('backend/models/edit', compact('model'));
$view->with('category_list',$category_list);
$view->with('depreciation_list',$depreciation_list);
@@ -236,7 +291,7 @@ class ModelsController extends AdminController
return Redirect::to('hardware/models')->with('success', Lang::get('admin/models/message.delete.success'));
}
}
public function getRestore($modelId = null)
{
@@ -308,7 +363,7 @@ class ModelsController extends AdminController
return $view;
}
public function getDatatable($status = null)
{
$models = Model::orderBy('created_at', 'DESC')->with('category','assets','depreciation');
@@ -324,6 +379,9 @@ class ModelsController extends AdminController
});
return Datatable::collection($models)
->addColumn('manufacturer', function($models) {
return $models->manufacturer->name;
})
->addColumn('name', function ($models) {
return link_to('/hardware/models/'.$models->id.'/view', $models->name);
})
@@ -345,15 +403,15 @@ class ModelsController extends AdminController
->orderColumns('name','modelno','asset_count','depreciation','category','eol','actions')
->make();
}
public function getDataView($modelID)
{
$model = Model::withTrashed()->find($modelID);
$modelassets = $model->assets;
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($modelassets)
{
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($modelassets)
{
if (($modelassets->assigned_to !='') && ($modelassets->assigned_to > 0)) {
return '<a href="'.route('checkin/hardware', $modelassets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
} else {
@@ -363,7 +421,8 @@ class ModelsController extends AdminController
return Datatable::collection($modelassets)
->addColumn('name', function ($modelassets) {
return link_to('/hardware/'.$modelassets->id.'/view', $modelassets->name);
return link_to('/hardware/'.$modelassets->id.'/view', $modelassets->showAssetName());
// return $modelassets->name;
})
->addColumn('asset_tag', function ($modelassets) {
return link_to('/hardware/'.$modelassets->id.'/view', $modelassets->asset_tag);
+489 -191
View File
@@ -1,19 +1,76 @@
<?php namespace Controllers\Admin;
use AdminController;
use Input;
use Lang;
use License;
use Asset;
use User;
use View;
use Location;
use Redirect;
use Response;
use Accessory;
use Actionlog;
use AdminController;
use Asset;
use AssetMaintenance;
use Carbon\Carbon;
use Category;
use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\View;
use Input;
use League\Csv\Reader;
use License;
use Location;
use Model;
use Redirect;
use Setting;
use User;
class ReportsController extends AdminController
{
/**
* Show Report for Accessories
*
* @return View
*/
public function getAccessoryReport()
{
$accessories = Accessory::orderBy('created_at', 'DESC')->get();
return View::make('backend/reports/accessories', compact('accessories'));
}
/**
* Export Accessories Report as CSV
*
* @return file download
*/
public function exportAccessoryReport()
{
$accessories = Accessory::orderBy('created_at', 'DESC')->get();
$rows = array();
$header = array(
Lang::get('admin/accessories/table.title'),
Lang::get('admin/accessories/general.accessory_category'),
Lang::get('admin/accessories/general.total'),
Lang::get('admin/accessories/general.remaining')
);
$header = array_map('trim', $header);
$rows[] = implode($header, ', ');
// Row per accessory
foreach ($accessories as $accessory) {
$row = array();
$row[] = $accessory->accessory_name;
$row[] = $accessory->accessory_category;
$row[] = $accessory->total;
$row[] = $accessory->remaining;
$rows[] = implode($row, ',');
}
$csv = implode($rows, "\n");
$response = Response::make($csv, 200);
$response->header('Content-Type', 'text/csv');
$response->header('Content-disposition', 'attachment;filename=report.csv');
return $response;
}
/**
* Show Asset Report
*
@@ -21,9 +78,14 @@ class ReportsController extends AdminController
*/
public function getAssetsReport()
{
// Grab all the assets
$assets = Asset::with('model','assigneduser.userLoc','assetstatus','defaultLoc','assetlog','supplier','model.manufacturer')->orderBy('created_at', 'DESC')->get();
return View::make('backend/reports/asset', compact('assets'));
$assets = Asset::with( 'model', 'assigneduser.userLoc', 'assetstatus', 'defaultLoc', 'assetlog', 'supplier',
'model.manufacturer' )
->orderBy( 'created_at', 'DESC' )
->get();
return View::make( 'backend/reports/asset', compact( 'assets' ) );
}
/**
@@ -33,41 +95,44 @@ class ReportsController extends AdminController
*/
public function exportAssetReport()
{
// Grab all the assets
$assets = Asset::orderBy('created_at', 'DESC')->get();
$rows = array();
// Grab all the assets
$assets = Asset::orderBy( 'created_at', 'DESC' )
->get();
$rows = [ ];
// Create the header row
$header = array(
Lang::get('admin/hardware/table.asset_tag'),
Lang::get('admin/hardware/form.manufacturer'),
Lang::get('admin/hardware/form.model'),
Lang::get('general.model_no'),
Lang::get('general.name'),
Lang::get('admin/hardware/table.serial'),
Lang::get('general.status'),
Lang::get('admin/hardware/table.purchase_date'),
Lang::get('admin/hardware/table.purchase_cost'),
Lang::get('admin/hardware/form.order'),
Lang::get('admin/hardware/form.supplier'),
Lang::get('admin/hardware/table.checkoutto'),
Lang::get('admin/hardware/table.location')
);
$header = array_map('trim', $header);
$rows[] = implode($header, ',');
$header = [
Lang::get( 'admin/hardware/table.asset_tag' ),
Lang::get( 'admin/hardware/form.manufacturer' ),
Lang::get( 'admin/hardware/form.model' ),
Lang::get( 'general.model_no' ),
Lang::get( 'general.name' ),
Lang::get( 'admin/hardware/table.serial' ),
Lang::get( 'general.status' ),
Lang::get( 'admin/hardware/table.purchase_date' ),
Lang::get( 'admin/hardware/table.purchase_cost' ),
Lang::get( 'admin/hardware/form.order' ),
Lang::get( 'admin/hardware/form.supplier' ),
Lang::get( 'admin/hardware/table.checkoutto' ),
Lang::get( 'admin/hardware/table.location' ),
Lang::get( 'general.notes' ),
];
$header = array_map( 'trim', $header );
$rows[] = implode( $header, ',' );
// Create a row per asset
foreach ($assets as $asset) {
$row = array();
$row = [ ];
$row[] = $asset->asset_tag;
if ($asset->model->manufacturer) {
$row[] = $asset->model->manufacturer->name;
} else {
$row[] = '';
}
$row[] = '"'.$asset->model->name.'"';
$row[] = '"'.$asset->model->modelno.'"';
$row[] = '"' . $asset->model->name . '"';
$row[] = '"' . $asset->model->modelno . '"';
$row[] = $asset->name;
$row[] = $asset->serial;
if ($asset->assetstatus) {
@@ -76,7 +141,7 @@ class ReportsController extends AdminController
$row[] = '';
}
$row[] = $asset->purchase_date;
$row[] = '"'.number_format($asset->purchase_cost).'"';
$row[] = '"' . number_format( $asset->purchase_cost ) . '"';
if ($asset->order_number) {
$row[] = $asset->order_number;
} else {
@@ -89,21 +154,21 @@ class ReportsController extends AdminController
}
if ($asset->assigned_to > 0) {
$user = User::find($asset->assigned_to);
$user = User::find( $asset->assigned_to );
$row[] = $user->fullName();
} else {
$row[] = ''; // Empty string if unassigned
}
if (($asset->assigned_to > 0) && ($asset->assigneduser->location_id > 0)) {
$location = Location::find($asset->assigneduser->location_id);
if (( $asset->assigned_to > 0 ) && ( $asset->assigneduser->location_id > 0 )) {
$location = Location::find( $asset->assigneduser->location_id );
if ($location->name) {
$row[] = $location->name;
} else {
$row[] = '';
}
} elseif ($asset->rtd_location_id) {
$location = Location::find($asset->rtd_location_id);
$location = Location::find( $asset->rtd_location_id );
if ($location->name) {
$row[] = $location->name;
} else {
@@ -113,14 +178,20 @@ class ReportsController extends AdminController
$row[] = ''; // Empty string if location is not set
}
$rows[] = implode($row, ',');
if ($asset->notes) {
$row[] = '"' . $asset->notes . '"';
} else {
$row[] = '';
}
$rows[] = implode( $row, ',' );
}
// spit out a csv
$csv = implode($rows, "\n");
$response = Response::make($csv, 200);
$response->header('Content-Type', 'text/csv');
$response->header('Content-disposition', 'attachment;filename=report.csv');
$csv = implode( $rows, "\n" );
$response = Response::make( $csv, 200 );
$response->header( 'Content-Type', 'text/csv' );
$response->header( 'Content-disposition', 'attachment;filename=report.csv' );
return $response;
}
@@ -132,9 +203,13 @@ class ReportsController extends AdminController
*/
public function getDeprecationReport()
{
// Grab all the assets
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')->orderBy('created_at', 'DESC')->get();
return View::make('backend/reports/depreciation', compact('assets'));
$assets = Asset::with( 'model', 'assigneduser', 'assetstatus', 'defaultLoc', 'assetlog' )
->orderBy( 'created_at', 'DESC' )
->get();
return View::make( 'backend/reports/depreciation', compact( 'assets' ) );
}
/**
@@ -144,45 +219,51 @@ class ReportsController extends AdminController
*/
public function exportDeprecationReport()
{
// Grab all the assets
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')->orderBy('created_at', 'DESC')->get();
$rows = array();
// Grab all the assets
$assets = Asset::with( 'model', 'assigneduser', 'assetstatus', 'defaultLoc', 'assetlog' )
->orderBy( 'created_at', 'DESC' )
->get();
$csv = \League\Csv\Writer::createFromFileObject( new \SplTempFileObject() );
$csv->setOutputBOM( Reader::BOM_UTF16_BE );
$rows = [ ];
// Create the header row
$header = array(
Lang::get('admin/hardware/table.asset_tag'),
Lang::get('admin/hardware/table.title'),
Lang::get('admin/hardware/table.serial'),
Lang::get('admin/hardware/table.checkoutto'),
Lang::get('admin/hardware/table.location'),
Lang::get('admin/hardware/table.purchase_date'),
Lang::get('admin/hardware/table.purchase_cost'),
Lang::get('admin/hardware/table.book_value'),
Lang::get('admin/hardware/table.diff')
);
$header = array_map('trim', $header);
$rows[] = implode($header, ',');
$header = [
Lang::get( 'admin/hardware/table.asset_tag' ),
Lang::get( 'admin/hardware/table.title' ),
Lang::get( 'admin/hardware/table.serial' ),
Lang::get( 'admin/hardware/table.checkoutto' ),
Lang::get( 'admin/hardware/table.location' ),
Lang::get( 'admin/hardware/table.purchase_date' ),
Lang::get( 'admin/hardware/table.purchase_cost' ),
Lang::get( 'admin/hardware/table.book_value' ),
Lang::get( 'admin/hardware/table.diff' )
];
//we insert the CSV header
$csv->insertOne( $header );
// Create a row per asset
foreach ($assets as $asset) {
$row = array();
$row = [ ];
$row[] = $asset->asset_tag;
$row[] = $asset->name;
$row[] = $asset->serial;
if ($asset->assigned_to > 0) {
$user = User::find($asset->assigned_to);
$row[] = $user->fullName();
} else {
$user = User::find( $asset->assigned_to );
$row[] = $user->fullName();
} else {
$row[] = ''; // Empty string if unassigned
}
if (($asset->assigned_to > 0) && ($asset->assigneduser->location_id > 0)) {
$location = Location::find($asset->assigneduser->location_id);
if (( $asset->assigned_to > 0 ) && ( $asset->assigneduser->location_id > 0 )) {
$location = Location::find( $asset->assigneduser->location_id );
if ($location->city) {
$row[] = '"'.$location->city . ', ' . $location->state.'"';
$row[] = $location->city . ', ' . $location->state;
} elseif ($location->name) {
$row[] = $location->name;
} else {
@@ -192,47 +273,45 @@ class ReportsController extends AdminController
$row[] = ''; // Empty string if location is not set
}
if ($asset->assetloc) {
$currency = $asset->assetloc->currency;
} else {
$currency = Setting::first()->default_currency;
}
$row[] = $asset->purchase_date;
$row[] = '"'.Lang::get('general.currency').number_format($asset->purchase_cost).'"';
$row[] = '"'.Lang::get('general.currency').number_format($asset->getDepreciatedValue()).'"';
$row[] = '"-'.Lang::get('general.currency').number_format(($asset->purchase_cost - $asset->getDepreciatedValue())).'"';
$rows[] = implode($row, ',');
$row[] = $currency . number_format( $asset->purchase_cost );
$row[] = $currency . number_format( $asset->getDepreciatedValue() );
$row[] = $currency . number_format( ( $asset->purchase_cost - $asset->getDepreciatedValue() ) );
$csv->insertOne( $row );
}
// spit out a csv
$csv = implode($rows, "\n");
$csv->output( 'depreciation-report-' . date( 'Y-m-d' ) . '.csv' );
die;
$response = Response::make($csv, 200);
$response->header('Content-Type', 'text/csv');
$response->header('Content-disposition', 'attachment;filename=report.csv');
return $response;
}
/**
/**
* Show Report for Activity
*
* @return View
*/
public function getActivityReport()
public function getActivityReport()
{
$log_actions = Actionlog::orderBy('created_at', 'DESC')
->with('adminlog')
->with('accessorylog')
->with('assetlog')
->with('licenselog')
->with('userlog')
->orderBy('created_at','DESC')
->get();
return View::make('backend/reports/activity', compact('log_actions'));
$log_actions = Actionlog::orderBy( 'created_at', 'DESC' )
->with( 'adminlog' )
->with( 'accessorylog' )
->with( 'assetlog' )
->with( 'licenselog' )
->with( 'userlog' )
->orderBy( 'created_at', 'DESC' )
->get();
return View::make( 'backend/reports/activity', compact( 'log_actions' ) );
}
/**
* Show Report for Licenses
*
@@ -240,8 +319,11 @@ class ReportsController extends AdminController
*/
public function getLicenseReport()
{
$licenses = License::orderBy('created_at', 'DESC')->get();
return View::make('backend/reports/licenses', compact('licenses'));
$licenses = License::orderBy( 'created_at', 'DESC' )
->get();
return View::make( 'backend/reports/licenses', compact( 'licenses' ) );
}
/**
@@ -251,170 +333,161 @@ class ReportsController extends AdminController
*/
public function exportLicenseReport()
{
$licenses = License::orderBy('created_at', 'DESC')->get();
$rows = array();
$header = array(
Lang::get('admin/licenses/table.title'),
Lang::get('admin/licenses/table.serial'),
Lang::get('admin/licenses/form.seats'),
Lang::get('admin/licenses/form.remaining_seats'),
Lang::get('admin/licenses/form.expiration'),
Lang::get('admin/licenses/form.date'),
Lang::get('admin/licenses/form.cost')
);
$header = array_map('trim', $header);
$rows[] = implode($header, ', ');
$licenses = License::orderBy( 'created_at', 'DESC' )
->get();
$rows = [ ];
$header = [
Lang::get( 'admin/licenses/table.title' ),
Lang::get( 'admin/licenses/table.serial' ),
Lang::get( 'admin/licenses/form.seats' ),
Lang::get( 'admin/licenses/form.remaining_seats' ),
Lang::get( 'admin/licenses/form.expiration' ),
Lang::get( 'admin/licenses/form.date' ),
Lang::get( 'admin/licenses/form.cost' )
];
$header = array_map( 'trim', $header );
$rows[] = implode( $header, ', ' );
// Row per license
foreach ($licenses as $license) {
$row = array();
$row = [ ];
$row[] = $license->name;
$row[] = $license->serial;
$row[] = $license->seats;
$row[] = $license->remaincount();
$row[] = $license->expiration_date;
$row[] = $license->purchase_date;
$row[] = '"'.number_format($license->purchase_cost).'"';
$row[] = '"' . number_format( $license->purchase_cost ) . '"';
$rows[] = implode($row, ',');
$rows[] = implode( $row, ',' );
}
$csv = implode($rows, "\n");
$response = Response::make($csv, 200);
$response->header('Content-Type', 'text/csv');
$response->header('Content-disposition', 'attachment;filename=report.csv');
$csv = implode( $rows, "\n" );
$response = Response::make( $csv, 200 );
$response->header( 'Content-Type', 'text/csv' );
$response->header( 'Content-disposition', 'attachment;filename=report.csv' );
return $response;
}
public function getCustomReport()
{
return View::make('backend/reports/custom');
return View::make( 'backend/reports/custom' );
}
public function postCustom()
{
$assets = Asset::orderBy('created_at', 'DESC')->get();
$rows = array();
$header = array();
if (e(Input::get('asset_name')) == '1')
{
$assets = Asset::orderBy( 'created_at', 'DESC' )
->get();
$rows = [ ];
$header = [ ];
if (e( Input::get( 'asset_name' ) ) == '1') {
$header[] = 'Asset Name';
}
if (e(Input::get('asset_tag')) == '1')
{
if (e( Input::get( 'asset_tag' ) ) == '1') {
$header[] = 'Asset Tag';
}
if (e(Input::get('manufacturer')) == '1')
{
if (e( Input::get( 'manufacturer' ) ) == '1') {
$header[] = 'Manufacturer';
}
if (e(Input::get('model')) == '1')
{
if (e( Input::get( 'model' ) ) == '1') {
$header[] = 'Model';
$header[] = 'Model Number';
}
if (e(Input::get('serial')) == '1')
{
if (e( Input::get( 'serial' ) ) == '1') {
$header[] = 'Serial';
}
if (e(Input::get('purchase_date')) == '1')
{
if (e( Input::get( 'purchase_date' ) ) == '1') {
$header[] = 'Purchase Date';
}
if ((e(Input::get('purchase_cost')) == '1') && (e(Input::get('depreciation')) == '0'))
{
if (( e( Input::get( 'purchase_cost' ) ) == '1' ) && ( e( Input::get( 'depreciation' ) ) == '0' )) {
$header[] = 'Purchase Cost';
}
if (e(Input::get('order')) == '1')
{
if (e( Input::get( 'order' ) ) == '1') {
$header[] = 'Order Number';
}
if (e(Input::get('supplier')) == '1')
{
if (e( Input::get( 'supplier' ) ) == '1') {
$header[] = 'Supplier';
}
if (e(Input::get('location')) == '1')
{
if (e( Input::get( 'location' ) ) == '1') {
$header[] = 'Location';
}
if (e(Input::get('assigned_to')) == '1')
{
if (e( Input::get( 'assigned_to' ) ) == '1') {
$header[] = 'Assigned To';
}
if (e(Input::get('status')) == '1')
{
if (e( Input::get( 'status' ) ) == '1') {
$header[] = 'Status';
}
if (e(Input::get('warranty')) == '1')
{
if (e( Input::get( 'warranty' ) ) == '1') {
$header[] = 'Warranty';
$header[] = 'Warranty Expires';
}
if (e(Input::get('depreciation')) == '1')
{
if (e( Input::get( 'depreciation' ) ) == '1') {
$header[] = 'Purchase Cost';
$header[] = 'Value';
$header[] = 'Diff';
}
$header = array_map('trim', $header);
$rows[] = implode($header, ',');
$header = array_map( 'trim', $header );
$rows[] = implode( $header, ',' );
foreach($assets as $asset) {
$row = array();
if (e(Input::get('asset_name')) == '1') {
foreach ($assets as $asset) {
$row = [ ];
if (e( Input::get( 'asset_name' ) ) == '1') {
$row[] = $asset->name;
}
if (e(Input::get('asset_tag')) == '1') {
if (e( Input::get( 'asset_tag' ) ) == '1') {
$row[] = $asset->asset_tag;
}
if (e(Input::get('manufacturer')) == '1') {
if (e( Input::get( 'manufacturer' ) ) == '1') {
if ($asset->model->manufacturer) {
$row[] = $asset->model->manufacturer->name;
} else {
$row[] = '';
}
}
if (e(Input::get('model')) == '1') {
$row[] = '"'.$asset->model->name.'"';
$row[] = '"'.$asset->model->modelno.'"';
if (e( Input::get( 'model' ) ) == '1') {
$row[] = '"' . $asset->model->name . '"';
$row[] = '"' . $asset->model->modelno . '"';
}
if (e(Input::get('serial')) == '1') {
if (e( Input::get( 'serial' ) ) == '1') {
$row[] = $asset->serial;
}
if (e(Input::get('purchase_date')) == '1') {
if (e( Input::get( 'purchase_date' ) ) == '1') {
$row[] = $asset->purchase_date;
}
if (e(Input::get('purchase_cost')) == '1') {
$row[] = '"'.number_format($asset->purchase_cost).'"';
if (e( Input::get( 'purchase_cost' ) ) == '1') {
$row[] = '"' . number_format( $asset->purchase_cost ) . '"';
}
if (e(Input::get('order')) == '1') {
if (e( Input::get( 'order' ) ) == '1') {
if ($asset->order_number) {
$row[] = $asset->order_number;
} else {
$row[] = '';
}
}
if (e(Input::get('supplier')) == '1') {
if (e( Input::get( 'supplier' ) ) == '1') {
if ($asset->supplier_id) {
$row[] = $asset->supplier->name;
} else {
$row[] = '';
}
}
if (e(Input::get('location')) == '1') {
if (($asset->assigned_to > 0) && ($asset->assigneduser->location_id > 0)) {
$location = Location::find($asset->assigneduser->location_id);
if (e( Input::get( 'location' ) ) == '1') {
if (( $asset->assigned_to > 0 ) && ( $asset->assigneduser->location_id > 0 )) {
$location = Location::find( $asset->assigneduser->location_id );
if ($location->name) {
$row[] = $location->name;
} else {
$row[] = '';
}
} elseif ($asset->rtd_location_id) {
$location = Location::find($asset->rtd_location_id);
$location = Location::find( $asset->rtd_location_id );
if ($location->name) {
$row[] = $location->name;
} else {
@@ -424,26 +497,26 @@ class ReportsController extends AdminController
$row[] = ''; // Empty string if location is not set
}
}
if (e(Input::get('assigned_to')) == '1') {
if (e( Input::get( 'assigned_to' ) ) == '1') {
if ($asset->assigned_to > 0) {
$user = User::find($asset->assigned_to);
$user = User::find( $asset->assigned_to );
$row[] = $user->fullName();
} else {
$row[] = ''; // Empty string if unassigned
}
}
if (e(Input::get('status')) == '1') {
if (($asset->status_id == '0') && ($asset->assigned_to == '0')) {
$row[] = Lang::get('general.ready_to_deploy');
} elseif (($asset->status_id == '') && ($asset->assigned_to == '0')) {
$row[] = Lang::get('general.pending');
if (e( Input::get( 'status' ) ) == '1') {
if (( $asset->status_id == '0' ) && ( $asset->assigned_to == '0' )) {
$row[] = Lang::get( 'general.ready_to_deploy' );
} elseif (( $asset->status_id == '' ) && ( $asset->assigned_to == '0' )) {
$row[] = Lang::get( 'general.pending' );
} elseif ($asset->assetstatus) {
$row[] = $asset->assetstatus->name;
} else {
$row[] = '';
}
}
if (e(Input::get('warranty')) == '1') {
if (e( Input::get( 'warranty' ) ) == '1') {
if ($asset->warranty_months) {
$row[] = $asset->warranty_months;
$row[] = $asset->warrantee_expires();
@@ -452,24 +525,249 @@ class ReportsController extends AdminController
$row[] = '';
}
}
if (e(Input::get('depreciation')) == '1') {
if (e( Input::get( 'depreciation' ) ) == '1') {
$depreciation = $asset->getDepreciatedValue();
$row[] = '"'.number_format($asset->purchase_cost).'"';
$row[] = '"'.number_format($depreciation).'"';
$row[] = '"'.number_format($asset->purchase_cost - $depreciation).'"';
$row[] = '"' . number_format( $asset->purchase_cost ) . '"';
$row[] = '"' . number_format( $depreciation ) . '"';
$row[] = '"' . number_format( $asset->purchase_cost - $depreciation ) . '"';
}
$rows[] = implode($row, ',');
$rows[] = implode( $row, ',' );
}
// spit out a csv
if (array_filter($rows)) {
$csv = implode($rows, "\n");
$response = Response::make($csv, 200);
$response->header('Content-Type', 'text/csv');
$response->header('Content-disposition', 'attachment;filename=report.csv');
if (array_filter( $rows )) {
$csv = implode( $rows, "\n" );
$response = Response::make( $csv, 200 );
$response->header( 'Content-Type', 'text/csv' );
$response->header( 'Content-disposition', 'attachment;filename=report.csv' );
return $response;
} else {
return Redirect::to("reports/custom")->with('error', Lang::get('admin/reports/message.error'));
return Redirect::to( "reports/custom" )
->with( 'error', Lang::get( 'admin/reports/message.error' ) );
}
}
/**
* getImprovementsReport
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function getAssetMaintenancesReport()
{
// Grab all the improvements
$assetMaintenances = \AssetMaintenance::with( 'asset', 'supplier' )
->orderBy( 'created_at', 'DESC' )
->get();
return View::make( 'backend/reports/asset_maintenances', compact( 'assetMaintenances' ) );
}
/**
* exportImprovementsReport
*
* @return \Illuminate\Http\Response
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function exportAssetMaintenancesReport()
{
// Grab all the improvements
$assetMaintenances = AssetMaintenance::with( 'asset', 'supplier' )
->orderBy( 'created_at', 'DESC' )
->get();
$rows = [ ];
$header = [
Lang::get( 'admin/asset_maintenances/table.asset_name' ),
Lang::get( 'admin/asset_maintenances/table.supplier_name' ),
Lang::get( 'admin/asset_maintenances/form.asset_maintenance_type' ),
Lang::get( 'admin/asset_maintenances/form.title' ),
Lang::get( 'admin/asset_maintenances/form.start_date' ),
Lang::get( 'admin/asset_maintenances/form.completion_date' ),
Lang::get( 'admin/asset_maintenances/form.asset_maintenance_time' ),
Lang::get( 'admin/asset_maintenances/form.cost' )
];
$header = array_map( 'trim', $header );
$rows[] = implode( $header, ',' );
foreach ($assetMaintenances as $assetMaintenance) {
$row = [ ];
$row[] = str_replace( ',', '', $assetMaintenance->asset->name );
$row[] = str_replace( ',', '', $assetMaintenance->supplier->name );
$row[] = $assetMaintenance->improvement_type;
$row[] = $assetMaintenance->title;
$row[] = $assetMaintenance->start_date;
$row[] = $assetMaintenance->completion_date;
if (is_null( $assetMaintenance->asset_maintenance_time )) {
$improvementTime = intval( Carbon::now()
->diffInDays( Carbon::parse( $assetMaintenance->start_date ) ) );
} else {
$improvementTime = intval( $assetMaintenance->asset_maintenance_time );
}
$row[] = $improvementTime;
$row[] = Lang::get( 'general.currency' ) . number_format( $assetMaintenance->cost, 2 );
$rows[] = implode( $row, ',' );
}
// spit out a csv
$csv = implode( $rows, "\n" );
$response = Response::make( $csv, 200 );
$response->header( 'Content-Type', 'text/csv' );
$response->header( 'Content-disposition', 'attachment;filename=report.csv' );
return $response;
}
/**
* getAssetAcceptanceReport
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function getAssetAcceptanceReport()
{
$assetsForReport = Asset::notYetAccepted()
->get();
return View::make( 'backend/reports/unaccepted_assets', compact( 'assetsForReport' ) );
}
/**
* exportAssetAcceptanceReport
*
* @return \Illuminate\Http\Response
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function exportAssetAcceptanceReport()
{
// Grab all the improvements
$assetsForReport = Actionlog::whereIn( 'id', $this->getAssetsNotAcceptedYet() )
->get();
$rows = [ ];
$header = [
Lang::get( 'general.category' ),
Lang::get( 'admin/hardware/form.model' ),
Lang::get( 'admin/hardware/form.name' ),
Lang::get( 'admin/hardware/table.asset_tag' ),
Lang::get( 'admin/hardware/table.checkoutto' ),
];
$header = array_map( 'trim', $header );
$rows[] = implode( $header, ',' );
foreach ($assetsForReport as $assetItem) {
$row = [ ];
$row[] = str_replace( ',', '', $assetItem->assetlog->model->category->name );
$row[] = str_replace( ',', '', $assetItem->assetlog->model->name );
$row[] = str_replace( ',', '', $assetItem->assetlog->showAssetName() );
$row[] = str_replace( ',', '', $assetItem->assetlog->asset_tag );
$row[] = str_replace( ',', '', $assetItem->assetlog->assigneduser->fullName() );
$rows[] = implode( $row, ',' );
}
// spit out a csv
$csv = implode( $rows, "\n" );
$response = Response::make( $csv, 200 );
$response->header( 'Content-Type', 'text/csv' );
$response->header( 'Content-disposition', 'attachment;filename=report.csv' );
return $response;
}
/**
* getCheckedOutAssetsRequiringAcceptance
*
* @param $modelsInCategoriesThatRequireAcceptance
*
* @return array
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function getCheckedOutAssetsRequiringAcceptance( $modelsInCategoriesThatRequireAcceptance )
{
return array_pluck( Asset::deployed()
->inModelList( $modelsInCategoriesThatRequireAcceptance )
->select( 'id' )
->get()
->toArray(), 'id' );
}
/**
* getModelsInCategoriesThatRequireAcceptance
*
* @param $assetCategoriesRequiringAcceptance
*
* @return array
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function getModelsInCategoriesThatRequireAcceptance( $assetCategoriesRequiringAcceptance )
{
return array_pluck( Model::inCategory( $assetCategoriesRequiringAcceptance )
->select( 'id' )
->get()
->toArray(), 'id' );
}
/**
* getCategoriesThatRequireAcceptance
*
* @return array
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function getCategoriesThatRequireAcceptance()
{
return array_pluck( Category::requiresAcceptance()
->select( 'id' )
->get()
->toArray(), 'id' );
}
/**
* getAssetsCheckedOutRequiringAcceptance
*
* @return array
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function getAssetsCheckedOutRequiringAcceptance()
{
return $this->getCheckedOutAssetsRequiringAcceptance(
$this->getModelsInCategoriesThatRequireAcceptance( $this->getCategoriesThatRequireAcceptance() )
);
}
/**
* getAssetsNotAcceptedYet
*
* @return array
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function getAssetsNotAcceptedYet()
{
return Asset::unaccepted();
}
}
+69 -7
View File
@@ -12,6 +12,7 @@ use Validator;
use View;
use Image;
use Config;
use Response;
class SettingsController extends AdminController
{
@@ -64,22 +65,23 @@ class SettingsController extends AdminController
// Declare the rules for the form validation
$rules = array(
"per_page" => 'required|min:1|numeric',
"qr_text" => 'min:1|max:31',
"logo" => 'mimes:jpeg,bmp,png,gif',
"alert_email" => 'email',
"slack_endpoint" => 'url',
"default_currency" => 'required',
"slack_channel" => 'regex:/(?<!\w)#\w+/',
"slack_botname" => 'alpha_dash',
);
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);
@@ -93,6 +95,7 @@ class SettingsController extends AdminController
if (Input::get('clear_logo')=='1') {
$setting->logo = NULL;
} elseif (Input::file('logo')) {
if (!Config::get('app.lock_passwords')) {
$image = Input::file('logo');
$file_name = "logo.".$image->getClientOriginalExtension();
$path = public_path('uploads/'.$file_name);
@@ -101,20 +104,22 @@ class SettingsController extends AdminController
$constraint->upsize();
})->save($path);
$setting->logo = $file_name;
}
}
// Update the asset data
$setting->id = '1';
if (Config::get('app.lock_passwords')==false) {
$setting->site_name = e(Input::get('site_name'));
}
}
$setting->per_page = e(Input::get('per_page'));
$setting->qr_code = e(Input::get('qr_code', '0'));
$setting->barcode_type = e(Input::get('barcode_type'));
$setting->load_remote = e(Input::get('load_remote', '0'));
$setting->default_currency = Input::get('default_currency', '$');
$setting->qr_text = e(Input::get('qr_text'));
$setting->auto_increment_prefix = e(Input::get('auto_increment_prefix'));
$setting->auto_increment_assets = e(Input::get('auto_increment_assets', '0'));
@@ -139,6 +144,63 @@ class SettingsController extends AdminController
}
/**
* Generate the backup page
*
* @return View
**/
public function getBackups()
{
$path = Config::get('backup::path');
$files = array();
if ($handle = opendir($path)) {
/* This is the correct way to loop over the directory. */
while (false !== ($entry = readdir($handle))) {
clearstatcache();
if (substr(strrchr($entry,'.'),1)=='zip') {
$files[] = array(
'filename' => $entry,
'filesize' => Setting::fileSizeConvert(filesize(Config::get('backup::path').$entry)),
'modified' => filemtime(Config::get('backup::path').$entry)
);
}
}
closedir($handle);
}
return View::make('backend/settings/backups', compact('path','files'));
}
/**
* Download the dump file
*
* @param int $assetId
* @return View
**/
public function downloadFile($filename = null)
{
$file = Config::get('backup::path').'/'.$filename;
// the license is valid
if (file_exists($file)) {
return Response::download($file);
} else {
// Prepare the error message
$error = Lang::get('admin/settings/message.does_not_exist');
// Redirect to the licence management page
return Redirect::route('settings/backups')->with('error', $error);
}
}
}
@@ -12,6 +12,8 @@ use Str;
use Validator;
use View;
use Symfony\Component\HttpFoundation\JsonResponse;
class StatuslabelsController extends AdminController
{
/**
@@ -40,8 +42,7 @@ class StatuslabelsController extends AdminController
// Show the page
$statuslabel = new Statuslabel;
$use_statuslabel_type = $statuslabel->getStatuslabelType();
$statuslabel_types = array('' => Lang::get('admin/hardware/form.select_statustype')) + array('undeployable' => Lang::get('admin/hardware/general.undeployable')) + array('pending' => Lang::get('admin/hardware/general.pending')) + array('archived' => Lang::get('admin/hardware/general.archived')) + array('deployable' => Lang::get('admin/hardware/general.deployable'));
$statuslabel_types = statusTypeList();
return View::make('backend/statuslabels/edit', compact('statuslabel_types','statuslabel'))->with('use_statuslabel_type',$use_statuslabel_type);
}
@@ -90,6 +91,44 @@ class StatuslabelsController extends AdminController
}
public function store()
{
// get the POST data
$new = Input::all();
$new['statuslabel_types']="deployable";
// create a new model instance
$statuslabel = new Statuslabel();
$statustype = Statuslabel::getStatuslabelTypesForDB(Input::get('statuslabel_types'));
// attempt validation
if ($statuslabel->validate($new)) {
//$statustype = Statuslabel::getStatuslabelTypesForDB(Input::get('statuslabel_types'));
// Save the Statuslabel data
$statuslabel->name = e(Input::get('name'));
$statuslabel->user_id = Sentry::getId();
$statuslabel->notes = '';
$statuslabel->deployable = $statustype['deployable'];
$statuslabel->pending = $statustype['pending'];
$statuslabel->archived = $statustype['archived'];
// Was the asset created?
if($statuslabel->save()) {
// Redirect to the new Statuslabel page
return JsonResponse::create($statuslabel);
} else {
return JsonResponse::create(["error" => "Couldn't save Statuslabel"],500);
}
} else {
// failure
$errors = $statuslabel->errors();
return JsonResponse::create(["error" => "Failed validation: ".print_r($errors->all('<li>:message</li>'),true)],500);
}
}
/**
* Statuslabel update.
@@ -2,6 +2,7 @@
use AdminController;
use Image;
use AssetMaintenance;
use Input;
use Lang;
use Supplier;
@@ -12,6 +13,9 @@ use Str;
use Validator;
use View;
use Symfony\Component\HttpFoundation\JsonResponse;
class SuppliersController extends AdminController
{
/**
@@ -99,6 +103,26 @@ class SuppliersController extends AdminController
return Redirect::to('admin/settings/suppliers/create')->with('error', Lang::get('admin/suppliers/message.create.error'));
}
public function store()
{
$supplier=new Supplier;
$new=Input::all();
$validator = Validator::make($new, $supplier->validationRules());
if($validator->fails()) {
return JsonResponse::create(["error" => "Failed validation: ".print_r($validator->messages()->all('<li>:message</li>'),true)],500);
} else {
//$supplier->fill($new);
$supplier->name=$new['name'];
$supplier->user_id = Sentry::getId();
if($supplier->save()) {
return JsonResponse::create($supplier);
} else {
return JsonResponse::create(["error" => "Couldn't save Supplier"]);
}
}
}
/**
* Supplier update.
File diff suppressed because it is too large Load Diff
@@ -17,13 +17,13 @@ class AddAccessoriesTable extends Migration {
$table->increments('id');
$table->string('name')->nullable()->default(NULL);
$table->integer('category_id')->nullable()->default(NULL);
$table->integer('user_id')->nullable()->default(NULL);
$table->integer('qty')->default(0);
$table->boolean('requestable')->default(0);
$table->integer('user_id')->nullable()->default(NULL);
$table->integer('qty')->default(0);
$table->boolean('requestable')->default(0);
$table->timestamps();
$table->softDeletes();
});
Schema::table('asset_logs', function ($table) {
$table->integer('accessory_id')->nullable()->default(NULL);
});
@@ -39,7 +39,7 @@ class AddAccessoriesTable extends Migration {
{
//
Schema::drop('accessories');
Schema::table('asset_logs', function ($table) {
$table->dropColumn('accessory_id');
});
@@ -13,18 +13,18 @@ class UpdateAcceptedAtToAcceptanceId extends Migration {
public function up()
{
//
Schema::table('asset_logs', function ($table) {
$table->integer('accepted_id')->nullable()->default(NULL);
});
$results = DB::select('select invitation.id AS invitation_id, acceptance.id AS acceptance_id FROM asset_logs invitation INNER JOIN asset_logs acceptance ON (invitation.checkedout_to=acceptance.checkedout_to AND invitation.asset_id=acceptance.asset_id) WHERE invitation.action_type="checkout" AND acceptance.action_type="accepted"');
foreach ($results as $result) {
$update = DB::update('update asset_logs set accepted_id=? where id=?', [$result->acceptance_id, $result->invitation_id]);
$update = DB::update('update asset_logs set accepted_id=? where id=?', [$result->acceptance_id, $result->invitation_id]);
}
}
/**
@@ -38,7 +38,7 @@ class UpdateAcceptedAtToAcceptanceId extends Migration {
Schema::table('asset_logs', function ($table) {
$table->dropColumn('accepted_id');
});
}
}
@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddParentIdToLocationsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('locations', function(Blueprint $table)
{
//
$table->integer('parent_id')->nullable()->default(NULL);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('locations', function(Blueprint $table)
{
//
$table->dropColumn('parent_id');
});
}
}
@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class FixDefaultForUserNotes extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'users` MODIFY `notes` varchar(255) DEFAULT NULL;');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'users` MODIFY `notes` varchar(255);');
}
}
@@ -0,0 +1,63 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateConsumables extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::create('consumables', function ($table) {
$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('user_id')->nullable()->default(NULL);
$table->integer('qty')->default(0);
$table->boolean('requestable')->default(0);
$table->timestamps();
$table->softDeletes();
});
Schema::table('asset_logs', function ($table) {
$table->integer('consumable_id')->nullable()->default(NULL);
});
Schema::create('consumables_users', function ($table) {
$table->increments('id');
$table->integer('user_id')->nullable()->default(NULL);
$table->integer('consumable_id')->nullable()->default(NULL);
$table->integer('assigned_to')->nullable()->default(NULL);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::drop('consumables');
Schema::table('asset_logs', function ($table) {
$table->dropColumn('consumable_id');
});
Schema::drop('consumables_users');
}
}
@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class MoveEmailToUsername extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
DB::update('UPDATE `'.DB::getTablePrefix().'users` SET `username`=`email`');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
//DB::statement('ALTER TABLE `users` MODIFY `notes` varchar(255);');
}
}
@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class MakeEmailNullable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'users` MODIFY `email` varchar(255) DEFAULT NULL;');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'users` MODIFY `email` varchar(255) NOT NULL;');
}
}
@@ -0,0 +1,65 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Lang;
class CreateAssetMaintenancesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create( 'asset_maintenances', function ( Blueprint $table ) {
$table->increments( 'id' );
$table->integer( 'asset_id' )
->unsigned();
$table->integer( 'supplier_id' )
->unsigned();
$table->enum( 'asset_maintenance_type', $this->getEnumFields() );
$table->string( 'title', 100 );
$table->boolean( 'is_warranty' );
$table->date( 'start_date' );
$table->date( 'completion_date' )
->nullable();
$table->integer( 'asset_maintenance_time' )
->nullable();
$table->longText( 'notes' )
->nullable();
$table->decimal( 'cost', 10, 2 )
->nullable();
$table->dateTime( 'deleted_at' )
->nullable();
$table->timestamps();
} );
}
protected function getEnumFields()
{
return [
Lang::get( 'admin/asset_maintenances/general.maintenance' ),
Lang::get( 'admin/asset_maintenances/general.repair' ),
Lang::get( 'admin/asset_maintenances/general.upgrade' )
];
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists( 'asset_maintenances' );
}
}
@@ -0,0 +1,56 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddCurrencyToSettingsAndLocations extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function(Blueprint $table)
{
$table->string('default_currency',10)->nullable()->default(NULL);
});
DB::update('UPDATE `'.DB::getTablePrefix().'settings` SET `default_currency`="'. Lang::get('general.currency').'"');
Schema::table('locations', function(Blueprint $table)
{
$table->string('currency',10)->nullable()->default(NULL);
});
DB::update('UPDATE `'.DB::getTablePrefix().'locations` SET `currency`="'. Lang::get('general.currency').'"');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::table('settings', function(Blueprint $table)
{
//
$table->dropColumn('default_currency');
});
Schema::table('locations', function(Blueprint $table)
{
//
$table->dropColumn('currency');
});
}
}
@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddExpectedCheckinDateToAssetLogs extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('asset_logs', function ($table) {
$table->date('expected_checkin')->nullable()->default(NULL);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('asset_logs', function(Blueprint $table)
{
$table->dropColumn('expected_checkin');
});
}
}
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddCheckinEmailToCategoryTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('categories', function ($table) {
$table->boolean('checkin_email')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('categories', function ($table) {
$table->dropColumn('checkin_email');
});
}
}
@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RemoveEmailUniqueConstraint extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function(Blueprint $table)
{
$table->dropUnique('users_email_unique');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
@@ -0,0 +1,210 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddThreadIdToAssetLogsTable extends Migration
{
/**
* currentAssetId
*
* @var int
*/
protected $currentAssetId = null;
/**
* currentAssetLogId
*
* @var int
*/
protected $currentAssetLogId = null;
/**
* assetLogs
*
* @var array
*/
protected $assetLogs = null;
/**
* startOfCurrentThread
*
* @var bool
*/
protected $startOfCurrentThread = true;
/**
* threadStartingActionTypes
*
* @var array
*/
protected $threadStartingActionTypes = [ 'checkout', 'requested' ];
/**
* threadFinalActionTypes
*
* @var array
*/
protected $threadFinalActionTypes = [ 'checkin from' ];
/**
* actionlog
*
* @var \Actionlog
*/
private $actionlog;
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table( 'asset_logs', function ( Blueprint $table ) {
$table->integer( 'thread_id' )
->nullable()
->default( null );
$table->index( 'thread_id' );
} );
$this->actionlog = new Actionlog();
$this->assetLogs = $this->actionlog->getListingOfActionLogsChronologicalOrder();
foreach ($this->assetLogs as $assetLog) {
if ($this->hasAssetChanged( $assetLog )) {
$this->resetCurrentAssetInformation( $assetLog );
}
if ($this->hasBegunNewChain( $assetLog )) {
$this->startOfCurrentThread = false;
continue;
}
$this->updateAssetLogWithThreadInformation( $assetLog );
if ($this->hasReachedEndOfChain( $assetLog )
) {
$this->clearCurrentAssetInformation();
}
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table( 'asset_logs', function ( Blueprint $table ) {
$table->dropIndex( 'thread_id' );
$table->dropColumn( 'thread_id' );
} );
}
/**
* hasAssetChanged
*
* @param $assetLog
*
* @return bool
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function hasAssetChanged( $assetLog )
{
return $assetLog->asset_id !== $this->currentAssetId;
}
/**
* resetCurrentAssetInformation
*
* @param $assetLog
*
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function resetCurrentAssetInformation( $assetLog )
{
$this->currentAssetId = $assetLog->asset_id;
$this->currentAssetLogId = $assetLog->id;
$this->startOfCurrentThread = true;
}
/**
* hasReachedEndOfChain
*
* @param $assetLog
*
* @return bool
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function hasReachedEndOfChain( $assetLog )
{
return in_array( $assetLog->action_type, $this->threadFinalActionTypes )
&& $this->startOfCurrentThread == false;
}
/**
* clearCurrentAssetInformation
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function clearCurrentAssetInformation()
{
$this->startOfCurrentThread = true;
$this->currentAssetLogId = null;
$this->currentAssetId = null;
}
/**
* updateAssetLogWithThreadInformation
*
* @param $assetLog
*
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function updateAssetLogWithThreadInformation( $assetLog )
{
$loadedAssetLog = Actionlog::find( $assetLog->id );
$loadedAssetLog->thread_id = $this->currentAssetLogId;
$loadedAssetLog->update();
unset( $loadedAssetLog );
}
/**
* hasBegunNewChain
*
* @param $assetLog
*
* @return bool
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function hasBegunNewChain( $assetLog )
{
return in_array( $assetLog->action_type, $this->threadStartingActionTypes )
&& $this->startOfCurrentThread == true;
}
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddAcceptedToAssets extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function(Blueprint $table)
{
$table->enum('accepted',["pending","accepted","rejected"])->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('assets', function(Blueprint $table)
{
$table->dropColumn('accepted');
});
}
}
+7 -7
View File
@@ -72,7 +72,7 @@ class AssetsSeeder extends Seeder
'assigned_to' => NULL,
'physical' => 1,
'archived' => 0,
'status_id' => 2,
'status_id' => 2,
'notes' => '',
'deleted_at' => NULL,
'archived' => '0',
@@ -139,7 +139,7 @@ class AssetsSeeder extends Seeder
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
'user_id' => 2,
'assigned_to' => 2,
'assigned_to' => 1,
'physical' => 1,
'archived' => 0,
'status_id' => 1,
@@ -162,10 +162,10 @@ class AssetsSeeder extends Seeder
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
'user_id' => 2,
'assigned_to' => 2,
'assigned_to' => 1,
'physical' => 1,
'archived' => 0,
'status_id' => 1,
'status_id' => 1,
'notes' => '',
'deleted_at' => NULL,
'archived' => '0',
@@ -211,7 +211,7 @@ class AssetsSeeder extends Seeder
'assigned_to' => NULL,
'physical' => 1,
'archived' => 0,
'status_id' => '2',
'status_id' => '2',
'notes' => '',
'deleted_at' => NULL,
'archived' => '0',
@@ -234,7 +234,7 @@ class AssetsSeeder extends Seeder
'assigned_to' => NULL,
'physical' => 1,
'archived' => 1,
'status_id' => '4',
'status_id' => '2',
'notes' => '',
'deleted_at' => NULL,
'archived' => '0',
@@ -257,7 +257,7 @@ class AssetsSeeder extends Seeder
'assigned_to' => NULL,
'physical' => 1,
'archived' => 1,
'status_id' => '3',
'status_id' => '2',
'notes' => '',
'deleted_at' => NULL,
'archived' => '0',
+79 -10
View File
@@ -1,18 +1,87 @@
<?php
/*
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
function ParseFloat($floatString){
function ParseFloat($floatString){
// use comma for thousands until local info is property used
$LocaleInfo = localeconv();
//$thousands = isset($LocaleInfo["mon_thousands_sep"]) ? $LocaleInfo["mon_thousands_sep"] : ",";
//$floatString = str_replace($LocaleInfo["mon_thousands_sep"] , "", $floatString);
//$floatString = str_replace($LocaleInfo["decimal_point"] , ".", $floatString);
$floatString = str_replace("," , "", $floatString);
$floatString = str_replace($LocaleInfo["decimal_point"] , ".", $floatString);
return floatval($floatString);
}
$floatString = str_replace("," , "", $floatString);
$floatString = str_replace($LocaleInfo["decimal_point"] , ".", $floatString);
return floatval($floatString);
}
function modelList() {
$model_list = array('' => Lang::get('general.select_model')) + DB::table('models')
->select(DB::raw('IF (modelno="" OR modelno IS NULL,name,concat(name, " / ",modelno)) as name, id'))
->orderBy('name', 'asc')
->whereNull('deleted_at')
->lists('name', 'id');
return $model_list;
}
function categoryList() {
$category_list = array('' => '') + DB::table('categories')
->whereNull('deleted_at')
->orderBy('name', 'asc')
->lists('name', 'id');
return $category_list;
}
function suppliersList() {
$supplier_list = array('' => Lang::get('general.select_supplier')) + Supplier::orderBy('name', 'asc')
->orderBy('name', 'asc')
->lists('name', 'id');
return $supplier_list;
}
function statusLabelList() {
$statuslabel_list = Statuslabel::orderBy('name', 'asc')
->lists('name', 'id');
return $statuslabel_list;
}
function locationsList() {
$location_list = array('' => Lang::get('general.select_location')) + Location::orderBy('name', 'asc')
->lists('name', 'id');
return $location_list;
}
function manufacturerList() {
$manufacturer_list = array('' => 'Select One') + Manufacturer::orderBy('name', 'asc')
->lists('name', 'id');
return $manufacturer_list;
}
function statusTypeList() {
$statuslabel_types = array('' => Lang::get('admin/hardware/form.select_statustype')) + array('undeployable' => Lang::get('admin/hardware/general.undeployable')) + array('pending' => Lang::get('admin/hardware/general.pending')) + array('archived' => Lang::get('admin/hardware/general.archived')) + array('deployable' => Lang::get('admin/hardware/general.deployable'));
return $statuslabel_types;
}
function managerList() {
$manager_list = array('' => '') + DB::table('users')
->select(DB::raw('concat(last_name,", ",first_name," (",username,")") as full_name, id'))
->whereNull('deleted_at', 'and')
->orderBy('last_name', 'asc')
->orderBy('first_name', 'asc')
->lists('full_name', 'id');
return $manager_list;
}
function depreciationList() {
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::orderBy('name', 'asc')->lists('name', 'id');
return $depreciation_list;
}
function categoryTypeList() {
$category_types= array('' => '','accessory' => 'Accessory', 'asset' => 'Asset', 'consumable' => 'Consumable');
return $category_types;
}
function usersList() {
$users_list = array('' => Lang::get('general.select_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');
return $users_list;
}
+2 -2
View File
@@ -5,7 +5,7 @@ return array(
'about_accessories_text' => 'الملحقات هي أي شيء تقوم بتسليمه للمستخدمين لكنه لا يحتوي على رقم تسلسلي (أو أنك لست بحاجة إلى تتبعه بشكل خاص). مثال: فأرة الحاسوب أو لوحة المفاتيح.',
'accessory_category' => 'فئة الملحق',
'accessory_name' => 'اسم الملحق',
'create' => 'إنشاء فئة جديدة',
'create' => 'Create Accessory',
'eula_text' => 'إنشاء اتفاقية جديدة',
'eula_text_help' => 'يسمح لك هذا الحقل بتخصيص الاتفاقيات لأنواع معينة من الأصول. اذا كنت تمتلك اتفاقية واحدة لجميع أصولك يمكنك أن تقوم بتأشير المربع في الأسفل لاستخدام الاتفاقية الافتراضية.',
'require_acceptance' => 'مطالبة المستخدمين بتأكيد قبولهم الأصول في هذه الفئة.',
@@ -13,7 +13,7 @@ return array(
'qty' => 'الكمية',
'total' => 'المجموع',
'remaining' => 'المتاح',
'update' => 'تحديث الفئة',
'update' => 'Update Accessory',
'use_default_eula' => 'قم باستعمال <a href="#" data-toggle="modal" data-target="#eulaModal">primary default EULA</a>.',
'use_default_eula_disabled' => '<del>Use the primary default EULA instead.</del> No primary default EULA is set. Please add one in Settings.',
+9 -9
View File
@@ -3,15 +3,15 @@
return array(
'does_not_exist' => 'هذه الفئة غير موجودة.',
'assoc_users' => 'This accessory currently has :count items checked out to users. Please check in the accessories and and try again. ',
'assoc_users' => 'تم إخراج :count عنصر من هذا الملحق للمستخدمين، الرجاء إيداع الملحقات ثم حاول مرة أخرى. ',
'create' => array(
'error' => 'Category was not created, please try again.',
'success' => 'Category created successfully.'
'error' => 'فشل إنشاء التصنيف، الرجاء المحاولة مرة أخرى.',
'success' => 'تم إنشاء الفئة بنجاح.'
),
'update' => array(
'error' => 'Category was not updated, please try again',
'error' => 'فشل تحديث التصنيف، الرجاء المحاولة مرة أخرى',
'success' => 'Category updated successfully.'
),
@@ -22,14 +22,14 @@ return array(
),
'checkout' => array(
'error' => 'Accessory was not checked out, please try again',
'success' => 'Accessory checked out successfully.',
'user_does_not_exist' => 'That user is invalid. Please try again.'
'error' => 'لم يتم إخراج الملحق، الرجاء المحاولة مرة أخرى',
'success' => 'تم إخراج الملحق بنجاح.',
'user_does_not_exist' => 'هذا المستخدم خاطئ، الرجاء المحاولة مرة أخرى.'
),
'checkin' => array(
'error' => 'Accessory was not checked in, please try again',
'success' => 'Accessory checked in successfully.',
'error' => 'لم يتم إيداع الملحق، الرجاء المحاولة مرة أخرى',
'success' => 'تم إيداع الملحق بنجاح.',
'user_does_not_exist' => 'That user is invalid. Please try again.'
)
+14
View File
@@ -0,0 +1,14 @@
<?php
return [
'asset_maintenance_type' => 'Asset Maintenance Type',
'title' => 'Title',
'start_date' => 'Start Date',
'completion_date' => 'Completion Date',
'cost' => 'Cost',
'is_warranty' => 'Warranty Improvement',
'asset_maintenance_time' => 'Asset Maintenance Time (in days)',
'notes' => 'Notes',
'update' => 'Update Asset Maintenance',
'create' => 'Create Asset Maintenance'
];
+11
View File
@@ -0,0 +1,11 @@
<?php
return [
'asset_maintenances' => 'Asset Maintenances',
'edit' => 'Edit Asset Maintenance',
'delete' => 'Delete Asset Maintenance',
'view' => 'View Asset Maintenance Details',
'repair' => 'Repair',
'maintenance' => 'Maintenance',
'upgrade' => 'Upgrade'
];
+17
View File
@@ -0,0 +1,17 @@
<?php
return [
'not_found' => 'Asset Maintenance you were looking for was not found!',
'delete' => [
'confirm' => 'Are you sure you wish to delete this asset maintenance?',
'error' => 'There was an issue deleting the asset maintenance. Please try again.',
'success' => 'The asset maintenance was deleted successfully.'
],
'create' => [
'error' => 'Asset Maintenance was not created, please try again.',
'success' => 'Asset Maintenance created successfully.'
],
'asset_maintenance_incomplete' => 'Not Completed Yet',
'warranty' => 'Warranty',
'not_warranty' => 'Not Warranty',
];
+9
View File
@@ -0,0 +1,9 @@
<?php
return [
'title' => 'Asset Maintenance',
'asset_name' => 'Asset Name',
'supplier_name' => 'Supplier Name',
'is_warranty' => 'Warranty',
'dl_csv' => 'Download CSV'
];
+1
View File
@@ -5,6 +5,7 @@ return array(
'about_categories' => 'تصنيفات الأصول تساعدك على ترتيب الأصول. من الأمثلة على التصنيفات &quot; مكاتب &quot;، &quot;أجهزة الكمبيوتر المحمولة &quot;، &quot;الهواتف النقالة &quot;، &quot;أجهزة لوحية &quot; وهكذا، كما يمكنك استخدام التصنيفات بأي طريقة تناسبك. ',
'asset_categories' => 'التصنيفات',
'category_name' => 'اسم التصنيف',
'checkin_email' => 'Send email to user on checkin.',
'clone' => 'Clone Category',
'create' => 'إنشاء تصنيف',
'edit' => 'Edit Category',
+11
View File
@@ -0,0 +1,11 @@
<?php
return array(
'about_consumables_title' => 'About Consumables',
'about_consumables_text' => 'Consumables are anything purchased that will be used up over time. For example, printer ink or copier paper.',
'consumable_name' => 'Consumable Name',
'create' => 'Create Consumable',
'remaining' => 'Remaining',
'total' => 'Total',
'update' => 'Update Consumable',
);
+36
View File
@@ -0,0 +1,36 @@
<?php
return array(
'does_not_exist' => 'Consumable does not exist.',
'create' => array(
'error' => 'Consumable was not created, please try again.',
'success' => 'Consumable created successfully.'
),
'update' => array(
'error' => 'Consumable was not updated, please try again',
'success' => 'Consumable updated successfully.'
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this accessory?',
'error' => 'There was an issue deleting the consumable. Please try again.',
'success' => 'The accessory was deleted successfully.'
),
'checkout' => array(
'error' => 'Consumable was not checked out, please try again',
'success' => 'Consumable checked out successfully.',
'user_does_not_exist' => 'That user is invalid. Please try again.'
),
'checkin' => array(
'error' => 'Consumable was not checked in, please try again',
'success' => 'Consumable checked in successfully.',
'user_does_not_exist' => 'That user is invalid. Please try again.'
)
);
+5
View File
@@ -0,0 +1,5 @@
<?php
return array(
'title' => 'Consumable Name',
);
+2 -1
View File
@@ -17,9 +17,10 @@ return array(
'default_location' => 'Default Location',
'eol_date' => 'EOL Date',
'eol_rate' => 'EOL Rate',
'expected_checkin' => 'Expected Checkin Date',
'expires' => 'Expires',
'fully_depreciated' => 'Fully Depreciated',
'help_checkout' => 'If you wish to assign this asset immediately, you should select "Ready to Deploy" from the status list above, or unexpected things may happen. ',
'help_checkout' => 'If you wish to assign this asset immediately, select "Ready to Deploy" from the status list above. ',
'mac_address' => 'MAC Address',
'manufacturer' => 'Manufacturer',
'model' => 'Model',
+1
View File
@@ -9,6 +9,7 @@ return array(
'deployable' => 'Deployable',
'deleted' => 'This asset has been deleted. <a href="/hardware/:asset_id/restore">Click here to restore it</a>.',
'edit' => 'Edit Asset',
'filetype_info' => 'Allowed filetypes are png, gif, jpg, jpeg, doc, docx, pdf, txt, zip, and rar.',
'model_deleted' => 'This Assets model has been deleted. You must restore the model before you can restore the Asset.<br/> <a href="/hardware/models/:model_id/restore">Click here to restore the model</a>.',
'requestable' => 'Requestable',
'restore' => 'Restore Asset',
+3 -2
View File
@@ -5,6 +5,7 @@ return array(
'undeployable' => '<strong>Warning: </strong> This asset has been marked as currently undeployable.
If this status has changed, please update the asset status.',
'does_not_exist' => 'Asset does not exist.',
'does_not_exist_or_not_requestable' => 'Nice try. That asset does not exist or is not requestable.',
'assoc_users' => 'This asset is currently checked out to a user and cannot be deleted. Please check the asset in first, and then try deleting again. ',
'create' => array(
@@ -22,7 +23,7 @@ return array(
'error' => 'Asset was not restored, please try again',
'success' => 'Asset restored successfully.'
),
'deletefile' => array(
'error' => 'File not deleted. Please try again.',
'success' => 'File successfully deleted.',
@@ -31,7 +32,7 @@ return array(
'upload' => array(
'error' => 'File(s) not uploaded. Please try again.',
'success' => 'File(s) successfully uploaded.',
'nofiles' => 'You did not select any files for upload',
'nofiles' => 'You did not select any files for upload, or the file you are trying to upload is too large',
'invalidfiles' => 'One or more of your files is too large or is a filetype that is not allowed. Allowed filetypes are png, gif, jpg, doc, docx, pdf, and txt.',
),
+1
View File
@@ -18,5 +18,6 @@ return array(
'serial' => 'Serial',
'status' => 'Status',
'title' => 'Asset ',
'days_without_acceptance' => 'Days Without Acceptance'
);
+1
View File
@@ -15,6 +15,7 @@ return array(
'notes' => 'Notes',
'order' => 'Order No.',
'purchase_order' => 'Purchase Order Number',
'reassignable' => 'Reassignable',
'remaining_seats' => 'Remaining Seats',
'seats' => 'Seats',
'serial' => 'Serial',
+1
View File
@@ -6,6 +6,7 @@ return array(
'checkout_history' => 'Checkout History',
'checkout' => 'Checkout License Seat',
'edit' => 'Edit License',
'filetype_info' => 'Allowed filetypes are png, gif, jpg, jpeg, doc, docx, pdf, txt, zip, and rar.',
'clone' => 'Clone License',
'history_for' => 'History for ',
'in_out' => 'In/Out',
+1 -1
View File
@@ -22,7 +22,7 @@ return array(
'upload' => array(
'error' => 'File(s) not uploaded. Please try again.',
'success' => 'File(s) successfully uploaded.',
'nofiles' => 'You did not select any files for upload',
'nofiles' => 'You did not select any files for upload, or the file you are trying to upload is too large',
'invalidfiles' => 'One or more of your files is too large or is a filetype that is not allowed. Allowed filetypes are png, gif, jpg, doc, docx, pdf, and txt.',
),
+2
View File
@@ -4,6 +4,8 @@ return array(
'does_not_exist' => 'Location does not exist.',
'assoc_users' => 'This location is currently associated with at least one user and cannot be deleted. Please update your users to no longer reference this location and try again. ',
'assoc_assets' => 'This location is currently associated with at least one asset and cannot be deleted. Please update your assets to no longer reference this location and try again. ',
'assoc_child_loc' => 'This location is currently the parent of at least one child location and cannot be deleted. Please update your locations to no longer reference this location and try again. ',
'create' => array(
+2
View File
@@ -12,4 +12,6 @@ return array(
'address' => 'Address',
'zip' => 'Postal Code',
'locations' => 'Locations',
'parent' => 'Parent',
'currency' => 'Location Currency', // this is deprecated
);
+3 -2
View File
@@ -8,7 +8,8 @@ return array(
'create' => array(
'error' => 'Model was not created, please try again.',
'success' => 'Model created successfully.'
'success' => 'Model created successfully.',
'duplicate_set' => 'An asset model with that name, manufacturer and model number already exists.',
),
'update' => array(
@@ -21,7 +22,7 @@ return array(
'error' => 'There was an issue deleting the model. Please try again.',
'success' => 'The model was deleted successfully.'
),
'restore' => array(
'error' => 'Model was not restored, please try again',
'success' => 'Model restored successfully.'
+3 -1
View File
@@ -7,8 +7,10 @@ return array(
'auto_increment_assets' => 'Generate auto-incrementing asset IDs',
'auto_increment_prefix' => 'Prefix (optional)',
'auto_incrementing_help' => 'Enable auto-incrementing asset IDs first to set this',
'backups' => 'Backups',
'barcode_type' => 'Barcode Type',
'barcode_settings' => 'Barcode Settings',
'default_currency' => 'Default Currency',
'default_eula_text' => 'Default EULA',
'default_eula_help_text' => 'You can also associate custom EULAs to specific asset categories.',
'display_asset_name' => 'Display Asset Name',
@@ -32,7 +34,7 @@ return array(
'qr_text' => 'QR Code Text',
'setting' => 'Setting',
'settings' => 'Settings',
'site_name' => 'Site Name',
'site_name' => 'Site Name',
'slack_botname' => 'Slack Botname',
'slack_channel' => 'Slack Channel',
'slack_endpoint' => 'Slack Endpoint',
+12 -9
View File
@@ -3,13 +3,16 @@
return array(
'assets_user' => 'الجهاز مسجل بعهدة :name',
'clone' => 'نسخ المستخدم',
'contact_user' => 'اتصل بـ :name',
'edit' => 'تعديل المستخدم',
'history_user' => 'الأرشيف الخاص بـ :name',
'last_login' => 'آخر دخول للمستخدم',
'software_user' => 'البرامج المسجلة لـ :name',
'view_user' => 'عرض المستخدم :name',
'usercsv' => 'ملف CSV',
'assets_user' => 'الجهاز مسجل بعهدة :name',
'clone' => 'نسخ المستخدم',
'contact_user' => 'اتصل بـ :name',
'edit' => 'تعديل المستخدم',
'filetype_info' => 'Allowed filetypes are png, gif, jpg, jpeg, doc, docx, pdf, txt, zip, and rar.',
'history_user' => 'الأرشيف الخاص بـ :name',
'last_login' => 'آخر دخول للمستخدم',
'ldap_config_text' => 'LDAP configuration settings can be found in the app/config folder in a file called ldap.php',
'ldap_text' => 'Connect to LDAP and create users. Passwords will be auto-generated.',
'software_user' => 'البرامج المسجلة لـ :name',
'view_user' => 'عرض المستخدم :name',
'usercsv' => 'ملف CSV',
);
+26 -6
View File
@@ -2,12 +2,15 @@
return array(
'user_exists' => 'المستخدم موجود مسبقاً!',
'user_not_found' => 'المستخدم [id:] غير موجود.',
'user_login_required' => 'حقل "الدخول" مطلوب',
'user_password_required' => 'كلمة السر مطلوبة.',
'insufficient_permissions' => 'صلاحيات غير كافية.',
'user_deleted_warning' => 'تم حذف المستخدم. سيكون عليك استعادة هذا المستخدم للتعديل عليه او تسليمه اجهزة جديدة.',
'accepted' => 'You have successfully accepted this asset.',
'declined' => 'You have successfully declined this asset.',
'user_exists' => 'المستخدم موجود مسبقاً!',
'user_not_found' => 'المستخدم [id:] غير موجود.',
'user_login_required' => 'حقل "الدخول" مطلوب',
'user_password_required' => 'كلمة السر مطلوبة.',
'insufficient_permissions' => 'صلاحيات غير كافية.',
'user_deleted_warning' => 'تم حذف المستخدم. سيكون عليك استعادة هذا المستخدم للتعديل عليه او تسليمه اجهزة جديدة.',
'ldap_not_configured' => 'LDAP integration has not been configured for this installation.',
'success' => array(
@@ -29,6 +32,23 @@ return array(
'unsuspend' => 'حدث خطأ ما أثناء إلغاء التعليق عن المستخدم. حاول مرة أخرى.',
'import' => 'حدث خطأ أثناء استيراد المستخدمين. حاول مرة أخرى.',
'asset_already_accepted' => 'هذا الجهاز تم قبوله مسبقاً.',
'accept_or_decline' => 'You must either accept or decline this asset.',
'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:',
'ldap_could_not_get_entries' => 'Could not get entries from the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server:',
),
'deletefile' => array(
'error' => 'File not deleted. Please try again.',
'success' => 'File successfully deleted.',
),
'upload' => array(
'error' => 'File(s) not uploaded. Please try again.',
'success' => 'File(s) successfully uploaded.',
'nofiles' => 'You did not select any files for upload',
'invalidfiles' => 'One or more of your files is too large or is a filetype that is not allowed. Allowed filetypes are png, gif, jpg, doc, docx, pdf, and txt.',
),
);
+1 -1
View File
@@ -3,7 +3,7 @@
return array(
'account_already_exists' => 'An account with the this email already exists.',
'account_not_found' => 'The email account or password is incorrect.',
'account_not_found' => 'The username or password is incorrect.',
'account_not_activated' => 'This user account is not activated.',
'account_suspended' => 'This user account is suspended.',
'account_banned' => 'This user account is banned.',
+1
View File
@@ -8,6 +8,7 @@ return array(
'delete' => 'حذف',
'edit' => 'تعديل',
'restore' => 'إستعادة',
'request' => 'Request',
'submit' => 'إرسال',
'upload' => 'Upload',
+24 -8
View File
@@ -1,10 +1,10 @@
<?php
return array(
return [
'accessories' => 'Accessories',
'accessory' => 'Accessory',
'accessory_report' => 'Accessory Report',
'action' => 'Action',
'activity_report' => 'Activity Report',
'address' => 'العنوان',
'admin' => 'الإدارة',
@@ -20,20 +20,23 @@ return array(
'avatar_delete' => 'حذف الصورة الرمزية',
'avatar_upload' => 'رفع صورة رمزية',
'back' => 'الرجوع للخلف',
'bad_data' => 'Nothing found. Maybe bad data?',
'cancel' => 'إلغاء',
'categories' => 'تصنيفات الأصول',
'category' => 'تصنيف الأصول',
'categories' => 'Categories',
'category' => 'Category',
'changeemail' => 'تغيير عنوان البريد الإلكتروني',
'changepassword' => 'تغيير كلمة المرور',
'checkin' => 'تسجيل',
'checkin_from' => 'Checkin from',
'checkout' => 'ترجيع',
'city' => 'المدينة',
'consumable' => 'Consumable',
'consumables' => 'Consumables',
'country' => 'الدولة',
'create' => 'إضافة',
'created_asset' => 'الأصول المضافة',
'created_at' => 'أنشئت في',
'currency' => '$',
'currency' => '$', // this is deprecated
'current' => 'الحالي',
'custom_report' => 'Custom Asset Report',
'dashboard' => 'Dashboard',
@@ -57,6 +60,10 @@ return array(
'id' => 'الرقم',
'image_delete' => 'حذف الصورة',
'image_upload' => 'رفع صورة',
'import' => 'Import',
'asset_maintenance' => 'Asset Maintenance',
'asset_maintenance_report' => 'Asset Maintenance Report',
'asset_maintenances' => 'Asset Maintenances',
'item' => 'Item',
'last' => 'Last',
'last_name' => 'الإسم الأخير',
@@ -66,6 +73,8 @@ return array(
'licenses' => 'الرخص',
'list_all' => 'عرض الكل',
'loading' => 'Loading',
'lock_passwords' => 'This field cannot be edited in this installation.',
'feature_disabled' => 'This feature has been disabled for this installation.',
'location' => 'الموقع',
'locations' => 'المواقع',
'logout' => 'تسجيل خروج',
@@ -88,9 +97,12 @@ return array(
'previous' => 'Previous',
'processing' => 'Processing',
'profile' => 'ملفك الشخصي',
'qty' => 'QTY',
'quanitity' => 'Quanitity',
'ready_to_deploy' => 'جاهزة للتوزيع',
'recent_activity' => 'Recent Activity',
'reports' => 'التقارير',
'requested' => 'Requested',
'save' => 'حفظ',
'select' => 'Select',
'search' => 'Search',
@@ -101,6 +113,7 @@ return array(
'select_supplier' => 'Select a Supplier',
'select_user' => 'Select a User',
'select_date' => 'Select Date',
'select_statuslabel' => 'Select Status',
'settings' => 'الإعدادات',
'sign_in' => 'تسجيل الدخول',
'site_name' => 'إسم الموقع',
@@ -113,8 +126,12 @@ return array(
'type' => 'Type',
'undeployable' => 'غير قابلة للتوزيع',
'unknown_admin' => 'إداري غير معروف',
'update' => 'Update',
'uploaded' => 'Uploaded',
'user' => 'المستخدم',
'accepted' => 'accepted',
'declined' => 'declined',
'unaccepted_asset_report' => 'Unaccepted Assets',
'users' => 'Users',
'viewassets' => 'عرض الأصول المسجلة',
'website' => 'الموقع',
@@ -122,5 +139,4 @@ return array(
'years' => 'سنوات',
'yes' => 'نعم',
'zip' => 'الرمز البريدي',
);
];
+1 -1
View File
@@ -77,7 +77,7 @@ return array(
*/
'custom' => array(),
'alpha_space' => "The :attribute field may only contain letters, commas, spaces and dashes.",
'alpha_space' => "The :attribute field contains a character that is not allowed.",
/*
|--------------------------------------------------------------------------
+16 -15
View File
@@ -1,20 +1,21 @@
<?php
return array(
'about_accessories_title' => 'About Accessories',
'about_accessories_text' => 'Accessories are anything you issue to users but that do not have a serial number (or you do not care about tracking them uniquely). For example, computer mice or keyboards.',
'accessory_category' => 'Accessory Category',
'accessory_name' => 'Accessory Name',
'create' => 'Create Category',
'eula_text' => 'Category EULA',
'eula_text_help' => 'This field allows you to customize your EULAs for specific types of assets. If you only have one EULA for all of your assets, you can check the box below to use the primary default.',
'require_acceptance' => 'Require users to confirm acceptance of assets in this category.',
'no_default_eula' => 'No primary default EULA found. Add one in Settings.',
'qty' => 'QTY',
'total' => 'Total',
'remaining' => 'Avail',
'update' => 'Update Category',
'use_default_eula' => 'Use the <a href="#" data-toggle="modal" data-target="#eulaModal">primary default EULA</a> instead.',
'use_default_eula_disabled' => '<del>Use the primary default EULA instead.</del> No primary default EULA is set. Please add one in Settings.',
'about_accessories_title' => 'O příslušenství',
'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í',
'create' => 'Vytvoř příslušenství',
'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í.',
'qty' => 'Množství',
'total' => 'CELKEM',
'remaining' => 'Dostupný',
'update' => 'Aktualizace příslušenství',
'use_default_eula' => 'Použít <a href="#" data-toggle="modal" data-target="#eulaModal">primární výchozí EULA</a>.',
'use_default_eula_disabled' => '<del>Použít výchozí EULA.</del>
Žádná výchozí EULA nenastavena. Zadejte novou v nastevení.',
);
+15 -15
View File
@@ -2,35 +2,35 @@
return array(
'does_not_exist' => 'Category does not exist.',
'assoc_users' => 'This accessory currently has :count items checked out to users. Please check in the accessories and and try again. ',
'does_not_exist' => 'Kategorie 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' => 'Category was not created, please try again.',
'success' => 'Category created successfully.'
'error' => 'Kategorie nevytvořena, zkuste to znovu.',
'success' => 'Kategorie úspěšně vytvořena.'
),
'update' => array(
'error' => 'Category was not updated, please try again',
'success' => 'Category updated successfully.'
'error' => 'Kategorie neaktualizována, zkuste to znovu',
'success' => 'Kategorie úspěšně aktualizována.'
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this category?',
'error' => 'There was an issue deleting the category. Please try again.',
'success' => 'The category was deleted successfully.'
'confirm' => 'Opravdu chcete smazat tuto kategorii?',
'error' => 'Vyskytl se problém při mazání kategorie. Zkuste to znovu.',
'success' => 'Kategorie byla úspěšně smazána.'
),
'checkout' => array(
'error' => 'Accessory was not checked out, please try again',
'success' => 'Accessory checked out successfully.',
'user_does_not_exist' => 'That user is invalid. Please try again.'
'error' => 'Příslušenství nebylo převzato, zkuste to znovu',
'success' => 'Příslušenství úspěšně předáno.',
'user_does_not_exist' => 'Neplatný uživatel. Zkuste to znovu.'
),
'checkin' => array(
'error' => 'Accessory was not checked in, please try again',
'success' => 'Accessory checked in successfully.',
'user_does_not_exist' => 'That user is invalid. Please try again.'
'error' => 'Příslušenství nebylo převzato, zkuste to znovu',
'success' => 'Příslušenství úspěšně předáno.',
'user_does_not_exist' => 'Neplatný uživatel. Zkuste to znovu.'
)
+2 -2
View File
@@ -3,7 +3,7 @@
return array(
'eula_text' => 'EULA',
'id' => 'ID',
'require_acceptance' => 'Acceptance',
'title' => 'Accessory Name',
'require_acceptance' => 'Přijetí',
'title' => 'Název příslušenství',
);
+14
View File
@@ -0,0 +1,14 @@
<?php
return [
'asset_maintenance_type' => 'Asset Maintenance Type',
'title' => 'Title',
'start_date' => 'Začátek',
'completion_date' => 'Completion Date',
'cost' => 'Cena',
'is_warranty' => 'Warranty Improvement',
'asset_maintenance_time' => 'Asset Maintenance Time (in days)',
'notes' => 'Poznámky',
'update' => 'Update Asset Maintenance',
'create' => 'Create Asset Maintenance'
];
+11
View File
@@ -0,0 +1,11 @@
<?php
return [
'asset_maintenances' => 'Asset Maintenances',
'edit' => 'Edit Asset Maintenance',
'delete' => 'Delete Asset Maintenance',
'view' => 'View Asset Maintenance Details',
'repair' => 'Oprava',
'maintenance' => 'Údržba',
'upgrade' => 'Upgradovat'
];
+17
View File
@@ -0,0 +1,17 @@
<?php
return [
'not_found' => 'Asset Maintenance you were looking for was not found!',
'delete' => [
'confirm' => 'Are you sure you wish to delete this asset maintenance?',
'error' => 'There was an issue deleting the asset maintenance. Please try again.',
'success' => 'The asset maintenance was deleted successfully.'
],
'create' => [
'error' => 'Asset Maintenance was not created, please try again.',
'success' => 'Asset Maintenance created successfully.'
],
'asset_maintenance_incomplete' => 'Not Completed Yet',
'warranty' => 'Záruka',
'not_warranty' => 'Bez záruky',
];
+9
View File
@@ -0,0 +1,9 @@
<?php
return [
'title' => 'Asset Maintenance',
'asset_name' => 'Název majetku',
'supplier_name' => 'Dodavatel',
'is_warranty' => 'Záruka',
'dl_csv' => 'Stáhnout CSV'
];
+11 -10
View File
@@ -5,17 +5,18 @@ return array(
'about_categories' => 'Kategorie pomáhají organizovat majetek. Takovou kategorii může být např. &quot;Desktopy&quot;, &quot;Notebooky&quot;, &quot;Mobilní telefony&quot;, &quot;Tablety&quot;, apod., kategorie můžete ale používat jakkoliv Vám to bude dávat smysl. ',
'asset_categories' => 'Kategorie majetku',
'category_name' => 'Jméno kategorie',
'clone' => 'Clone Category',
'checkin_email' => 'Send email to user on checkin.',
'clone' => 'Klonovat Kategorii',
'create' => 'Vytvořit kategorii',
'edit' => 'Edit Category',
'eula_text' => 'Category EULA',
'eula_text_help' => 'This field allows you to customize your EULAs for specific types of assets. If you only have one EULA for all of your assets, you can check the box below to use the primary default.',
'require_acceptance' => 'Require users to confirm acceptance of assets in this category.',
'required_acceptance' => 'This user will be emailed with a link to confirm acceptance of this item.',
'required_eula' => 'This user will be emailed a copy of the EULA',
'no_default_eula' => 'No primary default EULA found. Add one in Settings.',
'edit' => 'Upravit Kategorii',
'eula_text' => 'EULA Kategorie',
'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' => 'Žádat uživatelé o potvrzení převzetí majetku v této kategorii.',
'required_acceptance' => 'Uživateli bude zaslán email s odkazem pro potvrzení přijetí této položky.',
'required_eula' => 'Tomuto uživateli bude zaslána kopie EUAL emailem',
'no_default_eula' => 'Nenalezena primární výchozí EULA. Přidejte ji v Nastaveních.',
'update' => 'Upravit kategorii',
'use_default_eula' => 'Use the <a href="#" data-toggle="modal" data-target="#eulaModal">primary default EULA</a> instead.',
'use_default_eula_disabled' => '<del>Use the primary default EULA instead.</del> No primary default EULA is set. Please add one in Settings.',
'use_default_eula' => 'Použijte raději <a href="#" data-toggle="modal" data-target="#eulaModal">primární výchozí EULA</a>.',
'use_default_eula_disabled' => '<del>Použijte raději primární výchozí EULA.</del> Nenalezena primární výchozí EULA. Přidejte ji v Nastaveních prosím.',
);
+7 -7
View File
@@ -6,19 +6,19 @@ return array(
'assoc_users' => 'This category is currently associated with at least one model and cannot be deleted. Please update your models to no longer reference this category and try again. ',
'create' => array(
'error' => 'Category was not created, please try again.',
'success' => 'Category created successfully.'
'error' => 'Kategorie nebyla vytvořena, zkuste to znovu prosím.',
'success' => 'Kategorie byla úspěšně vytvořena.'
),
'update' => array(
'error' => 'Category was not updated, please try again',
'success' => 'Category updated successfully.'
'error' => 'Kategorie nebyla aktualizována, zkuste to znovu prosím',
'success' => 'Kategorie aktualizována úspěšně.'
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this category?',
'error' => 'There was an issue deleting the category. Please try again.',
'success' => 'The category was deleted successfully.'
'confirm' => 'Opravdu chcete smazat tuto kategorii na trvalo?',
'error' => 'Vyskytl se problém při mazání kategorie. Zkuste to znovu prosím.',
'success' => 'Kategorie byla úspěšně smazána.'
)
);
+11
View File
@@ -0,0 +1,11 @@
<?php
return array(
'about_consumables_title' => 'About Consumables',
'about_consumables_text' => 'Consumables are anything purchased that will be used up over time. For example, printer ink or copier paper.',
'consumable_name' => 'Consumable Name',
'create' => 'Create Consumable',
'remaining' => 'Zbývá',
'total' => 'Celkem',
'update' => 'Update Consumable',
);
+36
View File
@@ -0,0 +1,36 @@
<?php
return array(
'does_not_exist' => 'Consumable does not exist.',
'create' => array(
'error' => 'Consumable was not created, please try again.',
'success' => 'Consumable created successfully.'
),
'update' => array(
'error' => 'Consumable was not updated, please try again',
'success' => 'Consumable updated successfully.'
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this accessory?',
'error' => 'There was an issue deleting the consumable. Please try again.',
'success' => 'The accessory was deleted successfully.'
),
'checkout' => array(
'error' => 'Consumable was not checked out, please try again',
'success' => 'Consumable checked out successfully.',
'user_does_not_exist' => 'That user is invalid. Please try again.'
),
'checkin' => array(
'error' => 'Consumable was not checked in, please try again',
'success' => 'Consumable checked in successfully.',
'user_does_not_exist' => 'That user is invalid. Please try again.'
)
);
+5
View File
@@ -0,0 +1,5 @@
<?php
return array(
'title' => 'Consumable Name',
);
+8 -8
View File
@@ -3,23 +3,23 @@
return array(
'does_not_exist' => 'Amortizační skupina neexistuje.',
'assoc_users' => 'This depreciation is currently associated with one or more models and cannot be deleted. Please delete the models, and then try deleting again. ',
'assoc_users' => 'Tato amortizace je momentálně spojena s jedním nebo více modely a nemůže být smazáno. Prosím smažte tyto modely a pak to zkuste znovu. ',
'create' => array(
'error' => 'Depreciation class was not created, please try again. :(',
'success' => 'Depreciation class created successfully. :)'
'error' => 'Skupina amrotizace nebyla vytvořena, zkuste to znovu. :(',
'success' => 'Skupina amrotizace úspěšně vytvořena. :)'
),
'update' => array(
'error' => 'Depreciation class was not updated, please try again',
'success' => 'Depreciation class updated successfully.'
'error' => 'Skupina amrotizace nebyla aktualizována, zkuste to znovu',
'success' => 'Skupina amrotizace úspěšně aktualizována.'
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this depreciation class?',
'error' => 'There was an issue deleting the depreciation class. Please try again.',
'success' => 'The depreciation class was deleted successfully.'
'confirm' => 'Opravdu chcete smazat tuto skupinu amrotizace?',
'error' => 'Vyskytl se problém při mazání skupiny amrotizace. Zkuste to znovu.',
'success' => 'Skupina amrotizace byla úspěšně smazána.'
)
);
+3 -3
View File
@@ -14,9 +14,9 @@ return array(
'delete' => array(
'confirm' => 'Určitě chcete odstranit tuto skupinu?',
'create' => 'There was an issue creating the group. Please try again.',
'update' => 'There was an issue updating the group. Please try again.',
'delete' => 'There was an issue deleting the group. Please try again.',
'create' => 'Vyskytl se problém s vytvářením skupiny. Zkuste to znovu.',
'update' => 'Vyskytl se problém s aktualizací skupiny. Zkuste to znovu.',
'delete' => 'Vyskytl se problém se smazáním skupiny. Zkuste to znovu.',
),
);
+9 -8
View File
@@ -2,12 +2,12 @@
return array(
'bulk_update' => 'Bulk Update Assets',
'bulk_update_help' => 'This form allows you to update multiple assets at once. Only fill in the fields you need to change. Any fields left blank will remain unchanged. ',
'bulk_update_warn' => 'You are about to edit the properties of :asset_count assets.',
'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.',
'checkedout_to' => 'Vydané komu',
'checkout_date' => 'Checkout Date',
'checkin_date' => 'Checkin Date',
'checkout_date' => 'Datum vydání',
'checkin_date' => 'Datum převzetí',
'checkout_to' => 'Vydat někomu',
'cost' => 'Pořizovací cena',
'create' => 'Vytvořit záznam majetku',
@@ -17,10 +17,11 @@ return array(
'default_location' => 'Výchozí umístění',
'eol_date' => 'Konec životnosti',
'eol_rate' => 'Míra ukončení životnosti',
'expected_checkin' => 'Expected Checkin Date',
'expires' => 'Expiruje',
'fully_depreciated' => 'Plně odepsané',
'help_checkout' => 'Pokud si přejete přiřadit majetek okamžitě, měli by jste ze seznamu stavů zvolit "Připraveno k přiděleni", nebo se může něco pokazit. ',
'mac_address' => 'MAC Address',
'help_checkout' => 'If you wish to assign this asset immediately, select "Ready to Deploy" from the status list above. ',
'mac_address' => 'MAC adresa',
'manufacturer' => 'Výrobce',
'model' => 'Model',
'months' => 'měsíce',
@@ -29,7 +30,7 @@ return array(
'order' => 'Č. objednávky',
'qr' => 'QR kód',
'requestable' => 'Uživatelé můžou požádat o tento majetek',
'select_statustype' => 'Select Status Type',
'select_statustype' => 'Zvolte typ stavu',
'serial' => 'Sériové číslo',
'status' => 'Stav',
'supplier' => 'Dodavatel',

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