Updates handling of required packages
authorMatthias Schmidt <gravatronics@live.com>
Sat, 14 Jul 2012 18:51:24 +0000 (20:51 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 14 Jul 2012 18:51:24 +0000 (20:51 +0200)
wcfsetup/install/files/acp/templates/packageInstallationConfirm.tpl
wcfsetup/install/files/lib/system/package/PackageArchive.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 591f945cd9343817252a343b5930941d4a9d2553..dfaeea03023ea10ec92e0121fb83ffbe10d1f529 100644 (file)
                        <thead>
                                <tr>
                                        <th class="columnTitle">{lang}wcf.acp.package.name{/lang}</th>
-                                       <th class="columnDigits">{lang}wcf.acp.package.version{/lang}</th>
+                                       <th class="columnText">{lang}wcf.acp.package.installation.packageStatus{/lang}</th>
+                                       <th class="columnDigits">{lang}wcf.acp.package.installation.requiredVersion{/lang}</th>
                                </tr>
                        </thead>
                        
                        <tbody>
                        {foreach from=$requiredPackages item=$package}
                                <tr>
-                                       <td class="columnTitle"><p>{lang}wcf.acp.package.installation.packageName{/lang}</p></td>
-                                       <td class="columnDigits"><p>{if $package.minversion|isset}{$package.minversion}{/if}</p></td>
+                                       <td class="columnTitle"><p><span class="badge label {if $package.status == 'installed'}green{elseif $package.status == 'delivered'}yellow{else}red{/if}">{@$package.name}</span></p></td>
+                                       <td class="columnText"><p>{lang}wcf.acp.package.installation.packageStatus.{@$package.status}{/lang}</p></td>
+                                       <td class="columnDigits"><p>{if $package.minversion|isset}{if $package.status == 'missingVersion'}<span class="badge label red">{/if}{$package.minversion}{if $package.status == 'missingVersion'}</span>{/if}{/if}</p></td>
                                </tr>
                        {/foreach}
                        </tbody>
index ee93a50e7bfb1ed855ba74743c4dd83185710a58..1d6243cbd56f4b5e0340ac70b6d3ea9f844012fd 100644 (file)
@@ -730,9 +730,17 @@ class PackageArchive {
                        if (isset($existingPackages[$requirement['name']])) {
                                // package does already exist
                                // maybe an update is necessary
-                               if (!isset($requirement['minversion']) || Package::compareVersion($existingPackages[$requirement['name']]['packageVersion'], $requirement['minversion']) >= 0) {
-                                       // package does already exist in needed version
-                                       // skip installation of requirement 
+                               if (isset($requirement['minversion'])) {
+                                       if (Package::compareVersion($existingPackages[$requirement['name']]['packageVersion'], $requirement['minversion']) >= 0) {
+                                               // package does already exist in needed version
+                                               // skip installation of requirement 
+                                               continue;
+                                       }
+                                       else {
+                                               $requirement['existingVersion'] = $existingPackages[$requirement['name']]['packageVersion'];
+                                       }
+                               }
+                               else {
                                        continue;
                                }
                                
index deba10762ae0e1512c104c4f194a960bb33d8800..f81ab4359e5d73d3b0adb03311f3cd4155572e85 100644 (file)
@@ -716,12 +716,22 @@ class PackageInstallationDispatcher {
                $missingPackages = 0;
                foreach ($requirements as $key => $requirement) {
                        if (isset($openRequirements[$requirement['name']])) {
-                               $requirements[$key]['open'] = 1;
+                               $requirements[$key]['status'] = 'missing';
                                $requirements[$key]['action'] = $openRequirements[$requirement['name']]['action'];
-                               if (!isset($requirements[$key]['file'])) $missingPackages++;
+                               
+                               if (!isset($requirements[$key]['file'])) {
+                                       if ($openRequirements[$requirement['name']]['action'] === 'update') {
+                                               $requirements[$key]['status'] = 'missingVersion';
+                                               $requirements[$key]['existingVersion'] = $openRequirements[$requirement['name']]['existingVersion'];
+                                       }
+                                       $missingPackages++;
+                               }
+                               else {
+                                       $requirements[$key]['status'] = 'delivered';
+                               }
                        }
                        else {
-                               $requirements[$key]['open'] = 0;
+                               $requirements[$key]['status'] = 'installed';
                        }
                }
                
index 7ee1e8255ae1cd0441ec5c67e193baada2dde4b8..4c5266d97a8076b57e3a4db51794b6071b0f35c7 100644 (file)
                <item name="wcf.acp.package.information.properties"><![CDATA[Eigenschaften]]></item>
                <item name="wcf.acp.package.information.title"><![CDATA[Informationen]]></item>
                <item name="wcf.acp.package.installDate"><![CDATA[Installationsdatum]]></item>
+               <item name="wcf.acp.package.installation.packageStatus"><![CDATA[Status]]></item>
+               <item name="wcf.acp.package.installation.packageStatus.delivered"><![CDATA[vom Paket bereitgestellt]]></item>
+               <item name="wcf.acp.package.installation.packageStatus.installed"><![CDATA[bereits installiert]]></item>
+               <item name="wcf.acp.package.installation.packageStatus.missing"><![CDATA[fehlt]]></item>
+               <item name="wcf.acp.package.installation.packageStatus.missingVersion"><![CDATA[fehlende Paket-Version (installierte Version: {$package.existingVersion})]]></item>
                <item name="wcf.acp.package.installation.step.install"><![CDATA[&bdquo;{$packageName}&ldquo; wird installiert &hellip;]]></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 &hellip;]]></item>
-               <item name="wcf.acp.package.installation.packageName"><![CDATA[<span class="badge label {if $package.open == 0}green{elseif $package.file|isset}yellow{else}red{/if}" title="{if $package.open == 0}ist bereits installiert{elseif $package.file|isset}liegt dem Paket bei{else}fehlt{/if}" class="jsTooltip">{$package.name}</span>]]></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.list"><![CDATA[Paketliste]]></item>
                <item name="wcf.acp.package.list.detailed"><![CDATA[Detaillierte Paketliste]]></item>
                <item name="wcf.acp.package.name"><![CDATA[Paket]]></item>
index e1a7155267e8af2a6940b85984121648e714d33f..ff184f20fe47887e4e43e16670d1da33f1984e5c 100644 (file)
                <item name="wcf.acp.package.information.properties"><![CDATA[Properties]]></item>
                <item name="wcf.acp.package.information.title"><![CDATA[Informations]]></item>
                <item name="wcf.acp.package.installDate"><![CDATA[Installation date]]></item>
+               <item name="wcf.acp.package.installation.packageStatus"><![CDATA[Status]]></item>
+               <item name="wcf.acp.package.installation.packageStatus.delivered"><![CDATA[delivered by the package]]></item>
+               <item name="wcf.acp.package.installation.packageStatus.installed"><![CDATA[already installed]]></item>
+               <item name="wcf.acp.package.installation.packageStatus.missing"><![CDATA[missing]]></item>
+               <item name="wcf.acp.package.installation.packageStatus.missingVersion"><![CDATA[missing package version (installed version: {$package.existingVersion})]]></item>
                <item name="wcf.acp.package.installation.step.install"><![CDATA[Installing &ldquo;{$packageName}&rdquo; &hellip;]]></item>
                <item name="wcf.acp.package.installation.step.install.success"><![CDATA[Installation completed]]></item>
                <item name="wcf.acp.package.installation.step.prepare"><![CDATA[Prepairing installation &hellip;]]></item>
-               <item name="wcf.acp.package.installation.packageName"><![CDATA[<span class="badge label {if $package.open == 0}green{elseif $package.file|isset}yellow{else}red{/if}" title="{if $package.open == 0}is already installed{elseif $package.file|isset}is delivered by this package{else}is missing{/if}" class="jsTooltip">{$package.name}</span>]]></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.list"><![CDATA[Package list]]></item>
                <item name="wcf.acp.package.list.detailed"><![CDATA[Detailed package list]]></item>
                <item name="wcf.acp.package.name"><![CDATA[Package]]></item>