@@ -49,8 +49,7 @@ discard block |
||
49 | 49 | return $task; |
50 | 50 | } |
51 | 51 | } |
52 | - } |
|
53 | - catch(\Exception $ex) { } |
|
52 | + } catch(\Exception $ex) { } |
|
54 | 53 | |
55 | 54 | return null; |
56 | 55 | } |
@@ -83,8 +82,7 @@ discard block |
||
83 | 82 | ); |
84 | 83 | |
85 | 84 | return $task; |
86 | - } |
|
87 | - else { |
|
85 | + } else { |
|
88 | 86 | $this->deleteTask($row['majat_name']); |
89 | 87 | } |
90 | 88 | return null; |
@@ -156,8 +154,7 @@ discard block |
||
156 | 154 | 'is_running' => $task->isRunning() ? 1 : 0 |
157 | 155 | )); |
158 | 156 | return true; |
159 | - } |
|
160 | - catch (\Exception $ex) { |
|
157 | + } catch (\Exception $ex) { |
|
161 | 158 | Log::addErrorLog(sprintf('Error while updating the Admin Task %s. Exception: %s', $task->getName(), $ex->getMessage())); |
162 | 159 | return false; |
163 | 160 | } |
@@ -279,7 +276,9 @@ discard block |
||
279 | 276 | $dir=opendir($this->root_path); |
280 | 277 | while (($file=readdir($dir))!==false){ |
281 | 278 | try { |
282 | - if($file == '.' || $file == '..') continue; |
|
279 | + if($file == '.' || $file == '..') { |
|
280 | + continue; |
|
281 | + } |
|
283 | 282 | $task = include $this->root_path . $file; |
284 | 283 | if($task ) { |
285 | 284 | $task->setProvider($this); |
@@ -294,12 +293,10 @@ discard block |
||
294 | 293 | )); |
295 | 294 | |
296 | 295 | $tasks[] = $task; |
297 | - } |
|
298 | - else { |
|
296 | + } else { |
|
299 | 297 | throw new \Exception; |
300 | 298 | } |
301 | - } |
|
302 | - catch (\Exception $ex) { |
|
299 | + } catch (\Exception $ex) { |
|
303 | 300 | Log::addErrorLog('An error occured while trying to load the task in file ' . $file . '. Exception: ' . $ex->getMessage()); |
304 | 301 | } |
305 | 302 | } |
@@ -325,8 +322,7 @@ discard block |
||
325 | 322 | Log::addConfigurationLog('Admin Task '.$task_name.' has been deleted from disk - deleting it from DB'); |
326 | 323 | |
327 | 324 | return true; |
328 | - } |
|
329 | - catch(\Exception $ex) { |
|
325 | + } catch(\Exception $ex) { |
|
330 | 326 | Database::rollback(); |
331 | 327 | |
332 | 328 | Log::addErrorLog('An error occurred while deleting Admin Task '.$task_name.'. Exception: '. $ex->getMessage()); |
@@ -185,8 +185,7 @@ discard block |
||
185 | 185 | I18N::translate('Error').Mail::EOL. |
186 | 186 | str_repeat('-', $nb_char_count_title)."\t".str_repeat('-', $nb_char_type)."\t".str_repeat('-', 20)."\t".str_repeat('-', strlen(I18N::translate('Error'))).Mail::EOL. |
187 | 187 | $tmp_message.Mail::EOL; |
188 | - } |
|
189 | - else{ |
|
188 | + } else{ |
|
190 | 189 | $message .= I18N::translate('No errors', $nb_errors).Mail::EOL.Mail::EOL; |
191 | 190 | } |
192 | 191 | |
@@ -251,8 +250,7 @@ discard block |
||
251 | 250 | } |
252 | 251 | } |
253 | 252 | return true; |
254 | - } |
|
255 | - catch (\Exception $ex) { |
|
253 | + } catch (\Exception $ex) { |
|
256 | 254 | Log::addErrorLog(sprintf('Error while updating the Admin Task "%s". Exception: %s', $this->getName(), $ex->getMessage())); |
257 | 255 | return false; |
258 | 256 | } |
@@ -187,7 +187,9 @@ discard block |
||
187 | 187 | |
188 | 188 | // Generate an AJAX/JSON response for datatables to load a block of rows |
189 | 189 | $search = Filter::postArray('search'); |
190 | - if($search) $search = $search['value']; |
|
190 | + if($search) { |
|
191 | + $search = $search['value']; |
|
192 | + } |
|
191 | 193 | $start = Filter::postInteger('start'); |
192 | 194 | $length = Filter::postInteger('length'); |
193 | 195 | $order = Filter::postArray('order'); |
@@ -261,8 +263,7 @@ discard block |
||
261 | 263 | <button id="bt_runtask_'. $task->getName() .'" class="btn btn-primary" href="#" onclick="return run_admintask(\''. $task->getName() .'\')"> |
262 | 264 | <div id="bt_runtasktext_'. $task->getName() .'"><i class="fa fa-cog fa-fw" ></i>' . I18N::translate('Run') . '</div> |
263 | 265 | </button>'; |
264 | - } |
|
265 | - else { |
|
266 | + } else { |
|
266 | 267 | $datum[9] = ''; |
267 | 268 | } |
268 | 269 |
@@ -114,8 +114,12 @@ |
||
114 | 114 | $this->flushTmpSosaTable(); |
115 | 115 | |
116 | 116 | if($fam = $indi->getPrimaryChildFamily()) { |
117 | - if($husb = $fam->getHusband()) $this->addNode($husb, 2 * $sosa); |
|
118 | - if($wife = $fam->getWife()) $this->addNode($wife, 2 * $sosa + 1); |
|
117 | + if($husb = $fam->getHusband()) { |
|
118 | + $this->addNode($husb, 2 * $sosa); |
|
119 | + } |
|
120 | + if($wife = $fam->getWife()) { |
|
121 | + $this->addNode($wife, 2 * $sosa + 1); |
|
122 | + } |
|
119 | 123 | } |
120 | 124 | } |
121 | 125 |
@@ -431,8 +431,7 @@ discard block |
||
431 | 431 | ) { |
432 | 432 | $birt_by_decade[(int)($birth_dates[0]->gregorianYear()/10)*10] .= $person->getSex(); |
433 | 433 | } |
434 | - } |
|
435 | - else { |
|
434 | + } else { |
|
436 | 435 | $birth_dates[0]=new Date(''); |
437 | 436 | } |
438 | 437 | if ($death_dates = $person->getAllDeathDates()) { |
@@ -443,8 +442,7 @@ discard block |
||
443 | 442 | ) { |
444 | 443 | $deat_by_decade[(int) ($death_dates[0]->gregorianYear() / 10) * 10] .= $person->getSex(); |
445 | 444 | } |
446 | - } |
|
447 | - else { |
|
445 | + } else { |
|
448 | 446 | $death_dates[0] = new Date(''); |
449 | 447 | } |
450 | 448 | $age = Date::getAge($birth_dates[0], $death_dates[0], 0); |
@@ -41,8 +41,7 @@ |
||
41 | 41 | $place_name = $place->getFullName(); |
42 | 42 | if(isset($this->places[$place_name])){ |
43 | 43 | $this->places[$place_name]+=1; |
44 | - } |
|
45 | - else{ |
|
44 | + } else{ |
|
46 | 45 | $this->places[$place_name] = 1; |
47 | 46 | } |
48 | 47 | } |
@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | echo FunctionsPrintLists::surnameTable($surns, WT_SCRIPT_NAME, $tree, $extra_params); |
56 | 56 | break; |
57 | 57 | } |
58 | - } |
|
59 | - else if ($this->data->get('islineages', false)) { |
|
58 | + } else if ($this->data->get('islineages', false)) { |
|
60 | 59 | //Link to indilist |
61 | 60 | echo '<p class="center"><strong>'. |
62 | 61 | '<a href="indilist.php?ged=' . $tree->getNameUrl() . '&surname=' . rawurlencode($this->data->get('surname')) .'">'. |
@@ -81,7 +80,9 @@ discard block |
||
81 | 80 | |
82 | 81 | foreach($lineages as $i => $lineage) { |
83 | 82 | $this->printRootLineage($lineage); |
84 | - if($i < $nb_lineages - 1) echo '<hr />'; |
|
83 | + if($i < $nb_lineages - 1) { |
|
84 | + echo '<hr />'; |
|
85 | + } |
|
85 | 86 | } |
86 | 87 | |
87 | 88 | echo '</div>'; |
@@ -156,8 +157,7 @@ discard block |
||
156 | 157 | } |
157 | 158 | } |
158 | 159 | } |
159 | - } |
|
160 | - else { |
|
160 | + } else { |
|
161 | 161 | $this->printLineage($node); |
162 | 162 | } |
163 | 163 | echo '</div>'; |
@@ -185,8 +185,7 @@ discard block |
||
185 | 185 | echo '<li>'; |
186 | 186 | if($is_first_family){ |
187 | 187 | echo FunctionsPrint::htmlIndividualForList($node_indi); |
188 | - } |
|
189 | - else{ |
|
188 | + } else{ |
|
190 | 189 | echo FunctionsPrint::htmlIndividualForList($node_indi, false); |
191 | 190 | } |
192 | 191 | //Get individual's spouse |
@@ -207,15 +206,13 @@ discard block |
||
207 | 206 | foreach($fam_nodes[$fam] as $child_node) { |
208 | 207 | if($child_node) { |
209 | 208 | $this->printLineage($child_node); |
210 | - } |
|
211 | - else { |
|
209 | + } else { |
|
212 | 210 | echo '<ul><li><strong>…</strong></li></ul>'; |
213 | 211 | } |
214 | 212 | } |
215 | 213 | $is_first_family = false; |
216 | 214 | } |
217 | - } |
|
218 | - else { |
|
215 | + } else { |
|
219 | 216 | echo '<li>'; |
220 | 217 | echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlIndividualForList($node->getIndividual()); |
221 | 218 | if($node->hasFollowUpSurname()) { |
@@ -171,8 +171,7 @@ |
||
171 | 171 | |
172 | 172 | if ($this->show_all==='no') { |
173 | 173 | $view_bag->set('table_title', I18N::translate('Individuals in %s lineages', $this->legend)); |
174 | - } |
|
175 | - else { |
|
174 | + } else { |
|
176 | 175 | $view_bag->set('table_title', I18N::translate('All lineages')); |
177 | 176 | } |
178 | 177 | } |
@@ -66,7 +66,10 @@ |
||
66 | 66 | <td><?php echo (($hook->status)=='enabled'); ?></td> |
67 | 67 | <td><?php echo $hook->hook; ?></td> |
68 | 68 | <td><?php echo $hook->context; ?></td> |
69 | - <td><?php if($mod = Module::getModuleByName($hook->module)) echo $mod->getTitle(); ?></td> |
|
69 | + <td><?php if($mod = Module::getModuleByName($hook->module)) { |
|
70 | + echo $mod->getTitle(); |
|
71 | +} |
|
72 | +?></td> |
|
70 | 73 | <td><input type="text" class="center" size="2" value="<?php echo $hook->priority; ?>" name="moduleorder-<?php echo $hook->id; ?>" /></td> |
71 | 74 | <td><?php echo $hook->priority; ?></td> |
72 | 75 | </tr> |