diff options
| -rw-r--r-- | views/admin/kundendaten_tab2.phtml | 4 | ||||
| -rw-r--r-- | views/admin/module.phtml | 11 | ||||
| -rw-r--r-- | views/css/admin.css | 17 | ||||
| -rw-r--r-- | views/js/admin.js | 6 | ||||
| -rw-r--r-- | views/js/editable.js | 7 | ||||
| -rw-r--r-- | views/mods/mod_productgroups/produkt_addedit_sidebar.phtml | 5 | ||||
| -rw-r--r-- | views/mods/mod_productvariants/admin_edit.phtml | 172 | ||||
| -rw-r--r-- | views/mods/mod_productvariants/admin_html.phtml | 226 | ||||
| -rw-r--r-- | views/mods/mod_productvariants/admin_show.phtml | 102 | ||||
| -rw-r--r-- | views/mods/mod_productvariants/produkt_addedit_content.phtml | 33 | ||||
| -rw-r--r-- | views/mods/mod_productvariants/settings_edit.phtml | 22 |
11 files changed, 596 insertions, 9 deletions
diff --git a/views/admin/kundendaten_tab2.phtml b/views/admin/kundendaten_tab2.phtml index 7be3fa8..836256a 100644 --- a/views/admin/kundendaten_tab2.phtml +++ b/views/admin/kundendaten_tab2.phtml @@ -45,7 +45,7 @@ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Kundenvariable löschen', 'wpsg'); ?>" onclick="return wpsg_removeCustomField(<?php echo $c_id; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
- <script type="text/javascript">
+ <script type="text/javascript">/* <![CDATA[ */
jQuery('#kundenvariable_name_<?php echo $c_id; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=kundendaten&do=inlinedit&noheader=1', {
submitdata: {
@@ -59,7 +59,7 @@ });
- </script>
+ /* ]]> */</script>
</td>
</tr>
diff --git a/views/admin/module.phtml b/views/admin/module.phtml index 2185d1f..4e1ee4b 100644 --- a/views/admin/module.phtml +++ b/views/admin/module.phtml @@ -37,14 +37,14 @@ <?php echo wpsg_drawForm_AdminboxStart($this->arAllModule[$_REQUEST['modul']]->name); ?>
<form name="form1" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=<?php echo $_REQUEST['modul']; ?>&noheader=1" method="post" enctype="multipart/form-data">
- <h3>
+ <!-- <h3>
<?php echo $this->arAllModule[$_REQUEST['modul']]->name; ?>
<?php if (isset($this->arAllModule[$_REQUEST['modul']]->hilfeURL) && $this->arAllModule[$_REQUEST['modul']]->hilfeURL != '') { ?>
<a target="_blank" href="<?php echo $this->arAllModule[$_REQUEST['modul']]->hilfeURL; ?>" class="wpsg_form_help_notip"></a>
<?php } ?>
- </h3>
+ </h3> -->
- <p><?php echo $this->arAllModule[$_REQUEST['modul']]->desc; ?></p>
+ <p><?php echo $this->arAllModule[$_REQUEST['modul']]->desc; ?></p><br />
<?php $modul_install = $this->get_option($_REQUEST['modul'], $this->view['global']); ?>
<?php echo wpsg_drawForm_Select('aktiv', __('Modul aktiviert', 'wpsg'), array('0' => __('Nein', 'wpsg'), '1' => __('Ja', 'wpsg')), ((wpsg_isSizedInt($modul_install))?'1':'0')); ?>
@@ -94,6 +94,11 @@ <?php if ($this->arAllModule[$_REQUEST['modul']]->inline !== true) { ?>
</form>
<?php } ?>
+
+ <?php if (array_key_exists($_REQUEST['modul'], $this->arModule) && (!isset($this->arAllModule[$_REQUEST['modul']]->version) || (($this->arAllModule[$_REQUEST['modul']]->free === true || (is_array($this->arLizenz) && in_array($_REQUEST['modul'], (array)$this->arLizenz['mods'])) || $this->arAllModule[$_REQUEST['modul']]->getDemoDays() > 0)))) { ?>
+ <?php echo $this->arModule[$_REQUEST['modul']]->settings_edit_afterform(); ?>
+ <?php } ?>
+
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
</div>
<?php } else { ?>
diff --git a/views/css/admin.css b/views/css/admin.css index a46a738..ab93e34 100644 --- a/views/css/admin.css +++ b/views/css/admin.css @@ -30,6 +30,7 @@ #wpsg-bs .list-group-head { background-color:#666666; color:#FFFFFF; border:1px solid #666666; }
#wpsg-bs .wpsg_admin_submenu .list-group-item.active { color:#FFFFFF; }
#wpsg-bs .list-group-head a { color:#FFFFFF; }
+#wpsg-bs .modal-dialog { width:70%; }
/* Inline Edit */
#wpsg-bs .editableform > .control-group > div { padding-left:15px; padding-right:15px; }
@@ -83,7 +84,7 @@ .wpsg_admin_submenu { width:180px; float:left; }
.wpsg_admin_content { padding-left:20px; width:800px; float:left; }
.wpsg_admin_content h3 { margin:20px; }
-.wpsg_admin_content h3.panel-title { margin-bottom:0px; }
+.wpsg_admin_content h3.panel-title { margin:0px; }
.wpsg_admin_submenu .list-group-item { padding:5px 10px; }
.list-group { margin-bottom:15px !important; }
@@ -127,4 +128,18 @@ .wpsg_produkt_pa_label { margin-left:10px; }
#wpsg_produktattribute .wpsg_form_field { padding:10px 0; }
+/* Modul Produktvarianten */
+.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_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; }
+.wpsg_mod_productvariants_table_variation .col_id { width:50px; }
+.wpsg_mod_productvariants_table_variation .col_active { width:25px; }
+.wpsg_mod_productvariants_info { font-style:italic; font-size:0.9em; }
+.wpsg_mod_productvariants_dialog_noDialog { border:1px solid #DDDDDD; padding:5px; margin:-5px; margin-top:15px; margin-bottom:15px; }
+.wpsg_mod_productvariants_dialog_noDialog .modal-body { padding:1rem 0px; }
+.wpsg_mod_productvariants_dialog_noDialog .modal-footer { padding:1rem 0px; }
+
#beschreibung_ifr { height:500px; }
\ No newline at end of file diff --git a/views/js/admin.js b/views/js/admin.js index f1ad1d3..a8b254d 100644 --- a/views/js/admin.js +++ b/views/js/admin.js @@ -19,6 +19,12 @@ wpsg_number_format = function (number, decimals, dec_point, thousands_sep) { ui.children().each(function() {
+ jQuery(this).find('td').each(function() {
+
+ jQuery(this).width(jQuery(this).width());
+
+ } );
+
jQuery(this).width(jQuery(this).width());
} );
diff --git a/views/js/editable.js b/views/js/editable.js index 6bf8e65..7da81f2 100644 --- a/views/js/editable.js +++ b/views/js/editable.js @@ -20,7 +20,12 @@ if(jQuery.trim(value) == '') { return wpsg_ajax.ie_validate_empty; }
- }
+ },
+ 'display': function(value, sourceData) {
+
+ jQuery(this).html(sourceData);
+
+ }
} );
} );
diff --git a/views/mods/mod_productgroups/produkt_addedit_sidebar.phtml b/views/mods/mod_productgroups/produkt_addedit_sidebar.phtml index c48ca36..78fc497 100644 --- a/views/mods/mod_productgroups/produkt_addedit_sidebar.phtml +++ b/views/mods/mod_productgroups/produkt_addedit_sidebar.phtml @@ -22,8 +22,9 @@ <?php } ?>
<br /><br />
- <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&page=wpsg-Productgroups"><?php echo __('Produktgruppenverwaltung', 'wpsg'); ?></a>
- <br /><br />
+
+ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&page=wpsg-Productgroups"><span class="wpsg-glyphicon glyphicon glyphicon-book"></span><?php echo __('Produktgruppenverwaltung', 'wpsg'); ?></a><br />
<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productgroups"><span class="wpsg-glyphicon glyphicon glyphicon-wrench"></span><?php echo __('Zur Konfiguration der Produktgruppe', 'wpsg'); ?></a>
+
</div>
</div>
\ No newline at end of file diff --git a/views/mods/mod_productvariants/admin_edit.phtml b/views/mods/mod_productvariants/admin_edit.phtml new file mode 100644 index 0000000..4896638 --- /dev/null +++ b/views/mods/mod_productvariants/admin_edit.phtml @@ -0,0 +1,172 @@ +<?php
+
+ /**
+ * Template um eine Variante zu bearbeiten
+ */
+
+?>
+
+<input type="hidden" id="wpsg_mod_productvariants_product_id" value="<?php echo $this->view['product_id']; ?>" />
+<input type="hidden" id="wpsg_mod_productvariants_var_id" value="<?php echo $this->view['variant']['id']; ?>" />
+
+<?php if (wpsg_isSizedArray($this->view['arVariation'])) { ?>
+
+ <table class="table wpsg_mod_productvariants_table_variation">
+ <thead>
+ <tr>
+
+ <?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
+ <th class="col_active"></th>
+ <?php } ?>
+
+ <th class="col_id"><?php echo __('Id', 'wpsg'); ?></th>
+ <th class="col1"><?php echo __('Name', 'wpsg'); ?></th>
+
+ <?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
+ <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 { ?>
+ <th class="col_action"></th>
+ <?php } ?>
+
+ </tr>
+ </thead>
+ <?php $i = 0; foreach ($this->view['arVariation'] as $vari) { $i ++; ?>
+ <tbody id="vari_<?php echo $vari['id']; ?>">
+ <tr>
+
+ <?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
+ <td class="col_active">
+ <input type="checkbox" id="productvariation_active_<?php echo $vari['id']; ?>" name="active" value="1" <?php echo ((wpsg_isSizedString($vari['active'], '1'))?'checked="checked"':''); ?> />
+ </td>
+ <?php } ?>
+
+ <td class="col_id">
+ <?php echo $vari['id']; ?>
+ <script type="text/javascript">/* <![CDATA[ */
+
+ <?php if (!wpsg_isSizedInt($this->view['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',
+ field_id: '<?php echo $vari['id']; ?>'
+ }
+ });
+ <?php } else { ?>
+
+ jQuery('#productvariation_active_<?php echo $vari['id']; ?>').bind('change', function() {
+
+ var value = '0';
+ if (jQuery(this).prop('checked') === true) value = '1';
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1',
+ data: {
+ field: 'vari_active',
+ field_id: '<?php echo $vari['id']; ?>',
+ product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
+ value: value
+ }
+ } );
+
+ } );
+
+ jQuery('#productvariation_anr_<?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_anr',
+ product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
+ field_id: '<?php echo $vari['id']; ?>'
+ }
+ });
+
+ jQuery('#productvariation_price_<?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_price',
+ product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
+ field_id: '<?php echo $vari['id']; ?>'
+ }
+ });
+
+ jQuery('#productvariation_stock_<?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_stock',
+ product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
+ field_id: '<?php echo $vari['id']; ?>'
+ }
+ });
+ <?php } ?>
+
+ /* ]]> */</script>
+ </td>
+ <td class="col1"><span class="wpsg_editable" id="productvariation_name_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['name']); ?></span></td>
+
+ <?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
+ <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">
+
+ <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 } ?>
+
+ </tr>
+
+ <?php /* ?>
+ <tr>
+ <td class="col_id"> </td>
+ <td class="col_image" colspan="5">
+ TODO: Bilder
+ </td>
+ </tr>
+ */ ?>
+ </tbody>
+ <?php } ?>
+
+ </table>
+
+ <script type="text/javascript">/* <![CDATA[ */
+
+ <?php if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { ?>
+
+ jQuery('.wpsg_mod_productvariants_table_variation').sortable( {
+ items: 'tbody',
+ helper: wpsg_Tablefix,
+ update: function(event, ui) {
+
+ var wpsg_reorder = jQuery(this).sortable('toArray');
+ var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1',
+ data: {
+ 'field': 'vari_pos',
+ 'value': jQuery(this).sortable('toArray'),
+ 'product_id': product_id
+ },
+ success: function(data) { }
+ } );
+
+ }
+ } ).disableSelection();
+
+ <?php } ?>
+
+ <?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 if (!wpsg_isSizedInt($this->view['product_id'])) { ?>
+ <p class="wpsg_hinweis"><?php echo __('Reihenfolge kann mittels Drag&Drop verändert werden.', 'wpsg'); ?></p>
+ <?php } ?>
+
+<?php } else { ?>
+<?php echo __('Bisher keine Variationen der Variante angelegt.', 'wpsg'); ?>
+<?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 new file mode 100644 index 0000000..f2aa433 --- /dev/null +++ b/views/mods/mod_productvariants/admin_html.phtml @@ -0,0 +1,226 @@ +<?php
+
+ /**
+ * HTML Teil für die Produktvariablenverwaltung
+ * (GLOBAL und Produktbezogen)
+ */
+
+?>
+
+<div id="wpsg_mod_productvariants_dialog" class="wpsg_mod_productvariants_dialog_noDialog">
+
+ <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> <?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> <?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> <?php echo __('Zurück', 'wpsg'); ?></button>
+ </div>
+
+</div>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+ function wpsg_mod_productvariants_del(variant_id)
+ {
+
+ if (!confirm('<?php echo __('Sind Sie sich sicher, dass Sie die Variante löschen möchten?', 'wpsg'); ?>')) return false;
+
+ var product_id = jQuery('#wpsg_mod_productvariants_product_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.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+ data: {
+ 'subaction': 'admin_del',
+ 'variant_id': variant_id,
+ 'product_id': product_id
+ },
+ success: function(data) {
+
+ jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+ jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false);
+
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_mod_productvariants_del(variant_id)
+
+ function wpsg_mod_productvariation_del(variation_id)
+ {
+
+ if (!confirm('<?php echo __('Sind Sie sich sicher, dass Sie die Variation löschen möchten?', 'wpsg'); ?>')) return false;
+
+ 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.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+ data: {
+ 'subaction': 'admin_variation_del',
+ 'variation_id': variation_id,
+ 'variant_id': vari_id
+ },
+ success: function(data) {
+
+ jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+ jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false);
+
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_mod_productvariation_del(variation_id)
+
+ function wpsg_mod_productvariants_edit(variant_id)
+ {
+
+ var product_id = jQuery('#wpsg_mod_productvariants_product_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.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+ data: {
+ 'subaction': 'admin_edit',
+ 'variant_id': variant_id,
+ 'product_id': product_id
+ },
+ success: function(data) {
+
+ jQuery('.wpsg_mod_productvariants_variants').hide();
+ jQuery('.wpsg_mod_productvariants_variants_vari').show();
+
+ jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+
+ jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false);
+
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_mod_productvariants_edit(variant_id)
+
+ function wpsg_mod_productvariants_variation_add()
+ {
+
+ var variant_id = jQuery('#wpsg_mod_productvariants_var_id').val();
+ var product_id = jQuery('#wpsg_mod_productvariants_product_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.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+ data: {
+ 'subaction': 'admin_variation_add',
+ 'variant_id': variant_id,
+ 'product_id': product_id
+ },
+ success: function(data) {
+
+ jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+ jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false);
+
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_mod_productvariants_variation_add()
+
+ function wpsg_mod_productvariants_add()
+ {
+
+ var product_id = jQuery('#wpsg_mod_productvariants_product_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.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+ data: {
+ 'subaction': 'admin_add',
+ 'product_id': product_id
+ },
+ success: function(data) {
+
+ jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+ jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false);
+
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_mod_productvariants_add()
+
+ function wpsg_mod_productvariants_back()
+ {
+
+ var product_id = jQuery('#wpsg_mod_productvariants_product_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.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+ data: {
+ 'subaction': 'admin_show',
+ 'product_id': product_id
+ },
+ success: function(data) {
+
+ jQuery('.wpsg_mod_productvariants_variants').show();
+ jQuery('.wpsg_mod_productvariants_variants_vari').hide();
+ jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false);
+
+ jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_mod_productvariants_back()
+
+ function wpsg_mod_productvariants_show(product_id)
+ {
+
+ 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.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+ data: {
+ 'subaction': 'admin_show',
+ 'product_id': product_id
+ },
+ success: function(data) {
+
+ jQuery('.wpsg_mod_productvariants_variants').show();
+ jQuery('.wpsg_mod_productvariants_variants_vari').hide();
+
+ jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+ jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false);
+
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_mod_productvariants_show()
+
+/* ]]> */</script>
\ No newline at end of file diff --git a/views/mods/mod_productvariants/admin_show.phtml b/views/mods/mod_productvariants/admin_show.phtml new file mode 100644 index 0000000..099d8a2 --- /dev/null +++ b/views/mods/mod_productvariants/admin_show.phtml @@ -0,0 +1,102 @@ +<?php
+
+ /**
+ * Verwaltung der Produktvarianten im Backend
+ */
+
+?>
+
+<input type="hidden" id="wpsg_mod_productvariants_product_id" value="<?php echo $this->view['product_id']; ?>" />
+
+<?php if (wpsg_isSizedArray($this->view['arVariants'])) { ?>
+
+ <table class="table table-striped wpsg_mod_productvariants_table_variants">
+ <thead>
+ <tr>
+ <th class="col_id"><?php echo __('Id', 'wpsg'); ?></th>
+ <th class="col1"><?php echo __('Name', 'wpsg'); ?></th>
+ <th class="col_vari"><?php echo __('Variationen', 'wpsg'); ?></th>
+
+ <?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?>
+ <th class="col_products"><?php echo __('Produkte', 'wpsg'); ?></th>
+ <?php } ?>
+
+ <th class="col_action"></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach ($this->view['arVariants'] as $var) { ?>
+ <tr id="var_<?php echo $var['id']; ?>">
+ <td class="col_id"><?php echo $var['id']; ?></td>
+ <td class="col1">
+ <span class="wpsg_editable" id="productvariants_name_<?php echo $var['id']; ?>"><?php echo wpsg_hspc($var['name']); ?></span>
+ <?php if (wpsg_isSizedInt($var['product_id'])) { ?>
+ <span class="wpsg_mod_productvariants_info"><?php echo __('(Produktbezogen)', 'wpsg'); ?></span>
+ <?php } ?>
+ </td>
+ <td class="col_vari"><?php
+
+ if (wpsg_isSizedInt($this->view['product_id'])) echo $var['count_active'].'/'.$var['count_variation'];
+ else echo $var['count_variation'];
+
+ ?></td>
+ <?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?>
+ <td class="col_products"><?php echo wpsg_hspc($var['count_produkte']); ?></td>
+ <?php } ?>
+ <td class="col_action">
+
+ <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']; ?>'
+ }
+ });
+ <?php } ?>
+
+ /* ]]> */</script>
+
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Variante bearbeiten', 'wpsg'); ?>" onclick="return wpsg_mod_productvariants_edit(<?php echo $var['id']; ?>);"><span class="glyphicon glyphicon-pencil"></span></a>
+
+ <?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']))) { ?>
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Variante löschen', 'wpsg'); ?>" onclick="return wpsg_mod_productvariants_del(<?php echo $var['id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
+ <?php } ?>
+
+ </td>
+ </tr>
+ <?php } ?>
+ </tbody>
+ </table>
+
+ <p class="wpsg_hinweis"><?php echo __('Reihenfolge kann mittels Drag&Drop verändert werden.', 'wpsg'); ?></p>
+
+ <script>/* <![CDATA[ */
+
+ jQuery('.wpsg_mod_productvariants_table_variants tbody').sortable( {
+ items: 'tr',
+ helper: wpsg_Tablefix,
+ update: function(event, ui) {
+
+ var wpsg_reorder = jQuery(this).sortable('toArray');
+ var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1',
+ data: {
+ 'field': 'pos',
+ 'product_id': product_id,
+ 'value': jQuery(this).sortable('toArray')
+ },
+ success: function(data) { }
+ } );
+
+ }
+ } ).disableSelection();
+
+ /* ]]> */</script>
+
+<?php } else { ?>
+<?php echo __('Bisher keine Produktvarianten angelegt.', 'wpsg'); ?>
+<?php } ?>
\ No newline at end of file diff --git a/views/mods/mod_productvariants/produkt_addedit_content.phtml b/views/mods/mod_productvariants/produkt_addedit_content.phtml new file mode 100644 index 0000000..21b3e43 --- /dev/null +++ b/views/mods/mod_productvariants/produkt_addedit_content.phtml @@ -0,0 +1,33 @@ +<?php
+
+ /**
+ * Template für die Verwaltung der Produktvarianten innerhalb des Produktes
+ */
+
+?>
+
+<?php echo wpsg_drawForm_AdminboxStart(__('Produktvarianten', 'wpsg')); ?>
+
+<?php if (wpsg_isSizedInt($this->view['data']['id'])) { ?>
+
+ <?php echo $this->view['wpsg_mod_productvariants']['html']; ?>
+
+ <script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+
+ wpsg_mod_productvariants_show(<?php echo $this->view['data']['id']; ?>);
+
+ } );
+
+ /* ]]> */</script>
+
+<?php } else { ?>
+
+ <?php echo __('Bitte speichern Sie das Produkt zuerst.', 'wpsg'); ?>
+
+<?php } ?>
+
+<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants"><span class="wpsg-glyphicon glyphicon glyphicon-wrench"></span><?php echo __('Zur Konfiguration der Produktvarianten', 'wpsg'); ?></a>
+
+<?php echo wpsg_drawForm_AdminboxEnd(); ?>
\ No newline at end of file diff --git a/views/mods/mod_productvariants/settings_edit.phtml b/views/mods/mod_productvariants/settings_edit.phtml new file mode 100644 index 0000000..019f4f5 --- /dev/null +++ b/views/mods/mod_productvariants/settings_edit.phtml @@ -0,0 +1,22 @@ +<?php
+
+ /*
+ * Template für die Einstellungen des Moduls
+ */
+
+?>
+
+<h4><?php echo __('Verwaltung der globalen Produktvarianten', 'wpsg'); ?></h4>
+
+<?php echo $this->view['wpsg_mod_productvariants']['html']; ?>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+
+ wpsg_mod_productvariants_show(0);
+
+ } );
+
+/* ]]> */</script>
+
\ No newline at end of file |
