diff options
| -rw-r--r-- | views/js/editable.js | 17 | ||||
| -rw-r--r-- | views/mods/mod_ordercondition/list.phtml | 39 |
2 files changed, 53 insertions, 3 deletions
diff --git a/views/js/editable.js b/views/js/editable.js index 41b82f1..022f3f3 100644 --- a/views/js/editable.js +++ b/views/js/editable.js @@ -73,6 +73,21 @@ opt.value = value; //j;
}
+ else if (options.type == 'checklist')
+ {
+
+ opt.type = 'checklist';
+ opt.source = [];
+ opt.value = options.value;
+
+ for (var i in options.data)
+ {
+
+ opt.source.push( { value: i, text: options.data[i] } );
+
+ }
+
+ }
else
{
@@ -82,7 +97,7 @@ };
- }
+ }
if (typeof options.callback == "function") opt.success = options.callback;
diff --git a/views/mods/mod_ordercondition/list.phtml b/views/mods/mod_ordercondition/list.phtml index 00eabc0..a8fc581 100644 --- a/views/mods/mod_ordercondition/list.phtml +++ b/views/mods/mod_ordercondition/list.phtml @@ -99,6 +99,7 @@ if ($oc['typ'] == '1') echo __('Jede Bestellung', 'wpsg');
else if ($oc['typ'] == '2') echo __('Bestimmte Produkte', 'wpsg');
+ else if ($oc['typ'] == '3') echo __('Bestimmte Versandarten', 'wpsg');
else echo __('Inaktiv', 'wpsg');
?></span>
@@ -107,10 +108,16 @@ jQuery('#oc_typ_<?php echo $oc['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=inlinedit&noheader=1', {
type: 'select',
- data: <?php echo wpsg_prepare_for_inlineEdit(array('0' => __('Inaktiv', 'wpsg'), '1' => __('Jede Bestellung', 'wpsg'), '2' => __('Bestimmte Produkte', 'wpsg'))); ?>,
+ data: <?php echo wpsg_prepare_for_inlineEdit(array('0' => __('Inaktiv', 'wpsg'), '1' => __('Jede Bestellung', 'wpsg'), '2' => __('Bestimmte Produkte', 'wpsg'), '3' => __('Bestimmte Versandarten'))); ?>,
submitdata: {
field: 'typ',
oc_id: '<?php echo $oc['id']; ?>'
+ },
+ callback: function(e, params) {
+
+ if (params == 3) jQuery('.wpsg_mod_ordercondition_shipping_<?php echo $oc['id']; ?>').show();
+ else jQuery('.wpsg_mod_ordercondition_shipping_<?php echo $oc['id']; ?>').hide();
+
}
});
@@ -145,7 +152,35 @@ });
/* ]]> */</script>
-
+
+ <div class="wpsg_mod_ordercondition_shipping_<?php echo $oc['id']; ?>" style="display:<?php echo (($oc['type'] === '3')?'block':'none'); ?>;">
+ <?php echo wpsg_drawForm_TextStart(); ?>
+ <span class="wpsg_editable" id="oc_shipping_<?php echo $oc['id']; ?>"><?php
+
+ foreach (wpsg_trim(explode(',', $oc['shipping'])) as $shipping_id)
+ {
+
+ if (array_key_exists($shipping_id, $this->view['arShipping'])) echo $this->view['arShipping'][$shipping_id].'<br />';
+
+ }
+
+ ?></span>
+ <?php echo wpsg_drawForm_TextEnd(__('Versandartenauswahl', 'wpsg')); ?>
+ <script type="text/javascript">/* <![CDATA[ */
+
+ jQuery('#oc_shipping_<?php echo $oc['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=inlinedit&noheader=1', {
+ submitdata: {
+ field: 'shipping',
+ oc_id: '<?php echo $oc['id']; ?>'
+ },
+ data: <?php echo json_encode($this->view['arShipping']); ?>,
+ value: <?php echo json_encode(wpsg_trim(explode(',', $oc['shipping']))); ?>,
+ type: 'checklist'
+ });
+
+ /* ]]> */</script>
+ </div>
+
<?php if ($i == sizeof($this->view['wpsg_mod_ordercondition']['data'])) { ?><hr /><?php } ?>
</div>
|
