diff options
| author | Daniel Schmitzer <noreply@maennchen1.de> | 2016-01-14 14:55:36 +0000 |
|---|---|---|
| committer | Daniel Schmitzer <noreply@maennchen1.de> | 2016-01-14 14:55:36 +0000 |
| commit | ad405c7045c6e242080ec9d3ce4c9e586b517c4f (patch) | |
| tree | b41905f4d27f3eaaabd5bad3a39f8d3873540b46 /views/mods/mod_customergroup | |
- Testweise 4
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5261 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods/mod_customergroup')
| -rw-r--r-- | views/mods/mod_customergroup/addedit.phtml | 165 | ||||
| -rw-r--r-- | views/mods/mod_customergroup/index.phtml | 217 | ||||
| -rw-r--r-- | views/mods/mod_customergroup/settings_edit.phtml | 9 |
3 files changed, 391 insertions, 0 deletions
diff --git a/views/mods/mod_customergroup/addedit.phtml b/views/mods/mod_customergroup/addedit.phtml new file mode 100644 index 0000000..1ac02e7 --- /dev/null +++ b/views/mods/mod_customergroup/addedit.phtml @@ -0,0 +1,165 @@ +<?php
+
+ /**
+ * Template für das Anlegen und Bearbeiten einer Kundengruppe im Backend
+ */
+
+?>
+<div class="wrap wpsg_mod_kundenverwaltung_customergroup_addedit wpsg_customergroup_view wpsg_produkt_addedit wrap columns-2">
+ <div class="icon32 icon32-posts-post" id="icon-add"><br /></div>
+
+ <h2>
+ <?php if ($this->view['mode'] == 'edit') { ?>
+ <?php echo __('Kundengruppe bearbeiten', 'wpsg'); ?>
+ <?php } else { ?>
+ <?php echo __('Kundengruppe anlegen', 'wpsg'); ?>
+ <?php } ?>
+ </h2>
+ <br />
+
+ <?php echo $this->writeBackendMessage(); ?>
+
+ <form method="POST" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customergroup&action=save&noheader=1" enctype="multipart/form-data">
+
+ <?php if ($this->view['mode'] == 'edit') { ?>
+ <input type="hidden" name="edit_id" value="<?php echo $this->view['data']->id; ?>" />
+ <?php } ?>
+
+ <div id="postbox" class="metabox-holder has-right-sidebar">
+
+ <div id="side-info-column" class="inner-sidebar" style="width:386px;">
+
+ <div id="side-sortables" class="meta-box-sortables ui-sortable" style="width:380px;">
+
+ <?php $this->callMods('customergroup_edit', array(&$this->view['data'])); ?>
+
+ </div>
+
+ </div>
+
+ <div id="post-body">
+
+ <div id="normal-sortables" class="meta-box-sortables" style="margin-right:400px;">
+
+ <div id="wpsg_customergroup_general" class="postbox">
+ <h3 class="wpsg_handlediv">
+ <span title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>" class="handlediv"><br /></span>
+ <span><?php echo __('Allgemein', 'wpsg'); ?></span>
+ </h3>
+ <div class="inside">
+
+ <?php echo wpsg_drawForm_Input('wpsg_mod_kundenverwaltung[name]', __('Name', 'wpsg'), $this->view['data']->name); ?>
+ <?php echo wpsg_drawForm_Select('wpsg_mod_kundenverwaltung[calculation]', __('Preisangaben im Shop (Frontend)', 'wpsg'), array(
+ -1 => __('Standard', 'wpsg'),
+ WPSG_BRUTTO => __('Brutto (inkl. Steuer)', 'wpsg'),
+ WPSG_NETTO => __('Netto (zzgl. Steuer)', 'wpsg')
+ ), $this->view['data']->calculation); ?>
+
+ </div>
+ </div>
+
+ </div>
+
+ <p class="submit">
+ <input type="submit" value="<?php echo __('Kundengruppe speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit" />
+ <input type="submit" value="<?php echo __('Kundengruppe speichern und zur Übersicht', 'wpsg'); ?>" class="button-primary" id="submit_index" name="submit_index" />
+ </p>
+
+ </div>
+
+ </div>
+
+ </form>
+
+</div>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready( function() {
+
+ jQuery('.wpsg_form_help').tipTip();
+
+ jQuery("#normal-sortables, #side-sortables").sortable({
+ connectWith: ".meta-box-sortables",
+ placeholder: 'wpsg_placeholder',
+ dropOnEmpty: true,
+ cursor: 'move',
+ handle: '.wpsg_handlediv',
+ grid: [50, 20],
+ forceHelperSize: true,
+ forcePlaceholderSize: true,
+ opacity: 0.8,
+ stop: function(e,ui) {
+
+ var ser = jQuery("#normal-sortables").sortable("serialize");
+ ser = ser.replace(/\&wpsg\[\]\=/g, ',').replace(/wpsg\[\]\=/g, '');
+
+ jQuery.cookie('wpsg_customergroup_view_normal', ser);
+
+ var ser = jQuery("#side-sortables").sortable("serialize");
+ ser = ser.replace(/\&wpsg\[\]\=/g, ',').replace(/wpsg\[\]\=/g, '');
+
+ jQuery.cookie('wpsg_customergroup_view_side', ser);
+
+ },
+ receive: function(e, ui) {
+ }
+ });
+
+ if (jQuery.cookie('wpsg_customergroup_view_normal') != null)
+ {
+
+ var divs = jQuery.cookie('wpsg_customergroup_view_normal').split(',').reverse();
+
+ for (index in divs)
+ {
+
+ jQuery('#normal-sortables').prepend(jQuery('#wpsg_' + divs[index]));
+
+ }
+
+ }
+
+ if (jQuery.cookie('wpsg_customergroup_view_side') != null)
+ {
+
+ var divs = jQuery.cookie('wpsg_customergroup_view_side').split(',').reverse();
+
+ for (index in divs)
+ {
+
+ jQuery('#side-sortables').prepend(jQuery('#wpsg_' + divs[index]));
+
+ }
+
+ }
+
+ jQuery('.wpsg_handlediv').bind('click', function() {
+ jQuery(this).next().toggle();
+
+ var arClose = new Array();
+ jQuery('.wpsg_customergroup_view .postbox .inside:hidden').each(function() {
+ arClose.push(jQuery(this).parent().attr("id"));
+ } );
+
+ jQuery.cookie('wpsg_customergroup_closed', arClose.join(','));
+
+ } );
+
+ if (jQuery.cookie('wpsg_customergroup_closed') != null)
+ {
+
+ var arClose = jQuery.cookie('wpsg_customergroup_closed').split(',');
+
+ for (index in arClose)
+ {
+
+ jQuery('#' + arClose[index] + ' .inside').hide();
+
+ }
+
+ }
+
+ } );
+
+/* ]]> */</script>
\ No newline at end of file diff --git a/views/mods/mod_customergroup/index.phtml b/views/mods/mod_customergroup/index.phtml new file mode 100644 index 0000000..8542227 --- /dev/null +++ b/views/mods/mod_customergroup/index.phtml @@ -0,0 +1,217 @@ +<?php
+
+ /**
+ * Template für die Kundengruppenübersicht im Backend
+ */
+
+?>
+<div class="wrap wpsg_mod_kundenverwaltung_customergroup_index">
+
+ <div class="icon32 icon32-posts-post" id="icon-edit"><br /></div>
+
+ <h2>
+ <?php echo __('Kundengruppenverwaltung', 'wpsg'); ?>
+ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customergroup&action=add" class="add-new-h2"><?php echo __("Hinzufügen", "wpsg"); ?></a>
+ </h2>
+
+ <?php echo $this->writeBackendMessage(); ?>
+
+ <form method="POST" id="filter_form">
+
+ <?php if (sizeof($this->view['data']) > 0) { ?>
+ <p class="search-box">
+ <label for="post-search-input" class="screen-reader-text"><?php echo __('Kundengruppen suchen', 'wpsg'); ?>:</label>
+ <input type="text" value="<?php echo wpsg_hspc($_REQUEST['s']); ?>" name="filter[s]" id="post-search-input">
+ <input type="submit" value="<?php echo __('Kundengruppen suchen', 'wpsg'); ?>" class="button" id="search-submit" name="">
+ </p>
+ <?php } ?>
+
+ <div class="tablenav top">
+
+ <?php if (sizeof($this->view['data']) > 0) { ?>
+ <div class="tablenav-pages"><span class="displaying-num"><?php echo wpsg_translate(__('#1# Elemente', 'wpsg'), $this->view['count']); ?></span>
+ <div class="tablenav-pages">
+ <span class="pagination-links">
+ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customergroup&seite=1&s=<?php echo $_REQUEST['s'].'&'.http_build_query((array)$_REQUEST['filter']); ?>" title="<?php echo __('Zur ersten Seite gehen', 'wpsg'); ?>" class="first-page <?php echo (($this->view['seite'] == '1')?'disabled':''); ?>">«</a>
+ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customergroup&seite=<?php echo ($this->view['seite'] - 1).'&'.http_build_query((array)$_REQUEST['filter']); ?>" title="<?php echo __('Zur vorherigen Seite gehen', 'wpsg'); ?>" class="prev-page <?php echo (($this->view['seite'] <= 1)?'disabled':''); ?>">‹</a>
+ <span class="paging-input"><input type="text" size="1" value="<?php echo $this->view['seite']; ?>" id="seite" name="seite" title="<?php echo __('Aktuelle Seite', 'wpsg'); ?>" class="current-page"> <?php echo __('von', 'wpsg'); ?> <span class="total-pages"><?php echo $this->view['pages']; ?></span></span>
+ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customergroup&seite=<?php echo ($this->view['seite'] + 1).'&'.http_build_query((array)$_REQUEST['filter']); ?>" title="<?php echo __('Zur nächsten Seite gehen', 'wpsg'); ?>" class="next-page <?php echo (($this->view['seite'] >= $this->view['pages'])?'disabled':''); ?>">›</a>
+ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customergroup&seite=<?php echo $this->view['pages'].'&'.http_build_query((array)$_REQUEST['filter']); ?>" title="<?php echo __('Zur letzten Seite gehen', 'wpsg'); ?>" class="last-page <?php echo (($this->view['seite'] == $this->view['pages'])?'disabled':''); ?>">»</a>
+ </span>
+ </div>
+
+ <script type="text/javascript">
+
+ jQuery('.tablenav-pages .disabled').bind('click', function() { return false; } );
+
+ </script>
+
+ <br class="clear" />
+ </div>
+ <?php } ?>
+
+ </div>
+
+ <input id="wpsg_order" type="hidden" name="filter[order]" value="<?php echo $this->view['filter']['order']; ?>" />
+ <input id="wpsg_ascdesc" type="hidden" name="filter[ascdesc]" value="<?php echo $this->view['filter']['ascdesc']; ?>" />
+
+ <input style="display:none;" type="submit" name="suchen" value="" />
+
+ </form>
+
+ <?php if (is_array($this->view['data']) && sizeof($this->view['data']) > 0) { ?>
+ <table class="widefat post fixed">
+ <thead>
+ <tr>
+ <th class="manage-column col-id <?php echo ((wpsg_isSizedString($this->view['filter']['order'], 'id'))?'sorted':'sortable'); ?> <?php echo ((wpsg_isSizedString($this->view['filter']['ascdesc'], 'asc'))?'asc':'desc'); ?>">
+ <a href="#" onclick="return wpsg_setOrder('id');">
+ <span><?php echo __("Id", 'wpsg'); ?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="manage-column col-name <?php echo ((wpsg_isSizedString($this->view['filter']['order'], 'name'))?'sorted':'sortable'); ?> <?php echo ((wpsg_isSizedString($this->view['filter']['ascdesc'], 'asc'))?'asc':'desc'); ?>">
+ <a href="#" onclick="return wpsg_setOrder('name');">
+ <span><?php echo __("Name", 'wpsg'); ?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="manage-column col-calculation <?php echo ((wpsg_isSizedString($this->view['filter']['order'], 'calculation'))?'sorted':'sortable'); ?> <?php echo ((wpsg_isSizedString($this->view['filter']['ascdesc'], 'asc'))?'asc':'desc'); ?>">
+ <a href="#" onclick="return wpsg_setOrder('name');">
+ <span><?php echo __("Preisanzeige", 'wpsg'); ?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="manage-column col-customercount <?php echo ((wpsg_isSizedString($this->view['filter']['order'], 'customercount'))?'sorted':'sortable'); ?> <?php echo ((wpsg_isSizedString($this->view['filter']['ascdesc'], 'asc'))?'asc':'desc'); ?>">
+ <a href="#" onclick="return wpsg_setOrder('customercount');">
+ <span><?php echo __("Kunden", 'wpsg'); ?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php $i = 0; foreach ($this->view['data'] as $oCustomerGroup) { ?>
+ <tr class="<?php echo (($i % 2 == 0)?'odd':'even'); ?>">
+ <td class="col-id">
+ <?php echo wpsg_hspc($oCustomerGroup->id); ?>
+ </td>
+ <td class="col-name">
+ <?php echo wpsg_hspc($oCustomerGroup->name); ?>
+ <div class="row-actions">
+ <span class="edit"><a title="<?php echo __("Diesen Kunden bearbeiten", "wpsg"); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customergroup&action=edit&edit_id=<?php echo $oCustomerGroup->id; ?>"><?php echo __("Bearbeiten", "wpsg"); ?></a></span>
+ |
+ <span class="edit"><a title="<?php echo __("Kunden dieser Kundengruppe anzeigen", "wpsg"); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customer&customergroup=<?php echo $oCustomerGroup->id; ?>"><?php echo __("Kunden anzeigen", "wpsg"); ?></a></span>
+ |
+ <span class="del"><a onclick="if (!confirm('<?php echo __("Sind Sie sicher, dass Sie diese Kundengruppe löschen wollen?", "wpsg"); ?>')) return false;" title="<?php echo __("Diesen Kunden löschen", "wpsg"); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customergroup&action=del&edit_id=<?php echo $oCustomerGroup->id; ?>&noheader=1"><?php echo __("Löschen", "wpsg"); ?></a></span>
+ </div>
+ </td>
+ <td class="col-calculation">
+ <?php if ($oCustomerGroup->calculation == WPSG_BRUTTO) { ?>
+ <?php echo __('Brutto Preise', 'wpsg'); ?>
+ <?php } else if ($oCustomerGroup->calculation == WPSG_NETTO) { ?>
+ <?php echo __('Netto Preise', 'wpsg'); ?>
+ <?php } else { ?>
+ <?php echo __('Standard', 'wpsg'); ?>
+ <?php } ?>
+ </td>
+ <td class="col-customercount">
+ <?php echo wpsg_hspc($oCustomerGroup->customercount); ?>
+ </td>
+ </tr>
+ <?php $i ++; } ?>
+ </tbody>
+ <tfoot>
+ <tr>
+ <th class="manage-column col-id <?php echo ((wpsg_isSizedString($this->view['filter']['order'], 'id'))?'sorted':'sortable'); ?> <?php echo ((wpsg_isSizedString($this->view['filter']['ascdesc'], 'asc'))?'asc':'desc'); ?>">
+ <a href="#" onclick="return wpsg_setOrder('id');">
+ <span><?php echo __("Id", 'wpsg'); ?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="manage-column col-name <?php echo ((wpsg_isSizedString($this->view['filter']['order'], 'name'))?'sorted':'sortable'); ?> <?php echo ((wpsg_isSizedString($this->view['filter']['ascdesc'], 'asc'))?'asc':'desc'); ?>">
+ <a href="#" onclick="return wpsg_setOrder('name');">
+ <span><?php echo __("Name", 'wpsg'); ?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="manage-column col-calculation <?php echo ((wpsg_isSizedString($this->view['filter']['order'], 'calculation'))?'sorted':'sortable'); ?> <?php echo ((wpsg_isSizedString($this->view['filter']['ascdesc'], 'asc'))?'asc':'desc'); ?>">
+ <a href="#" onclick="return wpsg_setOrder('name');">
+ <span><?php echo __("Preisanzeige", 'wpsg'); ?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="manage-column col-customercount <?php echo ((wpsg_isSizedString($this->view['filter']['order'], 'customercount'))?'sorted':'sortable'); ?> <?php echo ((wpsg_isSizedString($this->view['filter']['ascdesc'], 'asc'))?'asc':'desc'); ?>">
+ <a href="#" onclick="return wpsg_setOrder('customercount');">
+ <span><?php echo __("Kunden", 'wpsg'); ?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ </tr>
+ </tfoot>
+ </table>
+ <?php } ?>
+
+ <div class="tablenav">
+
+ <?php if (is_array($this->view['data']) && sizeof($this->view['data']) > 0) { ?>
+
+ <div class="tablenav-pages"><span class="displaying-num"><?php echo wpsg_translate(__('#1# Elemente', 'wpsg'), $this->view['count']); ?></span>
+ <div class="tablenav-pages">
+ <span class="pagination-links">
+ <form method="POST">
+ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customergroup&seite=1&s=<?php echo $_REQUEST['s'].'&'.http_build_query((array)$_REQUEST['filter']); ?>" title="<?php echo __('Zur ersten Seite gehen', 'wpsg'); ?>" class="first-page <?php echo (($this->view['seite'] == '1')?'disabled':''); ?>">«</a>
+ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customergroup&seite=<?php echo ($this->view['seite'] - 1).'&'.http_build_query((array)$_REQUEST['filter']); ?>" title="<?php echo __('Zur vorherigen Seite gehen', 'wpsg'); ?>" class="prev-page <?php echo (($this->view['seite'] <= 1)?'disabled':''); ?>">‹</a>
+ <span class="paging-input"><input type="text" size="1" value="<?php echo $this->view['seite']; ?>" name="seite" title="<?php echo __('Aktuelle Seite', 'wpsg'); ?>" class="current-page"> <?php echo __('von', 'wpsg'); ?> <span class="total-pages"><?php echo $this->view['pages']; ?></span></span>
+ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customergroup&seite=<?php echo ($this->view['seite'] + 1).'&'.http_build_query((array)$_REQUEST['filter']); ?>" title="<?php echo __('Zur nächsten Seite gehen', 'wpsg'); ?>" class="next-page <?php echo (($this->view['seite'] >= $this->view['pages'])?'disabled':''); ?>">›</a>
+ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customergroup&seite=<?php echo $this->view['pages'].'&'.http_build_query((array)$_REQUEST['filter']); ?>" title="<?php echo __('Zur letzten Seite gehen', 'wpsg'); ?>" class="last-page <?php echo (($this->view['seite'] == $this->view['pages'])?'disabled':''); ?>">»</a>
+ </form>
+ </span>
+ </div>
+
+ <script type="text/javascript">
+
+ jQuery('.tablenav-pages .disabled').bind('click', function() { return false; } );
+
+ </script>
+
+ <br class="clear">
+ </div>
+
+ <?php } ?>
+
+ </div>
+
+ <script type="text/javascript">/* <![CDATA[ */
+
+ var wpsg_order = '<?php echo $this->view['filter']['order']; ?>';
+ var wpsg_ascdesc = '<?php echo $this->view['filter']['ascdesc']; ?>';
+
+ function wpsg_setOrder(order)
+ {
+
+ if (order == wpsg_order)
+ {
+
+ // Nur Richtung ändern
+ if (wpsg_ascdesc == 'asc') jQuery('#wpsg_ascdesc').val('desc');
+ else jQuery('#wpsg_ascdesc').val('asc');
+
+ }
+ else
+ {
+
+ jQuery('#wpsg_order').val(order);
+ jQuery('#wpsg_ascdesc').val('asc');
+
+ }
+
+ jQuery('#seite').val(1);
+ jQuery('#filter_form').submit();
+
+ return false;
+
+ } // function wpsg_setOrder(order)
+
+ /* ]]> */</script>
+
+</div>
\ No newline at end of file diff --git a/views/mods/mod_customergroup/settings_edit.phtml b/views/mods/mod_customergroup/settings_edit.phtml new file mode 100644 index 0000000..ae69c5c --- /dev/null +++ b/views/mods/mod_customergroup/settings_edit.phtml @@ -0,0 +1,9 @@ +<?php
+
+ /**
+ * Einstellungen für das Modul "Kundengruppen"
+ */
+
+?>
+<?php echo wpsg_drawForm_Select('wpsg_page_mod_kundenverwaltung_group_checkout', __('Kundengruppe bei Registrierung (Checkout)', 'wpsg'), $this->view['arCustomergroup'], $this->get_option('wpsg_page_mod_kundenverwaltung_group_checkout'), array('help' => 'wpsg_page_mod_kundenverwaltung_group_checkout')); ?>
+<?php echo wpsg_drawForm_Select('wpsg_page_mod_kundenverwaltung_group_register', __('Kundengruppe bei Registrierung (Registrierung)', 'wpsg'), $this->view['arCustomergroup'], $this->get_option('wpsg_page_mod_kundenverwaltung_group_register'), array('help' => 'wpsg_page_mod_kundenverwaltung_group_register')); ?>
|
