diff --git a/app/controllers/admin/AccessoriesController.php b/app/controllers/admin/AccessoriesController.php index bd2df7ab85..f6f6e3197c 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); @@ -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(); diff --git a/app/controllers/admin/AssetsController.php b/app/controllers/admin/AssetsController.php index 6ea8d4959f..ad9fc9a690 100755 --- a/app/controllers/admin/AssetsController.php +++ b/app/controllers/admin/AssetsController.php @@ -377,7 +377,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); @@ -426,14 +426,16 @@ class AssetsController extends AdminController // Was the asset updated? if($asset->save()) { $logaction = new Actionlog(); - - if (Input::has('checkout_at')) { + + 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 +449,10 @@ 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['expected_checkin'] = $logaction->expected_checkin; + $data['item_tag'] = $asset->asset_tag; + $data['note'] = $logaction->note; $data['require_acceptance'] = $asset->requireAcceptance(); $settings = Setting::getSettings(); diff --git a/app/controllers/admin/ConsumablesController.php b/app/controllers/admin/ConsumablesController.php index 06a815bd65..05376143b6 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); @@ -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(); diff --git a/app/controllers/admin/LicensesController.php b/app/controllers/admin/LicensesController.php index 40b09ba1b9..abfdfd75d8 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 = ''; @@ -408,7 +414,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 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); 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'); + }); + + } + +} 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. ', 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') }} +
+
diff --git a/app/views/backend/hardware/view.blade.php b/app/views/backend/hardware/view.blade.php index 96f63fcf19..db6897b22e 100755 --- a/app/views/backend/hardware/view.blade.php +++ b/app/views/backend/hardware/view.blade.php @@ -491,6 +491,10 @@