@@ -31,11 +31,16 @@ |
||
| 31 | 31 | $nb_levels = count($parent); |
| 32 | 32 | for ($i=0; $i < $nb_levels; $i++) { |
| 33 | 33 | $parent[$i] = trim($parent[$i]); |
| 34 | - if (empty($parent[$i])) $parent[$i]='unknown';// GoogleMap module uses "unknown" while GEDCOM uses , , |
|
| 34 | + if (empty($parent[$i])) { |
|
| 35 | + $parent[$i]='unknown'; |
|
| 36 | + } |
|
| 37 | + // GoogleMap module uses "unknown" while GEDCOM uses , , |
|
| 35 | 38 | $pl_id=Database::prepare('SELECT pl_id FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ? ORDER BY pl_place') |
| 36 | 39 | ->execute(array($i, $place_id, $parent[$i])) |
| 37 | 40 | ->fetchOne(); |
| 38 | - if (empty($pl_id)) break; |
|
| 41 | + if (empty($pl_id)) { |
|
| 42 | + break; |
|
| 43 | + } |
|
| 39 | 44 | $place_id = $pl_id; |
| 40 | 45 | } |
| 41 | 46 | return $place_id; |
@@ -65,8 +65,9 @@ discard block |
||
| 65 | 65 | public function hExtendIndiHeaderIcons(IndividualController $ctrlIndi) { |
| 66 | 66 | if($ctrlIndi){ |
| 67 | 67 | $dindi = new Individual($ctrlIndi->getSignificantIndividual()); |
| 68 | - if ($dindi->canDisplayIsSourced()) |
|
| 69 | - return FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, 'large'); |
|
| 68 | + if ($dindi->canDisplayIsSourced()) { |
|
| 69 | + return FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, 'large'); |
|
| 70 | + } |
|
| 70 | 71 | } |
| 71 | 72 | return ''; |
| 72 | 73 | } |
@@ -99,8 +100,9 @@ discard block |
||
| 99 | 100 | $dindi = new Individual($grec); |
| 100 | 101 | $html .= FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, $size); |
| 101 | 102 | $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isBirthSourced(), 'BIRT', 1, $size); |
| 102 | - if($grec->isDead()) |
|
| 103 | - $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1, $size); |
|
| 103 | + if($grec->isDead()) { |
|
| 104 | + $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1, $size); |
|
| 105 | + } |
|
| 104 | 106 | } |
| 105 | 107 | return $html; |
| 106 | 108 | } |
@@ -173,12 +175,13 @@ discard block |
||
| 173 | 175 | </tr>'; |
| 174 | 176 | } |
| 175 | 177 | |
| 176 | - if( $root->isDead() ) |
|
| 177 | - echo ' |
|
| 178 | + if( $root->isDead() ) { |
|
| 179 | + echo ' |
|
| 178 | 180 | <tr> |
| 179 | 181 | <td class="slabel">' . GedcomTag::getLabel('DEAT') . '</td> |
| 180 | 182 | <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1).'</td> |
| 181 | 183 | </tr>'; |
| 184 | + } |
|
| 182 | 185 | |
| 183 | 186 | echo '</table>'; |
| 184 | 187 | } |
@@ -45,7 +45,9 @@ |
||
| 45 | 45 | public function render() { |
| 46 | 46 | global $controller; |
| 47 | 47 | |
| 48 | - if(!$this->ctrl) throw new \Exception('Controller not initialised'); |
|
| 48 | + if(!$this->ctrl) { |
|
| 49 | + throw new \Exception('Controller not initialised'); |
|
| 50 | + } |
|
| 49 | 51 | |
| 50 | 52 | $controller = $this->ctrl; |
| 51 | 53 | $this->ctrl->pageHeader(); |
@@ -86,9 +86,12 @@ discard block |
||
| 86 | 86 | * @return boolean |
| 87 | 87 | */ |
| 88 | 88 | public function canDisplayIsSourced($access_level = null){ |
| 89 | - if(!$this->gedcomrecord->canShow($access_level)) return false; |
|
| 90 | - if($access_level === null ) |
|
| 91 | - $access_level = \Fisharebest\Webtrees\Auth::accessLevel($this->gedcomrecord->getTree()); |
|
| 89 | + if(!$this->gedcomrecord->canShow($access_level)) { |
|
| 90 | + return false; |
|
| 91 | + } |
|
| 92 | + if($access_level === null ) { |
|
| 93 | + $access_level = \Fisharebest\Webtrees\Auth::accessLevel($this->gedcomrecord->getTree()); |
|
| 94 | + } |
|
| 92 | 95 | |
| 93 | 96 | $global_facts = Globals::getGlobalFacts(); |
| 94 | 97 | if (isset($global_facts['SOUR'])) { |
@@ -108,7 +111,9 @@ discard block |
||
| 108 | 111 | * @return int Level of sources |
| 109 | 112 | */ |
| 110 | 113 | public function isSourced(){ |
| 111 | - if($this->_issourced !== null) return $this->_issourced; |
|
| 114 | + if($this->_issourced !== null) { |
|
| 115 | + return $this->_issourced; |
|
| 116 | + } |
|
| 112 | 117 | $this->_issourced=-1; |
| 113 | 118 | $sourcesfacts = $this->gedcomrecord->getFacts('SOUR'); |
| 114 | 119 | foreach($sourcesfacts as $sourcefact){ |
@@ -127,7 +132,9 @@ discard block |
||
| 127 | 132 | * @return int Level of sources |
| 128 | 133 | */ |
| 129 | 134 | public function isFactSourced($eventslist){ |
| 130 | - if(empty($eventslist)) return 0; |
|
| 135 | + if(empty($eventslist)) { |
|
| 136 | + return 0; |
|
| 137 | + } |
|
| 131 | 138 | $isSourced=0; |
| 132 | 139 | $facts = $this->gedcomrecord->getFacts($eventslist); |
| 133 | 140 | foreach($facts as $fact){ |
@@ -137,8 +144,7 @@ discard block |
||
| 137 | 144 | if($tmpIsSourced != 0) { |
| 138 | 145 | if($isSourced==0) { |
| 139 | 146 | $isSourced = $tmpIsSourced; |
| 140 | - } |
|
| 141 | - else{ |
|
| 147 | + } else{ |
|
| 142 | 148 | $isSourced = max($isSourced, $tmpIsSourced); |
| 143 | 149 | } |
| 144 | 150 | } |
@@ -123,7 +123,9 @@ |
||
| 123 | 123 | $tree = Globals::getTree(); |
| 124 | 124 | $cid = Filter::get('cid'); |
| 125 | 125 | $certificate = null; |
| 126 | - if(!empty($cid)) $certificate = Certificate::getInstance($cid, $tree, null, $this->provider); |
|
| 126 | + if(!empty($cid)) { |
|
| 127 | + $certificate = Certificate::getInstance($cid, $tree, null, $this->provider); |
|
| 128 | + } |
|
| 127 | 129 | |
| 128 | 130 | $imageBuilder = new ImageBuilder($certificate); |
| 129 | 131 | |
@@ -85,7 +85,9 @@ |
||
| 85 | 85 | */ |
| 86 | 86 | public function index() { |
| 87 | 87 | $action = Filter::post('action'); |
| 88 | - if($action == 'update' && Filter::checkCsrf()) $this->update(); |
|
| 88 | + if($action == 'update' && Filter::checkCsrf()) { |
|
| 89 | + $this->update(); |
|
| 90 | + } |
|
| 89 | 91 | |
| 90 | 92 | Theme::theme(new AdministrationTheme)->init(Globals::getTree()); |
| 91 | 93 | $ctrl = new PageController(); |
@@ -61,7 +61,9 @@ |
||
| 61 | 61 | */ |
| 62 | 62 | public function index() { |
| 63 | 63 | $action = Filter::post('action'); |
| 64 | - if($action == 'update' && Filter::checkCsrf()) $this->update(); |
|
| 64 | + if($action == 'update' && Filter::checkCsrf()) { |
|
| 65 | + $this->update(); |
|
| 66 | + } |
|
| 65 | 67 | |
| 66 | 68 | Theme::theme(new AdministrationTheme)->init(Globals::getTree()); |
| 67 | 69 | $ctrl = new PageController(); |
@@ -115,7 +115,9 @@ discard block |
||
| 115 | 115 | $sid=null; |
| 116 | 116 | |
| 117 | 117 | if($this->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($wt_tree)){ |
| 118 | - if (!$srec || strlen($srec) == 0) return $html; |
|
| 118 | + if (!$srec || strlen($srec) == 0) { |
|
| 119 | + return $html; |
|
| 120 | + } |
|
| 119 | 121 | |
| 120 | 122 | $certificate = null; |
| 121 | 123 | $subrecords = explode("\n", $srec); |
@@ -129,11 +131,14 @@ discard block |
||
| 129 | 131 | $subrecords[$i] = trim($subrecords[$i]); |
| 130 | 132 | $tag = substr($subrecords[$i], 2, 4); |
| 131 | 133 | $text = substr($subrecords[$i], 7); |
| 132 | - if($tag == '_ACT') $certificate= new Certificate($text, $wt_tree, $this->getProvider()); |
|
| 134 | + if($tag == '_ACT') { |
|
| 135 | + $certificate= new Certificate($text, $wt_tree, $this->getProvider()); |
|
| 136 | + } |
|
| 133 | 137 | } |
| 134 | 138 | |
| 135 | - if($certificate && $certificate->canShow()) |
|
| 136 | - $html = $this->getDisplay_ACT($certificate, $sid); |
|
| 139 | + if($certificate && $certificate->canShow()) { |
|
| 140 | + $html = $this->getDisplay_ACT($certificate, $sid); |
|
| 141 | + } |
|
| 137 | 142 | |
| 138 | 143 | } |
| 139 | 144 | return $html; |
@@ -161,7 +166,9 @@ discard block |
||
| 161 | 166 | $html = ''; |
| 162 | 167 | switch($tag){ |
| 163 | 168 | case '_ACT': |
| 164 | - if($context == 'SOUR') $html = $this->getDisplay_ACT($value, $contextid); |
|
| 169 | + if($context == 'SOUR') { |
|
| 170 | + $html = $this->getDisplay_ACT($value, $contextid); |
|
| 171 | + } |
|
| 165 | 172 | break; |
| 166 | 173 | } |
| 167 | 174 | return $html; |
@@ -189,7 +196,9 @@ discard block |
||
| 189 | 196 | $html .= '<select id="certifCity'.$element_id.'" class="_CITY">'; |
| 190 | 197 | foreach ($tabCities as $cities){ |
| 191 | 198 | $selectedCity=''; |
| 192 | - if($certificate && $cities== $certificate->getCity()) $selectedCity='selected="true"'; |
|
| 199 | + if($certificate && $cities== $certificate->getCity()) { |
|
| 200 | + $selectedCity='selected="true"'; |
|
| 201 | + } |
|
| 193 | 202 | $html .= '<option value="'.$cities.'" '.$selectedCity.' />'.$cities.'</option>'; |
| 194 | 203 | } |
| 195 | 204 | $html .= '</select>'; |
@@ -104,7 +104,9 @@ discard block |
||
| 104 | 104 | }'); |
| 105 | 105 | |
| 106 | 106 | $action = Filter::post('action'); |
| 107 | - if($action === 'update') $this->update($controller); |
|
| 107 | + if($action === 'update') { |
|
| 108 | + $this->update($controller); |
|
| 109 | + } |
|
| 108 | 110 | |
| 109 | 111 | $view_bag = new ViewBag(); |
| 110 | 112 | $view_bag->set('title', $controller->getPageTitle()); |
@@ -149,7 +151,9 @@ discard block |
||
| 149 | 151 | $user = User::find(Filter::getInteger('userid', -1)); |
| 150 | 152 | if($user) { |
| 151 | 153 | $calculator = new SosaCalculator(Globals::getTree(), $user); |
| 152 | - if($calculator->computeAll()) $view_bag->set('is_success', true); |
|
| 154 | + if($calculator->computeAll()) { |
|
| 155 | + $view_bag->set('is_success', true); |
|
| 156 | + } |
|
| 153 | 157 | } |
| 154 | 158 | ViewFactory::make('SosaComputeResult', $this, $controller, $view_bag)->render(); |
| 155 | 159 | } |
@@ -170,9 +174,10 @@ discard block |
||
| 170 | 174 | |
| 171 | 175 | if($user && $indi) { |
| 172 | 176 | $calculator = new SosaCalculator($wt_tree, $user); |
| 173 | - if($calculator->computeFromIndividual($indi)) $view_bag->set('is_success', true); |
|
| 174 | - } |
|
| 175 | - else { |
|
| 177 | + if($calculator->computeFromIndividual($indi)) { |
|
| 178 | + $view_bag->set('is_success', true); |
|
| 179 | + } |
|
| 180 | + } else { |
|
| 176 | 181 | $view_bag->set('error', I18N::translate('Non existing individual')); |
| 177 | 182 | } |
| 178 | 183 | |