Completed
Push — 1.7 ( ce7091...0d97cf )
by Greg
14:14 queued 07:41
created
app/Module/IndividualReportModule.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,15 +22,18 @@  discard block
 block discarded – undo
22 22
 /**
23 23
  * Class IndividualReportModule
24 24
  */
25
-class IndividualReportModule extends AbstractModule implements ModuleReportInterface {
25
+class IndividualReportModule extends AbstractModule implements ModuleReportInterface
26
+{
26 27
 	/** {@inheritdoc} */
27
-	public function getTitle() {
28
+	public function getTitle()
29
+	{
28 30
 		// This text also appears in the .XML file - update both together
29 31
 		return /* I18N: Name of a module/report */ I18N::translate('Individual');
30 32
 	}
31 33
 
32 34
 	/** {@inheritdoc} */
33
-	public function getDescription() {
35
+	public function getDescription()
36
+	{
34 37
 		// This text also appears in the .XML file - update both together
35 38
 		return /* I18N: Description of the “Individual” module */ I18N::translate('A report of an individual’s details.');
36 39
 	}
@@ -42,7 +45,8 @@  discard block
 block discarded – undo
42 45
 	 *
43 46
 	 * @return int
44 47
 	 */
45
-	public function defaultAccessLevel() {
48
+	public function defaultAccessLevel()
49
+	{
46 50
 		return Auth::PRIV_PRIVATE;
47 51
 	}
48 52
 
@@ -51,7 +55,8 @@  discard block
 block discarded – undo
51 55
 	 *
52 56
 	 * @return Menu
53 57
 	 */
54
-	public function getReportMenu() {
58
+	public function getReportMenu()
59
+	{
55 60
 		global $controller, $WT_TREE;
56 61
 
57 62
 		return new Menu(
Please login to merge, or discard this patch.
app/Module/DescendancyChartModule.php 1 patch
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,13 +23,15 @@  discard block
 block discarded – undo
23 23
 /**
24 24
  * Class DescendancyChartModule
25 25
  */
26
-class DescendancyChartModule extends AbstractModule implements ModuleChartInterface {
26
+class DescendancyChartModule extends AbstractModule implements ModuleChartInterface
27
+{
27 28
 	/**
28 29
 	 * How should this module be labelled on tabs, menus, etc.?
29 30
 	 *
30 31
 	 * @return string
31 32
 	 */
32
-	public function getTitle() {
33
+	public function getTitle()
34
+	{
33 35
 		return /* I18N: Name of a module/chart */ I18N::translate('Descendants');
34 36
 	}
35 37
 
@@ -38,7 +40,8 @@  discard block
 block discarded – undo
38 40
 	 *
39 41
 	 * @return string
40 42
 	 */
41
-	public function getDescription() {
43
+	public function getDescription()
44
+	{
42 45
 		return /* I18N: Description of the “DescendancyChart” module */ I18N::translate('A chart of an individual’s descendants.');
43 46
 	}
44 47
 
@@ -49,7 +52,8 @@  discard block
 block discarded – undo
49 52
 	 *
50 53
 	 * @return int
51 54
 	 */
52
-	public function defaultAccessLevel() {
55
+	public function defaultAccessLevel()
56
+	{
53 57
 		return Auth::PRIV_PRIVATE;
54 58
 	}
55 59
 
@@ -58,7 +62,8 @@  discard block
 block discarded – undo
58 62
 	 *
59 63
 	 * @return Menu|null
60 64
 	 */
61
-	public function getChartMenu(Individual $individual) {
65
+	public function getChartMenu(Individual $individual)
66
+	{
62 67
 		return new Menu(
63 68
 			$this->getTitle(),
64 69
 			'descendancy.php?rootid=' . $individual->getXref() . '&ged=' . $individual->getTree()->getNameUrl(),
@@ -72,7 +77,8 @@  discard block
 block discarded – undo
72 77
 	 *
73 78
 	 * @return Menu|null
74 79
 	 */
75
-	public function getBoxChartMenu(Individual $individual) {
80
+	public function getBoxChartMenu(Individual $individual)
81
+	{
76 82
 		return $this->getChartMenu($individual);
77 83
 	}
78 84
 }
Please login to merge, or discard this patch.
app/Module/FamilyGroupReportModule.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,15 +22,18 @@  discard block
 block discarded – undo
22 22
 /**
23 23
  * Class FamilyGroupReportModule
24 24
  */
25
-class FamilyGroupReportModule extends AbstractModule implements ModuleReportInterface {
25
+class FamilyGroupReportModule extends AbstractModule implements ModuleReportInterface
26
+{
26 27
 	/** {@inheritdoc} */
27
-	public function getTitle() {
28
+	public function getTitle()
29
+	{
28 30
 		// This text also appears in the .XML file - update both together
29 31
 		return /* I18N: Name of a module/report */ I18N::translate('Family');
30 32
 	}
31 33
 
32 34
 	/** {@inheritdoc} */
33
-	public function getDescription() {
35
+	public function getDescription()
36
+	{
34 37
 		// This text also appears in the .XML file - update both together
35 38
 		return /* I18N: Description of the “Family” module */ I18N::translate('A report of family members and their details.');
36 39
 	}
@@ -42,7 +45,8 @@  discard block
 block discarded – undo
42 45
 	 *
43 46
 	 * @return int
44 47
 	 */
45
-	public function defaultAccessLevel() {
48
+	public function defaultAccessLevel()
49
+	{
46 50
 		return Auth::PRIV_PRIVATE;
47 51
 	}
48 52
 
@@ -51,7 +55,8 @@  discard block
 block discarded – undo
51 55
 	 *
52 56
 	 * @return Menu
53 57
 	 */
54
-	public function getReportMenu() {
58
+	public function getReportMenu()
59
+	{
55 60
 		global $controller, $WT_TREE;
56 61
 
57 62
 		return new Menu(
Please login to merge, or discard this patch.
app/Module/ModuleConfigInterface.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,8 @@
 block discarded – undo
18 18
 /**
19 19
  * Interface ModuleConfigInterface - Classes and libraries for module system
20 20
  */
21
-interface ModuleConfigInterface {
21
+interface ModuleConfigInterface
22
+{
22 23
 	/**
23 24
 	 * The URL to a page where the user can modify the configuration of this module.
24 25
 	 *
Please login to merge, or discard this patch.
app/Module/UpcomingAnniversariesModule.php 1 patch
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -25,13 +25,15 @@  discard block
 block discarded – undo
25 25
 /**
26 26
  * Class UpcomingAnniversariesModule
27 27
  */
28
-class UpcomingAnniversariesModule extends AbstractModule implements ModuleBlockInterface {
28
+class UpcomingAnniversariesModule extends AbstractModule implements ModuleBlockInterface
29
+{
29 30
 	/**
30 31
 	 * How should this module be labelled on tabs, menus, etc.?
31 32
 	 *
32 33
 	 * @return string
33 34
 	 */
34
-	public function getTitle() {
35
+	public function getTitle()
36
+	{
35 37
 		return /* I18N: Name of a module */ I18N::translate('Upcoming events');
36 38
 	}
37 39
 
@@ -40,7 +42,8 @@  discard block
 block discarded – undo
40 42
 	 *
41 43
 	 * @return string
42 44
 	 */
43
-	public function getDescription() {
45
+	public function getDescription()
46
+	{
44 47
 		return /* I18N: Description of the “Upcoming events” module */ I18N::translate('A list of the anniversaries that will occur in the near future.');
45 48
 	}
46 49
 
@@ -53,7 +56,8 @@  discard block
 block discarded – undo
53 56
 	 *
54 57
 	 * @return string
55 58
 	 */
56
-	public function getBlock($block_id, $template = true, $cfg = array()) {
59
+	public function getBlock($block_id, $template = true, $cfg = array())
60
+	{
57 61
 		global $ctype, $WT_TREE;
58 62
 
59 63
 		$days      = $this->getBlockSetting($block_id, 'days', '7');
@@ -107,17 +111,20 @@  discard block
 block discarded – undo
107 111
 	}
108 112
 
109 113
 	/** {@inheritdoc} */
110
-	public function loadAjax() {
114
+	public function loadAjax()
115
+	{
111 116
 		return true;
112 117
 	}
113 118
 
114 119
 	/** {@inheritdoc} */
115
-	public function isUserBlock() {
120
+	public function isUserBlock()
121
+	{
116 122
 		return true;
117 123
 	}
118 124
 
119 125
 	/** {@inheritdoc} */
120
-	public function isGedcomBlock() {
126
+	public function isGedcomBlock()
127
+	{
121 128
 		return true;
122 129
 	}
123 130
 
@@ -126,7 +133,8 @@  discard block
 block discarded – undo
126 133
 	 *
127 134
 	 * @param int $block_id
128 135
 	 */
129
-	public function configureBlock($block_id) {
136
+	public function configureBlock($block_id)
137
+	{
130 138
 		if (Filter::postBool('save') && Filter::checkCsrf()) {
131 139
 			$this->setBlockSetting($block_id, 'days', Filter::postInteger('days', 1, 30, 7));
132 140
 			$this->setBlockSetting($block_id, 'filter', Filter::postBool('filter'));
Please login to merge, or discard this patch.
app/Module/ModuleSidebarInterface.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,8 @@
 block discarded – undo
18 18
 /**
19 19
  * Interface ModuleSidebarInterface - Classes and libraries for module system
20 20
  */
21
-interface ModuleSidebarInterface {
21
+interface ModuleSidebarInterface
22
+{
22 23
 	/**
23 24
 	 * The user can change the order of sidebars. Until they do this, they are shown in this order.
24 25
 	 *
Please login to merge, or discard this patch.
app/Module/PedigreeChartModule.php 1 patch
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,13 +23,15 @@  discard block
 block discarded – undo
23 23
 /**
24 24
  * Class PedigreeChartModule
25 25
  */
26
-class PedigreeChartModule extends AbstractModule implements ModuleChartInterface {
26
+class PedigreeChartModule extends AbstractModule implements ModuleChartInterface
27
+{
27 28
 	/**
28 29
 	 * How should this module be labelled on tabs, menus, etc.?
29 30
 	 *
30 31
 	 * @return string
31 32
 	 */
32
-	public function getTitle() {
33
+	public function getTitle()
34
+	{
33 35
 		return /* I18N: Name of a module/chart */ I18N::translate('Pedigree');
34 36
 	}
35 37
 
@@ -38,7 +40,8 @@  discard block
 block discarded – undo
38 40
 	 *
39 41
 	 * @return string
40 42
 	 */
41
-	public function getDescription() {
43
+	public function getDescription()
44
+	{
42 45
 		return /* I18N: Description of the “PedigreeChart” module */ I18N::translate('A chart of an individual’s ancestors, formatted as a tree.');
43 46
 	}
44 47
 
@@ -49,7 +52,8 @@  discard block
 block discarded – undo
49 52
 	 *
50 53
 	 * @return int
51 54
 	 */
52
-	public function defaultAccessLevel() {
55
+	public function defaultAccessLevel()
56
+	{
53 57
 		return Auth::PRIV_PRIVATE;
54 58
 	}
55 59
 
@@ -58,7 +62,8 @@  discard block
 block discarded – undo
58 62
 	 *
59 63
 	 * @return Menu|null
60 64
 	 */
61
-	public function getChartMenu(Individual $individual) {
65
+	public function getChartMenu(Individual $individual)
66
+	{
62 67
 		return new Menu(
63 68
 			$this->getTitle(),
64 69
 			'pedigree.php?rootid=' . $individual->getXref() . '&ged=' . $individual->getTree()->getNameUrl(),
@@ -72,7 +77,8 @@  discard block
 block discarded – undo
72 77
 	 *
73 78
 	 * @return Menu|null
74 79
 	 */
75
-	public function getBoxChartMenu(Individual $individual) {
80
+	public function getBoxChartMenu(Individual $individual)
81
+	{
76 82
 		return $this->getChartMenu($individual);
77 83
 	}
78 84
 }
Please login to merge, or discard this patch.
app/Module/BatchUpdateModule.php 1 patch
Braces   +36 added lines, -17 removed lines patch added patch discarded remove patch
@@ -34,7 +34,8 @@  discard block
 block discarded – undo
34 34
 /**
35 35
  * Class BatchUpdateModule
36 36
  */
37
-class BatchUpdateModule extends AbstractModule implements ModuleConfigInterface {
37
+class BatchUpdateModule extends AbstractModule implements ModuleConfigInterface
38
+{
38 39
 	/** @var string  Form parameter: chosen plugin*/
39 40
 	private $plugin;
40 41
 
@@ -73,7 +74,8 @@  discard block
 block discarded – undo
73 74
 	 *
74 75
 	 * @return string
75 76
 	 */
76
-	public function getTitle() {
77
+	public function getTitle()
78
+	{
77 79
 		return /* I18N: Name of a module */ I18N::translate('Batch update');
78 80
 	}
79 81
 
@@ -82,7 +84,8 @@  discard block
 block discarded – undo
82 84
 	 *
83 85
 	 * @return string
84 86
 	 */
85
-	public function getDescription() {
87
+	public function getDescription()
88
+	{
86 89
 		return /* I18N: Description of the “Batch update” module */ I18N::translate('Apply automatic corrections to your genealogy data.');
87 90
 	}
88 91
 
@@ -92,7 +95,8 @@  discard block
 block discarded – undo
92 95
 	 *
93 96
 	 * @param string $mod_action
94 97
 	 */
95
-	public function modAction($mod_action) {
98
+	public function modAction($mod_action)
99
+	{
96 100
 		switch ($mod_action) {
97 101
 		case 'admin_batch_update':
98 102
 			echo $this->main();
@@ -109,7 +113,8 @@  discard block
 block discarded – undo
109 113
 	 *
110 114
 	 * @return string
111 115
 	 */
112
-	private function main() {
116
+	private function main()
117
+	{
113 118
 		global $WT_TREE;
114 119
 
115 120
 		$this->plugins = $this->getPluginList(); // List of available plugins
@@ -236,12 +241,15 @@  discard block
 block discarded – undo
236 241
 					<?php // Reset - otherwise we might "undo all changes", which refreshes the ?>
237 242
 					<?php // page, which makes them all again!  ?>
238 243
 					<script>reset_reload();</script>
239
-			<?php else: ?>
244
+			<?php else {
245
+    : ?>
240 246
 					<hr>
241 247
 					<div id="batch_update2" class="col-sm-12">
242 248
 						<?php if ($this->curr_xref): ?>
243 249
 							<?php // Create an object, so we can get the latest version of the name. ?>
244
-								<?php $this->record = GedcomRecord::getInstance($this->curr_xref, $WT_TREE); ?>
250
+								<?php $this->record = GedcomRecord::getInstance($this->curr_xref, $WT_TREE);
251
+}
252
+?>
245 253
 							<div class="form-group">
246 254
 								<?php echo self::createSubmitButton(I18N::translate('previous'), $this->prev_xref) ?>
247 255
 					<?php echo self::createSubmitButton(I18N::translate('next'), $this->next_xref) ?>
@@ -253,8 +261,11 @@  discard block
 block discarded – undo
253 261
 							<div class="form-group">
254 262
 							<?php echo implode(' ', $this->PLUGIN->getActionButtons($this->curr_xref, $this->record)); ?>
255 263
 							</div>
256
-						<?php else: ?>
257
-							<div class="alert alert-info"><?php echo I18N::translate('Nothing found.'); ?></div>
264
+						<?php else {
265
+    : ?>
266
+							<div class="alert alert-info"><?php echo I18N::translate('Nothing found.');
267
+}
268
+?></div>
258 269
 					<?php endif; ?>
259 270
 					</div>
260 271
 				<?php endif; ?>
@@ -270,7 +281,8 @@  discard block
 block discarded – undo
270 281
 	 *
271 282
 	 * @return string|null
272 283
 	 */
273
-	private function findNextXref($xref) {
284
+	private function findNextXref($xref)
285
+	{
274 286
 		foreach (array_keys($this->all_xrefs) as $key) {
275 287
 			if ($key > $xref) {
276 288
 				$record = self::getLatestRecord($key, $this->all_xrefs[$key]);
@@ -290,7 +302,8 @@  discard block
 block discarded – undo
290 302
 	 *
291 303
 	 * @return string|null
292 304
 	 */
293
-	private function findPrevXref($xref) {
305
+	private function findPrevXref($xref)
306
+	{
294 307
 		foreach (array_reverse(array_keys($this->all_xrefs)) as $key) {
295 308
 			if ($key < $xref) {
296 309
 				$record = self::getLatestRecord($key, $this->all_xrefs[$key]);
@@ -306,7 +319,8 @@  discard block
 block discarded – undo
306 319
 	/**
307 320
 	 * Generate a list of all XREFs.
308 321
 	 */
309
-	private function getAllXrefs() {
322
+	private function getAllXrefs()
323
+	{
310 324
 		global $WT_TREE;
311 325
 
312 326
 		$sql  = array();
@@ -348,7 +362,8 @@  discard block
 block discarded – undo
348 362
 	 *
349 363
 	 * @return BatchUpdateBasePlugin[]
350 364
 	 */
351
-	private function getPluginList() {
365
+	private function getPluginList()
366
+	{
352 367
 		$plugins    = array();
353 368
 		$dir_handle = opendir(__DIR__ . '/BatchUpdate');
354 369
 		while (($file = readdir($dir_handle)) !== false) {
@@ -367,7 +382,8 @@  discard block
 block discarded – undo
367 382
 	 *
368 383
 	 * @return string
369 384
 	 */
370
-	private function getJavascript() {
385
+	private function getJavascript()
386
+	{
371 387
 		return
372 388
 			'<script>' .
373 389
 			'function reset_reload() {' .
@@ -389,7 +405,8 @@  discard block
 block discarded – undo
389 405
 	 *
390 406
 	 * @return string
391 407
 	 */
392
-	public static function createSubmitButton($text, $xref, $action = '', $data = '') {
408
+	public static function createSubmitButton($text, $xref, $action = '', $data = '')
409
+	{
393 410
 		return
394 411
 			'<input class="btn btn-primary" type="submit" value="' . $text . '" onclick="' .
395 412
 			'this.form.xref.value=\'' . Filter::escapeHtml($xref) . '\';' .
@@ -407,7 +424,8 @@  discard block
 block discarded – undo
407 424
 	 *
408 425
 	 * @return string
409 426
 	 */
410
-	public static function getLatestRecord($xref, $type) {
427
+	public static function getLatestRecord($xref, $type)
428
+	{
411 429
 		global $WT_TREE;
412 430
 
413 431
 		switch ($type) {
@@ -434,7 +452,8 @@  discard block
 block discarded – undo
434 452
 	 *
435 453
 	 * @return string
436 454
 	 */
437
-	public function getConfigLink() {
455
+	public function getConfigLink()
456
+	{
438 457
 		return 'module.php?mod=' . $this->getName() . '&amp;mod_action=admin_batch_update';
439 458
 	}
440 459
 
Please login to merge, or discard this patch.
app/Module/BatchUpdate/BatchUpdateMarriedNamesPlugin.php 1 patch
Braces   +18 added lines, -9 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@  discard block
 block discarded – undo
22 22
 /**
23 23
  * Class BatchUpdateMarriedNamesPlugin Batch Update plugin: add missing 2 _MARNM records
24 24
  */
25
-class BatchUpdateMarriedNamesPlugin extends BatchUpdateBasePlugin {
25
+class BatchUpdateMarriedNamesPlugin extends BatchUpdateBasePlugin
26
+{
26 27
 	/** @var string User option: add or replace husband’s surname */
27 28
 	private $surname;
28 29
 
@@ -31,7 +32,8 @@  discard block
 block discarded – undo
31 32
 	 *
32 33
 	 * @return string
33 34
 	 */
34
-	public function getName() {
35
+	public function getName()
36
+	{
35 37
 		return I18N::translate('Add missing married names');
36 38
 	}
37 39
 
@@ -40,7 +42,8 @@  discard block
 block discarded – undo
40 42
 	 *
41 43
 	 * @return string
42 44
 	 */
43
-	public function getDescription() {
45
+	public function getDescription()
46
+	{
44 47
 		return I18N::translate('You can make it easier to search for married women by recording their married name. However not all women take their husband’s surname, so beware of introducing incorrect information into your database.');
45 48
 	}
46 49
 
@@ -52,7 +55,8 @@  discard block
 block discarded – undo
52 55
 	 *
53 56
 	 * @return bool
54 57
 	 */
55
-	public function doesRecordNeedUpdate($xref, $gedrec) {
58
+	public function doesRecordNeedUpdate($xref, $gedrec)
59
+	{
56 60
 		return preg_match('/^1 SEX F/m', $gedrec) && preg_match('/^1 NAME /m', $gedrec) && self::surnamesToAdd($xref, $gedrec);
57 61
 	}
58 62
 
@@ -64,7 +68,8 @@  discard block
 block discarded – undo
64 68
 	 *
65 69
 	 * @return string
66 70
 	 */
67
-	public function updateRecord($xref, $gedrec) {
71
+	public function updateRecord($xref, $gedrec)
72
+	{
68 73
 		global $WT_TREE;
69 74
 
70 75
 		$SURNAME_TRADITION = $WT_TREE->getPreference('SURNAME_TRADITION');
@@ -97,7 +102,8 @@  discard block
 block discarded – undo
97 102
 	 *
98 103
 	 * @return string[]
99 104
 	 */
100
-	private function surnamesToAdd($xref, $gedrec) {
105
+	private function surnamesToAdd($xref, $gedrec)
106
+	{
101 107
 		$wife_surnames    = self::surnames($xref, $gedrec);
102 108
 		$husb_surnames    = array();
103 109
 		$missing_surnames = array();
@@ -126,7 +132,8 @@  discard block
 block discarded – undo
126 132
 	 *
127 133
 	 * @return string[]
128 134
 	 */
129
-	private function surnames($xref, $gedrec) {
135
+	private function surnames($xref, $gedrec)
136
+	{
130 137
 		if (preg_match_all('/^(?:1 NAME|2 _MARNM) .*\/(.+)\//m', $gedrec, $match)) {
131 138
 			return $match[1];
132 139
 		} else {
@@ -137,7 +144,8 @@  discard block
 block discarded – undo
137 144
 	/**
138 145
 	 * Process the user-supplied options.
139 146
 	 */
140
-	public function getOptions() {
147
+	public function getOptions()
148
+	{
141 149
 		parent::getOptions();
142 150
 		$this->surname = Filter::get('surname', 'add|replace', 'replace');
143 151
 	}
@@ -147,7 +155,8 @@  discard block
 block discarded – undo
147 155
 	 *
148 156
 	 * @return string
149 157
 	 */
150
-	public function getOptionsForm() {
158
+	public function getOptionsForm()
159
+	{
151 160
 		return
152 161
 			'<div class="form-group">' .
153 162
 			'<label class="control-label col-sm-3">' . I18N::translate('Surname option') . '</label>' .
Please login to merge, or discard this patch.