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') }}
+
+
+
|
-
- |
- 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();