mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Adding ability to remove ninja logo
This commit is contained in:
parent
8fdb122224
commit
5b323e04d7
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,7 +4,6 @@
|
|||||||
/app/config/ubuntu
|
/app/config/ubuntu
|
||||||
/app/config/packages/anahkiasen/rocketeer/
|
/app/config/packages/anahkiasen/rocketeer/
|
||||||
/app/storage
|
/app/storage
|
||||||
/public/logo
|
|
||||||
/public/build
|
/public/build
|
||||||
/public/vendor
|
/public/vendor
|
||||||
/bootstrap/compiled.php
|
/bootstrap/compiled.php
|
||||||
|
@ -70,9 +70,73 @@ class AccountController extends \BaseController {
|
|||||||
|
|
||||||
$account = Auth::user()->account;
|
$account = Auth::user()->account;
|
||||||
|
|
||||||
$client = new Client;
|
$ninjaAccount = $this->getNinjaAccount();
|
||||||
|
$ninjaClient = $this->getNinjaClient($ninjaAccount);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getNinjaAccount()
|
||||||
|
{
|
||||||
|
$account = Account::whereAccountKey(NINJA_ACCOUNT_KEY)->first();
|
||||||
|
|
||||||
|
if ($account)
|
||||||
|
{
|
||||||
|
return $account;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$account = new Account();
|
||||||
|
$account->name = 'Invoice Ninja';
|
||||||
|
$account->work_email = 'contact@invoiceninja.com';
|
||||||
|
$account->work_phone = '(800) 763-1948';
|
||||||
|
$account->account_key = NINJA_ACCOUNT_KEY;
|
||||||
|
$account->save();
|
||||||
|
|
||||||
|
$random = str_random(RANDOM_KEY_LENGTH);
|
||||||
|
|
||||||
|
$user = new User();
|
||||||
|
$user->email = 'contact@invoiceninja.com';
|
||||||
|
$user->password = $random;
|
||||||
|
$user->password_confirmation = $random;
|
||||||
|
$user->username = $random;
|
||||||
|
$user->notify_sent = false;
|
||||||
|
$user->notify_paid = false;
|
||||||
|
$account->users()->save($user);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $account;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getNinjaClient($ninjaAccount)
|
||||||
|
{
|
||||||
|
$client = Client::whereAccountId($ninjaAccount->id)->wherePublicId(Auth::user()->account_id)->first();
|
||||||
|
|
||||||
|
if ($client)
|
||||||
|
{
|
||||||
|
return $client;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$client = new Client;
|
||||||
|
$client->public_id = Auth::user()->account_id;
|
||||||
|
$client->user_id = $ninjaAccount->users()->first()->id;
|
||||||
|
foreach (['name', 'address1', 'address2', 'city', 'state', 'postal_code', 'country_id', 'work_phone'] as $field)
|
||||||
|
{
|
||||||
|
$client->$field = Auth::user()->account->$field;
|
||||||
|
}
|
||||||
|
$ninjaAccount->clients()->save($client);
|
||||||
|
|
||||||
|
$contact = new Contact;
|
||||||
|
$contact->user_id = $ninjaAccount->users()->first()->id;
|
||||||
|
$contact->is_primary = true;
|
||||||
|
foreach (['first_name', 'last_name', 'email', 'phone'] as $field)
|
||||||
|
{
|
||||||
|
$contact->$field = Auth::user()->$field;
|
||||||
|
}
|
||||||
|
$client->contacts()->save($contact);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTrashVisible($entityType, $visible)
|
public function setTrashVisible($entityType, $visible)
|
||||||
|
@ -14,7 +14,7 @@ class AddProPlan extends Migration {
|
|||||||
{
|
{
|
||||||
Schema::table('accounts', function($table)
|
Schema::table('accounts', function($table)
|
||||||
{
|
{
|
||||||
$table->timestamp('pro_plan_paid');
|
$table->date('pro_plan_paid');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,18 @@ class User extends ConfideUser implements UserInterface, RemindableInterface
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->account->pro_plan_paid;
|
$datePaid = $this->account->pro_plan_paid;
|
||||||
|
|
||||||
|
if (!$datePaid || $datePaid == '0000-00-00')
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$today = new DateTime('now');
|
||||||
|
$datePaid = DateTime::createFromFormat('Y-m-d', $datePaid);
|
||||||
|
$interval = $today->diff($datePaid);
|
||||||
|
|
||||||
|
return $interval->y == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showGreyBackground()
|
public function showGreyBackground()
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Application Routes
|
| Application Routes
|
||||||
@ -240,6 +239,7 @@ define('DEFAULT_QUERY_CACHE', 120); // minutes
|
|||||||
define('DEFUALT_LOCALE', 'en');
|
define('DEFUALT_LOCALE', 'en');
|
||||||
|
|
||||||
define('GATEWAY_PAYPAL_EXPRESS', 17);
|
define('GATEWAY_PAYPAL_EXPRESS', 17);
|
||||||
|
define('NINJA_ACCOUNT_KEY', 'zg4ylmzDkdkPOT8yoKQw9LTWaoZJx79h');
|
||||||
|
|
||||||
|
|
||||||
if (Auth::check() && !Session::has(SESSION_TIMEZONE))
|
if (Auth::check() && !Session::has(SESSION_TIMEZONE))
|
||||||
|
BIN
public/logo/zg4ylmzDkdkPOT8yoKQw9LTWaoZJx79h.jpg
Normal file
BIN
public/logo/zg4ylmzDkdkPOT8yoKQw9LTWaoZJx79h.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
Loading…
x
Reference in New Issue
Block a user