From 78a45d72d76fc409fe2bce9d162bfbaf87ed16d7 Mon Sep 17 00:00:00 2001 From: madd15 Date: Sat, 18 Jul 2015 10:53:51 +0930 Subject: [PATCH 01/18] Add reassignable to create --- app/controllers/admin/LicensesController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/controllers/admin/LicensesController.php b/app/controllers/admin/LicensesController.php index 40b09ba1b9..763564cb23 100755 --- a/app/controllers/admin/LicensesController.php +++ b/app/controllers/admin/LicensesController.php @@ -100,6 +100,12 @@ class LicensesController extends AdminController } else { $license->maintained = e(Input::get('maintained')); } + + if ( e(Input::get('reassignable')) == '') { + $license->reassignable = 0; + } else { + $license->reassignable = e(Input::get('reassignable')); + } if ( e(Input::get('purchase_order')) == '') { $license->purchase_order = ''; From 89df6fc6da441ab05878eb90f86de68035c9fbd0 Mon Sep 17 00:00:00 2001 From: madd15 Date: Mon, 20 Jul 2015 10:15:28 +0930 Subject: [PATCH 02/18] Change user list from email to username --- app/controllers/admin/AccessoriesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/AccessoriesController.php b/app/controllers/admin/AccessoriesController.php index bd2df7ab85..ae2de57723 100755 --- a/app/controllers/admin/AccessoriesController.php +++ b/app/controllers/admin/AccessoriesController.php @@ -218,7 +218,7 @@ class AccessoriesController extends AdminController } // Get the dropdown of users and then pass it to the checkout view - $users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name," (",email,")") as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id'); + $users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name," (",username,")") as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id'); return View::make('backend/accessories/checkout', compact('accessory'))->with('users_list',$users_list); From e29ab6b0d65303d9c705e8c4571a74805ed8afb2 Mon Sep 17 00:00:00 2001 From: madd15 Date: Mon, 20 Jul 2015 10:16:26 +0930 Subject: [PATCH 03/18] Change user list from email to username --- app/controllers/admin/AssetsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/AssetsController.php b/app/controllers/admin/AssetsController.php index 6928b30cee..eeea69f9c8 100755 --- a/app/controllers/admin/AssetsController.php +++ b/app/controllers/admin/AssetsController.php @@ -376,7 +376,7 @@ class AssetsController extends AdminController } // Get the dropdown of users and then pass it to the checkout view - $users_list = array('' => Lang::get('general.select_user')) + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name," (",email,")") as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id'); + $users_list = array('' => Lang::get('general.select_user')) + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name," (",username,")") as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id'); return View::make('backend/hardware/checkout', compact('asset'))->with('users_list',$users_list); From 5ff84d80b4db86fbb2bdcfa1977983ac27e2410e Mon Sep 17 00:00:00 2001 From: madd15 Date: Mon, 20 Jul 2015 10:16:58 +0930 Subject: [PATCH 04/18] Change user list from email to username --- app/controllers/admin/ConsumablesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/ConsumablesController.php b/app/controllers/admin/ConsumablesController.php index 06a815bd65..edc8faeee2 100644 --- a/app/controllers/admin/ConsumablesController.php +++ b/app/controllers/admin/ConsumablesController.php @@ -218,7 +218,7 @@ class ConsumablesController extends AdminController } // Get the dropdown of users and then pass it to the checkout view - $users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name," (",email,")") as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id'); + $users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name," (",username,")") as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id'); return View::make('backend/consumables/checkout', compact('consumable'))->with('users_list',$users_list); From abfb5bcd2ee6c1243dbefadd499b44256ef07041 Mon Sep 17 00:00:00 2001 From: madd15 Date: Mon, 20 Jul 2015 10:19:03 +0930 Subject: [PATCH 05/18] Change user list from email to username --- app/controllers/admin/LicensesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/LicensesController.php b/app/controllers/admin/LicensesController.php index 40b09ba1b9..fad85560c6 100755 --- a/app/controllers/admin/LicensesController.php +++ b/app/controllers/admin/LicensesController.php @@ -408,7 +408,7 @@ class LicensesController extends AdminController } // Get the dropdown of users and then pass it to the checkout view - $users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name," (",email,")") as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id'); + $users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name," (",username,")") as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id'); // Left join to get a list of assets and some other helpful info From 2f0f2c50024f0954f1e9e07f261bde8694ba03a0 Mon Sep 17 00:00:00 2001 From: madd15 Date: Mon, 20 Jul 2015 14:33:50 +0930 Subject: [PATCH 06/18] Add additional Fields --- app/views/emails/accept-asset.blade.php | 40 +++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/app/views/emails/accept-asset.blade.php b/app/views/emails/accept-asset.blade.php index f32eec975f..4497afd705 100755 --- a/app/views/emails/accept-asset.blade.php +++ b/app/views/emails/accept-asset.blade.php @@ -4,7 +4,42 @@

Hello {{{ $first_name }}},

-

A new item ({{{ strtoupper($item_name) }}}) has been checked out to you. +

A new item has been checked out to under your name, details are below. + + + + + + + + + + + + + + + + + + +
+ Asset Name: + + {{{ $item_name }}} +
+ Asset Tag: + + {{{ $item_tag }}} +
+ Checkout Date: + + {{{ $checkout_date }}} +
+ Additional Notes: + + {{{ $note }}} +
@if (($require_acceptance==1) && ($eula!='')) @@ -22,8 +57,7 @@

- -

{{ $eula }}

+

{{ $eula }}

@if ($require_acceptance==1)

I have read and agree to the terms of use, and have received this item.

From 0d0589800acba1e156ea1c1ad851b241e956438f Mon Sep 17 00:00:00 2001 From: madd15 Date: Mon, 20 Jul 2015 14:35:07 +0930 Subject: [PATCH 07/18] Add additional data for email fields --- app/controllers/admin/AssetsController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/admin/AssetsController.php b/app/controllers/admin/AssetsController.php index 6928b30cee..f01973b957 100755 --- a/app/controllers/admin/AssetsController.php +++ b/app/controllers/admin/AssetsController.php @@ -446,6 +446,9 @@ class AssetsController extends AdminController $data['eula'] = $asset->getEula(); $data['first_name'] = $user->first_name; $data['item_name'] = $asset->showAssetName(); + $data['checkout_date'] = $logaction->created_at; + $data['item_tag'] = $asset->asset_tag; + $data['note'] = $logaction->note; $data['require_acceptance'] = $asset->requireAcceptance(); $settings = Setting::getSettings(); From 4375d66d090fe02225ad04dd8ec3518e7f15c023 Mon Sep 17 00:00:00 2001 From: madd15 Date: Thu, 23 Jul 2015 10:05:16 +0930 Subject: [PATCH 08/18] Add Expected Checkin Date --- app/controllers/admin/AssetsController.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/controllers/admin/AssetsController.php b/app/controllers/admin/AssetsController.php index f01973b957..efda642fa3 100755 --- a/app/controllers/admin/AssetsController.php +++ b/app/controllers/admin/AssetsController.php @@ -426,13 +426,9 @@ class AssetsController extends AdminController if($asset->save()) { $logaction = new Actionlog(); - if (Input::has('checkout_at')) { - if (Input::get('checkout_at')!= date("Y-m-d")){ - $logaction->created_at = e(Input::get('checkout_at')).' 00:00:00'; - } - } - - + if (Input::has('expected_checkin')) { + $logaction->expected_checkin = e(Input::get('expected_checkin')); + } $logaction->asset_id = $asset->id; $logaction->checkedout_to = $asset->assigned_to; @@ -447,6 +443,7 @@ class AssetsController extends AdminController $data['first_name'] = $user->first_name; $data['item_name'] = $asset->showAssetName(); $data['checkout_date'] = $logaction->created_at; + $data['expected_checkin'] = $logaction->expected_checkin; $data['item_tag'] = $asset->asset_tag; $data['note'] = $logaction->note; $data['require_acceptance'] = $asset->requireAcceptance(); From 7afcd096510924176a4ea267026f62b47100c759 Mon Sep 17 00:00:00 2001 From: madd15 Date: Thu, 23 Jul 2015 10:07:04 +0930 Subject: [PATCH 09/18] Add Expected Checkin Date --- app/views/emails/accept-asset.blade.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/views/emails/accept-asset.blade.php b/app/views/emails/accept-asset.blade.php index 4497afd705..62ad51a932 100755 --- a/app/views/emails/accept-asset.blade.php +++ b/app/views/emails/accept-asset.blade.php @@ -31,6 +31,14 @@ {{{ $checkout_date }}} + + + Expected Checkin Date: + + + {{{ $expected_checkin }}} + + Additional Notes: From d12d1f161f6fdfb7ec8b8fe5a1aac40206ed0927 Mon Sep 17 00:00:00 2001 From: madd15 Date: Thu, 23 Jul 2015 11:52:04 +0930 Subject: [PATCH 10/18] Add Expected Checkin Date --- app/lang/en/admin/hardware/form.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/lang/en/admin/hardware/form.php b/app/lang/en/admin/hardware/form.php index 85af3f24c9..5cadad3641 100755 --- a/app/lang/en/admin/hardware/form.php +++ b/app/lang/en/admin/hardware/form.php @@ -17,6 +17,7 @@ return array( 'default_location' => 'Default Location', 'eol_date' => 'EOL Date', 'eol_rate' => 'EOL Rate', + 'expected_checkin' => 'Expected Checkin Date', 'expires' => 'Expires', 'fully_depreciated' => 'Fully Depreciated', 'help_checkout' => 'If you wish to assign this asset immediately, select "Ready to Deploy" from the status list above. ', From dea23bef457616ef551ecdae02b2cc6207d559ef Mon Sep 17 00:00:00 2001 From: madd15 Date: Thu, 23 Jul 2015 11:53:07 +0930 Subject: [PATCH 11/18] Add Expected Checkin Date --- app/views/backend/hardware/checkout.blade.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/views/backend/hardware/checkout.blade.php b/app/views/backend/hardware/checkout.blade.php index 273f9e8c05..e00b02c492 100755 --- a/app/views/backend/hardware/checkout.blade.php +++ b/app/views/backend/hardware/checkout.blade.php @@ -74,6 +74,16 @@ {{ $errors->first('checkout_at', '
:message') }} + + +
+ +
+ + + {{ $errors->first('expected_checkin', '
:message') }} +
+
From 878a163d119b902b4d0ad97dc39a861bdf81a636 Mon Sep 17 00:00:00 2001 From: madd15 Date: Thu, 23 Jul 2015 11:55:35 +0930 Subject: [PATCH 12/18] Create Expected Checkin Date Column --- ...dd_expected_checkin_date_to_asset_logs.php | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 app/database/migrations/2015_07_21_122022_add_expected_checkin_date_to_asset_logs.php diff --git a/app/database/migrations/2015_07_21_122022_add_expected_checkin_date_to_asset_logs.php b/app/database/migrations/2015_07_21_122022_add_expected_checkin_date_to_asset_logs.php new file mode 100644 index 0000000000..40826af579 --- /dev/null +++ b/app/database/migrations/2015_07_21_122022_add_expected_checkin_date_to_asset_logs.php @@ -0,0 +1,37 @@ +date('expected_checkin')->nullable()->default(NULL); + }); + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + + Schema::table('asset_logs', function(Blueprint $table) + { + $table->dropColumn('expected_checkin'); + }); + + } + +} From 4f1f21287cf45bd681cbf4758da5d5c1eafa42aa Mon Sep 17 00:00:00 2001 From: madd15 Date: Thu, 23 Jul 2015 12:37:45 +0930 Subject: [PATCH 13/18] Add Expected Checkin Date --- app/views/backend/hardware/view.blade.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/backend/hardware/view.blade.php b/app/views/backend/hardware/view.blade.php index 179983f81c..c9353ee55f 100755 --- a/app/views/backend/hardware/view.blade.php +++ b/app/views/backend/hardware/view.blade.php @@ -393,6 +393,10 @@
    @if (($asset->assetstatus->deployable=='1') && ($asset->assigned_to > 0) && ($asset->deleted_at=='')) + @if ($asset->assetlog->first()->expected_checkin) +

  • @lang('admin/hardware/form.expected_checkin') + : {{{ date('Y-m-d', strtotime($asset->assetlog->first()->expected_checkin)) }}}
  • + @endif

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

  • @lang('admin/hardware/general.checkout')
  • From 8ba55b4bf241254cb06205523576999b30409a11 Mon Sep 17 00:00:00 2001 From: madd15 Date: Thu, 23 Jul 2015 12:40:22 +0930 Subject: [PATCH 14/18] Fix missing checkedout_at --- app/controllers/admin/AssetsController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/controllers/admin/AssetsController.php b/app/controllers/admin/AssetsController.php index efda642fa3..bab4bc1408 100755 --- a/app/controllers/admin/AssetsController.php +++ b/app/controllers/admin/AssetsController.php @@ -425,6 +425,12 @@ class AssetsController extends AdminController // Was the asset updated? if($asset->save()) { $logaction = new Actionlog(); + + if (Input::has('checkout_at')) { + if (Input::get('checkout_at')!= date("Y-m-d")){ + $logaction->created_at = e(Input::get('checkout_at')).' 00:00:00'; + } + } if (Input::has('expected_checkin')) { $logaction->expected_checkin = e(Input::get('expected_checkin')); From 6d1197a144aa0cd2479791190a9b46f480ba7d68 Mon Sep 17 00:00:00 2001 From: madd15 Date: Fri, 24 Jul 2015 08:44:53 +0930 Subject: [PATCH 15/18] Fix edit model cat list showing deleted categories --- app/controllers/admin/ModelsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/ModelsController.php b/app/controllers/admin/ModelsController.php index 5983628768..25bc43762c 100755 --- a/app/controllers/admin/ModelsController.php +++ b/app/controllers/admin/ModelsController.php @@ -131,7 +131,7 @@ class ModelsController extends AdminController $depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id'); $manufacturer_list = array('' => 'Select One') + Manufacturer::lists('name', 'id'); - $category_list = array('' => '') + DB::table('categories')->lists('name', 'id'); + $category_list = array('' => '') + DB::table('categories')->whereNull('deleted_at')->lists('name', 'id'); $view = View::make('backend/models/edit', compact('model')); $view->with('category_list',$category_list); $view->with('depreciation_list',$depreciation_list); From fd9e8b712bb1a9203da3ee40edec7fe56436ca75 Mon Sep 17 00:00:00 2001 From: madd15 Date: Fri, 24 Jul 2015 09:26:34 +0930 Subject: [PATCH 16/18] Add flexibility if values not present --- app/views/emails/accept-asset.blade.php | 54 ++++++++++++++----------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/app/views/emails/accept-asset.blade.php b/app/views/emails/accept-asset.blade.php index 62ad51a932..ade6312ee6 100755 --- a/app/views/emails/accept-asset.blade.php +++ b/app/views/emails/accept-asset.blade.php @@ -15,14 +15,16 @@ {{{ $item_name }}} - - - Asset Tag: - - - {{{ $item_tag }}} - - + @if ($item_tag) + + + Asset Tag: + + + {{{ $item_tag }}} + + + @endif Checkout Date: @@ -31,22 +33,26 @@ {{{ $checkout_date }}} - - - Expected Checkin Date: - - - {{{ $expected_checkin }}} - - - - - Additional Notes: - - - {{{ $note }}} - - + @if ($expected_checkin) + + + Expected Checkin Date: + + + {{{ $expected_checkin }}} + + + @endif + @if ($note) + + + Additional Notes: + + + {{{ $note }}} + + + @endif @if (($require_acceptance==1) && ($eula!='')) From e4277b47e8ace642f5006f223087480833b24440 Mon Sep 17 00:00:00 2001 From: madd15 Date: Fri, 24 Jul 2015 09:27:44 +0930 Subject: [PATCH 17/18] Add extra fields for email --- app/controllers/admin/AccessoriesController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/admin/AccessoriesController.php b/app/controllers/admin/AccessoriesController.php index ae2de57723..f6f6e3197c 100755 --- a/app/controllers/admin/AccessoriesController.php +++ b/app/controllers/admin/AccessoriesController.php @@ -322,6 +322,10 @@ class AccessoriesController extends AdminController $data['eula'] = $accessory->getEula(); $data['first_name'] = $user->first_name; $data['item_name'] = $accessory->name; + $data['checkout_date'] = $logaction->created_at; + $data['item_tag'] = ''; + $data['expected_checkin'] = ''; + $data['note'] = $logaction->note; $data['require_acceptance'] = $accessory->requireAcceptance(); From d62d6ebf0553cb2987eb9ef93d7493768e9b9c07 Mon Sep 17 00:00:00 2001 From: madd15 Date: Fri, 24 Jul 2015 09:28:17 +0930 Subject: [PATCH 18/18] Add extra fields for email --- app/controllers/admin/ConsumablesController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/admin/ConsumablesController.php b/app/controllers/admin/ConsumablesController.php index edc8faeee2..05376143b6 100644 --- a/app/controllers/admin/ConsumablesController.php +++ b/app/controllers/admin/ConsumablesController.php @@ -322,6 +322,10 @@ class ConsumablesController extends AdminController $data['eula'] = $consumable->getEula(); $data['first_name'] = $user->first_name; $data['item_name'] = $consumable->name; + $data['checkout_date'] = $logaction->created_at; + $data['item_tag'] = ''; + $data['expected_checkin'] = ''; + $data['note'] = $logaction->note; $data['require_acceptance'] = $consumable->requireAcceptance();