<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>
<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}
{/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>
$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;
* @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();
}
/**
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 = ?
$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)
$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);
// 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();
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 '',