@@ -12,7 +12,7 @@ |
||
12 | 12 | if ($allowedCountries->count()) { |
13 | 13 | $allowedCountryCodes = $allowedCountries->column('Code'); |
14 | 14 | foreach ($newSource as $key => $value) { |
15 | - if (! in_array($key, $allowedCountryCodes)) { |
|
15 | + if (!in_array($key, $allowedCountryCodes)) { |
|
16 | 16 | unset($newSource[$key]); |
17 | 17 | } |
18 | 18 | } |
@@ -60,7 +60,7 @@ |
||
60 | 60 | DropdownField::create( |
61 | 61 | 'EcommerceCountryID', |
62 | 62 | 'Country', |
63 | - array('' => '-- make sure to select a country --')+$countries |
|
63 | + array('' => '-- make sure to select a country --') + $countries |
|
64 | 64 | ), |
65 | 65 | 'Title' |
66 | 66 | ); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | //secondary for another country |
112 | 112 | $fields->removeByName('Versions'); |
113 | 113 | if ($listOfCountriesCovered && $listOfCountriesCovered->count()) { |
114 | - $countryArray = array(" -- please select --") + $listOfCountriesCovered->toArray(); |
|
114 | + $countryArray = array(" -- please select --") + $listOfCountriesCovered->toArray(); |
|
115 | 115 | $fields->addFieldToTab("Root.CountryDetails", DropdownField::create("PrimaryCountryID", "Primary Country", $countryArray)); |
116 | 116 | } else { |
117 | 117 | $fields->removeByName('PrimaryCountryID'); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | 'IsDefault' => 'Default', |
144 | 144 | 'Email' => 'Email' |
145 | 145 | ); |
146 | - $table = '<table class="versions"><thead><tr><th>' . implode('</th><th>', $columns) . '</th></tr></thead><tbody>'; |
|
146 | + $table = '<table class="versions"><thead><tr><th>'.implode('</th><th>', $columns).'</th></tr></thead><tbody>'; |
|
147 | 147 | $version = $this->Version - 1; |
148 | 148 | while ($version > 0) { |
149 | 149 | $versionDO = Versioned::get_version('Distributor', $this->ID, $version--); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | foreach ($columns as $column => $title) { |
152 | 152 | $values[] = $versionDO->$column; |
153 | 153 | } |
154 | - $table .= '<tr><td>' . implode('</td><td>', $values) . '</td></tr>'; |
|
154 | + $table .= '<tr><td>'.implode('</td><td>', $values).'</td></tr>'; |
|
155 | 155 | } |
156 | 156 | $table .= '</tbody></table>'; |
157 | 157 | $table .= "<style type=\"text/css\"> |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | } |
235 | 235 | if ($this->PrimaryCountryID > 0 && EcommerceCountry::get()->byID(intval($this->PrimaryCountryID))) { |
236 | 236 | $primaryCountry = $this->PrimaryCountry(); |
237 | - if (! $this->Countries()->byID($this->PrimaryCountryID)) { |
|
237 | + if (!$this->Countries()->byID($this->PrimaryCountryID)) { |
|
238 | 238 | $this->Countries()->add($primaryCountry); |
239 | 239 | } |
240 | 240 | } else { |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | public function onAfterWrite() |
254 | 254 | { |
255 | 255 | parent::onAfterWrite(); |
256 | - if (! self::$_ran_after_write) { |
|
256 | + if (!self::$_ran_after_write) { |
|
257 | 257 | self::$_ran_after_write = true; |
258 | 258 | $this->setupUser(); |
259 | 259 | } |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | $member = Member::create($filter); |
372 | 372 | //$thisMember->SetPassword = substr(session_id, 0, 8); |
373 | 373 | } |
374 | - $member->FirstName = trim(_t('Distributor.SINGULAR_NAME', 'Distributor') . _t('Distributor.FOR', ' for ')); |
|
374 | + $member->FirstName = trim(_t('Distributor.SINGULAR_NAME', 'Distributor')._t('Distributor.FOR', ' for ')); |
|
375 | 375 | $member->Surname = $this->Name; |
376 | 376 | $member->DistributorID = $this->ID; |
377 | 377 | $member->write(); |
@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | $currencyCode = isset($currencyPerCountry[$countryCode]) ? $currencyPerCountry[$countryCode] : EcommerceCountry::default_currency(); |
45 | 45 | $currencyDO = EcommerceCurrency::get_one_from_code($currencyCode); |
46 | 46 | } |
47 | - if (! $currencyDO) { |
|
47 | + if (!$currencyDO) { |
|
48 | 48 | $currencyDO = EcommerceCurrency::create_new($currencyCode); |
49 | 49 | } |
50 | - if (! $currencyDO) { |
|
50 | + if (!$currencyDO) { |
|
51 | 51 | $currencyDO = EcommerceCurrency::get_default(); |
52 | 52 | } |
53 | 53 | return $currencyDO; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | { |
68 | 68 | $cachekey = "EcommerceCurrencyCountryMatrix"; |
69 | 69 | $cache = SS_Cache::factory($cachekey); |
70 | - if (! ($serializedArray = $cache->load($cachekey))) { |
|
70 | + if (!($serializedArray = $cache->load($cachekey))) { |
|
71 | 71 | $countries = CountryPrice_EcommerceCountry::get_real_countries_list(); |
72 | 72 | $unserializedArray = array(); |
73 | 73 | $defaultCurrencyCode = EcommerceCurrency::default_currency_code(); |
@@ -25,11 +25,11 @@ |
||
25 | 25 | } else { |
26 | 26 | $fromCountriesArray = array(); |
27 | 27 | } |
28 | - $allCountries = EcommerceCountry::get(); |
|
28 | + $allCountries = EcommerceCountry::get(); |
|
29 | 29 | $toCountries = array(); |
30 | 30 | foreach ($allCountries as $country) { |
31 | 31 | $country = CountryPrice_EcommerceCountry::get_real_country($country); |
32 | - $toCountries[$country->Code] = $country->Name . ($country->DoNotAllowSales ? ' (Sales not allowed)' : ''); |
|
32 | + $toCountries[$country->Code] = $country->Name.($country->DoNotAllowSales ? ' (Sales not allowed)' : ''); |
|
33 | 33 | } |
34 | 34 | $countryCurrencies = CountryPrice_EcommerceCurrency::get_currency_per_country(); |
35 | 35 | $link = CountryPrice_CopyPrices_Controller::get_link($this->owner); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | if ($this->debug) { |
221 | 221 | debug::log('TESTING '.$key.''); |
222 | 222 | } |
223 | - if (! isset(self::$_buyable_price[$key])) { |
|
223 | + if (!isset(self::$_buyable_price[$key])) { |
|
224 | 224 | //basics |
225 | 225 | $currency = null; |
226 | 226 | $currencyCode = null; |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | } |
308 | 308 | } |
309 | 309 | //order must have a country and a currency |
310 | - if (! $currencyCode || ! $countryCode) { |
|
310 | + if (!$currencyCode || !$countryCode) { |
|
311 | 311 | if ($this->debug) { |
312 | 312 | debug::log('No currency ('.$currencyCode.') or no country code ('.$countryCode.') for order: '); |
313 | 313 | } |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | */ |
405 | 405 | public function canEdit($member = null) |
406 | 406 | { |
407 | - if (! $member) { |
|
407 | + if (!$member) { |
|
408 | 408 | $member = Member::currentUser(); |
409 | 409 | } |
410 | 410 | if ($member) { |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function getFullPrice() |
127 | 127 | { |
128 | - return "$this->Price $this->Currency" . ($this->isObsolete() ? ' (obsolete!)' : ''); |
|
128 | + return "$this->Price $this->Currency".($this->isObsolete() ? ' (obsolete!)' : ''); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | public function getCMSFields() |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | public function canEdit($member = null) |
198 | 198 | { |
199 | 199 | $canEdit = parent::canEdit(); |
200 | - if (! $canEdit) { |
|
200 | + if (!$canEdit) { |
|
201 | 201 | $member = Member::currentUser(); |
202 | 202 | $distributor = $member->Distributor(); |
203 | 203 | if ($distributor->exists()) { |
@@ -215,16 +215,16 @@ discard block |
||
215 | 215 | protected function validate() |
216 | 216 | { |
217 | 217 | $result = parent::validate(); |
218 | - if (! $this->ObjectClass && isset($_REQUEST["MyObjectClass"])) { |
|
218 | + if (!$this->ObjectClass && isset($_REQUEST["MyObjectClass"])) { |
|
219 | 219 | if (class_exists($_REQUEST["MyObjectClass"])) { |
220 | 220 | $this->ObjectClass = Convert::raw2sql($_REQUEST["MyObjectClass"]); |
221 | 221 | } |
222 | 222 | } |
223 | - if (! $this->ObjectID && isset($_REQUEST["MyObjectID"])) { |
|
223 | + if (!$this->ObjectID && isset($_REQUEST["MyObjectID"])) { |
|
224 | 224 | $this->ObjectID = intval($_REQUEST["MyObjectID"]); |
225 | 225 | } |
226 | 226 | //check for duplicates in case it has not been created yet... |
227 | - if (! $this->ObjectClass || ! $this->ObjectID) { |
|
227 | + if (!$this->ObjectClass || !$this->ObjectID) { |
|
228 | 228 | $result->error('Object could not be created. Please contact your developer.'); |
229 | 229 | return $result; |
230 | 230 | } |
@@ -8,7 +8,7 @@ |
||
8 | 8 | } |
9 | 9 | public function canView($member = null) |
10 | 10 | { |
11 | - if (! $this->owner->ID) { |
|
11 | + if (!$this->owner->ID) { |
|
12 | 12 | return true; |
13 | 13 | } elseif ($member && $member->DistributorID) { |
14 | 14 | if ($order = $this->owner->Order()) { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | if ($order->IsSubmitted()) { |
62 | 62 | return true; |
63 | 63 | } |
64 | - if (! $countryCode) { |
|
64 | + if (!$countryCode) { |
|
65 | 65 | $countryCode = $order->getCountry(); |
66 | 66 | } |
67 | 67 | $currencyObject = CountryPrice_EcommerceCurrency::get_currency_for_country($countryCode); |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | //check if the billing and shipping address have a country so that they will not be overridden by previous Orders |
76 | 76 | //we do this to make sure that the previous address can not change the region and thereby destroy the order in the cart |
77 | 77 | if ($billingAddress = $order->CreateOrReturnExistingAddress('BillingAddress')) { |
78 | - if (! $billingAddress->Country || $force) { |
|
78 | + if (!$billingAddress->Country || $force) { |
|
79 | 79 | $billingAddress->Country = $countryCode; |
80 | 80 | $billingAddress->write(); |
81 | 81 | } |
82 | 82 | } |
83 | 83 | if ($shippingAddress = $order->CreateOrReturnExistingAddress('ShippingAddress')) { |
84 | - if (! $shippingAddress->ShippingCountry || $force) { |
|
84 | + if (!$shippingAddress->ShippingCountry || $force) { |
|
85 | 85 | $shippingAddress->ShippingCountry = $countryCode; |
86 | 86 | $shippingAddress->write(); |
87 | 87 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | //if a country code and currency has been set then all is good |
91 | 91 | //from there we keep it this way |
92 | 92 | if ( |
93 | - $order->OriginatingCountryCode == $countryCode && |
|
93 | + $order->OriginatingCountryCode == $countryCode && |
|
94 | 94 | $order->CurrencyUsedID == $currencyObject->ID |
95 | 95 | ) { |
96 | 96 | return true; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | if ($items) { |
112 | 112 | foreach ($items as $item) { |
113 | 113 | $buyable = $item->Buyable(true); |
114 | - if (! $buyable->canPurchase()) { |
|
114 | + if (!$buyable->canPurchase()) { |
|
115 | 115 | $item->delete(); |
116 | 116 | } |
117 | 117 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | public function canEdit($member = null) |
164 | 164 | { |
165 | - if (! $member) { |
|
165 | + if (!$member) { |
|
166 | 166 | $member = Member::currentUser(); |
167 | 167 | } |
168 | 168 | if ($member) { |