From c683c1c57e87fbe53f04c2cc6a998304a494583e Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Mon, 20 Jul 2015 17:12:28 -0700 Subject: [PATCH] Revert "Merge branch 'feature/857_AssetRepairUpgradeTracking' of https://github.com/vsposato/snipe-it into vsposato-feature/857_AssetRepairUpgradeTracking" This reverts commit 41b711740a5d7eb824aefae2372921f498baad5c, reversing changes made to 55309bfaef83d96dabc33275a1ba9e87e024a003. It also un-reverts reversions that were done inadvertently. --- app/config/version.php | 2 +- .../admin/AssetMaintenancesController.php | 464 ---------------- app/controllers/admin/AssetsController.php | 6 +- app/controllers/admin/ReportsController.php | 503 +++++++----------- app/controllers/admin/SuppliersController.php | 1 - app/controllers/admin/UsersController.php | 15 + ...213716_create_asset_maintenances_table.php | 65 --- app/lang/en/admin/asset_maintenances/form.php | 14 - .../en/admin/asset_maintenances/general.php | 11 - .../en/admin/asset_maintenances/message.php | 17 - .../en/admin/asset_maintenances/table.php | 9 - app/lang/en/general.php | 260 ++++----- app/models/Asset.php | 19 +- app/models/AssetMaintenance.php | 84 --- app/models/Supplier.php | 5 - app/routes.php | 494 +++++++++-------- .../backend/asset_maintenances/edit.blade.php | 146 ----- .../asset_maintenances/index.blade.php | 56 -- .../backend/asset_maintenances/view.blade.php | 110 ---- app/views/backend/hardware/index.blade.php | 2 +- app/views/backend/hardware/view.blade.php | 208 +++----- app/views/backend/layouts/default.blade.php | 25 +- .../reports/asset_maintenances.blade.php | 78 --- app/views/backend/suppliers/view.blade.php | 206 +++---- bootstrap/start.php | 4 +- 25 files changed, 772 insertions(+), 2032 deletions(-) delete mode 100644 app/controllers/admin/AssetMaintenancesController.php delete mode 100644 app/database/migrations/2015_06_26_213716_create_asset_maintenances_table.php delete mode 100755 app/lang/en/admin/asset_maintenances/form.php delete mode 100755 app/lang/en/admin/asset_maintenances/general.php delete mode 100644 app/lang/en/admin/asset_maintenances/message.php delete mode 100644 app/lang/en/admin/asset_maintenances/table.php delete mode 100644 app/models/AssetMaintenance.php delete mode 100644 app/views/backend/asset_maintenances/edit.blade.php delete mode 100644 app/views/backend/asset_maintenances/index.blade.php delete mode 100644 app/views/backend/asset_maintenances/view.blade.php delete mode 100644 app/views/backend/reports/asset_maintenances.blade.php diff --git a/app/config/version.php b/app/config/version.php index cf199e5a6e..e945b8ff41 100644 --- a/app/config/version.php +++ b/app/config/version.php @@ -1,5 +1,5 @@ 'v2.0-pre', - 'hash_version' => 'v2.0-pre-beta-31-g24b0d83', + 'hash_version' => 'v2.0-pre-beta-33-g919df7e', ); \ No newline at end of file diff --git a/app/controllers/admin/AssetMaintenancesController.php b/app/controllers/admin/AssetMaintenancesController.php deleted file mode 100644 index 846b8ff153..0000000000 --- a/app/controllers/admin/AssetMaintenancesController.php +++ /dev/null @@ -1,464 +0,0 @@ - - * @version v1.0 - */ - public function getIndex() - { - - return View::make( 'backend/asset_maintenances/index' ); - } - - /** - * getDatatable - * Gets the datatable for the index page - * - * @return mixed - * @author Vincent Sposato - * @version v1.0 - */ - public function getDatatable() - { - - $assetMaintenances = AssetMaintenance::orderBy( 'created_at', 'DESC' ) - ->get(); - - $actions = new \Chumper\Datatable\Columns\FunctionColumn( 'actions', function ( $assetMaintenances ) { - - return ''; - } ); - - return Datatable::collection( $assetMaintenances ) - ->addColumn( 'asset', function ( $assetMaintenances ) { - - return link_to( '/hardware/' . $assetMaintenances->asset_id . '/view', - mb_strimwidth( $assetMaintenances->asset->name, 0, 50, "..." ) ); - } ) - ->addColumn( 'supplier', function ( $assetMaintenances ) { - - return link_to( '/admin/settings/suppliers/' . $assetMaintenances->supplier_id - . '/view', - mb_strimwidth( $assetMaintenances->supplier->name, 0, 50, "..." ) ); - } ) - ->addColumn( 'asset_maintenance_type', function ( $assetMaintenances ) { - - return $assetMaintenances->asset_maintenance_type; - } ) - ->addColumn( 'title', function ( $assetMaintenances ) { - - return link_to( '/admin/asset_maintenances/' . $assetMaintenances->id . '/view', - mb_strimwidth( $assetMaintenances->title, 0, 50, "..." ) ); - } ) - ->addColumn( 'start_date', function ( $assetMaintenances ) { - - return $assetMaintenances->start_date; - } ) - ->addColumn( 'completion_date', function ( $assetMaintenances ) { - - return $assetMaintenances->completion_date; - } ) - ->addColumn( 'asset_maintenance_time', function ( $assetMaintenances ) { - - if (is_null( $assetMaintenances->asset_maintenance_time )) { - $assetMaintenances->asset_maintenance_time = Carbon::now() - ->diffInDays( Carbon::parse( $assetMaintenances->start_date ) ); - } - - return intval( $assetMaintenances->asset_maintenance_time ); - } ) - ->addColumn( 'cost', function ( $assetMaintenances ) { - - return sprintf( Lang::get( 'general.currency' ) . '%01.2f', $assetMaintenances->cost ); - } ) - ->addColumn( $actions ) - ->searchColumns( 'asset', 'supplier', 'asset_maintenance_type', 'title', 'start_date', - 'completion_date', 'asset_maintenance_time', 'cost', 'actions' ) - ->orderColumns( 'asset', 'supplier', 'asset_maintenance_type', 'title', 'start_date', - 'completion_date', 'asset_maintenance_time', 'cost', 'actions' ) - ->make(); - } - - /** - * getCreate - * - * @param null $assetId - * - * @return mixed - * @author Vincent Sposato - * @version v1.0 - */ - public function getCreate( $assetId = null ) - { - - // Prepare Asset Maintenance Type List - $assetMaintenanceType = [ - '' => 'Select an asset maintenance type', - ] + AssetMaintenance::getImprovementOptions(); - // Mark the selected asset, if it came in - $selectedAsset = $assetId; - // Get the possible assets using a left join to get a list of assets and some other helpful info - $asset = DB::table( 'assets' ) - ->leftJoin( 'users', 'users.id', '=', 'assets.assigned_to' ) - ->leftJoin( 'models', 'assets.model_id', '=', 'models.id' ) - ->select( 'assets.id', 'assets.name', 'first_name', 'last_name', 'asset_tag', - DB::raw( 'concat(first_name," ",last_name) as full_name, assets.id as id, models.name as modelname' ) ) - ->whereNull( 'assets.deleted_at' ) - ->get(); - $asset_array = json_decode( json_encode( $asset ), true ); - $asset_element[ '' ] = 'Please select an asset'; - // Build a list out of the data results - for ($x = 0; $x < count( $asset_array ); $x++) { - - if ($asset_array[ $x ][ 'full_name' ] != '') { - $full_name = ' (' . $asset_array[ $x ][ 'full_name' ] . ') ' . $asset_array[ $x ][ 'modelname' ]; - } else { - $full_name = ' (Unassigned) ' . $asset_array[ $x ][ 'modelname' ]; - } - $asset_element[ $asset_array[ $x ][ 'id' ] ] = - $asset_array[ $x ][ 'asset_tag' ] . ' - ' . $asset_array[ $x ][ 'name' ] . $full_name; - } - // Get Supplier List - $supplier_list = [ '' => 'Select Supplier' ] + Supplier::orderBy( 'name', 'asc' ) - ->lists( 'name', 'id' ); - - // Render the view - return View::make( 'backend/asset_maintenances/edit' ) - ->with( 'asset_list', $asset_element ) - ->with( 'selectedAsset', $selectedAsset ) - ->with( 'supplier_list', $supplier_list ) - ->with( 'assetMaintenanceType', $assetMaintenanceType ) - ->with( 'assetMaintenance', new AssetMaintenance ); - } - - /** - * postCreate - * - * @return mixed - * @author Vincent Sposato - * @version v1.0 - */ - public function postCreate() - { - - // get the POST data - $new = Input::all(); - - // create a new model instance - $assetMaintenance = new AssetMaintenance(); - - // attempt validation - if ($assetMaintenance->validate( $new )) { - - if (e( Input::get( 'supplier_id' ) ) == '') { - $assetMaintenance->supplier_id = null; - } else { - $assetMaintenance->supplier_id = e( Input::get( 'supplier_id' ) ); - } - - if (e( Input::get( 'is_warranty' ) ) == '') { - $assetMaintenance->is_warranty = 0; - } else { - $assetMaintenance->is_warranty = e( Input::get( 'is_warranty' ) ); - } - - if (e( Input::get( 'cost' ) ) == '') { - $assetMaintenance->cost = ''; - } else { - $assetMaintenance->cost = ParseFloat( e( Input::get( 'cost' ) ) ); - } - - if (e( Input::get( 'notes' ) ) == '') { - $assetMaintenance->notes = null; - } else { - $assetMaintenance->notes = e( Input::get( 'notes' ) ); - } - - // Save the asset maintenance data - $assetMaintenance->asset_id = e( Input::get( 'asset_id' ) ); - $assetMaintenance->asset_maintenance_type = e( Input::get( 'asset_maintenance_type' ) ); - $assetMaintenance->title = e( Input::get( 'title' ) ); - $assetMaintenance->start_date = e( Input::get( 'start_date' ) ); - $assetMaintenance->completion_date = e( Input::get( 'completion_date' ) ); - - if (( $assetMaintenance->completion_date == "" ) - || ( $assetMaintenance->completion_date == "0000-00-00" ) - ) { - $assetMaintenance->completion_date = null; - } - - // Was the asset maintenance created? - if ($assetMaintenance->save()) { - - // Redirect to the new asset maintenance page - return Redirect::to( "admin/asset_maintenances" ) - ->with( 'success', Lang::get( 'admin/asset_maintenances/message.create.success' ) ); - } - } else { - // failure - $errors = $assetMaintenance->errors(); - - return Redirect::back() - ->withInput() - ->withErrors( $errors ); - } - - // Redirect to the asset maintenance create page - return Redirect::to( 'admin/asset_maintenances/edit' ) - ->with( 'error', Lang::get( 'admin/asset_maintenances/message.create.error' ) ) - ->with( 'assetMaintenance', new AssetMaintenance ); - - } - - /** - * getEdit - * - * @param null $assetMaintenanceId - * - * @return mixed - * @author Vincent Sposato - * @version v1.0 - */ - public function getEdit( $assetMaintenanceId = null ) - { - - // Check if the asset maintenance exists - if (is_null( $assetMaintenance = AssetMaintenance::find( $assetMaintenanceId ) )) { - // Redirect to the improvement management page - return Redirect::to( 'admin/asset_maintenances' ) - ->with( 'error', Lang::get( 'admin/asset_maintenances/message.not_found' ) ); - } - - if ($assetMaintenance->completion_date == '0000-00-00') { - $assetMaintenance->completion_date = null; - } - - if ($assetMaintenance->start_date == '0000-00-00') { - $assetMaintenance->start_date = null; - } - - if ($assetMaintenance->cost == '0.00') { - $assetMaintenance->cost = null; - } - - // Prepare Improvement Type List - $assetMaintenanceType = [ - '' => 'Select an improvement type', - ] + AssetMaintenance::getImprovementOptions(); - - // Get the possible assets using a left join to get a list of assets and some other helpful info - $asset = DB::table( 'assets' ) - ->leftJoin( 'users', 'users.id', '=', 'assets.assigned_to' ) - ->leftJoin( 'models', 'assets.model_id', '=', 'models.id' ) - ->select( 'assets.id', 'assets.name', 'first_name', 'last_name', 'asset_tag', - DB::raw( 'concat(first_name," ",last_name) as full_name, assets.id as id, models.name as modelname' ) ) - ->whereNull( 'assets.deleted_at' ) - ->get(); - $asset_array = json_decode( json_encode( $asset ), true ); - $asset_element[ '' ] = 'Please select an asset'; - // Build a list out of the data results - for ($x = 0; $x < count( $asset_array ); $x++) { - - if ($asset_array[ $x ][ 'full_name' ] != '') { - $full_name = ' (' . $asset_array[ $x ][ 'full_name' ] . ') ' . $asset_array[ $x ][ 'modelname' ]; - } else { - $full_name = ' (Unassigned) ' . $asset_array[ $x ][ 'modelname' ]; - } - $asset_element[ $asset_array[ $x ][ 'id' ] ] = - $asset_array[ $x ][ 'asset_tag' ] . ' - ' . $asset_array[ $x ][ 'name' ] . $full_name; - } - // Get Supplier List - $supplier_list = [ '' => 'Select Supplier' ] + Supplier::orderBy( 'name', 'asc' ) - ->lists( 'name', 'id' ); - - // Render the view - return View::make( 'backend/asset_maintenances/edit' ) - ->with( 'asset_list', $asset_element ) - ->with( 'selectedAsset', null ) - ->with( 'supplier_list', $supplier_list ) - ->with( 'assetMaintenanceType', $assetMaintenanceType ) - ->with( 'assetMaintenance', $assetMaintenance ); - - } - - /** - * postEdit - * - * @param null $assetMaintenanceId - * - * @return mixed - * @author Vincent Sposato - * @version v1.0 - */ - public function postEdit( $assetMaintenanceId = null ) - { - - // get the POST data - $new = Input::all(); - - // Check if the asset maintenance exists - if (is_null( $assetMaintenance = AssetMaintenance::find( $assetMaintenanceId ) )) { - // Redirect to the asset maintenance management page - return Redirect::to( 'admin/asset_maintenances' ) - ->with( 'error', Lang::get( 'admin/asset_maintenances/message.not_found' ) ); - } - - // attempt validation - if ($assetMaintenance->validate( $new )) { - - if (e( Input::get( 'supplier_id' ) ) == '') { - $assetMaintenance->supplier_id = null; - } else { - $assetMaintenance->supplier_id = e( Input::get( 'supplier_id' ) ); - } - - if (e( Input::get( 'is_warranty' ) ) == '') { - $assetMaintenance->is_warranty = 0; - } else { - $assetMaintenance->is_warranty = e( Input::get( 'is_warranty' ) ); - } - - if (e( Input::get( 'cost' ) ) == '') { - $assetMaintenance->cost = ''; - } else { - $assetMaintenance->cost = ParseFloat( e( Input::get( 'cost' ) ) ); - } - - if (e( Input::get( 'notes' ) ) == '') { - $assetMaintenance->notes = null; - } else { - $assetMaintenance->notes = e( Input::get( 'notes' ) ); - } - - // Save the asset maintenance data - $assetMaintenance->asset_id = e( Input::get( 'asset_id' ) ); - $assetMaintenance->asset_maintenance_type = e( Input::get( 'asset_maintenance_type' ) ); - $assetMaintenance->title = e( Input::get( 'title' ) ); - $assetMaintenance->start_date = e( Input::get( 'start_date' ) ); - $assetMaintenance->completion_date = e( Input::get( 'completion_date' ) ); - - if (( $assetMaintenance->completion_date == "" ) - || ( $assetMaintenance->completion_date == "0000-00-00" ) - ) { - $assetMaintenance->completion_date = null; - if (( $assetMaintenance->asset_maintenance_time !== 0 ) - || ( !is_null( $assetMaintenance->asset_maintenance_time ) ) - ) { - $assetMaintenance->asset_maintenance_time = null; - } - } - - if (( $assetMaintenance->completion_date !== "" ) - && ( $assetMaintenance->completion_date !== "0000-00-00" ) - && ( $assetMaintenance->start_date !== "" ) - && ( $assetMaintenance->start_date !== "0000-00-00" ) - ) { - $startDate = Carbon::parse( $assetMaintenance->start_date ); - $completionDate = Carbon::parse( $assetMaintenance->completion_date ); - $assetMaintenance->asset_maintenance_time = $completionDate->diffInDays( $startDate ); - } - - // Was the asset maintenance created? - if ($assetMaintenance->save()) { - - // Redirect to the new asset maintenance page - return Redirect::to( "admin/asset_maintenances" ) - ->with( 'success', Lang::get( 'admin/asset_maintenances/message.create.success' ) ); - } - } else { - // failure - $errors = $assetMaintenance->errors(); - - return Redirect::back() - ->withInput() - ->withErrors( $errors ); - } - - // Redirect to the improvement create page - return Redirect::to( 'admin/asset_maintenances/edit' ) - ->with( 'error', Lang::get( 'admin/asset_maintenances/message.create.error' ) ) - ->with( 'assetMaintenance', $assetMaintenance ); - - } - - /** - * getDelete - * - * @param $assetMaintenanceId - * - * @return mixed - * @author Vincent Sposato - * @version v1.0 - */ - public function getDelete( $assetMaintenanceId ) - { - - // Check if the asset maintenance exists - if (is_null( $assetMaintenance = AssetMaintenance::find( $assetMaintenanceId ) )) { - // Redirect to the asset maintenance management page - return Redirect::to( 'admin/asset_maintenances' ) - ->with( 'error', Lang::get( 'admin/asset_maintenances/message.not_found' ) ); - } - // Delete the asset maintenance - $assetMaintenance->delete(); - - // Redirect to the asset_maintenance management page - return Redirect::to( 'admin/asset_maintenances' ) - ->with( 'success', Lang::get( 'admin/asset_maintenances/message.delete.success' ) ); - } - - /** - * getView - * - * @param $assetMaintenanceId - * - * @return mixed - * @author Vincent Sposato - * @version v1.0 - */ - public function getView( $assetMaintenanceId ) - { - - // Check if the asset maintenance exists - if (is_null( $assetMaintenance = AssetMaintenance::find( $assetMaintenanceId ) )) { - // Redirect to the asset maintenance management page - return Redirect::to( 'admin/asset_maintenances' ) - ->with( 'error', Lang::get( 'admin/asset_maintenances/message.not_found' ) ); - } - - return View::make( 'backend/asset_maintenances/view')->with('assetMaintenance', $assetMaintenance); - } - - } \ No newline at end of file diff --git a/app/controllers/admin/AssetsController.php b/app/controllers/admin/AssetsController.php index 16ceaa223c..6928b30cee 100755 --- a/app/controllers/admin/AssetsController.php +++ b/app/controllers/admin/AssetsController.php @@ -5,7 +5,6 @@ use Input; use Lang; use Asset; use Supplier; -use AssetMaintenance; use Statuslabel; use User; use Setting; @@ -1044,6 +1043,9 @@ class AssetsController extends AdminController } + if (Input::has('order_number')) { + $assets->where('order_number','=',e(Input::get('order_number'))); + } $assets = $assets->orderBy('asset_tag', 'ASC')->get(); @@ -1142,7 +1144,7 @@ class AssetsController extends AdminController ->addColumn('order_number',function($assets) { - return $assets->order_number; + return ''.$assets->order_number.''; }) diff --git a/app/controllers/admin/ReportsController.php b/app/controllers/admin/ReportsController.php index c7aaff5a0d..04b3dee550 100644 --- a/app/controllers/admin/ReportsController.php +++ b/app/controllers/admin/ReportsController.php @@ -1,14 +1,10 @@ orderBy( 'created_at', 'DESC' ) - ->get(); - - return View::make( 'backend/reports/asset', compact( 'assets' ) ); + $assets = Asset::with('model','assigneduser.userLoc','assetstatus','defaultLoc','assetlog','supplier','model.manufacturer')->orderBy('created_at', 'DESC')->get(); + return View::make('backend/reports/asset', compact('assets')); } /** @@ -46,12 +36,10 @@ class ReportsController extends AdminController */ public function exportAssetReport() { - // Grab all the assets - $assets = Asset::orderBy( 'created_at', 'DESC' ) - ->get(); + $assets = Asset::orderBy('created_at', 'DESC')->get(); - $rows = [ ]; + $rows = array(); // Create the header row $header = array( @@ -78,55 +66,55 @@ class ReportsController extends AdminController $row = array(); $row[] = $asset->asset_tag; if ($asset->model->manufacturer) { - $row[ ] = $asset->model->manufacturer->name; + $row[] = $asset->model->manufacturer->name; } else { - $row[ ] = ''; + $row[] = ''; } - $row[ ] = '"' . $asset->model->name . '"'; - $row[ ] = '"' . $asset->model->modelno . '"'; - $row[ ] = $asset->name; - $row[ ] = $asset->serial; + $row[] = '"'.$asset->model->name.'"'; + $row[] = '"'.$asset->model->modelno.'"'; + $row[] = $asset->name; + $row[] = $asset->serial; if ($asset->assetstatus) { - $row[ ] = $asset->assetstatus->name; + $row[] = $asset->assetstatus->name; } else { - $row[ ] = ''; + $row[] = ''; } - $row[ ] = $asset->purchase_date; - $row[ ] = '"' . number_format( $asset->purchase_cost ) . '"'; + $row[] = $asset->purchase_date; + $row[] = '"'.number_format($asset->purchase_cost).'"'; if ($asset->order_number) { - $row[ ] = $asset->order_number; + $row[] = $asset->order_number; } else { - $row[ ] = ''; + $row[] = ''; } if ($asset->supplier_id) { - $row[ ] = $asset->supplier->name; + $row[] = $asset->supplier->name; } else { - $row[ ] = ''; + $row[] = ''; } if ($asset->assigned_to > 0) { - $user = User::find( $asset->assigned_to ); - $row[ ] = $user->fullName(); + $user = User::find($asset->assigned_to); + $row[] = $user->fullName(); } else { - $row[ ] = ''; // Empty string if unassigned + $row[] = ''; // Empty string if unassigned } - if (( $asset->assigned_to > 0 ) && ( $asset->assigneduser->location_id > 0 )) { - $location = Location::find( $asset->assigneduser->location_id ); + if (($asset->assigned_to > 0) && ($asset->assigneduser->location_id > 0)) { + $location = Location::find($asset->assigneduser->location_id); if ($location->name) { - $row[ ] = $location->name; + $row[] = $location->name; } else { - $row[ ] = ''; + $row[] = ''; } } elseif ($asset->rtd_location_id) { - $location = Location::find( $asset->rtd_location_id ); + $location = Location::find($asset->rtd_location_id); if ($location->name) { - $row[ ] = $location->name; + $row[] = $location->name; } else { - $row[ ] = ''; + $row[] = ''; } } else { - $row[ ] = ''; // Empty string if location is not set + $row[] = ''; // Empty string if location is not set } if ($asset->notes) { @@ -139,10 +127,10 @@ class ReportsController extends AdminController } // spit out a csv - $csv = implode( $rows, "\n" ); - $response = Response::make( $csv, 200 ); - $response->header( 'Content-Type', 'text/csv' ); - $response->header( 'Content-disposition', 'attachment;filename=report.csv' ); + $csv = implode($rows, "\n"); + $response = Response::make($csv, 200); + $response->header('Content-Type', 'text/csv'); + $response->header('Content-disposition', 'attachment;filename=report.csv'); return $response; } @@ -154,13 +142,9 @@ class ReportsController extends AdminController */ public function getDeprecationReport() { - // Grab all the assets - $assets = Asset::with( 'model', 'assigneduser', 'assetstatus', 'defaultLoc', 'assetlog' ) - ->orderBy( 'created_at', 'DESC' ) - ->get(); - - return View::make( 'backend/reports/depreciation', compact( 'assets' ) ); + $assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')->orderBy('created_at', 'DESC')->get(); + return View::make('backend/reports/depreciation', compact('assets')); } /** @@ -170,11 +154,11 @@ class ReportsController extends AdminController */ public function exportDeprecationReport() { - // Grab all the assets - $assets = Asset::with( 'model', 'assigneduser', 'assetstatus', 'defaultLoc', 'assetlog' ) - ->orderBy( 'created_at', 'DESC' ) - ->get(); + $assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')->orderBy('created_at', 'DESC')->get(); + + $csv = \League\Csv\Writer::createFromFileObject(new \SplTempFileObject()); + $csv->setOutputBOM(Reader::BOM_UTF16_BE); $rows = array(); @@ -196,29 +180,30 @@ class ReportsController extends AdminController // Create a row per asset foreach ($assets as $asset) { - $row = [ ]; - $row[ ] = $asset->asset_tag; - $row[ ] = $asset->name; - $row[ ] = $asset->serial; + $row = array(); + $row[] = $asset->asset_tag; + $row[] = $asset->name; + $row[] = $asset->serial; + if ($asset->assigned_to > 0) { - $user = User::find( $asset->assigned_to ); - $row[ ] = $user->fullName(); - } else { - $row[ ] = ''; // Empty string if unassigned + $user = User::find($asset->assigned_to); + $row[] = $user->fullName(); + } else { + $row[] = ''; // Empty string if unassigned } - if (( $asset->assigned_to > 0 ) && ( $asset->assigneduser->location_id > 0 )) { - $location = Location::find( $asset->assigneduser->location_id ); + if (($asset->assigned_to > 0) && ($asset->assigneduser->location_id > 0)) { + $location = Location::find($asset->assigneduser->location_id); if ($location->city) { $row[] = $location->city . ', ' . $location->state; } elseif ($location->name) { - $row[ ] = $location->name; + $row[] = $location->name; } else { - $row[ ] = ''; + $row[] = ''; } } else { - $row[ ] = ''; // Empty string if location is not set + $row[] = ''; // Empty string if location is not set } @@ -241,25 +226,23 @@ class ReportsController extends AdminController } - /** + /** * Show Report for Activity * * @return View */ - public function getActivityReport() + public function getActivityReport() { - - $log_actions = Actionlog::orderBy( 'created_at', 'DESC' ) - ->with( 'adminlog' ) - ->with( 'accessorylog' ) - ->with( 'assetlog' ) - ->with( 'licenselog' ) - ->with( 'userlog' ) - ->orderBy( 'created_at', 'DESC' ) - ->get(); - - return View::make( 'backend/reports/activity', compact( 'log_actions' ) ); + $log_actions = Actionlog::orderBy('created_at', 'DESC') + ->with('adminlog') + ->with('accessorylog') + ->with('assetlog') + ->with('licenselog') + ->with('userlog') + ->orderBy('created_at','DESC') + ->get(); + return View::make('backend/reports/activity', compact('log_actions')); } @@ -270,11 +253,8 @@ class ReportsController extends AdminController */ public function getLicenseReport() { - - $licenses = License::orderBy( 'created_at', 'DESC' ) - ->get(); - - return View::make( 'backend/reports/licenses', compact( 'licenses' ) ); + $licenses = License::orderBy('created_at', 'DESC')->get(); + return View::make('backend/reports/licenses', compact('licenses')); } /** @@ -284,296 +264,225 @@ class ReportsController extends AdminController */ public function exportLicenseReport() { + $licenses = License::orderBy('created_at', 'DESC')->get(); + $rows = array(); + $header = array( + Lang::get('admin/licenses/table.title'), + Lang::get('admin/licenses/table.serial'), + Lang::get('admin/licenses/form.seats'), + Lang::get('admin/licenses/form.remaining_seats'), + Lang::get('admin/licenses/form.expiration'), + Lang::get('admin/licenses/form.date'), + Lang::get('admin/licenses/form.cost') + ); - $licenses = License::orderBy( 'created_at', 'DESC' ) - ->get(); - $rows = [ ]; - $header = [ - Lang::get( 'admin/licenses/table.title' ), - Lang::get( 'admin/licenses/table.serial' ), - Lang::get( 'admin/licenses/form.seats' ), - Lang::get( 'admin/licenses/form.remaining_seats' ), - Lang::get( 'admin/licenses/form.expiration' ), - Lang::get( 'admin/licenses/form.date' ), - Lang::get( 'admin/licenses/form.cost' ) - ]; - - $header = array_map( 'trim', $header ); - $rows[ ] = implode( $header, ', ' ); + $header = array_map('trim', $header); + $rows[] = implode($header, ', '); // Row per license foreach ($licenses as $license) { - $row = [ ]; - $row[ ] = $license->name; - $row[ ] = $license->serial; - $row[ ] = $license->seats; - $row[ ] = $license->remaincount(); - $row[ ] = $license->expiration_date; - $row[ ] = $license->purchase_date; - $row[ ] = '"' . number_format( $license->purchase_cost ) . '"'; + $row = array(); + $row[] = $license->name; + $row[] = $license->serial; + $row[] = $license->seats; + $row[] = $license->remaincount(); + $row[] = $license->expiration_date; + $row[] = $license->purchase_date; + $row[] = '"'.number_format($license->purchase_cost).'"'; - $rows[ ] = implode( $row, ',' ); + $rows[] = implode($row, ','); } - $csv = implode( $rows, "\n" ); - $response = Response::make( $csv, 200 ); - $response->header( 'Content-Type', 'text/csv' ); - $response->header( 'Content-disposition', 'attachment;filename=report.csv' ); + $csv = implode($rows, "\n"); + $response = Response::make($csv, 200); + $response->header('Content-Type', 'text/csv'); + $response->header('Content-disposition', 'attachment;filename=report.csv'); return $response; } public function getCustomReport() { - - return View::make( 'backend/reports/custom' ); + return View::make('backend/reports/custom'); } public function postCustom() { + $assets = Asset::orderBy('created_at', 'DESC')->get(); + $rows = array(); + $header = array(); - $assets = Asset::orderBy( 'created_at', 'DESC' ) - ->get(); - $rows = [ ]; - $header = [ ]; - - if (e( Input::get( 'asset_name' ) ) == '1') { - $header[ ] = 'Asset Name'; + if (e(Input::get('asset_name')) == '1') + { + $header[] = 'Asset Name'; } - if (e( Input::get( 'asset_tag' ) ) == '1') { - $header[ ] = 'Asset Tag'; + if (e(Input::get('asset_tag')) == '1') + { + $header[] = 'Asset Tag'; } - if (e( Input::get( 'manufacturer' ) ) == '1') { - $header[ ] = 'Manufacturer'; + if (e(Input::get('manufacturer')) == '1') + { + $header[] = 'Manufacturer'; } - if (e( Input::get( 'model' ) ) == '1') { - $header[ ] = 'Model'; - $header[ ] = 'Model Number'; + if (e(Input::get('model')) == '1') + { + $header[] = 'Model'; + $header[] = 'Model Number'; } - if (e( Input::get( 'serial' ) ) == '1') { - $header[ ] = 'Serial'; + if (e(Input::get('serial')) == '1') + { + $header[] = 'Serial'; } - if (e( Input::get( 'purchase_date' ) ) == '1') { - $header[ ] = 'Purchase Date'; + if (e(Input::get('purchase_date')) == '1') + { + $header[] = 'Purchase Date'; } - if (( e( Input::get( 'purchase_cost' ) ) == '1' ) && ( e( Input::get( 'depreciation' ) ) == '0' )) { - $header[ ] = 'Purchase Cost'; + if ((e(Input::get('purchase_cost')) == '1') && (e(Input::get('depreciation')) == '0')) + { + $header[] = 'Purchase Cost'; } - if (e( Input::get( 'order' ) ) == '1') { - $header[ ] = 'Order Number'; + if (e(Input::get('order')) == '1') + { + $header[] = 'Order Number'; } - if (e( Input::get( 'supplier' ) ) == '1') { - $header[ ] = 'Supplier'; + if (e(Input::get('supplier')) == '1') + { + $header[] = 'Supplier'; } - if (e( Input::get( 'location' ) ) == '1') { - $header[ ] = 'Location'; + if (e(Input::get('location')) == '1') + { + $header[] = 'Location'; } - if (e( Input::get( 'assigned_to' ) ) == '1') { - $header[ ] = 'Assigned To'; + if (e(Input::get('assigned_to')) == '1') + { + $header[] = 'Assigned To'; } - if (e( Input::get( 'status' ) ) == '1') { - $header[ ] = 'Status'; + if (e(Input::get('status')) == '1') + { + $header[] = 'Status'; } - if (e( Input::get( 'warranty' ) ) == '1') { - $header[ ] = 'Warranty'; - $header[ ] = 'Warranty Expires'; + if (e(Input::get('warranty')) == '1') + { + $header[] = 'Warranty'; + $header[] = 'Warranty Expires'; } - if (e( Input::get( 'depreciation' ) ) == '1') { - $header[ ] = 'Purchase Cost'; - $header[ ] = 'Value'; - $header[ ] = 'Diff'; + if (e(Input::get('depreciation')) == '1') + { + $header[] = 'Purchase Cost'; + $header[] = 'Value'; + $header[] = 'Diff'; } - $header = array_map( 'trim', $header ); - $rows[ ] = implode( $header, ',' ); + $header = array_map('trim', $header); + $rows[] = implode($header, ','); - foreach ($assets as $asset) { - $row = [ ]; - if (e( Input::get( 'asset_name' ) ) == '1') { - $row[ ] = $asset->name; + foreach($assets as $asset) { + $row = array(); + if (e(Input::get('asset_name')) == '1') { + $row[] = $asset->name; } - if (e( Input::get( 'asset_tag' ) ) == '1') { - $row[ ] = $asset->asset_tag; + if (e(Input::get('asset_tag')) == '1') { + $row[] = $asset->asset_tag; } - if (e( Input::get( 'manufacturer' ) ) == '1') { + if (e(Input::get('manufacturer')) == '1') { if ($asset->model->manufacturer) { - $row[ ] = $asset->model->manufacturer->name; + $row[] = $asset->model->manufacturer->name; } else { - $row[ ] = ''; + $row[] = ''; } } - if (e( Input::get( 'model' ) ) == '1') { - $row[ ] = '"' . $asset->model->name . '"'; - $row[ ] = '"' . $asset->model->modelno . '"'; + if (e(Input::get('model')) == '1') { + $row[] = '"'.$asset->model->name.'"'; + $row[] = '"'.$asset->model->modelno.'"'; } - if (e( Input::get( 'serial' ) ) == '1') { - $row[ ] = $asset->serial; + if (e(Input::get('serial')) == '1') { + $row[] = $asset->serial; } - if (e( Input::get( 'purchase_date' ) ) == '1') { - $row[ ] = $asset->purchase_date; + if (e(Input::get('purchase_date')) == '1') { + $row[] = $asset->purchase_date; } - if (e( Input::get( 'purchase_cost' ) ) == '1') { - $row[ ] = '"' . number_format( $asset->purchase_cost ) . '"'; + if (e(Input::get('purchase_cost')) == '1') { + $row[] = '"'.number_format($asset->purchase_cost).'"'; } - if (e( Input::get( 'order' ) ) == '1') { + if (e(Input::get('order')) == '1') { if ($asset->order_number) { - $row[ ] = $asset->order_number; + $row[] = $asset->order_number; } else { - $row[ ] = ''; + $row[] = ''; } } - if (e( Input::get( 'supplier' ) ) == '1') { + if (e(Input::get('supplier')) == '1') { if ($asset->supplier_id) { - $row[ ] = $asset->supplier->name; + $row[] = $asset->supplier->name; } else { - $row[ ] = ''; + $row[] = ''; } } - if (e( Input::get( 'location' ) ) == '1') { - if (( $asset->assigned_to > 0 ) && ( $asset->assigneduser->location_id > 0 )) { - $location = Location::find( $asset->assigneduser->location_id ); + if (e(Input::get('location')) == '1') { + if (($asset->assigned_to > 0) && ($asset->assigneduser->location_id > 0)) { + $location = Location::find($asset->assigneduser->location_id); if ($location->name) { - $row[ ] = $location->name; + $row[] = $location->name; } else { - $row[ ] = ''; + $row[] = ''; } } elseif ($asset->rtd_location_id) { - $location = Location::find( $asset->rtd_location_id ); + $location = Location::find($asset->rtd_location_id); if ($location->name) { - $row[ ] = $location->name; + $row[] = $location->name; } else { - $row[ ] = ''; + $row[] = ''; } } else { - $row[ ] = ''; // Empty string if location is not set + $row[] = ''; // Empty string if location is not set } } - if (e( Input::get( 'assigned_to' ) ) == '1') { + if (e(Input::get('assigned_to')) == '1') { if ($asset->assigned_to > 0) { - $user = User::find( $asset->assigned_to ); - $row[ ] = $user->fullName(); + $user = User::find($asset->assigned_to); + $row[] = $user->fullName(); } else { - $row[ ] = ''; // Empty string if unassigned + $row[] = ''; // Empty string if unassigned } } - if (e( Input::get( 'status' ) ) == '1') { - if (( $asset->status_id == '0' ) && ( $asset->assigned_to == '0' )) { - $row[ ] = Lang::get( 'general.ready_to_deploy' ); - } elseif (( $asset->status_id == '' ) && ( $asset->assigned_to == '0' )) { - $row[ ] = Lang::get( 'general.pending' ); + if (e(Input::get('status')) == '1') { + if (($asset->status_id == '0') && ($asset->assigned_to == '0')) { + $row[] = Lang::get('general.ready_to_deploy'); + } elseif (($asset->status_id == '') && ($asset->assigned_to == '0')) { + $row[] = Lang::get('general.pending'); } elseif ($asset->assetstatus) { - $row[ ] = $asset->assetstatus->name; + $row[] = $asset->assetstatus->name; } else { - $row[ ] = ''; + $row[] = ''; } } - if (e( Input::get( 'warranty' ) ) == '1') { + if (e(Input::get('warranty')) == '1') { if ($asset->warranty_months) { - $row[ ] = $asset->warranty_months; - $row[ ] = $asset->warrantee_expires(); + $row[] = $asset->warranty_months; + $row[] = $asset->warrantee_expires(); } else { - $row[ ] = ''; - $row[ ] = ''; + $row[] = ''; + $row[] = ''; } } - if (e( Input::get( 'depreciation' ) ) == '1') { + if (e(Input::get('depreciation')) == '1') { $depreciation = $asset->getDepreciatedValue(); - $row[ ] = '"' . number_format( $asset->purchase_cost ) . '"'; - $row[ ] = '"' . number_format( $depreciation ) . '"'; - $row[ ] = '"' . number_format( $asset->purchase_cost - $depreciation ) . '"'; + $row[] = '"'.number_format($asset->purchase_cost).'"'; + $row[] = '"'.number_format($depreciation).'"'; + $row[] = '"'.number_format($asset->purchase_cost - $depreciation).'"'; } - $rows[ ] = implode( $row, ',' ); + $rows[] = implode($row, ','); } // spit out a csv - if (array_filter( $rows )) { - $csv = implode( $rows, "\n" ); - $response = Response::make( $csv, 200 ); - $response->header( 'Content-Type', 'text/csv' ); - $response->header( 'Content-disposition', 'attachment;filename=report.csv' ); - + if (array_filter($rows)) { + $csv = implode($rows, "\n"); + $response = Response::make($csv, 200); + $response->header('Content-Type', 'text/csv'); + $response->header('Content-disposition', 'attachment;filename=report.csv'); return $response; } else { - return Redirect::to( "reports/custom" ) - ->with( 'error', Lang::get( 'admin/reports/message.error' ) ); + return Redirect::to("reports/custom")->with('error', Lang::get('admin/reports/message.error')); } } - - /** - * getImprovementsReport - * - * @return mixed - * @author Vincent Sposato - * @version v1.0 - */ - public function getAssetMaintenancesReport() - { - - // Grab all the improvements - $assetMaintenances = \AssetMaintenance::with( 'asset', 'supplier' ) - ->orderBy( 'created_at', 'DESC' ) - ->get(); - - return View::make( 'backend/reports/asset_maintenances', compact( 'assetMaintenances' ) ); - - } - - /** - * exportImprovementsReport - * - * @return \Illuminate\Http\Response - * @author Vincent Sposato - * @version v1.0 - */ - public function exportAssetMaintenancesReport() - { - - // Grab all the improvements - $assetMaintenances = AssetMaintenance::with( 'asset', 'supplier' ) - ->orderBy( 'created_at', 'DESC' ) - ->get(); - - $rows = [ ]; - - $header = [ - Lang::get( 'admin/asset_maintenances/table.asset_name' ), - Lang::get( 'admin/asset_maintenances/table.supplier_name' ), - Lang::get( 'admin/asset_maintenances/form.asset_maintenance_type' ), - Lang::get( 'admin/asset_maintenances/form.title' ), - Lang::get( 'admin/asset_maintenances/form.start_date' ), - Lang::get( 'admin/asset_maintenances/form.completion_date' ), - Lang::get( 'admin/asset_maintenances/form.asset_maintenance_time' ), - Lang::get( 'admin/asset_maintenances/form.cost' ) - ]; - - $header = array_map( 'trim', $header ); - $rows[ ] = implode( $header, ',' ); - - foreach ($assetMaintenances as $assetMaintenance) { - $row = [ ]; - $row[ ] = str_replace( ',', '', $assetMaintenance->asset->name ); - $row[ ] = str_replace( ',', '', $assetMaintenance->supplier->name ); - $row[ ] = $assetMaintenance->improvement_type; - $row[ ] = $assetMaintenance->title; - $row[ ] = $assetMaintenance->start_date; - $row[ ] = $assetMaintenance->completion_date; - if (is_null( $assetMaintenance->asset_maintenance_time )) { - $improvementTime = intval( Carbon::now() - ->diffInDays( Carbon::parse( $assetMaintenance->start_date ) ) ); - } else { - $improvementTime = intval( $assetMaintenance->asset_maintenance_time ); - } - $row[ ] = $improvementTime; - $row[ ] = Lang::get( 'general.currency' ) . number_format( $assetMaintenance->cost, 2 ); - $rows[ ] = implode( $row, ',' ); - } - - // spit out a csv - $csv = implode( $rows, "\n" ); - $response = Response::make( $csv, 200 ); - $response->header( 'Content-Type', 'text/csv' ); - $response->header( 'Content-disposition', 'attachment;filename=report.csv' ); - - return $response; - } } diff --git a/app/controllers/admin/SuppliersController.php b/app/controllers/admin/SuppliersController.php index a1f71a00d0..495b9aa793 100755 --- a/app/controllers/admin/SuppliersController.php +++ b/app/controllers/admin/SuppliersController.php @@ -2,7 +2,6 @@ use AdminController; use Image; -use AssetMaintenance; use Input; use Lang; use Supplier; diff --git a/app/controllers/admin/UsersController.php b/app/controllers/admin/UsersController.php index 0d106e6882..a4792ec1a3 100755 --- a/app/controllers/admin/UsersController.php +++ b/app/controllers/admin/UsersController.php @@ -424,6 +424,21 @@ class UsersController extends AdminController } } + public function postBulkEdit() { + + if (!Input::has('edit_user')) { + return Redirect::back()->with('error', 'No users selected'); + } else { + $user_raw_array = Input::get('edit_user'); + foreach ($user_raw_array as $user_id => $value) { + $user_ids[] = $user_id; + + } + + } + + } + /** * Restore a deleted user. * diff --git a/app/database/migrations/2015_06_26_213716_create_asset_maintenances_table.php b/app/database/migrations/2015_06_26_213716_create_asset_maintenances_table.php deleted file mode 100644 index 54688f8313..0000000000 --- a/app/database/migrations/2015_06_26_213716_create_asset_maintenances_table.php +++ /dev/null @@ -1,65 +0,0 @@ -increments( 'id' ); - $table->integer( 'asset_id' ) - ->unsigned(); - $table->integer( 'supplier_id' ) - ->unsigned(); - $table->enum( 'asset_maintenance_type', $this->getEnumFields() ); - $table->string( 'title', 100 ); - $table->boolean( 'is_warranty' ); - $table->date( 'start_date' ); - $table->date( 'completion_date' ) - ->nullable(); - $table->integer( 'asset_maintenance_time' ) - ->nullable(); - $table->longText( 'notes' ) - ->nullable(); - $table->decimal( 'cost', 10, 2 ) - ->nullable(); - $table->dateTime( 'deleted_at' ) - ->nullable(); - $table->timestamps(); - } ); - } - - protected function getEnumFields() - { - - return [ - Lang::get( 'admin/asset_maintenances/general.maintenance' ), - Lang::get( 'admin/asset_maintenances/general.repair' ), - Lang::get( 'admin/asset_maintenances/general.upgrade' ) - ]; - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - - Schema::dropIfExists( 'asset_maintenances' ); - - } - -} diff --git a/app/lang/en/admin/asset_maintenances/form.php b/app/lang/en/admin/asset_maintenances/form.php deleted file mode 100755 index 785d06b08f..0000000000 --- a/app/lang/en/admin/asset_maintenances/form.php +++ /dev/null @@ -1,14 +0,0 @@ - 'Asset Maintenance Type', - 'title' => 'Title', - 'start_date' => 'Start Date', - 'completion_date' => 'Completion Date', - 'cost' => 'Cost', - 'is_warranty' => 'Warranty Improvement', - 'asset_maintenance_time' => 'Asset Maintenance Time (in days)', - 'notes' => 'Notes', - 'update' => 'Update Asset Maintenance', - 'create' => 'Create Asset Maintenance' - ]; diff --git a/app/lang/en/admin/asset_maintenances/general.php b/app/lang/en/admin/asset_maintenances/general.php deleted file mode 100755 index c7ae42d41a..0000000000 --- a/app/lang/en/admin/asset_maintenances/general.php +++ /dev/null @@ -1,11 +0,0 @@ - 'Asset Maintenances', - 'edit' => 'Edit Asset Maintenance', - 'delete' => 'Delete Asset Maintenance', - 'view' => 'View Asset Maintenance Details', - 'repair' => 'Repair', - 'maintenance' => 'Maintenance', - 'upgrade' => 'Upgrade' - ]; diff --git a/app/lang/en/admin/asset_maintenances/message.php b/app/lang/en/admin/asset_maintenances/message.php deleted file mode 100644 index ca4256efbe..0000000000 --- a/app/lang/en/admin/asset_maintenances/message.php +++ /dev/null @@ -1,17 +0,0 @@ - 'Asset Maintenance you were looking for was not found!', - 'delete' => [ - 'confirm' => 'Are you sure you wish to delete this asset maintenance?', - 'error' => 'There was an issue deleting the asset maintenance. Please try again.', - 'success' => 'The asset maintenance was deleted successfully.' - ], - 'create' => [ - 'error' => 'Asset Maintenance was not created, please try again.', - 'success' => 'Asset Maintenance created successfully.' - ], - 'asset_maintenance_incomplete' => 'Not Completed Yet', - 'warranty' => 'Warranty', - 'not_warranty' => 'Not Warranty', - ]; \ No newline at end of file diff --git a/app/lang/en/admin/asset_maintenances/table.php b/app/lang/en/admin/asset_maintenances/table.php deleted file mode 100644 index 02e9060bf6..0000000000 --- a/app/lang/en/admin/asset_maintenances/table.php +++ /dev/null @@ -1,9 +0,0 @@ - 'Asset Maintenance', - 'asset_name' => 'Asset Name', - 'supplier_name' => 'Supplier Name', - 'is_warranty' => 'Warranty', - 'dl_csv' => 'Download CSV' - ]; \ No newline at end of file diff --git a/app/lang/en/general.php b/app/lang/en/general.php index 8252b4064d..0d6da73e7e 100755 --- a/app/lang/en/general.php +++ b/app/lang/en/general.php @@ -1,133 +1,135 @@ 'Accessories', - 'accessory' => 'Accessory', - 'activity_report' => 'Activity Report', - 'address' => 'Address', - 'admin' => 'Admin', - 'all_assets' => 'All Assets', - 'all' => 'All', - 'archived' => 'Archived', - 'asset_models' => 'Asset Models', - 'asset' => 'Asset', - 'asset_report' => 'Asset Report', - 'asset_tag' => 'Asset Tag', - 'assets_available' => 'assets available', - 'assets' => 'Assets', - 'avatar_delete' => 'Delete Avatar', - 'avatar_upload' => 'Upload Avatar', - 'back' => 'Back', - 'cancel' => 'Cancel', - 'categories' => 'Asset Categories', - 'category' => 'Asset Category', - 'changeemail' => 'Change Email Address', - 'changepassword' => 'Change Password', - 'checkin' => 'Checkin', - 'checkin_from' => 'Checkin from', - 'checkout' => 'Checkout', - 'city' => 'City', - 'country' => 'Country', - 'create' => 'Create New', - 'created_asset' => 'created asset', - 'created_at' => 'Created at', - 'currency' => '$', - 'current' => 'Current', - 'custom_report' => 'Custom Asset Report', - 'dashboard' => 'Dashboard', - 'date' => 'Date', - 'delete' => 'Delete', - 'deleted' => 'Deleted', - 'deployed' => 'Deployed', - 'depreciation_report' => 'Depreciation Report', - 'download' => 'Download', - 'depreciation' => 'Depreciation', - 'editprofile' => 'Edit Your Profile', - 'eol' => 'EOL', - 'first' => 'First', - 'first_name' => 'First Name', - 'file_name' => 'File', - 'file_uploads' => 'File Uploads', - 'generate' => 'Generate', - 'groups' => 'Groups', - 'gravatar_email' => 'Gravatar Email Address', - 'history_for' => 'History for', - 'id' => 'ID', - 'image_delete' => 'Delete Image', - 'image_upload' => 'Upload Image', - 'asset_maintenance' => 'Asset Maintenance', - 'asset_maintenance_report' => 'Asset Maintenance Report', - 'asset_maintenances' => 'Asset Maintenances', - 'item' => 'Item', - 'last' => 'Last', - 'last_name' => 'Last Name', - 'license' => 'License', - 'license_report' => 'License Report', - 'licenses_available' => 'licenses available', - 'licenses' => 'Licenses', - 'list_all' => 'List All', - 'loading' => 'Loading', - 'lock_passwords' => 'This field cannot be edited in this installation.', - 'location' => 'Location', - 'locations' => 'Locations', - 'logout' => 'Logout', - 'manufacturer' => 'Manufacturer', - 'manufacturers' => 'Manufacturers', - 'model_no' => 'Model No.', - 'months' => 'months', - 'moreinfo' => 'More Info', - 'name' => 'Name', - 'next' => 'Next', - 'no_depreciation' => 'No Depreciation', - 'no_results' => 'No Results.', - 'no' => 'No', - 'notes' => 'Notes', - 'page_menu' => 'Showing _MENU_ items', - 'pagination_info' => 'Showing _START_ to _END_ of _TOTAL_ items', - 'pending' => 'Pending', - 'people' => 'People', - 'per_page' => 'Results Per Page', - 'previous' => 'Previous', - 'processing' => 'Processing', - 'profile' => 'Your profile', - 'qty' => 'QTY', - 'quanitity' => 'Quanitity', - 'ready_to_deploy' => 'Ready to Deploy', - 'recent_activity' => 'Recent Activity', - 'reports' => 'Reports', - 'save' => 'Save', - 'select' => 'Select', - 'search' => 'Search', - 'select_depreciation' => 'Select a Depreciation Type', - 'select_location' => 'Select a Location', - 'select_manufacturer' => 'Select a Manufacturer', - 'select_model' => 'Select a Model', - 'select_supplier' => 'Select a Supplier', - 'select_user' => 'Select a User', - 'select_date' => 'Select Date', - 'select_statuslabel' => 'Select Status', - 'settings' => 'Settings', - 'sign_in' => 'Sign in', - 'site_name' => 'Site Name', - 'state' => 'State', - 'status_labels' => 'Status Labels', - 'status' => 'Status', - 'suppliers' => 'Suppliers', - 'total_assets' => 'total assets', - 'total_licenses' => 'total licenses', - 'type' => 'Type', - 'undeployable' => 'Un-deployable', - 'unknown_admin' => 'Unknown Admin', - 'update' => 'Update', - 'uploaded' => 'Uploaded', - 'user' => 'User', - 'users' => 'Users', - 'viewassets' => 'View Assigned Assets', - 'website' => 'Website', - 'welcome' => 'Welcome, :name', - 'years' => 'years', - 'yes' => 'Yes', - 'zip' => 'Zip', - ]; + 'accessories' => 'Accessories', + 'accessory' => 'Accessory', + 'action' => 'Action', + 'activity_report' => 'Activity Report', + 'address' => 'Address', + 'admin' => 'Admin', + 'all_assets' => 'All Assets', + 'all' => 'All', + 'archived' => 'Archived', + 'asset_models' => 'Asset Models', + 'asset' => 'Asset', + 'asset_report' => 'Asset Report', + 'asset_tag' => 'Asset Tag', + 'assets_available' => 'assets available', + 'assets' => 'Assets', + 'avatar_delete' => 'Delete Avatar', + 'avatar_upload' => 'Upload Avatar', + 'back' => 'Back', + 'bad_data' => 'Nothing found. Maybe bad data?', + 'cancel' => 'Cancel', + 'categories' => 'Categories', + 'category' => 'Category', + 'changeemail' => 'Change Email Address', + 'changepassword' => 'Change Password', + 'checkin' => 'Checkin', + 'checkin_from' => 'Checkin from', + 'checkout' => 'Checkout', + 'city' => 'City', + 'consumable' => 'Consumable', + 'consumables' => 'Consumables', + 'country' => 'Country', + 'create' => 'Create New', + 'created_asset' => 'created asset', + 'created_at' => 'Created at', + 'currency' => '$', // this is deprecated + 'current' => 'Current', + 'custom_report' => 'Custom Asset Report', + 'dashboard' => 'Dashboard', + 'date' => 'Date', + 'delete' => 'Delete', + 'deleted' => 'Deleted', + 'deployed' => 'Deployed', + 'depreciation_report' => 'Depreciation Report', + 'download' => 'Download', + 'depreciation' => 'Depreciation', + 'editprofile' => 'Edit Your Profile', + 'eol' => 'EOL', + 'first' => 'First', + 'first_name' => 'First Name', + 'file_name' => 'File', + 'file_uploads' => 'File Uploads', + 'generate' => 'Generate', + 'groups' => 'Groups', + 'gravatar_email' => 'Gravatar Email Address', + 'history_for' => 'History for', + 'id' => 'ID', + 'image_delete' => 'Delete Image', + 'image_upload' => 'Upload Image', + 'item' => 'Item', + 'last' => 'Last', + 'last_name' => 'Last Name', + 'license' => 'License', + 'license_report' => 'License Report', + 'licenses_available' => 'licenses available', + 'licenses' => 'Licenses', + 'list_all' => 'List All', + 'loading' => 'Loading', + 'lock_passwords' => 'This field cannot be edited in this installation.', + 'location' => 'Location', + 'locations' => 'Locations', + 'logout' => 'Logout', + 'manufacturer' => 'Manufacturer', + 'manufacturers' => 'Manufacturers', + 'model_no' => 'Model No.', + 'months' => 'months', + 'moreinfo' => 'More Info', + 'name' => 'Name', + 'next' => 'Next', + 'no_depreciation' => 'No Depreciation', + 'no_results' => 'No Results.', + 'no' => 'No', + 'notes' => 'Notes', + 'page_menu' => 'Showing _MENU_ items', + 'pagination_info' => 'Showing _START_ to _END_ of _TOTAL_ items', + 'pending' => 'Pending', + 'people' => 'People', + 'per_page' => 'Results Per Page', + 'previous' => 'Previous', + 'processing' => 'Processing', + 'profile' => 'Your profile', + 'qty' => 'QTY', + 'quanitity' => 'Quanitity', + 'ready_to_deploy' => 'Ready to Deploy', + 'recent_activity' => 'Recent Activity', + 'reports' => 'Reports', + 'save' => 'Save', + 'select' => 'Select', + 'search' => 'Search', + 'select_depreciation' => 'Select a Depreciation Type', + 'select_location' => 'Select a Location', + 'select_manufacturer' => 'Select a Manufacturer', + 'select_model' => 'Select a Model', + 'select_supplier' => 'Select a Supplier', + 'select_user' => 'Select a User', + 'select_date' => 'Select Date', + 'select_statuslabel' => 'Select Status', + 'settings' => 'Settings', + 'sign_in' => 'Sign in', + 'site_name' => 'Site Name', + 'state' => 'State', + 'status_labels' => 'Status Labels', + 'status' => 'Status', + 'suppliers' => 'Suppliers', + 'total_assets' => 'total assets', + 'total_licenses' => 'total licenses', + 'type' => 'Type', + 'undeployable' => 'Un-deployable', + 'unknown_admin' => 'Unknown Admin', + 'update' => 'Update', + 'uploaded' => 'Uploaded', + 'user' => 'User', + 'users' => 'Users', + 'viewassets' => 'View Assigned Assets', + 'website' => 'Website', + 'welcome' => 'Welcome, :name', + 'years' => 'years', + 'yes' => 'Yes', + 'zip' => 'Zip', + +); diff --git a/app/models/Asset.php b/app/models/Asset.php index d918649384..116da4ba13 100755 --- a/app/models/Asset.php +++ b/app/models/Asset.php @@ -7,7 +7,7 @@ class Asset extends Depreciable protected $table = 'assets'; protected $errors; - protected $rules = [ + protected $rules = array( 'name' => 'alpha_space|min:2|max:255', 'model_id' => 'required', 'status_id' => 'required', @@ -20,7 +20,7 @@ class Asset extends Depreciable 'supplier_id' => 'integer', 'asset_tag' => 'required|alpha_space|min:3|max:255|unique:assets,asset_tag,{id}', 'status' => 'integer' - ]; + ); public function depreciation() { @@ -79,21 +79,6 @@ class Asset extends Depreciable return $this->hasMany('Actionlog','asset_id')->where('asset_type','=','hardware')->orderBy('created_at', 'desc')->withTrashed(); } - /** - * assetmaintenances - * Get improvements for this asset - * @return mixed - * @author Vincent Sposato - * @version v1.0 - */ - public function assetmaintenances() - { - - return $this->hasMany( 'AssetMaintenance', 'asset_id' ) - ->orderBy( 'created_at', 'desc' ) - ->withTrashed(); - } - /** * Get action logs for this asset */ diff --git a/app/models/AssetMaintenance.php b/app/models/AssetMaintenance.php deleted file mode 100644 index 9d42f381ba..0000000000 --- a/app/models/AssetMaintenance.php +++ /dev/null @@ -1,84 +0,0 @@ - 'required|integer', - 'supplier_id' => 'required|integer', - 'asset_maintenance_type' => 'required', - 'title' => 'required|max:100', - 'is_warranty' => 'boolean', - 'start_date' => 'required|date_format:Y-m-d', - 'completion_date' => 'date_format:Y-m-d', - 'notes' => 'string', - 'cost' => 'numeric' - ]; - - /** - * getImprovementOptions - * - * @return array - * @author Vincent Sposato - * @version v1.0 - */ - public static function getImprovementOptions() - { - - return [ - Lang::get( 'admin/asset_maintenances/general.maintenance' ) => Lang::get( 'admin/asset_maintenances/general.maintenance' ), - Lang::get( 'admin/asset_maintenances/general.repair' ) => Lang::get( 'admin/asset_maintenances/general.repair' ), - Lang::get( 'admin/asset_maintenances/general.upgrade' ) => Lang::get( 'admin/asset_maintenances/general.upgrade' ) - ]; - } - - /** - * asset - * Get asset for this improvement - * - * @return mixed - * @author Vincent Sposato - * @version v1.0 - */ - public function asset() - { - - return $this->belongsTo( 'Asset', 'asset_id' ) - ->withTrashed(); - } - - public function supplier() - { - - return $this->belongsTo( 'Supplier', 'supplier_id' ) - ->withTrashed(); - } - - /** - * ----------------------------------------------- - * BEGIN QUERY SCOPES - * ----------------------------------------------- - **/ - - /** - * Query builder scope for Deleted assets - * - * @param Illuminate\Database\Query\Builder $query Query builder instance - * - * @return Illuminate\Database\Query\Builder Modified query builder - */ - - public function scopeDeleted( $query ) - { - - return $query->whereNotNull( 'deleted_at' ); - } - } \ No newline at end of file diff --git a/app/models/Supplier.php b/app/models/Supplier.php index b2b34ad906..36f4c5fab1 100755 --- a/app/models/Supplier.php +++ b/app/models/Supplier.php @@ -25,11 +25,6 @@ class Supplier extends Elegant return $this->hasMany('Asset', 'supplier_id'); } - public function asset_maintenances() - { - return $this->hasMany('AssetMaintenance', 'supplier_id'); - } - public function num_assets() { return $this->hasMany('Asset', 'supplier_id')->count(); diff --git a/app/routes.php b/app/routes.php index 6faa27b75e..6f9b884e67 100755 --- a/app/routes.php +++ b/app/routes.php @@ -81,32 +81,29 @@ Route::group(array('prefix' => 'api', 'namespace' => 'Controllers\Admin', 'befor | */ - Route::group( [ 'prefix' => 'hardware', 'namespace' => 'Controllers\Admin', 'before' => 'admin-auth' ], - function () { +Route::group(array('prefix' => 'hardware', 'namespace' => 'Controllers\Admin', 'before' => 'admin-auth'), function () { - Route::get( '/', [ - 'as' => 'hardware', - 'uses' => 'AssetsController@getIndex' - ] - ); - Route::get( 'create/{model?}', [ - 'as' => 'create/hardware', - 'uses' => 'AssetsController@getCreate' - ] - ); - Route::post( 'create', [ - 'as' => 'savenew/hardware', - 'uses' => 'AssetsController@postCreate' - ] - ); + Route::get('/', array( + 'as' => 'hardware', + 'uses' => 'AssetsController@getIndex') + ); - Route::get( '{assetId}/edit', [ - 'as' => 'update/hardware', - 'uses' => 'AssetsController@getEdit' - ] - ); + Route::get('create/{model?}', array( + 'as' => 'create/hardware', + 'uses' => 'AssetsController@getCreate') + ); + + Route::post('create', array( + 'as' => 'savenew/hardware', + 'uses' => 'AssetsController@postCreate') + ); + + Route::get('{assetId}/edit', array( + 'as' => 'update/hardware', + 'uses' => 'AssetsController@getEdit') + ); Route::get('{assetId}/clone', array('as' => 'clone/hardware', 'uses' => 'AssetsController@getClone')); Route::post('{assetId}/clone', 'AssetsController@postCreate'); @@ -124,47 +121,49 @@ Route::group(array('prefix' => 'api', 'namespace' => 'Controllers\Admin', 'befor Route::get('{assetId}/showfile/{fileId}', array('as' => 'show/assetfile', 'uses' => 'AssetsController@displayFile')); Route::post('{assetId}/edit', 'AssetsController@postEdit'); - Route::post( 'bulkedit', - [ - 'as' => 'hardware/bulkedit', - 'uses' => 'AssetsController@postBulkEdit' - ] ); - Route::post( 'bulksave', - [ - 'as' => 'hardware/bulksave', - 'uses' => 'AssetsController@postBulkSave' - ] ); + Route::post('bulkedit', + array('as' => 'hardware/bulkedit', + 'uses' => 'AssetsController@postBulkEdit')); + Route::post('bulksave', + array('as' => 'hardware/bulksave', + 'uses' => 'AssetsController@postBulkSave')); - # Asset Model Management - Route::group( [ 'prefix' => 'models', 'before' => 'admin-auth' ], function () { - Route::get( '/', [ 'as' => 'models', 'uses' => 'ModelsController@getIndex' ] ); - Route::get( 'create', [ 'as' => 'create/model', 'uses' => 'ModelsController@getCreate' ] ); - Route::post( 'create', 'ModelsController@postCreate' ); - Route::get( '{modelId}/edit', [ 'as' => 'update/model', 'uses' => 'ModelsController@getEdit' ] ); - Route::post( '{modelId}/edit', 'ModelsController@postEdit' ); - Route::get( '{modelId}/clone', [ 'as' => 'clone/model', 'uses' => 'ModelsController@getClone' ] ); - Route::post( '{modelId}/clone', 'ModelsController@postCreate' ); - Route::get( '{modelId}/delete', [ 'as' => 'delete/model', 'uses' => 'ModelsController@getDelete' ] ); - Route::get( '{modelId}/view', [ 'as' => 'view/model', 'uses' => 'ModelsController@getView' ] ); - Route::get( '{modelID}/restore', [ 'as' => 'restore/model', 'uses' => 'ModelsController@getRestore' ] ); - } ); - } ); - /* - |-------------------------------------------------------------------------- - | Admin Routes - |-------------------------------------------------------------------------- - | - | Register all the admin routes. - | - */ - Route::group( [ 'prefix' => 'admin', 'before' => 'admin-auth', 'namespace' => 'Controllers\Admin' ], function () { +# Asset Model Management + Route::group(array('prefix' => 'models', 'before' => 'admin-auth'), function () { + Route::get('/', array('as' => 'models', 'uses' => 'ModelsController@getIndex')); + Route::get('create', array('as' => 'create/model', 'uses' => 'ModelsController@getCreate')); + Route::post('create', 'ModelsController@postCreate'); + Route::get('{modelId}/edit', array('as' => 'update/model', 'uses' => 'ModelsController@getEdit')); + Route::post('{modelId}/edit', 'ModelsController@postEdit'); + Route::get('{modelId}/clone', array('as' => 'clone/model', 'uses' => 'ModelsController@getClone')); + Route::post('{modelId}/clone', 'ModelsController@postCreate'); + Route::get('{modelId}/delete', array('as' => 'delete/model', 'uses' => 'ModelsController@getDelete')); + Route::get('{modelId}/view', array('as' => 'view/model', 'uses' => 'ModelsController@getView')); + Route::get('{modelID}/restore', array('as' => 'restore/model', 'uses' => 'ModelsController@getRestore')); + }); - # Licenses - Route::group( [ 'prefix' => 'licenses' ], function () { + +}); + + +/* +|-------------------------------------------------------------------------- +| Admin Routes +|-------------------------------------------------------------------------- +| +| Register all the admin routes. +| +*/ + +Route::group(array('prefix' => 'admin', 'before' => 'admin-auth', 'namespace' => 'Controllers\Admin'), function () { + + + # Licenses + Route::group(array('prefix' => 'licenses'), function () { Route::get('create', array('as' => 'create/licenses', 'uses' => 'LicensesController@getCreate')); Route::post('create', 'LicensesController@postCreate'); @@ -173,6 +172,7 @@ Route::group(array('prefix' => 'api', 'namespace' => 'Controllers\Admin', 'befor Route::get('{licenseId}/clone', array('as' => 'clone/license', 'uses' => 'LicensesController@getClone')); Route::post('{licenseId}/clone', 'LicensesController@postCreate'); Route::get('{licenseId}/delete', array('as' => 'delete/license', 'uses' => 'LicensesController@getDelete')); + Route::get('{licenseId}/freecheckout', array('as' => 'freecheckout/license', 'uses' => 'LicensesController@getFreeLicense')); Route::get('{licenseId}/checkout', array('as' => 'checkout/license', 'uses' => 'LicensesController@getCheckout')); Route::post('{licenseId}/checkout', 'LicensesController@postCheckout'); Route::get('{licenseId}/checkin/{backto?}', array('as' => 'checkin/license', 'uses' => 'LicensesController@getCheckin')); @@ -184,56 +184,56 @@ Route::group(array('prefix' => 'api', 'namespace' => 'Controllers\Admin', 'befor Route::get('/', array('as' => 'licenses', 'uses' => 'LicensesController@getIndex')); }); - # Asset Maintenances - Route::group( [ 'prefix' => 'asset_maintenances' ], function () { + # Accessories + Route::group(array('prefix' => 'accessories'), function () { - Route::get( 'create/{assetId?}', - [ 'as' => 'create/asset_maintenances', 'uses' => 'AssetMaintenancesController@getCreate' ] ); - Route::post( 'create/{assetId?}', 'AssetMaintenancesController@postCreate' ); - Route::get( '/', [ 'as' => 'asset_maintenances', 'uses' => 'AssetMaintenancesController@getIndex' ] ); - Route::get( '{assetMaintenanceId}/edit', - [ 'as' => 'update/asset_maintenance', 'uses' => 'AssetMaintenancesController@getEdit' ] ); - Route::post( '{assetMaintenanceId}/edit', 'AssetMaintenancesController@postEdit' ); - Route::get( '{assetMaintenanceId}/delete', - [ 'as' => 'delete/asset_maintenance', 'uses' => 'AssetMaintenancesController@getDelete' ] ); - Route::get( '{assetMaintenanceId}/view', - [ 'as' => 'view/asset_maintenance', 'uses' => 'AssetMaintenancesController@getView' ] ); - } ); + Route::get('create', array('as' => 'create/accessory', 'uses' => 'AccessoriesController@getCreate')); + Route::post('create', 'AccessoriesController@postCreate'); + Route::get('{accessoryID}/edit', array('as' => 'update/accessory', 'uses' => 'AccessoriesController@getEdit')); + Route::post('{accessoryID}/edit', 'AccessoriesController@postEdit'); + Route::get('{accessoryID}/delete', array('as' => 'delete/accessory', 'uses' => 'AccessoriesController@getDelete')); + Route::get('{accessoryID}/view', array('as' => 'view/accessory', 'uses' => 'AccessoriesController@getView')); + Route::get('{accessoryID}/checkout', array('as' => 'checkout/accessory', 'uses' => 'AccessoriesController@getCheckout')); + Route::post('{accessoryID}/checkout', 'AccessoriesController@postCheckout'); + Route::get('{accessoryID}/checkin/{backto?}', array('as' => 'checkin/accessory', 'uses' => 'AccessoriesController@getCheckin')); + Route::post('{accessoryID}/checkin/{backto?}', 'AccessoriesController@postCheckin'); + + Route::get('/', array('as' => 'accessories', 'uses' => 'AccessoriesController@getIndex')); + }); - # Accessories - Route::group( [ 'prefix' => 'accessories' ], function () { + # Consumables + Route::group(array('prefix' => 'consumables'), function () { - Route::get( 'create', [ 'as' => 'create/accessory', 'uses' => 'AccessoriesController@getCreate' ] ); - Route::post( 'create', 'AccessoriesController@postCreate' ); - Route::get( '{accessoryID}/edit', - [ 'as' => 'update/accessory', 'uses' => 'AccessoriesController@getEdit' ] ); - Route::post( '{accessoryID}/edit', 'AccessoriesController@postEdit' ); - Route::get( '{accessoryID}/delete', - [ 'as' => 'delete/accessory', 'uses' => 'AccessoriesController@getDelete' ] ); - Route::get( '{accessoryID}/view', [ 'as' => 'view/accessory', 'uses' => 'AccessoriesController@getView' ] ); - Route::get( '{accessoryID}/checkout', - [ 'as' => 'checkout/accessory', 'uses' => 'AccessoriesController@getCheckout' ] ); - Route::post( '{accessoryID}/checkout', 'AccessoriesController@postCheckout' ); - Route::get( '{accessoryID}/checkin/{backto?}', - [ 'as' => 'checkin/accessory', 'uses' => 'AccessoriesController@getCheckin' ] ); - Route::post( '{accessoryID}/checkin/{backto?}', 'AccessoriesController@postCheckin' ); - - Route::get( '/', [ 'as' => 'accessories', 'uses' => 'AccessoriesController@getIndex' ] ); - } ); + Route::get('create', array('as' => 'create/consumable', 'uses' => 'ConsumablesController@getCreate')); + Route::post('create', 'ConsumablesController@postCreate'); + Route::get('{consumableID}/edit', array('as' => 'update/consumable', 'uses' => 'ConsumablesController@getEdit')); + Route::post('{consumableID}/edit', 'ConsumablesController@postEdit'); + Route::get('{consumableID}/delete', array('as' => 'delete/consumable', 'uses' => 'ConsumablesController@getDelete')); + Route::get('{consumableID}/view', array('as' => 'view/consumable', 'uses' => 'ConsumablesController@getView')); + Route::get('{consumableID}/checkout', array('as' => 'checkout/consumable', 'uses' => 'ConsumablesController@getCheckout')); + Route::post('{consumableID}/checkout', 'ConsumablesController@postCheckout'); + Route::get('/', array('as' => 'accessories', 'uses' => 'ConsumablesController@getIndex')); + }); # Admin Settings Routes (for categories, maufactureres, etc) - Route::group(array('prefix' => 'settings'), function () { + Route::group(array('prefix' => 'settings','before' => 'admin-auth'), function () { - # Settings - Route::group( [ 'prefix' => 'app' ], function () { + # Settings + Route::group(array('prefix' => 'app'), function () { + Route::get('/', array('as' => 'app', 'uses' => 'SettingsController@getIndex')); + Route::get('edit', array('as' => 'edit/settings', 'uses' => 'SettingsController@getEdit')); + Route::post('edit', 'SettingsController@postEdit'); + }); + + # Settings + Route::group(array('prefix' => 'backups'), function () { + Route::get('/', array('as' => 'settings/backups', 'uses' => 'SettingsController@getBackups')); + Route::get('download/{filename}', array('as' => 'settings/download-file', 'uses' => 'SettingsController@downloadFile')); + }); - Route::get( '/', [ 'as' => 'app', 'uses' => 'SettingsController@getIndex' ] ); - Route::get( 'edit', [ 'as' => 'edit/settings', 'uses' => 'SettingsController@getEdit' ] ); - Route::post( 'edit', 'SettingsController@postEdit' ); - } ); # Manufacturers Route::group(array('prefix' => 'manufacturers'), function () { @@ -246,82 +246,67 @@ Route::group(array('prefix' => 'api', 'namespace' => 'Controllers\Admin', 'befor Route::get('{manufacturerId}/view', array('as' => 'view/manufacturer', 'uses' => 'ManufacturersController@getView')); }); - # Suppliers - Route::group( [ 'prefix' => 'suppliers' ], function () { + # Suppliers + Route::group(array('prefix' => 'suppliers'), function () { + Route::get('/', array('as' => 'suppliers', 'uses' => 'SuppliersController@getIndex')); + Route::get('create', array('as' => 'create/supplier', 'uses' => 'SuppliersController@getCreate')); + Route::post('create', 'SuppliersController@postCreate'); + Route::get('{supplierId}/edit', array('as' => 'update/supplier', 'uses' => 'SuppliersController@getEdit')); + Route::post('{supplierId}/edit', 'SuppliersController@postEdit'); + Route::get('{supplierId}/delete', array('as' => 'delete/supplier', 'uses' => 'SuppliersController@getDelete')); + Route::get('{supplierId}/view', array('as' => 'view/supplier', 'uses' => 'SuppliersController@getView')); + }); - Route::get( '/', [ 'as' => 'suppliers', 'uses' => 'SuppliersController@getIndex' ] ); - Route::get( 'create', [ 'as' => 'create/supplier', 'uses' => 'SuppliersController@getCreate' ] ); - Route::post( 'create', 'SuppliersController@postCreate' ); - Route::get( '{supplierId}/edit', - [ 'as' => 'update/supplier', 'uses' => 'SuppliersController@getEdit' ] ); - Route::post( '{supplierId}/edit', 'SuppliersController@postEdit' ); - Route::get( '{supplierId}/delete', - [ 'as' => 'delete/supplier', 'uses' => 'SuppliersController@getDelete' ] ); - Route::get( '{supplierId}/view', [ 'as' => 'view/supplier', 'uses' => 'SuppliersController@getView' ] ); - } ); + # Categories + Route::group(array('prefix' => 'categories'), function () { + Route::get('create', array('as' => 'create/category', 'uses' => 'CategoriesController@getCreate')); + Route::post('create', 'CategoriesController@postCreate'); + Route::get('{categoryId}/edit', array('as' => 'update/category', 'uses' => 'CategoriesController@getEdit')); + Route::post('{categoryId}/edit', 'CategoriesController@postEdit'); + Route::get('{categoryId}/delete', array('as' => 'delete/category', 'uses' => 'CategoriesController@getDelete')); + Route::get('{categoryId}/view', array('as' => 'view/category', 'uses' => 'CategoriesController@getView')); + Route::get('/', array('as' => 'categories', 'uses' => 'CategoriesController@getIndex')); + }); - # Categories - Route::group( [ 'prefix' => 'categories' ], function () { - Route::get( 'create', [ 'as' => 'create/category', 'uses' => 'CategoriesController@getCreate' ] ); - Route::post( 'create', 'CategoriesController@postCreate' ); - Route::get( '{categoryId}/edit', - [ 'as' => 'update/category', 'uses' => 'CategoriesController@getEdit' ] ); - Route::post( '{categoryId}/edit', 'CategoriesController@postEdit' ); - Route::get( '{categoryId}/delete', - [ 'as' => 'delete/category', 'uses' => 'CategoriesController@getDelete' ] ); - Route::get( '{categoryId}/view', - [ 'as' => 'view/category', 'uses' => 'CategoriesController@getView' ] ); - Route::get( '/', [ 'as' => 'categories', 'uses' => 'CategoriesController@getIndex' ] ); - } ); + # Depreciations + Route::group(array('prefix' => 'depreciations'), function () { + Route::get('/', array('as' => 'depreciations', 'uses' => 'DepreciationsController@getIndex')); + Route::get('create', array('as' => 'create/depreciations', 'uses' => 'DepreciationsController@getCreate')); + Route::post('create', 'DepreciationsController@postCreate'); + Route::get('{depreciationId}/edit', array('as' => 'update/depreciations', 'uses' => 'DepreciationsController@getEdit')); + Route::post('{depreciationId}/edit', 'DepreciationsController@postEdit'); + Route::get('{depreciationId}/delete', array('as' => 'delete/depreciations', 'uses' => 'DepreciationsController@getDelete')); + }); - # Depreciations - Route::group( [ 'prefix' => 'depreciations' ], function () { + # Locations + Route::group(array('prefix' => 'locations'), function () { + Route::get('/', array('as' => 'locations', 'uses' => 'LocationsController@getIndex')); + Route::get('create', array('as' => 'create/location', 'uses' => 'LocationsController@getCreate')); + Route::post('create', 'LocationsController@postCreate'); + Route::get('{locationId}/edit', array('as' => 'update/location', 'uses' => 'LocationsController@getEdit')); + Route::post('{locationId}/edit', 'LocationsController@postEdit'); + Route::get('{locationId}/delete', array('as' => 'delete/location', 'uses' => 'LocationsController@getDelete')); + }); - Route::get( '/', [ 'as' => 'depreciations', 'uses' => 'DepreciationsController@getIndex' ] ); - Route::get( 'create', - [ 'as' => 'create/depreciations', 'uses' => 'DepreciationsController@getCreate' ] ); - Route::post( 'create', 'DepreciationsController@postCreate' ); - Route::get( '{depreciationId}/edit', - [ 'as' => 'update/depreciations', 'uses' => 'DepreciationsController@getEdit' ] ); - Route::post( '{depreciationId}/edit', 'DepreciationsController@postEdit' ); - Route::get( '{depreciationId}/delete', - [ 'as' => 'delete/depreciations', 'uses' => 'DepreciationsController@getDelete' ] ); - } ); + # Status Labels + Route::group(array('prefix' => 'statuslabels'), function () { + Route::get('/', array('as' => 'statuslabels', 'uses' => 'StatuslabelsController@getIndex')); + Route::get('create', array('as' => 'create/statuslabel', 'uses' => 'StatuslabelsController@getCreate')); + Route::post('create', 'StatuslabelsController@postCreate'); + Route::get('{statuslabelId}/edit', array('as' => 'update/statuslabel', 'uses' => 'StatuslabelsController@getEdit')); + Route::post('{statuslabelId}/edit', 'StatuslabelsController@postEdit'); + Route::get('{statuslabelId}/delete', array('as' => 'delete/statuslabel', 'uses' => 'StatuslabelsController@getDelete')); + }); - # Locations - Route::group( [ 'prefix' => 'locations' ], function () { - Route::get( '/', [ 'as' => 'locations', 'uses' => 'LocationsController@getIndex' ] ); - Route::get( 'create', [ 'as' => 'create/location', 'uses' => 'LocationsController@getCreate' ] ); - Route::post( 'create', 'LocationsController@postCreate' ); - Route::get( '{locationId}/edit', - [ 'as' => 'update/location', 'uses' => 'LocationsController@getEdit' ] ); - Route::post( '{locationId}/edit', 'LocationsController@postEdit' ); - Route::get( '{locationId}/delete', - [ 'as' => 'delete/location', 'uses' => 'LocationsController@getDelete' ] ); - } ); - - # Status Labels - Route::group( [ 'prefix' => 'statuslabels' ], function () { - - Route::get( '/', [ 'as' => 'statuslabels', 'uses' => 'StatuslabelsController@getIndex' ] ); - Route::get( 'create', [ 'as' => 'create/statuslabel', 'uses' => 'StatuslabelsController@getCreate' ] ); - Route::post( 'create', 'StatuslabelsController@postCreate' ); - Route::get( '{statuslabelId}/edit', - [ 'as' => 'update/statuslabel', 'uses' => 'StatuslabelsController@getEdit' ] ); - Route::post( '{statuslabelId}/edit', 'StatuslabelsController@postEdit' ); - Route::get( '{statuslabelId}/delete', - [ 'as' => 'delete/statuslabel', 'uses' => 'StatuslabelsController@getDelete' ] ); - } ); - - } ); + }); # User Management Route::group(array('prefix' => 'users'), function () { - + Route::get('create', array('as' => 'create/user', 'uses' => 'UsersController@getCreate')); Route::post('create', 'UsersController@postCreate'); Route::get('import', array('as' => 'import/user', 'uses' => 'UsersController@getImport')); @@ -334,119 +319,127 @@ Route::group(array('prefix' => 'api', 'namespace' => 'Controllers\Admin', 'befor Route::get('{userId}/restore', array('as' => 'restore/user', 'uses' => 'UsersController@getRestore')); Route::get('{userId}/view', array('as' => 'view/user', 'uses' => 'UsersController@getView')); Route::get('{userId}/unsuspend', array('as' => 'unsuspend/user', 'uses' => 'UsersController@getUnsuspend')); + Route::post('{userId}/upload', array('as' => 'upload/user', 'uses' => 'UsersController@postUpload')); + Route::get('{userId}/deletefile/{fileId}', array('as' => 'delete/userfile', 'uses' => 'UsersController@getDeleteFile')); + Route::get('{userId}/showfile/{fileId}', array('as' => 'show/userfile', 'uses' => 'UsersController@displayFile')); + + Route::post('bulkedit', + array('as' => 'users/bulkedit', + 'uses' => 'UsersController@postBulkEdit')); + Route::post('bulksave', + array('as' => 'users/bulksave', + 'uses' => 'UsersController@postBulkSave')); + + Route::get('/', array('as' => 'users', 'uses' => 'UsersController@getIndex')); - + }); - # Group Management - Route::group( [ 'prefix' => 'groups' ], function () { + # Group Management + Route::group(array('prefix' => 'groups'), function () { + Route::get('/', array('as' => 'groups', 'uses' => 'GroupsController@getIndex')); + Route::get('create', array('as' => 'create/group', 'uses' => 'GroupsController@getCreate')); + Route::post('create', 'GroupsController@postCreate'); + Route::get('{groupId}/edit', array('as' => 'update/group', 'uses' => 'GroupsController@getEdit')); + Route::post('{groupId}/edit', 'GroupsController@postEdit'); + Route::get('{groupId}/delete', array('as' => 'delete/group', 'uses' => 'GroupsController@getDelete')); + Route::get('{groupId}/restore', array('as' => 'restore/group', 'uses' => 'GroupsController@getRestore')); + Route::get('{groupId}/view', array('as' => 'view/group', 'uses' => 'GroupsController@getView')); + }); - Route::get( '/', [ 'as' => 'groups', 'uses' => 'GroupsController@getIndex' ] ); - Route::get( 'create', [ 'as' => 'create/group', 'uses' => 'GroupsController@getCreate' ] ); - Route::post( 'create', 'GroupsController@postCreate' ); - Route::get( '{groupId}/edit', [ 'as' => 'update/group', 'uses' => 'GroupsController@getEdit' ] ); - Route::post( '{groupId}/edit', 'GroupsController@postEdit' ); - Route::get( '{groupId}/delete', [ 'as' => 'delete/group', 'uses' => 'GroupsController@getDelete' ] ); - Route::get( '{groupId}/restore', [ 'as' => 'restore/group', 'uses' => 'GroupsController@getRestore' ] ); - Route::get( '{groupId}/view', [ 'as' => 'view/group', 'uses' => 'GroupsController@getView' ] ); - } ); + # Dashboard + Route::get('/', array('as' => 'admin', 'uses' => 'DashboardController@getIndex')); - # Dashboard - Route::get( '/', [ 'as' => 'admin', 'uses' => 'DashboardController@getIndex' ] ); +}); - } ); +/* +|-------------------------------------------------------------------------- +| Authentication and Authorization Routes +|-------------------------------------------------------------------------- +| +| +| +*/ - /* - |-------------------------------------------------------------------------- - | Authentication and Authorization Routes - |-------------------------------------------------------------------------- - | - | - | - */ +Route::group(array('prefix' => 'auth'), function () { - Route::group( [ 'prefix' => 'auth' ], function () { + # Login + Route::get('signin', array('as' => 'signin', 'uses' => 'AuthController@getSignin')); + Route::post('signin', 'AuthController@postSignin'); - # Login - Route::get( 'signin', [ 'as' => 'signin', 'uses' => 'AuthController@getSignin' ] ); - Route::post( 'signin', 'AuthController@postSignin' ); + # Register + #Route::get('signup', array('as' => 'signup', 'uses' => 'AuthController@getSignup')); + Route::post('signup', 'AuthController@postSignup'); - # Register - #Route::get('signup', array('as' => 'signup', 'uses' => 'AuthController@getSignup')); - Route::post( 'signup', 'AuthController@postSignup' ); + # Account Activation + Route::get('activate/{activationCode}', array('as' => 'activate', 'uses' => 'AuthController@getActivate')); - # Account Activation - Route::get( 'activate/{activationCode}', [ 'as' => 'activate', 'uses' => 'AuthController@getActivate' ] ); + # Forgot Password + Route::get('forgot-password', array('as' => 'forgot-password', 'uses' => 'AuthController@getForgotPassword')); + Route::post('forgot-password', 'AuthController@postForgotPassword'); - # Forgot Password - Route::get( 'forgot-password', [ 'as' => 'forgot-password', 'uses' => 'AuthController@getForgotPassword' ] ); - Route::post( 'forgot-password', 'AuthController@postForgotPassword' ); + # Forgot Password Confirmation + Route::get('forgot-password/{passwordResetCode}', array('as' => 'forgot-password-confirm', 'uses' => 'AuthController@getForgotPasswordConfirm')); + Route::post('forgot-password/{passwordResetCode}', 'AuthController@postForgotPasswordConfirm'); - # Forgot Password Confirmation - Route::get( 'forgot-password/{passwordResetCode}', - [ 'as' => 'forgot-password-confirm', 'uses' => 'AuthController@getForgotPasswordConfirm' ] ); - Route::post( 'forgot-password/{passwordResetCode}', 'AuthController@postForgotPasswordConfirm' ); + # Logout + Route::get('logout', array('as' => 'logout', 'uses' => 'AuthController@getLogout')); - # Logout - Route::get( 'logout', [ 'as' => 'logout', 'uses' => 'AuthController@getLogout' ] ); +}); - } ); +/* +|-------------------------------------------------------------------------- +| Account Routes +|-------------------------------------------------------------------------- +| +| +| +*/ - /* - |-------------------------------------------------------------------------- - | Account Routes - |-------------------------------------------------------------------------- - | - | - | - */ +Route::group(array('prefix' => 'account', 'before' => 'auth', 'namespace' => 'Controllers\Account'), function () { - Route::group( [ 'prefix' => 'account', 'before' => 'auth', 'namespace' => 'Controllers\Account' ], function () { - # Profile - Route::get( 'profile', [ 'as' => 'profile', 'uses' => 'ProfileController@getIndex' ] ); - Route::post( 'profile', 'ProfileController@postIndex' ); + # Profile + Route::get('profile', array('as' => 'profile', 'uses' => 'ProfileController@getIndex')); + Route::post('profile', 'ProfileController@postIndex'); - # Change Password - Route::get( 'change-password', [ 'as' => 'change-password', 'uses' => 'ChangePasswordController@getIndex' ] ); - Route::post( 'change-password', 'ChangePasswordController@postIndex' ); + # Change Password + Route::get('change-password', array('as' => 'change-password', 'uses' => 'ChangePasswordController@getIndex')); + Route::post('change-password', 'ChangePasswordController@postIndex'); - # View Assets - Route::get( 'view-assets', [ 'as' => 'view-assets', 'uses' => 'ViewAssetsController@getIndex' ] ); + # View Assets + Route::get('view-assets', array('as' => 'view-assets', 'uses' => 'ViewAssetsController@getIndex')); - # Change Email - Route::get( 'change-email', [ 'as' => 'change-email', 'uses' => 'ChangeEmailController@getIndex' ] ); - Route::post( 'change-email', 'ChangeEmailController@postIndex' ); + # Change Email + Route::get('change-email', array('as' => 'change-email', 'uses' => 'ChangeEmailController@getIndex')); + Route::post('change-email', 'ChangeEmailController@postIndex'); - # Accept Asset - Route::get( 'accept-asset/{logID}', - [ 'as' => 'account/accept-assets', 'uses' => 'ViewAssetsController@getAcceptAsset' ] ); - Route::post( 'accept-asset/{logID}', - [ 'as' => 'account/asset-accepted', 'uses' => 'ViewAssetsController@postAcceptAsset' ] ); + # Accept Asset + Route::get('accept-asset/{logID}', array('as' => 'account/accept-assets', 'uses' => 'ViewAssetsController@getAcceptAsset')); + Route::post('accept-asset/{logID}', array('as' => 'account/asset-accepted', 'uses' => 'ViewAssetsController@postAcceptAsset')); - # Profile - Route::get( 'requestable-assets', - [ 'as' => 'requestable-assets', 'uses' => 'ViewAssetsController@getRequestableIndex' ] ); - Route::get( 'request-asset/{assetId}', - [ 'as' => 'account/request-asset', 'uses' => 'ViewAssetsController@getRequestAsset' ] ); + # Profile + Route::get('requestable-assets', array('as' => 'requestable-assets', 'uses' => 'ViewAssetsController@getRequestableIndex')); + Route::get('request-asset/{assetId}', array('as' => 'account/request-asset', 'uses' => 'ViewAssetsController@getRequestAsset')); - # Account Dashboard - Route::get( '/', [ 'as' => 'account', 'uses' => 'DashboardController@getIndex' ] ); + # Account Dashboard + Route::get('/', array('as' => 'account', 'uses' => 'DashboardController@getIndex')); - } ); - /* - |-------------------------------------------------------------------------- - | Application Routes - |-------------------------------------------------------------------------- - | - | Here is where you can register all of the routes for an application. - | It's a breeze. Simply tell Laravel the URIs it should respond to - | and give it the Closure to execute when that URI is requested. - | - */ +}); - Route::group( [ 'before' => 'reporting-auth', 'namespace' => 'Controllers\Admin' ], function () { +/* +|-------------------------------------------------------------------------- +| Application Routes +|-------------------------------------------------------------------------- +| +| Here is where you can register all of the routes for an application. +| It's a breeze. Simply tell Laravel the URIs it should respond to +| and give it the Closure to execute when that URI is requested. +| +*/ + +Route::group(array('before' => 'reporting-auth', 'namespace' => 'Controllers\Admin'), function () { Route::get('reports/depreciation', array('as' => 'reports/depreciation', 'uses' => 'ReportsController@getDeprecationReport')); Route::get('reports/export/depreciation', array('as' => 'reports/export/depreciation', 'uses' => 'ReportsController@exportDeprecationReport')); @@ -457,15 +450,10 @@ Route::group(array('prefix' => 'api', 'namespace' => 'Controllers\Admin', 'befor Route::get('reports/custom', array('as' => 'reports/custom', 'uses' => 'ReportsController@getCustomReport')); Route::post('reports/custom', 'ReportsController@postCustom'); - + Route::get('reports/activity', array('as' => 'reports/activity', 'uses' => 'ReportsController@getActivityReport')); }); - Route::get( '/', - [ 'as' => 'home', 'before' => 'admin-auth', 'uses' => 'Controllers\Admin\DashboardController@getIndex' ] ); Route::get('/', array('as' => 'home', 'before' => 'admin-auth', 'uses' => 'Controllers\Admin\DashboardController@getIndex')); - - - diff --git a/app/views/backend/asset_maintenances/edit.blade.php b/app/views/backend/asset_maintenances/edit.blade.php deleted file mode 100644 index 68114e0a88..0000000000 --- a/app/views/backend/asset_maintenances/edit.blade.php +++ /dev/null @@ -1,146 +0,0 @@ -@extends('backend/layouts/default') - -{{-- Page title --}} -@section('title') - @if ($assetMaintenance->id) - @lang('admin/asset_maintenances/form.update') :: - @else - @lang('admin/asset_maintenances/form.create') :: - @endif - @parent -@stop - -{{-- Page content --}} -@section('content') - -
-
- - @lang('general.back') -

- @if ($assetMaintenance->id) - @lang('admin/asset_maintenances/form.update') - @else - @lang('admin/asset_maintenances/form.create') - @endif -

-
-
- -
- -
- - - - -
- -
- @if ($selectedAsset == null) - {{ Form::select('asset_id', $asset_list , Input::old('asset_id', $assetMaintenance->asset_id), ['class'=>'select2', 'style'=>'min-width:350px']) }} - @else - {{ Form::select('asset_id', $asset_list , Input::old('asset_id', $selectedAsset), ['class'=>'select2', 'style'=>'min-width:350px', 'enabled' => 'false']) }} - @endif - {{ $errors->first('asset_id', '
:message') }} -
-
- - -
- -
- {{ Form::select('supplier_id', $supplier_list , Input::old('supplier_id', $assetMaintenance->supplier_id), ['class'=>'select2', 'style'=>'min-width:350px']) }} - {{ $errors->first('supplier_id', '
:message') }} -
-
- - -
- -
- {{ Form::select('asset_maintenance_type', $assetMaintenanceType , Input::old('asset_maintenance_type', $assetMaintenance->asset_maintenance_type), ['class'=>'select2', 'style'=>'min-width:350px']) }} - {{ $errors->first('asset_maintenance_type', '
:message') }} -
-
- - -
- - -
- - {{ $errors->first('title', '
:message') }} -
-
- - -
- -
- - - {{ $errors->first('start_date', '
:message') }} -
-
- - -
- -
- - - {{ $errors->first('completion_date', '
:message') }} -
-
- - -
-
-
- -
-
-
- - -
- -
-
- @lang('general.currency') - - {{ $errors->first('cost', '
:message') }} -
-
-
- - -
- -
- - {{ $errors->first('notes', '
:message') }} -
-
- - -
- -
- - @lang('button.cancel') - -
-
- -
-
- -@stop diff --git a/app/views/backend/asset_maintenances/index.blade.php b/app/views/backend/asset_maintenances/index.blade.php deleted file mode 100644 index d05862f426..0000000000 --- a/app/views/backend/asset_maintenances/index.blade.php +++ /dev/null @@ -1,56 +0,0 @@ -@extends('backend/layouts/default') - -{{-- Page title --}} -@lang('admin/asset_maintenances/general.improvements') :: -@parent -@stop - -{{-- Page content --}} -@section('content') -
-
- Create New -

@lang('admin/asset_maintenances/general.asset_maintenances')

-
-
- -
- {{ Datatable::table() - ->addColumn(Lang::get('admin/asset_maintenances/table.asset_name'), - Lang::get('admin/asset_maintenances/table.supplier_name'), - Lang::get('admin/asset_maintenances/form.asset_maintenance_type'), - Lang::get('admin/asset_maintenances/form.title'), - Lang::get('admin/asset_maintenances/form.start_date'), - Lang::get('admin/asset_maintenances/form.completion_date'), - Lang::get('admin/asset_maintenances/form.asset_maintenance_time'), - Lang::get('admin/asset_maintenances/form.cost'), - Lang::get('table.actions')) - ->setOptions( - [ - 'language' => [ - 'search' => Lang::get('general.search'), - 'lengthMenu' => Lang::get('general.page_menu'), - 'loadingRecords' => Lang::get('general.loading'), - 'zeroRecords' => Lang::get('general.no_results'), - 'info' => Lang::get('general.pagination_info'), - 'processing' => Lang::get('general.processing'), - 'paginate'=> [ - 'first'=>Lang::get('general.first'), - 'previous'=>Lang::get('general.previous'), - 'next'=>Lang::get('general.next'), - 'last'=>Lang::get('general.last'), - ], - ], - 'sAjaxSource'=>route('api.asset_maintenances.list'), - 'dom' =>'CT<"clear">lfrtip', - 'colVis'=> ['showAll'=>'Show All','restore'=>'Restore','activate'=>'mouseover'], - 'columnDefs'=> [ - ['bSortable'=>false,'targets'=>[8]], - ['width'=>'12%','targets'=>[8]], - ], - 'order'=>[[0,'asc']], - ] - ) - ->render() }} -
-@stop diff --git a/app/views/backend/asset_maintenances/view.blade.php b/app/views/backend/asset_maintenances/view.blade.php deleted file mode 100644 index c38fcb6d53..0000000000 --- a/app/views/backend/asset_maintenances/view.blade.php +++ /dev/null @@ -1,110 +0,0 @@ - -@extends('backend/layouts/default') - -{{-- Page title --}} -@section('title') - @lang('admin/asset_maintenances/general.view') {{ $assetMaintenance->title }} :: - @parent -@stop - -{{-- Page content --}} -@section('content') -
-
-

- @lang('admin/asset_maintenances/general.view') - {{{ " - " . $assetMaintenance->title }}} -

- -
- - -
-
-
- - -@stop \ No newline at end of file diff --git a/app/views/backend/hardware/index.blade.php b/app/views/backend/hardware/index.blade.php index 1476d7ba99..c1b58d314a 100755 --- a/app/views/backend/hardware/index.blade.php +++ b/app/views/backend/hardware/index.blade.php @@ -86,7 +86,7 @@ 'last'=>Lang::get('general.last'), ), ), - 'sAjaxSource'=> route('api.hardware.list', Input::get('status')), + 'sAjaxSource'=> route('api.hardware.list', array(''=>Input::get('status'),'order_number'=>Input::get('order_number'))), 'dom' =>'CT<"clear">lfrtip', 'colVis'=> array('showAll'=>'Show All','restore'=>'Restore','exclude'=>array(0,12,13),'activate'=>'mouseover'), 'columnDefs'=> array(array('visible'=>false,'targets'=>array(7,8,9)),array('orderable'=>false,'targets'=>array(0,12,13))), diff --git a/app/views/backend/hardware/view.blade.php b/app/views/backend/hardware/view.blade.php index f000738ccd..179983f81c 100755 --- a/app/views/backend/hardware/view.blade.php +++ b/app/views/backend/hardware/view.blade.php @@ -50,12 +50,12 @@ @if ($asset->model->deleted_at!='')
- @lang('admin/hardware/general.model_deleted', ['model_id' => $asset->model->id]) + @lang('admin/hardware/general.model_deleted', array('model_id' => $asset->model->id))
@elseif ($asset->deleted_at!='')
- @lang('admin/hardware/general.deleted', ['asset_id' => $asset->id]) + @lang('admin/hardware/general.deleted', array('asset_id' => $asset->id))
@endif @@ -197,69 +197,14 @@ @endif - - -
-
-
- New Improvement -
@lang('general.asset_maintenances')
-
-
- - @if (count($asset->assetmaintenances) > 0) - - - - - - - - - - - - - - - @foreach ($asset->asset_maintenances as $assetMaintenance) - @if (is_null($assetMaintenance->deleted_at)) - - - - - - - - cost; ?> - - - @endif - @endforeach - - - - - - - - - - - -
@lang('admin/asset_maintenances/table.supplier_name')@lang('admin/asset_maintenances/form.asset_maintenance_type')@lang('admin/asset_maintenances/form.start_date')@lang('admin/asset_maintenances/form.completion_date')@lang('admin/asset_maintenances/table.is_warranty')@lang('admin/asset_maintenances/form.cost')@lang('table.actions')
{{{ $assetMaintenance->supplier->name }}}{{{ $assetMaintenance->improvement_type }}}{{{ $assetMaintenance->start_date }}}{{{ $assetMaintenance->completion_date }}}{{{ $assetMaintenance->is_warranty ? Lang::get('admin/asset_maintenances/message.warranty') : Lang::get('admin/asset_maintenances/message.not_warranty') }}}{{{ sprintf( Lang::get( 'general.currency' ) . '%01.2f', $assetMaintenance->cost) }}} -
{{{sprintf(Lang::get( 'general.currency' ) . '%01.2f', $totalCost)}}}
- @else -
-
- - @lang('general.no_results') -
-
- @endif -
-
+ + +
+ +
@lang('general.file_uploads') [ @lang('button.add') ]
+ + @@ -303,75 +248,82 @@ - @endif - - -
-
-
- - - - - - - - - - - - - @if (count($asset->assetlog) > 0) - @foreach ($asset->assetlog as $log) - - - - - - - - + +
@lang('general.date')@lang('general.admin')@lang('table.actions')@lang('general.user')@lang('general.notes')
{{{ $log->created_at }}} - @if (isset($log->user_id)) - {{{ $log->adminlog->fullName() }}} - @endif - {{ $log->action_type }} - @if ((isset($log->checkedout_to)) && ($log->checkedout_to!=0) && ($log->checkedout_to!='')) - - @if ($log->userlog->deleted_at=='') - - {{{ $log->userlog->fullName() }}} - - @else - {{{ $log->userlog->fullName() }}} @endif - @endif - - @if ($log->note) {{{ $log->note }}} - @endif -
- @endforeach - @endif - - {{ $asset->created_at }} - - @if (isset($asset->adminuser->id)) {{{ $asset->adminuser->fullName() }}} - @else - @lang('general.unknown_admin') +
+ + + + + + + + + + + + + + + + + + @if (count($asset->assetlog) > 0) + @foreach ($asset->assetlog as $log) + + + + + + + + + + @endforeach @endif - - - - + + + + + - - -
@lang('general.date')@lang('general.admin')@lang('table.actions')@lang('general.user')@lang('general.notes')
{{{ $log->created_at }}} + @if (isset($log->user_id)) + {{{ $log->adminlog->fullName() }}} + @endif + {{ $log->action_type }} + @if ((isset($log->checkedout_to)) && ($log->checkedout_to!=0) && ($log->checkedout_to!='')) + + @if ($log->userlog->deleted_at=='') + + {{{ $log->userlog->fullName() }}} + + @else + {{{ $log->userlog->fullName() }}} + @endif + + @endif + + @if ($log->note) {{{ $log->note }}} + @endif +
@lang('general.created_asset') +
{{ $asset->created_at }} + @if (isset($asset->adminuser->id)) {{{ $asset->adminuser->fullName() }}} + @else + @lang('general.unknown_admin') + @endif + @lang('general.created_asset') -
-
+ {{{ $asset->notes }}} + @endif --> + + + + + + +
diff --git a/app/views/backend/layouts/default.blade.php b/app/views/backend/layouts/default.blade.php index 5e548a945b..ca7aa4fb82 100644 --- a/app/views/backend/layouts/default.blade.php +++ b/app/views/backend/layouts/default.blade.php @@ -281,10 +281,10 @@
  • @lang('general.list_all')
  •  
  • -
  • @lang('general.asset_models')
  • -
  • @lang('general.categories')
  • -
  • @lang('general.deleted')
  • -
  • @lang('general.asset_maintenances')
  • +
  • @lang('general.asset_models')
  • +
  • @lang('general.categories')
  • +
  • @lang('general.deleted')
  • +
    ' : '>') }} @@ -293,6 +293,13 @@ @lang('general.accessories') +
    ' : '>') }} + + + @lang('general.consumables') + + +
    ' : '>') }} @@ -302,7 +309,6 @@ -
    ' : '>') }} @@ -322,11 +328,10 @@ @endif diff --git a/app/views/backend/reports/asset_maintenances.blade.php b/app/views/backend/reports/asset_maintenances.blade.php deleted file mode 100644 index d4c648b7fb..0000000000 --- a/app/views/backend/reports/asset_maintenances.blade.php +++ /dev/null @@ -1,78 +0,0 @@ - -@extends('backend/layouts/default') - -{{-- Page title --}} -@section('title') - @lang('general.asset_maintenance_report') :: - @parent -@stop - -{{-- Page content --}} -@section('content') - -
    -
    - - - - - - - - - - - - - - - - @foreach ($assetMaintenances as $assetMaintenance) - - - - - - - - @if (is_null($assetMaintenance->asset_maintenance_time)) - diffInDays(Carbon::parse($assetMaintenance->start_date))); - ?> - @else - asset_maintenance_time); - ?> - @endif - - - - cost); - ?> - @endforeach - - - - - - - - -
    @lang('admin/asset_maintenances/table.asset_name')@lang('admin/asset_maintenances/table.supplier_name')@lang('admin/asset_maintenances/form.asset_maintenance_type')@lang('admin/asset_maintenances/form.title')@lang('admin/asset_maintenances/form.start_date')@lang('admin/asset_maintenances/form.completion_date')@lang('admin/asset_maintenances/form.asset_maintenance_time')@lang('admin/asset_maintenances/form.cost')
    {{{ $assetMaintenance->asset->name }}}{{{ $assetMaintenance->supplier->name }}}{{{ $assetMaintenance->asset_maintenance_type }}}{{{ $assetMaintenance->title }}}{{{ $assetMaintenance->start_date }}}{{{ is_null($assetMaintenance->completion_date) ? Lang::get('admin/asset_maintenances/message.asset_maintenance_incomplete') : $assetMaintenance->completion_date }}}{{{ $assetMaintenanceTime }}}@lang('general.currency'){{ number_format($assetMaintenance->cost,2) }}
    Totals:{{number_format($totalDays)}}@lang('general.currency'){{ number_format($totalCost,2) }}
    -
    -
    -@stop \ No newline at end of file diff --git a/app/views/backend/suppliers/view.blade.php b/app/views/backend/suppliers/view.blade.php index 16e2997331..42ce3a13e5 100755 --- a/app/views/backend/suppliers/view.blade.php +++ b/app/views/backend/suppliers/view.blade.php @@ -25,144 +25,86 @@
    - -
    Assets
    -
    - @if (count($supplier->assets) > 0) - - - - - - - - - - + +
    Assets
    +
    + @if (count($supplier->assets) > 0) +
    NameAsset TagUserActions
    + + + + + + + + + - @foreach ($supplier->assets as $supplierassets) - - - - - - + @foreach ($supplier->assets as $supplierassets) + + + + + - - @endforeach + + @endforeach - -
    NameAsset TagUserActions
    {{{ $supplierassets->name }}}{{{ $supplierassets->name }}}{{{ $supplierassets->asset_tag }}} - @if ($supplierassets->assigneduser) - - {{{ $supplierassets->assigneduser->fullName() }}} - - @endif - - @if ($supplierassets->assigned_to != '') - Checkin - @else - Checkout - @endif -
    {{{ $supplierassets->name }}}{{{ $supplierassets->asset_tag }}} + @if ($supplierassets->assigneduser) + + {{{ $supplierassets->assigneduser->fullName() }}} + + @endif + + @if ($supplierassets->assigned_to != '') + Checkin + @else + Checkout + @endif +
    + + - @else -
    -
    - - @lang('general.no_results') -
    -
    - @endif -
    -
    -
    Software
    -
    - @if (count($supplier->licenses) > 0) - - - - - - - - - @foreach ($supplier->licenses as $license) - - - - - - @endforeach - -
    NameSerial
    {{{ $license->name }}}{{{ $license->serial }}}
    - @else - -
    -
    - - @lang('general.no_results') -
    -
    - @endif - -
    -
    -
    Improvements
    -
    - - @if (count($supplier->improvements) > 0) - - - - - - - - - - - - - - - @foreach ($supplier->improvements as $improvement) - @if (is_null($improvement->deleted_at)) - - - - - - - - cost; ?> - - - @endif - @endforeach - - - - - - - - - - - -
    @lang('admin/improvements/table.asset_name')@lang('admin/improvements/form.improvement_type')@lang('admin/improvements/form.start_date')@lang('admin/improvements/form.completion_date')@lang('admin/improvements/table.is_warranty')@lang('admin/improvements/form.cost')@lang('table.actions')
    {{{ $improvement->asset->name }}}{{{ $improvement->improvement_type }}}{{{ $improvement->start_date }}}{{{ $improvement->completion_date }}}{{{ $improvement->is_warranty ? Lang::get('admin/improvements/message.warranty') : Lang::get('admin/improvements/message.not_warranty') }}}{{{ sprintf( Lang::get( 'general.currency' ) . '%01.2f', $improvement->cost) }}} -
    {{{sprintf(Lang::get( 'general.currency' ) . '%01.2f', $totalCost)}}}
    - @else -
    -
    - - @lang('general.no_results') -
    -
    - @endif + @else +
    +
    + + @lang('general.no_results') +
    +
    + @endif +
    +
    +
    Software
    +
    + @if (count($supplier->licenses) > 0) + + + + + + + + + @foreach ($supplier->licenses as $license) + + + + + + @endforeach + +
    NameSerial
    {{{ $license->name }}}{{{ $license->serial }}}
    + @else +
    +
    + + @lang('general.no_results') +
    +
    + @endif
    diff --git a/bootstrap/start.php b/bootstrap/start.php index 81bf2ab19a..300ba1005c 100755 --- a/bootstrap/start.php +++ b/bootstrap/start.php @@ -26,8 +26,8 @@ $app = new Illuminate\Foundation\Application; $env = $app->detectEnvironment(array( - 'local' => array('homestead','YourLocalDevHostname','AlisonMBP'), - 'staging' => array('stagingweb01','staging.yourserver.com'), + 'local' => array('YourLocalDevHostname','AlisonMBP'), + 'staging' => array('staging.yourserver.com'), 'production' => array('www.yourserver.com') ));