Fixes for package update
authorAlexander Ebert <ebert@woltlab.com>
Mon, 20 May 2013 18:48:20 +0000 (20:48 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 20 May 2013 18:48:20 +0000 (20:48 +0200)
com.woltlab.wcf/package.xml
wcfsetup/install/files/acp/js/WCF.ACP.js
wcfsetup/install/files/acp/templates/packageInstallationConfirm.tpl
wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 93df9c57bc4828984e24b6bde6ed020607f0cdd6..b2c2660ac7efa4168700ad59310ec92e4ee0303a 100644 (file)
@@ -42,7 +42,7 @@
                <instruction type="acpMenu">acpMenu.xml</instruction>
                <instruction type="clipboardAction">clipboardAction.xml</instruction>
                <instruction type="coreObject">coreObject.xml</instruction>
-               <instruction type="language">languages/*.xml</instruction>
+               <instruction type="language">language/*.xml</instruction>
                <instruction type="option">option.xml</instruction>
                <instruction type="userGroupOption">userGroupOption.xml</instruction>
        </instructions>
index 48d92835ef043ce58f2c76f8fafd81041d1a92c9..ed06114492330593fba3687e0690c0b96545b84d 100644 (file)
@@ -385,9 +385,19 @@ WCF.ACP.Package.Installation = Class.extend({
                this._allowRollback = (allowRollback === true) ? true : false;
                this._queueID = queueID;
                
-               this._dialogTitle = 'wcf.acp.package.installation.title';
-               if (actionName == 'UninstallPackage') {
-                       this._dialogTitle = 'wcf.acp.package.uninstallation.title';
+               switch (actionName) {
+                       case 'InstallPackage':
+                               if (allowRollback) {
+                                       this._dialogTitle = 'wcf.acp.package.installation.title';
+                               }
+                               else {
+                                       this._dialogTitle = 'wcf.acp.package.update.title';
+                               }
+                       break;
+                       
+                       case 'UninstallPackage':
+                               this._dialogTitle = 'wcf.acp.package.uninstallation.title';
+                       break;
                }
                
                this._initProxy();
index 9daa38e8e649925340dcb7183171a8a16b22a528..41e41a0ac05dd71e70bac3d2649187480432f47a 100644 (file)
@@ -5,7 +5,8 @@
        $(function() {
                WCF.Language.addObject({
                        'wcf.acp.package.installation.title': '{lang}wcf.acp.package.installation.title{/lang}',
-                       'wcf.acp.package.uninstallation.title': '{lang}wcf.acp.package.uninstallation.title{/lang}'
+                       'wcf.acp.package.uninstallation.title': '{lang}wcf.acp.package.uninstallation.title{/lang}',
+                       'wcf.acp.package.update.title': '{lang}wcf.acp.package.update.title{/lang}'
                });
                new WCF.ACP.Package.Installation({@$queue->queueID}, undefined, {if $queue->action == 'install'}true{else}false{/if});
        });
index ad7b32c8c3272a165f62281323dea709d9513dcf..681e70ea13cd36fb765dc52c10c31e39edf71448 100755 (executable)
@@ -208,12 +208,13 @@ class InstallPackageAction extends AbstractDialogAction {
        protected function getCurrentAction($queueID) {
                if ($queueID === null) {
                        // success message
-                       $currentAction = WCF::getLanguage()->get('wcf.acp.package.installation.step.install.success');
+                       $currentAction = WCF::getLanguage()->get('wcf.acp.package.installation.step.' . $this->queue->action . '.success');
                }
                else {
                        // build package name
                        $packageName = $this->installation->nodeBuilder->getPackageNameByQueue($queueID);
-                       $currentAction = WCF::getLanguage()->getDynamicVariable('wcf.acp.package.installation.step.install', array('packageName' => $packageName));
+                       $installationType = $this->installation->nodeBuilder->getInstallationTypeByQueue($queueID);
+                       $currentAction = WCF::getLanguage()->getDynamicVariable('wcf.acp.package.installation.step.'.$installationType, array('packageName' => $packageName));
                }
                
                return $currentAction;
index 486705b80ca8f3cb053bf836f00ba0eb4b79d218..045aae2b36c42ccab432e581199593d0aaa78bfb 100644 (file)
@@ -184,7 +184,31 @@ class PackageInstallationDispatcher {
                        // clear user storage
                        UserStorageHandler::getInstance()->clear();
                        
+                       // rebuild config files for affected applications
+                       $sql = "SELECT          package.packageID
+                               FROM            wcf1_package_installation_queue queue,
+                                               wcf1_package package
+                               WHERE           queue.processNo = ?
+                                               AND package.packageID = queue.packageID
+                                               AND package.packageID <> ?
+                                               AND package.isApplication = ?";
+                       $statement = WCF::getDB()->prepareStatement($sql);
+                       $statement->execute(array(
+                               $this->queue->processNo,
+                               1,
+                               1
+                       ));
+                       while ($row = $statement->fetchArray()) {
+                               Package::writeConfigFile($row['packageID']);
+                       }
+                       
                        EventHandler::getInstance()->fireAction($this, 'postInstall');
+                       
+                       // remove queues with the same process no
+                       $sql = "DELETE FROM     wcf".WCF_N."_package_installation_queue
+                               WHERE           processNo = ?";
+                       $statement = WCF::getDB()->prepareStatement($sql);
+                       $statement->execute(array($this->queue->processNo));
                }
                
                if ($this->requireRestructureVersionTables) {
index 66ec2b3557d456ffe577be076f7a01479697e279..420d541bb940633eb1cf1e3ff04b000ed635214f 100644 (file)
@@ -136,6 +136,23 @@ class PackageInstallationNodeBuilder {
                return $row['packageName'];
        }
        
+       /**
+        * Returns installation type by queue id.
+        * 
+        * @param       integer         $queueID
+        * @return      string
+        */
+       public function getInstallationTypeByQueue($queueID) {
+               $sql = "SELECT  action
+                       FROM    wcf".WCF_N."_package_installation_queue
+                       WHERE   queueID = ?";
+               $statement = WCF::getDB()->prepareStatement($sql);
+               $statement->execute(array($queueID));
+               $row = $statement->fetchArray();
+               
+               return $row['action'];
+       }
+       
        /**
         * Returns data for current node.
         * 
index 3095d13f347ac3bb2cda10681eaf6465ede2dea1..91269a723a00bd88372c989dbb13c25351d26258 100644 (file)
                <item name="wcf.acp.package.installation.step.install"><![CDATA[„{$packageName}“ wird installiert …]]></item>
                <item name="wcf.acp.package.installation.step.install.success"><![CDATA[Installation abgeschlossen]]></item>
                <item name="wcf.acp.package.installation.step.prepare"><![CDATA[Installation wird vorbereitet …]]></item>
+               <item name="wcf.acp.package.installation.step.update"><![CDATA[„{$packageName}“ wird aktualisiert …]]></item>
+               <item name="wcf.acp.package.installation.step.update.success"><![CDATA[Aktualisierung abgeschlossen]]></item>
                <item name="wcf.acp.package.installation.title"><![CDATA[Installation]]></item>
                <item name="wcf.acp.package.installation.requiredVersion"><![CDATA[Benötigte Version]]></item>
                <item name="wcf.acp.package.license"><![CDATA[Lizenz]]></item>
                <item name="wcf.acp.package.update.server"><![CDATA[Paket-Server]]></item>
                <item name="wcf.acp.package.update.server.message"><![CDATA[Servermeldung]]></item>
                <item name="wcf.acp.package.update.server.url"><![CDATA[URL]]></item>
+               <item name="wcf.acp.package.update.title"><![CDATA[Aktualisierung]]></item>
                <item name="wcf.acp.package.update.unauthorized"><![CDATA[Authentifizierung erforderlich]]></item>
                <item name="wcf.acp.package.update.username"><![CDATA[Benutzername]]></item>
                <item name="wcf.acp.package.version"><![CDATA[Version]]></item>
index 42128f8943d7bb9bf8efaf85bfce9780b9d6d317..61a55e851677ab39ad301ee0652efd80f40930e6 100644 (file)
                <item name="wcf.acp.package.installation.step.install"><![CDATA[Installing “{$packageName}” …]]></item>
                <item name="wcf.acp.package.installation.step.install.success"><![CDATA[Installation completed]]></item>
                <item name="wcf.acp.package.installation.step.prepare"><![CDATA[Preparing Installation …]]></item>
+               <item name="wcf.acp.package.installation.step.update"><![CDATA[Updating “{$packageName}” …]]></item>
+               <item name="wcf.acp.package.installation.step.update.success"><![CDATA[Updated completed]]></item>
                <item name="wcf.acp.package.installation.title"><![CDATA[Installation]]></item>
                <item name="wcf.acp.package.installation.requiredVersion"><![CDATA[Required Version]]></item>
                <item name="wcf.acp.package.license"><![CDATA[License]]></item>
                <item name="wcf.acp.package.update.server"><![CDATA[Package Server]]></item>
                <item name="wcf.acp.package.update.server.message"><![CDATA[Server Notice]]></item>
                <item name="wcf.acp.package.update.server.url"><![CDATA[URL]]></item>
+               <item name="wcf.acp.package.update.title"><![CDATA[Update]]></item>
                <item name="wcf.acp.package.update.unauthorized"><![CDATA[Authorization Required]]></item>
                <item name="wcf.acp.package.update.username"><![CDATA[Username]]></item>
                <item name="wcf.acp.package.version"><![CDATA[Version]]></item>