mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-20 19:35:16 +00:00
Code cleanup.
This commit is contained in:
@@ -124,7 +124,7 @@ class AttachmentController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function preview(Attachment $attachment)
|
public function preview(Attachment $attachment)
|
||||||
{
|
{
|
||||||
if($attachment->mime == 'application/pdf') {
|
if ($attachment->mime == 'application/pdf') {
|
||||||
$file = public_path('images/page_white_acrobat.png');
|
$file = public_path('images/page_white_acrobat.png');
|
||||||
} else {
|
} else {
|
||||||
$file = public_path('images/page_green.png');
|
$file = public_path('images/page_green.png');
|
||||||
|
@@ -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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -49,7 +49,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $fillable = ['email', 'password','blocked','blocked_code'];
|
protected $fillable = ['email', 'password', 'blocked', 'blocked_code'];
|
||||||
/**
|
/**
|
||||||
* The attributes excluded from the model's JSON form.
|
* The attributes excluded from the model's JSON form.
|
||||||
*
|
*
|
||||||
|
@@ -145,12 +145,12 @@ return [
|
|||||||
'ExpandedForm' => [
|
'ExpandedForm' => [
|
||||||
'is_safe' => [
|
'is_safe' => [
|
||||||
'date', 'text', 'select', 'balance', 'optionsList', 'checkbox', 'amount', 'tags', 'integer', 'textarea', 'location',
|
'date', 'text', 'select', 'balance', 'optionsList', 'checkbox', 'amount', 'tags', 'integer', 'textarea', 'location',
|
||||||
'multiRadio','file','multiCheckbox','staticText'
|
'multiRadio', 'file', 'multiCheckbox', 'staticText'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'Form' => [
|
'Form' => [
|
||||||
'is_safe' => [
|
'is_safe' => [
|
||||||
'input', 'select', 'checkbox', 'model', 'open', 'radio', 'textarea','file'
|
'input', 'select', 'checkbox', 'model', 'open', 'radio', 'textarea', 'file'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
@@ -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>
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{{'tags_group'|_ }}
|
{{ 'tags_group'|_ }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
Reference in New Issue
Block a user