summaryrefslogtreecommitdiff
path: root/templates/install_upgrade.tpl
blob: d9ebf0e4c967fe7255b9a5477baca1865355622f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<h1>Upgrade Packages</h1>

{jstabs tab=0}
	{jstab title="Available Upgrades"}
		{form id="package_select" legend="Packages that will be upgraded" id="package_select"}
			<input type="hidden" name="step" value="{$next_step}" />

			{if $packageUpgrades}
				<h2>Packages and their upgrades</h2>
				<p class="danger">You are about to run an upgrade which might make changes to your database. We <strong>strongly</strong> recommend that you back up your database (preferably carry out the entire <a class="external" href="http://www.bitweaver.org/wiki/bitweaverUpgrade#Generalproceduretoupgrade">backup procedure</a>).</p>
				{foreach from=$packageUpgrades item=upgrade key=package}
					{* users don't have the option to select what packages to upgrade since the code of the package is dependent on this upgrade
					<h3><label><input type="checkbox" name="packages[]" value="{$package}" checked="checked" /> {$package}</label></h3> *}

					<h3>{$package}</h3>
					<input type="hidden" name="packages[]" value="{$package}" />
					<dl>
						<dt>{$gBitSystem->getVersion($package)}</dt>
						<dd><small>Currently installed version</small></dd>
						{foreach from=$upgrade item=data key=version}
							<dt>{$data.version}</dt>
							<dd>{$data.description}</dd>
							{if $errors.$package.$version}
								<p class="error">SQL errors that occurred during the {$version} upgrade:<br />
									<kbd>
										{if $errors.$package.$version.failedcommands}
											{foreach from=$errors.$package.$version.failedcommands item=command}
												{$command}<br />
											{/foreach}
										{/if}
									</kbd>
								</p>
							{/if}
						{/foreach}
					</dl>
				{/foreach}

				{if $errors}
					<p class="danger">The upgrade process was halted due to the SQL problems listed above. Please contact the bitweaver team to fix this issue.</p>
				{/if}
			{elseif !$success}
				<p class="success">Seems all installed packages are up to date!</p>
			{/if}

			{if $success}
				<h2>Post Install Notes</h2>
				<p class="success">Some packages were successfully updated which might have important post upgrade notes.</p>
				<dl>
					{foreach from=$success item=upgrade key=package}
						{foreach from=$upgrade item=data key=version}
							{if $data.post_upgrade}
								<dt>{$package}</dt>
								<dd>
									Upgrade &rarr; {$version}<br />
									<strong>Post install notes</strong><br />
									{$data.post_upgrade}
								</dd>
							{/if}
						{/foreach}
					{/foreach}
				</dl>
			{/if}

			{if $requirementsMap}
				<h2>Requirements Graph</h2>
				<p class="help">Below you will find an illustration of how packages will depend on each other after the upgrade has been completed.</p>
				<div style="text-align:center; overflow:auto;">
					<img alt="A graphical representation of package requirements" title="Requirements graph" src="{$smarty.const.KERNEL_PKG_URL}requirements_graph.php?format={$smarty.request.format}&amp;command={$smarty.request.command}" usemap="#Requirements" />
					{$requirementsMap}
				</div>
			{/if}

			{if $requirements}
				<h2>Requirements Table</h2>
				<p class="help">Below you will find a detailed table with package requirements after the upgrade has completed successfully. If not all package requirements are met, consider trying to meet all package requirements. If you don't meet them, you may continue at your own peril.</p>
				<table id="requirements">
					<caption>Package Requirements</caption>
					<tr>
						<th style="width:16%;">Requirement</th>
						<th style="width:16%;">Min Version</th>
						<th style="width:16%;">Max Version</th>
						<th style="width:16%;">Available</th>
						<th style="width:36%;">Result</th>
					</tr>
					{foreach from=$requirements item=dep}
						{if $pkg != $dep.package}
							<tr><th colspan="5">{$dep.package|ucfirst} requirements</th></tr>
							{assign var=pkg value=$dep.package}
						{/if}

						{if $dep.result == 'ok'}
							{assign var=class value=success}
						{elseif $dep.result == 'missing'}
							{assign var=class value=error}
						{elseif $dep.result == 'min_dep'}
							{assign var=class value=error}
						{else}
							{assign var=class value=warning}
						{/if}

						<tr class="{$class}">
							<td>{$dep.requires|ucfirst}</td>
							<td>{$dep.required_version.min}</td>
							<td>{$dep.required_version.max}</td>
							<td>{$dep.version.available}</td>
							<td>
								{if $dep.result == 'ok'}
									OK
								{elseif $dep.result == 'missing'}
									Package missing
									{assign var=missing value=true}
								{elseif $dep.result == 'min_dep'}
									Minimum version not met
									{assign var=min_dep value=true}
								{elseif $dep.result == 'max_dep'}
									Maximum version exceeded
									{assign var=max_dep value=true}
								{elseif $dep.result == 'inactive'}
									Package disabled
									{assign var=inactive value=true}
								{else}
									Unknown state
									{assign var=confused value=true}
								{/if}
							</td>
						</tr>
					{/foreach}
				</table>

				{if $missing}
					<p class="warning">At least one required package is missing. Please install that package before proceeding with the upgrade.</p>
				{/if}

				{if $min_dep}
					<p class="warning">At least one package did not meet the minimum version requirement in our calculations. If possible, please get a newer version of those packages and upgrade them as well.</p>
				{/if}

				{if $max_dep}
					<p class="warning">At least one package recommend a version lower to the one you have installed or are about to upgrade to. The package you wish to upgrade might work with this combination, but no guarantees can be given.</p>
				{/if}

				{if $inactive}
					<p class="warning">At least one required package is disabled. Please activate that package once your install is complete.</p>
				{/if}

				{if $confused}
					<p class="warning">At least one required package is in an unknown state. The upgrade may not work because of this. It is probably worth reinstalling the latest version of that package or contacting its developer.</p>
				{/if}

				{if !$min_dep && !$max_dep && !$missing}
					<p class="success">All package requirements have been met. You can proceed with the installation process.</p>
				{/if}
			{/if}

			<div class="row submit">
				<input type="submit" name="upgrade_packages" value="Upgrade Packages" />
			</div>

			<div class="row">
				{forminput}
					<label><input type="checkbox" name="debug" value="true" /> Debug mode</label>
					{formhelp note="Display SQL statements."}
				{/forminput}
			</div>
		{/form}
	{/jstab}

	{jstab title="Installed Packages"}
		{legend legend="Already Installed Packages"}
			{foreach from=$schema key=package item=item}
				{if $item.installed}
					<div class="row">
						<div class="formlabel">
							<label for="{$package}">{biticon ipackage=$package iname="pkg_$package" iexplain=`$package`}</label>
						</div>
						{forminput}
							<strong>{$package|capitalize}</strong>
							{formhelp note=`$item.info`}
							{formhelp note="<strong>Location</strong>: `$item.url`"}
							{formhelp package=$package}
						{/forminput}
					</div>
				{/if}
			{/foreach}
		{/legend}
	{/jstab}
{/jstabs}