Passed
Push — 1.7 ( 0a3d97...10e206 )
by
unknown
09:35
created
app/Filter.php 1 patch
Switch Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -117,10 +117,10 @@
 block discarded – undo
117 117
 	 */
118 118
 	public static function formatText($text, Tree $WT_TREE) {
119 119
 		switch ($WT_TREE->getPreference('FORMAT_TEXT')) {
120
-		case 'markdown':
121
-			return '<div class="markdown" dir="auto">' . self::markdown($text) . '</div>';
122
-		default:
123
-			return '<div style="white-space: pre-wrap;" dir="auto">' . self::expandUrls($text) . '</div>';
120
+			case 'markdown':
121
+				return '<div class="markdown" dir="auto">' . self::markdown($text) . '</div>';
122
+			default:
123
+				return '<div style="white-space: pre-wrap;" dir="auto">' . self::expandUrls($text) . '</div>';
124 124
 		}
125 125
 	}
126 126
 
Please login to merge, or discard this patch.
app/GedcomRecord.php 1 patch
Switch Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -198,27 +198,27 @@  discard block
 block discarded – undo
198 198
 		}
199 199
 
200 200
 		switch ($type) {
201
-		case 'INDI':
202
-			$record = new Individual($xref, $gedcom, $pending, $tree);
203
-			break;
204
-		case 'FAM':
205
-			$record = new Family($xref, $gedcom, $pending, $tree);
206
-			break;
207
-		case 'SOUR':
208
-			$record = new Source($xref, $gedcom, $pending, $tree);
209
-			break;
210
-		case 'OBJE':
211
-			$record = new Media($xref, $gedcom, $pending, $tree);
212
-			break;
213
-		case 'REPO':
214
-			$record = new Repository($xref, $gedcom, $pending, $tree);
215
-			break;
216
-		case 'NOTE':
217
-			$record = new Note($xref, $gedcom, $pending, $tree);
218
-			break;
219
-		default:
220
-			$record = new self($xref, $gedcom, $pending, $tree);
221
-			break;
201
+			case 'INDI':
202
+				$record = new Individual($xref, $gedcom, $pending, $tree);
203
+				break;
204
+			case 'FAM':
205
+				$record = new Family($xref, $gedcom, $pending, $tree);
206
+				break;
207
+			case 'SOUR':
208
+				$record = new Source($xref, $gedcom, $pending, $tree);
209
+				break;
210
+			case 'OBJE':
211
+				$record = new Media($xref, $gedcom, $pending, $tree);
212
+				break;
213
+			case 'REPO':
214
+				$record = new Repository($xref, $gedcom, $pending, $tree);
215
+				break;
216
+			case 'NOTE':
217
+				$record = new Note($xref, $gedcom, $pending, $tree);
218
+				break;
219
+			default:
220
+				$record = new self($xref, $gedcom, $pending, $tree);
221
+				break;
222 222
 		}
223 223
 
224 224
 		// Store it in the cache
@@ -437,31 +437,31 @@  discard block
 block discarded – undo
437 437
 // CACHING: this function can take three different parameters,
438 438
 		// and therefore needs three different caches for the result.
439 439
 		switch ($access_level) {
440
-		case Auth::PRIV_PRIVATE: // visitor
441
-			if ($this->disp_public === null) {
442
-				$this->disp_public = $this->canShowRecord(Auth::PRIV_PRIVATE);
443
-			}
440
+			case Auth::PRIV_PRIVATE: // visitor
441
+				if ($this->disp_public === null) {
442
+					$this->disp_public = $this->canShowRecord(Auth::PRIV_PRIVATE);
443
+				}
444 444
 
445
-			return $this->disp_public;
446
-		case Auth::PRIV_USER: // member
447
-			if ($this->disp_user === null) {
448
-				$this->disp_user = $this->canShowRecord(Auth::PRIV_USER);
449
-			}
445
+				return $this->disp_public;
446
+			case Auth::PRIV_USER: // member
447
+				if ($this->disp_user === null) {
448
+					$this->disp_user = $this->canShowRecord(Auth::PRIV_USER);
449
+				}
450 450
 
451
-			return $this->disp_user;
452
-		case Auth::PRIV_NONE: // admin
453
-			if ($this->disp_none === null) {
454
-				$this->disp_none = $this->canShowRecord(Auth::PRIV_NONE);
455
-			}
451
+				return $this->disp_user;
452
+			case Auth::PRIV_NONE: // admin
453
+				if ($this->disp_none === null) {
454
+					$this->disp_none = $this->canShowRecord(Auth::PRIV_NONE);
455
+				}
456 456
 
457
-			return $this->disp_none;
458
-		case Auth::PRIV_HIDE: // hidden from admins
459
-			// We use this value to bypass privacy checks. For example,
460
-			// when downloading data or when calculating privacy itself.
461
-			return true;
462
-		default:
463
-			// Should never get here.
464
-			return false;
457
+				return $this->disp_none;
458
+			case Auth::PRIV_HIDE: // hidden from admins
459
+				// We use this value to bypass privacy checks. For example,
460
+				// when downloading data or when calculating privacy itself.
461
+				return true;
462
+			default:
463
+				// Should never get here.
464
+				return false;
465 465
 		}
466 466
 	}
467 467
 
@@ -816,10 +816,10 @@  discard block
 block discarded – undo
816 816
 			}
817 817
 			if ($event->getDate()->isOK() || !$event->getPlace()->isEmpty()) {
818 818
 				switch ($style) {
819
-				case 1:
820
-					return '<br><em>' . $event->getLabel() . ' ' . FunctionsPrint::formatFactDate($event, $this, false, false) . $joiner . FunctionsPrint::formatFactPlace($event) . '</em>';
821
-				case 2:
822
-					return '<dl><dt class="label">' . $event->getLabel() . '</dt><dd class="field">' . FunctionsPrint::formatFactDate($event, $this, false, false) . $joiner . FunctionsPrint::formatFactPlace($event) . '</dd></dl>';
819
+					case 1:
820
+						return '<br><em>' . $event->getLabel() . ' ' . FunctionsPrint::formatFactDate($event, $this, false, false) . $joiner . FunctionsPrint::formatFactPlace($event) . '</em>';
821
+					case 2:
822
+						return '<dl><dt class="label">' . $event->getLabel() . '</dt><dd class="field">' . FunctionsPrint::formatFactDate($event, $this, false, false) . $joiner . FunctionsPrint::formatFactPlace($event) . '</dd></dl>';
823 823
 				}
824 824
 			}
825 825
 		}
Please login to merge, or discard this patch.
app/Date.php 1 patch
Switch Indentation   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -169,22 +169,22 @@  discard block
 block discarded – undo
169 169
 		}
170 170
 		// Now construct an object of the correct type
171 171
 		switch ($cal) {
172
-		case '@#DGREGORIAN@':
173
-			return new GregorianDate(array($y, $m, $d));
174
-		case '@#DJULIAN@':
175
-			return new JulianDate(array($y, $m, $d));
176
-		case '@#DHEBREW@':
177
-			return new JewishDate(array($y, $m, $d));
178
-		case '@#DHIJRI@':
179
-			return new HijriDate(array($y, $m, $d));
180
-		case '@#DFRENCH R@':
181
-			return new FrenchDate(array($y, $m, $d));
182
-		case '@#DJALALI@':
183
-			return new JalaliDate(array($y, $m, $d));
184
-		case '@#DROMAN@':
185
-			return new RomanDate(array($y, $m, $d));
186
-		default:
187
-			throw new \DomainException('Invalid calendar');
172
+			case '@#DGREGORIAN@':
173
+				return new GregorianDate(array($y, $m, $d));
174
+			case '@#DJULIAN@':
175
+				return new JulianDate(array($y, $m, $d));
176
+			case '@#DHEBREW@':
177
+				return new JewishDate(array($y, $m, $d));
178
+			case '@#DHIJRI@':
179
+				return new HijriDate(array($y, $m, $d));
180
+			case '@#DFRENCH R@':
181
+				return new FrenchDate(array($y, $m, $d));
182
+			case '@#DJALALI@':
183
+				return new JalaliDate(array($y, $m, $d));
184
+			case '@#DROMAN@':
185
+				return new RomanDate(array($y, $m, $d));
186
+			default:
187
+				throw new \DomainException('Invalid calendar');
188 188
 		}
189 189
 	}
190 190
 
@@ -291,42 +291,42 @@  discard block
 block discarded – undo
291 291
 
292 292
 		// Localise the date
293 293
 		switch ($q1 . $q2) {
294
-		case '':
295
-			$tmp = $d1 . $conv1;
296
-			break;
297
-		case 'ABT':
298
-			$tmp = /* I18N: Gedcom ABT dates */ I18N::translate('about %s', $d1 . $conv1);
299
-			break;
300
-		case 'CAL':
301
-			$tmp = /* I18N: Gedcom CAL dates */ I18N::translate('calculated %s', $d1 . $conv1);
302
-			break;
303
-		case 'EST':
304
-			$tmp = /* I18N: Gedcom EST dates */ I18N::translate('estimated %s', $d1 . $conv1);
305
-			break;
306
-		case 'INT':
307
-			$tmp = /* I18N: Gedcom INT dates */ I18N::translate('interpreted %s (%s)', $d1 . $conv1, $this->text);
308
-			break;
309
-		case 'BEF':
310
-			$tmp = /* I18N: Gedcom BEF dates */ I18N::translate('before %s', $d1 . $conv1);
311
-			break;
312
-		case 'AFT':
313
-			$tmp = /* I18N: Gedcom AFT dates */ I18N::translate('after %s', $d1 . $conv1);
314
-			break;
315
-		case 'FROM':
316
-			$tmp = /* I18N: Gedcom FROM dates */ I18N::translate('from %s', $d1 . $conv1);
317
-			break;
318
-		case 'TO':
319
-			$tmp = /* I18N: Gedcom TO dates */ I18N::translate('to %s', $d1 . $conv1);
320
-			break;
321
-		case 'BETAND':
322
-			$tmp = /* I18N: Gedcom BET-AND dates */ I18N::translate('between %s and %s', $d1 . $conv1, $d2 . $conv2);
323
-			break;
324
-		case 'FROMTO':
325
-			$tmp = /* I18N: Gedcom FROM-TO dates */ I18N::translate('from %s to %s', $d1 . $conv1, $d2 . $conv2);
326
-			break;
327
-		default:
328
-			$tmp = I18N::translate('Invalid date');
329
-			break; // e.g. BET without AND
294
+			case '':
295
+				$tmp = $d1 . $conv1;
296
+				break;
297
+			case 'ABT':
298
+				$tmp = /* I18N: Gedcom ABT dates */ I18N::translate('about %s', $d1 . $conv1);
299
+				break;
300
+			case 'CAL':
301
+				$tmp = /* I18N: Gedcom CAL dates */ I18N::translate('calculated %s', $d1 . $conv1);
302
+				break;
303
+			case 'EST':
304
+				$tmp = /* I18N: Gedcom EST dates */ I18N::translate('estimated %s', $d1 . $conv1);
305
+				break;
306
+			case 'INT':
307
+				$tmp = /* I18N: Gedcom INT dates */ I18N::translate('interpreted %s (%s)', $d1 . $conv1, $this->text);
308
+				break;
309
+			case 'BEF':
310
+				$tmp = /* I18N: Gedcom BEF dates */ I18N::translate('before %s', $d1 . $conv1);
311
+				break;
312
+			case 'AFT':
313
+				$tmp = /* I18N: Gedcom AFT dates */ I18N::translate('after %s', $d1 . $conv1);
314
+				break;
315
+			case 'FROM':
316
+				$tmp = /* I18N: Gedcom FROM dates */ I18N::translate('from %s', $d1 . $conv1);
317
+				break;
318
+			case 'TO':
319
+				$tmp = /* I18N: Gedcom TO dates */ I18N::translate('to %s', $d1 . $conv1);
320
+				break;
321
+			case 'BETAND':
322
+				$tmp = /* I18N: Gedcom BET-AND dates */ I18N::translate('between %s and %s', $d1 . $conv1, $d2 . $conv2);
323
+				break;
324
+			case 'FROMTO':
325
+				$tmp = /* I18N: Gedcom FROM-TO dates */ I18N::translate('from %s to %s', $d1 . $conv1, $d2 . $conv2);
326
+				break;
327
+			default:
328
+				$tmp = I18N::translate('Invalid date');
329
+				break; // e.g. BET without AND
330 330
 		}
331 331
 		if ($this->text && !$q1) {
332 332
 			$tmp = I18N::translate('%1$s (%2$s)', $tmp, $this->text);
@@ -445,33 +445,33 @@  discard block
 block discarded – undo
445 445
 		}
446 446
 
447 447
 		switch ($format) {
448
-		case 0:
449
-			// Years - integer only (for statistics, rather than for display)
450
-			if ($jd && $d1->minimumJulianDay() && $d1->minimumJulianDay() <= $jd) {
451
-				return $d1->minimumDate()->getAge(false, $jd, false);
452
-			} else {
453
-				return -1;
454
-			}
455
-		case 1:
456
-			// Days - integer only (for sorting, rather than for display)
457
-			if ($jd && $d1->minimumJulianDay()) {
458
-				return $jd - $d1->minimumJulianDay();
459
-			} else {
460
-				return -1;
461
-			}
462
-		case 2:
463
-			// Just years, in local digits, with warning for negative/
464
-			if ($jd && $d1->minimumJulianDay()) {
465
-				if ($d1->minimumJulianDay() > $jd) {
466
-					return '<i class="icon-warning"></i>';
448
+			case 0:
449
+				// Years - integer only (for statistics, rather than for display)
450
+				if ($jd && $d1->minimumJulianDay() && $d1->minimumJulianDay() <= $jd) {
451
+					return $d1->minimumDate()->getAge(false, $jd, false);
467 452
 				} else {
468
-					return I18N::number($d1->minimumDate()->getAge(false, $jd));
453
+					return -1;
469 454
 				}
470
-			} else {
471
-				return '';
472
-			}
473
-		default:
474
-			throw new \InvalidArgumentException('format: ' . $format);
455
+			case 1:
456
+				// Days - integer only (for sorting, rather than for display)
457
+				if ($jd && $d1->minimumJulianDay()) {
458
+					return $jd - $d1->minimumJulianDay();
459
+				} else {
460
+					return -1;
461
+				}
462
+			case 2:
463
+				// Just years, in local digits, with warning for negative/
464
+				if ($jd && $d1->minimumJulianDay()) {
465
+					if ($d1->minimumJulianDay() > $jd) {
466
+						return '<i class="icon-warning"></i>';
467
+					} else {
468
+						return I18N::number($d1->minimumDate()->getAge(false, $jd));
469
+					}
470
+				} else {
471
+					return '';
472
+				}
473
+			default:
474
+				throw new \InvalidArgumentException('format: ' . $format);
475 475
 		}
476 476
 	}
477 477
 
@@ -515,32 +515,32 @@  discard block
 block discarded – undo
515 515
 	public static function compare(Date $a, Date $b) {
516 516
 		// Get min/max JD for each date.
517 517
 		switch ($a->qual1) {
518
-		case 'BEF':
519
-			$amin = $a->minimumJulianDay() - 1;
520
-			$amax = $amin;
521
-			break;
522
-		case 'AFT':
523
-			$amax = $a->maximumJulianDay() + 1;
524
-			$amin = $amax;
525
-			break;
526
-		default:
527
-			$amin = $a->minimumJulianDay();
528
-			$amax = $a->maximumJulianDay();
529
-			break;
518
+			case 'BEF':
519
+				$amin = $a->minimumJulianDay() - 1;
520
+				$amax = $amin;
521
+				break;
522
+			case 'AFT':
523
+				$amax = $a->maximumJulianDay() + 1;
524
+				$amin = $amax;
525
+				break;
526
+			default:
527
+				$amin = $a->minimumJulianDay();
528
+				$amax = $a->maximumJulianDay();
529
+				break;
530 530
 		}
531 531
 		switch ($b->qual1) {
532
-		case 'BEF':
533
-			$bmin = $b->minimumJulianDay() - 1;
534
-			$bmax = $bmin;
535
-			break;
536
-		case 'AFT':
537
-			$bmax = $b->maximumJulianDay() + 1;
538
-			$bmin = $bmax;
539
-			break;
540
-		default:
541
-			$bmin = $b->minimumJulianDay();
542
-			$bmax = $b->maximumJulianDay();
543
-			break;
532
+			case 'BEF':
533
+				$bmin = $b->minimumJulianDay() - 1;
534
+				$bmax = $bmin;
535
+				break;
536
+			case 'AFT':
537
+				$bmax = $b->maximumJulianDay() + 1;
538
+				$bmin = $bmax;
539
+				break;
540
+			default:
541
+				$bmin = $b->minimumJulianDay();
542
+				$bmax = $b->maximumJulianDay();
543
+				break;
544 544
 		}
545 545
 		if ($amax < $bmin) {
546 546
 			return -1;
Please login to merge, or discard this patch.
app/Mail.php 1 patch
Switch Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -98,30 +98,30 @@
 block discarded – undo
98 98
 	 */
99 99
 	public static function transport() {
100 100
 		switch (Site::getPreference('SMTP_ACTIVE')) {
101
-		case 'internal':
102
-			return Swift_MailTransport::newInstance();
103
-		case 'sendmail':
104
-			return Swift_SendmailTransport::newInstance();
105
-		case 'external':
106
-            $transport = Swift_SmtpTransport::newInstance()
107
-                ->setHost(Site::getPreference('SMTP_HOST'))
108
-                ->setPort(Site::getPreference('SMTP_PORT'))
109
-                ->setLocalDomain(Site::getPreference('SMTP_HELO'));
101
+			case 'internal':
102
+				return Swift_MailTransport::newInstance();
103
+			case 'sendmail':
104
+				return Swift_SendmailTransport::newInstance();
105
+			case 'external':
106
+            	$transport = Swift_SmtpTransport::newInstance()
107
+                	->setHost(Site::getPreference('SMTP_HOST'))
108
+                	->setPort(Site::getPreference('SMTP_PORT'))
109
+                	->setLocalDomain(Site::getPreference('SMTP_HELO'));
110 110
 
111
-            if (Site::getPreference('SMTP_AUTH')) {
112
-                $transport
113
-                    ->setUsername(Site::getPreference('SMTP_AUTH_USER'))
114
-                    ->setPassword(Site::getPreference('SMTP_AUTH_PASS'));
115
-            }
111
+            	if (Site::getPreference('SMTP_AUTH')) {
112
+                	$transport
113
+                    	->setUsername(Site::getPreference('SMTP_AUTH_USER'))
114
+                    	->setPassword(Site::getPreference('SMTP_AUTH_PASS'));
115
+            	}
116 116
 
117
-            if (Site::getPreference('SMTP_SSL') !== 'none') {
118
-                $transport->setEncryption(Site::getPreference('SMTP_SSL'));
119
-            }
117
+            	if (Site::getPreference('SMTP_SSL') !== 'none') {
118
+                	$transport->setEncryption(Site::getPreference('SMTP_SSL'));
119
+            	}
120 120
 
121
-			return $transport;
122
-		default:
123
-			// For testing
124
-			return Swift_NullTransport::newInstance();
121
+				return $transport;
122
+			default:
123
+				// For testing
124
+				return Swift_NullTransport::newInstance();
125 125
 		}
126 126
 	}
127 127
 }
Please login to merge, or discard this patch.
edit_changes.php 1 patch
Switch Indentation   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -49,72 +49,72 @@  discard block
 block discarded – undo
49 49
 echo '<div id="pending"><h2>', I18N::translate('Pending changes'), '</h2>';
50 50
 
51 51
 switch ($action) {
52
-case 'undo':
53
-	$gedcom_id = Database::prepare("SELECT gedcom_id FROM `##change` WHERE change_id=?")->execute(array($change_id))->fetchOne();
54
-	$xref      = Database::prepare("SELECT xref      FROM `##change` WHERE change_id=?")->execute(array($change_id))->fetchOne();
55
-	// Undo a change, and subsequent changes to the same record
56
-	Database::prepare(
57
-		"UPDATE `##change`" .
58
-		" SET   status     = 'rejected'" .
59
-		" WHERE status     = 'pending'" .
60
-		" AND   gedcom_id  = ?" .
61
-		" AND   xref       = ?" .
62
-		" AND   change_id >= ?"
63
-	)->execute(array($gedcom_id, $xref, $change_id));
64
-	break;
65
-case 'accept':
66
-	$gedcom_id = Database::prepare("SELECT gedcom_id FROM `##change` WHERE change_id=?")->execute(array($change_id))->fetchOne();
67
-	$xref      = Database::prepare("SELECT xref      FROM `##change` WHERE change_id=?")->execute(array($change_id))->fetchOne();
68
-	// Accept a change, and all previous changes to the same record
69
-	$changes = Database::prepare(
70
-		"SELECT change_id, gedcom_id, gedcom_name, xref, old_gedcom, new_gedcom" .
71
-		" FROM  `##change` c" .
72
-		" JOIN  `##gedcom` g USING (gedcom_id)" .
73
-		" WHERE c.status   = 'pending'" .
74
-		" AND   gedcom_id  = ?" .
75
-		" AND   xref       = ?" .
76
-		" AND   change_id <= ?" .
77
-		" ORDER BY change_id"
78
-	)->execute(array($gedcom_id, $xref, $change_id))->fetchAll();
79
-	foreach ($changes as $change) {
80
-		if (empty($change->new_gedcom)) {
81
-			// delete
82
-			FunctionsImport::updateRecord($change->old_gedcom, $gedcom_id, true);
83
-		} else {
84
-			// add/update
85
-			FunctionsImport::updateRecord($change->new_gedcom, $gedcom_id, false);
52
+	case 'undo':
53
+		$gedcom_id = Database::prepare("SELECT gedcom_id FROM `##change` WHERE change_id=?")->execute(array($change_id))->fetchOne();
54
+		$xref      = Database::prepare("SELECT xref      FROM `##change` WHERE change_id=?")->execute(array($change_id))->fetchOne();
55
+		// Undo a change, and subsequent changes to the same record
56
+		Database::prepare(
57
+			"UPDATE `##change`" .
58
+			" SET   status     = 'rejected'" .
59
+			" WHERE status     = 'pending'" .
60
+			" AND   gedcom_id  = ?" .
61
+			" AND   xref       = ?" .
62
+			" AND   change_id >= ?"
63
+		)->execute(array($gedcom_id, $xref, $change_id));
64
+		break;
65
+	case 'accept':
66
+		$gedcom_id = Database::prepare("SELECT gedcom_id FROM `##change` WHERE change_id=?")->execute(array($change_id))->fetchOne();
67
+		$xref      = Database::prepare("SELECT xref      FROM `##change` WHERE change_id=?")->execute(array($change_id))->fetchOne();
68
+		// Accept a change, and all previous changes to the same record
69
+		$changes = Database::prepare(
70
+			"SELECT change_id, gedcom_id, gedcom_name, xref, old_gedcom, new_gedcom" .
71
+			" FROM  `##change` c" .
72
+			" JOIN  `##gedcom` g USING (gedcom_id)" .
73
+			" WHERE c.status   = 'pending'" .
74
+			" AND   gedcom_id  = ?" .
75
+			" AND   xref       = ?" .
76
+			" AND   change_id <= ?" .
77
+			" ORDER BY change_id"
78
+		)->execute(array($gedcom_id, $xref, $change_id))->fetchAll();
79
+		foreach ($changes as $change) {
80
+			if (empty($change->new_gedcom)) {
81
+				// delete
82
+				FunctionsImport::updateRecord($change->old_gedcom, $gedcom_id, true);
83
+			} else {
84
+				// add/update
85
+				FunctionsImport::updateRecord($change->new_gedcom, $gedcom_id, false);
86
+			}
87
+			Database::prepare("UPDATE `##change` SET status='accepted' WHERE change_id=?")->execute(array($change->change_id));
88
+			Log::addEditLog("Accepted change {$change->change_id} for {$change->xref} / {$change->gedcom_name} into database");
86 89
 		}
87
-		Database::prepare("UPDATE `##change` SET status='accepted' WHERE change_id=?")->execute(array($change->change_id));
88
-		Log::addEditLog("Accepted change {$change->change_id} for {$change->xref} / {$change->gedcom_name} into database");
89
-	}
90
-	break;
91
-case 'undoall':
92
-	Database::prepare(
93
-		"UPDATE `##change`" .
94
-		" SET status='rejected'" .
95
-		" WHERE status='pending' AND gedcom_id=?"
96
-	)->execute(array($WT_TREE->getTreeId()));
97
-	break;
98
-case 'acceptall':
99
-	$changes = Database::prepare(
100
-		"SELECT change_id, gedcom_id, gedcom_name, xref, old_gedcom, new_gedcom" .
101
-		" FROM `##change` c" .
102
-		" JOIN `##gedcom` g USING (gedcom_id)" .
103
-		" WHERE c.status='pending' AND gedcom_id=?" .
104
-		" ORDER BY change_id"
105
-	)->execute(array($WT_TREE->getTreeId()))->fetchAll();
106
-	foreach ($changes as $change) {
107
-		if (empty($change->new_gedcom)) {
108
-			// delete
109
-			FunctionsImport::updateRecord($change->old_gedcom, $change->gedcom_id, true);
110
-		} else {
111
-			// add/update
112
-			FunctionsImport::updateRecord($change->new_gedcom, $change->gedcom_id, false);
90
+		break;
91
+	case 'undoall':
92
+		Database::prepare(
93
+			"UPDATE `##change`" .
94
+			" SET status='rejected'" .
95
+			" WHERE status='pending' AND gedcom_id=?"
96
+		)->execute(array($WT_TREE->getTreeId()));
97
+		break;
98
+	case 'acceptall':
99
+		$changes = Database::prepare(
100
+			"SELECT change_id, gedcom_id, gedcom_name, xref, old_gedcom, new_gedcom" .
101
+			" FROM `##change` c" .
102
+			" JOIN `##gedcom` g USING (gedcom_id)" .
103
+			" WHERE c.status='pending' AND gedcom_id=?" .
104
+			" ORDER BY change_id"
105
+		)->execute(array($WT_TREE->getTreeId()))->fetchAll();
106
+		foreach ($changes as $change) {
107
+			if (empty($change->new_gedcom)) {
108
+				// delete
109
+				FunctionsImport::updateRecord($change->old_gedcom, $change->gedcom_id, true);
110
+			} else {
111
+				// add/update
112
+				FunctionsImport::updateRecord($change->new_gedcom, $change->gedcom_id, false);
113
+			}
114
+			Database::prepare("UPDATE `##change` SET status='accepted' WHERE change_id=?")->execute(array($change->change_id));
115
+			Log::addEditLog("Accepted change {$change->change_id} for {$change->xref} / {$change->gedcom_name} into database");
113 116
 		}
114
-		Database::prepare("UPDATE `##change` SET status='accepted' WHERE change_id=?")->execute(array($change->change_id));
115
-		Log::addEditLog("Accepted change {$change->change_id} for {$change->xref} / {$change->gedcom_name} into database");
116
-	}
117
-	break;
117
+		break;
118 118
 }
119 119
 
120 120
 $changed_gedcoms = Database::prepare(
@@ -146,27 +146,27 @@  discard block
 block discarded – undo
146 146
 
147 147
 
148 148
 		switch ($match[1]) {
149
-		case 'INDI':
150
-			$record = new Individual($change->xref, $change->old_gedcom, $change->new_gedcom, $tree);
151
-			break;
152
-		case 'FAM':
153
-			$record = new Family($change->xref, $change->old_gedcom, $change->new_gedcom, $tree);
154
-			break;
155
-		case 'SOUR':
156
-			$record = new Source($change->xref, $change->old_gedcom, $change->new_gedcom, $tree);
157
-			break;
158
-		case 'REPO':
159
-			$record = new Repository($change->xref, $change->old_gedcom, $change->new_gedcom, $tree);
160
-			break;
161
-		case 'OBJE':
162
-			$record = new Media($change->xref, $change->old_gedcom, $change->new_gedcom, $tree);
163
-			break;
164
-		case 'NOTE':
165
-			$record = new Note($change->xref, $change->old_gedcom, $change->new_gedcom, $tree);
166
-			break;
167
-		default:
168
-			$record = new GedcomRecord($change->xref, $change->old_gedcom, $change->new_gedcom, $tree);
169
-			break;
149
+			case 'INDI':
150
+				$record = new Individual($change->xref, $change->old_gedcom, $change->new_gedcom, $tree);
151
+				break;
152
+			case 'FAM':
153
+				$record = new Family($change->xref, $change->old_gedcom, $change->new_gedcom, $tree);
154
+				break;
155
+			case 'SOUR':
156
+				$record = new Source($change->xref, $change->old_gedcom, $change->new_gedcom, $tree);
157
+				break;
158
+			case 'REPO':
159
+				$record = new Repository($change->xref, $change->old_gedcom, $change->new_gedcom, $tree);
160
+				break;
161
+			case 'OBJE':
162
+				$record = new Media($change->xref, $change->old_gedcom, $change->new_gedcom, $tree);
163
+				break;
164
+			case 'NOTE':
165
+				$record = new Note($change->xref, $change->old_gedcom, $change->new_gedcom, $tree);
166
+				break;
167
+			default:
168
+				$record = new GedcomRecord($change->xref, $change->old_gedcom, $change->new_gedcom, $tree);
169
+				break;
170 170
 		}
171 171
 		if ($change->xref != $prev_xref || $change->gedcom_id != $prev_gedcom_id) {
172 172
 			if ($prev_xref) {
Please login to merge, or discard this patch.
search_advanced.php 1 patch
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -185,18 +185,18 @@
 block discarded – undo
185 185
 				$searchField  = $controller->getField($k);
186 186
 				$searchOption = substr($searchField, 20); // Assume we have something like "FAMC:HUSB:NAME:GIVN:foo"
187 187
 				switch (substr($searchField, 0, 20)) {
188
-				case 'FAMC:HUSB:NAME:GIVN:':
189
-					$fatherGivnOption = $searchOption;
190
-					break;
191
-				case 'FAMC:HUSB:NAME:SURN:':
192
-					$fatherSurnOption = $searchOption;
193
-					break;
194
-				case 'FAMC:WIFE:NAME:GIVN:':
195
-					$motherGivnOption = $searchOption;
196
-					break;
197
-				case 'FAMC:WIFE:NAME:SURN:':
198
-					$motherSurnOption = $searchOption;
199
-					break;
188
+					case 'FAMC:HUSB:NAME:GIVN:':
189
+						$fatherGivnOption = $searchOption;
190
+						break;
191
+					case 'FAMC:HUSB:NAME:SURN:':
192
+						$fatherSurnOption = $searchOption;
193
+						break;
194
+					case 'FAMC:WIFE:NAME:GIVN:':
195
+						$motherGivnOption = $searchOption;
196
+						break;
197
+					case 'FAMC:WIFE:NAME:SURN:':
198
+						$motherSurnOption = $searchOption;
199
+						break;
200 200
 				}
201 201
 			}
202 202
 			?>
Please login to merge, or discard this patch.
message.php 1 patch
Switch Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -65,20 +65,20 @@
 block discarded – undo
65 65
 // Ensure the user always visits this page twice - once to compose it and again to send it.
66 66
 // This makes it harder for spammers.
67 67
 switch ($action) {
68
-case 'compose':
69
-	Session::put('good_to_send', true);
70
-	break;
71
-case 'send':
72
-	// Only send messages if we've come straight from the compose page.
73
-	if (!Session::get('good_to_send')) {
74
-		Log::addAuthenticationLog('Attempt to send a message without visiting the compose page. Spam attack?');
75
-		$action = 'compose';
76
-	}
77
-	if (!Filter::checkCsrf()) {
78
-		$action = 'compose';
79
-	}
80
-	Session::forget('good_to_send');
81
-	break;
68
+	case 'compose':
69
+		Session::put('good_to_send', true);
70
+		break;
71
+	case 'send':
72
+		// Only send messages if we've come straight from the compose page.
73
+		if (!Session::get('good_to_send')) {
74
+			Log::addAuthenticationLog('Attempt to send a message without visiting the compose page. Spam attack?');
75
+			$action = 'compose';
76
+		}
77
+		if (!Filter::checkCsrf()) {
78
+			$action = 'compose';
79
+		}
80
+		Session::forget('good_to_send');
81
+		break;
82 82
 }
83 83
 
84 84
 switch ($action) {
Please login to merge, or discard this patch.
calendar.php 1 patch
Switch Indentation   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -118,15 +118,15 @@  discard block
 block discarded – undo
118 118
 $controller->setPageTitle(I18N::translate('Anniversary calendar'));
119 119
 
120 120
 switch ($view) {
121
-case 'day':
122
-	$controller->setPageTitle(I18N::translate('On this day…') . ' ' . $ged_date->display(false));
123
-	break;
124
-case 'month':
125
-	$controller->setPageTitle(I18N::translate('In this month…') . ' ' . $ged_date->display(false, '%F %Y'));
126
-	break;
127
-case 'year':
128
-	$controller->setPageTitle(I18N::translate('In this year…') . ' ' . $ged_date->display(false, '%Y'));
129
-	break;
121
+	case 'day':
122
+		$controller->setPageTitle(I18N::translate('On this day…') . ' ' . $ged_date->display(false));
123
+		break;
124
+	case 'month':
125
+		$controller->setPageTitle(I18N::translate('In this month…') . ' ' . $ged_date->display(false, '%F %Y'));
126
+		break;
127
+	case 'year':
128
+		$controller->setPageTitle(I18N::translate('In this year…') . ' ' . $ged_date->display(false, '%Y'));
129
+		break;
130 130
 }
131 131
 
132 132
 $controller->pageHeader();
@@ -329,38 +329,38 @@  discard block
 block discarded – undo
329 329
 $found_facts = array();
330 330
 
331 331
 switch ($view) {
332
-case 'day':
333
-	$found_facts = apply_filter(FunctionsDb::getAnniversaryEvents($cal_date->minJD, $filterev, $WT_TREE), $filterof, $filtersx);
334
-	break;
335
-case 'month':
336
-	$cal_date->d = 0;
337
-	$cal_date->setJdFromYmd();
338
-	// Make a separate list for each day. Unspecified/invalid days go in day 0.
339
-	for ($d = 0; $d <= $days_in_month; ++$d) {
340
-		$found_facts[$d] = array();
341
-	}
342
-	// Fetch events for each day
343
-	for ($jd = $cal_date->minJD; $jd <= $cal_date->maxJD; ++$jd) {
344
-		foreach (apply_filter(FunctionsDb::getAnniversaryEvents($jd, $filterev, $WT_TREE), $filterof, $filtersx) as $fact) {
345
-			$tmp = $fact->getDate()->minimumDate();
346
-			if ($tmp->d >= 1 && $tmp->d <= $tmp->daysInMonth()) {
347
-				// If the day is valid (for its own calendar), display it in the
348
-				// anniversary day (for the display calendar).
349
-				$found_facts[$jd - $cal_date->minJD + 1][] = $fact;
350
-			} else {
351
-				// Otherwise, display it in the "Day not set" box.
352
-				$found_facts[0][] = $fact;
332
+	case 'day':
333
+		$found_facts = apply_filter(FunctionsDb::getAnniversaryEvents($cal_date->minJD, $filterev, $WT_TREE), $filterof, $filtersx);
334
+		break;
335
+	case 'month':
336
+		$cal_date->d = 0;
337
+		$cal_date->setJdFromYmd();
338
+		// Make a separate list for each day. Unspecified/invalid days go in day 0.
339
+		for ($d = 0; $d <= $days_in_month; ++$d) {
340
+			$found_facts[$d] = array();
341
+		}
342
+		// Fetch events for each day
343
+		for ($jd = $cal_date->minJD; $jd <= $cal_date->maxJD; ++$jd) {
344
+			foreach (apply_filter(FunctionsDb::getAnniversaryEvents($jd, $filterev, $WT_TREE), $filterof, $filtersx) as $fact) {
345
+				$tmp = $fact->getDate()->minimumDate();
346
+				if ($tmp->d >= 1 && $tmp->d <= $tmp->daysInMonth()) {
347
+					// If the day is valid (for its own calendar), display it in the
348
+					// anniversary day (for the display calendar).
349
+					$found_facts[$jd - $cal_date->minJD + 1][] = $fact;
350
+				} else {
351
+					// Otherwise, display it in the "Day not set" box.
352
+					$found_facts[0][] = $fact;
353
+				}
353 354
 			}
354 355
 		}
355
-	}
356
-	break;
357
-case 'year':
358
-	$cal_date->m = 0;
359
-	$cal_date->setJdFromYmd();
360
-	$found_facts = apply_filter(FunctionsDb::getCalendarEvents($ged_date->minimumJulianDay(), $ged_date->maximumJulianDay(), $filterev, $WT_TREE), $filterof, $filtersx);
361
-	// Eliminate duplicates (e.g. BET JUL 1900 AND SEP 1900 will appear twice in 1900)
362
-	$found_facts = array_unique($found_facts);
363
-	break;
356
+		break;
357
+	case 'year':
358
+		$cal_date->m = 0;
359
+		$cal_date->setJdFromYmd();
360
+		$found_facts = apply_filter(FunctionsDb::getCalendarEvents($ged_date->minimumJulianDay(), $ged_date->maximumJulianDay(), $filterev, $WT_TREE), $filterof, $filtersx);
361
+		// Eliminate duplicates (e.g. BET JUL 1900 AND SEP 1900 will appear twice in 1900)
362
+		$found_facts = array_unique($found_facts);
363
+		break;
364 364
 }
365 365
 
366 366
 // Group the facts by family/individual
@@ -369,39 +369,39 @@  discard block
 block discarded – undo
369 369
 $cal_facts = array();
370 370
 
371 371
 switch ($view) {
372
-case 'year':
373
-case 'day':
374
-	foreach ($found_facts as $fact) {
375
-		$record = $fact->getParent();
376
-		$xref   = $record->getXref();
377
-		if ($record instanceof Individual) {
378
-			if (empty($indis[$xref])) {
379
-				$indis[$xref] = calendar_fact_text($fact, true);
380
-			} else {
381
-				$indis[$xref] .= '<br>' . calendar_fact_text($fact, true);
382
-			}
383
-		} elseif ($record instanceof Family) {
384
-			if (empty($indis[$xref])) {
385
-				$fams[$xref] = calendar_fact_text($fact, true);
386
-			} else {
387
-				$fams[$xref] .= '<br>' . calendar_fact_text($fact, true);
372
+	case 'year':
373
+	case 'day':
374
+		foreach ($found_facts as $fact) {
375
+			$record = $fact->getParent();
376
+			$xref   = $record->getXref();
377
+			if ($record instanceof Individual) {
378
+				if (empty($indis[$xref])) {
379
+					$indis[$xref] = calendar_fact_text($fact, true);
380
+				} else {
381
+					$indis[$xref] .= '<br>' . calendar_fact_text($fact, true);
382
+				}
383
+			} elseif ($record instanceof Family) {
384
+				if (empty($indis[$xref])) {
385
+					$fams[$xref] = calendar_fact_text($fact, true);
386
+				} else {
387
+					$fams[$xref] .= '<br>' . calendar_fact_text($fact, true);
388
+				}
388 389
 			}
389 390
 		}
390
-	}
391
-	break;
392
-case 'month':
393
-	foreach ($found_facts as $d => $facts) {
394
-		$cal_facts[$d] = array();
395
-		foreach ($facts as $fact) {
396
-			$xref = $fact->getParent()->getXref();
397
-			if (empty($cal_facts[$d][$xref])) {
398
-				$cal_facts[$d][$xref] = calendar_fact_text($fact, false);
399
-			} else {
400
-				$cal_facts[$d][$xref] .= '<br>' . calendar_fact_text($fact, false);
391
+		break;
392
+	case 'month':
393
+		foreach ($found_facts as $d => $facts) {
394
+			$cal_facts[$d] = array();
395
+			foreach ($facts as $fact) {
396
+				$xref = $fact->getParent()->getXref();
397
+				if (empty($cal_facts[$d][$xref])) {
398
+					$cal_facts[$d][$xref] = calendar_fact_text($fact, false);
399
+				} else {
400
+					$cal_facts[$d][$xref] .= '<br>' . calendar_fact_text($fact, false);
401
+				}
401 402
 			}
402 403
 		}
403
-	}
404
-	break;
404
+		break;
405 405
 }
406 406
 
407 407
 switch ($view) {
@@ -498,26 +498,26 @@  discard block
 block discarded – undo
498 498
 			// Show a converted date
499 499
 			foreach (explode('_and_', $CALENDAR_FORMAT) as $convcal) {
500 500
 				switch ($convcal) {
501
-				case 'french':
502
-					$alt_date = new FrenchDate($cal_date->minJD + $d - 1);
503
-					break;
504
-				case 'gregorian':
505
-					$alt_date = new GregorianDate($cal_date->minJD + $d - 1);
506
-					break;
507
-				case 'jewish':
508
-					$alt_date = new JewishDate($cal_date->minJD + $d - 1);
509
-					break;
510
-				case 'julian':
511
-					$alt_date = new JulianDate($cal_date->minJD + $d - 1);
512
-					break;
513
-				case 'hijri':
514
-					$alt_date = new HijriDate($cal_date->minJD + $d - 1);
515
-					break;
516
-				case 'jalali':
517
-					$alt_date = new JalaliDate($cal_date->minJD + $d - 1);
518
-					break;
519
-				default:
520
-					break 2;
501
+					case 'french':
502
+						$alt_date = new FrenchDate($cal_date->minJD + $d - 1);
503
+						break;
504
+					case 'gregorian':
505
+						$alt_date = new GregorianDate($cal_date->minJD + $d - 1);
506
+						break;
507
+					case 'jewish':
508
+						$alt_date = new JewishDate($cal_date->minJD + $d - 1);
509
+						break;
510
+					case 'julian':
511
+						$alt_date = new JulianDate($cal_date->minJD + $d - 1);
512
+						break;
513
+					case 'hijri':
514
+						$alt_date = new HijriDate($cal_date->minJD + $d - 1);
515
+						break;
516
+					case 'jalali':
517
+						$alt_date = new JalaliDate($cal_date->minJD + $d - 1);
518
+						break;
519
+					default:
520
+						break 2;
521 521
 				}
522 522
 				if (get_class($alt_date) !== get_class($cal_date) && $alt_date->inValidRange()) {
523 523
 					echo '<span class="rtl_cal_day">' . $alt_date->format("%j %M") . '</span>';
@@ -627,17 +627,17 @@  discard block
 block discarded – undo
627 627
 		$html .= $tag1 . '<a href="' . $tmp->getHtmlUrl() . '">' . $tmp->getFullName() . '</a> ';
628 628
 		if ($show_sex_symbols && $tmp instanceof Individual) {
629 629
 			switch ($tmp->getSex()) {
630
-			case 'M':
631
-				$html .= '<i class="icon-sex_m_9x9" title="' . I18N::translate('Male') . '"></i>';
632
-				++$males;
633
-				break;
634
-			case 'F':
635
-				$html .= '<i class="icon-sex_f_9x9" title="' . I18N::translate('Female') . '"></i>';
636
-				++$females;
637
-				break;
638
-			default:
639
-				$html .= '<i class="icon-sex_u_9x9" title="' . I18N::translateContext('unknown gender', 'Unknown') . '"></i>';
640
-				break;
630
+				case 'M':
631
+					$html .= '<i class="icon-sex_m_9x9" title="' . I18N::translate('Male') . '"></i>';
632
+					++$males;
633
+					break;
634
+				case 'F':
635
+					$html .= '<i class="icon-sex_f_9x9" title="' . I18N::translate('Female') . '"></i>';
636
+					++$females;
637
+					break;
638
+				default:
639
+					$html .= '<i class="icon-sex_u_9x9" title="' . I18N::translateContext('unknown gender', 'Unknown') . '"></i>';
640
+					break;
641 641
 			}
642 642
 		}
643 643
 		$html .= '<div class="indent">' . $facts . '</div>' . $tag2;
Please login to merge, or discard this patch.
app/Theme/MinimalTheme.php 1 patch
Switch Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,10 +41,10 @@
 block discarded – undo
41 41
 	protected function flashMessageContainer(\stdClass $message) {
42 42
 		// This theme uses jQueryUI markup.
43 43
 		switch ($message->status) {
44
-		case 'danger':
45
-			return '<p class="ui-state-error">' . $message->text . '</p>';
46
-		default:
47
-			return '<p class="ui-state-highlight">' . $message->text . '</p>';
44
+			case 'danger':
45
+				return '<p class="ui-state-error">' . $message->text . '</p>';
46
+			default:
47
+				return '<p class="ui-state-highlight">' . $message->text . '</p>';
48 48
 		}
49 49
 	}
50 50
 
Please login to merge, or discard this patch.