summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2017-09-08 09:03:43 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2017-09-08 09:03:43 +0000
commitb8a6622d79c99688325955e9af25c2e17e802843 (patch)
tree406cce45282cc26ad5653ecd3f0cabf07d20acc7
parente9a00eb45d574802eb708db68ba404156d480999 (diff)
- Lizenzverwaltung
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@6484 0d5edaf7-2b12-4e95-93f4-047927463d4b
-rw-r--r--views/admin/index.phtml4
-rw-r--r--views/admin/licence.phtml155
-rw-r--r--views/admin/module.phtml109
-rw-r--r--views/admin/news.phtml4
-rw-r--r--views/css/admin.css16
5 files changed, 229 insertions, 59 deletions
diff --git a/views/admin/index.phtml b/views/admin/index.phtml
index 9c5ea9b..dcebb2e 100644
--- a/views/admin/index.phtml
+++ b/views/admin/index.phtml
@@ -38,8 +38,8 @@
</div>
</nav>
- <?php echo $this->writeBackendMessage(); ?>
-
+ <hr class="wp-header-end" />
+
<div class="wpsg_admin_wrap">
<?php if (wpsg_isSizedString($this->view['subTemplate'])) { ?>
<?php $this->render($this->view['subTemplate']); ?>
diff --git a/views/admin/licence.phtml b/views/admin/licence.phtml
index f5975ca..b4fbec5 100644
--- a/views/admin/licence.phtml
+++ b/views/admin/licence.phtml
@@ -4,6 +4,10 @@
* Template für die Lizenzverwaltung
*/
+ $wpsg_update_data = wpsg_get_update_data();
+
+ if (!is_array($wpsg_update_data) || !current_user_can('wpsg_lizence')) die();
+
?>
<div class="wpsg_admin" id="wpsg-bs">
@@ -18,7 +22,7 @@
<li role="presentation" class="<?php echo (($this->view['actionName'] == "index")?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin"><?php echo __("Einstellungen", "wpsg"); ?></a></li>
<li role="presentation" class="<?php echo (($this->view['actionName'] == "module")?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;action=module"><?php echo __("Module", "wpsg"); ?></a></li>
- <?php if (current_user_can('wpsg_lizence') && is_array(wpsg_get_update_data())) { ?>
+ <?php if (current_user_can('wpsg_lizence') && is_array($wpsg_update_data)) { ?>
<li role="presentation" class="<?php echo (($this->view['actionName'] == "licence")?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;action=registrierung"><?php echo __("Lizenzverwaltung", "wpsg"); ?></a></li>
<?php } ?>
@@ -38,7 +42,7 @@
</nav>
<?php echo $this->writeBackendMessage(); ?>
-
+
<div class="wpsg_admin_wrap">
<div class="wpsg_admin_submenu">
@@ -68,15 +72,116 @@
<?php if ($this->view['subaction'] === 'registerdata') { ?>
-
+ <form method="POST" action="<?php echo WPSG_URL_WP ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=saveRegister">
+
+ <?php $strLicenceLabel = ''; ?>
+ <?php if ($wpsg_update_data['licence_model'] === 'enterprise') { $strLicenceLabel = __('Enterprise', 'wpsg'); ?>
+ <?php } else if ($wpsg_update_data['licence_model'] === 'pro') { $strLicenceLabel = __('Pro', 'wpsg'); } ?>
+
+ <?php echo wpsg_drawForm_Text(_('Lizenzmodel'), $strLicenceLabel); ?>
+
+ <br />
+
+ <?php echo wpsg_drawForm_Input('register[company]', __('Firma', 'wpsg'), $wpsg_update_data['registerData']['company']); ?>
+ <?php echo wpsg_drawForm_Input('register[firstname]', __('Vorname', 'wpsg'), $wpsg_update_data['registerData']['firstname']); ?>
+ <?php echo wpsg_drawForm_Input('register[lastname]', __('Name', 'wpsg'), $wpsg_update_data['registerData']['lastname']); ?>
+ <?php echo wpsg_drawForm_Input('register[zip]', __('PLZ', 'wpsg'), $wpsg_update_data['registerData']['zip']); ?>
+ <?php echo wpsg_drawForm_Input('register[city]', __('Ort', 'wpsg'), $wpsg_update_data['registerData']['city']); ?>
+ <?php echo wpsg_drawForm_Input('register[street]', __('Straße', 'wpsg'), $wpsg_update_data['registerData']['street']); ?>
+ <?php echo wpsg_drawForm_Select('register[country]', __('Land', 'wpsg'), array(
+ '1' => __('Deutschland', 'wpsg'),
+ '2' => __('Österreich', 'wpsg'),
+ '3' => __('Schweiz', 'wpsg'),
+ '4' => __('Niederlande', 'wpsg'),
+ '5' => __('Belgien', 'wpsg')
+ ), $wpsg_update_data['registerData']['country']); ?>
+ <?php echo wpsg_drawForm_Input('register[email]', __('E-Mail', 'wpsg'), $wpsg_update_data['registerData']['email']); ?>
+
+ <br />
+
+ <?php echo wpsg_drawForm_SubmitButton(__('Speichern', 'wpsg')); ?>
+
+ </form>
<?php } else if ($this->view['subaction'] === 'domaindata') { ?>
-
+
+ <?php if (wpsg_isSizedArray($wpsg_update_data['domainData'])) { ?>
+
+ <table class="table domaintable">
+ <thead>
+ <tr>
+ <th class="col_domain"><?php echo __('Domain', 'wspg'); ?></th>
+ <th class="col_action"></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach ($wpsg_update_data['domainData'] as $domain) { ?>
+ <tr class="success">
+ <td class="col_domain"><?php echo $domain; ?></td>
+ <td class="col_action">
+
+ <a href="<?php echo WPSG_URL_WP ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=domainDeRegister" class="btn btn-warning btn-sm"><?php echo __('Registrierung aufheben'); ?></a>
+
+ </td>
+ </tr>
+ <?php } ?>
+ </tbody>
+ </table>
+
+ <?php } else { ?>
+
+ <p><?php echo __('Es sind noch keine Domains für diese Lizenz registriert.', 'wpsg'); ?></p>
+
+ <?php } ?>
+
+ <hr />
+
+ <?php if (($wpsg_update_data['licence_model'] === 'enterprise' || sizeof($wpsg_update_data['domainData']) < 1) && !in_array($_SERVER['HTTP_HOST'], $wpsg_update_data['domainData'])) { ?>
+
+ <p class="wpsg_message_ok"><?php echo __('Diese Domain kann noch auf Ihre Lizenz aktiviert werden.', 'wpsg'); ?></p>
+
+ <br />
+
+ <a href="<?php echo WPSG_URL_WP ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=domainRegister" class="btn btn-primary"><?php echo __('Diese Domain registrieren', 'wpsg'); ?></a>
+
+ <?php } else if (in_array($_SERVER['HTTP_HOST'], $wpsg_update_data['domainData'])) { ?>
+
+ <p class="wpsg_message_ok"><?php echo __('Diese Domain ist bereits auf diesen Schlüssel registriert.', 'wpsg'); ?></p>
+
+ <?php } else { ?>
+
+ <p class="error"><?php echo __('Diese Domain kann nicht mehr registriert werden.', 'wpsg'); ?></p>
+
+ <?php } ?>
+
<?php } else if ($this->view['subaction'] === 'modulactivation') { ?>
<?php $this->shop->loadModule(true); ?>
<?php $wpsg_update_data = wpsg_get_update_data(); ?>
+
+ <form method="POST" action="<?php echo WPSG_URL_WP ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=activatemodul&source=licence">
+
+ <fieldset>
+ <legend style="padding-top:0px;"><?php echo __('Modulcode aktivieren', 'wpsg'); ?></legend>
+ <div class="row">
+ <div class="col-xs-10">
+
+ <input required="required" type="text" class="form-control" name="modulcode" id="modulcode" />
+
+ </div>
+ <div class="col-xs-2">
+
+ <input class="btn btn-primary btn-block" type="submit" class="form-control" value="<?php echo __('Prüfen', 'wpsg'); ?>" />
+
+ </div>
+ </div>
+ </fieldset>
+
+ </form>
+
+ <br />
+
<?php if (wpsg_isSizedArray($wpsg_update_data)) { ?>
<?php // Ich zeige hier nur die Aktiven Module an ?>
@@ -86,7 +191,7 @@
<thead>
<tr>
<th><?php echo __('Modulname', 'wpsg'); ?></th>
- <th><?php echo __('installierte Version', 'wpsg'); ?></th>
+ <th><?php echo __('Version', 'wpsg'); ?></th>
<th><?php echo __('Lizenz', 'wpsg'); ?></th>
<th><?php echo __('verfügbare Version', 'wpsg'); ?></th>
</tr>
@@ -111,9 +216,9 @@
<?php } else { ?>
<?php if (wpsg_isSizedString($modul_info['url_shop'])) { ?>
- <a href="<?php echo $modul_info['url_shop']; ?>" target="_blank"><?php echo __('Modulcode hier erwerben', 'wpsg'); ?></a>
+ <a href="<?php echo $modul_info['url_shop']; ?>" target="_blank"><?php echo __('Modulcode erwerben', 'wpsg'); ?></a>
<?php } else { ?>
- <a href="https://shop.maennchen1.de" target="_blank"><?php echo __('Modulcode hier erwerben', 'wpsg'); ?></a>
+ <a href="https://shop.maennchen1.de" target="_blank"><?php echo __('Modulcode erwerben', 'wpsg'); ?></a>
<?php } ?>
<?php } ?>
@@ -138,9 +243,16 @@
else if (version_compare($modul_info['version'], $this->shop->arAllModule[$modul_key]->versio) > 0)
{
- echo ' - <strong class="wpsg_error">'.__('neue Version verfügbar', 'wpsg').'</strong><br />';
- echo wpsg_translate(__('Version <a href="#1#">installieren</a>.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=installModul&modul='.$modul_key);
-
+ echo ' - <strong class="wpsg_error">'.__('neue Version verfügbar', 'wpsg').'</strong>';
+
+ if ($modul_info['active'] === true)
+ {
+
+ echo '<br />';
+ echo wpsg_translate(__('<a href="#1#">Version installieren</a>.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=installModul&modul='.$modul_key);
+
+ }
+
}
?></td>
@@ -150,28 +262,7 @@
</table>
<?php } ?>
-
- <form method="POST" action="<?php echo WPSG_URL_WP ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=activatemodul&source=licence">
-
- <fieldset>
- <legend style="padding-top:0px;"><?php echo __('Modulcode aktivieren', 'wpsg'); ?></legend>
-
- <div class="row">
- <div class="col-xs-10">
-
- <input required="required" type="text" class="form-control" name="modulcode" id="modulcode" />
-
- </div>
- <div class="col-xs-2">
-
- <input class="btn btn-primary btn-block" type="submit" class="form-control" value="<?php echo __('Prüfen', 'wpsg'); ?>" />
-
- </div>
- </div>
- </fieldset>
-
- </form>
-
+
<?php } ?>
</div>
diff --git a/views/admin/module.phtml b/views/admin/module.phtml
index 514918b..394ee7a 100644
--- a/views/admin/module.phtml
+++ b/views/admin/module.phtml
@@ -5,6 +5,12 @@
* Sollte nicht angepasst werden
*/
+ $wpsg_update_data = wpsg_get_update_data();
+ if (wpsg_isSizedArray($wpsg_update_data['modulinfo'])) $modul_info = $wpsg_update_data['modulinfo'];
+ else $modul_info = array();
+
+ //wpsg_debug($modul_info);
+
?>
<div class="wpsg_admin_submenu">
@@ -50,23 +56,79 @@
<?php echo wpsg_drawForm_Select('aktiv', __('Modul aktiviert', 'wpsg'), array('0' => __('Nein', 'wpsg'), '1' => __('Ja', 'wpsg')), ((wpsg_isSizedInt($modul_install))?'1':'0')); ?>
<?php if (isset($this->arAllModule[$_REQUEST['modul']]->version)) { ?>
- <?php echo wpsg_drawForm_Input('', __('Version', 'wpsg'), $this->arAllModule[$_REQUEST['modul']]->version, array('text' => true)); ?>
+
+ <?php echo wpsg_drawForm_TextStart(); ?>
- <?php if (isset($this->arAllModule[$_REQUEST['modul']]->free) && $this->arAllModule[$_REQUEST['modul']]->free === true) { ?>
- <?php $strLizenz = __('Kostenfrei', 'wpsg'); ?>
- <?php } else { ?>
- <?php if (is_array($this->arLizenz) && in_array($_REQUEST['modul'], (array)$this->arLizenz['mods'])) { ?>
- <?php $strLizenz = __('Aktiviert', 'wpsg'); ?>
- <?php } else { ?>
- <?php if ($this->arAllModule[$_REQUEST['modul']]->getDemoDays() > 0) { ?>
- <?php $strLizenz = wpsg_translate(__('Demo Modus noch #1# Tage verbleibend.', 'wpsg'), $this->arAllModule[$_REQUEST['modul']]->getDemoDays()); ?>
- <?php } else { ?>
- <?php $strLizenz = __('Demo Modus abgelaufen.', 'wpsg'); ?>
- <?php } ?>
- <?php } ?>
- <?php } ?>
- <?php echo wpsg_drawForm_Text(__('Lizenz'), $strLizenz); ?>
+ <?php
+
+ echo $this->arAllModule[$_REQUEST['modul']]->version;
+
+ if (wpsg_isSizedArray($modul_info[$_REQUEST['modul']]))
+ {
+
+ $modul_info_modul = $modul_info[$_REQUEST['modul']];
+
+ if ($modul_info_modul['version'] === $this->shop->arAllModule[$_REQUEST['modul']]->version)
+ {
+
+ echo ' - <strong class="wpsg_message_ok">'.__('aktuell', 'wpsg').'</strong>';
+
+ }
+ else if (version_compare($modul_info_modul['version'], WPSG_VERSION) > 0)
+ {
+
+ echo ' - <strong class="wpsg_error">'.__('neue Version verfügbar', 'wpsg').'</strong><br />'.wpsg_translate(__('<a href="#1#">wpShopGermany Update</a> notwendig', 'wpsg'), WPSG_URL_WP.'wp-admin/plugins.php');
+
+ }
+ else if (version_compare($modul_info_modul['version'], $this->shop->arAllModule[$_REQUEST['modul']]->versio) > 0)
+ {
+
+ echo ' - <strong class="wpsg_error">'.__('neue Version verfügbar', 'wpsg').'</strong>';
+
+ if ($modul_info_modul['active'] === true)
+ {
+
+ echo '<br />';
+ echo wpsg_translate(__('<a href="#1#">Version installieren</a>.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=installModul&modul='.$_REQUEST['modul']);
+
+ }
+
+ }
+
+ }
+
+ ?>
+
+ <?php echo wpsg_drawForm_TextEnd(__('Version', 'wpsg')); ?>
+
+ <?php echo wpsg_drawForm_TextStart(); ?>
+
+ <?php if (array_key_exists($_REQUEST['modul'], $modul_info)) { ?>
+
+ <?php if (wpsg_isTrue($modul_info[$_REQUEST['modul']]['free'])) { ?>
+ <span class="wpsg_message_ok"><?php echo __('Kostenfrei', 'wpsg'); ?></span>
+ <?php } else if (wpsg_isTrue($modul_info[$_REQUEST['modul']]['active'])) { ?>
+ <span class="wpsg_message_ok"><?php echo __('Aktiv', 'wpsg'); ?></span>
+ <?php } else { ?>
+ <span class="wpsg_error"><?php echo __('Nicht aktiv', 'wpsg'); ?></span>
+
+ <?php if (wpsg_isSizedString($modul_info[$_REQUEST['modul']]['shop_url'])) { ?>
+ [ <a href="<?php echo $modul_info[$_REQUEST['modul']]['shop_url']; ?>"><?php echo __('Modulcode erwerben', 'wpsg'); ?></a> ]
+ <?php } else { ?>
+ [ <a href="https://shop.maennchen1.de/"><?php echo __('Modulcode erwerben', 'wpsg'); ?></a> ]
+ <?php } ?>
+ [ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&subaction=modulactivation"><?php echo __('Modulcode eingeben', 'wpsg'); ?></a> ]
+
+ <?php } ?>
+
+ <?php } else { ?>
+ <span class="wpsg_error"><?php echo __('Unbekannt', 'wpsg'); ?></span>
+ <?php } ?>
+
+ <?php echo wpsg_drawForm_TextEnd(__('Lizenz')); ?>
+ <hr />
+
<?php } ?>
<?php if (!isset($this->arAllModule[$_REQUEST['modul']]->version) || ((wpsg_isTrue($this->arAllModule[$_REQUEST['modul']]->free) || (is_array($this->arLizenz) && in_array($_REQUEST['modul'], (array)$this->arLizenz['mods'])) || $this->arAllModule[$_REQUEST['modul']]->getDemoDays() > 0))) { ?>
@@ -140,7 +202,7 @@
<thead>
<tr>
<th><?php echo __('Modulname', 'wpsg'); ?></th>
- <th><?php echo __('installierte Version', 'wpsg'); ?></th>
+ <th><?php echo __('Version', 'wpsg'); ?></th>
<th><?php echo __('Lizenz', 'wpsg'); ?></th>
<th><?php echo __('verfügbare Version', 'wpsg'); ?></th>
</tr>
@@ -175,9 +237,9 @@
<?php } else { ?>
<?php if (wpsg_isSizedString($modul_info['url_shop'])) { ?>
- <a href="<?php echo $modul_info['url_shop']; ?>" target="_blank"><?php echo __('Modulcode hier erwerben', 'wpsg'); ?></a>
+ <a href="<?php echo $modul_info['url_shop']; ?>" target="_blank"><?php echo __('Modulcode erwerben', 'wpsg'); ?></a>
<?php } else { ?>
- <a href="https://shop.maennchen1.de" target="_blank"><?php echo __('Modulcode hier erwerben', 'wpsg'); ?></a>
+ <a href="https://shop.maennchen1.de" target="_blank"><?php echo __('Modulcode erwerben', 'wpsg'); ?></a>
<?php } ?>
<?php } ?>
@@ -202,8 +264,15 @@
else if (version_compare($modul_info['version'], $this->arAllModule[$modul_key]->versio) > 0)
{
- echo ' - <strong class="wpsg_error">'.__('neue Version verfügbar', 'wpsg').'</strong><br />';
- echo wpsg_translate(__('Version <a href="#1#">installieren</a>.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=installModul&modul='.$modul_key);
+ echo ' - <strong class="wpsg_error">'.__('neue Version verfügbar', 'wpsg').'</strong>';
+
+ if ($modul_info['active'] === true)
+ {
+
+ echo '<br />';
+ echo wpsg_translate(__('<a href="#1#">Version installieren</a>.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=installModul&modul='.$modul_key);
+
+ }
}
diff --git a/views/admin/news.phtml b/views/admin/news.phtml
index ceb4d62..25fdcf9 100644
--- a/views/admin/news.phtml
+++ b/views/admin/news.phtml
@@ -7,9 +7,7 @@
?>
<?php if (wpsg_isSizedArray($this->view['news'])) { ?>
-
- <br />
-
+
<div class="wpsg_news_wrap">
<?php foreach ($this->view['news'] as $news) { ?>
diff --git a/views/css/admin.css b/views/css/admin.css
index 7bdd8ff..87fe54c 100644
--- a/views/css/admin.css
+++ b/views/css/admin.css
@@ -41,7 +41,7 @@
#wpsg-bs .wpsg_error { color:red; }
#wpsg-bs .form-group-sm .form-control { padding-left:8px; }
#wpsg-bs .form-group-text { position:relative; }
-#wpsg-bs .form-group-text p { padding-top:8px; line-height:100%; min-height:18px; }
+#wpsg-bs .form-group-text p { padding-top:5px; line-height:150%; min-height:18px; }
#wpsg-bs .form-select .form-control { padding-left:5px; }
#wpsg-bs .form-group-sm .form-control-static { padding-left:10px; height:auto; }
#wpsg-bs .list-group-head { background-color:#666666; color:#FFFFFF; border:1px solid #666666; }
@@ -57,6 +57,8 @@
#wpsg-bs fieldset > legend > div { padding-left:25px; }
#wpsg-bs .wpsg_table_wrap { max-width:100%; overflow-x:auto; margin-bottom:1rem; }
#wpsg-bs .wpsg-bs-toggle-nav { float:right; line-height:50px; font-size:25px; text-decoration:none; }
+#wspg-bs #message,
+#wpsg-bs .wpsg_banner { margin-right:20px; }
/* Allgemeine Klassen */
.wpsg_grey { color:#999999; }
@@ -194,7 +196,14 @@
.wpsg_modul_onlyactive { position:absolute; }
.wpsg_modul_onlyactive_glyphicon { position:absolute !important; right:5px; top:7px !important; color:#3c763d; }
.wpsg_modul_search_wrap input[type="checkbox"] { right:25px; top:3px; position:absolute; }
-#wpsg-bs .modultable td { padding:4px 8px !important; }
+#wpsg-bs .modultable td { padding:4px 8px !important; font-size:1.2rem; }
+#wpsg-bs .modultable tr > *:nth-child(2) { width:100px; }
+#wpsg-bs .modultable tr > *:nth-child(3) { width:175px; }
+#wpsg-bs .modultable tr > *:nth-child(4) { width:200px; }
+
+/* Domainverwaltung */
+#wpsg-bs .domaintable td { padding:4px 8px !important; vertical-align:middle; }
+#wpsg-bs .domaintable td.col_action { text-align:right; }
/* Verwaltung Versandzonen */
.wpsg_table_vz .col_aktion { text-align:right; }
@@ -321,6 +330,9 @@
.wpsg_ov_table .wpsg_pflicht { width:100px; text-align:center; }
.wpsg_ov_table .wpsg_label { text-align:left; }
+/* News Bereich Backend */
+.wpsg_news_wrap { margin-right:20px; }
+
/* Statistikmodul */
.wpsg_mod_statistics_totals_row { width:100%; }
.wpsg_mod_statistics_totals_block { float:left; width:auto; text-align:center; font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif; }