Show link to shared file if it exists.

This commit is contained in:
Laurent Destailleur
2021-04-15 17:09:15 +02:00
parent 48a80dcef7
commit f1d55d38ba
4 changed files with 9 additions and 5 deletions

View File

@@ -5513,7 +5513,8 @@ if ($action == 'create') {
}
// Show direct download link
if ($object->statut != Facture::STATUS_DRAFT && !empty($conf->global->INVOICE_ALLOW_EXTERNAL_DOWNLOAD)) {
//if ($object->statut != Facture::STATUS_DRAFT && !empty($conf->global->INVOICE_ALLOW_EXTERNAL_DOWNLOAD)) {
if ($object->statut != Facture::STATUS_DRAFT) {
print '<br><!-- Link to download main doc -->'."\n";
print showDirectDownloadLink($object).'<br>';
}

View File

@@ -1330,8 +1330,8 @@ class FormFile
print '<td class="center">';
if ($relativedir && $filearray[$key]['rowid'] > 0) { // only if we are in a mode where a scan of dir were done and we have id of file in ECM table
if ($editline) {
print $langs->trans("FileSharedViaALink").' ';
print '<input class="inline-block" type="checkbox" name="shareenabled"'.($file['share'] ? ' checked="checked"' : '').' /> ';
print '<label for="idshareenabled'.$key.'">'.$langs->trans("FileSharedViaALink").'</label> ';
print '<input class="inline-block" type="checkbox" id="idshareenabled'.$key.'" name="shareenabled"'.($file['share'] ? ' checked="checked"' : '').' /> ';
} else {
if ($file['share']) {
// Define $urlwithroot

View File

@@ -8803,11 +8803,14 @@ function showDirectDownloadLink($object)
$out = '';
$url = $object->getLastMainDocLink($object->element);
$out .= img_picto($langs->trans("PublicDownloadLinkdesc"), 'globe').' <span class="opacitymedium">'.$langs->trans("DirectDownloadLink").'</span><br>';
if ($url) {
$out .= img_picto($langs->trans("PublicDownloadLinkdesc"), 'globe').' <span class="opacitymedium">'.$langs->trans("DirectDownloadLink").'</span><br>';
$out .= '<div class="urllink"><input type="text" id="directdownloadlink" class="quatrevingtpercent" value="'.$url.'"></div>';
$out .= ajax_autoselect("directdownloadlink", 0);
} else {
$out .= '<div class="urllink">'.$langs->trans("FileNotShared").'</div>';
}
return $out;
}

View File

@@ -173,7 +173,7 @@ function showOnlinePaymentUrl($type, $ref)
$out = img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePayment", $servicename).'</span><br>';
$url = getOnlinePaymentUrl(0, $type, $ref);
$out .= '<div class="urllink"><input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$url.'">';
$out .= '<a href="'.$url.'" target="_blank">'.img_picto('', 'globe').'</a></div>';
$out .= '<a href="'.$url.'" target="_blank">'.img_picto('', 'globe', 'class="paddingleft"').'</a></div>';
$out .= ajax_autoselect("onlinepaymenturl", 0);
return $out;
}