diff --git a/app/Http/Controllers/AccountGatewayController.php b/app/Http/Controllers/AccountGatewayController.php index 1634ca5f6004..489b2fb2d65c 100644 --- a/app/Http/Controllers/AccountGatewayController.php +++ b/app/Http/Controllers/AccountGatewayController.php @@ -101,23 +101,6 @@ class AccountGatewayController extends BaseController $selectedCards = $accountGateway ? $accountGateway->accepted_credit_cards : 0; $account = Auth::user()->account; - // $recommendedGateways = Gateway::remember(DEFAULT_QUERY_CACHE) - // ->where('recommended', '=', '1') - $recommendedGateways = Gateway::where('recommended', '=', '1') - ->orderBy('sort_order') - ->get(); - $recommendedGatewayArray = array(); - - foreach ($recommendedGateways as $recommendedGateway) { - $arrayItem = array( - 'value' => $recommendedGateway->id, - 'other' => 'false', - 'data-imageUrl' => asset($recommendedGateway->getLogoUrl()), - 'data-siteUrl' => $recommendedGateway->site_url, - ); - $recommendedGatewayArray[$recommendedGateway->name] = $arrayItem; - } - $creditCardsArray = unserialize(CREDIT_CARDS); $creditCards = []; foreach ($creditCardsArray as $card => $name) { @@ -128,14 +111,6 @@ class AccountGatewayController extends BaseController } } - $otherItem = array( - 'value' => 1000000, - 'other' => 'true', - 'data-imageUrl' => '', - 'data-siteUrl' => '', - ); - $recommendedGatewayArray['Other Options'] = $otherItem; - $account->load('account_gateways'); $currentGateways = $account->account_gateways; $gateways = Gateway::where('payment_library_id', '=', 1)->orderBy('name'); @@ -172,7 +147,6 @@ class AccountGatewayController extends BaseController 'accountGateway' => $accountGateway, 'config' => false, 'gateways' => $gateways, - 'recommendedGateways' => $recommendedGatewayArray, 'creditCardTypes' => $creditCards, 'tokenBillingOptions' => $tokenBillingOptions, 'showBreadcrumbs' => false, @@ -200,9 +174,7 @@ class AccountGatewayController extends BaseController public function save($accountGatewayPublicId = false) { $rules = array(); - $recommendedId = Input::get('recommendedGateway_id'); - - $gatewayId = ($recommendedId == 1000000 ? Input::get('gateway_id') : $recommendedId); + $gatewayId = Input::get('gateway_id'); if (!$gatewayId) { Session::flash('error', trans('validation.required', ['attribute' => 'gateway'])); diff --git a/app/Http/Controllers/ProductController.php b/app/Http/Controllers/ProductController.php index b35939ae1b5a..d971115b22f1 100644 --- a/app/Http/Controllers/ProductController.php +++ b/app/Http/Controllers/ProductController.php @@ -6,6 +6,12 @@ use DB; use Datatable; use Utils; use URL; +use View; +use Input; +use Session; +use Redirect; + +use App\Models\Product; class ProductController extends BaseController { diff --git a/database/seeds/ConstantsSeeder.php b/database/seeds/ConstantsSeeder.php index 5cbf0a615a4b..8fd7ba694289 100644 --- a/database/seeds/ConstantsSeeder.php +++ b/database/seeds/ConstantsSeeder.php @@ -174,6 +174,7 @@ class ConstantsSeeder extends Seeder DateFormat::create(array('format' => 'Y-M-d', 'picker_format' => 'yyyy-M-dd', 'label' => '2013-03-10')); PaymentLibrary::create(['name' => 'Omnipay']); + PaymentLibrary::create(['name' => 'PHP-Payments [Deprecated]']); /* d, dd: Numeric date, no leading zero and leading zero, respectively. Eg, 5, 05. diff --git a/resources/views/accounts/account_gateway.blade.php b/resources/views/accounts/account_gateway.blade.php index 81f4f65dca35..8bc3a53b1632 100644 --- a/resources/views/accounts/account_gateway.blade.php +++ b/resources/views/accounts/account_gateway.blade.php @@ -22,26 +22,11 @@ @endif @endif -
- {!! Former::checkboxes('creditCardTypes[]')->label('Accepted Credit Cards') - ->checkboxes($creditCardTypes)->class('creditcard-types') - !!} -
- -

 

-

-
- {!! Former::radios('recommendedGateway_id')->label('Recommended Gateway') - ->radios($recommendedGateways)->class('recommended-gateway') - !!} -
- {!! Former::select('gateway_id')->label('Select Gateway')->addOption('', '') ->dataClass('gateway-dropdown') ->fromQuery($gateways, 'name', 'id') ->onchange('setFieldsShown()'); !!} -
@foreach ($gateways as $gateway) @@ -64,7 +49,7 @@
- {{ $gateway->getHelp() }} + {!! $gateway->getHelp() !!}
@endif @@ -76,30 +61,25 @@ @endforeach + {!! Former::checkboxes('creditCardTypes[]')->label('Accepted Credit Cards') + ->checkboxes($creditCardTypes)->class('creditcard-types') + !!} + +

 

{!! Former::actions( - Button::success('Save')->submit()->large()->appendIcon(Icon::create('floppy-disk')), - $countGateways > 0 ? Button::lg_default_link('company/payments', 'Cancel')->append_with_icon('remove-circle') : false) !!} + Button::success(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk')), + $countGateways > 0 ? Button::normal(trans('texts.cancel'))->large()->asLinkTo('/company/payments')->appendIcon(Icon::create('remove-circle')) : false) !!} {!! Former::close() !!} @stop \ No newline at end of file diff --git a/resources/views/accounts/details.blade.php b/resources/views/accounts/details.blade.php index 5a60160afbac..f1a944b3b05a 100644 --- a/resources/views/accounts/details.blade.php +++ b/resources/views/accounts/details.blade.php @@ -62,9 +62,11 @@ {!! Former::legend('users') !!} {!! Former::text('first_name') !!} {!! Former::text('last_name') !!} - {!! Former::text('email') !!} + {!! Former::text('email') !!} {!! Former::text('phone') !!} - {!! Former::actions(Button::primary(trans('texts.change_password'), ['onclick'=>'showChangePassword()']))->small() !!} + @if (Auth::user()->confirmed) + {!! Former::actions( Button::primary(trans('texts.change_password'))->small()->withAttributes(['onclick'=>'showChangePassword()'])) !!} + @endif @endif {!! Former::legend('localization') !!} diff --git a/resources/views/accounts/product.blade.php b/resources/views/accounts/product.blade.php index 9fe08652c237..387926b230ea 100644 --- a/resources/views/accounts/product.blade.php +++ b/resources/views/accounts/product.blade.php @@ -3,28 +3,28 @@ @section('content') @parent - {{ Former::open($url)->method($method) + {!! Former::open($url)->method($method) ->rules(['product_key' => 'required|max:20']) - ->addClass('col-md-8 col-md-offset-2 warn-on-exit') }} + ->addClass('col-md-8 col-md-offset-2 warn-on-exit') !!} - {{ Former::legend($title) }} + {!! Former::legend($title) !!} @if ($product) {{ Former::populate($product) }} {{ Former::populateField('cost', number_format($product->cost, 2, '.', '')) }} @endif - {{ Former::text('product_key')->label('texts.product') }} - {{ Former::textarea('notes')->data_bind("value: wrapped_notes, valueUpdate: 'afterkeydown'") }} - {{ Former::text('cost') }} + {!! Former::text('product_key')->label('texts.product') !!} + {!! Former::textarea('notes')->data_bind("value: wrapped_notes, valueUpdate: 'afterkeydown'") !!} + {!! Former::text('cost') !!} - {{ Former::actions( - Button::lg_success_submit(trans('texts.save'))->append_with_icon('floppy-disk'), - Button::lg_default_link('company/products', trans('texts.cancel'))->append_with_icon('remove-circle') - ) }} + {!! Former::actions( + Button::success(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk')), + Button::normal(trans('texts.cancel'))->large()->asLinkTo('/company/products')->appendIcon(Icon::create('remove-circle')) + ) !!} - {{ Former::close() }} + {!! Former::close() !!}