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 // 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 '<br><!-- Link to download main doc -->'."\n";
print showDirectDownloadLink($object).'<br>'; print showDirectDownloadLink($object).'<br>';
} }

View File

@@ -1330,8 +1330,8 @@ class FormFile
print '<td class="center">'; 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 ($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) { if ($editline) {
print $langs->trans("FileSharedViaALink").' '; print '<label for="idshareenabled'.$key.'">'.$langs->trans("FileSharedViaALink").'</label> ';
print '<input class="inline-block" type="checkbox" name="shareenabled"'.($file['share'] ? ' checked="checked"' : '').' /> '; print '<input class="inline-block" type="checkbox" id="idshareenabled'.$key.'" name="shareenabled"'.($file['share'] ? ' checked="checked"' : '').' /> ';
} else { } else {
if ($file['share']) { if ($file['share']) {
// Define $urlwithroot // Define $urlwithroot

View File

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