diff options
| author | hartmut <noreply@maennchen1.de> | 2016-10-21 14:14:00 +0000 |
|---|---|---|
| committer | hartmut <noreply@maennchen1.de> | 2016-10-21 14:14:00 +0000 |
| commit | ad164f505a7bd14de7a7d177a8be256499974c09 (patch) | |
| tree | d942e84a53752041f8d59ca68e97ae871adaf68a | |
| parent | 1f48113a90c745e51778d7c8801ca138f4661edb (diff) | |
Shop4 Korrekturen
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5866 0d5edaf7-2b12-4e95-93f4-047927463d4b
| -rw-r--r-- | views/admin/module.phtml | 2 | ||||
| -rw-r--r-- | views/css/frontend.css | 42 | ||||
| -rw-r--r-- | views/mods/mod_autodebit/paymenthint.phtml | 65 | ||||
| -rw-r--r-- | views/mods/mod_autodebit/settings_edit.phtml | 1 | ||||
| -rw-r--r-- | views/mods/mod_creditcard/paymenthint.phtml | 155 | ||||
| -rw-r--r-- | views/mods/mod_creditcard/settings_edit.phtml | 17 | ||||
| -rw-r--r-- | views/mods/mod_rechnungen/settings_edit.phtml | 222 | ||||
| -rw-r--r-- | views/mods/mod_statistics/chartturnover/day.phtml | 9 | ||||
| -rw-r--r-- | views/mods/mod_statistics/chartturnoverperhour/all.phtml | 41 | ||||
| -rw-r--r-- | views/mods/mod_statistics/customermap/all.phtml | 13 | ||||
| -rw-r--r-- | views/mods/mod_statistics/js/markerclusterer.js | 1315 | ||||
| -rw-r--r-- | views/mods/mod_statistics/simplefilter.phtml | 2 | ||||
| -rw-r--r-- | views/mods/mod_statistics/statistics.phtml | 51 | ||||
| -rw-r--r-- | views/produkttemplates/standard.phtml | 1 | ||||
| -rw-r--r-- | views/warenkorb/checkout.phtml | 26 | ||||
| -rw-r--r-- | views/warenkorb/checkout2.phtml | 2 | ||||
| -rw-r--r-- | views/warenkorb/overview.phtml | 2 |
17 files changed, 1780 insertions, 186 deletions
diff --git a/views/admin/module.phtml b/views/admin/module.phtml index f7be96c..b4a5e4c 100644 --- a/views/admin/module.phtml +++ b/views/admin/module.phtml @@ -20,7 +20,7 @@ <div class="list-group list-modul-group" style="display:none;" >
<span class="list-group-item list-group-head"><?php echo $group_name; ?></span>
<?php foreach ($g as $mod_key => $m) { ?>
- <a class="<?php echo (($this->get_option($mod_key, $this->view['global']) > 0)?'modul_akt':''); ?> list-group-modul list-group-item <?php echo (($mod_key == $_REQUEST['modul'])?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=<?php echo $mod_key; ?>">
+ <a class="<?php echo (($this->get_option($mod_key, $this->view['global']) > 0)?'modul_akt':''); ?> list-group-modul list-group-item <?php echo (($mod_key == wpsg_getStr($_REQUEST['modul'])?'active':'')); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=<?php echo $mod_key; ?>">
<span class="wpsg_modul_name"><?php echo $m->name; ?></span>
<?php if (($this->get_option($mod_key, $this->view['global']) > 0)?'modul_akt':'') { ?>
<span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
diff --git a/views/css/frontend.css b/views/css/frontend.css index 4742011..a058e7a 100644 --- a/views/css/frontend.css +++ b/views/css/frontend.css @@ -8,6 +8,7 @@ #wpsg_notice p { border-left:4px solid #FDF60A; }
#wpsg_error p { border-left:4px solid #DD3D36; }
.wpsg_error { border-color:#DD3D36; }
+.wpsg_error_wrap { border-left:4px solid #DD3D36; list-style:none; padding-left:4px; }
.wpsg { }
.wpsg h2 { }
.wpsg_checkout label.wpsg_error { background-color:white; }
@@ -18,7 +19,6 @@ input.wpsg_error { border-color:red !important; } #TB_ajaxContent { width:100% !important; }
.wpsg_upper { vertical-align:top; font-size:60%; }
-
/* Basket Widget */
.wpsg_basket_widget .wpshopgermany_linktokasse { float:right; margin-top:1rem; }
@@ -80,7 +80,7 @@ input.wpsg_error { border-color:red !important; } .shippay_wrap .shippay_item_wrap .wpsg_payship_name { display:table-cell; vertical-align:middle; font-size:12px; height:64px; }
.shippay_wrap .shippay_active .wpsg_payship_name { font-weight:bold; }
.shippay_wrap .shippay_item_wrap:last-child { border-bottom:1px solid #DFDFDF; }
-.shippay_wrap .shippay_item_wrap input { display:none; }
+.shippay_wrap .shippay_item_wrap input[type="radio"] { display:none; }
.shippay_wrap .shippay_item_wrap .shippay_checkmark { display:none; width:23px; height:18px; background-image:url('../gfx/checkmark.png'); background-repeat:no-repeat; position:absolute; right:10px; top:16px; }
.shippay_wrap .shippay_active .shippay_checkmark { display:block; }
.shippay_wrap .wpsg_payship_logo { margin-top:-5px; padding-bottom:10px; }
@@ -89,6 +89,7 @@ input.wpsg_error { border-color:red !important; } .wpsg_checkout2 .wpsg_checkoutbutton { float:left; }
/* Overview */
+.wpsg_overview #wpsg_overview_form { display:inline; }
.wpsg_overview .wpsg_agb { width:100%; clear:both; margin-bottom:2px; }
.wpsg_overview .wpsg_agb label { line-height:18px; }
.wpsg_overview .wpsg_agb input[type="checkbox"] { width:auto; /*margin-top:10px; margin-right:10px;*/ }
@@ -137,6 +138,11 @@ input.wpsg_error { border-color:red !important; } .wpsg_mod_autodebit label { width:100%; line-height:36px; }
.wpsg_mod_autodebit input { float:right; margin-bottom:3px; }
+/* Kreditkarte */
+.wpsg_mod_creditcard .wpsg_mod_creditcard_field { clear:both; }
+.wpsg_mod_creditcard label { width:100%; line-height:36px; }
+.wpsg_mod_creditcard input { float:right; margin-bottom:3px; }
+
/* Versandadresse */
.wpsg_checkout .wpsg_mod_shippingadress { margin-bottom:1rem; }
@@ -316,7 +322,7 @@ input.wpsg_error { border-color:red !important; } .wpsg_mod_funding_progress .wpsg_mod_funding_state > .bar { width:90%; float:left; height:100%; display:table; }
.wpsg_mod_funding_progress .wpsg_mod_funding_state > .bar > .value { background-color:#484C51; height:100%; width:0%; }
.wpsg_mod_funding_progress .wpsg_mod_funding_state > .value { width:10%; height:100%; border-left:1px solid #C5C5C5; float:right; text-align:center; }
-
+
/* Modul "Produktansichten" */
.wpsg_productview { position:relative; }
.wpsg_productview_head { margin-bottom:25px; line-height:25px; margin-top:25px; position:relative; }
@@ -390,3 +396,33 @@ input.wpsg_error { border-color:red !important; } }
+.only3steps span.step { width: 33%; }
+
+.wpsg_mod_productvars_input { box-sizing:border-box; }
+
+/* Passwort Visualisierung */
+#wpsg_pwd_info { width:250px; background:#fefefe; width:100%; padding:25px; border-radius:5px; box-shadow:0 1px 3px #ccc; border:1px solid #ddd; display:none; }
+#wpsg_pwd_info::before { position:absolute; font-size:14px; text-shadow:none; disblay:block; color:#ddd; line-height:14px; }
+#wpsg_pwd_info ul li { margin:10px 20px; display:block; }
+.invalid { padding-left:22px; line-height:24px; color:#ec3f41; }
+.valid { padding-left:22px; line-height:24px; color:#3a7d34; }
+
+/* ajaxDialog Basket */
+#wpsg_basket_ajax_message .wpsg_basket_ajax_message_content { max-height:32rem; }
+.wpsg_basket_ajax_message_content_left { width:30%; float:left; }
+.wpsg_basket_ajax_message_content_right { width:70%; float:left; }
+.wpsg_ajaxdialog_form, .wpsg_ajaxdialog_relatedproducts h3 { float:left; }
+.wpsg_ajaxDialog_relatedproducts, .wpsg_ajaxdialog_relatedproducts { float:left; padding:20px 0; }
+.wpsg_ajaxdialog_productrow { float:left; padding:20px; margin:0 15px; width:13rem; }
+.wpsg_ajaxdialog_relatedproducts { height:200px; }
+
+/* Amazon */
+.wpsg_amazonhandler { display:none; }
+#LoginWithAmazon { float:right; margin-bottom:1rem; margin-left:1rem; }
+#addressBookWidgetDiv { width:100%; height:250px; float:left; margin-bottom:1rem; }
+#walletWidgetDiv { width:100%; height:250px; float:right; }
+#wpsg_mod_amazon_paymentForm input[type="submit"] { float:right; margin-top:1rem; }
+
+/* SOFORT Ident */
+#wpsg_mod_si_form { display:inline; }
+#wpsg_mod_si_form input { float:right; }
\ No newline at end of file diff --git a/views/mods/mod_autodebit/paymenthint.phtml b/views/mods/mod_autodebit/paymenthint.phtml index 93de573..6f17260 100644 --- a/views/mods/mod_autodebit/paymenthint.phtml +++ b/views/mods/mod_autodebit/paymenthint.phtml @@ -38,7 +38,7 @@ <div class="wpsg_mod_autodebit_iban wpsg_mod_autodebit_field">
<label>
<?php echo __('IBAN', 'wpsg'); ?><span class="wpsg_required">*</span>:
- <input class="<?php echo ((in_array("mod_autodebit_iban", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" name="wpsg_mod_autodebit[iban]" value="<?php echo wpsg_hspc($this->view['wpsg_mod_autodebit']['iban']); ?>" />
+ <input class="<?php echo ((in_array("mod_autodebit_iban", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" name="wpsg_mod_autodebit[iban]" id="wpsg_mod_autodebit_iban" value="<?php echo wpsg_hspc($this->view['wpsg_mod_autodebit']['iban']); ?>" />
</label>
</div>
<div class="wpsg_clear"></div>
@@ -64,4 +64,65 @@ <?php echo wpsg_translate(__('Mit #1# gekennzeichnete Felder sind Pflichtfelder.', 'wpsg'), '<span class="wpsg_required">*</span>'); ?>
</div>
-</div>
\ No newline at end of file +</div>
+
+<script>
+
+//id="wpsg_mod_autodebit_iban"
+jQuery("#wpsg_mod_autodebit_iban").on("input", function () {
+ var
+ iban,
+ a1,
+ bb = true,
+ sum = 0,
+ csum,
+ i;
+
+ //alert("oninput");
+ iban = jQuery('#wpsg_mod_autodebit_iban').val();
+ iban = iban.replace(/ /g, "");
+ // 2 + 2 + 8 + 10
+ // DE 22 Zeichen
+ // AT 20 Zeichen
+ // CH 21 Zeichen
+ // Ersetze alle Buchstaben durch Zahlen, wobei A = 10, B = 11, …, Z = 35.
+ // Berechne den ganzzahligen Rest, der bei Division durch 97 bleibt.
+ // Subtrahiere den Rest von 98, das Ergebnis sind die beiden Prüfziffern.
+ // Falls das Ergebnis einstellig ist, wird es mit einer führenden Null ergänzt.
+ // DE80500105175408332501 --> 500105175408332501DE80 --> 500105175408332501131480
+ // Zahl modulo 97 muss 1 ergeben
+
+ if (iban.length < 16) { return; }
+
+ sum = iban.substr(4);
+
+ a1 = parseInt(iban.charCodeAt(0, 1) - 64, 10) + 9;
+ sum = sum + a1.toString();
+ a1 = parseInt(iban.charCodeAt(1, 1) - 64, 10) + 9;
+ sum = sum + a1.toString();
+ sum = sum + iban.substr(2, 2);
+
+ //sum = sum % 97;
+ // Calculate checksum
+ csum = parseInt(sum.substr(0, 1), 10);
+ for (i = 1; i < sum.length; i++) {
+ csum = csum * 10;
+ csum = csum + parseInt(sum.substr(i, 1), 10);
+ csum = csum % 97;
+ }
+
+ if (csum !== 1) { bb = false; }
+
+ jQuery('#wpsg_mod_autodebit_iban').removeClass('wpsg_error');
+ if (bb === false) {
+ //alert('IBAN fehlerhaft');
+ jQuery('#wpsg_mod_autodebit_iban').addClass('wpsg_error');
+ }
+
+});
+
+
+
+
+
+</script>
diff --git a/views/mods/mod_autodebit/settings_edit.phtml b/views/mods/mod_autodebit/settings_edit.phtml index 1e6685d..2906dc3 100644 --- a/views/mods/mod_autodebit/settings_edit.phtml +++ b/views/mods/mod_autodebit/settings_edit.phtml @@ -14,5 +14,6 @@ <?php echo wpsg_drawForm_Select('wpsg_mod_autodebit_mwst', __('Mehrwertsteuersatz', 'wpsg'), wpsg_tax_groups(), $this->get_option('wpsg_mod_autodebit_mwst')); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_autodebit_mwstland', __('Keine MwSt. wenn Land steuerfrei', 'wpsg'), $this->get_option('wpsg_mod_autodebit_mwstland'), array('help' => 'wpsg_shippay_mwstland')); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_autodebit_iban', __('IBAN/BIC statt Kontonummer/BLZ verwenden', 'wpsg'), $this->get_option('wpsg_mod_autodebit_iban'), array('help' => 'wpsg_mod_autodebit_iban')); ?>
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_autodebit_bic', __('BIC validieren', 'wpsg'), $this->get_option('wpsg_mod_autodebit_bic'), array('help' => 'wpsg_mod_autodebit_bic')); ?>
<?php // echo wpsg_drawForm_Button('wpsg_mod_autodebit_ibanbicconvert2', __('BIC/IBAN Konvertierung', 'wpsg'), array('button_text' => __('BIC/IBAN Konvertieren', 'wpsg'), 'button_class' => 'wpsg_mod_autodebit_button', 'button_onclick' => 'if (!confirm(\''.wpsg_hspc(__('Es werden die Bankdaten von allen Bestellungen mit Bankeinzug in BIC/IBAN konvertiert, sofern noch nicht angegeben. Die Länderkürzel müssen den IBAN Länderkürzeln entsprechen.', 'wpsg')).'\')) return false; location.href=\''.WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_autodebit&wpsg_mod_autodebit_bicibanconverter=1&mail=0&noheader=1\'')); ?>
<?php // echo wpsg_drawForm_Button('wpsg_mod_autodebit_ibanbicconvert', '', array('button_text' => __('BIC/IBAN Konvertierung starten / Kunden informieren', 'wpsg'), 'button_class' => 'wpsg_mod_autodebit_button', 'button_onclick' => 'if (!confirm(\''.wpsg_hspc(__('Es werden die Bankdaten von allen Bestellungen mit Bankeinzug in BIC/IBAN konvertiert, sofern noch nicht angegeben. Die Länderkürzel müssen den IBAN Länderkürzeln entsprechen. Der Kunde wird darüber per E-Mail informiert.', 'wpsg')).'\')) return false;', 'onclick' => WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_autodebit&wpsg_mod_autodebit_bicibanconverter=1&mail=1&noheader=1')); ?>
diff --git a/views/mods/mod_creditcard/paymenthint.phtml b/views/mods/mod_creditcard/paymenthint.phtml new file mode 100644 index 0000000..5ffda92 --- /dev/null +++ b/views/mods/mod_creditcard/paymenthint.phtml @@ -0,0 +1,155 @@ +<?php
+
+ /**
+ * Template für die Integration der Kundeneingaben für das Modul "Kreditkarte" in den Checkout2
+ */
+
+?>
+<br /><br />
+<div class="wpsg_mod_creditcard">
+
+ <div class="wpsg_mod_creditcard_name wpsg_mod_creditcard_field">
+ <label>
+ <?php echo __('Typ der Kreditkarte', 'wpsg'); ?><span class="wpsg_required">*</span>:
+ <!-- <input class="<?php echo ((in_array("mod_creditcard_typ",
+ (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="text" name="wpsg_mod_creditcard[typ]"
+ value="<?php echo wpsg_hspc($this->view['wpsg_mod_creditcard']['typ']); ?>" />
+ -->
+ <select name="wpsg_mod_creditcard[typ]" id="wpsg_mod_creditcard_typ"
+ class="<?php echo ((in_array('mod_creditcard_typ', (array)$this->view['error']))?'wpsg_error':''); ?>" >
+ <option value="VISA" selected="selected">VISA</option>
+ <option value="MasterCard" >MasterCard</option>
+ </select>
+
+ </label>
+ </div>
+ <div class="wpsg_clear"></div>
+
+ <div class="wpsg_mod_creditcard_inhaber wpsg_mod_creditcard_field">
+ <label>
+ <?php echo __('Inhaber', 'wpsg'); ?><span class="wpsg_required">*</span>:
+ <input class="<?php echo ((in_array("mod_creditcard_inhaber", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" name="wpsg_mod_creditcard[inhaber]" value="<?php echo wpsg_hspc($this->view['wpsg_mod_creditcard']['inhaber']); ?>" />
+ </label>
+ </div>
+ <div class="wpsg_clear"></div>
+
+ <div class="wpsg_mod_creditcard_knr wpsg_mod_creditcard_field">
+ <label>
+ <?php echo __('Kartennummer', 'wpsg'); ?><span class="wpsg_required">*</span>:
+ <input class="<?php echo ((in_array("mod_creditcard_knr", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="wpsg_mod_creditcard_knr" name="wpsg_mod_creditcard[knr]" value="<?php echo wpsg_hspc($this->view['wpsg_mod_creditcard']['knr']); ?>" />
+ </label>
+ </div>
+ <div class="wpsg_clear"></div>
+
+ <div class="wpsg_mod_creditcard_knr wpsg_mod_creditcard_field">
+ <label>
+ <?php echo __('Prüfziffer', 'wpsg'); ?><span class="wpsg_required">*</span>:
+ <input class="<?php echo ((in_array("mod_creditcard_pruefz", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" name="wpsg_mod_creditcard[pruefz]" value="<?php echo wpsg_hspc($this->view['wpsg_mod_creditcard']['pruefz']); ?>" />
+ </label>
+ </div>
+ <div class="wpsg_clear"></div>
+
+ <div class="wpsg_mod_creditcard_knr wpsg_mod_creditcard_field">
+ <label>
+ <?php echo __('Gültigkeit', 'wpsg'); ?><span class="wpsg_required">*</span>:
+ <!-- <input class="<?php echo ((in_array("mod_creditcard_gueltig", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" name="wpsg_mod_creditcard[gueltig]" value="<?php echo wpsg_hspc($this->view['wpsg_mod_creditcard']['gueltig']); ?>" /> -->
+
+ <select name="wpsg_mod_creditcard[gueltigm]" id="wpsg_mod_creditcard_gueltigm"
+ class="<?php echo ((in_array('mod_creditcard_gueltigm', (array)$this->view['error']))?'wpsg_error':''); ?>" >
+ <option value="01">01</option>
+ <option value="02">02</option>
+ <option value="03">03</option>
+ <option value="04">04</option>
+ <option value="05">05</option>
+ <option value="06">06</option>
+ <option value="07">07</option>
+ <option value="08">08</option>
+ <option value="09">09</option>
+ <option value="10">10</option>
+ <option value="11">11</option>
+ <option value="12" selected="selected">12</option>
+ </select>
+ <select name="wpsg_mod_creditcard[gueltigj]" id="wpsg_mod_creditcard_gueltigj"
+ class="<?php echo ((in_array('mod_creditcard_gueltigj', (array)$this->view['error']))?'wpsg_error':''); ?>" >
+
+ </select>
+ </label>
+ </div>
+ <div class="wpsg_clear"></div>
+
+
+ <div class="wpsg_mandatoryfield_hint">
+ <?php echo wpsg_translate(__('Mit #1# gekennzeichnete Felder sind Pflichtfelder.', 'wpsg'), '<span class="wpsg_required">*</span>'); ?>
+ </div>
+
+</div>
+
+<script>
+
+jQuery(document).ready(function() {
+ var gm,
+ gj,
+ sel1,
+ i,
+ dt,
+ garr;
+
+ gm="<?php echo wpsg_hspc($this->view['wpsg_mod_creditcard']['gueltigm']); ?>";
+ gj="<?php echo wpsg_hspc($this->view['wpsg_mod_creditcard']['gueltigj']); ?>";
+
+ dt = new Date();
+ dt = dt.getFullYear();
+ sel1 = document.getElementById("wpsg_mod_creditcard_gueltigj");
+ for (i = 0; i < 6; i++) {
+ newopt = new Option(dt + i, dt + i, false, false);
+ sel1.options[i] = newopt;
+ }
+ //gm = '06';
+ //gj = '2018';
+ jQuery('#wpsg_mod_creditcard_gueltigm').val(gm);
+ jQuery('#wpsg_mod_creditcard_gueltigj').val(gj);
+
+
+});
+
+//alert(jQuery("#wpsg_mod_creditcard_knr").length);
+//$(document).on("input", "#wpsg_mod_creditcard_knr", function () {
+jQuery("#wpsg_mod_creditcard_knr").on("input", function () {
+ var
+ knr,
+ typ,
+ a1,
+ ai,
+ isANumber,
+ bb = true,
+ sum = 0,
+ k = 2,
+ i;
+ //alert("onchange");
+ knr = jQuery('#wpsg_mod_creditcard_knr').val();
+ typ = jQuery('#wpsg_mod_creditcard_typ').val();
+ knr = knr.replace(/ /g, "");
+ if (knr.length < 16) { return; }
+
+ isANumber = (isNaN(knr) === false);
+ if (isANumber === false) { bb = false; }
+ a1 = knr.substr(0, 1);
+ ai = parseInt(knr.substr(15, 1), 10);
+ if (!(((a1 === "4") && (typ === "VISA")) || ((a1 === "5") && (typ === "MasterCard")))) { bb = false; }
+ for (i = 14; i >= 0; i--) {
+ sum = sum + k * parseInt(knr.substr(i, 1), 10);
+ if (k === 2) { k = 1; } else { k = 2; }
+ }
+ sum = sum % 10;
+ if (sum > 0) { sum = 10 - sum; }
+ if (sum !== ai) { bb = false; }
+
+ if (bb === false) {
+ alert('Kartennummer fehlerhaft');
+ }
+
+});
+
+
+</script>
\ No newline at end of file diff --git a/views/mods/mod_creditcard/settings_edit.phtml b/views/mods/mod_creditcard/settings_edit.phtml new file mode 100644 index 0000000..d8ec516 --- /dev/null +++ b/views/mods/mod_creditcard/settings_edit.phtml @@ -0,0 +1,17 @@ +<?php
+
+ /**
+ * Template für die Einstellungen des Moduls "Kreditkarte"
+ */
+
+?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_creditcard_bezeichnung', __('Bezeichnung', 'wpsg'), $this->get_option('wpsg_mod_creditcard_bezeichnung'), array('help' => 'wpsg_shippay_name')); ?>
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_creditcard_aktiv', __('Aktiv', 'wpsg'), $this->get_option('wpsg_mod_creditcard_aktiv'), array('help' => 'wpsg_shippay_activ')); ?>
+<?php echo wpsg_drawForm_Textarea('wpsg_mod_creditcard_hint', __('Hinweistext', 'wpsg'), $this->get_option('wpsg_mod_creditcard_hint'), array('help' => 'wpsg_shippay_hint')); ?>
+
+<br />
+<?php echo wpsg_drawForm_Input('wpsg_mod_creditcard_gebuehr', __('Gebühr/Rabatt', 'wpsg'), wpsg_ff($this->get_option('wpsg_mod_creditcard_gebuehr'), true), array('unit' => $this->get_option('wpsg_currency').' / %', 'help' => 'wpsg_shippay_gebuehr')); ?>
+<?php echo wpsg_drawForm_Select('wpsg_mod_creditcard_mwst', __('Mehrwertsteuersatz', 'wpsg'), wpsg_tax_groups(), $this->get_option('wpsg_mod_creditcard_mwst')); ?>
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_creditcard_mwstland', __('Keine MwSt. wenn Land steuerfrei', 'wpsg'), $this->get_option('wpsg_mod_creditcard_mwstland'), array('help' => 'wpsg_shippay_mwstland')); ?>
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_creditcard_iban', __('IBAN/BIC statt Kontonummer/BLZ verwenden', 'wpsg'), $this->get_option('wpsg_mod_creditcard_iban'), array('help' => 'wpsg_mod_creditcard_iban')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_creditcard_schluessel', __('Schluessel', 'wpsg'), $this->get_option('wpsg_mod_creditcard_schluessel'), array('help' => 'wpsg_shippay_name')); ?>
diff --git a/views/mods/mod_rechnungen/settings_edit.phtml b/views/mods/mod_rechnungen/settings_edit.phtml index c1d3c1e..a401317 100644 --- a/views/mods/mod_rechnungen/settings_edit.phtml +++ b/views/mods/mod_rechnungen/settings_edit.phtml @@ -5,120 +5,57 @@ */
?>
-<script type="text/javascript">
- /**
- * Wird beim anlegen einer neuen Fußzeile aufgerufen
- */
- function wpsg_addFooter()
- {
-
- jQuery('#foottext_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
-
- jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_rechnungen&do=add&noheader=1',
- success: function(data) {
- jQuery('#foottext_list').html(data);
- }
- } );
-
- return false;
-
- } // function wpsg_addFooter()
-
- /**
- * Wird beim entfernen einer Fußzeile aufgerufen
- */
- function wpsg_removeFooter(foot_id)
- {
-
- if (!confirm('<?php echo __('Sind Sie sich sicher, dass Sie diese Fußzeile löschen möchten?', 'wpsg'); ?>')) return false;
-
- jQuery('#foottext_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
-
- jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_rechnungen&do=removeFooter&noheader=1',
- data: {
- foot_id: foot_id
- },
- success: function(data) {
- jQuery('#foottext_list').html(data);
- }
- } );
-
- return false;
-
- } // function wpsg_removeFooter()
-
-</script>
-
-<br />
-<div class="wpsg_admin_box" id="wpsg_tab">
- <div class="head">
- <div class="title">
- <div class="tab" id="tab1"><?php echo __('Vordefinierte Textfelder', 'wpsg'); ?></div>
- <div class="tab" id="tab2"><?php echo __('Fußzeile', 'wpsg'); ?></div>
- <div class="tab" id="tab3"><?php echo __('Sonstiges', 'wpsg'); ?></div>
- <div class="tabcontent tablink">
- <a href="" title="<?php echo __('Neues Feld für die Fußzeile hinzufügen', 'wpsg'); ?>" class="wpsg_icon wpsg_icon_right wpsg_icon_add" onclick="return wpsg_addFooter();"></a>
- </div>
- <div class="wpsg_clear"></div>
- </div>
- </div>
- <div class="content" id="wpsg_mwst_list">
-
- <div id="tabcontent1" class="tabcontent">
+<div>
+ <ul class="nav nav-tabs" role="tablist">
+ <li role="presentation" class="active"><a href="#tab1" aria-controls="home" role="tab" data-toggle="tab"><?php echo __('Vordefinierte Textfelder', 'wpsg'); ?></a></li>
+ <li role="presentation"><a href="#tab2" aria-controls="profile" role="tab" data-toggle="tab"><?php echo __('Fußzeile', 'wpsg'); ?></a></li>
+ <li role="presentation"><a href="#tab3" aria-controls="messages" role="tab" data-toggle="tab"><?php echo __('Sonstiges', 'wpsg'); ?></a></li>
+ </ul>
+ <div class="tab-content">
+ <div id="tab1" role="tabpanel" class="tab-pane active" >
<?php echo wpsg_drawForm_Input('wpsg_rechnungen_adresszeile', __('Adresszeile', 'wpsg'), $this->get_option('wpsg_rechnungen_adresszeile')); ?>
+<!--
<div class="wpsg_hinweis"><?php echo __('Diese Zeile wird klein oberhalb der Kundenadresse platziert', 'wpsg'); ?></div>
<br />
-
- <div class="wpsg_form_field">
- <div class="wpsg_form_left">
- <label><?php echo __('Briefpapier (PDF/JPG)', 'wpsg'); ?>:</label><br />
- <?php if ($this->view['bp'] !== false) { ?>
- <label>
- <input type="checkbox" name="wpsg_rechnungen_bp_del" value="1" /> <?php echo __('Löschen', 'wpsg'); ?>
- </label>
- <?php } ?>
- </div>
- <div class="wpsg_form_right">
- <?php if ($this->view['bp'] === false) { ?>
- <p><?php echo __('Es wurde bisher kein Briefpapier hochgeladen', 'wpsg'); ?></p>
- <?php } else { ?>
- <a href="<?php echo $this->view['bp']; ?>" target="_blank"><?php echo __('Derzeitiges Briefpapier', 'wpsg'); ?></a>
- <?php } ?>
- <a style="float:right; position:relative;" class="wpsg_form_help" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_bp" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_bp"></a>
- <input type="file" name="wpsg_rechnungen_bp">
- </div>
- <div class="wpsg_clear"></div>
- </div>
-
- <div class="wpsg_form_field">
- <div class="wpsg_form_left">
- <label><?php echo __('Logo (JPG)', 'wpsg'); ?>:</label><br />
- <?php if ($this->view['logo'] !== false) { ?>
- <label>
- <input type="checkbox" name="wpsg_rechnungen_logo_del" value="1" /> <?php echo __('Löschen', 'wpsg'); ?>
- </label>
- <?php } ?>
- </div>
- <div class="wpsg_form_right">
- <?php if ($this->view['logo'] === false) { ?>
- <p><?php echo __('Es wurde bisher kein Logo hochgeladen', 'wpsg'); ?></p>
- <?php } else { ?>
- <a href="<?php echo $this->view['logo']; ?>" target="_blank"><?php echo __('Derzeitiges Logo', 'wpsg'); ?></a>
- <?php } ?>
- <a style="float:right; position:relative;" class="wpsg_form_help" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_logo" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_logo"></a>
- <input type="file" name="wpsg_rechnungen_logo">
- </div>
- <div class="wpsg_clear"></div>
- </div>
-
+-->
+ <?php echo wpsg_drawForm_TextStart(); ?>
+ <?php if ($this->view['bp'] === false) { ?>
+ <p><?php echo __('Es wurde bisher kein Briefpapier hochgeladen', 'wpsg'); ?></p>
+ <?php } else { ?>
+ <a href="<?php echo $this->view['bp']; ?>" target="_blank"><?php echo __('Derzeitiges Briefpapier', 'wpsg'); ?></a>
+ <?php } ?>
+ <a style="float:right; position:relative;" class="wpsg_form_help" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_bp" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_bp"></a>
+ <input type="file" name="wpsg_rechnungen_bp">
+ <?php $strSuffix = ''; if ($this->view['bp'] !== false) { $strSuffix = '
+ <label>
+ <input type="checkbox" name="wpsg_rechnungen_bp_del" value="1" /> '.__('Löschen', 'wpsg').'
+ </label>';
+ } ?>
+ <?php echo wpsg_drawForm_TextEnd(__('Briefpapier (PDF/JPG)', 'wpsg').$strSuffix, array('noP' => true, 'help' => 'wpsg_rechnungen_bp')); ?>
+
+ <?php echo wpsg_drawForm_TextStart(); ?>
+ <?php if ($this->view['logo'] === false) { ?>
+ <p><?php echo __('Es wurde bisher kein Logo hochgeladen', 'wpsg'); ?></p>
+ <?php } else { ?>
+ <a href="<?php echo $this->view['logo']; ?>" target="_blank"><?php echo __('Derzeitiges Logo', 'wpsg'); ?></a>
+ <?php } ?>
+ <a style="float:right; position:relative;" class="wpsg_form_help" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_logo" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_logo"></a>
+ <input type="file" name="wpsg_rechnungen_logo">
+ <?php $strSuffix = ''; if ($this->view['logo'] !== false) { $strSuffix = '
+ <label>
+ <input type="checkbox" name="wpsg_rechnungen_logo_del" value="1" /> '.__('Löschen', 'wpsg').'
+ </label>';
+ } ?>
+ <?php echo wpsg_drawForm_TextEnd(__('Logo (JPG)', 'wpsg').$strSuffix, array('noP' => true, 'help' => 'wpsg_rechnungen_bp')); ?>
+
+<!--
<div class="wpsg_hinweis"><?php echo __('Das Briefpapier wird hinter die gesamte Seite gelegt, das Logo wird rechts oben auf jeder Seite platziert. (96 dpi)', 'wpsg'); ?></div>
<br />
-
- <table class="wpsg_mod_rechnungen_fieldtable">
+-->
+ <table class="table table-body-striped wpsg_mod_deliverynote_fieldtable">
+ <thead>
<tr>
<th class="col_bezeichnung"><?php echo __('Bezeichnung', 'wpsg'); ?></th>
<th class="col_freitext"><?php echo __('Freitext', 'wpsg'); ?></th>
@@ -128,30 +65,26 @@ <th class="col_groesse"><?php echo __('Größe', 'wpsg'); ?></th>
<th class="col_action"></th>
</tr>
+ </thead>
+ <tbody>
<?php foreach ($this->view['fields'] as $f => $field_name) { ?>
<tr>
- <td><?php echo wpsg_hspc($field_name); ?></td>
+ <td><?php echo wpsg_getStr($field_name); ?></td>
<td>
- <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][text]" value="<?php echo wpsg_hspc($this->view['arTexte'][$f]['text']); ?>" />
+ <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][text]" value="<?php echo wpsg_getStr($this->view['arTexte'][$f]['text']); ?>" />
</td>
<td>
- <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][x]" value="<?php echo wpsg_hspc($this->view['arTexte'][$f]['x']); ?>" />
+ <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][x]" value="<?php echo wpsg_getStr($this->view['arTexte'][$f]['x']); ?>" />
</td>
<td>
- <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][y]" value="<?php echo wpsg_hspc($this->view['arTexte'][$f]['y']); ?>" />
+ <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][y]" value="<?php echo wpsg_getStr($this->view['arTexte'][$f]['y']); ?>" />
</td>
<td>
- <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][color]" value="<?php echo wpsg_hspc($this->view['arTexte'][$f]['color']); ?>" />
+ <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][color]" value="<?php echo wpsg_getStr($this->view['arTexte'][$f]['color']); ?>" />
</td>
<td>
<select name="text[<?php echo $f; ?>][fontsize]" style="width:100%;">
- <option <?php echo (($this->view['arTexte'][$f]['fontsize'] == "8")?'selected="selected"':''); ?> value="8">8</option>
- <option <?php echo (($this->view['arTexte'][$f]['fontsize'] == "9")?'selected="selected"':''); ?> value="9">9</option>
- <option <?php echo (($this->view['arTexte'][$f]['fontsize'] == "10")?'selected="selected"':''); ?> value="10">10</option>
- <option <?php echo (($this->view['arTexte'][$f]['fontsize'] == "11")?'selected="selected"':''); ?> value="11">11</option>
- <option <?php echo (($this->view['arTexte'][$f]['fontsize'] == "12")?'selected="selected"':''); ?> value="12">12</option>
- <option <?php echo (($this->view['arTexte'][$f]['fontsize'] == "13")?'selected="selected"':''); ?> value="13">13</option>
- <option <?php echo (($this->view['arTexte'][$f]['fontsize'] == "14")?'selected="selected"':''); ?> value="14">14</option>
+
</select>
</td>
<td>
@@ -160,6 +93,7 @@ </td>
</tr>
<?php } ?>
+ </tbody>
</table>
<br />
@@ -173,7 +107,7 @@ <br />
</div>
- <div id="tabcontent2" class="tabcontent">
+ <div id="tab2" role="tabpanel" class="tab-pane" >
<div id="foottext_list"><?php echo $this->view['foottext_list']; ?></div>
<br />
@@ -183,7 +117,7 @@ </div>
</div>
- <div id="tabcontent3" class="tabcontent">
+ <div id="tab3" role="tabpanel" class="tab-pane" >
<?php echo wpsg_drawForm_Input('wpsg_rechnungen_url', __('URL Benachrichtigung', 'wpsg'), $this->get_option('wpsg_rechnungen_url'), array('help' => 'wpsg_rechnung_url')); ?>
<?php echo wpsg_drawForm_Select('wpsg_mod_rechnungen_auto', __('Rechnungserstellung', 'wpsg'), array(
@@ -227,7 +161,6 @@ <div class="wpsg_clear"></div>
</div>
-
</div>
</div>
@@ -243,4 +176,49 @@ } );
} );
+
+ /**
+ * Wird beim anlegen einer neuen Fußzeile aufgerufen
+ */
+ function wpsg_addFooter()
+ {
+
+ jQuery('#foottext_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_rechnungen&do=add&noheader=1',
+ success: function(data) {
+ jQuery('#foottext_list').html(data);
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_addFooter()
+
+ /**
+ * Wird beim entfernen einer Fußzeile aufgerufen
+ */
+ function wpsg_removeFooter(foot_id)
+ {
+
+ if (!confirm('<?php echo __('Sind Sie sich sicher, dass Sie diese Fußzeile löschen möchten?', 'wpsg'); ?>')) return false;
+
+ jQuery('#foottext_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_rechnungen&do=removeFooter&noheader=1',
+ data: {
+ foot_id: foot_id
+ },
+ success: function(data) {
+ jQuery('#foottext_list').html(data);
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_removeFooter()
+
+
/* ]]> */</script>
\ No newline at end of file diff --git a/views/mods/mod_statistics/chartturnover/day.phtml b/views/mods/mod_statistics/chartturnover/day.phtml index 18c1b4c..7ec62c6 100644 --- a/views/mods/mod_statistics/chartturnover/day.phtml +++ b/views/mods/mod_statistics/chartturnover/day.phtml @@ -24,7 +24,10 @@ $chartJS['legend'][$i] .= "}";
$j = 0;
-
+
+ if (wpsg_isSizedArray($this->view['chart']['data'][$i]))
+ {
+
foreach ((array)$this->view['chart']['data'][$i]['records'] as $index => $record)
{
@@ -48,7 +51,9 @@ }
$j++;
- }
+ }
+
+ }
}
diff --git a/views/mods/mod_statistics/chartturnoverperhour/all.phtml b/views/mods/mod_statistics/chartturnoverperhour/all.phtml index 1698126..a7d96c2 100644 --- a/views/mods/mod_statistics/chartturnoverperhour/all.phtml +++ b/views/mods/mod_statistics/chartturnoverperhour/all.phtml @@ -25,29 +25,34 @@ $j = 0;
- foreach ((array)$this->view['chart']['data'][$i]['records'] as $index => $record)
+ if (wpsg_isSizedArray($this->view['chart']['data'][$i]))
{
- //immer das Datum vom Rootelement nutzen
- $k = 0 ;
- foreach ($this->view['chart']['data'][0]['records'] as $rindex => $rrecord)
+ foreach ((array)$this->view['chart']['data'][$i]['records'] as $index => $record)
{
- if ($j == $k)
- {
- //if (mktime($record['hour'], 0, 0, $record['month'], $record['day'], $record['year']) <= mktime(date('H'), 0, 0, date('m'), date('d'), date('Y')))
- //{
- $chartJS['area']['area'.$i][] = "['".$rrecord['year'].'/'.$rrecord['month'].'/'.$rrecord['day']." ".$rrecord['hour'].":00:00', ".wpsg_hspc($record['total'])."]";
- //}
- }
- $k++;
+ //immer das Datum vom Rootelement nutzen
+ $k = 0 ;
+
+ foreach ($this->view['chart']['data'][0]['records'] as $rindex => $rrecord)
+ {
+ if ($j == $k)
+ {
+ //if (mktime($record['hour'], 0, 0, $record['month'], $record['day'], $record['year']) <= mktime(date('H'), 0, 0, date('m'), date('d'), date('Y')))
+ //{
+ $chartJS['area']['area'.$i][] = "['".$rrecord['year'].'/'.$rrecord['month'].'/'.$rrecord['day']." ".$rrecord['hour'].":00:00', ".wpsg_hspc($record['total'])."]";
+ //}
+ }
+ $k++;
+ }
+
+ if ($j == count($this->view['chart']['data'][$i]['records']) - 1) {
+ $chartJS['area']['area'.$i] = '['.implode(',', (array)$chartJS['area']['area'.$i]).']';
+ }
+
+ $j++;
}
- if ($j == count($this->view['chart']['data'][$i]['records']) - 1) {
- $chartJS['area']['area'.$i] = '['.implode(',', (array)$chartJS['area']['area'.$i]).']';
- }
-
- $j++;
- }
+ }
}
diff --git a/views/mods/mod_statistics/customermap/all.phtml b/views/mods/mod_statistics/customermap/all.phtml index b35624c..20e86d4 100644 --- a/views/mods/mod_statistics/customermap/all.phtml +++ b/views/mods/mod_statistics/customermap/all.phtml @@ -1,7 +1,7 @@ <?php
/**
- * Template für die Anzeige der Kundenkarte innerhalb des Statistikmoduls
+ * Template f�r die Anzeige der Kundenkarte innerhalb des Statistikmoduls
*/
?>
@@ -18,12 +18,15 @@ var map = new google.maps.Map(document.getElementById("wpsg_mod_statistics_map"), mapOptions);
var bounds = new google.maps.LatLngBounds();
-
+ var markers = [];
+
<?php $i = 1; foreach ($this->view['wpsg_mod_statistics']['marker'] as $m) { ?>
var marker<?php echo $i; ?> = new google.maps.Marker({
- position: new google.maps.LatLng(<?php echo $m['long']; ?>, <?php echo $m['lat']; ?>),
+ position: new google.maps.LatLng(<?php echo $m['lat']; ?>, <?php echo $m['long']; ?>),
map: map
} );
+ markers.push(marker<?php echo $i; ?>);
+
google.maps.event.addListener(marker<?php echo $i; ?>, 'click', function() {
location.href = '<?php echo WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Customer&action=edit&edit_id='.$m['customer']['id']; ?>';
} );
@@ -32,6 +35,10 @@ map.fitBounds(bounds);
map.setZoom(15);
+
+ var markerCluster = new MarkerClusterer(map, markers,
+ {imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});
+
} // function wpsg_mod_statistics_initialize()
diff --git a/views/mods/mod_statistics/js/markerclusterer.js b/views/mods/mod_statistics/js/markerclusterer.js new file mode 100644 index 0000000..21ab547 --- /dev/null +++ b/views/mods/mod_statistics/js/markerclusterer.js @@ -0,0 +1,1315 @@ +// ==ClosureCompiler==
+// @compilation_level ADVANCED_OPTIMIZATIONS
+// @externs_url https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/maps/google_maps_api_v3.js
+// ==/ClosureCompiler==
+
+/**
+ * @name MarkerClusterer for Google Maps v3
+ * @version version 1.0
+ * @author Luke Mahe
+ * @fileoverview
+ * The library creates and manages per-zoom-level clusters for large amounts of
+ * markers.
+ * <br/>
+ * This is a v3 implementation of the
+ * <a href="http://gmaps-utility-library-dev.googlecode.com/svn/tags/markerclusterer/"
+ * >v2 MarkerClusterer</a>.
+ */
+
+/**
+ * @license
+ * Copyright 2010 Google Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/**
+ * A Marker Clusterer that clusters markers.
+ *
+ * @param {google.maps.Map} map The Google map to attach to.
+ * @param {Array.<google.maps.Marker>=} opt_markers Optional markers to add to
+ * the cluster.
+ * @param {Object=} opt_options support the following options:
+ * 'gridSize': (number) The grid size of a cluster in pixels.
+ * 'maxZoom': (number) The maximum zoom level that a marker can be part of a
+ * cluster.
+ * 'zoomOnClick': (boolean) Whether the default behaviour of clicking on a
+ * cluster is to zoom into it.
+ * 'averageCenter': (boolean) Whether the center of each cluster should be
+ * the average of all markers in the cluster.
+ * 'minimumClusterSize': (number) The minimum number of markers to be in a
+ * cluster before the markers are hidden and a count
+ * is shown.
+ * 'styles': (object) An object that has style properties:
+ * 'url': (string) The image url.
+ * 'height': (number) The image height.
+ * 'width': (number) The image width.
+ * 'anchor': (Array) The anchor position of the label text.
+ * 'textColor': (string) The text color.
+ * 'textSize': (number) The text size.
+ * 'backgroundPosition': (string) The position of the backgound x, y.
+ * 'iconAnchor': (Array) The anchor position of the icon x, y.
+ * @constructor
+ * @extends google.maps.OverlayView
+ */
+function MarkerClusterer(map, opt_markers, opt_options) {
+ // MarkerClusterer implements google.maps.OverlayView interface. We use the
+ // extend function to extend MarkerClusterer with google.maps.OverlayView
+ // because it might not always be available when the code is defined so we
+ // look for it at the last possible moment. If it doesn't exist now then
+ // there is no point going ahead :)
+ this.extend(MarkerClusterer, google.maps.OverlayView);
+ this.map_ = map;
+
+ /**
+ * @type {Array.<google.maps.Marker>}
+ * @private
+ */
+ this.markers_ = [];
+
+ /**
+ * @type {Array.<Cluster>}
+ */
+ this.clusters_ = [];
+
+ this.sizes = [53, 56, 66, 78, 90];
+
+ /**
+ * @private
+ */
+ this.styles_ = [];
+
+ /**
+ * @type {boolean}
+ * @private
+ */
+ this.ready_ = false;
+
+ var options = opt_options || {};
+
+ /**
+ * @type {number}
+ * @private
+ */
+ this.gridSize_ = options['gridSize'] || 60;
+
+ /**
+ * @private
+ */
+ this.minClusterSize_ = options['minimumClusterSize'] || 2;
+
+
+ /**
+ * @type {?number}
+ * @private
+ */
+ this.maxZoom_ = options['maxZoom'] || null;
+
+ this.styles_ = options['styles'] || [];
+
+ /**
+ * @type {string}
+ * @private
+ */
+ this.imagePath_ = options['imagePath'] ||
+ this.MARKER_CLUSTER_IMAGE_PATH_;
+
+ /**
+ * @type {string}
+ * @private
+ */
+ this.imageExtension_ = options['imageExtension'] ||
+ this.MARKER_CLUSTER_IMAGE_EXTENSION_;
+
+ /**
+ * @type {boolean}
+ * @private
+ */
+ this.zoomOnClick_ = true;
+
+ if (options['zoomOnClick'] != undefined) {
+ this.zoomOnClick_ = options['zoomOnClick'];
+ }
+
+ /**
+ * @type {boolean}
+ * @private
+ */
+ this.averageCenter_ = false;
+
+ if (options['averageCenter'] != undefined) {
+ this.averageCenter_ = options['averageCenter'];
+ }
+
+ this.setupStyles_();
+
+ this.setMap(map);
+
+ /**
+ * @type {number}
+ * @private
+ */
+ this.prevZoom_ = this.map_.getZoom();
+
+ // Add the map event listeners
+ var that = this;
+ google.maps.event.addListener(this.map_, 'zoom_changed', function() {
+ var zoom = that.map_.getZoom();
+
+ if (that.prevZoom_ != zoom) {
+ that.prevZoom_ = zoom;
+ that.resetViewport();
+ }
+ });
+
+ google.maps.event.addListener(this.map_, 'idle', function() {
+ that.redraw();
+ });
+
+ // Finally, add the markers
+ if (opt_markers && opt_markers.length) {
+ this.addMarkers(opt_markers, false);
+ }
+}
+
+
+/**
+ * The marker cluster image path.
+ *
+ * @type {string}
+ * @private
+ */
+MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_ = '../images/m';
+
+
+/**
+ * The marker cluster image path.
+ *
+ * @type {string}
+ * @private
+ */
+MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_ = 'png';
+
+
+/**
+ * Extends a objects prototype by anothers.
+ *
+ * @param {Object} obj1 The object to be extended.
+ * @param {Object} obj2 The object to extend with.
+ * @return {Object} The new extended object.
+ * @ignore
+ */
+MarkerClusterer.prototype.extend = function(obj1, obj2) {
+ return (function(object) {
+ for (var property in object.prototype) {
+ this.prototype[property] = object.prototype[property];
+ }
+ return this;
+ }).apply(obj1, [obj2]);
+};
+
+
+/**
+ * Implementaion of the interface method.
+ * @ignore
+ */
+MarkerClusterer.prototype.onAdd = function() {
+ this.setReady_(true);
+};
+
+/**
+ * Implementaion of the interface method.
+ * @ignore
+ */
+MarkerClusterer.prototype.draw = function() {};
+
+/**
+ * Sets up the styles object.
+ *
+ * @private
+ */
+MarkerClusterer.prototype.setupStyles_ = function() {
+ if (this.styles_.length) {
+ return;
+ }
+
+ for (var i = 0, size; size = this.sizes[i]; i++) {
+ this.styles_.push({
+ url: this.imagePath_ + (i + 1) + '.' + this.imageExtension_,
+ height: size,
+ width: size
+ });
+ }
+};
+
+/**
+ * Fit the map to the bounds of the markers in the clusterer.
+ */
+MarkerClusterer.prototype.fitMapToMarkers = function() {
+ var markers = this.getMarkers();
+ var bounds = new google.maps.LatLngBounds();
+ for (var i = 0, marker; marker = markers[i]; i++) {
+ bounds.extend(marker.getPosition());
+ }
+
+ this.map_.fitBounds(bounds);
+};
+
+
+/**
+ * Sets the styles.
+ *
+ * @param {Object} styles The style to set.
+ */
+MarkerClusterer.prototype.setStyles = function(styles) {
+ this.styles_ = styles;
+};
+
+
+/**
+ * Gets the styles.
+ *
+ * @return {Object} The styles object.
+ */
+MarkerClusterer.prototype.getStyles = function() {
+ return this.styles_;
+};
+
+
+/**
+ * Whether zoom on click is set.
+ *
+ * @return {boolean} True if zoomOnClick_ is set.
+ */
+MarkerClusterer.prototype.isZoomOnClick = function() {
+ return this.zoomOnClick_;
+};
+
+/**
+ * Whether average center is set.
+ *
+ * @return {boolean} True if averageCenter_ is set.
+ */
+MarkerClusterer.prototype.isAverageCenter = function() {
+ return this.averageCenter_;
+};
+
+
+/**
+ * Returns the array of markers in the clusterer.
+ *
+ * @return {Array.<google.maps.Marker>} The markers.
+ */
+MarkerClusterer.prototype.getMarkers = function() {
+ return this.markers_;
+};
+
+
+/**
+ * Returns the number of markers in the clusterer
+ *
+ * @return {Number} The number of markers.
+ */
+MarkerClusterer.prototype.getTotalMarkers = function() {
+ return this.markers_.length;
+};
+
+
+/**
+ * Sets the max zoom for the clusterer.
+ *
+ * @param {number} maxZoom The max zoom level.
+ */
+MarkerClusterer.prototype.setMaxZoom = function(maxZoom) {
+ this.maxZoom_ = maxZoom;
+};
+
+
+/**
+ * Gets the max zoom for the clusterer.
+ *
+ * @return {number} The max zoom level.
+ */
+MarkerClusterer.prototype.getMaxZoom = function() {
+ return this.maxZoom_;
+};
+
+
+/**
+ * The function for calculating the cluster icon image.
+ *
+ * @param {Array.<google.maps.Marker>} markers The markers in the clusterer.
+ * @param {number} numStyles The number of styles available.
+ * @return {Object} A object properties: 'text' (string) and 'index' (number).
+ * @private
+ */
+MarkerClusterer.prototype.calculator_ = function(markers, numStyles) {
+ var index = 0;
+ var count = markers.length;
+ var dv = count;
+ while (dv !== 0) {
+ dv = parseInt(dv / 10, 10);
+ index++;
+ }
+
+ index = Math.min(index, numStyles);
+ return {
+ text: count,
+ index: index
+ };
+};
+
+
+/**
+ * Set the calculator function.
+ *
+ * @param {function(Array, number)} calculator The function to set as the
+ * calculator. The function should return a object properties:
+ * 'text' (string) and 'index' (number).
+ *
+ */
+MarkerClusterer.prototype.setCalculator = function(calculator) {
+ this.calculator_ = calculator;
+};
+
+
+/**
+ * Get the calculator function.
+ *
+ * @return {function(Array, number)} the calculator function.
+ */
+MarkerClusterer.prototype.getCalculator = function() {
+ return this.calculator_;
+};
+
+
+/**
+ * Add an array of markers to the clusterer.
+ *
+ * @param {Array.<google.maps.Marker>} markers The markers to add.
+ * @param {boolean=} opt_nodraw Whether to redraw the clusters.
+ */
+MarkerClusterer.prototype.addMarkers = function(markers, opt_nodraw) {
+ for (var i = 0, marker; marker = markers[i]; i++) {
+ this.pushMarkerTo_(marker);
+ }
+ if (!opt_nodraw) {
+ this.redraw();
+ }
+};
+
+
+/**
+ * Pushes a marker to the clusterer.
+ *
+ * @param {google.maps.Marker} marker The marker to add.
+ * @private
+ */
+MarkerClusterer.prototype.pushMarkerTo_ = function(marker) {
+ marker.isAdded = false;
+ if (marker['draggable']) {
+ // If the marker is draggable add a listener so we update the clusters on
+ // the drag end.
+ var that = this;
+ google.maps.event.addListener(marker, 'dragend', function() {
+ marker.isAdded = false;
+ that.repaint();
+ });
+ }
+ this.markers_.push(marker);
+};
+
+
+/**
+ * Adds a marker to the clusterer and redraws if needed.
+ *
+ * @param {google.maps.Marker} marker The marker to add.
+ * @param {boolean=} opt_nodraw Whether to redraw the clusters.
+ */
+MarkerClusterer.prototype.addMarker = function(marker, opt_nodraw) {
+ this.pushMarkerTo_(marker);
+ if (!opt_nodraw) {
+ this.redraw();
+ }
+};
+
+
+/**
+ * Removes a marker and returns true if removed, false if not
+ *
+ * @param {google.maps.Marker} marker The marker to remove
+ * @return {boolean} Whether the marker was removed or not
+ * @private
+ */
+MarkerClusterer.prototype.removeMarker_ = function(marker) {
+ var index = -1;
+ if (this.markers_.indexOf) {
+ index = this.markers_.indexOf(marker);
+ } else {
+ for (var i = 0, m; m = this.markers_[i]; i++) {
+ if (m == marker) {
+ index = i;
+ break;
+ }
+ }
+ }
+
+ if (index == -1) {
+ // Marker is not in our list of markers.
+ return false;
+ }
+
+ marker.setMap(null);
+
+ this.markers_.splice(index, 1);
+
+ return true;
+};
+
+
+/**
+ * Remove a marker from the cluster.
+ *
+ * @param {google.maps.Marker} marker The marker to remove.
+ * @param {boolean=} opt_nodraw Optional boolean to force no redraw.
+ * @return {boolean} True if the marker was removed.
+ */
+MarkerClusterer.prototype.removeMarker = function(marker, opt_nodraw) {
+ var removed = this.removeMarker_(marker);
+
+ if (!opt_nodraw && removed) {
+ this.resetViewport();
+ this.redraw();
+ return true;
+ } else {
+ return false;
+ }
+};
+
+
+/**
+ * Removes an array of markers from the cluster.
+ *
+ * @param {Array.<google.maps.Marker>} markers The markers to remove.
+ * @param {boolean=} opt_nodraw Optional boolean to force no redraw.
+ */
+MarkerClusterer.prototype.removeMarkers = function(markers, opt_nodraw) {
+ var removed = false;
+
+ for (var i = 0, marker; marker = markers[i]; i++) {
+ var r = this.removeMarker_(marker);
+ removed = removed || r;
+ }
+
+ if (!opt_nodraw && removed) {
+ this.resetViewport();
+ this.redraw();
+ return true;
+ }
+};
+
+
+/**
+ * Sets the clusterer's ready state.
+ *
+ * @param {boolean} ready The state.
+ * @private
+ */
+MarkerClusterer.prototype.setReady_ = function(ready) {
+ if (!this.ready_) {
+ this.ready_ = ready;
+ this.createClusters_();
+ }
+};
+
+
+/**
+ * Returns the number of clusters in the clusterer.
+ *
+ * @return {number} The number of clusters.
+ */
+MarkerClusterer.prototype.getTotalClusters = function() {
+ return this.clusters_.length;
+};
+
+
+/**
+ * Returns the google map that the clusterer is associated with.
+ *
+ * @return {google.maps.Map} The map.
+ */
+MarkerClusterer.prototype.getMap = function() {
+ return this.map_;
+};
+
+
+/**
+ * Sets the google map that the clusterer is associated with.
+ *
+ * @param {google.maps.Map} map The map.
+ */
+MarkerClusterer.prototype.setMap = function(map) {
+ this.map_ = map;
+};
+
+
+/**
+ * Returns the size of the grid.
+ *
+ * @return {number} The grid size.
+ */
+MarkerClusterer.prototype.getGridSize = function() {
+ return this.gridSize_;
+};
+
+
+/**
+ * Sets the size of the grid.
+ *
+ * @param {number} size The grid size.
+ */
+MarkerClusterer.prototype.setGridSize = function(size) {
+ this.gridSize_ = size;
+};
+
+
+/**
+ * Returns the min cluster size.
+ *
+ * @return {number} The grid size.
+ */
+MarkerClusterer.prototype.getMinClusterSize = function() {
+ return this.minClusterSize_;
+};
+
+/**
+ * Sets the min cluster size.
+ *
+ * @param {number} size The grid size.
+ */
+MarkerClusterer.prototype.setMinClusterSize = function(size) {
+ this.minClusterSize_ = size;
+};
+
+
+/**
+ * Extends a bounds object by the grid size.
+ *
+ * @param {google.maps.LatLngBounds} bounds The bounds to extend.
+ * @return {google.maps.LatLngBounds} The extended bounds.
+ */
+MarkerClusterer.prototype.getExtendedBounds = function(bounds) {
+ var projection = this.getProjection();
+
+ // Turn the bounds into latlng.
+ var tr = new google.maps.LatLng(bounds.getNorthEast().lat(),
+ bounds.getNorthEast().lng());
+ var bl = new google.maps.LatLng(bounds.getSouthWest().lat(),
+ bounds.getSouthWest().lng());
+
+ // Convert the points to pixels and the extend out by the grid size.
+ var trPix = projection.fromLatLngToDivPixel(tr);
+ trPix.x += this.gridSize_;
+ trPix.y -= this.gridSize_;
+
+ var blPix = projection.fromLatLngToDivPixel(bl);
+ blPix.x -= this.gridSize_;
+ blPix.y += this.gridSize_;
+
+ // Convert the pixel points back to LatLng
+ var ne = projection.fromDivPixelToLatLng(trPix);
+ var sw = projection.fromDivPixelToLatLng(blPix);
+
+ // Extend the bounds to contain the new bounds.
+ bounds.extend(ne);
+ bounds.extend(sw);
+
+ return bounds;
+};
+
+
+/**
+ * Determins if a marker is contained in a bounds.
+ *
+ * @param {google.maps.Marker} marker The marker to check.
+ * @param {google.maps.LatLngBounds} bounds The bounds to check against.
+ * @return {boolean} True if the marker is in the bounds.
+ * @private
+ */
+MarkerClusterer.prototype.isMarkerInBounds_ = function(marker, bounds) {
+ return bounds.contains(marker.getPosition());
+};
+
+
+/**
+ * Clears all clusters and markers from the clusterer.
+ */
+MarkerClusterer.prototype.clearMarkers = function() {
+ this.resetViewport(true);
+
+ // Set the markers a empty array.
+ this.markers_ = [];
+};
+
+
+/**
+ * Clears all existing clusters and recreates them.
+ * @param {boolean} opt_hide To also hide the marker.
+ */
+MarkerClusterer.prototype.resetViewport = function(opt_hide) {
+ // Remove all the clusters
+ for (var i = 0, cluster; cluster = this.clusters_[i]; i++) {
+ cluster.remove();
+ }
+
+ // Reset the markers to not be added and to be invisible.
+ for (var i = 0, marker; marker = this.markers_[i]; i++) {
+ marker.isAdded = false;
+ if (opt_hide) {
+ marker.setMap(null);
+ }
+ }
+
+ this.clusters_ = [];
+};
+
+/**
+ *
+ */
+MarkerClusterer.prototype.repaint = function() {
+ var oldClusters = this.clusters_.slice();
+ this.clusters_.length = 0;
+ this.resetViewport();
+ this.redraw();
+
+ // Remove the old clusters.
+ // Do it in a timeout so the other clusters have been drawn first.
+ window.setTimeout(function() {
+ for (var i = 0, cluster; cluster = oldClusters[i]; i++) {
+ cluster.remove();
+ }
+ }, 0);
+};
+
+
+/**
+ * Redraws the clusters.
+ */
+MarkerClusterer.prototype.redraw = function() {
+ this.createClusters_();
+};
+
+
+/**
+ * Calculates the distance between two latlng locations in km.
+ * @see http://www.movable-type.co.uk/scripts/latlong.html
+ *
+ * @param {google.maps.LatLng} p1 The first lat lng point.
+ * @param {google.maps.LatLng} p2 The second lat lng point.
+ * @return {number} The distance between the two points in km.
+ * @private
+*/
+MarkerClusterer.prototype.distanceBetweenPoints_ = function(p1, p2) {
+ if (!p1 || !p2) {
+ return 0;
+ }
+
+ var R = 6371; // Radius of the Earth in km
+ var dLat = (p2.lat() - p1.lat()) * Math.PI / 180;
+ var dLon = (p2.lng() - p1.lng()) * Math.PI / 180;
+ var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
+ Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) *
+ Math.sin(dLon / 2) * Math.sin(dLon / 2);
+ var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
+ var d = R * c;
+ return d;
+};
+
+
+/**
+ * Add a marker to a cluster, or creates a new cluster.
+ *
+ * @param {google.maps.Marker} marker The marker to add.
+ * @private
+ */
+MarkerClusterer.prototype.addToClosestCluster_ = function(marker) {
+ var distance = 40000; // Some large number
+ var clusterToAddTo = null;
+ var pos = marker.getPosition();
+ for (var i = 0, cluster; cluster = this.clusters_[i]; i++) {
+ var center = cluster.getCenter();
+ if (center) {
+ var d = this.distanceBetweenPoints_(center, marker.getPosition());
+ if (d < distance) {
+ distance = d;
+ clusterToAddTo = cluster;
+ }
+ }
+ }
+
+ if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {
+ clusterToAddTo.addMarker(marker);
+ } else {
+ var cluster = new Cluster(this);
+ cluster.addMarker(marker);
+ this.clusters_.push(cluster);
+ }
+};
+
+
+/**
+ * Creates the clusters.
+ *
+ * @private
+ */
+MarkerClusterer.prototype.createClusters_ = function() {
+ if (!this.ready_) {
+ return;
+ }
+
+ // Get our current map view bounds.
+ // Create a new bounds object so we don't affect the map.
+ var mapBounds = new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),
+ this.map_.getBounds().getNorthEast());
+ var bounds = this.getExtendedBounds(mapBounds);
+
+ for (var i = 0, marker; marker = this.markers_[i]; i++) {
+ if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {
+ this.addToClosestCluster_(marker);
+ }
+ }
+};
+
+
+/**
+ * A cluster that contains markers.
+ *
+ * @param {MarkerClusterer} markerClusterer The markerclusterer that this
+ * cluster is associated with.
+ * @constructor
+ * @ignore
+ */
+function Cluster(markerClusterer) {
+ this.markerClusterer_ = markerClusterer;
+ this.map_ = markerClusterer.getMap();
+ this.gridSize_ = markerClusterer.getGridSize();
+ this.minClusterSize_ = markerClusterer.getMinClusterSize();
+ this.averageCenter_ = markerClusterer.isAverageCenter();
+ this.center_ = null;
+ this.markers_ = [];
+ this.bounds_ = null;
+ this.clusterIcon_ = new ClusterIcon(this, markerClusterer.getStyles(),
+ markerClusterer.getGridSize());
+}
+
+/**
+ * Determins if a marker is already added to the cluster.
+ *
+ * @param {google.maps.Marker} marker The marker to check.
+ * @return {boolean} True if the marker is already added.
+ */
+Cluster.prototype.isMarkerAlreadyAdded = function(marker) {
+ if (this.markers_.indexOf) {
+ return this.markers_.indexOf(marker) != -1;
+ } else {
+ for (var i = 0, m; m = this.markers_[i]; i++) {
+ if (m == marker) {
+ return true;
+ }
+ }
+ }
+ return false;
+};
+
+
+/**
+ * Add a marker the cluster.
+ *
+ * @param {google.maps.Marker} marker The marker to add.
+ * @return {boolean} True if the marker was added.
+ */
+Cluster.prototype.addMarker = function(marker) {
+ if (this.isMarkerAlreadyAdded(marker)) {
+ return false;
+ }
+
+ if (!this.center_) {
+ this.center_ = marker.getPosition();
+ this.calculateBounds_();
+ } else {
+ if (this.averageCenter_) {
+ var l = this.markers_.length + 1;
+ var lat = (this.center_.lat() * (l-1) + marker.getPosition().lat()) / l;
+ var lng = (this.center_.lng() * (l-1) + marker.getPosition().lng()) / l;
+ this.center_ = new google.maps.LatLng(lat, lng);
+ this.calculateBounds_();
+ }
+ }
+
+ marker.isAdded = true;
+ this.markers_.push(marker);
+
+ var len = this.markers_.length;
+ if (len < this.minClusterSize_ && marker.getMap() != this.map_) {
+ // Min cluster size not reached so show the marker.
+ marker.setMap(this.map_);
+ }
+
+ if (len == this.minClusterSize_) {
+ // Hide the markers that were showing.
+ for (var i = 0; i < len; i++) {
+ this.markers_[i].setMap(null);
+ }
+ }
+
+ if (len >= this.minClusterSize_) {
+ marker.setMap(null);
+ }
+
+ this.updateIcon();
+ return true;
+};
+
+
+/**
+ * Returns the marker clusterer that the cluster is associated with.
+ *
+ * @return {MarkerClusterer} The associated marker clusterer.
+ */
+Cluster.prototype.getMarkerClusterer = function() {
+ return this.markerClusterer_;
+};
+
+
+/**
+ * Returns the bounds of the cluster.
+ *
+ * @return {google.maps.LatLngBounds} the cluster bounds.
+ */
+Cluster.prototype.getBounds = function() {
+ var bounds = new google.maps.LatLngBounds(this.center_, this.center_);
+ var markers = this.getMarkers();
+ for (var i = 0, marker; marker = markers[i]; i++) {
+ bounds.extend(marker.getPosition());
+ }
+ return bounds;
+};
+
+
+/**
+ * Removes the cluster
+ */
+Cluster.prototype.remove = function() {
+ this.clusterIcon_.remove();
+ this.markers_.length = 0;
+ delete this.markers_;
+};
+
+
+/**
+ * Returns the center of the cluster.
+ *
+ * @return {number} The cluster center.
+ */
+Cluster.prototype.getSize = function() {
+ return this.markers_.length;
+};
+
+
+/**
+ * Returns the center of the cluster.
+ *
+ * @return {Array.<google.maps.Marker>} The cluster center.
+ */
+Cluster.prototype.getMarkers = function() {
+ return this.markers_;
+};
+
+
+/**
+ * Returns the center of the cluster.
+ *
+ * @return {google.maps.LatLng} The cluster center.
+ */
+Cluster.prototype.getCenter = function() {
+ return this.center_;
+};
+
+
+/**
+ * Calculated the extended bounds of the cluster with the grid.
+ *
+ * @private
+ */
+Cluster.prototype.calculateBounds_ = function() {
+ var bounds = new google.maps.LatLngBounds(this.center_, this.center_);
+ this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds);
+};
+
+
+/**
+ * Determines if a marker lies in the clusters bounds.
+ *
+ * @param {google.maps.Marker} marker The marker to check.
+ * @return {boolean} True if the marker lies in the bounds.
+ */
+Cluster.prototype.isMarkerInClusterBounds = function(marker) {
+ return this.bounds_.contains(marker.getPosition());
+};
+
+
+/**
+ * Returns the map that the cluster is associated with.
+ *
+ * @return {google.maps.Map} The map.
+ */
+Cluster.prototype.getMap = function() {
+ return this.map_;
+};
+
+
+/**
+ * Updates the cluster icon
+ */
+Cluster.prototype.updateIcon = function() {
+ var zoom = this.map_.getZoom();
+ var mz = this.markerClusterer_.getMaxZoom();
+
+ if (mz && zoom > mz) {
+ // The zoom is greater than our max zoom so show all the markers in cluster.
+ for (var i = 0, marker; marker = this.markers_[i]; i++) {
+ marker.setMap(this.map_);
+ }
+ return;
+ }
+
+ if (this.markers_.length < this.minClusterSize_) {
+ // Min cluster size not yet reached.
+ this.clusterIcon_.hide();
+ return;
+ }
+
+ var numStyles = this.markerClusterer_.getStyles().length;
+ var sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles);
+ this.clusterIcon_.setCenter(this.center_);
+ this.clusterIcon_.setSums(sums);
+ this.clusterIcon_.show();
+};
+
+
+/**
+ * A cluster icon
+ *
+ * @param {Cluster} cluster The cluster to be associated with.
+ * @param {Object} styles An object that has style properties:
+ * 'url': (string) The image url.
+ * 'height': (number) The image height.
+ * 'width': (number) The image width.
+ * 'anchor': (Array) The anchor position of the label text.
+ * 'textColor': (string) The text color.
+ * 'textSize': (number) The text size.
+ * 'backgroundPosition: (string) The background postition x, y.
+ * @param {number=} opt_padding Optional padding to apply to the cluster icon.
+ * @constructor
+ * @extends google.maps.OverlayView
+ * @ignore
+ */
+function ClusterIcon(cluster, styles, opt_padding) {
+ cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView);
+
+ this.styles_ = styles;
+ this.padding_ = opt_padding || 0;
+ this.cluster_ = cluster;
+ this.center_ = null;
+ this.map_ = cluster.getMap();
+ this.div_ = null;
+ this.sums_ = null;
+ this.visible_ = false;
+
+ this.setMap(this.map_);
+}
+
+
+/**
+ * Triggers the clusterclick event and zoom's if the option is set.
+ *
+ * @param {google.maps.MouseEvent} event The event to propagate
+ */
+ClusterIcon.prototype.triggerClusterClick = function(event) {
+ var markerClusterer = this.cluster_.getMarkerClusterer();
+
+ // Trigger the clusterclick event.
+ google.maps.event.trigger(markerClusterer, 'clusterclick', this.cluster_, event);
+
+ if (markerClusterer.isZoomOnClick()) {
+ // Zoom into the cluster.
+ this.map_.fitBounds(this.cluster_.getBounds());
+ }
+};
+
+
+/**
+ * Adding the cluster icon to the dom.
+ * @ignore
+ */
+ClusterIcon.prototype.onAdd = function() {
+ this.div_ = document.createElement('DIV');
+ if (this.visible_) {
+ var pos = this.getPosFromLatLng_(this.center_);
+ this.div_.style.cssText = this.createCss(pos);
+ this.div_.innerHTML = this.sums_.text;
+ }
+
+ var panes = this.getPanes();
+ panes.overlayMouseTarget.appendChild(this.div_);
+
+ var that = this;
+ var isDragging = false;
+ google.maps.event.addDomListener(this.div_, 'click', function(event) {
+ // Only perform click when not preceded by a drag
+ if (!isDragging) {
+ that.triggerClusterClick(event);
+ }
+ });
+ google.maps.event.addDomListener(this.div_, 'mousedown', function() {
+ isDragging = false;
+ });
+ google.maps.event.addDomListener(this.div_, 'mousemove', function() {
+ isDragging = true;
+ });
+};
+
+
+/**
+ * Returns the position to place the div dending on the latlng.
+ *
+ * @param {google.maps.LatLng} latlng The position in latlng.
+ * @return {google.maps.Point} The position in pixels.
+ * @private
+ */
+ClusterIcon.prototype.getPosFromLatLng_ = function(latlng) {
+ var pos = this.getProjection().fromLatLngToDivPixel(latlng);
+
+ if (typeof this.iconAnchor_ === 'object' && this.iconAnchor_.length === 2) {
+ pos.x -= this.iconAnchor_[0];
+ pos.y -= this.iconAnchor_[1];
+ } else {
+ pos.x -= parseInt(this.width_ / 2, 10);
+ pos.y -= parseInt(this.height_ / 2, 10);
+ }
+ return pos;
+};
+
+
+/**
+ * Draw the icon.
+ * @ignore
+ */
+ClusterIcon.prototype.draw = function() {
+ if (this.visible_) {
+ var pos = this.getPosFromLatLng_(this.center_);
+ this.div_.style.top = pos.y + 'px';
+ this.div_.style.left = pos.x + 'px';
+ }
+};
+
+
+/**
+ * Hide the icon.
+ */
+ClusterIcon.prototype.hide = function() {
+ if (this.div_) {
+ this.div_.style.display = 'none';
+ }
+ this.visible_ = false;
+};
+
+
+/**
+ * Position and show the icon.
+ */
+ClusterIcon.prototype.show = function() {
+ if (this.div_) {
+ var pos = this.getPosFromLatLng_(this.center_);
+ this.div_.style.cssText = this.createCss(pos);
+ this.div_.style.display = '';
+ }
+ this.visible_ = true;
+};
+
+
+/**
+ * Remove the icon from the map
+ */
+ClusterIcon.prototype.remove = function() {
+ this.setMap(null);
+};
+
+
+/**
+ * Implementation of the onRemove interface.
+ * @ignore
+ */
+ClusterIcon.prototype.onRemove = function() {
+ if (this.div_ && this.div_.parentNode) {
+ this.hide();
+ this.div_.parentNode.removeChild(this.div_);
+ this.div_ = null;
+ }
+};
+
+
+/**
+ * Set the sums of the icon.
+ *
+ * @param {Object} sums The sums containing:
+ * 'text': (string) The text to display in the icon.
+ * 'index': (number) The style index of the icon.
+ */
+ClusterIcon.prototype.setSums = function(sums) {
+ this.sums_ = sums;
+ this.text_ = sums.text;
+ this.index_ = sums.index;
+ if (this.div_) {
+ this.div_.innerHTML = sums.text;
+ }
+
+ this.useStyle();
+};
+
+
+/**
+ * Sets the icon to the the styles.
+ */
+ClusterIcon.prototype.useStyle = function() {
+ var index = Math.max(0, this.sums_.index - 1);
+ index = Math.min(this.styles_.length - 1, index);
+ var style = this.styles_[index];
+ this.url_ = style['url'];
+ this.height_ = style['height'];
+ this.width_ = style['width'];
+ this.textColor_ = style['textColor'];
+ this.anchor_ = style['anchor'];
+ this.textSize_ = style['textSize'];
+ this.backgroundPosition_ = style['backgroundPosition'];
+ this.iconAnchor_ = style['iconAnchor'];
+};
+
+
+/**
+ * Sets the center of the icon.
+ *
+ * @param {google.maps.LatLng} center The latlng to set as the center.
+ */
+ClusterIcon.prototype.setCenter = function(center) {
+ this.center_ = center;
+};
+
+
+/**
+ * Create the css text based on the position of the icon.
+ *
+ * @param {google.maps.Point} pos The position.
+ * @return {string} The css style text.
+ */
+ClusterIcon.prototype.createCss = function(pos) {
+ var style = [];
+ style.push('background-image:url(' + this.url_ + ');');
+ var backgroundPosition = this.backgroundPosition_ ? this.backgroundPosition_ : '0 0';
+ style.push('background-position:' + backgroundPosition + ';');
+
+ if (typeof this.anchor_ === 'object') {
+ if (typeof this.anchor_[0] === 'number' && this.anchor_[0] > 0 &&
+ this.anchor_[0] < this.height_) {
+ style.push('height:' + (this.height_ - this.anchor_[0]) +
+ 'px; padding-top:' + this.anchor_[0] + 'px;');
+ } else if (typeof this.anchor_[0] === 'number' && this.anchor_[0] < 0 &&
+ -this.anchor_[0] < this.height_) {
+ style.push('height:' + this.height_ + 'px; line-height:' + (this.height_ + this.anchor_[0]) +
+ 'px;');
+ } else {
+ style.push('height:' + this.height_ + 'px; line-height:' + this.height_ +
+ 'px;');
+ }
+ if (typeof this.anchor_[1] === 'number' && this.anchor_[1] > 0 &&
+ this.anchor_[1] < this.width_) {
+ style.push('width:' + (this.width_ - this.anchor_[1]) +
+ 'px; padding-left:' + this.anchor_[1] + 'px;');
+ } else {
+ style.push('width:' + this.width_ + 'px; text-align:center;');
+ }
+ } else {
+ style.push('height:' + this.height_ + 'px; line-height:' +
+ this.height_ + 'px; width:' + this.width_ + 'px; text-align:center;');
+ }
+
+ var txtColor = this.textColor_ ? this.textColor_ : 'black';
+ var txtSize = this.textSize_ ? this.textSize_ : 11;
+
+ style.push('cursor:pointer; top:' + pos.y + 'px; left:' +
+ pos.x + 'px; color:' + txtColor + '; position:absolute; font-size:' +
+ txtSize + 'px; font-family:Arial,sans-serif; font-weight:bold');
+ return style.join('');
+};
+
+
+// Export Symbols for Closure
+// If you are not going to compile with closure then you can remove the
+// code below.
+window['MarkerClusterer'] = MarkerClusterer;
+MarkerClusterer.prototype['addMarker'] = MarkerClusterer.prototype.addMarker;
+MarkerClusterer.prototype['addMarkers'] = MarkerClusterer.prototype.addMarkers;
+MarkerClusterer.prototype['clearMarkers'] =
+ MarkerClusterer.prototype.clearMarkers;
+MarkerClusterer.prototype['fitMapToMarkers'] =
+ MarkerClusterer.prototype.fitMapToMarkers;
+MarkerClusterer.prototype['getCalculator'] =
+ MarkerClusterer.prototype.getCalculator;
+MarkerClusterer.prototype['getGridSize'] =
+ MarkerClusterer.prototype.getGridSize;
+MarkerClusterer.prototype['getExtendedBounds'] =
+ MarkerClusterer.prototype.getExtendedBounds;
+MarkerClusterer.prototype['getMap'] = MarkerClusterer.prototype.getMap;
+MarkerClusterer.prototype['getMarkers'] = MarkerClusterer.prototype.getMarkers;
+MarkerClusterer.prototype['getMaxZoom'] = MarkerClusterer.prototype.getMaxZoom;
+MarkerClusterer.prototype['getStyles'] = MarkerClusterer.prototype.getStyles;
+MarkerClusterer.prototype['getTotalClusters'] =
+ MarkerClusterer.prototype.getTotalClusters;
+MarkerClusterer.prototype['getTotalMarkers'] =
+ MarkerClusterer.prototype.getTotalMarkers;
+MarkerClusterer.prototype['redraw'] = MarkerClusterer.prototype.redraw;
+MarkerClusterer.prototype['removeMarker'] =
+ MarkerClusterer.prototype.removeMarker;
+MarkerClusterer.prototype['removeMarkers'] =
+ MarkerClusterer.prototype.removeMarkers;
+MarkerClusterer.prototype['resetViewport'] =
+ MarkerClusterer.prototype.resetViewport;
+MarkerClusterer.prototype['repaint'] =
+ MarkerClusterer.prototype.repaint;
+MarkerClusterer.prototype['setCalculator'] =
+ MarkerClusterer.prototype.setCalculator;
+MarkerClusterer.prototype['setGridSize'] =
+ MarkerClusterer.prototype.setGridSize;
+MarkerClusterer.prototype['setMaxZoom'] =
+ MarkerClusterer.prototype.setMaxZoom;
+MarkerClusterer.prototype['onAdd'] = MarkerClusterer.prototype.onAdd;
+MarkerClusterer.prototype['draw'] = MarkerClusterer.prototype.draw;
+
+Cluster.prototype['getCenter'] = Cluster.prototype.getCenter;
+Cluster.prototype['getSize'] = Cluster.prototype.getSize;
+Cluster.prototype['getMarkers'] = Cluster.prototype.getMarkers;
+
+ClusterIcon.prototype['onAdd'] = ClusterIcon.prototype.onAdd;
+ClusterIcon.prototype['draw'] = ClusterIcon.prototype.draw;
+ClusterIcon.prototype['onRemove'] = ClusterIcon.prototype.onRemove;
diff --git a/views/mods/mod_statistics/simplefilter.phtml b/views/mods/mod_statistics/simplefilter.phtml index 306befc..c6edd92 100644 --- a/views/mods/mod_statistics/simplefilter.phtml +++ b/views/mods/mod_statistics/simplefilter.phtml @@ -55,8 +55,6 @@ <input style="float:left; margin-left:25px;" type="submit" class="button-secondary" value="<?php echo __('Anzeigen', 'wpsg'); ?>" />
- <div class="wpsg_clear"></div><br/>
-
<div class="customfilter" style="display:none;">
<?php echo wpsg_drawForm_Date('filter[day][0]', __('von', 'wpsg'), $this->view['filter']['day'][0]['d'].'.'.$this->view['filter']['day'][0]['m'].'.'.$this->view['filter']['day'][0]['Y'], array('time' => false)); ?>
<?php echo wpsg_drawForm_Date('filter[day][1]', __('bis', 'wpsg'), $this->view['filter']['day'][1]['d'].'.'.$this->view['filter']['day'][1]['m'].'.'.$this->view['filter']['day'][1]['Y'], array('time' => false)); ?>
diff --git a/views/mods/mod_statistics/statistics.phtml b/views/mods/mod_statistics/statistics.phtml index 8f64b62..fc27f1f 100644 --- a/views/mods/mod_statistics/statistics.phtml +++ b/views/mods/mod_statistics/statistics.phtml @@ -71,28 +71,43 @@ </script>
<div class="icon32 icon32-posts-post" id="icon-edit"><br></div>
- <h2>
- <?php echo __('Statistik', 'wpsg'); ?>
- </h2>
- <br/>
+ <div class="wpsg_products" id="wpsg-bs">
- <div class="wpsg_admin_submenu" style="margin-top:8px;">
-
- <div class="head">
- <div class="title"><?php echo __('Auswahl', 'wpsg'); ?></div>
- <div style="clear:both;"></div>
- </div>
-
- <ul>
- <?php foreach ($this->view['charts'] as $index => $chart) { ?>
+ <nav class="navbar navbar-default">
+ <div class="container-fluid">
+ <div class="navbar-header">
+ <a class="navbar-brand" href="#"><?php echo __('wpShopGermany', 'wpsg'); ?></a>
+ </div>
+ <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
+ <ul class="nav navbar-nav">
+ <li role="presentation" class="<?php echo ((!isset($_REQUEST['action']))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt"><?php echo __("Statistik", "wpsg"); ?></a></li>
+<!--
+ <li role="presentation" class="wpsg_showhide_filter <?php echo (($this->view['hasFilter'] === true)?'active':''); ?>"><a href="#" onclick="return false;"><span class="glyphicon glyphicon-search"></span><?php echo __("Suche", "wpsg"); ?></a></li>
+ <li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'add'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=add"><span class="glyphicon glyphicon-plus"></span><?php echo __("Hinzufügen", "wpsg"); ?></a></li>
+-->
+ </ul>
+ </div>
+ </div>
+ </nav>
+ </div>
- <li class="<?php echo ((strtolower($index) == $_REQUEST['id'])?'current':''); ?>"><a href="admin.php?page=wpsg-Statistics&id=<?php echo wpsg_hspc($index); ?>"><?php echo wpsg_hspc($chart['name']); ?></a></li>
-
- <?php } ?>
- </ul>
- <div style="clear:both; margin-bottom:10px; margin-left:0px; margin-right:8px;"></div>
+ <div id="wpsg-bs" >
+ <div class="wpsg_admin_submenu" >
+
+ <div class="list-group" id="wpsg_statistics_tabs">
+ <span class="list-group-head list-group-item"><?php echo __('Auswahl', 'wpsg'); ?></span>
+ <?php foreach ($this->view['charts'] as $index => $chart) { ?>
+
+ <a class="list-group-item <?php echo ((strtolower($index) == $_REQUEST['id'])?'active':''); ?>" href="admin.php?page=wpsg-Statistics&id=<?php echo wpsg_hspc($index); ?>"><?php echo wpsg_hspc($chart['name']); ?></a>
+
+ <?php } ?>
+ </div>
+
+ <div style="clear:both; margin-bottom:10px; margin-left:0px; margin-right:8px;"></div>
+
+ </div>
</div>
<div style="padding-right:10px; margin-left:210px; float:none;" class="subsubsub">
diff --git a/views/produkttemplates/standard.phtml b/views/produkttemplates/standard.phtml index 8a60603..57f3646 100644 --- a/views/produkttemplates/standard.phtml +++ b/views/produkttemplates/standard.phtml @@ -164,6 +164,7 @@ </div>
<?php /* Hinweistext für Verzögerung in der Lieferzeit */ ?>
+
<?php if ($this->get_option('wpsg_mod_deliverytime_delay') == '1') { ?>
<div class="wpsg_mod_deliverytime_delay">
<?php echo wpsg_translate(__('Aufgrund von #1# kann es zu Verz�gerungen von #2# Tage in der Zustellung kommen.', 'wpsg'), $this->get_option('wpsg_mod_deliverytime_delayText'), $this->get_option('wpsg_mod_deliverytime_delayTime')); ?>
diff --git a/views/warenkorb/checkout.phtml b/views/warenkorb/checkout.phtml index ffe9dc5..fd3d585 100644 --- a/views/warenkorb/checkout.phtml +++ b/views/warenkorb/checkout.phtml @@ -90,7 +90,7 @@ <label for="wpsg_firma"><?php echo __("Firma", "wpsg"); ?>
<?php if ($this->view['pflicht']['firma'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="<?php echo (($this->view['pflicht']['firma'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("firma", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="wpsg_firma" name="wpsg[checkout][firma]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['firma']); ?>" />
+ <input class="<?php echo (($this->view['pflicht']['firma'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("firma", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="wpsg_firma" name="wpsg[checkout][firma]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['firma'])); ?>" />
</div>
<div class="wpsg_checkoutblock" id="wpsg_anrede">
@@ -108,21 +108,21 @@ <label for="vname" class="wpsg_checkout"><?php echo __("Vorname", "wpsg"); ?>
<?php if ($this->view['pflicht']['vname'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="<?php echo (($this->view['pflicht']['vname'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("vname", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="vname" name="wpsg[checkout][vname]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['vname']); ?>" />
+ <input class="<?php echo (($this->view['pflicht']['vname'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("vname", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="vname" name="wpsg[checkout][vname]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['vname'])); ?>" />
</div>
<div class="wpsg_checkoutblock" id="wpsg_name">
<label for="name" class="wpsg_checkout"><?php echo __("Name", "wpsg"); ?>
<?php if ($this->view['pflicht']['name'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="<?php echo (($this->view['pflicht']['name'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("name", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="name" name="wpsg[checkout][name]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['name']); ?>" />
+ <input class="<?php echo (($this->view['pflicht']['name'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("name", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="name" name="wpsg[checkout][name]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['name'])); ?>" />
</div>
<div class="wpsg_checkoutblock" id="wpsg_email">
<label for="email" class="wpsg_checkout"><?php echo __("E-Mail Adresse", "wpsg"); ?>
<?php if ($this->view['pflicht']['email'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>" type="email" id="email" name="wpsg[checkout][email]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['email']); ?>" />
+ <input class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>" type="email" id="email" name="wpsg[checkout][email]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['email'])); ?>" />
</div>
<?php if (isset($this->view['pflicht']['emailconfirm']) && $this->view['pflicht']['emailconfirm'] == '1') { ?>
@@ -130,7 +130,7 @@ <label for="email" class="wpsg_checkout"><?php echo __("E-Mail (Wiederholung)", "wpsg"); ?>
<?php if ($this->view['pflicht']['email'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>" type="email" id="email2" name="wpsg[checkout][email2]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['email2']); ?>" />
+ <input class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>" type="email" id="email2" name="wpsg[checkout][email2]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['email2'])); ?>" />
</div>
<?php } ?>
@@ -138,42 +138,42 @@ <label for="geb" class="wpsg_checkout"><?php echo __('Geburtsdatum (Format: TT.MM.JJJJ)',"wpsg"); ?>
<?php if ($this->view['pflicht']['geb'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="wpsg_input_text <?php echo (($this->view['pflicht']['geb'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("geb", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="geb" name="wpsg[checkout][geb]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['geb']); ?>" />
+ <input class="wpsg_input_text <?php echo (($this->view['pflicht']['geb'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("geb", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="geb" name="wpsg[checkout][geb]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['geb'])); ?>" />
</div>
<div class="wpsg_checkoutblock" id="wpsg_fax">
<label for="fax" class="wpsg_checkout"><?php echo __("Fax.", "wpsg"); ?>
<?php if ($this->view['pflicht']['fax'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="wpsg_input_text <?php echo (($this->view['pflicht']['fax'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("fax", (array)$this->view['error']))?'wpsg_error':''); ?>" type="tel" id="fax" name="wpsg[checkout][fax]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['fax']); ?>" />
+ <input class="wpsg_input_text <?php echo (($this->view['pflicht']['fax'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("fax", (array)$this->view['error']))?'wpsg_error':''); ?>" type="tel" id="fax" name="wpsg[checkout][fax]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['fax'])); ?>" />
</div>
<div class="wpsg_checkoutblock" id="wpsg_telefon">
<label for="tel" class="wpsg_checkout"><?php echo __("Tel.", "wpsg"); ?>
<?php if ($this->view['pflicht']['tel'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="wpsg_input_text <?php echo (($this->view['pflicht']['tel'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("tel", (array)$this->view['error']))?'wpsg_error':''); ?>" type="tel" id="tel" name="wpsg[checkout][tel]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['tel']); ?>" />
+ <input class="wpsg_input_text <?php echo (($this->view['pflicht']['tel'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("tel", (array)$this->view['error']))?'wpsg_error':''); ?>" type="tel" id="tel" name="wpsg[checkout][tel]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['tel'])); ?>" />
</div>
<div class="wpsg_checkoutblock" id="wpsg_strasse">
<label for="strasse" class="wpsg_checkout"><?php echo __("Strasse Nr.", "wpsg"); ?>
<?php if ($this->view['pflicht']['strasse'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="<?php echo (($this->view['pflicht']['strasse'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("strasse", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="strasse" name="wpsg[checkout][strasse]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['strasse']); ?>" />
+ <input class="<?php echo (($this->view['pflicht']['strasse'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("strasse", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="strasse" name="wpsg[checkout][strasse]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['strasse'])); ?>" />
</div>
<div class="wpsg_checkoutblock" id="wpsg_postleitzahl">
<label for="plz" class="wpsg_checkout"><?php echo __("Postleitzahl", "wpsg"); ?>
<?php if ($this->view['pflicht']['plz'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="wpsg_input_text <?php echo (($this->view['pflicht']['plz'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("plz", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="plz" name="wpsg[checkout][plz]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['plz']); ?>" />
+ <input class="wpsg_input_text <?php echo (($this->view['pflicht']['plz'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("plz", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="plz" name="wpsg[checkout][plz]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['plz'])); ?>" />
</div>
<div class="wpsg_checkoutblock" id="wpsg_ort">
<label for="ort" class="wpsg_checkout"><?php echo __("Ort", "wpsg"); ?>
<?php if ($this->view['pflicht']['ort'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="<?php echo (($this->view['pflicht']['ort'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("ort", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="ort" name="wpsg[checkout][ort]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['ort']); ?>" />
+ <input class="<?php echo (($this->view['pflicht']['ort'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("ort", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="ort" name="wpsg[checkout][ort]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['ort'])); ?>" />
</div>
<div class="wpsg_checkoutblock" id="wpsg_land">
@@ -192,7 +192,7 @@ <label for="wpsg_ustidnr" class="wpshopgermany_checkout"><?php echo __("UStIdNr.", "wpsg"); ?>
<?php if ($this->view['pflicht']['ustidnr'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="<?php echo (($this->view['pflicht']['ustidnr'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("ustidnr", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="wpsg_ustidnr" name="wpsg[checkout][ustidnr]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['ustidnr']); ?>" />
+ <input class="<?php echo (($this->view['pflicht']['ustidnr'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("ustidnr", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="wpsg_ustidnr" name="wpsg[checkout][ustidnr]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['ustidnr'])); ?>" />
</div>
<?php /* Automatische Einbindung der benutzerdefinierten Felder */ ?>
@@ -251,7 +251,7 @@ <div class="wpsg_spacer"></div>
<div class="wpsg_inner wpsg_commentblock">
- <textarea name="wpsg[checkout][comment]" id="wpsg_checkout_comment"><?php echo wpsg_hspc($this->view['basket']['checkout']['comment']); ?></textarea>
+ <textarea name="wpsg[checkout][comment]" id="wpsg_checkout_comment"><?php echo wpsg_getStr($this->view['basket']['checkout']['comment']); ?></textarea>
</div>
</div>
diff --git a/views/warenkorb/checkout2.phtml b/views/warenkorb/checkout2.phtml index b80ca62..8883ac6 100644 --- a/views/warenkorb/checkout2.phtml +++ b/views/warenkorb/checkout2.phtml @@ -95,8 +95,8 @@ <?php $this->callMods('checkout2_inner_prebutton', array(&$this->view)); ?>
- <input type="submit" class="wpsg_button wpsg_checkoutbutton" value="<?php echo __('zurück', 'wpsg'); ?>" name="wpsg_redirect_checkout" />
<input type="submit" id="wpsg_checkout2button" class="wpsg_button wpsg_overviewbutton" value="<?php echo __('weiter', 'wpsg'); ?>" name="wpsg_checkout2" />
+ <input type="submit" class="wpsg_button wpsg_checkoutbutton" value="<?php echo __('zurück', 'wpsg'); ?>" name="wpsg_redirect_checkout" />
<div class="wpsg_clear"></div>
diff --git a/views/warenkorb/overview.phtml b/views/warenkorb/overview.phtml index 3cfb560..4599ab3 100644 --- a/views/warenkorb/overview.phtml +++ b/views/warenkorb/overview.phtml @@ -42,7 +42,7 @@ <div class="shipping"><?php echo wpsg_hspc($this->arShipping[$this->view['basket']['checkout']['shipping']]['name']); ?></div>
</div>
- <?php if ($this->view['basket']['checkout']['diff_shippingadress'] == '1') { ?>
+ <?php if (wpsg_getStr($this->view['basket']['checkout']['diff_shippingadress']) == '1') { ?>
<div class="anschrift">
<div class="subtitle"><?php echo __('Rechnungsanschrift', 'wpsg'); ?>
<span class="sublink"><?php echo wpsg_translate(__('[<a href="#1#">Ändern</a>]', 'wpsg'), $this->getURL(wpsg_ShopController::URL_CHECKOUT)); ?></span>
|
