NEW Can removed doc templates from setup page of thirdparty

This commit is contained in:
Laurent Destailleur 2022-01-22 15:06:05 +01:00
parent 4750f6bbc6
commit 1790ba2820
2 changed files with 6 additions and 2 deletions

View File

@ -102,12 +102,13 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$form = new Form($this->db);
$texte = $this->description.".<br>\n";
$texte .= '<!-- form for option of ODT templates -->';
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" enctype="multipart/form-data">';
$texte .= '<input type="hidden" name="token" value="'.newToken().'">';
$texte .= '<input type="hidden" name="page_y" value="">';
$texte .= '<input type="hidden" name="action" value="setModuleOptions">';
$texte .= '<input type="hidden" name="param1" value="COMPANY_ADDON_PDF_ODT_PATH">';
$texte .= '<table class="nobordernopadding" width="100%">';
$texte .= '<table class="nobordernopadding centpercent">';
// List of directories area
$texte .= '<tr><td>';
@ -161,7 +162,9 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$texte .= '<div id="div_'.get_class($this).'" class="hiddenx">';
// Show list of found files
foreach ($listoffiles as $file) {
$texte .= '- '.$file['name'].' <a href="'.DOL_URL_ROOT.'/document.php?modulepart=doctemplates&file=thirdparties/'.urlencode(basename($file['name'])).'">'.img_picto('', 'listlight').'</a><br>';
$texte .= '- '.$file['name'].' &nbsp; <a class="reposition" href="'.DOL_URL_ROOT.'/document.php?modulepart=doctemplates&file=thirdparties/'.urlencode(basename($file['name'])).'">'.img_picto('', 'listlight').'</a>';
$texte .= ' &nbsp; <a class="reposition" href="'.$_SERVER["PHP_SELF"].'?modulepart=doctemplates&keyforuploaddir=COMPANY_ADDON_PDF_ODT_PATH&action=deletefile&file='.urlencode(basename($file['name'])).'">'.img_picto('', 'delete').'</a>';
$texte .= '<br>';
}
$texte .= '</div>';
}

View File

@ -34,6 +34,7 @@ $langs->loadLangs(array("admin", "companies", "other"));
$action = GETPOST('action', 'aZ09');
$value = GETPOST('value', 'alpha');
$modulepart = GETPOST('modulepart', 'aZ09');
if (!$user->admin) {
accessforbidden();