Version Notes
fifth official commit
Download this release
Release Info
Developer | Magento Core Team |
Extension | Fianet_Sceau |
Version | 1.0.4 |
Comparing to | |
See all releases |
Code changes from version 1.0.3 to 1.0.4
- app/code/community/Fianet/Sceau/Block/Catalog/ProductsReviews.php +13 -0
- app/code/community/Fianet/Sceau/Helper/Data.php +77 -23
- app/code/community/Fianet/Sceau/Model/Categories/Association.php +7 -0
- app/code/community/Fianet/Sceau/Model/Mysql4/Categories/Association.php +6 -0
- app/code/community/Fianet/Sceau/Model/Mysql4/Categories/Association/Collection.php +7 -0
- app/code/community/Fianet/Sceau/Model/Mysql4/Shipping/Association.php +6 -0
- app/code/community/Fianet/Sceau/Model/Mysql4/Shipping/Association/Collection.php +7 -0
- app/code/community/Fianet/Sceau/Model/Observer.php +12 -26
- app/code/community/Fianet/Sceau/Model/Order.php +1 -12
- app/code/community/Fianet/Sceau/Model/Shipping/Association.php +7 -0
- app/code/community/Fianet/Sceau/Model/Source/ProductType.php +332 -0
- app/code/community/Fianet/Sceau/Model/Source/ShippingType.php +12 -0
- app/code/community/Fianet/Sceau/controllers/Adminhtml/CategoriesController.php +34 -0
- app/code/community/Fianet/Sceau/controllers/Adminhtml/ProductsController.php +38 -0
- app/code/community/Fianet/Sceau/controllers/Adminhtml/ShippingController.php +34 -0
- app/code/community/Fianet/Sceau/controllers/IndexController.php +23 -38
- app/code/community/Fianet/Sceau/etc/adminhtml.xml +76 -0
- app/code/community/Fianet/Sceau/etc/config.xml +20 -32
- app/code/community/Fianet/Sceau/etc/system.xml +153 -156
- app/code/community/Fianet/Sceau/sql/fianet_sceau_setup/mysql4-install-1.0.0.php +6 -9
- app/code/community/Fianet/Sceau/sql/fianet_sceau_setup/mysql4-upgrade-1.0.3-1.0.4.php +1 -0
- app/design/adminhtml/default/default/layout/fianet_sceau.xml +13 -0
- app/design/adminhtml/default/default/template/fianet_sceau/categories.phtml +124 -0
- app/design/adminhtml/default/default/template/fianet_sceau/products.phtml +22 -0
- app/design/adminhtml/default/default/template/fianet_sceau/shipping.phtml +64 -0
- app/design/frontend/base/default/layout/fianet_sceau.xml +7 -2
- app/design/frontend/base/default/template/fianet_sceau/page/html/productsReviews.phtml +9 -0
- app/etc/modules/zFianet_Sceau.xml +2 -0
- app/locale/fr_FR/Fianet_Sceau.csv +30 -24
- package.xml +7 -7
app/code/community/Fianet/Sceau/Block/Catalog/ProductsReviews.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Fianet_Sceau_Block_Catalog_ProductsReviews extends Mage_Core_Block_Template {
|
4 |
+
|
5 |
+
public function isModuleActive() {
|
6 |
+
if (Mage::getStoreConfig('sceau/sceauconfg/active') == '1')
|
7 |
+
{
|
8 |
+
return true;
|
9 |
+
}
|
10 |
+
return false;
|
11 |
+
}
|
12 |
+
|
13 |
+
}
|
app/code/community/Fianet/Sceau/Helper/Data.php
CHANGED
@@ -7,19 +7,87 @@ class Fianet_Sceau_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
7 |
|
8 |
static function Generate_Sceau_xml(Mage_Sales_Model_Order $order) {
|
9 |
//récupération des informations
|
10 |
-
|
|
|
11 |
$timestamp = Mage::getModel('core/date')->date(null,strtotime($order->created_at));
|
12 |
-
$refid = $order->increment_id;
|
13 |
$privatekey = Mage::getStoreConfig('sceau/sceauconfg/private_key', $order->getStoreId());
|
14 |
$crypt = md5($privatekey . "_" . $refid . "+" . $timestamp . "=" . $email);
|
15 |
-
$siteid = self::getSiteID($order);
|
16 |
|
17 |
//Si l'IP de l'internaute n'est pas présente dans Magento (en cas de création de commande depuis le BO) alors on récupère l'IP de la boutique
|
18 |
$ip = (!$order->getRemoteIp()) ? $_SERVER['REMOTE_ADDR'] : $order->getRemoteIp();
|
19 |
-
|
|
|
|
|
|
|
20 |
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
static public function clean_xml($xml) {
|
25 |
$xml = str_replace("\\'", "'", $xml);
|
@@ -52,9 +120,6 @@ class Fianet_Sceau_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
52 |
$attribut_sceau = self::ORDER_ATTR_SCEAU_SENT_PROD;
|
53 |
}
|
54 |
$order->setData($attribut_sceau, '1');
|
55 |
-
|
56 |
-
//Mage::getSingleton('adminhtml/session')->addError('processOrderToFianet() : ' . $attribut_sceau . ' = ' . $order->getData($attribut_sceau));
|
57 |
-
|
58 |
return true;
|
59 |
}
|
60 |
return false;
|
@@ -69,10 +134,7 @@ class Fianet_Sceau_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
69 |
}
|
70 |
|
71 |
static function sendOrderToFianet(Mage_Sales_Model_Order $order) {
|
72 |
-
|
73 |
-
|
74 |
$flux = self::Generate_Sceau_xml($order);
|
75 |
-
//Zend_Debug::dump($flux, 'flux');
|
76 |
|
77 |
$url = self::getFianetUrl($order);
|
78 |
$config = array('maxredirects' => 0,
|
@@ -83,25 +145,18 @@ class Fianet_Sceau_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
83 |
'XMLInfo' => $flux);
|
84 |
|
85 |
Mage::dispatchEvent('Fianet_Sceau_Before_Send_Order', array('order' => $order, 'url' => $url, 'flux' => $flux));
|
86 |
-
//Zend_Debug::dump($config, 'config');
|
87 |
-
//Zend_Debug::dump($params, 'params');
|
88 |
|
89 |
try {
|
90 |
-
//Zend_Debug::dump($url, 'flux');
|
91 |
$client = new Zend_Http_Client($url, $config);
|
92 |
$client->setMethod(Zend_Http_Client::POST);
|
93 |
$client->setParameterPost($params);
|
94 |
-
//Zend_Debug::dump($client, 'client');
|
95 |
$response = $client->request();
|
96 |
|
97 |
-
//Mage::getSingleton('adminhtml/session')->addError('sendOrderToFianet() : '.htmlentities($flux));
|
98 |
-
//Mage::getSingleton('adminhtml/session')->addError('sendOrderToFianet() : '.$response->getBody());
|
99 |
-
|
100 |
Mage::dispatchEvent('Fianet_Sceau_After_Send_Order', array('order' => $order, 'response' => $response));
|
101 |
-
//Zend_Debug::dump($response);
|
102 |
|
103 |
return self::parseFianetResponse($response, $order);
|
104 |
} catch (Exception $e) {
|
|
|
105 |
Mage::getSingleton('adminhtml/session')->addError('FIA-NET Sceau sending error : ' . $e->getMessage());
|
106 |
}
|
107 |
}
|
@@ -113,7 +168,6 @@ class Fianet_Sceau_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
113 |
|
114 |
$simplexml = new Varien_Simplexml_Config($xml);
|
115 |
if ($simplexml->getNode()->getAttribute('type') == 'OK') {
|
116 |
-
//Zend_Debug::dump('OK');
|
117 |
$order->setData($attribut_sceau_error, '0');
|
118 |
return true;
|
119 |
}
|
@@ -122,9 +176,10 @@ class Fianet_Sceau_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
122 |
{
|
123 |
$order->setData($attribut_sceau_error, '1');
|
124 |
$ret = "erreur de flux";
|
125 |
-
|
126 |
else
|
127 |
$ret = $simplexml->getNode()->detail;
|
|
|
128 |
Mage::getSingleton('adminhtml/session')->addError('FIA-NET Sceau sending error : ' . $ret);
|
129 |
|
130 |
return false;
|
@@ -194,5 +249,4 @@ class Fianet_Sceau_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
194 |
static function sendingMode(Mage_Sales_Model_Order $order) {
|
195 |
return Mage::getStoreConfig('sceau/sceauconfg/mode', $order->getStoreId());
|
196 |
}
|
197 |
-
|
198 |
}
|
7 |
|
8 |
static function Generate_Sceau_xml(Mage_Sales_Model_Order $order) {
|
9 |
//récupération des informations
|
10 |
+
$version = (string) Mage::getConfig()->getModuleConfig('Fianet_Sceau')->version;
|
11 |
+
$email = self::clean_invalid_char($order->customer_email);
|
12 |
$timestamp = Mage::getModel('core/date')->date(null,strtotime($order->created_at));
|
13 |
+
$refid = self::clean_invalid_char($order->increment_id);
|
14 |
$privatekey = Mage::getStoreConfig('sceau/sceauconfg/private_key', $order->getStoreId());
|
15 |
$crypt = md5($privatekey . "_" . $refid . "+" . $timestamp . "=" . $email);
|
|
|
16 |
|
17 |
//Si l'IP de l'internaute n'est pas présente dans Magento (en cas de création de commande depuis le BO) alors on récupère l'IP de la boutique
|
18 |
$ip = (!$order->getRemoteIp()) ? $_SERVER['REMOTE_ADDR'] : $order->getRemoteIp();
|
19 |
+
|
20 |
+
//récupération des informations de livraison
|
21 |
+
$shipping_code = $order->getShippingCarrier()->getCarrierCode();
|
22 |
+
$shipping = Mage::getModel('sceau/shipping_association')->load($shipping_code);
|
23 |
|
24 |
+
//Si le titre du prénom est renseigné dans la commande, alors il s'ajoute au flux XML
|
25 |
+
$titre = '';
|
26 |
+
if ($order->customer_gender)
|
27 |
+
$titre = ' titre="' . $order->customer_gender . '"';
|
28 |
+
|
29 |
+
$xml = '';
|
30 |
+
$xml .= '<?xml version="1.0" encoding="UTF-8"?>';
|
31 |
+
$xml .= '<control fianetmodule="Magento_Sceau" version="' . $version . '">';
|
32 |
+
$xml .= '<utilisateur><nom' . $titre . '><![CDATA[' . self::clean_invalid_char($order->customer_lastname) . ']]></nom>';
|
33 |
+
$xml .= '<prenom><![CDATA[' . self::clean_invalid_char($order->customer_firstname) . ']]></prenom>';
|
34 |
+
$xml .= '<email><![CDATA[' . $email . ']]></email>';
|
35 |
+
$xml .= '</utilisateur>';
|
36 |
+
$xml .= '<infocommande>';
|
37 |
+
$xml .= '<siteid><![CDATA[' . self::getSiteID($order) . ']]></siteid>';
|
38 |
+
$xml .= '<refid><![CDATA[' . $refid . ']]></refid>';
|
39 |
+
$xml .= '<montant devise="' . $order->base_currency_code .'"><![CDATA[' . $order->base_grand_total . ']]></montant>';
|
40 |
+
$xml .= '<ip timestamp="' . $timestamp . '"><![CDATA[' . $ip . ']]></ip>';
|
41 |
+
|
42 |
+
if ($shipping)
|
43 |
+
$xml .= '<typelivraison><![CDATA[' . $shipping->getFianetSceauShippingType() . ']]></typelivraison>';
|
44 |
+
else
|
45 |
+
Mage::getModel('fianet/log')->Log(Mage::helper('fianet')->__('Sceau: order #%s error in shipping configuration.', $order->getIncrementId()));
|
46 |
+
|
47 |
+
$xml .= '<produits>';
|
48 |
+
foreach ($order->getAllVisibleItems() as $item) {
|
49 |
+
$Product= Mage::getModel('catalog/product')->load($item->getProductId());
|
50 |
+
$categories = $Product->getCategoryIds();
|
51 |
+
$type = Mage::getModel('sceau/categories_association')->load($categories[0])->getFianetSceauCategoryType();
|
52 |
+
$amount = $item->getBaseRowTotal() - $item->getBaseDiscountAmount() + $item->getBaseTaxAmount() + $item->getBaseWeeeTaxAppliedRowAmount();
|
53 |
+
$pName = $item->getName();
|
54 |
+
$pSku = $item->getSku();
|
55 |
+
if ($item->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
|
56 |
+
$childrenProduct = $item->getChildrenItems();
|
57 |
+
if (count($childrenProduct) == 1) {
|
58 |
+
$pName = $childrenProduct[0]->getName();
|
59 |
+
$pSku = $childrenProduct[0]->getSku();
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
$xml .= '<produit>';
|
64 |
+
$xml .= '<id><![CDATA[' . self::clean_invalid_char($pSku) . ']]></id>';
|
65 |
+
if ($type)
|
66 |
+
$xml .= '<categorie><![CDATA[' . $type . ']]></categorie>';
|
67 |
+
else
|
68 |
+
Mage::getModel('fianet/log')->Log(Mage::helper('fianet')->__('Sceau: order #%s error in products configuration.', $order->getIncrementId()));
|
69 |
+
|
70 |
+
$xml .= '<libelle><![CDATA[' . self::clean_invalid_char($pName) . ']]></libelle>';
|
71 |
+
$xml .= '<montant><![CDATA[' . $amount . ']]></montant>';
|
72 |
+
|
73 |
+
try {
|
74 |
+
if ($Product->getImageUrl())
|
75 |
+
$xml .= '<image><![CDATA[' . $Product->getImageUrl() . ']]></image>';
|
76 |
+
} catch (Exception $e) {
|
77 |
+
Mage::getModel('fianet/log')->Log(Mage::helper('fianet')->__('Sceau: order #%s Exception error: %s.', $order->getIncrementId(), $e->getMessage()));
|
78 |
+
}
|
79 |
+
|
80 |
+
$xml .= '</produit>';
|
81 |
+
}
|
82 |
+
$xml .= '</produits>';
|
83 |
+
$xml .= '</infocommande>';
|
84 |
+
$xml .= '<crypt><![CDATA[' . $crypt . ']]></crypt>';
|
85 |
+
$xml .= "</control>";
|
86 |
+
|
87 |
+
$xml = self::clean_xml($xml);
|
88 |
+
|
89 |
+
return $xml;
|
90 |
+
}
|
91 |
|
92 |
static public function clean_xml($xml) {
|
93 |
$xml = str_replace("\\'", "'", $xml);
|
120 |
$attribut_sceau = self::ORDER_ATTR_SCEAU_SENT_PROD;
|
121 |
}
|
122 |
$order->setData($attribut_sceau, '1');
|
|
|
|
|
|
|
123 |
return true;
|
124 |
}
|
125 |
return false;
|
134 |
}
|
135 |
|
136 |
static function sendOrderToFianet(Mage_Sales_Model_Order $order) {
|
|
|
|
|
137 |
$flux = self::Generate_Sceau_xml($order);
|
|
|
138 |
|
139 |
$url = self::getFianetUrl($order);
|
140 |
$config = array('maxredirects' => 0,
|
145 |
'XMLInfo' => $flux);
|
146 |
|
147 |
Mage::dispatchEvent('Fianet_Sceau_Before_Send_Order', array('order' => $order, 'url' => $url, 'flux' => $flux));
|
|
|
|
|
148 |
|
149 |
try {
|
|
|
150 |
$client = new Zend_Http_Client($url, $config);
|
151 |
$client->setMethod(Zend_Http_Client::POST);
|
152 |
$client->setParameterPost($params);
|
|
|
153 |
$response = $client->request();
|
154 |
|
|
|
|
|
|
|
155 |
Mage::dispatchEvent('Fianet_Sceau_After_Send_Order', array('order' => $order, 'response' => $response));
|
|
|
156 |
|
157 |
return self::parseFianetResponse($response, $order);
|
158 |
} catch (Exception $e) {
|
159 |
+
Mage::getModel('fianet/log')->Log(Mage::helper('fianet')->__('Sceau: order #%s sending error : %s.', $order->getIncrementId(), $e->getMessage()));
|
160 |
Mage::getSingleton('adminhtml/session')->addError('FIA-NET Sceau sending error : ' . $e->getMessage());
|
161 |
}
|
162 |
}
|
168 |
|
169 |
$simplexml = new Varien_Simplexml_Config($xml);
|
170 |
if ($simplexml->getNode()->getAttribute('type') == 'OK') {
|
|
|
171 |
$order->setData($attribut_sceau_error, '0');
|
172 |
return true;
|
173 |
}
|
176 |
{
|
177 |
$order->setData($attribut_sceau_error, '1');
|
178 |
$ret = "erreur de flux";
|
179 |
+
}
|
180 |
else
|
181 |
$ret = $simplexml->getNode()->detail;
|
182 |
+
Mage::getModel('fianet/log')->Log(Mage::helper('fianet')->__('Sceau: order #%s sending error : %s.', $order->getIncrementId(), $ret));
|
183 |
Mage::getSingleton('adminhtml/session')->addError('FIA-NET Sceau sending error : ' . $ret);
|
184 |
|
185 |
return false;
|
249 |
static function sendingMode(Mage_Sales_Model_Order $order) {
|
250 |
return Mage::getStoreConfig('sceau/sceauconfg/mode', $order->getStoreId());
|
251 |
}
|
|
|
252 |
}
|
app/code/community/Fianet/Sceau/Model/Categories/Association.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Fianet_Sceau_Model_Categories_Association extends Mage_Core_Model_Abstract {
|
3 |
+
protected function _construct() {
|
4 |
+
parent::_construct();
|
5 |
+
$this->_init('sceau/categories_association');
|
6 |
+
}
|
7 |
+
}
|
app/code/community/Fianet/Sceau/Model/Mysql4/Categories/Association.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Fianet_Sceau_Model_Mysql4_Categories_Association extends Fianet_Core_Model_Mysql4_Abstract {
|
3 |
+
protected function _construct() {
|
4 |
+
$this->_init('sceau/categories_association', 'entity_id');
|
5 |
+
}
|
6 |
+
}
|
app/code/community/Fianet/Sceau/Model/Mysql4/Categories/Association/Collection.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Fianet_Sceau_Model_Mysql4_Categories_Association_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
3 |
+
protected function _construct() {
|
4 |
+
parent::_construct();
|
5 |
+
$this->_init('sceau/categories_association');
|
6 |
+
}
|
7 |
+
}
|
app/code/community/Fianet/Sceau/Model/Mysql4/Shipping/Association.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Fianet_Sceau_Model_Mysql4_Shipping_Association extends Fianet_Core_Model_Mysql4_Abstract {
|
3 |
+
protected function _construct() {
|
4 |
+
$this->_init('sceau/shipping_association', 'shipping_code');
|
5 |
+
}
|
6 |
+
}
|
app/code/community/Fianet/Sceau/Model/Mysql4/Shipping/Association/Collection.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Fianet_Sceau_Model_Mysql4_Shipping_Association_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
3 |
+
protected function _construct() {
|
4 |
+
parent::_construct();
|
5 |
+
$this->_init('sceau/shipping_association');
|
6 |
+
}
|
7 |
+
}
|
app/code/community/Fianet/Sceau/Model/Observer.php
CHANGED
@@ -6,12 +6,9 @@ class Fianet_Sceau_Model_Observer extends Varien_Event_Observer {
|
|
6 |
CONST MASSACTION_BLOCK_CLASS = 'Mage_Adminhtml_Block_Widget_Grid_Massaction';
|
7 |
|
8 |
public function updateSalesOrderGrid($observer) {
|
9 |
-
|
10 |
$event = $observer->getEvent();
|
11 |
$block = $event->getData('block');
|
12 |
|
13 |
-
|
14 |
-
|
15 |
if ($block->getNameInLayout() == self::GRID_NAME_IN_LAYOUT) {
|
16 |
$block->addColumnAfter('fianet_sceau', array(
|
17 |
'header' => 'FIA-NET SCEAU',
|
@@ -24,52 +21,41 @@ class Fianet_Sceau_Model_Observer extends Varien_Event_Observer {
|
|
24 |
), 'action');
|
25 |
}
|
26 |
|
27 |
-
|
28 |
if (preg_match('/' . self::MASSACTION_BLOCK_NAME_IN_LAYOUT . '[0-9]+/', $block->getNameInLayout())
|
29 |
&& (get_class($block) == self::MASSACTION_BLOCK_CLASS || get_parent_class($block) == self::MASSACTION_BLOCK_CLASS)) {
|
30 |
$block->addItem('fianet_sceau', array(
|
31 |
-
'label' => Mage::helper('fianet_sceau')->__('
|
32 |
'url' => Mage::getUrl('sceau/index/mass')
|
33 |
));
|
34 |
}
|
35 |
}
|
36 |
-
|
37 |
|
38 |
public function sendToFianet($observer) {
|
39 |
-
//gestion de l'évènement magento
|
40 |
$event = $observer->getEvent();
|
41 |
$order = $event->getData('order');
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
if ($this->_canSendOrder($order))
|
47 |
-
{
|
48 |
-
Mage::Helper('fianet_sceau/Data')->processOrderToFianet($order);
|
49 |
}
|
50 |
}
|
51 |
|
52 |
protected function _canSendOrder(Mage_Sales_Model_Order $order)
|
53 |
{
|
54 |
-
if (!Mage::Helper('fianet_sceau/Data')->isModuleActive($order))
|
55 |
-
|
56 |
-
return false;
|
57 |
}
|
58 |
-
else if (Mage::Helper('fianet_sceau/Data')->isOrderAlreadySent($order))
|
59 |
-
|
60 |
-
return false;
|
61 |
}
|
62 |
-
elseif (Mage::Helper('fianet_sceau/Data')->checkCurrentOrderStatus($order))
|
63 |
-
{//si la status de la commande est l'un des status pour lequel l'envoi est requis
|
64 |
return true;
|
65 |
}
|
66 |
-
elseif ($order->getState() == Mage_Sales_Model_Order::STATE_NEW
|
67 |
-
&& $order->getIsInProcess())
|
68 |
-
{//si la commande a été payée
|
69 |
return true;
|
70 |
|
71 |
}
|
72 |
return false;
|
73 |
}
|
74 |
-
|
75 |
}
|
6 |
CONST MASSACTION_BLOCK_CLASS = 'Mage_Adminhtml_Block_Widget_Grid_Massaction';
|
7 |
|
8 |
public function updateSalesOrderGrid($observer) {
|
|
|
9 |
$event = $observer->getEvent();
|
10 |
$block = $event->getData('block');
|
11 |
|
|
|
|
|
12 |
if ($block->getNameInLayout() == self::GRID_NAME_IN_LAYOUT) {
|
13 |
$block->addColumnAfter('fianet_sceau', array(
|
14 |
'header' => 'FIA-NET SCEAU',
|
21 |
), 'action');
|
22 |
}
|
23 |
|
|
|
24 |
if (preg_match('/' . self::MASSACTION_BLOCK_NAME_IN_LAYOUT . '[0-9]+/', $block->getNameInLayout())
|
25 |
&& (get_class($block) == self::MASSACTION_BLOCK_CLASS || get_parent_class($block) == self::MASSACTION_BLOCK_CLASS)) {
|
26 |
$block->addItem('fianet_sceau', array(
|
27 |
+
'label' => Mage::helper('fianet_sceau')->__('Sceau de Confiance FIA-NET : request the sending of questionnaire'),
|
28 |
'url' => Mage::getUrl('sceau/index/mass')
|
29 |
));
|
30 |
}
|
31 |
}
|
|
|
32 |
|
33 |
public function sendToFianet($observer) {
|
34 |
+
//gestion de l'évènement magento
|
35 |
$event = $observer->getEvent();
|
36 |
$order = $event->getData('order');
|
37 |
+
|
38 |
+
if ($this->_canSendOrder($order) && Mage::Helper('fianet_sceau/Data')->processOrderToFianet($order)) {
|
39 |
+
Mage::getModel('fianet/log')->Log(Mage::helper('fianet')->__('Sceau: order #%s sent.', $order->getIncrementId()));
|
40 |
+
Mage::getSingleton('adminhtml/session')->addSuccess('Commande #' . $order->getIncrementId() . ' envoyée à FIA-NET');
|
|
|
|
|
|
|
41 |
}
|
42 |
}
|
43 |
|
44 |
protected function _canSendOrder(Mage_Sales_Model_Order $order)
|
45 |
{
|
46 |
+
if (!Mage::Helper('fianet_sceau/Data')->isModuleActive($order)) {//si le module est désactivé
|
47 |
+
return false;
|
|
|
48 |
}
|
49 |
+
else if (Mage::Helper('fianet_sceau/Data')->isOrderAlreadySent($order)) {//Si la commande a déjà été envoyée
|
50 |
+
return false;
|
|
|
51 |
}
|
52 |
+
elseif (Mage::Helper('fianet_sceau/Data')->checkCurrentOrderStatus($order)) {//si la status de la commande est l'un des status pour lequel l'envoi est requis
|
|
|
53 |
return true;
|
54 |
}
|
55 |
+
elseif ($order->getState() == Mage_Sales_Model_Order::STATE_NEW && $order->getIsInProcess()) {//si la commande a été payée
|
|
|
|
|
56 |
return true;
|
57 |
|
58 |
}
|
59 |
return false;
|
60 |
}
|
|
|
61 |
}
|
app/code/community/Fianet/Sceau/Model/Order.php
CHANGED
@@ -1,29 +1,18 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
/*
|
4 |
-
* To change this template, choose Tools | Templates
|
5 |
-
* and open the template in the editor.
|
6 |
-
*/
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Description of Order
|
10 |
-
*
|
11 |
-
* @author ahoury
|
12 |
-
*/
|
13 |
class Fianet_Sceau_Model_Order
|
14 |
{
|
15 |
static function processOrderToFianet($order)
|
16 |
{
|
17 |
if (Fianet_Sceau_Helper_Data::sendOrderToFianet($this))
|
18 |
{
|
19 |
-
|
20 |
$attribut_sceau = Fianet_Sceau_Helper_Data::ORDER_ATTR_SCEAU_SENT_PPROD;
|
21 |
|
22 |
if (Fianet_Sceau_Helper_Data::sendingMode($this) == Fianet_Sceau_Model_Source_Mode::MODE_PROD) {
|
23 |
$attribut_sceau = Fianet_Sceau_Helper_Data::ORDER_ATTR_SCEAU_SENT_PROD;
|
24 |
}
|
25 |
$this->setData($attribut_sceau, '1');
|
26 |
-
|
27 |
return true;
|
28 |
}
|
29 |
return false;
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Fianet_Sceau_Model_Order
|
4 |
{
|
5 |
static function processOrderToFianet($order)
|
6 |
{
|
7 |
if (Fianet_Sceau_Helper_Data::sendOrderToFianet($this))
|
8 |
{
|
|
|
9 |
$attribut_sceau = Fianet_Sceau_Helper_Data::ORDER_ATTR_SCEAU_SENT_PPROD;
|
10 |
|
11 |
if (Fianet_Sceau_Helper_Data::sendingMode($this) == Fianet_Sceau_Model_Source_Mode::MODE_PROD) {
|
12 |
$attribut_sceau = Fianet_Sceau_Helper_Data::ORDER_ATTR_SCEAU_SENT_PROD;
|
13 |
}
|
14 |
$this->setData($attribut_sceau, '1');
|
15 |
+
$this->save();
|
16 |
return true;
|
17 |
}
|
18 |
return false;
|
app/code/community/Fianet/Sceau/Model/Shipping/Association.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Fianet_Sceau_Model_Shipping_Association extends Mage_Core_Model_Abstract {
|
3 |
+
protected function _construct() {
|
4 |
+
parent::_construct();
|
5 |
+
$this->_init('sceau/shipping_association');
|
6 |
+
}
|
7 |
+
}
|
app/code/community/Fianet/Sceau/Model/Source/ProductType.php
ADDED
@@ -0,0 +1,332 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Fianet_Sceau_Model_Source_ProductType {
|
3 |
+
public function toOptionArray() {
|
4 |
+
return array(
|
5 |
+
array('theme' => Mage::helper('fianet')->__('Alimentation & Gastronomie'),
|
6 |
+
array('value' => 2, 'label' => Mage::helper('fianet')->__('Chocolats & Confiserie')),
|
7 |
+
array('value' => 3, 'label' => Mage::helper('fianet')->__('Alimentation générale')),
|
8 |
+
array('value' => 4, 'label' => Mage::helper('fianet')->__('Produits du terroir')),
|
9 |
+
array('value' => 5, 'label' => Mage::helper('fianet')->__('Vins & Spiritueux')),
|
10 |
+
array('value' => 6, 'label' => Mage::helper('fianet')->__('Aliments pour animaux')),
|
11 |
+
array('value' => 78, 'label' => Mage::helper('fianet')->__('Produits biologiques et diététiques')),
|
12 |
+
array('value' => 79, 'label' => Mage::helper('fianet')->__('Spécialités gastronomiques')),
|
13 |
+
array('value' => 248, 'label' => Mage::helper('fianet')->__('Commerce équitable')),
|
14 |
+
array('value' => 249, 'label' => Mage::helper('fianet')->__('Alimentation biologique & Diététique'))
|
15 |
+
),
|
16 |
+
array('theme' => Mage::helper('fianet')->__('Animaux') ,
|
17 |
+
array('value' => 264, 'label' => Mage::helper('fianet')->__('Animaux')),
|
18 |
+
array('value' => 265, 'label' => Mage::helper('fianet')->__('Aliments pour animaux')),
|
19 |
+
array('value' => 266, 'label' => Mage::helper('fianet')->__('Pharmacie pour animaux'))
|
20 |
+
),
|
21 |
+
array('theme' => Mage::helper('fianet')->__('Armurerie'),
|
22 |
+
array('value' => 253, 'label' => Mage::helper('fianet')->__('Armes'))
|
23 |
+
),
|
24 |
+
array('theme' => Mage::helper('fianet')->__('Auto & Moto'),
|
25 |
+
array('value' => 7, 'label' => Mage::helper('fianet')->__('Accessoires')),
|
26 |
+
array('value' => 8, 'label' => Mage::helper('fianet')->__('Autre')),
|
27 |
+
array('value' => 9, 'label' => Mage::helper('fianet')->__('Pneumatiques')),
|
28 |
+
array('value' => 80, 'label' => Mage::helper('fianet')->__('Autoradios')),
|
29 |
+
array('value' => 82, 'label' => Mage::helper('fianet')->__('Antivols')),
|
30 |
+
array('value' => 84, 'label' => Mage::helper('fianet')->__('Produits d\'entretien')),
|
31 |
+
array('value' => 86, 'label' => Mage::helper('fianet')->__('Pièces détachées')),
|
32 |
+
array('value' => 166, 'label' => Mage::helper('fianet')->__('Autos')),
|
33 |
+
array('value' => 167, 'label' => Mage::helper('fianet')->__('2 roues')),
|
34 |
+
array('value' => 175, 'label' => Mage::helper('fianet')->__('Sport automobile')),
|
35 |
+
array('value' => 186, 'label' => Mage::helper('fianet')->__('GPS')),
|
36 |
+
array('value' => 231, 'label' => Mage::helper('fianet')->__('Casques & Combinaisons moto')),
|
37 |
+
array('value' => 232, 'label' => Mage::helper('fianet')->__('Caravanes & Camping-cars')),
|
38 |
+
array('value' => 233, 'label' => Mage::helper('fianet')->__('Scooters')),
|
39 |
+
array('value' => 234, 'label' => Mage::helper('fianet')->__('Pièces détachées & Tuning')),
|
40 |
+
array('value' => 235, 'label' => Mage::helper('fianet')->__('Voitures neuves & Occasions')),
|
41 |
+
array('value' => 236, 'label' => Mage::helper('fianet')->__('Motos neuves & occasions')),
|
42 |
+
array('value' => 237, 'label' => Mage::helper('fianet')->__('Autoradios & vidéo embarquée')),
|
43 |
+
array('value' => 281, 'label' => Mage::helper('fianet')->__('Code de la route'))
|
44 |
+
),
|
45 |
+
array('theme' => Mage::helper('fianet')->__('Bébés & Enfants'),
|
46 |
+
array('value' => 257, 'label' => Mage::helper('fianet')->__('Jeux & Jouets d\'éveil')),
|
47 |
+
array('value' => 258, 'label' => Mage::helper('fianet')->__('Puériculture')),
|
48 |
+
array('value' => 259, 'label' => Mage::helper('fianet')->__('Mobilier bébés')),
|
49 |
+
array('value' => 260, 'label' => Mage::helper('fianet')->__('Faire-part & Cartes de voeux')),
|
50 |
+
array('value' => 261, 'label' => Mage::helper('fianet')->__('Poussettes & Voyages')),
|
51 |
+
array('value' => 262, 'label' => Mage::helper('fianet')->__('Hygiène')),
|
52 |
+
array('value' => 263, 'label' => Mage::helper('fianet')->__('Sécurité')),
|
53 |
+
array('value' => 272, 'label' => Mage::helper('fianet')->__('Mode bébés & Enfants'))
|
54 |
+
),
|
55 |
+
array('theme' => Mage::helper('fianet')->__('Culture & Divertissements'),
|
56 |
+
array('value' => 10, 'label' => Mage::helper('fianet')->__('Arts graphiques')),
|
57 |
+
array('value' => 11, 'label' => Mage::helper('fianet')->__('Autres')),
|
58 |
+
array('value' => 12, 'label' => Mage::helper('fianet')->__('DVD')),
|
59 |
+
array('value' => 13, 'label' => Mage::helper('fianet')->__('Jeux & Jouets')),
|
60 |
+
array('value' => 14, 'label' => Mage::helper('fianet')->__('Jeux vidéos')),
|
61 |
+
array('value' => 15, 'label' => Mage::helper('fianet')->__('Livres')),
|
62 |
+
array('value' => 16, 'label' => Mage::helper('fianet')->__('Musique')),
|
63 |
+
array('value' => 17, 'label' => Mage::helper('fianet')->__('Spectacles & Evènements')),
|
64 |
+
array('value' => 87, 'label' => Mage::helper('fianet')->__('Art')),
|
65 |
+
array('value' => 88, 'label' => Mage::helper('fianet')->__('Bande dessinées')),
|
66 |
+
array('value' => 90, 'label' => Mage::helper('fianet')->__('Collections et miniatures')),
|
67 |
+
array('value' => 91, 'label' => Mage::helper('fianet')->__('Magazines')),
|
68 |
+
array('value' => 92, 'label' => Mage::helper('fianet')->__('Cd-rom')),
|
69 |
+
array('value' => 93, 'label' => Mage::helper('fianet')->__('Vidéos')),
|
70 |
+
array('value' => 173, 'label' => Mage::helper('fianet')->__('Philatélie')),
|
71 |
+
array('value' => 185, 'label' => Mage::helper('fianet')->__('Consoles Vidéos')),
|
72 |
+
array('value' => 244, 'label' => Mage::helper('fianet')->__('Instruments de musique')),
|
73 |
+
array('value' => 245, 'label' => Mage::helper('fianet')->__('Livres & magazines')),
|
74 |
+
array('value' => 246, 'label' => Mage::helper('fianet')->__('Vidéo DVD et Blu Ray')),
|
75 |
+
array('value' => 271, 'label' => Mage::helper('fianet')->__('Consoles & Jeux vidéos')),
|
76 |
+
array('value' => 273, 'label' => Mage::helper('fianet')->__('Modélisme')),
|
77 |
+
array('value' => 280, 'label' => Mage::helper('fianet')->__('Déguisement')),
|
78 |
+
array('value' => 283, 'label' => Mage::helper('fianet')->__('Enseignement')),
|
79 |
+
array('value' => 286, 'label' => Mage::helper('fianet')->__('Vente de produits dérivés d\'artistes'))
|
80 |
+
),
|
81 |
+
array('theme' => Mage::helper('fianet')->__('Electroménager'),
|
82 |
+
array('value' => 23, 'label' => Mage::helper('fianet')->__('Réfrigérateurs')),
|
83 |
+
array('value' => 24, 'label' => Mage::helper('fianet')->__('Congélateurs')),
|
84 |
+
array('value' => 25, 'label' => Mage::helper('fianet')->__('Lave-vaisselles')),
|
85 |
+
array('value' => 26, 'label' => Mage::helper('fianet')->__('Micro-ondes')),
|
86 |
+
array('value' => 27, 'label' => Mage::helper('fianet')->__('Fours')),
|
87 |
+
array('value' => 28, 'label' => Mage::helper('fianet')->__('Cuisinières')),
|
88 |
+
array('value' => 100, 'label' => Mage::helper('fianet')->__('Hottes aspirantes')),
|
89 |
+
array('value' => 101, 'label' => Mage::helper('fianet')->__('Tables de cuisson')),
|
90 |
+
array('value' => 102, 'label' => Mage::helper('fianet')->__('Appareils culinaires')),
|
91 |
+
array('value' => 103, 'label' => Mage::helper('fianet')->__('Laves-linge')),
|
92 |
+
array('value' => 104, 'label' => Mage::helper('fianet')->__('Sèches-linge')),
|
93 |
+
array('value' => 105, 'label' => Mage::helper('fianet')->__('Aspirateurs')),
|
94 |
+
array('value' => 106, 'label' => Mage::helper('fianet')->__('Sèches-cheveux')),
|
95 |
+
array('value' => 108, 'label' => Mage::helper('fianet')->__('Rasoirs')),
|
96 |
+
array('value' => 109, 'label' => Mage::helper('fianet')->__('Epilateurs')),
|
97 |
+
array('value' => 110, 'label' => Mage::helper('fianet')->__('Pèses-personne')),
|
98 |
+
array('value' => 111, 'label' => Mage::helper('fianet')->__('Fers à repasser')),
|
99 |
+
array('value' => 169, 'label' => Mage::helper('fianet')->__('Produits d\'entretien')),
|
100 |
+
array('value' => 183, 'label' => Mage::helper('fianet')->__('Accessoires')),
|
101 |
+
array('value' => 188, 'label' => Mage::helper('fianet')->__('Climatisation')),
|
102 |
+
array('value' => 200, 'label' => Mage::helper('fianet')->__('Machines à coudre')),
|
103 |
+
array('value' => 201, 'label' => Mage::helper('fianet')->__('Cafetières & Expresso')),
|
104 |
+
array('value' => 202, 'label' => Mage::helper('fianet')->__('Caves à vin')),
|
105 |
+
array('value' => 203, 'label' => Mage::helper('fianet')->__('Petit électroménager')),
|
106 |
+
array('value' => 204, 'label' => Mage::helper('fianet')->__('Centrales vapeurs & Fers à repasser')),
|
107 |
+
array('value' => 205, 'label' => Mage::helper('fianet')->__('Ménage & Produits d\'entretien')),
|
108 |
+
array('value' => 206, 'label' => Mage::helper('fianet')->__('Chauffage, Climatisation & Energies renouvelables'))
|
109 |
+
),
|
110 |
+
array('theme' => Mage::helper('fianet')->__('Enchères & Achats groupés'),
|
111 |
+
array('value' => 29, 'label' => Mage::helper('fianet')->__('Achats groupés')),
|
112 |
+
array('value' => 30, 'label' => Mage::helper('fianet')->__('Clubs de consommateurs')),
|
113 |
+
array('value' => 31, 'label' => Mage::helper('fianet')->__('Enchères')),
|
114 |
+
array('value' => 32, 'label' => Mage::helper('fianet')->__('Enchères inversées'))
|
115 |
+
),
|
116 |
+
array('theme' => Mage::helper('fianet')->__('Finance aux particuliers'),
|
117 |
+
array('value' => 254, 'label' => Mage::helper('fianet')->__('Assurance')),
|
118 |
+
array('value' => 255, 'label' => Mage::helper('fianet')->__('Informations juridiques')),
|
119 |
+
array('value' => 256, 'label' => Mage::helper('fianet')->__('Banque & Finance')),
|
120 |
+
array('value' => 290, 'label' => Mage::helper('fianet')->__('Rachat d\'or'))
|
121 |
+
),
|
122 |
+
array('theme' => Mage::helper('fianet')->__('Fleurs & Cadeaux'),
|
123 |
+
array('value' => 33, 'label' => Mage::helper('fianet')->__('Service d\'aide pour les cadeaux')),
|
124 |
+
array('value' => 34, 'label' => Mage::helper('fianet')->__('Cartes')),
|
125 |
+
array('value' => 35, 'label' => Mage::helper('fianet')->__('Fleurs')),
|
126 |
+
array('value' => 36, 'label' => Mage::helper('fianet')->__('Souvenirs')),
|
127 |
+
array('value' => 112, 'label' => Mage::helper('fianet')->__('Chocolats & Confiseries')),
|
128 |
+
array('value' => 267, 'label' => Mage::helper('fianet')->__('Cartes & Papeterie')),
|
129 |
+
array('value' => 268, 'label' => Mage::helper('fianet')->__('Bons d\'achats & Chèques cadeaux')),
|
130 |
+
array('value' => 269, 'label' => Mage::helper('fianet')->__('Gadgets & Cadeaux personnalisés')),
|
131 |
+
array('value' => 270, 'label' => Mage::helper('fianet')->__('Escapades & Coffrets cadeaux')),
|
132 |
+
array('value' => 278, 'label' => Mage::helper('fianet')->__('Accessoires fumeurs'))
|
133 |
+
),
|
134 |
+
array('theme' => Mage::helper('fianet')->__('Hifi, Photos & Vidéos'),
|
135 |
+
array('value' => 142, 'label' => Mage::helper('fianet')->__('Radios cassettes')),
|
136 |
+
array('value' => 143, 'label' => Mage::helper('fianet')->__('Autoradios')),
|
137 |
+
array('value' => 145, 'label' => Mage::helper('fianet')->__('Vidéoprojecteurs')),
|
138 |
+
array('value' => 146, 'label' => Mage::helper('fianet')->__('Appareils photo')),
|
139 |
+
array('value' => 147, 'label' => Mage::helper('fianet')->__('Lecteur mp3')),
|
140 |
+
array('value' => 148, 'label' => Mage::helper('fianet')->__('Téléviseurs')),
|
141 |
+
array('value' => 149, 'label' => Mage::helper('fianet')->__('Camescopes')),
|
142 |
+
array('value' => 150, 'label' => Mage::helper('fianet')->__('Chaînes hifi')),
|
143 |
+
array('value' => 152, 'label' => Mage::helper('fianet')->__('Baladeurs')),
|
144 |
+
array('value' => 153, 'label' => Mage::helper('fianet')->__('Amplificateurs')),
|
145 |
+
array('value' => 154, 'label' => Mage::helper('fianet')->__('Enceintes')),
|
146 |
+
array('value' => 155, 'label' => Mage::helper('fianet')->__('Tables de mixage')),
|
147 |
+
array('value' => 156, 'label' => Mage::helper('fianet')->__('Lecteurs DVD')),
|
148 |
+
array('value' => 158, 'label' => Mage::helper('fianet')->__('Magnétoscopes')),
|
149 |
+
array('value' => 161, 'label' => Mage::helper('fianet')->__('Tirages photos')),
|
150 |
+
array('value' => 177, 'label' => Mage::helper('fianet')->__('Accessoires')),
|
151 |
+
array('value' => 179, 'label' => Mage::helper('fianet')->__('Home cinéma')),
|
152 |
+
array('value' => 196, 'label' => Mage::helper('fianet')->__('Enregistreurs')),
|
153 |
+
array('value' => 197, 'label' => Mage::helper('fianet')->__('Développement photos')),
|
154 |
+
array('value' => 198, 'label' => Mage::helper('fianet')->__('Lecteur DVD & Blu Ray')),
|
155 |
+
array('value' => 199, 'label' => Mage::helper('fianet')->__('Lecteur MP3 & Baladeurs'))
|
156 |
+
),
|
157 |
+
array('theme' => Mage::helper('fianet')->__('Informatique & Logiciels'),
|
158 |
+
array('value' => 37, 'label' => Mage::helper('fianet')->__('Consommables')),
|
159 |
+
array('value' => 38, 'label' => Mage::helper('fianet')->__('Logiciels')),
|
160 |
+
array('value' => 39, 'label' => Mage::helper('fianet')->__('Ordinateurs')),
|
161 |
+
array('value' => 40, 'label' => Mage::helper('fianet')->__('Périphériques')),
|
162 |
+
array('value' => 41, 'label' => Mage::helper('fianet')->__('Pièces détachées')),
|
163 |
+
array('value' => 42, 'label' => Mage::helper('fianet')->__('Téléchargements')),
|
164 |
+
array('value' => 113, 'label' => Mage::helper('fianet')->__('Imprimantes')),
|
165 |
+
array('value' => 114, 'label' => Mage::helper('fianet')->__('Lecteurs & Graveurs')),
|
166 |
+
array('value' => 115, 'label' => Mage::helper('fianet')->__('Moniteurs')),
|
167 |
+
array('value' => 116, 'label' => Mage::helper('fianet')->__('Cartes Graphiques')),
|
168 |
+
array('value' => 117, 'label' => Mage::helper('fianet')->__('Composants')),
|
169 |
+
array('value' => 118, 'label' => Mage::helper('fianet')->__('Assistants personnels')),
|
170 |
+
array('value' => 119, 'label' => Mage::helper('fianet')->__('Modems')),
|
171 |
+
array('value' => 120, 'label' => Mage::helper('fianet')->__('Scanners')),
|
172 |
+
array('value' => 159, 'label' => Mage::helper('fianet')->__('Portables')),
|
173 |
+
array('value' => 176, 'label' => Mage::helper('fianet')->__('Editeurs')),
|
174 |
+
array('value' => 184, 'label' => Mage::helper('fianet')->__('Accessoires')),
|
175 |
+
array('value' => 207, 'label' => Mage::helper('fianet')->__('Mini PC')),
|
176 |
+
array('value' => 208, 'label' => Mage::helper('fianet')->__('Cables & Connectiques')),
|
177 |
+
array('value' => 209, 'label' => Mage::helper('fianet')->__('GPS')),
|
178 |
+
array('value' => 210, 'label' => Mage::helper('fianet')->__('Réseau')),
|
179 |
+
array('value' => 211, 'label' => Mage::helper('fianet')->__('Dépannage informatique')),
|
180 |
+
array('value' => 212, 'label' => Mage::helper('fianet')->__('Stockage')),
|
181 |
+
array('value' => 213, 'label' => Mage::helper('fianet')->__('Ordinateurs PC & Mac')),
|
182 |
+
array('value' => 214, 'label' => Mage::helper('fianet')->__('Ordinateurs Portables')),
|
183 |
+
array('value' => 215, 'label' => Mage::helper('fianet')->__('Consommables & Accessoires')),
|
184 |
+
array('value' => 284, 'label' => Mage::helper('fianet')->__('Tablettes')),
|
185 |
+
array('value' => 285, 'label' => Mage::helper('fianet')->__('Accessoires pour tablettes'))
|
186 |
+
),
|
187 |
+
array('theme' => Mage::helper('fianet')->__('Maison & Jardin'),
|
188 |
+
array('value' => 19, 'label' => Mage::helper('fianet')->__('Bricolage')),
|
189 |
+
array('value' => 20, 'label' => Mage::helper('fianet')->__('Jardinage')),
|
190 |
+
array('value' => 21, 'label' => Mage::helper('fianet')->__('Fournitures & Mobiliers')),
|
191 |
+
array('value' => 22, 'label' => Mage::helper('fianet')->__('Design')),
|
192 |
+
array('value' => 94, 'label' => Mage::helper('fianet')->__('Décoration')),
|
193 |
+
array('value' => 95, 'label' => Mage::helper('fianet')->__('Linge de maison')),
|
194 |
+
array('value' => 96, 'label' => Mage::helper('fianet')->__('Luminaires')),
|
195 |
+
array('value' => 97, 'label' => Mage::helper('fianet')->__('Mobilier de jardin')),
|
196 |
+
array('value' => 98, 'label' => Mage::helper('fianet')->__('Vaisselles')),
|
197 |
+
array('value' => 99, 'label' => Mage::helper('fianet')->__('Autres')),
|
198 |
+
array('value' => 170, 'label' => Mage::helper('fianet')->__('Produits d\'entretien')),
|
199 |
+
array('value' => 181, 'label' => Mage::helper('fianet')->__('Art de la table')),
|
200 |
+
array('value' => 187, 'label' => Mage::helper('fianet')->__('Salles de bain')),
|
201 |
+
array('value' => 216, 'label' => Mage::helper('fianet')->__('Fenêtres, Volets & Stores')),
|
202 |
+
array('value' => 217, 'label' => Mage::helper('fianet')->__('Animalerie')),
|
203 |
+
array('value' => 218, 'label' => Mage::helper('fianet')->__('Cuisines')),
|
204 |
+
array('value' => 219, 'label' => Mage::helper('fianet')->__('Ameublement')),
|
205 |
+
array('value' => 220, 'label' => Mage::helper('fianet')->__('Piscines')),
|
206 |
+
array('value' => 221, 'label' => Mage::helper('fianet')->__('Maisons en bois')),
|
207 |
+
array('value' => 222, 'label' => Mage::helper('fianet')->__('Chauffage, Climatisation & Energies renouvelables')),
|
208 |
+
array('value' => 223, 'label' => Mage::helper('fianet')->__('Barbecues, Plancha & Accessoires')),
|
209 |
+
array('value' => 224, 'label' => Mage::helper('fianet')->__('Protections & Alarmes')),
|
210 |
+
array('value' => 225, 'label' => Mage::helper('fianet')->__('Literie')),
|
211 |
+
array('value' => 227, 'label' => Mage::helper('fianet')->__('Bricolage & Outillage')),
|
212 |
+
array('value' => 228, 'label' => Mage::helper('fianet')->__('Mobilier & Aménagement d\'exterieur')),
|
213 |
+
array('value' => 229, 'label' => Mage::helper('fianet')->__('Art de la table et de la cuisine')),
|
214 |
+
array('value' => 277, 'label' => Mage::helper('fianet')->__('Stickers & Adhésifs'))
|
215 |
+
),
|
216 |
+
array('theme' => Mage::helper('fianet')->__('Optique'),
|
217 |
+
array('value' => 275, 'label' => Mage::helper('fianet')->__('Lunettes de soleil')),
|
218 |
+
array('value' => 276, 'label' => Mage::helper('fianet')->__('Lunettes & Lentilles')),
|
219 |
+
),
|
220 |
+
array('theme' => Mage::helper('fianet')->__('Santé & Beauté'),
|
221 |
+
array('value' => 43, 'label' => Mage::helper('fianet')->__('Soins des cheveux')),
|
222 |
+
array('value' => 44, 'label' => Mage::helper('fianet')->__('Soins du corps')),
|
223 |
+
array('value' => 45, 'label' => Mage::helper('fianet')->__('Parfums')),
|
224 |
+
array('value' => 46, 'label' => Mage::helper('fianet')->__('Soins du visage')),
|
225 |
+
array('value' => 47, 'label' => Mage::helper('fianet')->__('Sexualité')),
|
226 |
+
array('value' => 48, 'label' => Mage::helper('fianet')->__('Animaux')),
|
227 |
+
array('value' => 121, 'label' => Mage::helper('fianet')->__('Produits biologiques')),
|
228 |
+
array('value' => 122, 'label' => Mage::helper('fianet')->__('Produits diététiques')),
|
229 |
+
array('value' => 123, 'label' => Mage::helper('fianet')->__('Parapharmacie')),
|
230 |
+
array('value' => 124, 'label' => Mage::helper('fianet')->__('Minceur')),
|
231 |
+
array('value' => 125, 'label' => Mage::helper('fianet')->__('Cosmétiques')),
|
232 |
+
array('value' => 157, 'label' => Mage::helper('fianet')->__('Bébé')),
|
233 |
+
array('value' => 163, 'label' => Mage::helper('fianet')->__('Lunettes')),
|
234 |
+
array('value' => 238, 'label' => Mage::helper('fianet')->__('Appareils santé beauté')),
|
235 |
+
array('value' => 239, 'label' => Mage::helper('fianet')->__('Produits diététiques & Bien-être')),
|
236 |
+
array('value' => 240, 'label' => Mage::helper('fianet')->__('Cosmétiques & Cosmétiques bio')),
|
237 |
+
array('value' => 241, 'label' => Mage::helper('fianet')->__('Soins du corps et du visage')),
|
238 |
+
array('value' => 242, 'label' => Mage::helper('fianet')->__('Intimité & Préservatifs')),
|
239 |
+
array('value' => 243, 'label' => Mage::helper('fianet')->__('Lentilles de contact & Lunettes de vue')),
|
240 |
+
array('value' => 288, 'label' => Mage::helper('fianet')->__('Accessoires'))
|
241 |
+
),
|
242 |
+
array('theme' => Mage::helper('fianet')->__('Services aux professionnels'),
|
243 |
+
array('value' => 59, 'label' => Mage::helper('fianet')->__('Divers')),
|
244 |
+
array('value' => 60, 'label' => Mage::helper('fianet')->__('Enchères professionnelles')),
|
245 |
+
array('value' => 61, 'label' => Mage::helper('fianet')->__('Formation')),
|
246 |
+
array('value' => 62, 'label' => Mage::helper('fianet')->__('Fournitures & Mobiliers')),
|
247 |
+
array('value' => 63, 'label' => Mage::helper('fianet')->__('Prestataires Internet')),
|
248 |
+
array('value' => 64, 'label' => Mage::helper('fianet')->__('Produits agricoles')),
|
249 |
+
array('value' => 172, 'label' => Mage::helper('fianet')->__('Information juridique'))
|
250 |
+
),
|
251 |
+
array('theme' => Mage::helper('fianet')->__('Sport'),
|
252 |
+
array('value' => 65, 'label' => Mage::helper('fianet')->__('Evènements')),
|
253 |
+
array('value' => 66, 'label' => Mage::helper('fianet')->__('Matériel')),
|
254 |
+
array('value' => 67, 'label' => Mage::helper('fianet')->__('Diététique')),
|
255 |
+
array('value' => 68, 'label' => Mage::helper('fianet')->__('Vêtements')),
|
256 |
+
array('value' => 182, 'label' => Mage::helper('fianet')->__('Chaussures')),
|
257 |
+
array('value' => 247, 'label' => Mage::helper('fianet')->__('Fitness & Diététique')),
|
258 |
+
array('value' => 279, 'label' => Mage::helper('fianet')->__('Ski'))
|
259 |
+
),
|
260 |
+
array('theme' => Mage::helper('fianet')->__('Téléphonie & Communication'),
|
261 |
+
array('value' => 127, 'label' => Mage::helper('fianet')->__('Accessoires')),
|
262 |
+
array('value' => 128, 'label' => Mage::helper('fianet')->__('Téléphones fixes')),
|
263 |
+
array('value' => 129, 'label' => Mage::helper('fianet')->__('Téléphones mobiles')),
|
264 |
+
array('value' => 130, 'label' => Mage::helper('fianet')->__('Fax')),
|
265 |
+
array('value' => 160, 'label' => Mage::helper('fianet')->__('Abonnements')),
|
266 |
+
array('value' => 178, 'label' => Mage::helper('fianet')->__('Achat de minutes')),
|
267 |
+
array('value' => 230, 'label' => Mage::helper('fianet')->__('Abonnements Internet & Téléphonique'))
|
268 |
+
),
|
269 |
+
array('theme' => Mage::helper('fianet')->__('Ventes privées'),
|
270 |
+
array('value' => 274, 'label' => Mage::helper('fianet')->__('Ventes privées'))
|
271 |
+
),
|
272 |
+
array('theme' => Mage::helper('fianet')->__('Vétements & Accessoires'),
|
273 |
+
array('value' => 69, 'label' => Mage::helper('fianet')->__('Accessoires')),
|
274 |
+
array('value' => 70, 'label' => Mage::helper('fianet')->__('Bijoux')),
|
275 |
+
array('value' => 71, 'label' => Mage::helper('fianet')->__('Chaussures')),
|
276 |
+
array('value' => 72, 'label' => Mage::helper('fianet')->__('Lingerie')),
|
277 |
+
array('value' => 73, 'label' => Mage::helper('fianet')->__('Maroquinerie')),
|
278 |
+
array('value' => 74, 'label' => Mage::helper('fianet')->__('Mode enfants')),
|
279 |
+
array('value' => 75, 'label' => Mage::helper('fianet')->__('Mode femme')),
|
280 |
+
array('value' => 76, 'label' => Mage::helper('fianet')->__('Mode homme')),
|
281 |
+
array('value' => 77, 'label' => Mage::helper('fianet')->__('Montres')),
|
282 |
+
array('value' => 126, 'label' => Mage::helper('fianet')->__('Bagagerie')),
|
283 |
+
array('value' => 164, 'label' => Mage::helper('fianet')->__('Lunettes')),
|
284 |
+
array('value' => 190, 'label' => Mage::helper('fianet')->__('Vêtement femme enceinte')),
|
285 |
+
array('value' => 191, 'label' => Mage::helper('fianet')->__('Jeans')),
|
286 |
+
array('value' => 192, 'label' => Mage::helper('fianet')->__('Mode bébés & Enfants')),
|
287 |
+
array('value' => 193, 'label' => Mage::helper('fianet')->__('Lunettes de soleil')),
|
288 |
+
array('value' => 194, 'label' => Mage::helper('fianet')->__('Accessoires de mode')),
|
289 |
+
array('value' => 195, 'label' => Mage::helper('fianet')->__('Bijoux & Montres')),
|
290 |
+
array('value' => 287, 'label' => Mage::helper('fianet')->__('Vente de produits dérivés d\'artistes')),
|
291 |
+
array('value' => 289, 'label' => Mage::helper('fianet')->__('Militaire'))
|
292 |
+
),
|
293 |
+
array('theme' => Mage::helper('fianet')->__('Vie pratique'),
|
294 |
+
array('value' => 49, 'label' => Mage::helper('fianet')->__('Actualités & Presse')),
|
295 |
+
array('value' => 50, 'label' => Mage::helper('fianet')->__('Assurance')),
|
296 |
+
array('value' => 51, 'label' => Mage::helper('fianet')->__('Banque & Finance')),
|
297 |
+
array('value' => 52, 'label' => Mage::helper('fianet')->__('Cartes & Plans')),
|
298 |
+
array('value' => 53, 'label' => Mage::helper('fianet')->__('Galeries marchandes')),
|
299 |
+
array('value' => 54, 'label' => Mage::helper('fianet')->__('Fournitures & Mobiliers')),
|
300 |
+
array('value' => 55, 'label' => Mage::helper('fianet')->__('Petites annonces')),
|
301 |
+
array('value' => 56, 'label' => Mage::helper('fianet')->__('Rencontres')),
|
302 |
+
array('value' => 57, 'label' => Mage::helper('fianet')->__('Science')),
|
303 |
+
array('value' => 58, 'label' => Mage::helper('fianet')->__('Animaux')),
|
304 |
+
array('value' => 162, 'label' => Mage::helper('fianet')->__('Tirages photos')),
|
305 |
+
array('value' => 165, 'label' => Mage::helper('fianet')->__('Immobilier')),
|
306 |
+
array('value' => 168, 'label' => Mage::helper('fianet')->__('Papeterie')),
|
307 |
+
array('value' => 171, 'label' => Mage::helper('fianet')->__('Information juridique')),
|
308 |
+
array('value' => 174, 'label' => Mage::helper('fianet')->__('Divers')),
|
309 |
+
array('value' => 180, 'label' => Mage::helper('fianet')->__('Armes')),
|
310 |
+
array('value' => 189, 'label' => Mage::helper('fianet')->__('Sécurité')),
|
311 |
+
array('value' => 226, 'label' => Mage::helper('fianet')->__('Mobilier d\'intérieur')),
|
312 |
+
array('value' => 250, 'label' => Mage::helper('fianet')->__('Faire-part & Cartes de voeux')),
|
313 |
+
array('value' => 251, 'label' => Mage::helper('fianet')->__('Imprimerie & Cartes de visite')),
|
314 |
+
array('value' => 252, 'label' => Mage::helper('fianet')->__('Sciences')),
|
315 |
+
array('value' => 282, 'label' => Mage::helper('fianet')->__('Code de la route'))
|
316 |
+
),
|
317 |
+
array('theme' => Mage::helper('fianet')->__('Voyage & Tourisme'),
|
318 |
+
array('value' => 131, 'label' => Mage::helper('fianet')->__('Billets d\'avion')),
|
319 |
+
array('value' => 132, 'label' => Mage::helper('fianet')->__('Location de voitures')),
|
320 |
+
array('value' => 133, 'label' => Mage::helper('fianet')->__('Hôtels')),
|
321 |
+
array('value' => 134, 'label' => Mage::helper('fianet')->__('Séjours')),
|
322 |
+
array('value' => 135, 'label' => Mage::helper('fianet')->__('Circuits')),
|
323 |
+
array('value' => 136, 'label' => Mage::helper('fianet')->__('Croisières')),
|
324 |
+
array('value' => 137, 'label' => Mage::helper('fianet')->__('Logements')),
|
325 |
+
array('value' => 138, 'label' => Mage::helper('fianet')->__('Week-ends')),
|
326 |
+
array('value' => 139, 'label' => Mage::helper('fianet')->__('Cartes & Guides')),
|
327 |
+
array('value' => 140, 'label' => Mage::helper('fianet')->__('Dernière minute')),
|
328 |
+
array('value' => 141, 'label' => Mage::helper('fianet')->__('Bagagerie'))
|
329 |
+
)
|
330 |
+
);
|
331 |
+
}
|
332 |
+
}
|
app/code/community/Fianet/Sceau/Model/Source/ShippingType.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Fianet_Sceau_Model_Source_ShippingType {
|
3 |
+
public function toOptionArray() {
|
4 |
+
return array(
|
5 |
+
array('value' => 1, 'label' => Mage::helper('fianet')->__('Retrait immédiat en magasin')),
|
6 |
+
array('value' => 2, 'label' => Mage::helper('fianet')->__('Retrait différé en magasin')),
|
7 |
+
array('value' => 3, 'label' => Mage::helper('fianet')->__('Livraison à domicile par transporteur')),
|
8 |
+
array('value' => 4, 'label' => Mage::helper('fianet')->__('Livraison par Colis Privé')),
|
9 |
+
array('value' => 5, 'label' => Mage::helper('fianet')->__('Livraison à domicile par magasin'))
|
10 |
+
);
|
11 |
+
}
|
12 |
+
}
|
app/code/community/Fianet/Sceau/controllers/Adminhtml/CategoriesController.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Fianet_Sceau_Adminhtml_CategoriesController extends Mage_Adminhtml_Controller_Action {
|
4 |
+
public function indexAction() {
|
5 |
+
$this->loadLayout();
|
6 |
+
$this->_setActiveMenu('adminfianet');
|
7 |
+
$this->getLayout()->getBlock('head')->setTitle(Mage::helper('fianet')->__('Categories type'));
|
8 |
+
$this->renderLayout();
|
9 |
+
}
|
10 |
+
|
11 |
+
public function postAction() {
|
12 |
+
$post = $this->getRequest()->getPost();
|
13 |
+
try {
|
14 |
+
if (empty($post)) {
|
15 |
+
Mage::throwException($this->__('Sceau: Invalid form data.'));
|
16 |
+
}
|
17 |
+
foreach ($post as $Code => $data) {
|
18 |
+
if (($data['categoryType'] && $data['productType']) && $Code != "form_key") {
|
19 |
+
var_dump($Code." : ".$data['categoryType']." - ".$data['productType']);
|
20 |
+
Mage::getModel('sceau/categories_association')
|
21 |
+
->load($Code)
|
22 |
+
->setEntityId($Code)
|
23 |
+
->setFianetSceauCategoryType($data['productType'])
|
24 |
+
->save();
|
25 |
+
}
|
26 |
+
}
|
27 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Data succesfully saved.'));
|
28 |
+
|
29 |
+
} catch (Exception $e) {
|
30 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
31 |
+
}
|
32 |
+
$this->_redirect('*/*');
|
33 |
+
}
|
34 |
+
}
|
app/code/community/Fianet/Sceau/controllers/Adminhtml/ProductsController.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Fianet_Sceau_Adminhtml_ProductsController extends Mage_Adminhtml_Controller_Action {
|
4 |
+
public function indexAction() {
|
5 |
+
$this->loadLayout();
|
6 |
+
$this->_setActiveMenu('adminfianet');
|
7 |
+
$this->getLayout()->getBlock('head')->setTitle(Mage::helper('fianet')->__('Products type'));
|
8 |
+
$this->renderLayout();
|
9 |
+
}
|
10 |
+
|
11 |
+
public function postAction() {
|
12 |
+
$post = $this->getRequest()->getPost();
|
13 |
+
try {
|
14 |
+
if (empty($post)) {
|
15 |
+
Mage::throwException($this->__('Sceau: Invalid form data.'));
|
16 |
+
}
|
17 |
+
|
18 |
+
foreach ($post as $Code => $data) {
|
19 |
+
if (trim($data['conveyorName']) != '') {
|
20 |
+
$shippingType = $data['shippingType'];
|
21 |
+
$deliveryTimes = $data['deliveryTimes'];
|
22 |
+
$conveyorName = $data['conveyorName'];
|
23 |
+
Mage::getModel('fianet/shipping_association')
|
24 |
+
->load($Code)
|
25 |
+
->setShippingCode($Code)
|
26 |
+
->setFianetShippingType($shippingType)
|
27 |
+
->setDeliveryTimes($deliveryTimes)
|
28 |
+
->setConveyorName($conveyorName)
|
29 |
+
->save();
|
30 |
+
}
|
31 |
+
}
|
32 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Data succesfully saved.'));
|
33 |
+
} catch (Exception $e) {
|
34 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
35 |
+
}
|
36 |
+
$this->_redirect('*/*');
|
37 |
+
}
|
38 |
+
}
|
app/code/community/Fianet/Sceau/controllers/Adminhtml/ShippingController.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Fianet_Sceau_Adminhtml_ShippingController extends Mage_Adminhtml_Controller_Action {
|
4 |
+
public function indexAction() {
|
5 |
+
$this->loadLayout();
|
6 |
+
$this->_setActiveMenu('adminfianet');
|
7 |
+
$this->getLayout()->getBlock('head')->setTitle(Mage::helper('fianet')->__('Shipping type'));
|
8 |
+
$this->renderLayout();
|
9 |
+
}
|
10 |
+
|
11 |
+
public function postAction() {
|
12 |
+
$post = $this->getRequest()->getPost();
|
13 |
+
try {
|
14 |
+
if (empty($post)) {
|
15 |
+
Mage::throwException($this->__('Sceau: Invalid form data.'));
|
16 |
+
}
|
17 |
+
|
18 |
+
foreach ($post as $Code => $data) {
|
19 |
+
|
20 |
+
if ($data['shippingType'] && $Code != "form_key") {
|
21 |
+
Mage::getModel('sceau/shipping_association')
|
22 |
+
->load($Code)
|
23 |
+
->setShippingCode($Code)
|
24 |
+
->setFianetSceauShippingType($data['shippingType'])
|
25 |
+
->save();
|
26 |
+
}
|
27 |
+
}
|
28 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Data succesfully saved.'));
|
29 |
+
} catch (Exception $e) {
|
30 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
31 |
+
}
|
32 |
+
$this->_redirect('*/*');
|
33 |
+
}
|
34 |
+
}
|
app/code/community/Fianet/Sceau/controllers/IndexController.php
CHANGED
@@ -1,52 +1,37 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class Fianet_Sceau_IndexController extends Mage_Adminhtml_Controller_Action
|
4 |
-
{
|
5 |
-
|
6 |
-
|
7 |
-
{
|
8 |
-
$params = Mage::app()->getRequest()->getParams();
|
9 |
-
$orderIds = $params[$params['massaction_prepare_key']];
|
10 |
|
11 |
-
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
$successMsg .= "\n<br />- Commande n° " . $order->getIncrementId();
|
28 |
-
}
|
29 |
-
}
|
30 |
-
if ($successMsg != '')
|
31 |
-
{
|
32 |
-
$successMsg = 'Commande envoyées à FIA-NET :' . $successMsg;
|
33 |
-
Mage::getSingleton('adminhtml/session')->addSuccess($successMsg);
|
34 |
-
}
|
35 |
-
$order->save();
|
36 |
$this->_redirect('adminhtml/sales_order/index');
|
37 |
}
|
38 |
|
39 |
-
protected function _canSendOrder(Mage_Sales_Model_Order $order)
|
40 |
-
|
41 |
-
|
42 |
-
{//si le module est désactivé
|
43 |
return false;
|
44 |
}
|
45 |
-
else if (Mage::Helper('fianet_sceau/Data')->isOrderAlreadySent($order))
|
46 |
-
|
47 |
return false;
|
48 |
}
|
49 |
return true;
|
50 |
}
|
51 |
-
|
52 |
}
|
1 |
<?php
|
2 |
|
3 |
+
class Fianet_Sceau_IndexController extends Mage_Adminhtml_Controller_Action {
|
4 |
+
public function massAction() {
|
5 |
+
$params = Mage::app()->getRequest()->getParams();
|
6 |
+
$orderIds = $params[$params['massaction_prepare_key']];
|
|
|
|
|
|
|
7 |
|
8 |
+
$successMsg = '';
|
9 |
|
10 |
+
foreach ($orderIds as $orderId) {
|
11 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
12 |
+
|
13 |
+
if ( $this->_canSendOrder($order) && Mage::Helper('fianet_sceau/Data')->processOrderToFianet($order)) {
|
14 |
+
Mage::getModel('fianet/log')->Log(Mage::helper('fianet')->__('Sceau: order #%s sent.', $order->getIncrementId()));
|
15 |
+
$successMsg .= "\n<br />- Commande #" . $order->getIncrementId();
|
16 |
+
}
|
17 |
+
$order->save();
|
18 |
+
}
|
19 |
+
if ($successMsg != '') {
|
20 |
+
$successMsg = 'Commande(s) envoyée(s) à FIA-NET :' . $successMsg;
|
21 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($successMsg);
|
22 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
$this->_redirect('adminhtml/sales_order/index');
|
24 |
}
|
25 |
|
26 |
+
protected function _canSendOrder(Mage_Sales_Model_Order $order) {
|
27 |
+
if (!Mage::Helper('fianet_sceau/Data')->isModuleActive($order)) {//si le module est désactivé
|
28 |
+
Mage::getModel('fianet/log')->Log(Mage::helper('fianet')->__('Sceau: module disabled, order #%s not sent.', $order->getIncrementId()));
|
|
|
29 |
return false;
|
30 |
}
|
31 |
+
else if (Mage::Helper('fianet_sceau/Data')->isOrderAlreadySent($order)) {//Si la commande a déjà été envoyée
|
32 |
+
Mage::getModel('fianet/log')->Log(Mage::helper('fianet')->__('Sceau: order #%s already sent.', $order->getIncrementId()));
|
33 |
return false;
|
34 |
}
|
35 |
return true;
|
36 |
}
|
|
|
37 |
}
|
app/code/community/Fianet/Sceau/etc/adminhtml.xml
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<config>
|
2 |
+
<menu>
|
3 |
+
<adminfianet module="fianet" translate="title">
|
4 |
+
<children>
|
5 |
+
<sceauconfig module="fianet_sceau" translate="title">
|
6 |
+
<title>Sceau de Confiance</title>
|
7 |
+
<sort_order>10</sort_order>
|
8 |
+
<children>
|
9 |
+
<sceaucategorytype translate="title" module="fianet_sceau">
|
10 |
+
<title>Product types: global configuration by category</title>
|
11 |
+
<sort_order>10</sort_order>
|
12 |
+
<action>sceau/adminhtml_categories</action>
|
13 |
+
</sceaucategorytype>
|
14 |
+
<!--<sceauproducttype translate="title" module="fianet_sceau">
|
15 |
+
<title>Product types: personalized configuration for each product</title>
|
16 |
+
<sort_order>20</sort_order>
|
17 |
+
<action>sceau/adminhtml_products</action>
|
18 |
+
</sceauproducttype>-->
|
19 |
+
<sceaushippingtype translate="title" module="fianet_sceau">
|
20 |
+
<title>Shipping types configuration</title>
|
21 |
+
<sort_order>30</sort_order>
|
22 |
+
<action>sceau/adminhtml_shipping</action>
|
23 |
+
</sceaushippingtype>
|
24 |
+
</children>
|
25 |
+
</sceauconfig>
|
26 |
+
</children>
|
27 |
+
</adminfianet>
|
28 |
+
</menu>
|
29 |
+
<acl>
|
30 |
+
<resources>
|
31 |
+
<all>
|
32 |
+
<title>Allow Everything</title>
|
33 |
+
</all>
|
34 |
+
<admin>
|
35 |
+
<children>
|
36 |
+
<system>
|
37 |
+
<children>
|
38 |
+
<config>
|
39 |
+
<children>
|
40 |
+
<sceau translate="title">
|
41 |
+
<title>Sceau de Confiance Section</title>
|
42 |
+
<sort_order>101</sort_order>
|
43 |
+
</sceau>
|
44 |
+
</children>
|
45 |
+
</config>
|
46 |
+
</children>
|
47 |
+
</system>
|
48 |
+
</children>
|
49 |
+
<children>
|
50 |
+
<adminfianet>
|
51 |
+
<children>
|
52 |
+
<sceauconfig>
|
53 |
+
<title>Sceau de Confiance</title>
|
54 |
+
<sort_order>10</sort_order>
|
55 |
+
<children>
|
56 |
+
<sceaucategorytype>
|
57 |
+
<title>Product types: global configuration by category</title>
|
58 |
+
<sort_order>10</sort_order>
|
59 |
+
</sceaucategorytype>
|
60 |
+
<!--<sceauproducttype>
|
61 |
+
<title>Product types: personalized configuration for each product</title>
|
62 |
+
<sort_order>20</sort_order>
|
63 |
+
</sceauproducttype>-->
|
64 |
+
<sceaushippingtype>
|
65 |
+
<title>Shipping types configuration</title>
|
66 |
+
<sort_order>30</sort_order>
|
67 |
+
</sceaushippingtype>
|
68 |
+
</children>
|
69 |
+
</sceauconfig>
|
70 |
+
</children>
|
71 |
+
</adminfianet>
|
72 |
+
</children>
|
73 |
+
</admin>
|
74 |
+
</resources>
|
75 |
+
</acl>
|
76 |
+
</config>
|
app/code/community/Fianet/Sceau/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Fianet_Sceau>
|
5 |
-
<version>1.0.
|
6 |
</Fianet_Sceau>
|
7 |
</modules>
|
8 |
<global>
|
@@ -17,9 +17,19 @@
|
|
17 |
</fianet_sceau>
|
18 |
</helpers>
|
19 |
<models>
|
|
|
|
|
|
|
|
|
20 |
<fianet_sceau_mysql4>
|
21 |
<class>Fianet_Sceau_Model_Mysql4</class>
|
22 |
<entities>
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
</entities>
|
24 |
</fianet_sceau_mysql4>
|
25 |
</models>
|
@@ -28,7 +38,7 @@
|
|
28 |
<fianet_sceau_setup>
|
29 |
<setup>
|
30 |
<module>Fianet_Sceau</module>
|
31 |
-
<class>
|
32 |
</setup>
|
33 |
<connection>
|
34 |
<use>core_setup</use>
|
@@ -113,33 +123,13 @@
|
|
113 |
</Fianet_Sceau>
|
114 |
</modules>
|
115 |
</translate>
|
116 |
-
|
117 |
-
|
118 |
-
<
|
119 |
-
<
|
120 |
-
</
|
121 |
-
|
122 |
-
|
123 |
-
<sceauconfig>
|
124 |
-
<title>Sceau</title>
|
125 |
-
<sort_order>190</sort_order>
|
126 |
-
</sceauconfig>
|
127 |
-
<system>
|
128 |
-
<children>
|
129 |
-
<config>
|
130 |
-
<children>
|
131 |
-
<sceau translate="title">
|
132 |
-
<title>sceau Section</title>
|
133 |
-
<sort_order>100</sort_order>
|
134 |
-
</sceau>
|
135 |
-
</children>
|
136 |
-
</config>
|
137 |
-
</children>
|
138 |
-
</system>
|
139 |
-
</children>
|
140 |
-
</admin>
|
141 |
-
</resources>
|
142 |
-
</acl>
|
143 |
</adminhtml>
|
144 |
<frontend>
|
145 |
<layout>
|
@@ -150,7 +140,7 @@
|
|
150 |
</updates>
|
151 |
</layout>
|
152 |
<routers>
|
153 |
-
|
154 |
</frontend>
|
155 |
<admin>
|
156 |
<routers>
|
@@ -163,6 +153,4 @@
|
|
163 |
</fianetsceau>
|
164 |
</routers>
|
165 |
</admin>
|
166 |
-
|
167 |
-
|
168 |
</config>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Fianet_Sceau>
|
5 |
+
<version>1.0.4</version>
|
6 |
</Fianet_Sceau>
|
7 |
</modules>
|
8 |
<global>
|
17 |
</fianet_sceau>
|
18 |
</helpers>
|
19 |
<models>
|
20 |
+
<sceau>
|
21 |
+
<class>Fianet_Sceau_Model</class>
|
22 |
+
<resourceModel>fianet_sceau_mysql4</resourceModel>
|
23 |
+
</sceau>
|
24 |
<fianet_sceau_mysql4>
|
25 |
<class>Fianet_Sceau_Model_Mysql4</class>
|
26 |
<entities>
|
27 |
+
<shipping_association>
|
28 |
+
<table>fianet_sceau_shipping_association</table>
|
29 |
+
</shipping_association>
|
30 |
+
<categories_association>
|
31 |
+
<table>fianet_sceau_catProducts_association</table>
|
32 |
+
</categories_association>
|
33 |
</entities>
|
34 |
</fianet_sceau_mysql4>
|
35 |
</models>
|
38 |
<fianet_sceau_setup>
|
39 |
<setup>
|
40 |
<module>Fianet_Sceau</module>
|
41 |
+
<class>Mage_Sales_Model_Mysql4_Setup</class>
|
42 |
</setup>
|
43 |
<connection>
|
44 |
<use>core_setup</use>
|
123 |
</Fianet_Sceau>
|
124 |
</modules>
|
125 |
</translate>
|
126 |
+
<layout>
|
127 |
+
<updates>
|
128 |
+
<fianet_sceau>
|
129 |
+
<file>fianet_sceau.xml</file>
|
130 |
+
</fianet_sceau>
|
131 |
+
</updates>
|
132 |
+
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
</adminhtml>
|
134 |
<frontend>
|
135 |
<layout>
|
140 |
</updates>
|
141 |
</layout>
|
142 |
<routers>
|
143 |
+
</routers>
|
144 |
</frontend>
|
145 |
<admin>
|
146 |
<routers>
|
153 |
</fianetsceau>
|
154 |
</routers>
|
155 |
</admin>
|
|
|
|
|
156 |
</config>
|
app/code/community/Fianet/Sceau/etc/system.xml
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
<sceauconfg translate="label">
|
14 |
<label>General configuration</label>
|
15 |
<frontend_type>text</frontend_type>
|
16 |
-
<comment><![CDATA[<b><a href="https://www.fia-net.com/__extranet/" target="_blank" style="color: #EA7601;">
|
17 |
<sort_order>1</sort_order>
|
18 |
<show_in_default>1</show_in_default>
|
19 |
<show_in_website>1</show_in_website>
|
@@ -40,180 +40,177 @@
|
|
40 |
<show_in_store>1</show_in_store>
|
41 |
</mode>
|
42 |
<siteid translate="label comment">
|
43 |
-
<label>
|
44 |
<frontend_type>text</frontend_type>
|
45 |
<sort_order>3</sort_order>
|
46 |
<show_in_default>1</show_in_default>
|
47 |
<show_in_website>1</show_in_website>
|
48 |
<show_in_store>1</show_in_store>
|
49 |
-
<comment>Correspond à votre
|
50 |
</siteid>
|
51 |
<login translate="label">
|
52 |
-
<label>Login
|
53 |
<frontend_type>text</frontend_type>
|
54 |
-
<sort_order>
|
55 |
<show_in_default>1</show_in_default>
|
56 |
<show_in_website>1</show_in_website>
|
57 |
<show_in_store>1</show_in_store>
|
58 |
</login>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
<private_key translate="label comment">
|
60 |
-
<label>
|
61 |
<frontend_type>text</frontend_type>
|
62 |
-
<sort_order>
|
63 |
<show_in_default>1</show_in_default>
|
64 |
<show_in_website>1</show_in_website>
|
65 |
<show_in_store>1</show_in_store>
|
66 |
</private_key>
|
67 |
-
<
|
68 |
-
<label>
|
69 |
-
<frontend_type>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
<sort_order>5</sort_order>
|
71 |
<show_in_default>1</show_in_default>
|
72 |
<show_in_website>1</show_in_website>
|
73 |
<show_in_store>1</show_in_store>
|
74 |
-
</
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
<
|
94 |
-
|
95 |
-
<
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
</
|
104 |
-
<
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
<frontend_type>select</frontend_type>
|
116 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
117 |
-
<sort_order>3</sort_order>
|
118 |
-
<show_in_default>1</show_in_default>
|
119 |
-
<show_in_website>1</show_in_website>
|
120 |
-
<show_in_store>1</show_in_store>
|
121 |
-
</footer_position>
|
122 |
-
|
123 |
-
<widgettransparent translate="label">
|
124 |
-
<label>widgettransparent</label>
|
125 |
-
<frontend_type>select</frontend_type>
|
126 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
127 |
-
<sort_order>4</sort_order>
|
128 |
-
<show_in_default>1</show_in_default>
|
129 |
-
<show_in_website>1</show_in_website>
|
130 |
-
<show_in_store>1</show_in_store>
|
131 |
-
</widgettransparent>
|
132 |
-
<commentaires translate="label">
|
133 |
-
<label>Activer les commentaires</label>
|
134 |
-
<frontend_type>select</frontend_type>
|
135 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
136 |
-
<sort_order>5</sort_order>
|
137 |
-
<show_in_default>1</show_in_default>
|
138 |
-
<show_in_website>1</show_in_website>
|
139 |
-
<show_in_store>1</show_in_store>
|
140 |
-
</commentaires>
|
141 |
-
</fields>
|
142 |
-
</widgetconf>
|
143 |
-
<logoconf translate="label">
|
144 |
-
<label>Logo configuration</label>
|
145 |
-
<frontend_type>text</frontend_type>
|
146 |
-
<sort_order>2</sort_order>
|
147 |
-
<show_in_default>1</show_in_default>
|
148 |
-
<show_in_website>1</show_in_website>
|
149 |
-
<show_in_store>1</show_in_store>
|
150 |
-
<fields>
|
151 |
-
<logo_left_position translate="label">
|
152 |
-
<label>logo left position</label>
|
153 |
-
<frontend_type>select</frontend_type>
|
154 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
155 |
-
<sort_order>1</sort_order>
|
156 |
-
<show_in_default>1</show_in_default>
|
157 |
-
<show_in_website>1</show_in_website>
|
158 |
-
<show_in_store>1</show_in_store>
|
159 |
-
</logo_left_position>
|
160 |
-
<logo_right_position translate="label">
|
161 |
-
<label>logo right position</label>
|
162 |
-
<frontend_type>select</frontend_type>
|
163 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
164 |
-
<sort_order>2</sort_order>
|
165 |
-
<show_in_default>1</show_in_default>
|
166 |
-
<show_in_website>1</show_in_website>
|
167 |
-
<show_in_store>1</show_in_store>
|
168 |
-
</logo_right_position>
|
169 |
-
<logo_footer_position translate="label">
|
170 |
-
<label>logo footer position</label>
|
171 |
-
<frontend_type>select</frontend_type>
|
172 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
173 |
-
<sort_order>3</sort_order>
|
174 |
-
<show_in_default>1</show_in_default>
|
175 |
-
<show_in_website>1</show_in_website>
|
176 |
-
<show_in_store>1</show_in_store>
|
177 |
-
</logo_footer_position>
|
178 |
-
</fields>
|
179 |
-
</logoconf>
|
180 |
-
|
181 |
-
<sceaulinks translate="label">
|
182 |
-
<label>links</label>
|
183 |
-
<frontend_type>text</frontend_type>
|
184 |
-
<sort_order>3</sort_order>
|
185 |
-
<show_in_default>1</show_in_default>
|
186 |
-
<show_in_website>1</show_in_website>
|
187 |
-
<show_in_store>1</show_in_store>
|
188 |
-
<fields>
|
189 |
-
<fianet_url translate="label comment">
|
190 |
-
<label>fianet_url</label>
|
191 |
-
<frontend_type>text</frontend_type>
|
192 |
-
<sort_order>1</sort_order>
|
193 |
-
<show_in_default>1</show_in_default>
|
194 |
-
<show_in_website>0</show_in_website>
|
195 |
-
<show_in_store>0</show_in_store>
|
196 |
-
</fianet_url>
|
197 |
-
<prod_send_url translate="label comment">
|
198 |
-
<label>prod_send_url</label>
|
199 |
-
<frontend_type>text</frontend_type>
|
200 |
-
<sort_order>3</sort_order>
|
201 |
-
<show_in_default>1</show_in_default>
|
202 |
-
<show_in_website>0</show_in_website>
|
203 |
-
<show_in_store>0</show_in_store>
|
204 |
-
</prod_send_url>
|
205 |
-
<test_send_url translate="label comment">
|
206 |
-
<label>test_send_url</label>
|
207 |
-
<frontend_type>text</frontend_type>
|
208 |
-
<sort_order>2</sort_order>
|
209 |
-
<show_in_default>1</show_in_default>
|
210 |
-
<show_in_website>0</show_in_website>
|
211 |
-
<show_in_store>0</show_in_store>
|
212 |
-
</test_send_url>
|
213 |
-
</fields>
|
214 |
-
</sceaulinks>
|
215 |
-
|
216 |
-
</groups>
|
217 |
-
</sceau>
|
218 |
-
</sections>
|
219 |
-
</config>
|
13 |
<sceauconfg translate="label">
|
14 |
<label>General configuration</label>
|
15 |
<frontend_type>text</frontend_type>
|
16 |
+
<comment><![CDATA[<b><a href="https://www.fia-net.com/__extranet/" target="_blank" style="color: #EA7601;">Accéder à votre Extranet Sceau de Confiance</a></b>]]></comment>
|
17 |
<sort_order>1</sort_order>
|
18 |
<show_in_default>1</show_in_default>
|
19 |
<show_in_website>1</show_in_website>
|
40 |
<show_in_store>1</show_in_store>
|
41 |
</mode>
|
42 |
<siteid translate="label comment">
|
43 |
+
<label>Site ID</label>
|
44 |
<frontend_type>text</frontend_type>
|
45 |
<sort_order>3</sort_order>
|
46 |
<show_in_default>1</show_in_default>
|
47 |
<show_in_website>1</show_in_website>
|
48 |
<show_in_store>1</show_in_store>
|
49 |
+
<comment>Correspond à votre identifiant marchand FIA-NET</comment>
|
50 |
</siteid>
|
51 |
<login translate="label">
|
52 |
+
<label>Login</label>
|
53 |
<frontend_type>text</frontend_type>
|
54 |
+
<sort_order>4</sort_order>
|
55 |
<show_in_default>1</show_in_default>
|
56 |
<show_in_website>1</show_in_website>
|
57 |
<show_in_store>1</show_in_store>
|
58 |
</login>
|
59 |
+
<password translate="label comment">
|
60 |
+
<label>Password</label>
|
61 |
+
<frontend_type>text</frontend_type>
|
62 |
+
<sort_order>5</sort_order>
|
63 |
+
<show_in_default>1</show_in_default>
|
64 |
+
<show_in_website>1</show_in_website>
|
65 |
+
<show_in_store>1</show_in_store>
|
66 |
+
</password>
|
67 |
<private_key translate="label comment">
|
68 |
+
<label>Private key</label>
|
69 |
<frontend_type>text</frontend_type>
|
70 |
+
<sort_order>6</sort_order>
|
71 |
<show_in_default>1</show_in_default>
|
72 |
<show_in_website>1</show_in_website>
|
73 |
<show_in_store>1</show_in_store>
|
74 |
</private_key>
|
75 |
+
<orderstatuses translate="label comment">
|
76 |
+
<label>Automatic sending orders</label>
|
77 |
+
<frontend_type>multiselect</frontend_type>
|
78 |
+
<source_model>fianet_sceau_model_source_status</source_model>
|
79 |
+
<sort_order>7</sort_order>
|
80 |
+
<show_in_default>1</show_in_default>
|
81 |
+
<show_in_website>0</show_in_website>
|
82 |
+
<show_in_store>0</show_in_store>
|
83 |
+
<comment>Select the status for which the transaction will be sent to Sceau de Confiance system (multiple selections possible)</comment>
|
84 |
+
</orderstatuses>
|
85 |
+
</fields>
|
86 |
+
</sceauconfg>
|
87 |
+
<logoconf translate="label">
|
88 |
+
<label>Logo configuration</label>
|
89 |
+
<frontend_type>text</frontend_type>
|
90 |
+
<sort_order>2</sort_order>
|
91 |
+
<show_in_default>1</show_in_default>
|
92 |
+
<show_in_website>1</show_in_website>
|
93 |
+
<show_in_store>1</show_in_store>
|
94 |
+
<fields>
|
95 |
+
<logo_left_position translate="label">
|
96 |
+
<label>Display in left position</label>
|
97 |
+
<frontend_type>select</frontend_type>
|
98 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
99 |
+
<sort_order>1</sort_order>
|
100 |
+
<show_in_default>1</show_in_default>
|
101 |
+
<show_in_website>1</show_in_website>
|
102 |
+
<show_in_store>1</show_in_store>
|
103 |
+
</logo_left_position>
|
104 |
+
<logo_right_position translate="label">
|
105 |
+
<label>Display in right position</label>
|
106 |
+
<frontend_type>select</frontend_type>
|
107 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
108 |
+
<sort_order>2</sort_order>
|
109 |
+
<show_in_default>1</show_in_default>
|
110 |
+
<show_in_website>1</show_in_website>
|
111 |
+
<show_in_store>1</show_in_store>
|
112 |
+
</logo_right_position>
|
113 |
+
<logo_footer_position translate="label">
|
114 |
+
<label>Display in footer position</label>
|
115 |
+
<frontend_type>select</frontend_type>
|
116 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
117 |
+
<sort_order>3</sort_order>
|
118 |
+
<show_in_default>1</show_in_default>
|
119 |
+
<show_in_website>1</show_in_website>
|
120 |
+
<show_in_store>1</show_in_store>
|
121 |
+
</logo_footer_position>
|
122 |
+
</fields>
|
123 |
+
</logoconf>
|
124 |
+
<widgetconf translate="label">
|
125 |
+
<label>Widget configuration</label>
|
126 |
+
<frontend_type>text</frontend_type>
|
127 |
+
<sort_order>3</sort_order>
|
128 |
+
<show_in_default>1</show_in_default>
|
129 |
+
<show_in_website>1</show_in_website>
|
130 |
+
<show_in_store>1</show_in_store>
|
131 |
+
<fields>
|
132 |
+
<left_position translate="label">
|
133 |
+
<label>Display in left position</label>
|
134 |
+
<frontend_type>select</frontend_type>
|
135 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
136 |
+
<sort_order>1</sort_order>
|
137 |
+
<show_in_default>1</show_in_default>
|
138 |
+
<show_in_website>1</show_in_website>
|
139 |
+
<show_in_store>1</show_in_store>
|
140 |
+
</left_position>
|
141 |
+
<right_position translate="label">
|
142 |
+
<label>Display in right position</label>
|
143 |
+
<frontend_type>select</frontend_type>
|
144 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
145 |
+
<sort_order>2</sort_order>
|
146 |
+
<show_in_default>1</show_in_default>
|
147 |
+
<show_in_website>1</show_in_website>
|
148 |
+
<show_in_store>1</show_in_store>
|
149 |
+
</right_position>
|
150 |
+
<footer_position translate="label">
|
151 |
+
<label>Display in footer position</label>
|
152 |
+
<frontend_type>select</frontend_type>
|
153 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
154 |
+
<sort_order>3</sort_order>
|
155 |
+
<show_in_default>1</show_in_default>
|
156 |
+
<show_in_website>1</show_in_website>
|
157 |
+
<show_in_store>1</show_in_store>
|
158 |
+
</footer_position>
|
159 |
+
<widgettransparent translate="label">
|
160 |
+
<label>widget transparent</label>
|
161 |
+
<frontend_type>select</frontend_type>
|
162 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
163 |
+
<sort_order>4</sort_order>
|
164 |
+
<show_in_default>1</show_in_default>
|
165 |
+
<show_in_website>1</show_in_website>
|
166 |
+
<show_in_store>1</show_in_store>
|
167 |
+
</widgettransparent>
|
168 |
+
<commentaires translate="label">
|
169 |
+
<label>Enable comments</label>
|
170 |
+
<frontend_type>select</frontend_type>
|
171 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
172 |
<sort_order>5</sort_order>
|
173 |
<show_in_default>1</show_in_default>
|
174 |
<show_in_website>1</show_in_website>
|
175 |
<show_in_store>1</show_in_store>
|
176 |
+
</commentaires>
|
177 |
+
</fields>
|
178 |
+
</widgetconf>
|
179 |
+
<sceaulinks translate="label">
|
180 |
+
<label>Links</label>
|
181 |
+
<frontend_type>text</frontend_type>
|
182 |
+
<sort_order>4</sort_order>
|
183 |
+
<show_in_default>1</show_in_default>
|
184 |
+
<show_in_website>1</show_in_website>
|
185 |
+
<show_in_store>1</show_in_store>
|
186 |
+
<fields>
|
187 |
+
<fianet_url translate="label comment">
|
188 |
+
<label>FIA-NET URL</label>
|
189 |
+
<frontend_type>text</frontend_type>
|
190 |
+
<sort_order>1</sort_order>
|
191 |
+
<show_in_default>1</show_in_default>
|
192 |
+
<show_in_website>0</show_in_website>
|
193 |
+
<show_in_store>0</show_in_store>
|
194 |
+
</fianet_url>
|
195 |
+
<test_send_url translate="label comment">
|
196 |
+
<label>[TEST] Sending script's orders</label>
|
197 |
+
<frontend_type>text</frontend_type>
|
198 |
+
<sort_order>2</sort_order>
|
199 |
+
<show_in_default>1</show_in_default>
|
200 |
+
<show_in_website>0</show_in_website>
|
201 |
+
<show_in_store>0</show_in_store>
|
202 |
+
</test_send_url>
|
203 |
+
<prod_send_url translate="label comment">
|
204 |
+
<label>[PROD] Sending script's orders</label>
|
205 |
+
<frontend_type>text</frontend_type>
|
206 |
+
<sort_order>3</sort_order>
|
207 |
+
<show_in_default>1</show_in_default>
|
208 |
+
<show_in_website>0</show_in_website>
|
209 |
+
<show_in_store>0</show_in_store>
|
210 |
+
</prod_send_url>
|
211 |
+
</fields>
|
212 |
+
</sceaulinks>
|
213 |
+
</groups>
|
214 |
+
</sceau>
|
215 |
+
</sections>
|
216 |
+
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Fianet/Sceau/sql/fianet_sceau_setup/mysql4-install-1.0.0.php
CHANGED
@@ -1,18 +1,15 @@
|
|
1 |
<?php
|
2 |
$installer = $this;
|
3 |
|
4 |
-
|
5 |
$installer->startSetup();
|
6 |
-
|
7 |
$installer->addAttribute('order', 'fianet_sceau_order_sent_prod', array('type' => 'int', 'visible' => false, 'required' => true, 'default_value' => 0));
|
8 |
-
$installer->getConnection()->addColumn($installer->getTable('sales_flat_order_grid'), 'fianet_sceau_order_sent_prod', 'varchar(255) default 0');
|
9 |
-
|
10 |
-
|
11 |
$installer->addAttribute('order', 'fianet_sceau_order_sent_preprod', array('type' => 'int', 'visible' => false, 'required' => true, 'default_value' => 0));
|
12 |
-
$installer->getConnection()->addColumn($installer->getTable('sales_flat_order_grid'), 'fianet_sceau_order_sent_preprod', 'varchar(255) default 0');
|
13 |
-
|
14 |
$installer->addAttribute('order', 'fianet_sceau_order_sent_error', array('type' => 'int', 'visible' => false, 'required' => true, 'default_value' => 0));
|
15 |
-
$installer->getConnection()->addColumn($installer->getTable('sales_flat_order_grid'), 'fianet_sceau_order_sent_error', 'varchar(255) default 0');
|
16 |
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
-
$installer->endSetup();
|
1 |
<?php
|
2 |
$installer = $this;
|
3 |
|
|
|
4 |
$installer->startSetup();
|
|
|
5 |
$installer->addAttribute('order', 'fianet_sceau_order_sent_prod', array('type' => 'int', 'visible' => false, 'required' => true, 'default_value' => 0));
|
|
|
|
|
|
|
6 |
$installer->addAttribute('order', 'fianet_sceau_order_sent_preprod', array('type' => 'int', 'visible' => false, 'required' => true, 'default_value' => 0));
|
|
|
|
|
7 |
$installer->addAttribute('order', 'fianet_sceau_order_sent_error', array('type' => 'int', 'visible' => false, 'required' => true, 'default_value' => 0));
|
|
|
8 |
|
9 |
+
if (!(Mage::helper('fianet')->getMagentoVersion() < 140)) {
|
10 |
+
$installer->getConnection()->addColumn($installer->getTable('sales_flat_order_grid'), 'fianet_sceau_order_sent_prod', 'varchar(255) default 0');
|
11 |
+
$installer->getConnection()->addColumn($installer->getTable('sales_flat_order_grid'), 'fianet_sceau_order_sent_preprod', 'varchar(255) default 0');
|
12 |
+
$installer->getConnection()->addColumn($installer->getTable('sales_flat_order_grid'), 'fianet_sceau_order_sent_error', 'varchar(255) default 0');
|
13 |
+
}
|
14 |
|
15 |
+
$installer->endSetup();
|
app/code/community/Fianet/Sceau/sql/fianet_sceau_setup/mysql4-upgrade-1.0.3-1.0.4.php
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
$installer->run("
|
1 |
INSERT IGNORE INTO `{$this->getTable('fianet_sceau_shipping_association')}` (`shipping_code`, `fianet_sceau_shipping_type`) VALUES
|
2 |
('{$code}', '3');
|
3 |
");
|
4 |
('{$categorie->entity_id}', '');
|
5 |
");
|
1 |
+
<?php
|
2 |
$installer->run("
|
3 |
INSERT IGNORE INTO `{$this->getTable('fianet_sceau_shipping_association')}` (`shipping_code`, `fianet_sceau_shipping_type`) VALUES
|
4 |
('{$code}', '3');
|
5 |
");
|
6 |
('{$categorie->entity_id}', '');
|
7 |
");
|
app/design/adminhtml/default/default/layout/fianet_sceau.xml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<layout>
|
3 |
+
<fianetsceau_adminhtml_shipping_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="fianet/adminhtml_fianetadmin" name="shipping_sceau" template="fianet_sceau/shipping.phtml"/>
|
6 |
+
</reference>
|
7 |
+
</fianetsceau_adminhtml_shipping_index>
|
8 |
+
<fianetsceau_adminhtml_categories_index>
|
9 |
+
<reference name="content">
|
10 |
+
<block type="fianet/adminhtml_fianetadmin" name="products_sceau" template="fianet_sceau/categories.phtml"/>
|
11 |
+
</reference>
|
12 |
+
</fianetsceau_adminhtml_categories_index>
|
13 |
+
</layout>
|
app/design/adminhtml/default/default/template/fianet_sceau/categories.phtml
ADDED
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
try {
|
3 |
+
$form_key = Mage::getSingleton('core/session')->getFormKey();
|
4 |
+
} catch (Exception $e) {
|
5 |
+
|
6 |
+
}
|
7 |
+
?>
|
8 |
+
<script type="text/javascript">
|
9 |
+
function loadSubCategories(select, id, ProductsType) {
|
10 |
+
var oSelect = document.getElementById(id+"[productType]"),
|
11 |
+
opts = oSelect.getElementsByTagName('option');
|
12 |
+
|
13 |
+
//r�initialisation du select sous-cat�gories
|
14 |
+
oSelect.style.display="none";
|
15 |
+
//nettoyage du select
|
16 |
+
while(opts[1]) {
|
17 |
+
oSelect.removeChild(opts[1]);
|
18 |
+
}
|
19 |
+
|
20 |
+
//Traitement si une cat�gorie est choisie
|
21 |
+
if(select.value != "0"){
|
22 |
+
oSelect.style.display="block";
|
23 |
+
for (i=0;i<ProductsType.length;i++) {
|
24 |
+
var count=0;
|
25 |
+
if (ProductsType[i].theme==select.value) {
|
26 |
+
for (var valeur in ProductsType[i]) {
|
27 |
+
count++;
|
28 |
+
}
|
29 |
+
}
|
30 |
+
for (j=0;j<count-1;j++) {
|
31 |
+
oSelect.options[oSelect.options.length] = new Option(ProductsType[i][j].label,ProductsType[i][j].value);
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}
|
35 |
+
}
|
36 |
+
</script>
|
37 |
+
<div class="content-header">
|
38 |
+
<table cellspacing="0" class="grid-header">
|
39 |
+
<tr>
|
40 |
+
<td><h3><?php echo $this->__('Categories configuration'); ?></h3></td>
|
41 |
+
<td class="a-right">
|
42 |
+
<button id="1021" type="button" class="scalable save" onclick="editForm.submit();" style=""><span><?php echo $this->__('Save'); ?></span></button>
|
43 |
+
</td>
|
44 |
+
</tr>
|
45 |
+
</table>
|
46 |
+
</div>
|
47 |
+
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Categories list'); ?></h4>
|
48 |
+
|
49 |
+
<div class="entry-edit">
|
50 |
+
<form id="edit_form" name="edit_form" method="post" action="<?php echo $this->getUrl('*/*/post'); ?>">
|
51 |
+
<?php
|
52 |
+
$ProductsType = Mage::getModel("sceau/source_ProductType")->toOptionArray();
|
53 |
+
$categories = Mage::getModel('catalog/category')->getCollection()
|
54 |
+
->addAttributeToSelect('name')
|
55 |
+
->addAttributeToSelect('url_key')
|
56 |
+
->addAttributeToSelect('my_attribute')
|
57 |
+
->setLoadProductCount(true)
|
58 |
+
->addAttributeToFilter('is_active',array('eq'=>true))
|
59 |
+
->load();
|
60 |
+
?>
|
61 |
+
<script type="text/javascript">
|
62 |
+
var chaine = <?php echo Mage::helper('core')->jsonEncode($ProductsType) ?>;
|
63 |
+
</script>
|
64 |
+
|
65 |
+
<?php
|
66 |
+
if (isset($form_key)) {
|
67 |
+
echo '<input type="hidden" name="form_key" value="' . $form_key . '" />';
|
68 |
+
}
|
69 |
+
?>
|
70 |
+
<fieldset id="my-fieldset">
|
71 |
+
<table cellspacing="0" class="form-list">
|
72 |
+
<tr>
|
73 |
+
<th><?php echo $this->__('Website Categories'); ?></th>
|
74 |
+
<th><?php echo $this->__('FIA-NET Categories'); ?></th>
|
75 |
+
</tr>
|
76 |
+
<?php
|
77 |
+
foreach ($categories as $categorie) {
|
78 |
+
$current_type = Mage::getModel('sceau/categories_association')->load($categorie->entity_id);
|
79 |
+
$current_theme = "";
|
80 |
+
|
81 |
+
$display = "display:none";
|
82 |
+
if ($current_type->fianet_sceau_category_type != 0) {
|
83 |
+
$display = "display:block";
|
84 |
+
}
|
85 |
+
echo '<tr>';
|
86 |
+
echo '<td class="label">' . $categorie->getName() . '</td>';
|
87 |
+
echo '<td class="input-ele"><select id="' . $categorie->entity_id . '[categoryType]" name="' . $categorie->entity_id . '[categoryType]" onchange="loadSubCategories(this, ' . $categorie->entity_id . ', chaine);">';
|
88 |
+
echo '<option value="0">-- Choix --</option>';
|
89 |
+
foreach ($ProductsType as $key => $category) {
|
90 |
+
$sel = '';
|
91 |
+
for ($i=0;$i<sizeof($category)-1;$i++) {
|
92 |
+
if($category[$i]['value'] == $current_type->fianet_sceau_category_type) {
|
93 |
+
$sel = ' selected';
|
94 |
+
$current_theme = $category['theme'];
|
95 |
+
}
|
96 |
+
}
|
97 |
+
echo '<option value="' . $category['theme'] . '"' . $sel . '>' . $category['theme'] . '</option>';
|
98 |
+
}
|
99 |
+
echo '</select></td>';
|
100 |
+
echo '<td class="input-ele" style="padding-left: 20px"><select id="' . $categorie->entity_id . '[productType]" name="' . $categorie->entity_id . '[productType]" style="' . $display . '">';
|
101 |
+
echo '<option value="0">-- Choix --</option>';
|
102 |
+
if ($current_theme != "") {
|
103 |
+
foreach ($ProductsType as $key => $category) {
|
104 |
+
if($category['theme'] == $current_theme) {
|
105 |
+
for ($i=0;$i<sizeof($category)-1;$i++) {
|
106 |
+
$sel = '';
|
107 |
+
if($category[$i]['value'] == $current_type->fianet_sceau_category_type)
|
108 |
+
$sel = ' selected';
|
109 |
+
echo '<option value="' . $category[$i]['value'] . '"' . $sel . '>' . $category[$i]['label'] . '</option>';
|
110 |
+
}
|
111 |
+
}
|
112 |
+
}
|
113 |
+
}
|
114 |
+
echo '</select></td>';
|
115 |
+
echo '</tr>';
|
116 |
+
}
|
117 |
+
?>
|
118 |
+
</table>
|
119 |
+
</fieldset>
|
120 |
+
</form>
|
121 |
+
</div>
|
122 |
+
<script type="text/javascript">
|
123 |
+
var editForm = new varienForm('edit_form', '');
|
124 |
+
</script>
|
app/design/adminhtml/default/default/template/fianet_sceau/products.phtml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
try {
|
3 |
+
$form_key = Mage::getSingleton('core/session')->getFormKey();
|
4 |
+
} catch (Exception $e) {
|
5 |
+
|
6 |
+
}
|
7 |
+
?>
|
8 |
+
<div class="content-header">
|
9 |
+
<table cellspacing="0" class="grid-header">
|
10 |
+
<tr>
|
11 |
+
<td><h3><?php echo $this->__('Products configuration'); ?></h3></td>
|
12 |
+
<td class="a-right">
|
13 |
+
<button id="1021" type="button" class="scalable save" onclick="editForm.submit();" style=""><span><?php echo $this->__('Save'); ?></span></button>
|
14 |
+
</td>
|
15 |
+
</tr>
|
16 |
+
</table>
|
17 |
+
</div>
|
18 |
+
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Products list'); ?></h4>
|
19 |
+
<?php
|
20 |
+
$ProductsType = Mage::getModel("sceau/source_ProductType")->toOptionArray();
|
21 |
+
var_dump($ProductsType);
|
22 |
+
?>
|
app/design/adminhtml/default/default/template/fianet_sceau/shipping.phtml
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
try {
|
3 |
+
$form_key = Mage::getSingleton('core/session')->getFormKey();
|
4 |
+
} catch (Exception $e) {
|
5 |
+
|
6 |
+
}
|
7 |
+
?>
|
8 |
+
<div class="content-header">
|
9 |
+
<table cellspacing="0" class="grid-header">
|
10 |
+
<tr>
|
11 |
+
<td><h3><?php echo $this->__('Shipping configuration'); ?></h3></td>
|
12 |
+
<td class="a-right">
|
13 |
+
<button id="1021" type="button" class="scalable save" onclick="editForm.submit();" style=""><span><?php echo $this->__('Save'); ?></span></button>
|
14 |
+
</td>
|
15 |
+
</tr>
|
16 |
+
</table>
|
17 |
+
</div>
|
18 |
+
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Shipping methods list'); ?></h4>
|
19 |
+
<div class="entry-edit">
|
20 |
+
<form id="edit_form" name="edit_form" method="post" action="<?php echo $this->getUrl('*/*/post'); ?>">
|
21 |
+
<?php
|
22 |
+
$ShippingType = Mage::getModel("sceau/source_ShippingType")->toOptionArray();
|
23 |
+
$shipping_list = Mage::getModel('fianet/mageConfiguration')->getShippingMethods();
|
24 |
+
$shipping_association = Mage::getModel("sceau/Shipping_Association");
|
25 |
+
if (isset($form_key)) {
|
26 |
+
echo '<input type="hidden" name="form_key" value="' . $form_key . '" />';
|
27 |
+
}
|
28 |
+
?>
|
29 |
+
<fieldset id="my-fieldset">
|
30 |
+
<table cellspacing="0" class="form-list">
|
31 |
+
<tr>
|
32 |
+
<th><?php echo $this->__('Shipping method'); ?></th>
|
33 |
+
</tr>
|
34 |
+
<?php
|
35 |
+
foreach ($shipping_list as $Code => $label) {
|
36 |
+
$disabled = "";
|
37 |
+
if ($Code == "socolissimosimplicite") {
|
38 |
+
$label = "So Colissimo Simplicité";
|
39 |
+
$disabled = "disabled";
|
40 |
+
}
|
41 |
+
$current_shipping = Mage::getModel('sceau/shipping_association')->load($Code);
|
42 |
+
echo '<tr>';
|
43 |
+
echo '<td class="label">' . $label . '</td>';
|
44 |
+
echo '<td class="input-ele"><select name="' . $Code . '[shippingType]"' . $disabled . '>';
|
45 |
+
foreach ($ShippingType as $data) {
|
46 |
+
$sel = '';
|
47 |
+
if ($current_shipping->shipping_code == null && $data['value'] == '3') {
|
48 |
+
$sel = ' selected';
|
49 |
+
} elseif ($current_shipping->shipping_code != null) {
|
50 |
+
$sel = $current_shipping->fianet_sceau_shipping_type == $data['value'] ? ' selected' : '';
|
51 |
+
}
|
52 |
+
echo '<option value="' . $data['value'] . '"' . $sel . '>' . $data['label'] . '</option>';
|
53 |
+
}
|
54 |
+
echo '</select></td>';
|
55 |
+
echo '</tr>';
|
56 |
+
}
|
57 |
+
?>
|
58 |
+
</table>
|
59 |
+
</fieldset>
|
60 |
+
</form>
|
61 |
+
</div>
|
62 |
+
<script type="text/javascript">
|
63 |
+
var editForm = new varienForm('edit_form', '');
|
64 |
+
</script>
|
app/design/frontend/base/default/layout/fianet_sceau.xml
CHANGED
@@ -19,6 +19,11 @@
|
|
19 |
</reference>
|
20 |
<reference name="footer">
|
21 |
<block type="fianet_sceau/logo_footer" name="logo.footer" template="fianet_sceau/page/html/logo.phtml"/>
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
24 |
</layout>
|
19 |
</reference>
|
20 |
<reference name="footer">
|
21 |
<block type="fianet_sceau/logo_footer" name="logo.footer" template="fianet_sceau/page/html/logo.phtml"/>
|
22 |
+
</reference>
|
23 |
+
</default>
|
24 |
+
<catalog_product_view>
|
25 |
+
<reference name="content">
|
26 |
+
<block type="fianet_sceau/catalog_ProductsReviews" name="catalog.productsreview" template="fianet_sceau/page/html/productsReviews.phtml" after="product.info" />
|
27 |
+
</reference>
|
28 |
+
</catalog_product_view>
|
29 |
</layout>
|
app/design/frontend/base/default/template/fianet_sceau/page/html/productsReviews.phtml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if ($this->isModuleActive()): ?>
|
2 |
+
<!--<div class="main-container">
|
3 |
+
<h2><?php echo $this->__('Customer reviews about products') ?></h2>
|
4 |
+
<div>
|
5 |
+
blabla
|
6 |
+
</div>
|
7 |
+
</div>-->
|
8 |
+
<?php endif; ?>
|
9 |
+
|
app/etc/modules/zFianet_Sceau.xml
CHANGED
@@ -4,6 +4,8 @@
|
|
4 |
<Fianet_Sceau>
|
5 |
<active>true</active>
|
6 |
<codePool>community</codePool>
|
|
|
|
|
7 |
</Fianet_Sceau>
|
8 |
</modules>
|
9 |
</config>
|
4 |
<Fianet_Sceau>
|
5 |
<active>true</active>
|
6 |
<codePool>community</codePool>
|
7 |
+
<!-- declare module's version information for database updates -->
|
8 |
+
<version>1.0.4</version>
|
9 |
</Fianet_Sceau>
|
10 |
</modules>
|
11 |
</config>
|
app/locale/fr_FR/Fianet_Sceau.csv
CHANGED
@@ -1,26 +1,32 @@
|
|
1 |
"Sceau de confiance","Sceau de confiance"
|
2 |
-
"
|
3 |
-
"
|
4 |
-
"
|
5 |
-
"
|
6 |
-
"
|
7 |
-
"
|
8 |
-
"
|
9 |
-
"
|
10 |
-
"
|
11 |
-
"
|
12 |
-
"
|
13 |
-
"
|
14 |
-
"
|
15 |
-
"fianet_url","Urls de Fia-net"
|
16 |
-
"widgettransparent","Transparence du Widget"
|
17 |
-
"Login Sceau","Login"
|
18 |
-
"Envoi automatique des commandes","Envoi automatique des commandes"
|
19 |
-
"Toute commande atteignant l'un des status définis fera l'objet d'un envoi de questionnaire","Toute commande atteignant l'un des status définis fera l'objet d'un envoi de questionnaire"
|
20 |
-
"Correspond à votre identifant marchand FIA-NET","Correspond à votre identifant marchand FIA-NET"
|
21 |
"Logo configuration","Configuration du logo"
|
22 |
-
"
|
23 |
-
"
|
24 |
-
"
|
25 |
-
"
|
26 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
"Sceau de confiance","Sceau de confiance"
|
2 |
+
"Product types: global configuration by category","Types de produits : configuration globale par catégorie"
|
3 |
+
"Product types: personalized configuration for each product","Types de produits : configuration personalisée par produit"
|
4 |
+
"Shipping types configuration","Configuration des types de livraison"
|
5 |
+
"Categories list","Liste des catégories"
|
6 |
+
"Website Categories","Catégories Boutique"
|
7 |
+
"FIA-NET Categories","Catégories FIA-NET"
|
8 |
+
"Site ID","Site ID"
|
9 |
+
"Private key","Clé privée"
|
10 |
+
"Login","Login"
|
11 |
+
"Automatic sending orders","Envoi automatique des commandes"
|
12 |
+
"FIA-NET URL","URL de FIA-NET"
|
13 |
+
"[TEST] Sending script's orders","[PROD] Script d'envoi des commandes"
|
14 |
+
"[PROD] Sending script's orders","[PROD] Script d'envoi des commandes"
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
"Logo configuration","Configuration du logo"
|
16 |
+
"Display in left position","Afficher dans la colonne de gauche"
|
17 |
+
"Display in right position","Afficher dans la colonne de droite"
|
18 |
+
"Display in footer position","Afficher dans le footer"
|
19 |
+
"Widget configuration","Configuration du Widget"
|
20 |
+
"Select the status for which the transaction will be sent to Sceau de Confiance system (multiple selections possible)","Selectionnez le statut pour lequel la transaction sera soumise au système Sceau de Confiance (multisélection possible)"
|
21 |
+
"Enable comments","Activer les commentaires"
|
22 |
+
"widget transparent","Transparence du Widget"
|
23 |
+
"Correspond à votre identifiant marchand FIA-NET","Correspond à votre identifiant marchand FIA-NET"
|
24 |
+
|
25 |
+
"Envoyer à FIA-NET sceau","Envoyer le questionnaire FIA-NET"
|
26 |
+
|
27 |
+
"Sceau: module disabled, order #%s not sent.","Sceau : module désactivé, commande #%s non envoyée."
|
28 |
+
"Sceau: order #%s already sent.","Sceau : commande #%s déjà envoyée"
|
29 |
+
"Sceau: order #%s sending error : %s.","Sceau : commande #%s erreur lors de l'envoi : %s"
|
30 |
+
"Sceau: order #%s error in products configuration.","Sceau : commande #%s erreur dans la configuration des produits"
|
31 |
+
"Sceau: order #%s error in shipping configuration.","Sceau : commande #%s erreur dans la configuration des méthodes de livraison"
|
32 |
+
"Sceau: order #%s sent.","Sceau: commande #%s envoyée."
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Fianet_Sceau</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/OSL-3.0">Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>FIA-NET Sceau de Confiance</summary>
|
10 |
<description>Seal of trust FIA-NET</description>
|
11 |
-
<notes>
|
12 |
-
<authors><author><name>FIA-NET</name><user>
|
13 |
-
<date>2013-09
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Fianet"><dir name="Sceau"><dir name="Block"><dir name="Logo"><file name="Abstract.php" hash="c3b9d566fb937f5093e5d49b021e82df"/><file name="Footer.php" hash="af103617947cbbd5d5a32468757b691b"/><file name="Left.php" hash="87fb4aab3af002792282eaea5f806cf4"/><file name="Right.php" hash="692839ed3361af84561468245c15e4e3"/></dir><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="1728f5da74fa5ab799f603dfd338a1e1"/></dir><file name="Order.php" hash="8caae3cbc5d66a55505664027138d866"/></dir><dir name="Widget"><file name="Abstract.php" hash="34081f22dc73992f7b4fc6575ca7fd01"/><file name="Footer.php" hash="46b8ff738bebeb17b4c80bab3f8414a2"/><dir name="
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Fianet_Sceau</name>
|
4 |
+
<version>1.0.4</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/OSL-3.0">Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>FIA-NET Sceau de Confiance</summary>
|
10 |
<description>Seal of trust FIA-NET</description>
|
11 |
+
<notes>fifth official commit</notes>
|
12 |
+
<authors><author><name>FIA-NET</name><user>auto-converted</user><email>support-boutique@fia-net.com</email></author></authors>
|
13 |
+
<date>2013-12-09</date>
|
14 |
+
<time>15:03:03</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Fianet"><dir name="Sceau"><dir name="Block"><dir name="Catalog"><file name="ProductsReviews.php" hash="80b7ecc97f25a442060c4471a5068032"/></dir><dir name="Logo"><file name="Abstract.php" hash="c3b9d566fb937f5093e5d49b021e82df"/><file name="Footer.php" hash="af103617947cbbd5d5a32468757b691b"/><file name="Left.php" hash="87fb4aab3af002792282eaea5f806cf4"/><file name="Right.php" hash="692839ed3361af84561468245c15e4e3"/></dir><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="1728f5da74fa5ab799f603dfd338a1e1"/></dir><file name="Order.php" hash="8caae3cbc5d66a55505664027138d866"/></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Filter"><file name="Fianet.php" hash="97b2dadc4011ce836781cc7d7d6a244b"/></dir><dir name="Renderer"><file name="Fianet.php" hash="ddb152623c2fd3f832e0c22f81819a32"/></dir></dir></dir><file name="Abstract.php" hash="34081f22dc73992f7b4fc6575ca7fd01"/><file name="Footer.php" hash="46b8ff738bebeb17b4c80bab3f8414a2"/><file name="Left.php" hash="9a81ebcfd5dbd11a6f0a4a23158157ed"/><file name="Right.php" hash="807cf3507a6d4177f3bbdc8be3f14f11"/></dir></dir><dir name="Helper"><file name="Data.php" hash="274558c312b6997f367f2297971f7137"/></dir><dir name="Model"><dir name="Categories"><file name="Association.php" hash="05d7c01cfc0eaa4b11677d0a5e9601ef"/></dir><dir name="Mysql4"><dir name="Categories"><dir name="Association"><file name="Collection.php" hash="f97eec5090921ca8e226167b7e0e152a"/></dir><file name="Association.php" hash="c159bea78e252c961e7cbaf6a29d2738"/></dir><dir name="Shipping"><dir name="Association"><file name="Collection.php" hash="bc99928aa71622baac8bea35d095f9ef"/></dir><file name="Association.php" hash="dfec437432bbb15aa2343e9135a69181"/></dir></dir><dir name="Shipping"><file name="Association.php" hash="8bc91127879515d4328db0ab46325384"/></dir><dir name="Source"><file name="Mode.php" hash="ac805c9b29096a3f6b317809733298a8"/><file name="ProductType.php" hash="35bdafbf86f7bde6901eff2b11c3c297"/><file name="ShippingType.php" hash="75e2ea777d3d4562b394cfb3141aa685"/><file name="Status.php" hash="55a727b776e617289242db7bfeb46fce"/></dir><file name="Observer.php" hash="d66271735ecd40efa54d1005daf40048"/><file name="Order.php" hash="b4eb827cc7533948adb57feb1974c3f1"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CategoriesController.php" hash="3b140e5ffa63d87c6ffb634c270d0ce1"/><file name="ProductsController.php" hash="28b094ee3ad7e626f7d377dd41f80b48"/><file name="ShippingController.php" hash="92bb0235bd87d979e66fdf6f591736e5"/></dir><file name="IndexController.php" hash="a2523c0123ddb64df0c225f18d4c8e8b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="b8df90b22890cc01b66ff61f62083c5c"/><file name="config.xml" hash="d801f1f2c3903e0a43be41ca496bf930"/><file name="system.xml" hash="9d5aec92fd69db94fb37241d7285d800"/></dir><dir name="sql"><dir name="fianet_sceau_setup"><file name="mysql4-install-1.0.0.php" hash="6fe72a93348606c385fa4dc69a078ada"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="f5e70abde67d076c1730788ec4718939"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="fianet_sceau.xml" hash="cbfb390109aa75b15794696471ee7da9"/></dir><dir name="template"><dir name="fianet_sceau"><dir name="page"><dir name="html"><file name="logo.phtml" hash="642dc18c04fea9ef9b00e9cd56f23134"/><file name="productsReviews.phtml" hash="ccde0ea627446780ae5cc0d9429057cb"/><file name="sceau.phtml" hash="ef2c379a26b4b367b6608ef3f0c390e9"/></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="fianet_sceau.xml" hash="3e56c10677bc0d2204f6395595547000"/></dir><dir name="template"><dir name="fianet_sceau"><file name="categories.phtml" hash="f3f63d3b3353a467fb84a3faf23a5704"/><file name="products.phtml" hash="b0f757caa343e2cace10593b3aef2fbe"/><file name="shipping.phtml" hash="701fdfbf67a49501c030cb8215cfbdc9"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="zFianet_Sceau.xml" hash="7815c8026865cb7b340a363724832179"/></dir></target><target name="magelocale"><dir name="fr_FR"><file name="Fianet_Sceau.csv" hash="e3286ad95eb632025c3233708576dd79"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="sceau"><file name="ko.PNG" hash="fe3a3f44292e6f6f3e7d6c90d22ddd54"/><file name="ok.JPG" hash="ce957f7ccb1e07277f9302f0e1fe4908"/><file name="ok.PNG" hash="f751d2b0e1eb1883144c60a8c87db2cb"/><file name="top_left_block_login.png" hash="30eb50342a004e39ac69faa0f7654701"/><file name="warning.gif" hash="c774f46bf0af9b2e5bde5789901c5083"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="sceau"><file name="logo_fianet_sceau.png" hash="befd6502a28deb2384674f696b9e1aa3"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
+
<dependencies><required><package><name>Fianet_Core</name><channel>community</channel><min></min><max></max></package></required></dependencies>
|
18 |
</package>
|