Skip to content

Commit 3cf4838

Browse files
authored
Merge pull request #32 from panichelpdesk/analysis-L3vlrn
Apply fixes from StyleCI
2 parents e4856a8 + 483b715 commit 3cf4838

File tree

8 files changed

+17
-21
lines changed

8 files changed

+17
-21
lines changed

src/Controllers/ConfigurationsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function index()
2828
'list_owner_notification', 'status_owner_notification', 'email.template', 'email.owner.newticket.template', 'email.account.name', 'email.account.mailbox', 'custom_recipients', ];
2929
$tickets_section = ['default_priority_id', 'default_status_id', 'default_close_status_id', 'default_reopen_status_id',
3030
'attachments_ticket_max_size', 'attachments_ticket_max_files_num', 'attachments_mimes',
31-
'attachments_path', 'thumbnails_path', 'oldest_year', 'html_replacements', 'use_default_status_id', 'delete_modal_type', 'embedded_image_prefix'];
31+
'attachments_path', 'thumbnails_path', 'oldest_year', 'html_replacements', 'use_default_status_id', 'delete_modal_type', 'embedded_image_prefix', ];
3232
$perms_section = ['agent_restrict', 'close_ticket_perm', 'reopen_ticket_perm'];
3333
$editor_section = ['editor_enabled', 'editor_html_highlighter', 'codemirror_theme',
3434
'summernote_locale', 'summernote_options_json_file', 'summernote_options_user', 'purifier_config', ];

src/Controllers/TicketsController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,13 @@ public function getTicketCollectionFrom($ticketList)
176176
});
177177
}
178178

179-
if (isset($search_fields['attachment_text'])){
179+
if (isset($search_fields['attachment_text'])) {
180180
$collection->whereIn('panichd_tickets.id', $this->listTicketsWhereAttachmentHas($search_fields['attachment_text']));
181181
}
182182

183183
if (isset($search_fields['any_text_field'])) {
184184
$a_attachment_tickets = $this->listTicketsWhereAttachmentHas($search_fields['any_text_field']);
185-
185+
186186
// Coincidence in any ticket field
187187
$collection->where(function ($query) use ($search_fields, $a_attachment_tickets) {
188188
$query->where('subject', 'like', '%'.$search_fields['any_text_field'].'%')

src/PanicHDServiceProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,8 @@ public function boot()
189189
// $editor_options = $user_editor != "0" ? $user_editor : file_get_contents(base_path(Setting::grab('summernote_options_json_file')));
190190
if ($user_editor != '0') {
191191
$editor_options = $user_editor;
192-
193-
}elseif (Setting::grab('summernote_options_json_file') != 'default' and file_exists(base_path(Setting::grab('summernote_options_json_file')))) {
192+
} elseif (Setting::grab('summernote_options_json_file') != 'default' and file_exists(base_path(Setting::grab('summernote_options_json_file')))) {
194193
$editor_options = file_get_contents(base_path(Setting::grab('summernote_options_json_file')));
195-
196194
} else {
197195
$editor_options = file_get_contents(realpath(__DIR__).'/JSON/summernote_init.json');
198196
}

src/Seeds/DemoDataSeeder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function run()
199199
$this->comments_per_ticket_max
200200
);
201201

202-
if ($comments_qty){
202+
if ($comments_qty) {
203203
for ($c = 1; $c <= $comments_qty; $c++) {
204204
if (is_null($ticket->completed_at)) {
205205
$random_comment_date = $faker->dateTimeBetween(

src/Seeds/SettingsTableSeeder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ public function getDefaults()
300300
/*
301301
* Prefix for embedded images: Embedded images in text fields with resolutions above specified limit
302302
* get transformed in an attachment with an image thumbnail. That attachment name is
303-
* formed by this field value and an automatic number
303+
* formed by this field value and an automatic number
304304
* Default: embedded_image
305305
*/
306306
'embedded_image_prefix' => 'image',

src/Traits/Attachments.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function createAttachmentsFrom($html, $ticket, $comment = false, $coun
8282
$node->setAttribute('class', 'summernote_embedded_image');
8383
} else {
8484
// Create filename
85-
$original_filename = Setting::grab('embedded_image_prefix') . '_' . ($i + $count).'.png';
85+
$original_filename = Setting::grab('embedded_image_prefix').'_'.($i + $count).'.png';
8686

8787
$file_name = $this->makeFilename($original_filename.date('YmdHis', time()), $ticket->id.'_embedded', '');
8888

@@ -613,23 +613,22 @@ protected function deleteThumbnail($file_name)
613613
/*
614614
* Search a string in all attachment fields
615615
* Return ticket id's that contain the found attachments
616-
*
616+
*
617617
* @return Array
618618
*/
619619
public function listTicketsWhereAttachmentHas($needle)
620620
{
621621
// Coincidence in Ticket / Comment attachments
622-
$attachments_col = Attachment::where('original_filename', 'like', '%' . $needle . '%')
623-
->orWhere('new_filename', 'like', '%' . $needle . '%')
624-
->orWhere('description', 'like', '%' . $needle . '%')
622+
$attachments_col = Attachment::where('original_filename', 'like', '%'.$needle.'%')
623+
->orWhere('new_filename', 'like', '%'.$needle.'%')
624+
->orWhere('description', 'like', '%'.$needle.'%')
625625
->with('ticket', 'comment.ticket')->get();
626-
626+
627627
$a_ticket_ids = [];
628-
foreach ($attachments_col as $att){
629-
if (!is_null($att->ticket)){
628+
foreach ($attachments_col as $att) {
629+
if (!is_null($att->ticket)) {
630630
$a_ticket_ids[] = $att->ticket->id;
631-
632-
}elseif (!is_null($att->comment) and !is_null($att->comment->ticket)){
631+
} elseif (!is_null($att->comment) and !is_null($att->comment->ticket)) {
633632
$a_ticket_ids[] = $att->comment->ticket->id;
634633
}
635634
}

src/Translations/es/settings.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@
6666
6767
<p>Opciones: <code>modal</code>, <code>integrada</code></p>
6868
ENDHTML
69-
, 'embedded_image_prefix' => 'Las imágenes incrustadas con resolución por encima del límite son transformadas en un fichero adjunto que tiene de nombre este prefijo con una numeración automática',
70-
69+
, 'embedded_image_prefix' => 'Las imágenes incrustadas con resolución por encima del límite son transformadas en un fichero adjunto que tiene de nombre este prefijo con una numeración automática',
7170

7271
/* ------------------ JS EDITOR ------------------ */, 'editor_enabled' => <<<'ENDHTML'
7372
<p>Activar editor summernote en áreas de texto</p>

src/routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
'parameters' => [
8585
$field_name => 'ticket_comment',
8686
],
87-
]);
87+
]);
8888

8989
//Ticket complete route for permitted user.
9090
Route::patch("$main_route_path/{id}/complete", 'PanicHD\PanicHD\Controllers\TicketsController@complete')

0 commit comments

Comments
 (0)