Completed
Branch develop (b6db7c)
by Greg
09:30
created
resources/views/admin/media.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
 <br>
78 78
 <br>
79 79
 
80
-<table class="table table-bordered table-sm" id="media-table-<?= e($table_id) ?>" data-ajax="<?= e(route('admin-media-data', ['files' => $files, 'media_folder' => $media_folder, 'media_path' => $media_path, 'subfolders' => $subfolders ])) ?>">
80
+<table class="table table-bordered table-sm" id="media-table-<?= e($table_id) ?>" data-ajax="<?= e(route('admin-media-data', ['files' => $files, 'media_folder' => $media_folder, 'media_path' => $media_path, 'subfolders' => $subfolders])) ?>">
81 81
 	<thead>
82 82
 		<tr>
83 83
 			<th><?= I18N::translate('Media file') ?></th>
Please login to merge, or discard this patch.
resources/views/admin/trees-import.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 							<select name="tree_name" class="form-control" id="import-server-file">
47 47
 								<option value=""></option>
48 48
 								<?php foreach ($gedcom_files as $gedcom_file): ?>
49
-									<option value="<?= e($gedcom_file) ?>" <?= $gedcom_file === $default_gedcom_file? 'selected' : '' ?>>
49
+									<option value="<?= e($gedcom_file) ?>" <?= $gedcom_file === $default_gedcom_file ? 'selected' : '' ?>>
50 50
 										<?= e($gedcom_file) ?>
51 51
 									</option>
52 52
 								<?php endforeach ?>
Please login to merge, or discard this patch.
resources/views/lists/notes-table.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 $count_media       = Database::prepare(
15 15
 	"SELECT l_to, COUNT(*) FROM `##media` JOIN `##link` ON l_from = m_id AND l_file = m_file AND l_type = 'NOTE' AND l_file = :tree_id GROUP BY l_to"
16 16
 )->execute(['tree_id' => $tree->getTreeId()])->fetchAssoc();
17
-$count_sources       = Database::prepare(
17
+$count_sources = Database::prepare(
18 18
 	"SELECT l_to, COUNT(*) FROM `##sources` JOIN `##link` ON l_from = s_id AND l_file = s_file AND l_type = 'NOTE' AND l_file = :tree_id GROUP BY l_to"
19 19
 )->execute(['tree_id' => $tree->getTreeId()])->fetchAssoc();
20 20
 ?>
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,29 +6,29 @@
 block discarded – undo
6 6
 // It is not good to bypass privacy, but many servers do not have the resources
7 7
 // to process privacy for every record in the tree
8 8
 $count_individuals = Database::prepare(
9
-	"SELECT l_to, COUNT(*) FROM `##individuals` JOIN `##link` ON l_from = i_id AND l_file = i_file AND l_type = 'NOTE' AND l_file = :tree_id GROUP BY l_to"
9
+    "SELECT l_to, COUNT(*) FROM `##individuals` JOIN `##link` ON l_from = i_id AND l_file = i_file AND l_type = 'NOTE' AND l_file = :tree_id GROUP BY l_to"
10 10
 )->execute(['tree_id' => $tree->getTreeId()])->fetchAssoc();
11 11
 $count_families    = Database::prepare(
12
-	"SELECT l_to, COUNT(*) FROM `##families` JOIN `##link` ON l_from = f_id AND l_file = f_file AND l_type = 'NOTE' AND l_file = :tree_id GROUP BY l_to"
12
+    "SELECT l_to, COUNT(*) FROM `##families` JOIN `##link` ON l_from = f_id AND l_file = f_file AND l_type = 'NOTE' AND l_file = :tree_id GROUP BY l_to"
13 13
 )->execute(['tree_id' => $tree->getTreeId()])->fetchAssoc();
14 14
 $count_media       = Database::prepare(
15
-	"SELECT l_to, COUNT(*) FROM `##media` JOIN `##link` ON l_from = m_id AND l_file = m_file AND l_type = 'NOTE' AND l_file = :tree_id GROUP BY l_to"
15
+    "SELECT l_to, COUNT(*) FROM `##media` JOIN `##link` ON l_from = m_id AND l_file = m_file AND l_type = 'NOTE' AND l_file = :tree_id GROUP BY l_to"
16 16
 )->execute(['tree_id' => $tree->getTreeId()])->fetchAssoc();
17 17
 $count_sources       = Database::prepare(
18
-	"SELECT l_to, COUNT(*) FROM `##sources` JOIN `##link` ON l_from = s_id AND l_file = s_file AND l_type = 'NOTE' AND l_file = :tree_id GROUP BY l_to"
18
+    "SELECT l_to, COUNT(*) FROM `##sources` JOIN `##link` ON l_from = s_id AND l_file = s_file AND l_type = 'NOTE' AND l_file = :tree_id GROUP BY l_to"
19 19
 )->execute(['tree_id' => $tree->getTreeId()])->fetchAssoc();
20 20
 ?>
21 21
 
22 22
 <table
23 23
 	class="table table-bordered table-sm wt-table-note datatables"
24 24
 	data-columns="<?= e(json_encode([
25
-		null,
26
-		['visible' => array_sum($count_individuals) > 0],
27
-		['visible' => array_sum($count_families) > 0],
28
-		['visible' => array_sum($count_media) > 0],
29
-		['visible' => array_sum($count_sources) > 0],
30
-		['visible' => (bool) $tree->getPreference('SHOW_LAST_CHANGE'), 'searchable' => false],
31
-	])) ?>"
25
+        null,
26
+        ['visible' => array_sum($count_individuals) > 0],
27
+        ['visible' => array_sum($count_families) > 0],
28
+        ['visible' => array_sum($count_media) > 0],
29
+        ['visible' => array_sum($count_sources) > 0],
30
+        ['visible' => (bool) $tree->getPreference('SHOW_LAST_CHANGE'), 'searchable' => false],
31
+    ])) ?>"
32 32
 	data-state-save="true"
33 33
 >
34 34
 	<caption class="sr-only">
Please login to merge, or discard this patch.
resources/views/lists/chart-by-decade.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 }
25 25
 $chart_url .= '|1:||' . rawurlencode(I18N::percentage($vmax / $count)); // y axis
26 26
 $chart_url .= '|2:||';
27
-$step      = $vmax;
27
+$step = $vmax;
28 28
 for ($d = $vmax; $d > 0; $d--) {
29 29
 	if ($vmax < ($d * 10 + 1) && ($vmax % $d) == 0) {
30 30
 		$step = $d;
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -4,12 +4,12 @@  discard block
 block discarded – undo
4 4
 $count = 0;
5 5
 $vmax  = 0;
6 6
 foreach ($data as $v) {
7
-	$n     = strlen($v);
8
-	$vmax  = max($vmax, $n);
9
-	$count += $n;
7
+    $n     = strlen($v);
8
+    $vmax  = max($vmax, $n);
9
+    $count += $n;
10 10
 }
11 11
 if ($count < 1) {
12
-	return '';
12
+    return '';
13 13
 }
14 14
 $chart_url = 'https://chart.googleapis.com/chart?cht=bvs'; // chart type
15 15
 $chart_url .= '&amp;chs=360x150'; // size
@@ -20,36 +20,36 @@  discard block
 block discarded – undo
20 20
 $chart_url .= '&amp;chxt=x,y,r'; // axis labels specification
21 21
 $chart_url .= '&amp;chxl=0:|&lt;|||'; // <1570
22 22
 for ($y = 1600; $y < 2030; $y += 50) {
23
-	$chart_url .= $y . '|||||'; // x axis
23
+    $chart_url .= $y . '|||||'; // x axis
24 24
 }
25 25
 $chart_url .= '|1:||' . rawurlencode(I18N::percentage($vmax / $count)); // y axis
26 26
 $chart_url .= '|2:||';
27 27
 $step      = $vmax;
28 28
 for ($d = $vmax; $d > 0; $d--) {
29
-	if ($vmax < ($d * 10 + 1) && ($vmax % $d) == 0) {
30
-		$step = $d;
31
-	}
29
+    if ($vmax < ($d * 10 + 1) && ($vmax % $d) == 0) {
30
+        $step = $d;
31
+    }
32 32
 }
33 33
 if ($step == $vmax) {
34
-	for ($d = $vmax - 1; $d > 0; $d--) {
35
-		if (($vmax - 1) < ($d * 10 + 1) && (($vmax - 1) % $d) == 0) {
36
-			$step = $d;
37
-		}
38
-	}
34
+    for ($d = $vmax - 1; $d > 0; $d--) {
35
+        if (($vmax - 1) < ($d * 10 + 1) && (($vmax - 1) % $d) == 0) {
36
+            $step = $d;
37
+        }
38
+    }
39 39
 }
40 40
 for ($n = $step; $n < $vmax; $n += $step) {
41
-	$chart_url .= $n . '|';
41
+    $chart_url .= $n . '|';
42 42
 }
43 43
 $chart_url        .= rawurlencode($vmax . ' / ' . $count); // r axis
44 44
 $chart_url        .= '&amp;chg=100,' . round(100 * $step / $vmax, 1) . ',1,5'; // grid
45 45
 $chart_url        .= '&amp;chd=s:'; // data : simple encoding from A=0 to 9=61
46 46
 $CHART_ENCODING61 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
47 47
 for ($y = 1570; $y < 2030; $y += 10) {
48
-	$chart_url .= $CHART_ENCODING61[(int) (substr_count($data[$y], 'M') * 61 / $vmax)];
48
+    $chart_url .= $CHART_ENCODING61[(int) (substr_count($data[$y], 'M') * 61 / $vmax)];
49 49
 }
50 50
 $chart_url .= ',';
51 51
 for ($y = 1570; $y < 2030; $y += 10) {
52
-	$chart_url .= $CHART_ENCODING61[(int) (substr_count($data[$y], 'F') * 61 / $vmax)];
52
+    $chart_url .= $CHART_ENCODING61[(int) (substr_count($data[$y], 'F') * 61 / $vmax)];
53 53
 }
54 54
 $html = '<img src="' . $chart_url . '" alt="' . $title . '" title="' . $title . '" class="gchart">';
55 55
 
Please login to merge, or discard this patch.
resources/views/lists/surnames-table.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,14 +43,14 @@
 block discarded – undo
43 43
 					<?php endforeach ?>
44 44
 				</td>
45 45
 
46
-				<td class="text-center" data-sort="<?= array_sum(array_map(function(array $x) { return count($x); }, $surns)) ?>">
46
+				<td class="text-center" data-sort="<?= array_sum(array_map(function (array $x) { return count($x); }, $surns)) ?>">
47 47
 					<?php foreach ($surns as $indis): ?>
48 48
 						<?= I18N::number(count($indis)) ?>
49 49
 						<br>
50 50
 					<?php endforeach ?>
51 51
 
52 52
 					<?php if (count($surns) > 1): ?>
53
-						<?= I18N::number(array_sum(array_map(function(array $x) { return count($x); }, $surns))) ?>
53
+						<?= I18N::number(array_sum(array_map(function (array $x) { return count($x); }, $surns))) ?>
54 54
 					<?php endif ?>
55 55
 				</td>
56 56
 			</tr>
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,8 @@  discard block
 block discarded – undo
12 12
 			<th>
13 13
 				<?php if ($route == 'family-list'):?>
14 14
 					<?= I18N::translate('Spouses') ?>
15
-				<?php else: ?>
15
+				<?php else {
16
+    : ?>
16 17
 					<?= I18N::translate('Individuals') ?>
17 18
 				<?php endif ?>
18 19
 			</th>
@@ -43,7 +44,9 @@  discard block
 block discarded – undo
43 44
 					<?php endforeach ?>
44 45
 				</td>
45 46
 
46
-				<td class="text-center" data-sort="<?= array_sum(array_map(function(array $x) { return count($x); }, $surns)) ?>">
47
+				<td class="text-center" data-sort="<?= array_sum(array_map(function(array $x) { return count($x);
48
+}
49
+}, $surns)) ?>">
47 50
 					<?php foreach ($surns as $indis): ?>
48 51
 						<?= I18N::number(count($indis)) ?>
49 52
 						<br>
Please login to merge, or discard this patch.
resources/views/edit/edit-fact.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
 						'level'          => 2,
40 40
 						'full_citations' => $tree->getPreference('FULL_SOURCES'),
41 41
 						'tree'           => $tree,
42
-					]);				}
42
+					]); }
43 43
 				if ($level1type !== 'OBJE') {
44 44
 					if ($tree->getPreference('MEDIA_UPLOAD') >= Auth::accessLevel($tree)) {
45 45
 						echo view('cards/add-media-object', [
Please login to merge, or discard this patch.
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -14,76 +14,76 @@  discard block
 block discarded – undo
14 14
 	<?php FunctionsEdit::createEditForm($edit_fact) ?>
15 15
 
16 16
 	<?php
17
-	$level1type = $edit_fact->getTag();
18
-	switch ($record::RECORD_TYPE) {
19
-		case 'REPO':
20
-			// REPO:NAME facts may take a NOTE (but the REPO record may not).
21
-			if ($level1type === 'NAME') {
22
-				echo view('cards/add-note', [
23
-					'level' => 2,
24
-					'tree' => $tree,
25
-				]);
26
-				echo view('addSimpleTag($tree, ', [
27
-					'level' => 2,
28
-					'tree' => $tree,
29
-				]);
30
-			}
31
-			break;
32
-		case 'FAM':
33
-		case 'INDI':
34
-			// FAM and INDI records have real facts. They can take NOTE/SOUR/OBJE/etc.
35
-			if ($level1type !== 'SEX' && $level1type !== 'NOTE' && $level1type !== 'ALIA') {
36
-				if ($level1type !== 'SOUR') {
37
-					echo view('cards/add-source-citation', [
38
-						'level'          => 2,
39
-						'full_citations' => $tree->getPreference('FULL_SOURCES'),
40
-						'tree'           => $tree,
41
-					]);				}
42
-				if ($level1type !== 'OBJE') {
43
-					if ($tree->getPreference('MEDIA_UPLOAD') >= Auth::accessLevel($tree)) {
44
-						echo view('cards/add-media-object', [
45
-							'level' => 2,
46
-							'tree'  => $tree,
47
-						]);
48
-					}
49
-				}
50
-				echo view('cards/add-note', [
51
-					'level' => 2,
52
-					'tree' => $tree,
53
-				]);
54
-				echo view('cards/add-shared-note', [
55
-					'level' => 2,
56
-					'tree' => $tree,
57
-				]);
58
-				if ($level1type !== 'ASSO' && $level1type !== 'NOTE' && $level1type !== 'SOUR') {
59
-					echo view('cards/add-associate', [
60
-						'id'    => Uuid::uuid4()->toString(),
61
-						'level' => 2,
62
-						'tree' => $tree,
63
-					]);
64
-				}
65
-				// allow to add godfather and godmother for CHR fact or best man and bridesmaid  for MARR fact in one window
66
-				if (in_array($level1type, Config::twoAssociates())) {
67
-					echo view('cards/add-associate', [
68
-						'id'    => Uuid::uuid4()->toString(),
69
-						'level' => 2,
70
-						'tree' => $tree,
71
-					]);
72
-				}
73
-				if ($level1type !== 'SOUR') {
74
-					echo view('cards/add-restriction', [
75
-						'level' => 2,
76
-						'tree' => $tree,
77
-					]);
78
-				}
79
-			}
80
-			break;
81
-		default:
82
-			// Other types of record do not have these lower-level records
83
-			break;
84
-	}
17
+    $level1type = $edit_fact->getTag();
18
+    switch ($record::RECORD_TYPE) {
19
+        case 'REPO':
20
+            // REPO:NAME facts may take a NOTE (but the REPO record may not).
21
+            if ($level1type === 'NAME') {
22
+                echo view('cards/add-note', [
23
+                    'level' => 2,
24
+                    'tree' => $tree,
25
+                ]);
26
+                echo view('addSimpleTag($tree, ', [
27
+                    'level' => 2,
28
+                    'tree' => $tree,
29
+                ]);
30
+            }
31
+            break;
32
+        case 'FAM':
33
+        case 'INDI':
34
+            // FAM and INDI records have real facts. They can take NOTE/SOUR/OBJE/etc.
35
+            if ($level1type !== 'SEX' && $level1type !== 'NOTE' && $level1type !== 'ALIA') {
36
+                if ($level1type !== 'SOUR') {
37
+                    echo view('cards/add-source-citation', [
38
+                        'level'          => 2,
39
+                        'full_citations' => $tree->getPreference('FULL_SOURCES'),
40
+                        'tree'           => $tree,
41
+                    ]);				}
42
+                if ($level1type !== 'OBJE') {
43
+                    if ($tree->getPreference('MEDIA_UPLOAD') >= Auth::accessLevel($tree)) {
44
+                        echo view('cards/add-media-object', [
45
+                            'level' => 2,
46
+                            'tree'  => $tree,
47
+                        ]);
48
+                    }
49
+                }
50
+                echo view('cards/add-note', [
51
+                    'level' => 2,
52
+                    'tree' => $tree,
53
+                ]);
54
+                echo view('cards/add-shared-note', [
55
+                    'level' => 2,
56
+                    'tree' => $tree,
57
+                ]);
58
+                if ($level1type !== 'ASSO' && $level1type !== 'NOTE' && $level1type !== 'SOUR') {
59
+                    echo view('cards/add-associate', [
60
+                        'id'    => Uuid::uuid4()->toString(),
61
+                        'level' => 2,
62
+                        'tree' => $tree,
63
+                    ]);
64
+                }
65
+                // allow to add godfather and godmother for CHR fact or best man and bridesmaid  for MARR fact in one window
66
+                if (in_array($level1type, Config::twoAssociates())) {
67
+                    echo view('cards/add-associate', [
68
+                        'id'    => Uuid::uuid4()->toString(),
69
+                        'level' => 2,
70
+                        'tree' => $tree,
71
+                    ]);
72
+                }
73
+                if ($level1type !== 'SOUR') {
74
+                    echo view('cards/add-restriction', [
75
+                        'level' => 2,
76
+                        'tree' => $tree,
77
+                    ]);
78
+                }
79
+            }
80
+            break;
81
+        default:
82
+            // Other types of record do not have these lower-level records
83
+            break;
84
+    }
85 85
 
86
-	?>
86
+    ?>
87 87
 
88 88
 	<div class="form-group row">
89 89
 		<label class="col-sm-3 col-form-label" for="keep_chan">
@@ -103,12 +103,12 @@  discard block
 block discarded – undo
103 103
 			<button class="btn btn-primary" type="submit">
104 104
 				<?= FontAwesome::decorativeIcon('save') ?>
105 105
 				<?= /* I18N: A button label. */
106
-				I18N::translate('save') ?>
106
+                I18N::translate('save') ?>
107 107
 			</button>
108 108
 			<a class="btn btn-secondary" href="<?= e($record->url()) ?>">
109 109
 				<?= FontAwesome::decorativeIcon('cancel') ?>
110 110
 				<?= /* I18N: A button label. */
111
-				I18N::translate('cancel') ?>
111
+                I18N::translate('cancel') ?>
112 112
 			</a>
113 113
 			<?php if ($can_edit_raw): ?>
114 114
 				<a class="btn btn-link" href="<?= e(route('edit-raw-fact', ['xref' => $record->getXref(), 'fact_id' => $edit_fact->getFactId(), 'ged' => $tree->getName()])) ?>">
Please login to merge, or discard this patch.
app/Module/LoggedInUsersModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
             }
65 65
         }
66 66
         $count_logged_in = count($logged_in);
67
-        $content         .= '<div class="logged_in_count">';
67
+        $content .= '<div class="logged_in_count">';
68 68
         if ($anonymous) {
69 69
             $content .= I18N::plural('%s anonymous signed-in user', '%s anonymous signed-in users', $anonymous, I18N::number($anonymous));
70 70
             if ($count_logged_in) {
Please login to merge, or discard this patch.
app/Module/BatchUpdate/BatchUpdateBasePlugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
      */
61 61
     public function getOptions(Request $request)
62 62
     {
63
-        $this->chan = (bool)$request->get('chan');
63
+        $this->chan = (bool) $request->get('chan');
64 64
     }
65 65
 
66 66
     /**
Please login to merge, or discard this patch.
app/Module/UpcomingAnniversariesModule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         $default_events = implode(',', self::DEFAULT_EVENTS);
117 117
 
118 118
         $days      = $this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS);
119
-        $filter    = (bool)$this->getBlockSetting($block_id, 'filter', self::DEFAULT_FILTER);
119
+        $filter    = (bool) $this->getBlockSetting($block_id, 'filter', self::DEFAULT_FILTER);
120 120
         $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', self::DEFAULT_STYLE);
121 121
         $sortStyle = $this->getBlockSetting($block_id, 'sortStyle', self::DEFAULT_SORT);
122 122
         $events    = $this->getBlockSetting($block_id, 'events', $default_events);
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         $events_filter = implode('|', $event_array);
135 135
 
136 136
         $startjd = WT_CLIENT_JD + 1;
137
-        $endjd   = WT_CLIENT_JD + (int)$days;
137
+        $endjd   = WT_CLIENT_JD + (int) $days;
138 138
 
139 139
         $facts = FunctionsDb::getEventsList($startjd, $endjd, $events_filter, $filter, $sortStyle, $tree);
140 140
 
Please login to merge, or discard this patch.