Skip to content

Commit 217808a

Browse files
author
Cameron Hall
authored
Bug fixes for release v2.1.3 (#12)
* Fixed #10: Domain information now displays for pending transfers * Fixes #9: Transfer price for on pricing import reflects module setting * Fixes #7: Prefixed all custom CSS rules with "sw-" * Updated CHANGELOG for 2.1.3 release * Removed .au transfer price variation for module setting It doesn't make sense to force the price for this because it is free if the .AU domain name is outside the renewal period. * Updated Makefile to add versions to the asset imports in the header
1 parent 99e9bad commit 217808a

File tree

10 files changed

+79
-55
lines changed

10 files changed

+79
-55
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ Synergy Wholesale WHMCS Domains Module
1515
### Removed
1616
-
1717

18+
## 2.1.3 [Updated 16/04/2020]
19+
20+
### Fixed
21+
- Fixed error "Registry Error: Data missing" on pending domain transfers in WHMCS versions 7.6 and later. Fixes [#10](https://github.com/SynergyWholesale/WHMCS-Domains-Module/issues/10)
22+
- Fixed transfer price for .au domains on pricing import. The transfer price will be set to "0.00" for all .au domains. Fixes [#9](https://github.com/SynergyWholesale/WHMCS-Domains-Module/issues/9)
23+
- Fixed style sheet rules conflicting with themes by prefixing any CSS rules with `sw-`. Fixes [#7](https://github.com/SynergyWholesale/WHMCS-Domains-Module/issues/7)
24+
25+
### Changed
26+
- Updated `Makefile` and `hooks.php` to insert module version as a parameter to prevent browsers loading cached assets after new releases.
1827

1928
## 2.1.2 [Updated 30/03/2020]
2029
### Fixed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ update-whois:
2525
replace:
2626
sed -i${SED_PARAM} "s/{{VERSION}}/${VERSION}/g" "README.txt"
2727
sed -i${SED_PARAM} "s/{{RELEASE_DATE}}/${RELEASE_DATE}/g" "README.txt"
28+
sed -i${SED_PARAM} "s/{{VERSION}}/${VERSION:v%=%}/g" "modules/registrars/synergywholesaledomains/hooks.php"
2829
sed -i${SED_PARAM} "s/{{VERSION}}/${VERSION:v%=%}/g" "modules/registrars/synergywholesaledomains/synergywholesaledomains.php"
2930
sed -i${SED_PARAM} "s/{{API}}/${SW_API_HOSTNAME}/g" "modules/registrars/synergywholesaledomains/synergywholesaledomains.php"
3031
sed -i${SED_PARAM} "s/{{FRONTEND}}/${SW_FRONTEND_HOSTNAME}/g" "modules/registrars/synergywholesaledomains/synergywholesaledomains.php"
3132

3233
revert:
3334
sed -i${SED_PARAM} "s/${VERSION}/{{VERSION}}/g" "README.txt"
34-
sed -i${SED_PARAM} "s/${RELEASE_DATE}/{{RELEASE_DATE}}/g" "README.txt"
35+
sed -i${SED_PARAM} "s/${VERSION}/{{VERSION}}/g" "README.txt"
36+
sed -i${SED_PARAM} "s/{{VERSION}}/${VERSION:v%=%}/g" "modules/registrars/synergywholesaledomains/hooks.php"
3537
sed -i${SED_PARAM} "s/${VERSION:v%=%}/{{VERSION}}/g" "modules/registrars/synergywholesaledomains/synergywholesaledomains.php"
3638
sed -i${SED_PARAM} "s/${SW_API_HOSTNAME}/{{API}}/g" "modules/registrars/synergywholesaledomains/synergywholesaledomains.php"
3739
sed -i${SED_PARAM} "s/${SW_FRONTEND_HOSTNAME}/{{FRONTEND}}/g" "modules/registrars/synergywholesaledomains/synergywholesaledomains.php"

modules/registrars/synergywholesaledomains/css/synergywholesaledomains.css

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @copyright Copyright (c) Synergy Wholesale Pty Ltd 2020
55
* @license https://github.com/synergywholesale/whmcs-domains-module/LICENSE
66
*/
7-
.ellipis {
7+
.sw-ellipis {
88
overflow: hidden;
99
-ms-text-overflow: ellipsis;
1010
-o-text-overflow: ellipsis;
@@ -13,49 +13,49 @@
1313
white-space: nowrap;
1414
}
1515

16-
.no-margin {
16+
.sw-no-margin {
1717
margin: unset;
1818
}
1919

20-
.inline {
20+
.sw-inline {
2121
display:inline-block;
2222
}
23-
.insertRow {
23+
.sw-insert-row {
2424
margin: 20px 0 10px 0;
2525
}
2626

27-
.row select[name=type] {
27+
.sw-table-form select[name=type] {
2828
width:100%;
2929
}
3030

31-
.row input[type=text], .row select {
31+
.sw-table-form input[type=text], .sw-table-form select {
3232
height:33px;
3333
}
3434

35-
.row-table .row:not(#divHeading) {
35+
.sw-row-table .row:not(#sw-heading) {
3636
padding:5px 0 5px 0;
3737
}
3838

39-
.row-table .row:not(#divHeading):nth-child(even) {
39+
.sw-row-table .row:not(#sw-heading):nth-child(even) {
4040
background-color:#F0F0F5;
4141
}
4242

43-
.row-table .row:not(#divHeading):nth-child(odd) {
43+
.sw-row-table .row:not(#sw-heading):nth-child(odd) {
4444
background-color:#F2F7FC;
4545
}
4646

47-
.loader {
47+
.sw-loader {
4848
border: 8px solid #f3f3f3;
4949
border-top: 8px solid #3498db;
5050
border-radius: 50%;
5151
width: 60px;
5252
height: 60px;
53-
animation: spin 1.5s linear infinite;
53+
animation: sw-spin 1.5s linear infinite;
5454
margin: auto;
5555
margin-bottom: 20px;
5656
}
5757

58-
@keyframes spin {
58+
@keyframes sw-spin {
5959
0% {
6060
transform: rotate(0deg);
6161
}

modules/registrars/synergywholesaledomains/domainchildhosts.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
{assign var="count" value=$ipArray|@count}
3636
{foreach $ipArray as $ipRecord}
3737
<tr>
38-
<td><div class="ellipis">{$key}</div></td>
39-
<td><div class="ellipis">{$ipRecord}</div></td>
38+
<td><div class="sw-ellipis">{$key}</div></td>
39+
<td><div class="sw-ellipis">{$ipRecord}</div></td>
4040
<td class="text-right">
4141
<form class="form-horizontal" role="form" method="post" action="clientarea.php?action=domaindetails&id={$domainid}&modop=custom&a=manageChildHosts">
4242
<input type="hidden" name="ipHost" value="{$key}"/>
@@ -88,7 +88,7 @@
8888
<tbody>
8989
{foreach $records as $key => $ipArray}
9090
<tr>
91-
<td><div class="ellipis">{$key}</div></td>
91+
<td><div class="sw-ellipis">{$key}</div></td>
9292
<td class="text-right">
9393
<form class="form-horizontal" role="form" method="post" action="clientarea.php?action=domaindetails&id={$domainid}&modop=custom&a=manageChildHosts">
9494
<input type="hidden" name="ipHost" value="{$key}"/>

modules/registrars/synergywholesaledomains/domaindnsemailforwarding.tpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
<input id="domainid" type="hidden" name="domainid" value="{$domainid}" />
99
<input id="domainname" type="hidden" name="domainname" value="{$domain}" />
1010

11-
<div class="row no-margin">
12-
<h3 class="inline">Email Forwards</h3>
13-
<button type="button" class="btn btn-success insertRow pull-right"><span class="glyphicon glyphicon-plus"></span></button>
11+
<div class="row sw-no-margin">
12+
<h3 class="sw-inline">Email Forwards</h3>
13+
<button type="button" class="btn btn-success sw-insert-row pull-right"><span class="glyphicon glyphicon-plus"></span></button>
1414
</div>
15-
<div class="container col-lg-12 row-table" id="emailforwards">
16-
<div class="row" id="divHeading">
15+
<div class="container col-lg-12 sw-row-table" id="emailforwards">
16+
<div class="row" id="sw-heading">
1717
<div class="col-lg-4">Prefix</div>
1818
<div class="col-lg-2"></div>
1919
<div class="col-lg-4">Forward To</div>
@@ -22,4 +22,4 @@
2222
<hr>
2323
</div>
2424
<div>&nbsp;</div>
25-
<div class="loader"></div>
25+
<div class="sw-loader"></div>

modules/registrars/synergywholesaledomains/domaindnssec.tpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
{foreach $records as $record}
3939
<tr>
4040
{foreach $record as $key => $value}
41-
{if $key eq "keyTag"} <td><div class="ellipis">{$value}</div></td>{/if}
42-
{if $key eq "algorithm"} <td><div class="ellipis">{$value}</div></td>{/if}
43-
{if $key eq "digest"} <td><div class="ellipis">{$value}</div></td>{/if}
44-
{if $key eq "digestType"} <td><div class="ellipis">{$value}</div></td>{/if}
41+
{if $key eq "keyTag"} <td><div class="sw-ellipis">{$value}</div></td>{/if}
42+
{if $key eq "algorithm"} <td><div class="sw-ellipis">{$value}</div></td>{/if}
43+
{if $key eq "digest"} <td><div class="sw-ellipis">{$value}</div></td>{/if}
44+
{if $key eq "digestType"} <td><div class="sw-ellipis">{$value}</div></td>{/if}
4545
{if $key eq "UUID"} {$uuid = $value}{/if}
4646
{/foreach}
4747
<td>
@@ -75,7 +75,7 @@
7575
<label class="control-label col-sm-2" for="algorithm">Algorithm:</label>
7676
<div class="col-xs-5">
7777
<select name="algorithm" class="form-control" id="algorithm" form="form">
78-
<optgroup label="DNSSEC Algorithms"></optgroup>
78+
<optgroup label="DNSSEC Algorithms"></optgroup>
7979
<option value="1">[1] RSA/MD5</option>
8080
<option value="2">[2] Diffie-Hellman</option>
8181
<option value="3">[3] DSA/SHA-1</option>

modules/registrars/synergywholesaledomains/domaindnsurlforwarding.tpl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
<input id="domainid" type="hidden" name="domainid" value="{$domainid}" />
99

10-
<div class="row no-margin">
11-
<h3 class="inline">DNS records</h3>
12-
<button type="button" class="btn btn-success insertRow pull-right" data-append="dnsrecords">
10+
<div class="row sw-no-margin">
11+
<h3 class="sw-inline">DNS records</h3>
12+
<button type="button" class="btn btn-success sw-insert-row pull-right" data-append="dnsrecords">
1313
<span class="glyphicon glyphicon-plus"></span>
1414
</button>
1515
</div>
16-
<div class="container col-lg-12 row-table" id="dnsrecords">
17-
<div class="row no-margin" id="divHeading">
16+
<div class="container col-lg-12 sw-row-table" id="dnsrecords">
17+
<div class="row sw-no-margin" id="sw-heading">
1818
<div class="col-lg-3">Host Name</div>
1919
<div class="col-lg-3">Address / Content</div>
2020
<div class="col-lg-2">Type</div>
@@ -25,16 +25,16 @@
2525
<hr>
2626
</div>
2727
<div>&nbsp;</div>
28-
<div class="loader"></div>
28+
<div class="sw-loader"></div>
2929

30-
<div class="row no-margin">
31-
<h3 class="inline">URL forwards</h3>
32-
<button type="button" class="btn btn-success insertRow pull-right" data-append="urlforwards">
30+
<div class="row sw-no-margin">
31+
<h3 class="sw-inline">URL forwards</h3>
32+
<button type="button" class="btn btn-success sw-insert-row pull-right" data-append="urlforwards">
3333
<span class="glyphicon glyphicon-plus"></span>
3434
</button>
3535
</div>
36-
<div class="container col-lg-12 row-table" id="urlforwards">
37-
<div class="row no-margin" id="divHeading">
36+
<div class="container col-lg-12 sw-row-table" id="urlforwards">
37+
<div class="row sw-no-margin" id="sw-heading">
3838
<div class="col-lg-3">Host Name</div>
3939
<div class="col-lg-3">Address</div>
4040
<div class="col-lg-3">Type</div>
@@ -43,4 +43,4 @@
4343
<hr>
4444
</div>
4545
<div>&nbsp;</div>
46-
<div class="loader"></div>
46+
<div class="sw-loader"></div>

modules/registrars/synergywholesaledomains/hooks.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
return str_replace('{WEB_ROOT}', $vars['WEB_ROOT'], '
9898
<script data-cfasync="false" src="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>
9999
<link href="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css" rel="stylesheet" />
100-
<script data-cfasync="false" src="{WEB_ROOT}/modules/registrars/synergywholesaledomains/js/functions.min.js"></script>
101-
<link rel="stylesheet" type="text/css" href="{WEB_ROOT}/modules/registrars/synergywholesaledomains/css/synergywholesaledomains.min.css" />
100+
<script data-cfasync="false" src="{WEB_ROOT}/modules/registrars/synergywholesaledomains/js/functions.min.js?v=2.1.2"></script>
101+
<link rel="stylesheet" type="text/css" href="{WEB_ROOT}/modules/registrars/synergywholesaledomains/css/synergywholesaledomains.min.css?v=2.1.2" />
102102
');
103103
});

modules/registrars/synergywholesaledomains/js/functions.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function listMailRecords(domain_id) {
4848
return;
4949
}
5050

51-
$('.loader').fadeOut('fast');
51+
$('.sw-loader').fadeOut('fast');
5252
for (i = 0; i < data.length; i++) {
5353
populateEmailRow(data[i].record_id, data[i].prefix, data[i].forward_to);
5454
}
@@ -124,7 +124,7 @@ function saveEmailRecord(domain_id, record_id, formdata) {
124124
// Populate the email row
125125
function populateEmailRow(record_id, prefix, forward_to) {
126126
$('#emailforwards').append(`
127-
<div class="row" id="emailrow-${record_id}">
127+
<div class="row sw-table-form" id="emailrow-${record_id}">
128128
<form id="emailform-${record_id}">
129129
<input type="hidden" name="record_id" id="emailrecord_id-${record_id}" value="${record_id}">
130130
<div class="col-lg-4">
@@ -159,7 +159,7 @@ function listRecords(domain_id) {
159159
return;
160160
}
161161

162-
$('.loader').fadeOut('fast');
162+
$('.sw-loader').fadeOut('fast');
163163
data.forEach(function(record) {
164164
if ('URL' === record.type || 'FRAME' === record.type) {
165165
populateURLRow(record.record_id, record.hostname, record.type, record.address);
@@ -327,7 +327,7 @@ function populateDNSRow(record_id, domain, hostname, type, ttl, address, priorit
327327
</div>`;
328328
}
329329

330-
let template = `<div class="row" id="row-${record_id}">
330+
let template = `<div class="row sw-table-form" id="row-${record_id}">
331331
<form id="form-${record_id}">
332332
<input type="hidden" name="record_id" id="record_id-${record_id}" value="${record_id}">
333333
<div class="col-lg-3">
@@ -369,7 +369,7 @@ function populateURLRow(record_id, hostname, type, address) {
369369
}
370370

371371
$('#urlforwards').append(`
372-
<div class="row" id="urlrow-${record_id}">
372+
<div class="row sw-table-form" id="urlrow-${record_id}">
373373
<form id="urlform-${record_id}">
374374
<input type="hidden" name="record_id" id="urlrecord_id-${record_id}" value="${record_id}">
375375
<div class="col-lg-3">
@@ -443,14 +443,14 @@ function EmailForwardPageReady(domain_id) {
443443
// Retrieve a list of all currently configured records
444444
listMailRecords(domain_id);
445445

446-
// If we get a click on the class insertRow do the following
447-
$(document).on('click', '.insertRow', function() {
446+
// If we get a click on the class sw-insert-row do the following
447+
$(document).on('click', '.sw-insert-row', function() {
448448
// Count the number of div's in the emailforwards div
449449
let row_count = $('#emailforwards > div').length + 1;
450450

451451
// Append the following html to the emailforwards div
452452
$('#emailforwards').append(`
453-
<div class="row" id="emailrow-${row_count}">
453+
<div class="row sw-table-form" id="emailrow-${row_count}">
454454
<form id="emailform-${row_count}">
455455
<input type="hidden" name="record_id" id="newemailrecord_id-${row_count}" value="${row_count}" />
456456
<div class="col-lg-4">
@@ -534,8 +534,8 @@ function DnsUrlPageReady(domain_id) {
534534
});
535535
// Retrieve a list of all currently configured records
536536
listRecords(domain_id);
537-
// If we get a click on the class insertRow do the following
538-
$(document).on('click', '.insertRow', function() {
537+
// If we get a click on the class sw-insert-row do the following
538+
$(document).on('click', '.sw-insert-row', function() {
539539
// Work out which div element we should be adding to
540540
let section = $(this).attr('data-append');
541541
let row_count = 0;
@@ -545,7 +545,7 @@ function DnsUrlPageReady(domain_id) {
545545
row_count = $('#dnsrecords > div').length + 1;
546546
// Append the following html to the dnsrecords div
547547
$('#dnsrecords').append(`
548-
<div class="row" id="row-${row_count}">
548+
<div class="row sw-table-form" id="row-${row_count}">
549549
<form id="form-${row_count}">
550550
<input type="hidden" name="record_id" id="newrecord_id-${row_count}" value="${row_count}">
551551
<div class="col-lg-3">
@@ -585,7 +585,7 @@ function DnsUrlPageReady(domain_id) {
585585
row_count = $('#urlforwards > div').length + 1;
586586

587587
$('#urlforwards').append(`
588-
<div class="row" id="urlrow-${row_count}">
588+
<div class="row sw-table-form" id="urlrow-${row_count}">
589589
<form id="urlform-${row_count}">
590590
<input type="hidden" name="record_id" id="urlnewrecord_id-${row_count}" value="${row_count}">
591591
<div class="col-lg-3">

modules/registrars/synergywholesaledomains/synergywholesaledomains.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2618,13 +2618,18 @@ function synergywholesaledomains_GetTldPricing(array $params)
26182618

26192619
foreach ($response['pricing'] as $extension) {
26202620
$tld = '.' . $extension->tld;
2621+
$transfer_price = $extension->transfer;
2622+
if (preg_match('/\.au$/', $tld)) {
2623+
$transfer_price = 0.00;
2624+
}
2625+
26212626
$results[] = (new WHMCS\Domain\TopLevel\ImportItem())
26222627
->setExtension($tld)
26232628
->setMinYears($extension->minPeriod)
26242629
->setMaxYears($extension->maxPeriod)
26252630
->setRegisterPrice($extension->register_1_year)
26262631
->setRenewPrice($extension->renew)
2627-
->setTransferPrice($extension->transfer)
2632+
->setTransferPrice($transfer_price)
26282633
->setRedemptionFeePrice($extension->redemption)
26292634
->setCurrency('AUD')
26302635
->setEppRequired(!preg_match('/\.uk$/', $tld))
@@ -2646,12 +2651,20 @@ function synergywholesaledomains_GetDomainInformation(array $params)
26462651
];
26472652
}
26482653

2654+
$status = constant('\WHMCS\Domain\Registrar\Domain::STATUS_ACTIVE');
2655+
2656+
if (isset($response['transfer_status'])) {
2657+
return (new WHMCS\Domain\Registrar\Domain())
2658+
->setDomain($response['domainName'])
2659+
->setRegistrationStatus($status)
2660+
;
2661+
}
2662+
26492663
$nameservers = [];
26502664
foreach ($response['nameServers'] as $index => $value) {
26512665
$nameservers['ns' . ($index + 1)] = strtolower($value);
26522666
}
26532667

2654-
$status = constant('\WHMCS\Domain\Registrar\Domain::STATUS_ACTIVE');
26552668
switch (strtolower($response['domain_status'])) {
26562669
case 'expired':
26572670
case 'clienthold':

0 commit comments

Comments
 (0)