Version Notes
2.2.17 - Added Magento 1.6 compatibility.
Download this release
Release Info
Developer | catalogondemand |
Extension | Mage_PDF_per_Product |
Version | 2.2.17 |
Comparing to | |
See all releases |
Version 2.2.17
- app/code/community/Mage/Codi/Block/Adminhtml/Menu.php +10 -0
- app/code/community/Mage/Codi/Block/Customer/Codi.php +526 -0
- app/code/community/Mage/Codi/Codi_Process.php +20 -0
- app/code/community/Mage/Codi/Helper/Data.php +113 -0
- app/code/community/Mage/Codi/Model/Codi.php +772 -0
- app/code/community/Mage/Codi/controllers/Adminhtml/MenuController.php +308 -0
- app/code/community/Mage/Codi/controllers/DeleteController.php +22 -0
- app/code/community/Mage/Codi/controllers/NsyncController.php +68 -0
- app/code/community/Mage/Codi/controllers/SyncController.php +166 -0
- app/code/community/Mage/Codi/etc/config.xml +146 -0
- app/design/adminhtml/default/default/template/codi/index.phtml +778 -0
- app/design/frontend/default/default/template/catalog/product/view.phtml +199 -0
- app/etc/modules/Mage_Codi.xml +9 -0
- js/jquery/jquery-1.2.6.noConflict.min.js +34 -0
- js/jquery/jquery.tooltip.js +294 -0
- package.xml +18 -0
- skin/adminhtml/default/default/images/codimport_run.gif +0 -0
- skin/adminhtml/default/default/images/codimport_yes.gif +0 -0
- skin/adminhtml/default/default/images/preview_field_help.png +0 -0
app/code/community/Mage/Codi/Block/Adminhtml/Menu.php
ADDED
@@ -0,0 +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 |
+
}
|
app/code/community/Mage/Codi/Block/Customer/Codi.php
ADDED
@@ -0,0 +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("'" , "'" , $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("'" , "'" , $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
ADDED
@@ -0,0 +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 |
+
?>
|
app/code/community/Mage/Codi/Helper/Data.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mage_Codi_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
function output_file($file, $name, $mime_type='')
|
5 |
+
{
|
6 |
+
/*
|
7 |
+
This function takes a path to a file to output ($file),
|
8 |
+
the filename that the browser will see ($name) and
|
9 |
+
the MIME type of the file ($mime_type, optional).
|
10 |
+
|
11 |
+
*/
|
12 |
+
if(!is_readable($file)) die('File not found or inaccessible!');
|
13 |
+
|
14 |
+
$size = filesize($file);
|
15 |
+
$name = rawurldecode($name);
|
16 |
+
|
17 |
+
/* Figure out the MIME type (if not specified) */
|
18 |
+
$known_mime_types=array(
|
19 |
+
"pdf" => "application/pdf",
|
20 |
+
"txt" => "text/plain",
|
21 |
+
"html" => "text/html",
|
22 |
+
"htm" => "text/html",
|
23 |
+
"exe" => "application/octet-stream",
|
24 |
+
"zip" => "application/zip",
|
25 |
+
"doc" => "application/msword",
|
26 |
+
"xls" => "application/vnd.ms-excel",
|
27 |
+
"ppt" => "application/vnd.ms-powerpoint",
|
28 |
+
"gif" => "image/gif",
|
29 |
+
"png" => "image/png",
|
30 |
+
"jpeg"=> "image/jpg",
|
31 |
+
"jpg" => "image/jpg",
|
32 |
+
"php" => "text/plain"
|
33 |
+
);
|
34 |
+
|
35 |
+
if($mime_type==''){
|
36 |
+
$file_extension = strtolower(substr(strrchr($file,"."),1));
|
37 |
+
if(array_key_exists($file_extension, $known_mime_types)){
|
38 |
+
$mime_type=$known_mime_types[$file_extension];
|
39 |
+
} else {
|
40 |
+
$mime_type="application/force-download";
|
41 |
+
};
|
42 |
+
};
|
43 |
+
|
44 |
+
@ob_end_clean(); //turn off output buffering to decrease cpu usage
|
45 |
+
|
46 |
+
// required for IE, otherwise Content-Disposition may be ignored
|
47 |
+
if(ini_get('zlib.output_compression'))
|
48 |
+
ini_set('zlib.output_compression', 'Off');
|
49 |
+
|
50 |
+
header('Content-Type: ' . $mime_type);
|
51 |
+
header('Content-Disposition: attachment; filename="'.$name.'"');
|
52 |
+
header("Content-Transfer-Encoding: binary");
|
53 |
+
header('Accept-Ranges: bytes');
|
54 |
+
|
55 |
+
/* The three lines below basically make the
|
56 |
+
download non-cacheable */
|
57 |
+
header("Cache-control: private");
|
58 |
+
header('Pragma: private');
|
59 |
+
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
60 |
+
|
61 |
+
// multipart-download and download resuming support
|
62 |
+
if(isset($_SERVER['HTTP_RANGE']))
|
63 |
+
{
|
64 |
+
list($a, $range) = explode("=",$_SERVER['HTTP_RANGE'],2);
|
65 |
+
list($range) = explode(",",$range,2);
|
66 |
+
list($range, $range_end) = explode("-", $range);
|
67 |
+
$range=intval($range);
|
68 |
+
if(!$range_end) {
|
69 |
+
$range_end=$size-1;
|
70 |
+
} else {
|
71 |
+
$range_end=intval($range_end);
|
72 |
+
}
|
73 |
+
|
74 |
+
$new_length = $range_end-$range+1;
|
75 |
+
header("HTTP/1.1 206 Partial Content");
|
76 |
+
header("Content-Length: $new_length");
|
77 |
+
header("Content-Range: bytes $range-$range_end/$size");
|
78 |
+
} else {
|
79 |
+
$new_length=$size;
|
80 |
+
header("Content-Length: ".$size);
|
81 |
+
}
|
82 |
+
|
83 |
+
/* output the file itself */
|
84 |
+
$chunksize = 1*(1024*1024); //you may want to change this
|
85 |
+
$bytes_send = 0;
|
86 |
+
if ($file = fopen($file, 'r'))
|
87 |
+
{
|
88 |
+
if(isset($_SERVER['HTTP_RANGE']))
|
89 |
+
fseek($file, $range);
|
90 |
+
|
91 |
+
while(!feof($file) &&
|
92 |
+
(!connection_aborted()) &&
|
93 |
+
($bytes_send<$new_length)
|
94 |
+
)
|
95 |
+
{
|
96 |
+
$buffer = fread($file, $chunksize);
|
97 |
+
print($buffer); //echo($buffer); // is also possible
|
98 |
+
flush();
|
99 |
+
$bytes_send += strlen($buffer);
|
100 |
+
}
|
101 |
+
fclose($file);
|
102 |
+
} else die('Error - can not open file.');
|
103 |
+
|
104 |
+
die();
|
105 |
+
}
|
106 |
+
|
107 |
+
function deleteFile($basePath='',$filename='')
|
108 |
+
{
|
109 |
+
@unlink($basePath."CODdataFiles/".$filename);
|
110 |
+
}
|
111 |
+
|
112 |
+
}
|
113 |
+
?>
|
app/code/community/Mage/Codi/Model/Codi.php
ADDED
@@ -0,0 +1,772 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
public $target ;
|
6 |
+
public $codigrid ; //this flag is to know whether we are displaying our grid or a general grid
|
7 |
+
public $userid ;
|
8 |
+
public $password ;
|
9 |
+
public $disableextension ;
|
10 |
+
public $version = "2.2.17";
|
11 |
+
|
12 |
+
public $customerid ;
|
13 |
+
public $customerdatasourceid ;
|
14 |
+
public $validateuser ;
|
15 |
+
public $extensionName='Mage_PDF_per_Product';
|
16 |
+
public $StoreId ;
|
17 |
+
public $reviewsModel ;
|
18 |
+
public $ratingModel ;
|
19 |
+
public $enablereviews ;
|
20 |
+
public $mediaurl ;
|
21 |
+
|
22 |
+
public function _construct()
|
23 |
+
{
|
24 |
+
parent::_construct();
|
25 |
+
$this->_init('codi/codi');
|
26 |
+
$this->_logFile = "Catalog-on-demand-items.log";
|
27 |
+
|
28 |
+
$this->enablereviews = Mage::getStoreConfig('codi/codi/codenablereviews');
|
29 |
+
|
30 |
+
// Get StoreID -Start
|
31 |
+
foreach (Mage::app()->getWebsites() as $website)
|
32 |
+
{
|
33 |
+
$defaultGroup = $website->getDefaultGroup();
|
34 |
+
$StoreId = $defaultGroup->getDefaultStoreId();
|
35 |
+
}
|
36 |
+
|
37 |
+
$this->StoreId = $StoreId ;
|
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 )
|
46 |
+
{
|
47 |
+
$section = 'codi' ;
|
48 |
+
$website = '' ;
|
49 |
+
$store = '';
|
50 |
+
|
51 |
+
$groups =
|
52 |
+
array(
|
53 |
+
'codi' =>
|
54 |
+
array(
|
55 |
+
'fields' => $myarray
|
56 |
+
));
|
57 |
+
Mage::getModel('adminhtml/config_data')
|
58 |
+
->setSection($section)
|
59 |
+
->setWebsite($website)
|
60 |
+
->setStore($store)
|
61 |
+
->setGroups($groups)
|
62 |
+
->save();
|
63 |
+
}
|
64 |
+
|
65 |
+
public function adminstart()
|
66 |
+
{
|
67 |
+
Mage::log("Notice : Admin Start", null, $this->_logFile);
|
68 |
+
|
69 |
+
$AdminNotified = Mage::getSingleton('core/session')->getAdminNotified();
|
70 |
+
if (!$AdminNotified)
|
71 |
+
{
|
72 |
+
Mage::getSingleton('core/session')->setAdminNotified(true);
|
73 |
+
try
|
74 |
+
{
|
75 |
+
$codimodel = Mage::getSingleton('codi/codi');
|
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 |
+
{
|
83 |
+
if (!$Responsemsg->Errors)
|
84 |
+
{
|
85 |
+
foreach ($Responsemsg->GetApplicationParametersResponse->ApplicationParameter as $ApplicationParameter)
|
86 |
+
{
|
87 |
+
//Get Version
|
88 |
+
if ((string)$ApplicationParameter->Name == "Version")
|
89 |
+
$Version = (string)$ApplicationParameter->Value;
|
90 |
+
//Get Release Notes Link
|
91 |
+
if ((string)$ApplicationParameter->Name == "ReleaseNotesLink")
|
92 |
+
$ReleaseNotesLink = (string)$ApplicationParameter->Value;
|
93 |
+
//Get the Notification Message
|
94 |
+
if ((string)$ApplicationParameter->Name == "NotificationMessage")
|
95 |
+
$NotificationMessage = (string)$ApplicationParameter->Value;
|
96 |
+
}
|
97 |
+
|
98 |
+
$title = "Catalog-On-Demand version " . $Version . " now available";
|
99 |
+
|
100 |
+
$feedData[] = array(
|
101 |
+
'severity' => 2,
|
102 |
+
'date_added' => NOW(),
|
103 |
+
'title' => (string)$title,
|
104 |
+
'description' => (string)$NotificationMessage,
|
105 |
+
'url' => (string)$ReleaseNotesLink,
|
106 |
+
);
|
107 |
+
|
108 |
+
if ( version_compare($Version, $codimodel->version) == 1) {
|
109 |
+
Mage::getModel('adminnotification/inbox')->parse(array_reverse($feedData)); }
|
110 |
+
}
|
111 |
+
}
|
112 |
+
}
|
113 |
+
catch(Exception $e){}
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
public function InitImportStatuses(){
|
118 |
+
|
119 |
+
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
120 |
+
|
121 |
+
$write->query("DROP TABLE IF EXISTS codi_import_status");
|
122 |
+
$write->query("CREATE TABLE codi_import_status(
|
123 |
+
id int(11) NOT NULL auto_increment PRIMARY KEY,
|
124 |
+
message varchar(50),
|
125 |
+
finished int(1) default 0)"
|
126 |
+
);
|
127 |
+
}
|
128 |
+
|
129 |
+
public function existTable(){
|
130 |
+
|
131 |
+
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
132 |
+
|
133 |
+
$write->query("CREATE TABLE IF NOT EXISTS codi_import_status(
|
134 |
+
id int(11) NOT NULL auto_increment PRIMARY KEY,
|
135 |
+
message varchar(50),
|
136 |
+
finished int(1) default 0)"
|
137 |
+
);
|
138 |
+
|
139 |
+
}
|
140 |
+
|
141 |
+
public function addImportStatus( $message, $finished = 0 ){
|
142 |
+
|
143 |
+
$this->existTable();
|
144 |
+
|
145 |
+
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
146 |
+
$query = "insert into codi_import_status (message, finished) values('".$message."', $finished)";
|
147 |
+
$write->query($query);
|
148 |
+
}
|
149 |
+
|
150 |
+
public function getImportStatuses(){
|
151 |
+
|
152 |
+
$this->existTable();
|
153 |
+
|
154 |
+
$read= Mage::getSingleton('core/resource')->getConnection('core_read');
|
155 |
+
|
156 |
+
$query = "select id, message, finished from codi_import_status order by id desc limit 1";
|
157 |
+
|
158 |
+
$messages = null;
|
159 |
+
|
160 |
+
$result = $read->query($query);
|
161 |
+
|
162 |
+
if($row = $result->fetch() ){
|
163 |
+
$messages = array('message'=>$row['message'], 'id'=>$row['id'], 'finished'=>$row['finished']);
|
164 |
+
}
|
165 |
+
|
166 |
+
return $messages;
|
167 |
+
}
|
168 |
+
|
169 |
+
public function deleteTable(){
|
170 |
+
|
171 |
+
$this->existTable();
|
172 |
+
|
173 |
+
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
174 |
+
$query = "delete from codi_import_status";
|
175 |
+
$write->query($query);
|
176 |
+
}
|
177 |
+
|
178 |
+
public function isStart(){
|
179 |
+
|
180 |
+
$this->existTable();
|
181 |
+
|
182 |
+
$read= Mage::getSingleton('core/resource')->getConnection('core_read');
|
183 |
+
|
184 |
+
$query = "select id, message, finished from codi_import_status where message = 'start' order by id desc limit 1";
|
185 |
+
|
186 |
+
$result = $read->query($query);
|
187 |
+
|
188 |
+
if($row = $result->fetch() ){
|
189 |
+
return true;
|
190 |
+
}
|
191 |
+
|
192 |
+
return false;
|
193 |
+
}
|
194 |
+
|
195 |
+
public function createFile($basePath){
|
196 |
+
|
197 |
+
$fh = fopen($basePath.'CODdataFiles/temp.txt', 'w');
|
198 |
+
|
199 |
+
if ( !$fh )
|
200 |
+
{
|
201 |
+
return false;
|
202 |
+
}
|
203 |
+
|
204 |
+
fclose($fh);
|
205 |
+
|
206 |
+
unlink($basePath.'CODdataFiles/temp.txt');
|
207 |
+
return true;
|
208 |
+
}
|
209 |
+
|
210 |
+
public function run_codi_import_manually($basepath){
|
211 |
+
|
212 |
+
$this->run_codi_import($basepath);
|
213 |
+
}
|
214 |
+
|
215 |
+
public function run_codi_import($basePath)
|
216 |
+
{
|
217 |
+
Mage::log("Notice : Codi Import Start", null, $this->_logFile);
|
218 |
+
|
219 |
+
ini_set('memory_limit','512M');
|
220 |
+
|
221 |
+
$this->InitImportStatuses();
|
222 |
+
|
223 |
+
$fh = fopen($basePath.'CODdataFiles/temp.txt', 'w');
|
224 |
+
|
225 |
+
if ( !$fh )
|
226 |
+
{
|
227 |
+
Mage::log("ERROR : Cann't open file for building data file:".$basePath, null, $this->_logFile);
|
228 |
+
$this->addImportStatus("fileerror", 1);
|
229 |
+
return;
|
230 |
+
}
|
231 |
+
|
232 |
+
fwrite($fh, "itemNumber\titemQty\titemUom\titemPrice\titemDescription\titemLink\titemAttributes\titemGraphic\tproductName\tproductMfg\tproductDescription\tproductGraphic\tproductLink\tproductAttributes\tCategory\tReviews\tSupplementalInfo");
|
233 |
+
|
234 |
+
$products = Mage::getModel('catalog/product')->getCollection();
|
235 |
+
$products->addAttributeToFilter('status', 1);//enabled
|
236 |
+
$products->addAttributeToFilter('visibility', 4);//catalog, search
|
237 |
+
$products->addAttributeToSelect('*');
|
238 |
+
$prodIds = $products->getAllIds();
|
239 |
+
|
240 |
+
$this->addImportStatus("start");
|
241 |
+
|
242 |
+
$status = "end";
|
243 |
+
foreach($prodIds as $productId) {
|
244 |
+
|
245 |
+
set_time_limit(0);
|
246 |
+
|
247 |
+
$message = $this->getImportStatuses();
|
248 |
+
if ( isset($message) && $message['message'] == "cancel") {
|
249 |
+
$status = "cancel";
|
250 |
+
break;
|
251 |
+
}
|
252 |
+
|
253 |
+
$product = Mage::getModel('catalog/product');
|
254 |
+
$product->load($productId);
|
255 |
+
|
256 |
+
fwrite($fh, $this->ProducttoString($product, "product"));
|
257 |
+
}
|
258 |
+
|
259 |
+
fclose($fh);
|
260 |
+
Mage::log("Notice : Codi Import End : ".$status, null, $this->_logFile);
|
261 |
+
|
262 |
+
if ( $status == "end" )
|
263 |
+
$this->addImportStatus($status, 1);
|
264 |
+
}
|
265 |
+
|
266 |
+
public function ProducttoString( $product , $from )
|
267 |
+
{
|
268 |
+
|
269 |
+
if( $product->isConfigurable() )
|
270 |
+
{
|
271 |
+
return $this->ProducttoStringConfigurable( $product , $from ) ;
|
272 |
+
}
|
273 |
+
else
|
274 |
+
{
|
275 |
+
return $this->ProducttoStringSimple( $product , $from ) ;
|
276 |
+
}
|
277 |
+
}
|
278 |
+
|
279 |
+
public function ProducttoStringConfigurable( $product , $from )
|
280 |
+
{
|
281 |
+
$ProducttoString = '' ;
|
282 |
+
$UsedProductIds = Mage::getModel('catalog/product_type_configurable')->getUsedProductIds($product);
|
283 |
+
|
284 |
+
$ProductDescription = $product->getDescription() ;
|
285 |
+
|
286 |
+
//Get Product Attributes Start
|
287 |
+
//$excludeAttr = array() ;
|
288 |
+
$attributes = $product->getAttributes();
|
289 |
+
|
290 |
+
$ProductAttributes = "" ;
|
291 |
+
foreach ($attributes as $attribute) {
|
292 |
+
if ($attribute->getIsVisibleOnFront() && !in_array($attribute->getAttributeCode(), array() )) {
|
293 |
+
$value = $attribute->getFrontend()->getValue($product);
|
294 |
+
if (is_string($value))
|
295 |
+
{
|
296 |
+
if (strlen($value) && $product->hasData($attribute->getAttributeCode()))
|
297 |
+
{
|
298 |
+
$ProductAttributes .= $attribute->getFrontend()->getLabel() . "=" . $value . "|" ;
|
299 |
+
}
|
300 |
+
}
|
301 |
+
}
|
302 |
+
}
|
303 |
+
$ProductAttributes = substr($ProductAttributes, 0, strlen($ProductAttributes)-1 ) ;
|
304 |
+
//Get Product Attributes End
|
305 |
+
|
306 |
+
//************************* Get Categories names Start ***************************
|
307 |
+
|
308 |
+
$categories = $product->getCategoryIds();
|
309 |
+
$CategoriesString = "" ;
|
310 |
+
|
311 |
+
foreach($categories as $k => $_category_id){
|
312 |
+
|
313 |
+
$_category = Mage::getModel('catalog/category')->load($_category_id) ;
|
314 |
+
$path = $_category->getPathInStore();
|
315 |
+
$pathIds = array_reverse(explode(',', $path));
|
316 |
+
|
317 |
+
foreach($pathIds as $m => $_cat_id){
|
318 |
+
|
319 |
+
$_cat = Mage::getModel('catalog/category')->load($_cat_id);
|
320 |
+
if( ($_cat->getName() != '') && ($_cat->getName() != 'Root Catalog') && ((string)$_cat->getLevel() != '1') && ($_cat->getParentId() > 1 ) )
|
321 |
+
$CategoriesString .= $_cat->getName() . "#$#" ;
|
322 |
+
}
|
323 |
+
|
324 |
+
if( substr($CategoriesString, strlen($CategoriesString)-3, 3) == "#$#" )
|
325 |
+
{
|
326 |
+
$CategoriesString = substr($CategoriesString, 0, strlen($CategoriesString)-3 ) ;
|
327 |
+
$CategoriesString .= "|";
|
328 |
+
}
|
329 |
+
}
|
330 |
+
|
331 |
+
$CategoriesString = substr($CategoriesString, 0, strlen($CategoriesString)-1 ) ;
|
332 |
+
if ($CategoriesString=='') $CategoriesString = 'Uncategorized' ;
|
333 |
+
|
334 |
+
//************************* Get Categories names End ***************************
|
335 |
+
|
336 |
+
foreach($UsedProductIds as $UsedProductid)
|
337 |
+
{
|
338 |
+
$UsedProduct = Mage::getModel('catalog/product')->load($UsedProductid);
|
339 |
+
if( Mage::getStoreConfig('codi/codi/fromchild') )
|
340 |
+
$UsedProductPrice = $UsedProduct->getFinalPrice() ;
|
341 |
+
else
|
342 |
+
$UsedProductPrice = $product->getFinalPrice() ; //default behavior
|
343 |
+
//************************ Get Attributes Start *******************************
|
344 |
+
//Extract Attributes
|
345 |
+
//$ImageURL = (string)$this->helper('catalog/image')->init($UsedProduct, 'image');
|
346 |
+
//$mediaurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
|
347 |
+
$ImageURL = $this->mediaurl . "catalog/product" . $product->getImage();
|
348 |
+
|
349 |
+
//Get Item Attributes Start
|
350 |
+
//$excludeAttr = array() ;
|
351 |
+
$attributes = $UsedProduct->getAttributes();
|
352 |
+
|
353 |
+
$ItemitemAttributes = "" ;
|
354 |
+
$AllowAttributes = $product->getTypeInstance(true)->getConfigurableAttributes($product);
|
355 |
+
foreach ($AllowAttributes as $attribute)
|
356 |
+
{
|
357 |
+
$AttributeCode = $attribute->getProductAttribute()->getAttributeCode() ;
|
358 |
+
$AttributeLabel = $attribute->getProductAttribute()->getFrontend()->getLabel() ;
|
359 |
+
$AttribId = $UsedProduct->getData($AttributeCode) ;
|
360 |
+
|
361 |
+
$AttributeValue = "" ;
|
362 |
+
foreach ( $attribute->getProductAttribute()->getSource()->getAllOptions() as $option )
|
363 |
+
{
|
364 |
+
if( $option['value'] == $AttribId )
|
365 |
+
{
|
366 |
+
$AttributeValue = $option['label'];
|
367 |
+
}
|
368 |
+
}
|
369 |
+
|
370 |
+
$ItemitemAttributes .= $AttributeLabel . "=" . $AttributeValue . "|" ;
|
371 |
+
|
372 |
+
//Get Delta Price Start
|
373 |
+
foreach( $attribute->getPrices() as $addedPrice )
|
374 |
+
{
|
375 |
+
if ( $AttributeValue == $addedPrice['label'])
|
376 |
+
{
|
377 |
+
if( $addedPrice['is_percent'] )
|
378 |
+
$UsedProductPrice += $UsedProductPrice * $addedPrice['pricing_value'] / 100;
|
379 |
+
else
|
380 |
+
$UsedProductPrice += $addedPrice['pricing_value'] ;
|
381 |
+
}
|
382 |
+
}
|
383 |
+
//Get Delta Price End
|
384 |
+
}
|
385 |
+
|
386 |
+
$ItemitemAttributes = substr($ItemitemAttributes, 0, strlen($ItemitemAttributes)-1 );
|
387 |
+
|
388 |
+
//Get Item Attributes End
|
389 |
+
//************************ Get Attributes End ************************************
|
390 |
+
//************************* Get Reviews Start ***********************
|
391 |
+
//$enablereviews = Mage::getStoreConfig('codi/codi/codenablereviews') ;
|
392 |
+
$Reviews = $this->enablereviews ? $this->getReviews($product->getId()) : '' ;
|
393 |
+
//************************* Get Reviews End *************************
|
394 |
+
|
395 |
+
//************************* Concatenate Product Info Start ***********************
|
396 |
+
$ProducttoString .= "\r\n" . $this->cleanStr( $UsedProduct->getSku() ) ; //ItemID
|
397 |
+
$ProducttoString .= "\t" . "" ; //ItemQty
|
398 |
+
$ProducttoString .= "\t" . "" ; //ItemUom
|
399 |
+
// $ProducttoString .= "\t" . $this->cleanStr( $product->getPrice() ) ; //ItemPrice
|
400 |
+
$ProducttoString .= "\t" . $this->cleanStr( $UsedProductPrice ) ; //ItemPrice
|
401 |
+
$ProducttoString .= "\t" . ""; //ItemDescription
|
402 |
+
$ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ); //ItemLink
|
403 |
+
$ProducttoString .= "\t" . $this->cleanStr( $ItemitemAttributes ) ; //ItemitemAttributes
|
404 |
+
$ProducttoString .= "\t" . ""; //ItemitemGraphic
|
405 |
+
$ProducttoString .= "\t" . $product->getId().'#$#'.$this->cleanStr( $product->getName() ); //ProductName
|
406 |
+
$ProducttoString .= "\t" . "" ; //ProductMfg
|
407 |
+
$ProducttoString .= "\t" . $this->cleanStr( $ProductDescription ) ; //ProductDescription
|
408 |
+
$ProducttoString .= "\t" . $this->cleanStr( $ImageURL ); //ProductGraphic
|
409 |
+
$ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ) ; //ProductLink
|
410 |
+
$ProducttoString .= "\t" . $this->cleanStr( $ProductAttributes ) ; //ProductAttributes
|
411 |
+
$ProducttoString .= "\t" . $this->cleanStr( $CategoriesString ); //Category
|
412 |
+
$ProducttoString .= "\t" . $this->cleanStr( $Reviews ); //Reviews
|
413 |
+
$ProducttoString .= "\t" . $this->cleanStr( $product->getShortDescription() ); //ShortDescription (Quick Overview)
|
414 |
+
//************************* Concatenate Product Info End ************************* cleanStr
|
415 |
+
}
|
416 |
+
|
417 |
+
return $ProducttoString ;
|
418 |
+
}
|
419 |
+
/////////////////////////////////////////// Simple Products ///////////////////////////////////////////////////////////////////
|
420 |
+
public function ProducttoStringSimple( $product , $from )
|
421 |
+
{
|
422 |
+
$ProducttoString = '' ;
|
423 |
+
$ProductDescription = $product->getDescription() ;
|
424 |
+
|
425 |
+
//************************ Get Attributes Start *******************************
|
426 |
+
//Extract Attributes
|
427 |
+
//$ImageURL = (string)$this->helper('catalog/image')->init($product, 'image');
|
428 |
+
//$mediaurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
|
429 |
+
$ImageURL = $this->mediaurl . "catalog/product" . $product->getImage();
|
430 |
+
|
431 |
+
//$excludeAttr = array() ;
|
432 |
+
$attributes = $product->getAttributes();
|
433 |
+
$ItemitemAttributes = "" ;
|
434 |
+
foreach ($attributes as $attribute) {
|
435 |
+
if ($attribute->getIsVisibleOnFront() && !in_array($attribute->getAttributeCode(), array() )) {
|
436 |
+
$value = $attribute->getFrontend()->getValue($product);
|
437 |
+
if (is_string($value))
|
438 |
+
{
|
439 |
+
if (strlen($value) && $product->hasData($attribute->getAttributeCode()))
|
440 |
+
{
|
441 |
+
$ItemitemAttributes .= $attribute->getFrontend()->getLabel() . "=" . $value . "|" ;
|
442 |
+
}
|
443 |
+
}
|
444 |
+
}
|
445 |
+
}
|
446 |
+
$ItemitemAttributes = substr($ItemitemAttributes, 0, strlen($ItemitemAttributes)-1 ) ;
|
447 |
+
//************************ Get Attributes End ************************************
|
448 |
+
|
449 |
+
//************************* Get Categories names Start ***************************
|
450 |
+
|
451 |
+
$categories = $product->getCategoryIds();
|
452 |
+
$CategoriesString = "" ;
|
453 |
+
foreach($categories as $k => $_category_id){
|
454 |
+
|
455 |
+
$_category = Mage::getModel('catalog/category')->load($_category_id) ;
|
456 |
+
$path = $_category->getPathInStore();
|
457 |
+
$pathIds = array_reverse(explode(',', $path));
|
458 |
+
|
459 |
+
foreach($pathIds as $m => $_cat_id){
|
460 |
+
$_cat = Mage::getModel('catalog/category')->load($_cat_id) ;
|
461 |
+
|
462 |
+
if( ($_cat->getName() != '') && ($_cat->getName() != 'Root Catalog') && ((string)$_cat->getLevel() != '1') && ($_cat->getParentId() > 1 ) )
|
463 |
+
$CategoriesString .= $_cat->getName() . "#$#" ;
|
464 |
+
}
|
465 |
+
|
466 |
+
if( substr($CategoriesString, strlen($CategoriesString)-3, 3) == "#$#" )
|
467 |
+
{
|
468 |
+
$CategoriesString = substr($CategoriesString, 0, strlen($CategoriesString)-3 );
|
469 |
+
$CategoriesString .= "|";
|
470 |
+
}
|
471 |
+
}
|
472 |
+
|
473 |
+
$CategoriesString = substr($CategoriesString, 0, strlen($CategoriesString)-1 ) ;
|
474 |
+
if ($CategoriesString == '' ) $CategoriesString = 'Uncategorized' ;
|
475 |
+
//************************* Get Categories names End ***************************
|
476 |
+
|
477 |
+
//************************* Get Reviews Start ***********************
|
478 |
+
//$enablereviews = Mage::getStoreConfig('codi/codi/codenablereviews') ;
|
479 |
+
//if($enablereviews) { $Reviews = $this->getReviews($product->getId()) ; }
|
480 |
+
$Reviews = $this->enablereviews ? $this->getReviews($product->getId()) : '' ;
|
481 |
+
//************************* Get Reviews End *************************
|
482 |
+
|
483 |
+
//************************* Concatenate Product Info Start ***********************
|
484 |
+
|
485 |
+
$ProducttoString .= "\r\n" . $this->cleanStr( $product->getSku() ) ; //ItemID
|
486 |
+
$ProducttoString .= "\t" . "" ; //ItemQty
|
487 |
+
$ProducttoString .= "\t" . "" ; //ItemUom
|
488 |
+
$ProducttoString .= "\t" . $this->cleanStr( $product->getFinalPrice() ) ; //ItemPrice
|
489 |
+
$ProducttoString .= "\t" . ""; //ItemDescription
|
490 |
+
$ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ); //ItemLink
|
491 |
+
$ProducttoString .= "\t" . ""; //ItemitemAttributes
|
492 |
+
$ProducttoString .= "\t" . ""; //ItemitemGraphic
|
493 |
+
$ProducttoString .= "\t" . $product->getId().'#$#'.$this->cleanStr( $product->getName() ); //ProductName
|
494 |
+
$ProducttoString .= "\t" . "" ; //ProductMfg
|
495 |
+
$ProducttoString .= "\t" . $this->cleanStr( $ProductDescription ) ; //ProductDescription
|
496 |
+
$ProducttoString .= "\t" . $this->cleanStr( $ImageURL ); //ProductGraphic
|
497 |
+
$ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ) ; //ProductLink
|
498 |
+
$ProducttoString .= "\t" . $this->cleanStr( $ItemitemAttributes ) ; //ProductAttributes
|
499 |
+
$ProducttoString .= "\t" . $this->cleanStr( $CategoriesString ); //Category
|
500 |
+
$ProducttoString .= "\t" . $this->cleanStr( $Reviews ); //Reviews
|
501 |
+
$ProducttoString .= "\t" . $this->cleanStr( $product->getShortDescription() ); //ShortDescription (Quick Overview)
|
502 |
+
//************************* Concatenate Product Info End ************************* cleanStr
|
503 |
+
|
504 |
+
return $ProducttoString ;
|
505 |
+
}
|
506 |
+
|
507 |
+
public function cleanStr($localstr)
|
508 |
+
{
|
509 |
+
$localstr = str_replace("\t","", $localstr ) ;
|
510 |
+
$localstr = str_replace("\r\n","<br>", $localstr ) ;
|
511 |
+
$localstr = str_replace("\r","<br>", $localstr ) ;
|
512 |
+
$localstr = str_replace("\n","<br>", $localstr ) ;
|
513 |
+
return $localstr ;
|
514 |
+
}
|
515 |
+
|
516 |
+
public function getReviews( $productid )
|
517 |
+
{
|
518 |
+
$reviewsCollection = $this->reviewsModel->getCollection()
|
519 |
+
->addStoreFilter($this->StoreId)
|
520 |
+
->addStatusFilter('approved')
|
521 |
+
->addEntityFilter('product', $productid)
|
522 |
+
->setDateOrder();
|
523 |
+
|
524 |
+
$Reviews = "" ;
|
525 |
+
foreach($reviewsCollection as $review)
|
526 |
+
{
|
527 |
+
$ratingCollection = $this->ratingModel
|
528 |
+
->getResourceCollection()
|
529 |
+
->setReviewFilter($review->getReviewId())
|
530 |
+
->setStoreFilter($this->StoreId)
|
531 |
+
->addRatingInfo($this->StoreId)
|
532 |
+
->load();
|
533 |
+
$Reviews .= "<p><b>".$review->getTitle()."(". $review->getNickname() .")</b><br>".$review->getDetail()."</p>" ;
|
534 |
+
}
|
535 |
+
return $Reviews ;
|
536 |
+
}
|
537 |
+
|
538 |
+
public function checkvalidity()
|
539 |
+
{
|
540 |
+
$userid = Mage::getStoreConfig('codi/codi/codusername') ;
|
541 |
+
$password = Mage::getStoreConfig('codi/codi/codpassword') ;
|
542 |
+
$url = "https://webservices.catalog-on-demand.com/smanager/api.do?Operation=ValidateUser&ResponseGroups=All&FunctionGroups=All" ;
|
543 |
+
$paramsarray = array('UserID' => $userid ,
|
544 |
+
'Password' => $password );
|
545 |
+
$Responsemsg = $this->Call( $url, $paramsarray );
|
546 |
+
if( $Responsemsg )
|
547 |
+
return $Responsemsg->Message=="OK" ? true : false ;
|
548 |
+
else
|
549 |
+
return false ;
|
550 |
+
}
|
551 |
+
|
552 |
+
//////////////////////////////////// Calling Start /////////////////////////////////////////////////////
|
553 |
+
public function CallusingZend( $url, $paramsarray )
|
554 |
+
{
|
555 |
+
$client = new Zend_Http_Client();
|
556 |
+
$client->setUri($url);
|
557 |
+
$client->setParameterPost('UserID', $this->userid);
|
558 |
+
$client->setParameterPost('Password', $this->password);
|
559 |
+
|
560 |
+
$mystr = '';
|
561 |
+
foreach($paramsarray as $key=>$value)
|
562 |
+
{
|
563 |
+
$client->setParameterPost($key, $value);
|
564 |
+
$mystr .= $key . $value ;
|
565 |
+
}
|
566 |
+
|
567 |
+
$response = $client->request('POST');
|
568 |
+
$result = $response->getBody() ;
|
569 |
+
return $result;
|
570 |
+
}
|
571 |
+
|
572 |
+
public function CallusingCurl( $url, $paramsarray )
|
573 |
+
{
|
574 |
+
$poststr = '';
|
575 |
+
foreach($paramsarray as $key=>$value)
|
576 |
+
{
|
577 |
+
$poststr .= $key ."=". urlencode($value) ."&";
|
578 |
+
}
|
579 |
+
|
580 |
+
$ch = curl_init();
|
581 |
+
curl_setopt($ch, CURLOPT_URL,$url);
|
582 |
+
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
|
583 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
|
584 |
+
curl_setopt($ch, CURLOPT_POST,1);
|
585 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, $poststr);
|
586 |
+
$result = curl_exec($ch);
|
587 |
+
curl_close($ch);
|
588 |
+
|
589 |
+
return $result;
|
590 |
+
}
|
591 |
+
|
592 |
+
public function Call( $url, $paramsarray )
|
593 |
+
{
|
594 |
+
$result = "" ;
|
595 |
+
try
|
596 |
+
{
|
597 |
+
$result = $this->CallusingZend( $url, $paramsarray );
|
598 |
+
}
|
599 |
+
catch(Exception $e)
|
600 |
+
{
|
601 |
+
try
|
602 |
+
{
|
603 |
+
$result = $this->CallusingCurl( $url, $paramsarray );
|
604 |
+
}
|
605 |
+
catch(Exception $e){}
|
606 |
+
}
|
607 |
+
|
608 |
+
$Responsemsg = false ;
|
609 |
+
|
610 |
+
return $result ;
|
611 |
+
}
|
612 |
+
//////////////////////////////////// Calling End /////////////////////////////////////////////////////
|
613 |
+
public function getComment($datetime='')
|
614 |
+
{
|
615 |
+
$Comment = "";
|
616 |
+
////////////////////////////////////////////////////////////
|
617 |
+
$extension_version = $this->version;//(string) Mage::getConfig()->getNode()->modules->Mage_Codi->version;
|
618 |
+
$app_version = Mage::getVersion();
|
619 |
+
$php_version = phpversion();
|
620 |
+
|
621 |
+
foreach (Mage::app()->getWebsites() as $website)
|
622 |
+
{
|
623 |
+
$defaultGroup = $website->getDefaultGroup();
|
624 |
+
$StoreId = $defaultGroup->getDefaultStoreId();
|
625 |
+
}
|
626 |
+
|
627 |
+
$design = Mage::getSingleton('core/design')->loadChange($StoreId);
|
628 |
+
$package = $design->getPackage();
|
629 |
+
$default_theme = $design->getTheme();
|
630 |
+
|
631 |
+
if ( $package == "" && $default_theme == "" ){
|
632 |
+
|
633 |
+
$package = Mage::getStoreConfig('design/package/name', $StoreId);
|
634 |
+
$default_theme = Mage::getStoreConfig('design/theme/default', $StoreId);
|
635 |
+
}
|
636 |
+
|
637 |
+
if ( $package == "" ) $package = "default";
|
638 |
+
if ( $default_theme == "" ) $default_theme = "default";
|
639 |
+
|
640 |
+
$theme = "default";
|
641 |
+
if ( $package != "default" || $default_theme != "default" )
|
642 |
+
$theme = $package."/".$default_theme;
|
643 |
+
|
644 |
+
$codbgcheck = ( Mage::getStoreConfig('codi/codi/codbgcheck') == '1' )?'Yes':'No' ;
|
645 |
+
|
646 |
+
$enablefreshflyers = ( Mage::getStoreConfig('codi/codi/enablefreshflyers') == 'checked' )?'Yes':'No' ;
|
647 |
+
$enablereviews = ( Mage::getStoreConfig('codi/codi/codenablereviews') == 'checked' )?'Yes':'No' ;
|
648 |
+
$fromchild = ( Mage::getStoreConfig('codi/codi/fromchild') == 'checked' )?'Yes':'No' ;
|
649 |
+
|
650 |
+
$codflyerlinkimgurl = Mage::getStoreConfig('codi/codi/codflyerlinkimgurl') ;
|
651 |
+
$codflyerlinkimg = ( Mage::getStoreConfig('codi/codi/codflyerlinkimg') == 'Custom' )? $codflyerlinkimgurl:'Default';
|
652 |
+
$codflyerlinkimgalt = Mage::getStoreConfig('codi/codi/codflyerlinkimgalt') ;
|
653 |
+
|
654 |
+
$codbeforename = ( Mage::getStoreConfig('codi/codi/codbeforename') == 'checked' )?'Yes':'No' ;
|
655 |
+
$codaftername = ( Mage::getStoreConfig('codi/codi/codaftername') == 'checked' )?'Yes':'No' ;
|
656 |
+
$codbeforeemailto = ( Mage::getStoreConfig('codi/codi/codbeforeemailto') == 'checked' )?'Yes':'No' ;
|
657 |
+
$codafteremailto = ( Mage::getStoreConfig('codi/codi/codafteremailto') == 'checked' )?'Yes':'No' ;
|
658 |
+
$codbeforeOR = ( Mage::getStoreConfig('codi/codi/codbeforeOR') == 'checked' )?'Yes':'No' ;
|
659 |
+
$codafterOR = ( Mage::getStoreConfig('codi/codi/codafterOR') == 'checked' )?'Yes':'No' ;
|
660 |
+
$codbeforeoverview = ( Mage::getStoreConfig('codi/codi/codbeforeoverview') == 'checked' ) ?'Yes':'No';
|
661 |
+
$codafteroverview = ( Mage::getStoreConfig('codi/codi/codafteroverview') == 'checked' )?'Yes':'No';
|
662 |
+
|
663 |
+
$Comment = "App extension version: ".$extension_version." \r\n";
|
664 |
+
$Comment .= "Magento version: ".$app_version." \r\n";
|
665 |
+
$Comment .= "PHP: ".$php_version." \r\n";
|
666 |
+
$Comment .= "Theme: ".$theme." \r\n";
|
667 |
+
$Comment .= "Create data file using background process: ".$codbgcheck." \r\n";
|
668 |
+
$Comment .= "Enable Always Fresh Flyers: ".$enablefreshflyers." \r\n";
|
669 |
+
$Comment .= "Enable Reviews: ".$enablereviews." \r\n";
|
670 |
+
$Comment .= "Get price from associated products: ".$fromchild." \r\n";
|
671 |
+
$Comment .= "Image to be used for flyer link: ".$codflyerlinkimg." \r\n";
|
672 |
+
$Comment .= "Alt text for flyer link image: ".$codflyerlinkimgalt." \r\n";
|
673 |
+
$Comment .= "Display options: \r\n";
|
674 |
+
$Comment .= " Display before product name: ".$codbeforename." \r\n";
|
675 |
+
$Comment .= " Display after product name: ".$codaftername." \r\n";
|
676 |
+
$Comment .= " Display before Email to a friend: ".$codbeforeemailto." \r\n";
|
677 |
+
$Comment .= " Display before Email to a friend: ".$codafteremailto." \r\n";
|
678 |
+
$Comment .= " Display before OR: ".$codbeforeOR." \r\n";
|
679 |
+
$Comment .= " Display after OR: ".$codafterOR." \r\n";
|
680 |
+
$Comment .= " Display before Quick Overview: ".$codbeforeoverview." \r\n";
|
681 |
+
$Comment .= " Display after Quick Overview: ".$codafteroverview." \r\n";
|
682 |
+
//code for version 2.2.16
|
683 |
+
$datafilelaunch = Mage::getStoreConfig('codi/codi/coddatafilelaunch');
|
684 |
+
$Comment .="Data File Launch Mode: ".$datafilelaunch."\r\n";
|
685 |
+
if($datafilelaunch=='magento')
|
686 |
+
{
|
687 |
+
$datafilelaunch='cronjob';
|
688 |
+
|
689 |
+
}
|
690 |
+
|
691 |
+
|
692 |
+
$url = Mage::getUrl('codi/nsync') ;
|
693 |
+
$pos = strrpos ($url , 'key') ;
|
694 |
+
if ( $pos != 0 )
|
695 |
+
$cronjoburl = substr( $url , 0 , $pos ) ;
|
696 |
+
else
|
697 |
+
$cronjoburl = $url;
|
698 |
+
|
699 |
+
if(($datafilelaunch=='magento') || ($datafilelaunch=='manual'))
|
700 |
+
{
|
701 |
+
$Comment .="Cron job command: wget ".$cronjoburl."\r\n";
|
702 |
+
}
|
703 |
+
|
704 |
+
$Comment .="Extension Name: ".$this->extensionName."\r\n";
|
705 |
+
$Comment .="Date and time of most recent data file: ".$datetime."\r\n";
|
706 |
+
|
707 |
+
|
708 |
+
|
709 |
+
return $Comment;
|
710 |
+
////////////////////////////////////////////////////////////
|
711 |
+
}
|
712 |
+
//code for version 2.2.16
|
713 |
+
public function new_run_codi_import($basePath)
|
714 |
+
{
|
715 |
+
|
716 |
+
Mage::log("Notice : Codi Import Start", null, $this->_logFile);
|
717 |
+
|
718 |
+
ini_set('memory_limit','512M');
|
719 |
+
|
720 |
+
$this->InitImportStatuses();
|
721 |
+
|
722 |
+
$fh = fopen($basePath.'CODdataFiles/temp.txt', 'w');
|
723 |
+
|
724 |
+
if ( !$fh )
|
725 |
+
{
|
726 |
+
Mage::log("ERROR : Cann't open file for building data file:".$basePath, null, $this->_logFile);
|
727 |
+
$this->addImportStatus("fileerror", 1);
|
728 |
+
return;
|
729 |
+
}
|
730 |
+
|
731 |
+
fwrite($fh, "itemNumber\titemQty\titemUom\titemPrice\titemDescription\titemLink\titemAttributes\titemGraphic\tproductName\tproductMfg\tproductDescription\tproductGraphic\tproductLink\tproductAttributes\tCategory\tReviews\tSupplementalInfo");
|
732 |
+
|
733 |
+
$products = Mage::getModel('catalog/product')->getCollection();
|
734 |
+
$products->addAttributeToFilter('status', 1);//enabled
|
735 |
+
$products->addAttributeToFilter('visibility', 4);//catalog, search
|
736 |
+
$products->addAttributeToSelect('*');
|
737 |
+
|
738 |
+
$prodIds = $products->getAllIds();
|
739 |
+
|
740 |
+
$this->addImportStatus("start");
|
741 |
+
|
742 |
+
$status = "end";
|
743 |
+
$i='0';
|
744 |
+
try{
|
745 |
+
foreach($prodIds as $productId)
|
746 |
+
{
|
747 |
+
set_time_limit(20);
|
748 |
+
$message = $this->getImportStatuses();
|
749 |
+
if ( isset($message) && $message['message'] == "cancel") {
|
750 |
+
$status = "cancel";
|
751 |
+
break;
|
752 |
+
}
|
753 |
+
$product = Mage::getModel('catalog/product');
|
754 |
+
$product->load($productId);
|
755 |
+
Mage::log("Notice : Codi Import Products :".$i, null, $this->_logFile);
|
756 |
+
fwrite($fh, $this->ProducttoString($product, "product"));
|
757 |
+
$i++;
|
758 |
+
}
|
759 |
+
}
|
760 |
+
catch (Exception $e)
|
761 |
+
{
|
762 |
+
Mage::log("Notice : Codi Import Products Exception :".$e->getMessage(), null, $this->_logFile);
|
763 |
+
}
|
764 |
+
fclose($fh);
|
765 |
+
Mage::log("Notice : Codi Import End : ".$status, null, $this->_logFile);
|
766 |
+
|
767 |
+
if ( $status == "end" )
|
768 |
+
$this->addImportStatus($status, 1);
|
769 |
+
|
770 |
+
}
|
771 |
+
|
772 |
+
}
|
app/code/community/Mage/Codi/controllers/Adminhtml/MenuController.php
ADDED
@@ -0,0 +1,308 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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."CODdataFiles/temp.txt");
|
141 |
+
$codimodel->deleteTable();
|
142 |
+
print '{"finished": "1"}';
|
143 |
+
|
144 |
+
}else if ( $status== "cancel" && $message['finished'] == 1 ) {
|
145 |
+
|
146 |
+
@unlink($basePath."CODdataFiles/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."CODdataFiles/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."CODdataFiles/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 = (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 |
+
|
223 |
+
$codimodel = Mage::getSingleton('codi/codi');
|
224 |
+
|
225 |
+
$codimodel->setStoreConfig(
|
226 |
+
array(
|
227 |
+
"codusername" => array ('value' => $userid) ,
|
228 |
+
"codpassword" => array ('value' => $password) ,
|
229 |
+
"secretkey" => array ('value' => $secretkey) ,
|
230 |
+
"enablefreshflyers" => array ('value' => $enablefreshflyers) ,
|
231 |
+
"codenablereviews" => array ('value' => $enablereviews) ,
|
232 |
+
"fromchild" => array ('value' => $fromchild) ,
|
233 |
+
"codflyerlinkimg" => array ('value' => $codflyerlinkimg) ,
|
234 |
+
"codflyerlinkimgurl" => array ('value' => $codflyerlinkimgurl) ,
|
235 |
+
"codflyerlinkimgalt" => array ('value' => $codflyerlinkimgalt) ,
|
236 |
+
"codbeforename" => array ('value' => $codbeforename) ,
|
237 |
+
"codaftername" => array ('value' => $codaftername) ,
|
238 |
+
"codbeforeemailto" => array ('value' => $codbeforeemailto) ,
|
239 |
+
"codafteremailto" => array ('value' => $codafteremailto) ,
|
240 |
+
"codbeforeOR" => array ('value' => $codbeforeOR) ,
|
241 |
+
"codafterOR" => array ('value' => $codafterOR) ,
|
242 |
+
"codbeforeoverview" => array ('value' => $codbeforeoverview) ,
|
243 |
+
"codafteroverview" => array ('value' => $codafteroverview) ,
|
244 |
+
"coddatafilelaunch" => array ('value' => $coddatafilelaunch) ,
|
245 |
+
|
246 |
+
)
|
247 |
+
);
|
248 |
+
|
249 |
+
Mage::app()->getCacheInstance()->cleanType('config');
|
250 |
+
|
251 |
+
$this->_redirect('codi/adminhtml_menu/auth');
|
252 |
+
}
|
253 |
+
|
254 |
+
public function registerAction()
|
255 |
+
{
|
256 |
+
$codimodel = Mage::getSingleton('codi/codi');
|
257 |
+
$codimodel->target = "register";
|
258 |
+
$this->loadLayout();
|
259 |
+
$this->_setActiveMenu('catalog');
|
260 |
+
$this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
|
261 |
+
$this->renderLayout();
|
262 |
+
}
|
263 |
+
|
264 |
+
public function documentationAction()
|
265 |
+
{
|
266 |
+
$codimodel = Mage::getSingleton('codi/codi');
|
267 |
+
$codimodel->target = "documentation";
|
268 |
+
$this->loadLayout();
|
269 |
+
$this->_setActiveMenu('catalog');
|
270 |
+
$this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
|
271 |
+
$this->renderLayout();
|
272 |
+
}
|
273 |
+
|
274 |
+
//Change for version 2.2.15
|
275 |
+
public function downloadtestAction(){
|
276 |
+
|
277 |
+
$codimodel = Mage::getSingleton('codi/codi');
|
278 |
+
$codimodel->target = "auth";
|
279 |
+
$helper=Mage::helper('codi');
|
280 |
+
$filename='text.tmp.txt';
|
281 |
+
$helper->output_file('CODdataFiles/text.tmp.txt',$filename , 'text/plain');
|
282 |
+
$this->loadLayout();
|
283 |
+
$this->_setActiveMenu('catalog');
|
284 |
+
$this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
|
285 |
+
$this->renderLayout();
|
286 |
+
}
|
287 |
+
public function deletetestAction()
|
288 |
+
{
|
289 |
+
$dir = dirname(__FILE__);
|
290 |
+
|
291 |
+
$_baseDirArray = explode("app", $dir);
|
292 |
+
$basePath = $_baseDirArray[0].'/';
|
293 |
+
|
294 |
+
|
295 |
+
$codimodel = Mage::getSingleton('codi/codi');
|
296 |
+
$codimodel->target = "auth";
|
297 |
+
$helper=Mage::helper('codi');
|
298 |
+
$filename='text.tmp.txt';
|
299 |
+
$helper->deleteFile($basePath,$filename);
|
300 |
+
$this->loadLayout();
|
301 |
+
$this->_setActiveMenu('catalog');
|
302 |
+
$this->_addContent($this->getLayout()->createBlock('codi/adminhtml_menu'));
|
303 |
+
$this->renderLayout();
|
304 |
+
|
305 |
+
|
306 |
+
}
|
307 |
+
|
308 |
+
}
|
app/code/community/Mage/Codi/controllers/DeleteController.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
17 |
+
$files = glob($basePath."CODdataFiles/*.txt");
|
18 |
+
foreach($files as $file) unlink($file);
|
19 |
+
|
20 |
+
Mage::log("Notice : DeleteindexAction End", null, $this->_logFile);
|
21 |
+
}
|
22 |
+
}
|
app/code/community/Mage/Codi/controllers/NsyncController.php
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
ini_set("max_execution_time", 3600);
|
3 |
+
ini_set("memory_limit","512M");
|
4 |
+
require_once 'Mage/Core/Controller/Front/Action.php';
|
5 |
+
class Mage_Codi_NsyncController extends Mage_Core_Controller_Front_Action
|
6 |
+
{
|
7 |
+
|
8 |
+
public function indexAction()
|
9 |
+
{
|
10 |
+
$this->_logFile = "Catalog-on-demand.log";
|
11 |
+
|
12 |
+
Mage::log("Notice: Mage_Codi_NSyncController", null, $this->_logFile);
|
13 |
+
|
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.'CODdataFiles/') )
|
24 |
+
mkdir($basePath.'CODdataFiles/');
|
25 |
+
|
26 |
+
|
27 |
+
|
28 |
+
$DataFile = 'text.tmp.txt';
|
29 |
+
$CodiModel->new_run_codi_import($basePath);
|
30 |
+
|
31 |
+
$error = "";
|
32 |
+
$message = $CodiModel->getImportStatuses();
|
33 |
+
$mes=implode(',',$message);
|
34 |
+
$status = 0;
|
35 |
+
if ( isset($message) ){
|
36 |
+
$status = $message['message'];
|
37 |
+
if ( $status== "end" && $message['finished'] == 1 ){
|
38 |
+
rename($basePath.'CODdataFiles/temp.txt', $basePath.'CODdataFiles/'.$DataFile);
|
39 |
+
$CodiModel->deleteTable();
|
40 |
+
$CodiModel->addImportStatus('end', 1);
|
41 |
+
print '{"success": "1"}';
|
42 |
+
Mage::log("ERROR : Finished to create product file", null, $this->_logFile);
|
43 |
+
|
44 |
+
}else if ( $status== "cancel" && $message['finished'] == 1 ) {
|
45 |
+
|
46 |
+
$error = "ERROR\nCanceled to create product file";
|
47 |
+
$CodiModel->deleteTable();
|
48 |
+
Mage::log("ERROR : Canceled to create product file", null, $this->_logFile);
|
49 |
+
|
50 |
+
}else if ( $status== "fileerror" && $message['finished'] == 1 ) {
|
51 |
+
|
52 |
+
$error = "ERROR\nFailed to create product file";
|
53 |
+
$CodiModel->deleteTable();
|
54 |
+
Mage::log("ERROR : Failed to create product file", null, $this->_logFile);
|
55 |
+
|
56 |
+
}else{
|
57 |
+
$error = "ERROR\nFailed to create product file";
|
58 |
+
$CodiModel->deleteTable();
|
59 |
+
Mage::log("ERROR : Failed to create product file 1", null, $this->_logFile);
|
60 |
+
}
|
61 |
+
}else{
|
62 |
+
$error = "ERROR\nFailed to create product file";
|
63 |
+
$CodiModel->deleteTable();
|
64 |
+
Mage::log("ERROR : Failed to create product file 2", null, $this->_logFile);
|
65 |
+
}
|
66 |
+
//print '{"success": "1"}';
|
67 |
+
}
|
68 |
+
}
|
app/code/community/Mage/Codi/controllers/SyncController.php
ADDED
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
ini_set("max_execution_time", 3600);
|
3 |
+
ini_set("memory_limit","512M");
|
4 |
+
require_once 'Mage/Core/Controller/Front/Action.php';
|
5 |
+
class Mage_Codi_SyncController extends Mage_Core_Controller_Front_Action
|
6 |
+
{
|
7 |
+
|
8 |
+
public function indexAction()
|
9 |
+
{
|
10 |
+
$this->_logFile = "Catalog-on-demand.log";
|
11 |
+
|
12 |
+
Mage::log("Notice: Mage_Codi_SyncController", null, $this->_logFile);
|
13 |
+
|
14 |
+
$error_msg = "";
|
15 |
+
//Check validity of Secret Key
|
16 |
+
if ( $this->getRequest()->getParam('SecretKey') != Mage::getStoreConfig('codi/codi/secretkey') )
|
17 |
+
{
|
18 |
+
Mage::log("ERROR : Secret Key Not accepted", null, $this->_logFile);
|
19 |
+
$error_msg = "ERROR\nSecret Key Not accepted.";
|
20 |
+
}
|
21 |
+
|
22 |
+
$CodiModel = Mage::getModel('codi/codi');
|
23 |
+
|
24 |
+
$dir = dirname(__FILE__);
|
25 |
+
$_baseDirArray = explode("app", $dir);
|
26 |
+
$basePath = $_baseDirArray[0].'/';
|
27 |
+
|
28 |
+
//Create folder if not exist.
|
29 |
+
if ( !is_dir($basePath.'CODdataFiles/') )
|
30 |
+
mkdir($basePath.'CODdataFiles/');
|
31 |
+
|
32 |
+
if ( !$CodiModel->createFile($basePath) ){
|
33 |
+
Mage::log("ERROR : Cannot create file : ".$basePath, null, $this->_logFile);
|
34 |
+
$error_msg = "ERROR\nThe Magento extension was prevented from creating a file in the folder CoDDataFile. The import has been cancelled. Please notify your Magento administrator.";
|
35 |
+
}
|
36 |
+
|
37 |
+
$url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
|
38 |
+
if ( $url == "http://" || $url == "https://" ){
|
39 |
+
|
40 |
+
Mage::log("ERROR : Cannot prepare the callback link : ".$url, null, $this->_logFile);
|
41 |
+
$error_msg = "ERROR\nCannot prepare the callback link.";
|
42 |
+
}
|
43 |
+
|
44 |
+
if ( $error_msg == "" ) $error_msg = "OK";
|
45 |
+
// respond immediately
|
46 |
+
|
47 |
+
@ob_end_clean();
|
48 |
+
header("Connection: close\r\n");
|
49 |
+
header("Content-Encoding: none\r\n");
|
50 |
+
ignore_user_abort(true);
|
51 |
+
ob_start();
|
52 |
+
echo $error_msg;
|
53 |
+
header("Content-Length: ".ob_get_length());
|
54 |
+
ob_end_flush();
|
55 |
+
flush();
|
56 |
+
@ob_end_clean();
|
57 |
+
|
58 |
+
Mage::log("Notice: Response ". $error_msg, null, $this->_logFile);
|
59 |
+
|
60 |
+
if ( $error_msg != "OK" ){
|
61 |
+
exit(0);
|
62 |
+
}
|
63 |
+
|
64 |
+
$DataFile = (string)$this->getRequest()->getParam('FileName').'.tmp.txt';
|
65 |
+
$filename = $basePath.'CODdataFiles/text.tmp.txt';
|
66 |
+
//Check code for file is exists or not
|
67 |
+
$fExist=0;
|
68 |
+
$modifie='';
|
69 |
+
if (file_exists($filename)) {
|
70 |
+
$fExist=1;
|
71 |
+
$modifie=date("M d, Y H:i:s.", filemtime($filename));
|
72 |
+
rename($filename, $basePath.'CODdataFiles/'.$DataFile);
|
73 |
+
}
|
74 |
+
|
75 |
+
|
76 |
+
Mage::log("Notice: Response ". $DataFile, null, $this->_logFile);
|
77 |
+
$datafilelaunch = Mage::getStoreConfig('codi/codi/coddatafilelaunch');
|
78 |
+
|
79 |
+
if((($datafilelaunch=="magento") || ($datafilelaunch=="manual") ) && ($fExist==1))
|
80 |
+
{
|
81 |
+
Mage::log("Notice: Import Products using Magento Cron job: ".$datafilelaunch, null, $this->_logFile);
|
82 |
+
}
|
83 |
+
else
|
84 |
+
{
|
85 |
+
Mage::log("Notice: Import Products using Catalog on demand: ".$datafilelaunch, null, $this->_logFile);
|
86 |
+
$CodiModel->run_codi_import($basePath);
|
87 |
+
$error = "";
|
88 |
+
$message = $CodiModel->getImportStatuses();
|
89 |
+
|
90 |
+
$status = 0;
|
91 |
+
if ( isset($message) ){
|
92 |
+
$status = $message['message'];
|
93 |
+
|
94 |
+
if ( $status== "end" && $message['finished'] == 1 ){
|
95 |
+
$modifie=date("M d, Y H:i:s.", filemtime($basePath.'CODdataFiles/temp.txt'));
|
96 |
+
rename($basePath.'CODdataFiles/temp.txt', $basePath.'CODdataFiles/'.$DataFile);
|
97 |
+
$CodiModel->deleteTable();
|
98 |
+
|
99 |
+
Mage::log("ERROR : Finished to create product file", null, $this->_logFile);
|
100 |
+
|
101 |
+
}else if ( $status== "cancel" && $message['finished'] == 1 ) {
|
102 |
+
|
103 |
+
$error = "ERROR\nCanceled to create product file";
|
104 |
+
$CodiModel->deleteTable();
|
105 |
+
Mage::log("ERROR : Canceled to create product file", null, $this->_logFile);
|
106 |
+
|
107 |
+
}else if ( $status== "fileerror" && $message['finished'] == 1 ) {
|
108 |
+
|
109 |
+
$error = "ERROR\nFailed to create product file";
|
110 |
+
$CodiModel->deleteTable();
|
111 |
+
Mage::log("ERROR : Failed to create product file", null, $this->_logFile);
|
112 |
+
|
113 |
+
}else{
|
114 |
+
$error = "ERROR\nFailed to create product file";
|
115 |
+
$CodiModel->deleteTable();
|
116 |
+
Mage::log("ERROR : Failed to create product file 1", null, $this->_logFile);
|
117 |
+
}
|
118 |
+
}else{
|
119 |
+
$error = "ERROR\nFailed to create product file";
|
120 |
+
$CodiModel->deleteTable();
|
121 |
+
Mage::log("ERROR : Failed to create product file 2", null, $this->_logFile);
|
122 |
+
}
|
123 |
+
}
|
124 |
+
//Prepare the callback parameters
|
125 |
+
|
126 |
+
$pos = strpos($url, 'index.php');
|
127 |
+
$DataFileLink = substr($url, 0, $pos ) . 'CODdataFiles/' . $DataFile;
|
128 |
+
|
129 |
+
Mage::log("Notice: Prepare the callback parameters link: ". $DataFileLink, null, $this->_logFile);
|
130 |
+
|
131 |
+
$ProcessID = (string)$this->getRequest()->getParam('ProcessID');
|
132 |
+
$url = (string)$this->getRequest()->getParam('CallbackURL');
|
133 |
+
$DeleteDataFileURL = (string)Mage::getUrl('codi/delete') ;
|
134 |
+
|
135 |
+
$Comment = $CodiModel->getComment($modifie);
|
136 |
+
Mage::log("Notice: Prepare the Comment : ". $Comment, null, $this->_logFile);
|
137 |
+
|
138 |
+
$paramsarray = array( 'ProcessID' => $ProcessID,
|
139 |
+
'DataFileLink' => $DataFileLink ,
|
140 |
+
'DeleteDataFileURL' => $DeleteDataFileURL ,
|
141 |
+
'Encoding' => 'utf-8' ,
|
142 |
+
'ClearDatabase' => 'MissingOnly' ,
|
143 |
+
'PartnerID' => 'CoDMagento' ,
|
144 |
+
'CatalogProject' => 'magento',
|
145 |
+
'Comment' => $Comment);
|
146 |
+
if ( $error != "" ) {
|
147 |
+
$paramsarray = array('ProcessID' => $ProcessID,
|
148 |
+
'DataFileLink' => $DataFileLink ,
|
149 |
+
'DeleteDataFileURL' => $DeleteDataFileURL ,
|
150 |
+
'Encoding' => 'utf-8' ,
|
151 |
+
'ClearDatabase' => 'MissingOnly' ,
|
152 |
+
'PartnerID' => 'CoDMagento' ,
|
153 |
+
'CatalogProject' => 'magento',
|
154 |
+
'Comment' => $Comment,
|
155 |
+
'Error' => $error);
|
156 |
+
}
|
157 |
+
|
158 |
+
Mage::log("Notice: Prepare the DataFileLink : ". $DataFileLink, null, $this->_logFile);
|
159 |
+
Mage::log("Notice: Prepare the process ID : ". $ProcessID, null, $this->_logFile);
|
160 |
+
Mage::log("Notice: Prepare the delete url : ". $DeleteDataFileURL, null, $this->_logFile);
|
161 |
+
Mage::log("Notice: Prepare the callback url : ". $url, null, $this->_logFile);
|
162 |
+
|
163 |
+
$Responsemsg = $CodiModel->Call( $url, $paramsarray );
|
164 |
+
Mage::log("Notice: Prepare the callback response message ". $Responsemsg, null, $this->_logFile);
|
165 |
+
}
|
166 |
+
}
|
app/code/community/Mage/Codi/etc/config.xml
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Mage_Codi>
|
5 |
+
<version>2.2.17</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>
|
app/design/adminhtml/default/default/template/codi/index.phtml
ADDED
@@ -0,0 +1,778 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
//http://anylinuxwork.in/magento_cod/index.php/codi/nsync/index/
|
29 |
+
$post_url = $this->getUrl('codi/nsync/index');
|
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 |
+
|
34 |
+
//Changed ver 2.2.15
|
35 |
+
$download_url = $this->getUrl('codi/adminhtml_menu/downloadtest');
|
36 |
+
$delete_codi_url = $this->getUrl('codi/adminhtml_menu/deletetest');
|
37 |
+
|
38 |
+
//Chagned ver 2.2.16
|
39 |
+
$datafilelaunch = Mage::getStoreConfig('codi/codi/coddatafilelaunch');
|
40 |
+
|
41 |
+
$codbg_checked = "";
|
42 |
+
if ( $codbgcheck == 1 ) $codbg_checked = "checked";
|
43 |
+
|
44 |
+
$extensionName="Mage_PDF_per_Product";
|
45 |
+
$currentVer = Mage::getConfig()->getModuleConfig('Mage_Codi')->version;
|
46 |
+
|
47 |
+
?>
|
48 |
+
<style>
|
49 |
+
#codi_status_template_button{
|
50 |
+
margin-bottom:0.5em;
|
51 |
+
width:329px;
|
52 |
+
}
|
53 |
+
#codi_status_template{
|
54 |
+
margin-bottom:0.5em;
|
55 |
+
width:330px;
|
56 |
+
}
|
57 |
+
#tooltip {
|
58 |
+
position: absolute;
|
59 |
+
z-index: 3000;
|
60 |
+
border: 1px solid #111;
|
61 |
+
background-color: #eee;
|
62 |
+
padding: 5px;
|
63 |
+
max-width:500px;
|
64 |
+
}
|
65 |
+
#tooltip h3, #tooltip div { margin: 0; }
|
66 |
+
#tooltip ul{list-style:disc outside none;margin-left:12px;margin-bottom:12px;padding-left:40px;}
|
67 |
+
.hidden{display:none;}
|
68 |
+
</style>
|
69 |
+
|
70 |
+
<div id="page:main-container">
|
71 |
+
<div class="columns ">
|
72 |
+
<div class="side-col" id="page:left">
|
73 |
+
<h3>Catalog-On-Demand®</h3>
|
74 |
+
|
75 |
+
<ul id="product_info_tabs" class="tabs">
|
76 |
+
<li >
|
77 |
+
<a href="<?php echo $this->getUrl('codi/adminhtml_menu/register');?>" class="tab-item-link "
|
78 |
+
<?php if ( $codimodel->target == "register") echo "style='background-color:#ffffff;'" ; ?>
|
79 |
+
onclick="window.open ('https://www.catalog-on-demand.com/signup/');">
|
80 |
+
<span>Sign Up</span>
|
81 |
+
</a>
|
82 |
+
</li>
|
83 |
+
<li >
|
84 |
+
<a href="<?php echo $this->getUrl('codi/adminhtml_menu/auth');?>" class="tab-item-link "
|
85 |
+
<?php if ( $codimodel->target == "auth") echo "style='background-color:#ffffff;'" ; ?> >
|
86 |
+
<span>Configuration Settings</span>
|
87 |
+
</a>
|
88 |
+
</li>
|
89 |
+
<li >
|
90 |
+
<a href="<?php echo $this->getUrl('codi/adminhtml_menu/systemtest');?>" class="tab-item-link "
|
91 |
+
<?php if ( $codimodel->target == "systemtest") echo "style='background-color:#ffffff;'" ; ?> >
|
92 |
+
<span>System Test</span>
|
93 |
+
</a>
|
94 |
+
</li>
|
95 |
+
<li >
|
96 |
+
<a href="<?php echo $this->getUrl('codi/adminhtml_menu/documentation');?>" class="tab-item-link "
|
97 |
+
<?php if ( $codimodel->target == "documentation") echo "style='background-color:#ffffff;'" ; ?>
|
98 |
+
onclick="window.open ('http://www.catalog-on-demand.com/plans/catalog-on-demand_for_magento.php');">
|
99 |
+
<span>Documentation</span>
|
100 |
+
</a>
|
101 |
+
</li>
|
102 |
+
</ul>
|
103 |
+
</div>
|
104 |
+
<div class="main-col" id="content">
|
105 |
+
<div class="main-col-inner">
|
106 |
+
<div class="content-header"></div>
|
107 |
+
|
108 |
+
<?php
|
109 |
+
$extensions = array('curl','dom', 'hash','iconv','mcrypt' );
|
110 |
+
|
111 |
+
$fail = '';
|
112 |
+
$pass = '';
|
113 |
+
|
114 |
+
if(version_compare(phpversion(), '5.2.0', '<')) {
|
115 |
+
$fail .= '<li>You need<strong> PHP 5.2.0</strong> (or greater). Your current version is '.phpversion().'</li>';
|
116 |
+
}
|
117 |
+
else {
|
118 |
+
$pass .='<li>You have<strong> PHP '.phpversion().'</strong></li>';
|
119 |
+
}
|
120 |
+
//Removed in Version 2.2.15
|
121 |
+
/*$allow_url_fopen = ini_get('allow_url_fopen');
|
122 |
+
if ( $allow_url_fopen != '1' )
|
123 |
+
$fail .= '<li> You are missing the <strong>allow_url_fopen</strong> configuration option</li>';
|
124 |
+
*/
|
125 |
+
if( !ini_get('safe_mode') ) {
|
126 |
+
$pass .='<li>Safe Mode is <strong>off</strong></li>';
|
127 |
+
}
|
128 |
+
else { $fail .= '<li>Safe Mode is <strong>on</strong></li>'; }
|
129 |
+
|
130 |
+
foreach($extensions as $extension) {
|
131 |
+
if( !extension_loaded($extension) ) {
|
132 |
+
$fail .= '<li> You are missing the <strong>'.$extension.'</strong> extension</li>';
|
133 |
+
}
|
134 |
+
else{
|
135 |
+
$pass .= '<li>You have the <strong>'.$extension.'</strong> extension</li>';
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
|
140 |
+
$baseDir = dirname(__FILE__);
|
141 |
+
|
142 |
+
$_baseDirArray = explode("app", $baseDir);
|
143 |
+
$basePath = $_baseDirArray[0];
|
144 |
+
|
145 |
+
if ( !is_dir($basePath.'CODdataFiles/') ){
|
146 |
+
if ( !mkdir($basePath.'CODdataFiles/') ){
|
147 |
+
|
148 |
+
$fail .= "<li>Could not create <strong>CoDDataFiles</strong> folder.</li>";
|
149 |
+
$fail .= "<li>You should be created <strong>CoDdataFiles manually </strong> in ".$basePath."</li>";
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
$is_file = true;
|
154 |
+
|
155 |
+
if ( !$codimodel->createFile($basePath) ){
|
156 |
+
$fail .= "<li>The Magento extension was prevented from creating a file in the folder CoDDataFile. Please notify your Magento administrator.</li>";
|
157 |
+
$is_file = false;
|
158 |
+
}
|
159 |
+
|
160 |
+
$target = $codimodel->target;
|
161 |
+
|
162 |
+
if ( $target == "auth" && $fail != "" ){
|
163 |
+
$target = "systemtest";
|
164 |
+
}
|
165 |
+
|
166 |
+
switch ($target)
|
167 |
+
{
|
168 |
+
case "register":
|
169 |
+
break;
|
170 |
+
case "documentation":
|
171 |
+
break;
|
172 |
+
case "systemtest":
|
173 |
+
|
174 |
+
echo "<div class='entry-edit'>
|
175 |
+
<div class='entry-edit-head'>
|
176 |
+
<h4 class='icon-head head-edit-form fieldset-legend'>System Test</h4>
|
177 |
+
<div> </div>
|
178 |
+
</div>
|
179 |
+
<div class='fieldset'>
|
180 |
+
";
|
181 |
+
|
182 |
+
if( $fail ) {
|
183 |
+
echo '<p><strong>Your server is not properly configured to run the Catalog-on-Demand® for Magento® extension.</strong>';
|
184 |
+
echo '<br>Please contact your hosting provider to report the failure of the following tests:';
|
185 |
+
echo '<br><ul>'.$fail.'</ul></p>';
|
186 |
+
echo '<br>The following tests were successfully met:';
|
187 |
+
echo '<ul>'.$pass.'</ul>';
|
188 |
+
} else {
|
189 |
+
echo '<p><strong>Congratulations!</strong> Your server has passed all the tests to properly run the Catalog-on-Demand® for Magento® extension.</p>';
|
190 |
+
echo '<ul>'.$pass.'</ul>';
|
191 |
+
}
|
192 |
+
|
193 |
+
echo "<br/>";
|
194 |
+
|
195 |
+
|
196 |
+
echo '<p> Current Extension Name : <b>'.$extensionName.'</b></p>';
|
197 |
+
|
198 |
+
echo '<p>Current Extension Version: <b>'.$currentVer.'</b></p>';
|
199 |
+
|
200 |
+
|
201 |
+
|
202 |
+
|
203 |
+
$exec_command = "";
|
204 |
+
|
205 |
+
if( (false !== strpos(ini_get("disable_functions"), "exec")) || (false !== strpos(ini_get("disable_functions"), "shell_exec")) ) {
|
206 |
+
$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>";
|
207 |
+
}else{
|
208 |
+
$exec_command = "The <strong>exec</strong> and <strong>shell_exec</strong> functions are enabled. You may use the background process to create data files.";
|
209 |
+
}
|
210 |
+
|
211 |
+
echo $exec_command;
|
212 |
+
|
213 |
+
echo "<br/><br/>";
|
214 |
+
|
215 |
+
foreach (Mage::app()->getWebsites() as $website)
|
216 |
+
{
|
217 |
+
$defaultGroup = $website->getDefaultGroup();
|
218 |
+
$StoreId = $defaultGroup->getDefaultStoreId();
|
219 |
+
}
|
220 |
+
|
221 |
+
$design = Mage::getSingleton('core/design')->loadChange($StoreId);
|
222 |
+
|
223 |
+
$package = $design->getPackage();
|
224 |
+
$default_theme = $design->getTheme();
|
225 |
+
|
226 |
+
if ( $package == "" && $default_theme == "" ){
|
227 |
+
|
228 |
+
$package = Mage::getStoreConfig('design/package/name', $StoreId);
|
229 |
+
$default_theme = Mage::getStoreConfig('design/theme/default', $StoreId);
|
230 |
+
}
|
231 |
+
|
232 |
+
if ( $package == "" ) $package = "default";
|
233 |
+
if ( $default_theme == "" ) $default_theme = "default";
|
234 |
+
|
235 |
+
$update_guide = "<ul style='list-style:decimal outside none;padding-left:30px;'>";
|
236 |
+
$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>";
|
237 |
+
$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>";
|
238 |
+
$update_guide .= "<ul style='list-style:square outside none;padding-left:30px;'>";
|
239 |
+
$update_guide .= "<li><p>Copy lines 37-50, and paste after the line containing getProduct().</p></li>";
|
240 |
+
$update_guide .= "<li><p>Copy line 69 and paste before the line containing 'name'.</p></li>";
|
241 |
+
$update_guide .= "<li><p>Copy line 71 and paste after the line containing 'name'.</p></li>";
|
242 |
+
$update_guide .= "<li><p>Copy line 79 and paste before the line containing 'Email to a Friend'.</p></li>";
|
243 |
+
$update_guide .= "<li><p>Copy line 81 and paste after the line containing 'Email to a Friend'.</p></li>";
|
244 |
+
$update_guide .= "<li><p>Copy line 99 and paste before the line containing 'OR'.</p></li>";
|
245 |
+
$update_guide .= "<li><p>Copy line 101 and paste after the line containing 'OR'.</p></li>";
|
246 |
+
$update_guide .= "<li><p>Copy line 115 and paste before the line containing 'Quick Overview'.</p></li>";
|
247 |
+
$update_guide .= "<li><p>Copy line 117 and paste after the line containing 'Quick Overview'.</p></li>";
|
248 |
+
$update_guide .= "</ul>";
|
249 |
+
$update_guide .= "</li>";
|
250 |
+
$update_guide .= "<ul>";
|
251 |
+
|
252 |
+
if ( $package != "default" || $default_theme != "default" ){
|
253 |
+
|
254 |
+
echo "<p>This is important if you intend to use the Always Fresh™ 'flyer-per-product-page' feature of Catalog-on-Demand®.</p>";
|
255 |
+
echo "<p>You are using the following theme : <strong>".$package." / ".$default_theme."</strong></p>";
|
256 |
+
echo "<p>Your site admin will need to edit the view.html for this theme, as follows:</p>";
|
257 |
+
echo $update_guide;
|
258 |
+
|
259 |
+
}else{
|
260 |
+
echo "<p>You have the default theme.</p>";
|
261 |
+
}
|
262 |
+
|
263 |
+
echo "</div></div>";
|
264 |
+
echo "<br />";
|
265 |
+
|
266 |
+
$text = "";
|
267 |
+
|
268 |
+
if ( $is_file ){
|
269 |
+
|
270 |
+
$message = $codimodel->getImportStatuses();
|
271 |
+
|
272 |
+
if ( isset($message) ){
|
273 |
+
|
274 |
+
$status = $message['message'];
|
275 |
+
|
276 |
+
if ( $status== "end" && $message['finished'] == 1 ){
|
277 |
+
$text = "<p id='codi_status_template_button'>Your test data file was created successfully. <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>";
|
278 |
+
$codimodel->deleteTable();
|
279 |
+
}else if ( $status== "start" && $message['finished'] == 0 ) {
|
280 |
+
$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> <button type='button' class='scalable cancel' onclick='cancel_codi_import()' style='margin-left:25px' ><span>Cancel</span></button></p>" ;
|
281 |
+
}else if ( $status== "fileerror" && $message['finished'] == 0 ) {
|
282 |
+
$text = "<p>Your test data file was not created. Please contact your administrator.</p>";
|
283 |
+
$codimodel->deleteTable();
|
284 |
+
}else{
|
285 |
+
$text = "<p>Your test data file was not created. Please contact your administrator.</p>";
|
286 |
+
$codimodel->deleteTable();
|
287 |
+
}
|
288 |
+
}
|
289 |
+
else{
|
290 |
+
//Changed on version 2.2.15
|
291 |
+
//$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 />";
|
292 |
+
$text .= "<button type='button' class='scalable add' onclick='start_codi_import()' style='margin-left:25px;' ><span>Test</span></button>";
|
293 |
+
//echo $basePath.'CODdataFiles/temp.txt';
|
294 |
+
// @unlink($basePath.'CODdataFiles/temp.txt');
|
295 |
+
}
|
296 |
+
//version 2.2.16
|
297 |
+
/*echo "<div class='entry-edit'>
|
298 |
+
<div class='entry-edit-head'>
|
299 |
+
<h4 class='icon-head head-edit-form fieldset-legend'>Data File Creation</h4>
|
300 |
+
<div> </div>
|
301 |
+
</div>
|
302 |
+
<div class='fieldset' id='codi_status_template' name='codi_status_template'>".$text."</div>
|
303 |
+
";*/
|
304 |
+
}
|
305 |
+
break;
|
306 |
+
case "auth":
|
307 |
+
?>
|
308 |
+
<form name="codiform" action="<?php echo $this->getUrl('codi/adminhtml_menu/authsave') ?>" method="post" id="codiform">
|
309 |
+
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
|
310 |
+
<input name="store" type="hidden" value="<?php echo $this->getRequest()->getParam('store'); ?>" />
|
311 |
+
<div class="entry-edit">
|
312 |
+
<div class="entry-edit-head">
|
313 |
+
<h4 class="icon-head head-edit-form fieldset-legend">Configuration Settings</h4>
|
314 |
+
<div class="form-buttons" align="right">
|
315 |
+
<button type="submit" class="scalable add" ><span>Save</span></button>
|
316 |
+
</div>
|
317 |
+
<div> </div>
|
318 |
+
</div>
|
319 |
+
<div class="fieldset " id="group_fields12">
|
320 |
+
<div class="hor-scroll">
|
321 |
+
<table cellspacing="0" class="form-list">
|
322 |
+
<tbody>
|
323 |
+
<tr>
|
324 |
+
<td class="scope-label"><a href="#accountid_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
|
325 |
+
<td class="label"><label for="userid">Account ID</label></td>
|
326 |
+
<td class="value"><input name="userid" id="userid" value="<?php echo $userid ?>" class=" input-text" type="text"/></td>
|
327 |
+
<td><small> </small></td>
|
328 |
+
</tr>
|
329 |
+
<tr>
|
330 |
+
<td class="scope-label"><a href="#secretkey_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
|
331 |
+
<td class="label"><label for="secretkey">Secret Key</label></td>
|
332 |
+
<td class="value"><input name="secretkey" id="secretkey" value="<?php echo $secretkey ?>" class=" input-text" type="text"/></td>
|
333 |
+
<td><small> </small></td>
|
334 |
+
</tr>
|
335 |
+
<tr>
|
336 |
+
<td class="scope-label"><a href="#kickoffurl_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
|
337 |
+
<td class="label"><label for="secretkey">Kick-off URL</label></td>
|
338 |
+
<td class="value"><label>
|
339 |
+
<?php
|
340 |
+
$url = $this->getUrl('codi/sync') ;
|
341 |
+
$pos = strrpos ($url , 'key') ;
|
342 |
+
if ( $pos != 0 )
|
343 |
+
$kickoffurl = substr( $url , 0 , $pos ) ;
|
344 |
+
else
|
345 |
+
$kickoffurl = $url;
|
346 |
+
|
347 |
+
echo "<input class='input-text' type='text' name='kickoffurl' value='".$kickoffurl."'>" ;
|
348 |
+
?></label>
|
349 |
+
</td>
|
350 |
+
<td><small> </small></td>
|
351 |
+
</tr>
|
352 |
+
<tr><td class="scope-label"></td><td class="label"></td><td class="value"></td><td><small> </small></td></tr>
|
353 |
+
<!-- Changed for version 2.2.16 to add data file launch mode -->
|
354 |
+
<tr>
|
355 |
+
<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>
|
356 |
+
<td class="label"><label for="DataFileLaunchMode">Data File Launch Mode</label></td>
|
357 |
+
<td class="value">
|
358 |
+
<input type="radio" value="manual" id="manual" name="datafilelaunch" <?php if ($datafilelaunch =="manual") echo "checked" ?> onclick="displayBlock('codi_status_template','cronjob','0');"/> <label for="manual">Manual <a href="#manual_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></label><br>
|
359 |
+
<p id="codi_status_template" name="codi_status_template" style="display:<?php if ($datafilelaunch =="manual") echo 'block'; else echo 'none';?>;">
|
360 |
+
<?php
|
361 |
+
$filename = $basePath.'CODdataFiles/text.tmp.txt';
|
362 |
+
if (file_exists($filename)) {
|
363 |
+
$modifie="Last Created Date: " . date("M d, Y H:i:s.", filemtime($filename));
|
364 |
+
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>";
|
365 |
+
}
|
366 |
+
else{
|
367 |
+
?>
|
368 |
+
<button type='button' class='scalable add' onclick='start_codi_import()' style='margin-left:25px;' ><span>Create Data File</span></button>
|
369 |
+
<?php }?>
|
370 |
+
</p>
|
371 |
+
|
372 |
+
|
373 |
+
<input type="radio" value="cod" id="cod" name="datafilelaunch" <?php if ($datafilelaunch =="cod") echo "checked" ?> onclick="displayBlock('codi_status_template','cronjob','1');" /> <label for="cod">Catalog-on-Demand <a href="#codoption_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></label><br>
|
374 |
+
<input type="radio" value="magento" id="magento" name="datafilelaunch" <?php if ($datafilelaunch =="magento") echo "checked" ?> onclick="displayBlock('cronjob','codi_status_template','0');" /> <label for="magento">Cron-job <a href="#cronjoburl_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></label>
|
375 |
+
</td>
|
376 |
+
<td><small> </small></td>
|
377 |
+
</tr>
|
378 |
+
<tr>
|
379 |
+
|
380 |
+
<td class="scope-label"></td>
|
381 |
+
<td class="label"></td>
|
382 |
+
<td class="value">
|
383 |
+
<p id="cronjob" name="cronjob" style="display:<?php if ($datafilelaunch =="magento") echo 'block'; else echo 'none';?>;">
|
384 |
+
<?php
|
385 |
+
$url = $this->getUrl('codi/nsync') ;
|
386 |
+
$pos = strrpos ($url , 'key') ;
|
387 |
+
if ( $pos != 0 )
|
388 |
+
$cronjoburl = substr( $url , 0 , $pos ) ;
|
389 |
+
else
|
390 |
+
$cronjoburl = $url;
|
391 |
+
|
392 |
+
echo '<input type="text" class="input-text" name="cronjoburl" width="60px" value="wget '.$cronjoburl.'">' ;
|
393 |
+
?></p>
|
394 |
+
</td>
|
395 |
+
<td><small> </small></td>
|
396 |
+
</tr>
|
397 |
+
|
398 |
+
<tr>
|
399 |
+
<td class="scope-label"><a href="#enablefreshflyers_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
|
400 |
+
<td class="label"><label for="enablefreshflyers">Enable Always Fresh™ Flyers</label></td>
|
401 |
+
<td class="value"><input name="enablefreshflyers" id="enablefreshflyers" value="checked" <?php if ($enablefreshflyers =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
|
402 |
+
<td><small> </small></td>
|
403 |
+
</tr>
|
404 |
+
<tr>
|
405 |
+
<td class="scope-label"><a href="#enablereviews_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
|
406 |
+
<td class="label"><label for="enablereviews">Enable Reviews</label></td>
|
407 |
+
<td class="value"><input name="enablereviews" id="enablereviews" value="checked" <?php if ($enablereviews =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
|
408 |
+
<td><small> </small></td>
|
409 |
+
</tr>
|
410 |
+
<tr>
|
411 |
+
<td class="scope-label"><a href="#getpricefromchild_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
|
412 |
+
<td class="label"><label for="fromchild">Get price from associated products</label></td>
|
413 |
+
<td class="value"><input name="fromchild" id="fromchild" value="checked" <?php if ($fromchild =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
|
414 |
+
<td><small> </small></td>
|
415 |
+
</tr>
|
416 |
+
<tr><td class="scope-label"></td><td class="label"></td><td class="value"></td><td><small> </small></td></tr>
|
417 |
+
<tr>
|
418 |
+
<td class="scope-label"><a href="#codflyerlinkimg_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
|
419 |
+
<td class="label"><label for="usedimage">Image to be used for flyer link</label></td>
|
420 |
+
<td class="value">
|
421 |
+
<input type="radio" value="Default" id="Default" name="codflyerlinkimg" <?php if ($codflyerlinkimg !="Custom") echo "checked" ?> onclick="document.getElementById('codflyerlinkimgurl').style.display='none';"/> <label for="Default">Default</label><br>
|
422 |
+
<input type="radio" value="Custom" id="Custom" name="codflyerlinkimg" <?php if ($codflyerlinkimg =="Custom") echo "checked" ?> onclick="document.getElementById('codflyerlinkimgurl').style.display='block';"/>
|
423 |
+
<label for="Custom">Custom</label>
|
424 |
+
</td>
|
425 |
+
<td>
|
426 |
+
<img src="<?php if ($codflyerlinkimg =='Custom') echo $codflyerlinkimgurl ; else echo 'http://www.catalog-on-demand.com/print-catalog.png'?>"></td>
|
427 |
+
</tr>
|
428 |
+
<tr>
|
429 |
+
<td class="scope-label"></td>
|
430 |
+
<td class="label"></td>
|
431 |
+
<td class="value">
|
432 |
+
<input type="text" id="codflyerlinkimgurl" name="codflyerlinkimgurl" class=" input-text"
|
433 |
+
value="<?php if ($codflyerlinkimg =='Custom') echo $codflyerlinkimgurl; else echo '';?>"
|
434 |
+
style="display:<?php if ($codflyerlinkimg =='Custom') echo 'block'; else echo 'none';?>" />
|
435 |
+
</td>
|
436 |
+
<td><small> </small></td>
|
437 |
+
</tr>
|
438 |
+
<tr>
|
439 |
+
<td class="scope-label"><a href="#codflyerlinkimgalt_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
|
440 |
+
<td class="label"><label for="usedimage">Alt text for flyer link image</label></td>
|
441 |
+
<td class="value">
|
442 |
+
<input type="text" id="codflyerlinkimgalt" name="codflyerlinkimgalt" class=" input-text"
|
443 |
+
value="<?php if ($codflyerlinkimgalt == '') echo 'Click for PDF of this product'; else echo $codflyerlinkimgalt ;?>" />
|
444 |
+
</td>
|
445 |
+
<td><small> </small></td>
|
446 |
+
</tr>
|
447 |
+
<tr><td class="scope-label"></td><td class="label"></td><td class="value"></td><td><small> </small></td></tr>
|
448 |
+
</table>
|
449 |
+
<fieldset style="width:460px;">
|
450 |
+
<legend style="width:120px;visibility:visible;height:12px;display:block;"><a href="#displayoptions_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a> Display Options</legend>
|
451 |
+
<table class="form-list" cellpadding='0'>
|
452 |
+
<tr>
|
453 |
+
<td class="label"><label for="codbeforename">Display before product name</label></td>
|
454 |
+
<td class="value"><input name="codbeforename" id="codbeforename" value="checked" <?php if ($codbeforename =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
|
455 |
+
<td class="scope-label"></td>
|
456 |
+
<td><small> </small></td>
|
457 |
+
</tr>
|
458 |
+
<tr>
|
459 |
+
<td class="label"><label for="codaftername">Display after product name</label></td>
|
460 |
+
<td class="value"><input name="codaftername" id="codaftername" value="checked" <?php if ($codaftername =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
|
461 |
+
<td class="scope-label"></td>
|
462 |
+
<td><small> </small></td>
|
463 |
+
</tr>
|
464 |
+
|
465 |
+
<tr>
|
466 |
+
<td class="label"><label for="codbeforeemailto">Display before 'Email to a friend'</label></td>
|
467 |
+
<td class="value"><input name="codbeforeemailto" id="codbeforeemailto" value="checked" <?php if ($codbeforeemailto =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
|
468 |
+
<td class="scope-label"></td>
|
469 |
+
<td><small> </small></td>
|
470 |
+
</tr>
|
471 |
+
<tr>
|
472 |
+
<td class="label"><label for="codafteremailto">Display after 'Email to a friend'</label></td>
|
473 |
+
<td class="value"><input name="codafteremailto" id="codafteremailto" value="checked" <?php if ($codafteremailto =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
|
474 |
+
<td class="scope-label"></td>
|
475 |
+
<td><small> </small></td>
|
476 |
+
</tr>
|
477 |
+
|
478 |
+
<tr>
|
479 |
+
<td class="label"><label for="codbeforeOR">Display before 'OR'</label></td>
|
480 |
+
<td class="value"><input name="codbeforeOR" id="codbeforeOR" value="checked" <?php if ($codbeforeOR =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
|
481 |
+
<td class="scope-label"></td>
|
482 |
+
<td><small> </small></td>
|
483 |
+
</tr>
|
484 |
+
<tr>
|
485 |
+
<td class="label"><label for="codafterOR">Display after 'OR'</label></td>
|
486 |
+
<td class="value"><input name="codafterOR" id="codafterOR" value="checked" <?php if ($codafterOR =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
|
487 |
+
<td class="scope-label"></td>
|
488 |
+
<td><small> </small></td>
|
489 |
+
</tr>
|
490 |
+
|
491 |
+
<tr>
|
492 |
+
<td class="label"><label for="codbeforeoverview">Display before 'Quick Overview'</label></td>
|
493 |
+
<td class="value"><input name="codbeforeoverview" id="codbeforeoverview" value="checked" <?php if ($codbeforeoverview =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
|
494 |
+
<td class="scope-label"></td>
|
495 |
+
<td><small> </small></td>
|
496 |
+
</tr>
|
497 |
+
<tr>
|
498 |
+
<td class="label"><label for="codafteroverview">Display after 'Quick Overview'</label></td>
|
499 |
+
<td class="value"><input name="codafteroverview" id="codafteroverview" value="checked" <?php if ($codafteroverview =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
|
500 |
+
<td class="scope-label"></td>
|
501 |
+
<td><small> </small></td>
|
502 |
+
</tr>
|
503 |
+
</fieldset>
|
504 |
+
|
505 |
+
</tbody>
|
506 |
+
</table>
|
507 |
+
</div>
|
508 |
+
</div>
|
509 |
+
</div>
|
510 |
+
</form>
|
511 |
+
<?php
|
512 |
+
break;
|
513 |
+
}
|
514 |
+
?>
|
515 |
+
|
516 |
+
</div>
|
517 |
+
</div>
|
518 |
+
</div>
|
519 |
+
</div>
|
520 |
+
<div id="accountid_tooltip" class="hidden">
|
521 |
+
<?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/accountid.html'); ?>
|
522 |
+
</div>
|
523 |
+
<div id="secretkey_tooltip" class="hidden">
|
524 |
+
<?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/secretkey.html'); ?>
|
525 |
+
</div>
|
526 |
+
<div id="kickoffurl_tooltip" class="hidden">
|
527 |
+
<?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/kickoffurl.html'); ?>
|
528 |
+
</div>
|
529 |
+
<div id="enablefreshflyers_tooltip" class="hidden">
|
530 |
+
<?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/enablefreshflyers.html'); ?>
|
531 |
+
</div>
|
532 |
+
<div id="enablereviews_tooltip" class="hidden">
|
533 |
+
<?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/enablereviews.html'); ?>
|
534 |
+
</div>
|
535 |
+
<div id="getpricefromchild_tooltip" class="hidden">
|
536 |
+
<?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/getpricefromchild.html'); ?>
|
537 |
+
</div>
|
538 |
+
<div id="codflyerlinkimg_tooltip" class="hidden">
|
539 |
+
<?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/codflyerlinkimg.html'); ?>
|
540 |
+
</div>
|
541 |
+
<div id="codflyerlinkimgalt_tooltip" class="hidden">
|
542 |
+
<?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/codflyerlinkimgalt.html'); ?>
|
543 |
+
</div>
|
544 |
+
<div id="displayoptions_tooltip" class="hidden">
|
545 |
+
<?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/displayoptions.html'); ?>
|
546 |
+
</div>
|
547 |
+
<div id="datafilebackground_tooltip" class="hidden">
|
548 |
+
<?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/datafilebackground.html'); ?>
|
549 |
+
</div>
|
550 |
+
<div id="data_file_launch_mode_tooltip" class="hidden">
|
551 |
+
<?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/datafilelaunchmode.html'); ?>
|
552 |
+
</div>
|
553 |
+
<div id="cronjoburl_tooltip" class="hidden">
|
554 |
+
<?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/cronjoburl.html'); ?>
|
555 |
+
</div>
|
556 |
+
<div id="codoption_tooltip" class="hidden">
|
557 |
+
<?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/CoDDataFileLaunch.html'); ?>
|
558 |
+
</div>
|
559 |
+
<div id="manual_tooltip" class="hidden">
|
560 |
+
<?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/ManualDataFileLaunch.html'); ?>
|
561 |
+
</div>
|
562 |
+
<script type="text/javascript" src="<?php echo $this->getJsUrl('jquery/jquery-1.2.6.noConflict.min.js') ?>"></script>
|
563 |
+
<script type="text/javascript" src="<?php echo $this->getJsUrl('jquery/jquery.tooltip.js') ?>"></script>
|
564 |
+
<script type="text/javascript">
|
565 |
+
jQuery("#content a").tooltip({
|
566 |
+
bodyHandler: function() {
|
567 |
+
return jQuery(jQuery(this).attr("href")).html();
|
568 |
+
},
|
569 |
+
delay: 0,
|
570 |
+
showURL: false
|
571 |
+
});
|
572 |
+
|
573 |
+
function start_codi_import(){
|
574 |
+
codi = new Codi('<?=$post_url?>','<?=$post_url_upd?>');
|
575 |
+
codi.startCodiImport();
|
576 |
+
}
|
577 |
+
|
578 |
+
function onBackgroundProcess(obj){
|
579 |
+
var value = 0;
|
580 |
+
if ( obj.checked == true )
|
581 |
+
value = 1;
|
582 |
+
|
583 |
+
var url = "<?php echo $post_bgprocess_check; ?>";
|
584 |
+
var param = "check=" + value;
|
585 |
+
new Ajax.Request(url,
|
586 |
+
{
|
587 |
+
method:'post',
|
588 |
+
parameters: param,
|
589 |
+
onSuccess: function(transport) {
|
590 |
+
}
|
591 |
+
});
|
592 |
+
|
593 |
+
}
|
594 |
+
|
595 |
+
var Codi = Class.create();
|
596 |
+
|
597 |
+
Codi.prototype = {
|
598 |
+
initialize: function(postUrl, postUrlUpd) {
|
599 |
+
|
600 |
+
this.postUrl = postUrl; //'https://techatcost.com/purchases/ajax/';
|
601 |
+
this.postUrlUpd = postUrlUpd;
|
602 |
+
this.failureUrl = document.URL;
|
603 |
+
// object with event message data
|
604 |
+
this.objectMsg = null;
|
605 |
+
// interval object
|
606 |
+
this.updateTimer = null;
|
607 |
+
// default shipping code. Display on errors
|
608 |
+
|
609 |
+
elem = 'checkoutSteps';
|
610 |
+
clickableEntity = '.head';
|
611 |
+
|
612 |
+
// overwrite Accordion class method
|
613 |
+
var headers = $$('#' + elem + ' .section ' + clickableEntity);
|
614 |
+
headers.each(function(header) {
|
615 |
+
Event.observe(header,'click',this.sectionClicked.bindAsEventListener(this));
|
616 |
+
}.bind(this));
|
617 |
+
},
|
618 |
+
startCodiImport: function () {
|
619 |
+
_this = this;
|
620 |
+
var param = "is_process=";
|
621 |
+
if ( jQuery('#background_process').is(':checked') == true )
|
622 |
+
param += "1";
|
623 |
+
else
|
624 |
+
param += "0";
|
625 |
+
new Ajax.Request(this.postUrl,
|
626 |
+
{
|
627 |
+
method:'post',
|
628 |
+
parameters: param,
|
629 |
+
requestTimeout: 100,
|
630 |
+
|
631 |
+
onSuccess: function(transport) {
|
632 |
+
var ret_msg = transport.responseText.evalJSON();
|
633 |
+
var status_div = document.getElementById('codi_status_template');
|
634 |
+
|
635 |
+
if ( ret_msg.success == 1 ){
|
636 |
+
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> <button type='button' class='scalable cancel' onclick='cancel_codi_import()' style='margin-left:25px' ><span>Cancel</span></button></p>";
|
637 |
+
_this.updateTimer = setInterval(function(){_this.updateEvent();}, 10000);
|
638 |
+
}else if ( ret_msg.error == 1 ){
|
639 |
+
status_div.innerHTML = "<p>The Magento extension was prevented from creating a file in the folder CoDDataFile. Please notify your Magento administrator.</p>";
|
640 |
+
}else if ( ret_msg.exec == 1 || ret_msg.shellexec == 1 ) {
|
641 |
+
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>";
|
642 |
+
}
|
643 |
+
},
|
644 |
+
onTimeout: function() {
|
645 |
+
var status_div = document.getElementById('codi_status_template');
|
646 |
+
status_div.innerHTML = "<p>Your test data file was not created. Please contact your administrator.</p>";
|
647 |
+
},
|
648 |
+
onFailure: function() {
|
649 |
+
var status_div = document.getElementById('codi_status_template');
|
650 |
+
status_div.innerHTML = "<p>Your test data file was not created. Please contact your administrator.</p>";
|
651 |
+
}
|
652 |
+
});
|
653 |
+
},
|
654 |
+
|
655 |
+
updateEvent: function () {
|
656 |
+
_this = this;
|
657 |
+
new Ajax.Request(this.postUrlUpd,
|
658 |
+
{
|
659 |
+
method: 'post',
|
660 |
+
onSuccess: function(transport) {
|
661 |
+
_this.objectMsg = transport.responseText.evalJSON();
|
662 |
+
|
663 |
+
if (_this.objectMsg.canceled == 1) {
|
664 |
+
_this.clearUpdateInterval();
|
665 |
+
_this.objectMsg.message = 'canceled';
|
666 |
+
_this.updateStatusHtml();
|
667 |
+
}
|
668 |
+
|
669 |
+
if (_this.objectMsg.processed == 1) {
|
670 |
+
}
|
671 |
+
|
672 |
+
if (_this.objectMsg.fileerror == 1) {
|
673 |
+
_this.clearUpdateInterval();
|
674 |
+
_this.objectMsg.message = 'fileerror';
|
675 |
+
_this.updateStatusHtml();
|
676 |
+
}
|
677 |
+
|
678 |
+
if (_this.objectMsg.error == 1) {
|
679 |
+
_this.clearUpdateInterval();
|
680 |
+
_this.objectMsg.message = 'error';
|
681 |
+
_this.updateStatusHtml();
|
682 |
+
}
|
683 |
+
|
684 |
+
if (_this.objectMsg.finished == 1) {
|
685 |
+
_this.objectMsg.message = 'finished';
|
686 |
+
_this.updateStatusHtml();
|
687 |
+
_this.clearUpdateInterval();
|
688 |
+
}
|
689 |
+
},
|
690 |
+
onFailure: this.ajaxFailure.bind(),
|
691 |
+
});
|
692 |
+
},
|
693 |
+
|
694 |
+
updateStatusHtml: function(){
|
695 |
+
message = this.objectMsg.message.toLowerCase();
|
696 |
+
var status_div = document.getElementById('codi_status_template');
|
697 |
+
var img_url = "<?php echo $this->getSkinUrl($this->__('images/codimport_yes.gif')) ?>";
|
698 |
+
|
699 |
+
if ( message == 'finished' ){
|
700 |
+
status_div.innerHTML="<p id='codi_status_template_button'>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></p>";
|
701 |
+
this.clearUpdateInterval();
|
702 |
+
}
|
703 |
+
|
704 |
+
if ( message == 'canceled' ){
|
705 |
+
this.clearUpdateInterval();
|
706 |
+
}
|
707 |
+
|
708 |
+
if ( message == 'processed' ){
|
709 |
+
}
|
710 |
+
|
711 |
+
if ( message == 'fileerror' ){
|
712 |
+
status_div.innerHTML="<p>Your test data file was not created. Please contact your administrator( File Error ).</p>";
|
713 |
+
this.clearUpdateInterval();
|
714 |
+
}
|
715 |
+
|
716 |
+
if ( message == 'error' ){
|
717 |
+
status_div.innerHTML="<p>Your test data file was not created. Please contact your administrator.</p>";
|
718 |
+
this.clearUpdateInterval();
|
719 |
+
}
|
720 |
+
|
721 |
+
},
|
722 |
+
|
723 |
+
ajaxFailure: function(){
|
724 |
+
this.clearUpdateInterval();
|
725 |
+
var status_div = document.getElementById('codi_status_template');
|
726 |
+
status_div.innerHTML = "<p>Your test data file was not created. Please contact your administrator(Ajax failure).</p>";
|
727 |
+
},
|
728 |
+
|
729 |
+
clearUpdateInterval: function () {
|
730 |
+
clearInterval(this.updateTimer);
|
731 |
+
},
|
732 |
+
}
|
733 |
+
function download_codi_file()
|
734 |
+
{
|
735 |
+
window.location.href="<?php echo $download_url?>";
|
736 |
+
|
737 |
+
}
|
738 |
+
function delete_codi_file()
|
739 |
+
{
|
740 |
+
window.location.href="<?php echo $delete_codi_url?>";
|
741 |
+
|
742 |
+
}
|
743 |
+
|
744 |
+
function displayBlock(show,hide,hideboth)
|
745 |
+
{
|
746 |
+
if(hideboth=='1')
|
747 |
+
{
|
748 |
+
document.getElementById(show).style.display='none';
|
749 |
+
document.getElementById(hide).style.display='none';
|
750 |
+
}
|
751 |
+
else
|
752 |
+
{
|
753 |
+
document.getElementById(show).style.display='';
|
754 |
+
document.getElementById(hide).style.display='none';
|
755 |
+
}
|
756 |
+
|
757 |
+
}
|
758 |
+
function cancel_codi_import(){
|
759 |
+
|
760 |
+
var url = "<?php echo $post_url_cancel; ?>";
|
761 |
+
new Ajax.Request(url,
|
762 |
+
{
|
763 |
+
method:'post',
|
764 |
+
onSuccess: function(transport) {
|
765 |
+
var ret_msg = transport.responseText;
|
766 |
+
|
767 |
+
if ( ret_msg ){
|
768 |
+
|
769 |
+
//var text = "<a href='#datafilebackground_tooltip'><img src=\"<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>\" /></a><br />";
|
770 |
+
text = "<button type='button' class='scalable add' onclick='start_codi_import()' style='margin-left:25px;' ><span>Create Data File</span></button>";
|
771 |
+
|
772 |
+
var status_div = document.getElementById('codi_status_template');
|
773 |
+
status_div.innerHTML = text;
|
774 |
+
}
|
775 |
+
}
|
776 |
+
});
|
777 |
+
}
|
778 |
+
</script>
|
app/design/frontend/default/default/template/catalog/product/view.phtml
ADDED
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-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 design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Product view template
|
29 |
+
*
|
30 |
+
* @see Mage_Catalog_Block_Product_View
|
31 |
+
* @see Mage_Review_Block_Product_View
|
32 |
+
*/
|
33 |
+
?>
|
34 |
+
<?php $_helper = $this->helper('catalog/output'); ?>
|
35 |
+
<?php $_product = $this->getProduct();?>
|
36 |
+
|
37 |
+
<?php
|
38 |
+
//Catalog-on-Demand
|
39 |
+
|
40 |
+
if ( Mage::getStoreConfig('codi/codi/codflyerlinkimg') =='Custom')
|
41 |
+
$codflyerlinkimgurl = Mage::getStoreConfig('codi/codi/codflyerlinkimgurl');
|
42 |
+
else
|
43 |
+
$codflyerlinkimgurl = 'http://www.catalog-on-demand.com/print-catalog.png';
|
44 |
+
|
45 |
+
$enablefreshflyers = Mage::getStoreConfig('codi/codi/enablefreshflyers');
|
46 |
+
|
47 |
+
$flyerlink = '<a target="_blank" href="http://catalog-on-demand.com/PDF-e-Link/?FlyerA&AID=' . Mage::getStoreConfig('codi/codi/codusername'). '|' . urlencode($_product->getId() . '#$#' . $_product->getName()) . '">'. '<img id="codflyerlinkimgalt" title="' . Mage::getStoreConfig('codi/codi/codflyerlinkimgalt') . '" alt="' . Mage::getStoreConfig('codi/codi/codflyerlinkimgalt') . '" src="' . $codflyerlinkimgurl . '">'. '</a>';
|
48 |
+
|
49 |
+
//Catalog-on-Demand
|
50 |
+
?>
|
51 |
+
|
52 |
+
|
53 |
+
<script type="text/javascript">
|
54 |
+
var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
|
55 |
+
</script>
|
56 |
+
<div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
|
57 |
+
<div class="product-view">
|
58 |
+
<div class="product-essential">
|
59 |
+
<form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
|
60 |
+
<div class="no-display">
|
61 |
+
<input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
|
62 |
+
<input type="hidden" name="related_product" id="related-products-field" value="" />
|
63 |
+
</div>
|
64 |
+
|
65 |
+
<div class="product-shop">
|
66 |
+
<div class="product-name">
|
67 |
+
<h1>
|
68 |
+
<!--Catalog-on-Demand-->
|
69 |
+
<?php if(Mage::getStoreConfig('codi/codi/codbeforename')=="checked" && $enablefreshflyers) echo $flyerlink; ?>
|
70 |
+
<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>
|
71 |
+
<?php if(Mage::getStoreConfig('codi/codi/codaftername')=="checked" && $enablefreshflyers) echo $flyerlink; ?>
|
72 |
+
<!--Catalog-on-Demand-->
|
73 |
+
</h1>
|
74 |
+
</div>
|
75 |
+
|
76 |
+
<?php if ($this->canEmailToFriend()): ?>
|
77 |
+
<p class="email-friend">
|
78 |
+
<!--Catalog-on-Demand-->
|
79 |
+
<?php if(Mage::getStoreConfig('codi/codi/codbeforeemailto')=="checked" && $enablefreshflyers) echo $flyerlink; ?>
|
80 |
+
<a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?php echo $this->__('Email to a Friend') ?></a>
|
81 |
+
<?php if(Mage::getStoreConfig('codi/codi/codafteremailto')=="checked" && $enablefreshflyers) echo $flyerlink; ?>
|
82 |
+
<!--Catalog-on-Demand-->
|
83 |
+
</p>
|
84 |
+
<?php endif; ?>
|
85 |
+
|
86 |
+
<?php echo $this->getReviewsSummaryHtml($_product, false, true)?>
|
87 |
+
<?php echo $this->getChildHtml('alert_urls') ?>
|
88 |
+
<?php echo $this->getChildHtml('product_type_data') ?>
|
89 |
+
<?php echo $this->getTierPriceHtml() ?>
|
90 |
+
<?php echo $this->getChildHtml('extrahint') ?>
|
91 |
+
|
92 |
+
<?php if (!$this->hasOptions()):?>
|
93 |
+
<div class="add-to-box">
|
94 |
+
<?php if($_product->isSaleable()): ?>
|
95 |
+
<?php echo $this->getChildHtml('addtocart') ?>
|
96 |
+
<?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
|
97 |
+
<span class="or">
|
98 |
+
<!--Catalog-on-Demand-->
|
99 |
+
<?php if(Mage::getStoreConfig('codi/codi/codbeforeOR')=="checked" && $enablefreshflyers) echo $flyerlink; ?>
|
100 |
+
<?php echo $this->__('OR') ?>
|
101 |
+
<?php if(Mage::getStoreConfig('codi/codi/codafterOR')=="checked" && $enablefreshflyers) echo $flyerlink; ?>
|
102 |
+
<!--Catalog-on-Demand-->
|
103 |
+
</span>
|
104 |
+
<?php endif; ?>
|
105 |
+
<?php endif; ?>
|
106 |
+
<?php echo $this->getChildHtml('addto') ?>
|
107 |
+
</div>
|
108 |
+
<?php echo $this->getChildHtml('extra_buttons') ?>
|
109 |
+
<?php endif; ?>
|
110 |
+
|
111 |
+
<?php if ($_product->getShortDescription()):?>
|
112 |
+
<div class="short-description">
|
113 |
+
<h2>
|
114 |
+
<!--Catalog-on-Demand-->
|
115 |
+
<?php if(Mage::getStoreConfig('codi/codi/codbeforeoverview')=="checked" && $enablefreshflyers) echo $flyerlink; ?>
|
116 |
+
<?php echo $this->__('Quick Overview') ?>
|
117 |
+
<?php if(Mage::getStoreConfig('codi/codi/codafteroverview')=="checked" && $enablefreshflyers) echo $flyerlink; ?>
|
118 |
+
<!--Catalog-on-Demand-->
|
119 |
+
</h2>
|
120 |
+
<div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
|
121 |
+
</div>
|
122 |
+
<?php endif;?>
|
123 |
+
|
124 |
+
<?php echo $this->getChildHtml('other');?>
|
125 |
+
|
126 |
+
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
|
127 |
+
<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
|
128 |
+
<?php endif;?>
|
129 |
+
|
130 |
+
</div>
|
131 |
+
|
132 |
+
<div class="product-img-box">
|
133 |
+
<?php echo $this->getChildHtml('media') ?>
|
134 |
+
</div>
|
135 |
+
|
136 |
+
<div class="clearer"></div>
|
137 |
+
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
|
138 |
+
<?php echo $this->getChildChildHtml('container2', '', true, true) ?>
|
139 |
+
<?php endif;?>
|
140 |
+
</form>
|
141 |
+
<script type="text/javascript">
|
142 |
+
//<![CDATA[
|
143 |
+
var productAddToCartForm = new VarienForm('product_addtocart_form');
|
144 |
+
productAddToCartForm.submit = function(button, url) {
|
145 |
+
if (this.validator.validate()) {
|
146 |
+
var form = this.form;
|
147 |
+
var oldUrl = form.action;
|
148 |
+
|
149 |
+
if (url) {
|
150 |
+
form.action = url;
|
151 |
+
}
|
152 |
+
var e = null;
|
153 |
+
try {
|
154 |
+
this.form.submit();
|
155 |
+
} catch (e) {
|
156 |
+
}
|
157 |
+
this.form.action = oldUrl;
|
158 |
+
if (e) {
|
159 |
+
throw e;
|
160 |
+
}
|
161 |
+
|
162 |
+
if (button && button != 'undefined') {
|
163 |
+
button.disabled = true;
|
164 |
+
}
|
165 |
+
}
|
166 |
+
}.bind(productAddToCartForm);
|
167 |
+
|
168 |
+
productAddToCartForm.submitLight = function(button, url){
|
169 |
+
if(this.validator) {
|
170 |
+
var nv = Validation.methods;
|
171 |
+
delete Validation.methods['required-entry'];
|
172 |
+
delete Validation.methods['validate-one-required'];
|
173 |
+
delete Validation.methods['validate-one-required-by-name'];
|
174 |
+
if (this.validator.validate()) {
|
175 |
+
if (url) {
|
176 |
+
this.form.action = url;
|
177 |
+
}
|
178 |
+
this.form.submit();
|
179 |
+
}
|
180 |
+
Object.extend(Validation.methods, nv);
|
181 |
+
}
|
182 |
+
}.bind(productAddToCartForm);
|
183 |
+
//]]>
|
184 |
+
</script>
|
185 |
+
</div>
|
186 |
+
|
187 |
+
<div class="product-collateral">
|
188 |
+
<?php foreach ($this->getChildGroup('detailed_info', 'getChildHtml') as $alias => $html):?>
|
189 |
+
<div class="box-collateral <?php echo "box-{$alias}"?>">
|
190 |
+
<?php if ($title = $this->getChildData($alias, 'title')):?>
|
191 |
+
<h2><?php echo $this->escapeHtml($title); ?></h2>
|
192 |
+
<?php endif;?>
|
193 |
+
<?php echo $html; ?>
|
194 |
+
</div>
|
195 |
+
<?php endforeach;?>
|
196 |
+
<?php echo $this->getChildHtml('upsell_products') ?>
|
197 |
+
<?php echo $this->getChildHtml('product_additional_data') ?>
|
198 |
+
</div>
|
199 |
+
</div>
|
app/etc/modules/Mage_Codi.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Mage_Codi>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Mage_Codi>
|
8 |
+
</modules>
|
9 |
+
</config>
|
js/jquery/jquery-1.2.6.noConflict.min.js
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery 1.2.6 - New Wave Javascript
|
3 |
+
*
|
4 |
+
* Copyright (c) 2008 John Resig (jquery.com)
|
5 |
+
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
6 |
+
* and GPL (GPL-LICENSE.txt) licenses.
|
7 |
+
*
|
8 |
+
* $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
|
9 |
+
* $Rev: 5685 $
|
10 |
+
*/
|
11 |
+
(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else
|
12 |
+
return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
|
13 |
+
return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else
|
14 |
+
selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
|
15 |
+
return(this[0].value||"").replace(/\r/g,"");}return undefined;}if(value.constructor==Number)value+='';return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else
|
16 |
+
this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
|
17 |
+
return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
|
18 |
+
jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){var src=target[name],copy=options[name];if(target===copy)continue;if(deep&©&&typeof copy=="object"&&!copy.nodeType)target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)target[name]=copy;}return target;};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else
|
19 |
+
script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!==undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object)if(callback.apply(object[name],args)===false)break;}else
|
20 |
+
for(;i<length;)if(callback.apply(object[i++],args)===false)break;}else{if(length==undefined){for(name in object)if(callback.call(object[name],name,object[name])===false)break;}else
|
21 |
+
for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
|
22 |
+
jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}if(name=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem+='';if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
|
23 |
+
ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&¬xml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else
|
24 |
+
while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]===elem)return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++])if(elem.nodeType!=8)first[pos++]=elem;}else
|
25 |
+
while(elem=second[i++])first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)if(!inv!=!callback(elems[i],i))ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)ret[ret.length]=value;}return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
|
26 |
+
for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i<args.length)jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
|
27 |
+
jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.ready);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!='string')return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else
|
28 |
+
xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
|
29 |
+
jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
|
30 |
+
for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
|
31 |
+
s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
|
32 |
+
e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})();
|
33 |
+
|
34 |
+
jQuery.noConflict();
|
js/jquery/jquery.tooltip.js
ADDED
@@ -0,0 +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);
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Mage_PDF_per_Product</name>
|
4 |
+
<version>2.2.17</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>2.2.17 - Added Magento 1.6 compatibility.</notes>
|
12 |
+
<authors><author><name>catalogondemand</name><user>catalogondemand</user><email>timh@catalog-on-demand.com</email></author></authors>
|
13 |
+
<date>2011-10-31</date>
|
14 |
+
<time>09:23:34</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="38238ebed2e682ac0b655f912e405f83"/></dir></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="de6b3d9d0787a3f96955b8089898b441"/></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="ae8a9d1be49f00102911ef5fbe97c126"/></dir><dir name="Customer"><file name="Codi.php" hash="17c557dbcfadd336dc7ba773d6304fc0"/></dir></dir><file name="Codi_Process.php" hash="fbbd13784f36efb5db3cf10f5981bcce"/><dir name="Helper"><file name="Data.php" hash="d4b1d32935b0564a5f2fae2965155d61"/></dir><dir name="Model"><file name="Codi.php" hash="fa57e10b748e0238fd2201bd8b6491f3"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MenuController.php" hash="2e0ba5fdd17637fccbb9b2837616c0d5"/></dir><file name="DeleteController.php" hash="fed4a29a509a181f0f185de0609872db"/><file name="NsyncController.php" hash="9ca19dc97a9cdef75a9e49bd5daea5c8"/><file name="SyncController.php" hash="4ba97098c8cbf330982b03911181fc3e"/></dir><dir name="etc"><file name="config.xml" hash="a9a4bc29670670e3e954b626360bcd58"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Codi.xml" hash="5d635cd2a0d415b67f095bda0298445d"/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|
skin/adminhtml/default/default/images/codimport_run.gif
ADDED
Binary file
|
skin/adminhtml/default/default/images/codimport_yes.gif
ADDED
Binary file
|
skin/adminhtml/default/default/images/preview_field_help.png
ADDED
Binary file
|