diff options
| author | hartmut <noreply@maennchen1.de> | 2017-03-17 10:19:08 +0000 |
|---|---|---|
| committer | hartmut <noreply@maennchen1.de> | 2017-03-17 10:19:08 +0000 |
| commit | a6ce790f1f3d111964c82d90f44470d8b5683319 (patch) | |
| tree | 25b960f25b2913e8e21b7741a27e210569d6c58f | |
| parent | 56490ae4ba4832daa77ef6f65b7bfedf0b59a097 (diff) | |
Anpassungen Kunden, Bestellungen, Varianten
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@6136 0d5edaf7-2b12-4e95-93f4-047927463d4b
| -rw-r--r-- | views/css/back.css | 10 | ||||
| -rw-r--r-- | views/mods/mod_productvariants/admin_edit.phtml | 65 | ||||
| -rw-r--r-- | views/mods/mod_productvariants/admin_html.phtml | 26 | ||||
| -rw-r--r-- | views/produkttemplates/standard.phtml | 2 |
4 files changed, 81 insertions, 22 deletions
diff --git a/views/css/back.css b/views/css/back.css index 37a5dd9..f84ddda 100644 --- a/views/css/back.css +++ b/views/css/back.css @@ -467,11 +467,11 @@ table.wpsg_admin_laender_list tr.even td {} #wpsg_vp_drawVarianten .col_variname { width:350px; }
#wpsg_vp_drawVarianten .col_variartnr { width:200px; text-align:left; }
#wpsg_vp_drawVarianten .col_stock { width:100px; text-align:left; }
-#wpsg_vp_drawVarianten .wpsg_mod_varianten_productimage_row .pic { display:block; float:left; margin-right:5px; padding:5px; height:25px; width:25px; }
-#wpsg_vp_drawVarianten .wpsg_mod_varianten_productimage_row .mark { background-color:rgb(174, 174, 174); }
-#wpsg_vp_drawVarianten .wpsg_mod_varianten_orderwrap_image .wpsg_mod_varianten_productimage_row .mark:first-of-type { background-color:black; }
-#wpsg_vp_drawVarianten .wpsg_mod_varianten_ajaxloading { width:100%; height:100%; position:absolute; left:0px; top:0px; background-color:rgba(125, 125, 125, 0.5); margin-top:-10px; padding-bottom:21px; }
-#wpsg_vp_drawVarianten .wpsg_mod_varianten_ajaxloading img { position:absolute; left:50%; top:50%; margin-left:-8px; margin-top:-5.5px; }
+#wpsg_vp_drawVarianten .wpsg_mod_productvariants_productimage_row .pic { display:block; float:left; margin-right:5px; padding:5px; height:25px; width:25px; }
+#wpsg_vp_drawVarianten .wpsg_mod_productvariants_productimage_row .mark { background-color:rgb(174, 174, 174); }
+#wpsg_vp_drawVarianten .wpsg_mod_productvariants_orderwrap_image .wpsg_mod_productvariants_productimage_row .mark:first-of-type { background-color:black; }
+#wpsg_vp_drawVarianten .wpsg_mod_productvariants_ajaxloading { width:100%; height:100%; position:absolute; left:0px; top:0px; background-color:rgba(125, 125, 125, 0.5); margin-top:-10px; padding-bottom:21px; }
+#wpsg_vp_drawVarianten .wpsg_mod_productvariants_ajaxloading img { position:absolute; left:50%; top:50%; margin-left:-8px; margin-top:-5.5px; }
/*
* Gutscheinmodul
diff --git a/views/mods/mod_productvariants/admin_edit.phtml b/views/mods/mod_productvariants/admin_edit.phtml index 4a1f691..edd0a59 100644 --- a/views/mods/mod_productvariants/admin_edit.phtml +++ b/views/mods/mod_productvariants/admin_edit.phtml @@ -128,27 +128,64 @@ </tr>
- <tr>
+ <tr class="wpsg_mod_productvariants_productimage_row">
<td class="col_id"> </td>
- <td class="col_image" colspan="<?php echo $colspan; ?>">
- TODO: Bilder
- <?php
- $pbArr = $this->callMod('wpsg_mod_produktbilder', 'getProduktBilder_MT', array($this->view['product_id']));
- $k = $this->view['variant']['id'];
- $kv = $vari['id'];
- $temp = $this->callMod('wpsg_mod_productvariants', 'getVariImages', array($this->view['product_id'], $k, $kv));
- ?>
- <?php $j = 0; foreach ($pbArr as $b) { $j ++; ?>
+ <?php
+ $pbArr = $this->callMod('wpsg_mod_produktbilder', 'getProduktBilder_MT', array($this->view['product_id']));
+ $k = $this->view['variant']['id'];
+ $kv = $vari['id'];
+ $temp = $this->callMod('wpsg_mod_productvariants', 'getVariImages', array($this->view['product_id'], $k, $kv));
+ ?>
+ <td class="ui-sortable" colspan="<?php echo $colspan; ?>" id="wpsg_mod_productvariants_productimage_<?php echo $k; ?>_<?php echo $kv; ?>" >
+ <?php $j = 0; foreach ($temp as $b) { $j ++; ?>
<?php // $this->view['variant']['id'] $vari $var $kv $_REQUEST['pic']
$file = $b['basename'];
$href = wp_get_attachment_image_src($b['post_id'], Array(25, 25));
?>
- <a class="<?php //echo ((in_array($file, explode(",", $vari['pic'])))?'mark':''); ?> pic" id="<?php echo $file; ?>"
- onclick="return wpsg_vp_vari_setPic(this, <?php echo $k; ?>, <?php echo $kv; ?>, '<?php echo $file; ?>', <?php echo $j; ?>);" href="">
+ <a class="<?php echo ((in_array($file, explode(",", $vari['pic'])))?'mark':''); ?> pic" id="<?php echo $file; ?>"
+ onclick="return wpsg_vp_vari_setPic(this, <?php echo $k; ?>, <?php echo $kv; ?>, '<?php echo $file; ?>', <?php echo $j; ?>);">
<img src="<?php echo $href[0]; ?>" alt="" width="25px" height="25px"/>
</a>
<?php } ?>
+ <?php if (wpsg_isSizedInt($j)) { ?>
+ <script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+
+ jQuery('#wpsg_mod_productvariants_productimage_<?php echo $k; ?>_<?php echo $kv; ?>').sortable( {
+ items: 'a',
+ helper : 'clone',
+ update: function(event, ui) {
+
+ wpsg_vp_ajaxloading_show();
+
+ var wpsg_reorder = jQuery(this).sortable('toArray');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=ajax&mod=wpsg_mod_productvariants&cmd=wpsg_var_setImageOrder&noheader=1&edit_id=<?php echo $this->view['product_id']; ?>',
+ async: false,
+ data: {
+ 'var_id': <?php echo $k; ?>,
+ 'vari_id': <?php echo $kv; ?>,
+ 'wpsg_reorder': wpsg_reorder
+ },
+ success: function(data) {
+
+ if (data != '1') alert(data);
+ wpsg_vp_ajaxloading_hide();
+
+ }
+ } );
+
+ }
+ } ).disableSelection();
+
+ } );
+
+ /* ]]> */</script>
+
+ <?php } ?>
</td>
</tr>
@@ -217,14 +254,14 @@ function wpsg_vp_ajaxloading_show()
{
- jQuery('.wpsg_mod_varianten_ajaxloading').show();
+ jQuery('.wpsg_mod_productvariants_ajaxloading').show();
}
function wpsg_vp_ajaxloading_hide()
{
- jQuery('.wpsg_mod_varianten_ajaxloading').hide();
+ jQuery('.wpsg_mod_productvariants_ajaxloading').hide();
}
diff --git a/views/mods/mod_productvariants/admin_html.phtml b/views/mods/mod_productvariants/admin_html.phtml index a5bf25e..ca08ab2 100644 --- a/views/mods/mod_productvariants/admin_html.phtml +++ b/views/mods/mod_productvariants/admin_html.phtml @@ -66,7 +66,9 @@ }
} );
-
+
+ //setTimeout("saveOrder()", 1000);
+
return false;
} // function wpsg_mod_productvariants_del(variant_id)
@@ -183,10 +185,30 @@ }
} );
-
+
+ setTimeout("saveOrder()", 3000);
+
return false;
} // function wpsg_mod_productvariants_add()
+
+ function saveOrder() {
+ var wpsg_reorder = jQuery('.wpsg_mod_productvariants_table_variants tbody').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('.wpsg_mod_productvariants_table_variants tbody').sortable('toArray')
+ },
+ success: function(data) { }
+ } );
+ // jQuery(this).sortable('toArray')
+ // jQuery('.wpsg_mod_productvariants_table_variants tbody').sortable(
+
+ }
function wpsg_mod_productvariants_back()
{
diff --git a/views/produkttemplates/standard.phtml b/views/produkttemplates/standard.phtml index 632f7e3..b9d4c68 100644 --- a/views/produkttemplates/standard.phtml +++ b/views/produkttemplates/standard.phtml @@ -203,7 +203,7 @@ if (!function_exists('is_plugin_active')) <?php /* Varianten START */ ?>
<div class="wpsg_produkt_varianten">
- <?php echo $this->callMod('wpsg_mod_varianten', 'renderTemplate', array($this->view['data']['product_key'])); ?>
+ <?php echo $this->callMod('wpsg_mod_productvariants', 'renderTemplate', array($this->view['data']['product_key'])); ?>
</div>
<?php /* Varianten ENDE */ ?>
</div>
|
