Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Extensions
UK Postcodes
Commits
8de877d8
Unverified
Commit
8de877d8
authored
Nov 28, 2018
by
mattwire
Committed by
GitHub
Nov 28, 2018
Browse files
Merge pull request #33 from mattwire/fix_staticcontext
Remove accessing $this in static context
parents
b90c5779
4bf8f613
Changes
6
Hide whitespace changes
Inline
Side-by-side
CRM/Civicrmpostcodelookup/Page/Afd.php
View file @
8de877d8
...
...
@@ -42,7 +42,7 @@ class CRM_Civicrmpostcodelookup_Page_Afd extends CRM_Civicrmpostcodelookup_Page_
*/
public
static
function
search
()
{
$postcode
=
self
::
getPostcode
(
TRUE
);
// FIXME: Check whether API requires space or not
$number
=
CRM_Utils_Request
::
retrieve
(
'number'
,
'String'
,
$this
,
false
);
$number
=
CRM_Utils_Request
::
retrieve
(
'number'
,
'String'
);
$querystring
=
self
::
getAFDCredentials
(
1
);
$querystring
=
$querystring
.
"&postcode="
.
$postcode
.
"&property="
.
$number
;
...
...
@@ -95,7 +95,10 @@ class CRM_Civicrmpostcodelookup_Page_Afd extends CRM_Civicrmpostcodelookup_Page_
* Function to get address details based on the AFD addressid/postkey
*/
public
static
function
getaddress
()
{
$moniker
=
CRM_Utils_Request
::
retrieve
(
'id'
,
'String'
,
$this
,
true
);
$moniker
=
CRM_Utils_Request
::
retrieve
(
'id'
,
'String'
);
if
(
empty
(
$moniker
))
{
exit
;
}
$address
=
self
::
getAddressByMoniker
(
$moniker
);
$response
=
array
(
...
...
CRM/Civicrmpostcodelookup/Page/Civipostcode.php
View file @
8de877d8
...
...
@@ -41,7 +41,7 @@ class CRM_Civicrmpostcodelookup_Page_Civipostcode extends CRM_Civicrmpostcodeloo
*/
public
static
function
search
()
{
$postcode
=
self
::
getPostcode
(
TRUE
);
$number
=
CRM_Utils_Request
::
retrieve
(
'number'
,
'String'
,
$this
,
false
);
$number
=
CRM_Utils_Request
::
retrieve
(
'number'
,
'String'
);
$querystring
=
self
::
getCivipostcodeCredentials
(
1
);
$querystring
=
$querystring
.
"&postcode="
.
urlencode
(
$postcode
)
.
"&property="
.
$number
;
...
...
@@ -110,7 +110,10 @@ class CRM_Civicrmpostcodelookup_Page_Civipostcode extends CRM_Civicrmpostcodeloo
* Function to get address details based on the Civipostcode address id
*/
public
static
function
getaddress
()
{
$moniker
=
CRM_Utils_Request
::
retrieve
(
'id'
,
'String'
,
$this
,
true
);
$moniker
=
CRM_Utils_Request
::
retrieve
(
'id'
,
'String'
);
if
(
empty
(
$moniker
))
{
exit
;
}
$address
=
self
::
getAddressByMoniker
(
$moniker
);
$response
=
array
(
...
...
CRM/Civicrmpostcodelookup/Page/Experian.php
View file @
8de877d8
...
...
@@ -44,7 +44,10 @@ class CRM_PostcodeLookup_Page_Ajax extends CRM_Civicrmpostcodelookup_Page_Postco
public
static
function
search
()
{
$postcode
=
self
::
getPostcode
(
TRUE
);
// FIXME: Check whether API requires space or not
$number
=
CRM_Utils_Request
::
retrieve
(
'number'
,
'String'
,
$this
,
true
);
$number
=
CRM_Utils_Request
::
retrieve
(
'number'
,
'String'
);
if
(
!
$number
)
{
exit
;
}
$qaCapture
=
self
::
getQACapture
();
$ret
=
$qaCapture
->
Search
(
"
$number
,
$postcode
"
,
'GBR'
,
'Singleline'
,
true
);
//, $intensity, $promptset, $threshold, $timeout, $layout, $formattedAddressInPicklist, $requestTag, $localisation)
...
...
@@ -80,7 +83,10 @@ class CRM_PostcodeLookup_Page_Ajax extends CRM_Civicrmpostcodelookup_Page_Postco
}
public
static
function
getaddress
()
{
$moniker
=
CRM_Utils_Request
::
retrieve
(
'id'
,
'String'
,
$this
,
true
);
$moniker
=
CRM_Utils_Request
::
retrieve
(
'id'
,
'String'
);
if
(
empty
(
$moniker
))
{
exit
;
}
$address
=
self
::
getAddressByMoniker
(
$moniker
);
$response
=
array
(
...
...
@@ -94,7 +100,10 @@ class CRM_PostcodeLookup_Page_Ajax extends CRM_Civicrmpostcodelookup_Page_Postco
private
static
function
getQACapture
()
{
if
(
self
::
$qacampture
===
null
)
{
// @todo retrieved value should be encoded somehow, MD5 or whatever
$mode
=
CRM_Utils_Request
::
retrieve
(
'mode'
,
'String'
,
$this
,
TRUE
,
'1'
);
$mode
=
CRM_Utils_Request
::
retrieve
(
'mode'
,
'String'
);
if
(
!
$mode
)
{
$mode
=
'1'
;
}
$params
=
self
::
getQasCredentials
(
$mode
);
self
::
$qacampture
=
new
QASCapture
(
$params
);
}
...
...
CRM/Civicrmpostcodelookup/Page/GetAddressIo.php
View file @
8de877d8
...
...
@@ -18,7 +18,7 @@ class CRM_Civicrmpostcodelookup_Page_GetAddressIo extends CRM_Civicrmpostcodeloo
if
(
!
self
::
isValidPostcode
(
$postcode
))
{
exit
;
}
$number
=
CRM_Utils_Request
::
retrieve
(
'number'
,
'String'
,
$this
,
FALSE
);
$number
=
CRM_Utils_Request
::
retrieve
(
'number'
,
'String'
);
$apiUrl
=
self
::
getAddressIoApiUrl
(
$postcode
,
$number
);
// get address result from getAddress.io
$addressData
=
self
::
addressAPIResult
(
$apiUrl
);
...
...
@@ -47,10 +47,8 @@ class CRM_Civicrmpostcodelookup_Page_GetAddressIo extends CRM_Civicrmpostcodeloo
* Function to get address details based on the selected address
*/
public
static
function
getaddress
()
{
try
{
$selectedId
=
CRM_Utils_Request
::
retrieve
(
'id'
,
'String'
,
$this
,
TRUE
,
NULL
,
'REQUEST'
,
TRUE
);
}
catch
(
CRM_Core_Exception
$e
)
{
$selectedId
=
CRM_Utils_Request
::
retrieve
(
'id'
,
'String'
);
if
(
empty
(
$selectedId
))
{
exit
;
}
...
...
CRM/Civicrmpostcodelookup/Page/Postcode.php
View file @
8de877d8
...
...
@@ -11,7 +11,7 @@ abstract class CRM_Civicrmpostcodelookup_Page_Postcode extends CRM_Core_Page {
* @return string
*/
protected
static
function
getPostcode
(
$space
=
FALSE
)
{
$postcode
=
CRM_Utils_Request
::
retrieve
(
'term'
,
'String'
,
$this
,
true
);
$postcode
=
CRM_Utils_Request
::
retrieve
(
'term'
,
'String'
);
return
self
::
format
(
$postcode
,
$space
);
}
...
...
CRM/Civicrmpostcodelookup/Page/PostcodeAnywhere.php
View file @
8de877d8
...
...
@@ -97,7 +97,10 @@ class CRM_Civicrmpostcodelookup_Page_PostcodeAnywhere extends CRM_Civicrmpostcod
* Function to get address details based on the PostcodeAnywhere addressid/postkey
*/
public
static
function
getaddress
()
{
$moniker
=
CRM_Utils_Request
::
retrieve
(
'id'
,
'String'
,
$this
,
true
);
$moniker
=
CRM_Utils_Request
::
retrieve
(
'id'
,
'String'
);
if
(
empty
(
$moniker
))
{
exit
;
}
$address
=
self
::
getAddressByMoniker
(
$moniker
);
$response
=
array
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment