Removed instanceName for packages and some fixes
authorAlexander Ebert <ebert@woltlab.com>
Fri, 7 Dec 2012 02:30:18 +0000 (03:30 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 7 Dec 2012 02:30:18 +0000 (03:30 +0100)
wcfsetup/install/files/acp/templates/package.tpl
wcfsetup/install/files/acp/templates/packageListDetailed.tpl
wcfsetup/install/files/lib/acp/page/PackageUpdateSearchResultPage.class.php
wcfsetup/install/files/lib/data/package/Package.class.php
wcfsetup/install/files/lib/system/package/PackageArchive.class.php
wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php
wcfsetup/setup/db/install.sql

index 78db50eb4c7583d969ec0a177f4f64a433ed14f7..8a9d2b24e8553441e82d63a24a8d7f61cecf1d37 100644 (file)
                                                                                                <img src="{@$__wcf->getPath()}icon/update.svg" alt="" title="{lang}wcf.acp.package.button.update{/lang}" class="icon16 disabled" />
                                                                                        {/if}
                                                                                        {if $requiredPackage->canUninstall()}
-                                                                                               <img src="{@$__wcf->getPath()}icon/delete.svg" alt="" title="{lang}wcf.acp.package.button.uninstall{/lang}" class="icon16 jsTooltip jsUninstallButton" data-objectID="{@$requiredPackage->packageID}" data-confirm-message="{lang package=$requiredPackage}wcf.acp.package.uninstallation.confirm{/lang}" data-is-required="{$package->isRequired()}true{else}false{/if}" />
+                                                                                               <img src="{@$__wcf->getPath()}icon/delete.svg" alt="" title="{lang}wcf.acp.package.button.uninstall{/lang}" class="icon16 jsTooltip jsUninstallButton" data-objectID="{@$requiredPackage->packageID}" data-confirm-message="{lang package=$requiredPackage}wcf.acp.package.uninstallation.confirm{/lang}" data-is-required="{if $package->isRequired()}true{else}false{/if}" />
                                                                                        {else}
                                                                                                <img src="{@$__wcf->getPath()}icon/delete.svg" alt="" title="{lang}wcf.acp.package.button.uninstall{/lang}" class="icon16 disabled" />
                                                                                        {/if}
                                                                                                <img src="{@$__wcf->getPath()}icon/package.svg" alt="" title="{lang}wcf.acp.package.type.other{/lang}" class="icon16 jsTooltip" />
                                                                                        {/if}
                                                                                </td>
-                                                                               <td class="columnTitle" title="{$requiredPackage->packageDescription|language}"><p><a href="{link controller='Package' id=$requiredPackage->packageID}{/link}">{$requiredPackage->packageName|language}{if $requiredPackage->instanceNo > 1 && $requiredPackage->instanceName == ''} (#{#$requiredPackage->instanceNo}){/if}</a></p></td>
+                                                                               <td class="columnTitle" title="{$requiredPackage->packageDescription|language}"><p><a href="{link controller='Package' id=$requiredPackage->packageID}{/link}">{$requiredPackage}</a></p></td>
                                                                                <td class="columnText">{if $requiredPackage->authorURL}<p><a href="{@$__wcf->getPath()}acp/dereferrer.php?url={$requiredPackage->authorURL|rawurlencode}" class="wcf-externalURL">{$requiredPackage->author}</a>{else}{$requiredPackage->author}</p>{/if}</td>
                                                                                <td class="columnText"><p>{$requiredPackage->packageVersion}</p></td>
                                                                                <td class="columnDate"><p>{@$requiredPackage->packageDate|date}</p></td>
                                                                                                <img src="{@$__wcf->getPath()}icon/update.svg" alt="" title="{lang}wcf.acp.package.button.update{/lang}" class="icon16 disabled" />
                                                                                        {/if}
                                                                                        {if $dependentPackage->canUninstall()}
-                                                                                               <img src="{@$__wcf->getPath()}icon/delete.svg" alt="" title="{lang}wcf.acp.package.button.uninstall{/lang}" class="icon16 jsTooltip jsUninstallButton" data-objectID="{@$dependentPackage->packageID}" data-confirm-message="{lang package=$dependentPackage}wcf.acp.package.uninstallation.confirm{/lang}" data-is-required="{$package->isRequired()}true{else}false{/if}" />
+                                                                                               <img src="{@$__wcf->getPath()}icon/delete.svg" alt="" title="{lang}wcf.acp.package.button.uninstall{/lang}" class="icon16 jsTooltip jsUninstallButton" data-objectID="{@$dependentPackage->packageID}" data-confirm-message="{lang package=$dependentPackage}wcf.acp.package.uninstallation.confirm{/lang}" data-is-required="{if $package->isRequired()}true{else}false{/if}" />
                                                                                        {else}
                                                                                                <img src="{@$__wcf->getPath()}icon/delete.svg" alt="" title="{lang}wcf.acp.package.button.uninstall{/lang}" class="icon16 disabled" />
                                                                                        {/if}
                                                                                                <img src="{@$__wcf->getPath()}icon/package.svg" alt="" title="{lang}wcf.acp.package.type.other{/lang}" class="jsTooltip" />
                                                                                        {/if}
                                                                                </td>
-                                                                               <td class="columnTitle" title="{$dependentPackage->packageDescription|language}"><p><a href="{link controller='Package' id=$dependentPackage->packageID}{/link}">{$dependentPackage->packageName|language}{if $dependentPackage->instanceNo > 1 && $dependentPackage->instanceName == ''} (#{#$dependentPackage->instanceNo}){/if}</a></p></td>
+                                                                               <td class="columnTitle" title="{$dependentPackage->packageDescription|language}"><p><a href="{link controller='Package' id=$dependentPackage->packageID}{/link}">{$dependentPackage}</a></p></td>
                                                                                <td class="columnText">{if $dependentPackage->authorURL}<p><a href="{@$__wcf->getPath()}acp/dereferrer.php?url={$dependentPackage->authorURL|rawurlencode}" class="wcf-externalURL">{$dependentPackage->author}</a>{else}{$dependentPackage->author}</p>{/if}</td>
                                                                                <td class="columnText"><p>{$dependentPackage->packageVersion}</p></td>
                                                                                <td class="columnDate"><p>{@$dependentPackage->packageDate|date}</p></td>
index bbdee27f2643c43b44c658b328b90659ec541837..e88f75e461711c98535b165c4f96d73f56e89712 100644 (file)
@@ -63,7 +63,7 @@
                                                                <img src="{@$__wcf->getPath()}icon/update.svg" alt="" title="{lang}wcf.acp.package.button.update{/lang}" class="icon16 disabled" />
                                                        {/if}
                                                        {if $package->canUninstall()}
-                                                               <img src="{@$__wcf->getPath()}icon/delete.svg" alt="" title="{lang}wcf.acp.package.button.uninstall{/lang}" class="icon16 jsUninstallButton jsTooltip" data-object-id="{@$package->packageID}" data-confirm-message="{lang}wcf.acp.package.uninstallation.confirm{/lang}" data-is-required="{$package->isRequired()}true{else}false{/if}" />
+                                                               <img src="{@$__wcf->getPath()}icon/delete.svg" alt="" title="{lang}wcf.acp.package.button.uninstall{/lang}" class="icon16 jsUninstallButton jsTooltip" data-object-id="{@$package->packageID}" data-confirm-message="{lang}wcf.acp.package.uninstallation.confirm{/lang}" data-is-required="{if $package->isRequired()}true{else}false{/if}" />
                                                        {else}
                                                                <img src="{@$__wcf->getPath()}icon/delete.svg" alt="" title="{lang}wcf.acp.package.button.uninstall{/lang}" class="icon16 disabled" />
                                                        {/if}
@@ -81,7 +81,7 @@
                                                        {/if}
                                                </td>
                                                <td id="packageName{@$package->packageID}" class="columnTitle" title="{$package->packageDescription|language}">
-                                                       <a href="{link controller='Package' id=$package->packageID}{/link}"><span>{$package->getName()}{if $package->instanceNo > 1 && $package->instanceName == ''} (#{#$package->instanceNo}){/if}</span></a>
+                                                       <a href="{link controller='Package' id=$package->packageID}{/link}"><span>{$package}</span></a>
                                                </td>
                                                <td class="columnText"><p>{if $package->authorURL}<a href="{@$__wcf->getPath()}acp/dereferrer.php?url={$package->authorURL|rawurlencode}" class="wcf-externalURL">{$package->author}</a>{else}{$package->author}{/if}</p></td>
                                                <td class="columnText"><p>{$package->packageVersion}</p></td>
index b5d3b9bab0d16d07cdf0f6d2e314a524b20837ea..43da38d87662319bd3b343f4eb988cbc316a6f5e 100755 (executable)
@@ -150,15 +150,16 @@ class PackageUpdateSearchResultPage extends SortablePage {
                                        $row['packageVersion'] = end($row['packageVersions']);
                                }
                                
+                               // TODO: Multiple instances are no longer supported, remove this
                                // get installed instances
-                               $sql = "SELECT  package.*, CASE WHEN instanceName <> '' THEN instanceName ELSE packageName END AS packageName
+                               $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;
                                        
index baa60762aea7f97cf6e0d8c253ed52be521eada3..181ffb842cf97337142935729c5cb76338c88f23 100644 (file)
@@ -85,7 +85,14 @@ class Package extends DatabaseObject {
         * @return      string
         */
        public function getName() {
-               return WCF::getLanguage()->get($this->instanceName ?: $this->packageName);
+               return WCF::getLanguage()->get($this->packageName);
+       }
+       
+       /**
+        * @see wcf\data\package\Package::getName()
+        */
+       public function __toString() {
+               return $this->getName();
        }
        
        /**
@@ -123,7 +130,7 @@ class Package extends DatabaseObject {
                if ($this->requiredPackages === null) {
                        $this->requiredPackages = array();
                        
-                       $sql = "SELECT          package.*, CASE WHEN instanceName <> '' THEN instanceName ELSE packageName END AS packageName
+                       $sql = "SELECT          package.*
                                FROM            wcf".WCF_N."_package_requirement package_requirement
                                LEFT JOIN       wcf".WCF_N."_package package ON (package.packageID = package_requirement.requirement)
                                WHERE           package_requirement.packageID = ?
index bd445a676a65e35afe32f0944e14bc03270cf5b9..ffc83bad405e3d3c721107876b729a960934941b 100644 (file)
@@ -531,7 +531,7 @@ class PackageArchive {
                $existingRequirements = array();
                $existingPackages = array();
                if ($this->package !== null) {
-                       $sql = "SELECT          package.*, CASE WHEN instanceName <> '' THEN instanceName ELSE packageName END AS packageName
+                       $sql = "SELECT          package.*
                                FROM            wcf".WCF_N."_package_requirement requirement
                                LEFT JOIN       wcf".WCF_N."_package package
                                ON              (package.packageID = requirement.requirement)
@@ -561,7 +561,7 @@ class PackageArchive {
                        $conditions = new PreparedStatementConditionBuilder();
                        $conditions->add("package.package IN (?)", array($packageNames));
                        
-                       $sql = "SELECT  package.*, CASE WHEN instanceName <> '' THEN instanceName ELSE packageName END AS packageName
+                       $sql = "SELECT  package.*
                                FROM    wcf".WCF_N."_package package
                                ".$conditions;
                        $statement = WCF::getDB()->prepareStatement($sql);
index 26a88cccbc34682eb7ef8098242ee92df5685606..5e1d7b0bf132ce1b765f6c9c7e493311fb7e7252 100644 (file)
@@ -470,8 +470,7 @@ abstract class PackageUpdateDispatcher {
                // get existing packages and their versions
                $existingPackages = array();
                $sql = "SELECT  packageID, package, instanceNo, packageDescription,
-                               packageVersion, packageDate, author, authorURL, isApplication,
-                               CASE WHEN instanceName <> '' THEN instanceName ELSE packageName END AS packageName
+                               packageVersion, packageDate, author, authorURL, isApplication
                        FROM    wcf".WCF_N."_package";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute();
index 47eeab57cb26e77fb3dca3db3c9b9c7f078586fd..0180f99198aa413e543d99db60ab7f116f4f8926 100644 (file)
@@ -307,7 +307,6 @@ CREATE TABLE wcf1_package (
        package VARCHAR(255) NOT NULL DEFAULT '',
        packageDir VARCHAR(255) NOT NULL DEFAULT '',
        packageName VARCHAR(255) NOT NULL DEFAULT '',
-       instanceName VARCHAR(255) NOT NULL DEFAULT '',
        instanceNo INT(10) NOT NULL DEFAULT 1,
        packageDescription VARCHAR(255) NOT NULL DEFAULT '',
        packageVersion VARCHAR(255) NOT NULL DEFAULT '',