Skip to content

Commit

Permalink
Merge pull request #374 from eve-seat/dev
Browse files Browse the repository at this point in the history
Merge v0.14.0 into master
  • Loading branch information
eve-seat committed Mar 5, 2015
2 parents af211fd + 5dd34f8 commit ef31167
Show file tree
Hide file tree
Showing 103 changed files with 3,256 additions and 1,409 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
* text=auto
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## SeAT - Simple (or Stupid) EVE Online API Tool ##
[![Latest Stable Version](https://poser.pugx.org/eve-seat/seat/v/stable.svg)](https://packagist.org/packages/eve-seat/seat) [![Total Downloads](https://poser.pugx.org/eve-seat/seat/downloads.svg)](https://packagist.org/packages/eve-seat/seat) [![Latest Unstable Version](https://poser.pugx.org/eve-seat/seat/v/unstable.svg)](https://packagist.org/packages/eve-seat/seat) [![License](https://poser.pugx.org/eve-seat/seat/license.svg)](https://packagist.org/packages/eve-seat/seat)
[![Latest Stable Version](https://poser.pugx.org/eve-seat/seat/v/stable.svg)](https://packagist.org/packages/eve-seat/seat) [![Latest Unstable Version](https://poser.pugx.org/eve-seat/seat/v/unstable.svg)](https://packagist.org/packages/eve-seat/seat) [![License](https://poser.pugx.org/eve-seat/seat/license.svg)](https://packagist.org/packages/eve-seat/seat)

##### *SeAT is still under heavy development and is not considered 100% stable yet. USE AT YOUR OWN RISK* #####

Expand Down
10 changes: 5 additions & 5 deletions app/commands/SeatAPIUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ public function fire()

// Call the addToQueue helper to queue jobs for
// the EVE Server, Map and General EVE info
\App\Services\Queue\QueueHelper::addToQueue(array('Full', 'Server'), 0, NULL, 'ServerStatus', 'Server');
\App\Services\Queue\QueueHelper::addToQueue(array('Full', 'Map'), 0, NULL, 'Map', 'Eve');
\App\Services\Queue\QueueHelper::addToQueue(array('Full', 'Eve'), 0, NULL, 'Eve', 'Eve');
\App\Services\Queue\QueueHelper::addToQueue('\Seat\EveQueues\Full\Server', 0, NULL, 'ServerStatus', 'Server');
\App\Services\Queue\QueueHelper::addToQueue('\Seat\EveQueues\Full\Map', 0, NULL, 'Map', 'Eve');
\App\Services\Queue\QueueHelper::addToQueue('\Seat\EveQueues\Full\Eve', 0, NULL, 'Eve', 'Eve');

// Log the start of the key processing
\Log::info('Starting job submissions for all keys', array('src' => __CLASS__));
Expand Down Expand Up @@ -105,11 +105,11 @@ public function fire()

// Do a fresh AccountStatus lookup
Account\AccountStatus::update($key->keyID, $key->vCode);
\App\Services\Queue\QueueHelper::addToQueue(array('Full', 'Character'), $key->keyID, $key->vCode, 'Character', 'Eve');
\App\Services\Queue\QueueHelper::addToQueue('\Seat\EveQueues\Full\Character', $key->keyID, $key->vCode, 'Character', 'Eve');
break;

case 'Corporation':
\App\Services\Queue\QueueHelper::addToQueue(array('Full', 'Corporation'), $key->keyID, $key->vCode, 'Corporation', 'Eve');
\App\Services\Queue\QueueHelper::addToQueue('\Seat\EveQueues\Full\Corporation', $key->keyID, $key->vCode, 'Corporation', 'Eve');
break;

default:
Expand Down
17 changes: 8 additions & 9 deletions app/commands/SeatDiagnose.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,20 @@ public function fire()
$this->info('Running SeAT ' . \Config::get('seat.version') . ' Diagnostics');
$this->line('');

// It is important to run the command as the user that the
// workers are running as. This allows for the checks
// for file permissions to logs to be checked
// correctly. Lets notify the user about
// this
$this->comment('If you are not already doing so, it is reccomended that you run this as the user the workers are running as.');
$this->comment('Eg: `sudo -u apache /usr/bin/php /var/www/seat/artisan seat:diagnose`.');
$this->comment('This allows you to ensure the correct permissions are in place as required.');
// It is important to run the command as the user that the workers are running as.
// This way, the checks that ensure file permissions are right are executed
// properly. If this is not the case, notify the user

$this->comment('If you are not already doing so, it is recommended that you run this as the user the workers are running as.');
$this->comment('Eg: `sudo -u apache php artisan seat:diagnose`.');
$this->comment('This helps to check whether the permissions are correct.');
$this->line('');

// Go ahead and get the configuration information using
// the \Config helper and print that
$this->info('SeAT configuration:');
if (\Config::get('app.debug'))
$this->comment('[warning] Debug Mode On: Yes. It is reccomended that you set this to false in app/config/app.php');
$this->comment('[warning] Debug Mode On: Yes. It is recommended that you set this to false in app/config/app.php');
else
$this->line('[ok] Debug Mode On: No');
$this->line('Url: ' . \Config::get('app.url'));
Expand Down
2 changes: 1 addition & 1 deletion app/config/seat.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
|
*/

'version' => '0.13.0',
'version' => '0.14.0',

/*
|--------------------------------------------------------------------------
Expand Down
24 changes: 24 additions & 0 deletions app/controllers/CharacterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ public function getAjaxCharacterSheet($characterID)
$jump_clones = DB::table(DB::raw('character_charactersheet_jumpclones as a'))
->select(DB::raw("
*, CASE
when a.locationID BETWEEN 66015148 AND 66015151 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.locationID-6000000)
when a.locationID BETWEEN 66000000 AND 66014933 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.locationID-6000001)
Expand Down Expand Up @@ -490,6 +493,9 @@ public function getAjaxAssets($characterID)
$assets = DB::table(DB::raw('character_assetlist as a'))
->select(DB::raw("
*, CASE
when a.locationID BETWEEN 66015148 AND 66015151 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.locationID-6000000)
when a.locationID BETWEEN 66000000 AND 66014933 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.locationID-6000001)
Expand Down Expand Up @@ -631,6 +637,9 @@ public function getAjaxContracts($characterID)
$contract_list = DB::table(DB::raw('character_contracts as a'))
->select(DB::raw(
"*, CASE
when a.startStationID BETWEEN 66015148 AND 66015151 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.startStationID-6000000)
when a.startStationID BETWEEN 66000000 AND 66014933 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.startStationID-6000001)
Expand All @@ -650,6 +659,9 @@ public function getAjaxContracts($characterID)
WHERE m.itemID=a.startStationID) end
AS startlocation,
CASE
when a.endstationID BETWEEN 66015148 AND 66015151 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.endStationID-6000000)
when a.endStationID BETWEEN 66000000 AND 66014933 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.endStationID-6000001)
Expand Down Expand Up @@ -775,6 +787,9 @@ public function getAjaxMarketOrders($characterID)
$market_orders = DB::table(DB::raw('character_marketorders as a'))
->select(DB::raw(
"*, CASE
when a.stationID BETWEEN 66015148 AND 66015151 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.stationID-6000000)
when a.stationID BETWEEN 66000000 AND 66014933 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.stationID-6000001)
Expand Down Expand Up @@ -1290,6 +1305,9 @@ public function postSearchAssets()
$assets = DB::table(DB::raw('character_assetlist as a'))
->select(DB::raw(
"*, CASE
when a.locationID BETWEEN 66015148 AND 66015151 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.locationID-6000000)
when a.locationID BETWEEN 66000000 AND 66014933 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.locationID-6000001)
Expand Down Expand Up @@ -1385,6 +1403,9 @@ public function getAjaxIndustry($characterID)
$current_jobs = DB::table('character_industryjobs as a')
->select(DB::raw("
*, CASE
when a.stationID BETWEEN 66015148 AND 66015151 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.stationID-6000000)
when a.stationID BETWEEN 66000000 AND 66014933 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.stationID-6000001)
Expand Down Expand Up @@ -1412,6 +1433,9 @@ public function getAjaxIndustry($characterID)
$finished_jobs = DB::table('character_industryjobs as a')
->select(DB::raw("
*, CASE
when a.stationID BETWEEN 66015148 AND 66015151 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.stationID-6000000)
when a.stationID BETWEEN 66000000 AND 66014933 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.stationID-6000001)
Expand Down
87 changes: 85 additions & 2 deletions app/controllers/CorporationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,41 @@
class CorporationController extends BaseController
{

/*
|--------------------------------------------------------------------------
| getAll()
|--------------------------------------------------------------------------
|
| Get all of the corporations on record
|
*/
public function getAll()
{

// Query the databse for all the characters and some related
// information
$corporations = DB::table('account_apikeyinfo')
->leftJoin('seat_keys', 'account_apikeyinfo.keyID', '=', 'seat_keys.keyID')
->leftJoin('account_apikeyinfo_characters', 'account_apikeyinfo.keyID', '=', 'account_apikeyinfo_characters.keyID')
->leftJoin('corporation_corporationsheet', 'account_apikeyinfo_characters.corporationID', '=', 'corporation_corporationsheet.corporationID')
->where('account_apikeyinfo.type', '=', 'Corporation')
->orderBy('seat_keys.isOk', 'asc')
->orderBy('account_apikeyinfo_characters.corporationName', 'asc')
->groupBy('account_apikeyinfo_characters.characterID');

// Check that we only return characters that the current
// user has access to. SuperUser() automatically
// inherits all permissions
if (!\Auth::hasAccess('recruiter'))
$corporations = $corporations->whereIn('seat_keys.keyID', Session::get('valid_keys'))
->get();
else
$corporations = $corporations->get();

return View::make('corporation.all')
->with('corporations', $corporations);
}

/*
|--------------------------------------------------------------------------
| getListJournals()
Expand Down Expand Up @@ -239,6 +274,9 @@ public function getAssets($corporationID)
$assets = DB::select(
"SELECT *,
CASE
when a.locationID BETWEEN 66015148 AND 66015151 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.locationID-6000000)
when a.locationID BETWEEN 66000000 AND 66014933 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.locationID-6000001)
Expand Down Expand Up @@ -399,6 +437,9 @@ public function getContracts($corporationID)
// Contract list
$contract_list = DB::select(
'SELECT *, CASE
when a.startStationID BETWEEN 66015148 AND 66015151 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.startStationID-6000000)
when a.startStationID BETWEEN 66000000 AND 66014933 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.startStationID-6000001)
Expand All @@ -418,6 +459,9 @@ public function getContracts($corporationID)
WHERE m.itemID=a.startStationID) end
AS startlocation,
CASE
when a.endStationID BETWEEN 66015148 AND 66015151 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.endStationID-6000000)
when a.endStationID BETWEEN 66000000 AND 66014933 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.endStationID-6000001)
Expand Down Expand Up @@ -1102,6 +1146,11 @@ public function getLedgerSummary($corporationID)
->where('corporation_accountbalance.corporationID', $corporationID)
->get();

$wallet_balances_total = 0;
foreach($wallet_balances as $div) {
$wallet_balances_total += $div->balance;
}

// The overall corporation ledger. We will loop over the wallet divisions
// and get the ledger calculated for each
$ledgers = array();
Expand Down Expand Up @@ -1154,14 +1203,26 @@ public function getLedgerSummary($corporationID)
->orderBy('total', 'desc')
->get();

$incursions_tax = DB::table('corporation_walletjournal')
->select('ownerID2', 'ownerName2', DB::raw('SUM(corporation_walletjournal.amount) total'))
->leftJoin('eve_reftypes', 'corporation_walletjournal.refTypeID', '=', 'eve_reftypes.refTypeID')
->where('corporation_walletjournal.refTypeID', 99) // Ref type id 99: Corporate Reward Payout (yeah, seriously ...)
->where('corporation_walletjournal.ownerName1', "CONCORD") // check if the payout came from CONCORD
->where('corporation_walletjournal.corporationID', $corporationID)
->groupBy('corporation_walletjournal.ownerName2')
->orderBy('total', 'desc')
->get();

return View::make('corporation.ledger.ledger')
->with('corporationID', $corporationID)
->with('ledger_dates', $ledger_dates)
->with('wallet_balances', $wallet_balances)
->with('ledgers', $ledgers)
->with('bounty_tax', $bounty_tax)
->with('mission_tax', $mission_tax)
->with('pi_tax', $pi_tax);
->with('pi_tax', $pi_tax)
->with('incursions_tax', $incursions_tax)
->with('wallet_balances_total', $wallet_balances_total);
}

/*
Expand Down Expand Up @@ -1251,13 +1312,26 @@ public function getLedgerMonth($corporationID, $date)
->orderBy('total', 'desc')
->get();

$incursions_tax = DB::table('corporation_walletjournal')
->select('ownerID2', 'ownerName2', DB::raw('SUM(corporation_walletjournal.amount) total'))
->leftJoin('eve_reftypes', 'corporation_walletjournal.refTypeID', '=', 'eve_reftypes.refTypeID')
->where('corporation_walletjournal.refTypeID', 99) // Ref type id 99: Corporate Reward Payout (yeah, seriously ...)
->where('corporation_walletjournal.ownerName1', "CONCORD") // check if the payout came from CONCORD
->where(DB::raw('MONTH(date)'), $month)
->where(DB::raw('YEAR(date)'), $year)
->where('corporation_walletjournal.corporationID', $corporationID)
->groupBy('corporation_walletjournal.ownerName2')
->orderBy('total', 'desc')
->get();

return View::make('corporation.ledger.ajax.ledgermonth')
->with('corporationID', $corporationID)
->with('date', $date)
->with('ledgers', $ledgers)
->with('bounty_tax', $bounty_tax)
->with('mission_tax', $mission_tax)
->with('pi_tax', $pi_tax);
->with('pi_tax', $pi_tax)
->with('incursions_tax', $incursions_tax);
}

/*
Expand Down Expand Up @@ -1453,6 +1527,9 @@ public function getMarketOrders($corporationID)
// Corporation Market Orders
$market_orders = DB::select(
'SELECT *, CASE
when a.stationID BETWEEN 66015148 AND 66015151 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.stationID-6000000)
when a.stationID BETWEEN 66000000 AND 66014933 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.stationID-6000001)
Expand Down Expand Up @@ -1662,6 +1739,9 @@ public function getIndustry($corporationID)
$current_jobs = DB::table('corporation_industryjobs as a')
->select(DB::raw("
*, CASE
when a.stationID BETWEEN 66015148 AND 66015151 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.stationID-6000000)
when a.stationID BETWEEN 66000000 AND 66014933 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.stationID-6000001)
Expand Down Expand Up @@ -1694,6 +1774,9 @@ public function getIndustry($corporationID)
$finished_jobs = DB::table('corporation_industryjobs as a')
->select(DB::raw("
*, CASE
when a.stationID BETWEEN 66015148 AND 66015151 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.stationID-6000000)
when a.stationID BETWEEN 66000000 AND 66014933 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.stationID-6000001)
Expand Down
6 changes: 6 additions & 0 deletions app/controllers/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public function getSearch()
$character_assets = DB::table(DB::raw('character_assetlist as a'))
->select(DB::raw(
"*, CASE
when a.locationID BETWEEN 66015148 AND 66015151 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.locationID-6000000)
when a.locationID BETWEEN 66000000 AND 66014933 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.locationID-6000001)
Expand Down Expand Up @@ -208,6 +211,9 @@ public function getSearch()
$corporation_assets = DB::table(DB::raw('corporation_assetlist as a'))
->select(DB::raw(
"*, CASE
when a.locationID BETWEEN 66015148 AND 66015151 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.locationID-6000000)
when a.locationID BETWEEN 66000000 AND 66014933 then
(SELECT s.stationName FROM staStations AS s
WHERE s.stationID=a.locationID-6000001)
Expand Down
Loading

0 comments on commit ef31167

Please sign in to comment.