Added company website

This commit is contained in:
Hillel Coren 2015-12-14 23:05:17 +02:00
parent c5c5ff3458
commit e893d74b41
10 changed files with 31 additions and 4 deletions

View File

@ -642,6 +642,7 @@ class AccountController extends BaseController
$account->id_number = trim(Input::get('id_number')); $account->id_number = trim(Input::get('id_number'));
$account->vat_number = trim(Input::get('vat_number')); $account->vat_number = trim(Input::get('vat_number'));
$account->work_email = trim(Input::get('work_email')); $account->work_email = trim(Input::get('work_email'));
$account->website = trim(Input::get('website'));
$account->work_phone = trim(Input::get('work_phone')); $account->work_phone = trim(Input::get('work_phone'));
$account->address1 = trim(Input::get('address1')); $account->address1 = trim(Input::get('address1'));
$account->address2 = trim(Input::get('address2')); $account->address2 = trim(Input::get('address2'));

View File

@ -66,7 +66,7 @@ class PublicClientController extends BaseController
return trans("texts.activity_{$model->activity_type_id}", $data); return trans("texts.activity_{$model->activity_type_id}", $data);
}) })
->addColumn('balance', function ($model) { return Utils::formatMoney($model->balance, $model->currency_id, $model->country_id); }) ->addColumn('balance', function ($model) { return Utils::formatMoney($model->balance, $model->currency_id, $model->country_id); })
->addColumn('adjustment', function ($model) { return $model->adjustment != 0 ? Utils::wrapAdjustment($model->adjustment, $model->currency_id) : ''; }) ->addColumn('adjustment', function ($model) { return $model->adjustment != 0 ? Utils::wrapAdjustment($model->adjustment, $model->currency_id, $model->country_id) : ''; })
->make(); ->make();
} }

View File

@ -887,4 +887,14 @@ class Utils
return $interval->y == 0; return $interval->y == 0;
} }
public static function addHttp($url)
{
if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
$url = "http://" . $url;
}
return $url;
}
} }

View File

@ -1,5 +1,6 @@
<?php namespace App\Ninja\Presenters; <?php namespace App\Ninja\Presenters;
use Utils;
use Laracasts\Presenter\Presenter; use Laracasts\Presenter\Presenter;
class AccountPresenter extends Presenter { class AccountPresenter extends Presenter {
@ -9,4 +10,8 @@ class AccountPresenter extends Presenter {
return $this->entity->name ?: trans('texts.untitled_account'); return $this->entity->name ?: trans('texts.untitled_account');
} }
public function website()
{
return Utils::addHttp($this->entity->website);
}
} }

View File

@ -31287,6 +31287,7 @@ NINJA.accountDetails = function(invoice) {
{text:account.name, style: ['accountName']}, {text:account.name, style: ['accountName']},
{text:account.id_number}, {text:account.id_number},
{text:account.vat_number}, {text:account.vat_number},
{text:account.website},
{text:account.work_email}, {text:account.work_email},
{text:account.work_phone} {text:account.work_phone}
]; ];

View File

@ -408,6 +408,7 @@ NINJA.accountDetails = function(invoice) {
{text:account.name, style: ['accountName']}, {text:account.name, style: ['accountName']},
{text:account.id_number}, {text:account.id_number},
{text:account.vat_number}, {text:account.vat_number},
{text:account.website},
{text:account.work_email}, {text:account.work_email},
{text:account.work_phone} {text:account.work_phone}
]; ];

View File

@ -48,7 +48,7 @@ There are two options:
### Documentation ### Documentation
* [Ubuntu and Apache](http://blog.technerdservices.com/index.php/2015/04/techpop-how-to-install-invoice-ninja-on-ubuntu-14-04/) * [Ubuntu and Apache](http://blog.technerdservices.com/index.php/2015/04/techpop-how-to-install-invoice-ninja-on-ubuntu-14-04/)
* [Debian and Nginx](https://www.rosehosting.com/blog/install-invoice-ninja-on-a-debian-7-vps/) * [Debian and Nginx](https://www.rosehosting.com/blog/install-invoice-ninja-on-a-debian-7-vps/)
* [User Guide](https://www.invoiceninja.com/user-guide/) * [User Guide](https://www.invoiceninja.com/app-user-guide/)
* [Developer Guide](https://www.invoiceninja.com/knowledgebase/developer-guide/) * [Developer Guide](https://www.invoiceninja.com/knowledgebase/developer-guide/)
* [API Documentation](https://www.invoiceninja.com/knowledgebase/api-documentation/) * [API Documentation](https://www.invoiceninja.com/knowledgebase/api-documentation/)
* [Support Forum](https://www.invoiceninja.com/forums/forum/support/) * [Support Forum](https://www.invoiceninja.com/forums/forum/support/)

View File

@ -22,7 +22,7 @@
->addClass('warn-on-exit') ->addClass('warn-on-exit')
->autocomplete('on') ->autocomplete('on')
->rules([ ->rules([
'name' => 'required' 'name' => 'required',
]) !!} ]) !!}
{{ Former::populate($account) }} {{ Former::populate($account) }}
@ -41,6 +41,7 @@
{!! Former::text('name') !!} {!! Former::text('name') !!}
{!! Former::text('id_number') !!} {!! Former::text('id_number') !!}
{!! Former::text('vat_number') !!} {!! Former::text('vat_number') !!}
{!! Former::text('website') !!}
{!! Former::text('work_email') !!} {!! Former::text('work_email') !!}
{!! Former::text('work_phone') !!} {!! Former::text('work_phone') !!}
{!! Former::file('logo')->max(2, 'MB')->accept('image')->inlineHelp(trans('texts.logo_help')) !!} {!! Former::file('logo')->max(2, 'MB')->accept('image')->inlineHelp(trans('texts.logo_help')) !!}

View File

@ -71,7 +71,7 @@
@endif @endif
@if ($account->website) @if ($account->website)
<strong><a href="{{ $account->website }}" style="color: #A7A6A6; text-decoration: none; font-weight: bold; font-size: 10px;">{{ $account->website }}</a></strong> <strong><a href="{{ $account->present()->website }}" style="color: #A7A6A6; text-decoration: none; font-weight: bold; font-size: 10px;">{{ $account->website }}</a></strong>
@endif @endif
</p> </p>
</td> </td>

View File

@ -24,6 +24,8 @@
div.address-details { div.address-details {
color: #666666; color: #666666;
font-size: 15px;
line-height: 1.8em;
} }
div.col-md-4-left { div.col-md-4-left {
@ -108,8 +110,14 @@
@if ($account->getCityState()) @if ($account->getCityState())
{{ $account->getCityState() }}<br/> {{ $account->getCityState() }}<br/>
@endif @endif
@if ($account->country)
{{ $account->country->name }}
@endif
</div> </div>
<div class="col-md-3 address-details"> <div class="col-md-3 address-details">
@if ($account->website)
<i class="fa fa-globe" style="width: 20px"></i><a href="{{ $account->website }}" target="_blank">{{ $account->website }}</a><br/>
@endif
@if ($account->work_phone) @if ($account->work_phone)
<i class="fa fa-phone" style="width: 20px"></i>{{ $account->work_phone }}<br/> <i class="fa fa-phone" style="width: 20px"></i>{{ $account->work_phone }}<br/>
@endif @endif