Skip to content

Commit c8526a6

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents bd7a043 + abd0acb commit c8526a6

File tree

9 files changed

+155
-10
lines changed

9 files changed

+155
-10
lines changed

app/config/version.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
22
return array (
3-
'app_version' => 'v2.0-114',
4-
'hash_version' => 'v2.0-114-g06c9076',
3+
'app_version' => 'v2.0-118',
4+
'hash_version' => 'v2.0-118-gf9dc576',
55
);

app/controllers/admin/UsersController.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,9 @@ public function getDatatable($status = null) {
876876
return '';
877877
}
878878
})
879+
->addColumn('username', function($users) {
880+
return $users->username;
881+
})
879882
->addColumn('manager', function($users) {
880883
if ($users->manager) {
881884
return '<a title="' . $users->manager->fullName() . '" href="users/' . $users->manager->id . '/view">' . $users->manager->fullName() . '</a>';
@@ -906,8 +909,8 @@ public function getDatatable($status = null) {
906909
return $group_names;
907910
})
908911
->addColumn($actions)
909-
->searchColumns('name', 'email', 'manager', 'activated', 'groups', 'location')
910-
->orderColumns('name', 'email', 'manager', 'activated', 'licenses', 'assets', 'accessories', 'consumables', 'groups', 'location')
912+
->searchColumns('name', 'email', 'username', 'manager', 'activated', 'groups', 'location')
913+
->orderColumns('name', 'email', 'username', 'manager', 'activated', 'licenses', 'assets', 'accessories', 'consumables', 'groups', 'location')
911914
->make();
912915
}
913916

@@ -1043,13 +1046,13 @@ public function getLDAP() {
10431046
// Selected permissions
10441047
$selectedPermissions = Input::old('permissions', array('superuser' => -1));
10451048
$this->encodePermissions($selectedPermissions);
1046-
1049+
10471050
$location_list = locationsList();
1048-
1051+
10491052
// Show the page
10501053
return View::make('backend/users/ldap', compact('groups', 'selectedGroups', 'permissions', 'selectedPermissions'))
10511054
->with('location_list', $location_list);
1052-
1055+
10531056
}
10541057

10551058
/**
@@ -1064,7 +1067,7 @@ public function getLDAP() {
10641067
'username' => 'required|min:2|unique:users,username',
10651068
'email' => 'email|unique:users,email',
10661069
);
1067-
1070+
10681071
/**
10691072
* Declare the rules for the form validation.
10701073
*
@@ -1083,14 +1086,14 @@ public function getLDAP() {
10831086
public function postLDAP() {
10841087

10851088
$location_id = Input::get('location_id');
1086-
1089+
10871090
$formValidator = Validator::make(Input::all(), $this->ldapFormInputValidationRules);
10881091
// If validation fails, we'll exit the operation now.
10891092
if ($formValidator->fails()) {
10901093
// Ooops.. something went wrong
10911094
return Redirect::back()->withInput()->withErrors($formValidator);
10921095
}
1093-
1096+
10941097
$ldap_version = Config::get('ldap.version');
10951098
$url = Config::get('ldap.url');
10961099
$username = Config::get('ldap.username');
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
class AccessoriesSeeder extends Seeder
3+
{
4+
public function run()
5+
{
6+
7+
8+
// Initialize empty array
9+
$accessory = array();
10+
11+
$date = new DateTime;
12+
13+
14+
$accessory[] = array(
15+
'name' => 'Cisco Desktop Phone',
16+
'category_id' => 4,
17+
'qty' => '20',
18+
'requestable' => '0',
19+
'user_id' => 1,
20+
);
21+
22+
$accessory[] = array(
23+
'name' => 'ASUS 23-inch',
24+
'category_id' => 5,
25+
'qty' => '20',
26+
'requestable' => '0',
27+
'user_id' => 1,
28+
);
29+
30+
31+
32+
// Delete all the old data
33+
DB::table('accessories')->truncate();
34+
35+
// Insert the new posts
36+
Accessory::insert($accessory);
37+
}
38+
39+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
class AssetMaintenancesSeeder extends Seeder
3+
{
4+
public function run()
5+
{
6+
7+
8+
// Initialize empty array
9+
$asset_maintenances = array();
10+
11+
$date = new DateTime;
12+
13+
14+
$asset_maintenances[] = array(
15+
'asset_id' => 1,
16+
'supplier_id' => 1,
17+
'asset_maintenance_type' => 'Maintenance',
18+
'title' => 'Test Maintenance',
19+
'start_date' => $date->modify('-10 day'),
20+
'cost' => '200.99',
21+
'created_at' => $date->modify('-10 day'),
22+
'updated_at' => $date->modify('-3 day'),
23+
);
24+
25+
26+
27+
// Delete all the old data
28+
DB::table('asset_maintenances')->truncate();
29+
30+
// Insert the new posts
31+
AssetMaintenance::insert($asset_maintenances);
32+
}
33+
34+
}

app/database/seeds/AssetsSeeder.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public function run()
1515
'name' => 'Shanen MBP',
1616
'asset_tag' => 'NNY2878796',
1717
'model_id' => 1,
18+
'supplier_id' => 1,
1819
'serial' => 'WS90585666669',
1920
'purchase_date' => '2013-10-02',
2021
'purchase_cost' => '2435.99',
@@ -38,6 +39,7 @@ public function run()
3839
'name' => 'Michael MBP',
3940
'asset_tag' => 'NNY28633396',
4041
'model_id' => 1,
42+
'supplier_id' => 1,
4143
'serial' => 'WS905823226669',
4244
'purchase_date' => '2013-10-02',
4345
'purchase_cost' => '2435.99',
@@ -62,6 +64,7 @@ public function run()
6264
'name' => 'Alison MBP',
6365
'asset_tag' => 'NNY287958796',
6466
'model_id' => 1,
67+
'supplier_id' => 1,
6568
'serial' => 'WS905869046069',
6669
'purchase_date' => '2013-10-02',
6770
'purchase_cost' => '2435.99',
@@ -85,6 +88,7 @@ public function run()
8588
'name' => 'Brady MBP',
8689
'asset_tag' => 'NNY78795566',
8790
'model_id' => 2,
91+
'supplier_id' => 2,
8892
'serial' => 'WS9078686069',
8993
'purchase_date' => '2012-01-02',
9094
'purchase_cost' => '1999.99',
@@ -108,6 +112,7 @@ public function run()
108112
'name' => 'Deborah MBP',
109113
'asset_tag' => 'NNY65756756775',
110114
'model_id' => 2,
115+
'supplier_id' => 2,
111116
'serial' => 'WS9078686069',
112117
'purchase_date' => '2012-01-02',
113118
'purchase_cost' => '699.99',
@@ -132,6 +137,7 @@ public function run()
132137
'name' => 'Sara MBP',
133138
'asset_tag' => 'NNY6897856775',
134139
'model_id' => 2,
140+
'supplier_id' => 2,
135141
'serial' => 'WS87897998Q',
136142
'purchase_date' => '2012-01-02',
137143
'purchase_cost' => '1999.99',
@@ -155,6 +161,7 @@ public function run()
155161
'name' => 'Ben MBP',
156162
'asset_tag' => 'NNY67567775',
157163
'model_id' => 2,
164+
'supplier_id' => 2,
158165
'serial' => 'WS89080890',
159166
'purchase_date' => '2012-01-02',
160167
'purchase_cost' => '1999.99',
@@ -178,6 +185,7 @@ public function run()
178185
'name' => 'Broken Laptop',
179186
'asset_tag' => 'NNY6756756775',
180187
'model_id' => 2,
188+
'supplier_id' => 2,
181189
'serial' => 'WS89080890',
182190
'purchase_date' => '2012-01-02',
183191
'purchase_cost' => '1999.99',
@@ -201,6 +209,7 @@ public function run()
201209
'name' => 'Maybe Broke-Ass Laptop',
202210
'asset_tag' => 'NNY6755667775',
203211
'model_id' => 2,
212+
'supplier_id' => 1,
204213
'serial' => 'WS45689080890',
205214
'purchase_date' => '2012-01-02',
206215
'purchase_cost' => '1999.99',
@@ -224,6 +233,7 @@ public function run()
224233
'name' => 'Completely Facacta Laptop',
225234
'asset_tag' => 'NNY6564567775',
226235
'model_id' => 2,
236+
'supplier_id' => 2,
227237
'serial' => 'WS99689080890',
228238
'purchase_date' => '2012-01-02',
229239
'purchase_cost' => '1999.99',
@@ -247,6 +257,7 @@ public function run()
247257
'name' => 'Borked Laptop',
248258
'asset_tag' => 'NNY656456778975',
249259
'model_id' => 2,
260+
'supplier_id' => 1,
250261
'serial' => 'WS99689080890',
251262
'purchase_date' => '2012-01-02',
252263
'purchase_cost' => '1999.99',
@@ -270,6 +281,7 @@ public function run()
270281
'name' => 'Noah MBP',
271282
'asset_tag' => 'NNY98056775',
272283
'model_id' => 2,
284+
'supplier_id' => 1,
273285
'serial' => 'WS909098888',
274286
'purchase_date' => '2011-12-20',
275287
'purchase_cost' => '699.99',

app/database/seeds/CategoriesSeeder.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public function run()
1616
'require_acceptance' => 0,
1717
'deleted_at' => NULL,
1818
'eula_text' => NULL,
19+
'category_type' => 'asset',
1920
);
2021

2122
$date = new DateTime;
@@ -28,6 +29,7 @@ public function run()
2829
'require_acceptance' => 0,
2930
'deleted_at' => NULL,
3031
'eula_text' => NULL,
32+
'category_type' => 'asset',
3133
);
3234

3335
$date = new DateTime;
@@ -40,6 +42,7 @@ public function run()
4042
'require_acceptance' => 0,
4143
'deleted_at' => NULL,
4244
'eula_text' => NULL,
45+
'category_type' => 'asset',
4346
);
4447

4548
$date = new DateTime;
@@ -52,6 +55,7 @@ public function run()
5255
'require_acceptance' => 0,
5356
'deleted_at' => NULL,
5457
'eula_text' => NULL,
58+
'category_type' => 'accessory',
5559
);
5660

5761
$date = new DateTime;
@@ -64,6 +68,20 @@ public function run()
6468
'require_acceptance' => 0,
6569
'deleted_at' => NULL,
6670
'eula_text' => NULL,
71+
'category_type' => 'accessory',
72+
);
73+
74+
$date = new DateTime;
75+
$category[] = array(
76+
'name' => 'Printer Ink',
77+
'created_at' => $date->modify('-10 day'),
78+
'updated_at' => $date->modify('-3 day'),
79+
'user_id' => 1,
80+
'use_default_eula' => 0,
81+
'require_acceptance' => 0,
82+
'deleted_at' => NULL,
83+
'eula_text' => NULL,
84+
'category_type' => 'consumable',
6785
);
6886

6987

app/database/seeds/DatabaseSeeder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public function run()
2222
$this->call('LicensesSeeder');
2323
$this->call('LicenseSeatsSeeder');
2424
$this->call('ActionlogSeeder');
25+
$this->call('AccessoriesSeeder');
26+
$this->call('AssetMaintenancesSeeder');
27+
$this->call('SuppliersSeeder');
2528
}
2629

2730
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
class SuppliersSeeder extends Seeder
3+
{
4+
public function run()
5+
{
6+
7+
8+
// Initialize empty array
9+
$supplier = array();
10+
11+
$date = new DateTime;
12+
13+
14+
$supplier[] = array(
15+
'name' => 'New Egg',
16+
'created_at' => $date->modify('-10 day'),
17+
'updated_at' => $date->modify('-3 day'),
18+
);
19+
20+
$supplier[] = array(
21+
'name' => 'Microsoft',
22+
'created_at' => $date->modify('-10 day'),
23+
'updated_at' => $date->modify('-3 day'),
24+
);
25+
26+
27+
28+
// Delete all the old data
29+
DB::table('suppliers')->truncate();
30+
31+
// Insert the new posts
32+
Supplier::insert($supplier);
33+
}
34+
35+
}

app/views/backend/users/index.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
->addColumn('<div class="text-center"><input type="checkbox" id="checkAll" style="padding-left: 0px;"></div>',
4545
Lang::get('admin/users/table.name'),
4646
'<i class="fa fa-envelope fa-lg"></i>',
47+
Lang::get('admin/users/table.username'),
4748
Lang::get('admin/users/table.manager'),
4849
Lang::get('admin/users/table.location'),
4950
'<i class="fa fa-barcode fa-lg"></i>',

0 commit comments

Comments
 (0)