Basic stuff to cover install on a 2.1 alpha 1
emanuele

emanuele commited on 2012-10-25 05:35:24
Showing 6 changed files, with 220 additions and 38 deletions.


Signed-off-by: emanuele <emanuele45@gmail.com>
... ...
@@ -0,0 +1,32 @@
1
+<?xml version="1.0"?>
2
+<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
3
+<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
4
+	<id>SimpleDeskTeam:SimpleDesk</id>
5
+	<version>2.0</version>
6
+
7
+	<file name="$sourcedir/ManagePosts.php"><!-- at the same time we modify the post settings, make sure we check and update SD's if necessary -->
8
+		<operation>
9
+			<search position="before"><![CDATA[$smcFunc['db_change_column']('{db_prefix}messages', 'body', array('type' => 'mediumtext'));]]></search>
10
+			<add><![CDATA[
11
+					$smcFunc['db_change_column']('{db_prefix}helpdesk_ticket_replies', 'body', array('type' => 'mediumtext'));]]></add>
12
+		</operation>
13
+		<operation>
14
+			<search position="before"><![CDATA[$smcFunc['db_change_column']('{db_prefix}messages', 'body', array('type' => 'text'));]]></search>
15
+			<add><![CDATA[
16
+					$smcFunc['db_change_column']('{db_prefix}helpdesk_ticket_replies', 'body', array('type' => 'text'));]]></add>
17
+		</operation>
18
+	</file>
19
+
20
+	<file name="$sourcedir/ManageServer.php"><!-- Language file handling -->
21
+		<operation>
22
+			<search position="after"><![CDATA[	// Check we have themes with a path and a name - just in case - and add the path.]]></search>
23
+			<add><![CDATA[	// Add SimpleDesk to the list of possible places to look.
24
+	$themes['shd'] = array('name' => 'SimpleDesk', 'theme_dir' => $settings['default_theme_dir'] . '/languages/sd_language');
25
+	$lang_dirs['shd'] = $settings['default_theme_dir'] . '/languages/sd_language';
26
+	$themes['shd_plugins'] = array('name' => 'SimpleDesk Plugins', 'theme_dir' => $settings['default_theme_dir'] . '/languages/sd_plugins_lang');
27
+	$lang_dirs['shd_plugins'] = $settings['default_theme_dir'] . '/languages/sd_plugins_lang';
28
+
29
+]]></add>
30
+		</operation>
31
+	</file>
32
+</modification>
0 33
\ No newline at end of file
... ...
@@ -0,0 +1,41 @@
1
+<?xml version="1.0"?>
2
+<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
3
+<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
4
+	<id>SimpleDeskTeam:SimpleDesk</id>
5
+	<version>2.0</version>
6
+
7
+	<file name="$sourcedir/ManageMaintenance.php"><!-- at the same time we modify the post settings, make sure we check and update SD's if necessary -->
8
+		<operation>
9
+			<search position="replace"><![CDATA[
10
+			$smcFunc['db_change_column']('{db_prefix}messages', 'body', array('type' => 'mediumtext'));]]></search>
11
+			<add><![CDATA[
12
+		{
13
+			$smcFunc['db_change_column']('{db_prefix}messages', 'body', array('type' => 'mediumtext'));
14
+			$smcFunc['db_change_column']('{db_prefix}helpdesk_ticket_replies', 'body', array('type' => 'mediumtext'));
15
+		}]]></add>
16
+		</operation>
17
+		<operation>
18
+			<search position="replace"><![CDATA[
19
+			$smcFunc['db_change_column']('{db_prefix}messages', 'body', array('type' => 'text'));]]></search>
20
+			<add><![CDATA[
21
+		{
22
+			$smcFunc['db_change_column']('{db_prefix}messages', 'body', array('type' => 'text'));
23
+			$smcFunc['db_change_column']('{db_prefix}helpdesk_ticket_replies', 'body', array('type' => 'text'));
24
+		}]]></add>
25
+		</operation>
26
+		<!-- @todo: add the check for tickets longer than xxx chars -->
27
+	</file>
28
+
29
+	<file name="$sourcedir/ManageLanguages.php"><!-- Language file handling -->
30
+		<operation>
31
+			<search position="after"><![CDATA[	// Check we have themes with a path and a name - just in case - and add the path.]]></search>
32
+			<add><![CDATA[	// Add SimpleDesk to the list of possible places to look.
33
+	$themes['shd'] = array('name' => 'SimpleDesk', 'theme_dir' => $settings['default_theme_dir'] . '/languages/sd_language');
34
+	$lang_dirs['shd'] = $settings['default_theme_dir'] . '/languages/sd_language';
35
+	$themes['shd_plugins'] = array('name' => 'SimpleDesk Plugins', 'theme_dir' => $settings['default_theme_dir'] . '/languages/sd_plugins_lang');
36
+	$lang_dirs['shd_plugins'] = $settings['default_theme_dir'] . '/languages/sd_plugins_lang';
37
+
38
+]]></add>
39
+		</operation>
40
+	</file>
41
+</modification>
0 42
\ No newline at end of file
... ...
@@ -0,0 +1,55 @@
1
+<?xml version="1.0"?>
2
+<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
3
+<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
4
+	<id>SimpleDeskTeam:SimpleDesk</id>
5
+	<version>2.0</version>
6
+
7
+	<file name="$sourcedir/Packages.php"><!-- Sorts the SD plugin packages into the relevant container. -->
8
+		<operation>
9
+			<search position="before"><![CDATA[$context['modification_types'] = $installed ? array('modification') : array('modification', 'avatar', 'language']]></search>
10
+			<add><![CDATA[, 'sdplugin']]></add>
11
+		</operation>
12
+		<operation>
13
+			<search position="after"><![CDATA[	$context['available_languages'] = array();]]></search>
14
+			<add><![CDATA[	$context['available_sdplugin'] = array();
15
+]]></add>
16
+		</operation>
17
+		<operation>
18
+			<search position="after"><![CDATA[				// Other stuff.
19
+				else
20
+				{
21
+					$sort_id['unknown']++;]]></search>
22
+			<add><![CDATA[				// SimpleDesk Plugins
23
+				elseif ($packageInfo['type'] == 'sdplugin')
24
+				{
25
+					$sort_id['sdplugin']++;
26
+					$packages['sdplugin'][strtolower($packageInfo[$sort])] = md5($package);
27
+					$context['available_sdplugin'][md5($package)] = $packageInfo;
28
+				}
29
+]]></add>
30
+		</operation>
31
+	</file>
32
+
33
+	<file name="$sourcedir/PackageGet.php"><!-- Make the install button available after an upload or a download. Code's the same, just gotta run twice. -->
34
+		<operation>
35
+			<search position="replace"><![CDATA[	if ($context['package']['type'] == 'modification')
36
+		$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=admin;area=packages;sa=install;package=' . $context['package']['filename'] . '">[ ' . $txt['install_mod'] . ' ]</a>';
37
+	elseif ($context['package']['type'] == 'avatar')]]></search>
38
+			<add><![CDATA[	if ($context['package']['type'] == 'modification')
39
+		$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=admin;area=packages;sa=install;package=' . $context['package']['filename'] . '">[ ' . $txt['install_mod'] . ' ]</a>';
40
+	elseif ($context['package']['type'] == 'sdplugin')
41
+		$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=admin;area=packages;sa=install;package=' . $context['package']['filename'] . '">[ ' . $txt['shd_install_plugin'] . ' ]</a>';
42
+	elseif ($context['package']['type'] == 'avatar')]]></add>
43
+		</operation>
44
+		<operation>
45
+			<search position="replace"><![CDATA[	if ($context['package']['type'] == 'modification')
46
+		$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=admin;area=packages;sa=install;package=' . $context['package']['filename'] . '">[ ' . $txt['install_mod'] . ' ]</a>';
47
+	elseif ($context['package']['type'] == 'avatar')]]></search>
48
+			<add><![CDATA[	if ($context['package']['type'] == 'modification')
49
+		$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=admin;area=packages;sa=install;package=' . $context['package']['filename'] . '">[ ' . $txt['install_mod'] . ' ]</a>';
50
+	elseif ($context['package']['type'] == 'sdplugin')
51
+		$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=admin;area=packages;sa=install;package=' . $context['package']['filename'] . '">[ ' . $txt['shd_install_plugin'] . ' ]</a>';
52
+	elseif ($context['package']['type'] == 'avatar')]]></add>
53
+		</operation>
54
+	</file>
55
+</modification>
0 56
\ No newline at end of file
... ...
@@ -172,29 +172,6 @@
172 172
 			<add><![CDATA[	// Ensure we uncache stuff that might change in the helpdesk
173 173
 	shd_clear_active_tickets();
174 174
 
175
-]]></add>
176
-		</operation>
177
-	</file>
178
-
179
-	<file name="$sourcedir/ManagePosts.php"><!-- at the same time we modify the post settings, make sure we check and update SD's if necessary -->
180
-		<operation>
181
-			<search position="before"><![CDATA[$smcFunc['db_change_column']('{db_prefix}messages', 'body', array('type' => 'mediumtext'));]]></search>
182
-			<add><![CDATA[
183
-					$smcFunc['db_change_column']('{db_prefix}helpdesk_ticket_replies', 'body', array('type' => 'mediumtext'));]]></add>
184
-		</operation>
185
-		<operation>
186
-			<search position="before"><![CDATA[$smcFunc['db_change_column']('{db_prefix}messages', 'body', array('type' => 'text'));]]></search>
187
-			<add><![CDATA[
188
-					$smcFunc['db_change_column']('{db_prefix}helpdesk_ticket_replies', 'body', array('type' => 'text'));]]></add>
189
-		</operation>
190
-	</file>
191
-
192
-	<file name="$sourcedir/Who.php"><!-- load the who's online strings... we don't use it much now, but maybe later... -->
193
-		<operation>
194
-			<search position="after"><![CDATA[	// Actions that require a specific permission level.]]></search>
195
-			<add><![CDATA[	shd_load_language('sd_language/SimpleDeskWho');
196
-	shd_load_plugin_langfiles('who');
197
-
198 175
 ]]></add>
199 176
 		</operation>
200 177
 	</file>
... ...
@@ -262,17 +239,4 @@ require_once($sourcedir . '/sd_source/SimpleDesk-SSI.php');]]></add>
262 239
 	}]]></add>
263 240
 		</operation>
264 241
 	</file>
265
-
266
-	<file name="$sourcedir/ManageServer.php"><!-- Language file handling -->
267
-		<operation>
268
-			<search position="after"><![CDATA[	// Check we have themes with a path and a name - just in case - and add the path.]]></search>
269
-			<add><![CDATA[	// Add SimpleDesk to the list of possible places to look.
270
-	$themes['shd'] = array('name' => 'SimpleDesk', 'theme_dir' => $settings['default_theme_dir'] . '/languages/sd_language');
271
-	$lang_dirs['shd'] = $settings['default_theme_dir'] . '/languages/sd_language';
272
-	$themes['shd_plugins'] = array('name' => 'SimpleDesk Plugins', 'theme_dir' => $settings['default_theme_dir'] . '/languages/sd_plugins_lang');
273
-	$lang_dirs['shd_plugins'] = $settings['default_theme_dir'] . '/languages/sd_plugins_lang';
274
-
275
-]]></add>
276
-		</operation>
277
-	</file>
278 242
 </modification>
279 243
\ No newline at end of file
... ...
@@ -16,9 +16,10 @@
16 16
 
17 17
 		<!-- general edits -->
18 18
 		<modification format="xml" type="file">install-xml/install.xml</modification>
19
+		<modification format="xml" type="file">install-xml/install-2.0.xml</modification>
19 20
 		<modification format="xml" type="file">install-xml/install-attachments.xml</modification>
20 21
 		<modification format="xml" type="file">install-xml/install-trackip.xml</modification>
21
-		<modification format="xml" type="file">install-xml/install-packages.xml</modification>
22
+		<modification format="xml" type="file">install-xml/install-packages-2.0.xml</modification>
22 23
 		<modification format="xml" type="file">install-xml/install-parsebbc.xml</modification>
23 24
 
24 25
 		<!-- language files -->
... ...
@@ -63,9 +64,10 @@
63 64
 
64 65
 		<!-- general edits, undone -->
65 66
 		<modification format="xml" type="file" reverse="true">install-xml/install.xml</modification>
67
+		<modification format="xml" type="file" reverse="true">install-xml/install-2.0.xml</modification>
66 68
 		<modification format="xml" type="file" reverse="true">install-xml/install-attachments.xml</modification>
67 69
 		<modification format="xml" type="file" reverse="true">install-xml/install-trackip.xml</modification>
68
-		<modification format="xml" type="file" reverse="true">install-xml/install-packages.xml</modification>
70
+		<modification format="xml" type="file" reverse="true">install-xml/install-packages-2.0.xml</modification>
69 71
 		<modification format="xml" type="file" reverse="true">install-xml/install-parsebbc.xml</modification>
70 72
 
71 73
 		<!-- language files, removed -->
... ...
@@ -94,4 +96,92 @@
94 96
 		<remove-file name="$themedir/scripts/helpdesk-admin.js" />
95 97
 		<remove-file name="$themedir/scripts/helpdesk.js" />
96 98
 	</uninstall>
99
+
100
+	<install for="2.1 alpha 1">
101
+		<!-- readme files -->
102
+		<readme lang="english" parsebbc="true" type="file">language-readme/readme.english.txt</readme>
103
+
104
+		<!-- general edits -->
105
+		<modification format="xml" type="file">install-xml/install.xml</modification>
106
+		<modification format="xml" type="file">install-xml/install-2.1.xml</modification>
107
+		<modification format="xml" type="file">install-xml/install-attachments.xml</modification>
108
+		<modification format="xml" type="file">install-xml/install-trackip.xml</modification>
109
+		<modification format="xml" type="file">install-xml/install-packages-2.1.xml</modification>
110
+		<modification format="xml" type="file">install-xml/install-parsebbc.xml</modification>
111
+
112
+		<!-- language files -->
113
+		<require-dir name="sd_language" destination="$themes_dir/default/languages" />
114
+
115
+		<!-- sources -->
116
+		<require-dir name="sd_source" destination="$sourcedir" />
117
+
118
+		<!-- templates -->
119
+		<require-dir name="sd_template" destination="$themedir" />
120
+
121
+		<!-- images -->
122
+		<require-dir name="images/simpledesk" destination="$themes_dir/default/images" />
123
+		<require-dir name="images/sd_plugins" destination="$themes_dir/default/images" />
124
+		<require-dir name="images/shd" destination="$imagesdir/admin" />
125
+		<require-file name="images/feature_shd.png" destination="$themes_dir/default/images/admin" /><!-- explicitly called from default theme in ACP -->
126
+
127
+		<!-- css -->
128
+		<require-file name="css/helpdesk.css" destination="$themedir/css" />
129
+		<require-file name="css/helpdesk_admin.css" destination="$themedir/css" />
130
+		<require-file name="css/helpdesk_ie6.css" destination="$themedir/css" />
131
+
132
+		<!-- scripts -->
133
+		<require-file name="scripts/helpdesk_admin.js" destination="$themedir/scripts" />
134
+		<require-file name="scripts/helpdesk.js" destination="$themedir/scripts" />
135
+
136
+		<!-- bundled plugins -->
137
+		<require-dir name="sd_plugins_source" destination="$sourcedir" />
138
+		<require-dir name="sd_plugins_template" destination="$themes_dir/default" />
139
+		<require-dir name="sd_plugins_lang" destination="$languagedir" />
140
+
141
+		<!-- database changes -->
142
+		<database>install.php</database>
143
+
144
+		<redirect url="?action=admin;area=corefeatures#js_feature_shd" />
145
+	</install>
146
+
147
+	<uninstall for="2.1 alpha 1">
148
+		<!-- database changes, undone -->
149
+		<database>uninstall-optional.php</database>
150
+		<code type="file">uninstall-required.php</code>
151
+
152
+		<!-- general edits, undone -->
153
+		<modification format="xml" type="file" reverse="true">install-xml/install.xml</modification>
154
+		<modification format="xml" type="file" reverse="true">install-xml/install-2.1.xml</modification>
155
+		<modification format="xml" type="file" reverse="true">install-xml/install-attachments.xml</modification>
156
+		<modification format="xml" type="file" reverse="true">install-xml/install-trackip.xml</modification>
157
+		<modification format="xml" type="file" reverse="true">install-xml/install-packages-2.1.xml</modification>
158
+		<modification format="xml" type="file" reverse="true">install-xml/install-parsebbc.xml</modification>
159
+
160
+		<!-- language files, removed -->
161
+		<remove-dir name="$themes_dir/default/languages/sd_language" />
162
+
163
+		<!-- source files, removed -->
164
+		<remove-dir name="$sourcedir/sd_source" />
165
+
166
+		<!-- template files, removed -->
167
+		<remove-dir name="$themedir/sd_template" />
168
+
169
+		<!-- images, removed -->
170
+		<remove-dir name="$themes_dir/default/images/simpledesk" />
171
+		<remove-dir name="$imagesdir/admin/shd" />
172
+		<remove-file name="$themes_dir/default/images/admin/feature_shd.png" />
173
+
174
+		<!-- css, removed -->
175
+		<remove-file name="$themedir/css/helpdesk.css" />
176
+		<remove-file name="$themedir/css/helpdesk-admin.css" />
177
+		<remove-file name="$themedir/css/helpdesk-ie6.css" />
178
+
179
+		<!-- bundled plugins removed (NOTE: done one by one to avoid eating existing plugins on upgrade) -->
180
+		<remove-dir name="$languagedir/sd_plugin_lang" />
181
+
182
+		<!-- scripts, removed -->
183
+		<remove-file name="$themedir/scripts/helpdesk-admin.js" />
184
+		<remove-file name="$themedir/scripts/helpdesk.js" />
185
+	</uninstall>
186
+
97 187
 </package-info>
98 188
\ No newline at end of file
99 189