Completed
Push — master ( 544e34...6465ee )
by Jonathan
06:11
created
src/Webtrees/Module/AdminTasksModule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     public function getConfigLink() {
65 65
         Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION);
66 66
         
67
-        return 'module.php?mod=' . $this->getName() . '&mod_action=AdminConfig';
67
+        return 'module.php?mod='.$this->getName().'&mod_action=AdminConfig';
68 68
     }
69 69
     
70 70
     /**
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     public function getProvider() {
84 84
         global $WT_TREE;
85 85
         
86
-        if(!$this->provider) {
86
+        if (!$this->provider) {
87 87
             $this->provider = new GeoAnalysisProvider($WT_TREE);
88 88
         }
89 89
         return $this->provider;
Please login to merge, or discard this patch.
src/Webtrees/Module/PatronymicLineage/Model/LineageBuilder.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -54,30 +54,30 @@  discard block
 block discarded – undo
54 54
 	public function buildLineages() {				
55 55
 		$indis = \Fisharebest\Webtrees\Query\QueryName::individuals($this->tree, $this->surname, null, null, false, false);
56 56
 		
57
-		if(count($indis) == 0) return null;
57
+		if (count($indis) == 0) return null;
58 58
 		
59 59
 		$root_lineages = array();
60 60
 		
61
-		foreach($indis as $indi) {
61
+		foreach ($indis as $indi) {
62 62
 			$pid = $indi->getXref();
63
-			if(!isset($this->used_indis[$pid])){
63
+			if (!isset($this->used_indis[$pid])) {
64 64
 				//Find the root of the lineage
65 65
 				/** @var Fisharebest\Webtrees\Individual $indiFirst  */
66
-				$indiFirst= $this->getLineageRootIndividual($indi);
67
-				if($indiFirst){
66
+				$indiFirst = $this->getLineageRootIndividual($indi);
67
+				if ($indiFirst) {
68 68
 					$this->used_indis[$indiFirst->getXref()] = true;
69
-					if($indiFirst->canShow()){
69
+					if ($indiFirst->canShow()) {
70 70
 						//Check if the root individual has brothers and sisters, without parents
71 71
 						$indiChildFamily = $indiFirst->getPrimaryChildFamily();
72
-						if($indiChildFamily !== null){
72
+						if ($indiChildFamily !== null) {
73 73
 							$root_node = new LineageRootNode(null); 
74 74
 							$root_node->addFamily($indiChildFamily);
75 75
 						}
76
-						else{
76
+						else {
77 77
 							$root_node = new LineageRootNode($indiFirst);
78 78
 						}
79 79
 						$root_node = $this->buildLineage($root_node);		
80
-						if($root_node) $root_lineages[] = $root_node;
80
+						if ($root_node) $root_lineages[] = $root_node;
81 81
 					}
82 82
 				}
83 83
 			}
@@ -94,45 +94,45 @@  discard block
 block discarded – undo
94 94
 	 * @return (Individual|null) Root individual
95 95
 	 */
96 96
 	protected function getLineageRootIndividual(Individual $indi) {
97
-		$is_first=false;
97
+		$is_first = false;
98 98
 		$dindi = new \MyArtJaub\Webtrees\Individual($indi);
99
-		$indi_surname=$dindi->getUnprotectedPrimarySurname();
99
+		$indi_surname = $dindi->getUnprotectedPrimarySurname();
100 100
 		$resIndi = $indi;
101
-		while(!$is_first){
101
+		while (!$is_first) {
102 102
 			//Get the individual parents family
103
-			$fam=$resIndi->getPrimaryChildFamily();
104
-			if($fam){
105
-				$husb=$fam->getHusband();
106
-				$wife=$fam->getWife();
103
+			$fam = $resIndi->getPrimaryChildFamily();
104
+			if ($fam) {
105
+				$husb = $fam->getHusband();
106
+				$wife = $fam->getWife();
107 107
 				//If the father exists, take him
108
-				if($husb){
108
+				if ($husb) {
109 109
 					$dhusb = new \MyArtJaub\Webtrees\Individual($husb);
110
-					$dhusb->isNewAddition() ? $is_first = true : $resIndi=$husb;
110
+					$dhusb->isNewAddition() ? $is_first = true : $resIndi = $husb;
111 111
 				}
112 112
 				//If only a mother exists
113
-				else if($wife){
113
+				else if ($wife) {
114 114
 					$dwife = new \MyArtJaub\Webtrees\Individual($wife);
115
-					$wife_surname=$dwife->getUnprotectedPrimarySurname();
115
+					$wife_surname = $dwife->getUnprotectedPrimarySurname();
116 116
 					//Check if the child is a natural child of the mother (based on the surname - Warning : surname must be identical)
117
-					if(!$dwife->isNewAddition() && I18N::strcasecmp($wife_surname, $indi_surname) == 0){
118
-						$resIndi=$wife;
117
+					if (!$dwife->isNewAddition() && I18N::strcasecmp($wife_surname, $indi_surname) == 0) {
118
+						$resIndi = $wife;
119 119
 					}
120
-					else{
121
-						$is_first=true;
120
+					else {
121
+						$is_first = true;
122 122
 					}
123 123
 				}
124
-				else{
125
-					$is_first=true;
124
+				else {
125
+					$is_first = true;
126 126
 				}
127 127
 			}
128
-			else{
129
-				$is_first=true;
128
+			else {
129
+				$is_first = true;
130 130
 			}
131 131
 		}
132
-		if(isset($this->used_indis[$resIndi->getXref()])){
132
+		if (isset($this->used_indis[$resIndi->getXref()])) {
133 133
 			return null;
134 134
 		}
135
-		else{
135
+		else {
136 136
 			return $resIndi;
137 137
 		}
138 138
 	}
@@ -145,15 +145,15 @@  discard block
 block discarded – undo
145 145
 	 * @return LineageNode Computed lineage
146 146
 	 */
147 147
 	protected function buildLineage(LineageNode $node) {
148
-		if($node === null) return;
148
+		if ($node === null) return;
149 149
 		
150 150
 		$indi_surname = null;
151 151
 		
152 152
 		$indi_node = $node->getIndividual();			
153
-		if($indi_node) {
154
-			if(count($node->getFamiliesNodes()) == 0) {
153
+		if ($indi_node) {
154
+			if (count($node->getFamiliesNodes()) == 0) {
155 155
 				$indiSpouseFamilies = $indi_node->getSpouseFamilies();
156
-				foreach($indiSpouseFamilies as $indiSpouseFamily) {
156
+				foreach ($indiSpouseFamilies as $indiSpouseFamily) {
157 157
 					$node->addFamily($indiSpouseFamily);
158 158
 				}
159 159
 			}
@@ -162,62 +162,62 @@  discard block
 block discarded – undo
162 162
 			$indi_surname = $dindi_node->getUnprotectedPrimarySurname();
163 163
 			
164 164
 			//Get the estimated birth place and put it in the place table
165
-			$place=$dindi_node->getEstimatedBirthPlace(false);
166
-			if($place && strlen($place) > 0){
167
-				$place=trim($place);
165
+			$place = $dindi_node->getEstimatedBirthPlace(false);
166
+			if ($place && strlen($place) > 0) {
167
+				$place = trim($place);
168 168
 				$node->getRootNode()->addPlace(new Place($place, $this->tree));
169 169
 			}
170 170
 				
171 171
 			//Tag the individual as used
172
-			$this->used_indis[$indi_node->getXref()]=true;
172
+			$this->used_indis[$indi_node->getXref()] = true;
173 173
 		}
174 174
 		
175
-		foreach($node->getFamiliesNodes() as $family) {
175
+		foreach ($node->getFamiliesNodes() as $family) {
176 176
 			$spouse_surname = null;
177
-			if($indi_node && $spouse = $family->getSpouse($indi_node)) {
177
+			if ($indi_node && $spouse = $family->getSpouse($indi_node)) {
178 178
 				$dspouse = new \MyArtJaub\Webtrees\Individual($spouse);
179
-				$spouse_surname=$dspouse->getUnprotectedPrimarySurname();
179
+				$spouse_surname = $dspouse->getUnprotectedPrimarySurname();
180 180
 			}
181 181
 			
182 182
 			$children = $family->getChildren();
183 183
 
184
-			$nbChildren=0;
185
-			$nbNatural=0;
184
+			$nbChildren = 0;
185
+			$nbNatural = 0;
186 186
 			
187
-			foreach($children as $child){
187
+			foreach ($children as $child) {
188 188
 				$dchild = new \MyArtJaub\Webtrees\Individual($child);
189
-				$child_surname=$dchild->getUnprotectedPrimarySurname();
189
+				$child_surname = $dchild->getUnprotectedPrimarySurname();
190 190
 				
191
-				if(!$dchild->isNewAddition()) {
191
+				if (!$dchild->isNewAddition()) {
192 192
 					$nbChildren++;
193 193
 					//If the root individual is the mother
194
-					if($indi_node && I18N::strcasecmp($indi_node->getSex(), 'F') == 0) {
194
+					if ($indi_node && I18N::strcasecmp($indi_node->getSex(), 'F') == 0) {
195 195
 						//Print only lineages of children with the same surname as their mother (supposing they are natural children)
196
-						if(!$spouse || ($spouse_surname && I18N::strcasecmp($child_surname, $spouse_surname) != 0)){
197
-							if(I18N::strcasecmp($child_surname, $indi_surname) == 0){
196
+						if (!$spouse || ($spouse_surname && I18N::strcasecmp($child_surname, $spouse_surname) != 0)) {
197
+							if (I18N::strcasecmp($child_surname, $indi_surname) == 0) {
198 198
 								$nbNatural++;
199 199
 								$node_child = new LineageNode($child, $node->getRootNode());							
200 200
 								$node_child = $this->buildLineage($node_child);
201
-								if($node_child) $node->addChild($family, $node_child);
201
+								if ($node_child) $node->addChild($family, $node_child);
202 202
 							}
203 203
 						}
204 204
 					}
205 205
 					//If the root individual is the father
206 206
 					else {
207 207
 						//Print if the children does not bear the same name as his mother (and different from his father)
208
-						if( strlen($child_surname) == 0 || strlen($indi_surname) == 0 || strlen($spouse_surname) == 0 ||
208
+						if (strlen($child_surname) == 0 || strlen($indi_surname) == 0 || strlen($spouse_surname) == 0 ||
209 209
 							I18N::strcasecmp($child_surname, $indi_surname) == 0 ||
210
-							I18N::strcasecmp($child_surname, $spouse_surname) != 0 )
210
+							I18N::strcasecmp($child_surname, $spouse_surname) != 0)
211 211
 						{
212 212
 							$nbNatural++;
213 213
 							$node_child = new LineageNode($child, $node->getRootNode());							
214 214
 							$node_child = $this->buildLineage($node_child);
215
-							if($node_child) $node->addChild($family, $node_child);
215
+							if ($node_child) $node->addChild($family, $node_child);
216 216
 						}
217 217
 						else {
218 218
 							$nbNatural++;
219 219
 							$node_child = new LineageNode($child, $node->getRootNode(), $child_surname);
220
-							if($node_child) $node->addChild($family, $node_child);
220
+							if ($node_child) $node->addChild($family, $node_child);
221 221
 						}
222 222
 					}
223 223
 				}
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 
226 226
 
227 227
 			//Do not print other children
228
-			if(($nbChildren-$nbNatural)>0){
228
+			if (($nbChildren - $nbNatural) > 0) {
229 229
 				$node->addChild($family, null);
230 230
 			}
231 231
 		}
Please login to merge, or discard this patch.
src/Webtrees/Module/PatronymicLineage/Views/LineageView.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
         /** @var \Fisharebest\Webtrees\Tree $tree */
37 37
         $tree = $this->data->get('tree');
38 38
         
39
-        echo '<h2 class="center">', $this->data->get('title') , '</h2>';
39
+        echo '<h2 class="center">', $this->data->get('title'), '</h2>';
40 40
         echo '<p class="center alpha_index">', implode(' | ', $this->getInitialLettersList()), '</p>';
41 41
          
42
-        if($this->data->get('issurnames', false)) {
42
+        if ($this->data->get('issurnames', false)) {
43 43
             $surns = $this->data->get('surnameslist', array());
44
-            $extra_params = array ('mod' => Constants::MODULE_MAJ_PATROLIN_NAME, 'mod_action' => 'Lineage');
44
+            $extra_params = array('mod' => Constants::MODULE_MAJ_PATROLIN_NAME, 'mod_action' => 'Lineage');
45 45
             // Show the surname list
46 46
             switch ($tree->getPreference('SURNAME_LIST_STYLE')) {
47 47
                 case 'style1':
@@ -59,16 +59,16 @@  discard block
 block discarded – undo
59 59
         else if ($this->data->get('islineages', false)) {
60 60
             //Link to indilist
61 61
             echo '<p class="center"><strong>'.
62
-                '<a href="indilist.php?ged=' . $tree->getNameUrl() . '&surname=' . rawurlencode($this->data->get('surname')) .'">'. 
62
+                '<a href="indilist.php?ged='.$tree->getNameUrl().'&surname='.rawurlencode($this->data->get('surname')).'">'. 
63 63
                 I18N::translate('Go to the list of individuals with surname %s', $this->data->get('legend')).
64 64
                 '</a></strong></p>';
65 65
             
66 66
             $lineages = $this->data->get('lineages', null);
67 67
             $nb_lineages = count($lineages);
68
-            if(is_null($lineages) || $nb_lineages == 0) {
68
+            if (is_null($lineages) || $nb_lineages == 0) {
69 69
             	echo '<p class="center"><span class="warning">',
70 70
             		I18N::translate('No individuals with surname %s has been found. Please try another name.',
71
-            			'<span dir="auto">' . $this->data->get('legend') . '</span>'),
71
+            			'<span dir="auto">'.$this->data->get('legend').'</span>'),
72 72
             			'</span></p>';
73 73
             } else { 
74 74
             	
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
             	
80 80
             	echo '<div class="list_value_wrap">';            	
81 81
             	
82
-            	foreach($lineages as $i => $lineage) {
82
+            	foreach ($lineages as $i => $lineage) {
83 83
             		$this->printRootLineage($lineage);
84
-            		if($i < $nb_lineages - 1) echo '<hr />';
84
+            		if ($i < $nb_lineages - 1) echo '<hr />';
85 85
             	}
86 86
             	
87 87
             	echo '</div>';
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         $list = array();
105 105
         /** @var \Fisharebest\Webtrees\Tree $tree */
106 106
         $tree = $this->data->get('tree');
107
-		$script_base_url = WT_SCRIPT_NAME . '?mod=' . \MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME . '&mod_action=Lineage';
107
+		$script_base_url = WT_SCRIPT_NAME.'?mod='.\MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME.'&mod_action=Lineage';
108 108
 		
109 109
         foreach (QueryName::surnameAlpha($tree, false, false) as $letter => $count) {
110 110
             switch ($letter) {
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
             }
121 121
             if ($count) {
122 122
                 if ($letter == $this->data->get('alpha')) {
123
-                    $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&amp;ged=' . $tree->getNameUrl() . '" class="warning" title="' . I18N::number($count) . '">' . $html . '</a>';
123
+                    $list[] = '<a href="'.$script_base_url.'&alpha='.rawurlencode($letter).'&amp;ged='.$tree->getNameUrl().'" class="warning" title="'.I18N::number($count).'">'.$html.'</a>';
124 124
                 } else {
125
-                    $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&amp;ged=' . $tree->getNameUrl() . '" title="' . I18N::number($count) . '">' . $html . '</a>';
125
+                    $list[] = '<a href="'.$script_base_url.'&alpha='.rawurlencode($letter).'&amp;ged='.$tree->getNameUrl().'" title="'.I18N::number($count).'">'.$html.'</a>';
126 126
                 }
127 127
             } else {
128 128
                 $list[] = $html;
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
         // Search spiders don't get the "show all" option as the other links give them everything.
133 133
         if (!Auth::isSearchEngine()) {
134 134
             if ($this->data->get('show_all') === 'yes') {
135
-                $list[] = '<span class="warning">' . I18N::translate('All') . '</span>';
135
+                $list[] = '<span class="warning">'.I18N::translate('All').'</span>';
136 136
             } else {
137
-                $list[] = '<a href="' . $script_base_url . '&show_all=yes' . '&amp;ged=' . $tree->getNameUrl() . '">' . I18N::translate('All') . '</a>';
137
+                $list[] = '<a href="'.$script_base_url.'&show_all=yes'.'&amp;ged='.$tree->getNameUrl().'">'.I18N::translate('All').'</a>';
138 138
             }
139 139
         }
140 140
     
@@ -147,11 +147,11 @@  discard block
 block discarded – undo
147 147
      */
148 148
     private function printRootLineage(LineageRootNode $node) {    	
149 149
     	print '<div class="patrolin_tree">';
150
-    	if($node->getIndividual() === null) {
150
+    	if ($node->getIndividual() === null) {
151 151
     		$fam_nodes = $node->getFamiliesNodes();
152
-    		foreach($fam_nodes as $fam){
153
-    			foreach($fam_nodes[$fam] as $child_node) {
154
-    				if($child_node) {
152
+    		foreach ($fam_nodes as $fam) {
153
+    			foreach ($fam_nodes[$fam] as $child_node) {
154
+    				if ($child_node) {
155 155
     					$this->printLineage($child_node);
156 156
     				}
157 157
     			}
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     	echo '</div>';
164 164
     	
165 165
     	$places = $node->getPlaces();
166
-    	if($places && count($places)>0){
166
+    	if ($places && count($places) > 0) {
167 167
     		echo '<div class="patrolin_places">';
168 168
     		echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlPlacesCloud($places, false, $this->data->get('tree'));
169 169
     		echo '</div>';
@@ -178,34 +178,34 @@  discard block
 block discarded – undo
178 178
     	
179 179
     	echo '<ul>';
180 180
     	$fam_nodes = $node->getFamiliesNodes();
181
-    	if(count($fam_nodes) > 0) {
181
+    	if (count($fam_nodes) > 0) {
182 182
     		$is_first_family = true;
183
-    		foreach($fam_nodes as $fam) {
183
+    		foreach ($fam_nodes as $fam) {
184 184
     			$node_indi = $node->getIndividual();
185 185
     			echo '<li>';
186
-    			if($is_first_family){
186
+    			if ($is_first_family) {
187 187
     				echo FunctionsPrint::htmlIndividualForList($node_indi);
188 188
     			}
189
-				else{
189
+				else {
190 190
 					echo FunctionsPrint::htmlIndividualForList($node_indi, false);
191 191
 				}
192 192
 				//Get individual's spouse
193 193
 				$dfam = new Family($fam);
194
-				$spouse=$dfam->getSpouseById($node_indi);
194
+				$spouse = $dfam->getSpouseById($node_indi);
195 195
 				//Print the spouse if relevant
196
-				if($spouse){
196
+				if ($spouse) {
197 197
 					$marrdate = I18N::translate('yes');
198 198
 					$marryear = '';
199 199
 					echo '&nbsp;<a href="'.$fam->getHtmlUrl().'">';
200
-					if ($fam->getMarriageYear()){
200
+					if ($fam->getMarriageYear()) {
201 201
 						$marrdate = strip_tags($fam->getMarriageDate()->Display());
202 202
 						$marryear = $fam->getMarriageYear();
203 203
 					}
204 204
 					echo '<span class="details1" title="'.$marrdate.'"><i class="icon-rings"></i>'.$marryear.'</span></a>&nbsp;';
205 205
 					echo FunctionsPrint::htmlIndividualForList($spouse);
206 206
 				}
207
-    			foreach($fam_nodes[$fam] as $child_node) {
208
-    				if($child_node) {
207
+    			foreach ($fam_nodes[$fam] as $child_node) {
208
+    				if ($child_node) {
209 209
     					$this->printLineage($child_node);
210 210
     				}
211 211
     				else {
@@ -218,10 +218,10 @@  discard block
 block discarded – undo
218 218
     	else {
219 219
     		echo '<li>';
220 220
     		echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlIndividualForList($node->getIndividual());
221
-    		if($node->hasFollowUpSurname()) {
222
-    			$url_base = WT_SCRIPT_NAME . '?mod=' . \MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME . '&mod_action=Lineage';
221
+    		if ($node->hasFollowUpSurname()) {
222
+    			$url_base = WT_SCRIPT_NAME.'?mod='.\MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME.'&mod_action=Lineage';
223 223
     			echo '&nbsp;'.
224
-    				'<a href="' . $url_base . '&surname=' . rawurlencode($node->getFollowUpSurname()) . '&amp;ged=' . $this->data->get('tree')->getNameUrl() . '">'.
224
+    				'<a href="'.$url_base.'&surname='.rawurlencode($node->getFollowUpSurname()).'&amp;ged='.$this->data->get('tree')->getNameUrl().'">'.
225 225
     				'('.I18N::translate('Go to %s lineages', $node->getFollowUpSurname()).')'.
226 226
     				'</a>';
227 227
     		}
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/Model/CertificateFileProvider.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -52,24 +52,24 @@  discard block
 block discarded – undo
52 52
      * {@inhericDoc}
53 53
      * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getRealCertificatesDirectory()
54 54
      */
55
-    public function getRealCertificatesDirectory(){
56
-        return WT_DATA_DIR . $this->root_path;
55
+    public function getRealCertificatesDirectory() {
56
+        return WT_DATA_DIR.$this->root_path;
57 57
     }
58 58
     
59 59
     /**
60 60
      * {@inhericDoc}
61 61
      * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCitiesList()
62 62
      */
63
-    public function getCitiesList(){
64
-        if(!isset($this->cities_list) || is_null($this->cities_list)){
63
+    public function getCitiesList() {
64
+        if (!isset($this->cities_list) || is_null($this->cities_list)) {
65 65
             $certdir = $this->getRealCertificatesDirectory();
66 66
             $this->cities_list = array();
67 67
     
68 68
             $dir = opendir($certdir);
69 69
             
70
-            while($entry = readdir($dir)){
71
-                if($entry != '.' && $entry != '..' && is_dir($certdir.$entry)){
72
-                    $this->cities_list[]= Functions::encodeFileSystemToUtf8($entry);
70
+            while ($entry = readdir($dir)) {
71
+                if ($entry != '.' && $entry != '..' && is_dir($certdir.$entry)) {
72
+                    $this->cities_list[] = Functions::encodeFileSystemToUtf8($entry);
73 73
                 }
74 74
             }
75 75
             sort($this->cities_list);
@@ -81,21 +81,21 @@  discard block
 block discarded – undo
81 81
      * {@inhericDoc}
82 82
      * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCertificatesList()
83 83
      */
84
-    public function getCertificatesList($selCity){
84
+    public function getCertificatesList($selCity) {
85 85
     
86 86
         $selCity = Functions::encodeUtf8ToFileSystem($selCity);
87 87
     
88 88
         $certdir = $this->getRealCertificatesDirectory();
89
-        $tabCertif= array();
89
+        $tabCertif = array();
90 90
     
91
-        if(is_dir($certdir.$selCity)){
92
-            $dir=opendir($certdir.$selCity);
93
-            while($entry = readdir($dir)){
94
-                if($entry!='.' && $entry!='..' && !is_dir($certdir.$entry.'/')){
91
+        if (is_dir($certdir.$selCity)) {
92
+            $dir = opendir($certdir.$selCity);
93
+            while ($entry = readdir($dir)) {
94
+                if ($entry != '.' && $entry != '..' && !is_dir($certdir.$entry.'/')) {
95 95
                     $path = Functions::encodeFileSystemToUtf8($selCity.'/'.$entry);
96 96
                     $certificate = new Certificate($path, $this->tree, $this);
97
-                    if(Functions::isImageTypeSupported($certificate->extension())){
98
-                        $tabCertif[] = 	$certificate;
97
+                    if (Functions::isImageTypeSupported($certificate->extension())) {
98
+                        $tabCertif[] = $certificate;
99 99
                     }
100 100
                 }
101 101
             }
@@ -107,17 +107,17 @@  discard block
 block discarded – undo
107 107
      * {@inhericDoc}
108 108
      * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCertificatesListBeginWith()
109 109
      */
110
-    public function getCertificatesListBeginWith($city, $contains, $limit= 9999){
111
-        $tabFiles= array();
112
-        $dirPath= $this->getRealCertificatesDirectory() . Functions::encodeUtf8ToFileSystem($city).'/';
110
+    public function getCertificatesListBeginWith($city, $contains, $limit = 9999) {
111
+        $tabFiles = array();
112
+        $dirPath = $this->getRealCertificatesDirectory().Functions::encodeUtf8ToFileSystem($city).'/';
113 113
         $contains = utf8_decode($contains);
114 114
         $nbCert = 0;
115 115
     
116
-        if(is_dir($dirPath)){
117
-            $dir=opendir($dirPath);
118
-            while(($entry = readdir($dir)) && $nbCert < $limit){
119
-                if($entry!='.' && $entry!='..' && $entry!='Thumbs.db' &&!is_dir($dirPath.$entry.'/') && stripos($entry, $contains)!== false){
120
-                    $tabFiles[]= Functions::encodeFileSystemToUtf8($entry);
116
+        if (is_dir($dirPath)) {
117
+            $dir = opendir($dirPath);
118
+            while (($entry = readdir($dir)) && $nbCert < $limit) {
119
+                if ($entry != '.' && $entry != '..' && $entry != 'Thumbs.db' && !is_dir($dirPath.$entry.'/') && stripos($entry, $contains) !== false) {
120
+                    $tabFiles[] = Functions::encodeFileSystemToUtf8($entry);
121 121
                     $nbCert++;
122 122
                 }
123 123
             }
Please login to merge, or discard this patch.
src/Webtrees/Module/Hooks/AdminConfigController.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -33,26 +33,26 @@  discard block
 block discarded – undo
33 33
      * Manage updates sent from the AdminConfig@index form.
34 34
      */
35 35
     protected function update() {
36
-        if(Auth::isAdmin()){
36
+        if (Auth::isAdmin()) {
37 37
             $ihooks = HookProvider::getInstalledHooks();
38 38
             	
39
-            $module_names= Database::prepare(
39
+            $module_names = Database::prepare(
40 40
                 "SELECT module_name FROM `##module` WHERE status='disabled'"
41 41
             )->fetchOneColumn();
42 42
             	
43
-            if($ihooks !== null){
43
+            if ($ihooks !== null) {
44 44
                 foreach ($ihooks as $ihook => $params) {
45
-                    if(Filter::post('hook-' . $params['id']) === 'yes') {                    
45
+                    if (Filter::post('hook-'.$params['id']) === 'yes') {                    
46 46
                         $array_hook = explode('#', $ihook);
47 47
                         //Update status
48
-                        $new_status= Filter::postBool('status-' . $params['id']);
49
-                        if(in_array($array_hook[0], $module_names)) $new_status = false;
48
+                        $new_status = Filter::postBool('status-'.$params['id']);
49
+                        if (in_array($array_hook[0], $module_names)) $new_status = false;
50 50
                         $previous_status = $params['status'];
51 51
                         if ($new_status !== null) {
52
-                            $new_status= $new_status ? 'enabled' : 'disabled';
53
-                            if($new_status != $previous_status){
52
+                            $new_status = $new_status ? 'enabled' : 'disabled';
53
+                            if ($new_status != $previous_status) {
54 54
                                 $chook = new Hook($array_hook[1], $array_hook[2]);
55
-                                switch($new_status){
55
+                                switch ($new_status) {
56 56
                                     case 'enabled':
57 57
                                         $chook->enable($array_hook[0]);
58 58
                                         break;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
                         $new_priority = Filter::postInteger("moduleorder-{$params['id']}");
70 70
                         $previous_priority = $params['priority'];
71 71
                         if ($new_priority !== null) {
72
-                            if($new_priority != $previous_priority){
72
+                            if ($new_priority != $previous_priority) {
73 73
                                 $chook = new Hook($array_hook[1], $array_hook[2]);
74 74
                                 $chook->setPriority($array_hook[0], $new_priority);
75 75
                             }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         HookProvider::updateHooks();
94 94
         
95 95
         $action = Filter::post('action');        
96
-        if($action == 'update' && Filter::checkCsrf()) $this->update();
96
+        if ($action == 'update' && Filter::checkCsrf()) $this->update();
97 97
         
98 98
         Theme::theme(new AdministrationTheme)->init($WT_TREE);        
99 99
         $ctrl = new PageController();
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             ->restrictAccess(Auth::isAdmin())
102 102
             ->setPageTitle($this->module->getTitle());
103 103
         
104
-        $table_id = 'table-installedhooks-' . Uuid::uuid4();
104
+        $table_id = 'table-installedhooks-'.Uuid::uuid4();
105 105
 
106 106
         $view_bag = new ViewBag();
107 107
         $view_bag->set('title', $ctrl->getPageTitle());
Please login to merge, or discard this patch.
src/Webtrees/Module/CertificatesModule.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      * @see \Fisharebest\Webtrees\Module\ModuleConfigInterface::getConfigLink()
68 68
      */
69 69
     public function getConfigLink() {
70
-        return 'module.php?mod=' . $this->getName() . '&amp;mod_action=AdminConfig';
70
+        return 'module.php?mod='.$this->getName().'&amp;mod_action=AdminConfig';
71 71
     }
72 72
     
73 73
     /**
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public function getMenu(Tree $tree, $reference = null) {
94 94
         $tree_url = $tree ? $tree->getNameUrl() : '';
95
-        return new Menu($this->getTitle(), 'module.php?mod=' . $this->getName() . '&mod_action=Certificate@listAll&ged=' . $tree_url, 'menu-maj-list-certificate', array('rel' => 'nofollow'));
95
+        return new Menu($this->getTitle(), 'module.php?mod='.$this->getName().'&mod_action=Certificate@listAll&ged='.$tree_url, 'menu-maj-list-certificate', array('rel' => 'nofollow'));
96 96
     }
97 97
     
98 98
     /**
@@ -102,27 +102,27 @@  discard block
 block discarded – undo
102 102
     public function hFactSourcePrepend($srec) {
103 103
         global $WT_TREE;
104 104
         
105
-        $html='';
106
-        $sid=null;
105
+        $html = '';
106
+        $sid = null;
107 107
         
108
-        if($this->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($WT_TREE)){
108
+        if ($this->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($WT_TREE)) {
109 109
             if (!$srec || strlen($srec) == 0) return $html;
110 110
             	
111 111
             $certificate = null;
112 112
             $subrecords = explode("\n", $srec);
113 113
             $levelSOUR = substr($subrecords[0], 0, 1);
114 114
             if (preg_match('~^'.$levelSOUR.' SOUR @('.WT_REGEX_XREF.')@$~', $subrecords[0], $match)) {
115
-                $sid=$match[1];
115
+                $sid = $match[1];
116 116
             };
117 117
             $nb_subrecords = count($subrecords);
118
-            for ($i=0; $i < $nb_subrecords; $i++) {
118
+            for ($i = 0; $i < $nb_subrecords; $i++) {
119 119
                 $subrecords[$i] = trim($subrecords[$i]);
120 120
                 $tag = substr($subrecords[$i], 2, 4);
121 121
                 $text = substr($subrecords[$i], 7);
122
-                if($tag == '_ACT') $certificate= new Certificate($text, $WT_TREE, $this->getProvider());
122
+                if ($tag == '_ACT') $certificate = new Certificate($text, $WT_TREE, $this->getProvider());
123 123
             }
124 124
             	
125
-            if($certificate && $certificate->canShow())
125
+            if ($certificate && $certificate->canShow())
126 126
                 $html = $this->getDisplay_ACT($certificate, $sid);
127 127
                 	
128 128
         }
@@ -149,9 +149,9 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public function hHtmlSimpleTagDisplay($tag, $value, $context = null, $contextid = null) {
151 151
         $html = '';
152
-        switch($tag){
152
+        switch ($tag) {
153 153
             case '_ACT':
154
-                if($context == 'SOUR') $html = $this->getDisplay_ACT($value, $contextid);
154
+                if ($context == 'SOUR') $html = $this->getDisplay_ACT($value, $contextid);
155 155
                 break;
156 156
         }
157 157
         return $html;
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         
167 167
         $html = '';
168 168
 		
169
-		switch($tag){
169
+		switch ($tag) {
170 170
 			case '_ACT':
171 171
 				$element_id = Uuid::uuid4();
172 172
 				$controller
@@ -174,14 +174,14 @@  discard block
 block discarded – undo
174 174
 					->addExternalJavascript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/autocomplete.js')
175 175
 					->addExternalJavascript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/updatecertificatevalues.js');
176 176
 				$certificate = null;
177
-				if($value){
177
+				if ($value) {
178 178
 					$certificate = new Certificate($value, $WT_TREE, $this->getProvider());
179 179
 				}
180 180
 				$tabCities = $this->getProvider()->getCitiesList();
181 181
 				$html .= '<select id="certifCity'.$element_id.'" class="_CITY">';
182
-				foreach ($tabCities as $cities){
183
-					$selectedCity='';
184
-					if($certificate && $cities== $certificate->getCity()) $selectedCity='selected="true"';
182
+				foreach ($tabCities as $cities) {
183
+					$selectedCity = '';
184
+					if ($certificate && $cities == $certificate->getCity()) $selectedCity = 'selected="true"';
185 185
 					$html .= '<option value="'.$cities.'" '.$selectedCity.' />'.$cities.'</option>';
186 186
 				}
187 187
 				$html .= '</select>';
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
      * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hAddSimpleTag()
200 200
      */
201 201
     public function hAddSimpleTag($context, $level) {
202
-        switch($context){
202
+        switch ($context) {
203 203
             case 'SOUR':
204 204
                 FunctionsEdit::addSimpleTag($level.' _ACT');
205 205
                 break;
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
      * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hHasHelpTextTag()
212 212
      */
213 213
     public function hHasHelpTextTag($tag) {
214
-        switch($tag){
214
+        switch ($tag) {
215 215
 			case '_ACT':
216 216
 				return true;
217 217
 				break;
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
      * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hGetHelpTextTag()
225 225
      */
226 226
     public function hGetHelpTextTag($tag) {
227
-        switch($tag){
227
+        switch ($tag) {
228 228
             case '_ACT':
229 229
                 return array(
230 230
                 I18N::translate('Certificate'),
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     public function getProvider() {
243 243
         global $WT_TREE;
244 244
     
245
-        if(!$this->provider) {
245
+        if (!$this->provider) {
246 246
             $root_path = $this->getSetting('MAJ_CERT_ROOTDIR', 'certificates/');
247 247
             $this->provider = new CertificateFileProvider($root_path, $WT_TREE);
248 248
         }
@@ -256,9 +256,9 @@  discard block
 block discarded – undo
256 256
      * @param Certificate $certificatePath Certificate (as per the GEDCOM)
257 257
      * @param string|null $sid Linked Source ID, if it exists
258 258
      */
259
-    protected function getDisplay_ACT(Certificate $certificate, $sid = null){    
259
+    protected function getDisplay_ACT(Certificate $certificate, $sid = null) {    
260 260
         $html = '';
261
-        if($certificate){
261
+        if ($certificate) {
262 262
             $certificate->setSource($sid);
263 263
             $html = $certificate->displayImage('icon');
264 264
         }
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/GeoAnalysisController.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         
70 70
         $ga_id = Filter::getInteger('ga_id');        
71 71
         
72
-        if($ga_id && $ga = $this->provider->getGeoAnalysis($ga_id)) {
72
+        if ($ga_id && $ga = $this->provider->getGeoAnalysis($ga_id)) {
73 73
             $data->set('has_analysis', true);
74 74
             $data->set('geoanalysis', $ga);
75 75
             
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                 jQuery.get(
83 83
 					"module.php",
84 84
 					{
85
-                        "mod" : "'. $this->module->getName() .'",  
85
+                        "mod" : "'. $this->module->getName().'",  
86 86
                         "mod_action": "GeoAnalysis@dataTabs",
87 87
                         "ga_id" : "'.$ga_id.'"
88 88
                     },
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         $data->set('has_list', false);
115 115
         
116 116
         $ga_list = $this->provider->getGeoAnalysisList();
117
-        if(count($ga_list) > 0 ) {
117
+        if (count($ga_list) > 0) {
118 118
              $data->set('has_list', true);
119 119
              $data->set('geoanalysislist', $ga_list);
120 120
         }
@@ -140,19 +140,19 @@  discard block
 block discarded – undo
140 140
         );
141 141
         
142 142
         $status = Filter::getBool('status');
143
-        $res = array('geoanalysis' => $ga->getId() , 'error' => null);
144
-        try{
143
+        $res = array('geoanalysis' => $ga->getId(), 'error' => null);
144
+        try {
145 145
             $this->provider->setGeoAnalysisStatus($ga, $status);
146 146
             $res['status'] = $status;
147
-			Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" has been '. ($status ? 'enabled' : 'disabled') .'.');
147
+			Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" has been '.($status ? 'enabled' : 'disabled').'.');
148 148
         }
149 149
         catch (\Exception $ex) {
150 150
             $res['error'] = $ex->getMessage();
151
-			Log::addErrorLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" could not be ' . ($status ? 'enabled' : 'disabled') .'. Error: '. $ex->getMessage());
151
+			Log::addErrorLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" could not be '.($status ? 'enabled' : 'disabled').'. Error: '.$ex->getMessage());
152 152
         }
153 153
         
154 154
         $controller->pageHeader();
155
-        if($res['error']) http_response_code(500);
155
+        if ($res['error']) http_response_code(500);
156 156
         
157 157
         echo \Zend_Json::encode($res);
158 158
     }
@@ -174,18 +174,18 @@  discard block
 block discarded – undo
174 174
             && $ga
175 175
             );
176 176
             
177
-        $res = array('geoanalysis' => $ga->getId() , 'error' => null);
178
-        try{
177
+        $res = array('geoanalysis' => $ga->getId(), 'error' => null);
178
+        try {
179 179
             $this->provider->deleteGeoAnalysis($ga);
180 180
 			Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" has been deleted.');
181 181
         }
182 182
         catch (\Exception $ex) {
183 183
             $res['error'] = $ex->getMessage();
184
-			Log::addErrorLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" could not be deleted. Error: '. $ex->getMessage());
184
+			Log::addErrorLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" could not be deleted. Error: '.$ex->getMessage());
185 185
         }
186 186
     
187 187
         $controller->pageHeader();
188
-        if($res['error']) http_response_code(500);
188
+        if ($res['error']) http_response_code(500);
189 189
     
190 190
         echo \Zend_Json::encode($res);
191 191
     }
@@ -211,9 +211,9 @@  discard block
 block discarded – undo
211 211
         list($placesDispGeneral, $placesDispGenerations) = $ga->getAnalysisResults($sosa_provider->getAllSosaWithGenerations());
212 212
         
213 213
         $flags = array();
214
-        if($placesDispGeneral && $ga->getOptions() && $ga->getOptions()->isUsingFlags()) {
214
+        if ($placesDispGeneral && $ga->getOptions() && $ga->getOptions()->isUsingFlags()) {
215 215
             $mapProvider = new GoogleMapsProvider();            
216
-            foreach($placesDispGeneral['places'] as $place => $count) {
216
+            foreach ($placesDispGeneral['places'] as $place => $count) {
217 217
                 $flags[$place] = $mapProvider->getPlaceIcon(new Place($place, $WT_TREE));
218 218
             }
219 219
         }
@@ -232,15 +232,15 @@  discard block
 block discarded – undo
232 232
 	 * @param (null|array) $flags Array of flags
233 233
 	 * @return string HTML code for the general tab
234 234
 	 */
235
-    protected function htmlPlacesAnalysisGeneralTab(GeoAnalysis $ga, $placesGeneralResults, $flags= null) {
235
+    protected function htmlPlacesAnalysisGeneralTab(GeoAnalysis $ga, $placesGeneralResults, $flags = null) {
236 236
         global $WT_TREE;
237 237
         
238
-        if(!empty($placesGeneralResults)){
238
+        if (!empty($placesGeneralResults)) {
239 239
             $data = new ViewBag();
240 240
             
241 241
             $nb_found = $placesGeneralResults['knownsum'];
242 242
             $nb_other = 0;
243
-            if(isset($placesGeneralResults['other'])) $nb_other =$placesGeneralResults['other'];
243
+            if (isset($placesGeneralResults['other'])) $nb_other = $placesGeneralResults['other'];
244 244
             $nb_unknown = $placesGeneralResults['unknown'];
245 245
             
246 246
             $data->set('stats_gen_nb_found', $nb_found);
@@ -249,28 +249,28 @@  discard block
 block discarded – undo
249 249
             
250 250
             $data->set('use_flags', $ga->getOptions() && $ga->getOptions()->isUsingFlags());
251 251
             
252
-            if($ga->hasMap()) {
252
+            if ($ga->hasMap()) {
253 253
                 $max = $placesGeneralResults['max'];
254 254
                 $map = $ga->getOptions()->getMap();
255 255
                 $results_by_subdivs = $map->getSubdivisions();
256 256
                 $places_mappings = $map->getPlacesMappings();
257 257
                 foreach ($placesGeneralResults['places'] as $location => $count) {
258
-                    $levelvalues = array_reverse(array_map('trim',explode(',', $location)));
258
+                    $levelvalues = array_reverse(array_map('trim', explode(',', $location)));
259 259
                     $level_map = $ga->getAnalysisLevel() - $ga->getOptions()->getMapLevel();
260
-                    if($level_map >= 0 && $level_map < count($levelvalues)) {
261
-                        $levelref = $levelvalues[0] . '@' . $levelvalues[$level_map];
262
-                        if(!isset($results_by_subdivs[$levelref])) { $levelref = $levelvalues[0]; }
260
+                    if ($level_map >= 0 && $level_map < count($levelvalues)) {
261
+                        $levelref = $levelvalues[0].'@'.$levelvalues[$level_map];
262
+                        if (!isset($results_by_subdivs[$levelref])) { $levelref = $levelvalues[0]; }
263 263
                     }
264 264
                     else {
265 265
                         $levelref = $levelvalues[0];
266 266
                     }
267
-                    if(isset($places_mappings[$levelref])) $levelref = $places_mappings[$levelref];
268
-                    if(isset($results_by_subdivs[$levelref])) {
267
+                    if (isset($places_mappings[$levelref])) $levelref = $places_mappings[$levelref];
268
+                    if (isset($results_by_subdivs[$levelref])) {
269 269
                         $count_subd = isset($results_by_subdivs[$levelref]['count']) ? $results_by_subdivs[$levelref]['count'] : 0;
270
-                        $count_subd  += $count;
270
+                        $count_subd += $count;
271 271
                         $results_by_subdivs[$levelref]['count'] = $count_subd;   
272 272
                         $results_by_subdivs[$levelref]['transparency'] = Functions::safeDivision($count_subd, $max);
273
-                        if($ga->getOptions()->isUsingFlags() && $flags) {
273
+                        if ($ga->getOptions()->isUsingFlags() && $flags) {
274 274
                             $results_by_subdivs[$levelref]['place'] = new Place($location, $WT_TREE);
275 275
                             $results_by_subdivs[$levelref]['flag'] = $flags[$location];
276 276
                         }
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
             }
293 293
         }
294 294
         else {
295
-            $html = '<p class="warning">' . I18N::translate('No data is available for the general analysis.') . '</p>';
295
+            $html = '<p class="warning">'.I18N::translate('No data is available for the general analysis.').'</p>';
296 296
         }
297 297
         return $html;
298 298
     }
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
     protected function htmlPlacesAnalysisGenerationsTab(GeoAnalysis $ga, $placesGenerationsResults, $flags = null) {
309 309
         global $WT_TREE;
310 310
         
311
-        if(!empty($placesGenerationsResults) && $ga->getOptions()){
311
+        if (!empty($placesGenerationsResults) && $ga->getOptions()) {
312 312
             $data = new ViewBag();
313 313
             
314 314
             ksort($placesGenerationsResults);
@@ -321,26 +321,26 @@  discard block
 block discarded – undo
321 321
             $data->set('display_all_places', $display_all_places);
322 322
             
323 323
             $results_by_gen = array();
324
-            foreach($placesGenerationsResults as $gen => $genData){
324
+            foreach ($placesGenerationsResults as $gen => $genData) {
325 325
                 $sum = 0;
326 326
                 $other = 0;
327 327
                 $unknown = 0;
328
-                if(isset($genData['sum'])) $sum = $genData['sum'];
329
-                if(isset($genData['other'])) $other = $genData['other'];
330
-                if(isset($genData['unknown'])) $unknown = $genData['unknown'];
328
+                if (isset($genData['sum'])) $sum = $genData['sum'];
329
+                if (isset($genData['other'])) $other = $genData['other'];
330
+                if (isset($genData['unknown'])) $unknown = $genData['unknown'];
331 331
                 
332
-                if($sum > 0) {                
332
+                if ($sum > 0) {                
333 333
                     $results_by_gen[$gen]['sum'] = $sum;
334 334
                     $results_by_gen[$gen]['other'] = $other;
335 335
                     $results_by_gen[$gen]['unknown'] = $unknown;
336 336
                     $results_by_gen[$gen]['places'] = array();                    
337 337
                     arsort($genData['places']);
338 338
                     
339
-                    if($display_all_places){
340
-                        foreach($genData['places'] as $placename=> $count){
339
+                    if ($display_all_places) {
340
+                        foreach ($genData['places'] as $placename=> $count) {
341 341
                             $results_by_gen[$gen]['places'][$placename]['count'] = $count;
342 342
                             
343
-                            if($ga->getOptions() && $ga->getOptions()->isUsingFlags() && ($flag = $flags[$placename]) != ''){
343
+                            if ($ga->getOptions() && $ga->getOptions()->isUsingFlags() && ($flag = $flags[$placename]) != '') {
344 344
                                 $results_by_gen[$gen]['places'][$placename]['place'] = new Place($placename, $WT_TREE);
345 345
                                 $results_by_gen[$gen]['places'][$placename]['flag'] = $flag;
346 346
                             }
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
                     }
349 349
                     else {
350 350
                         $tmp = $genData['places'];
351
-                        if($other > 0) {
351
+                        if ($other > 0) {
352 352
                             $tmp = array_slice($tmp, 0, 5, true);
353 353
                             $tmp['other'] = $other;
354 354
                             arsort($tmp);  
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
             
365 365
         }
366 366
         else {
367
-            $html = '<p class="warning">' . I18N::translate('No data is available for the generations analysis.') . '</p>';
367
+            $html = '<p class="warning">'.I18N::translate('No data is available for the generations analysis.').'</p>';
368 368
         }
369 369
         return $html;
370 370
     }
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/CertificateController.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         $cid = Filter::get('cid');
70 70
         
71 71
         $certificate = null;
72
-        if(!empty($cid) && strlen($cid) > 22){
72
+        if (!empty($cid) && strlen($cid) > 22) {
73 73
             $certificate = Certificate::getInstance($cid, $WT_TREE, null, $this->provider);
74 74
         }
75 75
         
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         $data->set('title', $controller->getPageTitle());
78 78
         
79 79
         $data->set('has_certif', false);
80
-        if($certificate) {
80
+        if ($certificate) {
81 81
             $controller->restrictAccess($certificate->canShow());
82 82
             $data->set('title', $certificate->getTitle());
83 83
             $data->set('has_certif', true);
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
             
86 86
             $data->set(
87 87
                 'url_certif_city', 
88
-                'module.php?mod=' . Constants::MODULE_MAJ_CERTIF_NAME . 
89
-                    '&mod_action=Certificate@listAll' .
90
-                    '&ged=' . $WT_TREE->getNameUrl() .
91
-                    '&city=' . Functions::encryptToSafeBase64($certificate->getCity())
88
+                'module.php?mod='.Constants::MODULE_MAJ_CERTIF_NAME. 
89
+                    '&mod_action=Certificate@listAll'.
90
+                    '&ged='.$WT_TREE->getNameUrl().
91
+                    '&city='.Functions::encryptToSafeBase64($certificate->getCity())
92 92
             );
93 93
             
94 94
             $controller->addInlineJavascript('
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
             $linked_indis = $certificate->linkedIndividuals();
103 103
             $linked_fams = $certificate->linkedFamilies();
104 104
                         
105
-            if($linked_indis && count($linked_indis) > 0) {
105
+            if ($linked_indis && count($linked_indis) > 0) {
106 106
                 $data->set('has_linked_indis', true);
107 107
                 $data->set('linked_indis', $linked_indis);
108 108
             }
109 109
             
110
-            if(!empty($linked_fams)) {
110
+            if (!empty($linked_fams)) {
111 111
                 $data->set('has_linked_fams', true);
112 112
                 $data->set('linked_fams', $linked_fams);
113 113
             }
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
     public function image() {      
123 123
         global $WT_TREE;
124 124
         
125
-        $cid   = Filter::get('cid');
125
+        $cid = Filter::get('cid');
126 126
         $certificate = null;
127
-        if(!empty($cid)) $certificate =  Certificate::getInstance($cid, $WT_TREE, null, $this->provider);
127
+        if (!empty($cid)) $certificate = Certificate::getInstance($cid, $WT_TREE, null, $this->provider);
128 128
         
129 129
         $imageBuilder = new ImageBuilder($certificate);
130 130
         
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         
158 158
         $city = Filter::get('city');
159 159
         
160
-        if(!empty($city) && strlen($city) > 22){
160
+        if (!empty($city) && strlen($city) > 22) {
161 161
             $city = Functions::decryptFromSafeBase64($city);
162 162
             $controller->setPageTitle(I18N::translate('Certificates for %s', $city));
163 163
         }
@@ -172,11 +172,11 @@  discard block
 block discarded – undo
172 172
         $data->set('selected_city', $city);
173 173
         
174 174
         $data->set('has_list', false);        
175
-        if(!empty($city)) {            
176
-            $table_id = 'table-certiflist-' . Uuid::uuid4();
175
+        if (!empty($city)) {            
176
+            $table_id = 'table-certiflist-'.Uuid::uuid4();
177 177
             
178 178
             $certif_list = $this->provider->getCertificatesList($city);            
179
-            if(!empty($certif_list)) {                
179
+            if (!empty($certif_list)) {                
180 180
                 $data->set('has_list', true);
181 181
                 $data->set('table_id', $table_id);
182 182
                 $data->set('certificate_list', $certif_list);
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         				jQuery.fn.dataTableExt.oSort["num-html-desc"]=function(a,b) {a=parseFloat(a.replace(/<[^<]*>/, "")); b=parseFloat(b.replace(/<[^<]*>/, "")); return (a>b) ? -1 : (a<b ? 1 : 0);};
192 192
                         
193 193
                         jQuery("#'.$table_id.'").dataTable( {
194
-        					dom: \'<"H"<"filtersH_' . $table_id . '">T<"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_' . $table_id . '">>\',
194
+        					dom: \'<"H"<"filtersH_' . $table_id.'">T<"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_'.$table_id.'">>\',
195 195
     					    '.I18N::datatablesI18N().',
196 196
     					    jQueryUI: true,
197 197
         					autoWidth: false,
Please login to merge, or discard this patch.
src/Webtrees/Module/Sosa/SosaListController.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $this->view_bag = new ViewBag();
71 71
         $this->view_bag->set('generation', $this->generation);
72 72
         $this->view_bag->set('max_gen', $this->sosa_provider->getLastGeneration());
73
-        $this->view_bag->set('is_setup', $this->sosa_provider->isSetup() && $this->view_bag->get('max_gen', 0)> 0);
73
+        $this->view_bag->set('is_setup', $this->sosa_provider->isSetup() && $this->view_bag->get('max_gen', 0) > 0);
74 74
         
75 75
     }
76 76
     
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
 
92 92
         $this->view_bag->set('title', $controller->getPageTitle());
93 93
         
94
-        if($this->view_bag->get('is_setup', false)) {
94
+        if ($this->view_bag->get('is_setup', false)) {
95 95
             $this->view_bag->set('has_sosa', $this->generation > 0 && $this->sosa_provider->getSosaCountAtGeneration($this->generation) > 0);
96 96
             $this->view_bag->set('url_module', $this->module->getName());
97 97
             $this->view_bag->set('url_action', 'SosaList');
98 98
             $this->view_bag->set('url_ged', $WT_TREE->getNameUrl()); 
99 99
             $this->view_bag->set('min_gen', 1);
100 100
             
101
-            if($this->view_bag->get('has_sosa', false)) {            
101
+            if ($this->view_bag->get('has_sosa', false)) {            
102 102
                 $controller->addInlineJavascript('
103 103
             		jQuery("#sosalist-tabs").tabs();
104 104
             		jQuery("#sosalist-tabs").css("visibility", "visible");
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             			{
109 109
                             "mod" : "'.$this->module->getName().'",
110 110
                             "mod_action": "SosaList@sosalist",
111
-                            "ged" : "' . $WT_TREE->getNameUrl(). '",
111
+                            "ged" : "' . $WT_TREE->getNameUrl().'",
112 112
                             "type" : "indi",
113 113
                             "gen" : "'.$this->generation.'"
114 114
                         },
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
                         {
134 134
                             "mod" : "'.$this->module->getName().'",
135 135
                             "mod_action": "SosaList@sosalist",
136
-                            "ged" : "' . $WT_TREE->getNameUrl(). '",
136
+                            "ged" : "' . $WT_TREE->getNameUrl().'",
137 137
                             "type" : "fam",
138 138
                             "gen" : "'.$this->generation.'"
139 139
                         },
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         
173 173
         $this->view_bag->set('title', $controller->getPageTitle());
174 174
         
175
-        if($this->view_bag->get('is_setup', false)) {
175
+        if ($this->view_bag->get('is_setup', false)) {
176 176
             $this->view_bag->set('url_module', $this->module->getName());
177 177
             $this->view_bag->set('url_action', 'SosaList@missing');
178 178
             $this->view_bag->set('url_ged', $WT_TREE->getNameUrl());
@@ -181,11 +181,11 @@  discard block
 block discarded – undo
181 181
             $missing_list = $this->sosa_provider->getMissingSosaListAtGeneration($this->generation);
182 182
             $this->view_bag->set('has_missing', $this->generation > 0 && count($missing_list) > 0);
183 183
             
184
-            $perc_sosa = Functions::safeDivision($this->sosa_provider->getSosaCountAtGeneration($this->generation), pow(2, $this->generation -1));
184
+            $perc_sosa = Functions::safeDivision($this->sosa_provider->getSosaCountAtGeneration($this->generation), pow(2, $this->generation - 1));
185 185
             $this->view_bag->set('perc_sosa', $perc_sosa);
186 186
             
187
-            if($this->view_bag->get('has_missing', false)) {
188
-                $table_id = 'table-sosa-missing-' . Uuid::uuid4();
187
+            if ($this->view_bag->get('has_missing', false)) {
188
+                $table_id = 'table-sosa-missing-'.Uuid::uuid4();
189 189
                 $this->view_bag->set('table_id', $table_id);
190 190
                 
191 191
                 $controller
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
     				jQuery.fn.dataTableExt.oSort["num-html-desc"]=function(a,b) {a=parseFloat(a.replace(/<[^<]*>/, "")); b=parseFloat(b.replace(/<[^<]*>/, "")); return (a>b) ? -1 : (a<b ? 1 : 0);};
199 199
                     
200 200
     				jQuery("#'.$table_id.'").dataTable( {
201
-                        dom: \'<"H"<"filtersH_' . $table_id . '">T<"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_' . $table_id . '">>\',
201
+                        dom: \'<"H"<"filtersH_' . $table_id.'">T<"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_'.$table_id.'">>\',
202 202
     					'.I18N::datatablesI18N().',
203 203
     					jQueryUI: true,
204 204
     					autoWidth:false,
@@ -229,14 +229,14 @@  discard block
 block discarded – undo
229 229
     					pagingType: "full_numbers"
230 230
     			   });
231 231
     			
232
-    				jQuery("#' . $table_id . '")
232
+    				jQuery("#' . $table_id.'")
233 233
     				/* Filter buttons in table header */
234 234
     				.on("click", "button[data-filter-column]", function() {
235 235
     					var btn = jQuery(this);
236 236
     					// De-activate the other buttons in this button group
237 237
     					btn.siblings().removeClass("ui-state-active");
238 238
     					// Apply (or clear) this filter
239
-    					var col = jQuery("#' . $table_id . '").DataTable().column(btn.data("filter-column"));
239
+    					var col = jQuery("#' . $table_id.'").DataTable().column(btn.data("filter-column"));
240 240
     					if (btn.hasClass("ui-state-active")) {
241 241
     						btn.removeClass("ui-state-active");
242 242
     						col.search("").draw();
@@ -253,8 +253,8 @@  discard block
 block discarded – undo
253 253
                 $unique_indis = array();
254 254
                 $sum_missing_different = 0;
255 255
                 $sum_missing_different_without_hidden = 0;
256
-                foreach($missing_list as $num => $missing_tab) {
257
-                    if(isset($unique_indis[$missing_tab['indi']])) {
256
+                foreach ($missing_list as $num => $missing_tab) {
257
+                    if (isset($unique_indis[$missing_tab['indi']])) {
258 258
                         unset($missing_list[$num]);
259 259
                         continue;
260 260
                     }
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
                 $this->view_bag->set('missing_list', $missing_list);
273 273
                 $this->view_bag->set('missing_diff_count', $sum_missing_different);
274 274
                 $this->view_bag->set('missing_hidden', $sum_missing_different - $sum_missing_different_without_hidden);
275
-                $perc_sosa_potential = Functions::safeDivision($this->sosa_provider->getSosaCountAtGeneration($this->generation - 1), pow(2, $this->generation-2));
275
+                $perc_sosa_potential = Functions::safeDivision($this->sosa_provider->getSosaCountAtGeneration($this->generation - 1), pow(2, $this->generation - 2));
276 276
                 $this->view_bag->set('perc_sosa_potential', $perc_sosa_potential);
277 277
             }            
278 278
         }
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
         $controller = new AjaxController();
291 291
         $controller->restrictAccess($this->generation > 0 || !is_null($type));
292 292
         
293
-        switch ($type){
293
+        switch ($type) {
294 294
             case 'indi':
295 295
                 $this->renderSosaListIndi($controller);
296 296
                 break;
@@ -313,9 +313,9 @@  discard block
 block discarded – undo
313 313
         $listSosa = $this->sosa_provider->getSosaListAtGeneration($this->generation); 
314 314
         $this->view_bag->set('has_sosa', false);
315 315
         
316
-        if(count($listSosa) > 0) {
316
+        if (count($listSosa) > 0) {
317 317
             $this->view_bag->set('has_sosa', true);
318
-            $table_id = 'table-sosa-indi-' . Uuid::uuid4();
318
+            $table_id = 'table-sosa-indi-'.Uuid::uuid4();
319 319
             $this->view_bag->set('table_id', $table_id);
320 320
                      
321 321
             $controller
@@ -327,8 +327,8 @@  discard block
 block discarded – undo
327 327
 				jQuery.fn.dataTableExt.oSort["num-html-desc"]=function(a,b) {a=parseFloat(a.replace(/<[^<]*>/, "")); b=parseFloat(b.replace(/<[^<]*>/, "")); return (a>b) ? -1 : (a<b ? 1 : 0);};
328 328
             
329 329
                 jQuery("#'.$table_id.'").dataTable( {
330
-					dom: \'<"H"<"filtersH_' . $table_id . '">T<"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_' . $table_id . '">>\',
331
-					' . I18N::datatablesI18N() . ',
330
+					dom: \'<"H"<"filtersH_' . $table_id.'">T<"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_'.$table_id.'">>\',
331
+					' . I18N::datatablesI18N().',
332 332
 					jQueryUI: true,
333 333
 					autoWidth: false,
334 334
 					processing: true,
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 					pagingType: "full_numbers"
365 365
 			   });
366 366
             
367
-				jQuery("#' . $table_id . '")
367
+				jQuery("#' . $table_id.'")
368 368
 				/* Hide/show parents */
369 369
 				.on("click", ".btn-toggle-parents", function() {
370 370
 					jQuery(this).toggleClass("ui-state-active");
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 				/* Hide/show statistics */
374 374
 				.on("click", ".btn-toggle-statistics", function() {
375 375
 					jQuery(this).toggleClass("ui-state-active");
376
-					jQuery("#indi_list_table-charts_' . $table_id . '").slideToggle();
376
+					jQuery("#indi_list_table-charts_' . $table_id.'").slideToggle();
377 377
 				})
378 378
 				/* Filter buttons in table header */
379 379
 				.on("click", "button[data-filter-column]", function() {
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 					// De-activate the other buttons in this button group
382 382
 					btn.siblings().removeClass("ui-state-active");
383 383
 					// Apply (or clear) this filter
384
-					var col = jQuery("#' . $table_id . '").DataTable().column(btn.data("filter-column"));
384
+					var col = jQuery("#' . $table_id.'").DataTable().column(btn.data("filter-column"));
385 385
 					if (btn.hasClass("ui-state-active")) {
386 386
 						btn.removeClass("ui-state-active");
387 387
 						col.search("").draw();
@@ -416,30 +416,30 @@  discard block
 block discarded – undo
416 416
             $nb_displayed = 0;
417 417
             
418 418
             Individual::load($WT_TREE, $listSosa);
419
-            foreach($listSosa as $sosa => $pid) {
419
+            foreach ($listSosa as $sosa => $pid) {
420 420
                 $person = Individual::getInstance($pid, $WT_TREE);
421 421
                 if (!$person || !$person->canShowName()) {
422 422
                     unset($listSosa[$sosa]);
423 423
                     continue;
424 424
                 }
425 425
                 $nb_displayed++;
426
-                if ($birth_dates=$person->getAllBirthDates()) {
426
+                if ($birth_dates = $person->getAllBirthDates()) {
427 427
                     if (
428 428
                         FunctionsPrint::isDateWithinChartsRange($birth_dates[0]) &&
429 429
                         !isset($unique_indis[$person->getXref()])
430 430
                         ) {
431
-                        $birt_by_decade[(int)($birth_dates[0]->gregorianYear()/10)*10] .= $person->getSex();
431
+                        $birt_by_decade[(int)($birth_dates[0]->gregorianYear() / 10) * 10] .= $person->getSex();
432 432
                     }
433 433
                 }
434 434
                 else {
435
-                    $birth_dates[0]=new Date('');
435
+                    $birth_dates[0] = new Date('');
436 436
                 }
437 437
                 if ($death_dates = $person->getAllDeathDates()) {
438 438
                     if (
439 439
                         FunctionsPrint::isDateWithinChartsRange($death_dates[0]) &&
440 440
                         !isset($unique_indis[$person->getXref()])
441 441
                         ) {
442
-                        $deat_by_decade[(int) ($death_dates[0]->gregorianYear() / 10) * 10] .= $person->getSex();
442
+                        $deat_by_decade[(int)($death_dates[0]->gregorianYear() / 10) * 10] .= $person->getSex();
443 443
                     }
444 444
                 }
445 445
                 else {
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
             $this->view_bag->set('sosa_list', $listSosa);   
456 456
             
457 457
             $this->view_bag->set('sosa_count', count($listSosa));
458
-            $this->view_bag->set('sosa_theo', pow(2, $this->generation-1));
458
+            $this->view_bag->set('sosa_theo', pow(2, $this->generation - 1));
459 459
             $this->view_bag->set('sosa_ratio', Functions::safeDivision($this->view_bag->get('sosa_count'), $this->view_bag->get('sosa_theo')));
460 460
             
461 461
             $this->view_bag->set('sosa_hidden', $this->view_bag->get('sosa_count') - $nb_displayed);
@@ -475,12 +475,12 @@  discard block
 block discarded – undo
475 475
     protected function renderFamSosaListIndi(AjaxController $controller) {
476 476
         global $WT_TREE;
477 477
         
478
-        $listFamSosa = $this->sosa_provider->getFamilySosaListAtGeneration($this->generation);;
478
+        $listFamSosa = $this->sosa_provider->getFamilySosaListAtGeneration($this->generation); ;
479 479
         $this->view_bag->set('has_sosa', false);
480 480
         
481
-        if(count($listFamSosa) > 0) {
481
+        if (count($listFamSosa) > 0) {
482 482
             $this->view_bag->set('has_sosa', true);
483
-            $table_id = 'table-sosa-fam-' . Uuid::uuid4();
483
+            $table_id = 'table-sosa-fam-'.Uuid::uuid4();
484 484
             $this->view_bag->set('table_id', $table_id);
485 485
              
486 486
             $controller
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 				jQuery.fn.dataTableExt.oSort["num-html-desc"]=function(a,b) {a=parseFloat(a.replace(/<[^<]*>/, "")); b=parseFloat(b.replace(/<[^<]*>/, "")); return (a>b) ? -1 : (a<b ? 1 : 0);};
493 493
         
494 494
                 jQuery("#'.$table_id.'").dataTable( {
495
-					dom: \'<"H"<"filtersH_' . $table_id . '"><"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_' . $table_id . '">>\',
495
+					dom: \'<"H"<"filtersH_' . $table_id.'"><"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_'.$table_id.'">>\',
496 496
                     '.I18N::datatablesI18N(array(16, 32, 64, 128, -1)).',
497 497
 					jQueryUI: true,
498 498
 					autoWidth: false,
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 					pagingType: "full_numbers"
530 530
 			   });
531 531
 					
532
-				jQuery("#' . $table_id . '")
532
+				jQuery("#' . $table_id.'")
533 533
 				/* Hide/show parents */
534 534
 				.on("click", ".btn-toggle-parents", function() {
535 535
 					jQuery(this).toggleClass("ui-state-active");
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 				/* Hide/show statistics */
539 539
 				.on("click",  ".btn-toggle-statistics", function() {
540 540
 					jQuery(this).toggleClass("ui-state-active");
541
-					jQuery("#fam_list_table-charts_' . $table_id . '").slideToggle();
541
+					jQuery("#fam_list_table-charts_' . $table_id.'").slideToggle();
542 542
 				})
543 543
 				/* Filter buttons in table header */
544 544
 				.on("click", "button[data-filter-column]", function() {
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 					// De-activate the other buttons in this button group
547 547
 					btn.siblings().removeClass("ui-state-active");
548 548
 					// Apply (or clear) this filter
549
-					var col = jQuery("#' . $table_id . '").DataTable().column(btn.data("filter-column"));
549
+					var col = jQuery("#' . $table_id.'").DataTable().column(btn.data("filter-column"));
550 550
 					if (btn.hasClass("ui-state-active")) {
551 551
 						btn.removeClass("ui-state-active");
552 552
 						col.search("").draw();
@@ -566,29 +566,29 @@  discard block
 block discarded – undo
566 566
             
567 567
             //-- init chart data
568 568
     		$marr_by_age = array();
569
-    		for ($age=0; $age<=$max_age; $age++) {
569
+    		for ($age = 0; $age <= $max_age; $age++) {
570 570
     			$marr_by_age[$age] = '';
571 571
     		}
572 572
     		$birt_by_decade = array();
573 573
     		$marr_by_decade = array();
574
-    		for ($year=1550; $year<2030; $year+=10) {
574
+    		for ($year = 1550; $year < 2030; $year += 10) {
575 575
     			$birt_by_decade[$year] = '';
576 576
     			$marr_by_decade[$year] = '';
577 577
     		}
578 578
     		
579
-            foreach($listFamSosa as $sosa => $fid) {
579
+            foreach ($listFamSosa as $sosa => $fid) {
580 580
                 $sfamily = Family::getInstance($fid, $WT_TREE);
581
-                if(!$sfamily || !$sfamily->canShow()) {
581
+                if (!$sfamily || !$sfamily->canShow()) {
582 582
                     unset($sfamily[$sosa]);
583 583
                     continue;
584 584
                 }
585
-                $mdate=$sfamily->getMarriageDate();
585
+                $mdate = $sfamily->getMarriageDate();
586 586
                 
587
-                if( ($husb = $sfamily->getHusband()) && 
587
+                if (($husb = $sfamily->getHusband()) && 
588 588
                     ($hdate = $husb->getBirthDate()) && 
589 589
                     $hdate->isOK() && $mdate->isOK()) {
590 590
                     if (FunctionsPrint::isDateWithinChartsRange($hdate)) {
591
-                        $birt_by_decade[(int) ($hdate->gregorianYear() / 10) * 10] .= $husb->getSex();
591
+                        $birt_by_decade[(int)($hdate->gregorianYear() / 10) * 10] .= $husb->getSex();
592 592
                     }
593 593
                     $hage = Date::getAge($hdate, $mdate, 0);
594 594
                     if ($hage >= 0 && $hage <= $max_age) {
@@ -596,11 +596,11 @@  discard block
 block discarded – undo
596 596
                     }
597 597
                 }
598 598
                 
599
-                if(($wife = $sfamily->getWife()) &&
600
-                    ($wdate=$wife->getBirthDate()) &&
599
+                if (($wife = $sfamily->getWife()) &&
600
+                    ($wdate = $wife->getBirthDate()) &&
601 601
                     $wdate->isOK() && $mdate->isOK()) {
602 602
                     if (FunctionsPrint::isDateWithinChartsRange($wdate)) {
603
-                        $birt_by_decade[(int) ($wdate->gregorianYear() / 10) * 10] .= $wife->getSex();
603
+                        $birt_by_decade[(int)($wdate->gregorianYear() / 10) * 10] .= $wife->getSex();
604 604
                     }
605 605
                     $wage = Date::getAge($wdate, $mdate, 0);
606 606
                     if ($wage >= 0 && $wage <= $max_age) {
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
                 }                
610 610
 
611 611
                 if ($mdate->isOK() && FunctionsPrint::isDateWithinChartsRange($mdate) && $husb && $wife) {
612
-                    $marr_by_decade[(int) ($mdate->gregorianYear() / 10) * 10] .= $husb->getSex() . $wife->getSex();
612
+                    $marr_by_decade[(int)($mdate->gregorianYear() / 10) * 10] .= $husb->getSex().$wife->getSex();
613 613
                 }
614 614
                 
615 615
                 $listFamSosa[$sosa] = $sfamily;
Please login to merge, or discard this patch.