Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
ptibogxiv committed Apr 1, 2019
1 parent a3fab7e commit ceae85b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions blocks/membership/membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ function doliconnect_membership_render_block( $attributes ) {
$html = "";

if (is_user_logged_in() && constant("DOLIBARR_MEMBER") > 0){
$adherent = callDoliApi("GET", "/adherentsplus/".constant("DOLIBARR_MEMBER"), "", HOUR_IN_SECONDS);
$adherent = callDoliApi("GET", "/adherentsplus/".constant("DOLIBARR_MEMBER"), null, dolidelay('member', esc_attr(isset($_GET["refresh"]) ? $_GET["refresh"] : null), true));
}

$typeadhesion = callDoliApi("GET", "/adherentsplus/type?sortfield=t.price&sqlfilters=(t.family:!=:'1')&sortorder=ASC", "", dolidelay(MONTH_IN_SECONDS, esc_attr(isset($_GET["refresh"]) ? $_GET["refresh"] : null), true));
$typeadhesion = callDoliApi("GET", "/adherentsplus/type?sortfield=t.price&sqlfilters=(t.family:!=:'1')&sortorder=ASC", null, dolidelay('member', esc_attr(isset($_GET["refresh"]) ? $_GET["refresh"] : null), true));

$typeadhesionpro = callDoliApi("GET", "/adherentsplus/type?sortfield=t.price&sqlfilters=(t.family:=:'1')&sortorder=ASC", "", dolidelay(MONTH_IN_SECONDS, esc_attr(isset($_GET["refresh"]) ? $_GET["refresh"] : null), true));
$typeadhesionpro = callDoliApi("GET", "/adherentsplus/type?sortfield=t.price&sqlfilters=(t.family:=:'1')&sortorder=ASC", null, dolidelay('member', esc_attr(isset($_GET["refresh"]) ? $_GET["refresh"] : null), true));

if ( $typeadhesionpro->error->code != '404' ) {
$html .= '<center><ul class="nav nav-pills nav-justified" id="pills-tab" role="tablist">
Expand Down Expand Up @@ -200,4 +200,4 @@ function doliconnect_membership_render_block( $attributes ) {
} // End function organic_profile_block().

// Hook: Editor assets.
add_action( 'init', 'doliconnect_membership_block' );
add_action( 'init', 'doliconnect_membership_block' );
2 changes: 1 addition & 1 deletion blocks/product/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function doliconnect_product_render_block( $attributes ) {

$html = '<DIV class="card shadow-sm"><DIV class="card-body">';
if ($attributes['productID']>0) {
$product = callDoliApi("GET", "/products/".$attributes['productID'], "");
$product = callDoliApi("GET", "/products/".$attributes['productID'], null, dolidelay('product'));
//$html .= $product;

if (defined("DOLIBUG")) {
Expand Down
4 changes: 2 additions & 2 deletions functions/tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ function dolibug(){
//header('Refresh: 180; URL='.esc_url(get_permalink()).'');
$bug = '<div id="dolibug" ><br><br><br><br><br><center><div class="align-middle"><i class="fas fa-bug fa-3x fa-fw"></i><h4>'.__( 'Oops, our servers are unreachable. Thank you for coming back in a few minutes.', 'doliconnect' ).'</h4>';
if ( ! empty(constant("DOLIBUG")) ) {
echo '<h6>'.__( 'Error code', 'doliconnect' ).' #'.constant("DOLIBUG").'</h6>';
$bug .= '<h6>'.__( 'Error code', 'doliconnect' ).' #'.constant("DOLIBUG").'</h6>';
}
echo '</div></center><br><br><br><br><br></div>';
$bug .='</div></center><br><br><br><br><br></div>';
return $bug;
}

Expand Down

0 comments on commit ceae85b

Please sign in to comment.