NEW: Add option FICHINTER_ALLOW_EXTERNAL_DOWNLOAD
This commit is contained in:
parent
36fd3f7816
commit
eb4a260fca
@ -5611,6 +5611,9 @@ abstract class CommonObject
|
||||
if ($this->element == 'contrat' && !empty($conf->global->CONTRACT_ALLOW_EXTERNAL_DOWNLOAD)) {
|
||||
$setsharekey = true;
|
||||
}
|
||||
if ($this->element == 'fichinter' && !empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD)) {
|
||||
$setsharekey = true;
|
||||
}
|
||||
if ($this->element == 'supplier_proposal' && !empty($conf->global->SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) {
|
||||
$setsharekey = true;
|
||||
}
|
||||
|
||||
@ -7782,6 +7782,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
||||
if (is_object($object) && $object->element == 'contrat') {
|
||||
$typeforonlinepayment = 'contract';
|
||||
}
|
||||
if (is_object($object) && $object->element == 'fichinter') {
|
||||
$typeforonlinepayment = 'ficheinter';
|
||||
}
|
||||
$url = getOnlinePaymentUrl(0, $typeforonlinepayment, $substitutionarray['__REF__']);
|
||||
$paymenturl = $url;
|
||||
}
|
||||
@ -7814,6 +7817,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
||||
} else {
|
||||
$substitutionarray['__DIRECTDOWNLOAD_URL_CONTRACT__'] = '';
|
||||
}
|
||||
if (!empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'fichinter') {
|
||||
$substitutionarray['__DIRECTDOWNLOAD_URL_FICHINTER__'] = $object->getLastMainDocLink($object->element);
|
||||
} else {
|
||||
$substitutionarray['__DIRECTDOWNLOAD_URL_FICHINTER__'] = '';
|
||||
}
|
||||
if (!empty($conf->global->SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'supplier_proposal') {
|
||||
$substitutionarray['__DIRECTDOWNLOAD_URL_SUPPLIER_PROPOSAL__'] = $object->getLastMainDocLink($object->element);
|
||||
} else {
|
||||
@ -7832,6 +7840,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
||||
if (is_object($object) && $object->element == 'contrat') {
|
||||
$substitutionarray['__URL_CONTRACT__'] = DOL_MAIN_URL_ROOT."/contrat/card.php?id=".$object->id;
|
||||
}
|
||||
if (is_object($object) && $object->element == 'fichinter') {
|
||||
$substitutionarray['__URL_FICHINTER__'] = DOL_MAIN_URL_ROOT."/fichinter/card.php?id=".$object->id;
|
||||
}
|
||||
if (is_object($object) && $object->element == 'supplier_proposal') {
|
||||
$substitutionarray['__URL_SUPPLIER_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/supplier_proposal/card.php?id=".$object->id;
|
||||
}
|
||||
|
||||
@ -1713,7 +1713,13 @@ if ($action == 'create') {
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('fichinter'));
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
|
||||
|
||||
//Show direct download link
|
||||
if ($object->statut != Fichinter::STATUS_DRAFT && !empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD))
|
||||
{
|
||||
print '<br><!-- Link to download main doc -->'."\n";
|
||||
print showDirectDownloadLink($object).'<br>';
|
||||
}
|
||||
|
||||
print '</div><div class="fichehalfright">';
|
||||
|
||||
// List of actions on element
|
||||
|
||||
Loading…
Reference in New Issue
Block a user