1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 12:12:48 +01:00

Bug fixes

This commit is contained in:
Hillel Coren 2015-09-02 13:59:03 +03:00
parent e4672b1213
commit 4d71b193d6
10 changed files with 85 additions and 82 deletions

View File

@ -9,15 +9,17 @@ use Exception;
use Input; use Input;
use Utils; use Utils;
use View; use View;
use Event;
use Session; use Session;
use Cookie; use Cookie;
use Response; use Response;
use Redirect;
use App\Models\User; use App\Models\User;
use App\Models\Account; use App\Models\Account;
use App\Models\Industry; use App\Models\Industry;
use App\Ninja\Mailers\Mailer; use App\Ninja\Mailers\Mailer;
use App\Ninja\Repositories\AccountRepository; use App\Ninja\Repositories\AccountRepository;
use Redirect; use App\Events\UserSettingsChanged;
class AppController extends BaseController class AppController extends BaseController
{ {
@ -183,6 +185,7 @@ class AppController extends BaseController
Artisan::call('db:seed', array('--force' => true, '--class' => 'PaymentLibrariesSeeder')); Artisan::call('db:seed', array('--force' => true, '--class' => 'PaymentLibrariesSeeder'));
Artisan::call('optimize', array('--force' => true)); Artisan::call('optimize', array('--force' => true));
Cache::flush(); Cache::flush();
Event::fire(new UserSettingsChanged());
Session::flash('message', trans('texts.processed_updates')); Session::flash('message', trans('texts.processed_updates'));
} catch (Exception $e) { } catch (Exception $e) {
Response::make($e->getMessage(), 500); Response::make($e->getMessage(), 500);

View File

@ -358,7 +358,11 @@ class PaymentController extends BaseController
} }
} }
Session::set('product_id', Input::get('product_id', PRODUCT_ONE_CLICK_INSTALL)); if (Input::has('product_id')) {
Session::set('product_id', Input::get('product_id'));
} else if (!Session::has('product_id')) {
Session::set('product_id', PRODUCT_ONE_CLICK_INSTALL);
}
if (!Session::get('affiliate_id')) { if (!Session::get('affiliate_id')) {
return Utils::fatalError(); return Utils::fatalError();

View File

@ -137,7 +137,7 @@ class TaskController extends BaseController
'url' => 'tasks', 'url' => 'tasks',
'title' => trans('texts.new_task'), 'title' => trans('texts.new_task'),
'timezone' => Auth::user()->account->timezone->name, 'timezone' => Auth::user()->account->timezone->name,
'datetimeFormat' => Auth::user()->account->datetime_format->format_moment_sec 'datetimeFormat' => Auth::user()->account->datetime_format->format_moment
]; ];
$data = array_merge($data, self::getViewModel()); $data = array_merge($data, self::getViewModel());
@ -188,7 +188,7 @@ class TaskController extends BaseController
'duration' => $task->is_running ? $task->getCurrentDuration() : $task->getDuration(), 'duration' => $task->is_running ? $task->getCurrentDuration() : $task->getDuration(),
'actions' => $actions, 'actions' => $actions,
'timezone' => Auth::user()->account->timezone->name, 'timezone' => Auth::user()->account->timezone->name,
'datetimeFormat' => Auth::user()->account->datetime_format->format_moment_sec 'datetimeFormat' => Auth::user()->account->datetime_format->format_moment
]; ];
$data = array_merge($data, self::getViewModel()); $data = array_merge($data, self::getViewModel());

View File

@ -51,10 +51,10 @@ class StartupCheck
'countries' => 'App\Models\Country', 'countries' => 'App\Models\Country',
'invoiceDesigns' => 'App\Models\InvoiceDesign', 'invoiceDesigns' => 'App\Models\InvoiceDesign',
]; ];
if (Input::has('clear_cache')) {
Session::flash('message', 'Cache cleared');
}
foreach ($cachedTables as $name => $class) { foreach ($cachedTables as $name => $class) {
if (Input::has('clear_cache')) {
Session::flash('message', 'Cache cleared');
}
if (Input::has('clear_cache') || !Cache::has($name)) { if (Input::has('clear_cache') || !Cache::has($name)) {
if ($name == 'paymentTerms') { if ($name == 'paymentTerms') {
$orderBy = 'num_days'; $orderBy = 'num_days';

View File

@ -21,12 +21,10 @@
"handsontable": "*", "handsontable": "*",
"pdfmake": "*", "pdfmake": "*",
"moment": "*", "moment": "*",
"jsoneditor": "*" "jsoneditor": "*",
"moment-timezone": "~0.4.0"
}, },
"resolutions": { "resolutions": {
"jquery": "~1.11" "jquery": "~1.11"
},
"devDependencies": {
"moment-timezone": "~0.4.0"
} }
} }

View File

@ -3,36 +3,37 @@
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
class AddFormatsToDatetimeFormatsTable extends Migration { class AddFormatsToDatetimeFormatsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::table('date_formats')
->where('label', '20/03/2013')
->update(['label' => '20-03-2013']);
/** DB::table('datetime_formats')
* Run the migrations. ->where('label', '20/03/2013 6:15 pm')
* ->update(['label' => '20-03-2013 6:15 pm']);
* @return void
*/
public function up()
{
Schema::table('datetime_formats', function(Blueprint $t)
{
$t->string('format_sec');
$t->string('format_moment');
$t->string('format_moment_sec');
});
}
/** Schema::table('datetime_formats', function (Blueprint $table) {
* Reverse the migrations. $table->string('format_moment');
* });
* @return void }
*/
public function down()
{
Schema::table('datetime_formats', function(Blueprint $t)
{
$t->dropColumn('format_sec');
$t->dropColumn('format_moment');
$t->dropColumn('format_moment_sec');
});
}
} /**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('datetime_formats', function (Blueprint $table) {
$table->dropColumn('format_moment');
});
}
}

View File

@ -108,12 +108,17 @@ class PaymentLibrariesSeeder extends Seeder
['format' => 'F j, Y', 'picker_format' => 'MM d, yyyy', 'label' => 'March 10, 2013'], ['format' => 'F j, Y', 'picker_format' => 'MM d, yyyy', 'label' => 'March 10, 2013'],
['format' => 'D M j, Y', 'picker_format' => 'D MM d, yyyy', 'label' => 'Mon March 10, 2013'], ['format' => 'D M j, Y', 'picker_format' => 'D MM d, yyyy', 'label' => 'Mon March 10, 2013'],
['format' => 'Y-M-d', 'picker_format' => 'yyyy-M-dd', 'label' => '2013-03-10'], ['format' => 'Y-M-d', 'picker_format' => 'yyyy-M-dd', 'label' => '2013-03-10'],
['format' => 'd/m/Y', 'picker_format' => 'dd/mm/yyyy', 'label' => '20/03/2013'], ['format' => 'd-m-Y', 'picker_format' => 'dd-mm-yyyy', 'label' => '20-03-2013'],
['format' => 'd.m.Y', 'picker_format' => 'dd.mm.yyyy', 'label' => '20.03.2013'] ['format' => 'm/d/Y', 'picker_format' => 'mm/dd/yyyy', 'label' => '03/20/2013']
]; ];
foreach ($formats as $format) { foreach ($formats as $format) {
if (!DB::table('date_formats')->whereLabel($format['label'])->get()) { $record = DateFormat::whereLabel($format['label'])->first();
if ($record) {
$record->format = $format['format'];
$record->picker_format = $format['picker_format'];
$record->save();
} else {
DateFormat::create($format); DateFormat::create($format);
} }
} }
@ -124,78 +129,63 @@ class PaymentLibrariesSeeder extends Seeder
$formats = [ $formats = [
[ [
'format' => 'd/M/Y g:i a', 'format' => 'd/M/Y g:i a',
'format_sec' => 'd/M/Y g:i:s a', 'format_moment' => 'DD/MMM/YYYY h:mm:ss a',
'format_moment' => 'DD/MMM/YYYY h:mm a',
'format_moment_sec' => 'DD/MMM/YYYY h:mm:ss a',
'label' => '10/Mar/2013' 'label' => '10/Mar/2013'
], ],
[ [
'format' => 'd-M-Yk g:i a', 'format' => 'd-M-Yk g:i a',
'format_sec' => 'd-M-Yk g:i:s a', 'format_moment' => 'DD-MMM-YYYY h:mm:ss a',
'format_moment' => 'DD-MMM-YYYY h:mm a',
'format_moment_sec' => 'DD-MMM-YYYY h:mm:ss a',
'label' => '10-Mar-2013' 'label' => '10-Mar-2013'
], ],
[ [
'format' => 'd/F/Y g:i a', 'format' => 'd/F/Y g:i a',
'format_sec' => 'd/F/Y g:i:s a', 'format_moment' => 'DD/MMMM/YYYY h:mm:ss a',
'format_moment' => 'DD/MMMM/YYYY h:mm a',
'format_moment_sec' => 'DD/MMMM/YYYY h:mm:ss a',
'label' => '10/March/2013' 'label' => '10/March/2013'
], ],
[ [
'format' => 'd-F-Y g:i a', 'format' => 'd-F-Y g:i a',
'format_sec' => 'd-F-Y g:i:s a', 'format_moment' => 'DD-MMMM-YYYY h:mm:ss a',
'format_moment' => 'DD-MMMM-YYYY h:mm a',
'format_moment_sec' => 'DD-MMMM-YYYY h:mm:ss a',
'label' => '10-March-2013' 'label' => '10-March-2013'
], ],
[ [
'format' => 'M j, Y g:i a', 'format' => 'M j, Y g:i a',
'format_sec' => 'M j, Y g:i:s a', 'format_moment' => 'MMM D, YYYY h:mm:ss a',
'format_moment' => 'MMM D, YYYY h:mm a',
'format_moment_sec' => 'MMM D, YYYY h:mm:ss a',
'label' => 'Mar 10, 2013 6:15 pm' 'label' => 'Mar 10, 2013 6:15 pm'
], ],
[ [
'format' => 'F j, Y g:i a', 'format' => 'F j, Y g:i a',
'format_sec' => 'F j, Y g:i:s a', 'format_moment' => 'MMMM D, YYYY h:mm:ss a',
'format_moment' => 'MMMM D, YYYY h:mm a',
'format_moment_sec' => 'MMMM D, YYYY h:mm:ss a',
'label' => 'March 10, 2013 6:15 pm' 'label' => 'March 10, 2013 6:15 pm'
], ],
[ [
'format' => 'D M jS, Y g:ia', 'format' => 'D M jS, Y g:ia',
'format_sec' => 'D M jS, Y g:i:sa', 'format_moment' => 'ddd MMM Do, YYYY h:mm:ss a',
'format_moment' => 'ddd MMM Do, YYYY h:mma',
'format_moment_sec' => 'ddd MMM Do, YYYY h:mm:ssa',
'label' => 'Mon March 10th, 2013 6:15 pm' 'label' => 'Mon March 10th, 2013 6:15 pm'
], ],
[ [
'format' => 'Y-M-d g:i a', 'format' => 'Y-M-d g:i a',
'format_sec' => 'Y-M-d g:i:s a', 'format_moment' => 'YYYY-MMM-DD h:mm:ss a',
'format_moment' => 'YYYY-MMM-DD h:mm a',
'format_moment_sec' => 'YYYY-MMM-DD h:mm:ss a',
'label' => '2013-03-10 6:15 pm' 'label' => '2013-03-10 6:15 pm'
], ],
[ [
'format' => 'd/m/Y g:i a', 'format' => 'd-m-Y g:i a',
'format_sec' => 'd/m/Y g:i:s a', 'format_moment' => 'DD-MM-YYYY h:mm:ss a',
'format_moment' => 'DD/MM/YYYY h:mm a', 'label' => '20-03-2013 6:15 pm'
'format_moment_sec' => 'DD/MM/YYYY h:mm:ss a',
'label' => '20/03/2013 6:15 pm'
], ],
[ [
'format' => 'd.m.Y H:i', 'format' => 'm/d/Y H:i',
'format_sec' => 'd.m.Y H:i:s', 'format_moment' => 'MM/DD/YYYY HH:mm:ss',
'format_moment' => 'DD.MM.YYYY HH:mm', 'label' => '03/20/2013 6:15 pm'
'format_moment_sec' => 'DD.MM.YYYY HH:mm:ss',
'label' => '20.03.2013 18:15'
] ]
]; ];
foreach ($formats as $format) { foreach ($formats as $format) {
if (!DB::table('datetime_formats')->whereLabel($format['label'])->get()) { $record = DatetimeFormat::whereLabel($format['label'])->first();
if ($record) {
$record->format = $format['format'];
$record->format_moment = $format['format_moment'];
$record->save();
} else {
DatetimeFormat::create($format); DatetimeFormat::create($format);
} }
} }

File diff suppressed because one or more lines are too long

View File

@ -18,11 +18,11 @@ If you'd like to translate the site please use [caouecs/Laravel4-long](https://g
### Features ### Features
* Built using Laravel 5 * Built using Laravel 5
* Live PDF generation * Live PDF generation using [pdfmake](http://pdfmake.org/)
* Integrates with 30+ payment providers * Integrates with 30+ payment providers
* Recurring invoices * Recurring invoices
* Tasks with time-tracking * Tasks with time-tracking
* Multi-user support * Multi-user/multi-company support
* Tax rates and payment terms * Tax rates and payment terms
* Partial payments * Partial payments
* Custom email templates * Custom email templates

View File

@ -1871,4 +1871,4 @@
</script> </script>
@stop @stop