From daa603f9e5133b2a6c0d5c2c6fdfdd74703bad78 Mon Sep 17 00:00:00 2001 From: Abdy Franco Date: Fri, 30 Jan 2026 15:43:51 -0600 Subject: [PATCH 1/2] Update admin views --- config.json | 3 +- views/default/admin_main.pdt | 186 +++++++++---------- views/default/admin_main_add.pdt | 291 +++++++++++++++--------------- views/default/admin_main_edit.pdt | 291 +++++++++++++++--------------- views/default/admin_main_logs.pdt | 166 ++++++++--------- views/default/admin_main_view.pdt | 241 +++++++++++-------------- 6 files changed, 559 insertions(+), 619 deletions(-) diff --git a/config.json b/config.json index 6bbed36..01d59cb 100644 --- a/config.json +++ b/config.json @@ -1,7 +1,8 @@ { - "version": "1.3.1", + "version": "2.0.0", "name": "WebhooksPlugin.name", "description": "WebhooksPlugin.description", + "icon": "bi bi-plug-fill", "authors": [ { "name": "Phillips Data, Inc.", diff --git a/views/default/admin_main.pdt b/views/default/admin_main.pdt index 5b2fa3c..d28135d 100644 --- a/views/default/admin_main.pdt +++ b/views/default/admin_main.pdt @@ -1,106 +1,108 @@ - $this->_('AdminMain.index.category_outgoing', true) . ' (' . (isset($type_count['outgoing']) ? $this->Html->safe($type_count['outgoing']) : null) . ')', 'current' => ((isset($type) ? $type : null) == 'outgoing' ? true : false), 'attributes' => ['href' => $this->base_uri . 'plugin/webhooks/admin_main/index/outgoing/', 'class' => 'ajax']], - ['name' => $this->_('AdminMain.index.category_incoming', true) . ' (' . (isset($type_count['incoming']) ? $this->Html->safe($type_count['incoming']) : null) . ')', 'current' => ((isset($type) ? $type : null) == 'incoming' ? true : false), 'attributes' => ['href' => $this->base_uri . 'plugin/webhooks/admin_main/index/incoming/', 'class' => 'ajax']] - ]; - $link_buttons = [ - [ - 'icon' => 'fas fa-plus', - 'name' => '', - 'attributes' => [ - 'title' => $this->_('AdminMain.index.categorylink_addwebhook', true), - 'href' => $this->Html->safe($this->base_uri . 'plugin/webhooks/admin_main/add/') - ] - ], - [ - 'icon' => 'fas fa-list', - 'name' => $this->_('AdminMain.index.categorylink_viewlogs', true), - 'attributes' => [ - 'title' => $this->_('AdminMain.index.categorylink_viewlogs', true), - 'href' => $this->Html->safe($this->base_uri . 'plugin/webhooks/admin_main/logs/') - ] - ] - ]; +$links = [ + [ + 'name' => $this->_('AdminMain.index.category_outgoing', true) . '' . ($type_count['outgoing'] ?? 0) . '', + 'current' => ($type ?? null) == 'outgoing', + 'attributes' => ['href' => $this->base_uri . 'plugin/webhooks/admin_main/index/outgoing/', 'class' => 'ajax'] + ], + [ + 'name' => $this->_('AdminMain.index.category_incoming', true) . '' . ($type_count['incoming'] ?? 0) . '', + 'current' => ($type ?? null) == 'incoming', + 'attributes' => ['href' => $this->base_uri . 'plugin/webhooks/admin_main/index/incoming/', 'class' => 'ajax'] + ] +]; +$link_buttons = [ + [ + 'icon' => 'bi bi-plus-lg', + 'name' => '', + 'attributes' => [ + 'title' => $this->_('AdminMain.index.categorylink_addwebhook', true), + 'href' => $this->Html->safe($this->base_uri . 'plugin/webhooks/admin_main/add/') + ] + ], + [ + 'icon' => 'bi bi-list me-1', + 'name' => $this->_('AdminMain.index.categorylink_viewlogs', true), + 'attributes' => [ + 'title' => $this->_('AdminMain.index.categorylink_viewlogs', true), + 'href' => $this->Html->safe($this->base_uri . 'plugin/webhooks/admin_main/logs/') + ] + ] +]; - $this->Widget->clear(); - $this->Widget->setLinks($links); - $this->Widget->setLinkButtons($link_buttons); - $this->Widget->create($this->_('AdminMain.index.boxtitle_webhooks', true), ['id' => 'admin_main'], ($render_section ?? null)); +$this->Widget->clear(); +$this->Widget->setLinks($links); +$this->Widget->setLinkButtons($link_buttons); +$this->Widget->setBodyWrapper(false); +$this->Widget->create($this->_('AdminMain.index.boxtitle_webhooks', true), ['id' => 'admin_main'], ($render_section ?? null)); - if (($webhooks ?? false) && ($num_tickets = count($webhooks)) > 0) { +if (($webhooks ?? false) && ($num_tickets = count($webhooks)) > 0) { +?> + + + + + + + + + + + -

_('AdminMain.index.text_description_' . ($type ?? 'outgoing'));?>

-
_('AdminMain.index.heading_callback');?>_('AdminMain.index.heading_event');?>_('AdminMain.index.heading_method');?>_('AdminMain.index.heading_options');?>
- - - - - - - - > - - + + + + - - - - -
_('AdminMain.index.heading_callback');?>_('AdminMain.index.heading_event');?>_('AdminMain.index.heading_method');?>_('AdminMain.index.heading_options');?>
- Html->safe('http://' . Configure::get('Blesta.company')->hostname . $this->base_uri . 'plugin/webhooks/trigger/index/' . ($webhook->callback ?? '')); - } else { - echo $this->Html->safe($webhook->callback ?? ''); - } - ?> - - events ?? [] as $event) { - ?> -
Html->safe($event);?>
+
+ Html->safe('http://' . Configure::get('Blesta.company')->hostname . $this->base_uri . 'plugin/webhooks/trigger/index/' . ($webhook->callback ?? '')); + } else { + echo $this->Html->safe($webhook->callback ?? ''); + } + ?> + + events ?? [] as $event) { + ?> + Html->safe($event);?> + + Html->safe(strtoupper($webhook->method ?? ''));?> + Html->safe(strtoupper($webhook->method ?? ''));?> - _('AdminMain.index.option_logs');?>, - _('AdminMain.index.option_edit');?>, - Form->create($this->base_uri . 'plugin/webhooks/admin_main/delete/'); + $this->Form->create($this->base_uri . 'plugin/webhooks/admin_main/delete/', ['class' => 'd-inline']); $this->Form->fieldHidden('id', ($webhook->id ?? null)); ?> - _('AdminMain.index.option_delete');?> + Form->end(); ?> -
- Pagination->build(); - } else { - ?> -
-
- _('AdminMain.index.no_results');?> -
-
+ + + Widget->end(); ?> + + +Pagination->build(); +} else { +?> +
+ +

_('AdminMain.index.no_results');?>

+
+ - $(document).ready(function() { - // Handle confirmation - $('#admin_main a.manage[rel]').blestaModalConfirm({base_url: 'base_uri) ? $this->Html->safe($this->base_uri) : null);?>', close: '_('AppController.modal.text_close');?>', submit: true}); - }); - +$this->Widget->end(); +?> diff --git a/views/default/admin_main_add.pdt b/views/default/admin_main_add.pdt index f2b2b4c..54c3bbf 100644 --- a/views/default/admin_main_add.pdt +++ b/views/default/admin_main_add.pdt @@ -2,179 +2,170 @@ echo ($message ?? null); $this->Widget->clear(); +$this->Widget->setBodyWrapper(false); $this->Widget->create($this->_('AdminMain.add.boxtitle_addwebhook', true)); ?> -
- Form->create(null, ['id' => 'webhook', 'class' => 'disable-on-submit']);?> -
-

_('AdminMain.add.heading_event');?>

+Form->create(null, ['id' => 'webhook', 'class' => 'disable-on-submit']);?> +
+
_('AdminMain.add.heading_event');?>
+ +
+ Form->label($this->_('AdminMain.add.field_callback', true), 'callback', ['class' => 'form-label']); + ?> +
+ + Form->fieldText('callback', ($vars->callback ?? null), ['id' => 'callback', 'class' => 'form-control']); + ?> +
-
-
    -
  • - Form->label($this->_('AdminMain.add.field_callback', true), 'callback'); - ?> -
    +
    + +
    + Form->label($this->_('AdminMain.add.field_event', true), 'event', ['class' => 'form-label']); + ?> +
    + $name) { + ?> +
    +
    Form->label($this->Html->safe('http://' . Configure::get('Blesta.company')->hostname . $this->base_uri . 'plugin/webhooks/trigger/index/'), null, ['class' => 'inline callback_url']); - $this->Form->fieldText('callback', ($vars->callback ?? null), ['id' => 'callback', 'class' => 'inline']); + $this->Form->fieldCheckbox('events[]', $event, in_array($event, $vars->events ?? []), ['id' => 'events_' . $event, 'class' => 'form-check-input']); + $this->Form->label($name, 'events_' . $event, ['class' => 'form-check-label']); ?> - _('AppController.tooltip.text');?>
    _('AdminMain.!tooltip.callback');?>
    -
  • -
  • - Form->label($this->_('AdminMain.add.field_event', true), 'event'); - ?> +
+ +
+
+ +
+ Form->label($this->_('AdminMain.add.field_type', true), 'type', ['class' => 'form-label']); + $this->Form->fieldSelect('type', ($types ?? null), ($vars->type ?? null), ['id' => 'type', 'class' => 'form-select']); + ?> +
+ +
+ Form->label($this->_('AdminMain.add.field_method', true), 'method', ['class' => 'form-label']); + $this->Form->fieldSelect('method', ($methods ?? null), ($vars->method ?? null), ['id' => 'method', 'class' => 'form-select']); + ?> +
+ +
_('AdminMain.add.heading_fields_map');?>
+

_('AdminMain.add.text_fields_map');?>

+ + -
+ + + + + + + + + + fields)) { + $vars->fields = [['field' => null, 'parameter' => null]]; + } + + foreach ($vars->fields ?? [] as $field) { + $field = (array) $field; + ?> + + + +
_('AdminMain.add.heading_field');?>_('AdminMain.add.heading_parameter');?>_('AdminMain.add.heading_options');?>
$name) { + $this->Form->fieldText('fields[' . $i . '][field]', ($field['field'] ?? null), ['class' => 'form-control']); ?> -
-
- Form->fieldCheckbox('events[]', $event, in_array($event, $vars->events ?? []), ['id' => 'events_' . $event]); - $this->Form->label($name, 'events_' . $event, ['class' => 'inline']); - ?> -
-
+
Form->fieldText('fields[' . $i . '][parameter]', ($field['parameter'] ?? null), ['class' => 'form-control']); ?> - - -
  • - Form->label($this->_('AdminMain.add.field_type', true), 'type'); - $this->Form->fieldSelect('type', ($types ?? null), ($vars->type ?? null), ['id' => 'type']); - ?> -
  • -
  • - Form->label($this->_('AdminMain.add.field_method', true), 'method'); - $this->Form->fieldSelect('method', ($methods ?? null), ($vars->method ?? null), ['id' => 'method']); - ?> -
  • - - - -
    -

    _('AdminMain.add.heading_fields_map');?>

    -
    -
    -

    _('AdminMain.add.text_fields_map');?>

    - - - - - - - - + + - fields)) { - $vars->fields = [['field' => null, 'parameter' => null]]; - } - - foreach ($vars->fields ?? [] as $field) { - $field = (array) $field; - ?> - - - - - - -
    _('AdminMain.add.heading_field');?>_('AdminMain.add.heading_parameter');?>_('AdminMain.add.heading_options');?> + _('AdminMain.add.option_delete');?> +
    - Form->fieldText('fields[' . $i . '][field]', ($field['field'] ?? null), ['class' => 'stretch']); - ?> - - Form->fieldText('fields[' . $i . '][parameter]', ($field['parameter'] ?? null), ['class' => 'stretch']); - ?> - - _('AdminMain.add.option_delete');?> -
    -
    - -
    Form->fieldSubmit('save', $this->_('AdminMain.add.field_addsubmit', true), ['class' => 'btn btn-primary float-right']); + $i++; + } + unset($i); ?> - _('AdminMain.add.field_cancel');?> -
    - Form->end();?> - +
    +
    + +Form->end();?> Widget->end();?> \ No newline at end of file + }); + diff --git a/views/default/admin_main_edit.pdt b/views/default/admin_main_edit.pdt index cc41b48..26d26bc 100644 --- a/views/default/admin_main_edit.pdt +++ b/views/default/admin_main_edit.pdt @@ -2,179 +2,170 @@ echo ($message ?? null); $this->Widget->clear(); +$this->Widget->setBodyWrapper(false); $this->Widget->create($this->_('AdminMain.edit.boxtitle_editwebhook', true)); ?> -
    - Form->create(null, ['id' => 'webhook', 'class' => 'disable-on-submit']);?> -
    -

    _('AdminMain.edit.heading_event');?>

    +Form->create(null, ['id' => 'webhook', 'class' => 'disable-on-submit']);?> +
    +
    _('AdminMain.edit.heading_event');?>
    + +
    + Form->label($this->_('AdminMain.edit.field_callback', true), 'callback'); + ?> +
    + + Form->fieldText('callback', ($vars->callback ?? null), ['id' => 'callback', 'class' => 'form-control']); + ?> +
    -
    -
      -
    • - Form->label($this->_('AdminMain.edit.field_callback', true), 'callback'); - ?> -
      +
      + +
      + Form->label($this->_('AdminMain.edit.field_event', true), 'event'); + ?> +
      + $name) { + ?> +
      +
      Form->label($this->Html->safe('http://' . Configure::get('Blesta.company')->hostname . $this->base_uri . 'plugin/webhooks/trigger/index/'), null, ['class' => 'inline callback_url']); - $this->Form->fieldText('callback', ($vars->callback ?? null), ['id' => 'callback', 'class' => 'inline']); + $this->Form->fieldCheckbox('events[]', $event, in_array($event, $vars->events ?? []), ['id' => 'events_' . $event, 'class' => 'form-check-input']); + $this->Form->label($name, 'events_' . $event, ['class' => 'form-check-label']); ?> - _('AppController.tooltip.text');?>
      _('AdminMain.!tooltip.callback');?>
      -
    • -
    • - Form->label($this->_('AdminMain.edit.field_event', true), 'event'); - ?> +
    + +
    +
    + +
    + Form->label($this->_('AdminMain.edit.field_type', true), 'type'); + $this->Form->fieldSelect('type', ($types ?? null), ($vars->type ?? null), ['id' => 'type', 'class' => 'form-select']); + ?> +
    + +
    + Form->label($this->_('AdminMain.edit.field_method', true), 'method'); + $this->Form->fieldSelect('method', ($methods ?? null), ($vars->method ?? null), ['id' => 'method', 'class' => 'form-select']); + ?> +
    + +
    _('AdminMain.edit.heading_fields_map');?>
    +

    _('AdminMain.edit.text_fields_map');?>

    + + -
    + + + + + + + + + + fields)) { + $vars->fields = [['field' => null, 'parameter' => null]]; + } + + foreach ($vars->fields ?? [] as $field) { + $field = (array) $field; + ?> + + + +
    _('AdminMain.edit.heading_field');?>_('AdminMain.edit.heading_parameter');?>_('AdminMain.edit.heading_options');?>
    $name) { + $this->Form->fieldText('fields[' . $i . '][field]', ($field['field'] ?? null), ['class' => 'form-control']); ?> -
    -
    - Form->fieldCheckbox('events[]', $event, in_array($event, $vars->events ?? []), ['id' => 'events_' . $event]); - $this->Form->label($name, 'events_' . $event, ['class' => 'inline']); - ?> -
    -
    +
    Form->fieldText('fields[' . $i . '][parameter]', ($field['parameter'] ?? null), ['class' => 'form-control']); ?> - - -
  • - Form->label($this->_('AdminMain.edit.field_type', true), 'type'); - $this->Form->fieldSelect('type', ($types ?? null), ($vars->type ?? null), ['id' => 'type']); - ?> -
  • -
  • - Form->label($this->_('AdminMain.edit.field_method', true), 'method'); - $this->Form->fieldSelect('method', ($methods ?? null), ($vars->method ?? null), ['id' => 'method']); - ?> -
  • - - - -
    -

    _('AdminMain.edit.heading_fields_map');?>

    -
    -
    -

    _('AdminMain.edit.text_fields_map');?>

    - - - - - - - - + + - fields)) { - $vars->fields = [['field' => null, 'parameter' => null]]; - } - - foreach ($vars->fields ?? [] as $field) { - $field = (array) $field; - ?> - - - - - - -
    _('AdminMain.edit.heading_field');?>_('AdminMain.edit.heading_parameter');?>_('AdminMain.edit.heading_options');?> + _('AdminMain.edit.option_delete');?> +
    - Form->fieldText('fields[' . $i . '][field]', ($field['field'] ?? null), ['class' => 'stretch']); - ?> - - Form->fieldText('fields[' . $i . '][parameter]', ($field['parameter'] ?? null), ['class' => 'stretch']); - ?> - - _('AdminMain.edit.option_delete');?> -
    -
    - -
    Form->fieldSubmit('save', $this->_('AdminMain.edit.field_editsubmit', true), ['class' => 'btn btn-primary float-right']); + $i++; + } + unset($i); ?> - _('AdminMain.edit.field_cancel');?> -
    - Form->end();?> - +
    +
    + +Form->end();?> Widget->end();?> \ No newline at end of file + }); + diff --git a/views/default/admin_main_logs.pdt b/views/default/admin_main_logs.pdt index 9d4f9c5..ec6c44b 100644 --- a/views/default/admin_main_logs.pdt +++ b/views/default/admin_main_logs.pdt @@ -1,99 +1,91 @@ - 'fas fa-arrow-left', - 'name' => $this->_('AdminMain.logs.categorylink_viewwebhooks', true), - 'attributes' => [ - 'title' => $this->_('AdminMain.logs.categorylink_viewwebhooks', true), - 'href' => $this->Html->safe($this->base_uri . 'plugin/webhooks/admin_main/') - ] - ] - ]; +Widget->clear(); - $this->Widget->setLinkButtons($link_buttons); - $this->Widget->setFilters($filters, $this->Html->safe($this->base_uri . 'plugin/webhooks/admin_main/logs/'), !empty($filter_vars)); - $this->Widget->setAjaxFiltering(); - $this->Widget->create($this->_('AdminMain.logs.boxtitle_logs', true), ['id' => 'admin_main_logs'], ($render_section ?? null)); - ?> +$link_buttons = [ + [ + 'icon' => 'bi bi-arrow-left', + 'attributes' => [ + 'title' => $this->_('AdminMain.logs.categorylink_viewwebhooks', true), + 'href' => $this->Html->safe($this->base_uri . 'plugin/webhooks/admin_main/') + ] + ] +]; -
    +$this->Widget->clear(); +$this->Widget->setLinkButtons($link_buttons); +$this->Widget->setFilters($filters, $this->Html->safe($this->base_uri . 'plugin/webhooks/admin_main/logs/'), !empty($filter_vars)); +$this->Widget->setAjaxFiltering(); +$this->Widget->setBodyWrapper(false); +$this->Widget->create($this->_('AdminMain.logs.boxtitle_logs', true), ['id' => 'admin_main_logs'], ($render_section ?? null)); - 0) { - ?> - - - - - - - - - - - +if (($logs ?? false) && count($logs) > 0) { +?> +
    _('AdminMain.logs.heading_webhook');?>_('AdminMain.logs.heading_event');?>_('AdminMain.logs.heading_response');?>_('AdminMain.logs.heading_method');?>_('AdminMain.logs.heading_http_response');?>_('AdminMain.logs.heading_date_triggered');?>_('AdminMain.logs.heading_date_last_retry');?>_('AdminMain.logs.heading_options');?>
    + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + +
    _('AdminMain.logs.heading_webhook');?>_('AdminMain.logs.heading_event');?>_('AdminMain.logs.heading_response');?>_('AdminMain.logs.heading_method');?>_('AdminMain.logs.heading_http_response');?>_('AdminMain.logs.heading_date_triggered');?>_('AdminMain.logs.heading_date_last_retry');?>_('AdminMain.logs.heading_options');?>
    + Html->safe($log->callback ?? '');?> + Html->safe($log->event ?? '');?> Form->fieldTextarea('response', ($log->response ?? ''), ['class' => 'form-control', 'rows' => 4]); ?> - > - - Html->safe($log->callback ?? '');?> - Html->safe($log->event ?? '');?> - Form->fieldTextarea('response', ($log->response ?? ''), ['class' => 'w-100', 'rows' => 4]); - ?> - Html->safe(strtoupper($log->method ?? ''));?>Html->safe($log->http_response ?? '');?>Date->cast($log->date_triggered, 'date_time');?>date_last_retry) ? $this->Date->cast($log->date_last_retry, 'date_time') : '';?> - Form->create($this->base_uri . 'plugin/webhooks/admin_main/retry/'); - $this->Form->fieldHidden('id', ($log->id ?? null)); - ?> - _('AdminMain.logs.option_resend');?> - Form->end(); - ?> -
    Html->safe(strtoupper($log->method ?? ''));?>Html->safe($log->http_response ?? '');?>Date->cast($log->date_triggered, 'date_time');?>date_last_retry) ? $this->Date->cast($log->date_last_retry, 'date_time') : '';?> Form->create($this->base_uri . 'plugin/webhooks/admin_main/retry/', ['class' => 'd-inline']); + $this->Form->fieldHidden('id', ($log->id ?? null)); ?> -
    - Pagination->build(); - } else { - ?> -
    -
    - _('AdminMain.logs.no_results');?> -
    -
    - -
    + + Form->end(); + ?> + + + + + +Pagination->build(); +} else { +?> +
    + +

    _('AdminMain.logs.no_results');?>

    +
    +Widget->end();?> +$this->Widget->end(); +?> diff --git a/views/default/admin_main_view.pdt b/views/default/admin_main_view.pdt index f9e5319..073d465 100644 --- a/views/default/admin_main_view.pdt +++ b/views/default/admin_main_view.pdt @@ -2,164 +2,127 @@ echo ($message ?? null); $this->Widget->clear(); +$this->Widget->setBodyWrapper(false); $this->Widget->create($this->_('AdminMain.view.boxtitle_viewwebhook', true), ['id' => 'admin_main_view'], (isset($render_section) ? $render_section : null)); ?> -
    -
    -
    -
    -

    _('AdminMain.view.heading_webhook');?>

    -
    -
    - - - - - - - - - - - -
    _('AdminMain.view.heading_callback');?>_('AdminMain.view.heading_type');?>_('AdminMain.view.heading_method');?>
    - Html->safe($webhook->callback ?? null);?> - - Html->safe($types[$webhook->type] ?? null);?> - - Html->safe($methods[$webhook->method] ?? null);?> -
    -
    -
    - -
    -
    -

    _('AdminMain.view.heading_events');?>

    -
    -
    - - - - - events ?? [] as $event) { - ?> - - - - -
    _('AdminMain.view.heading_event');?>
    - Html->safe($event ?? null);?> -
    -
    -
    +
    +
    +
    +
    _('AdminMain.view.heading_webhook');?>
    + + + + + + + + + + + + + + + +
    _('AdminMain.view.heading_callback');?>_('AdminMain.view.heading_type');?>_('AdminMain.view.heading_method');?>
    Html->safe($webhook->callback ?? null);?>Html->safe($types[$webhook->type] ?? null);?>Html->safe($methods[$webhook->method] ?? null);?>
    - fields ?? [])) { - ?> -
    -

    _('AdminMain.view.heading_fields_map');?>

    -
    -
    - - - - +
    +
    _('AdminMain.view.heading_events');?>
    +
    _('AdminMain.view.heading_field');?>_('AdminMain.view.heading_parameter');?>
    + + + + + fields ?? [] as $field) { - $field = (array) $field; + foreach ($webhook->events ?? [] as $event) { ?> - - - + + -
    _('AdminMain.view.heading_event');?>
    - Html->safe($field['field'] ?? '');?> - - Html->safe($field['parameter'] ?? '');?> -
    Html->safe($event ?? null);?>
    -
    - - -
    -

    _('AdminMain.view.heading_logs');?>

    + +
    -
    - - - - - - - - + + + fields ?? [])) { + ?> +
    _('AdminMain.view.heading_fields_map');?>
    +
    _('AdminMain.view.heading_event');?>_('AdminMain.view.heading_response');?>_('AdminMain.view.heading_http_response');?>_('AdminMain.view.heading_date_triggered');?>_('AdminMain.view.heading_date_last_retry');?>_('AdminMain.view.heading_options');?>
    + + + + + + fields ?? [] as $field) { + $field = (array) $field; ?> - - - - - - - + + + -
    _('AdminMain.view.heading_field');?>_('AdminMain.view.heading_parameter');?>
    - Html->safe($log->event ?? '');?> - - Form->fieldTextarea('response', ($log->response ?? ''), ['class' => 'w-100', 'rows' => 4]); - ?> - - Html->safe($log->http_response ?? '');?> - - Date->cast($log->date_triggered, 'date_time');?> - - date_last_retry) ? $this->Date->cast($log->date_last_retry, 'date_time') : '';?> - - Form->create($this->base_uri . 'plugin/webhooks/admin_main/retry/'); - $this->Form->fieldHidden('id', ($log->id ?? null)); - ?> - _('AdminMain.view.option_retry');?> - Form->end(); - ?> -
    Html->safe($field['field'] ?? '');?>Html->safe($field['parameter'] ?? '');?>
    + + + + +
    _('AdminMain.view.heading_logs');?>
    + + + + + + + + + + + + Pagination->build(); + foreach ($logs ?? [] as $log) { ?> - - + + + + + + + + + + +
    _('AdminMain.view.heading_event');?>_('AdminMain.view.heading_response');?>_('AdminMain.view.heading_http_response');?>_('AdminMain.view.heading_date_triggered');?>_('AdminMain.view.heading_date_last_retry');?>_('AdminMain.view.heading_options');?>
    Html->safe($log->event ?? '');?> + Form->fieldTextarea('response', ($log->response ?? ''), ['class' => 'form-control', 'rows' => 4]); + ?> + Html->safe($log->http_response ?? '');?>Date->cast($log->date_triggered, 'date_time');?>date_last_retry) ? $this->Date->cast($log->date_last_retry, 'date_time') : '';?> + Form->create($this->base_uri . 'plugin/webhooks/admin_main/retry/', ['class' => 'd-inline']); + $this->Form->fieldHidden('id', ($log->id ?? null)); + ?> + + Form->end(); + ?> +
    + Pagination->build(); + ?> +
    Widget->end();?> - - From 7f53f45cf0117f111017c94b5abc09c2a0c0b83c Mon Sep 17 00:00:00 2001 From: Abdy Franco Date: Fri, 30 Jan 2026 17:03:50 -0600 Subject: [PATCH 2/2] Update admin_main.pdt --- views/default/admin_main.pdt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/default/admin_main.pdt b/views/default/admin_main.pdt index d28135d..46efa53 100644 --- a/views/default/admin_main.pdt +++ b/views/default/admin_main.pdt @@ -15,8 +15,8 @@ $links = [ ]; $link_buttons = [ [ - 'icon' => 'bi bi-plus-lg', - 'name' => '', + 'icon' => 'bi bi-plus-lg me-1', + 'name' => $this->_('AdminMain.index.categorylink_addwebhook', true), 'attributes' => [ 'title' => $this->_('AdminMain.index.categorylink_addwebhook', true), 'href' => $this->Html->safe($this->base_uri . 'plugin/webhooks/admin_main/add/')