FIX : twice call in a page

fix to let this function be used twice in a page
This commit is contained in:
Norbert Penel 2020-04-07 09:27:55 +02:00 committed by GitHub
parent ff1b3db54b
commit a5f39e996d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7779,10 +7779,11 @@ class Form
global $conf, $langs;
$out = '';
if (!empty($conf->use_javascript_ajax)) $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="checkallactions" name="checkallactions" class="checkallactions"></div>';
$id=uniqid();
if (!empty($conf->use_javascript_ajax)) $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="checkallactions'.$id.'" name="checkallactions" class="checkallactions"></div>';
$out .= '<script>
$(document).ready(function() {
$("#checkallactions").click(function() {
$("#checkallactions'.$id.'").click(function() {
if($(this).is(\':checked\')){
console.log("We check all");
$(".'.$cssclass.'").prop(\'checked\', true).trigger(\'change\');