Removed isUnique
authorAlexander Ebert <ebert@woltlab.com>
Sun, 30 Dec 2012 01:50:18 +0000 (02:50 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 30 Dec 2012 01:50:18 +0000 (02:50 +0100)
Fixes #1039

XSD/package.xsd
com.woltlab.wcf/package.xml
wcfsetup/install/files/acp/templates/packageUpdateSearchResult.tpl
wcfsetup/install/files/lib/acp/form/PackageUpdateSearchForm.class.php
wcfsetup/install/files/lib/acp/page/PackageListDetailedPage.class.php
wcfsetup/install/files/lib/acp/page/PackageUpdateSearchResultPage.class.php

index dec100fac7a25799453113a75e10ee0824e6bcc6..ede939f1f923865f4e1dc678a411774fa8b16f93 100644 (file)
@@ -87,7 +87,6 @@
                        </xs:element>
                        <xs:element name="packageurl" type="xs:anyURI" minOccurs="0" maxOccurs="1" />
                        <xs:element name="isapplication" type="woltlab_boolean" minOccurs="0" maxOccurs="1" />
-                       <xs:element name="isunique" type="woltlab_boolean" minOccurs="0" maxOccurs="1" />
                        <xs:element name="version" type="woltlab_varchar" minOccurs="1" maxOccurs="1" />
                        <xs:element name="date" type="xs:date" minOccurs="1" maxOccurs="1" />
                        <xs:element name="plugin" type="woltlab_varchar" minOccurs="0" maxOccurs="1" />
index 5b34ca6167440bb8d54af3feaacdd1e34fbf8202..8f54d6281ee6eda7a9198d5336fea2425a9b0c5b 100644 (file)
@@ -5,7 +5,6 @@
                <packagedescription>Free web-framework, designed and developed for complex community applications.</packagedescription>
                <packagedescription language="de">Freies Web-Framework, das für komplexe Community-Anwendungen entworfen und entwickelt wurde.</packagedescription>
                <isapplication>1</isapplication>
-               <isunique>1</isunique>
                <version>2.0.0 Alpha 1</version> <!-- codename: maelstrom -->
                <date>2011-05-19</date>
        </packageinformation>
index 19f2e449a67f6b9cc0724a988f8f2c3d4567eba9..b837d6f582d5a98818d8ffd180c52ffb3368d6f0 100644 (file)
@@ -45,7 +45,7 @@
                                                                                var packageVersion = select.options[select.selectedIndex].value;
                                                                                
                                                                                // set value
-                                                                               {if !$package[isUnique]}document.getElementById('updates-{$package[package]}').value = packageVersion;{/if}
+                                                                               document.getElementById('updates-{$package[package]}').value = packageVersion;
                                                                                {foreach from=$package[updatableInstances] item=updatableInstance}
                                                                                        document.getElementById('updates-{$updatableInstance[packageID]}').value = packageVersion;
                                                                                {/foreach}
                                                <legend>{lang}wcf.acp.packageUpdate.options{/lang}</legend>
                                                
                                                <dl>
-                                                       {* new installation *}
-                                                       {if $package[isUnique] && !$package[updatableInstances]|count}
-                                                               <dt></dt>
-                                                               <dd>{lang}wcf.acp.packageUpdate.options.alreadyInstalledUnique{/lang}</dd>
-                                                       {/if}
-                                                       {if !$package[isUnique]}
-                                                               <dt></dt>
-                                                               <dd><label><input type="checkbox" id="updates-{$package[package]}" name="updates[{$package[package]}]" value="{$package[packageVersion]}" {if $selectedPackages[$package[packageID]]|isset}checked="checked" {/if}/> {if $package[instances]}{lang}wcf.acp.packageUpdate.options.installAlreadyInstalled{/lang}{else}{lang}wcf.acp.packageUpdate.options.install{/lang}{/if}</label></dd>
-                                                       {/if}
+                                                       <dt></dt>
+                                                       <dd><label><input type="checkbox" id="updates-{$package[package]}" name="updates[{$package[package]}]" value="{$package[packageVersion]}" {if $selectedPackages[$package[packageID]]|isset}checked="checked" {/if}/> {if $package[instances]}{lang}wcf.acp.packageUpdate.options.installAlreadyInstalled{/lang}{else}{lang}wcf.acp.packageUpdate.options.install{/lang}{/if}</label></dd>
                                                        
                                                        {* update *}
                                                        {foreach from=$package[updatableInstances] item=updatableInstance}
index e40d2aa5da5f1cc2f4d62f0e66d37acd4b857444..faab837aa7540aa7fba1e0b79e81318759a9f193 100644 (file)
@@ -75,12 +75,6 @@ class PackageUpdateSearchForm extends ACPForm {
         */
        public $other = 0;
        
-       /**
-        * indicates if unique packages are ignored that are already installed
-        * @var integer
-        */
-       public $ignoreUniques = 1;
-       
        /**
         * list of available update servers
         * @var array<wcf\data\package\update\server\PackageUpdateServer>
@@ -99,7 +93,7 @@ class PackageUpdateSearchForm extends ACPForm {
        public function readFormParameters() {
                parent::readFormParameters();
                
-               $this->ignoreUniques = $this->plugin = $this->isApplication = 0;
+               $this->plugin = $this->isApplication = 0;
                if (isset($_POST['packageUpdateServerIDs']) && is_array($_POST['packageUpdateServerIDs'])) $this->packageUpdateServerIDs = ArrayUtil::toIntegerArray($_POST['packageUpdateServerIDs']);
                if (isset($_POST['packageName'])) $this->packageName = StringUtil::trim($_POST['packageName']);
                if (isset($_POST['author'])) $this->author = StringUtil::trim($_POST['author']);
@@ -107,7 +101,6 @@ class PackageUpdateSearchForm extends ACPForm {
                if (isset($_POST['plugin'])) $this->plugin = intval($_POST['plugin']);
                if (isset($_POST['isApplication'])) $this->isApplication = intval($_POST['isApplication']);
                if (isset($_POST['other'])) $this->other = intval($_POST['other']);
-               if (isset($_POST['ignoreUniques'])) $this->ignoreUniques = intval($_POST['ignoreUniques']);
        }
        
        /**
@@ -143,9 +136,6 @@ class PackageUpdateSearchForm extends ACPForm {
                // author
                if (!empty($this->author)) $conditions->add("author LIKE ?", array($this->author));
                
-               // ignore already installed uniques
-               if ($this->ignoreUniques == 1) $conditions->add("package NOT IN (SELECT package FROM wcf".WCF_N."_package WHERE isUnique = 1)");
-               
                // package type
                if (($this->plugin == 0 || $this->isApplication == 0 || $this->other == 0) && ($this->plugin == 1 || $this->isApplication == 1 || $this->other == 1)) {
                        if ($this->isApplication == 1) {
@@ -272,8 +262,7 @@ class PackageUpdateSearchForm extends ACPForm {
                        'isApplication' => $this->isApplication,
                        'plugin' => $this->plugin,
                        'other' => $this->other,
-                       'packageUpdateServerIDs' => $this->packageUpdateServerIDs,
-                       'ignoreUniques' => $this->ignoreUniques
+                       'packageUpdateServerIDs' => $this->packageUpdateServerIDs
                ));
        }
        
index 12ecf92fa8bd26a5845ab98a5c8f01b10cf50253..619a8164e09b4ecbfbe1bfea72e94b2c0db152e0 100644 (file)
@@ -37,7 +37,7 @@ class PackageListDetailedPage extends SortablePage {
        /**
         * @see wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('packageID', 'package', 'packageDir', 'packageName', 'packageDescription', 'packageDate', 'packageURL', 'isUnique', 'isApplication', 'author', 'authorURL', 'installDate', 'updateDate');
+       public $validSortFields = array('packageID', 'package', 'packageDir', 'packageName', 'packageDescription', 'packageDate', 'packageURL', 'isApplication', 'author', 'authorURL', 'installDate', 'updateDate');
        
        /**
         * @see wcf\page\MultipleLinkPage::$objectListClassName
index 43da38d87662319bd3b343f4eb988cbc316a6f5e..421196db964b51fab886a22e7121d12c739e1c65 100755 (executable)
@@ -121,7 +121,6 @@ class PackageUpdateSearchResultPage extends SortablePage {
                        $statement->execute($conditions->getParameters());
                        while ($row = $statement->fetchArray()) {
                                // default values
-                               $row['isUnique'] = 0;
                                $row['updatableInstances'] = array();
                                $row['packageVersions'] = array();
                                $row['packageVersion'] = '1.0.0';
@@ -150,25 +149,6 @@ class PackageUpdateSearchResultPage extends SortablePage {
                                        $row['packageVersion'] = end($row['packageVersions']);
                                }
                                
-                               // TODO: Multiple instances are no longer supported, remove this
-                               // get installed instances
-                               $sql = "SELECT  package.*
-                                       FROM    wcf".WCF_N."_package package
-                                       WHERE   package.package = ?";
-                               $statement2 = WCF::getDB()->prepareStatement($sql);
-                               $statement2->execute(array($row['package']));
-                               while ($row2 = $statement2->fetchArray()) {
-                                       $row['instances']++;
-                                       
-                                       // is already installed unique?
-                                       if ($row2['isUnique'] == 1) $row['isUnique'] = 1;
-                                       
-                                       // check update support
-                                       if (Package::compareVersion($row2['packageVersion'], $row['packageVersion'], '<')) {
-                                               $row['updatableInstances'][] = $row2;
-                                       }
-                               }
-                               
                                $this->packages[] = $row;
                        }
                }