Skip to content

Commit 823e0c8

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents a5f4c51 + 95be790 commit 823e0c8

File tree

54 files changed

+283
-28
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+283
-28
lines changed

app/controllers/admin/AssetsController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function postCreate()
193193
$asset->order_number = e(Input::get('order_number'));
194194
$asset->notes = e(Input::get('notes'));
195195
$asset->asset_tag = e(Input::get('asset_tag'));
196-
196+
$asset->mac_address = e(Input::get('mac_address'));
197197
$asset->user_id = Sentry::getId();
198198
$asset->archived = '0';
199199
$asset->physical = '1';
@@ -322,10 +322,11 @@ public function postEdit($assetId = null)
322322
$asset->name = e(Input::get('name'));
323323
$asset->serial = e(Input::get('serial'));
324324
$asset->model_id = e(Input::get('model_id'));
325-
$asset->order_number = e(Input::get('order_number'));
325+
$asset->order_number = e(Input::get('order_number'));
326326
$asset->asset_tag = e(Input::get('asset_tag'));
327327
$asset->notes = e(Input::get('notes'));
328328
$asset->physical = '1';
329+
$asset->mac_address = e(Input::get('mac_address'));
329330

330331
// Was the asset updated?
331332
if($asset->save()) {

app/controllers/admin/ModelsController.php

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ public function postCreate()
6767

6868
// attempt validation
6969
if ($model->validate($new)) {
70-
70+
7171
if ( e(Input::get('depreciation_id')) == '') {
7272
$model->depreciation_id = 0;
7373
} else {
7474
$model->depreciation_id = e(Input::get('depreciation_id'));
7575
}
76-
76+
7777
if ( e(Input::get('eol')) == '') {
7878
$model->eol = 0;
7979
} else {
@@ -83,11 +83,11 @@ public function postCreate()
8383
// Save the model data
8484
$model->name = e(Input::get('name'));
8585
$model->modelno = e(Input::get('modelno'));
86-
//$model->depreciation_id = e(Input::get('depreciation_id'));
8786
$model->manufacturer_id = e(Input::get('manufacturer_id'));
8887
$model->category_id = e(Input::get('category_id'));
8988
$model->user_id = Sentry::getId();
90-
//$model->eol = e(Input::get('eol'));
89+
$model->show_mac_address = e(Input::get('show_mac_address', '0'));
90+
9191

9292
if (Input::file('image')) {
9393
$image = Input::file('image');
@@ -160,18 +160,18 @@ public function postEdit($modelId = null)
160160

161161
if ($validator->fails())
162162
{
163-
// The given data did not pass validation
163+
// The given data did not pass validation
164164
return Redirect::back()->withInput()->withErrors($validator->messages());
165165
}
166166
// attempt validation
167167
else {
168-
168+
169169
if ( e(Input::get('depreciation_id')) == '') {
170170
$model->depreciation_id = 0;
171171
} else {
172172
$model->depreciation_id = e(Input::get('depreciation_id'));
173173
}
174-
174+
175175
if ( e(Input::get('eol')) == '') {
176176
$model->eol = 0;
177177
} else {
@@ -180,9 +180,10 @@ public function postEdit($modelId = null)
180180

181181
// Update the model data
182182
$model->name = e(Input::get('name'));
183-
$model->modelno = e(Input::get('modelno'));
183+
$model->modelno = e(Input::get('modelno'));
184184
$model->manufacturer_id = e(Input::get('manufacturer_id'));
185185
$model->category_id = e(Input::get('category_id'));
186+
$model->show_mac_address = e(Input::get('show_mac_address', '0'));
186187

187188
if (Input::file('image')) {
188189
$image = Input::file('image');
@@ -198,13 +199,13 @@ public function postEdit($modelId = null)
198199
if (Input::get('image_delete') == 1 && Input::file('image') == "") {
199200
$model->image = NULL;
200201
}
201-
202+
202203
// Was it created?
203204
if($model->save()) {
204205
// Redirect to the new model page
205206
return Redirect::to("hardware/models")->with('success', Lang::get('admin/models/message.update.success'));
206207
}
207-
}
208+
}
208209

209210
// Redirect to the model create page
210211
return Redirect::to("hardware/models/$modelId/edit")->with('error', Lang::get('admin/models/message.update.error'));
@@ -261,18 +262,18 @@ public function getView($modelId = null)
261262

262263

263264
}
264-
265+
265266
public function getClone($modelId = null)
266267
{
267268
// Check if the model exists
268269
if (is_null($model_to_clone = Model::find($modelId))) {
269270
// Redirect to the model management page
270271
return Redirect::to('assets/models')->with('error', Lang::get('admin/models/message.does_not_exist'));
271272
}
272-
273+
273274
$model = clone $model_to_clone;
274275
$model->id = null;
275-
276+
276277
// Show the page
277278
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
278279
$manufacturer_list = array('' => 'Select One') + Manufacturer::lists('name', 'id');
@@ -284,7 +285,7 @@ public function getClone($modelId = null)
284285
$view->with('model',$model);
285286
$view->with('clone_model',$model_to_clone);
286287
return $view;
287-
288+
288289
}
289290

290291

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
use Illuminate\Database\Schema\Blueprint;
4+
use Illuminate\Database\Migrations\Migration;
5+
6+
class AddMacAddressToAsset extends Migration {
7+
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
//
16+
Schema::table('assets', function ($table) {
17+
$table->string('mac_address')->nullable()->default(NULL);
18+
});
19+
20+
Schema::table('models', function ($table) {
21+
$table->boolean('show_mac_address')->default(0);
22+
});
23+
24+
}
25+
26+
/**
27+
* Reverse the migrations.
28+
*
29+
* @return void
30+
*/
31+
public function down()
32+
{
33+
//
34+
Schema::table('assets', function ($table) {
35+
$table->dropColumn('mac_address');
36+
});
37+
38+
Schema::table('models', function ($table) {
39+
$table->dropColumn('show_mac_address');
40+
});
41+
}
42+
43+
}

app/lang/ar/admin/hardware/form.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
'expires' => 'Expires',
1616
'fully_depreciated' => 'Fully Depreciated',
1717
'help_checkout' => 'If you wish to assign this asset immediately, you should select "Ready to Deploy" from the status list above, or unexpected things may happen. ',
18+
'mac_address' => 'MAC Address',
1819
'manufacturer' => 'Manufacturer',
1920
'model' => 'Model',
2021
'months' => 'months',
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
return array(
4+
5+
'show_mac_address' => 'Show MAC address field in assets in this model',
6+
7+
);

app/lang/cs/admin/hardware/form.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
'expires' => 'Expiruje',
1616
'fully_depreciated' => 'Plně odepsané',
1717
'help_checkout' => 'Pokud si přejete přiřadit majetek okamžitě, měli by jste ze seznamu stavů zvolit "Připraveno k přiděleni", nebo se může něco pokazit. ',
18+
'mac_address' => 'MAC Address',
1819
'manufacturer' => 'Výrobce',
1920
'model' => 'Model',
2021
'months' => 'měsíce',
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
return array(
4+
5+
'show_mac_address' => 'Show MAC address field in assets in this model',
6+
7+
);

app/lang/da/admin/hardware/form.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
'expires' => 'Udløber',
1616
'fully_depreciated' => 'Fully Depreciated',
1717
'help_checkout' => 'If you wish to assign this asset immediately, you should select "Ready to Deploy" from the status list above, or unexpected things may happen. ',
18+
'mac_address' => 'MAC Address',
1819
'manufacturer' => 'Producent',
1920
'model' => 'Model',
2021
'months' => 'måneder',
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
return array(
4+
5+
'show_mac_address' => 'Show MAC address field in assets in this model',
6+
7+
);

app/lang/de/admin/hardware/form.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
'expires' => 'Gültig bis',
1616
'fully_depreciated' => 'Komplett Abgeschrieben',
1717
'help_checkout' => 'Wenn du dieses Asset sofort zuweisen möchtest, solltest du "Ready to Deploy" im Statusfeld auswählen oder es könnten unerwartete Probleme auftreten. ',
18+
'mac_address' => 'MAC Address',
1819
'manufacturer' => 'Hersteller',
1920
'model' => 'Modell',
2021
'months' => 'Monate',

0 commit comments

Comments
 (0)