Skip to content

Commit

Permalink
Corrections to fit updated Prestashop coding standards...
Browse files Browse the repository at this point in the history
  • Loading branch information
tbelliard committed Apr 21, 2017
1 parent b68fd93 commit db85700
Show file tree
Hide file tree
Showing 24 changed files with 30 additions and 57 deletions.
3 changes: 1 addition & 2 deletions ajax/get_relay_delivery_locations.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2017 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

header('Content-type: text/plain');
Expand Down
3 changes: 1 addition & 2 deletions ajax/save_relay_delivery_location.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2017 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

header('Content-type: text/plain');
Expand Down
6 changes: 3 additions & 3 deletions controllers/admin/adminparcel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

if (!defined('_PS_VERSION_')) {
Expand Down Expand Up @@ -146,7 +145,8 @@ public function renderForm()
'name' => 'value_to_insure',
'size' => 5,
'class' => 'fixed-width-sm',
'desc' => $this->l('You can leave blank if you do not intend to purchase insurance. Maximum 2000€ total per shipment.'), ),
'desc' => $this->l('You can leave blank if you do not intend to purchase insurance. Maximum 2000€ total per shipment.'),
),
array('type' => 'select',
'label' => $this->l('Currency:'),
'desc' => $this->l('Currency code for the value to insure.'),
Expand Down
4 changes: 1 addition & 3 deletions controllers/admin/adminshipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

if (!defined('_PS_VERSION_')) {
Expand Down Expand Up @@ -89,7 +88,6 @@ public function renderView()
$lce_service = false;

if ($shipment->api_offer_uuid) {

$api_offer = Lce\Resource\Offer::find($shipment->api_offer_uuid);

// We need to keep some sort of backward compatibility for past shipments
Expand Down
9 changes: 1 addition & 8 deletions lowcostexpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

if (!defined('_PS_VERSION_')) {
Expand Down Expand Up @@ -290,7 +289,6 @@ public function hookUpdateCarrier($params)
$lce_service = LceService::findByCarrierId($params['id_carrier']);
$lce_service->id_carrier = $params['carrier']->id;
$lce_service->save();

}

//===============
Expand Down Expand Up @@ -430,7 +428,6 @@ public function _refreshLceProducts($shipper_country = null)
$products = Lce\Resource\Product::findAll();

foreach ($products as $product) {

$lce_service = LceService::findByCode($product->code);

if (!$lce_service) {
Expand Down Expand Up @@ -563,14 +560,11 @@ public function _refreshLceProducts($shipper_country = null)
);
}
}


}
} catch (Exception $e) {
error_log($e->getMessage());
$message = $this->displayError($this->purify($e->getMessage()));
}

return $message;
}

Expand Down Expand Up @@ -722,7 +716,6 @@ public function getOrderShippingCost($cart, $shipping_cost)
$currency = new Currency($cart->id_currency);
// Getting total order value
$params['parcels'][0]['insured_currency'] = $currency->iso_code;

}

$api_quote = Lce\Resource\Quote::request($params);
Expand Down
3 changes: 1 addition & 2 deletions models/LceDimension.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

class LceDimension extends ObjectModel
Expand Down
3 changes: 1 addition & 2 deletions models/LceOffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

class LceOffer extends ObjectModel
Expand Down
3 changes: 1 addition & 2 deletions models/LceParcel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

class LceParcel extends ObjectModel
Expand Down
4 changes: 1 addition & 3 deletions models/LceQuote.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

class LceQuote extends ObjectModel
Expand Down Expand Up @@ -108,7 +107,6 @@ public static function getNewForCart($cart)
$currency = new Currency($cart->id_currency);
// Getting total order value
$params['parcels'][0]['insured_currency'] = $currency->iso_code;

}

$api_quote = Lce\Resource\Quote::request($params);
Expand Down
3 changes: 1 addition & 2 deletions models/LceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

class LceService extends ObjectModel
Expand Down
6 changes: 1 addition & 5 deletions models/LceShipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

class LceShipment extends ObjectModel
Expand Down Expand Up @@ -332,16 +331,13 @@ public function autoselectOffer($order)
$lce_service = LceService::findByCarrierId($order->id_carrier);

if ($lce_service) {

// $quote = new LceQuote();
// $quote->id_shipment = $shipment->id;
// $quote->add();

// Now we parse the offers and select
foreach ($api_quote->offers as $api_offer) {

if ($api_offer->product->code == $lce_service->code) {

// $offer = new LceOffer();
// $offer->id_quote = $quote->id;
// $offer->lce_service_id = $lce_service->id_service;
Expand Down
3 changes: 1 addition & 2 deletions sql-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

$sql = array();
Expand Down
3 changes: 1 addition & 2 deletions upgrade/install-0.0.24.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2017 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

if (!defined('_PS_VERSION_')) {
Expand Down
3 changes: 1 addition & 2 deletions upgrade/install-1.0.0.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2017 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

if (!defined('_PS_VERSION_')) {
Expand Down
3 changes: 1 addition & 2 deletions upgrade/install-1.0.1.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2017 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

if (!defined('_PS_VERSION_')) {
Expand Down
3 changes: 1 addition & 2 deletions upgrade/install-1.0.2.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2017 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

if (!defined('_PS_VERSION_')) {
Expand Down
3 changes: 1 addition & 2 deletions views/js/delivery_locations.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2017 MyFlyingBox
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
*
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

var lce_locations = null;
Expand Down
6 changes: 3 additions & 3 deletions views/templates/admin/order/shipment_details.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}

<div class='panel'>
Expand All @@ -28,7 +28,7 @@
<p>
<a href="{$var.new_shipment_path|escape:'htmlall':'UTF-8'}"><img src="../img/admin/add.gif" alt="{l s='Add shipment' mod='lowcostexpress'}" /> {l s='Add shipment' mod='lowcostexpress'}</a>
</p>

<table class="table" width="100%">
<thead>
<tr>
Expand Down Expand Up @@ -61,6 +61,6 @@
</tr>
{/foreach}
</table>

</fieldset>
</div>
4 changes: 2 additions & 2 deletions views/templates/admin/settings.bootstrap.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}
<div class="myflyingbox-settings">
<div class='row myflyingbox-settings-header'>
Expand Down Expand Up @@ -279,7 +279,7 @@
<label for="MOD_LCE_UPDATE_ORDER_STATUS" class="control-label col-lg-3">{l s='Automatically update order status:' mod='lowcostexpress'}</label>
<div class="col-lg-8">
<input id="MOD_LCE_UPDATE_ORDER_STATUS" name="MOD_LCE_UPDATE_ORDER_STATUS" type="checkbox" value="1"{if $MOD_LCE_UPDATE_ORDER_STATUS eq true} CHECKED{/if} />
<p class="help-block">{l s="If checked, the status of the order will be automatically set to 'shipped' when you confirm your MyFlyingBox shipment to generate the label." mod='lowcostexpress'}</p>
<p class="help-block">{l s='If checked, the status of the order will be automatically set to \'shipped\' when you confirm your MyFlyingBox shipment to generate the label.' mod='lowcostexpress'}</p>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions views/templates/admin/settings.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}

<div class="myflyingbox-settings">
Expand Down Expand Up @@ -215,7 +215,7 @@
<label for="MOD_LCE_UPDATE_ORDER_STATUS">{l s='Automatically update order status:' mod='lowcostexpress'}</label>
<div class="margin-form">
<input id="MOD_LCE_UPDATE_ORDER_STATUS" name="MOD_LCE_UPDATE_ORDER_STATUS" type="checkbox" value="1"{if $MOD_LCE_UPDATE_ORDER_STATUS eq true} CHECKED{/if} />
<p class="preference_description">{l s="If checked, the status of the order will be automatically set to 'shipped' when you confirm your MyFlyingBox shipment to generate the label." mod='lowcostexpress'}</p>
<p class="preference_description">{l s='If checked, the status of the order will be automatically set to \'shipped\' when you confirm your MyFlyingBox shipment to generate the label.' mod='lowcostexpress'}</p>
</div>

<p>
Expand Down
2 changes: 1 addition & 1 deletion views/templates/admin/shipment/helpers/form/form.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}

{extends file="helpers/form/form.tpl"}
Expand Down
2 changes: 1 addition & 1 deletion views/templates/admin/shipment/helpers/view/lce_offers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}

<form id="select-offer">
Expand Down
2 changes: 1 addition & 1 deletion views/templates/admin/shipment/helpers/view/view.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}

{block name="override_tpl"}
Expand Down
2 changes: 1 addition & 1 deletion views/templates/front/order/tracking_details.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*
* @author MyFlyingBox <[email protected]>
* @copyright 2016 MyFlyingBox
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @version 1.0
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}
{if !empty($shipments)}
<!-- Tracking -->
Expand Down

0 comments on commit db85700

Please sign in to comment.