Fix for links when public/ is in URL

This commit is contained in:
Hillel Coren 2016-04-13 12:57:03 +03:00
parent cd2c992158
commit b6fa4620b9
3 changed files with 8 additions and 7 deletions

View File

@ -9,6 +9,7 @@ use Session;
use Utils; use Utils;
use Validator; use Validator;
use View; use View;
use URL;
use stdClass; use stdClass;
use Cache; use Cache;
use Response; use Response;
@ -234,7 +235,7 @@ class AccountController extends BaseController
{ {
$oauthLoginUrls = []; $oauthLoginUrls = [];
foreach (AuthService::$providers as $provider) { foreach (AuthService::$providers as $provider) {
$oauthLoginUrls[] = ['label' => $provider, 'url' => '/auth/'.strtolower($provider)]; $oauthLoginUrls[] = ['label' => $provider, 'url' => URL::to('/auth/'.strtolower($provider))];
} }
$data = [ $data = [

View File

@ -112,10 +112,10 @@ class ClientController extends BaseController
$actionLinks = []; $actionLinks = [];
if(Task::canCreate()){ if(Task::canCreate()){
$actionLinks[] = ['label' => trans('texts.new_task'), 'url' => '/tasks/create/'.$client->public_id]; $actionLinks[] = ['label' => trans('texts.new_task'), 'url' => URL::to('/tasks/create/'.$client->public_id)];
} }
if (Utils::isPro() && Invoice::canCreate()) { if (Utils::isPro() && Invoice::canCreate()) {
$actionLinks[] = ['label' => trans('texts.new_quote'), 'url' => '/quotes/create/'.$client->public_id]; $actionLinks[] = ['label' => trans('texts.new_quote'), 'url' => URL::to('/quotes/create/'.$client->public_id)];
} }
if(!empty($actionLinks)){ if(!empty($actionLinks)){
@ -123,15 +123,15 @@ class ClientController extends BaseController
} }
if(Payment::canCreate()){ if(Payment::canCreate()){
$actionLinks[] = ['label' => trans('texts.enter_payment'), 'url' => '/payments/create/'.$client->public_id]; $actionLinks[] = ['label' => trans('texts.enter_payment'), 'url' => URL::to('/payments/create/'.$client->public_id)];
} }
if(Credit::canCreate()){ if(Credit::canCreate()){
$actionLinks[] = ['label' => trans('texts.enter_credit'), 'url' => '/credits/create/'.$client->public_id]; $actionLinks[] = ['label' => trans('texts.enter_credit'), 'url' => URL::to('/credits/create/'.$client->public_id)];
} }
if(Expense::canCreate()){ if(Expense::canCreate()){
$actionLinks[] = ['label' => trans('texts.enter_expense'), 'url' => '/expenses/create/0/'.$client->public_id]; $actionLinks[] = ['label' => trans('texts.enter_expense'), 'url' => URL::to('/expenses/create/0/'.$client->public_id)];
} }
$data = array( $data = array(

View File

@ -107,7 +107,7 @@ class VendorController extends BaseController
Utils::trackViewed($vendor->getDisplayName(), 'vendor'); Utils::trackViewed($vendor->getDisplayName(), 'vendor');
$actionLinks = [ $actionLinks = [
['label' => trans('texts.new_vendor'), 'url' => '/vendors/create/' . $vendor->public_id] ['label' => trans('texts.new_vendor'), 'url' => URL::to('/vendors/create/' . $vendor->public_id)]
]; ];
$data = array( $data = array(