Skip to content

Commit 244ecea

Browse files
committed
Merge branch 'develop'
# Conflicts: # config/version.php
2 parents 4f3c932 + 28fdbdd commit 244ecea

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

app/Console/Commands/SyncAssetLocations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function handle()
109109
$assigned_asset_asset->unsetEventDispatcher();
110110
$assigned_asset_asset->save();
111111
} else {
112-
$output['warn'][] ='Asset Assigned asset ' . $assigned_asset_asset->assetLoc()->id. ' ('.$assigned_asset_asset->asset_tag.') does not seem to have a valid location';
112+
$output['warn'][] ='Asset Assigned asset ' . $assigned_asset_asset->id. ' ('.$assigned_asset_asset->asset_tag.') does not seem to have a valid location';
113113
}
114114

115115
$bar->advance();

app/Models/Asset.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,10 @@ public function assignedAssets()
257257
/**
258258
* Get the asset's location based on the assigned user
259259
**/
260-
public function assetLoc()
260+
public function assetLoc($iterations = 1,$first_asset = null)
261261
{
262-
static $iterations=0;
263-
static $first_asset;
264262
if (!empty($this->assignedType())) {
265263
if ($this->assignedType() == self::ASSET) {
266-
$iterations++;
267264
if(!$first_asset) {
268265
$first_asset=$this;
269266
}
@@ -272,7 +269,7 @@ public function assetLoc()
272269
}
273270
$assigned_to=Asset::find($this->assigned_to); //have to do this this way because otherwise it errors
274271
if ($assigned_to) {
275-
return $assigned_to->assetLoc();
272+
return $assigned_to->assetLoc($iterations + 1, $first_asset);
276273
} // Recurse until we have a final location
277274
}
278275
if ($this->assignedType() == self::LOCATION) {

config/version.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22
return array (
3-
'app_version' => 'v4.1.6',
4-
'full_app_version' => 'v4.1.6 - build 2994-g83c8449',
5-
'build_version' => '2994',
3+
'app_version' => 'v4.1.7',
4+
'full_app_version' => 'v4.1.7 - build 3031-g4f3c932',
5+
'build_version' => '3031',
66
'prerelease_version' => '',
7-
'hash_version' => 'g83c8449',
8-
'full_hash' => 'v4.1.6-2994-g83c8449',
9-
'branch' => 'master'
7+
'hash_version' => 'g4f3c932',
8+
'full_hash' => 'v4.1.6-37-g4f3c932',
9+
'branch' => 'master',
1010
);

0 commit comments

Comments
 (0)