6134 |
daniel |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* Template für die Produktgruppenübersicht
|
|
|
5 |
*/
|
|
|
6 |
|
|
|
7 |
?>
|
|
|
8 |
|
|
|
9 |
<div class="wpsg_productgroups" id="wpsg-bs">
|
|
|
10 |
|
|
|
11 |
<nav class="navbar navbar-default">
|
|
|
12 |
|
|
|
13 |
<div class="container-fluid">
|
|
|
14 |
<div class="navbar-header">
|
|
|
15 |
<a class="navbar-brand" href="#"><?php echo __('wpShopGermany', 'wpsg'); ?></a>
|
|
|
16 |
</div>
|
|
|
17 |
<div class="collapse navbar-collapse" id="bs-customer-navbar-collapse-1">
|
|
|
18 |
<ul class="nav navbar-nav">
|
6135 |
thomas |
19 |
<li role="presentation" class="wpsg-customer-tab-a active"><a href="#" onclick="return false;"><?php echo wpsg_translate(__("Produktgruppenverwaltung (#1# Produktgruppen)", "wpsg"), $this->view['countAll']); ?></a></li>
|
6134 |
daniel |
20 |
<li role="presentation" class="wpsg-customer-tab-a wpsg_showhide_filter" id="wpsg-customer-tab-0"><a href="#" onclick="return false;"><span class="glyphicon glyphicon-search"></span><?php echo __("Suche", "wpsg"); ?></a></li>
|
7561 |
daniel |
21 |
<li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'add'))?'active':''); ?>"><a href="<?php
|
|
|
22 |
|
|
|
23 |
echo wpsg_admin_url('Productgroups', '', ['wpsg_mod_action' => 'add']);
|
|
|
24 |
|
|
|
25 |
?>"><span class="glyphicon glyphicon-plus"></span><?php echo __("Hinzufügen", "wpsg"); ?></a></li>
|
6134 |
daniel |
26 |
</ul>
|
|
|
27 |
<ul class="nav navbar-nav navbar-right">
|
|
|
28 |
</ul>
|
|
|
29 |
</div>
|
|
|
30 |
</div>
|
|
|
31 |
|
|
|
32 |
<div class="wpsg-filter wpsg-customer-tab wpsg-customer-tab-0 container-fluid form-horizontal" style="display:<?php echo (($this->view['hasFilter'] === true)?'block':'none'); ?>;">
|
|
|
33 |
<div class="row">
|
|
|
34 |
<div class="col-lg-4">
|
|
|
35 |
<form method="post" id="filter_form">
|
|
|
36 |
|
7561 |
daniel |
37 |
<?php echo wp_nonce_field('wpsg-mod-productgroups-search'); ?>
|
|
|
38 |
|
6134 |
daniel |
39 |
<input id="wpsg_seite" type="hidden" name="filter[page]" value="<?php echo @$this->view['page']; ?>" class="current-page" />
|
|
|
40 |
|
|
|
41 |
<input id="wpsg_order" type="hidden" name="filter[order]" value="<?php echo @$this->view['arFilter']['order']; ?>" />
|
|
|
42 |
<input id="wpsg_ascdesc" type="hidden" name="filter[ascdesc]" value="<?php echo @$this->view['arFilter']['ascdesc']; ?>" />
|
|
|
43 |
|
|
|
44 |
<?php echo wpsg_drawForm_Input('filter[s]', __('Suchfeld', 'wpsg'), wpsg_getStr($this->view['arFilter']['s'])); ?>
|
|
|
45 |
|
|
|
46 |
<?php echo wpsg_drawForm_SubmitButton(__('Produktgruppen suchen')); ?><br />
|
|
|
47 |
|
|
|
48 |
</form>
|
|
|
49 |
</div>
|
|
|
50 |
</div>
|
|
|
51 |
</div>
|
|
|
52 |
|
|
|
53 |
</nav>
|
7549 |
daniel |
54 |
|
|
|
55 |
<div class="wpsg_msg_wrap"><hr class="wp-header-end wpsg-wp-header-end"/></div>
|
|
|
56 |
<div class="wpsg_clear"></div>
|
|
|
57 |
|
6134 |
daniel |
58 |
<?php if ($this->view['pages'] > 1) { ?>
|
|
|
59 |
<nav class="pagination_wrap">
|
|
|
60 |
<ul class="pagination">
|
|
|
61 |
<?php if ($this->view['arFilter']['page'] > 1) { ?>
|
|
|
62 |
<li><a onclick="return goPage(<?php echo $this->view['arFilter']['page'] - 1; ?>);" href="#" aria-label="<?php echo __('Vorherige Seite'); ?>"><span aria-hidden="true">«</span></a></li>
|
|
|
63 |
<?php } ?>
|
|
|
64 |
<?php for ($i = 1; $i <= $this->view['pages']; $i ++) { ?>
|
|
|
65 |
<li class="<?php echo (($i == $this->view['arFilter']['page'])?'active':''); ?>"><a onclick="return goPage(<?php echo $i; ?>);" href="#"><?php echo $i; ?></a></li>
|
|
|
66 |
<?php } ?>
|
|
|
67 |
<?php if ($this->view['arFilter']['page'] + 1 <= $this->view['pages']) { ?>
|
|
|
68 |
<li><a onclick="return goPage(<?php echo $this->view['arFilter']['page'] + 1; ?>);" href="#" aria-label="<?php echo __('Nächste Seite'); ?>"><span aria-hidden="true">»</span></a></li>
|
|
|
69 |
<?php } ?>
|
|
|
70 |
</ul>
|
|
|
71 |
</nav>
|
|
|
72 |
<?php } ?>
|
|
|
73 |
|
|
|
74 |
<div class="wpsg_clear"></div>
|
|
|
75 |
|
|
|
76 |
<div class="content">
|
|
|
77 |
|
|
|
78 |
<?php if (is_array($this->view['arData']) && sizeof($this->view['arData']) > 0) { ?>
|
|
|
79 |
|
|
|
80 |
<table class="table wpsg-table-order table-bordered table-hover table-striped wpsg-table-customer">
|
|
|
81 |
<thead>
|
|
|
82 |
<tr>
|
8198 |
daniel |
83 |
<th class="wpsg_pic_col"></th>
|
6134 |
daniel |
84 |
<th class="wpsg_order col_name" data-order="nr"><?php echo __("Name", 'wpsg'); ?></th>
|
|
|
85 |
<th class="wpsg_order col_template" data-order="template"><?php echo __("Template", 'wpsg'); ?></th>
|
8280 |
daniel |
86 |
<th class="wpsg_order col_pos" data-order="template"><?php echo __("Position", 'wpsg'); ?></th>
|
6134 |
daniel |
87 |
<th class="wpsg_order col_products" data-order="products"><?php echo __("Produkte", 'wpsg'); ?></th>
|
|
|
88 |
</tr>
|
|
|
89 |
</thead>
|
|
|
90 |
<tbody>
|
8198 |
daniel |
91 |
<?php foreach ($this->view['arData'] as /** @var wpsg_productgroup */ $pg) { ?>
|
6134 |
daniel |
92 |
<tr>
|
8198 |
daniel |
93 |
<td class="wpsg_pic_col">
|
|
|
94 |
<?php if ($pg->getImage() > 0) { ?>
|
|
|
95 |
|
|
|
96 |
<?php echo \wp_get_attachment_image($pg->getImage(), [75, 75]); ?>
|
|
|
97 |
|
|
|
98 |
<?php } ?>
|
|
|
99 |
</td>
|
6134 |
daniel |
100 |
<td class="col_name">
|
8198 |
daniel |
101 |
<strong><a title="<?php echo __("Diese Produktgruppe bearbeiten", "wpsg"); ?>" href="<?php
|
|
|
102 |
|
|
|
103 |
echo wpsg_admin_url('Productgroups', '', ['wpsg_mod_action' => 'edit', 'edit_id' => $pg->id]);
|
|
|
104 |
|
|
|
105 |
?>" class="row-title"><?php echo $pg->name; ?></a></strong>
|
6134 |
daniel |
106 |
<div class="row-actions">
|
7561 |
daniel |
107 |
<span class="edit"><a title="<?php echo __("Diese Produktgruppe bearbeiten", "wpsg"); ?>" href="<?php
|
|
|
108 |
|
|
|
109 |
echo wpsg_admin_url('Productgroups', '', ['wpsg_mod_action' => 'edit', 'edit_id' => $pg->id]);
|
|
|
110 |
|
|
|
111 |
?>"><?php echo __("Bearbeiten", "wpsg"); ?></a>
|
6134 |
daniel |
112 |
|
|
7549 |
daniel |
113 |
<span class="del"><a onclick="if (!confirm('<?php echo __("Sind Sie sich sicher?", "wpsg"); ?>')) return false;" title="<?php echo __("Diese Produktgruppe löschen", "wpsg"); ?>" href="<?php
|
|
|
114 |
|
7561 |
daniel |
115 |
echo wpsg_admin_url('Productgroups', '', ['wpsg_mod_action' => 'del', 'edit_id' => $pg->id], ['noheader' => '1']);
|
7549 |
daniel |
116 |
|
|
|
117 |
?>"><?php echo __("Löschen", "wpsg"); ?></a>
|
6134 |
daniel |
118 |
<?php if ($pg->countProducts() > 0) { ?>
|
|
|
119 |
|
|
|
|
120 |
<span class="edit"><a title="<?php echo __("Zur Produktliste", "wpsg"); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&search[pgruppe]=<?php echo $pg->id; ?>"><?php echo __("Zur Produktliste", "wpsg"); ?></a>
|
|
|
121 |
<?php } ?>
|
|
|
122 |
</div>
|
|
|
123 |
</td>
|
|
|
124 |
<td class="col_template">
|
|
|
125 |
<?php echo (($pg->template_file == "0")?'Individuelle Produkttemplates':$pg->template_file); ?>
|
|
|
126 |
</td>
|
8280 |
daniel |
127 |
<td class="col_pos">
|
|
|
128 |
<?php echo $pg->pos; ?>
|
|
|
129 |
</td>
|
6134 |
daniel |
130 |
<td class="col_products">
|
|
|
131 |
<?php echo $pg->countProducts(); ?>
|
|
|
132 |
</td>
|
|
|
133 |
</tr>
|
|
|
134 |
<?php } ?>
|
|
|
135 |
</tbody>
|
|
|
136 |
</table>
|
|
|
137 |
|
|
|
138 |
<?php if ($this->view['pages'] > 1) { ?>
|
|
|
139 |
<nav class="pagination_wrap pagination_wrap_bottom">
|
|
|
140 |
<ul class="pagination">
|
|
|
141 |
<?php if ($this->view['arFilter']['page'] > 1) { ?>
|
|
|
142 |
<li><a onclick="return goPage(<?php echo $this->view['arFilter']['page'] - 1; ?>);" href="#" aria-label="<?php echo __('Vorherige Seite'); ?>"><span aria-hidden="true">«</span></a></li>
|
|
|
143 |
<?php } ?>
|
|
|
144 |
<?php for ($i = 1; $i <= $this->view['pages']; $i ++) { ?>
|
|
|
145 |
<li class="<?php echo (($i == $this->view['arFilter']['page'])?'active':''); ?>"><a onclick="return goPage(<?php echo $i; ?>);" href="#"><?php echo $i; ?></a></li>
|
|
|
146 |
<?php } ?>
|
|
|
147 |
<?php if ($this->view['arFilter']['page'] + 1 <= $this->view['pages']) { ?>
|
|
|
148 |
<li><a onclick="return goPage(<?php echo $this->view['arFilter']['page'] + 1; ?>);" href="#" aria-label="<?php echo __('Nächste Seite'); ?>"><span aria-hidden="true">»</span></a></li>
|
|
|
149 |
<?php } ?>
|
|
|
150 |
</ul>
|
|
|
151 |
</nav>
|
|
|
152 |
<?php } ?>
|
|
|
153 |
|
|
|
154 |
<?php } else { ?>
|
|
|
155 |
|
|
|
156 |
<?php echo wpsg_drawForm_AdminboxStart(); ?>
|
|
|
157 |
<?php echo __('Keine Produktgruppen in der Datenbank.', 'wpsg'); ?>
|
|
|
158 |
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
|
|
|
159 |
|
|
|
160 |
<?php } ?>
|
|
|
161 |
|
|
|
162 |
</div>
|
|
|
163 |
|
|
|
164 |
<script type="text/javascript">/* <![CDATA[ */
|
|
|
165 |
|
|
|
166 |
<?php if (wpsg_isSizedString($this->view['arFilter']['order']) && wpsg_isSizedString($this->view['arFilter']['ascdesc'])) { ?>
|
|
|
167 |
jQuery('th[data-order="<?php echo $this->view['arFilter']['order']; ?>"]').addClass('wpsg_order_<?php echo strtolower($this->view['arFilter']['ascdesc']); ?>');
|
|
|
168 |
<?php } ?>
|
|
|
169 |
|
|
|
170 |
function goPage(page)
|
|
|
171 |
{
|
|
|
172 |
|
6152 |
thomas |
173 |
//if (page <= 0 || page == <?php echo $this->view['arFilter']['page']; ?> || page > <?php echo $this->view['pages']; ?>) return;
|
6134 |
daniel |
174 |
|
|
|
175 |
jQuery('#wpsg_seite').val(page);
|
8040 |
karl |
176 |
jQuery('#filter_form').trigger('submit');
|
6134 |
daniel |
177 |
|
|
|
178 |
return false;
|
|
|
179 |
|
|
|
180 |
} // function goPage(page)
|
|
|
181 |
|
|
|
182 |
/* ]]> */</script>
|