diff --git a/dashboard/dashboard.php b/dashboard/dashboard.php index c72c46fd..8b69bc0d 100644 --- a/dashboard/dashboard.php +++ b/dashboard/dashboard.php @@ -506,14 +506,13 @@ function orders_menu( $arg ) { function orders_module( $url ) { global $current_user; -if ( isset($_GET['id']) && $_GET['id'] > 0 ) { - -$request = "/orders/".esc_attr($_GET['id'])."?contact_list=0"; -$orderfo = callDoliApi("GET", $request, null, dolidelay('order', esc_attr(isset($_GET["refresh"]) ? $_GET["refresh"] : null))); -//print $orderfo; -} + if ( isset($_GET['id']) && $_GET['id'] > 0 ) { + $request = "/orders/".esc_attr($_GET['id'])."?contact_list=0"; + $orderfo = callDoliApi("GET", $request, null, dolidelay('order', esc_attr(isset($_GET["refresh"]) ? $_GET["refresh"] : null))); + } + $thirdparty = doliConnect('thirdparty', $current_user, false, esc_attr(isset($_GET["refresh"]) ? $_GET["refresh"] : null)); -if ( !isset($orderfo->error) && isset($_GET['id']) && isset($_GET['ref']) && (doliconnector($current_user, 'fk_soc') == $orderfo->socid ) && ($_GET['ref'] == $orderfo->ref) && $orderfo->statut != 0 && isset($_GET['security']) && wp_verify_nonce( $_GET['security'], 'doli-orders-'.$orderfo->id.'-'.$orderfo->ref)) { +if ( !isset($orderfo->error) && isset($_GET['id']) && isset($_GET['ref']) && ($thirdparty->id == $orderfo->socid ) && ($_GET['ref'] == $orderfo->ref) && $orderfo->statut != 0 && isset($_GET['security']) && wp_verify_nonce( $_GET['security'], 'doli-orders-'.$orderfo->id.'-'.$orderfo->ref)) { print '
".sprintf( __( 'Please send your cheque in the amount of %1$s with reference %2$s to %3$s at the following address', 'doliconnect'), doliprice($orderfo, 'ttc', isset($orderfo->multicurrency_code) ? $orderfo->multicurrency_code : null), $orderfo->ref, $listpaymentmethods->CHQ->proprio).":
"; print "".$listpaymentmethods->CHQ->owner_address."
"; @@ -535,7 +534,7 @@ function orders_module( $url ) { print "".sprintf( __( 'Please send your transfert in the amount of %1$s with reference %2$s at the following account', 'doliconnect'), doliprice($orderfo, 'ttc', isset($orderfo->multicurrency_code) ? $orderfo->multicurrency_code : null), $orderfo->ref ).":";
if (isset($listpaymentmethods->VIR->bank)) print "
".__( 'Bank', 'doliconnect').": ".$listpaymentmethods->VIR->bank."";
@@ -568,7 +567,6 @@ function orders_module( $url ) {
print "
".sprintf( __( 'Please send your cheque in the amount of %1$s with reference %2$s to %3$s at the following address', 'doliconnect'), doliprice($invoicefo, 'ttc', isset($invoicefo->multicurrency_code) ? $invoicefo->multicurrency_code : null), $invoicefo->ref, $listpaymentmethods->CHQ->proprio).":
"; print "".$listpaymentmethods->CHQ->owner_address."
"; @@ -802,7 +799,7 @@ function invoices_module( $url ) { print "".sprintf( __( 'Please send your transfert in the amount of %1$s with reference %2$s at the following account', 'doliconnect'), doliprice($invoicefo, 'ttc', isset($invoicefo->multicurrency_code) ? $invoicefo->multicurrency_code : null), $invoicefo->ref ).":";
print "
".__( 'Bank', 'doliconnect').": ".$listpaymentmethods->VIR->bank."";
@@ -835,8 +832,6 @@ function invoices_module( $url ) {
print "