From 673c30456b082b48a538f54ff924e7f72ce0dfdc Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 1 Apr 2014 13:30:43 +0300 Subject: [PATCH] Working on multi-language support --- app/controllers/AccountController.php | 28 ++++--- app/controllers/ClientController.php | 7 +- app/controllers/CreditController.php | 4 +- app/lang/en/texts.php | 89 ++++++++++++++++++++++ app/libraries/utils.php | 7 +- app/models/Activity.php | 2 +- app/routes.php | 2 +- app/views/accounts/details.blade.php | 42 +++++----- app/views/accounts/import_export.blade.php | 10 +-- app/views/accounts/import_map.blade.php | 16 ++-- app/views/accounts/notifications.blade.php | 18 ++--- app/views/clients/show.blade.php | 73 ++++++++++++------ app/views/credits/edit.blade.php | 9 +-- app/views/payments/edit.blade.php | 9 +-- 14 files changed, 216 insertions(+), 100 deletions(-) diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index 31d5bc4a4ec9..2397a18b114d 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -167,9 +167,9 @@ class AccountController extends \BaseController { private function export() { - $output = fopen("php://output",'w') or die("Can't open php://output"); - header("Content-Type:application/csv"); - header("Content-Disposition:attachment;filename=export.csv"); + $output = fopen('php://output','w') or Utils::fatalError(); + header('Content-Type:application/csv'); + header('Content-Disposition:attachment;filename=export.csv'); $clients = Client::scope()->get(); AccountController::exportData($output, $clients->toArray()); @@ -303,14 +303,21 @@ class AccountController extends \BaseController { Activity::createClient($client); } - $message = Utils::pluralize('Successfully created ? client', $count); + $message = Utils::pluralize('created_client', $count); Session::flash('message', $message); return Redirect::to('clients'); } private function mapFile() - { + { $file = Input::file('file'); + + if ($file == null) + { + Session::flash('error', trans('texts.select_file')); + return Redirect::to('company/import_export'); + } + $name = $file->getRealPath(); require_once(app_path().'/includes/parsecsv.lib.php'); @@ -320,7 +327,8 @@ class AccountController extends \BaseController { if (count($csv->data) + Client::scope()->count() > MAX_NUM_CLIENTS) { - Session::flash('error', "Sorry, this wll exceed the limit of " . MAX_NUM_CLIENTS . " clients"); + $message = Utils::pluralize('limit_clients', MAX_NUM_CLIENTS); + Session::flash('error', $message); return Redirect::to('company/import_export'); } @@ -424,7 +432,7 @@ class AccountController extends \BaseController { $user->notify_paid = Input::get('notify_paid'); $user->save(); - Session::flash('message', 'Successfully updated settings'); + Session::flash('message', trans('texts.updated_settings')); return Redirect::to('company/notifications'); } @@ -474,7 +482,7 @@ class AccountController extends \BaseController { $account->account_gateways()->save($accountGateway); } - Session::flash('message', 'Successfully updated settings'); + Session::flash('message', trans('texts.updated_settings')); return Redirect::to('company/payments'); } } @@ -533,7 +541,7 @@ class AccountController extends \BaseController { Event::fire('user.refresh'); - Session::flash('message', 'Successfully updated details'); + Session::flash('message', trans('texts.updated_settings')); return Redirect::to('company/details'); } } @@ -542,7 +550,7 @@ class AccountController extends \BaseController { File::delete('logo/' . Auth::user()->account->account_key . '.jpg'); - Session::flash('message', 'Successfully removed logo'); + Session::flash('message', trans('texts.removed_logo')); return Redirect::to('company/details'); } diff --git a/app/controllers/ClientController.php b/app/controllers/ClientController.php index 0cfa7f649cc0..a8238e1f2462 100755 --- a/app/controllers/ClientController.php +++ b/app/controllers/ClientController.php @@ -229,17 +229,16 @@ class ClientController extends \BaseController { if ($publicId) { - Session::flash('message', 'Successfully updated client'); + Session::flash('message', trans('texts.updated_client')); } else { Activity::createClient($client); - Session::flash('message', 'Successfully created client'); + Session::flash('message', trans('texts.created_client')); } return Redirect::to('clients/' . $client->public_id); } - } public function bulk() @@ -248,7 +247,7 @@ class ClientController extends \BaseController { $ids = Input::get('id') ? Input::get('id') : Input::get('ids'); $count = $this->clientRepo->bulk($ids, $action); - $message = Utils::pluralize('Successfully '.$action.'d ? client', $count); + $message = Utils::pluralize($action.'d_client', $count); Session::flash('message', $message); return Redirect::to('clients'); diff --git a/app/controllers/CreditController.php b/app/controllers/CreditController.php index 1b9ca45c1fa5..b2a44086853c 100755 --- a/app/controllers/CreditController.php +++ b/app/controllers/CreditController.php @@ -121,7 +121,7 @@ class CreditController extends \BaseController { { $this->creditRepo->save($publicId, Input::all()); - $message = $publicId ? 'Successfully updated credit' : 'Successfully created credit'; + $message = trans('texts.created_credit'); Session::flash('message', $message); return Redirect::to('clients/' . Input::get('client')); } @@ -135,7 +135,7 @@ class CreditController extends \BaseController { if ($count > 0) { - $message = Utils::pluralize('Successfully '.$action.'d ? credit', $count); + $message = Utils::pluralize($action.'d_credit', $count); Session::flash('message', $message); } diff --git a/app/lang/en/texts.php b/app/lang/en/texts.php index a4551f1b1dcf..7ee6a01cfd6f 100644 --- a/app/lang/en/texts.php +++ b/app/lang/en/texts.php @@ -89,6 +89,11 @@ return array( 'notifications' => 'Notifications', 'import_export' => 'Import/Export', 'done' => 'Done', + 'save' => 'Save', + 'create' => 'Create', + 'upload' => 'Upload', + 'import' => 'Import', + 'download' => 'Download', 'cancel' => 'Cancel', 'provide_email' => 'Please provide a valid email address', 'powered_by' => 'Powered by', @@ -151,4 +156,88 @@ return array( 'select' => 'Select', 'edit_client' => 'Edit Client', 'edit_invoice' => 'Edit Invoice', + + // client view page + 'create_invoice' => 'Create Invoice', + 'enter_credit' => 'Enter Credit', + 'last_logged_in' => 'Last logged in', + 'details' => 'Details', + 'standing' => 'Standing', + 'credit' => 'Credit', + 'activity' => 'Activity', + 'date' => 'Date', + 'message' => 'Message', + 'adjustment' => 'Adjustment', + 'are_you_sure' => 'Are you sure?', + + // new payment page + 'payment_type_id' => 'Payment type', + 'amount' => 'Amount', + + // account/company pages + 'work_email' => 'Email', + 'language_id' => 'Language', + 'timezone_id' => 'Timezone', + 'date_format_id' => 'Date format', + 'datetime_format_id' => 'Date/Time Format', + 'users' => 'Users', + 'localization' => 'Localization', + 'remove_logo' => 'Remove logo', + 'logo_help' => 'Supported: JPEG, GIF and PNG. Recommended height: 120px', + 'payment_gateway' => 'Payment Gateway', + 'gateway_id' => 'Provider', + 'email_notifications' => 'Email Notifications', + 'email_sent' => 'Email me when an invoice is sent', + 'email_viewed' => 'Email me when an invoice is viewed', + 'email_paid' => 'Email me when an invoice is paid', + 'site_updates' => 'Site Updates', + 'custom_messages' => 'Custom Messages', + 'default_invoice_terms' => 'Set default invoice terms', + 'default_email_footer' => 'Set default email signature', + 'import_clients' => 'Import Client Data', + 'csv_file' => 'Select CSV file', + 'export_clients' => 'Export Client Data', + 'select_file' => 'Please select a file', + 'first_row_headers' => 'Use first row as headers', + 'column' => 'Column', + 'sample' => 'Sample', + 'import_to' => 'Import to', + 'client_will_create' => 'client will be created', + 'clients_will_create' => 'clients will be created', + + // application messages + 'created_client' => 'Successfully created client', + 'created_clients' => 'Successfully created ? clients', + 'limit_clients' => 'Sorry, this will exceed the limit of ? clients', + 'updated_settings' => 'Successfully updated settings', + 'removed_logo' => 'Successfully removed logo', + + 'updated_client' => 'Successfully updated client', + 'created_client' => 'Successfully created client', + 'archived_client' => 'Successfully archived client', + 'archived_clients' => 'Successfully archived ? clients', + 'deleted_client' => 'Successfully deleted client', + 'deleted_clients' => 'Successfully deleted ? clients', + + 'updated_invoice' => 'Successfully updated invoice', + 'created_invoice' => 'Successfully created invoice', + 'archived_invoice' => 'Successfully archived credit', + 'archived_invoices' => 'Successfully archived ? credits', + 'deleted_invoice' => 'Successfully deleted credit', + 'deleted_invoices' => 'Successfully deleted ? credits', + + 'created_payment' => 'Successfully created payment', + 'archived_payment' => 'Successfully archived payment', + 'archived_payments' => 'Successfully archived ? payments', + 'deleted_payment' => 'Successfully deleted payment', + 'deleted_payments' => 'Successfully deleted ? payments', + + 'created_credit' => 'Successfully created credit', + 'archived_credit' => 'Successfully archived credit', + 'archived_credits' => 'Successfully archived ? credits', + 'deleted_credit' => 'Successfully deleted credit', + 'deleted_credits' => 'Successfully deleted ? credits', + + + ); \ No newline at end of file diff --git a/app/libraries/utils.php b/app/libraries/utils.php index fa4cf0319c19..766b78679ae1 100755 --- a/app/libraries/utils.php +++ b/app/libraries/utils.php @@ -35,7 +35,7 @@ class Utils { if (!$message) { - $message = "An error occurred, please try again later"; + $message = "An error occurred, please try again later."; } static::logError($message . ' ' . $exception); @@ -122,9 +122,10 @@ class Utils public static function pluralize($string, $count) { + $field = $count == 1 ? $string : $string . 's'; + $string = trans("texts.$field"); $string = str_replace('?', $count, $string); - $field = $count == 1 ? $string : $string . 's'; - return trans("texts.$field"); + return $string; } public static function toArray($data) diff --git a/app/models/Activity.php b/app/models/Activity.php index 5cb9b861b3ca..71eca81be24e 100755 --- a/app/models/Activity.php +++ b/app/models/Activity.php @@ -423,7 +423,7 @@ class Activity extends Eloquent } $activity = Activity::getBlank(); - $activity->client_id = $client->id; + $activity->client_id = $credit->client_id; $activity->credit_id = $credit->id; $activity->activity_type_id = ACTIVITY_TYPE_ARCHIVE_CREDIT; $activity->message = Utils::encodeActivity(Auth::user(), 'archived ' . Utils::formatMoney($credit->balance, $credit->client->currency_id) . ' credit'); diff --git a/app/routes.php b/app/routes.php index bc4d86f7712b..f355ee5cf7cf 100755 --- a/app/routes.php +++ b/app/routes.php @@ -161,7 +161,7 @@ HTML::macro('breadcrumbs', function() { $crumb = trim($crumbs[$i]); if (!$crumb) continue; if ($crumb == 'company') return ''; - $name = ucwords($crumb); + $name = trans("texts.$crumb"); if ($i==count($crumbs)-1) { $str .= "
  • $name
  • "; diff --git a/app/views/accounts/details.blade.php b/app/views/accounts/details.blade.php index bf8df2a95763..823f5743e1a1 100755 --- a/app/views/accounts/details.blade.php +++ b/app/views/accounts/details.blade.php @@ -25,53 +25,53 @@
    - {{ Former::legend('Details') }} + {{ Former::legend('details') }} {{ Former::text('name') }} - {{ Former::text('work_email')->label('Email') }} - {{ Former::text('work_phone')->label('Phone') }} - {{ Former::file('logo')->max(2, 'MB')->accept('image')->inlineHelp('Supported: JPEG, GIF and PNG. Recommended height: 120px') }} + {{ Former::text('work_email') }} + {{ Former::text('work_phone') }} + {{ Former::file('logo')->max(2, 'MB')->accept('image')->inlineHelp(trans('texts.logo_help')) }} @if (file_exists($account->getLogoPath()))
    {{ HTML::image($account->getLogoPath(), "Logo") }}   - Remove logo + {{ trans('texts.remove_logo') }}

    @endif - {{ Former::select('size_id')->addOption('','')->label('Size') + {{ Former::select('size_id')->addOption('','') ->fromQuery($sizes, 'name', 'id') }} - {{ Former::select('industry_id')->addOption('','')->label('Industry') + {{ Former::select('industry_id')->addOption('','') ->fromQuery($industries, 'name', 'id') }} - {{ Former::legend('Address') }} - {{ Former::text('address1')->label('Street') }} - {{ Former::text('address2')->label('Apt/Suite') }} + {{ Former::legend('address') }} + {{ Former::text('address1') }} + {{ Former::text('address2') }} {{ Former::text('city') }} - {{ Former::text('state')->label('State/Province') }} + {{ Former::text('state') }} {{ Former::text('postal_code') }} - {{ Former::select('country_id')->addOption('','')->label('Country') + {{ Former::select('country_id')->addOption('','') ->fromQuery($countries, 'name', 'id') }}
    - {{ Former::legend('Users') }} + {{ Former::legend('users') }} {{ Former::text('first_name') }} {{ Former::text('last_name') }} {{ Former::text('email') }} {{ Former::text('phone') }} - {{ Former::legend('Localization') }} - {{ Former::select('language_id')->addOption('','')->label('Language') + {{ Former::legend('localization') }} + {{ Former::select('language_id')->addOption('','') ->fromQuery($languages, 'name', 'id') }} - {{ Former::select('currency_id')->addOption('','')->label('Currency') + {{ Former::select('currency_id')->addOption('','') ->fromQuery($currencies, 'name', 'id') }} - {{ Former::select('timezone_id')->addOption('','')->label('Timezone') + {{ Former::select('timezone_id')->addOption('','') ->fromQuery($timezones, 'location', 'id') }} - {{ Former::select('date_format_id')->addOption('','')->label('Date Format') + {{ Former::select('date_format_id')->addOption('','') ->fromQuery($dateFormats, 'label', 'id') }} - {{ Former::select('datetime_format_id')->addOption('','')->label('Date/Time Format') + {{ Former::select('datetime_format_id')->addOption('','') ->fromQuery($datetimeFormats, 'label', 'id') }} @@ -79,7 +79,7 @@
    - {{ Button::lg_success_submit('Save')->append_with_icon('floppy-disk') }} + {{ Button::lg_success_submit(trans('texts.save'))->append_with_icon('floppy-disk') }}
    {{ Former::close() }} @@ -95,7 +95,7 @@ }); function deleteLogo() { - if (confirm('Are you sure?')) { + if (confirm("{{ trans('texts.are_you_sure') }}")) { $('.removeLogoForm').submit(); } } diff --git a/app/views/accounts/import_export.blade.php b/app/views/accounts/import_export.blade.php index 1f1e21d030ac..e9a72ee1b2cd 100755 --- a/app/views/accounts/import_export.blade.php +++ b/app/views/accounts/import_export.blade.php @@ -4,14 +4,14 @@ @parent {{ Former::open_for_files('company/import_map')->addClass('col-md-9 col-md-offset-1') }} - {{ Former::legend('Import Client Data') }} - {{ Former::file('file')->label('Select CSV file') }} - {{ Former::actions( Button::lg_info_submit('Upload')->append_with_icon('open') ) }} + {{ Former::legend('import_clients') }} + {{ Former::file('file')->label(trans('texts.csv_file')) }} + {{ Former::actions( Button::lg_info_submit(trans('texts.upload'))->append_with_icon('open') ) }} {{ Former::close() }} {{ Former::open('company/export')->addClass('col-md-9 col-md-offset-1') }} - {{ Former::legend('Export Client Data') }} - {{ Former::actions( Button::lg_primary_submit('Download')->append_with_icon('download-alt') ) }} + {{ Former::legend('export_clients') }} + {{ Former::actions( Button::lg_primary_submit(trans('texts.download'))->append_with_icon('download-alt') ) }} {{ Former::close() }} @stop \ No newline at end of file diff --git a/app/views/accounts/import_map.blade.php b/app/views/accounts/import_map.blade.php index d56146bf95e2..e667cacbcc47 100755 --- a/app/views/accounts/import_map.blade.php +++ b/app/views/accounts/import_map.blade.php @@ -4,20 +4,20 @@ @parent {{ Former::open('company/import_export') }} - {{ Former::legend('Import Clients') }} + {{ Former::legend('import_clients') }} @if ($headers) - - - + + + @for ($i=0; $i @@ -55,11 +55,11 @@ { if (num == 1) { - $('#numClients').html('1 client will be created'); + $('#numClients').html("1 {{ trans('texts.client_will_create') }}"); } else { - $('#numClients').html(num + ' clients will be created'); + $('#numClients').html(num + " {{ trans('texts.clients_will_create') }}"); } } diff --git a/app/views/accounts/notifications.blade.php b/app/views/accounts/notifications.blade.php index 40ae1af08e6e..46a226bd2e12 100755 --- a/app/views/accounts/notifications.blade.php +++ b/app/views/accounts/notifications.blade.php @@ -9,12 +9,12 @@ {{ Former::populateField('notify_viewed', intval(Auth::user()->notify_viewed)) }} {{ Former::populateField('notify_paid', intval(Auth::user()->notify_paid)) }} - {{ Former::legend('Email Notifications') }} - {{ Former::checkbox('notify_sent')->label(' ')->text('Email me when an invoice is sent') }} - {{ Former::checkbox('notify_viewed')->label(' ')->text('Email me when an invoice is viewed') }} - {{ Former::checkbox('notify_paid')->label(' ')->text('Email me when an invoice is paid') }} + {{ Former::legend('email_notifications') }} + {{ Former::checkbox('notify_sent')->label(' ')->text(trans('texts.email_sent')) }} + {{ Former::checkbox('notify_viewed')->label(' ')->text(trans('texts.email_viewed')) }} + {{ Former::checkbox('notify_paid')->label(' ')->text(trans('texts.email_paid')) }} - {{ Former::legend('Site Updates') }} + {{ Former::legend('site_updates') }}
    @@ -36,11 +36,11 @@
    - {{ Former::legend('Custom Messages') }} - {{ Former::textarea('invoice_terms')->label('Set default invoice terms') }} - {{ Former::textarea('email_footer')->label('Set default email signature') }} + {{ Former::legend('custom_messages') }} + {{ Former::textarea('invoice_terms')->label(trans('texts.default_invoice_terms')) }} + {{ Former::textarea('email_footer')->label(trans('texts.default_email_footer')) }} - {{ Former::actions( Button::lg_success_submit('Save')->append_with_icon('floppy-disk') ) }} + {{ Former::actions( Button::lg_success_submit(trans('texts.save'))->append_with_icon('floppy-disk') ) }} {{ Former::close() }} @stop \ No newline at end of file diff --git a/app/views/clients/show.blade.php b/app/views/clients/show.blade.php index c8b5a852954a..328541670489 100755 --- a/app/views/clients/show.blade.php +++ b/app/views/clients/show.blade.php @@ -11,13 +11,13 @@ {{ Former::text('id')->value($client->public_id) }} - {{ DropdownButton::normal('Edit Client', + {{ DropdownButton::normal(trans('texts.edit_client'), Navigation::links( [ - ['Edit Client', URL::to('clients/' . $client->public_id . '/edit')], + [trans('texts.edit_client'), URL::to('clients/' . $client->public_id . '/edit')], [Navigation::DIVIDER], - ['Archive Client', "javascript:onArchiveClick()"], - ['Delete Client', "javascript:onDeleteClick()"], + [trans('texts.archive_client'), "javascript:onArchiveClick()"], + [trans('texts.delete_client'), "javascript:onDeleteClick()"], ] ) , ['id'=>'normalDropDown'])->split(); }} @@ -25,9 +25,9 @@ {{ DropdownButton::primary('Create Invoice', Navigation::links( [ - ['Create Invoice', URL::to('invoices/create/' . $client->public_id )], - ['Enter Payment', URL::to('payments/create/' . $client->public_id )], - ['Enter Credit', URL::to('credits/create/' . $client->public_id )], + [trans('texts.create_invoice'), URL::to('invoices/create/' . $client->public_id )], + [trans('texts.enter_payment'), URL::to('payments/create/' . $client->public_id )], + [trans('texts.enter_credit'), URL::to('credits/create/' . $client->public_id )], ] ) , ['id'=>'primaryDropDown'])->split(); }} @@ -39,43 +39,43 @@

    {{ $client->getDisplayName() }}

    @if ($client->last_login > 0)

    - Last logged in {{ Utils::timestampToDateTimeString(strtotime($client->last_login)); }} + {{ trans('texts.last_logged_in') }} {{ Utils::timestampToDateTimeString(strtotime($client->last_login)); }}

    @endif
    -

    Details

    +

    {{ trans('texts.details') }}

    {{ $client->getAddress() }}

    {{ $client->getPhone() }}

    {{ $client->getNotes() }}

    {{ $client->getIndustry() }}

    {{ $client->getWebsite() }}

    -

    {{ $client->payment_terms ? "Payment terms: Net " . $client->payment_terms : '' }}

    +

    {{ $client->payment_terms ? trans('texts.payment_terms') . ": Net " . $client->payment_terms : '' }}

    -

    Contacts

    +

    {{ trans('texts.contacts') }}

    @foreach ($client->contacts as $contact) {{ $contact->getDetails() }} @endforeach
    -

    Standing +

    {{ trans('texts.standing') }}

    ColumnSampleImport To{{ trans('texts.column') }}{{ trans('texts.sample') }}{{ trans('texts.import_to') }}
    - + - + @if ($credit > 0) - + @endif @@ -88,10 +88,10 @@

     

    @@ -99,7 +99,11 @@
    {{ Datatable::table() - ->addColumn('Date', 'Message', 'Balance', 'Adjustment') + ->addColumn( + trans('texts.date'), + trans('texts.message'), + trans('texts.balance'), + trans('texts.adjustment')) ->setUrl(url('api/activities/'. $client->public_id)) ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) @@ -112,7 +116,11 @@ @if ($hasRecurringInvoices) {{ Datatable::table() - ->addColumn('How Often', 'Start Date', 'End Date', 'Invoice Total') + ->addColumn( + trans('texts.frequency_id'), + trans('texts.start_date'), + trans('texts.end_date'), + trans('texts.invoice_total')) ->setUrl(url('api/recurring_invoices/' . $client->public_id)) ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) @@ -121,7 +129,13 @@ @endif {{ Datatable::table() - ->addColumn('Invoice Number', 'Invoice Date', 'Invoice Total', 'Balance Due', 'Due Date', 'Status') + ->addColumn( + trans('texts.invoice_number'), + trans('texts.invoice_date'), + trans('texts.invoice_total'), + trans('texts.balance_due'), + trans('texts.due_date'), + trans('texts.status')) ->setUrl(url('api/invoices/' . $client->public_id)) ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) @@ -132,7 +146,12 @@
    {{ Datatable::table() - ->addColumn('Invoice', 'Transaction Reference', 'Method', 'Payment Amount', 'Payment Date') + ->addColumn( + trans('texts.invoice'), + trans('texts.transaction_reference'), + trans('texts.method'), + trans('texts.payment_amount'), + trans('texts.payment_date')) ->setUrl(url('api/payments/' . $client->public_id)) ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) @@ -143,7 +162,11 @@
    {{ Datatable::table() - ->addColumn('Credit Amount', 'Credit Balance', 'Credit Date', 'Private Notes') + ->addColumn( + trans('texts.credit_amount'), + trans('texts.credit_balance'), + trans('texts.credit_date'), + trans('texts.private_notes')) ->setUrl(url('api/credits/' . $client->public_id)) ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) @@ -170,7 +193,7 @@ } function onDeleteClick() { - if (confirm('Are you sure you want to delete this client?')) { + if (confirm("{{ trans('texts.are_you_sure') }}")) { $('#action').val('delete'); $('.mainForm').submit(); } diff --git a/app/views/credits/edit.blade.php b/app/views/credits/edit.blade.php index 047f792dfd68..0ad2be8217cd 100755 --- a/app/views/credits/edit.blade.php +++ b/app/views/credits/edit.blade.php @@ -19,7 +19,7 @@ {{ Former::select('client')->addOption('', '')->addGroupClass('client-select') }} {{ Former::text('amount') }} {{ Former::text('credit_date')->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))->append('') }} - {{-- Former::select('currency_id')->addOption('','')->label('Currency') + {{-- Former::select('currency_id')->addOption('','') ->fromQuery($currencies, 'name', 'id')->select(Session::get(SESSION_CURRENCY, DEFAULT_CURRENCY)) --}} {{ Former::textarea('private_notes') }} @@ -29,8 +29,8 @@
    - {{ Button::lg_primary_submit_success('Save')->append_with_icon('floppy-disk') }} - {{ Button::lg_default_link('credits/' . ($credit ? $credit->public_id : ''), 'Cancel')->append_with_icon('remove-circle'); }} + {{ Button::lg_primary_submit_success(trans('texts.save'))->append_with_icon('floppy-disk') }} + {{ Button::lg_default_link('credits/' . ($credit ? $credit->public_id : ''), trans('texts.cancel'))->append_with_icon('remove-circle'); }}
    {{ Former::close() }} @@ -54,10 +54,7 @@ $clientSelect.combobox(); - - $('#currency_id').combobox(); - $('#credit_date').datepicker('update', new Date({{ strtotime(Utils::today()) * 1000 }})); }); diff --git a/app/views/payments/edit.blade.php b/app/views/payments/edit.blade.php index 580e48ff3000..19794813ab52 100755 --- a/app/views/payments/edit.blade.php +++ b/app/views/payments/edit.blade.php @@ -20,10 +20,10 @@ {{ Former::select('client')->addOption('', '')->addGroupClass('client-select') }} {{ Former::select('invoice')->addOption('', '')->addGroupClass('invoice-select') }} {{ Former::text('amount') }} - {{ Former::select('payment_type_id')->addOption('','')->label('Payment type') + {{ Former::select('payment_type_id')->addOption('','') ->fromQuery($paymentTypes, 'name', 'id') }} {{ Former::text('payment_date')->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))->append('') }} - {{-- Former::select('currency_id')->addOption('','')->label('Currency') + {{-- Former::select('currency_id')->addOption('','') ->fromQuery($currencies, 'name', 'id')->select(Session::get(SESSION_CURRENCY, DEFAULT_CURRENCY)) --}}
    @@ -33,8 +33,8 @@
    - {{ Button::lg_primary_submit_success('Save')->append_with_icon('floppy-disk') }} - {{ Button::lg_default_link('payments/' . ($payment ? $payment->public_id : ''), 'Cancel')->append_with_icon('remove-circle'); }} + {{ Button::lg_primary_submit_success(trans('texts.save'))->append_with_icon('floppy-disk') }} + {{ Button::lg_default_link('payments/' . ($payment ? $payment->public_id : ''), trans('texts.cancel'))->append_with_icon('remove-circle'); }}
    {{ Former::close() }} @@ -49,7 +49,6 @@ populateInvoiceComboboxes({{ $clientPublicId }}, {{ $invoicePublicId }}); $('#payment_type_id').combobox(); - $('#payment_date').datepicker('update', new Date({{ strtotime(Utils::today()) * 1000 }})); });
    Paid to Date{{ trans('texts.paid_to_date') }} {{ Utils::formatMoney($client->paid_to_date, $client->currency_id); }}
    Balance{{ trans('texts.balance') }} {{ Utils::formatMoney($client->balance, $client->currency_id); }}
    Credit{{ trans('texts.credit') }} {{ Utils::formatMoney($credit, $client->currency_id); }}