Completed
Push — master ( 153c83...604bee )
by Jonathan
03:10
created
src/Webtrees/Module/Sosa/Views/SosaConfigView.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,13 +47,13 @@
 block discarded – undo
47 47
         			<div class="value">
48 48
         				<?php 
49 49
         				    $users = $this->data->get('users_settings');
50
-        				    if(count($users) == 1) {
51
-        				        $root_indi = $users[0]['rootid'];  ?>
50
+        				    if (count($users) == 1) {
51
+        				        $root_indi = $users[0]['rootid']; ?>
52 52
         					<label>
53 53
         						<input id="maj_sosa_input_userid" type="hidden" name="userid" value="<?php echo $users[0]['user']->getUserId(); ?>" />
54 54
         						<?php echo $users[0]['user']->getRealNameHtml() ?>
55 55
         					</label>
56
-        				<?php  } else if(count($users) > 1) { ?>
56
+        				<?php  } else if (count($users) > 1) { ?>
57 57
         					<select id='maj-sosa-config-select' name="userid">
58 58
         					<?php 
59 59
         					   $root_indi = $users[0]['rootid'];
Please login to merge, or discard this patch.
src/Webtrees/Module/Sosa/Views/SosaListMissingView.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
             <div id="maj-sosa-missing-page" class="center">
35 35
     			<h2><?php echo $this->data->get('title'); ?></h2>
36 36
     			
37
-    			<?php  if($this->data->get('is_setup')) { 
37
+    			<?php  if ($this->data->get('is_setup')) { 
38 38
     			    $this->renderSosaHeader();
39
-    			    if($this->data->get('has_missing', false)) {
39
+    			    if ($this->data->get('has_missing', false)) {
40 40
     			        $table_id = $this->data->get('table_id');
41 41
     			        ?>
42 42
     			<div id="sosa-indi-missing" class="smissing-list">
43
-                	<table id="<?php echo $table_id;?>">
43
+                	<table id="<?php echo $table_id; ?>">
44 44
         				<thead>     
45 45
             				<tr>
46 46
     							<th colspan="16">
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         				</thead>
109 109
         			<tbody>
110 110
         			
111
-        			<?php foreach($this->data->get('missing_list') as $missing_tab) {
111
+        			<?php foreach ($this->data->get('missing_list') as $missing_tab) {
112 112
         			    $person = $missing_tab['indi'];
113 113
         			    
114 114
         			    /** @var \Fisharebest\Webtrees\Individual $person */
@@ -126,18 +126,18 @@  discard block
 block discarded – undo
126 126
                 			<td class="transparent"><?php echo $person->getXref(); ?></td>
127 127
                 			<td colspan="2">
128 128
                 			<?php foreach ($person->getAllNames() as $num=>$name) {
129
-                				if ($name['type']=='NAME') {
130
-                					$title='';
129
+                				if ($name['type'] == 'NAME') {
130
+                					$title = '';
131 131
                 				} else {
132
-                					$title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $person)).'"';
132
+                					$title = 'title="'.strip_tags(GedcomTag::getLabel($name['type'], $person)).'"';
133 133
                 				}
134
-                				if ($num==$person->getPrimaryName()) {
135
-                					$class=' class="name2"';
136
-                					$sex_image=$person->getSexImage();
137
-                					list($surn, $givn)=explode(',', $name['sort']);
134
+                				if ($num == $person->getPrimaryName()) {
135
+                					$class = ' class="name2"';
136
+                					$sex_image = $person->getSexImage();
137
+                					list($surn, $givn) = explode(',', $name['sort']);
138 138
                 				} else {
139
-                					$class='';
140
-                					$sex_image='';
139
+                					$class = '';
140
+                					$sex_image = '';
141 141
                 				} ?>
142 142
                 				<a <?php echo $title.' '.$class; ?> href="<?php echo $person->getHtmlUrl(); ?>">
143 143
                 					<?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']); ?>
@@ -150,10 +150,10 @@  discard block
 block discarded – undo
150 150
                     		</td>
151 151
                     		<td style="display:none;"></td>
152 152
                     		<td>
153
-                    			<?php echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)) . 'AAAA' . Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)); ?>
153
+                    			<?php echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)).'AAAA'.Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)); ?>
154 154
                     		</td>
155 155
                     		<td>
156
-                    			<?php echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)) . 'AAAA' . Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)); ?>
156
+                    			<?php echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)).'AAAA'.Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)); ?>
157 157
                     		</td>                    		
158 158
                 			<?php if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) {
159 159
         				        $isISourced = $dperson->isSourced(); ?>
@@ -163,11 +163,11 @@  discard block
 block discarded – undo
163 163
         					<td>&nbsp;</td>
164 164
         					<td></td>
165 165
         					<?php } ?>
166
-        					<td><?php echo $missing_tab['has_father'] ? '&nbsp;' : 'X';?></td>
167
-        					<td><?php echo $missing_tab['has_mother'] ? '&nbsp;' : 'X';?></td>
166
+        					<td><?php echo $missing_tab['has_father'] ? '&nbsp;' : 'X'; ?></td>
167
+        					<td><?php echo $missing_tab['has_mother'] ? '&nbsp;' : 'X'; ?></td>
168 168
         					<td>
169 169
                     		<?php 
170
-                    		if ($birth_dates=$person->getAllBirthDates()) {
170
+                    		if ($birth_dates = $person->getAllBirthDates()) {
171 171
         			            foreach ($birth_dates as $num=>$birth_date) {
172 172
             					   if ($num) { ?><br/><?php } ?>
173 173
             						<?php  echo $birth_date->display(true);
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
                     		} else {
176 176
                     		    $birth_date = new Date('');
177 177
                     		    if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES')) {
178
-                    		        $birth_date=$person->getEstimatedBirthDate();
178
+                    		        $birth_date = $person->getEstimatedBirthDate();
179 179
                     		        echo $birth_date->display(true);
180 180
                     		    } else {
181 181
                     		        echo '&nbsp;';
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                     		}
185 185
                     		?>
186 186
                     		</td>
187
-                    		<td><?php echo $birth_date->julianDay();?></td>
187
+                    		<td><?php echo $birth_date->julianDay(); ?></td>
188 188
                 			<td>
189 189
                 			<?php foreach ($person->getAllBirthPlaces() as $n => $birth_place) {
190 190
         				        $tmp = new \Fisharebest\Webtrees\Place($birth_place, $person->getTree());
@@ -211,9 +211,9 @@  discard block
 block discarded – undo
211 211
 							<td class="ui-state-default" colspan="16">
212 212
 								<div class="center">
213 213
 									<?php echo I18N::translate('Number of different missing ancestors: %s', I18N::number($this->data->get('missing_diff_count'))); ?>
214
-									<?php if($this->data->get('missing_hidden') > 0) echo ' ['. I18N::translate('%s hidden', I18N::number($this->data->get('missing_hidden'))).']'; ?>
215
-									<?php echo ' - ' . I18N::translate('Generation complete at %s', I18N::percentage($this->data->get('perc_sosa'), 2)); ?>
216
-									<?php echo ' [' . I18N::translate('Potential %s', I18N::percentage($this->data->get('perc_sosa_potential'),2)).']'; ?>
214
+									<?php if ($this->data->get('missing_hidden') > 0) echo ' ['.I18N::translate('%s hidden', I18N::number($this->data->get('missing_hidden'))).']'; ?>
215
+									<?php echo ' - '.I18N::translate('Generation complete at %s', I18N::percentage($this->data->get('perc_sosa'), 2)); ?>
216
+									<?php echo ' ['.I18N::translate('Potential %s', I18N::percentage($this->data->get('perc_sosa_potential'), 2)).']'; ?>
217 217
 								</div>
218 218
 							</td>
219 219
 						</tr>
Please login to merge, or discard this patch.
src/Webtrees/Hook/HookProvider.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 * @see \MyArtJaub\Webtrees\Hook\HookProviderInterface::getPossibleHooks()
72 72
 	 */
73 73
 	public function getPossibleHooks() {
74
-		static $hooks=null;
74
+		static $hooks = null;
75 75
 		if ($hooks === null) {
76 76
 		    $hooks = array();
77 77
 		    
@@ -83,31 +83,31 @@  discard block
 block discarded – undo
83 83
 		        'SELECT SQL_CACHE module_name FROM `##module`'
84 84
 		    )->fetchOneColumn();
85 85
 		    
86
-		    foreach($module_names as $module_name) {
86
+		    foreach ($module_names as $module_name) {
87 87
 		        $module = Module::getModuleByName($module_name);
88 88
 		        
89
-		        if($module instanceof HookSubscriberInterface){
89
+		        if ($module instanceof HookSubscriberInterface) {
90 90
 					$subscribedhooks = $module->getSubscribedHooks();
91
-					if(is_array($subscribedhooks)){
92
-						foreach($subscribedhooks as $key => $value){
93
-							if(is_int($key)) {
91
+					if (is_array($subscribedhooks)) {
92
+						foreach ($subscribedhooks as $key => $value) {
93
+							if (is_int($key)) {
94 94
 								$hook_item = $value;
95 95
 								$priority = self::DEFAULT_PRIORITY;
96 96
 							}
97
-							else{
97
+							else {
98 98
 								$hook_item = explode('#', $key, 2);
99 99
 								$priority = $value;
100 100
 							}
101
-							if($hook_item && count($hook_item) == 2){
101
+							if ($hook_item && count($hook_item) == 2) {
102 102
 								$hook_func = $hook_item[0];
103 103
 								$hook_cont = $hook_item[1];
104 104
 							}
105
-							else{
105
+							else {
106 106
 								$hook_func = $hook_item[0];
107 107
 								$hook_cont = 'all';
108 108
 							}
109
-							if(method_exists($module, $hook_func)){
110
-								$hooks[$module->getName().'#'.$hook_func.'#'.$hook_cont]=$priority;
109
+							if (method_exists($module, $hook_func)) {
110
+								$hooks[$module->getName().'#'.$hook_func.'#'.$hook_cont] = $priority;
111 111
 							}
112 112
 						}
113 113
 					}
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
 	 * {@inheritDoc}
122 122
 	 * @see \MyArtJaub\Webtrees\Hook\HookProviderInterface::getRawInstalledHooks()
123 123
 	 */
124
-	public function getRawInstalledHooks(){
125
-		if(self::isModuleOperational()){
124
+	public function getRawInstalledHooks() {
125
+		if (self::isModuleOperational()) {
126 126
 			return Database::prepare(
127 127
 					"SELECT majh_id AS id, majh_module_name AS module, majh_hook_function AS hook, majh_hook_context as context, majh_module_priority AS priority,  majh_status AS status".
128 128
 					" FROM `##maj_hooks`".
@@ -136,11 +136,11 @@  discard block
 block discarded – undo
136 136
 	 * {@inheritDoc}
137 137
 	 * @see \MyArtJaub\Webtrees\Hook\HookProviderInterface::getInstalledHooks()
138 138
 	 */
139
-	public function getInstalledHooks(){
140
-		static $installedhooks =null;
141
-		if($installedhooks===null){
142
-			$dbhooks=self::getRawInstalledHooks();
143
-			foreach($dbhooks as $dbhook){
139
+	public function getInstalledHooks() {
140
+		static $installedhooks = null;
141
+		if ($installedhooks === null) {
142
+			$dbhooks = self::getRawInstalledHooks();
143
+			foreach ($dbhooks as $dbhook) {
144 144
 				$installedhooks[($dbhook->module).'#'.($dbhook->hook).'#'.($dbhook->context)] = array('id' => $dbhook->id, 'status' => $dbhook->status, 'priority' => $dbhook->priority);
145 145
 			}
146 146
 		}
@@ -153,15 +153,15 @@  discard block
 block discarded – undo
153 153
 	 */
154 154
 	public function updateHooks() {
155 155
 	    
156
-	    if(Auth::isAdmin()){
156
+	    if (Auth::isAdmin()) {
157 157
 	        $ihooks = self::getInstalledHooks();
158 158
 	        $phooks = self::getPossibleHooks();
159 159
 	        	
160 160
 	        // Insert hooks not existing yet in the DB
161
-	        if($phooks !== null){
162
-	            foreach($phooks as $phook => $priority){
161
+	        if ($phooks !== null) {
162
+	            foreach ($phooks as $phook => $priority) {
163 163
 	                $array_hook = explode('#', $phook);
164
-	                if($ihooks === null || !array_key_exists($phook, $ihooks)){
164
+	                if ($ihooks === null || !array_key_exists($phook, $ihooks)) {
165 165
 	                    $chook = new Hook($array_hook[1], $array_hook[2]);
166 166
 	                    $chook->subscribe($array_hook[0]);
167 167
 	                    $chook->setPriority($array_hook[0], $priority);
@@ -170,10 +170,10 @@  discard block
 block discarded – undo
170 170
 	        }
171 171
 	        	
172 172
 	        //Remove hooks not existing any more in the file system
173
-	        if($ihooks !== null){
174
-	            foreach(array_keys($ihooks) as $ihook){
173
+	        if ($ihooks !== null) {
174
+	            foreach (array_keys($ihooks) as $ihook) {
175 175
 	                $array_hook = explode('#', $ihook);
176
-	                if($phooks === null || !array_key_exists($ihook, $phooks)){
176
+	                if ($phooks === null || !array_key_exists($ihook, $phooks)) {
177 177
 	                    $chook = new Hook($array_hook[1], $array_hook[2]);
178 178
 	                    $chook->remove($array_hook[0]);
179 179
 	                }
Please login to merge, or discard this patch.