* Add support for updating assets to the importer.
If an asset with a matching asset tag is found, and the --update flag is
passed to the importer, we edit the matching asset with any
asset-specific values, and persist to the database. Any missing/blank
values are skipped.
TODO: Add to web interface, add support in consumables/accessories
* Allow deleting of files on the import page.
* Extend web interface to allow updating of imported items.
This adds a modal dialog to the import process. Currently the dialog
allows the choice of update vs ignore, and choosing the item type to
import (Accessory, Asset, Consumable).
Also use Helper::ParseFloat() for purchase_cost processing. It exists,
and fixes issues on my end at least.
* Implement editing of consumables and accessories.
* Rename getProcessImportFile to postProcessImportFile to reflect how it's now used
* Fix copy-pasta error.
This does two main things:
1) The importer now imports as numbers, not parsed strings. This allows
is to format values on output instead of input, which is what was
happening in most places.
2) Add a Helper::parseCurrencyString method and port everything to use
this. This checks to see if the value is numeric or empty, and returns
the appropriate value in all cases. Should fix all known occurances of
number_format expections.
* Prevent multiple checkouts of the same asset.
This adds a new method to the Asset model, availableForCheckout.
Port getDataTable to use availableForCheckout instead of doing the
check manually.
Fixes Issue #2347
* Use availableForCheckout in categories controller. Also gate the checkin/checkout actions here.
* Use gate and availableForCheckout in manufactuers as well.
The importer already formatted/parsed numbers on input into the db
(maybe it shouldn't have?) so running number_format on that string
throws an exception. Check to make sure the value is numeric before
formatting it.
* components.view should point to view, not create
* Fix comment
* Rename variable to accurately reflect its responsibility
* Fix line breaks in serial key, remove places where adding line breaks makes no sense. Fixes#2344
* If a user doesn't belong to a company, when scoping to a company we should only show items that don't belong to a company.
* Scope tables/items to the company they belong to when fetching items for the index.
* Fix asset count to also scope to company. This fixes dashboard view
* Exempt super users from the child company check to be consistent. Fixes license count on dashboard now that we scope everything
* Fix adding an image to an asset when public/uploads/assets does not exist.
First check to see if we can create directory and do so. If any errors occur, display the error string as an error on the page.
* Add the public/uploads/assets directory to new installs.
* Add some comments explaining this code so I remember what it does next time.
* Add model number column to the hardware list and allow searching based on model number. Column is hidden by default.
* Fix sorting. Add scope to order by model number.
If the requestable checkbox was not checked, it did not exist in the request.
Setting requestable to null in such a case would cause a violation because it should be 0/1.
Also fix a copy/paste where we reset requestable after checking for rtd_location_id.
1) Missing $admin_user in AccessoriesController::postCheckout(). Fixes#2183
2) AssetsController::postCheckin used the hardware url for the user link, not the user url
This allows for centralizing the category fetching code more and fixes
an error in asset model viewing (#2118). Also add a few translated
strings and standardize on a base of 'Select a *' for the default value
in our lists.