Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Relative not absolute names
Browse files Browse the repository at this point in the history
  • Loading branch information
ecartz committed Oct 25, 2020
1 parent 759a676 commit abc49f9
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 34 deletions.
6 changes: 3 additions & 3 deletions includes/modules/customer_data/cd_city.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,21 @@ public function display_input($customer_details = null) {
$input = tep_draw_input_field('city', $city, $attribute)
. $postInput;

include $GLOBALS['oscTemplate']->map_to_template($this->get_constant('TEMPLATE'));
include $GLOBALS['oscTemplate']->map_to_template($this->base_constant('TEMPLATE'));
}

public function process(&$customer_details) {
$customer_details['city'] = tep_db_prepare_input($_POST['city'] ?? '');

if (strlen($customer_details['city']) < $this->get_constant('MIN_LENGTH')
if (strlen($customer_details['city']) < $this->base_constant('MIN_LENGTH')
&& ($this->is_required()
|| !empty($customer_details['city'])
)
)
{
$GLOBALS['messageStack']->add_classed(
$GLOBALS['message_stack_area'] ?? 'customer_data',
sprintf(ENTRY_CITY_ERROR, $this->get_constant('MIN_LENGTH')));
sprintf(ENTRY_CITY_ERROR, $this->base_constant('MIN_LENGTH')));

return false;
}
Expand Down
6 changes: 3 additions & 3 deletions includes/modules/customer_data/cd_company.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,21 @@ public function display_input($customer_details = null) {
$input = tep_draw_input_field('company', $company, $attribute)
. $postInput;

include $GLOBALS['oscTemplate']->map_to_template($this->get_constant('TEMPLATE'));
include $GLOBALS['oscTemplate']->map_to_template($this->base_constant('TEMPLATE'));
}

public function process(&$customer_details) {
$customer_details['company'] = tep_db_prepare_input($_POST['company']);

if (strlen($customer_details['company']) < $this->get_constant('MIN_LENGTH')
if (strlen($customer_details['company']) < $this->base_constant('MIN_LENGTH')
&& ($this->is_required()
|| !empty($customer_details['company'])
)
)
{
$GLOBALS['messageStack']->add_classed(
$GLOBALS['message_stack_area'] ?? 'customer_data',
sprintf(ENTRY_COMPANY_ERROR, $this->get_constant('MIN_LENGTH')));
sprintf(ENTRY_COMPANY_ERROR, $this->base_constant('MIN_LENGTH')));

return false;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/modules/customer_data/cd_country.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function display_input($customer_details = null) {
$input = $this->draw_country_list('country_id', $country_id, $attribute)
. $postInput;

include $GLOBALS['oscTemplate']->map_to_template($this->get_constant('TEMPLATE'));
include $GLOBALS['oscTemplate']->map_to_template($this->base_constant('TEMPLATE'));
}

public function process(&$customer_details) {
Expand Down
6 changes: 3 additions & 3 deletions includes/modules/customer_data/cd_dob.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function display_input($customer_details = null) {
$input = tep_draw_input_field('dob', $dob, $attribute)
. $postInput;

include $GLOBALS['oscTemplate']->map_to_template($this->get_constant('TEMPLATE'));
include $GLOBALS['oscTemplate']->map_to_template($this->base_constant('TEMPLATE'));
}

public function is_valid($date) {
Expand All @@ -100,7 +100,7 @@ public function is_valid($date) {
}

$raw = tep_cd_dob_date_raw($date);
return ((strlen($date) >= $this->get_constant('MIN_LENGTH'))
return ((strlen($date) >= $this->base_constant('MIN_LENGTH'))
&& is_numeric($raw)
&& @checkdate(substr($raw, 4, 2), substr($raw, 6, 2), substr($raw, 0, 4)));
}
Expand All @@ -111,7 +111,7 @@ public function process(&$customer_details) {
if (!$this->is_valid($dob)) {
$GLOBALS['messageStack']->add_classed(
$GLOBALS['message_stack_area'] ?? 'customer_data',
sprintf(ENTRY_DOB_ERROR, $this->get_constant('MIN_LENGTH')) . tep_cd_dob_date_raw($customer_details['dob']));
sprintf(ENTRY_DOB_ERROR, $this->base_constant('MIN_LENGTH')) . tep_cd_dob_date_raw($customer_details['dob']));

return false;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/modules/customer_data/cd_email_address.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function display_input($customer_details = null) {
$input = tep_draw_input_field('email_address', $email_address, $attribute, 'email')
. $postInput;

include $GLOBALS['oscTemplate']->map_to_template($this->get_constant('TEMPLATE'));
include $GLOBALS['oscTemplate']->map_to_template($this->base_constant('TEMPLATE'));
}

public function process(&$customer_details) {
Expand Down
6 changes: 3 additions & 3 deletions includes/modules/customer_data/cd_fax.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,21 @@ public function display_input($customer_details = null) {
$input = tep_draw_input_field('fax', $fax, $attribute)
. $postInput;

include $GLOBALS['oscTemplate']->map_to_template($this->get_constant('TEMPLATE'));
include $GLOBALS['oscTemplate']->map_to_template($this->base_constant('TEMPLATE'));
}

public function process(&$customer_details) {
$customer_details['fax'] = tep_db_prepare_input($_POST['fax']);

if (strlen($customer_details['fax']) < $this->get_constant('MIN_LENGTH')
if (strlen($customer_details['fax']) < $this->base_constant('MIN_LENGTH')
&& ($this->is_required()
|| !empty($customer_details['fax'])
)
)
{
$GLOBALS['messageStack']->add_classed(
$GLOBALS['message_stack_area'] ?? 'customer_data',
sprintf(ENTRY_FAX_ERROR, $this->get_constant('MIN_LENGTH')));
sprintf(ENTRY_FAX_ERROR, $this->base_constant('MIN_LENGTH')));

return false;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/modules/customer_data/cd_firstname.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function display_input($customer_details = null) {
$input = tep_draw_input_field('firstname', $firstname, $attribute)
. $postInput;

include DIR_FS_CATALOG . $GLOBALS['oscTemplate']->map_to_template($this->get_constant('TEMPLATE'));
include DIR_FS_CATALOG . $GLOBALS['oscTemplate']->map_to_template($this->base_constant('TEMPLATE'));
}

public function process(&$customer_details) {
Expand Down
2 changes: 1 addition & 1 deletion includes/modules/customer_data/cd_lastname.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function display_input($customer_details = null) {
$input = tep_draw_input_field('lastname', $lastname, $attribute)
. $postInput;

include $GLOBALS['oscTemplate']->map_to_template($this->get_constant('TEMPLATE'));
include $GLOBALS['oscTemplate']->map_to_template($this->base_constant('TEMPLATE'));
}

public function process(&$customer_details) {
Expand Down
6 changes: 3 additions & 3 deletions includes/modules/customer_data/cd_password.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,21 @@ public function display_input($customer_details = null, $entry_base = 'ENTRY_PAS
$input = tep_draw_input_field('password', null, $attribute, 'password')
. $postInput;

include $GLOBALS['oscTemplate']->map_to_template($this->get_constant('TEMPLATE'));
include $GLOBALS['oscTemplate']->map_to_template($this->base_constant('TEMPLATE'));
}

public function process(&$customer_details, $entry_base = 'ENTRY_PASSWORD') {
$customer_details['password'] = tep_db_prepare_input($_POST['password']);

if (strlen($customer_details['password']) < $this->get_constant('MIN_LENGTH')
if (strlen($customer_details['password']) < $this->base_constant('MIN_LENGTH')
&& ($this->is_required()
|| !empty($customer_details['password'])
)
)
{
$GLOBALS['messageStack']->add_classed(
$GLOBALS['message_stack_area'] ?? 'customer_data',
sprintf(constant($entry_base . '_ERROR'), $this->get_constant('MIN_LENGTH')));
sprintf(constant($entry_base . '_ERROR'), $this->base_constant('MIN_LENGTH')));

return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function display_input($customer_details = null) {
$input = tep_draw_input_field('password_confirmation', null, $attribute, 'password')
. $post_input;

include $GLOBALS['oscTemplate']->map_to_template($this->get_constant('TEMPLATE'));
include $GLOBALS['oscTemplate']->map_to_template($this->base_constant('TEMPLATE'));
}

public function process(&$customer_details, $entry_base = 'ENTRY_PASSWORD') {
Expand Down
6 changes: 3 additions & 3 deletions includes/modules/customer_data/cd_postcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,16 @@ public function display_input($customer_details = null) {
$input = tep_draw_input_field('postcode', $postcode, $attribute)
. $postInput;

include $GLOBALS['oscTemplate']->map_to_template($this->get_constant('TEMPLATE'));
include $GLOBALS['oscTemplate']->map_to_template($this->base_constant('TEMPLATE'));
}

public function process(&$customer_details) {
$customer_details['postcode'] = tep_db_prepare_input($_POST['postcode']);

if ($this->is_required() && (strlen($customer_details['postcode']) < $this->get_constant('MIN_LENGTH'))) {
if ($this->is_required() && (strlen($customer_details['postcode']) < $this->base_constant('MIN_LENGTH'))) {
$GLOBALS['messageStack']->add_classed(
$GLOBALS['message_stack_area'] ?? 'customer_data',
sprintf(ENTRY_POST_CODE_ERROR, $this->get_constant('MIN_LENGTH')));
sprintf(ENTRY_POST_CODE_ERROR, $this->base_constant('MIN_LENGTH')));

return false;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/modules/customer_data/cd_state.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function display_input(&$customer_details = null) {
}
$input .= $postInput;

include $GLOBALS['oscTemplate']->map_to_template($this->get_constant('TEMPLATE'));
include $GLOBALS['oscTemplate']->map_to_template($this->base_constant('TEMPLATE'));
}

public function fetch_zone_count($country_id) {
Expand Down
6 changes: 3 additions & 3 deletions includes/modules/customer_data/cd_street_address.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,19 @@ public function display_input($customer_details = null) {
$input = tep_draw_input_field('street_address', $street_address, $attribute)
. $postInput;

include $GLOBALS['oscTemplate']->map_to_template($this->get_constant('TEMPLATE'));
include $GLOBALS['oscTemplate']->map_to_template($this->base_constant('TEMPLATE'));
}

public function process(&$customer_details) {
$customer_details['street_address'] = tep_db_prepare_input($_POST['street_address']);

if ((strlen($customer_details['street_address']) < $this->get_constant('MIN_LENGTH'))
if ((strlen($customer_details['street_address']) < $this->base_constant('MIN_LENGTH'))
&& $this->is_required()
)
{
$GLOBALS['messageStack']->add_classed(
$GLOBALS['message_stack_area'] ?? 'customer_data',
sprintf(ENTRY_STREET_ADDRESS_ERROR, $this->get_constant('MIN_LENGTH')));
sprintf(ENTRY_STREET_ADDRESS_ERROR, $this->base_constant('MIN_LENGTH')));

return false;
}
Expand Down
8 changes: 4 additions & 4 deletions includes/modules/customer_data/cd_suburb.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function display_input($customer_details = null) {

$input_id = 'inputSuburb';
$attribute = 'id="' . $input_id
. '" autocomplete="' . $this->get_constant('AUTOCOMPLETE')
. '" autocomplete="' . $this->base_constant('AUTOCOMPLETE')
. '" placeholder="' . ENTRY_SUBURB_TEXT . '"';

$postInput = '';
Expand All @@ -102,21 +102,21 @@ public function display_input($customer_details = null) {
$input = tep_draw_input_field('suburb', $suburb, $attribute)
. $postInput;

include $GLOBALS['oscTemplate']->map_to_template($this->get_constant('TEMPLATE'));
include $GLOBALS['oscTemplate']->map_to_template($this->base_constant('TEMPLATE'));
}

public function process(&$customer_details) {
$customer_details['suburb'] = tep_db_prepare_input($_POST['suburb']);

if (strlen($customer_details['suburb']) < $this->get_constant('MIN_LENGTH')
if (strlen($customer_details['suburb']) < $this->base_constant('MIN_LENGTH')
&& ($this->is_required()
|| !empty($customer_details['suburb'])
)
)
{
$GLOBALS['messageStack']->add_classed(
$GLOBALS['message_stack_area'] ?? 'customer_data',
sprintf(ENTRY_SUBURB_ERROR, $this->get_constant('MIN_LENGTH')));
sprintf(ENTRY_SUBURB_ERROR, $this->base_constant('MIN_LENGTH')));

return false;
}
Expand Down
6 changes: 3 additions & 3 deletions includes/modules/customer_data/cd_telephone.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,21 @@ public function display_input($customer_details = null) {
$input = tep_draw_input_field('telephone', $telephone, $attribute)
. $postInput;

include $GLOBALS['oscTemplate']->map_to_template($this->get_constant('TEMPLATE'));
include $GLOBALS['oscTemplate']->map_to_template($this->base_constant('TEMPLATE'));
}

public function process(&$customer_details) {
$customer_details['telephone'] = tep_db_prepare_input($_POST['telephone']);

if (strlen($customer_details['telephone']) < $this->get_constant('MIN_LENGTH')
if (strlen($customer_details['telephone']) < $this->base_constant('MIN_LENGTH')
&& ($this->is_required()
|| !empty($customer_details['telephone'])
)
)
{
$GLOBALS['messageStack']->add_classed(
$GLOBALS['message_stack_area'] ?? 'customer_data',
sprintf(ENTRY_TELEPHONE_ERROR, $this->get_constant('MIN_LENGTH')));
sprintf(ENTRY_TELEPHONE_ERROR, $this->base_constant('MIN_LENGTH')));

return false;
}
Expand Down

0 comments on commit abc49f9

Please sign in to comment.