! Large text boxes need converted back to bbc (Subs-Post.php) [Bug 796] ! Removed ?> from end of php files (Many files)
Jeremy D

Jeremy D commited on 2011-10-27 16:13:15
Showing 62 changed files, with 13 additions and 155 deletions.

... ...
@@ -775,4 +775,3 @@ function db_field($name, $type, $size = 0, $unsigned = true, $auto = false)
775 775
 
776 776
 	return $field;
777 777
 }
778
-?>
779 778
\ No newline at end of file
... ...
@@ -477,4 +477,3 @@ $txt['shd_search_ticket_named_person'] = 'Type in the name of the person(s) you
477 477
 $txt['shd_search_no_results'] = 'No results were found with the given criteria. You may wish to go back and try altering your search criteria.';
478 478
 $txt['shd_search_criteria'] = 'Search Criteria:';
479 479
 $txt['shd_search_excluded'] = 'If every possible option was selected, it has not been included in the above (e.g. if all possible levels of urgency were ticked, it is not stated above, so you can concentrate on what is specific to your search)';
480
-?>
481 480
\ No newline at end of file
... ...
@@ -578,4 +578,3 @@ $txt['shd_search_rebuilt'] = 'The search index has been rebuilt.';
578 578
 */
579 579
 $txt['shd_fluffy'] = 'Guardian of the <span %s>cookies</span>';
580 580
 
581
-?>
582 581
\ No newline at end of file
... ...
@@ -139,4 +139,3 @@ $txt['shd_log_unmonitor'] = 'Removed &quot;<a href="{scripturl}?action=helpdesk;
139 139
 $txt['shd_log_ignore'] = 'Added &quot;<a href="{scripturl}?action=helpdesk;sa=ticket;ticket={ticket}">{subject}</a>&quot; to their do-not-notify (ignore) list.';
140 140
 $txt['shd_log_unignore'] = 'Removed &quot;<a href="{scripturl}?action=helpdesk;sa=ticket;ticket={ticket}">{subject}</a>&quot; from their do-not-notify (ignore) list.';
141 141
 //@}
142
-?>
143 142
\ No newline at end of file
... ...
@@ -82,4 +82,3 @@ $txt['shd_ping_n'] = 'You can send an email to these people on replying:';
82 82
 $txt['shd_ping_none_1'] = 'The following person has notifications turned off for this ticket, though you can send them an email about it if it is important:';
83 83
 $txt['shd_ping_none_n'] = 'The following people have notifications turned off for this ticket, though you can send them an email about it if it is important:';
84 84
 
85
-?>
86 85
\ No newline at end of file
... ...
@@ -378,4 +378,3 @@ $txt['shd_no_role_name'] = 'You did not enter the name of your new role.';
378 378
 $txt['shd_could_not_create_role'] = 'There was an error creating the role, please contact SimpleDesk.net for further support.';
379 379
 $txt['shd_unknown_role'] = 'That role does not exist.';
380 380
 //@}
381
-?>
382 381
\ No newline at end of file
... ...
@@ -174,4 +174,3 @@ $txt['shd_acct_information'] = 'Account Information';
174 174
 $txt['shd_replies_per_page'] = 'Replies to display per page';
175 175
 $txt['shd_per_page_default'] = 'Helpdesk default';
176 176
 
177
-?>
178 177
\ No newline at end of file
... ...
@@ -79,4 +79,3 @@ $txt['whoall_helpdesk_topictoticket'] = 'Moving a forum topic to a helpdesk tick
79 79
 $txt['whoall_helpdesk_topictoticket2'] = 'Moving a forum topic to a helpdesk ticket.';
80 80
 //@}
81 81
 
82
-?>
83 82
\ No newline at end of file
... ...
@@ -37,4 +37,3 @@ $txt['shdp_frontpage_content'] = 'Main content';
37 37
 
38 38
 $txt['shdp_tickets'] = 'Tickets';
39 39
 
40
-?>
41 40
\ No newline at end of file
... ...
@@ -267,4 +267,3 @@ function shd_frontpage_boardindex()
267 267
 	}
268 268
 }
269 269
 
270
-?>
271 270
\ No newline at end of file
... ...
@@ -81,4 +81,3 @@ function shdplugin_front_page()
81 81
 }
82 82
 
83 83
 
84
-?>
85 84
\ No newline at end of file
... ...
@@ -13,4 +13,3 @@ if (file_exists(dirname(dirname(dirname(__FILE__))) . '/Settings.php'))
13 13
 else
14 14
 	exit;
15 15
 
16
-?>
17 16
\ No newline at end of file
... ...
@@ -116,4 +116,3 @@ function template_shd_frontpage_admin()
116 116
 	// ]]></script>';
117 117
 }
118 118
 
119
-?>
120 119
\ No newline at end of file
... ...
@@ -13,4 +13,3 @@ if (file_exists(dirname(dirname(dirname(__FILE__))) . '/Settings.php'))
13 13
 else
14 14
 	exit;
15 15
 
16
-?>
17 16
\ No newline at end of file
... ...
@@ -918,4 +918,3 @@ function shd_do_important()
918 918
 	die(base64_decode('PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjAgVHJhbnNpdGlvbmFsLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSL3hodG1sMS9EVEQveGh0bWwxLXRyYW5zaXRpb25hbC5kdGQiPjxodG1sIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hodG1sIj48aGVhZD48dGl0bGU+Rmx1ZmZ5IC0gR3VhcmRpYW4gb2YgdGhlIGNvb2tpZXo8L3RpdGxlPjxtZXRhIGh0dHAtZXF1aXY9IkNvbnRlbnQtVHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04IiAvPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Ym9keXtiYWNrZ3JvdW5kOnB1cnBsZTtjb2xvcjp3aGl0ZTtmb250LXNpemU6MzBweDt0ZXh0LWFsaWduOmNlbnRlcjt9PC9zdHlsZT48L2hlYWQ+PGJvZHk+PGltZyBzcmM9Imh0dHA6Ly93d3cuc2ltcGxlZGVzay5uZXQvaW1hZ2VzL3NpdGUvZ3VhcmRkb2c0MDMuanBnIiBhbHQ9IiIgb25jbGljaz0iYWxlcnQoJ1dhcm5pbmc6IEhlIG1heSBiaXRlIScpIi8+PGJyIC8+PGJyIC8+PHN0cm9uZz5GbHVmZnk8L3N0cm9uZz4gc2VlcyB5b3UuIEZsdWZmeSB3aWxsIHByb3RlY3Qgb3VyIGNhbmR5IDxzdHJvbmc+Zm9yIGV2ZXI8L3N0cm9uZz4uIEZsdWZmeSBpcyB0aGUgPHN0cm9uZz5ndWFyZGlhbjwvc3Ryb25nPiBvZiB0aGUgPHN0cm9uZz5jb29raWVzPC9zdHJvbmc+LiBCZSBhd2FyZS48L2JvZHk+PC9odG1sPg==')); // It will be done, my lord.
919 919
 }
920 920
 
921
-?>
922 921
\ No newline at end of file
... ...
@@ -913,4 +913,3 @@ function shd_admin_canned_movereplycat()
913 913
 	}
914 914
 }
915 915
 
916
-?>
917 916
\ No newline at end of file
... ...
@@ -716,4 +716,3 @@ function shd_admin_cf_change_types($from_type)
716 716
 	}
717 717
 }
718 718
 
719
-?>
720 719
\ No newline at end of file
... ...
@@ -531,4 +531,3 @@ function shd_get_dept_theme_list()
531 531
 	$smcFunc['db_free_result']($request);
532 532
 }
533 533
 
534
-?>
535 534
\ No newline at end of file
... ...
@@ -1123,4 +1123,3 @@ function shd_return_exclude_regex($source)
1123 1123
 
1124 1124
 	return $exclude_regex;
1125 1125
 }
1126
-?>
1127 1126
\ No newline at end of file
... ...
@@ -733,4 +733,3 @@ function shd_load_role($loadrole = 0)
733 733
 	$smcFunc['db_free_result']($query);
734 734
 }
735 735
 
736
-?>
737 736
\ No newline at end of file
... ...
@@ -379,4 +379,3 @@ function shd_list_hooks()
379 379
 
380 380
 	return $hooks;
381 381
 }
382
-?>
383 382
\ No newline at end of file
... ...
@@ -833,4 +833,3 @@ function shd_format_notify_name(&$user_name, $user_id, $ticket_starter)
833 833
 	$user_name = shd_profile_link($user_name, $user_id) . ($user_id == $ticket_starter ? $txt['shd_is_ticket_opener'] : '');
834 834
 }
835 835
 
836
-?>
837 836
\ No newline at end of file
... ...
@@ -377,4 +377,3 @@ function shd_get_possible_assignees($private = false, $ticket_owner = 0, $dept =
377 377
 	// spit back the list of staff members who can see any ticket (+private if dealt with)
378 378
 	return array_intersect($staff, $visible);
379 379
 }
380
-?>
381 380
\ No newline at end of file
... ...
@@ -687,4 +687,3 @@ function shd_reply_restore()
687 687
 	redirectexit('action=helpdesk;sa=ticket;ticket=' . $context['ticket_id']);
688 688
 }
689 689
 
690
-?>
691 690
\ No newline at end of file
... ...
@@ -1344,4 +1344,3 @@ function shd_load_relationships($ticket = 0)
1344 1344
 	$smcFunc['db_free_result']($query);
1345 1345
 }
1346 1346
 
1347
-?>
1348 1347
\ No newline at end of file
... ...
@@ -435,4 +435,3 @@ function shd_ticket_relation()
435 435
 	redirectexit('action=helpdesk;sa=ticket;ticket=' . $context['ticket_id']);
436 436
 }
437 437
 
438
-?>
439 438
\ No newline at end of file
... ...
@@ -324,4 +324,3 @@ function shd_movedept2()
324 324
 		fatal_lang_error('shd_no_perm_move_dept', false);
325 325
 }
326 326
 
327
-?>
328 327
\ No newline at end of file
... ...
@@ -838,4 +838,3 @@ function shd_get_visible_list($dept, $private, $ticket_starter = 0, $include_adm
838 838
 	return $people;
839 839
 }
840 840
 
841
-?>
842 841
\ No newline at end of file
... ...
@@ -2100,4 +2100,3 @@ function shd_load_canned_replies()
2100 2100
 	}
2101 2101
 }
2102 2102
 
2103
-?>
2104 2103
\ No newline at end of file
... ...
@@ -796,4 +796,3 @@ function shd_profile_theme_wrapper($memID)
796 796
 	$context['profile_fields']['theme_settings']['callback_func'] = 'shd_theme_settings';
797 797
 }
798 798
 
799
-?>
800 799
\ No newline at end of file
... ...
@@ -323,4 +323,3 @@ function ssi_staffMembers($honour_admin_setting = true, $output_method = 'echo')
323 323
 	return $query_members;
324 324
 }
325 325
 
326
-?>
327 326
\ No newline at end of file
... ...
@@ -236,4 +236,3 @@ function shd_scheduled_purge_tickets()
236 236
 	// 4.6. Log everything.
237 237
 }
238 238
 
239
-?>
240 239
\ No newline at end of file
... ...
@@ -507,4 +507,3 @@ function shd_get_named_people($field)
507 507
 	}
508 508
 	return array_unique($members);
509 509
 }
510
-?>
511 510
\ No newline at end of file
... ...
@@ -1287,4 +1287,3 @@ function shd_topictoticket2()
1287 1287
 	redirectexit('action=helpdesk;sa=ticket;ticket=' . $ticket);
1288 1288
 }
1289 1289
 
1290
-?>
1291 1290
\ No newline at end of file
... ...
@@ -127,4 +127,3 @@ function shd_unread_posts()
127 127
 	$context['shd_unread_actions'][$_REQUEST['action']][1]();
128 128
 }
129 129
 
130
-?>
131 130
\ No newline at end of file
... ...
@@ -1398,4 +1398,3 @@ function shd_get_block_columns($block)
1398 1398
 			return array();
1399 1399
 	}
1400 1400
 }
1401
-?>
1402 1401
\ No newline at end of file
... ...
@@ -2015,4 +2015,3 @@ function shd_main_menu_admin($helpdesk_admin)
2015 2015
 	);
2016 2016
 }
2017 2017
 // Cause IE is being mean to meeee again...!
2018
-?>
2019 2018
\ No newline at end of file
... ...
@@ -577,4 +577,3 @@ function shd_admin_smf_perms(&$permissionGroups, &$permissionList, &$leftPermiss
577 577
 
578 578
 	$hiddenPermissions = array_merge($hiddenPermissions, $perms_disable);
579 579
 }
580
-?>
581 580
\ No newline at end of file
... ...
@@ -303,4 +303,3 @@ function shd_get_unread_departments()
303 303
 	}
304 304
 }
305 305
 
306
-?>
307 306
\ No newline at end of file
... ...
@@ -696,4 +696,3 @@ function shd_groups_allowed_to($permission, $dept = 0)
696 696
 
697 697
 	return $member_groups;
698 698
 }
699
-?>
700 699
\ No newline at end of file
... ...
@@ -78,7 +78,7 @@ if (!defined('SMF'))
78 78
  */
79 79
 function shd_create_ticket_post(&$msgOptions, &$ticketOptions, &$posterOptions)
80 80
 {
81
-	global $user_info, $txt, $modSettings, $smcFunc, $context, $user_profile, $sourcedir;
81
+	global $user_info, $txt, $modSettings, $smcFunc, $context, $user_profile;
82 82
 
83 83
 	// Clean them incoming vars up good 'n' proper
84 84
 	$msgOptions['smileys_enabled'] = !empty($msgOptions['smileys_enabled']);
... ...
@@ -365,42 +365,6 @@ function shd_create_ticket_post(&$msgOptions, &$ticketOptions, &$posterOptions)
365 365
 		$smcFunc['db_free_result']($query);
366 366
 	}
367 367
 
368
-	if (empty($context['shd_no_search']))
369
-	{
370
-		// Add words to the tables.
371
-		require_once($sourcedir . '/sd_source/Subs-SimpleDeskSearch.php');
372
-		$words = shd_tokeniser($msgOptions['body']);
373
-		if (!empty($words))
374
-		{
375
-			$rows = array();
376
-			foreach ($words as $word)
377
-				$rows[] = array($word, $msgOptions['id']);
378
-			$smcFunc['db_insert']('replace',
379
-				'{db_prefix}helpdesk_search_ticket_words',
380
-				array('id_word' => 'string', 'id_msg' => 'int'),
381
-				$rows,
382
-				array('id_word', 'id_msg')
383
-			);
384
-		}
385
-
386
-		if ($new_ticket)
387
-		{
388
-			$words = shd_tokeniser($ticketOptions['subject']);
389
-			if (!empty($words))
390
-			{
391
-				$rows = array();
392
-				foreach ($words as $word)
393
-					$rows[] = array($word, $ticketOptions['id']);
394
-				$smcFunc['db_insert']('replace',
395
-					'{db_prefix}helpdesk_search_subject_words',
396
-					array('id_word' => 'string', 'id_ticket' => 'int'),
397
-					$rows,
398
-					array('id_word', 'id_ticket')
399
-				);
400
-			}
401
-		}
402
-	}
403
-
404 368
 	if (!empty($ticketOptions['dept']))
405 369
 		shd_clear_active_tickets($ticketOptions['dept']);
406 370
 
... ...
@@ -452,7 +416,7 @@ function shd_create_ticket_post(&$msgOptions, &$ticketOptions, &$posterOptions)
452 416
 */
453 417
 function shd_modify_ticket_post(&$msgOptions, &$ticketOptions, &$posterOptions)
454 418
 {
455
-	global $user_info, $txt, $modSettings, $smcFunc, $context, $sourcedir;
419
+	global $user_info, $txt, $modSettings, $smcFunc, $context;
456 420
 
457 421
 	$messages_columns = array();
458 422
 	$ticket_columns = array();
... ...
@@ -689,60 +653,6 @@ function shd_modify_ticket_post(&$msgOptions, &$ticketOptions, &$posterOptions)
689 653
 		);
690 654
 	}
691 655
 
692
-	if (empty($context['shd_no_search']) && !empty($msgOptions['id']))
693
-	{
694
-		// Clear the original entries.
695
-		$smcFunc['db_query']('', '
696
-			DELETE FROM {db_prefix}helpdesk_search_ticket_words
697
-			WHERE id_msg = {int:msg}',
698
-			array(
699
-				'msg' => $msgOptions['id'],
700
-			)
701
-		);
702
-		// Add words to the tables.
703
-		require_once($sourcedir . '/sd_source/Subs-SimpleDeskSearch.php');
704
-		if (!empty($msgOptions['body']))
705
-		{
706
-			$words = shd_tokeniser($msgOptions['body']);
707
-			if (!empty($words))
708
-			{
709
-				$rows = array();
710
-				foreach ($words as $word)
711
-					$rows[] = array($word, $msgOptions['id']);
712
-				$smcFunc['db_insert']('replace',
713
-					'{db_prefix}helpdesk_search_ticket_words',
714
-					array('id_word' => 'string', 'id_msg' => 'int'),
715
-					$rows,
716
-					array('id_word', 'id_msg')
717
-				);
718
-			}
719
-		}
720
-
721
-		if (isset($ticketOptions['subject']))
722
-		{
723
-			$smcFunc['db_query']('', '
724
-				DELETE FROM {db_prefix}helpdesk_search_subject_words
725
-				WHERE id_ticket = {int:ticket}',
726
-				array(
727
-					'ticket' => $ticketOptions['id'],
728
-				)
729
-			);
730
-			$words = shd_tokeniser($ticketOptions['subject']);
731
-			if (!empty($words))
732
-			{
733
-				$rows = array();
734
-				foreach ($words as $word)
735
-					$rows[] = array($word, $ticketOptions['id']);
736
-				$smcFunc['db_insert']('replace',
737
-					'{db_prefix}helpdesk_search_subject_words',
738
-					array('id_word' => 'string', 'id_ticket' => 'int'),
739
-					$rows,
740
-					array('id_word', 'id_ticket')
741
-				);
742
-			}
743
-		}
744
-	}
745
-
746 656
 	// Int hook
747 657
 	call_integration_hook('shd_hook_modpost', array(&$msgOptions, &$ticketOptions, &$posterOptions));
748 658
 
... ...
@@ -829,7 +739,7 @@ function shd_get_urgency_options($self_ticket = false, $dept = 0)
829 739
 */
830 740
 function shd_load_custom_fields($is_ticket = true, $ticketContext = 0, $dept = 0)
831 741
 {
832
-	global $context, $smcFunc;
742
+	global $sourcedir, $context, $smcFunc;
833 743
 
834 744
 	$field_values = array();
835 745
 	if (!empty($ticketContext))
... ...
@@ -937,6 +847,15 @@ function shd_load_custom_fields($is_ticket = true, $ticketContext = 0, $dept = 0
937 847
 		{
938 848
 			if ($context['ticket_form']['custom_fields'][$loc][$row['id_field']]['type'] == CFIELD_TYPE_MULTI)
939 849
 				$field_values[$row['id_field']] = explode(',', $field_values[$row['id_field']]);
850
+
851
+			// Large text boxes may need fixing.
852
+			if ($context['ticket_form']['custom_fields'][$loc][$row['id_field']]['type'] == CFIELD_TYPE_LARGETEXT)
853
+			{
854
+				require_once($sourcedir . '/Subs-Editor.php');
855
+
856
+				$field_values[$row['id_field']] = html_to_bbc($field_values[$row['id_field']]);
857
+			}
858
+
940 859
 			$context['ticket_form']['custom_fields'][$loc][$row['id_field']]['value'] = $field_values[$row['id_field']];
941 860
 		}
942 861
 	}
... ...
@@ -1081,4 +1000,3 @@ function shd_get_postable_depts()
1081 1000
 		}
1082 1001
 	}
1083 1002
 }
1084
-?>
1085 1003
\ No newline at end of file
... ...
@@ -137,4 +137,3 @@ function shd_hash($string)
137 137
 	return sprintf('%0.0f', hexdec(substr(sha1($string), -13)));
138 138
 }
139 139
 
140
-?>
141 140
\ No newline at end of file
... ...
@@ -13,4 +13,3 @@ if (file_exists(dirname(dirname(dirname(__FILE__))) . '/Settings.php'))
13 13
 else
14 14
 	exit;
15 15
 
16
-?>
17 16
\ No newline at end of file
... ...
@@ -745,4 +745,3 @@ function template_shd_nojs_below()
745 745
 {
746 746
 
747 747
 }
748
-?>
749 748
\ No newline at end of file
... ...
@@ -301,4 +301,3 @@ function template_shd_move_reply_cat()
301 301
 				<span class="lowerframe"><span></span></span>';
302 302
 }
303 303
 
304
-?>
305 304
\ No newline at end of file
... ...
@@ -418,4 +418,3 @@ function template_shd_custom_field_edit()
418 418
 				</form>';
419 419
 }
420 420
 
421
-?>
422 421
\ No newline at end of file
... ...
@@ -296,4 +296,3 @@ function template_shd_edit_dept()
296 296
 				<br class="clear" />';
297 297
 }
298 298
 
299
-?>
300 299
\ No newline at end of file
... ...
@@ -347,4 +347,3 @@ function template_shd_admin_maint_search()
347 347
 		<span class="lowerframe"><span></span></span><br />';
348 348
 }
349 349
 
350
-?>
351 350
\ No newline at end of file
... ...
@@ -585,4 +585,4 @@ function template_shd_copy_role()
585 585
 				</div>
586 586
 				<span class="lowerframe"><span></span></span>';
587 587
 }
588
-?>
588
+
... ...
@@ -138,4 +138,3 @@ function template_shd_plugin_listing()
138 138
 	// ]]></script>';
139 139
 }
140 140
 
141
-?>
142 141
\ No newline at end of file
... ...
@@ -82,4 +82,3 @@ function template_assign()
82 82
 	<span class="lowerframe"><span></span></span>';
83 83
 }
84 84
 
85
-?>
86 85
\ No newline at end of file
... ...
@@ -1158,4 +1158,3 @@ function template_shd_display_nojs_below()
1158 1158
 
1159 1159
 }
1160 1160
 
1161
-?>
1162 1161
\ No newline at end of file
... ...
@@ -94,4 +94,3 @@ function template_movedept()
94 94
 	<span class="lowerframe"><span></span></span>';
95 95
 }
96 96
 
97
-?>
98 97
\ No newline at end of file
... ...
@@ -960,4 +960,3 @@ function template_shd_post_nojs_below()
960 960
 
961 961
 }
962 962
 
963
-?>
964 963
\ No newline at end of file
... ...
@@ -886,4 +886,3 @@ function template_profile_shd_theme_settings()
886 886
 							<dd></dd>';
887 887
 }
888 888
 
889
-?>
890 889
\ No newline at end of file
... ...
@@ -354,4 +354,3 @@ function template_search_results()
354 354
 				$use_bg2 = !$use_bg2;
355 355
 	}
356 356
 }
357
-?>
358 357
\ No newline at end of file
... ...
@@ -301,4 +301,3 @@ function template_shd_topictoticket()
301 301
 		<span class="lowerframe"><span></span></span>';
302 302
 }
303 303
 
304
-?>
305 304
\ No newline at end of file
... ...
@@ -85,4 +85,3 @@ function template_shd_unread_below()
85 85
 				</div>';
86 86
 }
87 87
 
88
-?>
89 88
\ No newline at end of file
... ...
@@ -654,4 +654,3 @@ if (!function_exists('template_button_strip'))
654 654
 	{
655 655
 	}
656 656
 }
657
-?>
658 657
\ No newline at end of file
... ...
@@ -13,4 +13,3 @@ if (file_exists(dirname(dirname(dirname(__FILE__))) . '/Settings.php'))
13 13
 else
14 14
 	exit;
15 15
 
16
-?>
17 16
\ No newline at end of file
... ...
@@ -136,4 +136,3 @@ updateSettings(array(
136 136
 	'settings_updated' => time(),
137 137
 ));
138 138
 
139
-?>
140 139
\ No newline at end of file
... ...
@@ -135,4 +135,3 @@ $smcFunc['db_query']('', '
135 135
 	)
136 136
 );
137 137
 
138
-?>
139 138
\ No newline at end of file
140 139