Merge branch 'refs/heads/develop'
This commit is contained in:
@@ -74,11 +74,11 @@ Use the following command to create your default user, user groups and run all t
|
||||
|
||||
You'll need to make sure that the app/storage directory is writable by your webserver, since caches and log files get written there. You should use the minimum permissions available for writing, based on how you've got your webserver configured.
|
||||
|
||||
chown -R 755 app/storage
|
||||
chmod -R 755 app/storage
|
||||
|
||||
If you still run into a permissions error, you may need to increase the permissions to 775, or twiddle your user/group permissions on your server.
|
||||
|
||||
chown -R 775 app/storage
|
||||
chmod -R 775 app/storage
|
||||
|
||||
-----
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ use AdminController;
|
||||
use Input;
|
||||
use Lang;
|
||||
use Asset;
|
||||
use Statuslabel;
|
||||
use User;
|
||||
use Redirect;
|
||||
use DB;
|
||||
@@ -48,7 +49,10 @@ class AssetsController extends AdminController {
|
||||
$model_list = array('' => '') + Model::lists('name', 'id');
|
||||
$depreciation_list = array('' => '') + Depreciation::lists('name', 'id');
|
||||
|
||||
return View::make('backend/assets/edit')->with('model_list',$model_list)->with('depreciation_list',$depreciation_list)->with('asset',new Asset);
|
||||
// Grab the dropdown list of status
|
||||
$statuslabel_list = array('' => 'Ready to Deploy') + Statuslabel::lists('name', 'id');
|
||||
|
||||
return View::make('backend/assets/edit')->with('model_list',$model_list)->with('statuslabel_list',$statuslabel_list)->with('depreciation_list',$depreciation_list)->with('asset',new Asset);
|
||||
|
||||
}
|
||||
|
||||
@@ -80,6 +84,7 @@ class AssetsController extends AdminController {
|
||||
$asset->order_number = e(Input::get('order_number'));
|
||||
$asset->notes = e(Input::get('notes'));
|
||||
$asset->asset_tag = e(Input::get('asset_tag'));
|
||||
$asset->status_id = e(Input::get('status_id'));
|
||||
$asset->user_id = Sentry::getId();
|
||||
$asset->physical = '1';
|
||||
|
||||
@@ -122,9 +127,13 @@ class AssetsController extends AdminController {
|
||||
// Grab the dropdown list of models
|
||||
$model_list = array('' => '') + Model::lists('name', 'id');
|
||||
|
||||
// Grab the dropdown list of status
|
||||
$statuslabel_list = array('' => '') + Statuslabel::lists('name', 'id');
|
||||
|
||||
// get depreciation list
|
||||
$depreciation_list = array('' => '') + Depreciation::lists('name', 'id');
|
||||
return View::make('backend/assets/edit', compact('asset'))->with('model_list',$model_list)->with('depreciation_list',$depreciation_list);
|
||||
|
||||
return View::make('backend/assets/edit', compact('asset'))->with('model_list',$model_list)->with('depreciation_list',$depreciation_list)->with('statuslabel_list',$statuslabel_list);
|
||||
}
|
||||
|
||||
|
||||
@@ -171,6 +180,7 @@ class AssetsController extends AdminController {
|
||||
$asset->purchase_cost = e(Input::get('purchase_cost'));
|
||||
$asset->order_number = e(Input::get('order_number'));
|
||||
$asset->asset_tag = e(Input::get('asset_tag'));
|
||||
$asset->status_id = e(Input::get('status_id'));
|
||||
$asset->notes = e(Input::get('notes'));
|
||||
$asset->physical = '1';
|
||||
|
||||
@@ -202,11 +212,19 @@ class AssetsController extends AdminController {
|
||||
return Redirect::to('admin')->with('error', Lang::get('admin/assets/message.not_found'));
|
||||
}
|
||||
|
||||
// Delete the asset
|
||||
$asset->delete();
|
||||
if (isset($asset->assigneduser->id) && ($asset->assigneduser->id!=0)) {
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('admin')->with('error', Lang::get('admin/assets/message.assoc_users'));
|
||||
} else {
|
||||
// Delete the asset
|
||||
$asset->delete();
|
||||
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('admin')->with('success', Lang::get('admin/assets/message.delete.success'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('admin')->with('success', Lang::get('admin/assets/message.delete.success'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -224,6 +242,9 @@ class AssetsController extends AdminController {
|
||||
// Get the dropdown of users and then pass it to the checkout view
|
||||
$users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat (first_name," ",last_name) as full_name, id'))->lists('full_name', 'id');
|
||||
|
||||
|
||||
|
||||
|
||||
//print_r($users);
|
||||
return View::make('backend/assets/checkout', compact('asset'))->with('users_list',$users_list);
|
||||
|
||||
|
||||
@@ -169,11 +169,20 @@ class CategoriesController extends AdminController {
|
||||
return Redirect::to('admin/settings/categories')->with('error', Lang::get('admin/categories/message.not_found'));
|
||||
}
|
||||
|
||||
// Delete the blog post
|
||||
$category->delete();
|
||||
|
||||
// Redirect to the blog posts management page
|
||||
return Redirect::to('admin/settings/categories')->with('success', Lang::get('admin/categories/message.delete.success'));
|
||||
if ($category->has_models() > 0) {
|
||||
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('admin/settings/categories')->with('error', Lang::get('admin/categories/message.assoc_users'));
|
||||
} else {
|
||||
|
||||
$category->delete();
|
||||
|
||||
// Redirect to the locations management page
|
||||
return Redirect::to('admin/settings/categories')->with('success', Lang::get('admin/categories/message.delete.success'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -170,11 +170,18 @@ class DepreciationsController extends AdminController {
|
||||
return Redirect::to('admin/settings/depreciations')->with('error', Lang::get('admin/depreciations/message.not_found'));
|
||||
}
|
||||
|
||||
// Delete the depreciation
|
||||
$depreciation->delete();
|
||||
if ($depreciation->has_models() > 0) {
|
||||
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('admin/settings/depreciations')->with('error', Lang::get('admin/depreciations/message.assoc_users'));
|
||||
} else {
|
||||
|
||||
$depreciation->delete();
|
||||
|
||||
// Redirect to the depreciations management page
|
||||
return Redirect::to('admin/settings/depreciations')->with('success', Lang::get('admin/depreciations/message.delete.success'));
|
||||
}
|
||||
|
||||
// Redirect to the depreciations management page
|
||||
return Redirect::to('admin/settings/depreciations')->with('success', Lang::get('admin/depreciations/message.delete.success'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -187,11 +187,18 @@ class LicensesController extends AdminController {
|
||||
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
|
||||
}
|
||||
|
||||
// Delete the license
|
||||
$license->delete();
|
||||
if (isset($license->assigneduser->id) && ($license->assigneduser->id!=0)) {
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.assoc_users'));
|
||||
} else {
|
||||
// Delete the license
|
||||
$license->delete();
|
||||
|
||||
// Redirect to the licenses management page
|
||||
return Redirect::to('admin/licenses')->with('success', Lang::get('admin/licenses/message.delete.success'));
|
||||
}
|
||||
|
||||
|
||||
// Redirect to the licenses management page
|
||||
return Redirect::to('admin/licenses')->with('success', Lang::get('admin/licenses/message.delete.success'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class LocationsController extends AdminController {
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
// create a new model instance
|
||||
// create a new location instance
|
||||
$location = new Location();
|
||||
|
||||
// attempt validation
|
||||
@@ -175,11 +175,21 @@ class LocationsController extends AdminController {
|
||||
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.not_found'));
|
||||
}
|
||||
|
||||
// Delete the location
|
||||
$location->delete();
|
||||
|
||||
// Redirect to the locations management page
|
||||
return Redirect::to('admin/settings/locations')->with('success', Lang::get('admin/locations/message.delete.success'));
|
||||
if ($location->has_users() > 0) {
|
||||
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.assoc_users'));
|
||||
} else {
|
||||
|
||||
$location->delete();
|
||||
|
||||
// Redirect to the locations management page
|
||||
return Redirect::to('admin/settings/locations')->with('success', Lang::get('admin/locations/message.delete.success'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -159,11 +159,24 @@ class ManufacturersController extends AdminController {
|
||||
return Redirect::to('admin/settings/manufacturers')->with('error', Lang::get('admin/manufacturers/message.not_found'));
|
||||
}
|
||||
|
||||
// Delete the manufacturer
|
||||
$manufacturer->delete();
|
||||
if ($manufacturer->has_models() > 0) {
|
||||
|
||||
// Redirect to the manufacturers management page
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('admin/settings/manufacturers')->with('error', Lang::get('admin/manufacturers/message.assoc_users'));
|
||||
} else {
|
||||
|
||||
// Delete the manufacturer
|
||||
$manufacturer->delete();
|
||||
|
||||
// Redirect to the manufacturers management page
|
||||
return Redirect::to('admin/settings/manufacturers')->with('success', Lang::get('admin/manufacturers/message.delete.success'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -168,11 +168,20 @@ class ModelsController extends AdminController {
|
||||
return Redirect::to('assets/models')->with('error', Lang::get('admin/models/message.not_found'));
|
||||
}
|
||||
|
||||
// Delete the model
|
||||
$model->delete();
|
||||
if ($model->assets->count() > 0) {
|
||||
// Throw an error that this model is associated with assets
|
||||
return Redirect::to('assets/models')->with('error', Lang::get('admin/models/message.assoc_users'));
|
||||
|
||||
} else {
|
||||
// Delete the model
|
||||
$model->delete();
|
||||
|
||||
// Redirect to the models management page
|
||||
return Redirect::to('assets/models')->with('success', Lang::get('admin/models/message.delete.success'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Redirect to the models management page
|
||||
return Redirect::to('assets/models')->with('success', Lang::get('admin/models/message.delete.success'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php namespace Controllers\Admin;
|
||||
|
||||
use AdminController;
|
||||
use Input;
|
||||
use Lang;
|
||||
use Setting;
|
||||
use Redirect;
|
||||
use DB;
|
||||
use Sentry;
|
||||
use Str;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class SettingsController extends AdminController {
|
||||
|
||||
/**
|
||||
* Show a list of all the settings.
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the settings
|
||||
$settings = Setting::orderBy('created_at', 'DESC')->paginate(10);
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/settings/index', compact('settings'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Setting update.
|
||||
*
|
||||
* @param int $settingId
|
||||
* @return View
|
||||
*/
|
||||
public function getEdit()
|
||||
{
|
||||
$settings = Setting::orderBy('created_at', 'DESC')->paginate(10);
|
||||
return View::make('backend/settings/edit', compact('settings'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Setting update form processing page.
|
||||
*
|
||||
* @param int $settingId
|
||||
* @return Redirect
|
||||
*/
|
||||
public function postEdit()
|
||||
{
|
||||
|
||||
$new = Input::all();
|
||||
|
||||
// create a new model instance
|
||||
$setting = new Location();
|
||||
|
||||
// attempt validation
|
||||
if ($setting->validate($new))
|
||||
{
|
||||
|
||||
// Update the setting data
|
||||
$setting->option_value = e(Input::get('name'));
|
||||
|
||||
|
||||
// Was the asset created?
|
||||
if($setting->save())
|
||||
{
|
||||
// Redirect to the saved setting page
|
||||
return Redirect::to("admin/settings/app/$settingId/edit")->with('success', Lang::get('admin/settings/message.update.success'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// failure
|
||||
$errors = $setting->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
}
|
||||
|
||||
// Redirect to the setting management page
|
||||
return Redirect::to("admin/settings/app/$settingId/edit")->with('error', Lang::get('admin/settings/message.update.error'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
<?php namespace Controllers\Admin;
|
||||
|
||||
use AdminController;
|
||||
use Input;
|
||||
use Lang;
|
||||
use Statuslabel;
|
||||
use Redirect;
|
||||
use DB;
|
||||
use Sentry;
|
||||
use Str;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class StatuslabelsController extends AdminController {
|
||||
|
||||
/**
|
||||
* Show a list of all the statuslabels.
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
|
||||
public function getIndex()
|
||||
{
|
||||
// Grab all the statuslabels
|
||||
$statuslabels = Statuslabel::orderBy('created_at', 'DESC')->paginate(10);
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/statuslabels/index', compact('statuslabels'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Statuslabel create.
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function getCreate()
|
||||
{
|
||||
// Show the page
|
||||
return View::make('backend/statuslabels/edit')->with('statuslabel',new Statuslabel);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Statuslabel create form processing.
|
||||
*
|
||||
* @return Redirect
|
||||
*/
|
||||
public function postCreate()
|
||||
{
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
// create a new model instance
|
||||
$statuslabel = new Statuslabel();
|
||||
|
||||
// attempt validation
|
||||
if ($statuslabel->validate($new))
|
||||
{
|
||||
|
||||
// Save the Statuslabel data
|
||||
$statuslabel->name = e(Input::get('name'));
|
||||
$statuslabel->user_id = Sentry::getId();
|
||||
|
||||
// Was the asset created?
|
||||
if($statuslabel->save())
|
||||
{
|
||||
// Redirect to the new Statuslabel page
|
||||
return Redirect::to("admin/settings/statuslabels")->with('success', Lang::get('admin/statuslabels/message.create.success'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// failure
|
||||
$errors = $statuslabel->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
}
|
||||
|
||||
// Redirect to the Statuslabel create page
|
||||
return Redirect::to('admin/settings/statuslabels/create')->with('error', Lang::get('admin/statuslabels/message.create.error'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Statuslabel update.
|
||||
*
|
||||
* @param int $statuslabelId
|
||||
* @return View
|
||||
*/
|
||||
public function getEdit($statuslabelId = null)
|
||||
{
|
||||
// Check if the Statuslabel exists
|
||||
if (is_null($statuslabel = Statuslabel::find($statuslabelId)))
|
||||
{
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/settings/statuslabels')->with('error', Lang::get('admin/statuslabels/message.does_not_exist'));
|
||||
}
|
||||
|
||||
|
||||
return View::make('backend/statuslabels/edit', compact('statuslabel'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Statuslabel update form processing page.
|
||||
*
|
||||
* @param int $statuslabelId
|
||||
* @return Redirect
|
||||
*/
|
||||
public function postEdit($statuslabelId = null)
|
||||
{
|
||||
// Check if the Statuslabel exists
|
||||
if (is_null($statuslabel = Statuslabel::find($statuslabelId)))
|
||||
{
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/settings/statuslabels')->with('error', Lang::get('admin/statuslabels/message.does_not_exist'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
// get the POST data
|
||||
$new = Input::all();
|
||||
|
||||
|
||||
// attempt validation
|
||||
if ($statuslabel->validate($new))
|
||||
{
|
||||
|
||||
// Update the Statuslabel data
|
||||
$statuslabel->name = e(Input::get('name'));
|
||||
|
||||
// Was the asset created?
|
||||
if($statuslabel->save())
|
||||
{
|
||||
// Redirect to the saved Statuslabel page
|
||||
return Redirect::to("admin/settings/statuslabels/$statuslabelId/edit")->with('success', Lang::get('admin/statuslabels/message.update.success'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// failure
|
||||
$errors = $statuslabel->errors();
|
||||
return Redirect::back()->withInput()->withErrors($errors);
|
||||
}
|
||||
|
||||
// Redirect to the Statuslabel management page
|
||||
return Redirect::to("admin/settings/statuslabels/$statuslabelId/edit")->with('error', Lang::get('admin/statuslabels/message.update.error'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the given Statuslabel.
|
||||
*
|
||||
* @param int $statuslabelId
|
||||
* @return Redirect
|
||||
*/
|
||||
public function getDelete($statuslabelId)
|
||||
{
|
||||
// Check if the Statuslabel exists
|
||||
if (is_null($statuslabel = Statuslabel::find($statuslabelId)))
|
||||
{
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('admin/settings/statuslabels')->with('error', Lang::get('admin/statuslabels/message.not_found'));
|
||||
}
|
||||
|
||||
|
||||
if ($statuslabel->has_assets() > 0) {
|
||||
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('admin/settings/statuslabels')->with('error', Lang::get('admin/statuslabels/message.assoc_users'));
|
||||
} else {
|
||||
|
||||
$statuslabel->delete();
|
||||
|
||||
// Redirect to the statuslabels management page
|
||||
return Redirect::to('admin/settings/statuslabels')->with('success', Lang::get('admin/statuslabels/message.delete.success'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -29,7 +29,7 @@ class CreateSettingsTable extends Migration {
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::drop('settings');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddSoftDeleteOnLocations extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('locations', function($table)
|
||||
{
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddSoftDeleteOnManufacturers extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('manufacturers', function($table)
|
||||
{
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddSoftDeleteOnCategories extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('categories', function($table)
|
||||
{
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateStatusLabels extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('status_labels', function($table)
|
||||
{
|
||||
$table->increments('id');
|
||||
$table->string('name',100);
|
||||
$table->integer('user_id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('status_labels');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddStatusIdOnAssetsTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('assets', function($table)
|
||||
{
|
||||
$table->integer('status_id')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('assets', function($table)
|
||||
{
|
||||
$table->dropColumn('status_id');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddStatusTypeOnStatusLabels extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('status_labels', function($table)
|
||||
{
|
||||
$table->boolean('deployable');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('status_labels', function($table)
|
||||
{
|
||||
$table->dropColumn('deployable');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddArchivedToAssets extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('assets', function($table)
|
||||
{
|
||||
$table->boolean('archived');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('assets', function($table)
|
||||
{
|
||||
$table->dropColumn('archived');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddUploadsTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('asset_uploads', function($table)
|
||||
{
|
||||
$table->increments('id');
|
||||
$table->integer('user_id');
|
||||
$table->string('filename');
|
||||
$table->integer('asset_id');
|
||||
$table->string('filenotes')->nullable;
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('asset_uploads');
|
||||
}
|
||||
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class RemoveDeployableBooleanFromStatusLabels extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('status_labels', function($table)
|
||||
{
|
||||
$table->dropColumn('deployable');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('status_labels', function($table)
|
||||
{
|
||||
$table->boolean('deployable');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddOptionLabelToSettingsTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('settings', function($table)
|
||||
{
|
||||
$table->string('option_label','80')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('settings', function($table)
|
||||
{
|
||||
$table->dropColumn('option_label');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,8 +23,10 @@ class AssetsSeeder extends Seeder {
|
||||
'user_id' => 1,
|
||||
'assigned_to' => 1,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'license_name' => NULL,
|
||||
'license_email' => NULL,
|
||||
'status_id' => NULL,
|
||||
);
|
||||
|
||||
$asset[] = array(
|
||||
@@ -40,8 +42,10 @@ class AssetsSeeder extends Seeder {
|
||||
'user_id' => 1,
|
||||
'assigned_to' => 1,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'license_name' => NULL,
|
||||
'license_email' => NULL,
|
||||
'status_id' => NULL,
|
||||
);
|
||||
|
||||
$asset[] = array(
|
||||
@@ -57,8 +61,10 @@ class AssetsSeeder extends Seeder {
|
||||
'user_id' => 2,
|
||||
'assigned_to' => 2,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'license_name' => NULL,
|
||||
'license_email' => NULL,
|
||||
'status_id' => NULL,
|
||||
);
|
||||
|
||||
$asset[] = array(
|
||||
@@ -74,8 +80,10 @@ class AssetsSeeder extends Seeder {
|
||||
'user_id' => 2,
|
||||
'assigned_to' => 2,
|
||||
'physical' => 0,
|
||||
'archived' => 0,
|
||||
'license_name' => 'Alison Giasnotto',
|
||||
'license_email' => 'snipe@snipe.net',
|
||||
'status_id' => NULL,
|
||||
);
|
||||
|
||||
$asset[] = array(
|
||||
@@ -91,8 +99,10 @@ class AssetsSeeder extends Seeder {
|
||||
'user_id' => 2,
|
||||
'assigned_to' => 2,
|
||||
'physical' => 0,
|
||||
'archived' => 0,
|
||||
'license_name' => 'Alison Giasnotto',
|
||||
'license_email' => 'me@example.com',
|
||||
'status_id' => NULL,
|
||||
);
|
||||
|
||||
$asset[] = array(
|
||||
@@ -108,8 +118,10 @@ class AssetsSeeder extends Seeder {
|
||||
'user_id' => 2,
|
||||
'assigned_to' => 2,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'license_name' => NULL,
|
||||
'license_email' => NULL,
|
||||
'status_id' => NULL,
|
||||
);
|
||||
|
||||
$asset[] = array(
|
||||
@@ -125,10 +137,90 @@ class AssetsSeeder extends Seeder {
|
||||
'user_id' => 2,
|
||||
'assigned_to' => 2,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'license_name' => NULL,
|
||||
'license_email' => NULL,
|
||||
'status_id' => NULL,
|
||||
);
|
||||
|
||||
$asset[] = array(
|
||||
'name' => 'Broke-Ass Laptop',
|
||||
'asset_tag' => 'NNY67567775',
|
||||
'model_id' => 2,
|
||||
'serial' => 'WS89080890',
|
||||
'purchase_date' => '2012-01-02',
|
||||
'purchase_cost' => '1999.99',
|
||||
'order_number' => '657756',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 2,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'license_name' => NULL,
|
||||
'license_email' => NULL,
|
||||
'status_id' => '3',
|
||||
);
|
||||
|
||||
$asset[] = array(
|
||||
'name' => 'Maybe Broke-Ass Laptop',
|
||||
'asset_tag' => 'NNY6755667775',
|
||||
'model_id' => 2,
|
||||
'serial' => 'WS45689080890',
|
||||
'purchase_date' => '2012-01-02',
|
||||
'purchase_cost' => '1999.99',
|
||||
'order_number' => '657756',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'license_name' => NULL,
|
||||
'license_email' => NULL,
|
||||
'status_id' => '2',
|
||||
);
|
||||
|
||||
|
||||
$asset[] = array(
|
||||
'name' => 'Completely Facacta Laptop',
|
||||
'asset_tag' => 'NNY6564567775',
|
||||
'model_id' => 2,
|
||||
'serial' => 'WS99689080890',
|
||||
'purchase_date' => '2012-01-02',
|
||||
'purchase_cost' => '1999.99',
|
||||
'order_number' => '657756',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 1,
|
||||
'license_name' => NULL,
|
||||
'license_email' => NULL,
|
||||
'status_id' => '4',
|
||||
);
|
||||
|
||||
$asset[] = array(
|
||||
'name' => 'Drunken Shanenigans Laptop',
|
||||
'asset_tag' => 'NNY6564567775',
|
||||
'model_id' => 2,
|
||||
'serial' => 'WS99689080890',
|
||||
'purchase_date' => '2012-01-02',
|
||||
'purchase_cost' => '1999.99',
|
||||
'order_number' => '657756',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 1,
|
||||
'license_name' => NULL,
|
||||
'license_email' => NULL,
|
||||
'status_id' => '5',
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
// Delete all the old data
|
||||
|
||||
@@ -17,6 +17,8 @@ class DatabaseSeeder extends Seeder {
|
||||
$this->call('ManufacturersSeeder');
|
||||
$this->call('ModelsSeeder');
|
||||
$this->call('DepreciationsSeeder');
|
||||
$this->call('StatuslabelsSeeder');
|
||||
$this->call('SettingsSeeder');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
class SettingsSeeder extends Seeder {
|
||||
|
||||
|
||||
public function run()
|
||||
{
|
||||
|
||||
|
||||
// Initialize empty array
|
||||
$setting = array();
|
||||
|
||||
$date = new DateTime;
|
||||
$setting[] = array(
|
||||
'option_name' => 'per_page',
|
||||
'option_label' => 'Results Per Page',
|
||||
'option_value' => '50',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
);
|
||||
|
||||
$setting[] = array(
|
||||
'option_name' => 'site_name',
|
||||
'option_label' => 'Site Name',
|
||||
'option_value' => 'Snipe IT Asset Management System',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
);
|
||||
|
||||
|
||||
// Delete all the old data
|
||||
DB::table('settings')->truncate();
|
||||
|
||||
// Insert the new posts
|
||||
Setting::insert($setting);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
class StatuslabelsSeeder extends Seeder {
|
||||
|
||||
|
||||
public function run()
|
||||
{
|
||||
|
||||
|
||||
// Initialize empty array
|
||||
$status = array();
|
||||
|
||||
$date = new DateTime;
|
||||
|
||||
$status[] = array(
|
||||
'name' => 'Out for Diagnostics',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
);
|
||||
|
||||
|
||||
$status[] = array(
|
||||
'name' => 'Out for Repair',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
);
|
||||
|
||||
|
||||
$status[] = array(
|
||||
'name' => 'Broken - Not Fixable',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
);
|
||||
|
||||
$status[] = array(
|
||||
'name' => 'Lost/Stolen',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
);
|
||||
|
||||
|
||||
|
||||
// Delete all the old data
|
||||
DB::table('status_labels')->truncate();
|
||||
|
||||
// Insert the new posts
|
||||
Statuslabel::insert($status);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
return array(
|
||||
|
||||
'does_not_exist' => 'Asset does not exist.',
|
||||
'assoc_users' => 'This asset is currently checked out to a user and cannot be deleted. Please check the asset in first, and then try deleting again. ',
|
||||
|
||||
'create' => array(
|
||||
'error' => 'Asset was not created, please try again. :(',
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
return array(
|
||||
|
||||
'does_not_exist' => 'Category does not exist.',
|
||||
'assoc_users' => 'This category is currently associated with at least one model and cannot be deleted. Please update your models to no longer reference this category and try again. ',
|
||||
|
||||
'create' => array(
|
||||
'error' => 'Category was not created, please try again.',
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
return array(
|
||||
|
||||
'does_not_exist' => 'Depreciation class does not exist.',
|
||||
'assoc_users' => 'This depreciation is currently associated with one or more models and cannot be deleted. Please delete the models, and then try deleting again. ',
|
||||
|
||||
|
||||
'create' => array(
|
||||
'error' => 'Depreciation class was not created, please try again. :(',
|
||||
|
||||
@@ -4,6 +4,8 @@ return array(
|
||||
|
||||
'does_not_exist' => 'License does not exist.',
|
||||
'user_does_not_exist' => 'User does not exist.',
|
||||
'assoc_users' => 'This license is currently checked out to a user and cannot be deleted. Please check the license in first, and then try deleting again. ',
|
||||
|
||||
|
||||
'create' => array(
|
||||
'error' => 'License was not created, please try again.',
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
return array(
|
||||
|
||||
'does_not_exist' => 'Location does not exist.',
|
||||
'assoc_users' => 'This location is currently associated with at least one user and cannot be deleted. Please update your users to no longer reference this location and try again. ',
|
||||
|
||||
|
||||
'create' => array(
|
||||
'error' => 'Location was not created, please try again.',
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
return array(
|
||||
|
||||
'does_not_exist' => 'Manufacturer does not exist.',
|
||||
'assoc_users' => 'This manufacturer is currently associated with at least one model and cannot be deleted. Please update your models to no longer reference this manufacturer and try again. ',
|
||||
|
||||
'create' => array(
|
||||
'error' => 'Manufacturer was not created, please try again.',
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
return array(
|
||||
|
||||
'does_not_exist' => 'Model does not exist.',
|
||||
'assoc_users' => 'This model is currently associated with one or more assets and cannot be deleted. Please delete the assets, and then try deleting again. ',
|
||||
|
||||
|
||||
'create' => array(
|
||||
'error' => 'Model was not created, please try again.',
|
||||
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'does_not_exist' => 'Location does not exist.',
|
||||
'assoc_users' => 'This location is currently associated with at least one user and cannot be deleted. Please update your users to no longer reference this location and try again. ',
|
||||
|
||||
|
||||
'create' => array(
|
||||
'error' => 'Location was not created, please try again.',
|
||||
'success' => 'Location created successfully.'
|
||||
),
|
||||
|
||||
'update' => array(
|
||||
'error' => 'Location was not updated, please try again',
|
||||
'success' => 'Location updated successfully.'
|
||||
),
|
||||
|
||||
'delete' => array(
|
||||
'error' => 'There was an issue deleting the location. Please try again.',
|
||||
'success' => 'The location was deleted successfully.'
|
||||
)
|
||||
|
||||
);
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'id' => 'ID',
|
||||
'name' => 'Name',
|
||||
'city' => 'City',
|
||||
'state' => 'State',
|
||||
'country' => 'Country',
|
||||
|
||||
);
|
||||
@@ -7,7 +7,7 @@ class ActionLog extends Eloquent {
|
||||
|
||||
|
||||
public function assetlog() {
|
||||
return $this->belongsTo('Asset','asset_id');
|
||||
return $this->belongsTo('Asset','asset_id')->withTrashed();
|
||||
}
|
||||
|
||||
public function adminlog() {
|
||||
|
||||
@@ -71,7 +71,7 @@ class Asset extends Elegant {
|
||||
*/
|
||||
public function adminuser()
|
||||
{
|
||||
return $this->belongsTo('User','id');
|
||||
return $this->belongsTo('User','user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,6 +94,7 @@ class Asset extends Elegant {
|
||||
return DB::table('assets')
|
||||
->where('physical', '=', '1')
|
||||
->where('assigned_to', '=', '0')
|
||||
->whereNull('status_id','and')
|
||||
->whereNull('deleted_at','and')
|
||||
->count();
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
class Category extends Elegant {
|
||||
|
||||
protected $softDelete = true;
|
||||
|
||||
/**
|
||||
* Category validation rules
|
||||
*/
|
||||
@@ -19,6 +21,10 @@ class Category extends Elegant {
|
||||
return $this->belongsTo('Category','parent');
|
||||
}
|
||||
|
||||
public function has_models()
|
||||
{
|
||||
return $this->hasMany('Model', 'category_id')->count();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,5 +8,9 @@ class Depreciation extends Elegant {
|
||||
'months' => 'required|min:1|integer',
|
||||
);
|
||||
|
||||
public function has_models()
|
||||
{
|
||||
return $this->hasMany('Model', 'depreciation_id')->count();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class License extends Elegant {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get action logs for this asset
|
||||
* Get asset logs for this asset
|
||||
*/
|
||||
public function assetlog()
|
||||
{
|
||||
@@ -38,7 +38,7 @@ class License extends Elegant {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get action logs for this asset
|
||||
* Get admin user for this asset
|
||||
*/
|
||||
public function adminuser()
|
||||
{
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
class Location extends Elegant {
|
||||
|
||||
|
||||
protected $softDelete = true;
|
||||
protected $table = 'locations';
|
||||
protected $rules = array(
|
||||
'name' => 'required|min:3',
|
||||
@@ -10,4 +12,9 @@ class Location extends Elegant {
|
||||
'country' => 'required|alpha|min:2|max:2',
|
||||
);
|
||||
|
||||
public function has_users()
|
||||
{
|
||||
return $this->hasMany('User', 'location_id')->count();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
<?php
|
||||
class Manufacturer extends Elegant {
|
||||
|
||||
protected $softDelete = true;
|
||||
// Declare the rules for the form validation
|
||||
protected $rules = array(
|
||||
'name' => 'required|min:2',
|
||||
);
|
||||
|
||||
public function has_models()
|
||||
{
|
||||
return $this->hasMany('Model', 'manufacturer_id')->count();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
class Setting extends Elegant {
|
||||
|
||||
protected $table = 'settings';
|
||||
protected $rules = array(
|
||||
"option_value['site_name']" => 'required|min:3',
|
||||
"option_value['per_page']" => 'required|min:1|numeric',
|
||||
);
|
||||
|
||||
public function getsettings()
|
||||
{
|
||||
$foo = Setting::all();
|
||||
print_r($foo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
class Statuslabel extends Elegant {
|
||||
protected $table = 'status_labels';
|
||||
protected $softDelete = true;
|
||||
|
||||
protected $rules = array(
|
||||
'name' => 'required|min:2',
|
||||
);
|
||||
|
||||
public function has_assets()
|
||||
{
|
||||
return $this->hasMany('Asset', 'status_id')->count();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -54,6 +54,7 @@ Route::group(array('prefix' => 'assets'), function()
|
||||
Route::group(array('prefix' => 'admin'), function()
|
||||
{
|
||||
|
||||
|
||||
# Licenses
|
||||
Route::group(array('prefix' => 'licenses'), function()
|
||||
{
|
||||
@@ -77,6 +78,15 @@ Route::group(array('prefix' => 'admin'), function()
|
||||
# Admin Settings Routes (for categories, maufactureres, etc)
|
||||
Route::group(array('prefix' => 'settings'), function()
|
||||
{
|
||||
|
||||
# Settings
|
||||
Route::group(array('prefix' => 'app'), function()
|
||||
{
|
||||
Route::get('/', array('as' => 'app', 'uses' => 'Controllers\Admin\SettingsController@getIndex'));
|
||||
Route::get('edit', array('as' => 'edit/settings', 'uses' => 'Controllers\Admin\SettingsController@getEdit'));
|
||||
Route::post('edit', 'Controllers\Admin\SettingsController@postEdit');
|
||||
});
|
||||
|
||||
# Manufacturers
|
||||
Route::group(array('prefix' => 'manufacturers'), function()
|
||||
{
|
||||
@@ -121,6 +131,18 @@ Route::group(array('prefix' => 'admin'), function()
|
||||
Route::get('{locationId}/delete', array('as' => 'delete/location', 'uses' => 'Controllers\Admin\LocationsController@getDelete'));
|
||||
});
|
||||
|
||||
# Status Labels
|
||||
Route::group(array('prefix' => 'statuslabels'), function()
|
||||
{
|
||||
Route::get('/', array('as' => 'statuslabels', 'uses' => 'Controllers\Admin\StatuslabelsController@getIndex'));
|
||||
Route::get('create', array('as' => 'create/statuslabel', 'uses' => 'Controllers\Admin\StatuslabelsController@getCreate'));
|
||||
Route::post('create', 'Controllers\Admin\StatuslabelsController@postCreate');
|
||||
Route::get('{statuslabelId}/edit', array('as' => 'update/statuslabel', 'uses' => 'Controllers\Admin\StatuslabelsController@getEdit'));
|
||||
Route::post('{statuslabelId}/edit', 'Controllers\Admin\StatuslabelsController@postEdit');
|
||||
Route::get('{statuslabelId}/delete', array('as' => 'delete/statuslabel', 'uses' => 'Controllers\Admin\StatuslabelsController@getDelete'));
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -105,8 +105,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- Depreciation -->
|
||||
<div class="control-group {{ $errors->has('depreciation_id') ? 'error' : '' }}">
|
||||
<label class="control-label" for="parent">Depreciation</label>
|
||||
@@ -118,6 +116,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Depreciation -->
|
||||
<div class="control-group {{ $errors->has('status_id') ? 'error' : '' }}">
|
||||
<label class="control-label" for="parent">Status</label>
|
||||
<div class="controls">
|
||||
<div class="field-box">
|
||||
{{ Form::select('status_id', $statuslabel_list , Input::old('status_id', $asset->status_id), array('class'=>'select2', 'style'=>'width:250px')) }}
|
||||
{{ $errors->first('depreciation_id', '<span class="help-inline">:message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Notes -->
|
||||
<div class="control-group {{ $errors->has('notes') ? 'error' : '' }}">
|
||||
<label class="control-label" for="notes">Notes</label>
|
||||
@@ -136,7 +146,7 @@
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<a class="btn btn-link" href="{{ route('assets') }}">Cancel</a>
|
||||
<button type="submit" class="btn-flat success"><i class="icon-ok icon-white"></i> Save </button>
|
||||
<button type="submit" class="btn-flat success"><i class="icon-ok icon-white"></i> Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -42,15 +42,15 @@ Assets ::
|
||||
<td><a href="{{ route('view/asset', $asset->id) }}">{{ $asset->name }}</a></td>
|
||||
<td>{{ $asset->serial }}</td>
|
||||
<td>
|
||||
@if ($asset->assigned_to != 0)
|
||||
@if ($asset->assigneduser)
|
||||
<a href="{{ route('view/user', $asset->assigned_to) }}">
|
||||
{{ $asset->assigneduser->fullName() }}
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if (($asset->assigned_to > 0) && ($asset->assigneduser->location_id > 0))
|
||||
{{ Location::find($asset->assigneduser->location_id)->name }}
|
||||
@if ($asset->assigneduser && $asset->assetloc)
|
||||
{{ $asset->assetloc->name }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@@ -12,7 +12,6 @@ View Asset {{ $asset->asset_tag }} ::
|
||||
<!-- header -->
|
||||
<h3 class="name">History for {{ $asset->asset_tag }} ({{ $asset->name }})
|
||||
|
||||
|
||||
<div class="btn-group pull-right">
|
||||
<button class="btn glow">Actions</button>
|
||||
<button class="btn glow dropdown-toggle" data-toggle="dropdown">
|
||||
@@ -26,22 +25,11 @@ View Asset {{ $asset->asset_tag }} ::
|
||||
<li><a href="{{ route('checkout/asset', $asset->id) }}" class="btn-flat success">Checkout</a></li>
|
||||
@endif
|
||||
<li><a href="{{ route('update/asset', $asset->id) }}">Edit Asset</a></li>
|
||||
<li><a href="#">Out for Disagnostics</a></li>
|
||||
<li><a href="#">Out for Repair</a></li>
|
||||
<li><a href="#">Mark as Lost/Stolen</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row-fluid profile">
|
||||
<!-- bio, new note & orders column -->
|
||||
<div class="span9 bio">
|
||||
@@ -90,7 +78,7 @@ View Asset {{ $asset->asset_tag }} ::
|
||||
<td></td>
|
||||
<td>{{ $asset->created_at }}</td>
|
||||
<td>
|
||||
@if (isset($asset->adminuser->id))
|
||||
@if ($asset->adminuser->id)
|
||||
{{ $asset->adminuser->fullName() }}
|
||||
@else
|
||||
Unknown Admin
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
<ul class="dropdown-menu">
|
||||
@if(Sentry::getUser()->hasAccess('admin'))
|
||||
<li>
|
||||
<a href="{{ route('admin') }}">
|
||||
<a href="{{ route('app') }}">
|
||||
<i class="icon-cog"></i> Settings
|
||||
</a>
|
||||
</li>
|
||||
@@ -120,7 +120,12 @@
|
||||
<a href="{{ URL::to('admin/groups') }}">
|
||||
<i class="icon-group"></i> Groups
|
||||
</a>
|
||||
</li>
|
||||
</li>
|
||||
<li{{ (Request::is('admin/settings/statuslabels*') ? ' class="active"' : '') }}>
|
||||
<a href="{{ URL::to('admin/settings/statuslabels') }}">
|
||||
<i class="icon-list"></i> Status Labels
|
||||
</a>
|
||||
</li>
|
||||
<li{{ (Request::is('admin/settings/manufacturers*') ? ' class="active"' : '') }}>
|
||||
<a href="{{ URL::to('admin/settings/manufacturers') }}">
|
||||
<i class="icon-briefcase"></i> Manufacturers
|
||||
@@ -305,6 +310,10 @@
|
||||
// jQuery Knobs
|
||||
$(".knob").knob();
|
||||
|
||||
|
||||
$("#example").popover();
|
||||
|
||||
|
||||
// confirm delete modal
|
||||
$('.delete-asset').click(function(evnt) {
|
||||
var href = $(this).attr('href');
|
||||
@@ -327,6 +336,9 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -26,8 +26,6 @@ View License {{ $license->name }} ::
|
||||
<li><a href="{{ route('checkout/license', $license->id) }}" class="btn-flat success">Checkout</a></li>
|
||||
@endif
|
||||
<li><a href="{{ route('update/license', $license->id) }}">Edit License</a></li>
|
||||
<li><a href="#">Mark as Lost/Stolen</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
Asset Depreciations ::
|
||||
Locations ::
|
||||
@parent
|
||||
@stop
|
||||
|
||||
|
||||
Executable
+63
@@ -0,0 +1,63 @@
|
||||
@extends('backend/layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
Update Settings ::
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div id="pad-wrapper" class="user-profile">
|
||||
<!-- header -->
|
||||
<h3 class="name">Update Settings
|
||||
<div class="pull-right">
|
||||
<a href="{{ route('app') }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
|
||||
</div>
|
||||
|
||||
</h3>
|
||||
|
||||
|
||||
<div class="row-fluid profile">
|
||||
<!-- bio, new note & orders column -->
|
||||
<div class="span9 bio">
|
||||
<div class="profile-box">
|
||||
<br>
|
||||
<!-- checked out assets table -->
|
||||
|
||||
<form class="form-horizontal" method="post" action="" autocomplete="off">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
@foreach ($settings as $setting)
|
||||
<div class="control-group {{ $errors->has('name') ? 'error' : '' }}">
|
||||
<label class="control-label" for="option_value">{{ $setting->option_label }}</label>
|
||||
<div class="controls">
|
||||
<input class="span9" type="text" name="option_value['{{ $setting->option_name }}']" id="option_value" value="{{ Input::old('option_value', $setting->option_value) }}" />
|
||||
{{ $errors->first('option_value', '<span class="help-inline">:message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@endforeach
|
||||
|
||||
<!-- Form actions -->
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<a class="btn btn-link" href="{{ route('app') }}">@lang('general.cancel')</a>
|
||||
<button type="submit" class="btn-flat success"><i class="icon-ok icon-white"></i> @lang('general.save')</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- side address column -->
|
||||
<div class="span3 address pull-right">
|
||||
<br /><br />
|
||||
<p>These settings let you customize certain aspects of your installation. </p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
||||
Executable
+55
@@ -0,0 +1,55 @@
|
||||
@extends('backend/layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
Settings ::
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div id="pad-wrapper" class="user-profile">
|
||||
<!-- header -->
|
||||
<h3 class="name">Settings
|
||||
<div class="pull-right">
|
||||
<!-- <a href="{{ route('edit/settings') }}" class="btn-flat white"> @lang('button.edit') Settings</a> -->
|
||||
</div>
|
||||
</h3>
|
||||
|
||||
|
||||
<div class="row-fluid profile">
|
||||
<!-- bio, new note & orders column -->
|
||||
<div class="span9 bio">
|
||||
<div class="profile-box">
|
||||
<br>
|
||||
<!-- checked out assets table -->
|
||||
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span4">Setting</th>
|
||||
<th class="span2"><span class="line"></span>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($settings as $setting)
|
||||
<tr>
|
||||
<td>{{ $setting->option_label }}</td>
|
||||
<td>{{ $setting->option_value }} </td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- side address column -->
|
||||
<div class="span3 address pull-right">
|
||||
<br /><br />
|
||||
|
||||
<p>These settings let you customize certain aspects of your installation. </p>
|
||||
|
||||
</div>
|
||||
@stop
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
@extends('backend/layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
@if ($statuslabel->id)
|
||||
Update Status Label ::
|
||||
@else
|
||||
Create New Status Label ::
|
||||
@endif
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div id="pad-wrapper" class="user-profile">
|
||||
<!-- header -->
|
||||
<h3 class="name">
|
||||
@if ($statuslabel->id)
|
||||
Update Status Label
|
||||
@else
|
||||
Create New Status Label
|
||||
@endif
|
||||
|
||||
<div class="pull-right">
|
||||
<a href="{{ route('statuslabels') }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
|
||||
</div>
|
||||
|
||||
</h3>
|
||||
|
||||
|
||||
<div class="row-fluid profile">
|
||||
<!-- bio, new note & orders column -->
|
||||
<div class="span9 bio">
|
||||
<div class="profile-box">
|
||||
<br>
|
||||
<!-- checked out assets table -->
|
||||
|
||||
<form class="form-horizontal" method="post" action="" autocomplete="off">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
<div class="control-group {{ $errors->has('name') ? 'error' : '' }}">
|
||||
<label class="control-label" for="name">Status Label</label>
|
||||
<div class="controls">
|
||||
<input class="span9" type="text" name="name" id="name" value="{{ Input::old('name', $statuslabel->name) }}" />
|
||||
{{ $errors->first('name', '<span class="help-inline">:message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Form actions -->
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<a class="btn btn-link" href="{{ route('statuslabels') }}">@lang('general.cancel')</a>
|
||||
<button type="submit" class="btn-flat success"><i class="icon-ok icon-white"></i> @lang('general.save')</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- side address column -->
|
||||
<div class="span3 address pull-right">
|
||||
<br /><br />
|
||||
<h6>About Status Labels</h6>
|
||||
<p>Status labels are used to describe the various reasons why an asset <strong><em>cannot</em></strong> be deployed. </p>
|
||||
|
||||
<p>It could be broken, out for diagnostics, out for
|
||||
repair, lost or stolen, etc. Status labels allow your team to show the progression.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
@extends('backend/layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
Status Labels
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div id="pad-wrapper" class="user-profile">
|
||||
<!-- header -->
|
||||
<h3 class="name">Status Labels
|
||||
<div class="pull-right">
|
||||
<a href="{{ route('create/statuslabel') }}" class="btn-flat success"><i class="icon-plus-sign icon-white"></i> Create New</a>
|
||||
</div>
|
||||
</h3>
|
||||
|
||||
|
||||
<div class="row-fluid profile">
|
||||
<!-- bio, new note & orders column -->
|
||||
<div class="span9 bio">
|
||||
<div class="profile-box">
|
||||
<br>
|
||||
<!-- checked out assets table -->
|
||||
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span4">@lang('admin/statuslabels/table.name')</th>
|
||||
<th class="span2"><span class="line"></span>@lang('table.actions')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($statuslabels as $statuslabel)
|
||||
<tr>
|
||||
<td>{{ $statuslabel->name }}</td>
|
||||
<td>
|
||||
<a href="{{ route('update/statuslabel', $statuslabel->id) }}" class="btn-flat white"> @lang('button.edit')</a>
|
||||
<a class="btn-flat danger delete-asset" data-toggle="modal" href="{{ route('delete/statuslabel', $statuslabel->id) }}" data-content="Are you sure you wish to delete the {{ $statuslabel->name }} status label?" data-title="Delete {{ $statuslabel->name }}?" onClick="return false;">@lang('button.delete')</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- side address column -->
|
||||
<div class="span3 address pull-right">
|
||||
<br><br>
|
||||
<h6>About Status Labels</h6>
|
||||
<p>Status labels are used to describe the various reasons why an asset <strong><em>cannot</em></strong> be deployed. </p>
|
||||
|
||||
<p>It could be broken, out for diagnostics, out for
|
||||
repair, lost or stolen, etc. Status labels allow your team to show the progression.</p>
|
||||
|
||||
</div>
|
||||
@stop
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -90,10 +90,12 @@ View User {{ $user->fullName() }} ::
|
||||
<td>{{ $log->added_on }}</td>
|
||||
<td>{{ $log->action_type }}</td>
|
||||
<td>
|
||||
@if (isset($log->assetlog->name))
|
||||
<a href="{{ route('view/asset', $log->asset_id) }}">{{ $log->assetlog->name }}</a>
|
||||
@if ((isset($log->assetlog->name)) && ($log->assetlog->deleted_at==''))
|
||||
<a href="{{ route('view/asset', $log->asset_id) }}">{{ $log->assetlog->name }}</a>
|
||||
@elseif ((isset($log->assetlog->name)) && ($log->assetlog->deleted_at!=''))
|
||||
<del>{{ $log->assetlog->name }}</del> (deleted)
|
||||
@else
|
||||
missing asset
|
||||
missing asset ({{ $log->assetlog->name }}) ({{ $log->assetlog->deleted_at }})
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $log->adminlog->fullName() }}</td>
|
||||
@@ -126,7 +128,7 @@ View User {{ $user->fullName() }} ::
|
||||
<ul>
|
||||
<li>{{ $user->userloc->address }} {{ $user->userloc->address2 }}</li>
|
||||
<li>{{ $user->userloc->city }}, {{ $user->userloc->state }} {{ $user->userloc->zip }}<br /><br /></li>
|
||||
@if (isset($user->phone))
|
||||
@if ($user->phone)
|
||||
<li><i class="icon-phone"></i>{{ $user->phone }}</li>
|
||||
@endif
|
||||
<li><i class="icon-envelope-alt"></i><a href="mailto:{{ $user->email }}">{{ $user->email }}</a></li>
|
||||
|
||||
@@ -44,6 +44,11 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#helpicon a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
.section {
|
||||
border-top: 1px solid #edeff1;
|
||||
margin-top: 100px;
|
||||
|
||||
@@ -8,6 +8,10 @@ body {
|
||||
/*-webkit-font-smoothing: antialiased;*/
|
||||
}
|
||||
|
||||
div.popover-content {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5 {
|
||||
margin: 0;
|
||||
line-height: inherit;
|
||||
|
||||
Reference in New Issue
Block a user