Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Changed

- Make the plugin compatible with the Content Security Policy

## [1.15.8] - 2026-10-27

### Fixed
Expand Down
1 change: 1 addition & 0 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ function plugin_version_credit()
'author' => '<a href="http://www.teclib.com">Teclib\'</a>',
'license' => 'GPLv3',
'homepage' => 'https://github.com/pluginsGLPI/credit',
'csp_compliant' => true,
'requirements' => [
'glpi' => [
'min' => PLUGIN_CREDIT_MIN_GLPI,
Expand Down
11 changes: 7 additions & 4 deletions templates/tickets/consume.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
consume,
__('Consume a voucher ?', 'credit'),
{
'additional_attributes': {
'onchange': 'showCreditDiv' ~ rand ~ '(this.value)',
},
'rand': rand,
}
) }}
Expand All @@ -59,7 +56,6 @@
{
'entity': entity_id,
'condition': condition,
'on_change': 'getQuantityRemaining' ~ rand ~ '(this.value);',
'field_class': 'col-6 col-sm-6',
'rand': rand,
}
Expand Down Expand Up @@ -129,5 +125,12 @@
});
}
}

document.getElementById('plugin_credit_consumed_voucher_{{ rand }}').addEventListener('change', function () {
showCreditDiv{{ rand }}(this.value);
});
$('#dropdown_plugin_credit_entities_id{{ rand }}').on('change', function () {
getQuantityRemaining{{ rand }}(this.value);
});
</script>
</div>
6 changes: 5 additions & 1 deletion templates/tickets/form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
{
'entity': entity_id,
'condition': conditions,
'on_change': 'getQuantityRemainingForm' ~ rand ~ '(this.value, this);',
'field_class': 'col-4 col-sm-4',
'rand': rand,
}
) }}
<div class="col-1 col-sm-1"></div>
Expand Down Expand Up @@ -105,6 +105,10 @@
});
}
}

$('#dropdown_plugin_credit_entities_id{{ rand }}').on('change', function () {
getQuantityRemainingForm{{ rand }}(this.value, this);
});
</script>
<input type="hidden" name="_glpi_csrf_token" value="{{ csrf_token() }}" />
<div class="hstack gap-1">
Expand Down
Loading