Debug feature for proposal signature
This commit is contained in:
parent
297580ed11
commit
252c910962
@ -174,7 +174,8 @@ 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', 'class="paddingleft"').'</a></div>';
|
||||
$out .= '<a class="hideonsmartphone" href="'.$url.'" target="_blank">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
|
||||
$out .= '</div>';
|
||||
$out .= ajax_autoselect("onlinepaymenturl", 0);
|
||||
return $out;
|
||||
}
|
||||
|
||||
@ -41,6 +41,7 @@ function showOnlineSignatureUrl($type, $ref)
|
||||
} else {
|
||||
$out .= '<input type="text" id="onlinesignatureurl" class="quatrevingtpercent" value="'.$url.'">';
|
||||
}
|
||||
$out .= '<a class="hideonsmartphone" href="'.$url.'" target="_blank">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
|
||||
$out .= '</div>';
|
||||
$out .= ajax_autoselect("onlinesignatureurl", 0);
|
||||
return $out;
|
||||
|
||||
@ -1157,4 +1157,5 @@ RecordsApproved=%s Record(s) approved
|
||||
Properties=Properties
|
||||
hasBeenValidated=%s has been validated
|
||||
ClientTZ=Client Time Zone (user)
|
||||
NotClosedYet=Not yet closed
|
||||
NotClosedYet=Not yet closed
|
||||
ClearSignature=Signature reset
|
||||
@ -240,7 +240,7 @@ if (!empty($conf->global->ONLINE_SIGN_NEWFORM_TEXT)) {
|
||||
}
|
||||
if (empty($text)) {
|
||||
$text .= '<tr><td class="textpublicpayment"><br><strong>'.$langs->trans("WelcomeOnOnlineSignaturePage", $mysoc->name).'</strong></td></tr>'."\n";
|
||||
$text .= '<tr><td class="textpublicpayment">'.$langs->trans("ThisScreenAllowsYouToSignDocFrom", $creditor).'<br><br></td></tr>'."\n";
|
||||
$text .= '<tr><td class="textpublicpayment opacitymedium">'.$langs->trans("ThisScreenAllowsYouToSignDocFrom", $creditor).'<br><br></td></tr>'."\n";
|
||||
}
|
||||
print $text;
|
||||
|
||||
@ -251,9 +251,8 @@ print '<tr><td align="left" colspan="2" class="opacitymedium">'.$langs->trans("T
|
||||
|
||||
$found = false;
|
||||
$error = 0;
|
||||
$var = false;
|
||||
|
||||
// Payment on customer order
|
||||
// Signature on commercial proposal
|
||||
if ($source == 'proposal') {
|
||||
$found = true;
|
||||
$langs->load("proposal");
|
||||
@ -271,24 +270,44 @@ if ($source == 'proposal') {
|
||||
|
||||
// Creditor
|
||||
|
||||
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("Creditor");
|
||||
print '</td><td class="CTableRow'.($var ? '1' : '2').'"><b>'.$creditor.'</b>';
|
||||
print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Creditor");
|
||||
print '</td><td class="CTableRow2">';
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"');
|
||||
print '<b>'.$creditor.'</b>';
|
||||
print '<input type="hidden" name="creditor" value="'.$creditor.'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Debitor
|
||||
|
||||
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("ThirdParty");
|
||||
print '</td><td class="CTableRow'.($var ? '1' : '2').'"><b>'.$proposal->thirdparty->name.'</b>';
|
||||
print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("ThirdParty");
|
||||
print '</td><td class="CTableRow2">';
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"');
|
||||
print '<b>'.$proposal->thirdparty->name.'</b>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Object
|
||||
|
||||
$text = '<b>'.$langs->trans("SignatureProposalRef", $proposal->ref).'</b>';
|
||||
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("Designation");
|
||||
print '</td><td class="CTableRow'.($var ? '1' : '2').'">'.$text;
|
||||
print '<tr class="CTableRow2"><td class="CTableRow2 tdtop">'.$langs->trans("Designation");
|
||||
print '</td><td class="CTableRow2">'.$text;
|
||||
if ($proposal->status == $proposal::STATUS_VALIDATED) {
|
||||
$directdownloadlink = $proposal->getLastMainDocLink('proposal');
|
||||
if ($directdownloadlink) {
|
||||
print '<br><a href="'.$directdownloadlink.'">';
|
||||
print img_mime($proposal->last_main_doc, '');
|
||||
print $langs->trans("DownloadDocument").'</a>';
|
||||
}
|
||||
} else {
|
||||
/* TODO If proposal signed newer than proposal ref, get link of proposal signed
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
print '<input type="hidden" name="source" value="'.GETPOST("source", 'alpha').'">';
|
||||
print '<input type="hidden" name="ref" value="'.$proposal->ref.'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// TODO Add link to download PDF (similar code than for invoice)
|
||||
}
|
||||
|
||||
|
||||
@ -316,9 +335,10 @@ if ($action != 'dosign') {
|
||||
|
||||
print '</td></tr>'."\n";
|
||||
print '<tr><td align="center">';
|
||||
|
||||
if ($action == "dosign" && empty($cancel)) {
|
||||
print '<div class="tablepublicpayment">';
|
||||
print '<input type="button" class="button" id="clearsignature" value="'.$langs->trans("ClearSignature").'">';
|
||||
print '<input type="button" class="buttonDelete small" id="clearsignature" value="'.$langs->trans("ClearSignature").'">';
|
||||
print '<div id="signature" style="border:solid;"></div>';
|
||||
print '</div>';
|
||||
print '<input type="button" class="button" id="signpropal" value="'.$langs->trans("Sign").'">';
|
||||
@ -334,8 +354,8 @@ if ($action == "dosign" && empty($cancel)) {
|
||||
if(!$._data($("#signpropal")[0], "events")){
|
||||
$("#signpropal").on("click",function(){
|
||||
var signature = $("#signature").jSignature("getData", "image");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "'.DOL_URL_ROOT.'/core/ajax/onlineSign.php",
|
||||
dataType: "text",
|
||||
data: {
|
||||
@ -360,21 +380,23 @@ if ($action == "dosign" && empty($cancel)) {
|
||||
$("#clearsignature").on("click",function(){
|
||||
$("#signature").jSignature("clear");
|
||||
$("#signpropal").attr("disabled",true);
|
||||
$("#clearsignature").css("display","none");
|
||||
/* $("#clearsignature").css("display","none"); */
|
||||
});
|
||||
|
||||
$("#clearsignature").css("display","none");
|
||||
/* $("#clearsignature").css("display","none"); */
|
||||
$("#signpropal").attr("disabled",true);
|
||||
});
|
||||
</script>';
|
||||
} else {
|
||||
if ($object->status == $object::STATUS_SIGNED) {
|
||||
print $langs->trans("PropalAlreadySigned");
|
||||
print '<br>';
|
||||
print '<span class="ok">'.$langs->trans("PropalAlreadySigned").'</span>';
|
||||
} elseif ($object->status == $object::STATUS_NOTSIGNED) {
|
||||
print $langs->trans("PropalAlreadyRefused");
|
||||
print '<br>';
|
||||
print '<span class="warning">'.$langs->trans("PropalAlreadyRefused").'</span>';
|
||||
} else {
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("SignPropal").'">';
|
||||
print '<input name="refusepropal" type="submit" class="button" value="'.$langs->trans("RefusePropal").'">';
|
||||
print '<input type="submit" class="button small wraponsmartphone reposition" value="'.$langs->trans("SignPropal").'">';
|
||||
print '<input name="refusepropal" type="submit" class="button small wraponsmartphone" value="'.$langs->trans("RefusePropal").'">';
|
||||
}
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
@ -953,7 +953,9 @@ if (!$source) {
|
||||
|
||||
// Creditor
|
||||
print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Creditor");
|
||||
print '</td><td class="CTableRow2"><b>'.$creditor.'</b>';
|
||||
print '</td><td class="CTableRow2">';
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"');
|
||||
print '<b>'.$creditor.'</b>';
|
||||
print '<input type="hidden" name="creditor" value="'.$creditor.'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
@ -1025,13 +1027,17 @@ if ($source == 'order') {
|
||||
|
||||
// Creditor
|
||||
print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Creditor");
|
||||
print '</td><td class="CTableRow2"><b>'.$creditor.'</b>';
|
||||
print '</td><td class="CTableRow2">';
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"');
|
||||
print '<b>'.$creditor.'</b>';
|
||||
print '<input type="hidden" name="creditor" value="'.$creditor.'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Debitor
|
||||
print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("ThirdParty");
|
||||
print '</td><td class="CTableRow2"><b>'.$order->thirdparty->name.'</b>';
|
||||
print '</td><td class="CTableRow2">';
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"');
|
||||
print '<b>'.$order->thirdparty->name.'</b>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Object
|
||||
@ -1149,13 +1155,17 @@ if ($source == 'invoice') {
|
||||
|
||||
// Creditor
|
||||
print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Creditor");
|
||||
print '</td><td class="CTableRow2"><b>'.$creditor.'</b>';
|
||||
print '</td><td class="CTableRow2">';
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"');
|
||||
print '<b>'.$creditor.'</b>';
|
||||
print '<input type="hidden" name="creditor" value="'.dol_escape_htmltag($creditor).'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Debitor
|
||||
print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("ThirdParty");
|
||||
print '</td><td class="CTableRow2"><b>'.$invoice->thirdparty->name.'</b>';
|
||||
print '</td><td class="CTableRow2">';
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"');
|
||||
print '<b>'.$invoice->thirdparty->name.'</b>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Object
|
||||
|
||||
@ -701,6 +701,9 @@ textarea.centpercent {
|
||||
.nowraponsmartphone {
|
||||
white-space: <?php print ($dol_optimize_smallscreen ? 'nowrap' : 'normal'); ?>;
|
||||
}
|
||||
.wraponsmartphone {
|
||||
white-space: <?php print ($dol_optimize_smallscreen ? 'normal' : 'nowrap'); ?>;
|
||||
}
|
||||
.liste_titre .nowrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
@ -1726,7 +1729,7 @@ td.showDragHandle {
|
||||
<?php } ?>
|
||||
}
|
||||
#id-right { /* This must stay id-right and not be replaced with echo $right */
|
||||
padding-top: 10px;
|
||||
padding-top: 14px;
|
||||
width: 100%;
|
||||
background: var(--colorbackbody);
|
||||
padding-bottom: 20px;
|
||||
@ -6998,6 +7001,9 @@ div.clipboardCPValue.hidewithsize {
|
||||
z-index: 201;
|
||||
background: var(--colorbackvmenu1);
|
||||
}
|
||||
#id-right { /* This must stay id-right and not be replaced with echo $right */
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
.login_vertical_align {
|
||||
padding-left: 20px;
|
||||
|
||||
@ -850,6 +850,9 @@ textarea.centpercent {
|
||||
.nowraponsmartphone {
|
||||
white-space: <?php print ($dol_optimize_smallscreen ? 'nowrap' : 'normal'); ?>;
|
||||
}
|
||||
.wraponsmartphone {
|
||||
white-space: <?php print ($dol_optimize_smallscreen ? 'normal' : 'nowrap'); ?>;
|
||||
}
|
||||
.liste_titre .nowrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user