Compare commits

...

127 Commits

Author SHA1 Message Date
snipe 265a896211 Bumped version 2017-02-22 22:38:33 -08:00
snipe f7e4fca70d Add model_number to accessory search 2017-02-22 22:34:56 -08:00
snipe bb4c443cd9 Added notes to custom report 2017-02-03 02:20:56 -08:00
snipe 7b1d2ee050 Fixed typo 2017-01-17 11:57:24 -08:00
snipe b3f70a046f Don’t require superadmin for checkin and delete user 2017-01-17 09:19:14 -08:00
morph027 734e87f85f Installer fine tuning (#2993)
* used shellcheck to lint snipeit.sh

* do not depend on lsb-release command

* add lsb codename

* really use perms()

* more fixes

* quiet apt

* silent logging using log()

* start mysql if not running

* added curl to ubuntu

* added logfile to log function

* update apt index after adding mariadb repo

* fixed typo

* review fixes
2017-01-10 23:07:06 -08:00
snipe f371c5fd62 Merge branch 'master' of github.com:snipe/snipe-it 2017-01-10 19:02:18 -08:00
snipe 4b3edbd2f5 Fixed #3130 - model ID not being saved weith model info on modal for create asset 2017-01-10 19:02:13 -08:00
Byron Wolfman 1f3106b9da Use debian base container and clean up apt-get (#3011)
* Use debian base container and clean up apt-get

Attempt to slim down the docker image by replacing ubuntu:trusty with debian:jessie and clean up after apt-get invocation. Building against the 3.6.0 commit shows a healthy reduction of 44MB, or 9%, compared to the ubuntu-based image.

* Use debian:jessie-slim for an even smaller image

If we're using a debian base image for sizing reasons, we may as well go the full distance and use debian-slim.
2017-01-10 16:22:06 -08:00
snipe 9fd3a9a82d Removed logging 2017-01-06 03:12:49 -08:00
snipe a6e6991a2d Removed second number_format 2017-01-06 03:11:27 -08:00
snipe 93ba0717d8 Removed number_format 2017-01-06 03:02:38 -08:00
snipe a8839e0ef4 Fixes #3104, #2914 and #2918 - auto-increment incorrectly generating next ID 2017-01-06 02:52:10 -08:00
snipe 3e4152c966 Bumped version 2017-01-06 00:04:26 -08:00
snipe 1bf34d73f5 Use correct authorize rule in middleware for user delete 2017-01-06 00:02:46 -08:00
snipe d1e360d64d Fix logic to use gate instead of asking if superuser 2017-01-06 00:02:19 -08:00
snipe 3b5b19848c Added oauth keys to gitignore 2017-01-06 00:01:55 -08:00
snipe 93ba90e837 Merge remote-tracking branch 'origin/develop' 2016-12-12 19:24:00 -08:00
snipe dd28c5709e Add action=“” to form (possible IE11 fix) 2016-12-12 19:23:41 -08:00
snipe fc70d79a17 Merge remote-tracking branch 'origin/develop' 2016-12-12 19:07:07 -08:00
snipe 42fe481f71 Bumped hash 2016-12-12 19:06:36 -08:00
snipe 95f1a98b96 Removed extraneous closing label tags 2016-12-12 19:03:45 -08:00
snipe 6f1e0d6d9f Updated readme with security notice 2016-12-12 19:03:12 -08:00
snipe ae66bba0f1 Fixes #3015 - increase size of state field in suppliers 2016-12-07 17:50:20 -08:00
snipe 32c5a258a7 Updated hash 2016-12-07 17:14:48 -08:00
snipe e7ac860f77 Supress error if pagination isn’t set up on the server 2016-12-07 17:07:48 -08:00
snipe 899a991a3b Added package.json 2016-12-07 17:07:07 -08:00
snipe f26d86dff2 Updated gulpfile 2016-12-07 17:06:48 -08:00
snipe 84317f7f50 Fixes #2990 - disabled autocomplete on login 2016-12-06 11:50:20 -08:00
snipe 65016a2383 Merge remote-tracking branch 'origin/develop' 2016-12-05 16:12:41 -08:00
snipe eb48e5ed1c Bumped hash 2016-12-05 16:12:05 -08:00
snipe dbcb2ccb46 Merge remote-tracking branch 'origin/develop' 2016-12-05 15:09:49 -08:00
Daniel Meltzer 927a12f78d Fix #2985. Missed in the field rename (#3014) 2016-12-05 15:09:14 -08:00
Brady Wetherington dd52b4828c Make .gitignore and .gitkeep files permissions match their directories (#3018) 2016-12-05 15:08:37 -08:00
snipe 6273e313bc Set DB_SSL to false for config 2016-12-03 17:33:36 -08:00
snipe 2afcfcc87c Set DB_SSL to false for config 2016-12-03 17:32:44 -08:00
snipe 1afef9416a Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	config/version.php
2016-12-03 17:15:02 -08:00
snipe 77685fd52b Bumped version 2016-12-03 17:13:09 -08:00
snipe f532abebd4 Updated translations 2016-12-03 17:10:05 -08:00
Brady Wetherington 6f9a82f4ea On a succesful LDAP user-creation, we should return the $user, not (#3008)
just 'true'.
2016-12-01 15:54:13 -08:00
snipe 4049143ebf Bumped version 2016-12-01 06:11:03 -08:00
snipe 4df53bdf8d Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	config/version.php
#	resources/views/account/view-assets.blade.php
2016-12-01 06:10:50 -08:00
snipe d49a1ea304 More graceful error message if log doesn’t exist 2016-12-01 06:05:14 -08:00
snipe 521f4facd5 Bumped version 2016-12-01 05:56:24 -08:00
snipe b4653dfc15 Ignore npm log 2016-12-01 05:55:29 -08:00
snipe 659d9c10ca Bumped hash 2016-12-01 05:54:21 -08:00
snipe 2ab0594530 Prevent errors if company support conflict prevents viewing the item 2016-12-01 05:54:14 -08:00
snipe 8a81b29901 Fixed missing closing angle bracket 2016-12-01 05:53:20 -08:00
snipe 93d9a6e4bb Ignore npm log 2016-12-01 05:52:50 -08:00
snipe 99e79a02d6 Revert "Halp! Stuck in pre-commit loop hell. :("
This reverts commit 47c77fe042.
2016-12-01 03:08:14 -08:00
snipe 47c77fe042 Halp! Stuck in pre-commit loop hell. :( 2016-12-01 03:07:47 -08:00
snipe e42da293ee Updated version for pre-release 2016-12-01 03:07:21 -08:00
snipe a2ffe77d55 Automatically updated version hash 2016-12-01 03:07:12 -08:00
snipe a7a9f027fb Automatically updated version hash 2016-12-01 03:00:18 -08:00
snipe e587b2dcee Automatically updated version hash 2016-12-01 03:00:02 -08:00
snipe c3b4342df4 Automatically updated version hash 2016-12-01 02:59:17 -08:00
snipe 5a7ea0e908 Updated hash 2016-12-01 02:59:11 -08:00
snipe 59617cc7d3 Updated version in settings 2016-12-01 02:57:47 -08:00
snipe 1be22cf051 Improved versioning script 2016-12-01 02:53:41 -08:00
snipe e62f3f9fb4 Bumped hash 2016-12-01 02:27:12 -08:00
snipe 7ccef51a4f Removed some dumb comments 2016-12-01 02:25:53 -08:00
snipe 4c418bf622 Remove unused $request variable 2016-12-01 02:13:00 -08:00
snipe 16cfdbaa93 Redirect the lost password success back to login 2016-12-01 02:04:43 -08:00
snipe 3f8f6ad981 Fixes #2995 - adds max login attempts/duration as .env option 2016-12-01 02:04:15 -08:00
snipe d8d800bb7a Fixes #2997 - don’t include soft-deleted maintenances 2016-12-01 00:55:00 -08:00
snipe 5bca1ed2b6 Allow supression of debug warning for demo 2016-12-01 00:48:43 -08:00
snipe 68b9ffb908 Only allow login via LDAP if the user was already imported or created via LDAP 2016-12-01 00:29:45 -08:00
snipe d03c167d3b Switch string to product key 2016-12-01 00:15:48 -08:00
snipe 2ec7c0bf1d Hide edit actions from asset sidebar if user cannot edit assets 2016-12-01 00:00:48 -08:00
snipe 7513c99dd0 Fixed supplier string in hardware view 2016-11-30 23:19:13 -08:00
snipe 6c366eb112 Fixes potential login issue if password syncing is set to true 2016-11-30 20:39:43 -08:00
snipe 820d37cabb Custom logging to only show debug info if the app is in debug mode
or if the user has overridden the APP_LOG_LEVEL in their env
2016-11-30 20:38:46 -08:00
snipe b614470b21 Updated serial text to product key 2016-11-29 21:45:49 -08:00
snipe ce056c39e5 Removed requirement for serial number
Some folks will use a license file instead
2016-11-29 14:06:33 -08:00
snipe b6ffb8b3df Protect edit route as well 2016-11-29 13:40:00 -08:00
snipe f5e100a6a5 Only allow asset files to be deleted, maintenances to be added if user has assets.edit permission 2016-11-29 13:37:45 -08:00
snipe abcc01f5e0 More language string corrections 2016-11-29 12:48:00 -08:00
snipe 4dbe8fad30 More language string fixes 2016-11-29 08:46:33 -08:00
snipe 7bf1664b8f Allow XML mimetypes 2016-11-29 08:01:08 -08:00
snipe 92ace8582d Fixed notes column header language string 2016-11-29 07:57:02 -08:00
snipe 507040976a Fixed incorrect license field text strings 2016-11-29 07:52:00 -08:00
snipe b0d8711002 Add .lic as possible license file type 2016-11-29 07:22:45 -08:00
snipe 227ac94aa2 Bumped version hash 2016-11-29 06:21:37 -08:00
snipe 53404f3d1c Fixes asset model clone 2016-11-29 06:16:52 -08:00
snipe f605821143 Remove unneeded use statements 2016-11-29 06:14:33 -08:00
snipe cab331f3f8 Link model name in category view 2016-11-29 06:14:20 -08:00
snipe eb340b0fa9 Add fieldset to asset model listing 2016-11-29 06:06:52 -08:00
snipe 3acc4065ce Merge branch 'develop' of github.com:snipe/snipe-it into develop 2016-11-29 05:19:24 -08:00
snipe 2ce67e9443 Derp. 2016-11-29 05:19:18 -08:00
Daniel Meltzer 263f19bdad Fix error in partializing with creating an asset maintenance. (#2987) 2016-11-29 05:02:48 -08:00
snipe 4fc88f673d Only check if table exists if there is not a value for the static cache yet 2016-11-29 05:02:14 -08:00
snipe c72954b671 Fixes #2959 - fixed error with custom fields not populating correctly 2016-11-29 01:59:18 -08:00
snipe dbb2b62223 Fixed cranky Codacy result 2016-11-29 01:44:24 -08:00
snipe 7393f0bbea Fixes snipeSettings error if the user was created but the settings table isn’t populated yet 2016-11-29 01:20:51 -08:00
snipe 2603488bd6 Removed settings middlware
(Already handled via AppServiceProvider)
2016-11-29 01:19:52 -08:00
snipe 81a0e06c40 Automatically log the user in after user creation 2016-11-29 01:19:25 -08:00
snipe 0d6b160b61 Fix mail test script 2016-11-29 01:19:05 -08:00
snipe 16a24b7fb8 Use getSettings() to check for locale to take advantage of cached value 2016-11-29 00:21:58 -08:00
snipe ba23952852 Add red banner if app is in production mode and debugging is turned on 2016-11-29 00:08:20 -08:00
snipe 4c08331c9d Get settings in middleware, makr available in views 2016-11-28 22:53:16 -08:00
snipe cc943e22db Fixes #2970
Should probably override this later using the global settings variable
2016-11-28 22:38:11 -08:00
snipe 6bb5555a73 Fixes #2980 - enable MySQL SSL settings 2016-11-28 19:25:26 -08:00
Daniel Meltzer 3592bdb2e1 Assocate a locations asset with User, not log. (#2973)
This fixes an issue where locations could not be deleted if at any point
they had an associated log entry.  Fixes #2916
2016-11-24 12:48:22 -08:00
Daniel Meltzer b8cbf0022e Log fixes (#2972)
* Make sure we set target_type when creating an accept asset log, and add a migration to fix older ones.

* On a declined log, we don't have an assigned user.

 Guard against this conditional (which realistically should never be hit?)
Should fix #2940

* Fix codacy issues with migration.
2016-11-24 12:48:14 -08:00
Brady Wetherington dd3718489a Attempt to fix #2961. Also inadvertently added the ability to rename (#2974)
and delete custom fields, as well. Bonus!
2016-11-24 12:48:03 -08:00
Daniel Meltzer 7214920563 Update index.blade.php (#2963)
Asset maintences should be searchable.
2016-11-23 06:15:40 -08:00
Daniel Meltzer 8c549c47e4 Update bootstrap-table.blade.php (#2964)
Fix error when search is not passed through.
2016-11-23 05:56:08 -08:00
snipe 45c789021e Add employee number option to custom report 2016-11-23 05:17:54 -08:00
snipe 1d2ae84572 Fixes #2953 - re-adding the CoC 2016-11-21 18:51:42 -08:00
snipe 54dec2147c Merge branch 'develop' of github.com:snipe/snipe-it into develop 2016-11-21 18:40:38 -08:00
snipe bc84f80e20 Check if sig_filename exists 2016-11-21 18:40:26 -08:00
Daniel Meltzer ac9fd3b3bb Update LicensesController.php (#2948)
* Update LicensesController.php

Should fix #2939.  Cannot test at the moment, so please check :)

* Add delete tests.  Improve test item generation.

* Add relationship here.

* Fix some issues with seeding.
2016-11-20 19:59:57 -08:00
snipe d8eb68af83 Merge branch 'hotfixes/accessory_model_number' into develop
# Conflicts:
#	resources/views/accessories/edit.blade.php
2016-11-17 20:01:01 -08:00
snipe dcc000284f Add accessory model to accessories 2016-11-17 20:00:08 -08:00
snipe d0d9d82579 Add model number to accessories 2016-11-17 19:57:53 -08:00
snipe 54848b5edf Added enum conversion 2016-11-17 16:56:08 -08:00
snipe eb4562a28b Add enum conversation
Tho I don’t know why we need this. I don’t see any enums left in the DB structure.
2016-11-17 16:55:22 -08:00
snipe e8f45555ff Make length match validation 2016-11-17 16:18:39 -08:00
snipe 554a6e4fd6 Make length match validation 2016-11-17 16:18:15 -08:00
snipe 7efe3a3207 Merge branch 'hotfixes/state_length' into develop 2016-11-17 16:16:47 -08:00
snipe f77cb3d0f5 Increase DB size of state field in locations 2016-11-17 16:16:33 -08:00
Daniel Meltzer 55ccc000eb Fix loggable checkin (#2935)
* Log the user items are checked in from

This restores functionality that was lost in the port to loggable.
I'd still like to figure out a better term for the table, currently it says to, but I wonder if target is a better choice?

* Fix display of remaining seats on license view
2016-11-17 15:54:29 -08:00
snipe 19592814d9 Merge branch 'hotfixes/purchase_cost_standardized' into develop 2016-11-16 17:35:03 -08:00
snipe 5c70898dbf Derp. Not a string. 2016-11-16 17:32:25 -08:00
snipe 08c7701f17 Make purchase cost longer and more standardized 2016-11-16 17:31:11 -08:00
Daniel Meltzer d722ed3823 Partialize forms (#2884)
* Consolidate edit form elements into reusable partials.

This is a large code change that doesn't do much immediately.  It
refactors all of the various edit.blade.php files to reference
standardized partials, so that they all reference the same base html
layout. This has the side effect of moving everything to the new fancy
"required" indicators, and making things look consistent.

In addition, I've gone ahead and renamed a few database fields.  We had
Assetmodel::modelno and Consumable::model_no, I've renamed both to
model_number.  We had items using ::note and ::notes, I've standardized
on ::notes.  Component used total_qty where consumables and accessories
used qty, so I've moved everything to qty (And fixed a few bugs in the
helper file in the process.

TODO includes looking at how/where to place the modal javascripts to
allow for on the fly creation from all places, rather than just the
asset page.

Rename assetmodel::modelno to model_number for clarity and consistency

Rename consumable::model_no to model_number for clarity and consistency

Rename assetmodel::note to notes for clarity and consistency

Port asset and assetmodel to new partials layout.  Adapt all code to the renamed model_number and notes database changes.  Fix some stying.

* Share a settings variable with all views.

* Allow editing the per_page setting.  We showed the value, but we never showed it on the edit page..

* use snipeSettings in all views instead of the long ugly path.

* War on partials. Centralize all bootstrap table javascript

* Use model_number instead of modelno in importer

* Codacy fix.

* More unification/deduplication.  Create an edit form template layout that we use as the base for all edit forms.  This gives the same interface for editing everything and makes the edit.blade.* files much easier to read.

* Use a ViewComposer instead of sharing the variable directly.  Fixes artisan optimize trying to hit the db--which ruins new installs

* Fix DB seeder.

* Base sql dump and csv's to import data from for tests.

* Start some functional tests for creating items.

* Add functional tests for all create methods.  Still need to do tests for edits, deletes, and lots of other things

* Improvements to functional tests.

Use the built in DB seeding mechanism instead of doing it ourselves.
Break the tests into multiple units, rather than testing everything in
each function.

* Some improvements to acceptance tests.

Make sure we're only looking at the "trs" within the bootstrap table.
Creation of assets is now tested at the functional level (and is faster)
so ignore it here.

I'm testing acceptance tests with the
IMPORT_{ASSETS,ACCESSORIES,CONSUMABLES}.csv in the tests/_data folder
imported.

* A few things to make acceptance tests work.  Add a name to the companies table, and make the locations table have the correct name

* Use a .env.tests file for testing functional and unit to allow a separate database.

* Add functional tests for compoents, groups, and licenses.

* Now that the config is in the functional.yml, this just confuses things.

* Start some functional tests for creating items.

* Add functional tests for all create methods.  Still need to do tests for edits, deletes, and lots of other things

* Improvements to functional tests.

Use the built in DB seeding mechanism instead of doing it ourselves.
Break the tests into multiple units, rather than testing everything in
each function.

* Some improvements to acceptance tests.

Make sure we're only looking at the "trs" within the bootstrap table.
Creation of assets is now tested at the functional level (and is faster)
so ignore it here.

I'm testing acceptance tests with the
IMPORT_{ASSETS,ACCESSORIES,CONSUMABLES}.csv in the tests/_data folder
imported.

* update db dump

* Update tests to new reality

* env for the test setup

* only load the database at beginning of tests, not between each Functional test.

* Fix a miss from renaming note to notes.

* Set Termination date when creating an asset.  It was only set on edit.

* Rename serial_number to serial in components for consistency.

* Update validation rules to match limits in database.  Currently we just accepted the values and they were truncated when adding to DB.

* Much more detailed functional testing of creating items.  This checks to make sure all values on form have been successfully persisted to database.
2016-11-16 16:56:57 -08:00
snipe 84e06f4642 Add postal code to locations listing 2016-11-16 08:22:54 -08:00
1048 changed files with 8876 additions and 7419 deletions
+15
View File
@@ -20,6 +20,16 @@ DB_PASSWORD=null
DB_PREFIX=null
DB_DUMP_PATH='/usr/bin'
# --------------------------------------------
# OPTIONAL: SSL DATABASE SETTINGS
# --------------------------------------------
DB_SSL=false
DB_SSL_KEY_PATH=null
DB_SSL_CERT_PATH=null
DB_SSL_CA_PATH=null
DB_SSL_CIPHER=null
# --------------------------------------------
# REQUIRED: OUTGOING MAIL SERVER SETTINGS
# --------------------------------------------
@@ -69,6 +79,11 @@ AWS_KEY=null
AWS_REGION=null
AWS_BUCKET=null
# --------------------------------------------
# OPTIONAL: LOGIN THROTTLING
# --------------------------------------------
LOGIN_MAX_ATTEMPTS=5
LOGIN_LOCKOUT_DURATION=60
# --------------------------------------------
# OPTIONAL: MISC
+9
View File
@@ -0,0 +1,9 @@
APP_ENV=local
APP_DEBUG=true
APP_URL=http://snipe-it.localapp
DB_CONNECTION=mysql
DB_HOST=localhost
DB_DATABASE=snipeittests
DB_USERNAME=snipeit
DB_PASSWORD=snipe
APP_KEY=base64:tu9NRh/a6+dCXBDGvg0Gv/0TcABnFsbT4AKxrr8mwQo=
+3
View File
@@ -37,3 +37,6 @@ storage/private_uploads/users/*
tests/_data/scenarios
tests/_output/*
tests/_support/_generated/*
/npm-debug.log
/storage/oauth-private.key
/storage/oauth-public.key
+74
View File
@@ -0,0 +1,74 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
+4 -2
View File
@@ -1,4 +1,4 @@
FROM ubuntu:trusty
FROM debian:jessie-slim
MAINTAINER Brady Wetherington <uberbrady@gmail.com>
RUN apt-get update && apt-get install -y \
@@ -13,7 +13,9 @@ patch \
curl \
vim \
git \
mysql-client
mysql-client \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN php5enmod mcrypt
RUN php5enmod gd
+4
View File
@@ -53,3 +53,7 @@ Please see the documentation on [contributing and developing for Snipe-IT](https
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.
### Security
To report a security vulnerability, please email security@snipeitapp.com instead of using the issue tracker.
+3 -3
View File
@@ -100,7 +100,7 @@ class ObjectImportCommand extends Command
$this->locations = Location::All(['name', 'id']);
$this->categories = Category::All(['name', 'category_type', 'id']);
$this->manufacturers = Manufacturer::All(['name', 'id']);
$this->asset_models = AssetModel::All(['name','modelno','category_id','manufacturer_id', 'id']);
$this->asset_models = AssetModel::All(['name','model_number','category_id','manufacturer_id', 'id']);
$this->companies = Company::All(['name', 'id']);
$this->status_labels = Statuslabel::All(['name', 'id']);
$this->suppliers = Supplier::All(['name', 'id']);
@@ -348,7 +348,7 @@ class ObjectImportCommand extends Command
$editingModel = false;
foreach ($this->asset_models as $tempmodel) {
if (strcasecmp($tempmodel->name, $asset_model_name) == 0
&& $tempmodel->modelno == $asset_modelno) {
&& $tempmodel->model_number == $asset_modelno) {
$this->log('A matching model ' . $asset_model_name . ' already exists');
if (!$this->option('update')) {
return $tempmodel;
@@ -366,7 +366,7 @@ class ObjectImportCommand extends Command
$asset_model->name = $asset_model_name;
}
isset($manufacturer) && $manufacturer->exists && $asset_model->manufacturer_id = $manufacturer->id;
isset($asset_modelno) && $asset_model->modelno = $asset_modelno;
isset($asset_modelno) && $asset_model->model_number = $asset_modelno;
if (isset($category) && $category->exists) {
$asset_model->category_id = $category->id;
}
+11 -13
View File
@@ -40,20 +40,19 @@ class Versioning extends Command
*/
public function fire()
{
// Path to the file containing your version
// This will be overwritten everything you commit a message
$versionFile = 'config/version.php';
$hash_version = str_replace("\n",'',shell_exec('git describe --tags'));
// The git's output
// get the argument passed in the git command
$hash_version = $this->argument('app_version');
$version = explode('-', $hash_version);
// discard the commit hash
$version = explode('-', $hash_version);
$realVersion = $version[0];
// save the version array to a variable
$array = var_export(array('app_version' => $realVersion,'hash_version' => $hash_version), true);
$array = var_export(
array(
'app_version' => $version[0],
'build_version' => $version[1],
'hash_version' => $version[2],
'full_hash' => $hash_version),
true);
// Construct our file content
@@ -64,7 +63,7 @@ CON;
// And finally write the file and output the current version
\File::put($versionFile, $content);
$this->line('Setting version: '. \config('version.latest'));
$this->line('Setting version: '. config('version.app_version').' build '.config('version.build_version').' ('.config('version.hash_version').')');
}
/**
@@ -75,7 +74,6 @@ CON;
protected function getArguments()
{
return array(
array('app_version', InputArgument::REQUIRED, 'version number is required.'),
);
}
+6 -6
View File
@@ -434,8 +434,8 @@ class Helper
foreach ($consumables as $consumable) {
$avail = $consumable->numRemaining();
if ($avail < ($consumable->min_amt) + \App\Models\Setting::getSettings()->alert_threshold) {
if ($consumable->total_qty > 0) {
$percent = number_format((($consumable->numRemaining() / $consumable->total_qty) * 100), 0);
if ($consumable->qty > 0) {
$percent = number_format((($consumable->numRemaining() / $consumable->qty) * 100), 0);
} else {
$percent = 100;
}
@@ -456,8 +456,8 @@ class Helper
$avail = $accessory->numRemaining();
if ($avail < ($accessory->min_amt) + \App\Models\Setting::getSettings()->alert_threshold) {
if ($accessory->total_qty > 0) {
$percent = number_format((($accessory->numRemaining() / $accessory->total_qty) * 100), 0);
if ($accessory->qty > 0) {
$percent = number_format((($accessory->numRemaining() / $accessory->qty) * 100), 0);
} else {
$percent = 100;
}
@@ -476,8 +476,8 @@ class Helper
foreach ($components as $component) {
$avail = $component->numRemaining();
if ($avail < ($component->min_amt) + \App\Models\Setting::getSettings()->alert_threshold) {
if ($component->total_qty > 0) {
$percent = number_format((($component->numRemaining() / $component->total_qty) * 100), 0);
if ($component->qty > 0) {
$percent = number_format((($component->numRemaining() / $component->qty) * 100), 0);
} else {
$percent = 100;
}
+12 -9
View File
@@ -7,19 +7,19 @@ use App\Models\Actionlog;
use App\Models\Company;
use App\Models\Setting;
use App\Models\User;
use Auth;
use Carbon\Carbon;
use Config;
use DB;
use Gate;
use Input;
use Lang;
use Mail;
use Redirect;
use Request;
use Slack;
use Str;
use View;
use Auth;
use Request;
use Gate;
/** This controller handles all actions related to Accessories for
* the Snipe-IT Asset Management application.
@@ -54,7 +54,7 @@ class AccessoriesController extends Controller
{
// Show the page
return View::make('accessories/edit')
->with('accessory', new Accessory)
->with('item', new Accessory)
->with('category_list', Helper::categoryList('accessory'))
->with('company_list', Helper::companyList())
->with('location_list', Helper::locationsList())
@@ -82,6 +82,7 @@ class AccessoriesController extends Controller
$accessory->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
$accessory->order_number = e(Input::get('order_number'));
$accessory->manufacturer_id = e(Input::get('manufacturer_id'));
$accessory->model_number = e(Input::get('model_number'));
if (e(Input::get('purchase_date')) == '') {
$accessory->purchase_date = null;
@@ -119,14 +120,14 @@ class AccessoriesController extends Controller
public function getEdit(Request $request, $accessoryId = null)
{
// Check if the accessory exists
if (is_null($accessory = Accessory::find($accessoryId))) {
if (is_null($item = Accessory::find($accessoryId))) {
// Redirect to the blogs management page
return redirect()->to('admin/accessories')->with('error', trans('admin/accessories/message.does_not_exist'));
} elseif (!Company::isCurrentUserHasAccess($accessory)) {
} elseif (!Company::isCurrentUserHasAccess($item)) {
return redirect()->to('admin/accessories')->with('error', trans('general.insufficient_permissions'));
}
return View::make('accessories/edit', compact('accessory'))
return View::make('accessories/edit', compact('item'))
->with('category_list', Helper::categoryList('accessory'))
->with('company_list', Helper::companyList())
->with('location_list', Helper::locationsList())
@@ -164,6 +165,7 @@ class AccessoriesController extends Controller
$accessory->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
$accessory->manufacturer_id = e(Input::get('manufacturer_id'));
$accessory->order_number = e(Input::get('order_number'));
$accessory->model_number = e(Input::get('model_number'));
if (e(Input::get('purchase_date')) == '') {
$accessory->purchase_date = null;
@@ -427,8 +429,8 @@ class AccessoriesController extends Controller
return redirect()->to('admin/accessories')->with('error', trans('general.insufficient_permissions'));
}
$logaction = $accessory->logCheckin(e(Input::get('note')));
$return_to = e($accessory_user->assigned_to);
$logaction = $accessory->logCheckin(User::find($return_to), e(Input::get('note')));
$admin_user = Auth::user();
@@ -552,7 +554,7 @@ class AccessoriesController extends Controller
}
$allowed_columns = ['name','min_amt','order_number','purchase_date','purchase_cost','companyName','category'];
$allowed_columns = ['name','min_amt','order_number','purchase_date','purchase_cost','companyName','category','model_number'];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? e(Input::get('sort')) : 'created_at';
@@ -594,6 +596,7 @@ class AccessoriesController extends Controller
$rows[] = array(
'name' => '<a href="'.url('admin/accessories/'.$accessory->id).'/view">'. $accessory->name.'</a>',
'category' => ($accessory->category) ? (string)link_to('admin/settings/categories/'.$accessory->category->id.'/view', $accessory->category->name) : '',
'model_number' => e($accessory->model_number),
'qty' => e($accessory->qty),
'order_number' => e($accessory->order_number),
'min_amt' => e($accessory->min_amt),
@@ -21,6 +21,7 @@ use App\Models\Setting;
use App\Models\Asset;
use App\Helpers\Helper;
use Auth;
use Gate;
/**
* This controller handles all actions related to Asset Maintenance for
@@ -75,8 +76,7 @@ class AssetMaintenancesController extends Controller
*/
public function getDatatable()
{
$maintenances = AssetMaintenance::with('asset', 'supplier', 'asset.company','admin')
->withTrashed();
$maintenances = AssetMaintenance::with('asset', 'supplier', 'asset.company','admin');
if (Input::has('search')) {
$maintenances = $maintenances->TextSearch(e(Input::get('search')));
@@ -119,8 +119,12 @@ class AssetMaintenancesController extends Controller
$settings = Setting::getSettings();
foreach ($maintenances as $maintenance) {
$actions = '<nobr><a href="'.route('update/asset_maintenance', $maintenance->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/asset_maintenance', $maintenance->id).'" data-content="'.trans('admin/asset_maintenances/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($maintenance->title).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></nobr>';
$actions = '';
if (Gate::allows('assets.edit')) {
$actions .= '<nobr><a href="' . route('update/asset_maintenance',
$maintenance->id) . '" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="' . route('delete/asset_maintenance',
$maintenance->id) . '" data-content="' . trans('admin/asset_maintenances/message.delete.confirm') . '" data-title="' . trans('general.delete') . ' ' . htmlspecialchars($maintenance->title) . '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></nobr>';
}
if (($maintenance->cost) && (isset($maintenance->asset)) && ($maintenance->asset->assetloc) && ($maintenance->asset->assetloc->currency!='')) {
$maintenance_cost = $maintenance->asset->assetloc->currency.$maintenance->cost;
@@ -178,7 +182,7 @@ class AssetMaintenancesController extends Controller
->with('selectedAsset', $selectedAsset)
->with('supplier_list', $supplier_list)
->with('assetMaintenanceType', $assetMaintenanceType)
->with('assetMaintenance', new AssetMaintenance);
->with('item', new AssetMaintenance);
}
/**
@@ -317,7 +321,7 @@ class AssetMaintenancesController extends Controller
->with('selectedAsset', null)
->with('supplier_list', $supplier_list)
->with('assetMaintenanceType', $assetMaintenanceType)
->with('assetMaintenance', $assetMaintenance);
->with('item', $assetMaintenance);
}
+18 -20
View File
@@ -6,11 +6,8 @@ use Input;
use Lang;
use App\Models\AssetModel;
use Redirect;
use App\Models\Setting;
use Auth;
use DB;
use App\Models\Depreciation;
use App\Models\Manufacturer;
use Str;
use Validator;
use View;
@@ -62,7 +59,7 @@ class AssetModelsController extends Controller
->with('category_list', $category_list)
->with('depreciation_list', $depreciation_list)
->with('manufacturer_list', $manufacturer_list)
->with('model', new AssetModel);
->with('item', new AssetModel);
}
@@ -94,10 +91,10 @@ class AssetModelsController extends Controller
// Save the model data
$model->name = e(Input::get('name'));
$model->modelno = e(Input::get('modelno'));
$model->model_number = e(Input::get('model_number'));
$model->manufacturer_id = e(Input::get('manufacturer_id'));
$model->category_id = e(Input::get('category_id'));
$model->note = e(Input::get('note'));
$model->notes = e(Input::get('notes'));
$model->user_id = Auth::user()->id;
$model->requestable = Input::has('requestable');
@@ -146,9 +143,9 @@ class AssetModelsController extends Controller
$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->model_number = e(Input::get('model_number'));
$model->user_id = Auth::user()->id;
$model->note = e(Input::get('note'));
$model->notes = e(Input::get('notes'));
$model->eol= null;
if (Input::get('fieldset_id')=='') {
@@ -176,7 +173,7 @@ class AssetModelsController extends Controller
public function getEdit($modelId = null)
{
// Check if the model exists
if (is_null($model = AssetModel::find($modelId))) {
if (is_null($item = AssetModel::find($modelId))) {
// Redirect to the model management page
return redirect()->to('assets/models')->with('error', trans('admin/models/message.does_not_exist'));
}
@@ -184,7 +181,8 @@ class AssetModelsController extends Controller
$depreciation_list = Helper::depreciationList();
$manufacturer_list = Helper::manufacturerList();
$category_list = Helper::categoryList('asset');
$view = View::make('models/edit', compact('model'));
$view = View::make('models/edit', compact('item'));
$view->with('category_list', $category_list);
$view->with('depreciation_list', $depreciation_list);
$view->with('manufacturer_list', $manufacturer_list);
@@ -221,13 +219,12 @@ class AssetModelsController extends Controller
} else {
$model->eol = e(Input::get('eol'));
}
// Update the model data
$model->name = e(Input::get('name'));
$model->modelno = e(Input::get('modelno'));
$model->model_number = e(Input::get('model_number'));
$model->manufacturer_id = e(Input::get('manufacturer_id'));
$model->category_id = e(Input::get('category_id'));
$model->note = e(Input::get('note'));
$model->notes = e(Input::get('notes'));
$model->requestable = Input::has('requestable');
@@ -381,7 +378,7 @@ class AssetModelsController extends Controller
$view->with('category_list', $category_list);
$view->with('depreciation_list', $depreciation_list);
$view->with('manufacturer_list', $manufacturer_list);
$view->with('model', $model);
$view->with('item', $model);
$view->with('clone_model', $model_to_clone);
return $view;
@@ -398,7 +395,7 @@ class AssetModelsController extends Controller
*/
public function getCustomFields($modelId)
{
$model=AssetModel::find($modelId);
$model = AssetModel::find($modelId);
return View::make("models.custom_fields_form")->with("model", $model);
}
@@ -442,7 +439,7 @@ class AssetModelsController extends Controller
}
$allowed_columns = ['id','name','modelno'];
$allowed_columns = ['id','name','model_number'];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? e(Input::get('sort')) : 'created_at';
@@ -465,12 +462,13 @@ class AssetModelsController extends Controller
'manufacturer' => (string)link_to('/admin/settings/manufacturers/'.$model->manufacturer->id.'/view', $model->manufacturer->name),
'name' => (string)link_to('/hardware/models/'.$model->id.'/view', $model->name),
'image' => ($model->image!='') ? '<img src="'.config('app.url').'/uploads/models/'.$model->image.'" height=50 width=50>' : '',
'modelnumber' => $model->modelno,
'modelnumber' => $model->model_number,
'numassets' => $model->assets->count(),
'depreciation' => (($model->depreciation)&&($model->depreciation->id > 0)) ? $model->depreciation->name.' ('.$model->depreciation->months.')' : trans('general.no_depreciation'),
'category' => ($model->category) ? $model->category->name : '',
'depreciation' => (($model->depreciation) && ($model->depreciation->id > 0)) ? $model->depreciation->name.' ('.$model->depreciation->months.')' : trans('general.no_depreciation'),
'category' => ($model->category) ? (string)link_to('admin/settings/categories/'.$model->category->id.'/view', $model->category->name) : '',
'eol' => ($model->eol) ? $model->eol.' '.trans('general.months') : '',
'note' => $model->getNote(),
'note' => $model->getNote(),
'fieldset' => ($model->fieldset) ? (string)link_to('admin/custom_fields/'.$model->fieldset->id, $model->fieldset->name) : '',
'actions' => $actions
);
}
+6 -6
View File
@@ -124,7 +124,7 @@ class AssetsController extends Controller
$view->with('statuslabel_list', $statuslabel_list);
$view->with('assigned_to', $assigned_to);
$view->with('location_list', $location_list);
$view->with('asset', new Asset);
$view->with('item', new Asset);
$view->with('manufacturer', $manufacturer_list);
$view->with('category', $category_list);
$view->with('statuslabel_types', $statuslabel_types);
@@ -290,10 +290,10 @@ class AssetsController extends Controller
{
// Check if the asset exists
if (!$asset = Asset::find($assetId)) {
if (!$item = Asset::find($assetId)) {
// Redirect to the asset management page
return redirect()->to('hardware')->with('error', trans('admin/hardware/message.does_not_exist'));
} elseif (!Company::isCurrentUserHasAccess($asset)) {
} elseif (!Company::isCurrentUserHasAccess($item)) {
return redirect()->to('hardware')->with('error', trans('general.insufficient_permissions'));
}
@@ -308,7 +308,7 @@ class AssetsController extends Controller
$assigned_to = Helper::usersList();
$statuslabel_types =Helper::statusTypeList();
return View::make('hardware/edit', compact('asset'))
return View::make('hardware/edit', compact('item'))
->with('model_list', $model_list)
->with('supplier_list', $supplier_list)
->with('company_list', $company_list)
@@ -1038,7 +1038,7 @@ class AssetsController extends Controller
->with('statuslabel_list', $statuslabel_list)
->with('statuslabel_types', $statuslabel_types)
->with('assigned_to', $assigned_to)
->with('asset', $asset)
->with('item', $asset)
->with('location_list', $location_list)
->with('manufacturer', $manufacturer_list)
->with('category', $category_list)
@@ -1798,7 +1798,7 @@ class AssetsController extends Controller
'asset_tag' => '<a title="'.e($asset->asset_tag).'" href="hardware/'.$asset->id.'/view">'.e($asset->asset_tag).'</a>',
'serial' => e($asset->serial),
'model' => ($asset->model) ? (string)link_to('/hardware/models/'.$asset->model->id.'/view', e($asset->model->name)) : 'No model',
'model_number' => ($asset->model && $asset->model->modelno) ? (string)$asset->model->modelno : '',
'model_number' => ($asset->model && $asset->model->model_number) ? (string)$asset->model->model_number : '',
'status_label' => ($asset->assigneduser) ? 'Deployed' : ((e($asset->assetstatus)) ? e($asset->assetstatus->name) : ''),
'assigned_to' => ($asset->assigneduser) ? (string)link_to(config('app.url').'/admin/users/'.$asset->assigned_to.'/view', e($asset->assigneduser->fullName())) : '',
'location' => (($asset->assigneduser) && ($asset->assigneduser->userloc!='')) ? (string)link_to('admin/settings/locations/'.$asset->assigneduser->userloc->id.'/view', e($asset->assigneduser->userloc->name)) : (($asset->defaultLoc!='') ? (string)link_to('admin/settings/locations/'.$asset->defaultLoc->id.'/view', e($asset->defaultLoc->name)) : ''),
+48 -11
View File
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Auth;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
use App\Models\Setting;
use App\Models\Ldap;
use App\Models\User;
@@ -30,7 +31,7 @@ use PragmaRX\Google2FA\Google2FA;
class AuthController extends Controller
{
use ThrottlesLogins;
use AuthenticatesAndRegistersUsers, ThrottlesLogins;
// This tells the auth controller to use username instead of email address
protected $username = 'username';
@@ -55,15 +56,13 @@ class AuthController extends Controller
function showLoginForm()
{
// Is the user logged in?
if (Auth::check()) {
return redirect()->intended('dashboard');
}
// Show the page
return View::make('auth.login');
}
private function login_via_ldap(Request $request)
{
LOG::debug("Binding user to LDAP.");
@@ -75,8 +74,8 @@ class AuthController extends Controller
LOG::debug("LDAP user ".$request->input('username')." successfully bound to LDAP");
}
// Check if the user exists in the database
$user = User::where('username', '=', Input::get('username'))->whereNull('deleted_at')->first();
// Check if the user already exists in the database and was imported via LDAP
$user = User::where('username', '=', Input::get('username'))->whereNull('deleted_at')->where('ldap_import','=',1)->first();
LOG::debug("Local auth lookup complete");
// The user does not exist in the database. Try to get them from LDAP.
@@ -123,17 +122,33 @@ class AuthController extends Controller
if ($validator->fails()) {
return redirect()->back()->withInput()->withErrors($validator);
}
// If the class is using the ThrottlesLogins trait, we can automatically throttle
// the login attempts for this application. We'll key this by the username and
// the IP address of the client making these requests into this application.
$throttles = $this->isUsingThrottlesLoginsTrait();
$this->maxLoginAttempts = config('auth.throttle.max_attempts');
$this->lockoutTime = config('auth.throttle.lockout_duration');
if ($throttles && $lockedOut = $this->hasTooManyLoginAttempts($request)) {
$this->fireLockoutEvent($request);
return $this->sendLockoutResponse($request);
}
$user = null;
// Should we even check for LDAP users?
if (Setting::getSettings()->ldap_enabled=='1') {
LOG::debug("LDAP is enabled.");
try {
$user = $this->login_via_ldap($request);
Auth::login($user, true);
// If the user was unable to login via LDAP, log the error and let them fall through to
// local authentication.
} catch (\Exception $e) {
if(Setting::getSettings()->ldap_pw_sync!='1') {
return redirect()->back()->withInput()->with('error',$e->getMessage());
}
LOG::error("There was an error authenticating the LDAP user: ".$e->getMessage());
}
}
@@ -142,8 +157,17 @@ class AuthController extends Controller
LOG::debug("Authenticating user against database.");
// Try to log the user in
if (!Auth::attempt(Input::only('username', 'password'), Input::get('remember-me', 0))) {
if ($throttles && ! $lockedOut) {
$this->incrementLoginAttempts($request);
}
LOG::debug("Local authentication failed.");
return redirect()->back()->withInput()->with('error', trans('auth/message.account_not_found'));
} else {
if ($throttles) {
$this->clearLoginAttempts($request);
}
}
}
@@ -153,8 +177,6 @@ class AuthController extends Controller
// Unset the page we were before from the session
\Session::forget('loginRedirect');
// Redirect to the users page
return redirect()->to($redirect)->with('success', trans('auth/message.signin.success'));
}
@@ -256,4 +278,19 @@ class AuthController extends Controller
'password' => 'required',
]);
}
/**
* Get the login lockout error message.
*
* @param int $seconds
* @return string
*/
protected function getLockoutErrorMessage($seconds)
{
return \Lang::has('auth/message.throttle')
? \Lang::get('auth/message.throttle', ['seconds' => $seconds])
: 'Too many login attempts. Please try again in '.$seconds.' seconds.';
}
}
@@ -46,4 +46,15 @@ class PasswordController extends Controller
public function getEmailSubject(){
return property_exists($this, 'subject') ? $this->subject : \Lang::get('mail.reset_link');
}
/**
* Get the response for after the reset link has been successfully sent.
*
* @param string $response
* @return \Symfony\Component\HttpFoundation\Response
*/
protected function getSendResetLinkEmailSuccessResponse($response)
{
return redirect()->route('login')->with('status', trans($response));
}
}
@@ -53,7 +53,7 @@ class CategoriesController extends Controller
{
// Show the page
$category_types= Helper::categoryTypeList();
return View::make('categories/edit')->with('category', new Category)
return View::make('categories/edit')->with('item', new Category)
->with('category_types', $category_types);
}
@@ -109,7 +109,7 @@ class CategoriesController extends Controller
public function getEdit($categoryId = null)
{
// Check if the category exists
if (is_null($category = Category::find($categoryId))) {
if (is_null($item = Category::find($categoryId))) {
// Redirect to the blogs management page
return redirect()->to('admin/settings/categories')->with('error', trans('admin/categories/message.does_not_exist'));
}
@@ -120,7 +120,7 @@ class CategoriesController extends Controller
$category_options = array('' => 'Top Level') + DB::table('categories')->where('id', '!=', $categoryId)->lists('name', 'id');
$category_types= Helper::categoryTypeList();
return View::make('categories/edit', compact('category'))
return View::make('categories/edit', compact('item'))
->with('category_options', $category_options)
->with('category_types', $category_types);
}
@@ -293,7 +293,6 @@ class CategoriesController extends Controller
'category_type' => ucwords($category->category_type),
'count' => $category->itemCount(),
'acceptance' => ($category->require_acceptance=='1') ? '<i class="fa fa-check"></i>' : '',
//EULA is still not working correctly
'eula' => ($category->getEula()) ? '<i class="fa fa-check"></i>' : '',
'actions' => $actions
);
@@ -357,7 +356,7 @@ class CategoriesController extends Controller
$rows[] = array(
'id' => $asset->id,
'name' => (string)link_to('/hardware/'.$asset->id.'/view', $asset->showAssetName()),
'model' => $asset->model->name,
'model' => ($asset->model) ? (string)link_to('hardware/models/'.$asset->model->id.'/view', $asset->model->name) : '',
'asset_tag' => $asset->asset_tag,
'serial' => $asset->serial,
'assigned_to' => ($asset->assigneduser) ? (string)link_to('/admin/users/'.$asset->assigneduser->id.'/view', $asset->assigneduser->fullName()): '',
+3 -3
View File
@@ -38,7 +38,7 @@ final class CompaniesController extends Controller
*/
public function getCreate()
{
return View::make('companies/edit')->with('company', new Company);
return View::make('companies/edit')->with('item', new Company);
}
/**
@@ -74,11 +74,11 @@ final class CompaniesController extends Controller
*/
public function getEdit($companyId)
{
if (is_null($company = Company::find($companyId))) {
if (is_null($item = Company::find($companyId))) {
return redirect()->to('admin/settings/companies')
->with('error', trans('admin/companies/message.does_not_exist'));
} else {
return View::make('companies/edit')->with('company', $company);
return View::make('companies/edit')->with('item', $item);
}
}
+12 -12
View File
@@ -61,7 +61,7 @@ class ComponentsController extends Controller
$location_list = Helper::locationsList();
return View::make('components/edit')
->with('component', new Component)
->with('item', new Component)
->with('category_list', $category_list)
->with('company_list', $company_list)
->with('location_list', $location_list);
@@ -89,7 +89,7 @@ class ComponentsController extends Controller
$component->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
$component->order_number = e(Input::get('order_number'));
$component->min_amt = e(Input::get('min_amt'));
$component->serial_number = e(Input::get('serial_number'));
$component->serial = e(Input::get('serial'));
if (e(Input::get('purchase_date')) == '') {
$component->purchase_date = null;
@@ -103,7 +103,7 @@ class ComponentsController extends Controller
$component->purchase_cost = Helper::ParseFloat(e(Input::get('purchase_cost')));
}
$component->total_qty = e(Input::get('total_qty'));
$component->qty = e(Input::get('qty'));
$component->user_id = Auth::user()->id;
// Was the component created?
@@ -130,10 +130,10 @@ class ComponentsController extends Controller
public function getEdit($componentId = null)
{
// Check if the component exists
if (is_null($component = Component::find($componentId))) {
if (is_null($item = Component::find($componentId))) {
// Redirect to the blogs management page
return redirect()->to('admin/components')->with('error', trans('admin/components/message.does_not_exist'));
} elseif (!Company::isCurrentUserHasAccess($component)) {
} elseif (!Company::isCurrentUserHasAccess($item)) {
return redirect()->to('admin/components')->with('error', trans('general.insufficient_permissions'));
}
@@ -141,7 +141,7 @@ class ComponentsController extends Controller
$company_list = Helper::companyList();
$location_list = Helper::locationsList();
return View::make('components/edit', compact('component'))
return View::make('components/edit', compact('item'))
->with('category_list', $category_list)
->with('company_list', $company_list)
->with('location_list', $location_list);
@@ -174,8 +174,8 @@ class ComponentsController extends Controller
$component->location_id = e(Input::get('location_id'));
$component->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
$component->order_number = e(Input::get('order_number'));
$component->min_amt = e(Input::get('min_amt'));
$component->serial_number = e(Input::get('serial_number'));
$component->min_amt = e(Input::get('min_amt'));
$component->serial = e(Input::get('serial'));
if (e(Input::get('purchase_date')) == '') {
$component->purchase_date = null;
@@ -189,7 +189,7 @@ class ComponentsController extends Controller
$component->purchase_cost = Helper::ParseFloat(e(Input::get('purchase_cost')));
}
$component->total_qty = e(Input::get('total_qty'));
$component->qty = e(Input::get('qty'));
// Was the component created?
if ($component->save()) {
@@ -424,7 +424,7 @@ class ComponentsController extends Controller
$limit = 50;
}
$allowed_columns = ['id','name','min_amt','order_number','serial_number','purchase_date','purchase_cost','companyName','category','total_qty'];
$allowed_columns = ['id','name','min_amt','order_number','serial','purchase_date','purchase_cost','companyName','category','total_qty'];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
@@ -472,9 +472,9 @@ class ComponentsController extends Controller
'checkbox' =>'<div class="text-center"><input type="checkbox" name="component['.$component->id.']" class="one_required"></div>',
'id' => $component->id,
'name' => (string)link_to('admin/components/'.$component->id.'/view', e($component->name)),
'serial_number' => $component->serial_number,
'serial_number' => $component->serial,
'location' => ($component->location) ? e($component->location->name) : '',
'total_qty' => e($component->total_qty),
'qty' => e($component->qty),
'min_amt' => e($component->min_amt),
'category' => ($component->category) ? e($component->category->name) : 'Missing category',
'order_number' => e($component->order_number),
@@ -59,7 +59,7 @@ class ConsumablesController extends Controller
$manufacturer_list = Helper::manufacturerList();
return View::make('consumables/edit')
->with('consumable', new Consumable)
->with('item', new Consumable)
->with('category_list', $category_list)
->with('company_list', $company_list)
->with('location_list', $location_list)
@@ -85,7 +85,7 @@ class ConsumablesController extends Controller
$consumable->order_number = e(Input::get('order_number'));
$consumable->min_amt = e(Input::get('min_amt'));
$consumable->manufacturer_id = e(Input::get('manufacturer_id'));
$consumable->model_no = e(Input::get('model_no'));
$consumable->model_number = e(Input::get('model_number'));
$consumable->item_no = e(Input::get('item_no'));
if (e(Input::get('purchase_date')) == '') {
@@ -127,10 +127,10 @@ class ConsumablesController extends Controller
public function getEdit($consumableId = null)
{
// Check if the consumable exists
if (is_null($consumable = Consumable::find($consumableId))) {
if (is_null($item = Consumable::find($consumableId))) {
// Redirect to the blogs management page
return redirect()->to('admin/consumables')->with('error', trans('admin/consumables/message.does_not_exist'));
} elseif (!Company::isCurrentUserHasAccess($consumable)) {
} elseif (!Company::isCurrentUserHasAccess($item)) {
return redirect()->to('admin/consumables')->with('error', trans('general.insufficient_permissions'));
}
@@ -139,7 +139,7 @@ class ConsumablesController extends Controller
$location_list = Helper::locationsList();
$manufacturer_list = Helper::manufacturerList();
return View::make('consumables/edit', compact('consumable'))
return View::make('consumables/edit', compact('item'))
->with('category_list', $category_list)
->with('company_list', $company_list)
->with('location_list', $location_list)
@@ -171,7 +171,7 @@ class ConsumablesController extends Controller
$consumable->order_number = e(Input::get('order_number'));
$consumable->min_amt = e(Input::get('min_amt'));
$consumable->manufacturer_id = e(Input::get('manufacturer_id'));
$consumable->model_no = e(Input::get('model_no'));
$consumable->model_number = e(Input::get('model_number'));
$consumable->item_no = e(Input::get('item_no'));
if (e(Input::get('purchase_date')) == '') {
@@ -412,7 +412,7 @@ class ConsumablesController extends Controller
$limit = 50;
}
$allowed_columns = ['id','name','order_number','min_amt','purchase_date','purchase_cost','companyName','category','model_no', 'item_no', 'manufacturer'];
$allowed_columns = ['id','name','order_number','min_amt','purchase_date','purchase_cost','companyName','category','model_number', 'item_no', 'manufacturer'];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
@@ -466,7 +466,7 @@ class ConsumablesController extends Controller
'min_amt' => e($consumable->min_amt),
'qty' => e($consumable->qty),
'manufacturer' => ($consumable->manufacturer) ? (string) link_to('/admin/settings/manufacturers/'.$consumable->manufacturer_id.'/view', $consumable->manufacturer->name): '',
'model_no' => e($consumable->model_no),
'model_number' => e($consumable->model_number),
'item_no' => e($consumable->item_no),
'category' => ($consumable->category) ? (string) link_to('/admin/settings/categories/'.$consumable->category_id.'/view', $consumable->category->name) : 'Missing category',
'order_number' => e($consumable->order_number),
@@ -46,7 +46,7 @@ class DepreciationsController extends Controller
public function getCreate()
{
// Show the page
return View::make('depreciations/edit')->with('depreciation', new Depreciation);
return View::make('depreciations/edit')->with('item', new Depreciation);
}
@@ -94,12 +94,12 @@ class DepreciationsController extends Controller
public function getEdit($depreciationId = null)
{
// Check if the depreciation exists
if (is_null($depreciation = Depreciation::find($depreciationId))) {
if (is_null($item = Depreciation::find($depreciationId))) {
// Redirect to the blogs management page
return redirect()->to('admin/settings/depreciations')->with('error', trans('admin/depreciations/message.does_not_exist'));
}
return View::make('depreciations/edit', compact('depreciation'));
return View::make('depreciations/edit', compact('item'));
}
+18 -15
View File
@@ -70,7 +70,7 @@ class LicensesController extends Controller
->with('maintained_list', $maintained_list)
->with('company_list', Helper::companyList())
->with('manufacturer_list', Helper::manufacturerList())
->with('license', new License);
->with('item', new License);
}
@@ -139,6 +139,7 @@ class LicensesController extends Controller
$license->depreciation_id = e(Input::get('depreciation_id'));
$license->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
$license->expiration_date = e(Input::get('expiration_date'));
$license->termination_date = e(Input::get('termination_date'));
$license->user_id = Auth::user()->id;
if (($license->purchase_date == "") || ($license->purchase_date == "0000-00-00")) {
@@ -190,26 +191,26 @@ class LicensesController extends Controller
public function getEdit($licenseId = null)
{
// Check if the license exists
if (is_null($license = License::find($licenseId))) {
if (is_null($item = License::find($licenseId))) {
// Redirect to the blogs management page
return redirect()->to('admin/licenses')->with('error', trans('admin/licenses/message.does_not_exist'));
} elseif (!Company::isCurrentUserHasAccess($license)) {
} elseif (!Company::isCurrentUserHasAccess($item)) {
return redirect()->to('admin/licenses')->with('error', trans('general.insufficient_permissions'));
}
if ($license->purchase_date == "0000-00-00") {
$license->purchase_date = null;
if ($item->purchase_date == "0000-00-00") {
$item->purchase_date = null;
}
if ($license->purchase_cost == "0.00") {
$license->purchase_cost = null;
if ($item->purchase_cost == "0.00") {
$item->purchase_cost = null;
}
// Show the page
$license_options = array('' => 'Top Level') + DB::table('assets')->where('id', '!=', $licenseId)->pluck('name', 'id');
$maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No');
return View::make('licenses/edit', compact('license'))
return View::make('licenses/edit', compact('item'))
->with('license_options', $license_options)
->with('depreciation_list', Helper::depreciationList())
->with('supplier_list', Helper::suppliersList())
@@ -395,7 +396,7 @@ class LicensesController extends Controller
return redirect()->to('admin/licenses')->with('error', trans('general.insufficient_permissions'));
}
if (($license->assignedcount()) && ($license->assignedcount() > 0)) {
if ($license->assigned_seats_count > 0) {
// Redirect to the license management page
return redirect()->to('admin/licenses')->with('error', trans('admin/licenses/message.assoc_users'));
@@ -669,8 +670,10 @@ class LicensesController extends Controller
// Ooops.. something went wrong
return redirect()->back()->withInput()->withErrors($validator);
}
$return_to = $licenseseat->assigned_to;
$return_to = User::find($licenseseat->assigned_to);
if (!$return_to) {
$return_to = Asset::find($licenseseat->asset_id);
}
// Update the asset data
$licenseseat->assigned_to = null;
$licenseseat->asset_id = null;
@@ -679,7 +682,7 @@ class LicensesController extends Controller
// Was the asset updated?
if ($licenseseat->save()) {
$licenseseat->logCheckin(e(Input::get('note')));
$licenseseat->logCheckin($return_to, e(Input::get('note')));
$settings = Setting::getSettings();
@@ -719,7 +722,7 @@ class LicensesController extends Controller
if ($backto=='user') {
return redirect()->to("admin/users/".$return_to.'/view')->with('success', trans('admin/licenses/message.checkin.success'));
return redirect()->to("admin/users/".$return_to->id.'/view')->with('success', trans('admin/licenses/message.checkin.success'));
} else {
return redirect()->to("admin/licenses/".$licenseseat->license_id."/view")->with('success', trans('admin/licenses/message.checkin.success'));
}
@@ -786,7 +789,7 @@ class LicensesController extends Controller
->with('license_options', $license_options)
->with('depreciation_list', $depreciation_list)
->with('supplier_list', $supplier_list)
->with('license', $license)
->with('item', $license)
->with('maintained_list', $maintained_list)
->with('company_list', $company_list)
->with('manufacturer_list', Helper::manufacturerList());
@@ -822,7 +825,7 @@ class LicensesController extends Controller
foreach (Input::file('licensefile') as $file) {
$rules = array(
'licensefile' => 'required|mimes:png,gif,jpg,jpeg,doc,docx,pdf,txt,zip,rar,rtf|max:2000'
'licensefile' => 'required|mimes:png,gif,jpg,jpeg,doc,docx,pdf,txt,zip,rar,rtf,xml,lic|max:2000'
);
$validator = Validator::make(array('licensefile'=> $file), $rules);
+5 -4
View File
@@ -61,7 +61,7 @@ class LocationsController extends Controller
return View::make('locations/edit')
->with('location_options', $location_options)
->with('location', new Location);
->with('item', new Location);
}
@@ -159,7 +159,7 @@ class LocationsController extends Controller
public function getEdit($locationId = null)
{
// Check if the location exists
if (is_null($location = Location::find($locationId))) {
if (is_null($item = Location::find($locationId))) {
return redirect()->to('admin/settings/locations')->with('error', trans('admin/locations/message.does_not_exist'));
}
@@ -169,7 +169,7 @@ class LocationsController extends Controller
$location_options = Location::flattenLocationsArray($location_options_array);
$location_options = array('' => 'Top Level') + $location_options;
return View::make('locations/edit', compact('location'))->with('location_options', $location_options);
return View::make('locations/edit', compact('item'))->with('location_options', $location_options);
}
@@ -318,7 +318,7 @@ class LocationsController extends Controller
$locations = $locations->OrderParent($order);
break;
default:
$allowed_columns = ['id','name','address','city','state','country','currency'];
$allowed_columns = ['id','name','address','city','state','country','currency','zip'];
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
$locations = $locations->orderBy($sort, $order);
@@ -344,6 +344,7 @@ class LocationsController extends Controller
'address' => ($location->address) ? e($location->address): '',
'city' => e($location->city),
'state' => e($location->state),
'zip' => e($location->zip),
'country' => e($location->country),
'currency' => e($location->currency),
'actions' => $actions
@@ -46,7 +46,7 @@ class ManufacturersController extends Controller
*/
public function getCreate()
{
return View::make('manufacturers/edit')->with('manufacturer', new Manufacturer);
return View::make('manufacturers/edit')->with('item', new Manufacturer);
}
@@ -84,13 +84,13 @@ class ManufacturersController extends Controller
public function getEdit($manufacturerId = null)
{
// Check if the manufacturer exists
if (is_null($manufacturer = Manufacturer::find($manufacturerId))) {
if (is_null($item = Manufacturer::find($manufacturerId))) {
// Redirect to the manufacturer page
return redirect()->to('admin/settings/manufacturers')->with('error', trans('admin/manufacturers/message.does_not_exist'));
}
// Show the page
return View::make('manufacturers/edit', compact('manufacturer'));
return View::make('manufacturers/edit', compact('item'));
}
@@ -521,7 +521,7 @@ class ManufacturersController extends Controller
'min_amt' => e($consumable->min_amt),
'qty' => e($consumable->qty),
'manufacturer' => ($consumable->manufacturer) ? (string) link_to('/admin/settings/manufacturers/'.$consumable->manufacturer_id.'/view', $consumable->manufacturer->name): '',
'model_no' => e($consumable->model_no),
'model_number' => e($consumable->model_number),
'item_no' => e($consumable->item_no),
'category' => ($consumable->category) ? (string) link_to('/admin/settings/categories/'.$consumable->category_id.'/view', $consumable->category->name) : 'Missing category',
'order_number' => e($consumable->order_number),
+30 -7
View File
@@ -152,7 +152,7 @@ class ReportsController extends Controller
$asset->asset_tag,
($asset->model->manufacturer) ? $asset->model->manufacturer->name : '',
($asset->model) ? $asset->model->name : '',
($asset->model->modelno) ? $asset->model->modelno : '',
($asset->model->model_number) ? $asset->model->model_number : '',
($asset->name) ? $asset->name : '',
($asset->serial) ? $asset->serial : '',
($asset->assetstatus) ? e($asset->assetstatus->name) : '',
@@ -361,7 +361,7 @@ class ReportsController extends Controller
$item_type = $activity->itemType();
} else {
$activity_item = "unkonwn";
$activity_item = "unknown (deleted)";
$item_type = "null";
}
@@ -453,9 +453,9 @@ class ReportsController extends Controller
trans('admin/licenses/form.seats'),
trans('admin/licenses/form.remaining_seats'),
trans('admin/licenses/form.expiration'),
trans('admin/licenses/form.date'),
trans('admin/licenses/form.depreciation'),
trans('admin/licenses/form.cost')
trans('general.purchase_date'),
trans('general.depreciation'),
trans('general.purchase_cost')
];
$header = array_map('trim', $header);
@@ -561,6 +561,9 @@ class ReportsController extends Controller
if (e(Input::get('username')) == '1') {
$header[] = 'Username';
}
if (e(Input::get('employee_num')) == '1') {
$header[] = 'Employee No.';
}
if (e(Input::get('status')) == '1') {
$header[] = 'Status';
}
@@ -577,6 +580,10 @@ class ReportsController extends Controller
$header[] = trans('admin/hardware/form.expected_checkin');
}
if (e(Input::get('notes')) == '1') {
$header[] = trans('general.notes');
}
foreach ($customfields as $customfield) {
if (e(Input::get($customfield->db_column_name())) == '1') {
@@ -610,7 +617,7 @@ class ReportsController extends Controller
}
if (e(Input::get('model')) == '1') {
$row[] = '"' . e($asset->model->name) . '"';
$row[] = '"' . e($asset->model->modelno) . '"';
$row[] = '"' . e($asset->model->model_number) . '"';
}
if (e(Input::get('category')) == '1') {
$row[] = '"' .e($asset->model->category->name) . '"';
@@ -679,6 +686,14 @@ class ReportsController extends Controller
}
}
if (e(Input::get('employee_num')) == '1') {
if ($asset->assigneduser) {
$row[] = '"' .e($asset->assigneduser->employee_num). '"';
} else {
$row[] = ''; // Empty string if unassigned
}
}
if (e(Input::get('status')) == '1') {
if (( $asset->status_id == '0' ) && ( $asset->assigned_to == '0' )) {
$row[] = trans('general.ready_to_deploy');
@@ -713,6 +728,14 @@ class ReportsController extends Controller
}
}
if (e(Input::get('notes')) == '1') {
if ($asset->notes) {
$row[] = '"' .$asset->notes . '"';
} else {
$row[] = '';
}
}
foreach ($customfields as $customfield) {
$column_name = $customfield->db_column_name();
if (e(Input::get($customfield->db_column_name())) == '1') {
@@ -776,7 +799,7 @@ class ReportsController extends Controller
$header = [
trans('admin/hardware/table.asset_tag'),
trans('admin/asset_maintenances/table.asset_name'),
trans('admin/asset_maintenances/table.supplier_name'),
trans('general.supplier'),
trans('admin/asset_maintenances/form.asset_maintenance_type'),
trans('admin/asset_maintenances/form.title'),
trans('admin/asset_maintenances/form.start_date'),
@@ -15,6 +15,7 @@ use Response;
use Artisan;
use Crypt;
use Mail;
use Auth;
use App\Models\User;
use App\Http\Requests\SetupUserRequest;
@@ -184,6 +185,7 @@ class SettingsController extends Controller
return redirect()->back()->withInput()->withErrors($user->getErrors())->withErrors($settings->getErrors());
} else {
$user->save();
Auth::login($user, true);
$settings->save();
if (Input::get('email_creds')=='1') {
@@ -195,6 +197,7 @@ class SettingsController extends Controller
}
return redirect()->route('setup.done');
}
@@ -224,6 +227,7 @@ class SettingsController extends Controller
*/
public function getSetupDone()
{
return View::make('setup/done')
->with('step', 4)
->with('section', 'Done!');
@@ -87,11 +87,11 @@ class StatuslabelsController extends Controller
public function getCreate()
{
// Show the page
$statuslabel = new Statuslabel;
$use_statuslabel_type = $statuslabel->getStatuslabelType();
$item = new Statuslabel;
$use_statuslabel_type = $item->getStatuslabelType();
$statuslabel_types = Helper::statusTypeList();
return View::make('statuslabels/edit', compact('statuslabel_types', 'statuslabel'))->with('use_statuslabel_type', $use_statuslabel_type);
return View::make('statuslabels/edit', compact('statuslabel_types', 'item'))->with('use_statuslabel_type', $use_statuslabel_type);
}
@@ -169,16 +169,16 @@ class StatuslabelsController extends Controller
public function getEdit($statuslabelId = null)
{
// Check if the Statuslabel exists
if (is_null($statuslabel = Statuslabel::find($statuslabelId))) {
if (is_null($item = Statuslabel::find($statuslabelId))) {
// Redirect to the blogs management page
return redirect()->to('admin/settings/statuslabels')->with('error', trans('admin/statuslabels/message.does_not_exist'));
}
$use_statuslabel_type = $statuslabel->getStatuslabelType();
$use_statuslabel_type = $item->getStatuslabelType();
$statuslabel_types = array('' => trans('admin/hardware/form.select_statustype')) + array('undeployable' => trans('admin/hardware/general.undeployable')) + array('pending' => trans('admin/hardware/general.pending')) + array('archived' => trans('admin/hardware/general.archived')) + array('deployable' => trans('admin/hardware/general.deployable'));
return View::make('statuslabels/edit', compact('statuslabel', 'statuslabel_types'))->with('use_statuslabel_type', $use_statuslabel_type);
return View::make('statuslabels/edit', compact('item', 'statuslabel_types'))->with('use_statuslabel_type', $use_statuslabel_type);
}
+3 -3
View File
@@ -45,7 +45,7 @@ class SuppliersController extends Controller
*/
public function getCreate()
{
return View::make('suppliers/edit')->with('supplier', new Supplier);
return View::make('suppliers/edit')->with('item', new Supplier);
}
@@ -125,13 +125,13 @@ class SuppliersController extends Controller
public function getEdit($supplierId = null)
{
// Check if the supplier exists
if (is_null($supplier = Supplier::find($supplierId))) {
if (is_null($item = Supplier::find($supplierId))) {
// Redirect to the supplier page
return redirect()->to('admin/settings/suppliers')->with('error', trans('admin/suppliers/message.does_not_exist'));
}
// Show the page
return View::make('suppliers/edit', compact('supplier'));
return View::make('suppliers/edit', compact('item'));
}
+5 -22
View File
@@ -425,17 +425,12 @@ class UsersController extends Controller
// Check if we are not trying to delete ourselves
if ($user->id === Auth::user()->id) {
// Prepare the error message
$error = trans('admin/users/message.error.delete');
// Redirect to the user management page
return redirect()->route('users')->with('error', $error);
return redirect()->route('users')->with('error', trans('admin/users/message.error.delete'));
}
// Do we have permission to delete this user?
if ((!Auth::user()->isSuperUser()) || (config('app.lock_passwords'))) {
// Redirect to the user management page
if ((Gate::denies('users.delete') || (config('app.lock_passwords')))) {
return redirect()->route('users')->with('error', 'Insufficient permissions!');
}
@@ -459,18 +454,11 @@ class UsersController extends Controller
// Delete the user
$user->delete();
// Prepare the success message
$success = trans('admin/users/message.success.delete');
// Redirect to the user management page
return redirect()->route('users')->with('success', $success);
} catch (UserNotFoundException $e) {
// Prepare the error message
$error = trans('admin/users/message.user_not_found', compact('id'));
// Redirect to the user management page
return redirect()->route('users')->with('error', $error);
} catch (UserNotFoundException $e) {
return redirect()->route('users')->with('error', trans('admin/users/message.user_not_found', compact('id')));
}
}
@@ -522,10 +510,7 @@ class UsersController extends Controller
if (($key = array_search(Auth::user()->id, $user_raw_array)) !== false) {
unset($user_raw_array[$key]);
}
if (!Auth::user()->isSuperUser()) {
return redirect()->route('users')->with('error', trans('admin/users/message.insufficient_permissions'));
}
if (!config('app.lock_passwords')) {
@@ -865,7 +850,6 @@ class UsersController extends Controller
'permissions' => '{"user":1}',
'notes' => 'Imported user'
);
//dd($newuser);
DB::table('users')->insert($newuser);
@@ -1107,7 +1091,6 @@ class UsersController extends Controller
$user = User::find($userId);
$destinationPath = config('app.private_uploads').'/users';
// the license is valid
if (isset($user->id)) {
if (!Company::isCurrentUserHasAccess($user)) {
@@ -379,11 +379,12 @@ class ViewAssetsController extends Controller
}
$logaction->target_id = $findlog->target_id;
$logaction->target_type = User::class;
$logaction->note = e(Input::get('note'));
$logaction->updated_at = date("Y-m-d H:i:s");
if ($sig_filename) {
if (isset($sig_filename)) {
$logaction->accept_signature = $sig_filename;
}
$log = $logaction->logaction($logaction_msg);
+1
View File
@@ -22,6 +22,7 @@ class Kernel extends HttpKernel
\App\Http\Middleware\NosniffGuard::class,
\App\Http\Middleware\CheckForSetup::class,
\Fideloper\Proxy\TrustProxies::class,
\App\Http\Middleware\CheckForDebug::class,
];
/**
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Auth;
class CheckForDebug
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
view()->share('debug_in_production', false);
if (((Auth::check() && (Auth::user()->isSuperUser()))) && (app()->environment()=='production') && (config('app.warn_debug')===true) && (config('app.debug')===true)) {
view()->share('debug_in_production', true);
}
return $next($request);
}
}
+5
View File
@@ -14,6 +14,11 @@ class CheckForSetup
public function handle($request, Closure $next, $guard = null)
{
// This is dumb
if ($request->is('_debugbar*')) {
return $next($request);
}
if (Setting::setupCompleted()) {
if ($request->is('setup*')) {
+3 -3
View File
@@ -19,13 +19,13 @@ class CheckForTwoFactor
public function handle($request, Closure $next)
{
// Skip the logic if the user is on the two factor pages
if (($request->route()->getName()=='two-factor') || ($request->route()->getName()=='two-factor-enroll') || ($request->route()->getName()=='logout')) {
// Skip the logic if the user is on the two factor pages or the setup pages
if (($request->route()->getName()=='two-factor') || ($request->route()->getName()=='two-factor-enroll') || ($request->route()->getPrefix()=='setup') || ($request->route()->getName()=='logout')) {
return $next($request);
}
// Two-factor is enabled (either optional or required)
if (Schema::hasTable('settings')) {
if (Setting::getSettings()) {
if (Auth::check() && (Setting::getSettings()->two_factor_enabled!='')) {
// This user is already 2fa-authed
+3 -1
View File
@@ -21,7 +21,9 @@ class CheckLocale
public function handle($request, Closure $next, $guard = null)
{
if (Schema::hasTable('settings')) {
if (Setting::getSettings()) {
// User's preference
if (($request->user()) && ($request->user()->locale)) {
\App::setLocale($request->user()->locale);
+27 -12
View File
@@ -481,17 +481,30 @@ Route::group([ 'prefix' => 'admin','middleware' => ['web','auth']], function ()
# Asset Maintenances
Route::group([ 'prefix' => 'asset_maintenances', 'middleware'=>'authorize:assets.view' ], function () {
Route::get(
'create/{assetId?}',
[ 'as' => 'create/asset_maintenances', 'uses' => 'AssetMaintenancesController@getCreate' ]
);
Route::post('create/{assetId?}', 'AssetMaintenancesController@postCreate');
Route::get('/', [ 'as' => 'asset_maintenances', 'uses' => 'AssetMaintenancesController@getIndex' ]);
Route::get(
'{assetMaintenanceId}/edit',
[ 'as' => 'update/asset_maintenance', 'uses' => 'AssetMaintenancesController@getEdit' ]
);
Route::post('{assetMaintenanceId}/edit', 'AssetMaintenancesController@postEdit');
Route::get('create/{assetId?}',
[ 'as' => 'create/asset_maintenances',
'middleware' => 'authorize:assets.edit',
'uses' => 'AssetMaintenancesController@getCreate'
]);
Route::post('create/{assetId?}',
[ 'as' => 'create/asset_maintenances.save',
'middleware' => 'authorize:assets.edit',
'uses' => 'AssetMaintenancesController@postCreate'
]);
Route::get('{assetMaintenanceId}/edit',
[ 'as' => 'update/asset_maintenance',
'middleware' => 'authorize:assets.edit',
'uses' => 'AssetMaintenancesController@getEdit'
]);
Route::post('{assetMaintenanceId}/edit',
[ 'as' => 'update/asset_maintenance.save',
'middleware' => 'authorize:assets.edit',
'uses' => 'AssetMaintenancesController@postEdit'
]);
Route::get(
'{assetMaintenanceId}/delete',
[ 'as' => 'delete/asset_maintenance', 'uses' => 'AssetMaintenancesController@getDelete' ]
@@ -500,6 +513,8 @@ Route::group([ 'prefix' => 'admin','middleware' => ['web','auth']], function ()
'{assetMaintenanceId}/view',
[ 'as' => 'view/asset_maintenance', 'uses' => 'AssetMaintenancesController@getView' ]
);
Route::get('/', [ 'as' => 'asset_maintenances', 'uses' => 'AssetMaintenancesController@getIndex' ]);
});
# Accessories
@@ -804,7 +819,7 @@ Route::group([ 'prefix' => 'admin','middleware' => ['web','auth']], function ()
Route::post('{userId}/edit', [ 'uses' => 'UsersController@postEdit', 'middleware' => ['authorize:users.edit'] ]);
Route::get('{userId}/clone', [ 'as' => 'clone/user', 'uses' => 'UsersController@getClone', 'middleware' => ['authorize:users.edit'] ]);
Route::post('{userId}/clone', [ 'uses' => 'UsersController@postCreate', 'middleware' => ['authorize:users.edit'] ]);
Route::get('{userId}/delete', [ 'as' => 'delete/user', 'uses' => 'UsersController@getDelete', 'middleware' => ['authorize:users.edit'] ]);
Route::get('{userId}/delete', [ 'as' => 'delete/user', 'uses' => 'UsersController@getDelete', 'middleware' => ['authorize:users.delete'] ]);
Route::get('{userId}/restore', [ 'as' => 'restore/user', 'uses' => 'UsersController@getRestore', 'middleware' => ['authorize:users.edit'] ]);
Route::get('{userId}/view', [ 'as' => 'view/user', 'uses' => 'UsersController@getView' , 'middleware' => ['authorize:users.view'] ]);
Route::get('{userId}/unsuspend', [ 'as' => 'unsuspend/user', 'uses' => 'UsersController@getUnsuspend', 'middleware' => ['authorize:users.edit'] ]);
+3 -1
View File
@@ -2,6 +2,7 @@
namespace App\Models;
use App\Models\Loggable;
use App\Models\SnipeModel;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
@@ -11,7 +12,7 @@ use Watson\Validating\ValidatingTrait;
*
* @version v1.0
*/
class Accessory extends Model
class Accessory extends SnipeModel
{
use CompanyableTrait;
use Loggable;
@@ -153,6 +154,7 @@ class Accessory extends Model
$query->where('locations.name', 'LIKE', '%'.$search.'%');
});
})->orWhere('accessories.name', 'LIKE', '%'.$search.'%')
->orWhere('accessories.model_number', 'LIKE', '%'.$search.'%')
->orWhere('accessories.order_number', 'LIKE', '%'.$search.'%')
->orWhere('accessories.purchase_cost', 'LIKE', '%'.$search.'%')
->orWhere('accessories.purchase_date', 'LIKE', '%'.$search.'%');
+15 -8
View File
@@ -217,7 +217,8 @@ class Asset extends Depreciable
$logaction->item_type = Asset::class;
$logaction->item_id = $this->id;
$logaction->target_type = User::class;
$logaction->target_id = $this->assigned_to;
// On Checkin, this is the user that previously had the asset.
$logaction->target_id = $user->id;
$logaction->note = $note;
$logaction->user_id = $admin->id;
if ($checkout_at!='') {
@@ -232,7 +233,6 @@ class Asset extends Depreciable
}
} else {
// Update the asset data to null, since it's being checked in
$logaction->target_id = '';
$logaction->location_id = null;
}
$logaction->user()->associate($admin);
@@ -329,8 +329,7 @@ class Asset extends Depreciable
{
return $this->hasMany('\App\Models\AssetMaintenance', 'asset_id')
->orderBy('created_at', 'desc')
->withTrashed();
->orderBy('created_at', 'desc');
}
/**
@@ -400,6 +399,11 @@ class Asset extends Depreciable
}
}
public function getDisplayNameAttribute()
{
return $this->showAssetName();
}
public function warrantee_expires()
{
$date = date_create($this->purchase_date);
@@ -481,9 +485,12 @@ class Asset extends Depreciable
$settings = \App\Models\Setting::getSettings();
if ($settings->auto_increment_assets == '1') {
$asset_tag = \DB::table('assets')
$temp_asset_tag = \DB::table('assets')
->where('physical', '=', '1')
->max('id');
->max('asset_tag');
$asset_tag_digits = preg_replace('/\D/', '', $temp_asset_tag);
$asset_tag = preg_replace('/^0*/', '', $asset_tag_digits);
if ($settings->zerofill_count > 0) {
return $settings->auto_increment_prefix.Asset::zerofill(($asset_tag + 1),$settings->zerofill_count);
@@ -788,7 +795,7 @@ public function checkin_email()
$query->where(function ($query) use ($search) {
$query->where('categories.name', 'LIKE', '%'.$search.'%')
->orWhere('models.name', 'LIKE', '%'.$search.'%')
->orWhere('models.modelno', 'LIKE', '%'.$search.'%');
->orWhere('models.model_number', 'LIKE', '%'.$search.'%');
});
});
})->orWhereHas('model', function ($query) use ($search) {
@@ -856,7 +863,7 @@ public function checkin_email()
*/
public function scopeOrderModelNumber($query, $order)
{
return $query->join('models', 'assets.model_id', '=', 'models.id')->orderBy('models.modelno', $order);
return $query->join('models', 'assets.model_id', '=', 'models.id')->orderBy('models.model_number', $order);
}
+6 -5
View File
@@ -2,6 +2,7 @@
namespace App\Models;
use App\Models\Requestable;
use App\Models\SnipeModel;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
@@ -12,7 +13,7 @@ use Watson\Validating\ValidatingTrait;
*
* @version v1.0
*/
class AssetModel extends Model
class AssetModel extends SnipeModel
{
use SoftDeletes;
use Requestable;
@@ -22,7 +23,7 @@ class AssetModel extends Model
// Declare the rules for the model validation
protected $rules = array(
'name' => 'required|min:1|max:255',
'modelno' => 'min:1|max:255',
'model_number' => 'min:1|max:255',
'category_id' => 'required|integer',
'manufacturer_id' => 'required|integer',
'eol' => 'integer:min:0|max:240',
@@ -92,8 +93,8 @@ class AssetModel extends Model
public function displayModelName()
{
$name = $this->manufacturer->name.' '.$this->name;
if ($this->modelno) {
$name .=" / ".$this->modelno;
if ($this->model_number) {
$name .=" / ".$this->model_number;
}
return $name;
}
@@ -161,7 +162,7 @@ class AssetModel extends Model
{
return $query->where('name', 'LIKE', "%$search%")
->orWhere('modelno', 'LIKE', "%$search%")
->orWhere('model_number', 'LIKE', "%$search%")
->orWhere(function ($query) use ($search) {
$query->whereHas('depreciation', function ($query) use ($search) {
$query->where('name', 'LIKE', '%'.$search.'%');
+3 -2
View File
@@ -1,10 +1,11 @@
<?php
namespace App\Models;
use App\Http\Traits\UniqueUndeletedTrait;
use App\Models\SnipeModel;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
use App\Http\Traits\UniqueUndeletedTrait;
/**
* Model for Categories. Categories are a higher-level group
@@ -14,7 +15,7 @@ use App\Http\Traits\UniqueUndeletedTrait;
*
* @version v1.0
*/
class Category extends Model
class Category extends SnipeModel
{
use SoftDeletes;
+4 -3
View File
@@ -1,17 +1,18 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Watson\Validating\ValidatingTrait;
use App\Models\SnipeModel;
use Auth;
use DB;
use Illuminate\Database\Eloquent\Model;
use Watson\Validating\ValidatingTrait;
/**
* Model for Companies.
*
* @version v1.8
*/
final class Company extends Model
final class Company extends SnipeModel
{
protected $table = 'companies';
+5 -4
View File
@@ -7,6 +7,7 @@ use App\Models\Company;
use App\Models\ConsumableAssignment;
use App\Models\Location;
use App\Models\Loggable;
use App\Models\SnipeModel;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
@@ -17,7 +18,7 @@ use Watson\Validating\ValidatingTrait;
*
* @version v1.0
*/
class Component extends Model
class Component extends SnipeModel
{
use CompanyableTrait;
use Loggable;
@@ -32,7 +33,7 @@ class Component extends Model
*/
public $rules = array(
'name' => 'required|min:3|max:255',
'total_qty' => 'required|integer|min:1',
'qty' => 'required|integer|min:1',
'category_id' => 'required|integer',
'company_id' => 'integer',
'purchase_date' => 'date',
@@ -100,7 +101,7 @@ class Component extends Model
}
$total = $this->total_qty;
$total = $this->qty;
$remaining = $total - $checkedout;
return $remaining;
}
@@ -141,7 +142,7 @@ class Component extends Model
});
})->orWhere('components.name', 'LIKE', '%'.$search.'%')
->orWhere('components.order_number', 'LIKE', '%'.$search.'%')
->orWhere('components.serial_number', 'LIKE', '%'.$search.'%')
->orWhere('components.serial', 'LIKE', '%'.$search.'%')
->orWhere('components.purchase_cost', 'LIKE', '%'.$search.'%')
->orWhere('components.purchase_date', 'LIKE', '%'.$search.'%');
}
+2 -1
View File
@@ -7,12 +7,13 @@ use App\Models\Company;
use App\Models\ConsumableAssignment;
use App\Models\Location;
use App\Models\Loggable;
use App\Models\SnipeModel;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
class Consumable extends Model
class Consumable extends SnipeModel
{
use CompanyableTrait;
use Loggable;
+11 -6
View File
@@ -2,6 +2,7 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Schema;
class CustomField extends Model
{
@@ -22,7 +23,7 @@ class CustomField extends Model
];
public $rules=[
"name" => "required|unique:custom_fields"
"name" => "required|unique:custom_fields"
];
public static $table_name="assets";
@@ -36,12 +37,12 @@ class CustomField extends Model
{
self::creating(function ($custom_field) {
if (in_array($custom_field->db_column_name(), \Schema::getColumnListing(\DB::getTablePrefix().CustomField::$table_name))) {
if (Schema::hasColumn(CustomField::$table_name,$custom_field->db_column_name())) {
//field already exists when making a new custom field; fail.
return false;
}
\Schema::table(\DB::getTablePrefix().\App\Models\CustomField::$table_name, function ($table) use ($custom_field) {
Schema::table(CustomField::$table_name, function ($table) use ($custom_field) {
$table->text($custom_field->db_column_name())->nullable();
});
@@ -49,17 +50,21 @@ class CustomField extends Model
self::updating(function ($custom_field) {
if ($custom_field->isDirty("name")) {
if (in_array($custom_field->db_column_name(), \Schema::getColumnListing(CustomField::$table_name))) {
if (Schema::hasColumn(CustomField::$table_name,$custom_field->db_column_name())) {
//field already exists when renaming a custom field
return false;
}
return \DB::statement("UPDATE ".CustomField::$table_name." RENAME ".self::name_to_db_name($custom_field->get_original("name"))." TO ".$custom_field->db_column_name());
return Schema::table(CustomField::$table_name, function ($table) use ($custom_field) {
$table->renameColumn(self::name_to_db_name($custom_field->getOriginal("name")),$custom_field->db_column_name());
});
}
return true;
});
self::deleting(function ($custom_field) {
return \DB::statement("ALTER TABLE ".CustomField::$table_name." DROP COLUMN ".$custom_field->db_column_name());
return Schema::table(CustomField::$table_name,function ($table) use ($custom_field) {
$table->dropColumn(self::name_to_db_name($custom_field->getOriginal("name")));
});
});
}
+3 -2
View File
@@ -1,10 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Models\Depreciation;
use App\Models\SnipeModel;
use Illuminate\Database\Eloquent\Model;
class Depreciable extends Model
class Depreciable extends SnipeModel
{
/**
* Depreciation Relation, and associated helper methods
+2 -1
View File
@@ -1,10 +1,11 @@
<?php
namespace App\Models;
use App\Models\SnipeModel;
use Illuminate\Database\Eloquent\Model;
use Watson\Validating\ValidatingTrait;
class Depreciation extends Model
class Depreciation extends SnipeModel
{
// Declare the rules for the form validation
protected $rules = array(
+2 -3
View File
@@ -1,11 +1,10 @@
<?php
namespace App\Models;
use App\Models\SnipeModel;
use Watson\Validating\ValidatingTrait;
use Illuminate\Database\Eloquent\Model;
class Group extends Model
class Group extends SnipeModel
{
protected $table = 'groups';
+2 -2
View File
@@ -219,7 +219,7 @@ class Ldap extends Model
$user->notes = 'Imported on first login from LDAP';
if ($user->save()) {
return true;
return $user;
} else {
LOG::debug('Could not create user.'.$user->getErrors());
throw new Exception("Could not create user: ".$user->getErrors());
@@ -277,7 +277,7 @@ class Ldap extends Model
$global_count += $results['count'];
$result_set = array_merge($result_set, $results);
ldap_control_paged_result_response($ldapconn, $search_results, $cookie);
@ldap_control_paged_result_response($ldapconn, $search_results, $cookie);
} while ($cookie !== null && $cookie != '');
+1 -2
View File
@@ -23,7 +23,6 @@ class License extends Depreciable
protected $table = 'licenses';
protected $rules = array(
'name' => 'required|string|min:3|max:255',
'serial' => 'required|min:5',
'seats' => 'required|min:1|max:10000|integer',
'license_email' => 'email|min:0|max:120',
'license_name' => 'string|min:0|max:100',
@@ -170,7 +169,7 @@ class License extends Depreciable
public function remaincount()
{
$total = $this->licenseSeatsCount;
$taken = $this->assigned_seats;
$taken = $this->assigned_seats_count;
$diff = ($total - $taken);
return $diff;
}
+8 -7
View File
@@ -1,14 +1,15 @@
<?php
namespace App\Models;
use App\Http\Traits\UniqueUndeletedTrait;
use App\Models\Asset;
use App\Models\SnipeModel;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\User;
use App\Models\Asset;
use Watson\Validating\ValidatingTrait;
use App\Http\Traits\UniqueUndeletedTrait;
class Location extends Model
class Location extends SnipeModel
{
use SoftDeletes;
protected $dates = ['deleted_at'];
@@ -16,8 +17,8 @@ class Location extends Model
protected $rules = array(
'name' => 'required|min:3|max:255|unique_undeleted',
'city' => 'min:3|max:255',
'state' => 'min:2|max:32',
'country' => 'min:2|max:2|max:2',
'state' => 'min:0|max:2',
'country' => 'min:2|max:2',
'address' => 'min:5|max:80',
'address2' => 'min:2|max:80',
'zip' => 'min:3|max:10',
@@ -49,7 +50,7 @@ class Location extends Model
public function assets()
{
return $this->hasManyThrough('\App\Models\Asset', '\App\Models\Actionlog', 'location_id', 'id');
return $this->hasManyThrough('\App\Models\Asset', '\App\Models\User', 'location_id', 'assigned_to', 'id');
}
public function assignedassets()
+3 -1
View File
@@ -63,9 +63,11 @@ trait Loggable
* @since [v3.4]
* @return \App\Models\Actionlog
*/
public function logCheckin($note)
public function logCheckin($target, $note)
{
$log = new Actionlog;
$log->target_type = get_class($target);
$log->target_id = $target->id;
if (static::class == LicenseSeat::class) {
$log->item_type = License::class;
$log->item_id = $this->license_id;
+7 -1
View File
@@ -1,11 +1,12 @@
<?php
namespace App\Models;
use App\Models\SnipeModel;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
class Manufacturer extends Model
class Manufacturer extends SnipeModel
{
use SoftDeletes;
protected $dates = ['deleted_at'];
@@ -46,6 +47,11 @@ class Manufacturer extends Model
return $this->hasManyThrough('\App\Models\Asset', '\App\Models\AssetModel', 'manufacturer_id', 'model_id');
}
public function models()
{
return $this->hasMany('\App\Models\AssetModel', 'manufacturer_id');
}
public function licenses()
{
return $this->hasMany('\App\Models\License', 'manufacturer_id');
+8 -4
View File
@@ -49,10 +49,14 @@ class Setting extends Model
{
static $static_cache = null;
if (!$static_cache) {
$static_cache = Setting::first();
}
return $static_cache;
if (!$static_cache) {
if (Schema::hasTable('settings')) {
$static_cache = Setting::first();
}
}
return $static_cache;
}
public static function setupCompleted()
+14
View File
@@ -0,0 +1,14 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class SnipeModel extends Model
{
//
public function getDisplayNameAttribute()
{
return $this->name;
}
}
+3 -2
View File
@@ -1,12 +1,13 @@
<?php
namespace App\Models;
use App\Http\Traits\UniqueUndeletedTrait;
use App\Models\SnipeModel;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
use App\Http\Traits\UniqueUndeletedTrait;
class Statuslabel extends Model
class Statuslabel extends SnipeModel
{
use SoftDeletes;
use ValidatingTrait;
+6 -5
View File
@@ -1,12 +1,13 @@
<?php
namespace App\Models;
use App\Http\Traits\UniqueUndeletedTrait;
use App\Models\SnipeModel;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
use App\Http\Traits\UniqueUndeletedTrait;
class Supplier extends Model
class Supplier extends SnipeModel
{
use SoftDeletes;
protected $dates = ['deleted_at'];
@@ -14,14 +15,14 @@ class Supplier extends Model
protected $rules = array(
'name' => 'required|min:3|max:255|unique_undeleted',
'address' => 'min:3|max:255',
'address2' => 'min:2|max:255',
'address' => 'min:3|max:50',
'address2' => 'min:2|max:50',
'city' => 'min:3|max:255',
'state' => 'min:0|max:32',
'country' => 'min:0|max:2',
'fax' => 'min:7|max:20',
'phone' => 'min:7|max:20',
'contact' => 'min:0|max:255',
'contact' => 'min:0|max:100',
'notes' => 'min:0|max:255',
'email' => 'email|min:5|max:150',
'zip' => 'min:0|max:10',
+21 -1
View File
@@ -4,6 +4,7 @@ namespace App\Providers;
use Validator;
use Illuminate\Support\ServiceProvider;
use DB;
use Log;
/**
@@ -64,6 +65,11 @@ class AppServiceProvider extends ServiceProvider
}
});
// Share common variables with all views.
view()->composer('*', function ($view) {
$view->with('snipeSettings', \App\Models\Setting::getSettings());
});
}
/**
@@ -73,6 +79,20 @@ class AppServiceProvider extends ServiceProvider
*/
public function register()
{
//
$monolog = Log::getMonolog();
if (config('app.debug')) {
$log_level = 'debug';
} else {
if (config('log-level')) {
$log_level = config('log-level');
} else {
$log_level = 'error';
}
}
foreach($monolog->getHandlers() as $handler) {
$handler->setLevel($log_level);
}
}
}
-7
View File
@@ -12,13 +12,6 @@ settings:
extensions:
enabled:
- Codeception\Extension\RunFailed
modules:
config:
Db:
dsn: ''
user: ''
password: ''
dump: tests/_data/dump.sql
coverage:
enabled: true
include:
+2
View File
@@ -27,6 +27,7 @@ return [
*/
'debug' => env('APP_DEBUG', false),
'warn_debug' => env('WARN_DEBUG', true),
/*
|--------------------------------------------------------------------------
@@ -109,6 +110,7 @@ return [
*/
'log' => env('APP_LOG', 'single'),
'log-level' => env('APP_LOG_LEVEL', 'error'),
/*
+17
View File
@@ -104,4 +104,21 @@ return [
],
],
/*
|--------------------------------------------------------------------------
| Login throttling
|--------------------------------------------------------------------------
|
| This handles the max failed login attempt throttling.
| You should not change the values here, but should change them in your
| application's .env file instead, as future changes to this file could
| overwrite your changes here.
|
*/
'throttle' => [
'max_attempts' => env('LOGIN_MAX_ATTEMPTS', 10),
'lockout_duration' => env('LOGIN_LOCKOUT_DURATION', 60),
],
];
+6
View File
@@ -73,6 +73,12 @@ return [
'dump_command_path' => env('DB_DUMP_PATH', '/usr/local/bin'), // only the path, so without 'mysqldump'
'dump_command_timeout' => 60 * 5, // 5 minute timeout
'dump_using_single_transaction' => true, // perform dump using a single transaction
'options' => (env('DB_SSL')) ? [
PDO::MYSQL_ATTR_SSL_KEY => env('DB_SSL_KEY'), // /path/to/key.pem
PDO::MYSQL_ATTR_SSL_CERT => env('DB_SSL_CERT'), // /path/to/cert.pem
PDO::MYSQL_ATTR_SSL_CA => env('DB_SSL_CA'), // /path/to/ca.pem
PDO::MYSQL_ATTR_SSL_CIPHER => env('DB_SSL_CIPHER')
] : []
],
'pgsql' => [
+4 -2
View File
@@ -1,5 +1,7 @@
<?php
return array (
'app_version' => 'v3.6.0',
'hash_version' => 'v3.6.0-g91caba0',
'app_version' => 'v3.6.4',
'build_version' => '12',
'hash_version' => 'gf7e4fca',
'full_hash' => 'v3.6.4-12-gf7e4fca',
);
+92 -51
View File
@@ -11,6 +11,11 @@
|
*/
use App\Models\Company;
use App\Models\Location;
use App\Models\Manufacturer;
use App\Models\Supplier;
$factory->defineAs(App\Models\Asset::class, 'asset', function (Faker\Generator $faker) {
return [
'name' => $faker->catchPhrase,
@@ -22,10 +27,12 @@ $factory->defineAs(App\Models\Asset::class, 'asset', function (Faker\Generator $
'asset_tag' => $faker->unixTime('now'),
'notes' => $faker->sentence,
'purchase_date' => $faker->dateTime(),
'purchase_cost' => $faker->randomFloat(2),
'order_number' => $faker->numberBetween(1000000,50000000),
'supplier_id' => $faker->numberBetween(1,5),
'requestable' => $faker->numberBetween(0,1),
'company_id' => \App\Models\Company::inRandomOrder()->first()->id
'company_id' => Company::inRandomOrder()->first()->id,
'requestable' => $faker->boolean()
];
});
@@ -35,25 +42,33 @@ $factory->defineAs(App\Models\AssetModel::class, 'assetmodel', function (Faker\G
'name' => $faker->catchPhrase,
'manufacturer_id' => $faker->numberBetween(1,10),
'category_id' => $faker->numberBetween(1,9),
'modelno' => $faker->numberBetween(1000000,50000000),
'model_number' => $faker->numberBetween(1000000,50000000),
'eol' => 1,
'notes' => $faker->paragraph(),
'requestable' => $faker->boolean(),
];
});
$factory->defineAs(App\Models\Location::class, 'location', function (Faker\Generator $faker) {
return [
'name' => $faker->city,
'city' => $faker->city,
'state' => $faker->stateAbbr,
'country' => $faker->countryCode,
'currency' => $faker->currencyCode,
];
return [
'name' => $faker->catchPhrase,
'address' => $faker->streetAddress,
'address2' => $faker->secondaryAddress,
'city' => $faker->city,
'state' => $faker->stateAbbr,
'country' => $faker->countryCode,
'currency' => $faker->currencyCode,
'zip' => $faker->postcode
];
});
$factory->defineAs(App\Models\Category::class, 'asset-category', function (Faker\Generator $faker) {
return [
'name' => $faker->text(20),
'category_type' => $faker->randomElement($array = array ('asset')),
'eula_text' => $faker->paragraph(),
'require_acceptance' => $faker->boolean(),
'checkin_email' => $faker->boolean()
];
});
@@ -95,9 +110,14 @@ $factory->defineAs(App\Models\Component::class, 'component', function (Faker\Gen
return [
'name' => $faker->text(20),
'category_id' => $faker->numberBetween(21,25),
'total_qty' => $faker->numberBetween(3, 10),
'location_id' => Location::inRandomOrder()->first()->id,
'serial' => $faker->uuid,
'qty' => $faker->numberBetween(3, 10),
'order_number' => $faker->numberBetween(1000000,50000000),
'purchase_date' => $faker->dateTime(),
'purchase_cost' => $faker->randomFloat(2),
'min_amt' => $faker->numberBetween($min = 1, $max = 2),
'company_id' => \App\Models\Company::inRandomOrder()->first()->id
'company_id' => Company::inRandomOrder()->first()->id
];
});
@@ -110,39 +130,52 @@ $factory->defineAs(App\Models\Depreciation::class, 'depreciation', function (Fak
$factory->defineAs(App\Models\Accessory::class, 'accessory', function (Faker\Generator $faker) {
return [
'company_id' => Company::inRandomOrder()->first()->id,
'name' => $faker->text(20),
'category_id' => $faker->numberBetween(11,15),
'qty' => $faker->numberBetween(5, 10),
'manufacturer_id' => Manufacturer::inRandomOrder()->first()->id,
'location_id' => $faker->numberBetween(1,5),
'order_number' => $faker->numberBetween(1000000,50000000),
'purchase_date' => $faker->dateTime(),
'purchase_cost' => $faker->randomFloat(2),
'qty' => $faker->numberBetween(5, 10),
'min_amt' => $faker->numberBetween($min = 1, $max = 2),
'company_id' => \App\Models\Company::inRandomOrder()->first()->id
];
});
$factory->defineAs(App\Models\Supplier::class, 'supplier', function (Faker\Generator $faker) {
return [
'name' => $faker->company,
'address' => $faker->streetAddress,
'city' => $faker->city,
'state' => $faker->stateAbbr,
'country' => $faker->countryCode,
'contact' => $faker->name,
'phone' => $faker->phoneNumber,
'email' => $faker->safeEmail,
];
return [
'name' => $faker->company,
'address' => $faker->streetAddress,
'address2' => $faker->secondaryAddress,
'city' => $faker->city,
'state' => $faker->stateAbbr,
'zip' => $faker->postCode,
'country' => $faker->countryCode,
'contact' => $faker->name,
'phone' => $faker->phoneNumber,
'fax' => $faker->phoneNumber,
'email' => $faker->safeEmail,
'url' => $faker->url,
'notes' => $faker->paragraph
];
});
$factory->defineAs(App\Models\Consumable::class, 'consumable', function (Faker\Generator $faker) {
return [
'name' => $faker->text(20),
'company_id' => Company::inRandomOrder()->first()->id,
'category_id' => $faker->numberBetween(16, 20),
'company_id' => $faker->numberBetween(1, 10),
'model_number' => $faker->numberBetween(1000000,50000000),
'item_no' => $faker->numberBetween(1000000,50000000),
'order_number' => $faker->numberBetween(1000000,50000000),
'purchase_date' => $faker->dateTime(),
'purchase_cost' => $faker->randomFloat(2),
'qty' => $faker->numberBetween(5, 10),
'min_amt' => $faker->numberBetween($min = 1, $max = 2),
'company_id' => \App\Models\Company::inRandomOrder()->first()->id
];
});
@@ -171,7 +204,7 @@ $factory->defineAs(App\Models\Statuslabel::class, 'pending', function (Faker\Gen
'deployable' => 0,
'pending' => 1,
'archived' => 0,
'notes' => ''
'notes' => $faker->sentence
];
});
@@ -246,17 +279,20 @@ $factory->defineAs(App\Models\Statuslabel::class, 'lost', function (Faker\Genera
});
$factory->defineAs(App\Models\License::class, 'license', function (Faker\Generator $faker) {
return [
'name' => $faker->catchPhrase,
'serial' => $faker->uuid,
'seats' => $faker->numberBetween(1, 10),
'license_email' => $faker->safeEmail,
'license_name' => $faker->name,
'purchase_date' => $faker->dateTime(),
'purchase_cost' => $faker->randomFloat(2),
'notes' => $faker->sentence,
'company_id' => \App\Models\Company::inRandomOrder()->first()->id
];
return [
'name' => $faker->catchPhrase,
'serial' => $faker->uuid,
'seats' => $faker->numberBetween(1, 10),
'license_email' => $faker->safeEmail,
'license_name' => $faker->name,
'order_number' => $faker->numberBetween(1500, 13250),
'purchase_order' => $faker->numberBetween(1500, 13250),
'purchase_date' => $faker->dateTime(),
'purchase_cost' => $faker->randomFloat(2),
'notes' => $faker->sentence,
'supplier_id' => Supplier::inRandomOrder()->first()->id,
'company_id' => Company::inRandomOrder()->first()->id
];
});
$factory->defineAs(App\Models\LicenseSeat::class, 'license-seat', function (Faker\Generator $faker) {
@@ -270,7 +306,7 @@ $factory->defineAs(App\Models\LicenseSeat::class, 'license-seat', function (Fake
});
$factory->defineAs(App\Models\Actionlog::class, 'asset-checkout', function (Faker\Generator $faker) {
$company = \App\Models\Company::has('users')->has('assets')->inRandomOrder()->first();
$company = Company::has('users')->has('assets')->inRandomOrder()->first();
return [
'user_id' => $company->users()->inRandomOrder()->first()->id,
'action_type' => 'checkout',
@@ -285,7 +321,7 @@ $factory->defineAs(App\Models\Actionlog::class, 'asset-checkout', function (Fake
});
$factory->defineAs(App\Models\Actionlog::class, 'license-checkout-asset', function (Faker\Generator $faker) {
$company = \App\Models\Company::has('users')->has('licenses')->inRandomOrder()->first();
$company = Company::has('users')->has('licenses')->inRandomOrder()->first();
return [
'user_id' => $company->users()->inRandomOrder()->first()->id,
@@ -301,7 +337,7 @@ $factory->defineAs(App\Models\Actionlog::class, 'license-checkout-asset', functi
});
$factory->defineAs(App\Models\Actionlog::class, 'accessory-checkout', function (Faker\Generator $faker) {
$company = \App\Models\Company::has('users')->has('accessories')->inRandomOrder()->first();
$company = Company::has('users')->has('accessories')->inRandomOrder()->first();
return [
'user_id' => $company->users()->inRandomOrder()->first()->id,
'action_type' => 'checkout',
@@ -316,7 +352,7 @@ $factory->defineAs(App\Models\Actionlog::class, 'accessory-checkout', function (
});
$factory->defineAs(App\Models\Actionlog::class, 'consumable-checkout', function (Faker\Generator $faker) {
$company = \App\Models\Company::has('users')->has('consumables')->inRandomOrder()->first();
$company = Company::has('users')->has('consumables')->inRandomOrder()->first();
return [
'user_id' => $company->users()->inRandomOrder()->first()->id,
@@ -332,7 +368,7 @@ $factory->defineAs(App\Models\Actionlog::class, 'consumable-checkout', function
});
$factory->defineAs(App\Models\Actionlog::class, 'component-checkout', function (Faker\Generator $faker) {
$company = \App\Models\Company::has('users')->has('components')->inRandomOrder()->first();
$company = Company::has('users')->has('components')->inRandomOrder()->first();
return [
'user_id' => $company->users()->inRandomOrder()->first()->id,
@@ -357,12 +393,17 @@ $factory->defineAs(App\Models\CustomField::class, 'customfield-ip', function (Fa
$factory->defineAs(App\Models\User::class, 'valid-user', function (Faker\Generator $faker) {
return [
'first_name' => $faker->firstName,
'last_name' => $faker->lastName,
'email' => $faker->safeEmail,
'password' => $faker->password,
'username' => $faker->username,
'company_id' => \App\Models\Company::inRandomOrder()->first()->id
];
return [
'first_name' => $faker->firstName,
'last_name' => $faker->lastName,
'username' => $faker->username,
'password' => $faker->password,
'email' => $faker->safeEmail,
'company_id' => Company::inRandomOrder()->first()->id,
'locale' => $faker->locale,
'employee_num' => $faker->numberBetween(3500, 35050),
'jobtitle' => $faker->word,
'phone' => $faker->phoneNumber,
'notes' => $faker->sentence
];
});
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RenameModelnoToModelNumber extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('models', function (Blueprint $table) {
//
$table->renameColumn('modelno', 'model_number');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('models', function (Blueprint $table) {
//
$table->renameColumn('model_number', 'modelno');
});
}
}
@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RenameConsumableModelnoToModelNumber extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('consumables', function (Blueprint $table) {
//
$table->renameColumn('model_no', 'model_number');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('consumables', function (Blueprint $table) {
//
$table->renameColumn('model_number', 'model_no');
});
}
}
@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RenameModelNoteToNotes extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('models', function (Blueprint $table) {
//
$table->renameColumn('note', 'notes');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('models', function (Blueprint $table) {
//
$table->renameColumn('notes', 'note');
});
}
}
@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RenameComponentTotalQtyToQty extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('components', function (Blueprint $table) {
//
$table->renameColumn('total_qty', 'qty');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('components', function (Blueprint $table) {
//
$table->renameColumn('qty', 'total_qty');
});
}
}
@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RenameComponentSerialNumberToSerial extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('components', function ($table) {
$table->renameColumn('serial_number', 'serial');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('components', function ($table) {
$table->renameColumn('serial', 'serial_number');
});
}
}
@@ -0,0 +1,79 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class IncreasePurchaseCostSize extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
$platform->registerDoctrineTypeMapping('enum', 'string');
Schema::table('assets', function ($table) {
$table->decimal('purchase_cost', 20, 2)->nullable()->default(null)->change();
});
Schema::table('accessories', function ($table) {
$table->decimal('purchase_cost', 20, 2)->nullable()->default(null)->change();
});
Schema::table('asset_maintenances', function ($table) {
$table->decimal('cost', 20, 2)->nullable()->default(null)->change();
});
Schema::table('components', function ($table) {
$table->decimal('purchase_cost', 20, 2)->nullable()->default(null)->change();
});
Schema::table('consumables', function ($table) {
$table->decimal('purchase_cost', 20, 2)->nullable()->default(null)->change();
});
Schema::table('licenses', function ($table) {
$table->decimal('purchase_cost', 20, 2)->nullable()->default(null)->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
$platform->registerDoctrineTypeMapping('enum', 'string');
Schema::table('assets', function ($table) {
$table->decimal('purchase_cost', 8, 2)->nullable()->default(null)->change();
});
Schema::table('accessories', function ($table) {
$table->decimal('purchase_cost', 13, 4)->nullable()->default(null)->change();
});
Schema::table('asset_maintenances', function ($table) {
$table->decimal('cost', 10, 2)->nullable()->default(null)->change();
});
Schema::table('components', function ($table) {
$table->decimal('purchase_cost', 13, 4)->nullable()->default(null)->change();
});
Schema::table('consumables', function ($table) {
$table->decimal('purchase_cost', 13, 4)->nullable()->default(null)->change();
});
Schema::table('licenses', function ($table) {
$table->decimal('purchase_cost', 8, 2)->nullable()->default(null)->change();
});
}
}
@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class LongerStateFieldInLocation extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('locations', function ($table) {
$table->string('state', 32)->nullable()->default(null)->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('locations', function ($table) {
$table->string('state', 2)->nullable()->default(null)->change();
});
}
}
@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddModelNumberToAccessories extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('accessories', function ($table) {
$table->string('model_number')->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('accessories', function ($table) {
$table->dropColumn('model_number');
});
}
}
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
class AddMissingTargetTypeToLogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// Get list of action logs with a target id but not a target type. This fixes missing target_type in accept_asset
DB::table('action_logs')->where('target_type', null)->where(function($query) {
$query->where('action_type', 'accepted')
->orWhere('action_type', 'declined');
})->update(['target_type'=> 'App\Models\User']);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// Nothing to do.
}
}
@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class IncreaseSizeOfStateInSuppliers extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('suppliers', function ($table) {
$table->string('state', 32)->nullable()->default(null)->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('suppliers', function ($table) {
$table->string('state', 2)->nullable()->default(null)->change();
});
}
}
+2 -2
View File
@@ -16,6 +16,8 @@ class DatabaseSeeder extends Seeder
$this->call(CompanySeeder::class);
$this->call(UserSeeder::class);
$this->call(ManufacturerSeeder::class);
$this->call(LocationSeeder::class);
$this->call(AssetModelSeeder::class);
$this->call(AccessorySeeder::class);
$this->call(AssetSeeder::class);
@@ -27,8 +29,6 @@ class DatabaseSeeder extends Seeder
$this->call(LicenseSeeder::class);
$this->call(ActionlogSeeder::class);
$this->call(DepreciationSeeder::class);
$this->call(ManufacturerSeeder::class);
$this->call(LocationSeeder::class);
$this->call(CustomFieldSeeder::class);
Model::reguard();
+2 -2
View File
@@ -1,5 +1,5 @@
var elixir = require('laravel-elixir');
require('laravel-elixir-codeception');
require('laravel-elixir-codeception-standalone');
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
@@ -38,7 +38,7 @@ elixir(function(mix) {
mix.version(['assets/css/app.css','assets/js/all.js']);
mix.codeception();
mix.codeception(null, { flags: '--report' });
+21
View File
@@ -0,0 +1,21 @@
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"devDependencies": {
"bootstrap-sass": "^3.3.7",
"gulp": "^3.9.1",
"jquery": "^3.1.0",
"laravel-elixir": "^6.0.0-11",
"laravel-elixir-vue-2": "^0.2.0",
"laravel-elixir-webpack-official": "^1.0.2",
"lodash": "^4.16.2",
"vue": "^2.0.1",
"vue-resource": "^1.0.3"
},
"dependencies": {
"laravel-elixir-codeception": "^0.2.0"
}
}
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
@@ -5,18 +5,14 @@ return array(
'about_accessories_text' => 'الملحقات هي أي شيء تقوم بتسليمه للمستخدمين لكنه لا يحتوي على رقم تسلسلي (أو أنك لست بحاجة إلى تتبعه بشكل خاص). مثال: فأرة الحاسوب أو لوحة المفاتيح.',
'accessory_category' => 'فئة الملحق',
'accessory_name' => 'اسم الملحق',
'cost' => 'تكلفة شراء',
'checkout' => 'الملحقات المخرجة',
'checkin' => 'إدخالات الملحقات',
'create' => 'إنشاء ملحق',
'date' => 'تاريخ الشراء',
'edit' => 'تعديل الملحق',
'eula_text' => 'إنشاء اتفاقية جديدة',
'eula_text_help' => 'يسمح لك هذا الحقل بتخصيص الاتفاقيات لأنواع معينة من الأصول. اذا كنت تمتلك اتفاقية واحدة لجميع أصولك يمكنك أن تقوم بتأشير المربع في الأسفل لاستخدام الاتفاقية الافتراضية.',
'require_acceptance' => 'مطالبة المستخدمين بتأكيد قبولهم الأصول في هذه الفئة.',
'no_default_eula' => 'ليس هناك اتفاقيات. قم باضافة واحدة من "الاعدادات".',
'order' => 'رقم طلب الشراء',
'qty' => 'الكمية',
'total' => 'المجموع',
'remaining' => 'المتاح',
'update' => 'تحديث الملحق',
@@ -2,8 +2,7 @@
return [
'title' => 'صيانة الاُصل',
'asset_name' => 'الأصل',
'supplier_name' => 'المورد',
'asset_name' => 'Asset Name',
'is_warranty' => 'الضمان',
'dl_csv' => 'التنزيل كملف CSV'
];
@@ -1,8 +1,8 @@
<?php
return array(
'about_asset_categories' => 'عن تصنيفات الأصول',
'about_categories' => 'تصنيفات الأصول تساعدك على ترتيب الأصول. من الأمثلة على التصنيفات &quot; مكاتب &quot;، &quot;أجهزة الكمبيوتر المحمولة &quot;، &quot;الهواتف النقالة &quot;، &quot;أجهزة لوحية &quot; وهكذا، كما يمكنك استخدام التصنيفات بأي طريقة تناسبك. ',
'about_categories_title' => 'About Categories',
'about_categories' => 'Categories help you organize your items. Some example categories might be &quot;Desktops&quot;, &quot;Laptops&quot;, &quot;Mobile Phones&quot;, &quot;Tablets&quot;, and so on, but you can use categories any way that makes sense for you.',
'asset_categories' => 'التصنيفات',
'category_name' => 'اسم التصنيف',
'checkin_email' => 'إرسال إشعار للمستخدم عند الإدخال.',
@@ -1,4 +1,6 @@
<?php
return [
'about_companies_title' => 'About Companies',
'about_companies_text' => 'Companies can be used as a simple identifier field, or can be used to limit visibility of assets, users, etc if full company support is enabled in your Admin settings.',
'select_company' => 'اختر الشركة',
];
@@ -5,11 +5,8 @@ return array(
'about_consumables_text' => 'المواد الاستهلاكية هي الأشياء المشتراة والتي ستستخدم مع مرور الوقت. على سبيل المثال، حبر الطابعة أو ورق الناسخة.',
'checkout' => 'Checkout Consumable to User',
'consumable_name' => 'اسم المادة الإستهلاكية',
'cost' => 'تكلفة الشراء',
'create' => 'إنشاء مادة إستهلاكية',
'date' => 'تاريخ الشراء',
'item_no' => 'رقم القطعة.',
'order' => 'رقم طلب الشراء',
'remaining' => 'المتبقية',
'total' => 'المجموع',
'update' => 'تحديث المادة الإستهلاكية',
@@ -6,7 +6,7 @@ return array(
'about_fieldsets_title' => 'حول مجموعة الحقول',
'about_fieldsets_text' => 'مجموعات-الحقول تسمح لك بإنشاء مجموعات من الحقول اللتي يمكن إعادة إستخدامها مع أنواع موديل محدد.',
'custom_format' => 'Custom format...',
'encrypt_field' => 'Encrypt the value of this field in the database for each asset. The decrypted value of this field will only be viewable by admins.',
'encrypt_field' => 'Encrypt the value of this field in the database',
'encrypt_field_help' => 'WARNING: Encrypting a field makes it unsearchable.',
'encrypted' => 'Encrypted',
'fieldset' => 'مجموعة-حقول',
@@ -15,7 +15,7 @@ return array(
'fieldset_name' => 'إسم مجموعة-الحقل',
'field_name' => 'إسم الحقل',
'field_values' => 'Field Values',
'field_values_help' => 'Add selectable options, one per line. Blank lines other than the first line will be ignored. Separate values and labels by pipes on each line (optional).',
'field_values_help' => 'Add selectable options, one per line. Blank lines other than the first line will be ignored.',
'field_element' => 'عنصر النموذج',
'field_element_short' => 'عنصر',
'field_format' => 'صيغة',
@@ -4,9 +4,9 @@ return array(
'about_asset_depreciations' => 'عن استهلاك الأصول',
'about_depreciations' => 'يمكنك ضبط قيمة إستهلاك الأصول لخفض الأصول على أساس القسط الثابت للاستهلاك.',
'asset_depreciations' => 'استهلاك الأصول',
'create_depreciation' => 'إنشاء الاستهلاك',
'create' => 'Create Depreciation',
'depreciation_name' => 'اسم الاستهلاك',
'number_of_months' => 'عدد الأشهر',
'update_depreciation' => 'تحديث الاستهلاك',
'update' => 'Update Depreciation',
);
+4 -3
View File
@@ -1,10 +1,11 @@
<?php
return array(
'about_groups_title' => 'About Groups',
'about_groups' => 'Groups are used to generalize user permissions.',
'group_management' => 'إدارة المجموعة',
'create_group' => 'إنشاء مجموعة جديدة',
'edit_group' => 'تعديل المجموعة',
'create' => 'Create New Group',
'update' => 'Edit Group',
'group_name' => 'اسم المجموعة',
'group_admin' => 'إدارة المجموعة',
'allow' => 'سماح',
+1 -3
View File
@@ -1,7 +1,7 @@
<?php
return array(
'bulk_delete' => 'إجراء حذف متعدد للاُصول',
'bulk_delete' => 'Confirm Bulk Delete Assets',
'bulk_delete_help' => 'Review the assets for bulk deletion below. Once deleted, these assets can be restored, but they will no longer be associated with any users they are currently assigned to.',
'bulk_delete_warn' => 'You are about to delete :asset_count assets.',
'bulk_update' => 'Bulk Update Assets',
@@ -15,7 +15,6 @@ return array(
'create' => 'Create Asset',
'date' => 'Purchase Date',
'depreciates_on' => 'Depreciates On',
'depreciation' => 'Depreciation',
'default_location' => 'Default Location',
'eol_date' => 'EOL Date',
'eol_rate' => 'EOL Rate',
@@ -35,7 +34,6 @@ return array(
'select_statustype' => 'Select Status Type',
'serial' => 'Serial',
'status' => 'Status',
'supplier' => 'Supplier',
'tag' => 'Asset Tag',
'update' => 'Asset Update',
'warranty' => 'Warranty',
@@ -1,6 +1,8 @@
<?php
return array(
'about_assets_title' => 'About Assets',
'about_assets_text' => 'Assets are items tracked by serial number or asset tag. They tend to be higher value items where identifying a specific item matters.',
'archived' => 'Archived',
'asset' => 'Asset',
'bulk_checkout' => 'Checkout Assets to User',
@@ -4,23 +4,16 @@ return array(
'asset' => 'Asset',
'checkin' => 'Checkin',
'cost' => 'Purchase Cost',
'create' => 'Create License',
'date' => 'Purchase Date',
'depreciation' => 'Depreciation',
'expiration' => 'Expiration Date',
'license_key' => 'Product Key',
'maintained' => 'Maintained',
'name' => 'Software Name',
'no_depreciation' => 'Do Not Depreciate',
'notes' => 'Notes',
'order' => 'Order No.',
'purchase_order' => 'Purchase Order Number',
'reassignable' => 'Reassignable',
'remaining_seats' => 'Remaining Seats',
'seats' => 'Seats',
'serial' => 'Serial',
'supplier' => 'Supplier',
'termination_date' => 'Termination Date',
'to_email' => 'Licensed to Email',
'to_name' => 'Licensed to Name',
+2 -1
View File
@@ -1,7 +1,8 @@
<?php
return array(
'about_licenses_title' => 'About Licenses',
'about_licenses' => 'Licenses are used to track software. They have a specified number of seats that can be checked out to individuals',
'checkin' => 'Checkin License Seat',
'checkout_history' => 'Checkout History',
'checkout' => 'Checkout License Seat',
+1 -1
View File
@@ -23,7 +23,7 @@ return array(
'error' => 'File(s) not uploaded. Please try again.',
'success' => 'File(s) successfully uploaded.',
'nofiles' => 'You did not select any files for upload, or the file you are trying to upload is too large',
'invalidfiles' => 'One or more of your files is too large or is a filetype that is not allowed. Allowed filetypes are png, gif, jpg, doc, docx, pdf, txt, zip, rar, and rtf.',
'invalidfiles' => 'One or more of your files is too large or is a filetype that is not allowed. Allowed filetypes are png, gif, jpg, jpeg, doc, docx, pdf, txt, zip, rar, rtf, xml, and lic.',
),
'update' => array(
+17 -15
View File
@@ -1,18 +1,20 @@
<?php
return array(
'assets_rtd' => 'Assets', // This has NEVER meant Assets Retired. I don't know how it keeps getting reverted.
'assets_checkedout' => 'Assets Assigned',
'id' => 'ID',
'city' => 'City',
'state' => 'State',
'country' => 'Country',
'create' => 'Create Location',
'update' => 'Update Location',
'name' => 'Location Name',
'address' => 'Address',
'zip' => 'Postal Code',
'locations' => 'Locations',
'parent' => 'Parent',
'currency' => 'Location Currency',
);
'about_locations_title' => 'About Locations',
'about_locations' => 'Locations are used to track location information for users, assets, and other items',
'assets_rtd' => 'Assets', // This has NEVER meant Assets Retired. I don't know how it keeps getting reverted.
'assets_checkedout' => 'Assets Assigned',
'id' => 'ID',
'city' => 'City',
'state' => 'State',
'country' => 'Country',
'create' => 'Create Location',
'update' => 'Update Location',
'name' => 'Location Name',
'address' => 'Address',
'zip' => 'Postal Code',
'locations' => 'Locations',
'parent' => 'Parent',
'currency' => 'Location Currency',
);
@@ -1,7 +1,8 @@
<?php
return array(
'about_manufacturers_title' => 'About manufacturers',
'about_manufacturers_text' => 'Manufacturers make all the magic items we consume.',
'asset_manufacturers' => 'Asset Manufacturers',
'create' => 'Create Manufacturer',
'id' => 'ID',
+2 -1
View File
@@ -1,7 +1,8 @@
<?php
return array(
'about_models_title' => 'About Asset Models',
'about_models_text' => 'Asset Models are a way to group identical assets. "MBP 2013", "IPhone 6s", etc.',
'deleted' => 'This model has been deleted. <a href="/hardware/models/:model_id/restore">Click here to restore it</a>.',
'restore' => 'Restore Model',
'requestable' => 'Users may request this model',
+4 -1
View File
@@ -114,12 +114,15 @@ return array(
'two_factor_reset_error' => 'Two factor device reset failed',
'two_factor_enabled_warning' => 'Enabling two-factor if it is not currently enabled will immediately force you to authenticate with a Google Auth enrolled device. You will have the ability to enroll your device if one is not currently enrolled.',
'two_factor_enabled_help' => 'This will turn on two-factor authentication using Google Authenticator.',
'two_factor_optional' => 'Optional (Users can enable or disable)',
'two_factor_optional' => 'Selective (Users can enable or disable if permitted)',
'two_factor_required' => 'Required for all users',
'two_factor_disabled' => 'Disabled',
'two_factor_enter_code' => 'Enter Two-Factor Code',
'two_factor_config_complete' => 'Submit Code',
'two_factor_enabled_edit_not_allowed' => 'Your administrator does not permit you to edit this setting.',
'two_factor_enrollment_text' => "Two factor authentication is required, however your device has not been enrolled yet. Open your Google Authenticator app and scan the QR code below to enroll your device. Once you've enrolled your device, enter the code below",
'require_accept_signature' => 'Require Signature',
'require_accept_signature_help_text' => 'Enabling this feature will require users to physically sign off on accepting an asset.',
'left' => 'left',
'right' => 'right',
'top' => 'top',
@@ -1,6 +1,8 @@
<?php
return array(
'about_suppliers_title' => 'About Suppliers',
'about_suppliers_text' => 'Suppliers are used to track the source of items',
'address' => 'Supplier Address',
'assets' => 'Assets',
'city' => 'City',
@@ -15,4 +15,7 @@ return array(
'software_user' => 'البرامج المسجلة لـ :name',
'view_user' => 'عرض المستخدم :name',
'usercsv' => 'ملف CSV',
'two_factor_admin_optin_help' => 'Your current admin settings allow selective enforcement of two-factor authentication. ',
'two_factor_enrolled' => '2FA Device Enrolled ',
'two_factor_active' => '2FA Active ',
);
+1
View File
@@ -7,6 +7,7 @@ return array(
'account_not_activated' => 'This user account is not activated.',
'account_suspended' => 'This user account is suspended.',
'account_banned' => 'This user account is banned.',
'throttle' => 'Too many failed login attempts. Please try again in :seconds seconds.',
'signin' => array(
'error' => 'There was a problem while trying to log you in, please try again.',
+7
View File
@@ -49,6 +49,8 @@
'custom_report' => 'Custom Asset Report',
'dashboard' => 'Dashboard',
'date' => 'التاريخ',
'debug_warning' => 'Warning!',
'debug_warning_text' => 'This application is running in production mode with debugging enabled. This can expose sensitive data if your application is accessible to the outside world. Disable debug mode by setting the <code>APP_DEBUG</code> value in your <code>.env</code> file to <code>false</code>.',
'delete' => 'حذف',
'deleted' => 'تم حذفها',
'delete_seats' => 'Deleted Seats',
@@ -113,6 +115,7 @@
'no_results' => 'لا يوجد نتائج.',
'no' => 'لا',
'notes' => 'مُلاحظات',
'order_number' => 'Order Number',
'page_menu' => 'Showing _MENU_ items',
'pagination_info' => 'Showing _START_ to _END_ of _TOTAL_ items',
'pending' => 'في انتظار المراجعة',
@@ -121,6 +124,8 @@
'previous' => 'Previous',
'processing' => 'Processing',
'profile' => 'ملفك الشخصي',
'purchase_cost' => 'Purchase Cost',
'purchase_date' => 'Purchase Date',
'qty' => 'QTY',
'quantity' => 'Quantity',
'ready_to_deploy' => 'جاهزة للتوزيع',
@@ -145,11 +150,13 @@
'select_asset' => 'Select Asset',
'settings' => 'الإعدادات',
'sign_in' => 'تسجيل الدخول',
'signature' => 'Signature',
'some_features_disabled' => 'DEMO MODE: Some features are disabled for this installation.',
'site_name' => 'إسم الموقع',
'state' => 'المنطقة / الولاية',
'status_labels' => 'بطاقات الحالة',
'status' => 'الحالة',
'supplier' => 'Supplier',
'suppliers' => 'الموردون',
'submit' => 'Submit',
'total_assets' => 'إجمالي الأصول',
@@ -5,18 +5,14 @@ return array(
'about_accessories_text' => 'Аксесоарите са всички неща, които се изписват на потребителите, но нямат сериен номер (или няма нужда да бъдат конкретно проследявани). Например, това са мишки, клавиатури и др.',
'accessory_category' => 'Категория аксесоари',
'accessory_name' => 'Аксесоар',
'cost' => 'Стойност на закупуване',
'checkout' => 'Checkout Accessory',
'checkin' => 'Checkin Accessory',
'create' => 'Създаване на аксесоар',
'date' => 'Дата на закупуване',
'edit' => 'Edit Accessory',
'eula_text' => 'EULA на категорията',
'eula_text_help' => 'Това поле позволява да задавате различни EULA за всеки тип активи. Ако имате обща EULA за всички активи, можете да използвате кутийката по-долу за да използвате една обща по подразбиране.',
'require_acceptance' => 'Задължаване на потребителите да потвърждават приемането на активи от тази категория.',
'no_default_eula' => 'Няма EULA по подразбиране. Добавете я в Настройки.',
'order' => 'Номер на поръчка',
'qty' => 'Количество',
'total' => 'Oбщо',
'remaining' => 'Наличност',
'update' => 'Обновяване на аксесоар',

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