Skip to content

Commit

Permalink
Merge pull request #76 from Project60/50-bad-link-in-wp
Browse files Browse the repository at this point in the history
@vurt2's proposal for #50
  • Loading branch information
bjendres authored Aug 21, 2024
2 parents e923fd1 + d21d5df commit d0fcc4a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
30 changes: 15 additions & 15 deletions templates/CRM/Bic/Page/BicList.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

{crmScope extensionKey='org.project60.bic'}
{if $show_message}
<div id="help">{ts}This page allows you to find banks and additional information. If you can't find the bank you're looking for, you may want to <a href='bicImport'>update your bank list</a>.{/ts}</div>
<div id="help">{ts}This page allows you to find banks and additional information. If you can't find the bank you're looking for, you may want to <a href='/civicrm/bicImport'>update your bank list</a>.{/ts}</div>
{/if}


Expand Down Expand Up @@ -69,7 +69,7 @@
{foreach from=$countries item=country}
<option value="{$country}" {if $country eq $default_country}selected{/if}>{$country_names.$country}</option>
{/foreach}
</select>
</select>
</td>
<td><input type="text" value="" name="nbid" id="nbid"></td>
<td><input type="text" value="" name="bic" id="bic" style="text-transform:uppercase;"></td>
Expand Down Expand Up @@ -98,13 +98,13 @@
<script type="text/javascript">
// Empty fields when loading the page
cleanFilters();

// Perform a search when a field changes
cj("#country").change(sendQuery);
cj("#bic").change(sendQuery);
cj("#nbid").change(sendQuery);
cj("#iban").change(sendIBANQuery);

// Empty BIC when writting NBID and viceversa
cj("#bic").keyup(enteringBIC);
cj("#nbid").keyup(enteringNBID);
Expand All @@ -116,7 +116,7 @@
query['bic'] = cj("#bic").val();
query['nbid'] = cj("#nbid").val();
query['country'] = cj("#country").val();

CRM.api3('Bic', 'get', query).done(
function(result) {
if (result.count > 0 ) {
Expand All @@ -130,15 +130,15 @@
"<td>" + result.values[key].country + "</td>" +
"<td>" + result.values[key].nbid + "</td>" +
"</tr>";
if (rowstyle == 'odd-row') { rowstyle = 'even-row'; } else { rowstyle = 'odd-row'; }
}

cj("#results").empty();
cj("#results").append(line);

} else {
var line = "<tr class='odd-row'><td colspan='5'>Could not find any match with this criteria. You may want to <a href='bicImport'>update your bank list</a>.</td></tr>";
var line = "<tr class='odd-row'><td colspan='5'>Could not find any match with this criteria. You may want to <a href='/civicrm/bicImport'>update your bank list</a>.</td></tr>";
cj("#results").empty();
cj("#results").append(line);
}
Expand All @@ -155,7 +155,7 @@
query['iban'] = query['iban'].replace(reSpaceAndMinus, "");
query['iban'] = query['iban'].toUpperCase();


CRM.api3('Bic', 'findbyiban', query).done(
function(result) {
if (result.count != 0 ) {
Expand All @@ -166,12 +166,12 @@
"<td>" + result.country + "</td>" +
"<td>" + result.nbid + "</td>" +
"</tr>";
cj("#iban_results").empty();
cj("#iban_results").append(line);
} else {
var line = "<tr class='odd-row'><td colspan='5'>Could not find any match with this criteria. You may want to <a href='bicImport'>update your bank list</a>.</td></tr>";
let line = "<tr class='odd-row'><td colspan='5'>Could not find any match with this criteria. You may want to <a href='/civicrm/bicImport'>update your bank list</a>.</td></tr>";
cj("#iban_results").empty();
cj("#iban_results").append(line);
}
Expand All @@ -192,7 +192,7 @@
sendQuery();
}
}

function enteringIBAN() {
if(cj("#iban").val().length >= 10) {
sendIBANQuery();
Expand All @@ -205,4 +205,4 @@
}
</script>
{/literal}
{/crmScope}
{/crmScope}
8 changes: 4 additions & 4 deletions templates/CRM/Bic/Page/Config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
If you click the Update button, next to the name of one of the listed countries,
CiviCRM will try to connect to the official source of financial institutions
in this country and retrieve its bank information. Then, you'll be able to
query this information in the <a href="bicList">Banks List</a> page.
query this information in the <a href="/civicrm/bicList">Banks List</a> page.
{/ts}</div>

{* TODO: make this more beatiful ;) *}
Expand Down Expand Up @@ -77,7 +77,7 @@
<script type="text/javascript">
cj("#printer-friendly").hide();
cj("#access").hide();

cj().crmAccordions();

// UPDATE BUTTONS
Expand All @@ -88,7 +88,7 @@

// disable buttons
cj('.button').addClass('disabled');

if (country_code=='all') {
// set ALL to busy
cj(button).parent().parent().parent().parent().parent().find('[name="busy"]').show();
Expand Down Expand Up @@ -131,4 +131,4 @@
}
</script>
{/literal}
{/crmScope}
{/crmScope}

0 comments on commit d0fcc4a

Please sign in to comment.