From d86b5aa613f32268160c675e8e0bd6e4afdf37d2 Mon Sep 17 00:00:00 2001 From: snipe Date: Sun, 8 Feb 2015 16:20:24 -0800 Subject: [PATCH 01/36] Bumped version --- app/views/backend/layouts/default.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/backend/layouts/default.blade.php b/app/views/backend/layouts/default.blade.php index 2b25b2e026..fb79abd560 100644 --- a/app/views/backend/layouts/default.blade.php +++ b/app/views/backend/layouts/default.blade.php @@ -360,7 +360,7 @@ Documentation | Help Translate It! | Report a Bug -     (v1.2.2)

+     (v1.2.3)

From cfebe1175584d6edbbd5da7d6b8ae167b91df71a Mon Sep 17 00:00:00 2001 From: snipe Date: Sun, 8 Feb 2015 16:20:36 -0800 Subject: [PATCH 02/36] Updated docs for 4.2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 73c2e3bab8..2a0cbbc6a3 100755 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This is a FOSS project for asset management in IT Operations. Knowing who has which laptop, when it was purchased in order to depreciate it correctly, handling software licenses, etc. -It is built on [Laravel 4.1](http://laravel.com) and uses the [Sentry 2](https://github.com/cartalyst/sentry) package. +It is built on [Laravel 4.2](http://laravel.com) and uses the [Sentry 2](https://github.com/cartalyst/sentry) package. This project is being actively developed and we're [releasing quite frequently](https://github.com/snipe/snipe-it/releases). ([Check out the live demo here](http://snipeitapp.com/demo.php).) From 95ae26eb2acf5c94d628cb25415447772744a1e1 Mon Sep 17 00:00:00 2001 From: snipe Date: Sun, 8 Feb 2015 16:21:33 -0800 Subject: [PATCH 03/36] Updated docs location --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a0cbbc6a3..75aee597d8 100755 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ __This is web-based software__. This means there there is no executable file (ak ----- ### Documentation & Installation -__Installation and configuration documentation for this project has been moved to http://docs.snipeitapp.com.__ This provides a more easily navigated, organized view of the documentation, and is based off of the [documentation branch](https://github.com/snipe/snipe-it/tree/documentation) in this repo. Contributions and bugfixes to the documentation are always welcome! +__Installation and configuration documentation for this project has been moved to http://snipeitapp.com/documentation/.__ We'll be adding a long-overdue user's manual soon as well. From 389c27b2e691743eb361cc1fbe4ece4259ae6046 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 9 Feb 2015 00:34:29 -0800 Subject: [PATCH 04/36] Fixes #477 - wrong sidebar on asset view --- app/views/backend/hardware/view.blade.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/views/backend/hardware/view.blade.php b/app/views/backend/hardware/view.blade.php index dfb82e3fac..b234c99d3e 100755 --- a/app/views/backend/hardware/view.blade.php +++ b/app/views/backend/hardware/view.blade.php @@ -279,10 +279,13 @@
  • {{{ $asset->assigneduser->phone }}}
  • @endif +

  • @lang('admin/hardware/general.checkin')
  • + @elseif (($asset->status_id ) && ($asset->status_id > 1)) + @if ($asset->assetstatus)

    {{{ $asset->assetstatus->name }}} @@ -297,16 +300,14 @@ @endif - @elseif ($asset->status_id == NULL) -

    @lang('admin/hardware/general.pending')
    -
    -
    - - @lang('admin/hardware/message.undeployable') -
    -
    - @else + @elseif ($asset->status_id == NULL) + +

    @lang('admin/hardware/general.pending')
    + + + @elseif ($asset->status_id == 0) +

    @lang('admin/hardware/general.checkout')
    + @endif - @elseif (($asset->status_id ) && ($asset->status_id > 1)) - + @if (($asset->status_id ) && ($asset->status_id > 1)) + @if ($asset->assetstatus)

    {{{ $asset->assetstatus->name }}} @lang('admin/hardware/general.asset')
    + @if ($asset->assetstatus->notes)
    -
    - - @lang('admin/hardware/message.undeployable') +
    + + {{{ $asset->assetstatus->notes }}}
    + @endif
    - @endif - - - @elseif ($asset->status_id == NULL) - -

    @lang('admin/hardware/general.pending')
    - - - @elseif ($asset->status_id == 0) - -

    @lang('admin/hardware/general.checkout')
    -
      -
    • This asset is not checked out to anyone yet. Use the button below to check it out now.
    • -


    • Checkout Asset
    • -
    + @endif @endif +
    diff --git a/app/views/backend/reports/asset.blade.php b/app/views/backend/reports/asset.blade.php index e1a5b8fbef..197d43e363 100644 --- a/app/views/backend/reports/asset.blade.php +++ b/app/views/backend/reports/asset.blade.php @@ -34,6 +34,7 @@ @lang('general.name') @endif @lang('admin/hardware/table.serial') + @lang('admin/hardware/table.status') @lang('admin/hardware/table.purchase_date') @lang('admin/hardware/table.purchase_cost') @lang('admin/hardware/form.order') @@ -54,11 +55,19 @@ @endif {{{ $asset->model->name }}} - {{{ $asset->model->modelno }}} + {{{ $asset->model->modelno }}} @if (Setting::getSettings()->display_asset_name) {{{ $asset->name }}} @endif {{ $asset->serial }} + + + @if ($asset->assetstatus) + {{{ $asset->assetstatus->name }}} + @elseif ($asset->assigneduser) + {{{ $asset->assigneduser->fullName() }}} + @endif + {{{ $asset->purchase_date }}} @lang('general.currency') {{{ number_format($asset->purchase_cost) }}} diff --git a/app/views/backend/statuslabels/edit.blade.php b/app/views/backend/statuslabels/edit.blade.php index 957c8d174f..14072b00e7 100755 --- a/app/views/backend/statuslabels/edit.blade.php +++ b/app/views/backend/statuslabels/edit.blade.php @@ -50,6 +50,32 @@ + + +
    + +
    + + {{ $errors->first('notes', ' :message') }} +
    +
    + + + +
    + + +
    + {{ Form::select('statuslabel_types', $statuslabel_types , $use_statuslabel_type, array('class'=>'select2', 'style'=>'min-width:400px')) }} + {{ $errors->first('notes', ' :message') }} + {{ $errors->first('status_type', ' :message') }} +
    +
    + + + +
    diff --git a/app/views/backend/statuslabels/index.blade.php b/app/views/backend/statuslabels/index.blade.php index e31cf43ef3..f211d25b3d 100755 --- a/app/views/backend/statuslabels/index.blade.php +++ b/app/views/backend/statuslabels/index.blade.php @@ -28,6 +28,7 @@ @lang('admin/statuslabels/table.name') + @lang('admin/statuslabels/table.status_type') @lang('table.actions') @@ -35,6 +36,17 @@ @foreach ($statuslabels as $statuslabel) {{{ $statuslabel->name }}} + + @if ($statuslabel->deployable == 1) + @lang('admin/statuslabels/table.deployable') + @elseif ($statuslabel->pending == 1) + @lang('admin/statuslabels/table.pending') + @elseif ($statuslabel->archived == 1) + @lang('admin/statuslabels/table.archived') + @else + @lang('admin/statuslabels/table.undeployable') + @endif + Date: Tue, 10 Feb 2015 16:06:24 -0800 Subject: [PATCH 13/36] Small fix for pending status --- app/models/Asset.php | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/app/models/Asset.php b/app/models/Asset.php index 34e232e960..c447cd593e 100755 --- a/app/models/Asset.php +++ b/app/models/Asset.php @@ -233,7 +233,7 @@ class Asset extends Elegant { return $query->whereHas('assetstatus',function($query) { - $query->where('pending','=',1); + $query->where('deployable','=',0)->where('pending','=',1)->where('archived','=',0); }); } @@ -249,7 +249,7 @@ class Asset extends Elegant { return $query->whereHas('assetstatus',function($query) { - $query->where('deployable','=',1); + $query->where('deployable','=',1)->where('pending','=',0)->where('archived','=',0); }); } @@ -267,11 +267,28 @@ class Asset extends Elegant { return $query->whereHas('assetstatus',function($query) { - $query->where('deployable','=',0); + $query->where('deployable','=',0)->where('pending','=',0)->where('archived','=',0); }); } + /** + * Query builder scope for Archived assets + * + * @param Illuminate\Database\Query\Builder $query Query builder instance + * @return Illuminate\Database\Query\Builder Modified query builder + */ + + public function scopeArchived($query) + { + return $query->whereHas('assetstatus',function($query) + { + $query->where('deployable','=',0)->where('pending','=',0)->where('archived','=',1); + }); + } + + + /** * Query builder scope for Deployed assets * From 1db1819a56f53ff8df1ea6f0b7c4f6195d397d2a Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 16:06:33 -0800 Subject: [PATCH 14/36] Added Archived as view for filter --- app/controllers/admin/AssetsController.php | 2 ++ app/database/seeds/StatuslabelsSeeder.php | 12 ++++++++++++ app/views/backend/layouts/default.blade.php | 1 + 3 files changed, 15 insertions(+) diff --git a/app/controllers/admin/AssetsController.php b/app/controllers/admin/AssetsController.php index 6c2474dd21..32df7dce2a 100755 --- a/app/controllers/admin/AssetsController.php +++ b/app/controllers/admin/AssetsController.php @@ -46,6 +46,8 @@ class AssetsController extends AdminController $assets->RTD(); } elseif (Input::get('Undeployable')) { $assets->Undeployable(); + } elseif (Input::get('Archived')) { + $assets->Archived(); } elseif (Input::get('Deployed')) { $assets->Deployed(); } diff --git a/app/database/seeds/StatuslabelsSeeder.php b/app/database/seeds/StatuslabelsSeeder.php index 6531b778dc..5ec3bf2cd8 100755 --- a/app/database/seeds/StatuslabelsSeeder.php +++ b/app/database/seeds/StatuslabelsSeeder.php @@ -34,6 +34,18 @@ class StatuslabelsSeeder extends Seeder 'notes' => '' ); + $status[] = array( + 'name' => 'Archived', + 'created_at' => $date->modify('-10 day'), + 'updated_at' => $date->modify('-3 day'), + 'user_id' => 1, + 'deleted_at' => NULL, + 'deployable' => 0, + 'pending' => 0, + 'archived' => 1, + 'notes' => 'These assets are permanently undeployable' + ); + $status[] = array( 'name' => 'Out for Diagnostics', diff --git a/app/views/backend/layouts/default.blade.php b/app/views/backend/layouts/default.blade.php index fb79abd560..81bbfd3fdd 100644 --- a/app/views/backend/layouts/default.blade.php +++ b/app/views/backend/layouts/default.blade.php @@ -242,6 +242,7 @@
  • @lang('general.pending')
  • @lang('general.undeployable')
  • @lang('general.list_all')
  • +
  • @lang('admin/hardware/general.archived')
  •  
  • @lang('general.asset_models')
  • @lang('general.categories')
  • From e29da5521de61a6816ae7c2bd6e85359f15f8a7a Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 16:08:02 -0800 Subject: [PATCH 15/36] Moved location of archived link --- app/views/backend/layouts/default.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/backend/layouts/default.blade.php b/app/views/backend/layouts/default.blade.php index 81bbfd3fdd..0b852d3fa6 100644 --- a/app/views/backend/layouts/default.blade.php +++ b/app/views/backend/layouts/default.blade.php @@ -241,9 +241,9 @@
  • @lang('general.ready_to_deploy')
  • @lang('general.pending')
  • @lang('general.undeployable')
  • -
  • @lang('general.list_all')
  • -
  • @lang('admin/hardware/general.archived')
  • +
  • @lang('admin/hardware/general.archived')
  •  
  • +
  • @lang('general.list_all')
  • @lang('general.asset_models')
  • @lang('general.categories')
  • From f175f52530e58bd5ab80139c526fc7838750cb11 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 16:08:54 -0800 Subject: [PATCH 16/36] Fixed spacer in sidenav for list all --- app/views/backend/layouts/default.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/backend/layouts/default.blade.php b/app/views/backend/layouts/default.blade.php index 0b852d3fa6..9a1fcd378a 100644 --- a/app/views/backend/layouts/default.blade.php +++ b/app/views/backend/layouts/default.blade.php @@ -242,8 +242,8 @@
  • @lang('general.pending')
  • @lang('general.undeployable')
  • @lang('admin/hardware/general.archived')
  • -
  •  
  • @lang('general.list_all')
  • +
  •  
  • @lang('general.asset_models')
  • @lang('general.categories')
  • From 283d2855d7861dfda65cbd4c6110abab60990af5 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 16:22:02 -0800 Subject: [PATCH 17/36] Added user_id to status label migration for strict mode --- .../2015_02_10_040958_fix_bad_assigned_to_ids.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/database/migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php b/app/database/migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php index 21561894e4..6f2303a3c7 100644 --- a/app/database/migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php +++ b/app/database/migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php @@ -22,9 +22,9 @@ class FixBadAssignedToIds extends Migration { $table->text('notes')->nullable(); }); - DB::statement('INSERT into ' . DB::getTablePrefix() . 'status_labels (name, deployable, pending, archived, notes) VALUES ("Pending",0,1,0,"These assets are not yet ready to be depoloyed, usually because of configuration or waiting on parts.")'); - DB::statement('INSERT into ' . DB::getTablePrefix() . 'status_labels (name, deployable, pending, archived, notes) VALUES ("Ready to Deploy",1,0,0,"These assets are ready to deploy.")'); - DB::statement('INSERT into ' . DB::getTablePrefix() . 'status_labels (name, deployable, pending, archived, notes) VALUES ("Archived",0,0,1,"These assets are no longer in circulation or viable.")'); + DB::statement('INSERT into ' . DB::getTablePrefix() . 'status_labels (user_id, name, deployable, pending, archived, notes) VALUES (1,"Pending",0,1,0,"These assets are not yet ready to be depoloyed, usually because of configuration or waiting on parts.")'); + DB::statement('INSERT into ' . DB::getTablePrefix() . 'status_labels (user_id, name, deployable, pending, archived, notes) VALUES (1,"Ready to Deploy",1,0,0,"These assets are ready to deploy.")'); + DB::statement('INSERT into ' . DB::getTablePrefix() . 'status_labels (user_id, name, deployable, pending, archived, notes) VALUES (1,"Archived",0,0,1,"These assets are no longer in circulation or viable.")'); } From b36d73a4bb0820f07dfdfe818e61336edec614ba Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 17:03:13 -0800 Subject: [PATCH 18/36] Missing checkin buttons on index --- app/views/backend/hardware/index.blade.php | 5 ++++- app/views/backend/layouts/default.blade.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/backend/hardware/index.blade.php b/app/views/backend/hardware/index.blade.php index 86698d762a..80ef504082 100755 --- a/app/views/backend/hardware/index.blade.php +++ b/app/views/backend/hardware/index.blade.php @@ -38,8 +38,11 @@ @if ($assets->count() > 0) + +
    + @@ -125,7 +128,7 @@ @endif
    @lang('admin/hardware/table.asset_tag') - @if ($asset->status_id < 1 ) + @if ($asset->assetstatus->deployable ==1 ) @if ($asset->assigned_to != 0) @lang('general.checkin') @else diff --git a/app/views/backend/layouts/default.blade.php b/app/views/backend/layouts/default.blade.php index 9a1fcd378a..0c24a47aa8 100644 --- a/app/views/backend/layouts/default.blade.php +++ b/app/views/backend/layouts/default.blade.php @@ -361,7 +361,7 @@ Documentation | Help Translate It! | Report a Bug -     (v1.2.3)

    +     (v1.2.4)

    From 2277b6ee699a78108523eee11695a280e76b1bb4 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 17:04:15 -0800 Subject: [PATCH 19/36] Fixed checkout logic for new assigned_to --- app/views/backend/hardware/index.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/backend/hardware/index.blade.php b/app/views/backend/hardware/index.blade.php index 80ef504082..bafe4c3e42 100755 --- a/app/views/backend/hardware/index.blade.php +++ b/app/views/backend/hardware/index.blade.php @@ -129,7 +129,7 @@
    @if ($asset->assetstatus->deployable ==1 ) - @if ($asset->assigned_to != 0) + @if ($asset->assigned_to !='') @lang('general.checkin') @else @lang('general.checkout') From dbc93de6b3966470f83254547f8029c60f489490 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 17:11:40 -0800 Subject: [PATCH 20/36] Fixes checkin button on view --- app/views/backend/hardware/view.blade.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/views/backend/hardware/view.blade.php b/app/views/backend/hardware/view.blade.php index ba6f027e93..b7f44721c9 100755 --- a/app/views/backend/hardware/view.blade.php +++ b/app/views/backend/hardware/view.blade.php @@ -252,7 +252,7 @@

    @endif - @if ((isset($asset->assigned_to ) && ($asset->assigned_to > 0))) + @if ((isset($asset->assigneduser) && ($asset->assigned_to > 0)))

    @lang('admin/hardware/form.checkedout_to')
      @@ -285,13 +285,24 @@ @endif - @if (($asset->status_id ) && ($asset->status_id > 1)) + @if (($asset->status_id ) && ($asset->status_id > 0)) @if ($asset->assetstatus)

      {{{ $asset->assetstatus->name }}} @lang('admin/hardware/general.asset')
      + + @if ($asset->assetstatus->notes)
      From c06a4d4118039d112b69e48f9d4efc2be796f2e0 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 17:17:33 -0800 Subject: [PATCH 21/36] Fixed wonky checkin/checkout buttons --- app/views/backend/hardware/index.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/backend/hardware/index.blade.php b/app/views/backend/hardware/index.blade.php index bafe4c3e42..03bd845e33 100755 --- a/app/views/backend/hardware/index.blade.php +++ b/app/views/backend/hardware/index.blade.php @@ -128,8 +128,8 @@ @endif
    - @if ($asset->assetstatus->deployable ==1 ) - @if ($asset->assigned_to !='') + @if ($asset->assetstatus->deployable == 1 ) + @if (($asset->assigned_to !='') && ($asset->assigned_to > 0)) @lang('general.checkin') @else @lang('general.checkout') From 31f4ba88f655e1386f2f4f0efae84399f7aa6d52 Mon Sep 17 00:00:00 2001 From: madd15 Date: Wed, 11 Feb 2015 11:49:28 +1030 Subject: [PATCH 22/36] Fix RTD query to not display checked out asset --- app/models/Asset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/Asset.php b/app/models/Asset.php index c447cd593e..cfca20b560 100755 --- a/app/models/Asset.php +++ b/app/models/Asset.php @@ -249,7 +249,7 @@ class Asset extends Elegant { return $query->whereHas('assetstatus',function($query) { - $query->where('deployable','=',1)->where('pending','=',0)->where('archived','=',0); + $query->where('deployable','=',1)->where('pending','=',0)->where('archived','=',0)->whereNULL('assigned_to'); }); } From 3645f857317e3c925f15109129bb21fa9984d979 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 17:23:25 -0800 Subject: [PATCH 23/36] Typo :( --- .../migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/database/migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php b/app/database/migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php index 6f2303a3c7..93a676f89e 100644 --- a/app/database/migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php +++ b/app/database/migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php @@ -22,7 +22,7 @@ class FixBadAssignedToIds extends Migration { $table->text('notes')->nullable(); }); - DB::statement('INSERT into ' . DB::getTablePrefix() . 'status_labels (user_id, name, deployable, pending, archived, notes) VALUES (1,"Pending",0,1,0,"These assets are not yet ready to be depoloyed, usually because of configuration or waiting on parts.")'); + DB::statement('INSERT into ' . DB::getTablePrefix() . 'status_labels (user_id, name, deployable, pending, archived, notes) VALUES (1,"Pending",0,1,0,"These assets are not yet ready to be deployed, usually because of configuration or waiting on parts.")'); DB::statement('INSERT into ' . DB::getTablePrefix() . 'status_labels (user_id, name, deployable, pending, archived, notes) VALUES (1,"Ready to Deploy",1,0,0,"These assets are ready to deploy.")'); DB::statement('INSERT into ' . DB::getTablePrefix() . 'status_labels (user_id, name, deployable, pending, archived, notes) VALUES (1,"Archived",0,0,1,"These assets are no longer in circulation or viable.")'); From 1b93c5538a98aa42a27cd08cd1c806db79e4b89c Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 17:41:19 -0800 Subject: [PATCH 24/36] Get trashed for admins --- app/models/Actionlog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/Actionlog.php b/app/models/Actionlog.php index beea14de73..71179d7f65 100755 --- a/app/models/Actionlog.php +++ b/app/models/Actionlog.php @@ -26,7 +26,7 @@ class Actionlog extends Eloquent public function adminlog() { - return $this->belongsTo('User','user_id'); + return $this->belongsTo('User','user_id')->withTrashed(); } public function userlog() From 5f1227d0fac114bbf83e381450e498370ee577a4 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 17:41:27 -0800 Subject: [PATCH 25/36] Removed stray chars --- app/views/backend/hardware/view.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/backend/hardware/view.blade.php b/app/views/backend/hardware/view.blade.php index b7f44721c9..5c5adce7e1 100755 --- a/app/views/backend/hardware/view.blade.php +++ b/app/views/backend/hardware/view.blade.php @@ -298,7 +298,7 @@ @elseif (($asset->assetstatus->deployable=='1') && (($asset->assigned_to=='') || ($asset->assigned_to==0)))

  • @lang('admin/hardware/general.checkout')
  • @else - popo + {{ $asset->assigned_to }} @endif From 268fb98dbbd61565d937311874054ce2975da432 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 17:41:42 -0800 Subject: [PATCH 26/36] Indented for better readibility --- app/views/backend/hardware/index.blade.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/backend/hardware/index.blade.php b/app/views/backend/hardware/index.blade.php index 03bd845e33..1b5783d161 100755 --- a/app/views/backend/hardware/index.blade.php +++ b/app/views/backend/hardware/index.blade.php @@ -129,11 +129,11 @@
    @if ($asset->assetstatus->deployable == 1 ) - @if (($asset->assigned_to !='') && ($asset->assigned_to > 0)) - @lang('general.checkin') - @else - @lang('general.checkout') - @endif + @if (($asset->assigned_to !='') && ($asset->assigned_to > 0)) + @lang('general.checkin') + @else + @lang('general.checkout') + @endif @endif From 5867c604104781c351f870ff3e0fd4b4d6eeb35a Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 17:58:47 -0800 Subject: [PATCH 27/36] Fixed scope chaining on assigned_to --- app/models/Asset.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/Asset.php b/app/models/Asset.php index cfca20b560..fbcccb72db 100755 --- a/app/models/Asset.php +++ b/app/models/Asset.php @@ -247,9 +247,9 @@ class Asset extends Elegant public function scopeRTD($query) { - return $query->whereHas('assetstatus',function($query) + return $query->whereNULL('assigned_to')->whereHas('assetstatus',function($query) { - $query->where('deployable','=',1)->where('pending','=',0)->where('archived','=',0)->whereNULL('assigned_to'); + $query->where('deployable','=',1)->where('pending','=',0)->where('archived','=',0); }); } From 0aa4d2a3db572da2ada799a75a97fffacb3533b4 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 18:06:55 -0800 Subject: [PATCH 28/36] Added undeployable as allowed validation type --- app/models/Statuslabel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/Statuslabel.php b/app/models/Statuslabel.php index 35919be758..5cca696e1e 100755 --- a/app/models/Statuslabel.php +++ b/app/models/Statuslabel.php @@ -9,7 +9,7 @@ class Statuslabel extends Elegant protected $rules = array( 'name' => 'required|alpha_space|min:2|max:100|unique:status_labels,name,{id}', - 'statuslabel_types' => 'required|in:deployable,pending,archived', + 'statuslabel_types' => 'required|in:deployable,pending,archived,undeployable', ); public function has_assets() From a2178392e65bcc35594d516a20f67eea8466e5c1 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 18:09:36 -0800 Subject: [PATCH 29/36] Fixed seeder --- app/database/seeds/AssetsSeeder.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/database/seeds/AssetsSeeder.php b/app/database/seeds/AssetsSeeder.php index 1ce0e24ed8..ac20850cf3 100755 --- a/app/database/seeds/AssetsSeeder.php +++ b/app/database/seeds/AssetsSeeder.php @@ -22,10 +22,10 @@ class AssetsSeeder extends Seeder 'created_at' => $date->modify('-10 day'), 'updated_at' => $date->modify('-3 day'), 'user_id' => 1, - 'assigned_to' => 0, + 'assigned_to' => NULL, 'physical' => 1, 'archived' => 0, - 'status_id' => 2, + 'status_id' => 1, 'notes' => '', 'deleted_at' => NULL, 'archived' => '0', @@ -45,7 +45,7 @@ class AssetsSeeder extends Seeder 'created_at' => $date->modify('-10 day'), 'updated_at' => $date->modify('-3 day'), 'user_id' => 1, - 'assigned_to' => 0, + 'assigned_to' => NULL, 'physical' => 1, 'archived' => 0, 'status_id' => 1, @@ -69,7 +69,7 @@ class AssetsSeeder extends Seeder 'created_at' => $date->modify('-10 day'), 'updated_at' => $date->modify('-3 day'), 'user_id' => 1, - 'assigned_to' => 0, + 'assigned_to' => NULL, 'physical' => 1, 'archived' => 0, 'status_id' => 2, @@ -92,7 +92,7 @@ class AssetsSeeder extends Seeder 'created_at' => $date->modify('-10 day'), 'updated_at' => $date->modify('-3 day'), 'user_id' => 1, - 'assigned_to' => 0, + 'assigned_to' => NULL, 'physical' => 1, 'archived' => 0, 'status_id' => 1, @@ -115,7 +115,7 @@ class AssetsSeeder extends Seeder 'created_at' => $date->modify('-10 day'), 'updated_at' => $date->modify('-3 day'), 'user_id' => 2, - 'assigned_to' => 0, + 'assigned_to' => NULL, 'physical' => 1, 'archived' => 0, 'status_id' => 2, @@ -185,7 +185,7 @@ class AssetsSeeder extends Seeder 'created_at' => $date->modify('-10 day'), 'updated_at' => $date->modify('-3 day'), 'user_id' => 2, - 'assigned_to' => 0, + 'assigned_to' => NULL, 'physical' => 1, 'archived' => 0, 'status_id' => '3', @@ -208,7 +208,7 @@ class AssetsSeeder extends Seeder 'created_at' => $date->modify('-10 day'), 'updated_at' => $date->modify('-3 day'), 'user_id' => 1, - 'assigned_to' => 0, + 'assigned_to' => NULL, 'physical' => 1, 'archived' => 0, 'status_id' => '2', @@ -231,7 +231,7 @@ class AssetsSeeder extends Seeder 'created_at' => $date->modify('-10 day'), 'updated_at' => $date->modify('-3 day'), 'user_id' => 1, - 'assigned_to' => 0, + 'assigned_to' => NULL, 'physical' => 1, 'archived' => 1, 'status_id' => '4', @@ -254,7 +254,7 @@ class AssetsSeeder extends Seeder 'created_at' => $date->modify('-10 day'), 'updated_at' => $date->modify('-3 day'), 'user_id' => 1, - 'assigned_to' => 0, + 'assigned_to' => NULL, 'physical' => 1, 'archived' => 1, 'status_id' => '3', @@ -277,7 +277,7 @@ class AssetsSeeder extends Seeder 'created_at' => $date->modify('-10 day'), 'updated_at' => $date->modify('-3 day'), 'user_id' => 2, - 'assigned_to' => 0, + 'assigned_to' => NULL, 'physical' => 1, 'archived' => 0, 'status_id' => 1, From 7715731c4a2e423afb94873227eb728ad4877221 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 18:26:35 -0800 Subject: [PATCH 30/36] Fix count in header --- app/models/Asset.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/Asset.php b/app/models/Asset.php index fbcccb72db..f6483798c7 100755 --- a/app/models/Asset.php +++ b/app/models/Asset.php @@ -90,7 +90,8 @@ class Asset extends Elegant */ public static function availassetcount() { - return Asset::orderBy('asset_tag', 'ASC')->where('status_id', '=', 0)->whereNull('assigned_to')->where('physical', '=', 1)->count(); + return Asset::RTD()->count(); + } /** From 9bcc9a7ed1fc533ab55a507d96b413a7c4917b8d Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 18:27:00 -0800 Subject: [PATCH 31/36] Check not deleted --- app/models/Asset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/Asset.php b/app/models/Asset.php index f6483798c7..c6223dd73b 100755 --- a/app/models/Asset.php +++ b/app/models/Asset.php @@ -90,7 +90,7 @@ class Asset extends Elegant */ public static function availassetcount() { - return Asset::RTD()->count(); + return Asset::RTD()->whereNull('deleted_at')->count(); } From c2e532e32e4943e251dcb5fdd005e9b65d9798a5 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 18:33:19 -0800 Subject: [PATCH 32/36] Fixed language file for status label messages --- app/lang/en/admin/statuslabels/message.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/lang/en/admin/statuslabels/message.php b/app/lang/en/admin/statuslabels/message.php index 98280082ef..de5d901281 100755 --- a/app/lang/en/admin/statuslabels/message.php +++ b/app/lang/en/admin/statuslabels/message.php @@ -2,18 +2,18 @@ return array( - 'does_not_exist' => 'Location does not exist.', - 'assoc_users' => 'This location is currently associated with at least one user and cannot be deleted. Please update your users to no longer reference this location and try again. ', + 'does_not_exist' => 'Status label does not exist.', + 'assoc_users' => 'This status label is currently associated with at least one user and cannot be deleted. Please update your users to no longer reference this location and try again. ', 'create' => array( - 'error' => 'Location was not created, please try again.', - 'success' => 'Location created successfully.' + 'error' => 'Status label was not created, please try again.', + 'success' => 'Status label created successfully.' ), 'update' => array( - 'error' => 'Location was not updated, please try again', - 'success' => 'Location updated successfully.' + 'error' => 'Status label was not updated, please try again', + 'success' => 'Status label updated successfully.' ), 'delete' => array( From f36029a34a696d89b1058c9abdca7953d51e2bc4 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 18:41:45 -0800 Subject: [PATCH 33/36] Fixed migration for to set assigned_to to null per #506 --- .../migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/database/migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php b/app/database/migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php index 93a676f89e..5ca94c54a2 100644 --- a/app/database/migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php +++ b/app/database/migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php @@ -13,7 +13,7 @@ class FixBadAssignedToIds extends Migration { public function up() { // - DB::statement('update ' . DB::getTablePrefix() . 'assets SET assigned_to=NULL where assigned_to=0'); + DB::update('update ' . DB::getTablePrefix() . 'assets SET assigned_to=NULL where assigned_to=0'); Schema::table('status_labels', function ($table) { $table->boolean('deployable')->default(0); From fa9cf35ff507d7ce1dc456e0bfb407f0ec83178e Mon Sep 17 00:00:00 2001 From: madd15 Date: Wed, 11 Feb 2015 13:43:19 +1030 Subject: [PATCH 34/36] Added Archived Lang --- app/lang/en/general.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/lang/en/general.php b/app/lang/en/general.php index f25b694509..7c9cd05d2d 100755 --- a/app/lang/en/general.php +++ b/app/lang/en/general.php @@ -7,6 +7,7 @@ return array( 'admin' => 'Admin', 'all_assets' => 'All Assets', 'all' => 'All', + 'archived' => 'Archived', 'asset_models' => 'Asset Models', 'asset' => 'Asset', 'asset_report' => 'Asset Report', From 5c92be51909cac42c77443774baaa8f2d2acc267 Mon Sep 17 00:00:00 2001 From: madd15 Date: Wed, 11 Feb 2015 13:45:04 +1030 Subject: [PATCH 35/36] Added Archived Lang --- app/views/backend/hardware/index.blade.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/backend/hardware/index.blade.php b/app/views/backend/hardware/index.blade.php index 1b5783d161..6361df81c1 100755 --- a/app/views/backend/hardware/index.blade.php +++ b/app/views/backend/hardware/index.blade.php @@ -1,7 +1,7 @@ @extends('backend/layouts/default') @section('title0') - @if (Input::get('Pending') || Input::get('Undeployable') || Input::get('RTD') || Input::get('Deployed')) + @if (Input::get('Pending') || Input::get('Undeployable') || Input::get('RTD') || Input::get('Deployed') || Input::get('Archived')) @if (Input::get('Pending')) @lang('general.pending') @elseif (Input::get('RTD')) @@ -10,6 +10,8 @@ @lang('general.undeployable') @elseif (Input::get('Deployed')) @lang('general.deployed') + @elseif (Input::get('Archived')) + @lang('general.archived') @endif @else @lang('general.all') From bf9a825095816705edb7ffe2ed6206f33515dc54 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Feb 2015 19:18:15 -0800 Subject: [PATCH 36/36] Removed extraneous ID --- app/views/backend/hardware/view.blade.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/backend/hardware/view.blade.php b/app/views/backend/hardware/view.blade.php index 5c5adce7e1..e5737de527 100755 --- a/app/views/backend/hardware/view.blade.php +++ b/app/views/backend/hardware/view.blade.php @@ -297,21 +297,21 @@

  • @lang('admin/hardware/general.checkin')
  • @elseif (($asset->assetstatus->deployable=='1') && (($asset->assigned_to=='') || ($asset->assigned_to==0)))

  • @lang('admin/hardware/general.checkout')
  • - @else - {{ $asset->assigned_to }} + @endif @if ($asset->assetstatus->notes)
    -
    - - {{{ $asset->assetstatus->notes }}} +
    + + {{{ $asset->assetstatus->notes }}} +
    @endif -
    + @endif @endif