Skip to content

Commit

Permalink
Update tools.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ptibogxiv committed Nov 13, 2024
1 parent ab092f0 commit 0223d4e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion functions/tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ function doliConnect($fonction, $current_user = null, $boolean = false, $refresh
} elseif ($fonction == 'user' && isset($current_user->user_email) && !empty($current_user->user_email)) {
$return = callDoliApi("GET", "/users/email/".$current_user->user_email, null, dolidelay('doliconnector', $refresh));
} elseif ($fonction == 'order' && isset($current_user->user_email) && !empty($current_user->user_email)) {
$thirdparty = callDoliApi("GET", "/thirdparties/email/".$current_user->user_email, null, dolidelay('doliconnector'));
if ( doliversion('21.0.0') ) {
$thirdparty = callDoliApi("GET", "/thirdparties/accounts/wordpress/".$current_user->ID, null, dolidelay('doliconnector', $refresh));
} else {
$thirdparty = callDoliApi("GET", "/thirdparties/email/".$current_user->user_email, null, dolidelay('doliconnector', $refresh));
}
if (isset($thirdparty->id)) $object = callDoliApi("GET", "/orders?sortfield=t.rowid&sortorder=DESC&limit=1&thirdparty_ids=".$thirdparty->id."&sqlfilters=(t.fk_statut%3A%3D%3A'0')and(t.module_source%3A%3D%3A'doliconnect')&pagination_data=true", null, dolidelay('doliconnector', $refresh));
if ( doliversion('20.0.0') && isset($object->data) ) { $object = $object->data; } elseif ( isset($object) ) { $object = $object; } else { $object = null; }
if (isset($object[0])) {
Expand Down

0 comments on commit 0223d4e

Please sign in to comment.