mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-06 18:02:42 +00:00
Code cleanup.
This commit is contained in:
@@ -124,7 +124,7 @@ class AttachmentController extends Controller
|
||||
*/
|
||||
public function preview(Attachment $attachment)
|
||||
{
|
||||
if($attachment->mime == 'application/pdf') {
|
||||
if ($attachment->mime == 'application/pdf') {
|
||||
$file = public_path('images/page_white_acrobat.png');
|
||||
} else {
|
||||
$file = public_path('images/page_green.png');
|
||||
|
||||
@@ -6,7 +6,6 @@ use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Preferences;
|
||||
use Session;
|
||||
use View;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php namespace FireflyIII\Http\Controllers;
|
||||
|
||||
use Artisan;
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Config;
|
||||
@@ -11,7 +12,7 @@ use Preferences;
|
||||
use Route;
|
||||
use Session;
|
||||
use Steam;
|
||||
use Artisan;
|
||||
|
||||
/**
|
||||
* Class HomeController
|
||||
*
|
||||
|
||||
@@ -193,7 +193,6 @@ Route::group(
|
||||
Route::post('/accounts/destroy/{account}', ['uses' => 'AccountController@destroy', 'as' => 'accounts.destroy']);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Attachment Controller
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,21 @@ use FireflyIII\Models\Attachment;
|
||||
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 array $data
|
||||
@@ -29,19 +44,4 @@ class AttachmentRepository implements AttachmentRepositoryInterface
|
||||
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
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Attachment $attachment
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function destroy(Attachment $attachment);
|
||||
|
||||
/**
|
||||
* @param Attachment $attachment
|
||||
* @param array $attachmentData
|
||||
@@ -19,12 +26,5 @@ interface AttachmentRepositoryInterface
|
||||
* @return Attachment
|
||||
*/
|
||||
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
|
||||
*/
|
||||
protected $fillable = ['email', 'password','blocked','blocked_code'];
|
||||
protected $fillable = ['email', 'password', 'blocked', 'blocked_code'];
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
|
||||
@@ -145,12 +145,12 @@ return [
|
||||
'ExpandedForm' => [
|
||||
'is_safe' => [
|
||||
'date', 'text', 'select', 'balance', 'optionsList', 'checkbox', 'amount', 'tags', 'integer', 'textarea', 'location',
|
||||
'multiRadio','file','multiCheckbox','staticText'
|
||||
'multiRadio', 'file', 'multiCheckbox', 'staticText'
|
||||
]
|
||||
],
|
||||
'Form' => [
|
||||
'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
|
||||
{
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('attachments');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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}) }}
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<p class="text-success">
|
||||
{{ 'save_transactions_by_moving'|_ }}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{{ Form.select('move_account_before_delete', accountList, null, {class: 'form-control'}) }}
|
||||
</p>
|
||||
|
||||
@@ -55,6 +55,5 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
<div class="popover" role="tooltip">
|
||||
<div class="arrow"></div>
|
||||
<h3 class="popover-title"></h3>
|
||||
|
||||
<div class="popover-content"></div>
|
||||
<div class="popover-navigation">
|
||||
<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="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>
|
||||
<button class="btn btn-sm btn-default" data-role="end">{{ 'end-tour'|_ }}</button>
|
||||
</div>
|
||||
|
||||
@@ -53,7 +53,8 @@
|
||||
<td>
|
||||
<a href="{{ route('transactions.show',journal.id) }}" title="{{ journal.description }}">{{ journal.description }}</a>
|
||||
{% 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 %}
|
||||
|
||||
</td>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<p class="text-danger">
|
||||
{{ trans('form.permDeleteWarning') }}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{{ trans('form.tag_areYouSure', {'tag': tag.tag}) }}
|
||||
</p>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{{'tags_group'|_ }}
|
||||
{{ 'tags_group'|_ }}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user