Merge remote-tracking branch 'origin/develop'
Conflicts: app/views/backend/layouts/default.blade.php
@@ -46,6 +46,8 @@ class AssetsController extends AdminController
|
||||
$assets->RTD();
|
||||
} elseif (Input::get('Undeployable')) {
|
||||
$assets->Undeployable();
|
||||
} elseif (Input::get('Archived')) {
|
||||
$assets->Archived();
|
||||
} elseif (Input::get('Deployed')) {
|
||||
$assets->Deployed();
|
||||
}
|
||||
@@ -93,7 +95,7 @@ class AssetsController extends AdminController
|
||||
|
||||
|
||||
// Grab the dropdown list of status
|
||||
$statuslabel_list = array('' => Lang::get('general.pending')) + array('0' => Lang::get('general.ready_to_deploy')) + Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
|
||||
$statuslabel_list = Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
|
||||
|
||||
$view = View::make('backend/hardware/edit');
|
||||
$view->with('supplier_list',$supplier_list);
|
||||
@@ -238,7 +240,7 @@ class AssetsController extends AdminController
|
||||
$location_list = array('' => '') + Location::orderBy('name', 'asc')->lists('name', 'id');
|
||||
|
||||
// Grab the dropdown list of status
|
||||
$statuslabel_list = array('' => Lang::get('general.pending')) + array('0' => Lang::get('general.ready_to_deploy')) + Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
|
||||
$statuslabel_list = Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
|
||||
|
||||
return View::make('backend/hardware/edit', compact('asset'))->with('model_list',$model_list)->with('supplier_list',$supplier_list)->with('location_list',$location_list)->with('statuslabel_list',$statuslabel_list);
|
||||
}
|
||||
@@ -589,7 +591,7 @@ class AssetsController extends AdminController
|
||||
$model_list = array('' => '') + Model::lists('name', 'id');
|
||||
|
||||
// Grab the dropdown list of status
|
||||
$statuslabel_list = array('' => 'Pending') + array('0' => 'Ready to Deploy') + Statuslabel::lists('name', 'id');
|
||||
$statuslabel_list = Statuslabel::lists('name', 'id');
|
||||
|
||||
$location_list = array('' => '') + Location::lists('name', 'id');
|
||||
|
||||
|
||||
@@ -38,7 +38,12 @@ class StatuslabelsController extends AdminController
|
||||
public function getCreate()
|
||||
{
|
||||
// Show the page
|
||||
return View::make('backend/statuslabels/edit')->with('statuslabel',new Statuslabel);
|
||||
$statuslabel = new Statuslabel;
|
||||
$use_statuslabel_type = $statuslabel->getStatuslabelType();
|
||||
|
||||
$statuslabel_types = array('' => Lang::get('admin/hardware/form.select_statustype')) + array('undeployable' => Lang::get('admin/hardware/general.undeployable')) + array('pending' => Lang::get('admin/hardware/general.pending')) + array('archived' => Lang::get('admin/hardware/general.archived')) + array('deployable' => Lang::get('admin/hardware/general.deployable'));
|
||||
|
||||
return View::make('backend/statuslabels/edit', compact('statuslabel_types','statuslabel'))->with('use_statuslabel_type',$use_statuslabel_type);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,9 +64,15 @@ class StatuslabelsController extends AdminController
|
||||
// attempt validation
|
||||
if ($statuslabel->validate($new)) {
|
||||
|
||||
$statustype = Statuslabel::getStatuslabelTypesForDB(Input::get('statuslabel_types'));
|
||||
|
||||
// Save the Statuslabel data
|
||||
$statuslabel->name = e(Input::get('name'));
|
||||
$statuslabel->user_id = Sentry::getId();
|
||||
$statuslabel->notes = e(Input::get('notes'));
|
||||
$statuslabel->deployable = $statustype['deployable'];
|
||||
$statuslabel->pending = $statustype['pending'];
|
||||
$statuslabel->archived = $statustype['archived'];
|
||||
|
||||
// Was the asset created?
|
||||
if($statuslabel->save()) {
|
||||
@@ -94,8 +105,11 @@ class StatuslabelsController extends AdminController
|
||||
return Redirect::to('admin/settings/statuslabels')->with('error', Lang::get('admin/statuslabels/message.does_not_exist'));
|
||||
}
|
||||
|
||||
$use_statuslabel_type = $statuslabel->getStatuslabelType();
|
||||
|
||||
return View::make('backend/statuslabels/edit', compact('statuslabel'));
|
||||
$statuslabel_types = array('' => Lang::get('admin/hardware/form.select_statustype')) + array('undeployable' => Lang::get('admin/hardware/general.undeployable')) + array('pending' => Lang::get('admin/hardware/general.pending')) + array('archived' => Lang::get('admin/hardware/general.archived')) + array('deployable' => Lang::get('admin/hardware/general.deployable'));
|
||||
|
||||
return View::make('backend/statuslabels/edit', compact('statuslabel','statuslabel_types'))->with('use_statuslabel_type',$use_statuslabel_type);
|
||||
}
|
||||
|
||||
|
||||
@@ -118,20 +132,27 @@ class StatuslabelsController extends AdminController
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
// The given data did not pass validation
|
||||
// The given data did not pass validation
|
||||
return Redirect::back()->withInput()->withErrors($validator->messages());
|
||||
}
|
||||
// attempt validation
|
||||
else {
|
||||
// Update the Statuslabel data
|
||||
$statustype = Statuslabel::getStatuslabelTypesForDB(Input::get('statuslabel_types'));
|
||||
|
||||
$statuslabel->name = e(Input::get('name'));
|
||||
$statuslabel->notes = e(Input::get('notes'));
|
||||
$statuslabel->deployable = $statustype['deployable'];
|
||||
$statuslabel->pending = $statustype['pending'];
|
||||
$statuslabel->archived = $statustype['archived'];
|
||||
|
||||
|
||||
// Was the asset created?
|
||||
if($statuslabel->save()) {
|
||||
// Redirect to the saved Statuslabel page
|
||||
return Redirect::to("admin/settings/statuslabels/")->with('success', Lang::get('admin/statuslabels/message.update.success'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the Statuslabel management page
|
||||
return Redirect::to("admin/settings/statuslabels/$statuslabelId/edit")->with('error', Lang::get('admin/statuslabels/message.update.error'));
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class FixBadAssignedToIds extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
DB::update('update ' . DB::getTablePrefix() . 'assets SET assigned_to=NULL where assigned_to=0');
|
||||
|
||||
Schema::table('status_labels', function ($table) {
|
||||
$table->boolean('deployable')->default(0);
|
||||
$table->boolean('pending')->default(0);
|
||||
$table->boolean('archived')->default(0);
|
||||
$table->text('notes')->nullable();
|
||||
});
|
||||
|
||||
DB::statement('INSERT into ' . DB::getTablePrefix() . 'status_labels (user_id, name, deployable, pending, archived, notes) VALUES (1,"Pending",0,1,0,"These assets are not yet ready to be deployed, usually because of configuration or waiting on parts.")');
|
||||
DB::statement('INSERT into ' . DB::getTablePrefix() . 'status_labels (user_id, name, deployable, pending, archived, notes) VALUES (1,"Ready to Deploy",1,0,0,"These assets are ready to deploy.")');
|
||||
DB::statement('INSERT into ' . DB::getTablePrefix() . 'status_labels (user_id, name, deployable, pending, archived, notes) VALUES (1,"Archived",0,0,1,"These assets are no longer in circulation or viable.")');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::table('status_labels', function ($table) {
|
||||
$table->dropColumn('deployable');
|
||||
$table->dropColumn('pending');
|
||||
$table->dropColumn('archived');
|
||||
$table->dropColumn('notes');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class MigrateDataToNewStatuses extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
// get newly added statuses from last migration
|
||||
$statuses = DB::select('select * from ' . DB::getTablePrefix() . 'status_labels where name="Pending" OR name="Ready to Deploy"');
|
||||
|
||||
|
||||
foreach ($statuses as $status) {
|
||||
if ($status->name =="Pending") {
|
||||
$pending_id = array($status->id);
|
||||
} elseif ($status->name =="Ready to Deploy") {
|
||||
$rtd_id = array($status->id);
|
||||
}
|
||||
}
|
||||
|
||||
// Pending
|
||||
$pendings = DB::select('select * from ' . DB::getTablePrefix() . 'assets where status_id IS NULL AND physical=1 ');
|
||||
|
||||
foreach ($pendings as $pending) {
|
||||
DB::update('update ' . DB::getTablePrefix() . 'assets set status_id = ? where status_id IS NULL AND physical=1',$pending_id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Ready to Deploy
|
||||
$rtds = DB::select('select * from ' . DB::getTablePrefix() . 'assets where status_id = 0 AND physical=1 ');
|
||||
|
||||
foreach ($rtds as $rtd) {
|
||||
//DB::update('update users set votes = 100 where name = ?', array('John'));
|
||||
DB::update('update ' . DB::getTablePrefix() . 'assets set status_id = ? where status_id = 0 AND physical=1',$rtd_id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,10 +22,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => NULL,
|
||||
'status_id' => 1,
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -45,10 +45,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => NULL,
|
||||
'status_id' => 1,
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -69,10 +69,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => 0,
|
||||
'status_id' => 2,
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -92,10 +92,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => 0,
|
||||
'status_id' => 1,
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -115,10 +115,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 2,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => 0,
|
||||
'status_id' => 2,
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -142,7 +142,7 @@ class AssetsSeeder extends Seeder
|
||||
'assigned_to' => 2,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => 0,
|
||||
'status_id' => 1,
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -165,7 +165,7 @@ class AssetsSeeder extends Seeder
|
||||
'assigned_to' => 2,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => 0,
|
||||
'status_id' => 1,
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
@@ -185,7 +185,7 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 2,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => '3',
|
||||
@@ -208,7 +208,7 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => '2',
|
||||
@@ -231,7 +231,7 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 1,
|
||||
'status_id' => '4',
|
||||
@@ -254,7 +254,7 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 1,
|
||||
'status_id' => '3',
|
||||
@@ -277,10 +277,10 @@ class AssetsSeeder extends Seeder
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 2,
|
||||
'assigned_to' => 0,
|
||||
'assigned_to' => NULL,
|
||||
'physical' => 1,
|
||||
'archived' => 0,
|
||||
'status_id' => 0,
|
||||
'status_id' => 1,
|
||||
'notes' => '',
|
||||
'deleted_at' => NULL,
|
||||
'archived' => '0',
|
||||
|
||||
@@ -10,12 +10,53 @@ class StatuslabelsSeeder extends Seeder
|
||||
|
||||
$date = new DateTime;
|
||||
|
||||
$status[] = array(
|
||||
'name' => 'Ready to Deploy',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'deleted_at' => NULL,
|
||||
'deployable' => 1,
|
||||
'pending' => 0,
|
||||
'archived' => 0,
|
||||
'notes' => ''
|
||||
);
|
||||
|
||||
$status[] = array(
|
||||
'name' => 'Pending',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'deleted_at' => NULL,
|
||||
'deployable' => 0,
|
||||
'pending' => 1,
|
||||
'archived' => 0,
|
||||
'notes' => ''
|
||||
);
|
||||
|
||||
$status[] = array(
|
||||
'name' => 'Archived',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'deleted_at' => NULL,
|
||||
'deployable' => 0,
|
||||
'pending' => 0,
|
||||
'archived' => 1,
|
||||
'notes' => 'These assets are permanently undeployable'
|
||||
);
|
||||
|
||||
|
||||
$status[] = array(
|
||||
'name' => 'Out for Diagnostics',
|
||||
'created_at' => $date->modify('-10 day'),
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'deleted_at' => NULL,
|
||||
'deployable' => 0,
|
||||
'pending' => 0,
|
||||
'archived' => 0,
|
||||
'notes' => ''
|
||||
);
|
||||
|
||||
|
||||
@@ -25,6 +66,10 @@ class StatuslabelsSeeder extends Seeder
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'deleted_at' => NULL,
|
||||
'deployable' => 0,
|
||||
'pending' => 0,
|
||||
'archived' => 0,
|
||||
'notes' => ''
|
||||
);
|
||||
|
||||
|
||||
@@ -34,6 +79,10 @@ class StatuslabelsSeeder extends Seeder
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'deleted_at' => NULL,
|
||||
'deployable' => 0,
|
||||
'pending' => 0,
|
||||
'archived' => 1,
|
||||
'notes' => ''
|
||||
);
|
||||
|
||||
$status[] = array(
|
||||
@@ -42,6 +91,10 @@ class StatuslabelsSeeder extends Seeder
|
||||
'updated_at' => $date->modify('-3 day'),
|
||||
'user_id' => 1,
|
||||
'deleted_at' => NULL,
|
||||
'deployable' => 0,
|
||||
'pending' => 0,
|
||||
'archived' => 1,
|
||||
'notes' => '',
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ return array(
|
||||
'order' => 'Order Number',
|
||||
'qr' => 'QR Code',
|
||||
'requestable' => 'Users may request this asset',
|
||||
'select_statustype' => 'Select Status Type',
|
||||
'serial' => 'Serial',
|
||||
'status' => 'Status',
|
||||
'supplier' => 'Supplier',
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'archived' => 'Archived',
|
||||
'asset' => 'Asset',
|
||||
'checkin' => 'Checkin Asset',
|
||||
'checkout' => 'Checkout Asset to User',
|
||||
'clone' => 'Clone Asset',
|
||||
'deployable' => 'Deployable',
|
||||
'edit' => 'Edit Asset',
|
||||
'pending' => 'Pending Asset',
|
||||
'pending' => 'Pending',
|
||||
'undeployable' => 'Undeployable',
|
||||
'view' => 'View Asset',
|
||||
);
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
|
||||
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. ',
|
||||
'does_not_exist' => 'Status label does not exist.',
|
||||
'assoc_users' => 'This status label 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.'
|
||||
'error' => 'Status label was not created, please try again.',
|
||||
'success' => 'Status label created successfully.'
|
||||
),
|
||||
|
||||
'update' => array(
|
||||
'error' => 'Location was not updated, please try again',
|
||||
'success' => 'Location updated successfully.'
|
||||
'error' => 'Status label was not updated, please try again',
|
||||
'success' => 'Status label updated successfully.'
|
||||
),
|
||||
|
||||
'delete' => array(
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'name' => 'Status Name',
|
||||
'title' => 'Status Labels',
|
||||
'update' => 'Update Status Label',
|
||||
'create' => 'Create Status Label',
|
||||
'about' => 'About Status Labels',
|
||||
'info' => 'Status labels are used to describe the various reasons why an asset <strong><em>cannot</em></strong> be deployed. It could be broken, out for diagnostics, out for repair, lost or stolen, etc. Status labels allow your team to show the progression.',
|
||||
'archived' => 'Archived',
|
||||
'create' => 'Create Status Label',
|
||||
'deployable' => 'Deployable',
|
||||
'info' => 'Status labels are used to describe the various states your assets could be in. They may be out for repair, lost/stolen, etc. You can create new status labels for deployable, pending and archived assets.',
|
||||
'name' => 'Status Name',
|
||||
'pending' => 'Pending',
|
||||
'status_type' => 'Status Type',
|
||||
'title' => 'Status Labels',
|
||||
'undeployable' => 'Undeployable',
|
||||
'update' => 'Update Status Label',
|
||||
);
|
||||
|
||||
@@ -7,6 +7,7 @@ return array(
|
||||
'admin' => 'Admin',
|
||||
'all_assets' => 'All Assets',
|
||||
'all' => 'All',
|
||||
'archived' => 'Archived',
|
||||
'asset_models' => 'Asset Models',
|
||||
'asset' => 'Asset',
|
||||
'asset_report' => 'Asset Report',
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'asset' => 'Asset',
|
||||
'checkin' => 'Checkin Asset',
|
||||
'checkout' => 'Checkout Asset to User',
|
||||
'clone' => 'Clone Asset',
|
||||
'edit' => 'Edit Asset',
|
||||
'pending' => 'Pending Asset',
|
||||
'view' => 'View Asset',
|
||||
'asset' => 'Nabytek',
|
||||
'checkin' => 'Potwierdzanie zasobu/aktywa',
|
||||
'checkout' => 'Przypisanie aktywa do Użytkownika',
|
||||
'clone' => 'Klonuj zasób',
|
||||
'edit' => 'Edytuj zasób',
|
||||
'pending' => 'Oczekujący nabytek',
|
||||
'view' => 'Wyświetl nabytki',
|
||||
);
|
||||
|
||||
@@ -15,15 +15,15 @@ return array(
|
||||
),
|
||||
|
||||
'deletefile' => array(
|
||||
'error' => 'File not deleted. Please try again.',
|
||||
'success' => 'File successfully deleted.',
|
||||
'error' => '该文件无法删除,请重试。',
|
||||
'success' => '文件成功删除。',
|
||||
),
|
||||
|
||||
'upload' => array(
|
||||
'error' => 'File(s) not uploaded. Please try again.',
|
||||
'success' => 'File(s) successfully uploaded.',
|
||||
'nofiles' => 'You did not select any files for upload',
|
||||
'invalidfiles' => 'One or more of your files is too large or is a filetype that is not allowed. Allowed filetypes are png, gif, jpg, doc, docx, pdf, and txt.',
|
||||
'error' => '文件上传失败,请重试。',
|
||||
'success' => '文件上传成功。',
|
||||
'nofiles' => '您没有选择要上传的文件',
|
||||
'invalidfiles' => '一个或多个文件过大或者属于不被允许的文件类型。允许上传的文件类型有PNG,GIF,JPG,DOC,DOCX,PDF和TXT。',
|
||||
),
|
||||
|
||||
'update' => array(
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
return array(
|
||||
|
||||
'actions' => '操作',
|
||||
'add' => 'Add New',
|
||||
'cancel' => 'Cancel',
|
||||
'add' => '新增',
|
||||
'cancel' => '取消',
|
||||
'delete' => '刪除',
|
||||
'edit' => '编辑',
|
||||
'restore' => '恢复',
|
||||
'submit' => '提交',
|
||||
'upload' => 'Upload',
|
||||
'upload' => '上传',
|
||||
|
||||
);
|
||||
|
||||
@@ -40,8 +40,8 @@ return array(
|
||||
'editprofile' => '修改简介',
|
||||
'eol' => '寿命',
|
||||
'first_name' => '名字',
|
||||
'file_name' => 'File',
|
||||
'file_uploads' => 'File Uploads',
|
||||
'file_name' => '文件',
|
||||
'file_uploads' => '文件上传',
|
||||
'generate' => '生成',
|
||||
'groups' => '分组',
|
||||
'gravatar_email' => 'Gravatar头像邮件地址',
|
||||
|
||||
@@ -6,7 +6,7 @@ class Actionlog extends Eloquent
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
protected $table = 'asset_logs';
|
||||
public $timestamps = false;
|
||||
public $timestamps = true;
|
||||
|
||||
|
||||
public function assetlog()
|
||||
@@ -26,7 +26,7 @@ class Actionlog extends Eloquent
|
||||
|
||||
public function adminlog()
|
||||
{
|
||||
return $this->belongsTo('User','user_id');
|
||||
return $this->belongsTo('User','user_id')->withTrashed();
|
||||
}
|
||||
|
||||
public function userlog()
|
||||
|
||||
@@ -90,7 +90,8 @@ class Asset extends Elegant
|
||||
*/
|
||||
public static function availassetcount()
|
||||
{
|
||||
return Asset::orderBy('asset_tag', 'ASC')->where('status_id', '=', 0)->where('assigned_to','=','0')->where('physical', '=', 1)->count();
|
||||
return Asset::RTD()->whereNull('deleted_at')->count();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -231,7 +232,10 @@ class Asset extends Elegant
|
||||
|
||||
public function scopePending($query)
|
||||
{
|
||||
return $query->whereNull('status_id','and')->where('assigned_to','=','0');
|
||||
return $query->whereHas('assetstatus',function($query)
|
||||
{
|
||||
$query->where('deployable','=',0)->where('pending','=',1)->where('archived','=',0);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -244,10 +248,15 @@ class Asset extends Elegant
|
||||
|
||||
public function scopeRTD($query)
|
||||
{
|
||||
return $query->where('status_id','=','0')->where('assigned_to','=','0');
|
||||
return $query->whereNULL('assigned_to')->whereHas('assetstatus',function($query)
|
||||
{
|
||||
$query->where('deployable','=',1)->where('pending','=',0)->where('archived','=',0);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Query builder scope for Undeployable assets
|
||||
*
|
||||
@@ -257,10 +266,30 @@ class Asset extends Elegant
|
||||
|
||||
public function scopeUndeployable($query)
|
||||
{
|
||||
return $query->where('status_id','>',1)->where('assigned_to','=','0');
|
||||
return $query->whereHas('assetstatus',function($query)
|
||||
{
|
||||
$query->where('deployable','=',0)->where('pending','=',0)->where('archived','=',0);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Query builder scope for Archived assets
|
||||
*
|
||||
* @param Illuminate\Database\Query\Builder $query Query builder instance
|
||||
* @return Illuminate\Database\Query\Builder Modified query builder
|
||||
*/
|
||||
|
||||
public function scopeArchived($query)
|
||||
{
|
||||
return $query->whereHas('assetstatus',function($query)
|
||||
{
|
||||
$query->where('deployable','=',0)->where('pending','=',0)->where('archived','=',1);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Query builder scope for Deployed assets
|
||||
*
|
||||
|
||||
@@ -9,10 +9,49 @@ class Statuslabel extends Elegant
|
||||
|
||||
protected $rules = array(
|
||||
'name' => 'required|alpha_space|min:2|max:100|unique:status_labels,name,{id}',
|
||||
'statuslabel_types' => 'required|in:deployable,pending,archived,undeployable',
|
||||
);
|
||||
|
||||
public function has_assets()
|
||||
{
|
||||
return $this->hasMany('Asset', 'status_id')->count();
|
||||
}
|
||||
|
||||
public function getStatuslabelType() {
|
||||
|
||||
if ($this->pending == 1) {
|
||||
return 'pending';
|
||||
} elseif ($this->archived == 1) {
|
||||
return 'archived';
|
||||
} elseif (($this->archived == 0) && ($this->deployable == 0) && ($this->deployable == 0)) {
|
||||
return 'undeployable';
|
||||
} else {
|
||||
return 'deployable';
|
||||
}
|
||||
}
|
||||
|
||||
public static function getStatuslabelTypesForDB($type) {
|
||||
if ($type == 'pending') {
|
||||
$statustype['pending'] = 1;
|
||||
$statustype['deployable'] = 0;
|
||||
$statustype['archived'] = 0;
|
||||
|
||||
} elseif ($type == 'deployable') {
|
||||
$statustype['pending'] = 0;
|
||||
$statustype['deployable'] = 1;
|
||||
$statustype['archived'] = 0;
|
||||
|
||||
} elseif ($type == 'archived') {
|
||||
$statustype['pending'] = 0;
|
||||
$statustype['deployable'] = 0;
|
||||
$statustype['archived'] = 1;
|
||||
|
||||
} elseif ($type == 'undeployable') {
|
||||
$statustype['pending'] = 0;
|
||||
$statustype['deployable'] = 0;
|
||||
$statustype['archived'] = 0;
|
||||
}
|
||||
|
||||
return $statustype;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($asset->name)
|
||||
<!-- Asset name -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">@lang('admin/hardware/form.name')</label>
|
||||
@@ -39,11 +40,12 @@
|
||||
<p class="form-control-static">{{{ $asset->name }}}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Note -->
|
||||
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
||||
<label for="note" class="col-md-2 control-label">@lang('admin/hardware/form.notes')</label>
|
||||
<div class="col-md-7">
|
||||
<input class="col-md-6 form-control" type="text" name="note" id="note" value="{{{ Input::old('note', $asset->note) }}}" />
|
||||
<textarea class="col-md-6 form-control" id="note" name="note">{{{ Input::old('note', $asset->note) }}}</textarea>
|
||||
{{ $errors->first('note', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
<div class="col-md-7">
|
||||
@if (isset($selected_model))
|
||||
{{ Form::select('model_id', $model_list , $selected_model->id, array('class'=>'select2', 'style'=>'min-width:400px')) }}
|
||||
|
||||
@else
|
||||
{{ Form::select('model_id', $model_list , Input::old('model_id', $asset->model_id), array('class'=>'select2', 'style'=>'min-width:400px')) }}
|
||||
@endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@extends('backend/layouts/default')
|
||||
|
||||
@section('title0')
|
||||
@if (Input::get('Pending') || Input::get('Undeployable') || Input::get('RTD') || Input::get('Deployed'))
|
||||
@if (Input::get('Pending') || Input::get('Undeployable') || Input::get('RTD') || Input::get('Deployed') || Input::get('Archived'))
|
||||
@if (Input::get('Pending'))
|
||||
@lang('general.pending')
|
||||
@elseif (Input::get('RTD'))
|
||||
@@ -10,6 +10,8 @@
|
||||
@lang('general.undeployable')
|
||||
@elseif (Input::get('Deployed'))
|
||||
@lang('general.deployed')
|
||||
@elseif (Input::get('Archived'))
|
||||
@lang('general.archived')
|
||||
@endif
|
||||
@else
|
||||
@lang('general.all')
|
||||
@@ -38,8 +40,11 @@
|
||||
|
||||
@if ($assets->count() > 0)
|
||||
|
||||
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="example">
|
||||
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="col-md-1" bSortable="true">@lang('admin/hardware/table.asset_tag')</th>
|
||||
@@ -125,12 +130,12 @@
|
||||
@endif
|
||||
|
||||
<td>
|
||||
@if ($asset->status_id < 1 )
|
||||
@if ($asset->assigned_to != 0)
|
||||
<a href="{{ route('checkin/hardware', $asset->id) }}" class="btn btn-primary">@lang('general.checkin')</a>
|
||||
@else
|
||||
<a href="{{ route('checkout/hardware', $asset->id) }}" class="btn btn-info">@lang('general.checkout')</a>
|
||||
@endif
|
||||
@if ($asset->assetstatus->deployable == 1 )
|
||||
@if (($asset->assigned_to !='') && ($asset->assigned_to > 0))
|
||||
<a href="{{ route('checkin/hardware', $asset->id) }}" class="btn btn-primary">@lang('general.checkin')</a>
|
||||
@else
|
||||
<a href="{{ route('checkout/hardware', $asset->id) }}" class="btn btn-info">@lang('general.checkout')</a>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td nowrap="nowrap">
|
||||
|
||||
@@ -252,7 +252,7 @@
|
||||
</p>
|
||||
@endif
|
||||
|
||||
@if ((isset($asset->assigned_to ) && ($asset->assigned_to > 0)))
|
||||
@if ((isset($asset->assigneduser) && ($asset->assigned_to > 0)))
|
||||
<h6><br>@lang('admin/hardware/form.checkedout_to')</h6>
|
||||
<ul>
|
||||
|
||||
@@ -279,40 +279,42 @@
|
||||
<li><i class="icon-phone"></i> {{{ $asset->assigneduser->phone }}}</li>
|
||||
@endif
|
||||
|
||||
|
||||
<li><br /><a href="{{ route('checkin/hardware', $asset->id) }}" class="btn-flat large info ">@lang('admin/hardware/general.checkin')</a></li>
|
||||
</ul>
|
||||
|
||||
@elseif (($asset->status_id ) && ($asset->status_id > 1))
|
||||
@endif
|
||||
|
||||
@if (($asset->status_id ) && ($asset->status_id > 0))
|
||||
<!-- Status Info -->
|
||||
|
||||
@if ($asset->assetstatus)
|
||||
<h6><br>{{{ $asset->assetstatus->name }}}
|
||||
@lang('admin/hardware/general.asset')</h6>
|
||||
|
||||
<ul>
|
||||
@if (($asset->assetstatus->deployable=='1') && ($asset->assigned_to > 0))
|
||||
<li><br /><a href="{{ route('checkin/hardware', $asset->id) }}" class="btn-flat large info ">@lang('admin/hardware/general.checkin')</a></li>
|
||||
@elseif (($asset->assetstatus->deployable=='1') && (($asset->assigned_to=='') || ($asset->assigned_to==0)))
|
||||
<li><br /><a href="{{ route('checkout/hardware', $asset->id) }}" class="btn-flat large info ">@lang('admin/hardware/general.checkout')</a></li>
|
||||
|
||||
|
||||
@endif
|
||||
</ul>
|
||||
|
||||
@if ($asset->assetstatus->notes)
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-warning alert-block">
|
||||
<i class="icon-warning-sign"></i>
|
||||
@lang('admin/hardware/message.undeployable')
|
||||
<div class="alert alert-info alert-block">
|
||||
<i class="icon-info-sign"></i>
|
||||
{{{ $asset->assetstatus->notes }}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@elseif ($asset->status_id == NULL)
|
||||
<h6><br>@lang('admin/hardware/general.pending')</h6>
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-info alert-block">
|
||||
<i class="icon-info-sign"></i>
|
||||
@lang('admin/hardware/message.undeployable')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@else
|
||||
<h6><br>@lang('admin/hardware/general.checkout')</h6>
|
||||
<ul>
|
||||
<li>This asset is not checked out to anyone yet. Use the button below to check it out now.</li>
|
||||
<li><br><br /><a href="{{ route('checkout/hardware', $asset->id) }}" class="btn-flat large success">Checkout Asset</a></li>
|
||||
</ul>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -241,6 +241,7 @@
|
||||
<li><a href="{{ URL::to('hardware?RTD=true') }}" {{{ (Request::query('RTD') ? ' class="active"' : '') }}} >@lang('general.ready_to_deploy')</a></li>
|
||||
<li><a href="{{ URL::to('hardware?Pending=true') }}" {{{ (Request::query('Pending') ? ' class="active"' : '') }}} >@lang('general.pending')</a></li>
|
||||
<li><a href="{{ URL::to('hardware?Undeployable=true') }}" {{{ (Request::query('Undeployable') ? ' class="active"' : '') }}} >@lang('general.undeployable')</a></li>
|
||||
<li><a href="{{ URL::to('hardware?Archived=true') }}" {{{ (Request::query('Archived') ? ' class="active"' : '') }}} >@lang('admin/hardware/general.archived')</a></li>
|
||||
<li><a href="{{ URL::to('hardware') }}">@lang('general.list_all')</a></li>
|
||||
<li class="divider"> </li>
|
||||
<li><a href="{{ URL::to('hardware/models') }}" {{{ (Request::is('hardware/models*') ? ' class="active"' : '') }}} >@lang('general.asset_models')</a></li>
|
||||
@@ -360,7 +361,7 @@
|
||||
<a target="_blank" href="http://docs.snipeitapp.com/">Documentation</a> |
|
||||
<a href="https://crowdin.com/project/snipe-it">Help Translate It! </a> |
|
||||
<a target="_blank" href="https://github.com/snipe/snipe-it/issues?state=open">Report a Bug</a>
|
||||
(v1.2.3)</p>
|
||||
(v1.2.4)</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
<th class="col-sm-1">@lang('general.name')</th>
|
||||
@endif
|
||||
<th class="col-sm-1">@lang('admin/hardware/table.serial')</th>
|
||||
<th class="col-sm-1">@lang('admin/hardware/table.status')</th>
|
||||
<th class="col-sm-1">@lang('admin/hardware/table.purchase_date')</th>
|
||||
<th class="col-sm-1">@lang('admin/hardware/table.purchase_cost')</th>
|
||||
<th class="col-sm-1">@lang('admin/hardware/form.order')</th>
|
||||
@@ -54,11 +55,19 @@
|
||||
@endif
|
||||
</td>
|
||||
<td>{{{ $asset->model->name }}}</td>
|
||||
<td>{{{ $asset->model->modelno }}}</td>
|
||||
<td>{{{ $asset->model->modelno }}}</td>
|
||||
@if (Setting::getSettings()->display_asset_name)
|
||||
<td>{{{ $asset->name }}}</td>
|
||||
@endif
|
||||
<td>{{ $asset->serial }}</td>
|
||||
<td>
|
||||
|
||||
@if ($asset->assetstatus)
|
||||
{{{ $asset->assetstatus->name }}}
|
||||
@elseif ($asset->assigneduser)
|
||||
{{{ $asset->assigneduser->fullName() }}}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{{ $asset->purchase_date }}}</td>
|
||||
<td class="align-right">@lang('general.currency')
|
||||
{{{ number_format($asset->purchase_cost) }}}
|
||||
|
||||
@@ -50,6 +50,32 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Note -->
|
||||
<div class="form-group {{ $errors->has('notes') ? 'error' : '' }}">
|
||||
<label for="notes" class="col-md-3 control-label">@lang('admin/hardware/form.notes')</label>
|
||||
<div class="col-md-7">
|
||||
<textarea class="col-md-6 form-control" id="notes" name="notes">{{{ Input::old('notes', $statuslabel->notes) }}}</textarea>
|
||||
{{ $errors->first('notes', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Label type -->
|
||||
<div class="form-group {{ $errors->has('status_type_bool') ? 'error' : '' }}">
|
||||
<label for="notes" class="col-md-3 control-label">@lang('admin/statuslabels/table.status_type')
|
||||
<i class='icon-asterisk'></i></label>
|
||||
</label>
|
||||
<div class="col-md-7">
|
||||
{{ Form::select('statuslabel_types', $statuslabel_types , $use_statuslabel_type, array('class'=>'select2', 'style'=>'min-width:400px')) }}
|
||||
{{ $errors->first('notes', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
{{ $errors->first('status_type', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Form actions -->
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label"></label>
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="col-md-4">@lang('admin/statuslabels/table.name')</th>
|
||||
<th class="col-md-4">@lang('admin/statuslabels/table.status_type')</th>
|
||||
<th class="col-md-2 actions">@lang('table.actions')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -35,6 +36,17 @@
|
||||
@foreach ($statuslabels as $statuslabel)
|
||||
<tr>
|
||||
<td>{{{ $statuslabel->name }}}</td>
|
||||
<td>
|
||||
@if ($statuslabel->deployable == 1)
|
||||
@lang('admin/statuslabels/table.deployable')
|
||||
@elseif ($statuslabel->pending == 1)
|
||||
@lang('admin/statuslabels/table.pending')
|
||||
@elseif ($statuslabel->archived == 1)
|
||||
@lang('admin/statuslabels/table.archived')
|
||||
@else
|
||||
@lang('admin/statuslabels/table.undeployable')
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('update/statuslabel', $statuslabel->id) }}" class="btn btn-warning"><i class="icon-pencil icon-white"></i></a>
|
||||
<a data-html="false" class="btn delete-asset btn-danger" data-toggle="modal" href="{{ route('delete/statuslabel', $statuslabel->id) }}" data-content="@lang('admin/statuslabels/message.delete.confirm')"
|
||||
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 418 B |
|
After Width: | Height: | Size: 312 B |
|
After Width: | Height: | Size: 205 B |
|
After Width: | Height: | Size: 262 B |
|
After Width: | Height: | Size: 348 B |
|
After Width: | Height: | Size: 207 B |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 278 B |
|
After Width: | Height: | Size: 328 B |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 143 B |
|
After Width: | Height: | Size: 143 B |
|
After Width: | Height: | Size: 32 KiB |