summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/css/admin.css1
-rw-r--r--views/js/editable.js43
-rw-r--r--views/mods/mod_productvariants/admin_show.phtml13
3 files changed, 50 insertions, 7 deletions
diff --git a/views/css/admin.css b/views/css/admin.css
index ab93e34..3779d03 100644
--- a/views/css/admin.css
+++ b/views/css/admin.css
@@ -132,6 +132,7 @@
.wpsg_mod_productvariants_table_variants .col_action { text-align:right; width:60px; }
.wpsg_mod_productvariants_table_variants .col_products { text-align:center; width:75px; }
.wpsg_mod_productvariants_table_variants .col_vari { width:75px; text-align:center; }
+.wpsg_mod_productvariants_table_variants .col_type { width:100px; }
.wpsg_mod_productvariants_table_variants .col_id { width:50px; }
.wpsg_mod_productvariants_table_variation .col_action { text-align:right; width:75px; }
.wpsg_mod_productvariants_table_variation tbody:nth-child(even) td { background-color:#F9F9F9; }
diff --git a/views/js/editable.js b/views/js/editable.js
index 7da81f2..d05345a 100644
--- a/views/js/editable.js
+++ b/views/js/editable.js
@@ -6,7 +6,7 @@
return this.each(function() {
- jQuery(this).editable( {
+ var opt = {
'type': 'text',
'url': url,
'pk': 1,
@@ -20,13 +20,42 @@
if(jQuery.trim(value) == '') { return wpsg_ajax.ie_validate_empty; }
- },
- 'display': function(value, sourceData) {
-
- jQuery(this).html(sourceData);
+ }
+ };
+
+ if (options.type == 'select' && typeof options.data == "string") {
+
+ var ar = [];
+ var arData = jQuery.parseJSON(options.data);
+
+ for (var i in arData)
+ {
+
+ ar.push( {
+ 'value': i,
+ 'text': arData[i]
+ } );
+
+ if (arData[i] == jQuery(this).text()) opt.value = i;
- }
- } );
+ }
+
+ opt.type = 'select';
+ opt.source = ar;
+
+ }
+ else
+ {
+
+ opt.display = function(value, sourceData) {
+
+ jQuery(this).html(sourceData);
+
+ };
+
+ }
+
+ jQuery(this).editable(opt);
} );
diff --git a/views/mods/mod_productvariants/admin_show.phtml b/views/mods/mod_productvariants/admin_show.phtml
index 099d8a2..780dc53 100644
--- a/views/mods/mod_productvariants/admin_show.phtml
+++ b/views/mods/mod_productvariants/admin_show.phtml
@@ -15,6 +15,7 @@
<tr>
<th class="col_id"><?php echo __('Id', 'wpsg'); ?></th>
<th class="col1"><?php echo __('Name', 'wpsg'); ?></th>
+ <th class="col_type"><?php echo __('Typ', 'wpsg'); ?></th>
<th class="col_vari"><?php echo __('Variationen', 'wpsg'); ?></th>
<?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?>
@@ -34,6 +35,7 @@
&nbsp;<span class="wpsg_mod_productvariants_info"><?php echo __('(Produktbezogen)', 'wpsg'); ?></span>
<?php } ?>
</td>
+ <td class="col_type"><span class="wpsg_editable" id="productvariants_type_<?php echo $var['id']; ?>"><?php echo $var['type_label']; ?></span></td>
<td class="col_vari"><?php
if (wpsg_isSizedInt($this->view['product_id'])) echo $var['count_active'].'/'.$var['count_variation'];
@@ -48,12 +50,23 @@
<script type="text/javascript">/* <![CDATA[ */
<?php if ((wpsg_isSizedInt($this->view['product_id']) && $this->view['product_id'] == $var['product_id']) || (!wpsg_isSizedInt($var['product_id']) && !wpsg_isSizedInt($this->view['product_id']))) { ?>
+
jQuery('#productvariants_name_<?php echo $var['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
submitdata: {
field: 'name',
field_id: '<?php echo $var['id']; ?>'
}
});
+
+ jQuery('#productvariants_type_<?php echo $var['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
+ submitdata: {
+ field: 'type',
+ field_id: '<?php echo $var['id']; ?>'
+ },
+ data: '<?php echo json_encode(wpsg_mod_productvariants::$arTypeLabel); ?>',
+ type: 'select'
+ });
+
<?php } ?>
/* ]]> */</script>