mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-21 03:39:00 +00:00
Code cleanup.
This commit is contained in:
@@ -6,7 +6,6 @@ use Illuminate\Foundation\Bus\DispatchesJobs;
|
|||||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||||
use Illuminate\Routing\Controller as BaseController;
|
use Illuminate\Routing\Controller as BaseController;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Session;
|
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
<?php namespace FireflyIII\Http\Controllers;
|
<?php namespace FireflyIII\Http\Controllers;
|
||||||
|
|
||||||
|
use Artisan;
|
||||||
use Auth;
|
use Auth;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Config;
|
use Config;
|
||||||
@@ -11,7 +12,7 @@ use Preferences;
|
|||||||
use Route;
|
use Route;
|
||||||
use Session;
|
use Session;
|
||||||
use Steam;
|
use Steam;
|
||||||
use Artisan;
|
|
||||||
/**
|
/**
|
||||||
* Class HomeController
|
* Class HomeController
|
||||||
*
|
*
|
||||||
|
@@ -193,7 +193,6 @@ Route::group(
|
|||||||
Route::post('/accounts/destroy/{account}', ['uses' => 'AccountController@destroy', 'as' => 'accounts.destroy']);
|
Route::post('/accounts/destroy/{account}', ['uses' => 'AccountController@destroy', 'as' => 'accounts.destroy']);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attachment Controller
|
* Attachment Controller
|
||||||
*/
|
*/
|
||||||
|
@@ -12,6 +12,21 @@ use FireflyIII\Models\Attachment;
|
|||||||
class AttachmentRepository implements AttachmentRepositoryInterface
|
class AttachmentRepository implements AttachmentRepositoryInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Attachment $attachment
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function destroy(Attachment $attachment)
|
||||||
|
{
|
||||||
|
/** @var \FireflyIII\Helpers\Attachments\AttachmentHelperInterface $helper */
|
||||||
|
$helper = app('FireflyIII\Helpers\Attachments\AttachmentHelperInterface');
|
||||||
|
|
||||||
|
$file = $helper->getAttachmentLocation($attachment);
|
||||||
|
unlink($file);
|
||||||
|
$attachment->delete();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Attachment $attachment
|
* @param Attachment $attachment
|
||||||
* @param array $data
|
* @param array $data
|
||||||
@@ -29,19 +44,4 @@ class AttachmentRepository implements AttachmentRepositoryInterface
|
|||||||
return $attachment;
|
return $attachment;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Attachment $attachment
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function destroy(Attachment $attachment)
|
|
||||||
{
|
|
||||||
/** @var \FireflyIII\Helpers\Attachments\AttachmentHelperInterface $helper */
|
|
||||||
$helper = app('FireflyIII\Helpers\Attachments\AttachmentHelperInterface');
|
|
||||||
|
|
||||||
$file = $helper->getAttachmentLocation($attachment);
|
|
||||||
unlink($file);
|
|
||||||
$attachment->delete();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -12,6 +12,13 @@ use FireflyIII\Models\Attachment;
|
|||||||
interface AttachmentRepositoryInterface
|
interface AttachmentRepositoryInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Attachment $attachment
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function destroy(Attachment $attachment);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Attachment $attachment
|
* @param Attachment $attachment
|
||||||
* @param array $attachmentData
|
* @param array $attachmentData
|
||||||
@@ -19,12 +26,5 @@ interface AttachmentRepositoryInterface
|
|||||||
* @return Attachment
|
* @return Attachment
|
||||||
*/
|
*/
|
||||||
public function update(Attachment $attachment, array $attachmentData);
|
public function update(Attachment $attachment, array $attachmentData);
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Attachment $attachment
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function destroy(Attachment $attachment);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,6 +8,16 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
*/
|
*/
|
||||||
class ChangesForV349 extends Migration
|
class ChangesForV349 extends Migration
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*
|
*
|
||||||
@@ -22,14 +32,4 @@ class ChangesForV349 extends Migration
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -8,6 +8,17 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
*/
|
*/
|
||||||
class ChangesForV3410 extends Migration
|
class ChangesForV3410 extends Migration
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::drop('attachments');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*
|
*
|
||||||
@@ -42,16 +53,4 @@ class ChangesForV3410 extends Migration
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::drop('attachments');
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -30,9 +30,11 @@
|
|||||||
{{ Lang.choice('form.also_delete_piggyBanks', account.piggyBanks|length, {count: account.piggyBanks|length}) }}
|
{{ Lang.choice('form.also_delete_piggyBanks', account.piggyBanks|length, {count: account.piggyBanks|length}) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p class="text-success">
|
<p class="text-success">
|
||||||
{{ 'save_transactions_by_moving'|_ }}
|
{{ 'save_transactions_by_moving'|_ }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{{ Form.select('move_account_before_delete', accountList, null, {class: 'form-control'}) }}
|
{{ Form.select('move_account_before_delete', accountList, null, {class: 'form-control'}) }}
|
||||||
</p>
|
</p>
|
||||||
|
@@ -55,6 +55,5 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@@ -54,6 +54,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@@ -1,12 +1,14 @@
|
|||||||
<div class="popover" role="tooltip">
|
<div class="popover" role="tooltip">
|
||||||
<div class="arrow"></div>
|
<div class="arrow"></div>
|
||||||
<h3 class="popover-title"></h3>
|
<h3 class="popover-title"></h3>
|
||||||
|
|
||||||
<div class="popover-content"></div>
|
<div class="popover-content"></div>
|
||||||
<div class="popover-navigation">
|
<div class="popover-navigation">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button class="btn btn-sm btn-default" data-role="prev">« {{ 'prev'|_ }}</button>
|
<button class="btn btn-sm btn-default" data-role="prev">« {{ 'prev'|_ }}</button>
|
||||||
<button class="btn btn-sm btn-default" data-role="next">{{ 'prev'|_ }} »</button>
|
<button class="btn btn-sm btn-default" data-role="next">{{ 'prev'|_ }} »</button>
|
||||||
<button class="btn btn-sm btn-default" data-role="pause-resume" data-pause-text="{{ 'pause'|_ }}" data-resume-text="Resume"> {{ 'pause'|_ }}</button>
|
<button class="btn btn-sm btn-default" data-role="pause-resume" data-pause-text="{{ 'pause'|_ }}"
|
||||||
|
data-resume-text="Resume"> {{ 'pause'|_ }}</button>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn btn-sm btn-default" data-role="end">{{ 'end-tour'|_ }}</button>
|
<button class="btn btn-sm btn-default" data-role="end">{{ 'end-tour'|_ }}</button>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -53,7 +53,8 @@
|
|||||||
<td>
|
<td>
|
||||||
<a href="{{ route('transactions.show',journal.id) }}" title="{{ journal.description }}">{{ journal.description }}</a>
|
<a href="{{ route('transactions.show',journal.id) }}" title="{{ journal.description }}">{{ journal.description }}</a>
|
||||||
{% if journal.attachments|length > 0 %}
|
{% if journal.attachments|length > 0 %}
|
||||||
<i class="fa fa-paperclip pull-right" title="{{ Lang.choice('firefly.nr_of_attachments', journal.attachments|length, {count: journal.attachments|length}) }}"></i>
|
<i class="fa fa-paperclip pull-right"
|
||||||
|
title="{{ Lang.choice('firefly.nr_of_attachments', journal.attachments|length, {count: journal.attachments|length}) }}"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
<p class="text-danger">
|
<p class="text-danger">
|
||||||
{{ trans('form.permDeleteWarning') }}
|
{{ trans('form.permDeleteWarning') }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{{ trans('form.tag_areYouSure', {'tag': tag.tag}) }}
|
{{ trans('form.tag_areYouSure', {'tag': tag.tag}) }}
|
||||||
</p>
|
</p>
|
||||||
|
Reference in New Issue
Block a user