summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/mods/mod_productvariants/admin_edit.phtml36
-rw-r--r--views/mods/mod_productvariants/admin_html.phtml33
-rw-r--r--views/mods/mod_productvariants/frontend.js0
3 files changed, 45 insertions, 24 deletions
diff --git a/views/mods/mod_productvariants/admin_edit.phtml b/views/mods/mod_productvariants/admin_edit.phtml
index d491b74..b307c4e 100644
--- a/views/mods/mod_productvariants/admin_edit.phtml
+++ b/views/mods/mod_productvariants/admin_edit.phtml
@@ -27,9 +27,11 @@
<th class="col_artnr"><?php echo __('Artikelnummer', 'wpsg'); ?></th>
<th class="col_price"><?php echo __('Preis', 'wpsg'); ?></th>
<th class="col_stock"><?php echo __('Lagerbestand', 'wpsg'); ?></th>
- <?php } else { $colspan ++; ?>
- <th class="col_action"></th>
<?php } ?>
+
+ <?php if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { $colspan ++; ?>
+ <th class="col_action"></th>
+ <?php } ?>
</tr>
</thead>
@@ -47,7 +49,7 @@
<?php echo $vari['id']; ?>
<script type="text/javascript">/* <![CDATA[ */
- <?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?>
+ <?php if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { ?>
jQuery('#productvariation_name_<?php echo $vari['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: 'vari_name',
@@ -60,8 +62,8 @@
field: 'vari_shortname',
field_id: '<?php echo $vari['id']; ?>'
}
- });
- <?php } else { ?>
+ });
+ <?php } ?>
jQuery('#productvariation_active_<?php echo $vari['id']; ?>').bind('change', function() {
@@ -103,7 +105,7 @@
field_id: '<?php echo $vari['id']; ?>'
}
});
- <?php } ?>
+
/* ]]> */</script>
</td>
@@ -114,13 +116,15 @@
<td class="col_artnr"><span class="wpsg_editable" id="productvariation_anr_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['anr']); ?></span></td>
<td class="col_price"><span class="wpsg_editable" id="productvariation_price_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc(wpsg_ff($vari['price'], $this->get_option('wpsg_currency'))); ?></span></td>
<td class="col_stock"><span class="wpsg_editable" id="productvariation_stock_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['stock']); ?></span></td>
- <?php } else { ?>
- <td class="col_action">
+ <?php } ?>
+
+ <?php if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { ?>
+ <td class="col_action">
<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Variation löschen', 'wpsg'); ?>" onclick="return wpsg_mod_productvariation_del(<?php echo $vari['id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
</td>
- <?php } ?>
+ <?php } ?>
</tr>
@@ -176,5 +180,17 @@
<?php } ?>
<?php } else { ?>
-<?php echo __('Bisher keine Variationen der Variante angelegt.', 'wpsg'); ?>
+
+ <?php echo __('Bisher keine Variationen der Variante angelegt.', 'wpsg'); ?>
+
+ <script type="text/javascript">/* <![CDATA[ */
+
+ <?php if (wpsg_isSizedInt($this->view['variant']['product_id']) || !wpsg_isSizedInt($this->view['product_id'])) { ?>
+ jQuery('.wpsg_mod_productvariants_variation_add_button').show();
+ <?php } else { ?>
+ jQuery('.wpsg_mod_productvariants_variation_add_button').hide();
+ <?php } ?>
+
+ /* ]]> */</script>
+
<?php } ?> \ No newline at end of file
diff --git a/views/mods/mod_productvariants/admin_html.phtml b/views/mods/mod_productvariants/admin_html.phtml
index dda39e7..5f07b73 100644
--- a/views/mods/mod_productvariants/admin_html.phtml
+++ b/views/mods/mod_productvariants/admin_html.phtml
@@ -9,15 +9,18 @@
<div id="wpsg_mod_productvariants_dialog" class="wpsg_mod_productvariants_dialog_noDialog">
- <div class="modal-body">
+ <div class="modal-body">
- </div>
- <div class="modal-footer">
-
- <button type="button" class="btn-sm wpsg_mod_productvariants_variants btn btn-default" onclick="return wpsg_mod_productvariants_add();"><span class="glyphicon glyphicon-plus"></span>&nbsp;<?php echo __('Neue Produktvariante', 'wpsg'); ?></button>
- <button type="button" class="btn-sm wpsg_mod_productvariants_variants_vari btn btn-default" id="wpsg_mod_productvariants_variation_add_button" style="display:none;" onclick="return wpsg_mod_productvariants_variation_add();"><span class="glyphicon glyphicon-plus"></span>&nbsp;<?php echo __('Neue Variation', 'wpsg'); ?></button>
+ </div>
+ <div class="modal-footer">
+
+ <button type="button" class="btn-sm wpsg_mod_productvariants_variants btn btn-default" onclick="return wpsg_mod_productvariants_add();"><span class="glyphicon glyphicon-plus"></span>&nbsp;<?php
+
+ echo ((wpsg_isSizedInt($_REQUEST['edit_id'])?__('Neue Produktvariante', 'wpsg'):__('Neue Variante', 'wpsg')));
+
+ ?></button>
- </div>
+ </div>
</div>
@@ -33,14 +36,14 @@
</div>
<div class="modal-footer">
- <button type="button" class="btn-sm wpsg_mod_productvariants_variants_vari btn btn-default" id="wpsg_mod_productvariants_variation_add_button" style="display:none;" onclick="return wpsg_mod_productvariants_variation_add();"><span class="glyphicon glyphicon-plus"></span>&nbsp;<?php echo __('Neue Variation', 'wpsg'); ?></button>
- <button type="button" class="btn-sm wpsg_mod_productvariants_variants_vari btn btn-default" style="display:none;" onclick="return wpsg_mod_productvariants_back();"><span class="glyphicon glyphicon-chevron-left"></span>&nbsp;<?php echo __('Schließen', 'wpsg'); ?></button>
+ <button type="button" class="btn-sm wpsg_mod_productvariants_variation_add_button btn btn-default" id="wpsg_mod_productvariants_variation_add_button" style="display:none;" onclick="return wpsg_mod_productvariants_variation_add();"><span class="glyphicon glyphicon-plus"></span>&nbsp;<?php echo __('Neue Variation', 'wpsg'); ?></button>
+ <button type="button" class="btn-sm wpsg_mod_productvariants_variants_close wpsg_mod_productvariants_variants_vari btn btn-default" style="display:none;" onclick="return wpsg_mod_productvariants_back();"><span class="glyphicon glyphicon-remove"></span>&nbsp;<?php echo __('Schließen', 'wpsg'); ?></button>
</div>
</div>
</div>
</div>
-
+
<script type="text/javascript">/* <![CDATA[ */
function wpsg_mod_productvariants_del(variant_id)
@@ -79,8 +82,8 @@
var vari_id = jQuery('#wpsg_mod_productvariants_var_id').val();
- jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', true);
- jQuery('#wpsg_mod_productvariants_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+ jQuery('#wpsg_mod_productvariants_dialog_modal button').prop('disabled', true);
+ jQuery('#wpsg_mod_productvariants_dialog_modal .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
jQuery.ajax( {
url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
@@ -91,8 +94,8 @@
},
success: function(data) {
- jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
- jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false);
+ jQuery('#wpsg_mod_productvariants_dialog_modal .modal-body').html(data);
+ jQuery('#wpsg_mod_productvariants_dialog_modal button').prop('disabled', false);
}
} );
@@ -108,6 +111,8 @@
jQuery('#wpsg_mod_productvariants_dialog_modal button').prop('disabled', true);
jQuery('#wpsg_mod_productvariants_dialog_modal .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+ jQuery('.wpsg_mod_productvariants_variants_close').show();
+
jQuery('#wpsg_mod_productvariants_dialog_modal').modal( { } ).modal('show');
jQuery.ajax( {
diff --git a/views/mods/mod_productvariants/frontend.js b/views/mods/mod_productvariants/frontend.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/views/mods/mod_productvariants/frontend.js