alpha 0.4.0 release candidate

This commit is contained in:
Cordeos Team
2014-08-11 17:13:43 +09:00
parent d6404dc734
commit 0dfc9660ca
62 changed files with 78 additions and 26 deletions
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
View File
View File
Regular → Executable
View File
View File
View File
View File
Regular → Executable
View File
+10 -6
View File
@@ -197,7 +197,7 @@ class AssetsController extends AdminController
if (e(Input::get('purchase_cost')) == '') {
$asset->purchase_cost = NULL;
} else {
$asset->purchase_cost = e(Input::get('purchase_cost'));
$asset->purchase_cost = ParseFloat(e(Input::get('purchase_cost')));
}
if (e(Input::get('purchase_date')) == '') {
@@ -341,7 +341,7 @@ class AssetsController extends AdminController
$asset->name = e(Input::get('name'));
$asset->serial = e(Input::get('serial'));
$asset->model_id = e(Input::get('model_id'));
$asset->order_number = e(Input::get('order_number'));
$asset->order_number = e(Input::get('order_number'));
$asset->asset_tag = e(Input::get('asset_tag'));
$asset->notes = e(Input::get('notes'));
$asset->physical = '1';
@@ -606,7 +606,7 @@ class AssetsController extends AdminController
public function getClone($assetId = null)
{
// Check if the asset exists
if (is_null($asset = Asset::find($assetId))) {
if (is_null($asset_to_clone = Asset::find($assetId))) {
// Redirect to the asset management page
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
@@ -619,9 +619,13 @@ class AssetsController extends AdminController
// get depreciation list
$depreciation_list = array('' => '') + Depreciation::lists('name', 'id');
$supplier_list = array('' => '') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$assigned_to = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat (first_name," ",last_name) as full_name, id'))->whereNull('deleted_at')->lists('full_name', 'id');
$asset = clone $asset_to_clone;
$asset->id = null;
$asset->asset_tag = '';
return View::make('backend/hardware/edit')->with('supplier_list',$supplier_list)->with('model_list',$model_list)->with('statuslabel_list',$statuslabel_list)->with('assigned_to',$assigned_to)->with('asset',$asset);
return View::make('backend/hardware/clone', compact('asset'))->with('model_list',$model_list)->with('depreciation_list',$depreciation_list)->with('statuslabel_list',$statuslabel_list);
}
}
View File
View File
+28 -2
View File
@@ -75,6 +75,13 @@ class LicensesController extends AdminController
// attempt validation
if ($license->validate($new)) {
if ( e(Input::get('purchase_cost')) == '') {
$license->purchase_cost = NULL;
} else {
$license->purchase_cost = ParseFloat(e(Input::get('purchase_cost')));
//$license->purchase_cost = e(Input::get('purchase_cost'));
}
// Save the license data
$license->name = e(Input::get('name'));
$license->serial = e(Input::get('serial'));
@@ -84,7 +91,7 @@ class LicensesController extends AdminController
$license->order_number = e(Input::get('order_number'));
$license->seats = e(Input::get('seats'));
$license->purchase_date = e(Input::get('purchase_date'));
$license->purchase_cost = e(Input::get('purchase_cost'));
//$license->purchase_cost = e(Input::get('purchase_cost'));
$license->depreciation_id = e(Input::get('depreciation_id'));
//$license->asset_id = e(Input::get('asset_id'));
$license->user_id = Sentry::getId();
@@ -535,6 +542,25 @@ class LicensesController extends AdminController
return Redirect::route('licenses')->with('error', $error);
}
}
public function getClone($licenseId = null)
{
// Check if the license exists
if (is_null($license_to_clone = License::find($licenseId))) {
// Redirect to the blogs management page
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.does_not_exist'));
}
// Show the page
$license_options = array('0' => 'Top Level') + License::lists('name', 'id');
$license = clone $license_to_clone;
$license->id = null;
$license->serial = null;
// Show the page
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
return View::make('backend/licenses/edit')->with('license_options',$license_options)->with('depreciation_list',$depreciation_list)->with('license',$license);
}
}
View File
View File
View File
View File
View File
View File
View File
@@ -1,8 +1,11 @@
ALTER TABLE `asset_uploads`
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
CHANGE COLUMN `updated_at` `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;
ALTER TABLE `assets`
/*
SNIPE IT SQL migration script
20140810_0.4.0
Created by Cordeos
*/
ALTER TABLE `asset_uploads`
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
CHANGE COLUMN `updated_at` `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;
@@ -26,6 +29,10 @@ ALTER TABLE `license_seats`
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
CHANGE COLUMN `updated_at` `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;
ALTER TABLE `assets`
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
CHANGE COLUMN `updated_at` `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;
ALTER TABLE `licenses`
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
CHANGE COLUMN `updated_at` `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;
@@ -38,10 +45,6 @@ ALTER TABLE `manufacturers`
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
CHANGE COLUMN `updated_at` `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;
ALTER TABLE `models`
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
CHANGE COLUMN `updated_at` `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;
ALTER TABLE `settings`
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
CHANGE COLUMN `updated_at` `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;
@@ -54,14 +57,13 @@ ALTER TABLE `suppliers`
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
CHANGE COLUMN `updated_at` `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;
ALTER TABLE `users`
ALTER TABLE `models`
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
CHANGE COLUMN `updated_at` `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;
UPDATE assets SET status_id=0 where status_id is null;
UPDATE assets SET purchase_cost=0 where purchase_cost is null;
UPDATE models SET eol=0 where eol is null;
UPDATE users SET location_id=0 where location_id is null;
ALTER TABLE `users`
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
CHANGE COLUMN `updated_at` `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;
ALTER TABLE `assets`
CHANGE COLUMN `name` `name` VARCHAR(255) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NULL DEFAULT NULL ,
@@ -70,17 +72,18 @@ CHANGE COLUMN `purchase_cost` `purchase_cost` DECIMAL(13,4) NOT NULL DEFAULT '0.
CHANGE COLUMN `order_number` `order_number` VARCHAR(255) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NULL DEFAULT NULL ,
CHANGE COLUMN `assigned_to` `assigned_to` INT(11) NULL DEFAULT NULL ,
CHANGE COLUMN `notes` `notes` TEXT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NULL DEFAULT NULL ,
CHANGE COLUMN `status_id` `status_id` INT(11) NULL DEFAULT NULL ;
CHANGE COLUMN `archived` `archived` TINYINT(1) NOT NULL DEFAULT '0' ,
CHANGE COLUMN `depreciate` `depreciate` TINYINT(1) NOT NULL DEFAULT '0' ,
CHANGE COLUMN `supplier_id` `supplier_id` INT(11) NULL DEFAULT NULL ,
CHANGE COLUMN `requestable` `requestable` TINYINT(4) NOT NULL DEFAULT '0' ;
CHANGE COLUMN `depreciate` `depreciate` TINYINT(1) NOT NULL DEFAULT '0' ;
ALTER TABLE `licenses`
CHANGE COLUMN `purchase_cost` `purchase_cost` DECIMAL(13,4) NULL DEFAULT NULL ,
CHANGE COLUMN `depreciate` `depreciate` TINYINT(1) NULL DEFAULT '0' ;
ALTER TABLE `license_seats`
CHANGE COLUMN `assigned_to` `assigned_to` INT(11) NULL DEFAULT NULL ;
ALTER TABLE `locations`
CHANGE COLUMN `state` `state` VARCHAR(64) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NOT NULL ,
CHANGE COLUMN `address2` `address2` VARCHAR(80) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NULL DEFAULT NULL ,
CHANGE COLUMN `zip` `zip` VARCHAR(10) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NULL DEFAULT NULL ;
Regular → Executable
View File
View File
+1
View File
@@ -6,6 +6,7 @@ return array(
'checkout_history' => 'Checkout History',
'checkout' => 'Checkout License Seat',
'edit' => 'Edit License',
'clone' => 'Clone License',
'history_for' => 'History for ',
'in_out' => 'In/Out',
'info' => 'License Info',
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Executable → Regular
+2
View File
@@ -62,6 +62,8 @@ Route::group(array('prefix' => 'admin'), function () {
Route::post('create', 'Controllers\Admin\LicensesController@postCreate');
Route::get('{licenseId}/edit', array('as' => 'update/license', 'uses' => 'Controllers\Admin\LicensesController@getEdit'));
Route::post('{licenseId}/edit', 'Controllers\Admin\LicensesController@postEdit');
Route::get('{licenseId}/clone', array('as' => 'clone/license', 'uses' => 'Controllers\Admin\LicensesController@getClone'));
Route::post('{licenseId}/clone', 'Controllers\Admin\LicensesController@postCreate');
Route::get('{licenseId}/delete', array('as' => 'delete/license', 'uses' => 'Controllers\Admin\LicensesController@getDelete'));
Route::get('{licenseId}/checkout', array('as' => 'checkout/license', 'uses' => 'Controllers\Admin\LicensesController@getCheckout'));
Route::post('{licenseId}/checkout', 'Controllers\Admin\LicensesController@postCheckout');
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
+17 -1
View File
@@ -9,11 +9,27 @@
{{-- Page content --}}
@section('content')
<div class="row header">
<!--<div class="row header">
<div class="col-md-12">
<a href="{{ route('update/license', $license->id) }}" class="btn btn-warning pull-right"> @lang('admin/licenses/form.update')</a>
<h3 class="name">@lang('general.history_for') {{ $license->name }}</h3>
</div>
</div>-->
<div class="row header">
<div class="col-md-12">
<div class="btn-group pull-right">
<button class="btn gray">@lang('button.actions')</button>
<button class="btn glow dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="{{ route('update/license', $license->id) }}">@lang('admin/licenses/general.edit')</a></li>
<li><a href="{{ route('clone/license', $license->id) }}">@lang('admin/licenses/general.clone')</a></li>
</ul>
</div>
<h3 class="name">@lang('general.history_for') {{ $license->name }}</h3>
</div>
</div>
<div class="user-profile">
View File
View File
View File
View File
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File