From ffc17fc63db07fe5969a0d9e35e05c6a9138c86e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 30 Dec 2012 02:50:18 +0100 Subject: [PATCH] Removed isUnique Fixes #1039 --- XSD/package.xsd | 1 - com.woltlab.wcf/package.xml | 1 - .../templates/packageUpdateSearchResult.tpl | 13 +++--------- .../form/PackageUpdateSearchForm.class.php | 15 ++------------ .../page/PackageListDetailedPage.class.php | 2 +- .../PackageUpdateSearchResultPage.class.php | 20 ------------------- 6 files changed, 6 insertions(+), 46 deletions(-) diff --git a/XSD/package.xsd b/XSD/package.xsd index dec100fac7..ede939f1f9 100644 --- a/XSD/package.xsd +++ b/XSD/package.xsd @@ -87,7 +87,6 @@ - diff --git a/com.woltlab.wcf/package.xml b/com.woltlab.wcf/package.xml index 5b34ca6167..8f54d6281e 100644 --- a/com.woltlab.wcf/package.xml +++ b/com.woltlab.wcf/package.xml @@ -5,7 +5,6 @@ Free web-framework, designed and developed for complex community applications. Freies Web-Framework, das für komplexe Community-Anwendungen entworfen und entwickelt wurde. 1 - 1 2.0.0 Alpha 1 2011-05-19 diff --git a/wcfsetup/install/files/acp/templates/packageUpdateSearchResult.tpl b/wcfsetup/install/files/acp/templates/packageUpdateSearchResult.tpl index 19f2e449a6..b837d6f582 100644 --- a/wcfsetup/install/files/acp/templates/packageUpdateSearchResult.tpl +++ b/wcfsetup/install/files/acp/templates/packageUpdateSearchResult.tpl @@ -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} @@ -76,15 +76,8 @@ {lang}wcf.acp.packageUpdate.options{/lang}
- {* new installation *} - {if $package[isUnique] && !$package[updatableInstances]|count} -
-
{lang}wcf.acp.packageUpdate.options.alreadyInstalledUnique{/lang}
- {/if} - {if !$package[isUnique]} -
-
- {/if} +
+
{* update *} {foreach from=$package[updatableInstances] item=updatableInstance} diff --git a/wcfsetup/install/files/lib/acp/form/PackageUpdateSearchForm.class.php b/wcfsetup/install/files/lib/acp/form/PackageUpdateSearchForm.class.php index e40d2aa5da..faab837aa7 100644 --- a/wcfsetup/install/files/lib/acp/form/PackageUpdateSearchForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PackageUpdateSearchForm.class.php @@ -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 @@ -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 )); } diff --git a/wcfsetup/install/files/lib/acp/page/PackageListDetailedPage.class.php b/wcfsetup/install/files/lib/acp/page/PackageListDetailedPage.class.php index 12ecf92fa8..619a8164e0 100644 --- a/wcfsetup/install/files/lib/acp/page/PackageListDetailedPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/PackageListDetailedPage.class.php @@ -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 diff --git a/wcfsetup/install/files/lib/acp/page/PackageUpdateSearchResultPage.class.php b/wcfsetup/install/files/lib/acp/page/PackageUpdateSearchResultPage.class.php index 43da38d876..421196db96 100755 --- a/wcfsetup/install/files/lib/acp/page/PackageUpdateSearchResultPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/PackageUpdateSearchResultPage.class.php @@ -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; } } -- 2.20.1