Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3773 [Hook] fix: need more precision on model name and require #3774

Merged
Merged
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
8 changes: 4 additions & 4 deletions class/actions_digiriskdolibarr.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public function printCommonFooter($parameters)
$out = saturne_show_documents('digiriskdolibarr:TicketDocument', $dirFiles, $fileDir, $urlSource, $user->rights->ticket->write, $user->rights->ticket->delete, getDolGlobalString('DIGIRISKDOLIBARR_TICKET_DEFAULT_MODEL'), 1, 0, 0, 0, '', '', '', '', '', $object); ?>

<script>
jQuery('.fichehalfleft .div-table-responsive-no-min').append(<?php echo json_encode($out); ?>)
jQuery('.fichehalfleft .div-table-responsive-no-min').first().append(<?php echo json_encode($out); ?>);
</script>
<?php

Expand Down Expand Up @@ -559,7 +559,7 @@ public function doActions($parameters, $object, $action)
}
}
} else if ($parameters['currentcontext'] == 'ticketcard') {
if ($action == 'builddoc' && strstr(GETPOST('model'), 'ticketdocument_odt')) {
if ($action == 'builddoc' && preg_match('/\bticketdocument_odt\b/', GETPOST('model'))) {
require_once __DIR__ . '/digiriskdolibarrdocuments/ticketdocument.class.php';

$document = new TicketDocument($this->db);
Expand All @@ -579,7 +579,7 @@ public function doActions($parameters, $object, $action)
$upload_dir = $conf->digiriskdolibarr->multidir_output[$conf->entity ?? 1];

// Action to generate pdf from odt file
require_once __DIR__ . '/../../saturne/core/tpl/documents/saturne_manual_pdf_generation_action.tpl.php';
require __DIR__ . '/../../saturne/core/tpl/documents/saturne_manual_pdf_generation_action.tpl.php';

$urlToRedirect = $_SERVER['REQUEST_URI'];
$urlToRedirect = preg_replace('/#pdfGeneration$/', '', $urlToRedirect);
Expand All @@ -589,7 +589,7 @@ public function doActions($parameters, $object, $action)
exit;
}

require_once __DIR__ . '/../../saturne/core/tpl/documents/documents_action.tpl.php';
require __DIR__ . '/../../saturne/core/tpl/documents/documents_action.tpl.php';
} elseif (in_array($parameters['currentcontext'] , array('ticketlist', 'thirdpartyticket', 'projectticket'))) {
if ($action == 'list') {
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
Expand Down