Mage_PDF_per_Product - Version 3.0.6

Version Notes

3.0.6- Added Catalog Project, Sections and Data file support

Download this release

Release Info

Developer Magento Core Team
Extension Mage_PDF_per_Product
Version 3.0.6
Comparing to
See all releases


Code changes from version 3.0.5 to 3.0.6

app/code/community/Mage/Codi/Block/Adminhtml/Menu.php CHANGED
@@ -1,10 +1,10 @@
1
- <?php
2
-
3
- class Mage_Codi_Block_Adminhtml_Menu extends Mage_Adminhtml_Block_Template
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
- $this->setTemplate('codi/index.phtml');
9
- }
10
- }
1
+ <?php
2
+
3
+ class Mage_Codi_Block_Adminhtml_Menu extends Mage_Adminhtml_Block_Template
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setTemplate('codi/index.phtml');
9
+ }
10
+ }
app/code/community/Mage/Codi/Block/Adminhtml/Switcher.php CHANGED
@@ -1,109 +1,109 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category Mage
22
- * @package Mage_Adminhtml
23
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
- */
26
-
27
-
28
- class Mage_Codi_Block_Adminhtml_Switcher extends Mage_Adminhtml_Block_Template
29
- {
30
- protected function _prepareLayout()
31
- {
32
- $this->setTemplate('codi/switcher.phtml');
33
- return parent::_prepareLayout();
34
- }
35
-
36
- /**
37
- * Enter description here...
38
- *
39
- * @return array
40
- */
41
- public function getStoreSelectOptions()
42
- {
43
- $section = $this->getRequest()->getParam('section');
44
-
45
- $curWebsite = $this->getRequest()->getParam('website');
46
- $curStore = $this->getRequest()->getParam('store');
47
-
48
- $storeModel = Mage::getSingleton('adminhtml/system_store');
49
- /* @var $storeModel Mage_Adminhtml_Model_System_Store */
50
-
51
- $url = Mage::getModel('adminhtml/url');
52
-
53
- $options = array();
54
- $options['default'] = array(
55
- 'label' => Mage::helper('adminhtml')->__('Default Config'),
56
- 'url' => $url->getUrl('*/*/*', array('section'=>$section)),
57
- 'selected' => !$curWebsite && !$curStore,
58
- 'style' => 'background:#ccc; font-weight:bold;',
59
- );
60
-
61
- foreach ($storeModel->getWebsiteCollection() as $website) {
62
- $websiteShow = false;
63
- foreach ($storeModel->getGroupCollection() as $group) {
64
- if ($group->getWebsiteId() != $website->getId()) {
65
- continue;
66
- }
67
- $groupShow = false;
68
- foreach ($storeModel->getStoreCollection() as $store) {
69
- if ($store->getGroupId() != $group->getId()) {
70
- continue;
71
- }
72
- if ($websiteShow) {
73
- $websiteShow = true;
74
- $options['website_' . $website->getCode()] = array(
75
- 'label' => $website->getName(),
76
- 'url' => $url->getUrl('*/*/*', array('section'=>$section, 'website'=>$website->getCode())),
77
- 'selected' => !$curStore && $curWebsite == $website->getCode(),
78
- 'style' => 'padding-left:16px; background:#DDD; font-weight:bold;',
79
- );
80
- }
81
- if (!$groupShow) {
82
- $groupShow = true;
83
- $options['group_' . $group->getId() . '_open'] = array(
84
- 'is_group' => true,
85
- 'is_close' => false,
86
- 'label' => $group->getName(),
87
- 'style' => 'padding-left:32px;'
88
- );
89
- }
90
- $options['store_' . $store->getCode()] = array(
91
- 'label' => $store->getName(),
92
- 'url' => $url->getUrl('*/*/*', array('section'=>$section, 'website'=>$website->getCode(), 'store'=>$store->getCode())),
93
- 'selected' => $curStore == $store->getCode(),
94
- 'style' => '',
95
- );
96
- }
97
- if ($groupShow) {
98
- $options['group_' . $group->getId() . '_close'] = array(
99
- 'is_group' => true,
100
- 'is_close' => true,
101
- );
102
- }
103
- }
104
- }
105
-
106
- return $options;
107
- }
108
-
109
- }
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ class Mage_Codi_Block_Adminhtml_Switcher extends Mage_Adminhtml_Block_Template
29
+ {
30
+ protected function _prepareLayout()
31
+ {
32
+ $this->setTemplate('codi/switcher.phtml');
33
+ return parent::_prepareLayout();
34
+ }
35
+
36
+ /**
37
+ * Enter description here...
38
+ *
39
+ * @return array
40
+ */
41
+ public function getStoreSelectOptions()
42
+ {
43
+ $section = $this->getRequest()->getParam('section');
44
+
45
+ $curWebsite = $this->getRequest()->getParam('website');
46
+ $curStore = $this->getRequest()->getParam('store');
47
+
48
+ $storeModel = Mage::getSingleton('adminhtml/system_store');
49
+ /* @var $storeModel Mage_Adminhtml_Model_System_Store */
50
+
51
+ $url = Mage::getModel('adminhtml/url');
52
+
53
+ $options = array();
54
+ $options['default'] = array(
55
+ 'label' => Mage::helper('adminhtml')->__('Default Config'),
56
+ 'url' => $url->getUrl('*/*/*', array('section'=>$section)),
57
+ 'selected' => !$curWebsite && !$curStore,
58
+ 'style' => 'background:#ccc; font-weight:bold;',
59
+ );
60
+
61
+ foreach ($storeModel->getWebsiteCollection() as $website) {
62
+ $websiteShow = false;
63
+ foreach ($storeModel->getGroupCollection() as $group) {
64
+ if ($group->getWebsiteId() != $website->getId()) {
65
+ continue;
66
+ }
67
+ $groupShow = false;
68
+ foreach ($storeModel->getStoreCollection() as $store) {
69
+ if ($store->getGroupId() != $group->getId()) {
70
+ continue;
71
+ }
72
+ if ($websiteShow) {
73
+ $websiteShow = true;
74
+ $options['website_' . $website->getCode()] = array(
75
+ 'label' => $website->getName(),
76
+ 'url' => $url->getUrl('*/*/*', array('section'=>$section, 'website'=>$website->getCode())),
77
+ 'selected' => !$curStore && $curWebsite == $website->getCode(),
78
+ 'style' => 'padding-left:16px; background:#DDD; font-weight:bold;',
79
+ );
80
+ }
81
+ if (!$groupShow) {
82
+ $groupShow = true;
83
+ $options['group_' . $group->getId() . '_open'] = array(
84
+ 'is_group' => true,
85
+ 'is_close' => false,
86
+ 'label' => $group->getName(),
87
+ 'style' => 'padding-left:32px;'
88
+ );
89
+ }
90
+ $options['store_' . $store->getCode()] = array(
91
+ 'label' => $store->getName(),
92
+ 'url' => $url->getUrl('*/*/*', array('section'=>$section, 'website'=>$website->getCode(), 'store'=>$store->getCode())),
93
+ 'selected' => $curStore == $store->getCode(),
94
+ 'style' => '',
95
+ );
96
+ }
97
+ if ($groupShow) {
98
+ $options['group_' . $group->getId() . '_close'] = array(
99
+ 'is_group' => true,
100
+ 'is_close' => true,
101
+ );
102
+ }
103
+ }
104
+ }
105
+
106
+ return $options;
107
+ }
108
+
109
+ }
app/code/community/Mage/Codi/Block/Customer/Codi.php CHANGED
@@ -1,526 +1,526 @@
1
- <?php
2
- ini_set("max_execution_time", 3600);
3
- ini_set('session.gc_maxlifetime', 3600);
4
- ini_set("memory_limit","256M");
5
-
6
- class Mage_Codi_Block_Customer_Codi extends Mage_Wishlist_Block_Customer_Wishlist
7
- {
8
-
9
- protected $_wishlistLoaded = false;
10
- public $m_DataFile = "itemNumber\titemQty\titemUom\titemPrice\titemDescription\titemLink\titemAttributes\titemGraphic\tproductName\tproductMfg\tproductDescription\tproductGraphic\tproductLink\tproductAttributes\tCategory\tReviews\tSupplementalInfo";
11
- // public $ProductModel ;
12
- // public $ConfigurableModel ;
13
- public $mediaurl ;
14
- public $RootCategories ;
15
- public $enablereviews ;
16
- public $StoreId ;
17
- public $reviewsModel ;
18
- public $ratingModel ;
19
-
20
- public function _construct()
21
- {
22
- // $this->ProductModel = Mage::getModel('catalog/product') ;
23
- // $this->ConfigurableModel = Mage::getModel('catalog/product_type_configurable') ;
24
- $this->mediaurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) ;
25
-
26
- // Get Root Categories to eliminate them from being send -Start
27
- $RootCategoriesArray = Mage::getModel('adminhtml/system_config_source_category')->toOptionArray();
28
- $RootCategories = array();
29
- foreach($RootCategoriesArray as $RootCategory):
30
- if($RootCategory['value']) array_push($RootCategories, $RootCategory['value'] );
31
- endforeach;
32
-
33
- $this->RootCategories = $RootCategories ;
34
- // Get Root Categories to eliminate them from being send -End
35
-
36
- $this->enablereviews = Mage::getStoreConfig('codi/codi/codenablereviews') ;
37
- $this->fromchild = Mage::getStoreConfig('codi/codi/fromchild') ;
38
-
39
- // Get StoreID -Start
40
- foreach (Mage::app()->getWebsites() as $website)
41
- {
42
- $defaultGroup = $website->getDefaultGroup();
43
- $StoreId = $defaultGroup->getDefaultStoreId();
44
- }
45
-
46
- $this->StoreId = $StoreId ;
47
- // Get StoreID -End
48
-
49
- $this->reviewsModel = Mage::getModel('review/review') ;
50
- $this->ratingModel = Mage::getModel('rating/rating_option_vote') ;
51
-
52
- $this->_logFile = "Catalog-on-demand.log";
53
- }
54
-
55
-
56
- protected function _prepareLayout()
57
- {
58
- if ($headBlock = $this->getLayout()->getBlock('head')) {
59
- $headBlock->setTitle($this->__('My Wishlist'));
60
- }
61
- }
62
-
63
- public function getWishlist()
64
- {
65
- if(!$this->_wishlistLoaded) {
66
- Mage::registry('wishlist')
67
- ->loadByCustomer(Mage::getSingleton('customer/session')->getCustomer());
68
-
69
- $collection = Mage::registry('wishlist')->getProductCollection()
70
- ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
71
- ->addStoreFilter();
72
-
73
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
74
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
75
-
76
- $this->_wishlistLoaded = true;
77
- }
78
- return Mage::registry('wishlist')->getProductCollection();
79
- }
80
-
81
- public function ProcessDataFileImport($m_DataFile)
82
- {
83
- $codimodel = Mage::getSingleton('codi/codi');
84
- $userid = Mage::getStoreConfig('codi/codi/codusername') ;
85
- $password = Mage::getStoreConfig('codi/codi/codpassword') ;
86
- $url = "https://webservices.catalog-on-demand.com/onDemandPublishingProcessor.do" ;
87
- $paramsarray = array(
88
- 'Operation' => "ProcessDataFileImport" ,
89
- 'UserID' => $userid ,
90
- 'Password' => $password ,
91
- 'ClearDatabase' => "All" ,
92
- 'CatalogProject'=> "Magento" ,
93
- 'DataFileText' => str_replace("'" , "&apos;" , $m_DataFile) );
94
-
95
- $Responsemsg = $codimodel->Call( $url, $paramsarray );
96
- if( $Responsemsg )
97
- {
98
- if($Responsemsg->Message=="OK")
99
- {
100
- echo "Your site data has been posted to the Catalog-On-Demand database and will be available for sharing and/or publishing within 5-10 minutes.";
101
- }
102
- }
103
- else
104
- echo "*There appears to be some problem in your installation’s ability to communicate with the Catalog-On-Demand server. Please contact Catalog-On-Demand support to report this problem." ;
105
- }
106
-
107
- public function LaunchSponsoredCoDSite($m_DataFile)
108
- {
109
- $codimodel = Mage::getSingleton('codi/codi');
110
- $userid = Mage::getStoreConfig('codi/codi/codusername') ;
111
- $password = Mage::getStoreConfig('codi/codi/codpassword') ;
112
-
113
- $customerid = "" ;
114
- $customerdatasourceid = "" ;
115
- $validateuser = "" ;
116
- $url = "https://webservices.catalog-on-demand.com/smanager/api.do?Operation=ValidateUser&ResponseGroups=All&FunctionGroups=All" ;
117
- $paramsarray = array('UserID' => $userid ,
118
- 'Password' => $password );
119
- $Responsemsg = $codimodel->Call( $url, $paramsarray );
120
- if( $Responsemsg )
121
- {
122
- if($Responsemsg->Message=="OK")
123
- {
124
- $customerid = (string)$Responsemsg->ValidateUserResponse->User->Customer->CustomerID ;
125
- $customername = (string)$Responsemsg->ValidateUserResponse->User->Customer->Name ;
126
- $customerdatasourceid = (string)$Responsemsg->ValidateUserResponse->User->Customer->DataSource->ID ;
127
- $validateuser = (string)$Responsemsg->Message;
128
- }
129
-
130
- echo "<html><body>" ;
131
- $form = ""; for ($i=0 ; $i<=100 ; $i++) { $form .= "<br>" ; } echo $form ; //hide tmp characters
132
- ?>
133
- <FORM name='publishitems' method='POST' enctype='multipart/form-data' action='https://webservices.catalog-on-demand.com/aservices/api.do'>
134
- <input type='hidden' name='Operation' value='LaunchSponsoredCoDSite'>
135
- <input type='hidden' name='HideScreens' value='SelectItems'>
136
- <input type='hidden' name='UserID' value='<?php echo htmlentities($userid) ?>'>
137
- <input type='hidden' name='Password' value='<?php echo htmlentities($password) ?>'>
138
- <input type='hidden' name='Sponsor' value='<?php echo htmlentities($customerid) ?>'>
139
- <input type='hidden' name='DataFileText' value='<?php echo str_replace("'" , "&apos;" , $m_DataFile) ?>'>
140
- </FORM>
141
- <SCRIPT language="JavaScript">
142
- document.publishitems.submit();
143
- </SCRIPT>
144
- </body></html>
145
- <?php
146
- }
147
- else
148
- echo "*There appears to be some problem in your installation’s ability to communicate with the Catalog-On-Demand server. Please contact Catalog-On-Demand support to report this problem." ;
149
- }
150
-
151
- public function ProducttoString( $product , $from )
152
- {
153
- if( $product->isConfigurable() )
154
- {
155
- return $this->ProducttoStringConfigurable( $product , $from ) ;
156
- }
157
- else
158
- {
159
- return $this->ProducttoStringSimple( $product , $from ) ;
160
- }
161
- }
162
-
163
- public function ProducttoStringConfigurable( $product , $from )
164
- {
165
- set_time_limit(0);
166
-
167
- $ProducttoString = '' ;
168
- $UsedProductIds = Mage::getModel('catalog/product_type_configurable')->getUsedProductIds($product);
169
-
170
- if( $from == "wishlist" )
171
- {
172
- $myproduct = '';
173
- $Comment = '' ;
174
- //Add Comment if exist
175
- $defaultcomment = $this->helper('wishlist')->defaultCommentString() ;
176
- if ( $product->getWishlistItemDescription() !== $defaultcomment )
177
- $Comment = "\\par{\\b Comment}\\par" . $product->getWishlistItemDescription() ;
178
- //Get Full Product
179
- $myproduct = Mage::getModel('catalog/product')->load($product->getProductID());
180
- //Get Product Description
181
- $ProductDescription = $myproduct->getDescription() ;
182
- $ProductDescription .= $Comment ;
183
- }
184
- else
185
- {
186
- $ProductDescription = $product->getDescription() ;
187
- }
188
-
189
- //Get Product Attributes Start
190
- //$excludeAttr = array() ;
191
- $attributes = $product->getAttributes();
192
-
193
- $ProductAttributes = "" ;
194
- foreach ($attributes as $attribute) {
195
- if ($attribute->getIsVisibleOnFront() && !in_array($attribute->getAttributeCode(), array() )) {
196
- $value = $attribute->getFrontend()->getValue($product);
197
- if (is_string($value))
198
- {
199
- if (strlen($value) && $product->hasData($attribute->getAttributeCode()))
200
- {
201
- $ProductAttributes .= $attribute->getFrontend()->getLabel() . "=" . $value . "|" ;
202
- }
203
- }
204
- }
205
- }
206
- $ProductAttributes = substr($ProductAttributes, 0, strlen($ProductAttributes)-1 ) ;
207
- //Get Product Attributes End
208
-
209
- foreach($UsedProductIds as $UsedProductid)
210
- {
211
- $UsedProduct = Mage::getModel('catalog/product')->load($UsedProductid);
212
- if( Mage::getStoreConfig('codi/codi/fromchild') )
213
- $UsedProductPrice = $UsedProduct->getFinalPrice() ;
214
- else
215
- $UsedProductPrice = $product->getFinalPrice() ; //default behavior
216
- //************************ Get Attributes Start *******************************
217
- //Extract Attributes
218
- //$ImageURL = (string)$this->helper('catalog/image')->init($UsedProduct, 'image');
219
- //$mediaurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
220
- $ImageURL = $this->mediaurl . "catalog/product" . $product->getImage();
221
-
222
- //Get Item Attributes Start
223
- //$excludeAttr = array() ;
224
- $attributes = $UsedProduct->getAttributes();
225
-
226
- $ItemitemAttributes = "" ;
227
- $AllowAttributes = $product->getTypeInstance(true)->getConfigurableAttributes($product);
228
- foreach ($AllowAttributes as $attribute)
229
- {
230
- $AttributeCode = $attribute->getProductAttribute()->getAttributeCode() ;
231
- $AttributeLabel = $attribute->getProductAttribute()->getFrontend()->getLabel() ;
232
- $AttribId = $UsedProduct->getData($AttributeCode) ;
233
-
234
- $AttributeValue = "" ;
235
- foreach ( $attribute->getProductAttribute()->getSource()->getAllOptions() as $option )
236
- {
237
- if( $option['value'] == $AttribId )
238
- {
239
- $AttributeValue = $option['label'];
240
- }
241
- }
242
-
243
- $ItemitemAttributes .= $AttributeLabel . "=" . $AttributeValue . "|" ;
244
-
245
- //Get Delta Price Start
246
- foreach( $attribute->getPrices() as $addedPrice )
247
- {
248
- if ( $AttributeValue == $addedPrice['label'])
249
- {
250
- if( $addedPrice['is_percent'] )
251
- $UsedProductPrice += $UsedProductPrice * $addedPrice['pricing_value'] / 100;
252
- else
253
- $UsedProductPrice += $addedPrice['pricing_value'] ;
254
- }
255
- }
256
- //Get Delta Price End
257
- }
258
-
259
- $ItemitemAttributes = substr($ItemitemAttributes, 0, strlen($ItemitemAttributes)-1 );
260
-
261
- //Get Item Attributes End
262
- //************************ Get Attributes End ************************************
263
-
264
- //************************* Get Categories names Start ***************************
265
-
266
- $categories = $product->getCategoryIds();
267
-
268
- $CategoriesString = "" ;
269
- foreach($categories as $k => $_category_id){
270
-
271
- $_category = Mage::getModel('catalog/category')->load($_category_id) ;
272
- $path = $_category->getPathInStore();
273
- $pathIds = array_reverse(explode(',', $path));
274
-
275
- foreach($pathIds as $m => $_cat_id){
276
- $_cat = Mage::getModel('catalog/category')->load($_cat_id) ;
277
- // if( $_cat->getName() != '' && (string)$_cat->getLevel() != '1' && !(in_array($_cat_id, $this->RootCategories)) )
278
- if( ($_cat->getName() != '') && ($_cat->getName() != 'Root Catalog') && ((string)$_cat->getLevel() != '1') && ($_cat->getParentId() > 1 ) )
279
- $CategoriesString .= $_cat->getName() . "#$#" ;
280
- }
281
-
282
- if( substr($CategoriesString, strlen($CategoriesString)-3, 3) == "#$#" )
283
- {
284
- $CategoriesString = substr($CategoriesString, 0, strlen($CategoriesString)-3 ) ;
285
- $CategoriesString .= "|";
286
- }
287
-
288
- }
289
-
290
- $CategoriesString = substr($CategoriesString, 0, strlen($CategoriesString)-1 ) ;
291
-
292
- if ($CategoriesString=='') $CategoriesString = 'Uncategorized' ;
293
-
294
- //************************* Get Categories names End ***************************
295
-
296
- //************************* Get Reviews Start ***********************
297
- //$enablereviews = Mage::getStoreConfig('codi/codi/codenablereviews') ;
298
- $Reviews = $this->enablereviews ? $this->getReviews($product->getId()) : '' ;
299
- //************************* Get Reviews End *************************
300
-
301
- //************************* Concatenate Product Info Start ***********************
302
- $ProducttoString .= "\r\n" . $this->cleanStr( $UsedProduct->getSku() ) ; //ItemID
303
- $ProducttoString .= "\t" . "" ; //ItemQty
304
- $ProducttoString .= "\t" . "" ; //ItemUom
305
- // $ProducttoString .= "\t" . $this->cleanStr( $product->getPrice() ) ; //ItemPrice
306
- $ProducttoString .= "\t" . $this->cleanStr( $UsedProductPrice ) ; //ItemPrice
307
- $ProducttoString .= "\t" . ""; //ItemDescription
308
- $ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ); //ItemLink
309
- $ProducttoString .= "\t" . $this->cleanStr( $ItemitemAttributes ) ; //ItemitemAttributes
310
- $ProducttoString .= "\t" . ""; //ItemitemGraphic
311
- $ProducttoString .= "\t" . $product->getId().'#$#'.$this->cleanStr( $product->getName() ); //ProductName
312
- $ProducttoString .= "\t" . "" ; //ProductMfg
313
- $ProducttoString .= "\t" . $this->cleanStr( $ProductDescription ) ; //ProductDescription
314
- $ProducttoString .= "\t" . $this->cleanStr( $ImageURL ); //ProductGraphic
315
- $ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ) ; //ProductLink
316
- $ProducttoString .= "\t" . $this->cleanStr( $ProductAttributes ) ; //ProductAttributes
317
- $ProducttoString .= "\t" . $this->cleanStr( $CategoriesString ); //Category
318
- $ProducttoString .= "\t" . $this->cleanStr( $Reviews ); //Reviews
319
- $ProducttoString .= "\t" . $this->cleanStr( $product->getShortDescription() ); //ShortDescription (Quick Overview)
320
- //************************* Concatenate Product Info End ************************* cleanStr
321
- }
322
-
323
- return $ProducttoString ;
324
- }
325
- /////////////////////////////////////////// Simple Products ///////////////////////////////////////////////////////////////////
326
- public function ProducttoStringSimple( $product , $from )
327
- {
328
- set_time_limit(0);
329
-
330
- $ProducttoString = '' ;
331
- if($from == "wishlist")
332
- {
333
- $Comment = '' ;
334
- //Add Comment if exist
335
- $defaultcomment = $this->helper('wishlist')->defaultCommentString() ;
336
- if ( $product->getWishlistItemDescription() !== $defaultcomment )
337
- $Comment = "\\par{\\b Comment}\\par" . $product->getWishlistItemDescription() ;
338
- //Get Full Product
339
- $product = Mage::getModel('catalog/product')->load($product->getProductID());
340
- //Get Product Description
341
- $ProductDescription = $product->getDescription() ;
342
- $ProductDescription .= $Comment ;
343
- }
344
- else
345
- {
346
- $ProductDescription = $product->getDescription() ;
347
- }
348
-
349
- //************************ Get Attributes Start *******************************
350
- //Extract Attributes
351
- //$ImageURL = (string)$this->helper('catalog/image')->init($product, 'image');
352
- //$mediaurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
353
- $ImageURL = $this->mediaurl . "catalog/product" . $product->getImage();
354
-
355
- //$excludeAttr = array() ;
356
- $attributes = $product->getAttributes();
357
- $ItemitemAttributes = "" ;
358
- foreach ($attributes as $attribute) {
359
- if ($attribute->getIsVisibleOnFront() && !in_array($attribute->getAttributeCode(), array() )) {
360
- $value = $attribute->getFrontend()->getValue($product);
361
- if (is_string($value))
362
- {
363
- if (strlen($value) && $product->hasData($attribute->getAttributeCode()))
364
- {
365
- $ItemitemAttributes .= $attribute->getFrontend()->getLabel() . "=" . $value . "|" ;
366
- }
367
- }
368
- }
369
- }
370
- $ItemitemAttributes = substr($ItemitemAttributes, 0, strlen($ItemitemAttributes)-1 ) ;
371
- //************************ Get Attributes End ************************************
372
-
373
- //************************* Get Categories names Start ***************************
374
-
375
- $categories = $product->getCategoryIds();
376
- $CategoriesString = "" ;
377
- foreach($categories as $k => $_category_id){
378
-
379
- $_category = Mage::getModel('catalog/category')->load($_category_id) ;
380
- $path = $_category->getPathInStore();
381
- $pathIds = array_reverse(explode(',', $path));
382
-
383
- foreach($pathIds as $m => $_cat_id){
384
- $_cat = Mage::getModel('catalog/category')->load($_cat_id) ;
385
- // if( $_cat->getName() != '' && (string)$_cat->getLevel() != '1' && !(in_array($_cat_id, $this->RootCategories)) )
386
- if( ($_cat->getName() != '') && ($_cat->getName() != 'Root Catalog') && ((string)$_cat->getLevel() != '1') && ($_cat->getParentId() > 1 ) )
387
- $CategoriesString .= $_cat->getName() . "#$#" ;
388
- }
389
-
390
- if( substr($CategoriesString, strlen($CategoriesString)-3, 3) == "#$#" )
391
- {
392
- $CategoriesString = substr($CategoriesString, 0, strlen($CategoriesString)-3 );
393
- $CategoriesString .= "|";
394
- }
395
- }
396
-
397
- $CategoriesString = substr($CategoriesString, 0, strlen($CategoriesString)-1 ) ;
398
- if ($CategoriesString == '' ) $CategoriesString = 'Uncategorized' ;
399
- //************************* Get Categories names End ***************************
400
-
401
- //************************* Get Reviews Start ***********************
402
- //$enablereviews = Mage::getStoreConfig('codi/codi/codenablereviews') ;
403
- //if($enablereviews) { $Reviews = $this->getReviews($product->getId()) ; }
404
- $Reviews = $this->enablereviews ? $this->getReviews($product->getId()) : '' ;
405
- //************************* Get Reviews End *************************
406
-
407
- //************************* Concatenate Product Info Start ***********************
408
-
409
- $ProducttoString .= "\r\n" . $this->cleanStr( $product->getSku() ) ; //ItemID
410
- $ProducttoString .= "\t" . "" ; //ItemQty
411
- $ProducttoString .= "\t" . "" ; //ItemUom
412
- $ProducttoString .= "\t" . $this->cleanStr( $product->getFinalPrice() ) ; //ItemPrice
413
- $ProducttoString .= "\t" . ""; //ItemDescription
414
- $ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ); //ItemLink
415
- $ProducttoString .= "\t" . ""; //ItemitemAttributes
416
- $ProducttoString .= "\t" . ""; //ItemitemGraphic
417
- $ProducttoString .= "\t" . $product->getId().'#$#'.$this->cleanStr( $product->getName() ); //ProductName
418
- $ProducttoString .= "\t" . "" ; //ProductMfg
419
- $ProducttoString .= "\t" . $this->cleanStr( $ProductDescription ) ; //ProductDescription
420
- $ProducttoString .= "\t" . $this->cleanStr( $ImageURL ); //ProductGraphic
421
- $ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ) ; //ProductLink
422
- $ProducttoString .= "\t" . $this->cleanStr( $ItemitemAttributes ) ; //ProductAttributes
423
- $ProducttoString .= "\t" . $this->cleanStr( $CategoriesString ); //Category
424
- $ProducttoString .= "\t" . $this->cleanStr( $Reviews ); //Reviews
425
- $ProducttoString .= "\t" . $this->cleanStr( $product->getShortDescription() ); //ShortDescription (Quick Overview)
426
- //************************* Concatenate Product Info End ************************* cleanStr
427
-
428
- return $ProducttoString ;
429
- }
430
-
431
- public function getReviews( $productid )
432
- {
433
- $reviewsCollection = $this->reviewsModel->getCollection()
434
- ->addStoreFilter($this->StoreId)
435
- ->addStatusFilter('approved')
436
- ->addEntityFilter('product', $productid)
437
- ->setDateOrder();
438
-
439
- $Reviews = "" ;
440
- foreach($reviewsCollection as $review)
441
- {
442
- $ratingCollection = $this->ratingModel
443
- ->getResourceCollection()
444
- ->setReviewFilter($review->getReviewId())
445
- ->setStoreFilter($this->StoreId)
446
- ->addRatingInfo($this->StoreId)
447
- ->load();
448
- $Reviews .= "<p><b>".$review->getTitle()."(". $review->getNickname() .")</b><br>".$review->getDetail()."</p>" ;
449
- }
450
- return $Reviews ;
451
- }
452
-
453
- public function getWishListDataFile()
454
- {
455
- $m_DataFile = '' ;
456
-
457
- foreach($this->getWishlist() as $item):
458
- $m_DataFile .= $this->ProducttoString($item , "wishlist" ) ;
459
- endforeach ;
460
-
461
- return $this->m_DataFile . $m_DataFile ;
462
- }
463
-
464
- public function getcurrencysign()
465
- {
466
- try {
467
- $currencystr = Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE) ;
468
- $currency = new Zend_Currency($currencystr);
469
- Zend_Registry::set('Zend_Currency', $currency);
470
- return $currency->getSymbol();
471
- } catch (Exception $e) {
472
- return "US";
473
- }
474
- }
475
-
476
- public function ProcessBackgroundJob()
477
- {
478
- $m_DataFile = $this->getWishListDataFile() ;
479
-
480
- $codimodel = Mage::getSingleton('codi/codi');
481
- $userid = Mage::getStoreConfig('codi/codi/codusername') ;
482
- $password = Mage::getStoreConfig('codi/codi/codpassword') ;
483
-
484
- //Get Currency Sign
485
- $currencysign = $this->getcurrencysign() ;
486
- //Preparing the call
487
- $UserEmail = $this->getuseremail() ;
488
- $JobName = $this->getRequest()->getParam('JobName') ;
489
-
490
- $options = "_JobName=" . $JobName ;
491
- $options .= "||CurrencySymbol=" . $currencysign ;
492
- $options .= "||ClientAppVersion=" . "Magento" . Mage::getVersion() . "-Codi" . $codimodel->version ;
493
-
494
- $url = "https://webservices.catalog-on-demand.com/onDemandPublishingProcessor.do?Operation=ProcessBackgroundJob";
495
- $paramsarray = array('UserID' => $userid,
496
- 'Password' => $password,
497
- 'Email' => $UserEmail,
498
- 'Options' => $options,
499
- 'DataFileText' => $m_DataFile);
500
- //Calling
501
- $UserEmail = Mage::getSingleton('customer/session')->getCustomer()->getEmail() ; //Get User Email
502
- $Responsemsg = $codimodel->Call( $url, $paramsarray );
503
- if( $Responsemsg )
504
- {
505
- if($Responsemsg->Message=="OK")
506
- echo "Your Wishlist has been submitted to Catalog-On-Demand for publishing and should be complete within 5-10 minutes. Please monitor your email ($UserEmail) for a link to your PDF publication." ;
507
- else
508
- {
509
- echo "Error No. " . $Responsemsg->Errors->Error->Code . "<br>";
510
- echo $Responsemsg->Errors->Error->Description . "<br>";
511
- }
512
- }
513
- else
514
- echo "*There appears to be some problem in your installation’s ability to communicate with the Catalog-On-Demand server. Please contact Catalog-On-Demand support to report this problem." ;
515
- }
516
-
517
- public function cleanStr($localstr)
518
- {
519
- $localstr = str_replace("\t","", $localstr ) ;
520
- $localstr = str_replace("\r\n","<br>", $localstr ) ;
521
- $localstr = str_replace("\r","<br>", $localstr ) ;
522
- $localstr = str_replace("\n","<br>", $localstr ) ;
523
- return $localstr ;
524
- }
525
-
526
- }// class end
1
+ <?php
2
+ ini_set("max_execution_time", 3600);
3
+ ini_set('session.gc_maxlifetime', 3600);
4
+ ini_set("memory_limit","256M");
5
+
6
+ class Mage_Codi_Block_Customer_Codi extends Mage_Wishlist_Block_Customer_Wishlist
7
+ {
8
+
9
+ protected $_wishlistLoaded = false;
10
+ public $m_DataFile = "itemNumber\titemQty\titemUom\titemPrice\titemDescription\titemLink\titemAttributes\titemGraphic\tproductName\tproductMfg\tproductDescription\tproductGraphic\tproductLink\tproductAttributes\tCategory\tReviews\tSupplementalInfo";
11
+ // public $ProductModel ;
12
+ // public $ConfigurableModel ;
13
+ public $mediaurl ;
14
+ public $RootCategories ;
15
+ public $enablereviews ;
16
+ public $StoreId ;
17
+ public $reviewsModel ;
18
+ public $ratingModel ;
19
+
20
+ public function _construct()
21
+ {
22
+ // $this->ProductModel = Mage::getModel('catalog/product') ;
23
+ // $this->ConfigurableModel = Mage::getModel('catalog/product_type_configurable') ;
24
+ $this->mediaurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) ;
25
+
26
+ // Get Root Categories to eliminate them from being send -Start
27
+ $RootCategoriesArray = Mage::getModel('adminhtml/system_config_source_category')->toOptionArray();
28
+ $RootCategories = array();
29
+ foreach($RootCategoriesArray as $RootCategory):
30
+ if($RootCategory['value']) array_push($RootCategories, $RootCategory['value'] );
31
+ endforeach;
32
+
33
+ $this->RootCategories = $RootCategories ;
34
+ // Get Root Categories to eliminate them from being send -End
35
+
36
+ $this->enablereviews = Mage::getStoreConfig('codi/codi/codenablereviews') ;
37
+ $this->fromchild = Mage::getStoreConfig('codi/codi/fromchild') ;
38
+
39
+ // Get StoreID -Start
40
+ foreach (Mage::app()->getWebsites() as $website)
41
+ {
42
+ $defaultGroup = $website->getDefaultGroup();
43
+ $StoreId = $defaultGroup->getDefaultStoreId();
44
+ }
45
+
46
+ $this->StoreId = $StoreId ;
47
+ // Get StoreID -End
48
+
49
+ $this->reviewsModel = Mage::getModel('review/review') ;
50
+ $this->ratingModel = Mage::getModel('rating/rating_option_vote') ;
51
+
52
+ $this->_logFile = "Catalog-on-demand.log";
53
+ }
54
+
55
+
56
+ protected function _prepareLayout()
57
+ {
58
+ if ($headBlock = $this->getLayout()->getBlock('head')) {
59
+ $headBlock->setTitle($this->__('My Wishlist'));
60
+ }
61
+ }
62
+
63
+ public function getWishlist()
64
+ {
65
+ if(!$this->_wishlistLoaded) {
66
+ Mage::registry('wishlist')
67
+ ->loadByCustomer(Mage::getSingleton('customer/session')->getCustomer());
68
+
69
+ $collection = Mage::registry('wishlist')->getProductCollection()
70
+ ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
71
+ ->addStoreFilter();
72
+
73
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
74
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
75
+
76
+ $this->_wishlistLoaded = true;
77
+ }
78
+ return Mage::registry('wishlist')->getProductCollection();
79
+ }
80
+
81
+ public function ProcessDataFileImport($m_DataFile)
82
+ {
83
+ $codimodel = Mage::getSingleton('codi/codi');
84
+ $userid = Mage::getStoreConfig('codi/codi/codusername') ;
85
+ $password = Mage::getStoreConfig('codi/codi/codpassword') ;
86
+ $url = "https://webservices.catalog-on-demand.com/onDemandPublishingProcessor.do" ;
87
+ $paramsarray = array(
88
+ 'Operation' => "ProcessDataFileImport" ,
89
+ 'UserID' => $userid ,
90
+ 'Password' => $password ,
91
+ 'ClearDatabase' => "All" ,
92
+ 'CatalogProject'=> "Magento" ,
93
+ 'DataFileText' => str_replace("'" , "&apos;" , $m_DataFile) );
94
+
95
+ $Responsemsg = $codimodel->Call( $url, $paramsarray );
96
+ if( $Responsemsg )
97
+ {
98
+ if($Responsemsg->Message=="OK")
99
+ {
100
+ echo "Your site data has been posted to the Catalog-On-Demand database and will be available for sharing and/or publishing within 5-10 minutes.";
101
+ }
102
+ }
103
+ else
104
+ echo "*There appears to be some problem in your installation’s ability to communicate with the Catalog-On-Demand server. Please contact Catalog-On-Demand support to report this problem." ;
105
+ }
106
+
107
+ public function LaunchSponsoredCoDSite($m_DataFile)
108
+ {
109
+ $codimodel = Mage::getSingleton('codi/codi');
110
+ $userid = Mage::getStoreConfig('codi/codi/codusername') ;
111
+ $password = Mage::getStoreConfig('codi/codi/codpassword') ;
112
+
113
+ $customerid = "" ;
114
+ $customerdatasourceid = "" ;
115
+ $validateuser = "" ;
116
+ $url = "https://webservices.catalog-on-demand.com/smanager/api.do?Operation=ValidateUser&ResponseGroups=All&FunctionGroups=All" ;
117
+ $paramsarray = array('UserID' => $userid ,
118
+ 'Password' => $password );
119
+ $Responsemsg = $codimodel->Call( $url, $paramsarray );
120
+ if( $Responsemsg )
121
+ {
122
+ if($Responsemsg->Message=="OK")
123
+ {
124
+ $customerid = (string)$Responsemsg->ValidateUserResponse->User->Customer->CustomerID ;
125
+ $customername = (string)$Responsemsg->ValidateUserResponse->User->Customer->Name ;
126
+ $customerdatasourceid = (string)$Responsemsg->ValidateUserResponse->User->Customer->DataSource->ID ;
127
+ $validateuser = (string)$Responsemsg->Message;
128
+ }
129
+
130
+ echo "<html><body>" ;
131
+ $form = ""; for ($i=0 ; $i<=100 ; $i++) { $form .= "<br>" ; } echo $form ; //hide tmp characters
132
+ ?>
133
+ <FORM name='publishitems' method='POST' enctype='multipart/form-data' action='https://webservices.catalog-on-demand.com/aservices/api.do'>
134
+ <input type='hidden' name='Operation' value='LaunchSponsoredCoDSite'>
135
+ <input type='hidden' name='HideScreens' value='SelectItems'>
136
+ <input type='hidden' name='UserID' value='<?php echo htmlentities($userid) ?>'>
137
+ <input type='hidden' name='Password' value='<?php echo htmlentities($password) ?>'>
138
+ <input type='hidden' name='Sponsor' value='<?php echo htmlentities($customerid) ?>'>
139
+ <input type='hidden' name='DataFileText' value='<?php echo str_replace("'" , "&apos;" , $m_DataFile) ?>'>
140
+ </FORM>
141
+ <SCRIPT language="JavaScript">
142
+ document.publishitems.submit();
143
+ </SCRIPT>
144
+ </body></html>
145
+ <?php
146
+ }
147
+ else
148
+ echo "*There appears to be some problem in your installation’s ability to communicate with the Catalog-On-Demand server. Please contact Catalog-On-Demand support to report this problem." ;
149
+ }
150
+
151
+ public function ProducttoString( $product , $from )
152
+ {
153
+ if( $product->isConfigurable() )
154
+ {
155
+ return $this->ProducttoStringConfigurable( $product , $from ) ;
156
+ }
157
+ else
158
+ {
159
+ return $this->ProducttoStringSimple( $product , $from ) ;
160
+ }
161
+ }
162
+
163
+ public function ProducttoStringConfigurable( $product , $from )
164
+ {
165
+ set_time_limit(0);
166
+
167
+ $ProducttoString = '' ;
168
+ $UsedProductIds = Mage::getModel('catalog/product_type_configurable')->getUsedProductIds($product);
169
+
170
+ if( $from == "wishlist" )
171
+ {
172
+ $myproduct = '';
173
+ $Comment = '' ;
174
+ //Add Comment if exist
175
+ $defaultcomment = $this->helper('wishlist')->defaultCommentString() ;
176
+ if ( $product->getWishlistItemDescription() !== $defaultcomment )
177
+ $Comment = "\\par{\\b Comment}\\par" . $product->getWishlistItemDescription() ;
178
+ //Get Full Product
179
+ $myproduct = Mage::getModel('catalog/product')->load($product->getProductID());
180
+ //Get Product Description
181
+ $ProductDescription = $myproduct->getDescription() ;
182
+ $ProductDescription .= $Comment ;
183
+ }
184
+ else
185
+ {
186
+ $ProductDescription = $product->getDescription() ;
187
+ }
188
+
189
+ //Get Product Attributes Start
190
+ //$excludeAttr = array() ;
191
+ $attributes = $product->getAttributes();
192
+
193
+ $ProductAttributes = "" ;
194
+ foreach ($attributes as $attribute) {
195
+ if ($attribute->getIsVisibleOnFront() && !in_array($attribute->getAttributeCode(), array() )) {
196
+ $value = $attribute->getFrontend()->getValue($product);
197
+ if (is_string($value))
198
+ {
199
+ if (strlen($value) && $product->hasData($attribute->getAttributeCode()))
200
+ {
201
+ $ProductAttributes .= $attribute->getFrontend()->getLabel() . "=" . $value . "|" ;
202
+ }
203
+ }
204
+ }
205
+ }
206
+ $ProductAttributes = substr($ProductAttributes, 0, strlen($ProductAttributes)-1 ) ;
207
+ //Get Product Attributes End
208
+
209
+ foreach($UsedProductIds as $UsedProductid)
210
+ {
211
+ $UsedProduct = Mage::getModel('catalog/product')->load($UsedProductid);
212
+ if( Mage::getStoreConfig('codi/codi/fromchild') )
213
+ $UsedProductPrice = $UsedProduct->getFinalPrice() ;
214
+ else
215
+ $UsedProductPrice = $product->getFinalPrice() ; //default behavior
216
+ //************************ Get Attributes Start *******************************
217
+ //Extract Attributes
218
+ //$ImageURL = (string)$this->helper('catalog/image')->init($UsedProduct, 'image');
219
+ //$mediaurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
220
+ $ImageURL = $this->mediaurl . "catalog/product" . $product->getImage();
221
+
222
+ //Get Item Attributes Start
223
+ //$excludeAttr = array() ;
224
+ $attributes = $UsedProduct->getAttributes();
225
+
226
+ $ItemitemAttributes = "" ;
227
+ $AllowAttributes = $product->getTypeInstance(true)->getConfigurableAttributes($product);
228
+ foreach ($AllowAttributes as $attribute)
229
+ {
230
+ $AttributeCode = $attribute->getProductAttribute()->getAttributeCode() ;
231
+ $AttributeLabel = $attribute->getProductAttribute()->getFrontend()->getLabel() ;
232
+ $AttribId = $UsedProduct->getData($AttributeCode) ;
233
+
234
+ $AttributeValue = "" ;
235
+ foreach ( $attribute->getProductAttribute()->getSource()->getAllOptions() as $option )
236
+ {
237
+ if( $option['value'] == $AttribId )
238
+ {
239
+ $AttributeValue = $option['label'];
240
+ }
241
+ }
242
+
243
+ $ItemitemAttributes .= $AttributeLabel . "=" . $AttributeValue . "|" ;
244
+
245
+ //Get Delta Price Start
246
+ foreach( $attribute->getPrices() as $addedPrice )
247
+ {
248
+ if ( $AttributeValue == $addedPrice['label'])
249
+ {
250
+ if( $addedPrice['is_percent'] )
251
+ $UsedProductPrice += $UsedProductPrice * $addedPrice['pricing_value'] / 100;
252
+ else
253
+ $UsedProductPrice += $addedPrice['pricing_value'] ;
254
+ }
255
+ }
256
+ //Get Delta Price End
257
+ }
258
+
259
+ $ItemitemAttributes = substr($ItemitemAttributes, 0, strlen($ItemitemAttributes)-1 );
260
+
261
+ //Get Item Attributes End
262
+ //************************ Get Attributes End ************************************
263
+
264
+ //************************* Get Categories names Start ***************************
265
+
266
+ $categories = $product->getCategoryIds();
267
+
268
+ $CategoriesString = "" ;
269
+ foreach($categories as $k => $_category_id){
270
+
271
+ $_category = Mage::getModel('catalog/category')->load($_category_id) ;
272
+ $path = $_category->getPathInStore();
273
+ $pathIds = array_reverse(explode(',', $path));
274
+
275
+ foreach($pathIds as $m => $_cat_id){
276
+ $_cat = Mage::getModel('catalog/category')->load($_cat_id) ;
277
+ // if( $_cat->getName() != '' && (string)$_cat->getLevel() != '1' && !(in_array($_cat_id, $this->RootCategories)) )
278
+ if( ($_cat->getName() != '') && ($_cat->getName() != 'Root Catalog') && ((string)$_cat->getLevel() != '1') && ($_cat->getParentId() > 1 ) )
279
+ $CategoriesString .= $_cat->getName() . "#$#" ;
280
+ }
281
+
282
+ if( substr($CategoriesString, strlen($CategoriesString)-3, 3) == "#$#" )
283
+ {
284
+ $CategoriesString = substr($CategoriesString, 0, strlen($CategoriesString)-3 ) ;
285
+ $CategoriesString .= "|";
286
+ }
287
+
288
+ }
289
+
290
+ $CategoriesString = substr($CategoriesString, 0, strlen($CategoriesString)-1 ) ;
291
+
292
+ if ($CategoriesString=='') $CategoriesString = 'Uncategorized' ;
293
+
294
+ //************************* Get Categories names End ***************************
295
+
296
+ //************************* Get Reviews Start ***********************
297
+ //$enablereviews = Mage::getStoreConfig('codi/codi/codenablereviews') ;
298
+ $Reviews = $this->enablereviews ? $this->getReviews($product->getId()) : '' ;
299
+ //************************* Get Reviews End *************************
300
+
301
+ //************************* Concatenate Product Info Start ***********************
302
+ $ProducttoString .= "\r\n" . $this->cleanStr( $UsedProduct->getSku() ) ; //ItemID
303
+ $ProducttoString .= "\t" . "" ; //ItemQty
304
+ $ProducttoString .= "\t" . "" ; //ItemUom
305
+ // $ProducttoString .= "\t" . $this->cleanStr( $product->getPrice() ) ; //ItemPrice
306
+ $ProducttoString .= "\t" . $this->cleanStr( $UsedProductPrice ) ; //ItemPrice
307
+ $ProducttoString .= "\t" . ""; //ItemDescription
308
+ $ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ); //ItemLink
309
+ $ProducttoString .= "\t" . $this->cleanStr( $ItemitemAttributes ) ; //ItemitemAttributes
310
+ $ProducttoString .= "\t" . ""; //ItemitemGraphic
311
+ $ProducttoString .= "\t" . $product->getId().'#$#'.$this->cleanStr( $product->getName() ); //ProductName
312
+ $ProducttoString .= "\t" . "" ; //ProductMfg
313
+ $ProducttoString .= "\t" . $this->cleanStr( $ProductDescription ) ; //ProductDescription
314
+ $ProducttoString .= "\t" . $this->cleanStr( $ImageURL ); //ProductGraphic
315
+ $ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ) ; //ProductLink
316
+ $ProducttoString .= "\t" . $this->cleanStr( $ProductAttributes ) ; //ProductAttributes
317
+ $ProducttoString .= "\t" . $this->cleanStr( $CategoriesString ); //Category
318
+ $ProducttoString .= "\t" . $this->cleanStr( $Reviews ); //Reviews
319
+ $ProducttoString .= "\t" . $this->cleanStr( $product->getShortDescription() ); //ShortDescription (Quick Overview)
320
+ //************************* Concatenate Product Info End ************************* cleanStr
321
+ }
322
+
323
+ return $ProducttoString ;
324
+ }
325
+ /////////////////////////////////////////// Simple Products ///////////////////////////////////////////////////////////////////
326
+ public function ProducttoStringSimple( $product , $from )
327
+ {
328
+ set_time_limit(0);
329
+
330
+ $ProducttoString = '' ;
331
+ if($from == "wishlist")
332
+ {
333
+ $Comment = '' ;
334
+ //Add Comment if exist
335
+ $defaultcomment = $this->helper('wishlist')->defaultCommentString() ;
336
+ if ( $product->getWishlistItemDescription() !== $defaultcomment )
337
+ $Comment = "\\par{\\b Comment}\\par" . $product->getWishlistItemDescription() ;
338
+ //Get Full Product
339
+ $product = Mage::getModel('catalog/product')->load($product->getProductID());
340
+ //Get Product Description
341
+ $ProductDescription = $product->getDescription() ;
342
+ $ProductDescription .= $Comment ;
343
+ }
344
+ else
345
+ {
346
+ $ProductDescription = $product->getDescription() ;
347
+ }
348
+
349
+ //************************ Get Attributes Start *******************************
350
+ //Extract Attributes
351
+ //$ImageURL = (string)$this->helper('catalog/image')->init($product, 'image');
352
+ //$mediaurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
353
+ $ImageURL = $this->mediaurl . "catalog/product" . $product->getImage();
354
+
355
+ //$excludeAttr = array() ;
356
+ $attributes = $product->getAttributes();
357
+ $ItemitemAttributes = "" ;
358
+ foreach ($attributes as $attribute) {
359
+ if ($attribute->getIsVisibleOnFront() && !in_array($attribute->getAttributeCode(), array() )) {
360
+ $value = $attribute->getFrontend()->getValue($product);
361
+ if (is_string($value))
362
+ {
363
+ if (strlen($value) && $product->hasData($attribute->getAttributeCode()))
364
+ {
365
+ $ItemitemAttributes .= $attribute->getFrontend()->getLabel() . "=" . $value . "|" ;
366
+ }
367
+ }
368
+ }
369
+ }
370
+ $ItemitemAttributes = substr($ItemitemAttributes, 0, strlen($ItemitemAttributes)-1 ) ;
371
+ //************************ Get Attributes End ************************************
372
+
373
+ //************************* Get Categories names Start ***************************
374
+
375
+ $categories = $product->getCategoryIds();
376
+ $CategoriesString = "" ;
377
+ foreach($categories as $k => $_category_id){
378
+
379
+ $_category = Mage::getModel('catalog/category')->load($_category_id) ;
380
+ $path = $_category->getPathInStore();
381
+ $pathIds = array_reverse(explode(',', $path));
382
+
383
+ foreach($pathIds as $m => $_cat_id){
384
+ $_cat = Mage::getModel('catalog/category')->load($_cat_id) ;
385
+ // if( $_cat->getName() != '' && (string)$_cat->getLevel() != '1' && !(in_array($_cat_id, $this->RootCategories)) )
386
+ if( ($_cat->getName() != '') && ($_cat->getName() != 'Root Catalog') && ((string)$_cat->getLevel() != '1') && ($_cat->getParentId() > 1 ) )
387
+ $CategoriesString .= $_cat->getName() . "#$#" ;
388
+ }
389
+
390
+ if( substr($CategoriesString, strlen($CategoriesString)-3, 3) == "#$#" )
391
+ {
392
+ $CategoriesString = substr($CategoriesString, 0, strlen($CategoriesString)-3 );
393
+ $CategoriesString .= "|";
394
+ }
395
+ }
396
+
397
+ $CategoriesString = substr($CategoriesString, 0, strlen($CategoriesString)-1 ) ;
398
+ if ($CategoriesString == '' ) $CategoriesString = 'Uncategorized' ;
399
+ //************************* Get Categories names End ***************************
400
+
401
+ //************************* Get Reviews Start ***********************
402
+ //$enablereviews = Mage::getStoreConfig('codi/codi/codenablereviews') ;
403
+ //if($enablereviews) { $Reviews = $this->getReviews($product->getId()) ; }
404
+ $Reviews = $this->enablereviews ? $this->getReviews($product->getId()) : '' ;
405
+ //************************* Get Reviews End *************************
406
+
407
+ //************************* Concatenate Product Info Start ***********************
408
+
409
+ $ProducttoString .= "\r\n" . $this->cleanStr( $product->getSku() ) ; //ItemID
410
+ $ProducttoString .= "\t" . "" ; //ItemQty
411
+ $ProducttoString .= "\t" . "" ; //ItemUom
412
+ $ProducttoString .= "\t" . $this->cleanStr( $product->getFinalPrice() ) ; //ItemPrice
413
+ $ProducttoString .= "\t" . ""; //ItemDescription
414
+ $ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ); //ItemLink
415
+ $ProducttoString .= "\t" . ""; //ItemitemAttributes
416
+ $ProducttoString .= "\t" . ""; //ItemitemGraphic
417
+ $ProducttoString .= "\t" . $product->getId().'#$#'.$this->cleanStr( $product->getName() ); //ProductName
418
+ $ProducttoString .= "\t" . "" ; //ProductMfg
419
+ $ProducttoString .= "\t" . $this->cleanStr( $ProductDescription ) ; //ProductDescription
420
+ $ProducttoString .= "\t" . $this->cleanStr( $ImageURL ); //ProductGraphic
421
+ $ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ) ; //ProductLink
422
+ $ProducttoString .= "\t" . $this->cleanStr( $ItemitemAttributes ) ; //ProductAttributes
423
+ $ProducttoString .= "\t" . $this->cleanStr( $CategoriesString ); //Category
424
+ $ProducttoString .= "\t" . $this->cleanStr( $Reviews ); //Reviews
425
+ $ProducttoString .= "\t" . $this->cleanStr( $product->getShortDescription() ); //ShortDescription (Quick Overview)
426
+ //************************* Concatenate Product Info End ************************* cleanStr
427
+
428
+ return $ProducttoString ;
429
+ }
430
+
431
+ public function getReviews( $productid )
432
+ {
433
+ $reviewsCollection = $this->reviewsModel->getCollection()
434
+ ->addStoreFilter($this->StoreId)
435
+ ->addStatusFilter('approved')
436
+ ->addEntityFilter('product', $productid)
437
+ ->setDateOrder();
438
+
439
+ $Reviews = "" ;
440
+ foreach($reviewsCollection as $review)
441
+ {
442
+ $ratingCollection = $this->ratingModel
443
+ ->getResourceCollection()
444
+ ->setReviewFilter($review->getReviewId())
445
+ ->setStoreFilter($this->StoreId)
446
+ ->addRatingInfo($this->StoreId)
447
+ ->load();
448
+ $Reviews .= "<p><b>".$review->getTitle()."(". $review->getNickname() .")</b><br>".$review->getDetail()."</p>" ;
449
+ }
450
+ return $Reviews ;
451
+ }
452
+
453
+ public function getWishListDataFile()
454
+ {
455
+ $m_DataFile = '' ;
456
+
457
+ foreach($this->getWishlist() as $item):
458
+ $m_DataFile .= $this->ProducttoString($item , "wishlist" ) ;
459
+ endforeach ;
460
+
461
+ return $this->m_DataFile . $m_DataFile ;
462
+ }
463
+
464
+ public function getcurrencysign()
465
+ {
466
+ try {
467
+ $currencystr = Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE) ;
468
+ $currency = new Zend_Currency($currencystr);
469
+ Zend_Registry::set('Zend_Currency', $currency);
470
+ return $currency->getSymbol();
471
+ } catch (Exception $e) {
472
+ return "US";
473
+ }
474
+ }
475
+
476
+ public function ProcessBackgroundJob()
477
+ {
478
+ $m_DataFile = $this->getWishListDataFile() ;
479
+
480
+ $codimodel = Mage::getSingleton('codi/codi');
481
+ $userid = Mage::getStoreConfig('codi/codi/codusername') ;
482
+ $password = Mage::getStoreConfig('codi/codi/codpassword') ;
483
+
484
+ //Get Currency Sign
485
+ $currencysign = $this->getcurrencysign() ;
486
+ //Preparing the call
487
+ $UserEmail = $this->getuseremail() ;
488
+ $JobName = $this->getRequest()->getParam('JobName') ;
489
+
490
+ $options = "_JobName=" . $JobName ;
491
+ $options .= "||CurrencySymbol=" . $currencysign ;
492
+ $options .= "||ClientAppVersion=" . "Magento" . Mage::getVersion() . "-Codi" . $codimodel->version ;
493
+
494
+ $url = "https://webservices.catalog-on-demand.com/onDemandPublishingProcessor.do?Operation=ProcessBackgroundJob";
495
+ $paramsarray = array('UserID' => $userid,
496
+ 'Password' => $password,
497
+ 'Email' => $UserEmail,
498
+ 'Options' => $options,
499
+ 'DataFileText' => $m_DataFile);
500
+ //Calling
501
+ $UserEmail = Mage::getSingleton('customer/session')->getCustomer()->getEmail() ; //Get User Email
502
+ $Responsemsg = $codimodel->Call( $url, $paramsarray );
503
+ if( $Responsemsg )
504
+ {
505
+ if($Responsemsg->Message=="OK")
506
+ echo "Your Wishlist has been submitted to Catalog-On-Demand for publishing and should be complete within 5-10 minutes. Please monitor your email ($UserEmail) for a link to your PDF publication." ;
507
+ else
508
+ {
509
+ echo "Error No. " . $Responsemsg->Errors->Error->Code . "<br>";
510
+ echo $Responsemsg->Errors->Error->Description . "<br>";
511
+ }
512
+ }
513
+ else
514
+ echo "*There appears to be some problem in your installation’s ability to communicate with the Catalog-On-Demand server. Please contact Catalog-On-Demand support to report this problem." ;
515
+ }
516
+
517
+ public function cleanStr($localstr)
518
+ {
519
+ $localstr = str_replace("\t","", $localstr ) ;
520
+ $localstr = str_replace("\r\n","<br>", $localstr ) ;
521
+ $localstr = str_replace("\r","<br>", $localstr ) ;
522
+ $localstr = str_replace("\n","<br>", $localstr ) ;
523
+ return $localstr ;
524
+ }
525
+
526
+ }// class end
app/code/community/Mage/Codi/Codi_Process.php CHANGED
@@ -1,20 +1,20 @@
1
- <?php
2
-
3
- $baseDir = dirname(__FILE__);
4
-
5
- $_baseDirArray = explode("app", $baseDir);
6
- $basePath = $_baseDirArray[0].'/';
7
-
8
- require $baseDir . '/../../../../../app/Mage.php';
9
-
10
- Mage::app();
11
-
12
- Mage::log("Notice: Start Create data file.", null, "Catalog-on-demand.log");
13
-
14
- $CodiModel = Mage::getModel('codi/codi');
15
-
16
- $CodiModel->run_codi_import($basePath);
17
-
18
- Mage::log("Notice: Finish Create data file.", null, "Catalog-on-demand.log");
19
-
20
- ?>
1
+ <?php
2
+
3
+ $baseDir = dirname(__FILE__);
4
+
5
+ $_baseDirArray = explode("app", $baseDir);
6
+ $basePath = $_baseDirArray[0].'/';
7
+
8
+ require $baseDir . '/../../../../../app/Mage.php';
9
+
10
+ Mage::app();
11
+
12
+ Mage::log("Notice: Start Create data file.", null, "Catalog-on-demand.log");
13
+
14
+ $CodiModel = Mage::getModel('codi/codi');
15
+
16
+ $CodiModel->run_codi_import($basePath);
17
+
18
+ Mage::log("Notice: Finish Create data file.", null, "Catalog-on-demand.log");
19
+
20
+ ?>
app/code/community/Mage/Codi/Model/Codi.php CHANGED
@@ -7,7 +7,7 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
7
  public $userid ;
8
  public $password ;
9
  public $disableextension ;
10
- public $version = "3.0.4";
11
 
12
  public $customerid ;
13
  public $customerdatasourceid ;
@@ -38,8 +38,8 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
38
  // Get StoreID -End
39
 
40
  $this->reviewsModel = Mage::getModel('review/review') ;
41
- $this->ratingModel = Mage::getModel('rating/rating_option_vote') ;
42
- $this->mediaurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
43
  }
44
 
45
  public function setStoreConfig( $myarray )
@@ -76,7 +76,7 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
76
  //Get Application Parameters Response (Notification)
77
  $url = "https://webservices.catalog-on-demand.com/smanager/api.do?Operation=GetApplicationParameters&Application=CoDExtensionForMagento" ;
78
  $paramsarray = array('UserID' => Mage::getStoreConfig('codi/codi/codusername'),
79
- 'Password' => Mage::getStoreConfig('codi/codi/codpassword') );
80
  $Responsemsg = $this->Call( $url, $paramsarray );
81
  if ( $Responsemsg )
82
  {
@@ -206,6 +206,22 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
206
  //unlink($basePath.'CoDzip/CoDfiles/temp.txt');
207
  return true;
208
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
 
210
  public function run_codi_import_manually($basepath){
211
 
@@ -273,13 +289,147 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
273
  {
274
  return $this->ProducttoStringConfigurable( $product , $from ) ;
275
  }
276
- else
 
 
 
 
 
277
  {
278
  return $this->ProducttoStringSimple( $product , $from ) ;
279
  }
280
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
 
282
- public function ProducttoStringConfigurable( $product , $from )
 
 
283
  {
284
  $ProducttoString = '' ;
285
  $UsedProductIds = Mage::getModel('catalog/product_type_configurable')->getUsedProductIds($product);
@@ -289,7 +439,7 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
289
  {
290
  $ProductDescription .= $product->getShortDescription();
291
  }
292
- $ProductDescription .= $product->getDescription() ;
293
  //Get Product Attributes Start
294
  //$excludeAttr = array() ;
295
  $attributes = $product->getAttributes();
@@ -423,6 +573,8 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
423
 
424
  return $ProducttoString ;
425
  }
 
 
426
  /////////////////////////////////////////// Simple Products ///////////////////////////////////////////////////////////////////
427
  public function ProducttoStringSimple( $product , $from )
428
  {
@@ -1111,6 +1263,36 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
1111
  }
1112
 
1113
  return false;
1114
- } //Function for save data import progress status public function saveProgressData() { echo $tableName = Mage::getSingleton('core/resource')->getTableName('codi_progress_status'); die(); $write = Mage::getSingleton('core/resource')->getConnection('core_write'); if($update==0) $query = "insert into ".$tableName." (message, finished,created_time) values('".$message."', $finished,$created_time)"; else $query = "update ".$tableName." set message=".$message.", finished=".$finished.", created_time =".$created_time; $write->query($query); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1115
 
1116
  }
7
  public $userid ;
8
  public $password ;
9
  public $disableextension ;
10
+ public $version = "3.0.6";
11
 
12
  public $customerid ;
13
  public $customerdatasourceid ;
38
  // Get StoreID -End
39
 
40
  $this->reviewsModel = Mage::getModel('review/review') ;
41
+ $this->ratingModel = Mage::getModel('rating/rating_option_vote') ;
42
+ $this->mediaurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
43
  }
44
 
45
  public function setStoreConfig( $myarray )
76
  //Get Application Parameters Response (Notification)
77
  $url = "https://webservices.catalog-on-demand.com/smanager/api.do?Operation=GetApplicationParameters&Application=CoDExtensionForMagento" ;
78
  $paramsarray = array('UserID' => Mage::getStoreConfig('codi/codi/codusername'),
79
+ 'Password' => Mage::getStoreConfig('codi/codi/codpassword') );
80
  $Responsemsg = $this->Call( $url, $paramsarray );
81
  if ( $Responsemsg )
82
  {
206
  //unlink($basePath.'CoDzip/CoDfiles/temp.txt');
207
  return true;
208
  }
209
+
210
+ //Changed in 3.0.6
211
+ public function createFileInit($basePath){
212
+
213
+ $fh = fopen($basePath.'CoDzip/CoDfiles/ttemp.txt', 'w');
214
+
215
+ if ( !$fh )
216
+ {
217
+ return false;
218
+ }
219
+
220
+ fclose($fh);
221
+
222
+ unlink($basePath.'CoDzip/CoDfiles/ttemp.txt');
223
+ return true;
224
+ }
225
 
226
  public function run_codi_import_manually($basepath){
227
 
289
  {
290
  return $this->ProducttoStringConfigurable( $product , $from ) ;
291
  }
292
+
293
+ elseif( $product->isGrouped() )
294
+ {
295
+ return $this->ProducttoStringGrouped( $product , $from ) ;
296
+ }
297
+ else
298
  {
299
  return $this->ProducttoStringSimple( $product , $from ) ;
300
  }
301
  }
302
+ ////////////////////////////////////// Grouped Products //////////////////////////////////////////////////////////
303
+ public function ProducttoStringGrouped( $product , $from )
304
+ {
305
+ $ProducttoString = '' ;
306
+ $getAssociatedProductIds = Mage::getModel('catalog/product_type_grouped')->getAssociatedProductIds($product);
307
+
308
+ $ProductDescription = '';
309
+ if(Mage::getStoreConfig('codi/codi/codincludeshortdescription')=="checked")
310
+ {
311
+ $ProductDescription .= $product->getShortDescription();
312
+ }
313
+ $ProductDescription .= $product->getDescription() ;
314
+
315
+ //Get Product Attributes Start
316
+ $attributes = $product->getAttributes();
317
+
318
+ $ProductAttributes = "" ;
319
+ foreach ($attributes as $attribute) {
320
+ if ($attribute->getIsVisibleOnFront() && !in_array($attribute->getAttributeCode(), array() )) {
321
+ $value = $attribute->getFrontend()->getValue($product);
322
+ if (is_string($value))
323
+ {
324
+ if (strlen($value) && $product->hasData($attribute->getAttributeCode()))
325
+ {
326
+ $ProductAttributes .= $attribute->getFrontend()->getLabel() . "=" . $value . "|" ;
327
+ }
328
+ }
329
+ }
330
+ }
331
+ $ProductAttributes = substr($ProductAttributes, 0, strlen($ProductAttributes)-1 ) ;
332
+ //Get Product Attributes End
333
+
334
+ //******************** Get Tier Price option *********************//
335
+
336
+ if(Mage::getStoreConfig('codi/codi/codpublishtieredpricing')=='checked')
337
+ {
338
+ $TierPriceAttributes =Mage::helper('codi')->geTierprice($product);
339
+ $sp="|";
340
+ if(($ProductAttributes=='') || ($TierPriceAttributes==''))
341
+ $sp='';
342
+
343
+ if($ProductAttributes=='')
344
+
345
+
346
+ $ProductAttributes.= $sp.$TierPriceAttributes;
347
+ }
348
+ //************End Tier Price option *************//
349
+ //************************* Get Categories names Start ***************************
350
+ //Changed in 3.0.3 removed the category names
351
+ $CategoriesString = "" ;
352
+
353
+ //************************* Get Categories names End ***************************
354
+
355
+
356
+ foreach($getAssociatedProductIds as $UsedProductid)
357
+ {
358
+ $UsedProduct = Mage::getModel('catalog/product')->load($UsedProductid);
359
+ $ItemName= $UsedProduct->getName() ;
360
+ if( Mage::getStoreConfig('codi/codi/fromchild') )
361
+ $UsedProductPrice = $UsedProduct->getFinalPrice() ;
362
+ else
363
+ $UsedProductPrice = $UsedProduct->getFinalPrice() ; //default behavior
364
+ //************************ Get Attributes Start *******************************
365
+
366
+ //Extract Attributes
367
+
368
+ $ImageURL = $this->mediaurl . "catalog/product" . $product->getImage();
369
+ $ItemImageURL = $this->mediaurl . "catalog/product" . $UsedProduct->getImage();
370
+ //Get Item Attributes Start
371
+
372
+ //$excludeAttr = array() ;
373
+ $attributes = $UsedProduct->getAttributes();
374
+ $ItemitemAttributes = "" ;
375
+ foreach ($attributes as $attribute) {
376
+ if ($attribute->getIsVisibleOnFront() && !in_array($attribute->getAttributeCode(), array() )) {
377
+ $value = $attribute->getFrontend()->getValue($UsedProduct);
378
+ if (is_string($value))
379
+ {
380
+ if (strlen($value) && $UsedProduct->hasData($attribute->getAttributeCode()))
381
+ {
382
+ $ItemitemAttributes .= $attribute->getFrontend()->getLabel() . "=" . $value . "|" ;
383
+ }
384
+ }
385
+ }
386
+ }
387
+ $ItemitemAttributes = substr($ItemitemAttributes, 0, strlen($ItemitemAttributes)-1 ) ;
388
+
389
+
390
+
391
+ //Get Item Attributes End
392
+ //************************ Get Attributes End ************************************
393
+ //************************* Get Reviews Start ***********************
394
+ //$enablereviews = Mage::getStoreConfig('codi/codi/codenablereviews') ;
395
+ $Reviews = $this->enablereviews ? $this->getReviews($product->getId()) : '' ;
396
+ //************************* Get Reviews End *************************
397
+
398
+ //************************* Concatenate Product Info Start ***********************
399
+ $ProducttoString .= "\r\n" . $this->cleanStr( $UsedProduct->getSku() ) ; //ItemID
400
+ $ProducttoString .= "\t" . "" ; //ItemQty
401
+ $ProducttoString .= "\t" . "" ; //ItemUom
402
+ // $ProducttoString .= "\t" . $this->cleanStr( $product->getPrice() ) ; //ItemPrice
403
+ $ProducttoString .= "\t" . $this->cleanStr( $UsedProductPrice ) ; //ItemPrice
404
+ $ProducttoString .= "\t" . $this->cleanStr( $ItemName) ; //ItemDescription
405
+ $ProducttoString .= "\t" . $this->cleanStr( $UsedProduct ->getProductUrl() ); //ItemLink
406
+ $ProducttoString .= "\t" . $this->cleanStr( $ItemitemAttributes ) ; //ItemitemAttributes
407
+ $ProducttoString .= "\t" . $this->cleanStr( $ItemImageURL ) ; //ItemitemGraphic
408
+ $ProducttoString .= "\t" . $product->getId().'#$#'.$this->cleanStr( $product->getName() ); //ProductName
409
+ $ProducttoString .= "\t" . "" ; //ProductMfg
410
+ $ProducttoString .= "\t" . $this->cleanStr( $ProductDescription ) ; //ProductDescription
411
+ $ProducttoString .= "\t" . $this->cleanStr( $ImageURL ); //ProductGraphic
412
+ $ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ) ; //ProductLink
413
+ $ProducttoString .= "\t" . $this->cleanStr( $ProductAttributes ) ; //ProductAttributes
414
+ $ProducttoString .= "\t" . $this->cleanStr( $CategoriesString ); //Category
415
+ $ProducttoString .= "\t" . $this->cleanStr( $Reviews ); //Reviews
416
+ $ProducttoString .= "\t" . $this->cleanStr( $product->getShortDescription() ); //ShortDescription (Quick Overview)
417
+ //************************* Concatenate Product Info End ************************* cleanStr
418
+ }
419
+ unset($ProductDescription);
420
+ unset($ImageURL);
421
+ unset($product);
422
+ unset($ItemitemAttributes);
423
+ unset($CategoriesString);
424
+ unset($Reviews);
425
+ unset($UsedProduct);
426
+
427
+ return $ProducttoString ;
428
+ }
429
 
430
+
431
+ ////////////////////////////////////// Configurable Products //////////////////////////////////////////////////////////
432
+ public function ProducttoStringConfigurable( $product , $from )
433
  {
434
  $ProducttoString = '' ;
435
  $UsedProductIds = Mage::getModel('catalog/product_type_configurable')->getUsedProductIds($product);
439
  {
440
  $ProductDescription .= $product->getShortDescription();
441
  }
442
+ else $ProductDescription .= $product->getDescription() ;
443
  //Get Product Attributes Start
444
  //$excludeAttr = array() ;
445
  $attributes = $product->getAttributes();
573
 
574
  return $ProducttoString ;
575
  }
576
+
577
+
578
  /////////////////////////////////////////// Simple Products ///////////////////////////////////////////////////////////////////
579
  public function ProducttoStringSimple( $product , $from )
580
  {
1263
  }
1264
 
1265
  return false;
1266
+ } //Function for save data import progress status
1267
+
1268
+ public function saveProgressData($message='start',$finished=0,$created_time='',$update=0,$var='')
1269
+ {
1270
+ $tableName = Mage::getSingleton('core/resource')->getTableName('codi_progress_status');
1271
+ $write = Mage::getSingleton('core/resource')->getConnection('core_write');
1272
+ if($update==0)
1273
+ {
1274
+ $query = "insert into ".$tableName." (message, finished,created_time) values('".$message."', $finished,$created_time)";
1275
+ }
1276
+ else
1277
+ {
1278
+ /*$query = "update ".$tableName." set message='".$message."', finished=".$finished.", created_time =".$created_time." where id=".$var;*/
1279
+ $query = "delete FROM ".$tableName." where finished=1";
1280
+
1281
+ }
1282
+ $write->query($query);
1283
+ return $write->lastInsertId();
1284
+ }
1285
+
1286
+ //Function to get last row details
1287
+ public function getstatus()
1288
+ {
1289
+ $tableName = Mage::getSingleton('core/resource')->getTableName('codi_progress_status');
1290
+ $write = Mage::getSingleton('core/resource')->getConnection('core_write');
1291
+
1292
+ $query = "select message,finished,created_time from ".$tableName." where finished=1 order by id desc limit 1";
1293
+ $var=$write->query($query);
1294
+
1295
+ return $var;
1296
+ }
1297
 
1298
  }
app/code/community/Mage/Codi/controllers/Adminhtml/MenuController.php CHANGED
@@ -1,327 +1,327 @@
1
- <?php
2
- ini_set("max_execution_time", 3600);
3
- ini_set('session.gc_maxlifetime', 3600);
4
- ini_set("memory_limit","512M");
5
-
6
- class Mage_Codi_Adminhtml_MenuController extends Mage_Adminhtml_Controller_Action
7
- {
8
-
9
- public $CodiBlock ;
10
-
11
- protected function _construct()
12
- {
13
- $this->CodiBlock = $this->getLayout()->createBlock('codi/customer_codi');
14
- $this->_logFile = "Catalog-on-demand.log";
15
- }
16
-
17
- public function indexAction()
18
- {
19
- $this->loadLayout();
20
- $this->_setActiveMenu('catalog');
21
- $this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
22
- $this->renderLayout();
23
- }
24
-
25
- public function authAction()
26
- {
27
- $codimodel = Mage::getSingleton('codi/codi');
28
- $codimodel->target = "auth";
29
- $this->loadLayout();
30
- $this->_setActiveMenu('catalog');
31
- $this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
32
- $this->renderLayout();
33
- }
34
-
35
- public function systemtestAction(){
36
-
37
- $codimodel = Mage::getSingleton('codi/codi');
38
- $codimodel->target = "systemtest";
39
- $this->loadLayout();
40
- $this->_setActiveMenu('catalog');
41
- $this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
42
- $this->renderLayout();
43
- }
44
-
45
- public function createAction(){
46
-
47
- $codimodel = Mage::getSingleton('codi/codi');
48
- $codimodel->target = "create";
49
- $this->loadLayout();
50
- $this->_setActiveMenu('catalog');
51
- $this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
52
- $this->renderLayout();
53
- }
54
-
55
- public function createfileAction(){
56
-
57
- $codimodel = Mage::getSingleton('codi/codi');
58
-
59
- $dir = dirname(__FILE__);
60
-
61
- $_baseDirArray = explode("app", $dir);
62
- $basePath = $_baseDirArray[0].'/';
63
-
64
- if ( !$codimodel->createFile($basePath) ){
65
- Mage::log("ERROR : Cannot create file : ".$basePath, null, $this->_logFile);
66
- print '{"error": "1"}';
67
- return;
68
- }
69
-
70
- $is_process = $this->getRequest()->getParam('is_process');
71
-
72
- Mage::log("Notice: Mage_Codi_MenuController Process : ".$is_process, null, $this->_logFile);
73
-
74
- if ( $is_process == 1 ){
75
-
76
- if( false !== strpos(ini_get("disable_functions"), "exec") ) {
77
-
78
- $this->bgCheckSave();
79
-
80
- print '{"exec": "1"}';
81
-
82
- }else if ( false !== strpos(ini_get("disable_functions"), "shell_exec") ){
83
-
84
- $this->bgCheckSave();
85
-
86
- print '{"shellexec": "1"}';
87
- }else{
88
-
89
- $output = shell_exec("ps ax | grep php");
90
-
91
- Mage::log("Notice: Mage_Codi_MenuController Process : ".$output, null, $this->_logFile);
92
-
93
- if ( strpos($output, "php5") !== false ){
94
- exec("nohup php5 ".$dir."/../../Codi_Process.php > /dev/null & echo $!");
95
- Mage::log("Notice: Mage_Codi_MenuController Process : php5 ", null, $this->_logFile);
96
- }else{
97
- exec("nohup php ".$dir."/../../Codi_Process.php > /dev/null & echo $!");
98
- Mage::log("Notice: Mage_Codi_MenuController Process : php ", null, $this->_logFile);
99
- }
100
-
101
- $codimodel->addImportStatus('auto', 0);
102
- Mage::log("Notice: Mage_Codi_MenuController Process : auto ", null, $this->_logFile);
103
-
104
- print '{"success": "1"}';
105
- }
106
- }
107
- else{
108
-
109
- $codimodel->addImportStatus('manual', 0);
110
-
111
- print '{"success": "1"}';
112
-
113
- }
114
- }
115
-
116
- public function cancelAction(){
117
-
118
- $codimodel = Mage::getSingleton('codi/codi');
119
- $codimodel->addImportStatus('cancel', 1);
120
-
121
- print "cancel";
122
- }
123
-
124
- public function updatestatusAction()
125
- {
126
- $codimodel = Mage::getSingleton('codi/codi');
127
- $message = $codimodel->getImportStatuses();
128
-
129
- $dir = dirname(__FILE__);
130
- $_baseDirArray = explode("app", $dir);
131
- $basePath = $_baseDirArray[0].'/';
132
-
133
- $status = 0;
134
- if ( isset($message) ){
135
-
136
- $status = $message['message'];
137
-
138
- if ( $status== "end" && $message['finished'] == 1 ){
139
-
140
- @unlink($basePath."CoDZip/CoDfiles/temp.txt");
141
- $codimodel->deleteTable();
142
- print '{"finished": "1"}';
143
-
144
- }else if ( $status== "cancel" && $message['finished'] == 1 ) {
145
-
146
- @unlink($basePath."CoDZip/CoDfiles/temp.txt");
147
- $codimodel->deleteTable();
148
- print '{"canceled": "1"}';
149
-
150
- }else if ( $status== "start" && $message['finished'] == 0 ) {
151
-
152
- print '{"processed": "1"}';
153
-
154
- }else if ( $status== "fileerror" && $message['finished'] == 1 ) {
155
-
156
- @unlink($basePath."CoDZip/CoDfiles/temp.txt");
157
- $codimodel->deleteTable();
158
- print '{"fileerror": "1"}';
159
-
160
- }else if ( $status== "manual" && $message['finished'] == 0 ) {
161
-
162
- print '{"processed": "1"}';
163
- $codimodel->run_codi_import_manually($basePath);
164
-
165
- }else if ( $status== "auto" && $message['finished'] == 0 ){
166
- if ( !$codimodel->isStart() ){
167
- @unlink($basePath."CoDZip/CoDfiles/temp.txt");
168
- $codimodel->deleteTable();
169
- print '{"error": "1"}';
170
- }
171
- }
172
- }
173
- }
174
-
175
- public function bgcheckAction(){
176
-
177
- $checked = $this->getRequest()->getParam('check');
178
-
179
- $this->bgCheckSave($checked);
180
- }
181
-
182
- public function bgCheckSave($checked=0){
183
-
184
- $codimodel = Mage::getSingleton('codi/codi');
185
-
186
- $codimodel->setStoreConfig(
187
- array(
188
- "codbgcheck" => array ('value' => $checked)
189
- )
190
- );
191
-
192
- Mage::app()->getCacheInstance()->cleanType('config');
193
- }
194
-
195
- public function authsaveAction()
196
- {
197
- $userid = strtolower((string)$this->getRequest()->getParam('userid'));
198
- $password = (string)$this->getRequest()->getParam('password');
199
- $secretkey = (string)$this->getRequest()->getParam('secretkey');
200
- $enablefreshflyers = (string)$this->getRequest()->getParam('enablefreshflyers');
201
- $enablereviews = (string)$this->getRequest()->getParam('enablereviews');
202
- $fromchild = (string)$this->getRequest()->getParam('fromchild');
203
-
204
- $codflyerlinkimg = (string)$this->getRequest()->getParam('codflyerlinkimg');
205
- $codflyerlinkimgurl = (string)$this->getRequest()->getParam('codflyerlinkimgurl');
206
- $codflyerlinkimgalt = (string)$this->getRequest()->getParam('codflyerlinkimgalt');
207
-
208
- $codbeforename = (string)$this->getRequest()->getParam('codbeforename');
209
- $codaftername = (string)$this->getRequest()->getParam('codaftername');
210
-
211
- $codbeforeemailto = (string)$this->getRequest()->getParam('codbeforeemailto');
212
- $codafteremailto = (string)$this->getRequest()->getParam('codafteremailto');
213
-
214
- $codbeforeOR = (string)$this->getRequest()->getParam('codbeforeOR');
215
- $codafterOR = (string)$this->getRequest()->getParam('codafterOR');
216
-
217
- $codbeforeoverview = (string)$this->getRequest()->getParam('codbeforeoverview');
218
- $codafteroverview = (string)$this->getRequest()->getParam('codafteroverview');
219
-
220
- //ver 2.2.16
221
- $coddatafilelaunch = (string)$this->getRequest()->getParam('datafilelaunch');
222
- //for waitfor minute
223
-
224
- $waitforminute = (string)$this->getRequest()->getParam('waitforminute');
225
- $includeshortdescription = (string)$this->getRequest()->getParam('includeshortdescription');
226
-
227
- //Code for Tier pricing
228
- $codpublishtieredpricing=(string)$this->getRequest()->getParam('publishtieredpricing');
229
- $codquantity=(string)$this->getRequest()->getParam('codquantity');
230
- $codprice=(string)$this->getRequest()->getParam('codprice');
231
- $codsavings=(string)$this->getRequest()->getParam('codsavings');
232
-
233
-
234
- $codimodel = Mage::getSingleton('codi/codi');
235
-
236
- $codimodel->setStoreConfig(
237
- array(
238
- "codusername" => array ('value' => $userid) ,
239
- "codpassword" => array ('value' => $password) ,
240
- "secretkey" => array ('value' => $secretkey) ,
241
- "enablefreshflyers" => array ('value' => $enablefreshflyers) ,
242
- "codenablereviews" => array ('value' => $enablereviews) ,
243
- "fromchild" => array ('value' => $fromchild) ,
244
- "codflyerlinkimg" => array ('value' => $codflyerlinkimg) ,
245
- "codflyerlinkimgurl" => array ('value' => $codflyerlinkimgurl) ,
246
- "codflyerlinkimgalt" => array ('value' => $codflyerlinkimgalt) ,
247
- "codbeforename" => array ('value' => $codbeforename) ,
248
- "codaftername" => array ('value' => $codaftername) ,
249
- "codbeforeemailto" => array ('value' => $codbeforeemailto) ,
250
- "codafteremailto" => array ('value' => $codafteremailto) ,
251
- "codbeforeOR" => array ('value' => $codbeforeOR) ,
252
- "codafterOR" => array ('value' => $codafterOR) ,
253
- "codbeforeoverview" => array ('value' => $codbeforeoverview) ,
254
- "codafteroverview" => array ('value' => $codafteroverview) ,
255
- "coddatafilelaunch" => array ('value' => $coddatafilelaunch) ,
256
- "codwaitforminute" => array ('value' => $waitforminute),
257
- "codincludeshortdescription" => array ('value' => $includeshortdescription),
258
- "codpublishtieredpricing" => array ('value' => $codpublishtieredpricing),
259
- "codquantity" => array ('value' => $codquantity),
260
- "codprice" => array ('value' => $codprice),
261
- "codsavings" => array ('value' => $codsavings),
262
- )
263
- );
264
-
265
- Mage::app()->getCacheInstance()->cleanType('config');
266
-
267
- $this->_redirect('codi/adminhtml_menu/auth');
268
- }
269
-
270
- public function registerAction()
271
- {
272
- $codimodel = Mage::getSingleton('codi/codi');
273
- $codimodel->target = "register";
274
- $this->loadLayout();
275
- $this->_setActiveMenu('catalog');
276
- $this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
277
- $this->renderLayout();
278
- }
279
-
280
- public function documentationAction()
281
- {
282
- $codimodel = Mage::getSingleton('codi/codi');
283
- $codimodel->target = "documentation";
284
- $this->loadLayout();
285
- $this->_setActiveMenu('catalog');
286
- $this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
287
- $this->renderLayout();
288
- }
289
-
290
- //Change for version 2.2.15
291
- public function downloadtestAction(){
292
-
293
- $codimodel = Mage::getSingleton('codi/codi');
294
- $codimodel->target = "auth";
295
- $helper=Mage::helper('codi');
296
- $filename='CoDMagento.zip';
297
- //Change for zip code
298
- $helper->output_file('CoDzip/CoDMagento.zip',$filename , 'application/zip');
299
- $this->loadLayout();
300
- $this->_setActiveMenu('catalog');
301
- $this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
302
- $this->renderLayout();
303
- }
304
- public function deletetestAction()
305
- {
306
- $dir = dirname(__FILE__);
307
-
308
- $_baseDirArray = explode("app", $dir);
309
- $basePath = $_baseDirArray[0].'/';
310
-
311
-
312
- $codimodel = Mage::getSingleton('codi/codi');
313
- $codimodel->target = "auth";
314
- $helper=Mage::helper('codi');
315
- //change for zip file
316
- $filename='/CoDzip/CoDMagento.zip';
317
- $helper->deleteFile($basePath,$filename);
318
- $this->loadLayout();
319
- $this->_setActiveMenu('catalog');
320
- $this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
321
- $this->renderLayout();
322
- $this->_redirect('codi/adminhtml_menu/auth');
323
-
324
-
325
- }
326
-
327
- }
1
+ <?php
2
+ ini_set("max_execution_time", 3600);
3
+ ini_set('session.gc_maxlifetime', 3600);
4
+ ini_set("memory_limit","512M");
5
+
6
+ class Mage_Codi_Adminhtml_MenuController extends Mage_Adminhtml_Controller_Action
7
+ {
8
+
9
+ public $CodiBlock ;
10
+
11
+ protected function _construct()
12
+ {
13
+ $this->CodiBlock = $this->getLayout()->createBlock('codi/customer_codi');
14
+ $this->_logFile = "Catalog-on-demand.log";
15
+ }
16
+
17
+ public function indexAction()
18
+ {
19
+ $this->loadLayout();
20
+ $this->_setActiveMenu('catalog');
21
+ $this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
22
+ $this->renderLayout();
23
+ }
24
+
25
+ public function authAction()
26
+ {
27
+ $codimodel = Mage::getSingleton('codi/codi');
28
+ $codimodel->target = "auth";
29
+ $this->loadLayout();
30
+ $this->_setActiveMenu('catalog');
31
+ $this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
32
+ $this->renderLayout();
33
+ }
34
+
35
+ public function systemtestAction(){
36
+
37
+ $codimodel = Mage::getSingleton('codi/codi');
38
+ $codimodel->target = "systemtest";
39
+ $this->loadLayout();
40
+ $this->_setActiveMenu('catalog');
41
+ $this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
42
+ $this->renderLayout();
43
+ }
44
+
45
+ public function createAction(){
46
+
47
+ $codimodel = Mage::getSingleton('codi/codi');
48
+ $codimodel->target = "create";
49
+ $this->loadLayout();
50
+ $this->_setActiveMenu('catalog');
51
+ $this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
52
+ $this->renderLayout();
53
+ }
54
+
55
+ public function createfileAction(){
56
+
57
+ $codimodel = Mage::getSingleton('codi/codi');
58
+
59
+ $dir = dirname(__FILE__);
60
+
61
+ $_baseDirArray = explode("app", $dir);
62
+ $basePath = $_baseDirArray[0].'/';
63
+
64
+ if ( !$codimodel->createFile($basePath) ){
65
+ Mage::log("ERROR : Cannot create file : ".$basePath, null, $this->_logFile);
66
+ print '{"error": "1"}';
67
+ return;
68
+ }
69
+
70
+ $is_process = $this->getRequest()->getParam('is_process');
71
+
72
+ Mage::log("Notice: Mage_Codi_MenuController Process : ".$is_process, null, $this->_logFile);
73
+
74
+ if ( $is_process == 1 ){
75
+
76
+ if( false !== strpos(ini_get("disable_functions"), "exec") ) {
77
+
78
+ $this->bgCheckSave();
79
+
80
+ print '{"exec": "1"}';
81
+
82
+ }else if ( false !== strpos(ini_get("disable_functions"), "shell_exec") ){
83
+
84
+ $this->bgCheckSave();
85
+
86
+ print '{"shellexec": "1"}';
87
+ }else{
88
+
89
+ $output = shell_exec("ps ax | grep php");
90
+
91
+ Mage::log("Notice: Mage_Codi_MenuController Process : ".$output, null, $this->_logFile);
92
+
93
+ if ( strpos($output, "php5") !== false ){
94
+ exec("nohup php5 ".$dir."/../../Codi_Process.php > /dev/null & echo $!");
95
+ Mage::log("Notice: Mage_Codi_MenuController Process : php5 ", null, $this->_logFile);
96
+ }else{
97
+ exec("nohup php ".$dir."/../../Codi_Process.php > /dev/null & echo $!");
98
+ Mage::log("Notice: Mage_Codi_MenuController Process : php ", null, $this->_logFile);
99
+ }
100
+
101
+ $codimodel->addImportStatus('auto', 0);
102
+ Mage::log("Notice: Mage_Codi_MenuController Process : auto ", null, $this->_logFile);
103
+
104
+ print '{"success": "1"}';
105
+ }
106
+ }
107
+ else{
108
+
109
+ $codimodel->addImportStatus('manual', 0);
110
+
111
+ print '{"success": "1"}';
112
+
113
+ }
114
+ }
115
+
116
+ public function cancelAction(){
117
+
118
+ $codimodel = Mage::getSingleton('codi/codi');
119
+ $codimodel->addImportStatus('cancel', 1);
120
+
121
+ print "cancel";
122
+ }
123
+
124
+ public function updatestatusAction()
125
+ {
126
+ $codimodel = Mage::getSingleton('codi/codi');
127
+ $message = $codimodel->getImportStatuses();
128
+
129
+ $dir = dirname(__FILE__);
130
+ $_baseDirArray = explode("app", $dir);
131
+ $basePath = $_baseDirArray[0].'/';
132
+
133
+ $status = 0;
134
+ if ( isset($message) ){
135
+
136
+ $status = $message['message'];
137
+
138
+ if ( $status== "end" && $message['finished'] == 1 ){
139
+
140
+ @unlink($basePath."CoDZip/CoDfiles/temp.txt");
141
+ $codimodel->deleteTable();
142
+ print '{"finished": "1"}';
143
+
144
+ }else if ( $status== "cancel" && $message['finished'] == 1 ) {
145
+
146
+ @unlink($basePath."CoDZip/CoDfiles/temp.txt");
147
+ $codimodel->deleteTable();
148
+ print '{"canceled": "1"}';
149
+
150
+ }else if ( $status== "start" && $message['finished'] == 0 ) {
151
+
152
+ print '{"processed": "1"}';
153
+
154
+ }else if ( $status== "fileerror" && $message['finished'] == 1 ) {
155
+
156
+ @unlink($basePath."CoDZip/CoDfiles/temp.txt");
157
+ $codimodel->deleteTable();
158
+ print '{"fileerror": "1"}';
159
+
160
+ }else if ( $status== "manual" && $message['finished'] == 0 ) {
161
+
162
+ print '{"processed": "1"}';
163
+ $codimodel->run_codi_import_manually($basePath);
164
+
165
+ }else if ( $status== "auto" && $message['finished'] == 0 ){
166
+ if ( !$codimodel->isStart() ){
167
+ @unlink($basePath."CoDZip/CoDfiles/temp.txt");
168
+ $codimodel->deleteTable();
169
+ print '{"error": "1"}';
170
+ }
171
+ }
172
+ }
173
+ }
174
+
175
+ public function bgcheckAction(){
176
+
177
+ $checked = $this->getRequest()->getParam('check');
178
+
179
+ $this->bgCheckSave($checked);
180
+ }
181
+
182
+ public function bgCheckSave($checked=0){
183
+
184
+ $codimodel = Mage::getSingleton('codi/codi');
185
+
186
+ $codimodel->setStoreConfig(
187
+ array(
188
+ "codbgcheck" => array ('value' => $checked)
189
+ )
190
+ );
191
+
192
+ Mage::app()->getCacheInstance()->cleanType('config');
193
+ }
194
+
195
+ public function authsaveAction()
196
+ {
197
+ $userid = strtolower((string)$this->getRequest()->getParam('userid'));
198
+ $password = (string)$this->getRequest()->getParam('password');
199
+ $secretkey = (string)$this->getRequest()->getParam('secretkey');
200
+ $enablefreshflyers = (string)$this->getRequest()->getParam('enablefreshflyers');
201
+ $enablereviews = (string)$this->getRequest()->getParam('enablereviews');
202
+ $fromchild = (string)$this->getRequest()->getParam('fromchild');
203
+
204
+ $codflyerlinkimg = (string)$this->getRequest()->getParam('codflyerlinkimg');
205
+ $codflyerlinkimgurl = (string)$this->getRequest()->getParam('codflyerlinkimgurl');
206
+ $codflyerlinkimgalt = (string)$this->getRequest()->getParam('codflyerlinkimgalt');
207
+
208
+ $codbeforename = (string)$this->getRequest()->getParam('codbeforename');
209
+ $codaftername = (string)$this->getRequest()->getParam('codaftername');
210
+
211
+ $codbeforeemailto = (string)$this->getRequest()->getParam('codbeforeemailto');
212
+ $codafteremailto = (string)$this->getRequest()->getParam('codafteremailto');
213
+
214
+ $codbeforeOR = (string)$this->getRequest()->getParam('codbeforeOR');
215
+ $codafterOR = (string)$this->getRequest()->getParam('codafterOR');
216
+
217
+ $codbeforeoverview = (string)$this->getRequest()->getParam('codbeforeoverview');
218
+ $codafteroverview = (string)$this->getRequest()->getParam('codafteroverview');
219
+
220
+ //ver 2.2.16
221
+ $coddatafilelaunch = (string)$this->getRequest()->getParam('datafilelaunch');
222
+ //for waitfor minute
223
+
224
+ $waitforminute = (string)$this->getRequest()->getParam('waitforminute');
225
+ $includeshortdescription = (string)$this->getRequest()->getParam('includeshortdescription');
226
+
227
+ //Code for Tier pricing
228
+ $codpublishtieredpricing=(string)$this->getRequest()->getParam('publishtieredpricing');
229
+ $codquantity=(string)$this->getRequest()->getParam('codquantity');
230
+ $codprice=(string)$this->getRequest()->getParam('codprice');
231
+ $codsavings=(string)$this->getRequest()->getParam('codsavings');
232
+
233
+
234
+ $codimodel = Mage::getSingleton('codi/codi');
235
+
236
+ $codimodel->setStoreConfig(
237
+ array(
238
+ "codusername" => array ('value' => $userid) ,
239
+ "codpassword" => array ('value' => $password) ,
240
+ "secretkey" => array ('value' => $secretkey) ,
241
+ "enablefreshflyers" => array ('value' => $enablefreshflyers) ,
242
+ "codenablereviews" => array ('value' => $enablereviews) ,
243
+ "fromchild" => array ('value' => $fromchild) ,
244
+ "codflyerlinkimg" => array ('value' => $codflyerlinkimg) ,
245
+ "codflyerlinkimgurl" => array ('value' => $codflyerlinkimgurl) ,
246
+ "codflyerlinkimgalt" => array ('value' => $codflyerlinkimgalt) ,
247
+ "codbeforename" => array ('value' => $codbeforename) ,
248
+ "codaftername" => array ('value' => $codaftername) ,
249
+ "codbeforeemailto" => array ('value' => $codbeforeemailto) ,
250
+ "codafteremailto" => array ('value' => $codafteremailto) ,
251
+ "codbeforeOR" => array ('value' => $codbeforeOR) ,
252
+ "codafterOR" => array ('value' => $codafterOR) ,
253
+ "codbeforeoverview" => array ('value' => $codbeforeoverview) ,
254
+ "codafteroverview" => array ('value' => $codafteroverview) ,
255
+ "coddatafilelaunch" => array ('value' => $coddatafilelaunch) ,
256
+ "codwaitforminute" => array ('value' => $waitforminute),
257
+ "codincludeshortdescription" => array ('value' => $includeshortdescription),
258
+ "codpublishtieredpricing" => array ('value' => $codpublishtieredpricing),
259
+ "codquantity" => array ('value' => $codquantity),
260
+ "codprice" => array ('value' => $codprice),
261
+ "codsavings" => array ('value' => $codsavings),
262
+ )
263
+ );
264
+
265
+ Mage::app()->getCacheInstance()->cleanType('config');
266
+
267
+ $this->_redirect('codi/adminhtml_menu/auth');
268
+ }
269
+
270
+ public function registerAction()
271
+ {
272
+ $codimodel = Mage::getSingleton('codi/codi');
273
+ $codimodel->target = "register";
274
+ $this->loadLayout();
275
+ $this->_setActiveMenu('catalog');
276
+ $this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
277
+ $this->renderLayout();
278
+ }
279
+
280
+ public function documentationAction()
281
+ {
282
+ $codimodel = Mage::getSingleton('codi/codi');
283
+ $codimodel->target = "documentation";
284
+ $this->loadLayout();
285
+ $this->_setActiveMenu('catalog');
286
+ $this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
287
+ $this->renderLayout();
288
+ }
289
+
290
+ //Change for version 2.2.15
291
+ public function downloadtestAction(){
292
+
293
+ $codimodel = Mage::getSingleton('codi/codi');
294
+ $codimodel->target = "auth";
295
+ $helper=Mage::helper('codi');
296
+ $filename='CoDMagento.zip';
297
+ //Change for zip code
298
+ $helper->output_file('CoDzip/CoDMagento.zip',$filename , 'application/zip');
299
+ $this->loadLayout();
300
+ $this->_setActiveMenu('catalog');
301
+ $this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
302
+ $this->renderLayout();
303
+ }
304
+ public function deletetestAction()
305
+ {
306
+ $dir = dirname(__FILE__);
307
+
308
+ $_baseDirArray = explode("app", $dir);
309
+ $basePath = $_baseDirArray[0].'/';
310
+
311
+
312
+ $codimodel = Mage::getSingleton('codi/codi');
313
+ $codimodel->target = "auth";
314
+ $helper=Mage::helper('codi');
315
+ //change for zip file
316
+ $filename='/CoDzip/CoDMagento.zip';
317
+ $helper->deleteFile($basePath,$filename);
318
+ $this->loadLayout();
319
+ $this->_setActiveMenu('catalog');
320
+ $this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
321
+ $this->renderLayout();
322
+ $this->_redirect('codi/adminhtml_menu/auth');
323
+
324
+
325
+ }
326
+
327
+ }
app/code/community/Mage/Codi/controllers/DeleteController.php CHANGED
@@ -1,37 +1,37 @@
1
- <?php
2
- require_once 'Mage/Core/Controller/Front/Action.php';
3
- class Mage_Codi_DeleteController extends Mage_Core_Controller_Front_Action
4
- {
5
-
6
- public function indexAction()
7
- {
8
- $this->_logFile = "Catalog-on-demand.log";
9
-
10
- Mage::log("Notice : Mage_Codi_DeleteController", null, $this->_logFile);
11
-
12
- $dir = dirname(__FILE__);
13
- $_baseDirArray = explode("app", $dir);
14
- $basePath = $_baseDirArray[0];
15
-
16
- //code for remove zip files
17
- $files = glob($basePath."CoDzip/*.zip");
18
- foreach($files as $file)
19
- {
20
- //changed for zip file
21
- if($file!=$basePath."CoDzip/CoDMagento.zip")
22
- unlink($file);
23
- }
24
-
25
- //remove text files
26
- $filesn = glob($basePath."CoDzip/CoDfiles/*.txt");
27
-
28
- foreach($filesn as $filen)
29
- {
30
- //if(($filen!=$basePath."CoDzip/CoDfiles/CoDMagento.txt")&&($filen!=$basePath."CoDzip/CoDfiles/CatalogProject.txt")&&($filen!=$basePath."CoDzip/CoDfiles/CatalogSection.txt"))
31
- unlink($filen);
32
-
33
- }
34
-
35
- Mage::log("Notice : DeleteindexAction End", null, $this->_logFile);
36
- }
37
- }
1
+ <?php
2
+ require_once 'Mage/Core/Controller/Front/Action.php';
3
+ class Mage_Codi_DeleteController extends Mage_Core_Controller_Front_Action
4
+ {
5
+
6
+ public function indexAction()
7
+ {
8
+ $this->_logFile = "Catalog-on-demand.log";
9
+
10
+ Mage::log("Notice : Mage_Codi_DeleteController", null, $this->_logFile);
11
+
12
+ $dir = dirname(__FILE__);
13
+ $_baseDirArray = explode("app", $dir);
14
+ $basePath = $_baseDirArray[0];
15
+
16
+ //code for remove zip files
17
+ $files = glob($basePath."CoDzip/*.zip");
18
+ foreach($files as $file)
19
+ {
20
+ //changed for zip file
21
+ if($file!=$basePath."CoDzip/CoDMagento.zip")
22
+ unlink($file);
23
+ }
24
+
25
+ //remove text files
26
+ $filesn = glob($basePath."CoDzip/CoDfiles/*.txt");
27
+
28
+ foreach($filesn as $filen)
29
+ {
30
+ //if(($filen!=$basePath."CoDzip/CoDfiles/CoDMagento.txt")&&($filen!=$basePath."CoDzip/CoDfiles/CatalogProject.txt")&&($filen!=$basePath."CoDzip/CoDfiles/CatalogSection.txt"))
31
+ unlink($filen);
32
+
33
+ }
34
+
35
+ Mage::log("Notice : DeleteindexAction End", null, $this->_logFile);
36
+ }
37
+ }
app/code/community/Mage/Codi/controllers/NsyncController.php CHANGED
@@ -1,164 +1,176 @@
1
- <?php
2
- ini_set("max_execution_time", 3600);
3
- ini_set("memory_limit","1024M");
4
- require_once 'Mage/Core/Controller/Front/Action.php';
5
- class Mage_Codi_NsyncController extends Mage_Core_Controller_Front_Action
6
- {
7
- public $CodiBlock ;
8
-
9
- public function indexAction()
10
- {
11
- $this->_logFile = "Catalog-on-demand.log";
12
-
13
- Mage::log("Notice: Mage_Codi_NSyncController", null, $this->_logFile);
14
-
15
- $error_msg = "";
16
- $CodiModel = Mage::getModel('codi/codi');
17
-
18
- $dir = dirname(__FILE__);
19
- $_baseDirArray = explode("app", $dir);
20
- $basePath = $_baseDirArray[0].'/';
21
-
22
- //Create folder if not exist.
23
- if ( !is_dir($basePath.'CoDzip/CoDfiles/') )
24
- mkdir($basePath.'CoDzip/CoDfiles/');
25
-
26
- $DataFile = 'CoDMagento.txt';
27
- $CodiModel->new_run_codi_import($basePath);
28
-
29
-
30
- $error = "";
31
- $message = $CodiModel->getImportStatuses();
32
- $mes=implode(',',$message);
33
- $status = 0;
34
- if ( isset($message) ){
35
- $status = $message['message'];
36
- if ( $status== "end" && $message['finished'] == 1 ){
37
- rename($basePath.'CoDzip/CoDfiles/temp.txt', $basePath.'CoDzip/CoDfiles/'.$DataFile);
38
- $CodiModel->deleteTable();
39
- $CodiModel->addImportStatus('end', 1);
40
- print '{"success": "1"}';
41
- Mage::log("ERROR : Finished to create product file", null, $this->_logFile);
42
-
43
- }else if ( $status== "cancel" && $message['finished'] == 1 ) {
44
-
45
- $error = "ERROR\nCanceled to create product file";
46
- $CodiModel->deleteTable();
47
- Mage::log("ERROR : Canceled to create product file", null, $this->_logFile);
48
-
49
- }else if ( $status== "fileerror" && $message['finished'] == 1 ) {
50
-
51
- $error = "ERROR\nFailed to create product file";
52
- $CodiModel->deleteTable();
53
- Mage::log("ERROR : Failed to create product file", null, $this->_logFile);
54
-
55
- }else{
56
- $error = "ERROR\nFailed to create product file";
57
- $CodiModel->deleteTable();
58
- Mage::log("ERROR : Failed to create product file 1", null, $this->_logFile);
59
- }
60
- }else{
61
- $error = "ERROR\nFailed to create product file";
62
- $CodiModel->deleteTable();
63
- Mage::log("ERROR : Failed to create product file 2", null, $this->_logFile);
64
- }
65
- // Calling function to create Catalog Section
66
- $CodiModel->createCatalogSection();
67
- //Calling function to create Catalog Project
68
- $CodiModel->createCatalogProject('1');
69
-
70
-
71
- }
72
-
73
- // Below function is for the loader
74
-
75
- public function manualAction()
76
- {
77
- $products = Mage::getModel('catalog/product')->getCollection();
78
- $products->addAttributeToFilter('status', 1);//enabled
79
- $products->addAttributeToFilter('visibility', 4);//catalog, search
80
- $products->addAttributeToSelect('sku');
81
- $prodIds = $products->getAllIds();
82
-
83
- print Mage::helper('codi')->array2json($prodIds);
84
- }
85
- //create file
86
- public function updatestatusAction()
87
- {
88
- ini_set('memory_limit','1024M');
89
- set_time_limit(0);
90
- $this->_logFile = "Catalog-on-demand.log";
91
- Mage::log("Notice: Mage_Codi_NSyncController", null, $this->_logFile);
92
-
93
-
94
- $CodiModel = Mage::getModel('codi/codi');
95
- //product is id of the product
96
- $productid=$this->getRequest()->getParam('product');
97
- // counter is no. of product passed
98
- $counter=$this->getRequest()->getParam('counter');
99
- // Total product . counter and total is for calculating how many percent of data is transfered.
100
- $total=$this->getRequest()->getParam('total');
101
- //basepath
102
- $basepath=$this->getRequest()->getParam('basepath');
103
- $fh = fopen($basepath.'CoDzip/CoDfiles/temp.txt', 'a');
104
- try{
105
- // below condition is for the write all heading only first time after that it will not write.
106
- if($counter==1){
107
-
108
- fwrite($fh, "itemNumber\titemQty\titemUom\titemPrice\titemDescription\titemLink\titemAttributes\titemGraphic\tproductName\tproductMfg\tproductDescription\tproductGraphic\tproductLink\tproductAttributes\tCategory\tReviews\tSupplementalInfo");
109
-
110
- }
111
-
112
- $product = Mage::getModel('catalog/product');
113
- $product->load($productid);
114
-
115
- Mage::log("Notice : Codi Import Products :".$productid, null, $this->_logFile);
116
- fwrite($fh, $CodiModel->ProducttoString($product, "product"));
117
- }catch(Exception $e)
118
- {
119
- echo "error";
120
- return;
121
- }
122
- fclose($fh);
123
- $progress=(string)(($counter/$total)*100);
124
- if($progress=='100'){
125
- $DataFile = 'CoDMagento.txt';
126
- rename($basePath.'CoDzip/CoDfiles/temp.txt', $basePath.'CoDzip/CoDfiles/'.$DataFile);
127
- //die();
128
- }
129
- unset($product);
130
- echo floor($progress);
131
-
132
-
133
-
134
- }
135
- //Create Catalog section file
136
- public function createcatalogsectionAction()
137
- {
138
- ini_set('memory_limit','1024M');
139
- set_time_limit(0);
140
- //create object of Codi Model
141
- $CodiModel = Mage::getModel('codi/codi');
142
- // Calling function to create CatalogSection
143
- $progress=$CodiModel->createCatalogSection();
144
-
145
- echo $progress;
146
- }
147
-
148
- //Create Catalog section file
149
- public function createcatalogprojectAction()
150
- {
151
- ini_set('memory_limit','1024M');
152
- set_time_limit(0);
153
- //create object of Codi Model
154
- $CodiModel = Mage::getModel('codi/codi');
155
- // Calling function to create CatalogProject
156
- $progress=$CodiModel->createCatalogProject();
157
- echo $progress;
158
-
159
-
160
-
161
- }
162
-
163
-
164
- }
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ ini_set("max_execution_time", 3600);
3
+ ini_set("memory_limit","1024M");
4
+ require_once 'Mage/Core/Controller/Front/Action.php';
5
+ class Mage_Codi_NsyncController extends Mage_Core_Controller_Front_Action
6
+ {
7
+ public $CodiBlock ;
8
+
9
+ public function indexAction()
10
+ {
11
+ $this->_logFile = "Catalog-on-demand.log";
12
+ //Code for progress
13
+ $message='start';
14
+ $finished=1;
15
+ $created_time=time();
16
+ $CodiModel = Mage::getModel('codi/codi');
17
+
18
+ $var=$CodiModel->saveProgressData($message,$finished,$created_time);
19
+ //echo $var;die();
20
+
21
+
22
+ Mage::log("Notice: Mage_Codi_NSyncController", null, $this->_logFile);
23
+
24
+ $error_msg = "";
25
+
26
+
27
+ $dir = dirname(__FILE__);
28
+ $_baseDirArray = explode("app", $dir);
29
+ $basePath = $_baseDirArray[0].'/';
30
+
31
+ //Create folder if not exist.
32
+ if ( !is_dir($basePath.'CoDzip/CoDfiles/') )
33
+ mkdir($basePath.'CoDzip/CoDfiles/');
34
+
35
+ $DataFile = 'CoDMagento.txt';
36
+ $CodiModel->new_run_codi_import($basePath);
37
+
38
+
39
+ $error = "";
40
+ $message = $CodiModel->getImportStatuses();
41
+ $mes=implode(',',$message);
42
+ $status = 0;
43
+ if (isset($message) ){
44
+ $status = $message['message'];
45
+ if ( $status== "end" && $message['finished'] == 1 ){
46
+ rename($basePath.'CoDzip/CoDfiles/temp.txt', $basePath.'CoDzip/CoDfiles/'.$DataFile);
47
+ $CodiModel->deleteTable();
48
+ $CodiModel->addImportStatus('end', 1);
49
+ print '{"success": "1"}';
50
+ Mage::log("ERROR : Finished to create product file", null, $this->_logFile);
51
+
52
+ }else if ( $status== "cancel" && $message['finished'] == 1 ) {
53
+
54
+ $error = "ERROR\nCanceled to create product file";
55
+ $CodiModel->deleteTable();
56
+ Mage::log("ERROR : Canceled to create product file", null, $this->_logFile);
57
+
58
+ }else if ( $status== "fileerror" && $message['finished'] == 1 ) {
59
+
60
+ $error = "ERROR\nFailed to create product file";
61
+ $CodiModel->deleteTable();
62
+ Mage::log("ERROR : Failed to create product file", null, $this->_logFile);
63
+
64
+ }else{
65
+ $error = "ERROR\nFailed to create product file";
66
+ $CodiModel->deleteTable();
67
+ Mage::log("ERROR : Failed to create product file 1", null, $this->_logFile);
68
+ }
69
+ }else{
70
+ $error = "ERROR\nFailed to create product file";
71
+ $CodiModel->deleteTable();
72
+ Mage::log("ERROR : Failed to create product file 2", null, $this->_logFile);
73
+ }
74
+ // Calling function to create Catalog Section
75
+ $CodiModel->createCatalogSection();
76
+ //Calling function to create Catalog Project
77
+ $CodiModel->createCatalogProject('1');
78
+
79
+ //Code for Update values after file download
80
+ $message='start';
81
+ $update=1;
82
+ $finished=2;
83
+ $created_time=time();
84
+ $CodiModel->saveProgressData($message,$finished,$created_time,$update,$var);
85
+ }
86
+
87
+ // Below function is for the loader
88
+
89
+ public function manualAction()
90
+ {
91
+ $products = Mage::getModel('catalog/product')->getCollection();
92
+ $products->addAttributeToFilter('status', 1);//enabled
93
+ $products->addAttributeToFilter('visibility', 4);//catalog, search
94
+ $products->addAttributeToSelect('sku');
95
+ $prodIds = $products->getAllIds();
96
+
97
+ print Mage::helper('codi')->array2json($prodIds);
98
+ }
99
+ //create file
100
+ public function updatestatusAction()
101
+ {
102
+ ini_set('memory_limit','1024M');
103
+ set_time_limit(0);
104
+ $this->_logFile = "Catalog-on-demand.log";
105
+ Mage::log("Notice: Mage_Codi_NSyncController", null, $this->_logFile);
106
+
107
+
108
+ $CodiModel = Mage::getModel('codi/codi');
109
+ //product is id of the product
110
+ $productid=$this->getRequest()->getParam('product');
111
+ // counter is no. of product passed
112
+ $counter=$this->getRequest()->getParam('counter');
113
+ // Total product . counter and total is for calculating how many percent of data is transfered.
114
+ $total=$this->getRequest()->getParam('total');
115
+ //basepath
116
+ $basepath=$this->getRequest()->getParam('basepath');
117
+ $fh = fopen($basepath.'CoDzip/CoDfiles/temp.txt', 'a');
118
+ try{
119
+ // below condition is for the write all heading only first time after that it will not write.
120
+ if($counter==1){
121
+
122
+ fwrite($fh, "itemNumber\titemQty\titemUom\titemPrice\titemDescription\titemLink\titemAttributes\titemGraphic\tproductName\tproductMfg\tproductDescription\tproductGraphic\tproductLink\tproductAttributes\tCategory\tReviews\tSupplementalInfo");
123
+
124
+ }
125
+
126
+ $product = Mage::getModel('catalog/product');
127
+ $product->load($productid);
128
+
129
+ Mage::log("Notice : Codi Import Products :".$productid, null, $this->_logFile);
130
+ fwrite($fh, $CodiModel->ProducttoString($product, "product"));
131
+ }catch(Exception $e)
132
+ {
133
+ echo "error";
134
+ return;
135
+ }
136
+ fclose($fh);
137
+ $progress=(string)(($counter/$total)*100);
138
+ if($progress=='100'){
139
+ $DataFile = 'CoDMagento.txt';
140
+ rename($basePath.'CoDzip/CoDfiles/temp.txt', $basePath.'CoDzip/CoDfiles/'.$DataFile);
141
+ //die();
142
+ }
143
+ unset($product);
144
+ echo floor($progress);
145
+
146
+
147
+
148
+ }
149
+ //Create Catalog section file
150
+ public function createcatalogsectionAction()
151
+ {
152
+ ini_set('memory_limit','1024M');
153
+ set_time_limit(0);
154
+ //create object of Codi Model
155
+ $CodiModel = Mage::getModel('codi/codi');
156
+ // Calling function to create CatalogSection
157
+ $progress=$CodiModel->createCatalogSection();
158
+
159
+ echo $progress;
160
+ }
161
+
162
+ //Create Catalog section file
163
+ public function createcatalogprojectAction()
164
+ {
165
+ ini_set('memory_limit','1024M');
166
+ set_time_limit(0);
167
+ //create object of Codi Model
168
+ $CodiModel = Mage::getModel('codi/codi');
169
+ // Calling function to create CatalogProject
170
+ $progress=$CodiModel->createCatalogProject();
171
+ echo $progress;
172
+
173
+ }
174
+
175
+
176
+ }
app/code/community/Mage/Codi/controllers/SyncController.php CHANGED
@@ -80,6 +80,14 @@ class Mage_Codi_SyncController extends Mage_Core_Controller_Front_Action
80
  exit(0);
81
  }
82
 
 
 
 
 
 
 
 
 
83
  $DataFile = (string)$this->getRequest()->getParam('FileName');
84
  $filename = $basePath.'CoDzip/CoDfiles/CoDMagento.txt';
85
  //Check code for file is exists or not
@@ -165,8 +173,7 @@ class Mage_Codi_SyncController extends Mage_Core_Controller_Front_Action
165
  $helper=Mage::helper('codi');
166
  $TemplateName=(string)$helper->getTheme();
167
 
168
-
169
- //Changed the value of CatalogProject value from magento to General
170
  $paramsarray = array( 'ProcessID' => $ProcessID,
171
  'TemplateName' => $TemplateName,
172
  'DataFileLink' => $DataFileLink ,
@@ -174,7 +181,7 @@ class Mage_Codi_SyncController extends Mage_Core_Controller_Front_Action
174
  'Encoding' => 'utf-8' ,
175
  'ClearDatabase' => 'MissingOnly' ,
176
  'PartnerID' => 'CoDMagento' ,
177
- 'CatalogProject' => 'General',
178
  'Comment' => $Comment);
179
  if ( $error != "" ) {
180
  $paramsarray = array('ProcessID' => $ProcessID,
@@ -184,7 +191,7 @@ class Mage_Codi_SyncController extends Mage_Core_Controller_Front_Action
184
  'Encoding' => 'utf-8' ,
185
  'ClearDatabase' => 'MissingOnly' ,
186
  'PartnerID' => 'CoDMagento' ,
187
- 'CatalogProject' => 'General',
188
  'Comment' => $Comment,
189
  'Error' => $error);
190
  }
@@ -195,6 +202,14 @@ class Mage_Codi_SyncController extends Mage_Core_Controller_Front_Action
195
  Mage::log("Notice: Prepare the callback url : ". $url, null, $this->_logFile);
196
  Mage::log("Notice: Prepare the template theme : ". $TemplateName, null, $this->_logFile);
197
  $Responsemsg = $CodiModel->Call( $url, $paramsarray );
 
 
 
 
 
 
 
 
198
  Mage::log("Notice: Prepare the callback response message ". $Responsemsg, null, $this->_logFile);
199
  }
200
  }
80
  exit(0);
81
  }
82
 
83
+ //Code for progress
84
+ $message='start';
85
+ $finished=1;
86
+ $created_time=time();
87
+ $CodiModel = Mage::getModel('codi/codi');
88
+
89
+ $var=$CodiModel->saveProgressData($message,$finished,$created_time);
90
+
91
  $DataFile = (string)$this->getRequest()->getParam('FileName');
92
  $filename = $basePath.'CoDzip/CoDfiles/CoDMagento.txt';
93
  //Check code for file is exists or not
173
  $helper=Mage::helper('codi');
174
  $TemplateName=(string)$helper->getTheme();
175
 
176
+
 
177
  $paramsarray = array( 'ProcessID' => $ProcessID,
178
  'TemplateName' => $TemplateName,
179
  'DataFileLink' => $DataFileLink ,
181
  'Encoding' => 'utf-8' ,
182
  'ClearDatabase' => 'MissingOnly' ,
183
  'PartnerID' => 'CoDMagento' ,
184
+ 'CatalogProject' => 'magento',
185
  'Comment' => $Comment);
186
  if ( $error != "" ) {
187
  $paramsarray = array('ProcessID' => $ProcessID,
191
  'Encoding' => 'utf-8' ,
192
  'ClearDatabase' => 'MissingOnly' ,
193
  'PartnerID' => 'CoDMagento' ,
194
+ 'CatalogProject' => 'magento',
195
  'Comment' => $Comment,
196
  'Error' => $error);
197
  }
202
  Mage::log("Notice: Prepare the callback url : ". $url, null, $this->_logFile);
203
  Mage::log("Notice: Prepare the template theme : ". $TemplateName, null, $this->_logFile);
204
  $Responsemsg = $CodiModel->Call( $url, $paramsarray );
205
+
206
+ //Code for Update values after file download
207
+ $message='start';
208
+ $update=1;
209
+ $finished=2;
210
+ $created_time=time();
211
+ $CodiModel->saveProgressData($message,$finished,$created_time,$update,$var);
212
+
213
  Mage::log("Notice: Prepare the callback response message ". $Responsemsg, null, $this->_logFile);
214
  }
215
  }
app/code/community/Mage/Codi/etc/config.xml CHANGED
@@ -1,146 +1,146 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Mage_Codi>
5
- <version>3.0.5</version>
6
- </Mage_Codi>
7
- </modules>
8
- <adminhtml>
9
- <menu>
10
- <catalog translate="title" module="catalog">
11
- <title>Catalog</title>
12
- <depends>
13
- <module>Mage_Catalog</module>
14
- </depends>
15
- <children>
16
- <codi translate="title" module="catalog">
17
- <sort_order>-1</sort_order>
18
- <title>Catalog-On-Demand</title>
19
- <action>codi/adminhtml_menu/</action>
20
- </codi>
21
- </children>
22
- </catalog>
23
- </menu>
24
- </adminhtml>
25
- <global>
26
- <!--
27
- <fieldsets>
28
- <customer_account>
29
- <codinternaluser><create>1</create><update>1</update></codinternaluser>
30
- </customer_account>
31
- </fieldsets>
32
- -->
33
-
34
- <!--
35
- <blocks>
36
- <adminhtml>
37
- <rewrite>
38
- <widget_grid>Mage_Codi_Block_Widget_Grid</widget_grid>
39
- </rewrite>
40
- </adminhtml>
41
- </blocks>
42
- <blocks>
43
- <adminhtml>
44
- <rewrite>
45
- <widget_grid_massaction>Mage_Codi_Block_Widget_Grid_Massaction</widget_grid_massaction>
46
- </rewrite>
47
- </adminhtml>
48
- </blocks>
49
- <blocks>
50
- <adminhtml>
51
- <rewrite>
52
- <catalog_product_grid>Mage_Codi_Block_Adminhtml_Catalog_Product_Grid</catalog_product_grid>
53
- </rewrite>
54
- </adminhtml>
55
- </blocks>
56
- <blocks>
57
- <adminhtml>
58
- <rewrite>
59
- <catalog_product>Mage_Codi_Block_Adminhtml_Catalog_Product</catalog_product>
60
- </rewrite>
61
- </adminhtml>
62
- </blocks>
63
- -->
64
- <!-- V2 Start-->
65
- <models>
66
- <codi>
67
- <class>Mage_Codi_Model</class>
68
- </codi>
69
- </models>
70
- <blocks>
71
- <codi>
72
- <class>Mage_Codi_Block</class>
73
- </codi>
74
- </blocks>
75
- <!--
76
- <events>
77
- <adminhtml_controller_action_predispatch_start>
78
- <observers>
79
- <mage_codi_codi>
80
- <type>singleton</type>
81
- <class>mage_codi_model_codi</class>
82
- <method>adminstart</method>
83
- </mage_codi_codi>
84
- </observers>
85
- </adminhtml_controller_action_predispatch_start>
86
- </events>
87
- <rewrite>
88
- <codi_index_update>
89
- <from><![CDATA[#^/wishlist/index/update/#]]></from>
90
- <to>codi/index/update</to>
91
- </codi_index_update>
92
-
93
- <codi_index_index>
94
- <from><![CDATA[#^/wishlist/$#]]></from>
95
- <to>codi/codifront/index</to>
96
- </codi_index_index>
97
-
98
- <codi_codifront_index1>
99
- <from><![CDATA[#^/wishlist/codifront#]]></from>
100
- <to>codi/codifront/index</to>
101
- </codi_codifront_index1>
102
- </rewrite>
103
- -->
104
- </global>
105
- <frontend>
106
- <routers>
107
- <codi>
108
- <use>standard</use>
109
- <args>
110
- <module>Mage_Codi</module>
111
- <frontName>codi</frontName>
112
- </args>
113
- </codi>
114
- </routers>
115
- <!--
116
- <layout>
117
- <updates>
118
- <codi>
119
- <file>codi.xml</file>
120
- </codi>
121
- </updates>
122
- </layout>
123
- -->
124
- </frontend>
125
- <admin>
126
- <routers>
127
- <codi>
128
- <use>admin</use>
129
- <args>
130
- <module>Mage_Codi</module>
131
- <frontName>codi</frontName>
132
- </args>
133
- </codi>
134
- </routers>
135
- </admin>
136
- <adminhtml>
137
- <layout>
138
- <updates>
139
- <codi>
140
- <file>codi.xml</file>
141
- </codi>
142
- </updates>
143
- </layout>
144
- </adminhtml>
145
- <!-- V2 End-->
146
- </config>
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Mage_Codi>
5
+ <version>3.0.6</version>
6
+ </Mage_Codi>
7
+ </modules>
8
+ <adminhtml>
9
+ <menu>
10
+ <catalog translate="title" module="catalog">
11
+ <title>Catalog</title>
12
+ <depends>
13
+ <module>Mage_Catalog</module>
14
+ </depends>
15
+ <children>
16
+ <codi translate="title" module="catalog">
17
+ <sort_order>-1</sort_order>
18
+ <title>Catalog-On-Demand</title>
19
+ <action>codi/adminhtml_menu/</action>
20
+ </codi>
21
+ </children>
22
+ </catalog>
23
+ </menu>
24
+ </adminhtml>
25
+ <global> <resources> <codi_setup> <setup> <module>Mage_Codi</module> </setup> <connection> <use>core_setup</use> </connection> </codi_setup> </resources>
26
+ <!--
27
+ <fieldsets>
28
+ <customer_account>
29
+ <codinternaluser><create>1</create><update>1</update></codinternaluser>
30
+ </customer_account>
31
+ </fieldsets>
32
+ -->
33
+
34
+ <!--
35
+ <blocks>
36
+ <adminhtml>
37
+ <rewrite>
38
+ <widget_grid>Mage_Codi_Block_Widget_Grid</widget_grid>
39
+ </rewrite>
40
+ </adminhtml>
41
+ </blocks>
42
+ <blocks>
43
+ <adminhtml>
44
+ <rewrite>
45
+ <widget_grid_massaction>Mage_Codi_Block_Widget_Grid_Massaction</widget_grid_massaction>
46
+ </rewrite>
47
+ </adminhtml>
48
+ </blocks>
49
+ <blocks>
50
+ <adminhtml>
51
+ <rewrite>
52
+ <catalog_product_grid>Mage_Codi_Block_Adminhtml_Catalog_Product_Grid</catalog_product_grid>
53
+ </rewrite>
54
+ </adminhtml>
55
+ </blocks>
56
+ <blocks>
57
+ <adminhtml>
58
+ <rewrite>
59
+ <catalog_product>Mage_Codi_Block_Adminhtml_Catalog_Product</catalog_product>
60
+ </rewrite>
61
+ </adminhtml>
62
+ </blocks>
63
+ -->
64
+ <!-- V2 Start-->
65
+ <models>
66
+ <codi>
67
+ <class>Mage_Codi_Model</class>
68
+ </codi>
69
+ </models>
70
+ <blocks>
71
+ <codi>
72
+ <class>Mage_Codi_Block</class>
73
+ </codi>
74
+ </blocks>
75
+ <!--
76
+ <events>
77
+ <adminhtml_controller_action_predispatch_start>
78
+ <observers>
79
+ <mage_codi_codi>
80
+ <type>singleton</type>
81
+ <class>mage_codi_model_codi</class>
82
+ <method>adminstart</method>
83
+ </mage_codi_codi>
84
+ </observers>
85
+ </adminhtml_controller_action_predispatch_start>
86
+ </events>
87
+ <rewrite>
88
+ <codi_index_update>
89
+ <from><![CDATA[#^/wishlist/index/update/#]]></from>
90
+ <to>codi/index/update</to>
91
+ </codi_index_update>
92
+
93
+ <codi_index_index>
94
+ <from><![CDATA[#^/wishlist/$#]]></from>
95
+ <to>codi/codifront/index</to>
96
+ </codi_index_index>
97
+
98
+ <codi_codifront_index1>
99
+ <from><![CDATA[#^/wishlist/codifront#]]></from>
100
+ <to>codi/codifront/index</to>
101
+ </codi_codifront_index1>
102
+ </rewrite>
103
+ -->
104
+ </global>
105
+ <frontend>
106
+ <routers>
107
+ <codi>
108
+ <use>standard</use>
109
+ <args>
110
+ <module>Mage_Codi</module>
111
+ <frontName>codi</frontName>
112
+ </args>
113
+ </codi>
114
+ </routers>
115
+ <!--
116
+ <layout>
117
+ <updates>
118
+ <codi>
119
+ <file>codi.xml</file>
120
+ </codi>
121
+ </updates>
122
+ </layout>
123
+ -->
124
+ </frontend>
125
+ <admin>
126
+ <routers>
127
+ <codi>
128
+ <use>admin</use>
129
+ <args>
130
+ <module>Mage_Codi</module>
131
+ <frontName>codi</frontName>
132
+ </args>
133
+ </codi>
134
+ </routers>
135
+ </admin>
136
+ <!--<adminhtml>
137
+ <layout>
138
+ <updates>
139
+ <codi>
140
+ <file>codi.xml</file>
141
+ </codi>
142
+ </updates>
143
+ </layout>
144
+ </adminhtml> -->
145
+ <!-- V2 End-->
146
+ </config>
app/code/community/Mage/Codi/sql/codi_setup/mysql4-install-3.0.4.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ DROP TABLE IF EXISTS {$this->getTable('codi_progress_status')};
10
+ CREATE TABLE {$this->getTable('codi_progress_status')} (
11
+ `id` int(11) unsigned NOT NULL auto_increment,
12
+ `message` varchar(50) NOT NULL default '',
13
+ `finished` smallint(1) NOT NULL default '0',
14
+ `created_time` varchar(50) NULL,
15
+ PRIMARY KEY (`id`)
16
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
17
+ ");
18
+
19
+ $installer->endSetup();
app/code/community/Mage/Codi/sql/codi_setup/mysql4-install-3.0.6.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ DROP TABLE IF EXISTS {$this->getTable('codi_progress_status')};
10
+ CREATE TABLE {$this->getTable('codi_progress_status')} (
11
+ `id` int(11) unsigned NOT NULL auto_increment,
12
+ `message` varchar(50) NOT NULL default '',
13
+ `finished` smallint(1) NOT NULL default '0',
14
+ `created_time` varchar(50) NULL,
15
+ PRIMARY KEY (`id`)
16
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
17
+ ");
18
+
19
+ $installer->endSetup();
app/design/adminhtml/default/default/template/codi/index.phtml CHANGED
@@ -1,1029 +1,1093 @@
1
- <?php
2
- $codimodel = Mage::getSingleton('codi/codi');
3
- $userid = Mage::getStoreConfig('codi/codi/codusername') ;
4
- $password = Mage::getStoreConfig('codi/codi/codpassword') ;
5
- $secretkey = Mage::getStoreConfig('codi/codi/secretkey') ;
6
-
7
- $enablefreshflyers = Mage::getStoreConfig('codi/codi/enablefreshflyers') ;
8
- $enablereviews = Mage::getStoreConfig('codi/codi/codenablereviews') ;
9
- $fromchild = Mage::getStoreConfig('codi/codi/fromchild') ;
10
-
11
- $codflyerlinkimg = Mage::getStoreConfig('codi/codi/codflyerlinkimg') ;
12
- $codflyerlinkimgurl = Mage::getStoreConfig('codi/codi/codflyerlinkimgurl') ;
13
- $codflyerlinkimgalt = Mage::getStoreConfig('codi/codi/codflyerlinkimgalt') ;
14
-
15
- $codbeforename = Mage::getStoreConfig('codi/codi/codbeforename') ;
16
- $codaftername = Mage::getStoreConfig('codi/codi/codaftername') ;
17
-
18
- $codbeforeemailto = Mage::getStoreConfig('codi/codi/codbeforeemailto') ;
19
- $codafteremailto = Mage::getStoreConfig('codi/codi/codafteremailto') ;
20
-
21
- $codbeforeOR = Mage::getStoreConfig('codi/codi/codbeforeOR') ;
22
- $codafterOR = Mage::getStoreConfig('codi/codi/codafterOR') ;
23
-
24
- $codbeforeoverview = Mage::getStoreConfig('codi/codi/codbeforeoverview') ;
25
- $codafteroverview = Mage::getStoreConfig('codi/codi/codafteroverview') ;
26
-
27
- $codbgcheck = Mage::getStoreConfig('codi/codi/codbgcheck') ;
28
-
29
- $post_url = $this->getUrl('codi/nsync/manual');
30
- $post_url_upd = $this->getUrl('codi/adminhtml_menu/updatestatus');
31
- $post_url_cancel = $this->getUrl('codi/adminhtml_menu/cancel');
32
- $post_bgprocess_check = $this->getUrl('codi/adminhtml_menu/bgcheck');
33
- //chagned ver 3.0.1
34
- $newpostupdate = $this->getUrl('codi/nsync/updatestatus');
35
- //Changed for category section file
36
- $createCatalogSection = $this->getUrl('codi/nsync/createcatalogsection');
37
-
38
- //Changed for Category project section
39
- $createCatalogProject = $this->getUrl('codi/nsync/createcatalogproject');
40
-
41
- //Changed ver 2.2.15
42
- $download_url = $this->getUrl('codi/adminhtml_menu/downloadtest');
43
- $delete_codi_url = $this->getUrl('codi/adminhtml_menu/deletetest');
44
-
45
- //Chagned ver 2.2.16
46
- $datafilelaunch = Mage::getStoreConfig('codi/codi/coddatafilelaunch');
47
-
48
- $codbg_checked = "";
49
- if ( $codbgcheck == 1 ) $codbg_checked = "checked";
50
-
51
- $extensionName="Mage_PDF_per_Product";
52
- $currentVer = Mage::getConfig()->getModuleConfig('Mage_Codi')->version;
53
-
54
- //Changed ver 3.0.1 Added wait for minute parameter
55
- $waitforminute=Mage::getStoreConfig('codi/codi/codwaitforminute');
56
- $includeshortdescription = Mage::getStoreConfig('codi/codi/codincludeshortdescription');
57
-
58
- //Chagned ver 3.0.2 Added Tier price display settings
59
- $publishtieredpricing=Mage::getStoreConfig('codi/codi/codpublishtieredpricing');
60
- $codquantity=Mage::getStoreConfig('codi/codi/codquantity');
61
- $codprice=Mage::getStoreConfig('codi/codi/codprice');
62
- $codsavings=Mage::getStoreConfig('codi/codi/codsavings');
63
-
64
- //Changed for show download zip file url
65
- $zipurl = $this->getUrl('CoDzip/') ;
66
- $pos = strrpos ($zipurl , 'key') ;
67
- if ( $pos != 0 )
68
- $zipurl = substr( $zipurl , 0 , $pos ) ;
69
- else
70
- $zipurl = $zipurl;
71
-
72
- $zipurl=str_replace("index.php/CoDzip/index/index/", "CoDzip/",$zipurl);
73
-
74
- ?>
75
- <style>
76
- #codi_status_template_button{
77
- margin-bottom:0.5em;
78
- width:329px;
79
- }
80
- #codi_status_template{
81
- margin-bottom:0.5em;
82
- width:330px;
83
- }
84
- #tooltip {
85
- position: absolute;
86
- z-index: 3000;
87
- border: 1px solid #111;
88
- background-color: #eee;
89
- padding: 5px;
90
- max-width:500px;
91
- }
92
- #tooltip h3, #tooltip div { margin: 0; }
93
- #tooltip ul{list-style:disc outside none;margin-left:12px;margin-bottom:12px;padding-left:40px;}
94
- .hidden{display:none;}
95
- .waitforminute{width:59px;}
96
- .tiredprice{width:155px;visibility:visible;height:12px;display:block;}
97
- .displayOption{width:120px;visibility:visible;height:12px;display:block;}
98
- </style>
99
-
100
- <div id="page:main-container">
101
- <div class="columns ">
102
- <div class="side-col" id="page:left">
103
- <h3>Catalog-On-Demand®</h3>
104
-
105
- <ul id="product_info_tabs" class="tabs">
106
- <li >
107
- <a href="<?php echo $this->getUrl('codi/adminhtml_menu/register');?>" class="tab-item-link "
108
- <?php if ( $codimodel->target == "register") echo "style='background-color:#ffffff;'" ; ?>
109
- onclick="window.open ('https://www.catalog-on-demand.com/signup/');">
110
- <span>Sign Up</span>
111
- </a>
112
- </li>
113
- <li >
114
- <a href="<?php echo $this->getUrl('codi/adminhtml_menu/auth');?>" class="tab-item-link "
115
- <?php if ( $codimodel->target == "auth") echo "style='background-color:#ffffff;'" ; ?> >
116
- <span>Configuration Settings</span>
117
- </a>
118
- </li>
119
- <li >
120
- <a href="<?php echo $this->getUrl('codi/adminhtml_menu/systemtest');?>" class="tab-item-link "
121
- <?php if ( $codimodel->target == "systemtest") echo "style='background-color:#ffffff;'" ; ?> >
122
- <span>System Test</span>
123
- </a>
124
- </li>
125
- <li >
126
- <a href="<?php echo $this->getUrl('codi/adminhtml_menu/documentation');?>" class="tab-item-link "
127
- <?php if ( $codimodel->target == "documentation") echo "style='background-color:#ffffff;'" ; ?>
128
- onclick="window.open ('http://www.catalog-on-demand.com/plans/catalog-on-demand_for_magento.php');">
129
- <span>Documentation</span>
130
- </a>
131
- </li>
132
- </ul>
133
- </div>
134
- <div class="main-col" id="content">
135
- <div class="main-col-inner">
136
- <div class="content-header"></div>
137
-
138
- <?php
139
- $extensions = array('curl','dom', 'hash','iconv','mcrypt' );
140
-
141
- $fail = '';
142
- $pass = '';
143
-
144
- if(version_compare(phpversion(), '5.2.0', '<')) {
145
- $fail .= '<li>You need<strong> PHP 5.2.0</strong> (or greater). Your current version is '.phpversion().'</li>';
146
- }
147
- else {
148
- $pass .='<li>You have<strong> PHP '.phpversion().'</strong></li>';
149
- }
150
-
151
- if( !ini_get('safe_mode') ) {
152
- $pass .='<li>Safe Mode is <strong>off</strong></li>';
153
- }
154
- else { $fail .= '<li>Safe Mode is <strong>on</strong></li>'; }
155
-
156
- foreach($extensions as $extension) {
157
- if( !extension_loaded($extension) ) {
158
- $fail .= '<li> You are missing the <strong>'.$extension.'</strong> extension</li>';
159
- }
160
- else{
161
- $pass .= '<li>You have the <strong>'.$extension.'</strong> extension</li>';
162
- }
163
- }
164
-
165
-
166
- $baseDir = dirname(__FILE__);
167
-
168
- $_baseDirArray = explode("app", $baseDir);
169
- $basePath = $_baseDirArray[0];
170
-
171
- //Create folder if not exist. change for zip
172
- if (!is_dir($basePath.'CoDzip/') )
173
- {
174
- if (!mkdir($basePath.'CoDzip/'))
175
- {
176
- $fail .= "<li>Could not create <strong>CoDzip</strong> folder.</li>";
177
- $fail .= "<li>Please create <strong>CoDzip manually</strong> in ".$basePath."</li>";
178
-
179
- }
180
- }
181
- if (is_dir($basePath.'CoDzip/') )
182
- {
183
- if (!is_dir($basePath.'CoDzip/CoDfiles/') )
184
- {
185
- if (!mkdir($basePath.'CoDzip/CoDfiles/'))
186
- {
187
- $fail .= "<li>Could not create <strong>CoDzip/CoDfiles</strong> folder.</li>";
188
- $fail .= "<li>Please create <strong>CoDzip/CoDfiles manually</strong> in ".$basePath."</li>";
189
- }
190
- }
191
- }
192
- /*if ( !is_dir($basePath.'CoDzip/CoDfiles/') ){
193
- if ( !mkdir($basePath.'CoDzip/CoDFiles/') ){
194
-
195
- $fail .= "<li>Could not create <strong>CoDzip</strong> folder.</li>";
196
- $fail .= "<li>Please create <strong>CoDzip manually</strong> in ".$basePath."</li>";
197
- }
198
- }*/
199
-
200
- $is_file = true;
201
-
202
- if ( !$codimodel->createFile($basePath) ){
203
- $fail .= "<li>The Magento extension was prevented from creating a file in the folder CoDzip. Please notify your Magento administrator.</li>";
204
- $is_file = false;
205
- }
206
-
207
- $target = $codimodel->target;
208
-
209
- if ( $target == "auth" && $fail != "" ){
210
- $target = "systemtest";
211
- }
212
-
213
- switch ($target)
214
- {
215
- case "register":
216
- break;
217
- case "documentation":
218
- break;
219
- case "systemtest":
220
-
221
- echo "<div class='entry-edit'>
222
- <div class='entry-edit-head'>
223
- <h4 class='icon-head head-edit-form fieldset-legend'>System Test</h4>
224
- <div>&nbsp;</div>
225
- </div>
226
- <div class='fieldset'>
227
- ";
228
-
229
- if( $fail ) {
230
- echo '<p><strong>Your server is not properly configured to run the Catalog-on-Demand® for Magento® extension.</strong>';
231
- echo '<br>Please contact your hosting provider to report the failure of the following tests:';
232
- echo '<br><ul>'.$fail.'</ul></p>';
233
- echo '<br>The following tests were successfully met:';
234
- echo '<ul>'.$pass.'</ul>';
235
- } else {
236
- echo '<p><strong>Congratulations!</strong>&nbsp; Your server has passed all the tests to properly run the Catalog-on-Demand® for Magento® extension.</p>';
237
- echo '<ul>'.$pass.'</ul>';
238
- }
239
-
240
- echo "<br/>";
241
-
242
-
243
- echo '<p> Current Extension Name : <b>'.$extensionName.'</b></p>';
244
-
245
- echo '<p>Current Extension Version: <b>'.$currentVer.'</b></p>';
246
-
247
-
248
-
249
-
250
- $exec_command = "";
251
-
252
- if( (false !== strpos(ini_get("disable_functions"), "exec")) || (false !== strpos(ini_get("disable_functions"), "shell_exec")) ) {
253
- $exec_command = "<p>The <strong>exec</strong> and/or <strong>shell_exec</strong> functions are disabled in your php.ini. See the line starting with <strong>'disable_functions ='</strong>. Unless you remove both <strong>'exec'</strong> and <strong>'shell_exec'</strong> from this line, you may not use the background process to create data files. This may be a problem if you have a large product database.</p>";
254
- }else{
255
- $exec_command = "The <strong>exec</strong> and <strong>shell_exec</strong> functions are enabled. You may use the background process to create data files.";
256
- }
257
-
258
- echo $exec_command;
259
-
260
- echo "<br/><br/>";
261
-
262
- foreach (Mage::app()->getWebsites() as $website)
263
- {
264
- $defaultGroup = $website->getDefaultGroup();
265
- $StoreId = $defaultGroup->getDefaultStoreId();
266
- }
267
-
268
- $design = Mage::getSingleton('core/design')->loadChange($StoreId);
269
-
270
- $package = $design->getPackage();
271
- $default_theme = $design->getTheme();
272
-
273
- if ( $package == "" && $default_theme == "" ){
274
-
275
- $package = Mage::getStoreConfig('design/package/name', $StoreId);
276
- $default_theme = Mage::getStoreConfig('design/theme/default', $StoreId);
277
- }
278
-
279
- if ( $package == "" ) $package = "default";
280
- if ( $default_theme == "" ) $default_theme = "default";
281
-
282
- $update_guide = "<ul style='list-style:decimal outside none;padding-left:30px;'>";
283
- $update_guide .= "<li><p>Open this file : /app/design/frontend/default/default/template/catalog/product/view.phtml. This will be your 'source' file.</p></li>";
284
- $update_guide .= "<li><p>Your view.phtml ( /app/design/frontend/".$package."/".$default_theme."/template/catalog/product/view.phtml ) will be your 'target' file. </p><p>Please copy the code as follows: </p>";
285
- $update_guide .= "<ul style='list-style:square outside none;padding-left:30px;'>";
286
- $update_guide .= "<li><p>Copy lines 37-50, and paste after the line containing getProduct().</p></li>";
287
- $update_guide .= "<li><p>Copy line 69 and paste before the line containing 'name'.</p></li>";
288
- $update_guide .= "<li><p>Copy line 71 and paste after the line containing 'name'.</p></li>";
289
- $update_guide .= "<li><p>Copy line 79 and paste before the line containing 'Email to a Friend'.</p></li>";
290
- $update_guide .= "<li><p>Copy line 81 and paste after the line containing 'Email to a Friend'.</p></li>";
291
- $update_guide .= "<li><p>Copy line 99 and paste before the line containing 'OR'.</p></li>";
292
- $update_guide .= "<li><p>Copy line 101 and paste after the line containing 'OR'.</p></li>";
293
- $update_guide .= "<li><p>Copy line 115 and paste before the line containing 'Quick Overview'.</p></li>";
294
- $update_guide .= "<li><p>Copy line 117 and paste after the line containing 'Quick Overview'.</p></li>";
295
- $update_guide .= "</ul>";
296
- $update_guide .= "</li>";
297
- $update_guide .= "<ul>";
298
-
299
- if ( $package != "default" || $default_theme != "default" ){
300
-
301
- echo "<p>This is important if you intend to use the Always Fresh™ 'flyer-per-product-page' feature of Catalog-on-Demand®.</p>";
302
- echo "<p>You are using the following theme : <strong>".$package." / ".$default_theme."</strong></p>";
303
- echo "<p>Your site admin will need to edit the view.html for this theme, as follows:</p>";
304
- echo $update_guide;
305
-
306
- }else{
307
- echo "<p>You have the default theme.</p>";
308
- }
309
-
310
- echo "</div></div>";
311
- echo "<br />";
312
-
313
- $text = "";
314
-
315
- if ( $is_file ){
316
-
317
- $message = $codimodel->getImportStatuses();
318
-
319
- if ( isset($message) ){
320
-
321
- $status = $message['message'];
322
-
323
- if ( $status== "end" && $message['finished'] == 1 ){
324
- $text = "<p id='codi_status_template_button'>Your test data file was created successfully. &nbsp;<img src='".$this->getSkinUrl($this->__('images/codimport_yes.gif'))."' /> <button type='button' onclick='download_codi_file();' class='scalable add' style='margin-left:25px;' ><span>Download Data File</span></button> <button type='button' onclick='delete_codi_file();' class='scalable add' style='margin-left:25px;' ><span>Delete Data File</span></button></p>";
325
- $codimodel->deleteTable();
326
- }else if ( $status== "start" && $message['finished'] == 0 ) {
327
- $text = "<p>A test data file is now being created. <span style='margin-left:15px;'><img src='".$this->getSkinUrl($this->__('images/codimport_run.gif'))."' /></span>&nbsp;&nbsp;&nbsp;</p>" ;
328
- }else if ( $status== "fileerror" && $message['finished'] == 0 ) {
329
- $text = "<p>Your test data file was not created. Please contact your administrator.</p>";
330
- $codimodel->deleteTable();
331
- }else{
332
- $text = "<p>Your test data file was not created. Please contact your administrator.</p>";
333
- $codimodel->deleteTable();
334
- }
335
- }
336
- else{
337
- //Changed on version 2.2.15
338
- //$text .= "<a href='#datafilebackground_tooltip'><img src='".$this->getSkinUrl($this->__('images/preview_field_help.png'))."' /></a><input type='checkbox' id='background_process' name='background_process' ".$codbg_checked." style='margin:0px 5px 0px 15px;cursor:pointer' onclick='onBackgroundProcess(this)' />Create data file using background process<br /><br />";
339
- $text .= "<button type='button' class='scalable add' onclick='start_codi_import()' style='margin-left:25px;' ><span>Test</span></button>";
340
- }
341
-
342
-
343
- }
344
- break;
345
- case "auth":
346
- ?>
347
- <form name="codiform" action="<?php echo $this->getUrl('codi/adminhtml_menu/authsave') ?>" method="post" id="codiform">
348
- <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
349
- <input name="store" type="hidden" value="<?php echo $this->getRequest()->getParam('store'); ?>" />
350
- <div class="entry-edit">
351
- <div class="entry-edit-head">
352
- <h4 class="icon-head head-edit-form fieldset-legend">Configuration Settings</h4>
353
- <div class="form-buttons" align="right">
354
- <button type="submit" class="scalable add" ><span>Save</span></button>
355
- </div>
356
- <div>&nbsp;</div>
357
- </div>
358
- <div class="fieldset " id="group_fields12">
359
- <div class="hor-scroll">
360
- <table cellspacing="0" class="form-list">
361
- <tbody>
362
- <tr>
363
- <td class="scope-label"><a href="#accountid_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
364
- <td class="label"><label for="userid">Account ID</label></td>
365
- <td class="value"><input name="userid" onchange="makeLowercase();" id="userid" value="<?php echo $userid ?>" class=" input-text" type="text"/></td>
366
- <td><small>&nbsp;</small></td>
367
- </tr>
368
- <tr>
369
- <td class="scope-label"><a href="#secretkey_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
370
- <td class="label"><label for="secretkey">Secret Key</label></td>
371
- <td class="value"><input name="secretkey" id="secretkey" value="<?php echo $secretkey ?>" class=" input-text" type="text"/></td>
372
- <td><small>&nbsp;</small></td>
373
- </tr>
374
- <tr>
375
- <td class="scope-label"><a href="#kickoffurl_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
376
- <td class="label"><label for="secretkey">Kick-off URL</label></td>
377
- <td class="value"><label>
378
- <?php
379
- $url = $this->getUrl('codi/sync') ;
380
- $pos = strrpos ($url , 'key') ;
381
- if ( $pos != 0 )
382
- $kickoffurl = substr( $url , 0 , $pos ) ;
383
- else
384
- $kickoffurl = $url;
385
-
386
- echo "<input class='input-text' type='text' name='kickoffurl' value='".$kickoffurl."'>" ;
387
- ?></label>
388
- </td>
389
- <td><small>&nbsp;</small></td>
390
- </tr>
391
- <tr><td class="scope-label"></td><td class="label"></td><td class="value"></td><td><small>&nbsp;</small></td></tr>
392
- <!-- Changed for version 2.2.16 to add data file launch mode -->
393
- <tr>
394
- <td class="scope-label"><a href="#data_file_launch_mode_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
395
- <td class="label"><label for="DataFileLaunchMode">Data File Launch Mode</label></td>
396
- <td class="value">
397
- <input type="radio" value="manual" id="manual" name="datafilelaunch" <?php if ($datafilelaunch =="manual") echo "checked" ?> onclick="displayBlock('codi_status_template','cronjob','0');"/>&nbsp;<label for="manual">Manual&nbsp;<a href="#manual_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></label><br>
398
- <p id="codi_status_template" name="codi_status_template" style="display:<?php if ($datafilelaunch =="manual") echo 'block'; else echo 'none';?>;">
399
- <?php
400
- $filename = $basePath.'CoDzip/CoDMagento.zip';
401
- if (file_exists($filename)) {
402
-
403
- $url = $this->getUrl('CoDzip/CoDMagento.zip') ;
404
- $pos = strrpos ($url , 'key') ;
405
- if ( $pos != 0 )
406
- $url = substr( $url , 0 , $pos ) ;
407
- else
408
- $url = $url;
409
-
410
- $zipfileurl=str_replace("index.php/CoDzip/CoDMagento.zip/index/", "CoDzip/CoDMagento.zip",$url);
411
- $modifie="<input class='input-text' type='text' name='zipfileurl' value='".$zipfileurl."'><br/>" ;
412
- $modifie.="Last Created Date: " . date("M d, Y H:i:s.", filemtime($filename))."(GMT)";
413
- echo $modifie." <button type='button' onclick='download_codi_file();' class='scalable add' style='margin-left:25px;' ><span>Download Data File</span></button> <button type='button' onclick='delete_codi_file();' class='scalable add' style='margin-left:25px;' ><span>Delete Data File</span></button>";
414
- }
415
- else{
416
- ?>
417
- <button type='button' class='scalable add' onclick='start_codi_import()' style='margin-left:25px;' ><span>Create Data File</span></button>
418
- <?php }?>
419
- </p>
420
-
421
-
422
- <input type="radio" value="cod" id="cod" name="datafilelaunch" <?php if ($datafilelaunch =="cod") echo "checked" ?> onclick="displayBlock('codi_status_template','cronjob','1');" />&nbsp;<label for="cod">Catalog-on-Demand&nbsp;<a href="#codoption_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></label>
423
- <span style="display:<?php if ($datafilelaunch =="cod") echo ''; else echo 'none';?>;" id="waitforminute"><br>Minutes to wait for data file creation : <input type="text" name="waitforminute" onchange="valuevalidation(this.value,5,999,'Please enter only integer value between 5 and 999.','I');" class="waitforminute" width="60px" value="<?php echo $waitforminute;?>">&nbsp;<a href="#waitforminute_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></span><br>
424
- <input type="radio" value="magento" id="magento" name="datafilelaunch" <?php if ($datafilelaunch =="magento") echo "checked" ?> onclick="displayBlock('cronjob','codi_status_template','0');" />&nbsp;<label for="magento">Cron-job &nbsp;<a href="#cronjoburl_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></label>
425
- </td>
426
- <td><small>&nbsp;</small></td>
427
- </tr>
428
- <tr>
429
-
430
- <td class="scope-label"></td>
431
- <td class="label"></td>
432
- <td class="value">
433
- <p id="cronjob" name="cronjob" style="display:<?php if ($datafilelaunch =="magento") echo 'block'; else echo 'none';?>;">
434
- <?php
435
- $url = $this->getUrl('codi/nsync') ;
436
- $pos = strrpos ($url , 'key') ;
437
- if ( $pos != 0 )
438
- $cronjoburl = substr( $url , 0 , $pos ) ;
439
- else
440
- $cronjoburl = $url;
441
-
442
- echo '<input type="text" class="input-text" name="cronjoburl" width="60px" value="wget '.$cronjoburl.'">' ;
443
- ?></p>
444
- </td>
445
- <td><small>&nbsp;</small></td>
446
- </tr>
447
-
448
- <tr>
449
- <td class="scope-label"><a href="#enablefreshflyers_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
450
- <td class="label"><label for="enablefreshflyers">Enable Always Fresh™ Flyers</label></td>
451
- <td class="value"><input name="enablefreshflyers" id="enablefreshflyers" value="checked" <?php if ($enablefreshflyers =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
452
- <td><small>&nbsp;</small></td>
453
- </tr>
454
- <!-- Code for Include Short Description -->
455
- <tr>
456
- <td class="scope-label"><a href="#includeshortdescription_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
457
- <td class="label"><label for="includeshortdescription">Include Short Description</label></td>
458
- <td class="value"><input name="includeshortdescription" id="includeshortdescription" value="checked" <?php if ($includeshortdescription =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
459
- <td><small>&nbsp;</small></td>
460
- </tr>
461
- <tr>
462
- <td class="scope-label"><a href="#enablereviews_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
463
- <td class="label"><label for="enablereviews">Enable Reviews</label></td>
464
- <td class="value"><input name="enablereviews" id="enablereviews" value="checked" <?php if ($enablereviews =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
465
- <td><small>&nbsp;</small></td>
466
- </tr>
467
- <tr>
468
- <td class="scope-label"><a href="#getpricefromchild_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
469
- <td class="label"><label for="fromchild">Get price from associated products</label></td>
470
- <td class="value"><input name="fromchild" id="fromchild" value="checked" <?php if ($fromchild =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
471
- <td><small>&nbsp;</small></td>
472
- </tr>
473
- <!-- Changes for Tired price option -->
474
- </table>
475
-
476
- <fieldset style="width:460px;">
477
- <legend class="tiredprice"><a href="#tieredpricingoptions_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a>&nbsp; Tiered Pricing Options</legend>
478
- <table class="form-list" cellpadding='0'>
479
- <tr>
480
- <td class="label"><label for="publishtieredpricing">Publish tiered pricing</label></td>
481
- <td class="value"><input name="publishtieredpricing" id="publishtieredpricing" value="checked" <?php if ($publishtieredpricing =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
482
- <td class="scope-label"></td>
483
- <td><small>&nbsp;</small></td>
484
- </tr>
485
-
486
- <tr>
487
- <td class="label"><label for="codquantity">Label for quantity column</label></td>
488
- <td class="value"><input type="text" id="codquantity" name="codquantity" class="input-text" value="<?php if ($codquantity == '') echo 'Quantity'; else echo $codquantity ;?>"></td>
489
- <td class="scope-label"></td>
490
- <td><small>&nbsp;</small></td>
491
- </tr>
492
-
493
- <tr>
494
- <td class="label"><label for="codprice">Label for price column</label></td>
495
- <td class="value"><input type="text" id="codprice" name="codprice" class=" input-text" value="<?php if ($codprice == '') echo 'Price'; else echo $codprice;?>"> </td>
496
- <td class="scope-label"></td>
497
- <td><small>&nbsp;</small></td>
498
- </tr>
499
- <tr>
500
- <td class="label"><label for="codsavings">Label for savings</label></td>
501
- <td class="value"><input type="text" id="codsavings" name="codsavings" class=" input-text" value="<?php if ($codsavings == '') echo 'Savings'; else echo $codsavings;?>" ></td>
502
- <td class="scope-label"></td>
503
- <td><small>&nbsp;</small></td>
504
- </tr>
505
- </table>
506
-
507
- </fieldset>
508
- <!-- End changes for Tired price option -->
509
- <table class="form-list">
510
- <tr><td class="scope-label"></td><td class="label"></td><td class="value"></td><td><small>&nbsp;</small></td></tr>
511
- <tr>
512
- <td class="scope-label"><a href="#codflyerlinkimg_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
513
- <td class="label"><label for="usedimage">Image to be used for flyer link</label></td>
514
- <td class="value">
515
- <input type="radio" value="Default" id="Default" name="codflyerlinkimg" <?php if ($codflyerlinkimg !="Custom") echo "checked" ?> onclick="document.getElementById('codflyerlinkimgurl').style.display='none';"/>&nbsp;<label for="Default">Default</label><br>
516
- <input type="radio" value="Custom" id="Custom" name="codflyerlinkimg" <?php if ($codflyerlinkimg =="Custom") echo "checked" ?> onclick="document.getElementById('codflyerlinkimgurl').style.display='block';"/>
517
- &nbsp;<label for="Custom">Custom</label>
518
- </td>
519
- <td>
520
- <img src="<?php if ($codflyerlinkimg =='Custom') echo $codflyerlinkimgurl ; else echo 'http://www.catalog-on-demand.com/print-catalog.png'?>"></td>
521
- </tr>
522
- <tr>
523
- <td class="scope-label"></td>
524
- <td class="label"></td>
525
- <td class="value">
526
- <input type="text" id="codflyerlinkimgurl" name="codflyerlinkimgurl" class=" input-text"
527
- value="<?php if ($codflyerlinkimg =='Custom') echo $codflyerlinkimgurl; else echo '';?>"
528
- style="display:<?php if ($codflyerlinkimg =='Custom') echo 'block'; else echo 'none';?>" />
529
- </td>
530
- <td><small>&nbsp;</small></td>
531
- </tr>
532
- <tr>
533
- <td class="scope-label"><a href="#codflyerlinkimgalt_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
534
- <td class="label"><label for="usedimage">Alt text for flyer link image</label></td>
535
- <td class="value">
536
- <input type="text" id="codflyerlinkimgalt" name="codflyerlinkimgalt" class=" input-text"
537
- value="<?php if ($codflyerlinkimgalt == '') echo 'Click for PDF of this product'; else echo $codflyerlinkimgalt ;?>" />
538
- </td>
539
- <td><small>&nbsp;</small></td>
540
- </tr>
541
- <tr><td class="scope-label"></td><td class="label"></td><td class="value"></td><td><small>&nbsp;</small></td></tr>
542
- </table>
543
- <fieldset style="width:460px;">
544
- <legend class="displayOption"><a href="#displayoptions_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a>&nbsp; Display Options</legend>
545
- <table class="form-list" cellpadding='0'>
546
- <tr>
547
- <td class="label"><label for="codbeforename">Display before product name</label></td>
548
- <td class="value"><input name="codbeforename" id="codbeforename" value="checked" <?php if ($codbeforename =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
549
- <td class="scope-label"></td>
550
- <td><small>&nbsp;</small></td>
551
- </tr>
552
- <tr>
553
- <td class="label"><label for="codaftername">Display after product name</label></td>
554
- <td class="value"><input name="codaftername" id="codaftername" value="checked" <?php if ($codaftername =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
555
- <td class="scope-label"></td>
556
- <td><small>&nbsp;</small></td>
557
- </tr>
558
-
559
- <tr>
560
- <td class="label"><label for="codbeforeemailto">Display before 'Email to a friend'</label></td>
561
- <td class="value"><input name="codbeforeemailto" id="codbeforeemailto" value="checked" <?php if ($codbeforeemailto =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
562
- <td class="scope-label"></td>
563
- <td><small>&nbsp;</small></td>
564
- </tr>
565
- <tr>
566
- <td class="label"><label for="codafteremailto">Display after 'Email to a friend'</label></td>
567
- <td class="value"><input name="codafteremailto" id="codafteremailto" value="checked" <?php if ($codafteremailto =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
568
- <td class="scope-label"></td>
569
- <td><small>&nbsp;</small></td>
570
- </tr>
571
-
572
- <tr>
573
- <td class="label"><label for="codbeforeOR">Display before 'OR'</label></td>
574
- <td class="value"><input name="codbeforeOR" id="codbeforeOR" value="checked" <?php if ($codbeforeOR =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
575
- <td class="scope-label"></td>
576
- <td><small>&nbsp;</small></td>
577
- </tr>
578
- <tr>
579
- <td class="label"><label for="codafterOR">Display after 'OR'</label></td>
580
- <td class="value"><input name="codafterOR" id="codafterOR" value="checked" <?php if ($codafterOR =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
581
- <td class="scope-label"></td>
582
- <td><small>&nbsp;</small></td>
583
- </tr>
584
-
585
- <tr>
586
- <td class="label"><label for="codbeforeoverview">Display before 'Quick Overview'</label></td>
587
- <td class="value"><input name="codbeforeoverview" id="codbeforeoverview" value="checked" <?php if ($codbeforeoverview =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
588
- <td class="scope-label"></td>
589
- <td><small>&nbsp;</small></td>
590
- </tr>
591
- <tr>
592
- <td class="label"><label for="codafteroverview">Display after 'Quick Overview'</label></td>
593
- <td class="value"><input name="codafteroverview" id="codafteroverview" value="checked" <?php if ($codafteroverview =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
594
- <td class="scope-label"></td>
595
- <td><small>&nbsp;</small></td>
596
- </tr>
597
- </table>
598
- </fieldset>
599
-
600
- </tbody>
601
- </table>
602
- </div>
603
- </div>
604
- </div>
605
- </form>
606
- <?php
607
- break;
608
- }
609
- ?>
610
-
611
- </div>
612
- </div>
613
- </div>
614
- </div>
615
- <div id="accountid_tooltip" class="hidden">
616
- <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/accountid.html'); ?>
617
- </div>
618
- <div id="secretkey_tooltip" class="hidden">
619
- <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/secretkey.html'); ?>
620
- </div>
621
- <div id="kickoffurl_tooltip" class="hidden">
622
- <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/kickoffurl.html'); ?>
623
- </div>
624
- <div id="enablefreshflyers_tooltip" class="hidden">
625
- <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/enablefreshflyers.html'); ?>
626
- </div>
627
- <div id="enablereviews_tooltip" class="hidden">
628
- <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/enablereviews.html'); ?>
629
- </div>
630
- <div id="getpricefromchild_tooltip" class="hidden">
631
- <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/getpricefromchild.html'); ?>
632
- </div>
633
- <div id="codflyerlinkimg_tooltip" class="hidden">
634
- <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/codflyerlinkimg.html'); ?>
635
- </div>
636
- <div id="codflyerlinkimgalt_tooltip" class="hidden">
637
- <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/codflyerlinkimgalt.html'); ?>
638
- </div>
639
- <div id="displayoptions_tooltip" class="hidden">
640
- <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/displayoptions.html'); ?>
641
- </div>
642
- <div id="datafilebackground_tooltip" class="hidden">
643
- <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/datafilebackground.html'); ?>
644
- </div>
645
- <div id="data_file_launch_mode_tooltip" class="hidden">
646
- <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/datafilelaunchmode.html'); ?>
647
- </div>
648
- <div id="cronjoburl_tooltip" class="hidden">
649
- <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/cronjoburl.html'); ?>
650
- </div>
651
- <div id="codoption_tooltip" class="hidden">
652
- <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/CoDDataFileLaunch.html'); ?>
653
- </div>
654
- <div id="manual_tooltip" class="hidden">
655
- <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/ManualDataFileLaunch.html'); ?>
656
- </div>
657
-
658
- <div id="waitforminute_tooltip" class="hidden">
659
- <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/waitforminute.html'); ?>
660
- </div>
661
- <div id="includeshortdescription_tooltip" class="hidden">
662
- <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/shortdesc.html'); ?>
663
- </div>
664
-
665
- <script type="text/javascript" src="<?php echo $this->getJsUrl('jquery/jquery-1.2.6.noConflict.min.js') ?>"></script>
666
- <script type="text/javascript" src="<?php echo $this->getJsUrl('jquery/jquery.tooltip.js') ?>"></script>
667
- <script type="text/javascript">
668
- jQuery("#content a").tooltip({
669
- bodyHandler: function() {
670
- return jQuery(jQuery(this).attr("href")).html();
671
- },
672
- delay: 0,
673
- showURL: false
674
- });
675
-
676
- function start_codi_import(){
677
- codi = new Codi('<?=$post_url?>','<?=$post_url_upd?>');
678
- codi.startCodiImport();
679
- }
680
-
681
- function onBackgroundProcess(obj){
682
- var value = 0;
683
- if ( obj.checked == true )
684
- value = 1;
685
-
686
- var url = "<?php echo $post_bgprocess_check; ?>";
687
- var param = "check=" + value;
688
- new Ajax.Request(url,
689
- {
690
- method:'post',
691
- parameters: param,
692
- onSuccess: function(transport) {
693
- }
694
- });
695
-
696
- }
697
-
698
- var Codi = Class.create();
699
-
700
- Codi.prototype = {
701
- initialize: function(postUrl, postUrlUpd) {
702
-
703
- this.postUrl = postUrl; //'https://techatcost.com/purchases/ajax/';
704
- this.postUrlUpd = postUrlUpd;
705
- this.failureUrl = document.URL;
706
- // object with event message data
707
- this.objectMsg = null;
708
- // interval object
709
- this.updateTimer = null;
710
- // default shipping code. Display on errors
711
-
712
- elem = 'checkoutSteps';
713
- clickableEntity = '.head';
714
-
715
- // overwrite Accordion class method
716
- var headers = $$('#' + elem + ' .section ' + clickableEntity);
717
- headers.each(function(header) {
718
- Event.observe(header,'click',this.sectionClicked.bindAsEventListener(this));
719
- }.bind(this));
720
- },
721
- startCodiImport: function () {
722
- _this = this;
723
- var param = "is_process=";
724
- if ( jQuery('#background_process').is(':checked') == true )
725
- param += "1";
726
- else
727
- param += "0";
728
- new Ajax.Request(this.postUrl,
729
- {
730
- method:'post',
731
- parameters: param,
732
- requestTimeout: 100,
733
-
734
- onSuccess: function(transport) {
735
- var ret_msg = transport.responseText.evalJSON();
736
- var status_div = document.getElementById('codi_status_template');
737
- var v;
738
- var totalproduct=ret_msg.length;
739
- //check total products
740
- if(totalproduct==0)
741
- {
742
- status_div.innerHTML = "<p>Your test data file was not created. Please contact your administrator.</p>";
743
- }
744
- else
745
- {
746
- for (var i=0;i<ret_msg.length;i++)
747
- {
748
- //alert(ret_msg[i]);
749
- productid=ret_msg[i];
750
- var j=i+1;
751
- v=createfilenew(productid,j,totalproduct);
752
- }
753
- }
754
-
755
- if ( ret_msg.success == 1 ){
756
- status_div.innerHTML = "<p>A test data file is now being created. <span style='margin-left:15px;'><img src=\"<?=$this->getSkinUrl($this->__('images/codimport_run.gif'))?>\" ></span>&nbsp;&nbsp;&nbsp;</p>";
757
- _this.updateTimer = setInterval(function(){_this.updateEvent();}, 10000);
758
- }else if ( ret_msg.error == 1 ){
759
- status_div.innerHTML = "<p>The Magento extension was prevented from creating a file in the folder CoDDataFile. Please notify your Magento administrator.</p>";
760
- }else if ( ret_msg.exec == 1 || ret_msg.shellexec == 1 ) {
761
- status_div.innerHTML = "<p>The <strong>exec</strong> and/or <strong>shell_exec</strong> functions are disabled in your php.ini. See the line starting with <strong>'disable_functions ='</strong>. Unless you remove both <strong>'exec'</strong> and <strong>'shell_exec'</strong> from this line, you may not use the background process to create data files. This may be a problem if you have a large product database.</p>";
762
- }
763
- },
764
- onTimeout: function() {
765
- var status_div = document.getElementById('codi_status_template');
766
- status_div.innerHTML = "<p>Your test data file was not created. Please contact your administrator.</p>";
767
- },
768
- onFailure: function() {
769
- var status_div = document.getElementById('codi_status_template');
770
- status_div.innerHTML = "<p>Your test data file was not created. Please contact your administrator.</p>";
771
- }
772
- });
773
- },
774
-
775
- updateEvent: function () {
776
- _this = this;
777
- new Ajax.Request(this.postUrlUpd,
778
- {
779
- method: 'post',
780
- onSuccess: function(transport) {
781
- _this.objectMsg = transport.responseText.evalJSON();
782
-
783
- if (_this.objectMsg.canceled == 1) {
784
- _this.clearUpdateInterval();
785
- _this.objectMsg.message = 'canceled';
786
- _this.updateStatusHtml();
787
- }
788
-
789
- if (_this.objectMsg.processed == 1) {
790
- }
791
-
792
- if (_this.objectMsg.fileerror == 1) {
793
- _this.clearUpdateInterval();
794
- _this.objectMsg.message = 'fileerror';
795
- _this.updateStatusHtml();
796
- }
797
-
798
- if (_this.objectMsg.error == 1) {
799
- _this.clearUpdateInterval();
800
- _this.objectMsg.message = 'error';
801
- _this.updateStatusHtml();
802
- }
803
-
804
- if (_this.objectMsg.finished == 1) {
805
- _this.objectMsg.message = 'finished';
806
- _this.updateStatusHtml();
807
- _this.clearUpdateInterval();
808
- }
809
- },
810
- onFailure: this.ajaxFailure.bind(),
811
- });
812
- },
813
-
814
- updateStatusHtml: function(){
815
- message = this.objectMsg.message.toLowerCase();
816
- var status_div = document.getElementById('codi_status_template');
817
- var img_url = "<?php echo $this->getSkinUrl($this->__('images/codimport_yes.gif')) ?>";
818
-
819
- if ( message == 'finished' ){
820
- status_div.innerHTML="<p id='codi_status_template_button'>Your test data file was created successfully. &nbsp;<img src='" + img_url + "' /><button type='button' class='scalable add' style='margin-left:25px;' onclick='download_codi_file();' ><span>Download Data File</span></button><button type='button' class='scalable add' style='margin-left:25px;' onclick='delete_codi_file();' ><span>Delete Data File</span></button></p>";
821
- this.clearUpdateInterval();
822
- }
823
-
824
- if ( message == 'canceled' ){
825
- this.clearUpdateInterval();
826
- }
827
-
828
- if ( message == 'processed' ){
829
- }
830
-
831
- if ( message == 'fileerror' ){
832
- status_div.innerHTML="<p>Your test data file was not created. Please contact your administrator( File Error ).</p>";
833
- this.clearUpdateInterval();
834
- }
835
-
836
- if ( message == 'error' ){
837
- status_div.innerHTML="<p>Your test data file was not created. Please contact your administrator.</p>";
838
- this.clearUpdateInterval();
839
- }
840
-
841
- },
842
-
843
- ajaxFailure: function(){
844
- this.clearUpdateInterval();
845
- var status_div = document.getElementById('codi_status_template');
846
- status_div.innerHTML = "<p>Your test data file was not created. Please contact your administrator(Ajax failure).</p>";
847
- },
848
-
849
- clearUpdateInterval: function () {
850
- clearInterval(this.updateTimer);
851
- },
852
- }
853
- function download_codi_file()
854
- {
855
- window.location.href="<?php echo $download_url?>";
856
-
857
- }
858
- function delete_codi_file()
859
- {
860
- window.location.href="<?php echo $delete_codi_url?>";
861
-
862
- }
863
-
864
-
865
- function displayBlock(show,hide,hideboth)
866
- {
867
-
868
- if(hideboth=='1')
869
- {
870
- document.getElementById(show).style.display='none';
871
- document.getElementById(hide).style.display='none';
872
- document.getElementById('waitforminute').style.display='';
873
-
874
- }
875
- else
876
- {
877
- document.getElementById('waitforminute').style.display='none';
878
- document.getElementById(show).style.display='';
879
- document.getElementById(hide).style.display='none';
880
- }
881
-
882
- }
883
- function cancel_codi_import(){
884
-
885
- var url = "<?php echo $post_url_cancel; ?>";
886
- new Ajax.Request(url,
887
- {
888
- method:'post',
889
- onSuccess: function(transport) {
890
- var ret_msg = transport.responseText;
891
-
892
- if ( ret_msg ){
893
-
894
- //var text = "<a href='#datafilebackground_tooltip'><img src=\"<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>\" /></a><br />";
895
- text = "<button type='button' class='scalable add' onclick='start_codi_import()' style='margin-left:25px;' ><span>Create Data File</span></button>";
896
-
897
- var status_div = document.getElementById('codi_status_template');
898
- status_div.innerHTML = text;
899
- }
900
- }
901
- });
902
- }
903
-
904
- function makeLowercase() {
905
- document.getElementById('userid').value = document.getElementById('userid').value.toLowerCase();
906
- }
907
-
908
- function valuevalidation(value, min, max, alertbox, datatype)
909
- {
910
-
911
- with (value)
912
- {
913
- checkvalue=parseFloat(value);
914
- if (datatype)
915
- { smalldatatype=datatype.toLowerCase();
916
- if (smalldatatype.charAt(0)=="i") {checkvalue=parseInt(value)};
917
- }
918
- if ((parseFloat(min)==min && checkvalue<min) || (parseFloat(max)==max && checkvalue>max) || value!=checkvalue)
919
- {if (alertbox!="") {alert(alertbox);} return false;}
920
- else {return true;}
921
- }
922
- }
923
-
924
- function createfilenew(productid,i,totalproduct)
925
- { var img_url = "<?php echo $this->getSkinUrl($this->__('images/codimport_yes.gif')) ?>";
926
- var r;
927
- var base = "<?php echo $basePath ?>";
928
- var status_div = document.getElementById('codi_status_template');
929
- var a = new Ajax.Request("<?php echo $newpostupdate; ?>",
930
- { asynchronous:false,
931
- method: 'post',
932
- parameters: "product="+productid+"&counter="+i+"&total="+totalproduct+"&basepath="+base,
933
- onSuccess: function(transport) {
934
- r= transport.responseText;
935
- if(r=='100'){
936
- //alert(r+'create');
937
- status_div.innerHTML="Building Hierarchy";
938
- createfileCatalogSection();
939
- }
940
- else{
941
- if(r!="error"){
942
- status_div.innerHTML="<p id='codi_status_template_button'>"+transport.responseText+"% </p><p>A test data file is now being created. <span style='margin-left:15px;'><img src=\"<?=$this->getSkinUrl($this->__('images/codimport_run.gif'))?>\" ></span>&nbsp;&nbsp;&nbsp;</p>";
943
- }
944
- }
945
- if(r=="error")
946
- {
947
- status_div.innerHTML="<p>Your test data file was not created. Please contact your administrator( File Error ).</p>";
948
- }
949
-
950
- }
951
-
952
- //onFailure: this.ajaxFailure.bind(),
953
- });
954
- return r;
955
- }
956
- function createfileCatalogSection()
957
- {
958
- var img_url = "<?php echo $this->getSkinUrl($this->__('images/codimport_yes.gif')) ?>";
959
- var r;
960
- var base = "<?php echo $basePath ?>";
961
- var status_div = document.getElementById('codi_status_template');
962
- status_div.innerHTML='Building Hierarchy';
963
- var a = new Ajax.Request("<?php echo $createCatalogSection; ?>",
964
- { asynchronous:false,
965
- method: 'post',
966
- parameters: "basepath="+base,
967
- onSuccess: function(transport) {
968
- r= transport.responseText;
969
- //alert(r+'section');
970
- if(r=='100'){
971
- t=createfileCatalogProject();
972
- if(t=='10'){
973
- status_div.innerHTML="<p id='codi_status_template_button'>"+transport.responseText+"% </p> <input class='input-text' type='text' name='zipfileurl' value='<?php echo $zipurl?>CoDMagento.zip'><br/> Your test data file was created successfully.<img src='" + img_url + "' /><button type='button' class='scalable add' style='margin-left:25px;' onclick='download_codi_file();' ><span>Download Data File</span></button><button type='button' class='scalable add' style='margin-left:25px;' onclick='delete_codi_file();' ><span>Delete Data File</span></button> ";
974
- }
975
-
976
- }
977
- else{
978
- if(r!="error"){
979
- status_div.innerHTML="<p id='codi_status_template_button'>"+transport.responseText+"% </p><p>A test data file is now being created. <span style='margin-left:15px;'><img src=\"<?=$this->getSkinUrl($this->__('images/codimport_run.gif'))?>\" ></span>&nbsp;&nbsp;&nbsp;</p>";
980
- }
981
- }
982
- if(r=="0")
983
- {
984
- status_div.innerHTML="<p>Your test data file was not created. Please contact your administrator( File Error ).</p>";
985
- }
986
-
987
- }
988
-
989
- //onFailure: this.ajaxFailure.bind(),
990
- });
991
- return r;
992
- }
993
-
994
- function createfileCatalogProject()
995
- {
996
- var img_url = "<?php echo $this->getSkinUrl($this->__('images/codimport_yes.gif')) ?>";
997
- var r;
998
- var base = "<?php echo $basePath ?>";
999
- var status_div = document.getElementById('codi_status_template');
1000
- status_div.innerHTML='Merging with Hierarchy';
1001
- var a = new Ajax.Request("<?php echo $createCatalogProject; ?>",
1002
- { asynchronous:false,
1003
- method: 'post',
1004
- parameters: "basepath="+base,
1005
- onSuccess: function(transport) {
1006
- r= transport.responseText;
1007
- if(r=='10'){
1008
- status_div.innerHTML="<p id='codi_status_template_button'>"+transport.responseText+"% </p> Your test data file was created successfully.<img src='" + img_url + "' /><button type='button' class='scalable add' style='margin-left:25px;' onclick='download_codi_file();' ><span>Download Data File</span></button><button type='button' class='scalable add' style='margin-left:25px;' onclick='delete_codi_file();' ><span>Delete Data File</span></button> ";
1009
-
1010
- }
1011
- else{
1012
- if(r!="error"){
1013
- status_div.innerHTML="<p id='codi_status_template_button'>"+transport.responseText+"% </p><p>A test data file is now being created. <span style='margin-left:15px;'><img src=\"<?=$this->getSkinUrl($this->__('images/codimport_run.gif'))?>\" ></span>&nbsp;&nbsp;&nbsp;</p>";
1014
- }
1015
- }
1016
- if(r=="error")
1017
- {
1018
- status_div.innerHTML="<p>Your test data file was not created. Please contact your administrator( File Error ).</p>";
1019
- }
1020
-
1021
- }
1022
-
1023
- //onFailure: this.ajaxFailure.bind(),
1024
- });
1025
- return r;
1026
- }
1027
-
1028
-
1029
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $codimodel = Mage::getSingleton('codi/codi');
3
+ $userid = Mage::getStoreConfig('codi/codi/codusername') ;
4
+ $password = Mage::getStoreConfig('codi/codi/codpassword') ;
5
+ $secretkey = Mage::getStoreConfig('codi/codi/secretkey') ;
6
+
7
+ $enablefreshflyers = Mage::getStoreConfig('codi/codi/enablefreshflyers') ;
8
+ $enablereviews = Mage::getStoreConfig('codi/codi/codenablereviews') ;
9
+ $fromchild = Mage::getStoreConfig('codi/codi/fromchild') ;
10
+
11
+ $codflyerlinkimg = Mage::getStoreConfig('codi/codi/codflyerlinkimg') ;
12
+ $codflyerlinkimgurl = Mage::getStoreConfig('codi/codi/codflyerlinkimgurl') ;
13
+ $codflyerlinkimgalt = Mage::getStoreConfig('codi/codi/codflyerlinkimgalt') ;
14
+
15
+ $codbeforename = Mage::getStoreConfig('codi/codi/codbeforename') ;
16
+ $codaftername = Mage::getStoreConfig('codi/codi/codaftername') ;
17
+
18
+ $codbeforeemailto = Mage::getStoreConfig('codi/codi/codbeforeemailto') ;
19
+ $codafteremailto = Mage::getStoreConfig('codi/codi/codafteremailto') ;
20
+
21
+ $codbeforeOR = Mage::getStoreConfig('codi/codi/codbeforeOR') ;
22
+ $codafterOR = Mage::getStoreConfig('codi/codi/codafterOR') ;
23
+
24
+ $codbeforeoverview = Mage::getStoreConfig('codi/codi/codbeforeoverview') ;
25
+ $codafteroverview = Mage::getStoreConfig('codi/codi/codafteroverview') ;
26
+
27
+ $codbgcheck = Mage::getStoreConfig('codi/codi/codbgcheck') ;
28
+
29
+ $post_url = $this->getUrl('codi/nsync/manual');
30
+ $post_url_upd = $this->getUrl('codi/adminhtml_menu/updatestatus');
31
+ $post_url_cancel = $this->getUrl('codi/adminhtml_menu/cancel');
32
+ $post_bgprocess_check = $this->getUrl('codi/adminhtml_menu/bgcheck');
33
+ //chagned ver 3.0.1
34
+ $newpostupdate = $this->getUrl('codi/nsync/updatestatus');
35
+ //Changed for category section file
36
+ $createCatalogSection = $this->getUrl('codi/nsync/createcatalogsection');
37
+
38
+ //Changed for Category project section
39
+ $createCatalogProject = $this->getUrl('codi/nsync/createcatalogproject');
40
+
41
+ //Changed ver 2.2.15
42
+ $download_url = $this->getUrl('codi/adminhtml_menu/downloadtest');
43
+ $delete_codi_url = $this->getUrl('codi/adminhtml_menu/deletetest');
44
+
45
+ //Chagned ver 2.2.16
46
+ $datafilelaunch = Mage::getStoreConfig('codi/codi/coddatafilelaunch');
47
+
48
+ $codbg_checked = "";
49
+ if ( $codbgcheck == 1 ) $codbg_checked = "checked";
50
+
51
+ $extensionName="Mage_PDF_per_Product";
52
+ $currentVer = Mage::getConfig()->getModuleConfig('Mage_Codi')->version;
53
+
54
+ //Changed ver 3.0.1 Added wait for minute parameter
55
+ $waitforminute=Mage::getStoreConfig('codi/codi/codwaitforminute');
56
+ $includeshortdescription = Mage::getStoreConfig('codi/codi/codincludeshortdescription');
57
+
58
+ //Chagned ver 3.0.2 Added Tier price display settings
59
+ $publishtieredpricing=Mage::getStoreConfig('codi/codi/codpublishtieredpricing');
60
+ $codquantity=Mage::getStoreConfig('codi/codi/codquantity');
61
+ $codprice=Mage::getStoreConfig('codi/codi/codprice');
62
+ $codsavings=Mage::getStoreConfig('codi/codi/codsavings');
63
+
64
+ //Changed for show download zip file url
65
+ $zipurl = $this->getUrl('CoDzip/') ;
66
+ $pos = strrpos ($zipurl , 'key') ;
67
+ if ( $pos != 0 )
68
+ $zipurl = substr( $zipurl , 0 , $pos ) ;
69
+ else
70
+ $zipurl = $zipurl;
71
+
72
+ $zipurl=str_replace("index.php/CoDzip/index/index/", "CoDzip/",$zipurl);
73
+
74
+ ?>
75
+ <style>
76
+ #codi_status_template_button{
77
+ margin-bottom:0.5em;
78
+ width:329px;
79
+ }
80
+ #codi_status_template{
81
+ margin-bottom:0.5em;
82
+ width:330px;
83
+ }
84
+ #tooltip {
85
+ position: absolute;
86
+ z-index: 3000;
87
+ border: 1px solid #111;
88
+ background-color: #eee;
89
+ padding: 5px;
90
+ max-width:500px;
91
+ }
92
+ #tooltip h3, #tooltip div { margin: 0; }
93
+ #tooltip ul{list-style:disc outside none;margin-left:12px;margin-bottom:12px;padding-left:40px;}
94
+ .hidden{display:none;}
95
+ .waitforminute{width:59px;}
96
+ .tiredprice{width:155px;visibility:visible;height:12px;display:block;}
97
+ .displayOption{width:120px;visibility:visible;height:12px;display:block;}
98
+ </style>
99
+
100
+ <div id="page:main-container">
101
+ <div class="columns ">
102
+ <div class="side-col" id="page:left">
103
+ <h3>Catalog-On-Demand®</h3>
104
+ <?php
105
+ $CodiModel = Mage::getModel('codi/codi');
106
+ $vari=$CodiModel->getstatus();// check status for datafile
107
+
108
+ foreach ($vari as $var)
109
+ {
110
+ $message=$var['message'];
111
+ $finished=$var['finished'];
112
+ $start_time=$var['created_time'];
113
+ }
114
+
115
+ $end_time=strtotime('+1 hours',$start_time);
116
+ $endwait_time=strtotime('+'.$waitforminute. 'minutes',$start_time);
117
+ $current_time=time();
118
+
119
+
120
+ if($finished==1 && $endwait_time<$current_time &&$end_time<$current_time)
121
+ {
122
+ $mess='Sorry! Your last product import failed. Please use Manual mode to create the data file. Click on the help icon for instructions.';
123
+
124
+ }
125
+
126
+
127
+ if($start_time<$current_time && $current_time<$end_time)
128
+ {
129
+ $data='Data file is in process';
130
+
131
+ ?>
132
+ <ul id="product_info_tabs" class="tabs">
133
+ <li >
134
+ <a href="<?php echo $this->getUrl('codi/adminhtml_menu/register');?>" onclick="return false;">
135
+ <span>Sign Up</span>
136
+ </a>
137
+ </li>
138
+ <li >
139
+ <a href="<?php echo $this->getUrl('codi/adminhtml_menu/auth');?>" onclick="return false;" >
140
+ <span>Configuration Settings</span>
141
+ </a>
142
+ </li>
143
+ <li >
144
+ <a href="<?php echo $this->getUrl('codi/adminhtml_menu/systemtest');?>" onclick="return false;">
145
+ <span>System Test</span>
146
+ </a>
147
+ </li>
148
+ <li >
149
+ <a href="<?php echo $this->getUrl('codi/adminhtml_menu/documentation');?>" onclick="return false;">
150
+ <span>Documentation</span>
151
+ </a>
152
+ </li>
153
+ </ul>
154
+ <?php
155
+ }
156
+
157
+ else
158
+ {
159
+ ?>
160
+
161
+ <ul id="product_info_tabs" class="tabs">
162
+ <li >
163
+ <a href="<?php echo $this->getUrl('codi/adminhtml_menu/register');?>" class="tab-item-link "
164
+ <?php if ( $codimodel->target == "register") echo "style='background-color:#ffffff;'" ; ?>
165
+ onclick="window.open ('https://www.catalog-on-demand.com/signup/');" >
166
+ <span>Sign Up</span>
167
+ </a>
168
+ </li>
169
+ <li >
170
+ <a href="<?php echo $this->getUrl('codi/adminhtml_menu/auth');?>" class="tab-item-link "
171
+ <?php if ( $codimodel->target == "auth") echo "style='background-color:#ffffff;'" ; ?> >
172
+ <span>Configuration Settings</span>
173
+ </a>
174
+ </li>
175
+ <li >
176
+ <a href="<?php echo $this->getUrl('codi/adminhtml_menu/systemtest');?>" class="tab-item-link "
177
+ <?php if ( $codimodel->target == "systemtest") echo "style='background-color:#ffffff;'" ; ?> >
178
+ <span>System Test</span>
179
+ </a>
180
+ </li>
181
+ <li >
182
+ <a href="<?php echo $this->getUrl('codi/adminhtml_menu/documentation');?>" class="tab-item-link "
183
+ <?php if ( $codimodel->target == "documentation") echo "style='background-color:#ffffff;'" ; ?>
184
+ onclick="window.open ('http://www.catalog-on-demand.com/plans/catalog-on-demand_for_magento.php');">
185
+ <span>Documentation</span>
186
+ </a>
187
+ </li>
188
+ </ul>
189
+ <?php
190
+ }?>
191
+ </div>
192
+ <div class="main-col" id="content">
193
+ <div class="main-col-inner">
194
+ <div class="content-header"></div>
195
+ <!-- Show message when data file is in process or stopped -->
196
+ <div style="color: red;"><?php echo $mess; ?></div>
197
+ <div style="color: green;font: 12px/1.5em "><?php echo $data; ?></div>
198
+ <?php
199
+ $extensions = array('curl','dom', 'hash','iconv','mcrypt' );
200
+
201
+ $fail = '';
202
+ $pass = '';
203
+
204
+ if(version_compare(phpversion(), '5.2.0', '<')) {
205
+ $fail .= '<li>You need<strong> PHP 5.2.0</strong> (or greater). Your current version is '.phpversion().'</li>';
206
+ }
207
+ else {
208
+ $pass .='<li>You have<strong> PHP '.phpversion().'</strong></li>';
209
+ }
210
+
211
+ if( !ini_get('safe_mode') ) {
212
+ $pass .='<li>Safe Mode is <strong>off</strong></li>';
213
+ }
214
+ else { $fail .= '<li>Safe Mode is <strong>on</strong></li>'; }
215
+
216
+ foreach($extensions as $extension) {
217
+ if( !extension_loaded($extension) ) {
218
+ $fail .= '<li> You are missing the <strong>'.$extension.'</strong> extension</li>';
219
+ }
220
+ else{
221
+ $pass .= '<li>You have the <strong>'.$extension.'</strong> extension</li>';
222
+ }
223
+ }
224
+
225
+
226
+ $baseDir = dirname(__FILE__);
227
+
228
+ $_baseDirArray = explode("app", $baseDir);
229
+ $basePath = $_baseDirArray[0];
230
+
231
+ //Create folder if not exist. change for zip
232
+ if (!is_dir($basePath.'CoDzip/') )
233
+ {
234
+ if (!mkdir($basePath.'CoDzip/'))
235
+ {
236
+ $fail .= "<li>Could not create <strong>CoDzip</strong> folder.</li>";
237
+ $fail .= "<li>Please create <strong>CoDzip manually</strong> in ".$basePath."</li>";
238
+
239
+ }
240
+ }
241
+ if (is_dir($basePath.'CoDzip/') )
242
+ {
243
+ if (!is_dir($basePath.'CoDzip/CoDfiles/') )
244
+ {
245
+ if (!mkdir($basePath.'CoDzip/CoDfiles/'))
246
+ {
247
+ $fail .= "<li>Could not create <strong>CoDzip/CoDfiles</strong> folder.</li>";
248
+ $fail .= "<li>Please create <strong>CoDzip/CoDfiles manually</strong> in ".$basePath."</li>";
249
+ }
250
+ }
251
+ }
252
+ /*if ( !is_dir($basePath.'CoDzip/CoDfiles/') ){
253
+ if ( !mkdir($basePath.'CoDzip/CoDFiles/') ){
254
+
255
+ $fail .= "<li>Could not create <strong>CoDzip</strong> folder.</li>";
256
+ $fail .= "<li>Please create <strong>CoDzip manually</strong> in ".$basePath."</li>";
257
+ }
258
+ }*/
259
+
260
+ $is_file = true;
261
+
262
+ if ( !$codimodel->createFileInit($basePath) ){
263
+ $fail .= "<li>The Magento extension was prevented from creating a file in the folder CoDzip. Please notify your Magento administrator.</li>";
264
+ $is_file = false;
265
+ }
266
+
267
+ $target = $codimodel->target;
268
+
269
+ if ( $target == "auth" && $fail != "" ){
270
+ $target = "systemtest";
271
+ }
272
+
273
+ switch ($target)
274
+ {
275
+ case "register":
276
+ break;
277
+ case "documentation":
278
+ break;
279
+ case "systemtest":
280
+
281
+ echo "<div class='entry-edit'>
282
+ <div class='entry-edit-head'>
283
+ <h4 class='icon-head head-edit-form fieldset-legend'>System Test</h4>
284
+ <div>&nbsp;</div>
285
+ </div>
286
+ <div class='fieldset'>
287
+ ";
288
+
289
+ if( $fail ) {
290
+ echo '<p><strong>Your server is not properly configured to run the Catalog-on-Demand® for Magento® extension.</strong>';
291
+ echo '<br>Please contact your hosting provider to report the failure of the following tests:';
292
+ echo '<br><ul>'.$fail.'</ul></p>';
293
+ echo '<br>The following tests were successfully met:';
294
+ echo '<ul>'.$pass.'</ul>';
295
+ } else {
296
+ echo '<p><strong>Congratulations!</strong>&nbsp; Your server has passed all the tests to properly run the Catalog-on-Demand® for Magento® extension.</p>';
297
+ echo '<ul>'.$pass.'</ul>';
298
+ }
299
+
300
+ echo "<br/>";
301
+
302
+
303
+ echo '<p> Current Extension Name : <b>'.$extensionName.'</b></p>';
304
+
305
+ echo '<p>Current Extension Version: <b>'.$currentVer.'</b></p>';
306
+
307
+
308
+
309
+
310
+ $exec_command = "";
311
+
312
+ if( (false !== strpos(ini_get("disable_functions"), "exec")) || (false !== strpos(ini_get("disable_functions"), "shell_exec")) ) {
313
+ $exec_command = "<p>The <strong>exec</strong> and/or <strong>shell_exec</strong> functions are disabled in your php.ini. See the line starting with <strong>'disable_functions ='</strong>. Unless you remove both <strong>'exec'</strong> and <strong>'shell_exec'</strong> from this line, you may not use the background process to create data files. This may be a problem if you have a large product database.</p>";
314
+ }else{
315
+ $exec_command = "The <strong>exec</strong> and <strong>shell_exec</strong> functions are enabled. You may use the background process to create data files.";
316
+ }
317
+
318
+ echo $exec_command;
319
+
320
+ echo "<br/><br/>";
321
+
322
+ foreach (Mage::app()->getWebsites() as $website)
323
+ {
324
+ $defaultGroup = $website->getDefaultGroup();
325
+ $StoreId = $defaultGroup->getDefaultStoreId();
326
+ }
327
+
328
+ $design = Mage::getSingleton('core/design')->loadChange($StoreId);
329
+
330
+ $package = $design->getPackage();
331
+ $default_theme = $design->getTheme();
332
+
333
+ if ( $package == "" && $default_theme == "" ){
334
+
335
+ $package = Mage::getStoreConfig('design/package/name', $StoreId);
336
+ $default_theme = Mage::getStoreConfig('design/theme/default', $StoreId);
337
+ }
338
+
339
+ if ( $package == "" ) $package = "default";
340
+ if ( $default_theme == "" ) $default_theme = "default";
341
+
342
+ $update_guide = "<ul style='list-style:decimal outside none;padding-left:30px;'>";
343
+ $update_guide .= "<li><p>Open this file : /app/design/frontend/default/default/template/catalog/product/view.phtml. This will be your 'source' file.</p></li>";
344
+ $update_guide .= "<li><p>Your view.phtml ( /app/design/frontend/".$package."/".$default_theme."/template/catalog/product/view.phtml ) will be your 'target' file. </p><p>Please copy the code as follows: </p>";
345
+ $update_guide .= "<ul style='list-style:square outside none;padding-left:30px;'>";
346
+ $update_guide .= "<li><p>Copy lines 37-50, and paste after the line containing getProduct().</p></li>";
347
+ $update_guide .= "<li><p>Copy line 69 and paste before the line containing 'name'.</p></li>";
348
+ $update_guide .= "<li><p>Copy line 71 and paste after the line containing 'name'.</p></li>";
349
+ $update_guide .= "<li><p>Copy line 79 and paste before the line containing 'Email to a Friend'.</p></li>";
350
+ $update_guide .= "<li><p>Copy line 81 and paste after the line containing 'Email to a Friend'.</p></li>";
351
+ $update_guide .= "<li><p>Copy line 99 and paste before the line containing 'OR'.</p></li>";
352
+ $update_guide .= "<li><p>Copy line 101 and paste after the line containing 'OR'.</p></li>";
353
+ $update_guide .= "<li><p>Copy line 115 and paste before the line containing 'Quick Overview'.</p></li>";
354
+ $update_guide .= "<li><p>Copy line 117 and paste after the line containing 'Quick Overview'.</p></li>";
355
+ $update_guide .= "</ul>";
356
+ $update_guide .= "</li>";
357
+ $update_guide .= "<ul>";
358
+
359
+ if ( $package != "default" || $default_theme != "default" ){
360
+
361
+ echo "<p>This is important if you intend to use the Always Fresh™ 'flyer-per-product-page' feature of Catalog-on-Demand®.</p>";
362
+ echo "<p>You are using the following theme : <strong>".$package." / ".$default_theme."</strong></p>";
363
+ echo "<p>Your site admin will need to edit the view.html for this theme, as follows:</p>";
364
+ echo $update_guide;
365
+
366
+ }else{
367
+ echo "<p>You have the default theme.</p>";
368
+ }
369
+
370
+ echo "</div></div>";
371
+ echo "<br />";
372
+
373
+ $text = "";
374
+
375
+ if ( $is_file ){
376
+
377
+ $message = $codimodel->getImportStatuses();
378
+
379
+ if ( isset($message) ){
380
+
381
+ $status = $message['message'];
382
+
383
+ if ( $status== "end" && $message['finished'] == 1 ){
384
+ $text = "<p id='codi_status_template_button'>Your test data file was created successfully. &nbsp;<img src='".$this->getSkinUrl($this->__('images/codimport_yes.gif'))."' /> <button type='button' onclick='download_codi_file();' class='scalable add' style='margin-left:25px;' ><span>Download Data File</span></button> <button type='button' onclick='delete_codi_file();' class='scalable add' style='margin-left:25px;' ><span>Delete Data File</span></button></p>";
385
+ $codimodel->deleteTable();
386
+ }else if ( $status== "start" && $message['finished'] == 0 ) {
387
+ $text = "<p>A test data file is now being created. <span style='margin-left:15px;'><img src='".$this->getSkinUrl($this->__('images/codimport_run.gif'))."' /></span>&nbsp;&nbsp;&nbsp;</p>" ;
388
+ }else if ( $status== "fileerror" && $message['finished'] == 0 ) {
389
+ $text = "<p>Your test data file was not created. Please contact your administrator.</p>";
390
+ $codimodel->deleteTable();
391
+ }else{
392
+ $text = "<p>Your test data file was not created. Please contact your administrator.</p>";
393
+ $codimodel->deleteTable();
394
+ }
395
+ }
396
+ else{
397
+ //Changed on version 2.2.15
398
+ //$text .= "<a href='#datafilebackground_tooltip'><img src='".$this->getSkinUrl($this->__('images/preview_field_help.png'))."' /></a><input type='checkbox' id='background_process' name='background_process' ".$codbg_checked." style='margin:0px 5px 0px 15px;cursor:pointer' onclick='onBackgroundProcess(this)' />Create data file using background process<br /><br />";
399
+ $text .= "<button type='button' class='scalable add' onclick='start_codi_import()' style='margin-left:25px;' ><span>Test</span></button>";
400
+ }
401
+
402
+
403
+ }
404
+ break;
405
+ case "auth":
406
+ ?>
407
+
408
+ <?php echo $this->getStoreSwitcherHtml() ?>
409
+
410
+ <form name="codiform" action="<?php echo $this->getUrl('codi/adminhtml_menu/authsave') ?>" method="post" id="codiform">
411
+ <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
412
+ <input name="store" type="hidden" value="<?php echo $this->getRequest()->getParam('store'); ?>" />
413
+ <div class="entry-edit">
414
+ <div class="entry-edit-head">
415
+ <h4 class="icon-head head-edit-form fieldset-legend">Configuration Settings</h4>
416
+ <div class="form-buttons" align="right">
417
+ <button type="submit" class="scalable add" ><span>Save</span></button>
418
+ </div>
419
+ <div>&nbsp;</div>
420
+ </div>
421
+ <div class="fieldset " id="group_fields12">
422
+ <div class="hor-scroll">
423
+ <table cellspacing="0" class="form-list">
424
+ <tbody>
425
+ <tr>
426
+ <td class="scope-label"><a href="#accountid_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
427
+ <td class="label"><label for="userid">Account ID</label></td>
428
+ <td class="value"><input name="userid" onchange="makeLowercase();" id="userid" value="<?php echo $userid ?>" class=" input-text" type="text"/></td>
429
+ <td><small>&nbsp;</small></td>
430
+ </tr>
431
+ <tr>
432
+ <td class="scope-label"><a href="#secretkey_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
433
+ <td class="label"><label for="secretkey">Secret Key</label></td>
434
+ <td class="value"><input name="secretkey" id="secretkey" value="<?php echo $secretkey ?>" class=" input-text" type="text"/></td>
435
+ <td><small>&nbsp;</small></td>
436
+ </tr>
437
+ <tr>
438
+ <td class="scope-label"><a href="#kickoffurl_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
439
+ <td class="label"><label for="secretkey">Kick-off URL</label></td>
440
+ <td class="value"><label>
441
+ <?php
442
+ $url = $this->getUrl('codi/sync') ;
443
+ $pos = strrpos ($url , 'key') ;
444
+ if ( $pos != 0 )
445
+ $kickoffurl = substr( $url , 0 , $pos ) ;
446
+ else
447
+ $kickoffurl = $url;
448
+
449
+ echo "<input class='input-text' type='text' name='kickoffurl' value='".$kickoffurl."'>" ;
450
+ ?></label>
451
+ </td>
452
+ <td><small>&nbsp;</small></td>
453
+ </tr>
454
+ <tr><td class="scope-label"></td><td class="label"></td><td class="value"></td><td><small>&nbsp;</small></td></tr>
455
+ <!-- Changed for version 2.2.16 to add data file launch mode -->
456
+ <tr>
457
+ <td class="scope-label"><a href="#data_file_launch_mode_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
458
+ <td class="label"><label for="DataFileLaunchMode">Data File Launch Mode</label></td>
459
+ <td class="value">
460
+ <input type="radio" value="manual" id="manual" name="datafilelaunch" <?php if ($datafilelaunch =="manual") echo "checked" ?> onclick="displayBlock('codi_status_template','cronjob','0');"/>&nbsp;<label for="manual">Manual&nbsp;<a href="#manual_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></label><br>
461
+ <p id="codi_status_template" name="codi_status_template" style="display:<?php if ($datafilelaunch =="manual") echo 'block'; else echo 'none';?>;">
462
+ <?php
463
+ $filename = $basePath.'CoDzip/CoDMagento.zip';
464
+ if (file_exists($filename)) {
465
+
466
+ $url = $this->getUrl('CoDzip/CoDMagento.zip') ;
467
+ $pos = strrpos ($url , 'key') ;
468
+ if ( $pos != 0 )
469
+ $url = substr( $url , 0 , $pos ) ;
470
+ else
471
+ $url = $url;
472
+
473
+ $zipfileurl=str_replace("index.php/CoDzip/CoDMagento.zip/index/", "CoDzip/CoDMagento.zip",$url);
474
+ $modifie="<input class='input-text' type='text' name='zipfileurl' value='".$zipfileurl."'><br/>" ;
475
+ $modifie.="Last Created Date: " . date("M d, Y H:i:s.", filemtime($filename))."(GMT)";
476
+ echo $modifie." <button type='button' onclick='download_codi_file();' class='scalable add' style='margin-left:25px;' ><span>Download Data File</span></button> <button type='button' onclick='delete_codi_file();' class='scalable add' style='margin-left:25px;' ><span>Delete Data File</span></button>";
477
+ }
478
+ else{
479
+ ?>
480
+ <button type='button' class='scalable add' onclick='start_codi_import()' style='margin-left:25px;' ><span>Create Data File</span></button>
481
+ <?php }?>
482
+ </p>
483
+
484
+
485
+ <input type="radio" value="cod" id="cod" name="datafilelaunch" <?php if ($datafilelaunch =="cod") echo "checked" ?> onclick="displayBlock('codi_status_template','cronjob','1');" />&nbsp;<label for="cod">Catalog-on-Demand&nbsp;<a href="#codoption_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></label>
486
+ <span style="display:<?php if ($datafilelaunch =="cod") echo ''; else echo 'none';?>;" id="waitforminute"><br>Minutes to wait for data file creation : <input type="text" name="waitforminute" onchange="valuevalidation(this.value,5,999,'Please enter only integer value between 5 and 999.','I');" class="waitforminute" width="60px" value="<?php echo $waitforminute;?>">&nbsp;<a href="#waitforminute_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></span><br>
487
+ <input type="radio" value="magento" id="magento" name="datafilelaunch" <?php if ($datafilelaunch =="magento") echo "checked" ?> onclick="displayBlock('cronjob','codi_status_template','0');" />&nbsp;<label for="magento">Cron-job &nbsp;<a href="#cronjoburl_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></label>
488
+ </td>
489
+ <td><small>&nbsp;</small></td>
490
+ </tr>
491
+ <tr>
492
+
493
+ <td class="scope-label"></td>
494
+ <td class="label"></td>
495
+ <td class="value">
496
+ <p id="cronjob" name="cronjob" style="display:<?php if ($datafilelaunch =="magento") echo 'block'; else echo 'none';?>;">
497
+ <?php
498
+ $url = $this->getUrl('codi/nsync') ;
499
+ $pos = strrpos ($url , 'key') ;
500
+ if ( $pos != 0 )
501
+ $cronjoburl = substr( $url , 0 , $pos ) ;
502
+ else
503
+ $cronjoburl = $url;
504
+
505
+ echo '<input type="text" class="input-text" name="cronjoburl" width="60px" value="wget '.$cronjoburl.'">' ;
506
+ ?></p>
507
+ </td>
508
+ <td><small>&nbsp;</small></td>
509
+ </tr>
510
+
511
+ <tr>
512
+ <td class="scope-label"><a href="#enablefreshflyers_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
513
+ <td class="label"><label for="enablefreshflyers">Enable Always Fresh™ Flyers</label></td>
514
+ <td class="value"><input name="enablefreshflyers" id="enablefreshflyers" value="checked" <?php if ($enablefreshflyers =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
515
+ <td><small>&nbsp;</small></td>
516
+ </tr>
517
+ <!-- Code for Include Short Description -->
518
+ <tr>
519
+ <td class="scope-label"><a href="#includeshortdescription_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
520
+ <td class="label"><label for="includeshortdescription">Include Short Description</label></td>
521
+ <td class="value"><input name="includeshortdescription" id="includeshortdescription" value="checked" <?php if ($includeshortdescription =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
522
+ <td><small>&nbsp;</small></td>
523
+ </tr>
524
+ <tr>
525
+ <td class="scope-label"><a href="#enablereviews_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
526
+ <td class="label"><label for="enablereviews">Enable Reviews</label></td>
527
+ <td class="value"><input name="enablereviews" id="enablereviews" value="checked" <?php if ($enablereviews =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
528
+ <td><small>&nbsp;</small></td>
529
+ </tr>
530
+ <tr>
531
+ <td class="scope-label"><a href="#getpricefromchild_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
532
+ <td class="label"><label for="fromchild">Get price from associated products</label></td>
533
+ <td class="value"><input name="fromchild" id="fromchild" value="checked" <?php if ($fromchild =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
534
+ <td><small>&nbsp;</small></td>
535
+
536
+ </tr>
537
+ <!-- Changes for Tired price option -->
538
+ </table>
539
+
540
+ <fieldset style="width:460px;">
541
+ <legend class="tiredprice"><a href="#tieredpricingoptions_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a>&nbsp; Tiered Pricing Options</legend>
542
+ <table class="form-list" cellpadding='0'>
543
+ <tr>
544
+ <td class="label"><label for="publishtieredpricing">Publish tiered pricing</label></td>
545
+ <td class="value"><input name="publishtieredpricing" id="publishtieredpricing" value="checked" <?php if ($publishtieredpricing =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
546
+ <td class="scope-label"></td>
547
+ <td><small>&nbsp;</small></td>
548
+ </tr>
549
+
550
+ <tr>
551
+ <td class="label"><label for="codquantity">Label for quantity column</label></td>
552
+ <td class="value"><input type="text" id="codquantity" name="codquantity" class="input-text" value="<?php if ($codquantity == '') echo 'Quantity'; else echo $codquantity ;?>"></td>
553
+ <td class="scope-label"></td>
554
+ <td><small>&nbsp;</small></td>
555
+ </tr>
556
+
557
+ <tr>
558
+ <td class="label"><label for="codprice">Label for price column</label></td>
559
+ <td class="value"><input type="text" id="codprice" name="codprice" class=" input-text" value="<?php if ($codprice == '') echo 'Price'; else echo $codprice;?>"> </td>
560
+ <td class="scope-label"></td>
561
+ <td><small>&nbsp;</small></td>
562
+ </tr>
563
+ <tr>
564
+ <td class="label"><label for="codsavings">Label for savings</label></td>
565
+ <td class="value"><input type="text" id="codsavings" name="codsavings" class=" input-text" value="<?php if ($codsavings == '') echo 'Savings'; else echo $codsavings;?>" ></td>
566
+ <td class="scope-label"></td>
567
+ <td><small>&nbsp;</small></td>
568
+ </tr>
569
+ </table>
570
+
571
+ </fieldset>
572
+ <!-- End changes for Tired price option -->
573
+ <table class="form-list">
574
+ <tr><td class="scope-label"></td><td class="label"></td><td class="value"></td><td><small>&nbsp;</small></td></tr>
575
+ <tr>
576
+ <td class="scope-label"><a href="#codflyerlinkimg_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
577
+ <td class="label"><label for="usedimage">Image to be used for flyer link</label></td>
578
+ <td class="value">
579
+ <input type="radio" value="Default" id="Default" name="codflyerlinkimg" <?php if ($codflyerlinkimg !="Custom") echo "checked" ?> onclick="document.getElementById('codflyerlinkimgurl').style.display='none';"/>&nbsp;<label for="Default">Default</label><br>
580
+ <input type="radio" value="Custom" id="Custom" name="codflyerlinkimg" <?php if ($codflyerlinkimg =="Custom") echo "checked" ?> onclick="document.getElementById('codflyerlinkimgurl').style.display='block';"/>
581
+ &nbsp;<label for="Custom">Custom</label>
582
+ </td>
583
+ <td>
584
+ <img src="<?php if ($codflyerlinkimg =='Custom') echo $codflyerlinkimgurl ; else echo 'http://www.catalog-on-demand.com/print-catalog.png'?>"></td>
585
+ </tr>
586
+ <tr>
587
+ <td class="scope-label"></td>
588
+ <td class="label"></td>
589
+ <td class="value">
590
+ <input type="text" id="codflyerlinkimgurl" name="codflyerlinkimgurl" class=" input-text"
591
+ value="<?php if ($codflyerlinkimg =='Custom') echo $codflyerlinkimgurl; else echo '';?>"
592
+ style="display:<?php if ($codflyerlinkimg =='Custom') echo 'block'; else echo 'none';?>" />
593
+ </td>
594
+ <td><small>&nbsp;</small></td>
595
+ </tr>
596
+ <tr>
597
+ <td class="scope-label"><a href="#codflyerlinkimgalt_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
598
+ <td class="label"><label for="usedimage">Alt text for flyer link image</label></td>
599
+ <td class="value">
600
+ <input type="text" id="codflyerlinkimgalt" name="codflyerlinkimgalt" class=" input-text"
601
+ value="<?php if ($codflyerlinkimgalt == '') echo 'Click for PDF of this product'; else echo $codflyerlinkimgalt ;?>" />
602
+ </td>
603
+ <td><small>&nbsp;</small></td>
604
+ </tr>
605
+ <tr><td class="scope-label"></td><td class="label"></td><td class="value"></td><td><small>&nbsp;</small></td></tr>
606
+ </table>
607
+ <fieldset style="width:460px;">
608
+ <legend class="displayOption"><a href="#displayoptions_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a>&nbsp; Display Options</legend>
609
+ <table class="form-list" cellpadding='0'>
610
+ <tr>
611
+ <td class="label"><label for="codbeforename">Display before product name</label></td>
612
+ <td class="value"><input name="codbeforename" id="codbeforename" value="checked" <?php if ($codbeforename =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
613
+ <td class="scope-label"></td>
614
+ <td><small>&nbsp;</small></td>
615
+ </tr>
616
+ <tr>
617
+ <td class="label"><label for="codaftername">Display after product name</label></td>
618
+ <td class="value"><input name="codaftername" id="codaftername" value="checked" <?php if ($codaftername =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
619
+ <td class="scope-label"></td>
620
+ <td><small>&nbsp;</small></td>
621
+ </tr>
622
+
623
+ <tr>
624
+ <td class="label"><label for="codbeforeemailto">Display before 'Email to a friend'</label></td>
625
+ <td class="value"><input name="codbeforeemailto" id="codbeforeemailto" value="checked" <?php if ($codbeforeemailto =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
626
+ <td class="scope-label"></td>
627
+ <td><small>&nbsp;</small></td>
628
+ </tr>
629
+ <tr>
630
+ <td class="label"><label for="codafteremailto">Display after 'Email to a friend'</label></td>
631
+ <td class="value"><input name="codafteremailto" id="codafteremailto" value="checked" <?php if ($codafteremailto =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
632
+ <td class="scope-label"></td>
633
+ <td><small>&nbsp;</small></td>
634
+ </tr>
635
+
636
+ <tr>
637
+ <td class="label"><label for="codbeforeOR">Display before 'OR'</label></td>
638
+ <td class="value"><input name="codbeforeOR" id="codbeforeOR" value="checked" <?php if ($codbeforeOR =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
639
+ <td class="scope-label"></td>
640
+ <td><small>&nbsp;</small></td>
641
+ </tr>
642
+ <tr>
643
+ <td class="label"><label for="codafterOR">Display after 'OR'</label></td>
644
+ <td class="value"><input name="codafterOR" id="codafterOR" value="checked" <?php if ($codafterOR =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
645
+ <td class="scope-label"></td>
646
+ <td><small>&nbsp;</small></td>
647
+ </tr>
648
+
649
+ <tr>
650
+ <td class="label"><label for="codbeforeoverview">Display before 'Quick Overview'</label></td>
651
+ <td class="value"><input name="codbeforeoverview" id="codbeforeoverview" value="checked" <?php if ($codbeforeoverview =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
652
+ <td class="scope-label"></td>
653
+ <td><small>&nbsp;</small></td>
654
+ </tr>
655
+ <tr>
656
+ <td class="label"><label for="codafteroverview">Display after 'Quick Overview'</label></td>
657
+ <td class="value"><input name="codafteroverview" id="codafteroverview" value="checked" <?php if ($codafteroverview =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
658
+ <td class="scope-label"></td>
659
+ <td><small>&nbsp;</small></td>
660
+ </tr>
661
+ </table>
662
+ </fieldset>
663
+
664
+ </tbody>
665
+ </table>
666
+ </div>
667
+ </div>
668
+ </div>
669
+ </form>
670
+ <?php
671
+ break;
672
+ }
673
+ ?>
674
+
675
+ </div>
676
+ </div>
677
+ </div>
678
+ </div>
679
+ <div id="accountid_tooltip" class="hidden">
680
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/accountid.html'); ?>
681
+ </div>
682
+ <div id="secretkey_tooltip" class="hidden">
683
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/secretkey.html'); ?>
684
+ </div>
685
+ <div id="kickoffurl_tooltip" class="hidden">
686
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/kickoffurl.html'); ?>
687
+ </div>
688
+ <div id="enablefreshflyers_tooltip" class="hidden">
689
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/enablefreshflyers.html'); ?>
690
+ </div>
691
+ <div id="enablereviews_tooltip" class="hidden">
692
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/enablereviews.html'); ?>
693
+ </div>
694
+ <div id="getpricefromchild_tooltip" class="hidden">
695
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/getpricefromchild.html'); ?>
696
+ </div>
697
+ <div id="codflyerlinkimg_tooltip" class="hidden">
698
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/codflyerlinkimg.html'); ?>
699
+ </div>
700
+ <div id="codflyerlinkimgalt_tooltip" class="hidden">
701
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/codflyerlinkimgalt.html'); ?>
702
+ </div>
703
+ <div id="displayoptions_tooltip" class="hidden">
704
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/displayoptions.html'); ?>
705
+ </div>
706
+ <div id="datafilebackground_tooltip" class="hidden">
707
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/datafilebackground.html'); ?>
708
+ </div>
709
+ <div id="data_file_launch_mode_tooltip" class="hidden">
710
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/datafilelaunchmode.html'); ?>
711
+ </div>
712
+ <div id="cronjoburl_tooltip" class="hidden">
713
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/cronjoburl.html'); ?>
714
+ </div>
715
+ <div id="codoption_tooltip" class="hidden">
716
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/CoDDataFileLaunch.html'); ?>
717
+ </div>
718
+ <div id="manual_tooltip" class="hidden">
719
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/ManualDataFileLaunch.html'); ?>
720
+ </div>
721
+
722
+ <div id="waitforminute_tooltip" class="hidden">
723
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/waitforminute.html'); ?>
724
+ </div>
725
+ <div id="includeshortdescription_tooltip" class="hidden">
726
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/shortdesc.html'); ?>
727
+ </div>
728
+
729
+ <script type="text/javascript" src="<?php echo $this->getJsUrl('jquery/jquery-1.2.6.noConflict.min.js') ?>"></script>
730
+ <script type="text/javascript" src="<?php echo $this->getJsUrl('jquery/jquery.tooltip.js') ?>"></script>
731
+ <script type="text/javascript">
732
+ jQuery("#content a").tooltip({
733
+ bodyHandler: function() {
734
+ return jQuery(jQuery(this).attr("href")).html();
735
+ },
736
+ delay: 0,
737
+ showURL: false
738
+ });
739
+
740
+ function start_codi_import(){
741
+ codi = new Codi('<?=$post_url?>','<?=$post_url_upd?>');
742
+ codi.startCodiImport();
743
+ }
744
+
745
+ function onBackgroundProcess(obj){
746
+ var value = 0;
747
+ if ( obj.checked == true )
748
+ value = 1;
749
+
750
+ var url = "<?php echo $post_bgprocess_check; ?>";
751
+ var param = "check=" + value;
752
+ new Ajax.Request(url,
753
+ {
754
+ method:'post',
755
+ parameters: param,
756
+ onSuccess: function(transport) {
757
+ }
758
+ });
759
+
760
+ }
761
+
762
+ var Codi = Class.create();
763
+
764
+ Codi.prototype = {
765
+ initialize: function(postUrl, postUrlUpd) {
766
+
767
+ this.postUrl = postUrl; //'https://techatcost.com/purchases/ajax/';
768
+ this.postUrlUpd = postUrlUpd;
769
+ this.failureUrl = document.URL;
770
+ // object with event message data
771
+ this.objectMsg = null;
772
+ // interval object
773
+ this.updateTimer = null;
774
+ // default shipping code. Display on errors
775
+
776
+ elem = 'checkoutSteps';
777
+ clickableEntity = '.head';
778
+
779
+ // overwrite Accordion class method
780
+ var headers = $$('#' + elem + ' .section ' + clickableEntity);
781
+ headers.each(function(header) {
782
+ Event.observe(header,'click',this.sectionClicked.bindAsEventListener(this));
783
+ }.bind(this));
784
+ },
785
+ startCodiImport: function () {
786
+ _this = this;
787
+ var param = "is_process=";
788
+ if ( jQuery('#background_process').is(':checked') == true )
789
+ param += "1";
790
+ else
791
+ param += "0";
792
+ new Ajax.Request(this.postUrl,
793
+ {
794
+ method:'post',
795
+ parameters: param,
796
+ requestTimeout: 100,
797
+
798
+ onSuccess: function(transport) {
799
+ var ret_msg = transport.responseText.evalJSON();
800
+ var status_div = document.getElementById('codi_status_template');
801
+ var v;
802
+ var totalproduct=ret_msg.length;
803
+ //check total products
804
+ if(totalproduct==0)
805
+ {
806
+ status_div.innerHTML = "<p>Your test data file was not created. Please contact your administrator.</p>";
807
+ }
808
+ else
809
+ {
810
+ for (var i=0;i<ret_msg.length;i++)
811
+ {
812
+ //alert(ret_msg[i]);
813
+ productid=ret_msg[i];
814
+ var j=i+1;
815
+ v=createfilenew(productid,j,totalproduct);
816
+ }
817
+ }
818
+
819
+ if ( ret_msg.success == 1 ){
820
+ status_div.innerHTML = "<p>A test data file is now being created. <span style='margin-left:15px;'><img src=\"<?=$this->getSkinUrl($this->__('images/codimport_run.gif'))?>\" ></span>&nbsp;&nbsp;&nbsp;</p>";
821
+ _this.updateTimer = setInterval(function(){_this.updateEvent();}, 10000);
822
+ }else if ( ret_msg.error == 1 ){
823
+ status_div.innerHTML = "<p>The Magento extension was prevented from creating a file in the folder CoDDataFile. Please notify your Magento administrator.</p>";
824
+ }else if ( ret_msg.exec == 1 || ret_msg.shellexec == 1 ) {
825
+ status_div.innerHTML = "<p>The <strong>exec</strong> and/or <strong>shell_exec</strong> functions are disabled in your php.ini. See the line starting with <strong>'disable_functions ='</strong>. Unless you remove both <strong>'exec'</strong> and <strong>'shell_exec'</strong> from this line, you may not use the background process to create data files. This may be a problem if you have a large product database.</p>";
826
+ }
827
+ },
828
+ onTimeout: function() {
829
+ var status_div = document.getElementById('codi_status_template');
830
+ status_div.innerHTML = "<p>Your test data file was not created. Please contact your administrator.</p>";
831
+ },
832
+ onFailure: function() {
833
+ var status_div = document.getElementById('codi_status_template');
834
+ status_div.innerHTML = "<p>Your test data file was not created. Please contact your administrator.</p>";
835
+ }
836
+ });
837
+ },
838
+
839
+ updateEvent: function () {
840
+ _this = this;
841
+ new Ajax.Request(this.postUrlUpd,
842
+ {
843
+ method: 'post',
844
+ onSuccess: function(transport) {
845
+ _this.objectMsg = transport.responseText.evalJSON();
846
+
847
+ if (_this.objectMsg.canceled == 1) {
848
+ _this.clearUpdateInterval();
849
+ _this.objectMsg.message = 'canceled';
850
+ _this.updateStatusHtml();
851
+ }
852
+
853
+ if (_this.objectMsg.processed == 1) {
854
+ }
855
+
856
+ if (_this.objectMsg.fileerror == 1) {
857
+ _this.clearUpdateInterval();
858
+ _this.objectMsg.message = 'fileerror';
859
+ _this.updateStatusHtml();
860
+ }
861
+
862
+ if (_this.objectMsg.error == 1) {
863
+ _this.clearUpdateInterval();
864
+ _this.objectMsg.message = 'error';
865
+ _this.updateStatusHtml();
866
+ }
867
+
868
+ if (_this.objectMsg.finished == 1) {
869
+ _this.objectMsg.message = 'finished';
870
+ _this.updateStatusHtml();
871
+ _this.clearUpdateInterval();
872
+ }
873
+ },
874
+ onFailure: this.ajaxFailure.bind(),
875
+ });
876
+ },
877
+
878
+ updateStatusHtml: function(){
879
+ message = this.objectMsg.message.toLowerCase();
880
+ var status_div = document.getElementById('codi_status_template');
881
+ var img_url = "<?php echo $this->getSkinUrl($this->__('images/codimport_yes.gif')) ?>";
882
+
883
+ if ( message == 'finished' ){
884
+ status_div.innerHTML="<p id='codi_status_template_button'>Your test data file was created successfully. &nbsp;<img src='" + img_url + "' /><button type='button' class='scalable add' style='margin-left:25px;' onclick='download_codi_file();' ><span>Download Data File</span></button><button type='button' class='scalable add' style='margin-left:25px;' onclick='delete_codi_file();' ><span>Delete Data File</span></button></p>";
885
+ this.clearUpdateInterval();
886
+ }
887
+
888
+ if ( message == 'canceled' ){
889
+ this.clearUpdateInterval();
890
+ }
891
+
892
+ if ( message == 'processed' ){
893
+ }
894
+
895
+ if ( message == 'fileerror' ){
896
+ status_div.innerHTML="<p>Your test data file was not created. Please contact your administrator( File Error ).</p>";
897
+ this.clearUpdateInterval();
898
+ }
899
+
900
+ if ( message == 'error' ){
901
+ status_div.innerHTML="<p>Your test data file was not created. Please contact your administrator.</p>";
902
+ this.clearUpdateInterval();
903
+ }
904
+
905
+ },
906
+
907
+ ajaxFailure: function(){
908
+ this.clearUpdateInterval();
909
+ var status_div = document.getElementById('codi_status_template');
910
+ status_div.innerHTML = "<p>Your test data file was not created. Please contact your administrator(Ajax failure).</p>";
911
+ },
912
+
913
+ clearUpdateInterval: function () {
914
+ clearInterval(this.updateTimer);
915
+ },
916
+ }
917
+ function download_codi_file()
918
+ {
919
+ window.location.href="<?php echo $download_url?>";
920
+
921
+ }
922
+ function delete_codi_file()
923
+ {
924
+ window.location.href="<?php echo $delete_codi_url?>";
925
+
926
+ }
927
+
928
+
929
+ function displayBlock(show,hide,hideboth)
930
+ {
931
+
932
+ if(hideboth=='1')
933
+ {
934
+ document.getElementById(show).style.display='none';
935
+ document.getElementById(hide).style.display='none';
936
+ document.getElementById('waitforminute').style.display='';
937
+
938
+ }
939
+ else
940
+ {
941
+ document.getElementById('waitforminute').style.display='none';
942
+ document.getElementById(show).style.display='';
943
+ document.getElementById(hide).style.display='none';
944
+ }
945
+
946
+ }
947
+ function cancel_codi_import(){
948
+
949
+ var url = "<?php echo $post_url_cancel; ?>";
950
+ new Ajax.Request(url,
951
+ {
952
+ method:'post',
953
+ onSuccess: function(transport) {
954
+ var ret_msg = transport.responseText;
955
+
956
+ if ( ret_msg ){
957
+
958
+ //var text = "<a href='#datafilebackground_tooltip'><img src=\"<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>\" /></a><br />";
959
+ text = "<button type='button' class='scalable add' onclick='start_codi_import()' style='margin-left:25px;' ><span>Create Data File</span></button>";
960
+
961
+ var status_div = document.getElementById('codi_status_template');
962
+ status_div.innerHTML = text;
963
+ }
964
+ }
965
+ });
966
+ }
967
+
968
+ function makeLowercase() {
969
+ document.getElementById('userid').value = document.getElementById('userid').value.toLowerCase();
970
+ }
971
+
972
+ function valuevalidation(value, min, max, alertbox, datatype)
973
+ {
974
+
975
+ with (value)
976
+ {
977
+ checkvalue=parseFloat(value);
978
+ if (datatype)
979
+ { smalldatatype=datatype.toLowerCase();
980
+ if (smalldatatype.charAt(0)=="i") {checkvalue=parseInt(value)};
981
+ }
982
+ if ((parseFloat(min)==min && checkvalue<min) || (parseFloat(max)==max && checkvalue>max) || value!=checkvalue)
983
+ {if (alertbox!="") {alert(alertbox);} return false;}
984
+ else {return true;}
985
+ }
986
+ }
987
+
988
+ function createfilenew(productid,i,totalproduct)
989
+ { var img_url = "<?php echo $this->getSkinUrl($this->__('images/codimport_yes.gif')) ?>";
990
+ var r;
991
+ var base = "<?php echo $basePath ?>";
992
+ var status_div = document.getElementById('codi_status_template');
993
+ var a = new Ajax.Request("<?php echo $newpostupdate; ?>",
994
+ { asynchronous:false,
995
+ method: 'post',
996
+ parameters: "product="+productid+"&counter="+i+"&total="+totalproduct+"&basepath="+base,
997
+ onSuccess: function(transport) {
998
+ r= transport.responseText;
999
+ if(r=='100'){
1000
+ //alert(r+'create');
1001
+ status_div.innerHTML="Building Hierarchy";
1002
+ createfileCatalogSection();
1003
+ }
1004
+ else{
1005
+ if(r!="error"){
1006
+ status_div.innerHTML="<p id='codi_status_template_button'>"+transport.responseText+"% </p><p>A test data file is now being created. <span style='margin-left:15px;'><img src=\"<?=$this->getSkinUrl($this->__('images/codimport_run.gif'))?>\" ></span>&nbsp;&nbsp;&nbsp;</p>";
1007
+ }
1008
+ }
1009
+ if(r=="error")
1010
+ {
1011
+ status_div.innerHTML="<p>Your test data file was not created. Please contact your administrator( File Error ).</p>";
1012
+ }
1013
+
1014
+ }
1015
+
1016
+ //onFailure: this.ajaxFailure.bind(),
1017
+ });
1018
+ return r;
1019
+ }
1020
+ function createfileCatalogSection()
1021
+ {
1022
+ var img_url = "<?php echo $this->getSkinUrl($this->__('images/codimport_yes.gif')) ?>";
1023
+ var r;
1024
+ var base = "<?php echo $basePath ?>";
1025
+ var status_div = document.getElementById('codi_status_template');
1026
+ status_div.innerHTML='Building Hierarchy';
1027
+ var a = new Ajax.Request("<?php echo $createCatalogSection; ?>",
1028
+ { asynchronous:false,
1029
+ method: 'post',
1030
+ parameters: "basepath="+base,
1031
+ onSuccess: function(transport) {
1032
+ r= transport.responseText;
1033
+ //alert(r+'section');
1034
+ if(r=='100'){
1035
+ t=createfileCatalogProject();
1036
+ if(t=='10'){
1037
+ status_div.innerHTML="<p id='codi_status_template_button'>"+transport.responseText+"% </p> <input class='input-text' type='text' name='zipfileurl' value='<?php echo $zipurl?>CoDMagento.zip'><br/> Your test data file was created successfully.<img src='" + img_url + "' /><button type='button' class='scalable add' style='margin-left:25px;' onclick='download_codi_file();' ><span>Download Data File</span></button><button type='button' class='scalable add' style='margin-left:25px;' onclick='delete_codi_file();' ><span>Delete Data File</span></button> ";
1038
+ }
1039
+
1040
+ }
1041
+ else{
1042
+ if(r!="error"){
1043
+ status_div.innerHTML="<p id='codi_status_template_button'>"+transport.responseText+"% </p><p>A test data file is now being created. <span style='margin-left:15px;'><img src=\"<?=$this->getSkinUrl($this->__('images/codimport_run.gif'))?>\" ></span>&nbsp;&nbsp;&nbsp;</p>";
1044
+ }
1045
+ }
1046
+ if(r=="0")
1047
+ {
1048
+ status_div.innerHTML="<p>Your test data file was not created. Please contact your administrator( File Error ).</p>";
1049
+ }
1050
+
1051
+ }
1052
+
1053
+ //onFailure: this.ajaxFailure.bind(),
1054
+ });
1055
+ return r;
1056
+ }
1057
+
1058
+ function createfileCatalogProject()
1059
+ {
1060
+ var img_url = "<?php echo $this->getSkinUrl($this->__('images/codimport_yes.gif')) ?>";
1061
+ var r;
1062
+ var base = "<?php echo $basePath ?>";
1063
+ var status_div = document.getElementById('codi_status_template');
1064
+ status_div.innerHTML='Merging with Hierarchy';
1065
+ var a = new Ajax.Request("<?php echo $createCatalogProject; ?>",
1066
+ { asynchronous:false,
1067
+ method: 'post',
1068
+ parameters: "basepath="+base,
1069
+ onSuccess: function(transport) {
1070
+ r= transport.responseText;
1071
+ if(r=='10'){
1072
+ status_div.innerHTML="<p id='codi_status_template_button'>"+transport.responseText+"% </p> Your test data file was created successfully.<img src='" + img_url + "' /><button type='button' class='scalable add' style='margin-left:25px;' onclick='download_codi_file();' ><span>Download Data File</span></button><button type='button' class='scalable add' style='margin-left:25px;' onclick='delete_codi_file();' ><span>Delete Data File</span></button> ";
1073
+
1074
+ }
1075
+ else{
1076
+ if(r!="error"){
1077
+ status_div.innerHTML="<p id='codi_status_template_button'>"+transport.responseText+"% </p><p>A test data file is now being created. <span style='margin-left:15px;'><img src=\"<?=$this->getSkinUrl($this->__('images/codimport_run.gif'))?>\" ></span>&nbsp;&nbsp;&nbsp;</p>";
1078
+ }
1079
+ }
1080
+ if(r=="error")
1081
+ {
1082
+ status_div.innerHTML="<p>Your test data file was not created. Please contact your administrator( File Error ).</p>";
1083
+ }
1084
+
1085
+ }
1086
+
1087
+ //onFailure: this.ajaxFailure.bind(),
1088
+ });
1089
+ return r;
1090
+ }
1091
+
1092
+
1093
+ </script>
js/jquery/jquery.tooltip.js CHANGED
@@ -1,294 +1,294 @@
1
- /*
2
- * jQuery Tooltip plugin 1.3
3
- *
4
- * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
5
- * http://docs.jquery.com/Plugins/Tooltip
6
- *
7
- * Copyright (c) 2006 - 2008 Jörn Zaefferer
8
- *
9
- * $Id: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer $
10
- *
11
- * Dual licensed under the MIT and GPL licenses:
12
- * http://www.opensource.org/licenses/mit-license.php
13
- * http://www.gnu.org/licenses/gpl.html
14
- */
15
-
16
- ;(function($) {
17
-
18
- // the tooltip element
19
- var helper = {},
20
- // the current tooltipped element
21
- current,
22
- // the title of the current element, used for restoring
23
- title,
24
- // timeout id for delayed tooltips
25
- tID,
26
- // IE 5.5 or 6
27
- IE = $.browser.msie && /MSIE\s(5\.5|6\.)/.test(navigator.userAgent),
28
- // flag for mouse tracking
29
- track = false;
30
-
31
- $.tooltip = {
32
- blocked: false,
33
- defaults: {
34
- delay: 200,
35
- fade: false,
36
- showURL: true,
37
- extraClass: "",
38
- top: 15,
39
- left: 15,
40
- id: "tooltip"
41
- },
42
- block: function() {
43
- $.tooltip.blocked = !$.tooltip.blocked;
44
- }
45
- };
46
-
47
- $.fn.extend({
48
- tooltip: function(settings) {
49
- settings = $.extend({}, $.tooltip.defaults, settings);
50
- createHelper(settings);
51
- return this.each(function() {
52
- $.data(this, "tooltip", settings);
53
- this.tOpacity = helper.parent.css("opacity");
54
- // copy tooltip into its own expando and remove the title
55
- this.tooltipText = this.title;
56
- $(this).removeAttr("title");
57
- // also remove alt attribute to prevent default tooltip in IE
58
- this.alt = "";
59
- })
60
- .mouseover(save)
61
- .mouseout(hide)
62
- .click(hide);
63
- },
64
- fixPNG: IE ? function() {
65
- return this.each(function () {
66
- var image = $(this).css('backgroundImage');
67
- if (image.match(/^url\(["']?(.*\.png)["']?\)$/i)) {
68
- image = RegExp.$1;
69
- $(this).css({
70
- 'backgroundImage': 'none',
71
- 'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
72
- }).each(function () {
73
- var position = $(this).css('position');
74
- if (position != 'absolute' && position != 'relative')
75
- $(this).css('position', 'relative');
76
- });
77
- }
78
- });
79
- } : function() { return this; },
80
- unfixPNG: IE ? function() {
81
- return this.each(function () {
82
- $(this).css({'filter': '', backgroundImage: ''});
83
- });
84
- } : function() { return this; },
85
- hideWhenEmpty: function() {
86
- return this.each(function() {
87
- $(this)[ $(this).html() ? "show" : "hide" ]();
88
- });
89
- },
90
- url: function() {
91
- return this.attr('href') || this.attr('src');
92
- }
93
- });
94
-
95
- function createHelper(settings) {
96
- // there can be only one tooltip helper
97
- if( helper.parent )
98
- return;
99
- // create the helper, h3 for title, div for url
100
- helper.parent = $('<div id="' + settings.id + '"><h3></h3><div class="body"></div><div class="url"></div></div>')
101
- // add to document
102
- .appendTo(document.body)
103
- // hide it at first
104
- .hide();
105
-
106
- // apply bgiframe if available
107
- if ( $.fn.bgiframe )
108
- helper.parent.bgiframe();
109
-
110
- // save references to title and url elements
111
- helper.title = $('h3', helper.parent);
112
- helper.body = $('div.body', helper.parent);
113
- helper.url = $('div.url', helper.parent);
114
- }
115
-
116
- function settings(element) {
117
- return $.data(element, "tooltip");
118
- }
119
-
120
- // main event handler to start showing tooltips
121
- function handle(event) {
122
- // show helper, either with timeout or on instant
123
- if( settings(this).delay )
124
- tID = setTimeout(show, settings(this).delay);
125
- else
126
- show();
127
-
128
- // if selected, update the helper position when the mouse moves
129
- track = !!settings(this).track;
130
- $(document.body).bind('mousemove', update);
131
-
132
- // update at least once
133
- update(event);
134
- }
135
-
136
- // save elements title before the tooltip is displayed
137
- function save() {
138
- // if this is the current source, or it has no title (occurs with click event), stop
139
- if ( $.tooltip.blocked || this == current || (!this.tooltipText && !settings(this).bodyHandler) )
140
- return;
141
-
142
- // save current
143
- current = this;
144
- title = this.tooltipText;
145
-
146
- if ( settings(this).bodyHandler ) {
147
- helper.title.hide();
148
- var bodyContent = settings(this).bodyHandler.call(this);
149
- if (bodyContent.nodeType || bodyContent.jquery) {
150
- helper.body.empty().append(bodyContent)
151
- } else {
152
- helper.body.html( bodyContent );
153
- }
154
- helper.body.show();
155
- } else if ( settings(this).showBody ) {
156
- var parts = title.split(settings(this).showBody);
157
- helper.title.html(parts.shift()).show();
158
- helper.body.empty();
159
- for(var i = 0, part; (part = parts[i]); i++) {
160
- if(i > 0)
161
- helper.body.append("<br/>");
162
- helper.body.append(part);
163
- }
164
- helper.body.hideWhenEmpty();
165
- } else {
166
- helper.title.html(title).show();
167
- helper.body.hide();
168
- }
169
-
170
- // if element has href or src, add and show it, otherwise hide it
171
- if( settings(this).showURL && $(this).url() )
172
- helper.url.html( $(this).url().replace('http://', '') ).show();
173
- else
174
- helper.url.hide();
175
-
176
- // add an optional class for this tip
177
- helper.parent.addClass(settings(this).extraClass);
178
-
179
- // fix PNG background for IE
180
- if (settings(this).fixPNG )
181
- helper.parent.fixPNG();
182
-
183
- handle.apply(this, arguments);
184
- }
185
-
186
- // delete timeout and show helper
187
- function show() {
188
- tID = null;
189
- if ((!IE || !$.fn.bgiframe) && settings(current).fade) {
190
- if (helper.parent.is(":animated"))
191
- helper.parent.stop().show().fadeTo(settings(current).fade, current.tOpacity);
192
- else
193
- helper.parent.is(':visible') ? helper.parent.fadeTo(settings(current).fade, current.tOpacity) : helper.parent.fadeIn(settings(current).fade);
194
- } else {
195
- helper.parent.show();
196
- }
197
- update();
198
- }
199
-
200
- /**
201
- * callback for mousemove
202
- * updates the helper position
203
- * removes itself when no current element
204
- */
205
- function update(event) {
206
- if($.tooltip.blocked)
207
- return;
208
-
209
- if (event && event.target.tagName == "OPTION") {
210
- return;
211
- }
212
-
213
- // stop updating when tracking is disabled and the tooltip is visible
214
- if ( !track && helper.parent.is(":visible")) {
215
- $(document.body).unbind('mousemove', update)
216
- }
217
-
218
- // if no current element is available, remove this listener
219
- if( current == null ) {
220
- $(document.body).unbind('mousemove', update);
221
- return;
222
- }
223
-
224
- // remove position helper classes
225
- helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");
226
-
227
- var left = helper.parent[0].offsetLeft;
228
- var top = helper.parent[0].offsetTop;
229
- if (event) {
230
- // position the helper 15 pixel to bottom right, starting from mouse position
231
- left = event.pageX + settings(current).left;
232
- top = event.pageY + settings(current).top;
233
- var right='auto';
234
- if (settings(current).positionLeft) {
235
- right = $(window).width() - left;
236
- left = 'auto';
237
- }
238
- helper.parent.css({
239
- left: left,
240
- right: right,
241
- top: top
242
- });
243
- }
244
-
245
- var v = viewport(),
246
- h = helper.parent[0];
247
- // check horizontal position
248
- if (v.x + v.cx < h.offsetLeft + h.offsetWidth) {
249
- left -= h.offsetWidth + 20 + settings(current).left;
250
- helper.parent.css({left: left + 'px'}).addClass("viewport-right");
251
- }
252
- // check vertical position
253
- if (v.y + v.cy < h.offsetTop + h.offsetHeight) {
254
- top -= h.offsetHeight + 20 + settings(current).top;
255
- helper.parent.css({top: top + 'px'}).addClass("viewport-bottom");
256
- }
257
- }
258
-
259
- function viewport() {
260
- return {
261
- x: $(window).scrollLeft(),
262
- y: $(window).scrollTop(),
263
- cx: $(window).width(),
264
- cy: $(window).height()
265
- };
266
- }
267
-
268
- // hide helper and restore added classes and the title
269
- function hide(event) {
270
- if($.tooltip.blocked)
271
- return;
272
- // clear timeout if possible
273
- if(tID)
274
- clearTimeout(tID);
275
- // no more current element
276
- current = null;
277
-
278
- var tsettings = settings(this);
279
- function complete() {
280
- helper.parent.removeClass( tsettings.extraClass ).hide().css("opacity", "");
281
- }
282
- if ((!IE || !$.fn.bgiframe) && tsettings.fade) {
283
- if (helper.parent.is(':animated'))
284
- helper.parent.stop().fadeTo(tsettings.fade, 0, complete);
285
- else
286
- helper.parent.stop().fadeOut(tsettings.fade, complete);
287
- } else
288
- complete();
289
-
290
- if( settings(this).fixPNG )
291
- helper.parent.unfixPNG();
292
- }
293
-
294
  })(jQuery);
1
+ /*
2
+ * jQuery Tooltip plugin 1.3
3
+ *
4
+ * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
5
+ * http://docs.jquery.com/Plugins/Tooltip
6
+ *
7
+ * Copyright (c) 2006 - 2008 Jörn Zaefferer
8
+ *
9
+ * $Id: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer $
10
+ *
11
+ * Dual licensed under the MIT and GPL licenses:
12
+ * http://www.opensource.org/licenses/mit-license.php
13
+ * http://www.gnu.org/licenses/gpl.html
14
+ */
15
+
16
+ ;(function($) {
17
+
18
+ // the tooltip element
19
+ var helper = {},
20
+ // the current tooltipped element
21
+ current,
22
+ // the title of the current element, used for restoring
23
+ title,
24
+ // timeout id for delayed tooltips
25
+ tID,
26
+ // IE 5.5 or 6
27
+ IE = $.browser.msie && /MSIE\s(5\.5|6\.)/.test(navigator.userAgent),
28
+ // flag for mouse tracking
29
+ track = false;
30
+
31
+ $.tooltip = {
32
+ blocked: false,
33
+ defaults: {
34
+ delay: 200,
35
+ fade: false,
36
+ showURL: true,
37
+ extraClass: "",
38
+ top: 15,
39
+ left: 15,
40
+ id: "tooltip"
41
+ },
42
+ block: function() {
43
+ $.tooltip.blocked = !$.tooltip.blocked;
44
+ }
45
+ };
46
+
47
+ $.fn.extend({
48
+ tooltip: function(settings) {
49
+ settings = $.extend({}, $.tooltip.defaults, settings);
50
+ createHelper(settings);
51
+ return this.each(function() {
52
+ $.data(this, "tooltip", settings);
53
+ this.tOpacity = helper.parent.css("opacity");
54
+ // copy tooltip into its own expando and remove the title
55
+ this.tooltipText = this.title;
56
+ $(this).removeAttr("title");
57
+ // also remove alt attribute to prevent default tooltip in IE
58
+ this.alt = "";
59
+ })
60
+ .mouseover(save)
61
+ .mouseout(hide)
62
+ .click(hide);
63
+ },
64
+ fixPNG: IE ? function() {
65
+ return this.each(function () {
66
+ var image = $(this).css('backgroundImage');
67
+ if (image.match(/^url\(["']?(.*\.png)["']?\)$/i)) {
68
+ image = RegExp.$1;
69
+ $(this).css({
70
+ 'backgroundImage': 'none',
71
+ 'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
72
+ }).each(function () {
73
+ var position = $(this).css('position');
74
+ if (position != 'absolute' && position != 'relative')
75
+ $(this).css('position', 'relative');
76
+ });
77
+ }
78
+ });
79
+ } : function() { return this; },
80
+ unfixPNG: IE ? function() {
81
+ return this.each(function () {
82
+ $(this).css({'filter': '', backgroundImage: ''});
83
+ });
84
+ } : function() { return this; },
85
+ hideWhenEmpty: function() {
86
+ return this.each(function() {
87
+ $(this)[ $(this).html() ? "show" : "hide" ]();
88
+ });
89
+ },
90
+ url: function() {
91
+ return this.attr('href') || this.attr('src');
92
+ }
93
+ });
94
+
95
+ function createHelper(settings) {
96
+ // there can be only one tooltip helper
97
+ if( helper.parent )
98
+ return;
99
+ // create the helper, h3 for title, div for url
100
+ helper.parent = $('<div id="' + settings.id + '"><h3></h3><div class="body"></div><div class="url"></div></div>')
101
+ // add to document
102
+ .appendTo(document.body)
103
+ // hide it at first
104
+ .hide();
105
+
106
+ // apply bgiframe if available
107
+ if ( $.fn.bgiframe )
108
+ helper.parent.bgiframe();
109
+
110
+ // save references to title and url elements
111
+ helper.title = $('h3', helper.parent);
112
+ helper.body = $('div.body', helper.parent);
113
+ helper.url = $('div.url', helper.parent);
114
+ }
115
+
116
+ function settings(element) {
117
+ return $.data(element, "tooltip");
118
+ }
119
+
120
+ // main event handler to start showing tooltips
121
+ function handle(event) {
122
+ // show helper, either with timeout or on instant
123
+ if( settings(this).delay )
124
+ tID = setTimeout(show, settings(this).delay);
125
+ else
126
+ show();
127
+
128
+ // if selected, update the helper position when the mouse moves
129
+ track = !!settings(this).track;
130
+ $(document.body).bind('mousemove', update);
131
+
132
+ // update at least once
133
+ update(event);
134
+ }
135
+
136
+ // save elements title before the tooltip is displayed
137
+ function save() {
138
+ // if this is the current source, or it has no title (occurs with click event), stop
139
+ if ( $.tooltip.blocked || this == current || (!this.tooltipText && !settings(this).bodyHandler) )
140
+ return;
141
+
142
+ // save current
143
+ current = this;
144
+ title = this.tooltipText;
145
+
146
+ if ( settings(this).bodyHandler ) {
147
+ helper.title.hide();
148
+ var bodyContent = settings(this).bodyHandler.call(this);
149
+ if (bodyContent.nodeType || bodyContent.jquery) {
150
+ helper.body.empty().append(bodyContent)
151
+ } else {
152
+ helper.body.html( bodyContent );
153
+ }
154
+ helper.body.show();
155
+ } else if ( settings(this).showBody ) {
156
+ var parts = title.split(settings(this).showBody);
157
+ helper.title.html(parts.shift()).show();
158
+ helper.body.empty();
159
+ for(var i = 0, part; (part = parts[i]); i++) {
160
+ if(i > 0)
161
+ helper.body.append("<br/>");
162
+ helper.body.append(part);
163
+ }
164
+ helper.body.hideWhenEmpty();
165
+ } else {
166
+ helper.title.html(title).show();
167
+ helper.body.hide();
168
+ }
169
+
170
+ // if element has href or src, add and show it, otherwise hide it
171
+ if( settings(this).showURL && $(this).url() )
172
+ helper.url.html( $(this).url().replace('http://', '') ).show();
173
+ else
174
+ helper.url.hide();
175
+
176
+ // add an optional class for this tip
177
+ helper.parent.addClass(settings(this).extraClass);
178
+
179
+ // fix PNG background for IE
180
+ if (settings(this).fixPNG )
181
+ helper.parent.fixPNG();
182
+
183
+ handle.apply(this, arguments);
184
+ }
185
+
186
+ // delete timeout and show helper
187
+ function show() {
188
+ tID = null;
189
+ if ((!IE || !$.fn.bgiframe) && settings(current).fade) {
190
+ if (helper.parent.is(":animated"))
191
+ helper.parent.stop().show().fadeTo(settings(current).fade, current.tOpacity);
192
+ else
193
+ helper.parent.is(':visible') ? helper.parent.fadeTo(settings(current).fade, current.tOpacity) : helper.parent.fadeIn(settings(current).fade);
194
+ } else {
195
+ helper.parent.show();
196
+ }
197
+ update();
198
+ }
199
+
200
+ /**
201
+ * callback for mousemove
202
+ * updates the helper position
203
+ * removes itself when no current element
204
+ */
205
+ function update(event) {
206
+ if($.tooltip.blocked)
207
+ return;
208
+
209
+ if (event && event.target.tagName == "OPTION") {
210
+ return;
211
+ }
212
+
213
+ // stop updating when tracking is disabled and the tooltip is visible
214
+ if ( !track && helper.parent.is(":visible")) {
215
+ $(document.body).unbind('mousemove', update)
216
+ }
217
+
218
+ // if no current element is available, remove this listener
219
+ if( current == null ) {
220
+ $(document.body).unbind('mousemove', update);
221
+ return;
222
+ }
223
+
224
+ // remove position helper classes
225
+ helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");
226
+
227
+ var left = helper.parent[0].offsetLeft;
228
+ var top = helper.parent[0].offsetTop;
229
+ if (event) {
230
+ // position the helper 15 pixel to bottom right, starting from mouse position
231
+ left = event.pageX + settings(current).left;
232
+ top = event.pageY + settings(current).top;
233
+ var right='auto';
234
+ if (settings(current).positionLeft) {
235
+ right = $(window).width() - left;
236
+ left = 'auto';
237
+ }
238
+ helper.parent.css({
239
+ left: left,
240
+ right: right,
241
+ top: top
242
+ });
243
+ }
244
+
245
+ var v = viewport(),
246
+ h = helper.parent[0];
247
+ // check horizontal position
248
+ if (v.x + v.cx < h.offsetLeft + h.offsetWidth) {
249
+ left -= h.offsetWidth + 20 + settings(current).left;
250
+ helper.parent.css({left: left + 'px'}).addClass("viewport-right");
251
+ }
252
+ // check vertical position
253
+ if (v.y + v.cy < h.offsetTop + h.offsetHeight) {
254
+ top -= h.offsetHeight + 20 + settings(current).top;
255
+ helper.parent.css({top: top + 'px'}).addClass("viewport-bottom");
256
+ }
257
+ }
258
+
259
+ function viewport() {
260
+ return {
261
+ x: $(window).scrollLeft(),
262
+ y: $(window).scrollTop(),
263
+ cx: $(window).width(),
264
+ cy: $(window).height()
265
+ };
266
+ }
267
+
268
+ // hide helper and restore added classes and the title
269
+ function hide(event) {
270
+ if($.tooltip.blocked)
271
+ return;
272
+ // clear timeout if possible
273
+ if(tID)
274
+ clearTimeout(tID);
275
+ // no more current element
276
+ current = null;
277
+
278
+ var tsettings = settings(this);
279
+ function complete() {
280
+ helper.parent.removeClass( tsettings.extraClass ).hide().css("opacity", "");
281
+ }
282
+ if ((!IE || !$.fn.bgiframe) && tsettings.fade) {
283
+ if (helper.parent.is(':animated'))
284
+ helper.parent.stop().fadeTo(tsettings.fade, 0, complete);
285
+ else
286
+ helper.parent.stop().fadeOut(tsettings.fade, complete);
287
+ } else
288
+ complete();
289
+
290
+ if( settings(this).fixPNG )
291
+ helper.parent.unfixPNG();
292
+ }
293
+
294
  })(jQuery);
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_PDF_per_Product</name>
4
- <version>3.0.5</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Catalog-On-Demand</summary>
10
  <description>Catalog-On-Demand</description>
11
- <notes>3.0.4- Added Catalog Project, Sections and Data file support</notes>
12
  <authors><author><name>catalogondemand</name><user>auto-converted</user><email>timh@catalog-on-demand.com</email></author></authors>
13
- <date>2011-12-06</date>
14
- <time>04:38:01</time>
15
- <contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="codimport_run.gif" hash="e805ea7eca1f34c75ba0f93780d32d38"/><file name="codimport_yes.gif" hash="0afb20898a704a106cb4c598868abf32"/><file name="preview_field_help.png" hash="1b1601459d25e8b1a6b1d109782078d2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="codi"><file name="index.phtml" hash="b1fa1b65044275ab9ec474fc84e0b379"/></dir></dir><dir name="layout"><file name="codi.xml" hash="9407985f30403744eb4e758312d62aef"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="catalog"><dir name="product"><file name="view.phtml" hash="86eff56921219708a31c279309b949ca"/></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="jquery"><file name="jquery-1.2.6.noConflict.min.js" hash="090fdb3fbcb4727c0ca20cca87e7e12d"/><file name="jquery.tooltip.js" hash="d17cc8af1b8a595bd597084232be87e0"/></dir></dir></target><target name="magecommunity"><dir name="Mage"><dir name="Codi"><dir name="Block"><dir name="Adminhtml"><file name="Menu.php" hash="f1f1858f0d5b9ce563e45781dbf6f633"/><file name="Switcher.php" hash="2a8001fa18ff263d6c4a05353e131825"/></dir><dir name="Customer"><file name="Codi.php" hash="a2769ec72db46ce58ceb28823c3dc1a0"/></dir></dir><dir name="Helper"><file name="Createzip.php" hash="03fe07641f6f3f480b1d1c47b5ab3901"/><file name="Data.php" hash="0c5442367142b7c2048ca900e1e5a8f1"/></dir><dir name="Model"><file name="Codi.php" hash="52087a8d0bc51fbb44ca1814ee304bbb"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MenuController.php" hash="00301b123b460d9b9ac58382701e5806"/></dir><file name="DeleteController.php" hash="7267c76bf9575d0d905d19e281b89905"/><file name="NsyncController.php" hash="8456908a4239529c39f897f07a40b9bc"/><file name="SyncController.php" hash="b0efee98bd5addc1fef81db6fd56634d"/></dir><dir name="etc"><file name="config.xml" hash="1e117f28ce2e0cc6cdb1d64dd7ac5c6c"/></dir><file name="Codi_Process.php" hash="543456357988f8f8301f959fa75f9bb6"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Codi.xml" hash="5d635cd2a0d415b67f095bda0298445d"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_PDF_per_Product</name>
4
+ <version>3.0.6</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Catalog-On-Demand</summary>
10
  <description>Catalog-On-Demand</description>
11
+ <notes>3.0.6- Added Catalog Project, Sections and Data file support</notes>
12
  <authors><author><name>catalogondemand</name><user>auto-converted</user><email>timh@catalog-on-demand.com</email></author></authors>
13
+ <date>2011-12-12</date>
14
+ <time>08:04:35</time>
15
+ <contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="codimport_run.gif" hash="e805ea7eca1f34c75ba0f93780d32d38"/><file name="codimport_yes.gif" hash="0afb20898a704a106cb4c598868abf32"/><file name="preview_field_help.png" hash="1b1601459d25e8b1a6b1d109782078d2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="codi"><file name="index.phtml" hash="655ebed208c9f7d106468048e4a79c49"/></dir></dir><dir name="layout"><file name="codi.xml" hash="9407985f30403744eb4e758312d62aef"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="catalog"><dir name="product"><file name="view.phtml" hash="86eff56921219708a31c279309b949ca"/></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="jquery"><file name="jquery-1.2.6.noConflict.min.js" hash="090fdb3fbcb4727c0ca20cca87e7e12d"/><file name="jquery.tooltip.js" hash="8217c6611da6cfe45094e58485d013f0"/></dir></dir></target><target name="magecommunity"><dir name="Mage"><dir name="Codi"><dir name="Block"><dir name="Adminhtml"><file name="Menu.php" hash="ae8a9d1be49f00102911ef5fbe97c126"/><file name="Switcher.php" hash="62f36d23f039d7c21ec84b42fd0532ff"/></dir><dir name="Customer"><file name="Codi.php" hash="17c557dbcfadd336dc7ba773d6304fc0"/></dir></dir><dir name="Helper"><file name="Createzip.php" hash="03fe07641f6f3f480b1d1c47b5ab3901"/><file name="Data.php" hash="0c5442367142b7c2048ca900e1e5a8f1"/></dir><dir name="Model"><file name="Codi.php" hash="44bfe5d1b40917101298239e413d7297"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MenuController.php" hash="0db56a3c8d2bdd2564c8231b1efa8860"/></dir><file name="DeleteController.php" hash="8030915b46c87e5369a7c34d979873b4"/><file name="NsyncController.php" hash="d7e7601f65d33c31a6801018469a1de6"/><file name="SyncController.php" hash="ce7dfa71ab6214fbb825578ea81f55d2"/></dir><dir name="etc"><file name="config.xml" hash="00b4ca52037df0406cbb50d0b355e46e"/></dir><dir name="sql"><dir name="codi_setup"><file name="mysql4-install-3.0.4.php" hash="ffa1c82119aa4a56a6123dd1c5feca8f"/><file name="mysql4-install-3.0.6.php" hash="ffa1c82119aa4a56a6123dd1c5feca8f"/></dir></dir><file name="Codi_Process.php" hash="07b09ec755a1ae56c3a9f3945aa72035"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Codi.xml" hash="5d635cd2a0d415b67f095bda0298445d"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>