diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index dd4845111e1..83e757b78f8 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -15,9 +15,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * For paypal test: https://developer.paypal.com/ - * For paybox test: ??? */ /** @@ -26,8 +23,9 @@ * \brief File to offer a way to make an online signature for a particular Dolibarr entity */ -define("NOLOGIN", 1); // This means this output page does not require to be logged. -define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +if (!defined('NOLOGIN')) define("NOLOGIN", 1); // This means this output page does not require to be logged. +if (!defined('NOCSRFCHECK')) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip // For MultiCompany module. // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php @@ -41,12 +39,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +// Load translation files +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox")); + // Security check // No check on module enabled. Done later according to $validpaymentmethod -$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox")); - -$action = GETPOST('action', 'alpha'); +$action = GETPOST('action', 'aZ09'); // Input are: // type ('invoice','order','contractline'), @@ -55,7 +54,7 @@ $action = GETPOST('action', 'alpha'); // tag (a free text, required if type is empty) // currency (iso code) -$suffix = GETPOST("suffix", 'alpha'); +$suffix = GETPOST("suffix", 'aZ09'); $source = GETPOST("source", 'alpha'); $ref = $REF = GETPOST("ref", 'alpha'); @@ -71,9 +70,6 @@ if (!$action) } -$paymentmethod = ''; -$validpaymentmethod = array(); - @@ -133,7 +129,8 @@ if (!empty($conf->global->MAIN_SIGN_CSS_URL)) $head = 'dol_hide_topmenu = 1; $conf->dol_hide_leftmenu = 1; -llxHeader($head, $langs->trans("OnlineSignature"), '', '', 0, 0, '', '', '', 'onlinepaymentbody'); +$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; +llxHeader($head, $langs->trans("OnlineSignature"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); // Check link validity if (!empty($source) && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', ''))) @@ -171,23 +168,32 @@ elseif (!empty($conf->global->ONLINE_SIGN_LOGO)) $logosmall = $conf->global->ONL //print ''."\n"; // Define urllogo $urllogo = ''; +$urllogofull = ''; if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); + $width = 150; } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); - $width = 96; + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); + $width = 150; } // Output html code for logo if ($urllogo) { - print ''; - print ''; + print '
'; + print ''; - print ''."\n"; + print '>'; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; } // Output introduction text @@ -209,7 +215,7 @@ print $text; // Output payment summary form print ''; print ''; -print ''."\n"; +print ''."\n"; $found = false; $error = 0;
'.$langs->trans("ThisIsInformationOnDocumentToSign").' :
'.$langs->trans("ThisIsInformationOnDocumentToSign").' :