From 56586b7e83b058cfd4c4e3a5e20cb45ade39f1b1 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 25 Nov 2013 05:07:20 -0500 Subject: [PATCH 1/4] Smaller flat buttons --- public/assets/css/compiled/elements.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/css/compiled/elements.css b/public/assets/css/compiled/elements.css index 6cbb7d5327..f0c9302074 100644 --- a/public/assets/css/compiled/elements.css +++ b/public/assets/css/compiled/elements.css @@ -93,7 +93,7 @@ .btn-flat { display: inline-block; margin: 0; - line-height: 15px; + line-height: 11px; vertical-align: middle; font-size: 12px; text-shadow: none; From 343eb31c56894db46f64ee29b3cd9a787610607c Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 25 Nov 2013 05:11:46 -0500 Subject: [PATCH 2/4] More info on license page --- app/views/backend/licenses/index.blade.php | 26 +++++++++++----------- app/views/backend/licenses/view.blade.php | 9 ++++++++ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/app/views/backend/licenses/index.blade.php b/app/views/backend/licenses/index.blade.php index 751a22ef33..5ca05337c8 100755 --- a/app/views/backend/licenses/index.blade.php +++ b/app/views/backend/licenses/index.blade.php @@ -29,7 +29,6 @@ Licenses :: @lang('admin/licenses/table.license_name') @lang('admin/licenses/table.license_email') @lang('admin/licenses/table.assigned_to') - @lang('admin/licenses/table.checkout') @lang('table.actions') @@ -44,7 +43,7 @@ Licenses :: {{ $license->serial }} {{ $license->license_name }} {{ $license->license_email }} - + @@ -61,8 +60,14 @@ Licenses :: - - {{ $license->serial }} + + @if ($licensedto->assigned_to) + Checkin + @else + Checkout + @endif + + {{ $license->serial }} {{ $license->license_name }} @@ -74,15 +79,10 @@ Licenses :: @endif - - @if ($licensedto->assigned_to) - Checkin - @else - Checkout - @endif - - - + + + + @endforeach @endif diff --git a/app/views/backend/licenses/view.blade.php b/app/views/backend/licenses/view.blade.php index 9bb513dd89..d6a776607a 100644 --- a/app/views/backend/licenses/view.blade.php +++ b/app/views/backend/licenses/view.blade.php @@ -154,6 +154,15 @@ View License {{ $license->name }} :: @if ($license->purchase_date)
  • Purchase Date: {{ $license->purchase_date }}
  • @endif + @if ($license->purchase_cost) +
  • Purchase Cost: ${{ number_format($license->purchase_cost) }}
  • + @endif + @if ($license->order_number) +
  • Order #: {{ $license->order_number }}
  • + @endif + @if ($license->seats) +
  • Seats: {{ $license->seats }}
  • + @endif From 2353eda611fbb5e3ae5ea745116bed2bd7c144a9 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 25 Nov 2013 05:12:23 -0500 Subject: [PATCH 3/4] Removed extra columns in license table to make it easier to read, moved buttons for more compact view --- app/views/backend/licenses/index.blade.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/views/backend/licenses/index.blade.php b/app/views/backend/licenses/index.blade.php index 5ca05337c8..02d8d1335f 100755 --- a/app/views/backend/licenses/index.blade.php +++ b/app/views/backend/licenses/index.blade.php @@ -26,8 +26,6 @@ Licenses :: @lang('admin/licenses/table.seats') @lang('admin/licenses/table.title') @lang('admin/licenses/table.serial') - @lang('admin/licenses/table.license_name') - @lang('admin/licenses/table.license_email') @lang('admin/licenses/table.assigned_to') @lang('table.actions') @@ -41,8 +39,7 @@ Licenses :: {{ $license->seats }} {{ $license->name }} {{ $license->serial }} - {{ $license->license_name }} - {{ $license->license_email }} + @@ -70,8 +67,7 @@ Licenses :: {{ $license->serial }} - {{ $license->license_name }} - {{ $license->license_email }} + @if ($licensedto->assigned_to) From 2b088a3fb2ea7711f66e4a887882b17f401ba4bc Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 25 Nov 2013 05:36:42 -0500 Subject: [PATCH 4/4] Fixes #17 --- app/controllers/admin/AssetsController.php | 3 ++ ...5_101308_add_warrantee_to_assets_table.php | 35 +++++++++++++++++++ app/models/Asset.php | 12 +++++++ app/views/backend/assets/edit.blade.php | 9 +++++ app/views/backend/assets/view.blade.php | 19 ++++++++++ 5 files changed, 78 insertions(+) create mode 100644 app/database/migrations/2013_11_25_101308_add_warrantee_to_assets_table.php diff --git a/app/controllers/admin/AssetsController.php b/app/controllers/admin/AssetsController.php index 2ebc6616fd..39630dc262 100644 --- a/app/controllers/admin/AssetsController.php +++ b/app/controllers/admin/AssetsController.php @@ -117,6 +117,7 @@ class AssetsController extends AdminController { $asset->notes = e(Input::get('notes')); $asset->asset_tag = e(Input::get('asset_tag')); $asset->status_id = e(Input::get('status_id')); + $asset->warrantee_months = e(Input::get('warrantee_months')); $asset->user_id = Sentry::getId(); $asset->physical = '1'; @@ -191,6 +192,7 @@ class AssetsController extends AdminController { 'asset_tag' => 'required|min:3', 'model_id' => 'required', 'serial' => 'required|min:3', + 'warrantee_months' => 'integer|min:1', ); // Create a new validator instance from our validation rules @@ -213,6 +215,7 @@ class AssetsController extends AdminController { $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->warrantee_months = e(Input::get('warrantee_months')); $asset->notes = e(Input::get('notes')); $asset->physical = '1'; diff --git a/app/database/migrations/2013_11_25_101308_add_warrantee_to_assets_table.php b/app/database/migrations/2013_11_25_101308_add_warrantee_to_assets_table.php new file mode 100644 index 0000000000..c99f091162 --- /dev/null +++ b/app/database/migrations/2013_11_25_101308_add_warrantee_to_assets_table.php @@ -0,0 +1,35 @@ +integer('warrantee_months')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + Schema::table('assets', function($table) + { + $table->dropColumn('warrantee_months'); + }); + } + +} \ No newline at end of file diff --git a/app/models/Asset.php b/app/models/Asset.php index 05657ab632..692159d27e 100644 --- a/app/models/Asset.php +++ b/app/models/Asset.php @@ -9,6 +9,7 @@ class Asset extends Elegant { 'asset_tag' => 'required|min:3|unique:assets', 'model_id' => 'required', 'serial' => 'required|min:3', + 'warrantee_months' => 'integer|min:1', ); @@ -104,4 +105,15 @@ class Asset extends Elegant { } + public function warrantee_expires() + { + + + $date = date_create($this->purchase_date); + date_add($date, date_interval_create_from_date_string($this->warrantee_months.' months')); + return date_format($date, 'Y-m-d'); + + } + + } diff --git a/app/views/backend/assets/edit.blade.php b/app/views/backend/assets/edit.blade.php index 853565cf9a..544bb50e16 100755 --- a/app/views/backend/assets/edit.blade.php +++ b/app/views/backend/assets/edit.blade.php @@ -105,6 +105,15 @@ + +
    + +
    + months + {{ $errors->first('warrantee_months', ':message') }} +
    +
    +
    diff --git a/app/views/backend/assets/view.blade.php b/app/views/backend/assets/view.blade.php index cdd83df4a7..1fdd250e7d 100644 --- a/app/views/backend/assets/view.blade.php +++ b/app/views/backend/assets/view.blade.php @@ -98,6 +98,25 @@ View Asset {{ $asset->asset_tag }} ::
    +

    More Info:
    +
      + + @if ($asset->purchase_date) +
    • Purchase Date: {{ $asset->purchase_date }}
    • + @endif + @if ($asset->purchase_cost) +
    • Purchase Cost: ${{ number_format($asset->purchase_cost) }}
    • + @endif + @if ($asset->order_number) +
    • Order #: {{ $asset->order_number }}
    • + @endif + @if ($asset->warrantee_months) +
    • Warrantee: {{ $asset->warrantee_months }} months
    • +
    • Expires: {{ $asset->warrantee_expires() }}
    • + @endif +
    + + @if ((isset($asset->assigned_to ) && ($asset->assigned_to > 0)))

    Checked Out To: