Version Notes
enable to adding downloadable products in account
Download this release
Release Info
Developer | Magento Core Team |
Extension | Amm_Product |
Version | 1.0.0.5 |
Comparing to | |
See all releases |
Code changes from version 1.0.0.2 to 1.0.0.5
app/code/community/Amm/Product/controllers/IndexController.php
CHANGED
@@ -35,7 +35,7 @@ class Amm_Product_IndexController extends Mage_Core_Controller_Front_Action
|
|
35 |
{
|
36 |
$param = $this->getRequest()->getParams();
|
37 |
if($param['ep']==0){
|
38 |
-
$this->_redirectUrl('
|
39 |
}else{
|
40 |
$session = $this->_getSession();
|
41 |
if(!$session->isLoggedIn()){
|
@@ -68,7 +68,7 @@ class Amm_Product_IndexController extends Mage_Core_Controller_Front_Action
|
|
68 |
}
|
69 |
}
|
70 |
|
71 |
-
$this->_redirectUrl('
|
72 |
}
|
73 |
|
74 |
public function uploadAction()
|
35 |
{
|
36 |
$param = $this->getRequest()->getParams();
|
37 |
if($param['ep']==0){
|
38 |
+
$this->_redirectUrl(Mage::getBaseUrl('link').'product/');
|
39 |
}else{
|
40 |
$session = $this->_getSession();
|
41 |
if(!$session->isLoggedIn()){
|
68 |
}
|
69 |
}
|
70 |
|
71 |
+
$this->_redirectUrl(Mage::getBaseUrl('link').'product/');
|
72 |
}
|
73 |
|
74 |
public function uploadAction()
|
app/design/frontend/base/default/template/product/show.phtml
ADDED
@@ -0,0 +1,1665 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$resultRequest = $this->productList();
|
4 |
+
|
5 |
+
$productEdit = $this->getEditProduct();
|
6 |
+
|
7 |
+
$pep = split('\.',@$productEdit['price']);
|
8 |
+
$price = $pep[0];
|
9 |
+
//var_dump($productEdit);
|
10 |
+
|
11 |
+
$category_id_hidden = '';
|
12 |
+
foreach($productEdit['category_id'] as $k=>$v){
|
13 |
+
$category_id_hidden .= ','.$v;
|
14 |
+
}
|
15 |
+
|
16 |
+
?>
|
17 |
+
|
18 |
+
|
19 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/extjs/fix-defer-before.js"></script>
|
20 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/prototype/window.js"></script>
|
21 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/mage/adminhtml/hash.js"></script>
|
22 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/mage/adminhtml/events.js"></script>
|
23 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/mage/adminhtml/loader.js"></script>
|
24 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/mage/adminhtml/grid.js"></script>
|
25 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/mage/adminhtml/tabs.js"></script>
|
26 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/mage/adminhtml/form.js"></script>
|
27 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/mage/adminhtml/accordion.js"></script>
|
28 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/mage/adminhtml/tools.js"></script>
|
29 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/mage/adminhtml/uploader.js"></script>
|
30 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/mage/adminhtml/product.js"></script>
|
31 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/calendar/calendar.js"></script>
|
32 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/calendar/calendar-setup.js"></script>
|
33 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/extjs/ext-tree.js"></script>
|
34 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/extjs/fix-defer.js"></script>
|
35 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/extjs/ext-tree-checkbox.js"></script>
|
36 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/mage/adminhtml/wysiwyg/tiny_mce/setup.js"></script>
|
37 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/mage/adminhtml/variables.js"></script>
|
38 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/mage/adminhtml/wysiwyg/widget.js"></script>
|
39 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/mage/adminhtml/browser.js"></script>
|
40 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/extjs/fix-defer-before.js"></script>
|
41 |
+
|
42 |
+
|
43 |
+
<!--
|
44 |
+
**
|
45 |
+
** list products
|
46 |
+
**
|
47 |
+
-->
|
48 |
+
|
49 |
+
<div class="request_table">
|
50 |
+
|
51 |
+
<?php echo $this->getPagerHtml(); ?>
|
52 |
+
<div class="box-account box-recent">
|
53 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
54 |
+
<tr>
|
55 |
+
<th>Created</th>
|
56 |
+
<th>Updated</th>
|
57 |
+
<th>SKU</th>
|
58 |
+
<th>Name</th>
|
59 |
+
<th>Price [USD]</th>
|
60 |
+
<th>Status</th>
|
61 |
+
<th>Action</th>
|
62 |
+
</tr>
|
63 |
+
<?php
|
64 |
+
if($resultRequest){ foreach($resultRequest as $rt){
|
65 |
+
$dca = split(' ',$rt['created_at']);
|
66 |
+
$dua = split(' ',$rt['updated_at']);
|
67 |
+
$prc = split('\.',$rt['price']);
|
68 |
+
$sts = ($rt['status']==1?'<span style="color:green;">Enabled</span>':'Disabled');
|
69 |
+
|
70 |
+
echo '<tr class="clicktagtr">
|
71 |
+
<td>'.$dca[0].'</td>
|
72 |
+
<td>'.$dua[0].'</td>
|
73 |
+
<td>'.$rt['sku'].'</td>
|
74 |
+
<td>'.substr(strip_tags($rt['name']),0,45).'...</td>
|
75 |
+
<td>'.$prc[0].'</td>
|
76 |
+
<td>'.$sts.'</td>
|
77 |
+
<td>[<a href="'.Mage::getBaseUrl("link").'product/index/edit?ep='.$rt['entity_id'].'&limit='.$resultRequest[0]['limit'].'&p='.$resultRequest[0]['page'].'">edit</a>][<a href="javascript:void();" onclick="javascript:sureDelete('.$rt['entity_id'].')">delete</a>]</td>
|
78 |
+
</tr>';
|
79 |
+
}
|
80 |
+
}
|
81 |
+
///product/index/delete?p='.$rt['entity_id'].'
|
82 |
+
?>
|
83 |
+
</table>
|
84 |
+
</div>
|
85 |
+
<?php echo $this->getPagerHtml(); ?>
|
86 |
+
|
87 |
+
<p> </p>
|
88 |
+
</div>
|
89 |
+
|
90 |
+
<!--
|
91 |
+
**
|
92 |
+
** end list products
|
93 |
+
**
|
94 |
+
-->
|
95 |
+
|
96 |
+
|
97 |
+
<div style="clear:both;"></div>
|
98 |
+
|
99 |
+
|
100 |
+
|
101 |
+
<hr />
|
102 |
+
|
103 |
+
|
104 |
+
|
105 |
+
|
106 |
+
|
107 |
+
<p> </p>
|
108 |
+
|
109 |
+
|
110 |
+
|
111 |
+
|
112 |
+
|
113 |
+
<div class="showcase">
|
114 |
+
<h3>Add and Edit Product</h3>
|
115 |
+
<!--
|
116 |
+
**
|
117 |
+
** form
|
118 |
+
**
|
119 |
+
-->
|
120 |
+
<form action="" method="post" name="showcaseform" id="product_edit_form" enctype="multipart/form-data">
|
121 |
+
|
122 |
+
<table width="100%" border="0" cellpadding="2" cellspacing="0">
|
123 |
+
<tr>
|
124 |
+
<td width="170">
|
125 |
+
<div class="showcase_attribute">
|
126 |
+
|
127 |
+
<strong>Attribute set:</strong>
|
128 |
+
<!--
|
129 |
+
**
|
130 |
+
** set
|
131 |
+
**
|
132 |
+
-->
|
133 |
+
<div><select name="set" id="set" onchange="getSetSelectAttribute();">
|
134 |
+
<?php
|
135 |
+
|
136 |
+
$entity_type_id = 4;
|
137 |
+
|
138 |
+
$entitytype = Mage::getModel('eav/entity_type')->getCollection()->addFieldToFilter('entity_model', 'catalog/product');
|
139 |
+
foreach($entitytype as $arrenty){
|
140 |
+
$entity_type_id = $arrenty->getData('entity_type_id');
|
141 |
+
}
|
142 |
+
|
143 |
+
$attributes = Mage::getModel('eav/entity_attribute_set')->getCollection()->addFieldToFilter('entity_type_id', $entity_type_id);
|
144 |
+
|
145 |
+
foreach($attributes as $arrt){
|
146 |
+
echo '<option value="'.$arrt->getData('attribute_set_id').'" '.(@$productEdit['attribute_set_id']==$arrt->getData('attribute_set_id')?'selected="selected"':'').'> '.$arrt->getData('attribute_set_name').'</option>';
|
147 |
+
}
|
148 |
+
|
149 |
+
?>
|
150 |
+
</select>
|
151 |
+
</div>
|
152 |
+
<!--
|
153 |
+
**
|
154 |
+
** type
|
155 |
+
**
|
156 |
+
-->
|
157 |
+
<input type="hidden" name="type" value="downloadable" />
|
158 |
+
|
159 |
+
<div class="showcase_menu">
|
160 |
+
<!--
|
161 |
+
**
|
162 |
+
** Categories
|
163 |
+
**
|
164 |
+
-->
|
165 |
+
<strong>Categories:</strong>
|
166 |
+
<div>
|
167 |
+
|
168 |
+
<?php echo $this->selectTreeCategory(Mage::app()->getStore()->getRootCategoryId(), @$productEdit['category_id']); ?>
|
169 |
+
|
170 |
+
</div>
|
171 |
+
</div>
|
172 |
+
<div>
|
173 |
+
<p> </p>
|
174 |
+
<button onclick="javascript:newproduct();return false;">Clear form, add product</button>
|
175 |
+
</div>
|
176 |
+
</div>
|
177 |
+
|
178 |
+
</td><td>
|
179 |
+
|
180 |
+
<div class="block">
|
181 |
+
<!--
|
182 |
+
**
|
183 |
+
** General
|
184 |
+
**
|
185 |
+
** product[name]
|
186 |
+
** product[description]
|
187 |
+
** product[short_description]
|
188 |
+
** product[sku]
|
189 |
+
** product[status]
|
190 |
+
** product[visibility]
|
191 |
+
**
|
192 |
+
-->
|
193 |
+
<div class="block-title" id="generaltitle" onclick="showdiv('generaldiv');"><strong>General</strong></div>
|
194 |
+
<div id="generaldiv">
|
195 |
+
<p class="fieldbg"><strong>Name <span style="color:red;">*</span></strong><br />
|
196 |
+
<input type="text" id="product_name" name="product[name]" value="<?php echo @$productEdit['name']; ?>" /></p>
|
197 |
+
|
198 |
+
<p class="fieldbg"><strong>Description <span style="color:red;">*</span></strong><br />
|
199 |
+
<textarea id="product_description" name="product[description]"><?php echo @$productEdit['description']; ?></textarea>
|
200 |
+
</p>
|
201 |
+
|
202 |
+
<p class="fieldbg"><strong>Short description <span style="color:red;">*</span></strong><br />
|
203 |
+
<textarea id="product_short_description" name="product[short_description]"><?php echo @$productEdit['short_description']; ?></textarea></p>
|
204 |
+
|
205 |
+
<p class="fieldbg"><strong>SKU <span style="color:red;">*</span></strong><br />
|
206 |
+
<input type="text" id="product_sku" name="product[sku]" value="<?php echo @$productEdit['sku']; ?>" /></p>
|
207 |
+
|
208 |
+
<p class="fieldbg"><strong>Status <span style="color:red;">*</span></strong><br />
|
209 |
+
<select name="product[status]">
|
210 |
+
<option value="1" <?=(@$productEdit['status']==1?'selected="selected"':'')?>>Enabled</option>
|
211 |
+
<option value="2" <?=(@$productEdit['status']==2?'selected="selected"':'')?>>Disabled</option>
|
212 |
+
</select></p>
|
213 |
+
|
214 |
+
<input type="hidden" name="product[visibility]" value="4" />
|
215 |
+
</div>
|
216 |
+
|
217 |
+
<!--
|
218 |
+
**
|
219 |
+
** Prices
|
220 |
+
**
|
221 |
+
** product[price]
|
222 |
+
**
|
223 |
+
-->
|
224 |
+
<div class="block-title" id="pricetitle" onclick="showdiv('pricediv');"><strong>Prices</strong></div>
|
225 |
+
<div id="pricediv">
|
226 |
+
<p class="fieldbg"><strong>Price <span style="color:red;">*</span> [USD]</strong><br />
|
227 |
+
<input type="text" id="product_price" name="product[price]" value="<?php echo @$price; ?>" /></p>
|
228 |
+
</div>
|
229 |
+
|
230 |
+
|
231 |
+
<!--
|
232 |
+
**
|
233 |
+
** Images
|
234 |
+
**
|
235 |
+
-->
|
236 |
+
<div class="block-title" id="imagetitle" onclick="showdiv('imagediv');"><strong>Images</strong></div>
|
237 |
+
<div id="imagediv">
|
238 |
+
|
239 |
+
<div id="media_gallery_content">
|
240 |
+
<div class="grid">
|
241 |
+
|
242 |
+
<script type="text/javascript">
|
243 |
+
var save = [];
|
244 |
+
</script>
|
245 |
+
|
246 |
+
<table cellspacing="0" width="100%">
|
247 |
+
<col width="70" />
|
248 |
+
<col />
|
249 |
+
<col width="30" />
|
250 |
+
<col width="40" />
|
251 |
+
<col width="40" />
|
252 |
+
<col width="40" />
|
253 |
+
<col width="50" />
|
254 |
+
<col width="50" />
|
255 |
+
<thead>
|
256 |
+
<tr class="headings">
|
257 |
+
<th><?php echo Mage::helper('catalog')->__('Image') ?></th>
|
258 |
+
<th><?php echo Mage::helper('catalog')->__('Label') ?></th>
|
259 |
+
<th><?php echo Mage::helper('catalog')->__('Sort') ?></th>
|
260 |
+
<th><?php echo Mage::helper('catalog')->__('Image') ?></th>
|
261 |
+
<th><?php echo Mage::helper('catalog')->__('Small') ?></th>
|
262 |
+
<th><?php echo Mage::helper('catalog')->__('Thumb') ?></th>
|
263 |
+
<th><?php echo Mage::helper('catalog')->__('Exclude') ?></th>
|
264 |
+
<th class="last"><?php echo Mage::helper('catalog')->__('Remove') ?></th>
|
265 |
+
</tr>
|
266 |
+
</thead>
|
267 |
+
|
268 |
+
|
269 |
+
<tbody id="media_gallery_content_list">
|
270 |
+
|
271 |
+
<tr id="media_gallery_content_template" class="template no-display">
|
272 |
+
<td class="cell-image"><div class="place-holder" onmouseover="media_gallery_contentJsObject.loadImage('__file__')"><span>Roll Over for preview</span></div><img src="<?=Mage::getBaseUrl("web");?>/skin/adminhtml/default/default/images/spacer.gif" width="60" style="display:none;" alt="" /></td>
|
273 |
+
<td class="cell-label"><input type="text" class="input-text" onkeyup="media_gallery_contentJsObject.updateImage('__file__')" onchange="media_gallery_contentJsObject.updateImage('__file__')" /></td>
|
274 |
+
<td class="cell-position"><input type="text" style="width:30px;" class="input-text validate-number" onkeyup="media_gallery_contentJsObject.updateImage('__file__')" onchange="media_gallery_contentJsObject.updateImage('__file__')" /></td>
|
275 |
+
<td class="cell-image a-center"><input type="radio" name="product[image]" onclick="media_gallery_contentJsObject.setProductImages('__file__')" value="__file__" /></td>
|
276 |
+
<td class="cell-small_image a-center"><input type="radio" name="product[small_image]" onclick="media_gallery_contentJsObject.setProductImages('__file__')" value="__file__" /></td>
|
277 |
+
<td class="cell-thumbnail a-center"><input type="radio" name="product[thumbnail]" onclick="media_gallery_contentJsObject.setProductImages('__file__')" value="__file__" /></td>
|
278 |
+
<td class="cell-disable a-center"><input type="checkbox" onclick="media_gallery_contentJsObject.updateImage('__file__')" /></td>
|
279 |
+
<td class="cell-remove a-center last"><input type="checkbox" onclick="media_gallery_contentJsObject.updateImage('__file__')" /></td>
|
280 |
+
</tr>
|
281 |
+
<tr id="media_gallery_content-image-0">
|
282 |
+
<td class="cell-image">No</td>
|
283 |
+
<td class="cell-label"><input type="hidden" /> </td>
|
284 |
+
<td class="cell-position"><input type="hidden" /> </td>
|
285 |
+
<td class="cell-image a-center"><input type="radio" name="product[image]" onclick="media_gallery_contentJsObject.setProductImages('no_selection')" value="no_selection" /></td>
|
286 |
+
<td class="cell-small_image a-center"><input type="radio" name="product[small_image]" onclick="media_gallery_contentJsObject.setProductImages('no_selection')" value="no_selection" /></td>
|
287 |
+
<td class="cell-thumbnail a-center"><input type="radio" name="product[thumbnail]" onclick="media_gallery_contentJsObject.setProductImages('no_selection')" value="no_selection" /></td>
|
288 |
+
<td class="cell-disable"><input type="hidden" /> </td>
|
289 |
+
<td class="cell-remove last"><input type="hidden" /> </td>
|
290 |
+
</tr>
|
291 |
+
|
292 |
+
<?php foreach($productEdit['image'] as $kv){ ?>
|
293 |
+
|
294 |
+
<script type="text/javascript">
|
295 |
+
var save_obj = {
|
296 |
+
"value_id":"<?php echo $kv['value_id']; ?>",
|
297 |
+
"file":"<?php echo $kv['value']; ?>",
|
298 |
+
"label":"<?php echo $kv['label']; ?>",
|
299 |
+
"position":"<?php echo $kv['position']; ?>",
|
300 |
+
"disabled":"<?php echo $kv['disabled']; ?>",
|
301 |
+
"label_default":"<?php echo $kv['label']; ?>",
|
302 |
+
"position_default":"<?php echo $kv['position']; ?>",
|
303 |
+
"disabled_default":"<?php echo $kv['disabled']; ?>",
|
304 |
+
"url":"<?php echo Mage::getBaseUrl('web').'media/catalog/product'.$kv['value']; ?>",
|
305 |
+
"removed":"0"
|
306 |
+
}
|
307 |
+
|
308 |
+
save.push(save_obj);
|
309 |
+
|
310 |
+
</script>
|
311 |
+
|
312 |
+
<? } ?>
|
313 |
+
</tbody>
|
314 |
+
|
315 |
+
|
316 |
+
|
317 |
+
|
318 |
+
<tfoot>
|
319 |
+
<tr>
|
320 |
+
<td colspan="100" class="last" style="padding:8px">
|
321 |
+
<!--
|
322 |
+
**
|
323 |
+
** flex images
|
324 |
+
**
|
325 |
+
-->
|
326 |
+
<div id="id_2ae1264f5c19e1db1580e98f51ec3175_Uploader-flash" class="flex" style="position:relative;float:right;">
|
327 |
+
<embed quality="high" pluginspage="http://www.adobe.com/go/getflashplayer" type="application/x-shockwave-flash" allowscriptaccess="always" left="100" top="300" src="<?php echo Mage::getBaseUrl('web'); ?>skin/adminhtml/default/default/media/uploader.swf" wmode="transparent" name="flexMovieUID1" flashvars="bridgeName=flexMovieUID1bridge" allowfullscreen="true" height="20" width="230">
|
328 |
+
</div>
|
329 |
+
<div id="id_2ae1264f5c19e1db1580e98f51ec3175_Uploader" class="uploader">
|
330 |
+
<div class="buttons">
|
331 |
+
<div id="id_2ae1264f5c19e1db1580e98f51ec3175_Uploader-install-flash" style="display:none">
|
332 |
+
This content requires last version of Adobe Flash Player. <a href="http://www.adobe.com/go/getflash/">Get Flash</a> </div>
|
333 |
+
</div>
|
334 |
+
<div class="clear"></div>
|
335 |
+
<div class="no-display" id="id_2ae1264f5c19e1db1580e98f51ec3175_Uploader-template">
|
336 |
+
<div id="{{id}}" class="file-row">
|
337 |
+
<span class="file-info">{{name}} ({{size}})</span>
|
338 |
+
<span class="delete-button"><button id="{{id}}-delete" title="Remove" type="button" class="scalable delete" onclick="id_2ae1264f5c19e1db1580e98f51ec3175_UploaderJsObject.removeFile('{{fileId}}')" style=""><span><span><span>Remove</span></span></span></button></span>
|
339 |
+
<span class="progress-text"></span>
|
340 |
+
<div class="clear"></div>
|
341 |
+
</div>
|
342 |
+
</div>
|
343 |
+
<div class="no-display" id="id_2ae1264f5c19e1db1580e98f51ec3175_Uploader-template-progress">
|
344 |
+
{{percent}}% {{uploaded}} / {{total}}
|
345 |
+
</div>
|
346 |
+
|
347 |
+
|
348 |
+
</div>
|
349 |
+
|
350 |
+
|
351 |
+
|
352 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/lib/flex.js"></script>
|
353 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/mage/adminhtml/flexuploader.js"></script>
|
354 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/lib/FABridge.js"></script>
|
355 |
+
|
356 |
+
|
357 |
+
|
358 |
+
<script type="text/javascript">
|
359 |
+
//<![CDATA[
|
360 |
+
|
361 |
+
var maxUploadFileSizeInBytes = 10097152;
|
362 |
+
var maxUploadFileSize = '10M';
|
363 |
+
|
364 |
+
id_2ae1264f5c19e1db1580e98f51ec3175_UploaderJsObject = new Flex.Uploader('id_2ae1264f5c19e1db1580e98f51ec3175_Uploader', '<?php echo Mage::getBaseUrl(); ?>skin/adminhtml/default/default/media/uploader.swf', {"url":"<?php echo str_replace('/','\/', Mage::getBaseUrl('link')); ?>product\/index\/upload\/key\/d9c878b694d1a2785b319b0eb0cad41b\/?SID=99gb4uemdf2ihudgiqv4t3igl4","params":{"form_key":"gn0aHDfjLLxXQFGN"},"file_field":"image","filters":{"images":{"label":"Images (.gif, .jpg, .png)","files":["*.gif","*.jpg","*.jpeg","*.png"]}}});
|
365 |
+
|
366 |
+
if (varienGlobalEvents) {
|
367 |
+
varienGlobalEvents.attachEventHandler('tabChangeBefore', id_2ae1264f5c19e1db1580e98f51ec3175_UploaderJsObject.onContainerHideBefore);
|
368 |
+
}
|
369 |
+
|
370 |
+
//]]>
|
371 |
+
</script>
|
372 |
+
|
373 |
+
</td>
|
374 |
+
</tr>
|
375 |
+
</tfoot>
|
376 |
+
</table>
|
377 |
+
|
378 |
+
<!--
|
379 |
+
**
|
380 |
+
** form_key
|
381 |
+
** product[media_gallery][images] ... media_gallery_content_save
|
382 |
+
** product[media_gallery][values] ... media_gallery_content_save_image
|
383 |
+
**
|
384 |
+
-->
|
385 |
+
<input type="hidden" name="form_key" value="gn0aHDfjLLxXQFGN" />
|
386 |
+
<input type="hidden" name="product[media_gallery][images]" id="media_gallery_content_save" value="" />
|
387 |
+
<input type="hidden" name="product[media_gallery][values]" id="media_gallery_content_save_image" value="" />
|
388 |
+
|
389 |
+
</div>
|
390 |
+
</div>
|
391 |
+
|
392 |
+
</div>
|
393 |
+
|
394 |
+
|
395 |
+
<div id="addnewfields">
|
396 |
+
<!--additional fields-->
|
397 |
+
</div>
|
398 |
+
|
399 |
+
<!--
|
400 |
+
**
|
401 |
+
** Downloadable Information
|
402 |
+
**
|
403 |
+
-->
|
404 |
+
<div class="block-title" id="downlodabletitle" onclick="showdiv('downlodablediv');"><strong>Downloadable Information</strong></div>
|
405 |
+
<div id="downlodablediv">
|
406 |
+
|
407 |
+
<!-- downloadable -->
|
408 |
+
<div id="product_info_tabs_downloadable_items_content">
|
409 |
+
<script type="text/javascript">
|
410 |
+
//<![CDATA[>
|
411 |
+
|
412 |
+
var uploaderTemplate = '<div class="no-display" id="[[idName]]-template">' +
|
413 |
+
'<div id="{{id}}" class="file-row file-row-narrow">' +
|
414 |
+
'<span class="file-info">' +
|
415 |
+
'<span class="file-info-name">{{name}}</span>' +
|
416 |
+
' ' +
|
417 |
+
'<span class="file-info-size">({{size}})</span>' +
|
418 |
+
'</span>' +
|
419 |
+
'<span class="progress-text"></span>' +
|
420 |
+
'<div class="clear"></div>' +
|
421 |
+
'</div>' +
|
422 |
+
'</div>' +
|
423 |
+
'<div class="no-display" id="[[idName]]-template-progress">' +
|
424 |
+
'{{percent}}% {{uploaded}} / {{total}}' +
|
425 |
+
'</div>';
|
426 |
+
|
427 |
+
var fileListTemplate = '<span class="file-info">' +
|
428 |
+
'<span class="file-info-name">{{name}}</span>' +
|
429 |
+
' ' +
|
430 |
+
'<span class="file-info-size">({{size}})</span>' +
|
431 |
+
'</span>';
|
432 |
+
|
433 |
+
var Downloadable = {
|
434 |
+
uploaderObj : $H({}),
|
435 |
+
objCount : 0,
|
436 |
+
setUploaderObj : function(type, key, obj){
|
437 |
+
if (!this.uploaderObj.get(type)) {
|
438 |
+
this.uploaderObj.set(type, $H({}));
|
439 |
+
}
|
440 |
+
this.uploaderObj.get(type).set(key, obj);
|
441 |
+
},
|
442 |
+
getUploaderObj : function(type, key){
|
443 |
+
try {
|
444 |
+
return this.uploaderObj.get(type).get(key);
|
445 |
+
} catch (e) {
|
446 |
+
try {
|
447 |
+
console.log(e);
|
448 |
+
} catch (e2) {
|
449 |
+
alert(e.name + '\n' + e.message);
|
450 |
+
}
|
451 |
+
}
|
452 |
+
},
|
453 |
+
unsetUploaderObj : function(type, key){
|
454 |
+
try {
|
455 |
+
this.uploaderObj.get(type).unset(key);
|
456 |
+
} catch (e) {
|
457 |
+
try {
|
458 |
+
console.log(e);
|
459 |
+
} catch (e2) {
|
460 |
+
alert(e.name + '\n' + e.message);
|
461 |
+
}
|
462 |
+
}
|
463 |
+
},
|
464 |
+
massUploadByType : function(type){
|
465 |
+
try {
|
466 |
+
this.uploaderObj.get(type).each(function(item){
|
467 |
+
container = item.value.container.up('tr');
|
468 |
+
if (container.visible() && !container.hasClassName('no-display')) {
|
469 |
+
item.value.upload();
|
470 |
+
} else {
|
471 |
+
Downloadable.unsetUploaderObj(type, item.key);
|
472 |
+
}
|
473 |
+
});
|
474 |
+
} catch (e) {
|
475 |
+
try {
|
476 |
+
console.log(e);
|
477 |
+
} catch (e2) {
|
478 |
+
alert(e.name + '\n' + e.message);
|
479 |
+
}
|
480 |
+
}
|
481 |
+
}
|
482 |
+
};
|
483 |
+
|
484 |
+
Downloadable.FileUploader = Class.create();
|
485 |
+
Downloadable.FileUploader.prototype = {
|
486 |
+
type : null,
|
487 |
+
key : null, //key, identifier of uploader obj
|
488 |
+
elmContainer : null, //insert Flex object and templates to elmContainer
|
489 |
+
fileValueName : null, //name of field of JSON data of saved file
|
490 |
+
fileValue : null,
|
491 |
+
idName : null, //id name of elements for unique uploader
|
492 |
+
uploaderText: uploaderTemplate,
|
493 |
+
uploaderSyntax : /(^|.|\r|\n)(\[\[(\w+)\]\])/,
|
494 |
+
uploaderObj : $H({}),
|
495 |
+
config : null,
|
496 |
+
initialize: function (type, key, elmContainer, fileValueName, fileValue ,idName, config) {
|
497 |
+
this.type = type;
|
498 |
+
this.key = key;
|
499 |
+
this.elmContainer = elmContainer;
|
500 |
+
this.fileValueName = fileValueName;
|
501 |
+
this.fileValue = fileValue;
|
502 |
+
this.idName = idName;
|
503 |
+
this.config = config;
|
504 |
+
uploaderTemplate = new Template(this.uploaderText, this.uploaderSyntax);
|
505 |
+
Element.insert(
|
506 |
+
elmContainer,
|
507 |
+
{'top' : uploaderTemplate.evaluate({
|
508 |
+
'idName' : this.idName,
|
509 |
+
'fileValueName' : this.fileValueName,
|
510 |
+
'uploaderObj' : 'Downloadable.getUploaderObj(\''+this.type+'\', \''+this.key+'\')'
|
511 |
+
})
|
512 |
+
}
|
513 |
+
);
|
514 |
+
if ($(this.idName+'_save')) {
|
515 |
+
$(this.idName+'_save').value = this.fileValue.toJSON
|
516 |
+
? this.fileValue.toJSON()
|
517 |
+
: Object.toJSON(this.fileValue);
|
518 |
+
}
|
519 |
+
Downloadable.setUploaderObj(
|
520 |
+
this.type,
|
521 |
+
this.key,
|
522 |
+
new Flex.Uploader(this.idName, '<?=Mage::getBaseUrl();?>/skin/adminhtml/default/default/media/uploaderSingle.swf', this.config)
|
523 |
+
);
|
524 |
+
if (varienGlobalEvents) {
|
525 |
+
varienGlobalEvents.attachEventHandler('tabChangeBefore', Downloadable.getUploaderObj(type, key).onContainerHideBefore);
|
526 |
+
}
|
527 |
+
new Downloadable.FileList(this.idName, Downloadable.getUploaderObj(type, key));
|
528 |
+
}
|
529 |
+
}
|
530 |
+
|
531 |
+
Downloadable.FileList = Class.create();
|
532 |
+
Downloadable.FileList.prototype = {
|
533 |
+
file: [],
|
534 |
+
containerId: '',
|
535 |
+
container: null,
|
536 |
+
uploader: null,
|
537 |
+
fileListTemplate: fileListTemplate,
|
538 |
+
templatePattern : /(^|.|\r|\n)({{(\w+)}})/,
|
539 |
+
listTemplate : null,
|
540 |
+
initialize: function (containerId, uploader) {
|
541 |
+
this.containerId = containerId,
|
542 |
+
this.container = $(this.containerId);
|
543 |
+
this.uploader = uploader;
|
544 |
+
this.uploader.onFilesComplete = this.handleUploadComplete.bind(this);
|
545 |
+
this.file = this.getElement('save').value.evalJSON();
|
546 |
+
this.listTemplate = new Template(this.fileListTemplate, this.templatePattern);
|
547 |
+
this.updateFiles();
|
548 |
+
this.uploader.onFileRemoveAll = this.handleFileRemoveAll.bind(this);
|
549 |
+
this.uploader.onFileSelect = this.handleFileSelect.bind(this);
|
550 |
+
},
|
551 |
+
handleFileRemoveAll: function(fileId) {
|
552 |
+
$(this.containerId+'-new').hide();
|
553 |
+
$(this.containerId+'-old').show();
|
554 |
+
},
|
555 |
+
handleFileSelect: function() {
|
556 |
+
$(this.containerId+'_type').checked = true;
|
557 |
+
},
|
558 |
+
getElement: function (name) {
|
559 |
+
return $(this.containerId + '_' + name);
|
560 |
+
},
|
561 |
+
handleUploadComplete: function (files) {
|
562 |
+
files.each(function(item) {
|
563 |
+
if (!item.response.isJSON()) {
|
564 |
+
try {
|
565 |
+
console.log(item.response);
|
566 |
+
} catch (e2) {
|
567 |
+
alert(item.response);
|
568 |
+
}
|
569 |
+
return;
|
570 |
+
}
|
571 |
+
var response = item.response.evalJSON();
|
572 |
+
if (response.error) {
|
573 |
+
return;
|
574 |
+
}
|
575 |
+
var newFile = {};
|
576 |
+
newFile.file = response.file;
|
577 |
+
newFile.name = response.name;
|
578 |
+
newFile.size = response.size;
|
579 |
+
newFile.status = 'new';
|
580 |
+
this.file[0] = newFile;
|
581 |
+
this.uploader.removeFile(item.id);
|
582 |
+
}.bind(this));
|
583 |
+
this.updateFiles();
|
584 |
+
},
|
585 |
+
updateFiles: function() {
|
586 |
+
this.getElement('save').value = this.file.toJSON
|
587 |
+
? this.file.toJSON()
|
588 |
+
: Object.toJSON(this.file);
|
589 |
+
this.file.each(function(row){
|
590 |
+
row.size = this.uploader.formatSize(row.size);
|
591 |
+
$(this.containerId + '-old').innerHTML = this.listTemplate.evaluate(row);
|
592 |
+
$(this.containerId + '-new').hide();
|
593 |
+
$(this.containerId + '-old').show();
|
594 |
+
}.bind(this));
|
595 |
+
}
|
596 |
+
}
|
597 |
+
|
598 |
+
var alertAlreadyDisplayed = false;
|
599 |
+
|
600 |
+
Validation.addAllThese([
|
601 |
+
['validate-downloadable-file', 'Please upload a file.', function(v,element) {
|
602 |
+
linkType = element.up(0).down('input[value="file"]');
|
603 |
+
if (linkType.checked && (v == '' || v == '[]')) {
|
604 |
+
newFileContainer = element.up(0).down('div.new-file');
|
605 |
+
if (!alertAlreadyDisplayed && (newFileContainer.empty() || newFileContainer.style.display != 'none')) {
|
606 |
+
alertAlreadyDisplayed = true;
|
607 |
+
alert('There are files that were selected but not uploaded yet. Please upload or remove them first');
|
608 |
+
}
|
609 |
+
return false;
|
610 |
+
}
|
611 |
+
return true;
|
612 |
+
}]
|
613 |
+
]);
|
614 |
+
|
615 |
+
Validation.addAllThese([
|
616 |
+
['validate-downloadable-url', 'Please specify Url.', function(v,element) {
|
617 |
+
linkType = element.up(0).down('input[value="url"]');
|
618 |
+
if (linkType.checked && v == '') {
|
619 |
+
return false;
|
620 |
+
}
|
621 |
+
return true;
|
622 |
+
}]
|
623 |
+
]);
|
624 |
+
//]]>
|
625 |
+
</script>
|
626 |
+
|
627 |
+
<div class="entry-edit">
|
628 |
+
<dl id="tab_content_downloadableInfo" name="tab_content_downloadableInfo" class="accordion">
|
629 |
+
|
630 |
+
<!--
|
631 |
+
**
|
632 |
+
** Samples
|
633 |
+
**
|
634 |
+
-->
|
635 |
+
<dt id="dt-samples" class=""><strong>Samples</strong></dt>
|
636 |
+
<dd id="dd-samples" class="">
|
637 |
+
<div class="fieldset" style="margin:0px; padding:3px;">
|
638 |
+
<table cellspacing="0" class="form-list">
|
639 |
+
<tbody>
|
640 |
+
<tr class="headings">
|
641 |
+
<td class="label"><label for="name">Title</label>
|
642 |
+
</td>
|
643 |
+
<td class="value">
|
644 |
+
<input type="text" class="input-text" name="product[samples_title]" value="<?php echo @$productEdit['samples_title']; ?>" />
|
645 |
+
</td>
|
646 |
+
</tr>
|
647 |
+
</tbody>
|
648 |
+
</table>
|
649 |
+
<br />
|
650 |
+
<div class="grid">
|
651 |
+
<div class="hor-scroll">
|
652 |
+
<table cellspacing="0" class="data border">
|
653 |
+
<col />
|
654 |
+
<col width="1" />
|
655 |
+
<col width="1" />
|
656 |
+
<col width="1" />
|
657 |
+
<thead>
|
658 |
+
<tr class="headings">
|
659 |
+
<th>Title <span class="required">*</span></th>
|
660 |
+
<th><span class="nobr">Sort Order</span></th>
|
661 |
+
<th> </th>
|
662 |
+
</tr>
|
663 |
+
</thead>
|
664 |
+
<tfoot>
|
665 |
+
<tr>
|
666 |
+
<td colspan="4" class="a-right"><button id="add_sample_item" title="Add New Row" type="button" class="scalable add" onclick="" style=""><span><span><span>Add New Row</span></span></span></button> <button title="Upload Files" type="button" class="scalable " onclick="Downloadable.massUploadByType('samples')" style=""><span><span><span>Upload Files</span></span></span></button></td>
|
667 |
+
</tr>
|
668 |
+
</tfoot>
|
669 |
+
<tbody id="sample_items_body">
|
670 |
+
</tbody>
|
671 |
+
</table>
|
672 |
+
</div>
|
673 |
+
</div>
|
674 |
+
</div>
|
675 |
+
<script type="text/javascript">
|
676 |
+
|
677 |
+
function hidesampletr(id){
|
678 |
+
document.getElementById('sampletr1'+id).style.display='none';
|
679 |
+
document.getElementById('sampletr2'+id).style.display='none';
|
680 |
+
}
|
681 |
+
|
682 |
+
//<![CDATA[>
|
683 |
+
var sampleTemplate = '<tr id="sampletr1{{sample_id}}">'+
|
684 |
+
'<td>'+
|
685 |
+
'<input type="hidden" class="__delete__" name="downloadable[sample][{{id}}][is_delete]" value="" />'+
|
686 |
+
'<input type="hidden" name="downloadable[sample][{{id}}][sample_id]" value="{{sample_id}}" />'+
|
687 |
+
'<input type="text" class="required-entry input-text" name="downloadable[sample][{{id}}][title]" value="{{title}}" style="width:380px;" />'+
|
688 |
+
''+
|
689 |
+
'</td>'+
|
690 |
+
'<td class="a-center"><input type="text" name="downloadable[sample][{{id}}][sort_order]" value="{{sort_order}}" class="input-text sort" style="width:50px;" /></td>'+
|
691 |
+
'<td>'+
|
692 |
+
'<button type="button" class="scalable delete icon-btn delete-sample-item" onclick="hidesampletr({{sample_id}});"><span><span><span>Delete</span></span></span></button>'+
|
693 |
+
'</td>'+
|
694 |
+
'</tr><tr id="sampletr2{{sample_id}}">'+
|
695 |
+
'<td colspan="3">'+
|
696 |
+
'<div class="files-wide">'+
|
697 |
+
'<div class="row">'+
|
698 |
+
'<label for="downloadable_sample_{{id}}_file_type"><input type="radio" class="radio validate-one-required-by-name" id="downloadable_sample_{{id}}_file_type" name="downloadable[sample][{{id}}][type]" value="file"{{file_checked}} /> File:</label>'+
|
699 |
+
'<input type="hidden" class="validate-downloadable-file" id="downloadable_sample_{{id}}_file_save" name="downloadable[sample][{{id}}][file]" value="{{file_save}}" />'+
|
700 |
+
'<div id="downloadable_sample_{{id}}_file" class="uploader">'+
|
701 |
+
'<div id="downloadable_sample_{{id}}_file-old" class="file-row-info"></div>'+
|
702 |
+
'<div id="downloadable_sample_{{id}}_file-new" class="file-row-info new-file"></div>'+
|
703 |
+
'<div class="buttons">'+
|
704 |
+
'<div id="downloadable_sample_{{id}}_file-install-flash" style="display:none">'+
|
705 |
+
'This content requires last version of Adobe Flash Player. <a href="http://www.adobe.com/go/getflash/">Get Flash</a>'+
|
706 |
+
'</div>'+
|
707 |
+
'</div>'+
|
708 |
+
'<div class="clear"></div>'+
|
709 |
+
'</div>'+
|
710 |
+
'</div>'+
|
711 |
+
'<div class="row">'+
|
712 |
+
'<label for="downloadable_sample_{{id}}_url_type"><input type="radio" class="radio validate-one-required-by-name" id="downloadable_sample_{{id}}_url_type" name="downloadable[sample][{{id}}][type]" value="url"{{url_checked}} /> URL:</label> <input type="text" class="validate-downloadable-url input-text" name="downloadable[sample][{{id}}][sample_url]" value="{{sample_url}}" style="width:450px;" />'+
|
713 |
+
'</div>'+
|
714 |
+
'<div>'+
|
715 |
+
'<span id="downloadable_sample_{{id}}_container"></span>'+
|
716 |
+
'</div>'+
|
717 |
+
'</div>'+
|
718 |
+
'<br /><hr style="border:1px dashed #999999;" /><br /></td>'+
|
719 |
+
'</tr>';
|
720 |
+
var sampleItems = {
|
721 |
+
tbody : $('sample_items_body'),
|
722 |
+
templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
|
723 |
+
templateText : sampleTemplate,
|
724 |
+
itemCount : 0,
|
725 |
+
add : function(data) {
|
726 |
+
alertAlreadyDisplayed = false;
|
727 |
+
this.template = new Template(this.templateText, this.templateSyntax);
|
728 |
+
|
729 |
+
if(!data.sample_id){
|
730 |
+
data = {};
|
731 |
+
data.sample_type = 'file';
|
732 |
+
data.sample_id = 0;
|
733 |
+
}
|
734 |
+
|
735 |
+
data.id = this.itemCount;
|
736 |
+
|
737 |
+
if (data.sample_type == 'url') {
|
738 |
+
data.url_checked = ' checked="checked"';
|
739 |
+
} else if (data.sample_type == 'file') {
|
740 |
+
data.file_checked = ' checked="checked"';
|
741 |
+
}
|
742 |
+
|
743 |
+
Element.insert(this.tbody, {'bottom':this.template.evaluate(data)});
|
744 |
+
|
745 |
+
scopeTitle = $('downloadable_sample_'+data.id+'_title');
|
746 |
+
if (scopeTitle) {
|
747 |
+
Event.observe(scopeTitle, 'click', function(event){
|
748 |
+
scopeElm = $(Event.findElement(event, 'input'));
|
749 |
+
titleField = scopeElm.up(0).down('input[type="text"]');
|
750 |
+
if (scopeElm.checked == true) {
|
751 |
+
titleField.disabled = true;
|
752 |
+
} else {
|
753 |
+
titleField.disabled = false;
|
754 |
+
}
|
755 |
+
});
|
756 |
+
}
|
757 |
+
if (!data.store_title && scopeTitle) {
|
758 |
+
scopeTitle.up(0).down('input[type="text"]').disabled = true;
|
759 |
+
scopeTitle.checked = true;
|
760 |
+
}
|
761 |
+
|
762 |
+
sampleUrl = $('downloadable_sample_'+data.id+'_url_type');
|
763 |
+
|
764 |
+
if (!data.file_save) {
|
765 |
+
data.file_save = [];
|
766 |
+
}
|
767 |
+
new Downloadable.FileUploader(
|
768 |
+
'samples',
|
769 |
+
data.id,
|
770 |
+
sampleUrl.up('td').down('div.uploader'),
|
771 |
+
'downloadable[sample]['+data.id+']',
|
772 |
+
data.file_save,
|
773 |
+
'downloadable_sample_'+data.id+'_file',
|
774 |
+
{"url":"<?php echo str_replace('/','\/',Mage::getBaseUrl('link')); ?>product\/index\/downloadableupload\/type\/samples\/key\/5f1c87fd0cea69563a4e829ba06b9616\/?SID=16bblj105lu5ir7p2v6arkd3s4","params":{"form_key":"gn0aHDfjLLxXQFGN"},"file_field":"samples","filters":{"all":{"label":"All Files","files":["*.*"]}},"replace_browse_with_remove":true,"width":"32","hide_upload_button":true} );
|
775 |
+
sampleUrl.advaiceContainer = 'downloadable_sample_'+data.id+'_container';
|
776 |
+
sampleFile = $('downloadable_sample_'+data.id+'_file_type');
|
777 |
+
sampleFile.advaiceContainer = 'downloadable_sample_'+data.id+'_container';
|
778 |
+
$('downloadable_sample_'+data.id+'_file_save').advaiceContainer = 'downloadable_sample_'+data.id+'_container';
|
779 |
+
|
780 |
+
this.itemCount++;
|
781 |
+
this.bindRemoveButtons();
|
782 |
+
},
|
783 |
+
remove : function(event){
|
784 |
+
var element = $(Event.findElement(event, 'tr'));
|
785 |
+
alertAlreadyDisplayed = false;
|
786 |
+
if(element){
|
787 |
+
element.down('input[type="hidden"].__delete__').value = '1';
|
788 |
+
element.down('div.flex').remove();
|
789 |
+
element.addClassName('no-display');
|
790 |
+
element.addClassName('ignore-validate');
|
791 |
+
element.hide();
|
792 |
+
}
|
793 |
+
},
|
794 |
+
bindRemoveButtons : function(){
|
795 |
+
var buttons = $$('tbody#sample_items_body .delete-sample-item');
|
796 |
+
for(var i=0;i<buttons.length;i++){
|
797 |
+
if(!$(buttons[i]).binded){
|
798 |
+
$(buttons[i]).binded = true;
|
799 |
+
Event.observe(buttons[i], 'click', this.remove.bind(this));
|
800 |
+
}
|
801 |
+
}
|
802 |
+
}
|
803 |
+
}
|
804 |
+
|
805 |
+
sampleItems.bindRemoveButtons();
|
806 |
+
|
807 |
+
if($('add_sample_item')){
|
808 |
+
Event.observe('add_sample_item', 'click', sampleItems.add.bind(sampleItems));
|
809 |
+
}
|
810 |
+
|
811 |
+
<? if(@$productEdit['sample']){ foreach($productEdit['sample'] as $psl){ ?>
|
812 |
+
|
813 |
+
sampleItems.add({"sample_id":"<?php echo $psl['sample_id']; ?>","title":"<?php echo $psl['title']; ?>","sample_url":<?php echo (isset($psl['sample_url'])?'"'.str_replace('/','\/',$psl['sample_url']).'"':'null'); ?>,"sample_type":"<?php echo $psl['sample_type']; ?>","sort_order":"<?php echo $psl['sort_order']; ?>","file_save":[{"file":"<?php echo str_replace('/','\/',$psl['sample_file']); ?>","name":"<?php echo str_replace('/a/l/','',$psl['sample_file']); ?>","size":<?php echo filesize(Mage_Downloadable_Model_Sample::getBasePath().$psl['sample_file']); ?>,"status":"old"}],"store_title":"<?php echo $psl['title']; ?>"});
|
814 |
+
|
815 |
+
<? }} ?>
|
816 |
+
|
817 |
+
//]]>
|
818 |
+
</script>
|
819 |
+
</dd>
|
820 |
+
|
821 |
+
<!--
|
822 |
+
**
|
823 |
+
** Links
|
824 |
+
**
|
825 |
+
-->
|
826 |
+
<dt id="dt-links" class=" open"><br /><strong>Links</strong></dt><dd id="dd-links" class=" open"><div class="fieldset" style="margin:0px; padding:3px;">
|
827 |
+
<table cellspacing="0" class="form-list">
|
828 |
+
<tbody>
|
829 |
+
<tr class="headings">
|
830 |
+
<td class="label"><label for="name">Title</label>
|
831 |
+
</td>
|
832 |
+
<td class="value">
|
833 |
+
<input type="text" class="input-text" id="downloadable_links_title" name="product[links_title]" value="<?php echo @$productEdit['links_title']; ?>" />
|
834 |
+
</td>
|
835 |
+
</tr>
|
836 |
+
</tbody>
|
837 |
+
</table>
|
838 |
+
|
839 |
+
<input type="hidden" name="product[links_purchased_separately]" id="downloadable_link_purchase_type" value="1" />
|
840 |
+
<br />
|
841 |
+
|
842 |
+
<div class="grid">
|
843 |
+
<div class="hor-scroll">
|
844 |
+
<table cellspacing="0" class="data border">
|
845 |
+
<col width="33%" />
|
846 |
+
<col />
|
847 |
+
<col />
|
848 |
+
<col />
|
849 |
+
<col width="1" />
|
850 |
+
<col width="1" />
|
851 |
+
<col width="1" />
|
852 |
+
<col width="1" />
|
853 |
+
<thead>
|
854 |
+
<tr class="headings">
|
855 |
+
<th>Title <span class="required">*</span></th>
|
856 |
+
<th>Shareable</th>
|
857 |
+
<th><span class="nobr">Downloads</span></th>
|
858 |
+
<th><span class="nobr">Sort</span></th>
|
859 |
+
<th> </th>
|
860 |
+
</tr>
|
861 |
+
</thead>
|
862 |
+
<tfoot>
|
863 |
+
<tr>
|
864 |
+
<td colspan="8" class="a-right"><button id="add_link_item" title="Add New Row" type="button" class="scalable add" onclick="" style=""><span><span><span>Add New Row</span></span></span></button> <button title="Upload Files" type="button" class="scalable " onclick="Downloadable.massUploadByType('links');Downloadable.massUploadByType('linkssample')" style=""><span><span><span>Upload Files</span></span></span></button></td>
|
865 |
+
</tr>
|
866 |
+
</tfoot>
|
867 |
+
<tbody id="link_items_body">
|
868 |
+
</tbody>
|
869 |
+
</table>
|
870 |
+
</div>
|
871 |
+
</div>
|
872 |
+
</div>
|
873 |
+
|
874 |
+
<script type="text/javascript">
|
875 |
+
|
876 |
+
|
877 |
+
function hidelinkstr(id){
|
878 |
+
document.getElementById('linkstr1'+id).style.display='none';
|
879 |
+
document.getElementById('linkstr2'+id).style.display='none';
|
880 |
+
document.getElementById('linkstr3'+id).style.display='none';
|
881 |
+
}
|
882 |
+
|
883 |
+
//<![CDATA[
|
884 |
+
var linkTemplate = '<tr id="linkstr1{{link_id}}">'+
|
885 |
+
'<td>'+
|
886 |
+
'<input type="hidden" class="__delete__" name="downloadable[link][{{id}}][is_delete]" value="" />'+
|
887 |
+
'<input type="hidden" name="downloadable[link][{{id}}][link_id]" value="{{link_id}}" />'+
|
888 |
+
'<input type="text" class="required-entry input-text" name="downloadable[link][{{id}}][title]" value="{{title}}" style="width:250px;" />'+
|
889 |
+
''+
|
890 |
+
'</td>'+
|
891 |
+
'<td class="a-center">'+
|
892 |
+
'<select id="downloadable_link _{{id}}_shareable" name="downloadable[link][{{id}}][is_shareable]">'+
|
893 |
+
'<option value="1">Yes</option>'+
|
894 |
+
'<option value="0">No</option>'+
|
895 |
+
'<option value="2" selected="selected">Use config</option>'+
|
896 |
+
'</select>'+
|
897 |
+
'</td>'+
|
898 |
+
'<input type="hidden" id="downloadable_link_{{id}}_price_value" class="input-text validate-number link-prices" name="downloadable[link][{{id}}][price]" value="0.00" /> ' +
|
899 |
+
'<td><input type="text" id="downloadable_link_{{id}}_downloads" name="downloadable[link][{{id}}][number_of_downloads]" class="input-text downloads" value="{{number_of_downloads}}" style="width:70px;" />'+
|
900 |
+
'<p><input type="checkbox" class="checkbox" id="downloadable_link_{{id}}_is_unlimited" name="downloadable[link][{{id}}][is_unlimited]" value="1" {{is_unlimited}} /> <label>Unlimited</label></p></td>'+
|
901 |
+
'<td class="a-center"><input type="text" name="downloadable[link][{{id}}][sort_order]" value="{{sort_order}}" class="input-text sort" style="width:30px;" /></td>'+
|
902 |
+
'<td>'+
|
903 |
+
'<button id="downloadable_link_{{id}}_delete_button" type="button" class="scalable delete icon-btn delete-link-item" onclick="hidelinkstr({{link_id}});"><span><span><span>Delete</span></span></span></button>'+
|
904 |
+
'</td>'+
|
905 |
+
'</tr><tr id="linkstr2{{link_id}}">'+
|
906 |
+
'<td colspan="6">'+
|
907 |
+
'<div><strong>Sample:</strong></div>'+
|
908 |
+
'<div class="files">'+
|
909 |
+
'<div class="row">'+
|
910 |
+
'<label for="downloadable_link_{{id}}_sample_file_type"><input type="radio" class="radio" id="downloadable_link_{{id}}_sample_file_type" name="downloadable[link][{{id}}][sample][type]" value="file"{{sample_file_checked}} /> File:</label>'+
|
911 |
+
'<input type="hidden" id="downloadable_link_{{id}}_sample_file_save" name="downloadable[link][{{id}}][sample][file]" value="{{sample_file_save}}" />'+
|
912 |
+
'<div id="downloadable_link_{{id}}_sample_file" class="uploader">'+
|
913 |
+
'<div id="downloadable_link_{{id}}_sample_file-old" class="file-row-info"></div>'+
|
914 |
+
'<div id="downloadable_link_{{id}}_sample_file-new" class="file-row-info"></div>'+
|
915 |
+
'<div class="buttons">'+
|
916 |
+
'<div id="downloadable_link_{{id}}_sample_file-install-flash" style="display:none">'+
|
917 |
+
'This content requires last version of Adobe Flash Player. <a href="http://www.adobe.com/go/getflash/">Get Flash</a>'+
|
918 |
+
'</div>'+
|
919 |
+
'</div>'+
|
920 |
+
'<div class="clear"></div>'+
|
921 |
+
'</div>'+
|
922 |
+
'</div>'+
|
923 |
+
'<div class="row">'+
|
924 |
+
'<label for="downloadable_link_{{id}}_sample_url_type"><input type="radio" class="radio" id="downloadable_link_{{id}}_sample_url_type" name="downloadable[link][{{id}}][sample][type]" value="url"{{sample_url_checked}} /> URL:</label><input type="text" class="input-text" name="downloadable[link][{{id}}][sample][url]" value="{{sample_url}}" style="width:450px;" />'+
|
925 |
+
'</div>'+
|
926 |
+
'<div>'+
|
927 |
+
'<span id="downloadable_link_{{id}}_sample_container"></span>'+
|
928 |
+
'</div>'+
|
929 |
+
'</div><br />'+
|
930 |
+
'</td>'+
|
931 |
+
'</tr><tr id="linkstr3{{link_id}}">'+
|
932 |
+
'<td colspan="6">'+
|
933 |
+
'<div><strong>File:</strong></div>'+
|
934 |
+
'<div class="files">'+
|
935 |
+
'<div class="row">'+
|
936 |
+
'<label for="downloadable_link_{{id}}_file_type"><input type="radio" class="radio validate-one-required-by-name" id="downloadable_link_{{id}}_file_type" name="downloadable[link][{{id}}][type]" value="file"{{file_checked}} /> File:</label>'+
|
937 |
+
'<input type="hidden" class="validate-downloadable-file" id="downloadable_link_{{id}}_file_save" name="downloadable[link][{{id}}][file]" value="{{file_save}}" />'+
|
938 |
+
'<div id="downloadable_link_{{id}}_file" class="uploader">'+
|
939 |
+
'<div id="downloadable_link_{{id}}_file-old" class="file-row-info"></div>'+
|
940 |
+
'<div id="downloadable_link_{{id}}_file-new" class="file-row-info new-file"></div>'+
|
941 |
+
'<div class="buttons">'+
|
942 |
+
'<div id="downloadable_link_{{id}}_file-install-flash" style="display:none">'+
|
943 |
+
'This content requires last version of Adobe Flash Player. <a href="http://www.adobe.com/go/getflash/">Get Flash</a>'+
|
944 |
+
'</div>'+
|
945 |
+
'</div>'+
|
946 |
+
'<div class="clear"></div>'+
|
947 |
+
'</div>'+
|
948 |
+
'</div>'+
|
949 |
+
'<div class="row">'+
|
950 |
+
'<label for="downloadable_link_{{id}}_url_type"><input type="radio" class="radio validate-one-required-by-name" id="downloadable_link_{{id}}_url_type" name="downloadable[link][{{id}}][type]" value="url"{{url_checked}} /> URL:</label><input type="text" class="validate-downloadable-url input-text" name="downloadable[link][{{id}}][link_url]" value="{{link_url}}" style="width:450px;" />'+
|
951 |
+
'</div>'+
|
952 |
+
'<div>'+
|
953 |
+
'<span id="downloadable_link_{{id}}_link_container"></span>'+
|
954 |
+
'</div>'+
|
955 |
+
'</div><br /><hr style="border:1px dashed #999999;" /><br />'+
|
956 |
+
'</td>'+
|
957 |
+
'</tr>';
|
958 |
+
|
959 |
+
var linkItems = {
|
960 |
+
tbody : $('link_items_body'),
|
961 |
+
templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
|
962 |
+
templateText : linkTemplate,
|
963 |
+
itemCount : 0,
|
964 |
+
add : function(data) {
|
965 |
+
alertAlreadyDisplayed = false;
|
966 |
+
this.template = new Template(this.templateText, this.templateSyntax);
|
967 |
+
|
968 |
+
if(!data.link_id){
|
969 |
+
data = {};
|
970 |
+
data.link_id = 0;
|
971 |
+
data.link_type = 'file';
|
972 |
+
data.sample_type = 'none';
|
973 |
+
data.number_of_downloads = '0';
|
974 |
+
}
|
975 |
+
|
976 |
+
data.id = this.itemCount;
|
977 |
+
|
978 |
+
if (data.link_type == 'url') {
|
979 |
+
data.url_checked = ' checked="checked"';
|
980 |
+
} else if (data.link_type == 'file') {
|
981 |
+
data.file_checked = ' checked="checked"';
|
982 |
+
}
|
983 |
+
if (data.sample_type == 'url') {
|
984 |
+
data.sample_url_checked = ' checked="checked"';
|
985 |
+
} else if (data.sample_type == 'file') {
|
986 |
+
data.sample_file_checked = ' checked="checked"';
|
987 |
+
}
|
988 |
+
|
989 |
+
Element.insert(this.tbody, {'bottom':this.template.evaluate(data)});
|
990 |
+
|
991 |
+
scopeTitle = $('downloadable_link_'+data.id+'_title');
|
992 |
+
if (scopeTitle) {
|
993 |
+
Event.observe(scopeTitle, 'click', function(event){
|
994 |
+
scopeElm = $(Event.findElement(event, 'input'));
|
995 |
+
titleField = scopeElm.up(0).down('input[type="text"]');
|
996 |
+
if (scopeElm.checked == true) {
|
997 |
+
titleField.disabled = true;
|
998 |
+
} else {
|
999 |
+
titleField.disabled = false;
|
1000 |
+
}
|
1001 |
+
});
|
1002 |
+
}
|
1003 |
+
if (!data.store_title && scopeTitle) {
|
1004 |
+
scopeTitle.up(0).down('input[type="text"]').disabled = true;
|
1005 |
+
scopeTitle.checked = true;
|
1006 |
+
}
|
1007 |
+
|
1008 |
+
scopePrice = $('downloadable_link_'+data.id+'_price');
|
1009 |
+
if (scopePrice) {
|
1010 |
+
Event.observe(scopePrice, 'click', function(event){
|
1011 |
+
scopeElm = $(Event.findElement(event, 'input'));
|
1012 |
+
priceField = scopeElm.up(0).down('input[type="text"]');
|
1013 |
+
if (scopeElm.checked == true) {
|
1014 |
+
priceField.disabled = true;
|
1015 |
+
} else {
|
1016 |
+
priceField.disabled = false;
|
1017 |
+
}
|
1018 |
+
});
|
1019 |
+
}
|
1020 |
+
if (!data.website_price && scopePrice) {
|
1021 |
+
scopePrice.up(0).down('input[type="text"]').disabled = true;
|
1022 |
+
scopePrice.checked = true;
|
1023 |
+
}
|
1024 |
+
downloadsElm = $('downloadable_link_'+data.id+'_downloads');
|
1025 |
+
isUnlimitedElm = $('downloadable_link_'+data.id+'_is_unlimited');
|
1026 |
+
if (data.is_unlimited) {
|
1027 |
+
downloadsElm.disabled = true;
|
1028 |
+
}
|
1029 |
+
Event.observe(isUnlimitedElm, 'click', function(event){
|
1030 |
+
elm = Event.element(event);
|
1031 |
+
elm.up('td').down('input[type="text"].downloads').disabled = elm.checked;
|
1032 |
+
});
|
1033 |
+
|
1034 |
+
if (data.is_shareable) {
|
1035 |
+
options = $('downloadable_link _'+data.id+'_shareable').options;
|
1036 |
+
for (var i=0; i < options.length; i++) {
|
1037 |
+
if (options[i].value == data.is_shareable) {
|
1038 |
+
options[i].selected = true;
|
1039 |
+
}
|
1040 |
+
}
|
1041 |
+
}
|
1042 |
+
|
1043 |
+
sampleUrl = $('downloadable_link_'+data.id+'_sample_url_type');
|
1044 |
+
linkUrl = $('downloadable_link_'+data.id+'_url_type');
|
1045 |
+
|
1046 |
+
if (!data.file_save) {
|
1047 |
+
data.file_save = [];
|
1048 |
+
}
|
1049 |
+
if (!data.sample_file_save) {
|
1050 |
+
data.sample_file_save = [];
|
1051 |
+
}
|
1052 |
+
|
1053 |
+
// link sample file
|
1054 |
+
new Downloadable.FileUploader(
|
1055 |
+
'linkssample',
|
1056 |
+
'linkssample_'+data.id,
|
1057 |
+
sampleUrl.up('td'),
|
1058 |
+
'downloadable[link]['+data.id+'][sample]',
|
1059 |
+
data.sample_file_save,
|
1060 |
+
'downloadable_link_'+data.id+'_sample_file',
|
1061 |
+
{"url":"<?php echo str_replace('/','\/',Mage::getBaseUrl('link')); ?>product\/index\/downloadableupload\/type\/link_samples\/key\/5f1c87fd0cea69563a4e829ba06b9616\/?SID=16bblj105lu5ir7p2v6arkd3s4","params":{"form_key":"gn0aHDfjLLxXQFGN"},"file_field":"link_samples","filters":{"all":{"label":"All Files","files":["*.*"]}},"replace_browse_with_remove":true,"width":"32","hide_upload_button":true} );
|
1062 |
+
// link file
|
1063 |
+
new Downloadable.FileUploader(
|
1064 |
+
'links',
|
1065 |
+
'links_'+data.id,
|
1066 |
+
linkUrl.up('td'),
|
1067 |
+
'downloadable[link]['+data.id+']',
|
1068 |
+
data.file_save,
|
1069 |
+
'downloadable_link_'+data.id+'_file',
|
1070 |
+
{"url":"<?php echo str_replace('/','\/',Mage::getBaseUrl('link')); ?>product\/index\/downloadableupload\/type\/links\/key\/5f1c87fd0cea69563a4e829ba06b9616\/?SID=16bblj105lu5ir7p2v6arkd3s4","params":{"form_key":"gn0aHDfjLLxXQFGN"},"file_field":"links","filters":{"all":{"label":"All Files","files":["*.*"]}},"replace_browse_with_remove":true,"width":"32","hide_upload_button":true} );
|
1071 |
+
|
1072 |
+
linkFile = $('downloadable_link_'+data.id+'_file_type');
|
1073 |
+
linkFile.advaiceContainer = 'downloadable_link_'+data.id+'_link_container';
|
1074 |
+
linkUrl.advaiceContainer = 'downloadable_link_'+data.id+'_link_container';
|
1075 |
+
$('downloadable_link_'+data.id+'_file_save').advaiceContainer = 'downloadable_link_'+data.id+'_link_container';
|
1076 |
+
|
1077 |
+
sampleFile = $('downloadable_link_'+data.id+'_sample_file_type');
|
1078 |
+
|
1079 |
+
this.itemCount++;
|
1080 |
+
this.togglePriceFields();
|
1081 |
+
this.bindRemoveButtons();
|
1082 |
+
},
|
1083 |
+
remove : function(event){
|
1084 |
+
var element = $(Event.findElement(event, 'tr'));
|
1085 |
+
alertAlreadyDisplayed = false;
|
1086 |
+
if(element){
|
1087 |
+
element.down('input[type="hidden"].__delete__').value = '1';
|
1088 |
+
Element.select(element, 'div.flex').each(function(elm){
|
1089 |
+
elm.remove();
|
1090 |
+
});
|
1091 |
+
element.addClassName('no-display');
|
1092 |
+
element.addClassName('ignore-validate');
|
1093 |
+
element.hide();
|
1094 |
+
}
|
1095 |
+
},
|
1096 |
+
bindRemoveButtons : function(){
|
1097 |
+
var buttons = $$('tbody#link_items_body .delete-link-item');
|
1098 |
+
for(var i=0;i<buttons.length;i++){
|
1099 |
+
if(!$(buttons[i]).binded && !$(buttons[i]).hasClassName('disabled')){
|
1100 |
+
$(buttons[i]).binded = true;
|
1101 |
+
Event.observe(buttons[i], 'click', this.remove.bind(this));
|
1102 |
+
}
|
1103 |
+
}
|
1104 |
+
},
|
1105 |
+
togglePriceFields : function(){
|
1106 |
+
var toogleTo = $('downloadable_link_purchase_type').value;
|
1107 |
+
var disableFlag = true;
|
1108 |
+
if (toogleTo == '1') {
|
1109 |
+
disableFlag = false;
|
1110 |
+
}
|
1111 |
+
$$('.link-prices[type="text"]').each(function(elm){
|
1112 |
+
var flag = disableFlag;
|
1113 |
+
if (elm.hasClassName('disabled')) {
|
1114 |
+
flag = true;
|
1115 |
+
}
|
1116 |
+
elm.disabled = flag;
|
1117 |
+
});
|
1118 |
+
}
|
1119 |
+
}
|
1120 |
+
|
1121 |
+
linkItems.bindRemoveButtons();
|
1122 |
+
|
1123 |
+
if ($('downloadable_link_purchase_type')) {
|
1124 |
+
Event.observe('downloadable_link_purchase_type', 'change', linkItems.togglePriceFields.bind());
|
1125 |
+
}
|
1126 |
+
|
1127 |
+
if($('add_link_item')) {
|
1128 |
+
Event.observe('add_link_item', 'click', linkItems.add.bind(linkItems));
|
1129 |
+
}
|
1130 |
+
|
1131 |
+
|
1132 |
+
<? if(@$productEdit['links']){ foreach($productEdit['links'] as $pls){ ?>
|
1133 |
+
|
1134 |
+
linkItems.add({"link_id":"<?php echo $pls['link_id']; ?>","title":"<?php echo $pls['title']; ?>","price":"0.00","number_of_downloads":"<?php echo $pls['number_of_downloads']; ?>","is_shareable":"<?php echo $pls['is_shareable']; ?>","link_url":<?php echo (isset($pls['link_url'])?'"'.str_replace('/','\/',$pls['link_url']).'"':'null'); ?>,"link_type":"<?php echo $pls['link_type']; ?>","sample_file":<?php echo (isset($pls['sample_file'])?'"'.str_replace('/','\/',$pls['sample_file']).'"':'null'); ?>,"sample_url":<?php echo (isset($pls['sample_url'])?'"'.str_replace('/','\/',$pls['sample_url']).'"':'null'); ?>,"sample_type":<?php echo (isset($pls['sample_type'])?'"'.$pls['sample_type'].'"':'null'); ?>,"sort_order":"<?php echo $pls['sort_order']; ?>","file_save":[{"file":"<?php echo str_replace('/','\/',$pls['link_file']); ?>","name":"<a href=\"<?php echo str_replace('/','\/',Mage::getBaseUrl('link')); ?>product\/index\/link\/id\/<?php echo $pls['link_id']; ?>\/key\/4d47168280e41d1930f20275b43842dc\/\"><?php echo str_replace('/a/l/','',$pls['link_file']); ?><\/a>","size":<?php echo filesize(Mage_Downloadable_Model_Link::getBasePath().$pls['link_file']); ?>,"status":"old"}],"sample_file_save":[{"file":"<?php echo str_replace('/','\/',$pls['sample_file']); ?>","name":"<?php echo str_replace('/a/l/','',$pls['sample_file']); ?>","size":<?php echo filesize(Mage_Downloadable_Model_Link::getBaseSamplePath().$pls['sample_file']); ?>,"status":"old"}],"is_unlimited":" checked=\"checked\""});
|
1135 |
+
|
1136 |
+
<? }} ?>
|
1137 |
+
|
1138 |
+
Validation.addAllThese([
|
1139 |
+
['validate-downloadable-link-sample-file', 'Please specify File.', function(v,element) {
|
1140 |
+
fileSaveElm = element.up('div').next('input[type="hidden"]');
|
1141 |
+
if (element.checked && (fileSaveElm.value == '' || fileSaveElm.value == '[]')) {
|
1142 |
+
return false;
|
1143 |
+
}
|
1144 |
+
return true;
|
1145 |
+
}]
|
1146 |
+
]);
|
1147 |
+
Validation.addAllThese([
|
1148 |
+
['validate-downloadable-link-sample-url', 'Please specify Sample URL.', function(v,element) {
|
1149 |
+
if (element.checked && element.up('p').down('input[type="text"]').value == '') {
|
1150 |
+
return false;
|
1151 |
+
}
|
1152 |
+
return true;
|
1153 |
+
}]
|
1154 |
+
]);
|
1155 |
+
//]]>
|
1156 |
+
</script>
|
1157 |
+
</dd></dl>
|
1158 |
+
<script type="text/javascript">
|
1159 |
+
tab_content_downloadableInfoAccordionJs = new varienAccordion('tab_content_downloadableInfo', '');
|
1160 |
+
</script>
|
1161 |
+
</div>
|
1162 |
+
<div style="display:none">
|
1163 |
+
<div id="custom-advice-container"></div>
|
1164 |
+
</div>
|
1165 |
+
<!--
|
1166 |
+
<div><input type="hidden" name="affect_downloadable_information" value="1" /></div>
|
1167 |
+
-->
|
1168 |
+
</div>
|
1169 |
+
<!-- downloadable -->
|
1170 |
+
|
1171 |
+
</div>
|
1172 |
+
|
1173 |
+
|
1174 |
+
<p> </p>
|
1175 |
+
|
1176 |
+
|
1177 |
+
|
1178 |
+
<!--
|
1179 |
+
**
|
1180 |
+
** hidden
|
1181 |
+
**
|
1182 |
+
-->
|
1183 |
+
<input type="hidden" name="product[tax_class_id]" value="0" />
|
1184 |
+
<input type="hidden" name="product[custom_design]" value="" />
|
1185 |
+
<input type="hidden" name="product[page_layout]" value="one_column" />
|
1186 |
+
<input type="hidden" name="product[options_container]" value="container2" />
|
1187 |
+
|
1188 |
+
<input type="hidden" name="product[use_config_gift_message_available]" value="1" />
|
1189 |
+
<input type="hidden" name="product[stock_data][use_config_min_sale_qty]" value="1" />
|
1190 |
+
<input type="hidden" name="product[stock_data][use_config_manage_stock]" value="1" />
|
1191 |
+
<input type="hidden" name="product[stock_data][use_config_max_sale_qty]" value="1" />
|
1192 |
+
<input type="hidden" name="product[stock_data][use_config_notify_stock_qty]" value="1" />
|
1193 |
+
<input type="hidden" name="product[stock_data][use_config_enable_qty_increments]" value="1" />
|
1194 |
+
<input type="hidden" name="product[website_ids][]" value="1" />
|
1195 |
+
|
1196 |
+
|
1197 |
+
<input type="hidden" value="<?php echo @$category_id_hidden; ?>" name="category_ids" id="category_ids">
|
1198 |
+
|
1199 |
+
<?php if($productEdit){ ?>
|
1200 |
+
<input type="hidden" value="<?php echo @$productEdit['entity_id']; ?>" name="id">
|
1201 |
+
<?php } ?>
|
1202 |
+
|
1203 |
+
<p align="center">
|
1204 |
+
<button class="button" id="showcaseformsavebutton" onclick="showcaseformpresubmit(); return false;" type="button" title="Save"><span>Save</span></button>
|
1205 |
+
</p>
|
1206 |
+
|
1207 |
+
</div>
|
1208 |
+
|
1209 |
+
</td></tr></table>
|
1210 |
+
</form>
|
1211 |
+
|
1212 |
+
</div>
|
1213 |
+
|
1214 |
+
|
1215 |
+
|
1216 |
+
<!--
|
1217 |
+
**
|
1218 |
+
** Javascript
|
1219 |
+
**
|
1220 |
+
-->
|
1221 |
+
<script type="text/javascript">
|
1222 |
+
|
1223 |
+
function showcaseformpresubmit(){
|
1224 |
+
var err = 0;
|
1225 |
+
if(document.getElementById('product_name').value==''){ err = 1; }else
|
1226 |
+
if(document.getElementById('product_description').value==''){ err = 2; }else
|
1227 |
+
if(document.getElementById('product_short_description').value==''){ err = 3; }else
|
1228 |
+
if(document.getElementById('product_sku').value==''){ err = 4; }else
|
1229 |
+
if(document.getElementById('product_price').value==''){ err = 5; }
|
1230 |
+
|
1231 |
+
if(err){
|
1232 |
+
switch(err){
|
1233 |
+
case 1:
|
1234 |
+
alert("Name field is not set");
|
1235 |
+
break;
|
1236 |
+
case 2:
|
1237 |
+
alert("Description field is not set");
|
1238 |
+
break;
|
1239 |
+
case 3:
|
1240 |
+
alert("Short description field is not set");
|
1241 |
+
break;
|
1242 |
+
case 4:
|
1243 |
+
alert("SKU field is not set");
|
1244 |
+
break;
|
1245 |
+
case 5:
|
1246 |
+
alert("Price field is not set");
|
1247 |
+
break;
|
1248 |
+
default:
|
1249 |
+
alert("Javascript Error");
|
1250 |
+
break;
|
1251 |
+
}
|
1252 |
+
err = 0;
|
1253 |
+
return false;
|
1254 |
+
}else{
|
1255 |
+
document.forms['showcaseform'].submit();
|
1256 |
+
}
|
1257 |
+
}
|
1258 |
+
|
1259 |
+
/*
|
1260 |
+
**
|
1261 |
+
** for my additional attributes ... Ajax
|
1262 |
+
**
|
1263 |
+
*/
|
1264 |
+
|
1265 |
+
function getSetSelectAttribute(){
|
1266 |
+
var FORM_KEY = 'gn0aHDfjLLxXQFGN';
|
1267 |
+
var mydiv = document.getElementById('addnewfields');
|
1268 |
+
mydiv.innerHTML = "";
|
1269 |
+
|
1270 |
+
new Ajax.Request('<?=Mage::getBaseUrl("link");?>product/index/additionalfields', {
|
1271 |
+
method:'get',
|
1272 |
+
parameters: {setp: document.getElementById("set").value, entid: <?php echo (@$productEdit['entity_id']>0?@$productEdit['entity_id']:0); ?>, form_key: FORM_KEY},
|
1273 |
+
onSuccess: function(transport) {
|
1274 |
+
var response = transport.responseText || "no response text";
|
1275 |
+
//alert("Success! \n\n" + response);
|
1276 |
+
var obja = JSON.parse(response);
|
1277 |
+
for(var jr=0; jr<obja.attributes.length; jr++){
|
1278 |
+
if(obja.attributes[jr].attribute_id.length>0){
|
1279 |
+
var newdiv = document.createElement('div');
|
1280 |
+
newdiv.setAttribute('class','block-title');
|
1281 |
+
newdiv.setAttribute('id','af-title'+obja.attributes[jr].group_id);
|
1282 |
+
newdiv.setAttribute('onclick',"showdiv('af-div"+obja.attributes[jr].group_id+"');");
|
1283 |
+
var newstrong = document.createElement('strong');
|
1284 |
+
var newtext=document.createTextNode(obja.attributes[jr].group_name);
|
1285 |
+
mydiv.appendChild(newdiv);
|
1286 |
+
newdiv.appendChild(newstrong);
|
1287 |
+
newstrong.appendChild(newtext);
|
1288 |
+
|
1289 |
+
var newdiv2 = document.createElement('div');
|
1290 |
+
newdiv2.setAttribute('id','af-div'+obja.attributes[jr].group_id);
|
1291 |
+
mydiv.appendChild(newdiv2);
|
1292 |
+
for(var rt=0; rt<obja.attributes[jr].attribute_id.length;rt++){
|
1293 |
+
var newp = document.createElement('p');
|
1294 |
+
var newstrong2 = document.createElement('strong');
|
1295 |
+
newdiv2.appendChild(newp);
|
1296 |
+
newp.appendChild(newstrong2);
|
1297 |
+
var newtext2=document.createTextNode(obja.attributes[jr].attribute_id[rt].label);
|
1298 |
+
newstrong2.appendChild(newtext2);
|
1299 |
+
if(obja.attributes[jr].attribute_id[rt].type=="text" && obja.attributes[jr].attribute_id[rt].input=="textarea"){
|
1300 |
+
var newstextarea = document.createElement('textarea');
|
1301 |
+
newstextarea.setAttribute('name','product['+obja.attributes[jr].attribute_id[rt].code+']');
|
1302 |
+
newdiv2.appendChild(newstextarea);
|
1303 |
+
var newtext3=document.createTextNode(obja.attributes[jr].attribute_id[rt].value);
|
1304 |
+
newstextarea.appendChild(newtext3);
|
1305 |
+
}
|
1306 |
+
if(obja.attributes[jr].attribute_id[rt].type=="varchar" && obja.attributes[jr].attribute_id[rt].input=="text"){
|
1307 |
+
var newstextarea = document.createElement('input');
|
1308 |
+
newstextarea.setAttribute('type','text');
|
1309 |
+
newstextarea.setAttribute('name','product['+obja.attributes[jr].attribute_id[rt].code+']');
|
1310 |
+
newstextarea.setAttribute('value',obja.attributes[jr].attribute_id[rt].value);
|
1311 |
+
newdiv2.appendChild(newstextarea);
|
1312 |
+
}
|
1313 |
+
if(obja.attributes[jr].attribute_id[rt].type=="int" && obja.attributes[jr].attribute_id[rt].input=="boolean"){
|
1314 |
+
var newsboolean = document.createElement('select');
|
1315 |
+
newsboolean.setAttribute('id',obja.attributes[jr].attribute_id[rt].code);
|
1316 |
+
newsboolean.setAttribute('name','product['+obja.attributes[jr].attribute_id[rt].code+']');
|
1317 |
+
newdiv2.appendChild(newsboolean);
|
1318 |
+
for(var ib=0; ib<2; ib++){
|
1319 |
+
var newsoption = document.createElement('option');
|
1320 |
+
newsoption.setAttribute('value',ib);
|
1321 |
+
if(obja.attributes[jr].attribute_id[rt].value==ib){
|
1322 |
+
newsoption.setAttribute('selected','selected');
|
1323 |
+
}
|
1324 |
+
newsboolean.appendChild(newsoption);
|
1325 |
+
if(ib==0){
|
1326 |
+
var newsoptiontext=document.createTextNode("No");
|
1327 |
+
}else{
|
1328 |
+
var newsoptiontext=document.createTextNode("Yes");
|
1329 |
+
}
|
1330 |
+
newsoption.appendChild(newsoptiontext);
|
1331 |
+
}
|
1332 |
+
}
|
1333 |
+
|
1334 |
+
}
|
1335 |
+
|
1336 |
+
var newstyle = document.createElement('style');
|
1337 |
+
var newtextstyle=document.createTextNode("#af-div"+obja.attributes[jr].group_id+" { display:none; } #af-div"+obja.attributes[jr].group_id+" p{ margin:0px; } #af-div"+obja.attributes[jr].group_id+" textarea, #af-div"+obja.attributes[jr].group_id+" input{ width:98%; }");
|
1338 |
+
mydiv.appendChild(newstyle);
|
1339 |
+
newstyle.appendChild(newtextstyle);
|
1340 |
+
}
|
1341 |
+
}
|
1342 |
+
},
|
1343 |
+
onFailure: function() { alert('Javascript Error'); }
|
1344 |
+
});
|
1345 |
+
|
1346 |
+
//alert(document.getElementById("set").value);
|
1347 |
+
}
|
1348 |
+
|
1349 |
+
getSetSelectAttribute();
|
1350 |
+
|
1351 |
+
/*
|
1352 |
+
**
|
1353 |
+
** for blocks ... show/hide
|
1354 |
+
**
|
1355 |
+
*/
|
1356 |
+
|
1357 |
+
function showdiv(id){
|
1358 |
+
var dform = document.getElementById(id).style.display;
|
1359 |
+
if(dform){
|
1360 |
+
if(dform=='none'){
|
1361 |
+
document.getElementById(id).style.display='block';
|
1362 |
+
}else{
|
1363 |
+
document.getElementById(id).style.display='none';
|
1364 |
+
}
|
1365 |
+
}else{
|
1366 |
+
document.getElementById(id).style.display='block';
|
1367 |
+
}
|
1368 |
+
}
|
1369 |
+
|
1370 |
+
|
1371 |
+
/*
|
1372 |
+
**
|
1373 |
+
** for set json images block
|
1374 |
+
**
|
1375 |
+
*/
|
1376 |
+
|
1377 |
+
function setArrSave(){
|
1378 |
+
//alert(save.length + ' --- ' + save[1].url);
|
1379 |
+
var arr_save = '[';
|
1380 |
+
|
1381 |
+
for(var i=0; i<save.length; i++){
|
1382 |
+
save[i].toString = function() {
|
1383 |
+
return '{"value_id":"' + this.value_id + '", "file":"' + this.file + '", "label":"' + this.label + '", "position":"' + this.position + '", "disabled":"' + this.disabled + '", "label_default":"' + this.label_default + '", "position_default":"' + this.position_default + '", "disabled_default":"' + this.disabled_default + '", "url":"' + this.url + '", "removed":"' + this.removed + '"}';
|
1384 |
+
}
|
1385 |
+
|
1386 |
+
if(i>0){
|
1387 |
+
arr_save += ',' + save[i].toString();
|
1388 |
+
}else{
|
1389 |
+
arr_save += save[i].toString();
|
1390 |
+
}
|
1391 |
+
}
|
1392 |
+
|
1393 |
+
arr_save += ']';
|
1394 |
+
|
1395 |
+
return arr_save;
|
1396 |
+
}
|
1397 |
+
|
1398 |
+
document.getElementById('media_gallery_content_save').value = setArrSave();
|
1399 |
+
|
1400 |
+
|
1401 |
+
/*
|
1402 |
+
**
|
1403 |
+
** for Exclude
|
1404 |
+
**
|
1405 |
+
*/
|
1406 |
+
function changeExclude(value_id){
|
1407 |
+
|
1408 |
+
for(var i=0; i<save.length; i++){
|
1409 |
+
|
1410 |
+
if(save[i].value_id==value_id){
|
1411 |
+
if(save[i].disabled=="0"){
|
1412 |
+
save[i].disabled="1";
|
1413 |
+
}else{
|
1414 |
+
save[i].disabled="0";
|
1415 |
+
}
|
1416 |
+
}
|
1417 |
+
|
1418 |
+
}
|
1419 |
+
|
1420 |
+
document.getElementById('media_gallery_content_save').value = setArrSave();
|
1421 |
+
|
1422 |
+
}
|
1423 |
+
|
1424 |
+
/*
|
1425 |
+
**
|
1426 |
+
** for Remove
|
1427 |
+
**
|
1428 |
+
*/
|
1429 |
+
function changeRemove(value_id){
|
1430 |
+
|
1431 |
+
for(var i=0; i<save.length; i++){
|
1432 |
+
|
1433 |
+
if(save[i].value_id==value_id){
|
1434 |
+
if(save[i].removed=="0"){
|
1435 |
+
save[i].removed="1";
|
1436 |
+
}else{
|
1437 |
+
save[i].removed="0";
|
1438 |
+
}
|
1439 |
+
}
|
1440 |
+
|
1441 |
+
}
|
1442 |
+
|
1443 |
+
document.getElementById('media_gallery_content_save').value = setArrSave();
|
1444 |
+
|
1445 |
+
}
|
1446 |
+
|
1447 |
+
/*
|
1448 |
+
**
|
1449 |
+
** for Position
|
1450 |
+
**
|
1451 |
+
*/
|
1452 |
+
function changePosition(value_id){
|
1453 |
+
|
1454 |
+
for(var i=0; i<save.length; i++){
|
1455 |
+
|
1456 |
+
if(save[i].value_id==value_id){
|
1457 |
+
save[i].position=document.getElementById('position_' + value_id).value;
|
1458 |
+
}
|
1459 |
+
|
1460 |
+
}
|
1461 |
+
|
1462 |
+
document.getElementById('media_gallery_content_save').value = setArrSave();
|
1463 |
+
|
1464 |
+
}
|
1465 |
+
|
1466 |
+
/*
|
1467 |
+
**
|
1468 |
+
** for Label
|
1469 |
+
**
|
1470 |
+
*/
|
1471 |
+
function changeLabel(value_id){
|
1472 |
+
|
1473 |
+
for(var i=0; i<save.length; i++){
|
1474 |
+
|
1475 |
+
if(save[i].value_id==value_id){
|
1476 |
+
save[i].label=document.getElementById('label_' + value_id).value;
|
1477 |
+
}
|
1478 |
+
|
1479 |
+
}
|
1480 |
+
|
1481 |
+
document.getElementById('media_gallery_content_save').value = setArrSave();
|
1482 |
+
|
1483 |
+
}
|
1484 |
+
|
1485 |
+
|
1486 |
+
|
1487 |
+
/*
|
1488 |
+
**
|
1489 |
+
** for json images
|
1490 |
+
**
|
1491 |
+
*/
|
1492 |
+
|
1493 |
+
var save_image = {
|
1494 |
+
"image":"<?php echo $productEdit['image_radio']; ?>",
|
1495 |
+
"small_image":"<?php echo $productEdit['small_image_radio']; ?>",
|
1496 |
+
"thumbnail":"<?php echo $productEdit['thumb_image_radio']; ?>"
|
1497 |
+
};
|
1498 |
+
|
1499 |
+
save_image.toString = function() {
|
1500 |
+
return '{"image":"' + this.image.replace(/\//g,"\\\/") + '", "small_image":"' + this.small_image.replace(/\//g,"\\\/") + '", "thumbnail":"' + this.thumbnail.replace(/\//g,"\\\/") + '"}';
|
1501 |
+
}
|
1502 |
+
|
1503 |
+
document.getElementById('media_gallery_content_save_image').value = save_image.toString();
|
1504 |
+
|
1505 |
+
function setImageProduct(alias){
|
1506 |
+
//alert(alias);
|
1507 |
+
save_image.image = alias;
|
1508 |
+
document.getElementById('media_gallery_content_save_image').value = save_image.toString();
|
1509 |
+
}
|
1510 |
+
|
1511 |
+
function setSmallImageProduct(alias){
|
1512 |
+
//alert(alias);
|
1513 |
+
save_image.small_image = alias;
|
1514 |
+
document.getElementById('media_gallery_content_save_image').value = save_image.toString();
|
1515 |
+
}
|
1516 |
+
|
1517 |
+
function setThumbnailProduct(alias){
|
1518 |
+
//alert(alias);
|
1519 |
+
save_image.thumbnail = alias;
|
1520 |
+
document.getElementById('media_gallery_content_save_image').value = save_image.toString();
|
1521 |
+
}
|
1522 |
+
|
1523 |
+
|
1524 |
+
|
1525 |
+
|
1526 |
+
/*
|
1527 |
+
**
|
1528 |
+
** for category check
|
1529 |
+
**
|
1530 |
+
*/
|
1531 |
+
function categorytree(id){
|
1532 |
+
var t = ","+id;
|
1533 |
+
var c = document.getElementById("category_ids").value;
|
1534 |
+
var pos = c.indexOf(t);
|
1535 |
+
if(document.getElementById("checkcat"+id).checked==true){
|
1536 |
+
if( pos == -1 ){
|
1537 |
+
c += t;
|
1538 |
+
}
|
1539 |
+
}else{
|
1540 |
+
c = c.replace(t,"");
|
1541 |
+
}
|
1542 |
+
document.getElementById("category_ids").value = c;
|
1543 |
+
}
|
1544 |
+
|
1545 |
+
/*
|
1546 |
+
**
|
1547 |
+
** for confirm delete
|
1548 |
+
**
|
1549 |
+
*/
|
1550 |
+
function sureDelete(id){
|
1551 |
+
if (confirm("The record will be deleted. Are you sure?")) {
|
1552 |
+
location = "<?=Mage::getBaseUrl('link');?>product/index/delete?p=" + id;
|
1553 |
+
}
|
1554 |
+
}
|
1555 |
+
|
1556 |
+
/*
|
1557 |
+
**
|
1558 |
+
** for new product
|
1559 |
+
**
|
1560 |
+
*/
|
1561 |
+
function newproduct(){
|
1562 |
+
location.href='<?=Mage::getBaseUrl("link");?>product';
|
1563 |
+
}
|
1564 |
+
|
1565 |
+
</script>
|
1566 |
+
|
1567 |
+
<!--
|
1568 |
+
**
|
1569 |
+
** for block images ... read gallery
|
1570 |
+
**
|
1571 |
+
-->
|
1572 |
+
<script type="text/javascript">
|
1573 |
+
//<![CDATA[
|
1574 |
+
var media_gallery_contentJsObject = new Product.Gallery('media_gallery_content', id_2ae1264f5c19e1db1580e98f51ec3175_UploaderJsObject, {"image":{"label":"Base Image ","field":"product[image]"},"small_image":{"label":"Small Image ","field":"product[small_image]"},"thumbnail":{"label":"Thumbnail ","field":"product[thumbnail]"}});
|
1575 |
+
|
1576 |
+
//setInterval(function(){
|
1577 |
+
// console.log("JSON : %1", media_gallery_contentJsObject.images.url);
|
1578 |
+
//}, 5000);
|
1579 |
+
//]]>
|
1580 |
+
</script>
|
1581 |
+
|
1582 |
+
|
1583 |
+
<style type="text/css">
|
1584 |
+
.total{
|
1585 |
+
font-size:18px;
|
1586 |
+
}
|
1587 |
+
|
1588 |
+
#generaldiv, #pricediv, #imagediv, #additionalfieldsdiv, #downlodablediv{
|
1589 |
+
display:none;
|
1590 |
+
}
|
1591 |
+
|
1592 |
+
.headings th{
|
1593 |
+
border:1px solid #dddddd;
|
1594 |
+
padding:2px;
|
1595 |
+
font-weight:bold;
|
1596 |
+
}
|
1597 |
+
.headings td{
|
1598 |
+
border:1px solid #dddddd;
|
1599 |
+
padding:2px;
|
1600 |
+
}
|
1601 |
+
.showcase_attribute{
|
1602 |
+
width:160px;
|
1603 |
+
float:left;
|
1604 |
+
border:1px solid #dddddd;
|
1605 |
+
padding:5px;
|
1606 |
+
background-color:#ffffff;
|
1607 |
+
}
|
1608 |
+
.showcase_menu{
|
1609 |
+
width:150px;
|
1610 |
+
position:relative;
|
1611 |
+
float:right;
|
1612 |
+
padding:5px;
|
1613 |
+
overflow-x:scroll;
|
1614 |
+
background-color:#ffffff;
|
1615 |
+
margin:10px 0 0 0;
|
1616 |
+
}
|
1617 |
+
.showcase_menu ul{
|
1618 |
+
width:250px;
|
1619 |
+
}
|
1620 |
+
.showcase_menu ul li ul, .showcase_menu ul li ul li ul, .showcase_menu ul li ul li ul li ul{
|
1621 |
+
padding-left:10px;
|
1622 |
+
}
|
1623 |
+
.generalblock{
|
1624 |
+
border:1px solid #dddddd;
|
1625 |
+
}
|
1626 |
+
.titlebg{
|
1627 |
+
background-color:#E26703;
|
1628 |
+
color:#ffffff;
|
1629 |
+
margin:0px;
|
1630 |
+
padding:0px 0px 0px 5px;
|
1631 |
+
border:1px solid #fff;
|
1632 |
+
cursor:pointer;
|
1633 |
+
}
|
1634 |
+
.block-title{
|
1635 |
+
cursor:pointer;
|
1636 |
+
}
|
1637 |
+
.fieldbg{
|
1638 |
+
padding:0px 0px 10px 5px;
|
1639 |
+
margin:0px;
|
1640 |
+
}
|
1641 |
+
.fieldbg input, .fieldbg textarea{
|
1642 |
+
width:98%;
|
1643 |
+
}
|
1644 |
+
|
1645 |
+
|
1646 |
+
.request_table td, .request_table th{
|
1647 |
+
padding:3px;
|
1648 |
+
}
|
1649 |
+
.request_table th{
|
1650 |
+
font-weight:bold;
|
1651 |
+
border-bottom:1px solid #dddddd;
|
1652 |
+
}
|
1653 |
+
.request_table td{
|
1654 |
+
border-bottom:1px solid #dddddd;
|
1655 |
+
}
|
1656 |
+
.request_table table{
|
1657 |
+
width:100%;
|
1658 |
+
}
|
1659 |
+
.request_new{
|
1660 |
+
color:#ff0000;
|
1661 |
+
}
|
1662 |
+
.clicktagtr{
|
1663 |
+
cursor:pointer;
|
1664 |
+
}
|
1665 |
+
</style>
|
app/design/frontend/base/default/template/product/statistica.phtml
ADDED
@@ -0,0 +1,259 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div>
|
2 |
+
<h2><?php echo $this->__('My Statistica') ?></h2>
|
3 |
+
</div>
|
4 |
+
|
5 |
+
<?php
|
6 |
+
|
7 |
+
$resultRequest = $this->productListStatistica();
|
8 |
+
|
9 |
+
?>
|
10 |
+
|
11 |
+
<p> </p>
|
12 |
+
<form action="" method="post" name="filterdateform" id="filter_form">
|
13 |
+
<div class="field">
|
14 |
+
<div class="input-box">
|
15 |
+
<table border="0"><tr>
|
16 |
+
<td width="100" colspan="2">
|
17 |
+
|
18 |
+
<label for="dob"><strong><?php echo Mage::helper('contacts')->__('Date filter') ?></strong></label>
|
19 |
+
|
20 |
+
</td>
|
21 |
+
</tr>
|
22 |
+
<tr>
|
23 |
+
<td style="text-align:right;">
|
24 |
+
From:
|
25 |
+
</td>
|
26 |
+
<td width="250">
|
27 |
+
<input name="_dob" id="_dob" value="<?php echo $resultRequest[0]['filter_from']?>" type="text">
|
28 |
+
<img title="Select date" id="_dob_trig" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/grid-cal.gif'; ?>" class="v-middle">
|
29 |
+
|
30 |
+
</td>
|
31 |
+
</tr>
|
32 |
+
<tr>
|
33 |
+
<td style="text-align:right;">
|
34 |
+
To:
|
35 |
+
</td>
|
36 |
+
<td width="250">
|
37 |
+
<input name="_dobto" id="_dobto" value="<?php echo $resultRequest[0]['filter_to']?>" type="text">
|
38 |
+
<img title="Select date" id="_dobto_trig" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/grid-cal.gif'; ?>" class="v-middle">
|
39 |
+
|
40 |
+
</td>
|
41 |
+
</tr>
|
42 |
+
<tr>
|
43 |
+
<td>
|
44 |
+
|
45 |
+
<input type="submit" name="filtergo" value="filter">
|
46 |
+
|
47 |
+
</td>
|
48 |
+
</tr></table>
|
49 |
+
</div>
|
50 |
+
</div>
|
51 |
+
</form><br />
|
52 |
+
|
53 |
+
|
54 |
+
<div class="request_table">
|
55 |
+
|
56 |
+
<?php echo $this->getPagerHtml(); ?>
|
57 |
+
<div class="box-account box-recent">
|
58 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
59 |
+
<tr>
|
60 |
+
<th>SKU</th>
|
61 |
+
<th>Name</th>
|
62 |
+
<th>Price [USD]</th>
|
63 |
+
<th>Purchased</th>
|
64 |
+
<th>Sum [USD]</th>
|
65 |
+
</tr>
|
66 |
+
<?php
|
67 |
+
if($resultRequest){
|
68 |
+
$total = 0;
|
69 |
+
foreach($resultRequest as $rt){
|
70 |
+
$prc = split('\.',$rt['price']);
|
71 |
+
$sum = $prc[0]*$rt['count'];
|
72 |
+
$total += $sum;
|
73 |
+
echo '<tr class="clicktagtr">
|
74 |
+
<td>'.$rt['sku'].'</td>
|
75 |
+
<td>'.substr(strip_tags($rt['name']),0,45).'...</td>
|
76 |
+
<td>'.$prc[0].'</td>
|
77 |
+
<td>'.$rt['count'].'</td>
|
78 |
+
<td>'.$sum.'</td>
|
79 |
+
</tr>';
|
80 |
+
}
|
81 |
+
}
|
82 |
+
///product/index/delete?p='.$rt['entity_id'].'
|
83 |
+
?>
|
84 |
+
</table>
|
85 |
+
</div>
|
86 |
+
<?php echo $this->getPagerHtml(); ?>
|
87 |
+
|
88 |
+
<p> </p>
|
89 |
+
<p align="right" class="total">Total: <strong><?php echo $total; ?></strong> [USD]</p>
|
90 |
+
|
91 |
+
</div>
|
92 |
+
|
93 |
+
|
94 |
+
<script type="text/javascript">
|
95 |
+
//<![CDATA[
|
96 |
+
enUS = {"m":{"wide":["January","February","March","April","May","June","July","August","September","October","November","December"],"abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}}; // en_US locale reference
|
97 |
+
Calendar._DN = ["\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0432\u0442\u043e\u0440\u043d\u0438\u043a","\u0441\u0440\u0435\u0434\u0430","\u0447\u0435\u0442\u0432\u0435\u0440\u0433","\u043f\u044f\u0442\u043d\u0438\u0446\u0430","\u0441\u0443\u0431\u0431\u043e\u0442\u0430"]; // full day names
|
98 |
+
Calendar._SDN = ["\u0412\u0441","\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"]; // short day names
|
99 |
+
Calendar._FD = 1; // First day of the week. "0" means display Sunday first, "1" means display Monday first, etc.
|
100 |
+
Calendar._MN = ["\u044f\u043d\u0432\u0430\u0440\u044f","\u0444\u0435\u0432\u0440\u0430\u043b\u044f","\u043c\u0430\u0440\u0442\u0430","\u0430\u043f\u0440\u0435\u043b\u044f","\u043c\u0430\u044f","\u0438\u044e\u043d\u044f","\u0438\u044e\u043b\u044f","\u0430\u0432\u0433\u0443\u0441\u0442\u0430","\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f","\u043e\u043a\u0442\u044f\u0431\u0440\u044f","\u043d\u043e\u044f\u0431\u0440\u044f","\u0434\u0435\u043a\u0430\u0431\u0440\u044f"]; // full month names
|
101 |
+
Calendar._SMN = ["\u044f\u043d\u0432.","\u0444\u0435\u0432\u0440.","\u043c\u0430\u0440\u0442\u0430","\u0430\u043f\u0440.","\u043c\u0430\u044f","\u0438\u044e\u043d\u044f","\u0438\u044e\u043b\u044f","\u0430\u0432\u0433.","\u0441\u0435\u043d\u0442.","\u043e\u043a\u0442.","\u043d\u043e\u044f\u0431.","\u0434\u0435\u043a."]; // short month names
|
102 |
+
Calendar._am = "AM"; // am/pm
|
103 |
+
Calendar._pm = "PM";
|
104 |
+
|
105 |
+
// tooltips
|
106 |
+
Calendar._TT = {};
|
107 |
+
Calendar._TT["INFO"] = "About the calendar";
|
108 |
+
|
109 |
+
Calendar._TT["ABOUT"] =
|
110 |
+
"DHTML Date/Time Selector\n" +
|
111 |
+
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" +
|
112 |
+
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
|
113 |
+
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
|
114 |
+
"\n\n" +
|
115 |
+
"Date selection:\n" +
|
116 |
+
"- Use the \xab, \xbb buttons to select year\n" +
|
117 |
+
"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" +
|
118 |
+
"- Hold mouse button on any of the above buttons for faster selection.";
|
119 |
+
Calendar._TT["ABOUT_TIME"] = "\n\n" +
|
120 |
+
"Time selection:\n" +
|
121 |
+
"- Click on any of the time parts to increase it\n" +
|
122 |
+
"- or Shift-click to decrease it\n" +
|
123 |
+
"- or click and drag for faster selection.";
|
124 |
+
|
125 |
+
Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)";
|
126 |
+
Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)";
|
127 |
+
Calendar._TT["GO_TODAY"] = "Go Today";
|
128 |
+
Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)";
|
129 |
+
Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)";
|
130 |
+
Calendar._TT["SEL_DATE"] = "Select date";
|
131 |
+
Calendar._TT["DRAG_TO_MOVE"] = "Drag to move";
|
132 |
+
Calendar._TT["PART_TODAY"] = ' (' + "\u0421\u0435\u0433\u043e\u0434\u043d\u044f" + ')';
|
133 |
+
|
134 |
+
// the following is to inform that "%s" is to be the first day of week
|
135 |
+
Calendar._TT["DAY_FIRST"] = "Display %s first";
|
136 |
+
|
137 |
+
// This may be locale-dependent. It specifies the week-end days, as an array
|
138 |
+
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
|
139 |
+
// means Monday, etc.
|
140 |
+
Calendar._TT["WEEKEND"] = "0,6";
|
141 |
+
|
142 |
+
Calendar._TT["CLOSE"] = "Close";
|
143 |
+
Calendar._TT["TODAY"] = "\u0421\u0435\u0433\u043e\u0434\u043d\u044f";
|
144 |
+
Calendar._TT["TIME_PART"] = "(Shift-)Click or drag to change value";
|
145 |
+
|
146 |
+
// date formats
|
147 |
+
Calendar._TT["DEF_DATE_FORMAT"] = "%d.%m.%Y";
|
148 |
+
Calendar._TT["TT_DATE_FORMAT"] = "%e %B %Y '\u0433'.";
|
149 |
+
|
150 |
+
Calendar._TT["WK"] = "\u041d\u0435\u0434\u0435\u043b\u044f";
|
151 |
+
Calendar._TT["TIME"] = "Time:";
|
152 |
+
|
153 |
+
CalendarDateObject._LOCAL_TIMZEONE_OFFSET_SECONDS = 10800;
|
154 |
+
CalendarDateObject._SERVER_TIMZEONE_SECONDS = 1364818509;
|
155 |
+
|
156 |
+
//]]>
|
157 |
+
</script>
|
158 |
+
|
159 |
+
|
160 |
+
<script type="text/javascript">
|
161 |
+
//<![CDATA[
|
162 |
+
Calendar.setup({
|
163 |
+
inputField : '_dob',
|
164 |
+
ifFormat : '%d.%m.%Y',
|
165 |
+
button : '_dob_trig',
|
166 |
+
align : 'Bl',
|
167 |
+
singleClick : true
|
168 |
+
});
|
169 |
+
|
170 |
+
Calendar.setup({
|
171 |
+
inputField : '_dobto',
|
172 |
+
ifFormat : '%d.%m.%Y',
|
173 |
+
button : '_dobto_trig',
|
174 |
+
align : 'Bl',
|
175 |
+
singleClick : true
|
176 |
+
});
|
177 |
+
//]]>
|
178 |
+
</script>
|
179 |
+
|
180 |
+
<style type="text/css">
|
181 |
+
.total{
|
182 |
+
font-size:18px;
|
183 |
+
}
|
184 |
+
|
185 |
+
#generaldiv, #pricediv, #imagediv, #additionalfieldsdiv, #downlodablediv{
|
186 |
+
display:none;
|
187 |
+
}
|
188 |
+
|
189 |
+
.headings th{
|
190 |
+
border:1px solid #dddddd;
|
191 |
+
padding:2px;
|
192 |
+
font-weight:bold;
|
193 |
+
}
|
194 |
+
.headings td{
|
195 |
+
border:1px solid #dddddd;
|
196 |
+
padding:2px;
|
197 |
+
}
|
198 |
+
.showcase_attribute{
|
199 |
+
width:160px;
|
200 |
+
float:left;
|
201 |
+
border:1px solid #dddddd;
|
202 |
+
padding:5px;
|
203 |
+
background-color:#ffffff;
|
204 |
+
}
|
205 |
+
.showcase_menu{
|
206 |
+
width:150px;
|
207 |
+
position:relative;
|
208 |
+
float:right;
|
209 |
+
padding:5px;
|
210 |
+
overflow-x:scroll;
|
211 |
+
background-color:#ffffff;
|
212 |
+
margin:10px 0 0 0;
|
213 |
+
}
|
214 |
+
.showcase_menu ul{
|
215 |
+
width:250px;
|
216 |
+
}
|
217 |
+
.showcase_menu ul li ul, .showcase_menu ul li ul li ul, .showcase_menu ul li ul li ul li ul{
|
218 |
+
padding-left:10px;
|
219 |
+
}
|
220 |
+
.generalblock{
|
221 |
+
border:1px solid #dddddd;
|
222 |
+
}
|
223 |
+
.titlebg{
|
224 |
+
background-color:#E26703;
|
225 |
+
color:#ffffff;
|
226 |
+
margin:0px;
|
227 |
+
padding:0px 0px 0px 5px;
|
228 |
+
border:1px solid #fff;
|
229 |
+
cursor:pointer;
|
230 |
+
}
|
231 |
+
.fieldbg{
|
232 |
+
padding:0px 0px 10px 5px;
|
233 |
+
margin:0px;
|
234 |
+
}
|
235 |
+
.fieldbg input, .fieldbg textarea{
|
236 |
+
width:98%;
|
237 |
+
}
|
238 |
+
|
239 |
+
|
240 |
+
.request_table td, .request_table th{
|
241 |
+
padding:3px;
|
242 |
+
}
|
243 |
+
.request_table th{
|
244 |
+
font-weight:bold;
|
245 |
+
border-bottom:1px solid #dddddd;
|
246 |
+
}
|
247 |
+
.request_table td{
|
248 |
+
border-bottom:1px solid #dddddd;
|
249 |
+
}
|
250 |
+
.request_table table{
|
251 |
+
width:100%;
|
252 |
+
}
|
253 |
+
.request_new{
|
254 |
+
color:#ff0000;
|
255 |
+
}
|
256 |
+
.clicktagtr{
|
257 |
+
cursor:pointer;
|
258 |
+
}
|
259 |
+
</style>
|
package.xml
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Amm_Product</name>
|
4 |
-
<version>1.0.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Enables clients in account to add products in the category of the directory store.</summary>
|
10 |
-
<description>Enables clients in account to add products in the category of the directory store. 
|
11 |
Type products - Downloadable.</description>
|
12 |
<notes>enable to adding downloadable products in account</notes>
|
13 |
<authors><author><name>Alexey</name><user>auto-converted</user><email>softaliancecom@gmail.com</email></author></authors>
|
14 |
-
<date>2013-05-
|
15 |
-
<time>11:
|
16 |
-
<contents><target name="magecommunity"><dir name="Amm"><dir name="Product"><dir name="Block"><dir name="Adminhtml"><dir name="Product"><file name="Grid.php" hash="b4661fe5f4f754cdb0c91abe6b01f14f"/></dir><file name="Grid.php" hash="f93b4d141b863e2ec71feb169f440240"/></dir><file name="Monblock.php" hash="59f97b2e53b27e223f5d6e650ab7b5c4"/></dir><dir name="Helper"><file name="Data.php" hash="9b4fba746e0acdffc418696f0ab08b37"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Product"><file name="Collection.php" hash="a57cf43fb3989a3a865c23ca7fa9ff1a"/></dir><file name="Product.php" hash="15b7fea36193f2e377bd009d52c23121"/><file name="Setup.php" hash="92ed515cd2cb4963f9d363612cabdfca"/></dir><file name="Product.php" hash="afd9cd60318217520ee85b7c0e9f9e7c"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="9b01987b5765f788341173d0b86259ab"/></dir><file name="IndexController.php" hash="
|
17 |
<compatible/>
|
18 |
<dependencies/>
|
19 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Amm_Product</name>
|
4 |
+
<version>1.0.0.5</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Enables clients in account to add products in the category of the directory store.</summary>
|
10 |
+
<description>Enables clients in account to add products in the category of the directory store. 

|
11 |
Type products - Downloadable.</description>
|
12 |
<notes>enable to adding downloadable products in account</notes>
|
13 |
<authors><author><name>Alexey</name><user>auto-converted</user><email>softaliancecom@gmail.com</email></author></authors>
|
14 |
+
<date>2013-05-24</date>
|
15 |
+
<time>11:58:02</time>
|
16 |
+
<contents><target name="magecommunity"><dir name="Amm"><dir name="Product"><dir name="Block"><dir name="Adminhtml"><dir name="Product"><file name="Grid.php" hash="b4661fe5f4f754cdb0c91abe6b01f14f"/></dir><file name="Grid.php" hash="f93b4d141b863e2ec71feb169f440240"/></dir><file name="Monblock.php" hash="59f97b2e53b27e223f5d6e650ab7b5c4"/></dir><dir name="Helper"><file name="Data.php" hash="9b4fba746e0acdffc418696f0ab08b37"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Product"><file name="Collection.php" hash="a57cf43fb3989a3a865c23ca7fa9ff1a"/></dir><file name="Product.php" hash="15b7fea36193f2e377bd009d52c23121"/><file name="Setup.php" hash="92ed515cd2cb4963f9d363612cabdfca"/></dir><file name="Product.php" hash="afd9cd60318217520ee85b7c0e9f9e7c"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="9b01987b5765f788341173d0b86259ab"/></dir><file name="IndexController.php" hash="f375f6fadfdbf9b5877631de3cc0057a"/><file name="StatisticaController.php" hash="65b01ef7adc9dfeff32791ec672a011f"/></dir><dir name="etc"><file name="config.xml" hash="613627e7d6bca7865232ca786a18e551"/></dir><dir name="sql"><dir name="product_setup"><file name="mysql4-install-0.0.1.php" hash="070155ac1b2191b9f4b2c2210e89ad4f"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Amm_Product.xml" hash="e239211fb553bb940071c95391a955e3"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="product.xml" hash="9cb80194a83716c2201d3782b8e497b2"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="product.xml" hash="71c6a8638e1a92986355ee8ee85d9a8b"/></dir><dir name="template"><dir name="product"><file name="show.phtml" hash="025262329785df5355d4c03587de7bd5"/><file name="statistica.phtml" hash="6d199bb5c00f07e9ff998755bc1f9efa"/></dir></dir></dir></dir></dir></target></contents>
|
17 |
<compatible/>
|
18 |
<dependencies/>
|
19 |
</package>
|