Skip to content

Commit

Permalink
Eoxia#80 [PublicShortener] add: hook for use in digiquali
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Feb 3, 2025
1 parent 01e5b2b commit 389a20c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions class/actions_easyurl.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,25 @@ public function doActions(array $parameters, $object, string $action): int

return 0; // or return 1 to replace standard code
}

/**
* Overloading the digiqualiPublicControlTab function : replacing the parent's function with the one below
*
* @param array $parameters Hook metadata (context, etc...)
* @return int 0 < on error, 0 on success, 1 to replace standard code
*/
public function digiqualiPublicControlTab(array $parameters): int
{
global $langs;

if (isModEnabled('digiquali') && $parameters['objectType'] == 'productlot') {
$langs->load('easyurl@easyurl');

print '<a class="tab" href="' . dol_buildpath('custom/easyurl/public/shortener/public_shortener.php?entity=' . $parameters['entity'], 1) . '">';
print $langs->transnoentities('AssignQRCode');
print '</a>';
}

return 0; // or return 1 to replace standard code
}
}
3 changes: 2 additions & 1 deletion core/modules/modEasyURL.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ public function __construct($db)
'interventioncard',
'propallist',
'orderlist',
'invoicelist'
'invoicelist',
'publiccontrol'
],
// Set this to 1 if features of module are opened to external users
'moduleforexternal' => 0
Expand Down

0 comments on commit 389a20c

Please sign in to comment.