From 5efeb2f094ce60b39bf6665f3427b5e40be06e14 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 18 Jan 2022 14:16:38 +0100 Subject: [PATCH] FIX break after find current domain name --- myaccount/tpl/instances.tpl.php | 6 ++++-- myaccount/tpl/mycustomerinstances.tpl.php | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/myaccount/tpl/instances.tpl.php b/myaccount/tpl/instances.tpl.php index 9296ea285..ecaa6af68 100644 --- a/myaccount/tpl/instances.tpl.php +++ b/myaccount/tpl/instances.tpl.php @@ -1006,7 +1006,9 @@ function disable_combo_if_not(s) { print "/* Code if we select pid = ".$key." so plan = ".$plan['label']." with restrict_domains = ".$plan['restrict_domains']." */\n"; foreach($restrict_domains as $domain) { print " if (pid == ".$key.") { disable_combo_if_not('".trim($domain)."'); }\n"; - break; // We keep only the first domain in list as the domain to keep possible for deployment + if ($domain == $domainname) { + break; // We keep only the first domain in list as the domain to keep possible for deployment + } } } else { print ' /* No restriction for pid = '.$key.', currentdomain is '.$domainname.' */'."\n"; @@ -1050,7 +1052,7 @@ function disable_combo_if_not(s) { print ''; print ''; // end Add a new instance - + print ' diff --git a/myaccount/tpl/mycustomerinstances.tpl.php b/myaccount/tpl/mycustomerinstances.tpl.php index 9eaf362ea..50f10fe9b 100644 --- a/myaccount/tpl/mycustomerinstances.tpl.php +++ b/myaccount/tpl/mycustomerinstances.tpl.php @@ -236,7 +236,7 @@ } print "\n"; print '
'; - + // Calculate price on invoicing $contract->fetchObjectLinked(); @@ -306,7 +306,7 @@ $maxWidth=40; $alt=''; $htmlforphoto = $tmpproduct->show_photos('product', $conf->product->dir_output, 1, 1, 1, 0, 0, $maxHeight, $maxWidth, 1, 1, 1); - + if (empty($htmlforphoto) || $htmlforphoto == '' || $htmlforphoto == ''."\n") { print ''; print '
'; @@ -315,7 +315,7 @@ } else { print $htmlforphoto; } - + //var_dump($tmpproduct->array_options); /*if ($tmpproduct->array_options['options_app_or_option'] == 'app') { @@ -877,7 +877,9 @@ function disable_combo_if_not(s) { $restrict_domains = explode(",", $plan['restrict_domains']); foreach($restrict_domains as $domain) { print " if (pid == ".$key.") { disable_combo_if_not('".$domain."'); }\n"; - break; + if ($domain == $domainname) { + break; // We keep only the first domain in list as the domain to keep possible for deployment + } } } else { print ' /* No restriction for pid = '.$key.', currentdomain is '.$domainname.' */'."\n";