Skip to content

Commit

Permalink
Merge branch 'master' of [email protected]:DoliCloud/SellYourSaas.git
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jan 16, 2024
2 parents b13f347 + dafa3c0 commit f2335d6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion myaccount/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2263,7 +2263,8 @@
$duration_unit = $tmparray['duration_unit'];
$date_start = dol_now();
$date_end = dol_time_plus_duree($now, $duration_value, $duration_unit) - 1;
$descriptionlines = "Websiteref = ".$website->ref;
$descriptionlines = "WebsiteRef=".$website->ref.", ";
$descriptionlines .= "WebsiteDomainName=".$domainnamewebsite;
$foundlinecontract = 0;
foreach ($object->lines as $key => $line) {
if ($line->description == $descriptionlines && $line->fk_product == $productid) {
Expand Down
21 changes: 21 additions & 0 deletions myaccount/tpl/instances.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -798,12 +798,33 @@
print '<span class="bold">'.$langs->trans("OptionWebsite").'&nbsp;</span>';
print '<select style="width:60%" id="websiteidoption" name="websiteidoption">';
print '<option value="">&nbsp;</option>';
$contractlines = $contract->lines;
$arraywebsitesenabled = array();
foreach ($contractlines as $line) {
if ($line->fk_product == getDolGlobalInt("SELLYOURSAAS_PRODUCT_ID_FOR_WEBSITE_DEPLOYMENT")) {
$desc = $line->description;
$tmpdesc = explode(", ", $desc);
$websiteref = explode("WebsiteRef=", $tmpdesc[0])[1];
$websitecustomurl = explode("WebsiteDomainName=", $tmpdesc[1])[1];
$arraywebsitesenabled[$websiteref] = $websitecustomurl;
}
}
foreach ($listofwebsitestoactivate as $website) {
$isalreadyactivated = 0;
if (isset($arraywebsitesenabled[$website->ref])) {
$isalreadyactivated = 1;
}
print '<option value="'.$website->id.'" '.(GETPOST("websiteidoption", "int") == $website->id ? "selected" : "");
if ($isalreadyactivated) {
print " disabled";
}
if ($website->status != $websitestatic::STATUS_VALIDATED) {
print " disabled";
}
print '>'.$website->ref;
if ($isalreadyactivated) {
print ' - '.$arraywebsitesenabled[$website->ref];
}
if ($website->status != $websitestatic::STATUS_VALIDATED) {
print ' - '.$langs->trans("Disabled");
}
Expand Down

0 comments on commit f2335d6

Please sign in to comment.