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

View File

@ -137,7 +137,7 @@ class TaskController extends BaseController
'url' => 'tasks',
'title' => trans('texts.new_task'),
'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());
@ -188,7 +188,7 @@ class TaskController extends BaseController
'duration' => $task->is_running ? $task->getCurrentDuration() : $task->getDuration(),
'actions' => $actions,
'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());

View File

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

View File

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

View File

@ -3,36 +3,37 @@
use Illuminate\Database\Schema\Blueprint;
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']);
/**
* Run the migrations.
*
* @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');
});
}
DB::table('datetime_formats')
->where('label', '20/03/2013 6:15 pm')
->update(['label' => '20-03-2013 6:15 pm']);
/**
* Reverse the migrations.
*
* @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');
});
}
Schema::table('datetime_formats', function (Blueprint $table) {
$table->string('format_moment');
});
}
}
/**
* 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' => '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' => '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) {
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);
}
}
@ -124,78 +129,63 @@ class PaymentLibrariesSeeder extends Seeder
$formats = [
[
'format' => 'd/M/Y g:i a',
'format_sec' => 'd/M/Y g:i:s a',
'format_moment' => 'DD/MMM/YYYY h:mm a',
'format_moment_sec' => 'DD/MMM/YYYY h:mm:ss a',
'format_moment' => 'DD/MMM/YYYY h:mm:ss a',
'label' => '10/Mar/2013'
],
[
'format' => 'd-M-Yk g:i a',
'format_sec' => 'd-M-Yk g:i:s a',
'format_moment' => 'DD-MMM-YYYY h:mm a',
'format_moment_sec' => 'DD-MMM-YYYY h:mm:ss a',
'format_moment' => 'DD-MMM-YYYY h:mm:ss a',
'label' => '10-Mar-2013'
],
[
'format' => 'd/F/Y g:i a',
'format_sec' => 'd/F/Y g:i:s a',
'format_moment' => 'DD/MMMM/YYYY h:mm a',
'format_moment_sec' => 'DD/MMMM/YYYY h:mm:ss a',
'format_moment' => 'DD/MMMM/YYYY h:mm:ss a',
'label' => '10/March/2013'
],
[
'format' => 'd-F-Y g:i a',
'format_sec' => 'd-F-Y g:i:s a',
'format_moment' => 'DD-MMMM-YYYY h:mm a',
'format_moment_sec' => 'DD-MMMM-YYYY h:mm:ss a',
'format_moment' => 'DD-MMMM-YYYY h:mm:ss a',
'label' => '10-March-2013'
],
[
'format' => 'M j, Y g:i a',
'format_sec' => 'M j, Y g:i:s a',
'format_moment' => 'MMM D, YYYY h:mm a',
'format_moment_sec' => 'MMM D, YYYY h:mm:ss a',
'format_moment' => 'MMM D, YYYY h:mm:ss a',
'label' => 'Mar 10, 2013 6:15 pm'
],
[
'format' => 'F j, Y g:i a',
'format_sec' => 'F j, Y g:i:s a',
'format_moment' => 'MMMM D, YYYY h:mm a',
'format_moment_sec' => 'MMMM D, YYYY h:mm:ss a',
'format_moment' => 'MMMM D, YYYY h:mm:ss a',
'label' => 'March 10, 2013 6:15 pm'
],
[
'format' => 'D M jS, Y g:ia',
'format_sec' => 'D M jS, Y g:i:sa',
'format_moment' => 'ddd MMM Do, YYYY h:mma',
'format_moment_sec' => 'ddd MMM Do, YYYY h:mm:ssa',
'format_moment' => 'ddd MMM Do, YYYY h:mm:ss a',
'label' => 'Mon March 10th, 2013 6:15 pm'
],
[
'format' => 'Y-M-d g:i a',
'format_sec' => 'Y-M-d g:i:s a',
'format_moment' => 'YYYY-MMM-DD h:mm a',
'format_moment_sec' => 'YYYY-MMM-DD h:mm:ss a',
'format_moment' => 'YYYY-MMM-DD h:mm:ss a',
'label' => '2013-03-10 6:15 pm'
],
[
'format' => 'd/m/Y g:i a',
'format_sec' => 'd/m/Y g:i:s a',
'format_moment' => 'DD/MM/YYYY h:mm a',
'format_moment_sec' => 'DD/MM/YYYY h:mm:ss a',
'label' => '20/03/2013 6:15 pm'
'format' => 'd-m-Y g:i a',
'format_moment' => 'DD-MM-YYYY h:mm:ss a',
'label' => '20-03-2013 6:15 pm'
],
[
'format' => 'd.m.Y H:i',
'format_sec' => 'd.m.Y H:i:s',
'format_moment' => 'DD.MM.YYYY HH:mm',
'format_moment_sec' => 'DD.MM.YYYY HH:mm:ss',
'label' => '20.03.2013 18:15'
'format' => 'm/d/Y H:i',
'format_moment' => 'MM/DD/YYYY HH:mm:ss',
'label' => '03/20/2013 6:15 pm'
]
];
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);
}
}

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
* Built using Laravel 5
* Live PDF generation
* Live PDF generation using [pdfmake](http://pdfmake.org/)
* Integrates with 30+ payment providers
* Recurring invoices
* Tasks with time-tracking
* Multi-user support
* Multi-user/multi-company support
* Tax rates and payment terms
* Partial payments
* Custom email templates

View File

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