Minor fixes

This commit is contained in:
Hillel Coren 2015-08-03 22:08:07 +03:00
parent 5aa64523dc
commit 4b7d143630
11 changed files with 22 additions and 16 deletions

View File

@ -62,7 +62,7 @@ class AuthController extends Controller {
$userId = Auth::check() ? Auth::user()->id : null;
$user = User::where('email', '=', $request->input('email'))->first();
if ($user->failed_logins >= 3) {
if ($user && $user->failed_logins >= 3) {
Session::flash('error', 'These credentials do not match our records.');
return redirect()->to('login');
}

View File

@ -382,10 +382,6 @@ class UserController extends BaseController
public function manageCompanies()
{
$data = [
];
return View::make('users.account_management', $data);
return View::make('users.account_management');
}
}

View File

@ -3,6 +3,7 @@
use Auth;
use Cache;
use DB;
use App;
use Schema;
use Session;
use Request;
@ -69,6 +70,11 @@ class Utils
return Auth::check() && Auth::user()->isPro();
}
public static function isEnglish()
{
return App::getLocale() == 'en';
}
public static function getUserType()
{
if (Utils::isNinja()) {

View File

@ -147,7 +147,7 @@ class Account extends Eloquent
public function getLogoPath()
{
$fileName = 'logo/' . $this->account_key;
return file_exists($fileName.'.png') ? $fileName.'.png' : $fileName.'.jpg';
return file_exists($fileName.'.png') && $this->utf8_invoices ? $fileName.'.png' : $fileName.'.jpg';
}
public function getLogoWidth()

View File

@ -6,7 +6,7 @@ use Session;
use Utils;
use DB;
use stdClass;
use Schema;
use App\Models\AccountGateway;
use App\Models\Invitation;
use App\Models\Invoice;
@ -250,6 +250,10 @@ class AccountRepository
public function findUserAccounts($userId1, $userId2 = false)
{
if (!Schema::hasTable('user_accounts')) {
return false;
}
$query = UserAccount::where('user_id1', '=', $userId1)
->orWhere('user_id2', '=', $userId1)
->orWhere('user_id3', '=', $userId1)

View File

@ -29884,7 +29884,7 @@ function generatePDF(invoice, javascript, force, cb) {
if (!invoice || !javascript) {
return;
}
console.log('== generatePDF - force: %s', force);
//console.log('== generatePDF - force: %s', force);
if (force || !invoiceOld) {
refreshTimer = null;
} else {

View File

@ -13,7 +13,7 @@ function generatePDF(invoice, javascript, force, cb) {
if (!invoice || !javascript) {
return;
}
console.log('== generatePDF - force: %s', force);
//console.log('== generatePDF - force: %s', force);
if (force || !invoiceOld) {
refreshTimer = null;
} else {

View File

@ -51,7 +51,7 @@
@if (file_exists($account->getLogoPath()))
<center>
{!! HTML::image($account->getLogoPath().'?no_cache='.time(), "Logo") !!} &nbsp;
{!! HTML::image($account->getLogoPath().'?no_cache='.time(), 'Logo', ['width' => 200]) !!} &nbsp;
<a href="#" onclick="deleteLogo()">{{ trans('texts.remove_logo') }}</a>
</center><br/>
@endif

View File

@ -253,12 +253,12 @@
}, 2000);
$('#search').blur(function(){
$('#search').css('width', '150px');
$('#search').css('width', '{{ Utils::isEnglish() ? 150 : 100 }}px');
$('ul.navbar-right').show();
});
$('#search').focus(function(){
$('#search').css('width', '256px');
$('#search').css('width', '{{ Utils::isEnglish() ? 256 : 206 }}px');
$('ul.navbar-right').hide();
if (!window.hasOwnProperty('searchData')) {
$.get('{{ URL::route('getSearchData') }}', function(data) {
@ -461,7 +461,7 @@
<form class="navbar-form navbar-right" role="search">
<div class="form-group">
<input type="text" id="search" style="width: 150px"
<input type="text" id="search" style="width: {{ Utils::isEnglish() ? 150 : 100 }}px"
class="form-control" placeholder="{{ trans('texts.search') }}">
</div>
</form>

View File

@ -94,7 +94,7 @@
{!! Former::text('end_date')->data_bind("datePicker: end_date, valueUpdate: 'afterkeydown'")
->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT, DEFAULT_DATE_PICKER_FORMAT))->append('<i class="glyphicon glyphicon-calendar" onclick="toggleDatePicker(\'end_date\')"></i>') !!}
</div>
@if ($invoice && $invoice->recurring_invoice_id)
@if ($invoice && $invoice->recurring_invoice)
<div class="pull-right" style="padding-top: 6px">
{!! trans('texts.created_by_recurring', ['invoice' => link_to('/invoices/'.$invoice->recurring_invoice->public_id, $invoice->recurring_invoice->invoice_number)]) !!}
</div>

View File

@ -1,5 +1,5 @@
<li style="margin-top: 4px; margin-bottom: 4px; min-width: 220px; cursor: pointer">
@if (isset($user_id))
@if (isset($user_id) && $user_id != Auth::user()->id)
<a href="{{ URL::to("/switch_account/{$user_id}") }}">
@else
<a href="{{ URL::to("/company/details") }}">