Merge branch 'develop'

# Conflicts:
#	snipeit.sh
This commit is contained in:
snipe 2017-10-05 23:14:13 -07:00
commit 8919c3b52a
3 changed files with 18 additions and 4 deletions

View file

@ -815,6 +815,7 @@ class Asset extends Depreciable
{
return $query->where(function ($query) use ($filter) {
foreach ($filter as $key => $search_val) {
if ($key =='asset_tag') {
$query->where('assets.asset_tag', 'LIKE', '%'.$search_val.'%');
}
@ -914,11 +915,13 @@ class Asset extends Depreciable
}
foreach (CustomField::all() as $field) {
if (array_key_exists($field->db_column_name(), $filter)) {
$query->orWhere($field->db_column_name(), 'LIKE', "%$search_val%");
if (array_key_exists('custom_fields.'.$field->db_column_name(), $filter)) {
$query->orWhere($field->db_column_name(), 'LIKE', '%' . $search_val . '%');
}
}
});
}

View file

@ -1,7 +1,13 @@
# ensure running as root
if [ "$(id -u)" != "0" ]; then
#Debian doesnt have sudo if root has a password.
if ! hash sudo 2>/dev/null; then
exec su -c "$0" "$@"
else
exec sudo "$0" "$@"
fi
fi
wget https://raw.githubusercontent.com/snipe/snipe-it/master/snipeit.sh
chmod 744 snipeit.sh
sudo ./snipeit.sh 2>&1 | sudo tee -a /var/log/snipeit-install.log

View file

@ -311,6 +311,11 @@ $('.snipe-table').bootstrapTable({
// for custom fields in a more useful way.
function customFieldsFormatter(value, row) {
if ((!this) || (!this.title)) {
return '';
}
var field_column = this.title;
// Pull out any HTMl that might be passed via the presenter