diff options
| -rw-r--r-- | views/mods/mod_gutschein/add.phtml | 37 | ||||
| -rw-r--r-- | views/mods/mod_gutschein/index.phtml | 12 |
2 files changed, 40 insertions, 9 deletions
diff --git a/views/mods/mod_gutschein/add.phtml b/views/mods/mod_gutschein/add.phtml index e7a3580..2bd6fec 100644 --- a/views/mods/mod_gutschein/add.phtml +++ b/views/mods/mod_gutschein/add.phtml @@ -42,15 +42,29 @@ <?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_start', __('Gültig ab', 'wpsg'), $this->view['mod_gutschein']['start'], array('datepicker' => true)); ?>
<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_end', __('Gültig bis', 'wpsg'), $this->view['mod_gutschein']['end'], array('datepicker' => true)); ?>
- <?php echo wpsg_drawForm_Select('wpsg_mod_gutschein_gen', __('Code Generierung', 'wpsg'), array(
- '0' => __('Automatisch', 'wpsg'),
- '1' => __('Manuell', 'wpsg')
- ), wpsg_getStr($this->view['mod_gutschein']['gen']), array('help' => 'wpsg_mod_gutschein_gen')); ?>
- <div id="wpsg_mod_gutschein_layercode">
+
+ <?php if (!wpsg_isSizedInt($this->view['edit_id'])) { ?>
+
+ <?php echo wpsg_drawForm_Select('wpsg_mod_gutschein_gen', __('Code Generierung', 'wpsg'), array(
+ '0' => __('Automatisch', 'wpsg'),
+ '1' => __('Manuell', 'wpsg')
+ ), wpsg_getStr($this->view['mod_gutschein']['gen']), array('help' => 'wpsg_mod_gutschein_gen')); ?>
+ <div id="wpsg_mod_gutschein_layercode">
+ <?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_code', __('Code', 'wpsg'), wpsg_getStr($this->view['mod_gutschein']['code']), array('help' => 'wpsg_mod_gutschein_code')); ?>
+ </div>
+
+ <?php } else { ?>
+
<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_code', __('Code', 'wpsg'), wpsg_getStr($this->view['mod_gutschein']['code']), array('help' => 'wpsg_mod_gutschein_code')); ?>
- </div>
+
+ <?php } ?>
+
<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_minvalue', __('Minimaler Warenwert', 'wpsg'), wpsg_getStr($this->view['mod_gutschein']['minvalue']), array('help' => 'wpsg_mod_gutschein_minvalue')); ?>
+
+ <?php if (!wpsg_isSizedInt($this->view['edit_id'])) { ?>
<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_count', __('Menge', 'wpsg'), $this->view['mod_gutschein']['count']); ?>
+ <?php } ?>
+
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_gutschein_multi', __('Mehrfach verwendbar', 'wpsg'), $this->view['mod_gutschein']['multi']); ?>
<?php echo wpsg_drawForm_Textarea('wpsg_mod_gutschein_comment', __('Kommentar', 'wpsg'), @$this->view['mod_gutschein']['comment']); ?>
<?php if ($this->hasMod('wpsg_mod_productgroups') && wpsg_isSizedArray($this->view['wpsg_mod_gutschein']['arProductGroups'])) { ?>
@@ -59,7 +73,16 @@ <?php echo wpsg_drawForm_Select('wpsg_mod_gutschein_products', __('Beschränkung auf Produkte', 'wpsg'), @$this->view['wpsg_mod_gutschein']['arProducts'], @$this->view['mod_gutschein']['products'], array('multiple' => ((sizeof($this->view['wpsg_mod_gutschein']['arProducts']) > 5)?5:sizeof($this->view['wpsg_mod_gutschein']['arProducts'])), 'help' => 'wpsg_mod_gutschein_products')); ?>
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
- <input type="submit" value="<?php echo __('Gutschein anlegen', 'wpsg'); ?>" class="button-primary" id="submit" name="submit" />
+ <?php if (wpsg_isSizedInt($this->view['edit_id'])) { ?>
+
+ <input type="hidden" name="edit_id" value="<?php echo $this->view['edit_id']; ?>" />
+ <input type="submit" value="<?php echo __('Gutschein speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit" />
+
+ <?php } else { ?>
+
+ <input type="submit" value="<?php echo __('Gutschein anlegen', 'wpsg'); ?>" class="button-primary" id="submit" name="submit" />
+
+ <?php } ?>
</form>
diff --git a/views/mods/mod_gutschein/index.phtml b/views/mods/mod_gutschein/index.phtml index e3494b1..8ede88e 100644 --- a/views/mods/mod_gutschein/index.phtml +++ b/views/mods/mod_gutschein/index.phtml @@ -87,8 +87,16 @@ <input class="col_set_checkbox" value="<?php echo $oVoucher->id; ?>" name="wpsg_multido[]" type="checkbox" />
</td>
- <?php /* <td class="col_code"><?php echo $oVoucher->code; ?></td> */ ?>
- <td class="col_code"><a href="<?php echo WPSG_URL_WP . 'wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_voucherproduct&gs_id='.$oVoucher->id.'&order_id='.$oVoucher->autocreate_order.'&noheader=1&cmd=getVoucher'; ?>"><?php echo $oVoucher->code; ?></a></td>
+ <?php /* <td class="col_code"><?php echo $oVoucher->code; ?></td> */ ?>
+ <td class="col_code">
+
+ <a title="<?php echo __('Gutschein bearbeiten', 'wpsg'); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=edit&edit_id=<?php echo $oVoucher->id; ?>"><?php echo $oVoucher->code; ?></a>
+
+ <?php if (1||$this->hasMod('mod_voucherproduct')) { ?>
+ [ <a href="<?php echo WPSG_URL_WP . 'wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_voucherproduct&gs_id='.$oVoucher->id.'&order_id='.$oVoucher->autocreate_order.'&noheader=1&cmd=getVoucher'; ?>"><?php echo __('PDF', 'wpsg'); ?></a> ]
+ <?php } ?>
+
+ </td>
<td class="col_start"><?php echo wpsg_formatTimestamp($oVoucher->start_date); ?></td>
<td class="col_end"><?php echo wpsg_formatTimestamp($oVoucher->end_date); ?></td>
<td class="col_value"><?php
|
