diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 63a12e5d25a..a15ed888a6e 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2368,13 +2368,19 @@ if ($action == 'create') $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); // Show online signature link - $useonlinepayment = $conf->global->MAIN_FEATURES_LEVEL; + $useonlinesignature = $conf->global->MAIN_FEATURES_LEVEL; // Replace this with 1 when feature to make online signature is ok - if ($object->statut != Propal::STATUS_DRAFT && $useonlinepayment) + if ($object->statut != Propal::STATUS_DRAFT && $useonlinesignature) { - print '
'; + print '
'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; - print showOnlineSignatureUrl('proposal', $object->ref); + print showOnlineSignatureUrl('proposal', $object->ref).'
'; + } + + if ($object->statut != Propal::STATUS_DRAFT && ! empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) + { + print '
'."\n"; + print showDirectDownloadLink($object).'
'; } print '
'; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 0d73b288f0b..238b677395e 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2584,6 +2584,20 @@ if ($action == 'create' && $user->rights->commande->creer) $linktoelem = $form->showLinkToObjectBlock($object, null, array('order')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + // Show online signature link + $useonlinepayment = $conf->global->ORDER_SHOW_ONLINE_PAYMENT_ON_ORDER; + if ($object->statut != Commande::STATUS_DRAFT && $useonlinepayment) + { + print '
'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; + print showOnlinePaymentUrl('order', $object->ref).'
'; + } + + if ($object->statut != Commande::STATUS_DRAFT && ! empty($conf->global->ORDER_ALLOW_EXTERNAL_DOWNLOAD)) + { + print '
'."\n"; + print showDirectDownloadLink($object).'
'; + } print '
'; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 868856094df..8365a52f277 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4382,9 +4382,15 @@ else if ($id > 0 || ! empty($ref)) if ($object->statut != Facture::STATUS_DRAFT && $useonlinepayment) { - print '
'; + print '
'."\n"; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; - print showOnlinePaymentUrl('invoice', $object->ref); + print showOnlinePaymentUrl('invoice', $object->ref).'
'; + } + + if ($object->statut != Facture::STATUS_DRAFT && ! empty($conf->global->INVOICE_ALLOW_EXTERNAL_DOWNLOAD)) + { + print '
'."\n"; + print showDirectDownloadLink($object).'
'; } print '
'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5d8be8ec224..e3c68ebdd60 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6649,6 +6649,28 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0) return $res; } +/** + * Return string with full Url + * + * @param Object $object Object + * @return string Url string + */ +function showDirectDownloadLink($object) +{ + global $conf, $langs; + + $out=''; + $url = $object->getLastMainDocLink($object->element); + + if ($url) + { + $out.= img_picto('','object_globe.png').' '.$langs->trans("DirectDownloadLink").'
'; + $out.= ''; + $out.= ajax_autoselect("directdownloadlink", 0); + } + return $out; +} + /** * Return the filename of file to get the thumbs *