Skip to content

Commit

Permalink
Evarisk#3977 [PublicTicket] fix: change hook name because already use…
Browse files Browse the repository at this point in the history
…d and remove unused code
  • Loading branch information
nicolas-eoxia committed Jun 18, 2024
1 parent a64cb0f commit 0ac25e1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 28 deletions.
26 changes: 0 additions & 26 deletions class/actions_digiriskdolibarr.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,32 +508,6 @@ public function printCommonFooter($parameters)
}
}
}
} else if (strpos($parameters['context'], 'ticketpubliccard') !== false) {
if (!$conf->multicompany->enabled) {
$entity = $conf->entity;
} else {
$entity = GETPOST('entity');
}
if ($entity > 0) {
?>
<script>
let date = new Date();

let month = date.getMonth() + 1;
let day = date.getDate();
let fulldate = (day < 10 ? '0' : '') + day + '/' + (month < 10 ? '0' : '') + month + '/' + date.getFullYear();
let hour = date.getHours();
let min = date.getMinutes();

jQuery('#options_digiriskdolibarr_ticket_date').val(fulldate);
jQuery('#options_digiriskdolibarr_ticket_dateday').val((day < 10 ? '0' : '') + day);
jQuery('#options_digiriskdolibarr_ticket_datemonth').val((month < 10 ? '0' : '') + month);
jQuery('#options_digiriskdolibarr_ticket_dateyear').val(date.getFullYear());
jQuery('#options_digiriskdolibarr_ticket_datehour').val((hour < 10 ? '0' : '') + hour);
jQuery('#options_digiriskdolibarr_ticket_datemin').val((min < 10 ? '0' : '') + min);
</script>
<?php
}
} elseif (strpos($parameters['context'], 'categoryindex') !== false) { // do something only for the context 'somecontext1' or 'somecontext2'
print '<script src="../custom/digiriskdolibarr/js/digiriskdolibarr.js"></script>';
}
Expand Down
2 changes: 1 addition & 1 deletion core/modules/modDigiriskDolibarr.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ public function __construct($db)
'projecttaskcard',
'projecttaskscard',
'tasklist',
'publicnewticketcard',
'publicticket',
'ticketlist',
'thirdpartyticket',
'projectticket',
Expand Down
2 changes: 1 addition & 1 deletion public/ticket/create_ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
}

// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(['ticketpubliccard', 'globalcard']);
$hookmanager->initHooks(['publicticket', 'saturnepublicinterface']);

$object = new Ticket($db);
$formfile = new FormFile($db);
Expand Down

0 comments on commit 0ac25e1

Please sign in to comment.