';
}
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 '| '.$langs->trans("ThisIsInformationOnDocumentToSign").' : | '."\n";
+print '| '.$langs->trans("ThisIsInformationOnDocumentToSign").' : | '."\n";
$found = false;
$error = 0;
diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php
index 2e160139dec..9a9c3fff27d 100644
--- a/htdocs/public/payment/newpayment.php
+++ b/htdocs/public/payment/newpayment.php
@@ -34,8 +34,9 @@
* \brief File to offer a way to make a payment for a particular Dolibarr object
*/
-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 get of entity must be done before including main.inc.php
@@ -49,11 +50,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php';
+// Load translation files
+$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data
+
// Security check
// No check on module enabled. Done later according to $validpaymentmethod
-$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data
-
$action = GETPOST('action', 'aZ09');
// Input are:
diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php
index c4a3b71e6ad..b3e94d5ceb2 100644
--- a/htdocs/public/ticket/create_ticket.php
+++ b/htdocs/public/ticket/create_ticket.php
@@ -28,6 +28,7 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
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
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
@@ -53,6 +54,7 @@ $extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($object->table_element);
+
/*
* Actions
*/
diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php
index 031ef2793b5..bbe831c1a84 100644
--- a/htdocs/public/ticket/index.php
+++ b/htdocs/public/ticket/index.php
@@ -25,6 +25,7 @@
if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
+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
diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php
index 41bda75b2b5..1952fb8304c 100644
--- a/htdocs/societe/paymentmodes.php
+++ b/htdocs/societe/paymentmodes.php
@@ -569,30 +569,38 @@ if (empty($reshook))
$db->begin();
if (empty($newcu)) {
- $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account WHERE site = 'stripe' AND fk_soc = ".$object->id." AND status = ".$servicestatus." AND entity = ".$conf->entity;
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '".$site_account."') AND fk_soc = ".$object->id." AND status = ".$servicestatus." AND entity = ".$conf->entity;
} else {
- $sql = 'UPDATE '.MAIN_DB_PREFIX."societe_account";
- $sql .= " SET key_account = '".$db->escape(GETPOST('key_account', 'alpha'))."'";
- $sql .= " WHERE site = 'stripe' AND fk_soc = ".$object->id." AND status = ".$servicestatus." AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified !
+ $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX."societe_account";
+ $sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '".$site_account."') AND fk_soc = ".$object->id." AND status = ".$servicestatus." AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified !
}
$resql = $db->query($sql);
- $num = $db->num_rows($resql);
- if (empty($num) && !empty($newcu))
- {
- $societeaccount = new SocieteAccount($db);
- $societeaccount->fk_soc = $object->id;
- $societeaccount->login = '';
- $societeaccount->pass_encoding = '';
- $societeaccount->site = 'stripe';
- $societeaccount->status = $servicestatus;
- $societeaccount->key_account = $newcu;
- $result = $societeaccount->create($user);
- if ($result < 0)
+ $num = $db->num_rows($resql); // Note: $num is always 0 on an update and delete, it is defined for select only.
+ if (!empty($newcu)) {
+ if (empty($num))
{
- $error++;
+ $societeaccount = new SocieteAccount($db);
+ $societeaccount->fk_soc = $object->id;
+ $societeaccount->login = '';
+ $societeaccount->pass_encoding = '';
+ $societeaccount->site = 'stripe';
+ $societeaccount->status = $servicestatus;
+ $societeaccount->key_account = $newcu;
+ $societeaccount->site_account = $site_account;
+ $result = $societeaccount->create($user);
+ if ($result < 0)
+ {
+ $error++;
+ }
+ } else {
+ $sql = 'UPDATE '.MAIN_DB_PREFIX."societe_account";
+ $sql .= " SET key_account = '".$db->escape(GETPOST('key_account', 'alpha'))."', site_account = '".$site_account."'";
+ $sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '".$site_account."') AND fk_soc = ".$object->id." AND status = ".$servicestatus." AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified !
+ $resql = $db->query($sql);
}
}
+ //var_dump($sql); var_dump($newcu); var_dump($num); exit;
if (!$error)
{
@@ -615,6 +623,8 @@ if (empty($reshook))
if (empty($newsup)) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token WHERE fk_soc = ".$object->id." AND service = '".$service."' AND entity = ".$conf->entity;
+ // TODO Add site and site_account on oauth_token table
+ //$sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token WHERE site = 'stripe' AND (site_account IS NULL or site_account = '".$site_account."') AND fk_soc = ".$object->id." AND service = '".$service."' AND entity = ".$conf->entity;
} else {
try {
$stripesup = \Stripe\Account::retrieve($db->escape(GETPOST('key_account_supplier', 'alpha')));
@@ -622,6 +632,8 @@ if (empty($reshook))
$tokenstring['type'] = $stripesup->type;
$sql = "UPDATE ".MAIN_DB_PREFIX."oauth_token";
$sql .= " SET tokenstring = '".dol_json_encode($tokenstring)."'";
+ $sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '".$site_account."') AND fk_soc = ".$object->id." AND service = '".$service."' AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified !
+ // TODO Add site and site_account on oauth_token table
$sql .= " WHERE fk_soc = ".$object->id." AND service = '".$service."' AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified !
} catch (Exception $e) {
$error++;
@@ -639,6 +651,7 @@ if (empty($reshook))
$tokenstring['type'] = $stripesup->type;
$sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token (service, fk_soc, entity, tokenstring)";
$sql .= " VALUES ('".$service."', ".$object->id.", ".$conf->entity.", '".dol_json_encode($tokenstring)."')";
+ // TODO Add site and site_account on oauth_token table
} catch (Exception $e) {
$error++;
setEventMessages($e->getMessage(), null, 'errors');
diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php
index 7dbf4dd6089..77bd1d918bf 100644
--- a/htdocs/stripe/charge.php
+++ b/htdocs/stripe/charge.php
@@ -215,7 +215,7 @@ if (!$rowid)
print "\n";
// Origine
print "";
- if ($charge->metadata->dol_type=="order") {
+ if ($charge->metadata->dol_type=="order" || $charge->metadata->dol_type=="commande") {
$object = new Commande($db);
$object->fetch($charge->metadata->dol_id);
if ($object->id > 0) {
@@ -223,7 +223,7 @@ if (!$rowid)
} else {
print $FULLTAG;
}
- } elseif ($charge->metadata->dol_type=="invoice") {
+ } elseif ($charge->metadata->dol_type=="invoice" || $charge->metadata->dol_type=="facture") {
$object = new Facture($db);
$object->fetch($charge->metadata->dol_id);
if ($object->id > 0) {
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index 0f96bb15d62..c6386ba7ea2 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -2377,9 +2377,14 @@ div.tabs {
div.tabsElem {
margin-top: 1px;
} /* To avoid overlap of tabs when not browser */
-div.tabsElem a {
- /* font-weight: normal !important; */
+/*
+div.tabsElem a.tabactive::before, div.tabsElem a.tabunactive::before {
+ content: "\f0da";
+ font-family: "Font Awesome 5 Free";
+ padding-right: 2px;
+ font-weight: 900;
}
+*/
div.tabBar {
color: #;
padding-top: 16px;
@@ -5501,11 +5506,12 @@ div.tabsElem a.tab {
width: 70%;
}
.publicnewticketform {
- margin-top: 25px !important;
+ /* margin-top: 25px !important; */
}
.ticketlargemargin {
padding-left: 50px;
padding-right: 50px;
+ padding-top: 10px;
}
@media only screen and (max-width: 767px)
{
@@ -5513,7 +5519,7 @@ div.tabsElem a.tab {
padding-left: 5px; padding-right: 5px;
}
.ticketpublicarea {
- width: 100%;
+ width: 100% !important;
}
}
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 0806cb47d1e..fe23020991f 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -5649,11 +5649,12 @@ border-top-right-radius: 6px;
width: 70%;
}
.publicnewticketform {
- margin-top: 25px !important;
+ /* margin-top: 25px !important; */
}
.ticketlargemargin {
padding-left: 50px;
padding-right: 50px;
+ padding-top: 10px;
}
@media only screen and (max-width: 767px)
{
diff --git a/htdocs/ticket/css/styles.css.php b/htdocs/ticket/css/styles.css.php
index 15eadf8ffb8..914a3dba119 100644
--- a/htdocs/ticket/css/styles.css.php
+++ b/htdocs/ticket/css/styles.css.php
@@ -146,5 +146,9 @@ div.ticketform .blue:hover {
background-color: #f8f8f8;
}
-#form_create_ticket input.text,
-#form_create_ticket textarea { width:450px;}
+#form_create_ticket input.text, #form_create_ticket textarea { width:450px;}
+
+@media only screen and (max-width: 767px)
+{
+ #form_create_ticket input.text, #form_create_ticket textarea { width: unset;}
+}
| |