'."\n";
if ($addformmessage) {
print '';
print '
';
diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php
index cb2458de4ff..3aaa3676663 100644
--- a/htdocs/public/onlinesign/newonlinesign.php
+++ b/htdocs/public/onlinesign/newonlinesign.php
@@ -62,6 +62,8 @@ $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors",
// Get parameters
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
+$confirm = GETPOST('confirm', 'alpha');
+
$refusepropal = GETPOST('refusepropal', 'alpha');
$message = GETPOST('message', 'aZ09');
@@ -148,7 +150,7 @@ if (!dol_verifyHash($securekeyseed.$type.$ref, $SECUREKEY, '0')) {
* Actions
*/
-if ($action == 'confirm_refusepropal') {
+if ($action == 'confirm_refusepropal' && $confirm == 'yes') {
$db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
@@ -213,6 +215,7 @@ print '
'."\n
print '
'."\n";
print '
'."\n";
print '
';
+print '
';
print "\n";
print ''."\n";
@@ -336,18 +339,28 @@ if ($source == 'proposal') {
}
} else {
$last_main_doc_file = $proposal->last_main_doc;
- if (preg_match('/_signed-(\d+)/', $last_main_doc_file)) { // If the last main doc has been signed
- $last_main_doc_file_not_signed = preg_replace('/_signed-(\d+)/', '', $last_main_doc_file);
- $datefilesigned = dol_filemtime($last_main_doc_file);
- $datefilenotsigned = dol_filemtime($last_main_doc_file_not_signed);
+ if ($proposal->status == $proposal::STATUS_NOTSIGNED) {
+ $directdownloadlink = $proposal->getLastMainDocLink('proposal');
+ if ($directdownloadlink) {
+ print '
';
+ print img_mime($proposal->last_main_doc, '');
+ print $langs->trans("DownloadDocument").' ';
+ }
+ } elseif ($proposal->status == $proposal::STATUS_SIGNED || $proposal->status == $proposal::STATUS_BILLED) {
+ if (preg_match('/_signed-(\d+)/', $last_main_doc_file)) { // If the last main doc has been signed
+ $last_main_doc_file_not_signed = preg_replace('/_signed-(\d+)/', '', $last_main_doc_file);
- if (empty($datefilenotsigned) || $datefilesigned > $datefilenotsigned) {
- $directdownloadlink = $proposal->getLastMainDocLink('proposal');
- if ($directdownloadlink) {
- print '
';
- print img_mime($proposal->last_main_doc, '');
- print $langs->trans("DownloadDocument").' ';
+ $datefilesigned = dol_filemtime($last_main_doc_file);
+ $datefilenotsigned = dol_filemtime($last_main_doc_file_not_signed);
+
+ if (empty($datefilenotsigned) || $datefilesigned > $datefilenotsigned) {
+ $directdownloadlink = $proposal->getLastMainDocLink('proposal');
+ if ($directdownloadlink) {
+ print '
';
+ print img_mime($proposal->last_main_doc, '');
+ print $langs->trans("DownloadDocument").' ';
+ }
}
}
}
@@ -392,6 +405,7 @@ if ($action == "dosign" && empty($cancel)) {
print '
';
print '
';
print '
';
+ // Do not use class="reposition" here: It breaks the submit and there is a message on top to say it's ok, so going back top is better.
print '
';
@@ -459,7 +473,7 @@ if ($action == "dosign" && empty($cancel)) {
}
} else {
print '