Improved search for purchased items (Plugin-Store)
authorAlexander Ebert <ebert@woltlab.com>
Tue, 6 May 2014 19:30:36 +0000 (21:30 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 6 May 2014 19:30:36 +0000 (21:30 +0200)
wcfsetup/install/files/acp/js/WCF.ACP.js
wcfsetup/install/files/acp/templates/pluginStorePurchasedItems.tpl
wcfsetup/install/files/lib/acp/page/PluginStorePurchasedItemsPage.class.php
wcfsetup/install/lang/de.xml

index a9e9fa6213baaa7e42e0e54a3d1931e57e6f906c..edb8cbcae95fac554fb4d796f19ef216ae47c722 100644 (file)
@@ -1509,6 +1509,8 @@ WCF.ACP.Package.Update.Manager = Class.extend({
 
 /**
  * Searches for available updates.
+ * 
+ * @param      boolean         bindOnExistingButtons
  */
 WCF.ACP.Package.Update.Search = Class.extend({
        /**
@@ -1518,13 +1520,20 @@ WCF.ACP.Package.Update.Search = Class.extend({
        _dialog: null,
        
        /**
-        * initializes the WCF.ACP.Package.SearchForUpdates class.
+        * Initializes the WCF.ACP.Package.SearchForUpdates class.
+        * 
+        * @param       boolean         bindOnExistingButtons
         */
-       init: function() {
+       init: function(bindOnExistingButtons) {
                this._dialog = null;
                
-               var $button = $('<li><a class="button"><span class="icon icon16 icon-refresh"></span> <span>' + WCF.Language.get('wcf.acp.package.searchForUpdates') + '</span></a></li>');
-               $button.click($.proxy(this._click, this)).prependTo($('.contentNavigation:eq(0) > nav:not(.pageNavigation) > ul'));
+               if (bindOnExistingButtons === true) {
+                       $('.jsButtonPackageUpdate').click($.proxy(this._click, this));
+               }
+               else {
+                       var $button = $('<li><a class="button"><span class="icon icon16 icon-refresh"></span> <span>' + WCF.Language.get('wcf.acp.package.searchForUpdates') + '</span></a></li>');
+                       $button.click($.proxy(this._click, this)).prependTo($('.contentNavigation:eq(0) > nav:not(.pageNavigation) > ul'));
+               }
        },
        
        /**
index b40327331a627686aaedadcb5a461a09dbc38484..a4431d091436ed92d7c83ab40a6555a03131f6b7 100644 (file)
@@ -1,5 +1,20 @@
 {include file='header' pageTitle='wcf.acp.pluginStore.purchasedItems'}
 
+<script data-relocate="true">
+       $(function() {
+               WCF.Language.addObject({
+                       'wcf.acp.package.searchForUpdates': '{lang}wcf.acp.package.searchForUpdates{/lang}',
+                       'wcf.acp.package.searchForUpdates.noResults': '{lang}wcf.acp.package.searchForUpdates.noResults{/lang}',
+                       'wcf.acp.package.update.unauthorized': '{lang}wcf.acp.package.update.unauthorized{/lang}'
+               });
+               
+               var $installer = new WCF.ACP.Package.Server.Installation();
+               $installer.bind();
+               
+               new WCF.ACP.Package.Update.Search(true);
+       });
+</script>
+
 <header class="boxHeadline">
        <h1>{lang}wcf.acp.pluginStore.purchasedItems{/lang}</h1>
 </header>
                                                <tr>
                                                        <td class="columnIcon">
                                                                {if $product[status] == 'install'}
-                                                                       <a class="jsInstallPackage data-confirm-message="{*lang}wcf.acp.package.install.confirmMessage{/lang*}" data-package="{$product[package]}" data-package-version="{$product[version][available]}"><span class="icon icon16 fa-plus jsTooltip" title="{lang}wcf.acp.package.button.installPackage{/lang}"></span></a>
+                                                                       <a class="jsButtonPackageInstall" data-confirm-message="{lang}wcf.acp.pluginStore.purchasedItems.status.install.confirmMessage{/lang}" data-package="{$product[package]}" data-package-version="{$product[version][available]}"><span class="icon icon16 fa-plus jsTooltip" title="{lang}wcf.acp.package.button.installPackage{/lang}"></span></a>
                                                                {else if $product[status] == 'update'}
-                                                                       <span class="icon icon16 fa-refresh"></span>
+                                                                       <a class="jsButtonPackageUpdate"><span class="icon icon16 fa-refresh jsTooltip" title="{lang}wcf.acp.pluginStore.purchasedItems.status.update{/lang}"></span></a>
+                                                               {else if $product[status] == 'upToDate'}
+                                                                       <span class="icon icon16 fa-check green jsTooltip" title="{lang}wcf.acp.pluginStore.purchasedItems.status.upToDate{/lang}"></span>
                                                                {else}
-                                                                       <span class="icon icon16 fa-ban red"></span>
+                                                                       <span class="icon icon16 fa-ban red jsTooltip" title="{lang}wcf.acp.pluginStore.purchasedItems.status.unavailable{/lang}"></span>
                                                                {/if}
                                                        </td>
                                                        <td class="columnText"><a href="{@$__wcf->getPath()}acp/dereferrer.php?url={$product[pluginStoreURL]|rawurlencode}" class="externalURL">{$product[packageName]}</a></td>
index 3c7f16999f67ee31e37e2fae9ac029b8d3d900c3..0a7870ccce15bebd6cf887eddaf1f7cfbca2b323 100644 (file)
@@ -100,6 +100,9 @@ class PluginStorePurchasedItemsPage extends AbstractPage {
                                if (Package::compareVersion($product['lastVersion'], $package->packageVersion, '>')) {
                                        $this->productData[$wcfMajorRelease][$packageUpdateID]['status'] = 'update';
                                }
+                               else if (Package::compareVersion($product['lastVersion'], $package->packageVersion, '=')) {
+                                       $this->productData[$wcfMajorRelease][$packageUpdateID]['status'] = 'upToDate';
+                               }
                        }
                }
        }
index 3e3f1fb53dc7fdf502c9d1d4f8ce079e964746eb..bc30b56ff549dc9484be2849286c894d55b4e01e 100644 (file)
@@ -1043,6 +1043,10 @@ GmbH=Gesellschaft mit beschränkter Haftung]]></item>
                <item name="wcf.acp.pluginStore.purchasedItems.button.search"><![CDATA[Gekaufte Produkte (Plugin-Store)]]></item>
                <item name="wcf.acp.pluginStore.purchasedItems"><![CDATA[Gekaufte Produkte (Plugin-Store)]]></item>
                <item name="wcf.acp.pluginStore.purchasedItems.noResults"><![CDATA[Die Suche ergab keine Treffer, entweder haben Sie noch keine Produkte erworben oder diese sind nicht kompatibel.]]></item>
+               <item name="wcf.acp.pluginStore.purchasedItems.status.update"><![CDATA[Neuere Version verfügbar]]></item>
+               <item name="wcf.acp.pluginStore.purchasedItems.status.unavailable"><![CDATA[Paket-Server nicht installiert]]></item>
+               <item name="wcf.acp.pluginStore.purchasedItems.status.upToDate"><![CDATA[Aktuellste Version bereits installiert]]></item>
+               <item name="wcf.acp.pluginStore.purchasedItems.status.install.confirmMessage"><![CDATA[Möchten Sie das Produkt „{$product[packageName]}“ wirklich installieren?]]></item>
                <item name="wcf.acp.pluginStore.purchasedItems.updateServer.disabled"><![CDATA[Der Paket-Server für „{$wcfMajorRelease}“ („http://store.woltlab.com/{$wcfMajorRelease}/“) ist deaktiviert und steht weder für Neuinstallation noch Updates zur Verfügung.]]></item>
                <item name="wcf.acp.pluginStore.purchasedItems.updateServer.missing"><![CDATA[Der Paket-Server für „{$wcfMajorRelease}“ ist bei Ihnen nicht eingetragen. Wenn Sie die unten stehenden Pakete installieren möchten, müssen Sie diesen zuvor <a href="{link controller='PackageUpdateServerAdd'}{/link}">hinzufügen</a>.<br />Die Adresse des Servers lautet: „http://store.woltlab.com/{$wcfMajorRelease}/“]]></item>
                <item name="wcf.acp.pluginStore.purchasedItems.wcfMajorRelease"><![CDATA[Paket-Server für „{$wcfMajorRelease}“]]></item>