Version Notes
Share Jewelry Products to Jewelrslink.
Includes importing product from jewerlslink and Exporting products to Jewelerslink with attributes mapping functions.
Download this release
Release Info
Developer | John Dorsey |
Extension | Jewelerslink_Jewelryshare |
Version | 0.1.1 |
Comparing to | |
See all releases |
Code changes from version 0.1.0 to 0.1.1
- app/design/adminhtml/default/jewelerslink/template/jewelryshare/head/window.phtml +42 -0
- app/design/adminhtml/default/jewelerslink/template/jewelryshare/tab/import.phtml +33 -0
- app/design/adminhtml/default/jewelerslink/template/jewelryshare/tab/priceincrease.phtml +190 -0
- app/design/adminhtml/default/jewelerslink/template/jewelryshare/tab/update.phtml +25 -0
- app/design/adminhtml/default/jewelerslink/template/jewelryshare/tab/vendor.phtml +202 -0
- package.xml +4 -4
app/design/adminhtml/default/jewelerslink/template/jewelryshare/head/window.phtml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script type="text/javascript">
|
2 |
+
function openNewImportWindow(url) {
|
3 |
+
dialog_import_window = Dialog.info('', {
|
4 |
+
draggable:true,
|
5 |
+
resizable:false,
|
6 |
+
closable:true,
|
7 |
+
className:"magento",
|
8 |
+
windowClassName:"popup-window",
|
9 |
+
title:"New import item",
|
10 |
+
top:100,
|
11 |
+
width:600,
|
12 |
+
height:220,
|
13 |
+
zIndex:1000,
|
14 |
+
recenterAuto:false,
|
15 |
+
hideEffect:Element.hide,
|
16 |
+
showEffect:Element.show,
|
17 |
+
id:"browser_window"
|
18 |
+
});
|
19 |
+
new Ajax.Updater($$('#browser_window_content #modal_dialog_message')[0], url, {evalScripts: true});
|
20 |
+
}
|
21 |
+
|
22 |
+
function saveNewImportItem(url)
|
23 |
+
{
|
24 |
+
new Ajax.Request(url, {
|
25 |
+
parameters: $('import_item_form').serialize(true),
|
26 |
+
onSuccess: function(response) {
|
27 |
+
var json = response.responseText.evalJSON();
|
28 |
+
if (json) {
|
29 |
+
dialog_import_window.close();
|
30 |
+
if (typeof(find_feed_list_codesJsObject) == 'object') {
|
31 |
+
find_feed_list_codesJsObject.reload();
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}
|
35 |
+
});
|
36 |
+
}
|
37 |
+
|
38 |
+
function closeNewImportItem()
|
39 |
+
{
|
40 |
+
dialog_import_window.close();
|
41 |
+
}
|
42 |
+
</script>
|
app/design/adminhtml/default/jewelerslink/template/jewelryshare/tab/import.phtml
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<style type="text/css">
|
2 |
+
.custombuttons td { padding: 5px 2px; }
|
3 |
+
</style>
|
4 |
+
|
5 |
+
<table class="custombuttons">
|
6 |
+
|
7 |
+
<tr>
|
8 |
+
<td>
|
9 |
+
<button onclick="setLocation('<?php echo $this->getUrl('jewelryshare/adminhtml_jewelryshare/getImportCSV', array('_current'=>true)); ?>')" class="scalable save" type="button" title="Get Import CSV">
|
10 |
+
<span><span><span>Get Import CSV</span></span></span>
|
11 |
+
</button>
|
12 |
+
</td>
|
13 |
+
|
14 |
+
<td>
|
15 |
+
<button onclick="setLocation('<?php echo $this->getUrl('jewelryshare/adminhtml_jewelryshare/getImages', array('_current'=>true)); ?>')" class="scalable save" type="button" title="Get Images">
|
16 |
+
<span><span><span>Get Images</span></span></span>
|
17 |
+
</button>
|
18 |
+
</td>
|
19 |
+
|
20 |
+
<td>
|
21 |
+
<button onclick="window.open('<?php echo $this->getUrl('jewelryshare/adminhtml_jewelryshare/importJewelry', array('_current'=>true)); ?>')" class="scalable save" type="button" title="Import Products">
|
22 |
+
<span><span><span>Import Products</span></span></span>
|
23 |
+
</button>
|
24 |
+
</td>
|
25 |
+
|
26 |
+
<td>
|
27 |
+
<button onclick="setLocation('<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).'var/import/jewelerslink_import.csv'; ?>')" class="scalable save" type="button" title="Download Update CSV">
|
28 |
+
<span><span><span>Download Import CSV</span></span></span>
|
29 |
+
</button>
|
30 |
+
</td>
|
31 |
+
</tr>
|
32 |
+
|
33 |
+
</table>
|
app/design/adminhtml/default/jewelerslink/template/jewelryshare/tab/priceincrease.phtml
ADDED
@@ -0,0 +1,190 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$resource = Mage::getConfig()->getNode('global/resources')->asArray();
|
3 |
+
$magento_db = $resource['default_setup']['connection']['host'];
|
4 |
+
$mdb_user = $resource['default_setup']['connection']['username'];
|
5 |
+
$mdb_passwd = $resource['default_setup']['connection']['password'];
|
6 |
+
$mdb_name = $resource['default_setup']['connection']['dbname'];
|
7 |
+
|
8 |
+
//developm_magento
|
9 |
+
$magento_connection = @mysql_connect($magento_db, $mdb_user, $mdb_passwd);
|
10 |
+
if (!$magento_connection)
|
11 |
+
{
|
12 |
+
die('Unable to connect to the Magento database');
|
13 |
+
}
|
14 |
+
@mysql_select_db($mdb_name, $magento_connection) or die ("Magento Database not found.");
|
15 |
+
|
16 |
+
$table = Mage::getSingleton('core/resource')->getTableName('jewelryshare_priceincrease');
|
17 |
+
$query = "SELECT * FROM `$table`";
|
18 |
+
|
19 |
+
|
20 |
+
$result = @mysql_db_query($mdb_name, $query) or die("Failed Query of ".$query);
|
21 |
+
$coupon_rule_id = @mysql_insert_id($magento_connection);
|
22 |
+
|
23 |
+
while($row = mysql_fetch_array($result))
|
24 |
+
{
|
25 |
+
$price_from[] = $row['price_from'];
|
26 |
+
$price_to[] = $row['price_to'];
|
27 |
+
$price_increase[] = $row['price_increase'];
|
28 |
+
|
29 |
+
}
|
30 |
+
|
31 |
+
$count = count($price_increase);
|
32 |
+
|
33 |
+
$html = "
|
34 |
+
<table width='100%'>
|
35 |
+
<tr><td>Price From</td><td>Price To</td><td>Price Increase in %</td></tr>
|
36 |
+
";
|
37 |
+
|
38 |
+
$j = 100;
|
39 |
+
|
40 |
+
for($i=0; $i<$count; $i++)
|
41 |
+
{
|
42 |
+
|
43 |
+
$j++;
|
44 |
+
|
45 |
+
$html .= "<tr><td><input type='text' name='multiline_0-".$j."' value=".$price_from[$i]." /></td>
|
46 |
+
<td><input type='text' name='multiline_1-".$j."' value=".$price_to[$i]." /></td>
|
47 |
+
<td><input type='text' name='multiline_2-".$j."' value=".$price_increase[$i]." /></td></tr>";
|
48 |
+
}
|
49 |
+
|
50 |
+
$html .= "</table>";
|
51 |
+
|
52 |
+
$html .= '<table id="gallery" class="gallery" border="0" cellspacing="3" cellpadding="0">';
|
53 |
+
$html .= '<thead id="gallery_thead" class="gallery"><tr class="gallery"><td class="gallery" valign="middle" align="center">Price From</td><td class="gallery" valign="middle" align="center">Price To</td><td class="gallery" valign="middle" align="center">Price Increse ( % )</td><td class="gallery" valign="middle" align="center">Sort Order</td><td class="gallery" valign="middle" align="center">Delete</td></tr></thead>';
|
54 |
+
$widgetButton = $this->getLayout();
|
55 |
+
$buttonHtml = $widgetButton->createBlock('adminhtml/widget_button')
|
56 |
+
->setData(
|
57 |
+
array(
|
58 |
+
'label' => 'Add New Rule',
|
59 |
+
'onclick' => 'addNewImg()',
|
60 |
+
'class' => 'add'))
|
61 |
+
->toHtml();
|
62 |
+
|
63 |
+
$html .= '<tfoot class="gallery">';
|
64 |
+
$html .= '<tr class="gallery">';
|
65 |
+
$html .= '<td class="gallery" valign="middle" align="left" colspan="5">'.$buttonHtml.'</td>';
|
66 |
+
$html .= '</tr>';
|
67 |
+
$html .= '</tfoot>';
|
68 |
+
|
69 |
+
$html .= '<tbody class="gallery">';
|
70 |
+
|
71 |
+
$i = 0;
|
72 |
+
if (!is_null($this->getValue())) {
|
73 |
+
foreach ($this->getValue() as $image) {
|
74 |
+
$i++;
|
75 |
+
$html .= '<tr class="gallery">';
|
76 |
+
foreach ($this->getValue()->getAttributeBackend()->getImageTypes() as $type) {
|
77 |
+
$url = $image->setType($type)->getSourceUrl();
|
78 |
+
$html .= '<td class="gallery" align="center" style="vertical-align:bottom;">';
|
79 |
+
$html .= '<a href="'.$url.'" target="_blank" onclick="imagePreview(\''.$this->getHtmlId().'_image_'.$type.'_'.$image->getValueId().'\');return false;">
|
80 |
+
<img id="'.$this->getHtmlId().'_image_'.$type.'_'.$image->getValueId().'" src="'.$url.'" alt="'.$image->getValue().'" height="25" align="absmiddle" class="small-image-preview"></a><br/>';
|
81 |
+
$html .= '<input type="text" name="'.$this->getName().'_'.$type.'['.$image->getValueId().']" size="1"></td>';
|
82 |
+
}
|
83 |
+
$html .= '<td class="gallery" align="center" style="vertical-align:bottom;"><input type="input" name="'.parent::getName().'[position]['.$image->getValueId().']" value="'.$image->getPosition().'" id="'.$this->getHtmlId().'_position_'.$image->getValueId().'" size="3"/></td>';
|
84 |
+
$html .= '<td class="gallery" align="center" style="vertical-align:bottom;"><input type="checkbox" name="'.parent::getName().'[delete]['.$image->getValueId().']" value="'.$image->getValueId().'" id="'.$this->getHtmlId().'_delete_'.$image->getValueId().'"/></td>';
|
85 |
+
$html .= '</tr>';
|
86 |
+
}
|
87 |
+
}
|
88 |
+
if ($i==0) {
|
89 |
+
$html .= '<script type="text/javascript">document.getElementById("gallery_thead").style.visibility="hidden";</script>';
|
90 |
+
}
|
91 |
+
|
92 |
+
$html .= '</tbody></table>';
|
93 |
+
|
94 |
+
$name = $this->getName();
|
95 |
+
$parentName = parent::getName();
|
96 |
+
|
97 |
+
$html .= <<<EndSCRIPT
|
98 |
+
|
99 |
+
<script language="javascript">
|
100 |
+
id = 0;
|
101 |
+
|
102 |
+
function addNewImg(){
|
103 |
+
|
104 |
+
document.getElementById("gallery_thead").style.visibility="visible";
|
105 |
+
|
106 |
+
id--;
|
107 |
+
new_file_input = '<input type="text" name="{$name}_%j%-%id%" size="1" style="width:100px"/>';
|
108 |
+
|
109 |
+
// Sort order input
|
110 |
+
var new_row_input = document.createElement( 'input' );
|
111 |
+
new_row_input.type = 'text';
|
112 |
+
new_row_input.name = '{$parentName}[position]['+id+']';
|
113 |
+
new_row_input.size = '3';
|
114 |
+
new_row_input.value = '0';
|
115 |
+
new_row_input.id = 'position';
|
116 |
+
|
117 |
+
|
118 |
+
// Delete button
|
119 |
+
var new_row_button = document.createElement( 'input' );
|
120 |
+
new_row_button.type = 'checkbox';
|
121 |
+
new_row_button.value = 'Delete';
|
122 |
+
|
123 |
+
table = document.getElementById( "gallery" );
|
124 |
+
|
125 |
+
// no of rows in the table:
|
126 |
+
noOfRows = table.rows.length;
|
127 |
+
|
128 |
+
// no of columns in the pre-last row:
|
129 |
+
noOfCols = table.rows[noOfRows-2].cells.length;
|
130 |
+
|
131 |
+
// insert row at pre-last:
|
132 |
+
var x=table.insertRow(noOfRows-1);
|
133 |
+
|
134 |
+
// insert cells in row.
|
135 |
+
for (var j = 0; j < noOfCols; j++) {
|
136 |
+
|
137 |
+
newCell = x.insertCell(j);
|
138 |
+
newCell.align = "center";
|
139 |
+
newCell.valign = "middle";
|
140 |
+
|
141 |
+
if (j==3) {
|
142 |
+
newCell.appendChild( new_row_input );
|
143 |
+
}
|
144 |
+
else if (j==4) {
|
145 |
+
newCell.appendChild( new_row_button );
|
146 |
+
}
|
147 |
+
else {
|
148 |
+
newCell.innerHTML = new_file_input.replace(/%j%/g, j).replace(/%id%/g, id);
|
149 |
+
}
|
150 |
+
|
151 |
+
}
|
152 |
+
|
153 |
+
// Delete function
|
154 |
+
new_row_button.onclick= function(){
|
155 |
+
|
156 |
+
this.parentNode.parentNode.parentNode.removeChild( this.parentNode.parentNode );
|
157 |
+
|
158 |
+
// Appease Safari
|
159 |
+
// without it Safari wants to reload the browser window
|
160 |
+
// which nixes your already queued uploads
|
161 |
+
return false;
|
162 |
+
};
|
163 |
+
|
164 |
+
}
|
165 |
+
</script>
|
166 |
+
|
167 |
+
EndSCRIPT;
|
168 |
+
$html.= $this->getAfterElementHtml();
|
169 |
+
?>
|
170 |
+
|
171 |
+
<div class="entry-edit">
|
172 |
+
<div class="entry-edit-head">
|
173 |
+
<h4 class="icon-head head-edit-form fieldset-legend">Jewelry Price Increase</h4>
|
174 |
+
<div class="form-buttons"></div>
|
175 |
+
</div>
|
176 |
+
<div id="jewelryshare_priceincrease" class="fieldset">
|
177 |
+
<div class="hor-scroll">
|
178 |
+
<table cellspacing="0" class="form-list">
|
179 |
+
<tbody>
|
180 |
+
<tr>
|
181 |
+
<td class="label"><label for="multiline">Price Increase in % <span class="required">*</span></label></td>
|
182 |
+
<td class="value">
|
183 |
+
<?php echo $html; ?>
|
184 |
+
</td>
|
185 |
+
</tr>
|
186 |
+
</tbody>
|
187 |
+
</table>
|
188 |
+
</div>
|
189 |
+
</div>
|
190 |
+
</div>
|
app/design/adminhtml/default/jewelerslink/template/jewelryshare/tab/update.phtml
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<style type="text/css">
|
2 |
+
.custombuttons td { padding: 5px 2px; }
|
3 |
+
</style>
|
4 |
+
|
5 |
+
<table class="custombuttons">
|
6 |
+
|
7 |
+
<tr>
|
8 |
+
<td>
|
9 |
+
<button onclick="setLocation('<?php echo $this->getUrl('jewelryshare/adminhtml_jewelryshare/getUpdateCSV', array('_current'=>true)); ?>')" class="scalable save" type="button" title="Get Update CSV">
|
10 |
+
<span><span><span>Get Update CSV</span></span></span>
|
11 |
+
</button>
|
12 |
+
</td>
|
13 |
+
<td>
|
14 |
+
<button onclick="window.open('<?php echo $this->getUrl('jewelryshare/adminhtml_jewelryshare/updateJewelry', array('_current'=>true)); ?>')" class="scalable save" type="button" title="Update Products">
|
15 |
+
<span><span><span>Update Products</span></span></span>
|
16 |
+
</button>
|
17 |
+
</td>
|
18 |
+
<td>
|
19 |
+
<button onclick="setLocation('<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).'var/import/jewelerslink_update.csv'; ?>')" class="scalable save" type="button" title="Download Update CSV">
|
20 |
+
<span><span><span>Download Update CSV</span></span></span>
|
21 |
+
</button>
|
22 |
+
</td>
|
23 |
+
</tr>
|
24 |
+
|
25 |
+
</table>
|
app/design/adminhtml/default/jewelerslink/template/jewelryshare/tab/vendor.phtml
ADDED
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$resource = Mage::getConfig()->getNode('global/resources')->asArray();
|
3 |
+
$magento_db = $resource['default_setup']['connection']['host'];
|
4 |
+
$mdb_user = $resource['default_setup']['connection']['username'];
|
5 |
+
$mdb_passwd = $resource['default_setup']['connection']['password'];
|
6 |
+
$mdb_name = $resource['default_setup']['connection']['dbname'];
|
7 |
+
|
8 |
+
//developm_magento
|
9 |
+
$magento_connection = @mysql_connect($magento_db, $mdb_user, $mdb_passwd);
|
10 |
+
if (!$magento_connection)
|
11 |
+
{
|
12 |
+
die('Unable to connect to the Magento databaseeeee');
|
13 |
+
}
|
14 |
+
@mysql_select_db($mdb_name, $magento_connection) or die ("Magento Database not found.");
|
15 |
+
|
16 |
+
$table = Mage::getSingleton('core/resource')->getTableName('jewelryshare_vendor');
|
17 |
+
$query = "SELECT * FROM `$table`";
|
18 |
+
|
19 |
+
$result = @mysql_db_query($mdb_name, $query) or die("Failed Query of ".$query);
|
20 |
+
$coupon_rule_id = @mysql_insert_id($magento_connection);
|
21 |
+
|
22 |
+
$vendor_id = array();
|
23 |
+
while($row = mysql_fetch_array($result))
|
24 |
+
{
|
25 |
+
$vendor_name[] = $row['vendor_name'];
|
26 |
+
$vendor_id[] = $row['vendor_id'];
|
27 |
+
}
|
28 |
+
|
29 |
+
$count = count($vendor_id);
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
$html = "
|
34 |
+
<table width='100%'>
|
35 |
+
<tr><td>Vendor Name</td><td>Vendor ID</td></tr>
|
36 |
+
";
|
37 |
+
|
38 |
+
|
39 |
+
for($i=0; $i<$count; $i++)
|
40 |
+
{
|
41 |
+
|
42 |
+
$html .= "<tr id='vendor-row-".$i."'>
|
43 |
+
<td><input type='text' name='vendor_1-".$i."' value=".$vendor_name[$i]." /></td>
|
44 |
+
<td><input type='text' name='vendor_2-".$i."' value=".$vendor_id[$i]." /></td></tr>";
|
45 |
+
}
|
46 |
+
|
47 |
+
for($j=100; $j<200; $j++)
|
48 |
+
{
|
49 |
+
|
50 |
+
$html .= "<tr id='vendor-row-".$j."' class='no-display'>
|
51 |
+
<td ><input name='vendor_1-".$j."' /></td>
|
52 |
+
<td ><input name='vendor_2-".$j."' /></td></tr>";
|
53 |
+
}
|
54 |
+
|
55 |
+
$html .= "</table>";
|
56 |
+
|
57 |
+
|
58 |
+
|
59 |
+
$html .= '<table id="gallery" class="gallery" border="0" cellspacing="3" cellpadding="0">';
|
60 |
+
$html .= '<thead id="gallery_thead_2" class="gallery"><tr class="gallery"><td class="gallery" valign="middle" align="center">Vendor Name</td><td class="gallery" valign="middle" align="center">Vendor Id</td><td class="gallery" valign="middle" align="center">% Rap</td><td class="gallery" valign="middle" align="center">Sort Order</td><td class="gallery" valign="middle" align="center">Delete</td></tr></thead>';
|
61 |
+
$widgetButton = $this->getLayout();
|
62 |
+
$buttonHtml = $widgetButton->createBlock('adminhtml/widget_button')
|
63 |
+
->setData(
|
64 |
+
array(
|
65 |
+
'label' => 'Add New Vendor',
|
66 |
+
'onclick' => 'addNewImg2()',
|
67 |
+
'class' => 'add'))
|
68 |
+
->toHtml();
|
69 |
+
|
70 |
+
$html .= '<tfoot class="gallery">';
|
71 |
+
$html .= '<tr class="gallery">';
|
72 |
+
$html .= '<td class="gallery" valign="middle" align="left" colspan="5">'.$buttonHtml.'</td>';
|
73 |
+
$html .= '</tr>';
|
74 |
+
$html .= '</tfoot>';
|
75 |
+
|
76 |
+
$html .= '<tbody class="gallery">';
|
77 |
+
|
78 |
+
$i = 0;
|
79 |
+
if (!is_null($this->getValue())) {
|
80 |
+
foreach ($this->getValue() as $image) {
|
81 |
+
$i++;
|
82 |
+
$html .= '<tr class="gallery">';
|
83 |
+
foreach ($this->getValue()->getAttributeBackend()->getImageTypes() as $type) {
|
84 |
+
$url = $image->setType($type)->getSourceUrl();
|
85 |
+
$html .= '<td class="gallery" align="center" style="vertical-align:bottom;">';
|
86 |
+
$html .= '<a href="'.$url.'" target="_blank" onclick="imagePreview(\''.$this->getHtmlId().'_image_'.$type.'_'.$image->getValueId().'\');return false;">
|
87 |
+
<img id="'.$this->getHtmlId().'_image_'.$type.'_'.$image->getValueId().'" src="'.$url.'" alt="'.$image->getValue().'" height="25" align="absmiddle" class="small-image-preview"></a><br/>';
|
88 |
+
$html .= '<input type="text" name="'.$this->getName().'_'.$type.'['.$image->getValueId().']" size="1"></td>';
|
89 |
+
}
|
90 |
+
$html .= '<td class="gallery" align="center" style="vertical-align:bottom;"><input type="input" name="'.parent::getName().'[position]['.$image->getValueId().']" value="'.$image->getPosition().'" id="'.$this->getHtmlId().'_position_'.$image->getValueId().'" size="3"/></td>';
|
91 |
+
$html .= '<td class="gallery" align="center" style="vertical-align:bottom;"><input type="checkbox" name="'.parent::getName().'[delete]['.$image->getValueId().']" value="'.$image->getValueId().'" id="'.$this->getHtmlId().'_delete_'.$image->getValueId().'"/></td>';
|
92 |
+
$html .= '</tr>';
|
93 |
+
}
|
94 |
+
}
|
95 |
+
if ($i==0) {
|
96 |
+
$html .= '<script type="text/javascript">document.getElementById("gallery_thead_2").style.visibility="hidden";</script>';
|
97 |
+
}
|
98 |
+
|
99 |
+
$html .= '</tbody></table>';
|
100 |
+
|
101 |
+
$name = $this->getName();
|
102 |
+
$parentName = parent::getName();
|
103 |
+
|
104 |
+
$html .= <<<EndSCRIPT
|
105 |
+
|
106 |
+
<script language="javascript">
|
107 |
+
id = 99;
|
108 |
+
|
109 |
+
function addNewImg2(){
|
110 |
+
|
111 |
+
id++;
|
112 |
+
|
113 |
+
document.getElementById('vendor-row-'+id).className = "no";
|
114 |
+
|
115 |
+
/*
|
116 |
+
|
117 |
+
document.getElementById("gallery_thead_2").style.visibility="visible";
|
118 |
+
|
119 |
+
id--;
|
120 |
+
new_file_input = '<input type="text" name="{$name}_%j%-%id%" size="1" style="width:100px"/>';
|
121 |
+
|
122 |
+
// Sort order input
|
123 |
+
var new_row_input = document.createElement( 'input' );
|
124 |
+
new_row_input.type = 'text';
|
125 |
+
new_row_input.name = '{$parentName}[position]['+id+']';
|
126 |
+
new_row_input.size = '3';
|
127 |
+
new_row_input.value = '0';
|
128 |
+
|
129 |
+
|
130 |
+
// Delete button
|
131 |
+
var new_row_button = document.createElement( 'input' );
|
132 |
+
new_row_button.type = 'checkbox';
|
133 |
+
new_row_button.value = 'Delete';
|
134 |
+
|
135 |
+
table = document.getElementById( "gallery" );
|
136 |
+
|
137 |
+
// no of rows in the table:
|
138 |
+
noOfRows = table.rows.length;
|
139 |
+
|
140 |
+
// no of columns in the pre-last row:
|
141 |
+
noOfCols = table.rows[noOfRows-2].cells.length;
|
142 |
+
|
143 |
+
// insert row at pre-last:
|
144 |
+
var x=table.insertRow(noOfRows-1);
|
145 |
+
|
146 |
+
// insert cells in row.
|
147 |
+
for (var j = 0; j < noOfCols; j++) {
|
148 |
+
|
149 |
+
newCell = x.insertCell(j);
|
150 |
+
newCell.align = "center";
|
151 |
+
newCell.valign = "middle";
|
152 |
+
|
153 |
+
if (j==3) {
|
154 |
+
newCell.appendChild( new_row_input );
|
155 |
+
}
|
156 |
+
else if (j==4) {
|
157 |
+
newCell.appendChild( new_row_button );
|
158 |
+
}
|
159 |
+
else {
|
160 |
+
newCell.innerHTML = new_file_input.replace(/%j%/g, j).replace(/%id%/g, id);
|
161 |
+
}
|
162 |
+
|
163 |
+
}
|
164 |
+
|
165 |
+
// Delete function
|
166 |
+
new_row_button.onclick= function(){
|
167 |
+
|
168 |
+
this.parentNode.parentNode.parentNode.removeChild( this.parentNode.parentNode );
|
169 |
+
|
170 |
+
// Appease Safari
|
171 |
+
// without it Safari wants to reload the browser window
|
172 |
+
// which nixes your already queued uploads
|
173 |
+
return false;
|
174 |
+
};
|
175 |
+
|
176 |
+
*/}
|
177 |
+
</script>
|
178 |
+
|
179 |
+
EndSCRIPT;
|
180 |
+
$html.= $this->getAfterElementHtml();
|
181 |
+
?>
|
182 |
+
|
183 |
+
<div class="entry-edit">
|
184 |
+
<div class="entry-edit-head">
|
185 |
+
<h4 class="icon-head head-edit-form fieldset-legend">Manage Vendors</h4>
|
186 |
+
<div class="form-buttons"></div>
|
187 |
+
</div>
|
188 |
+
<div id="jewelryshare_vendor" class="fieldset">
|
189 |
+
<div class="hor-scroll">
|
190 |
+
<table cellspacing="0" class="form-list">
|
191 |
+
<tbody>
|
192 |
+
<tr>
|
193 |
+
<td class="label"><label for="multiline">Vendors <span class="required">*</span></label></td>
|
194 |
+
<td class="value">
|
195 |
+
<?php echo $html; ?>
|
196 |
+
</td>
|
197 |
+
</tr>
|
198 |
+
</tbody>
|
199 |
+
</table>
|
200 |
+
</div>
|
201 |
+
</div>
|
202 |
+
</div>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Jewelerslink_Jewelryshare</name>
|
4 |
-
<version>0.1.
|
5 |
<stability>stable</stability>
|
6 |
<license>Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
@@ -12,9 +12,9 @@ Includes importing product from jewerlslink and Exporting products to Jewelersli
|
|
12 |
<notes>Share Jewelry Products to Jewelrslink.
|
13 |
Includes importing product from jewerlslink and Exporting products to Jewelerslink with attributes mapping functions.</notes>
|
14 |
<authors><author><name>John Dorsey</name><user>jewelerslink</user><email>support@idealbrandmarketing.com</email></author></authors>
|
15 |
-
<date>2014-
|
16 |
-
<time>
|
17 |
-
<contents><target name="magecommunity"><dir name="Jewelerslink"><dir name="Jewelryshare"><dir name="Block"><dir name="Adminhtml"><dir name="Edit"><dir name="Codes"><dir name="Edit"><file name="Form.php" hash="862f0625803dda26595c8dffea1c00db"/></dir></dir><file name="Codes.php" hash="7622b2901f4fa12ef746d23f5b0f52ef"/></dir><dir name="Jewelryshare"><dir name="Edit"><file name="Form.php" hash="2c1802fc7f6660a99d8fd73ef0bc0c7b"/><dir name="Tab"><file name="Import.php" hash="8846742c307b767b976af6135a71c72a"/><file name="Priceincrease.php" hash="6cd5181396c0bbb62df79cde4ebf1599"/><file name="Update.php" hash="72c7e63d769217d1fd8a86b37970e45b"/><file name="Vendor.php" hash="355e7536bbb62a609e8472ebfebb991e"/></dir><file name="Tabs.php" hash="05912b81eea239ad16b5528104fde50a"/></dir><file name="Edit.php" hash="3878e1bb83b25c789a74e41d35cbab37"/></dir><file name="Jewelryshare.php" hash="ac4e61454f5446c9f71c448e55344b7d"/><dir name="List"><dir name="Codes"><file name="Grid.php" hash="91745a1b7af27c8429ca64d92b9e9a6c"/></dir><file name="Codes.php" hash="b0559a0add7c44382f0c8f0718f5c7d5"/><dir name="Items"><file name="Grid.php" hash="14fac42fe4cfeb73d5d12cd5b5100e95"/></dir><file name="Items.php" hash="01e37c7ee401aa6b80d1ece47bb5c0a8"/></dir></dir><file name="Jewelryshare.php" hash="bbedf7e6b9af83cf30a06ff98847f7f4"/></dir><dir name="Helper"><file name="Data.php" hash="583953d868a0f9e820f642e9316f54a3"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Source"><dir name="Cron"><file name="Frequency.php" hash="157982f145c28e528d9a1baa1474aa9a"/><file name="Hours.php" hash="af3a105daaa3f1b9d12779270e7f7389"/></dir></dir></dir></dir><file name="Codes.php" hash="d3364c4fb3efc5b8c0a9b20e36b19577"/><file name="Import.php" hash="43baefae0ce560c3e86deab89970a066"/><file name="Importcron.php" hash="3e25435df67efa4739943a1ac49b2f4e"/><file name="Jewelryshare.php" hash="1a81cc9320f2862938f3de32b8aef228"/><dir name="Mysql4"><dir name="Codes"><file name="Collection.php" hash="108ffaa4a81851cef0523ad4e69b6a4a"/></dir><file name="Codes.php" hash="369c47bfb299953de7bb589e7c53dfcf"/><dir name="Jewelryshare"><file name="Collection.php" hash="995827e4401121ac018640a0116235c5"/></dir><file name="Jewelryshare.php" hash="c1949083da201ed4c3beb448f6f4a0a1"/><file name="Setup.php" hash="a5e601f2f9bdd74ee4d071f7b44b91d8"/></dir><file name="Observer.php" hash="5aa1d35df5f842dea67ba4f8b5c82913"/><dir name="Resource"><dir name="Codes"><file name="Collection.php" hash="9ae5ee4977f839eae5529430cea149d2"/></dir><file name="Codes.php" hash="d5c4c6d0ea0c53d5c9483e373c46c35d"/><file name="Setup.php" hash="d671e546f292d41e109a0dd05c38f2bb"/></dir><file name="Status.php" hash="0e4ad2aa81885846bea70a33f2742530"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Jewelryshare"><dir name="Codes"><file name="GridController.php" hash="f89b68945ac1593bae82702becb9fe3d"/></dir><dir name="Items"><file name="GridController.php" hash="3b1158d0e36ed1d0a01324bc8b32c1a0"/></dir></dir><file name="JewelryshareController.php" hash="9fa99287f44f697a575b7f2c1bfeb6d1"/></dir></dir><dir name="etc"><file name="config.xml" hash="4f4698ac474ffb0e0ea2e57dabadc4b7"/><file name="system.xml" hash="3fe851581dc7bc721b2a65a1e9de03d7"/></dir><dir name="sql"><dir name="jewelryshare_setup"><file name="mysql4-install-0.1.0.php" hash="cf2b169dc15ab3aacfaef4e6fef5e0f6"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="jewelerslink"><dir name="layout"><file name="jewelryshare.xml" hash="2c882425e9e4d2a1a8b5aea0f7e72aa7"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Jewelerslink_Jewelryshare.xml" hash="90d667cb2838d75a228701dc33f2ec69"/></dir></target><target name="mageweb"><dir><dir name="js"><dir name="jewelerslink"><file name="btn_bg.gif" hash="37c51a4d48a92da9648dcd3ca011039f"/><file name="content_bg.gif" hash="21278ea0da2d4256f4ced96b6080ba2e"/><file name="jewelerslink.css" hash="41a7b0279ce58c53afda35b3c02a0a64"/><file name="top_bg.gif" hash="26f28090de87d64f9b01bf624f89bfe2"/><file name="window_close.png" hash="3af14f053f360bf31f8ba2df73ec7f1e"/></dir></dir></dir></target></contents>
|
18 |
<compatible/>
|
19 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Jewelerslink_Jewelryshare</name>
|
4 |
+
<version>0.1.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
12 |
<notes>Share Jewelry Products to Jewelrslink.
|
13 |
Includes importing product from jewerlslink and Exporting products to Jewelerslink with attributes mapping functions.</notes>
|
14 |
<authors><author><name>John Dorsey</name><user>jewelerslink</user><email>support@idealbrandmarketing.com</email></author></authors>
|
15 |
+
<date>2014-02-03</date>
|
16 |
+
<time>10:38:30</time>
|
17 |
+
<contents><target name="magecommunity"><dir name="Jewelerslink"><dir name="Jewelryshare"><dir name="Block"><dir name="Adminhtml"><dir name="Edit"><dir name="Codes"><dir name="Edit"><file name="Form.php" hash="862f0625803dda26595c8dffea1c00db"/></dir></dir><file name="Codes.php" hash="7622b2901f4fa12ef746d23f5b0f52ef"/></dir><dir name="Jewelryshare"><dir name="Edit"><file name="Form.php" hash="2c1802fc7f6660a99d8fd73ef0bc0c7b"/><dir name="Tab"><file name="Import.php" hash="8846742c307b767b976af6135a71c72a"/><file name="Priceincrease.php" hash="6cd5181396c0bbb62df79cde4ebf1599"/><file name="Update.php" hash="72c7e63d769217d1fd8a86b37970e45b"/><file name="Vendor.php" hash="355e7536bbb62a609e8472ebfebb991e"/></dir><file name="Tabs.php" hash="05912b81eea239ad16b5528104fde50a"/></dir><file name="Edit.php" hash="3878e1bb83b25c789a74e41d35cbab37"/></dir><file name="Jewelryshare.php" hash="ac4e61454f5446c9f71c448e55344b7d"/><dir name="List"><dir name="Codes"><file name="Grid.php" hash="91745a1b7af27c8429ca64d92b9e9a6c"/></dir><file name="Codes.php" hash="b0559a0add7c44382f0c8f0718f5c7d5"/><dir name="Items"><file name="Grid.php" hash="14fac42fe4cfeb73d5d12cd5b5100e95"/></dir><file name="Items.php" hash="01e37c7ee401aa6b80d1ece47bb5c0a8"/></dir></dir><file name="Jewelryshare.php" hash="bbedf7e6b9af83cf30a06ff98847f7f4"/></dir><dir name="Helper"><file name="Data.php" hash="583953d868a0f9e820f642e9316f54a3"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Source"><dir name="Cron"><file name="Frequency.php" hash="157982f145c28e528d9a1baa1474aa9a"/><file name="Hours.php" hash="af3a105daaa3f1b9d12779270e7f7389"/></dir></dir></dir></dir><file name="Codes.php" hash="d3364c4fb3efc5b8c0a9b20e36b19577"/><file name="Import.php" hash="43baefae0ce560c3e86deab89970a066"/><file name="Importcron.php" hash="3e25435df67efa4739943a1ac49b2f4e"/><file name="Jewelryshare.php" hash="1a81cc9320f2862938f3de32b8aef228"/><dir name="Mysql4"><dir name="Codes"><file name="Collection.php" hash="108ffaa4a81851cef0523ad4e69b6a4a"/></dir><file name="Codes.php" hash="369c47bfb299953de7bb589e7c53dfcf"/><dir name="Jewelryshare"><file name="Collection.php" hash="995827e4401121ac018640a0116235c5"/></dir><file name="Jewelryshare.php" hash="c1949083da201ed4c3beb448f6f4a0a1"/><file name="Setup.php" hash="a5e601f2f9bdd74ee4d071f7b44b91d8"/></dir><file name="Observer.php" hash="5aa1d35df5f842dea67ba4f8b5c82913"/><dir name="Resource"><dir name="Codes"><file name="Collection.php" hash="9ae5ee4977f839eae5529430cea149d2"/></dir><file name="Codes.php" hash="d5c4c6d0ea0c53d5c9483e373c46c35d"/><file name="Setup.php" hash="d671e546f292d41e109a0dd05c38f2bb"/></dir><file name="Status.php" hash="0e4ad2aa81885846bea70a33f2742530"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Jewelryshare"><dir name="Codes"><file name="GridController.php" hash="f89b68945ac1593bae82702becb9fe3d"/></dir><dir name="Items"><file name="GridController.php" hash="3b1158d0e36ed1d0a01324bc8b32c1a0"/></dir></dir><file name="JewelryshareController.php" hash="9fa99287f44f697a575b7f2c1bfeb6d1"/></dir></dir><dir name="etc"><file name="config.xml" hash="4f4698ac474ffb0e0ea2e57dabadc4b7"/><file name="system.xml" hash="3fe851581dc7bc721b2a65a1e9de03d7"/></dir><dir name="sql"><dir name="jewelryshare_setup"><file name="mysql4-install-0.1.0.php" hash="cf2b169dc15ab3aacfaef4e6fef5e0f6"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="jewelerslink"><dir name="layout"><file name="jewelryshare.xml" hash="2c882425e9e4d2a1a8b5aea0f7e72aa7"/></dir><dir name="template"><dir name="jewelryshare"><dir name="head"><file name="window.phtml" hash="bca7164eb5cd37919f2db352834f7622"/></dir><dir name="tab"><file name="import.phtml" hash="fd64f35bdc4beb7f183813fce6293e0b"/><file name="priceincrease.phtml" hash="da9f076ef90ff479da04dae0fd402d35"/><file name="update.phtml" hash="f195a51ac230e01bb0b8645f6fdb1511"/><file name="vendor.phtml" hash="d64292d10e24e75adc5d20454bc7ac88"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Jewelerslink_Jewelryshare.xml" hash="90d667cb2838d75a228701dc33f2ec69"/></dir></target><target name="mageweb"><dir><dir name="js"><dir name="jewelerslink"><file name="btn_bg.gif" hash="37c51a4d48a92da9648dcd3ca011039f"/><file name="content_bg.gif" hash="21278ea0da2d4256f4ced96b6080ba2e"/><file name="jewelerslink.css" hash="41a7b0279ce58c53afda35b3c02a0a64"/><file name="top_bg.gif" hash="26f28090de87d64f9b01bf624f89bfe2"/><file name="window_close.png" hash="3af14f053f360bf31f8ba2df73ec7f1e"/></dir></dir></dir></target></contents>
|
18 |
<compatible/>
|
19 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
</package>
|