diff options
| author | Greg Roach <fisharebest@gmail.com> | 2015-01-18 14:52:17 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2015-01-18 14:52:50 +0000 |
| commit | b7896d601b767dfc140a9e74b3cc722bde9b6ae4 (patch) | |
| tree | e2ba2cd2b2d90fb74457fd80051c60161cbaa1b3 | |
| parent | 6177601f1b8352832a205f3b48b5fc560ce8c621 (diff) | |
| download | webtrees-b7896d601b767dfc140a9e74b3cc722bde9b6ae4.tar.gz webtrees-b7896d601b767dfc140a9e74b3cc722bde9b6ae4.tar.bz2 webtrees-b7896d601b767dfc140a9e74b3cc722bde9b6ae4.zip | |
code style
| -rw-r--r-- | admin_site_logs.php | 2 | ||||
| -rw-r--r-- | edit_changes.php | 6 | ||||
| -rw-r--r-- | edit_interface.php | 34 | ||||
| -rw-r--r-- | find.php | 4 | ||||
| -rw-r--r-- | library/WT/Report/PDF.php | 6 |
5 files changed, 29 insertions, 23 deletions
diff --git a/admin_site_logs.php b/admin_site_logs.php index 34885bc075..7953dc1b31 100644 --- a/admin_site_logs.php +++ b/admin_site_logs.php @@ -32,7 +32,7 @@ $controller require WT_ROOT . 'includes/functions/functions_edit.php'; $earliest = WT_DB::prepare("SELECT DATE(MIN(log_time)) FROM `##log`")->execute(array())->fetchOne(); -$latest = WT_DB::prepare("SELECT DATE(MAX(log_time)) FROM `##log`")->execute(array())->fetchOne(); +$latest = WT_DB::prepare("SELECT DATE(MAX(log_time)) FROM `##log`")->execute(array())->fetchOne(); // Filtering $action = WT_Filter::get('action'); diff --git a/edit_changes.php b/edit_changes.php index 19141edf9c..a2d8662693 100644 --- a/edit_changes.php +++ b/edit_changes.php @@ -61,10 +61,10 @@ case 'undo': )->execute(array($gedcom_id, $xref, $change_id)); break; case 'accept': - $gedcom_id=WT_DB::prepare("SELECT gedcom_id FROM `##change` WHERE change_id=?")->execute(array($change_id))->fetchOne(); - $xref =WT_DB::prepare("SELECT xref FROM `##change` WHERE change_id=?")->execute(array($change_id))->fetchOne(); + $gedcom_id = WT_DB::prepare("SELECT gedcom_id FROM `##change` WHERE change_id=?")->execute(array($change_id))->fetchOne(); + $xref = WT_DB::prepare("SELECT xref FROM `##change` WHERE change_id=?")->execute(array($change_id))->fetchOne(); // Accept a change, and all previous changes to the same record - $changes=WT_DB::prepare( + $changes = WT_DB::prepare( "SELECT change_id, gedcom_id, gedcom_name, xref, old_gedcom, new_gedcom". " FROM `##change` c". " JOIN `##gedcom` g USING (gedcom_id)". diff --git a/edit_interface.php b/edit_interface.php index 1c068ee92b..f3ee8051f7 100644 --- a/edit_interface.php +++ b/edit_interface.php @@ -2616,9 +2616,11 @@ function print_indi_form($nextaction, WT_Individual $person = null, WT_Family $f // Get the advanced name fields $adv_name_fields = array(); - if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $ADVANCED_NAME_FACTS, $match)) - foreach ($match[1] as $tag) + if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $ADVANCED_NAME_FACTS, $match)) { + foreach ($match[1] as $tag) { $adv_name_fields[$tag] = ''; + } + } // This is a custom tag, but webtrees uses it extensively. if ($SURNAME_TRADITION == 'paternal' || $SURNAME_TRADITION == 'polish' || $SURNAME_TRADITION == 'lithuanian' || (strpos($namerec, '2 _MARNM') !== false)) { $adv_name_fields['_MARNM'] = ''; @@ -2628,28 +2630,32 @@ function print_indi_form($nextaction, WT_Individual $person = null, WT_Family $f } foreach ($adv_name_fields as $tag=>$dummy) { // Edit existing tags - if (preg_match_all("/2 $tag (.+)/", $namerec, $match)) + if (preg_match_all("/2 $tag (.+)/", $namerec, $match)) { foreach ($match[1] as $value) { if ($tag == '_MARNM') { - $mnsct = preg_match('/\/(.+)\//', $value, $match2); + $mnsct = preg_match('/\/(.+)\//', $value, $match2); $marnm_surn = ''; - if ($mnsct > 0) $marnm_surn = $match2[1]; + if ($mnsct > 0) { + $marnm_surn = $match2[1]; + } add_simple_tag("2 _MARNM " . $value); add_simple_tag("2 _MARNM_SURN " . $marnm_surn); } else { add_simple_tag("2 $tag $value", '', WT_Gedcom_Tag::getLabel("NAME:{$tag}", $person)); } } - // Allow a new row to be entered if there was no row provided - if (count($match[1]) == 0 && empty($name_fields[$tag]) || $tag != '_HEB' && $tag != 'NICK') - if ($tag == '_MARNM') { - if (strstr($ADVANCED_NAME_FACTS, '_MARNM') == false) { - add_simple_tag("0 _MARNM"); - add_simple_tag("0 _MARNM_SURN $new_marnm"); - } - } else { - add_simple_tag("0 $tag", '', WT_Gedcom_Tag::getLabel("NAME:{$tag}", $person)); + } + // Allow a new row to be entered if there was no row provided + if (count($match[1]) == 0 && empty($name_fields[$tag]) || $tag != '_HEB' && $tag != 'NICK') { + if ($tag == '_MARNM') { + if (strstr($ADVANCED_NAME_FACTS, '_MARNM') == false) { + add_simple_tag("0 _MARNM"); + add_simple_tag("0 _MARNM_SURN $new_marnm"); } + } else { + add_simple_tag("0 $tag", '', WT_Gedcom_Tag::getLabel("NAME:{$tag}", $person)); + } + } } // Handle any other NAME subfields that aren’t included above (SOUR, NOTE, _CUSTOM, etc) @@ -402,10 +402,10 @@ if ($type == "facts") { }; function initPickFact() { - var n,i,j,tmp,preselectedDefaultTags="\x01<?php foreach ($preselDefault as $p) echo addslashes($p), '\\x01'; ?>"; + var n,i,j,tmp,preselectedDefaultTags="\x01<?php foreach ($preselDefault as $p) { echo addslashes($p), '\\x01'; } ?>"; DefaultTags=[<?php - $firstFact = TRUE; + $firstFact = true; foreach (WT_Gedcom_Tag::getPicklistFacts() as $factId => $factName) { if ($firstFact) $firstFact = FALSE; else echo ','; diff --git a/library/WT/Report/PDF.php b/library/WT/Report/PDF.php index 652b1b8cc2..df7306c6ec 100644 --- a/library/WT/Report/PDF.php +++ b/library/WT/Report/PDF.php @@ -35,19 +35,19 @@ class WT_Report_PDF extends WT_Report_Base { */ const COMPRESSION = true; /** - * If TRUE reduce the RAM memory usage by caching temporary data on filesystem (slower). + * If true reduce the RAM memory usage by caching temporary data on filesystem (slower). * * @var boolean const */ const DISK_CACHE = false; /** - * TRUE means that the input text is unicode (PDF) + * true means that the input text is unicode (PDF) * * @var boolean const */ const UNICODE = true; /** - * FALSE means that the full font is embedded, TRUE means only the used chars + * false means that the full font is embedded, true means only the used chars * in TCPDF v5.9 font subsetting is a very slow process, this leads to larger files * * @var boolean const |
