/webtrees/app/Module/ |
H A D | ClippingsCartModule.php | 133 public function getMenu(Tree $tree): Menu|null argument 139 $count = count($cart[$tree->name()] ?? []); 146 'tree' => $tree->name(), 159 'tree' => $tree->name(), 165 if (!$this->isCartEmpty($tree)) { 169 'tree' => $tree->name(), 175 'tree' => $tree->name(), 188 private function isCartEmpty(Tree $tree): bool argument 192 $contents = $cart[$tree->name()] ?? []; 199 $tree = Validator::attributes($request)->tree(); [all …]
|
H A D | ModuleDataFixTrait.php | 44 * @param Tree $tree 48 public function fixOptions(Tree $tree): string argument 57 * @param Tree $tree 62 public function recordsToFix(Tree $tree, array $params): Collection argument 64 $families = $this->familiesToFix($tree, $params); 65 $individuals = $this->individualsToFix($tree, $params); 66 $locations = $this->locationsToFix($tree, $params); 67 $media = $this->mediaToFix($tree, $params); 68 $notes = $this->notesToFix($tree, $params); 69 $repositories = $this->repositoriesToFix($tree, $params); [all …]
|
H A D | ModuleThemeTrait.php | 81 …$opt_tags = preg_split('/\W/', $individual->tree()->getPreference('CHART_BOX_TAGS'), 0, PREG_SPLIT… 152 …foreach ($module_service->findByComponent(ModuleChartInterface::class, $individual->tree(), Auth::… 194 * @param Tree $tree 198 public function menuChangeBlocks(Tree $tree): Menu|null argument 204 …:translate('Customize this page'), route(UserPageEdit::class, ['tree' => $tree->name()]), 'menu-ch… 207 if (Auth::isManager($tree) && $route->name === TreePage::class) { 208 …:translate('Customize this page'), route(TreePageEdit::class, ['tree' => $tree->name()]), 'menu-ch… 217 * @param Tree $tree 221 public function menuControlPanel(Tree $tree): Menu|null argument 227 if (Auth::isManager($tree)) { [all …]
|
H A D | SiteMapModule.php | 152 foreach ($this->tree_service->all() as $tree) { 153 … $include_in_sitemap = Validator::parsedBody($request)->boolean('sitemap' . $tree->id(), false); 154 $tree->setPreference('include_in_sitemap', (string) $include_in_sitemap); 196 … ->filter(static fn (Tree $tree): bool => $tree->getPreference('include_in_sitemap') === '1') 197 ->map(static fn (Tree $tree): int => $tree->id()); 276 $tree = Validator::attributes($request)->tree('tree'); 280 if ($tree->getPreference('include_in_sitemap') !== '1') { 284 $cache_key = 'sitemap/' . $tree->id() . '/' . $type . '/' . $page . '.xml'; 286 …$content = Registry::cache()->file()->remember($cache_key, function () use ($tree, $type, $page): … 287 …$records = $this->sitemapRecords($tree, $type, self::RECORDS_PER_VOLUME, self::RECORDS_PER_VOLUME … [all …]
|
H A D | FamilyTreeFavoritesModule.php | 61 * @param Tree $tree 68 public function getBlock(Tree $tree, int $block_id, string $context, array $config = []): string argument 72 'can_edit' => Auth::isManager($tree), 73 'favorites' => $this->getFavorites($tree), 75 'tree' => $tree, 125 * @param Tree $tree 129 public function getFavorites(Tree $tree): array argument 132 ->where('gedcom_id', '=', $tree->id()) 135 ->map(static function (object $row) use ($tree): object { 137 $row->record = Registry::gedcomRecordFactory()->make($row->xref, $tree); [all …]
|
H A D | StoriesModule.php | 105 'tree' => $individual->tree(), 119 ->where('gedcom_id', '=', $individual->tree()->id()) 149 … return Auth::isManager($individual->tree()) || $this->getStoriesForIndividual($individual) !== []; 178 * @param Tree $tree 182 public function getMenu(Tree $tree): Menu|null argument 187 'tree' => $tree->name(), 212 $tree = Validator::attributes($request)->treeOptional(); 214 if (!$tree instanceof Tree) { 215 $tree = $this->tree_service->all()->first(); 216 if ($tree instanceof Tree) { [all …]
|
H A D | UserFavoritesModule.php | 62 * @param Tree $tree 69 public function getBlock(Tree $tree, int $block_id, string $context, array $config = []): string argument 74 'favorites' => $this->getFavorites($tree, Auth::user()), 76 'tree' => $tree, 126 * @param Tree $tree 131 public function getFavorites(Tree $tree, UserInterface $user): array argument 134 ->where('gedcom_id', '=', $tree->id()) 137 ->map(static function (object $row) use ($tree): object { 139 $row->record = Registry::gedcomRecordFactory()->make($row->xref, $tree); 161 $tree = Validator::attributes($request)->tree(); [all …]
|
H A D | AbstractIndividualListModule.php | 84 public function listUrl(Tree $tree, array $parameters = []): string argument 90 $individual = Registry::individualFactory()->make($xref, $tree); 99 $parameters['tree'] = $tree->name(); 114 $tree = Validator::attributes($request)->tree(); 117 Auth::checkComponentAccess($this, ModuleListInterface::class, $tree, $user); 153 … ->redirectUrl($this->listUrl($tree, $params), StatusCodeInterface::STATUS_MOVED_PERMANENTLY); 170 $surname_data = $this->surnameData($tree, $show_marnm === 'yes', $this->showFamilies()); 181 ->redirectUrl($this->listUrl($tree)); 189 … $params = ['tree' => $tree->name(), 'show_all' => 'yes', 'show_marnm' => $show_marnm]; 193 … $params = ['tree' => $tree->name(), 'show_all' => 'yes', 'show_marnm' => $show_marnm]; [all …]
|
H A D | RelationshipsChartModule.php | 143 …$my_xref = $individual->tree()->getUserPreference(Auth::user(), UserInterface::PREF_TREE_ACCOUNT_X… 146 $my_record = Registry::individualFactory()->make($my_xref, $individual->tree()); 199 'tree' => $individual->tree()->name(), 210 $tree = Validator::attributes($request)->tree(); 221 'tree' => $tree->name(), 229 $individual1 = Registry::individualFactory()->make($xref, $tree); 230 $individual2 = Registry::individualFactory()->make($xref2, $tree); 232 … $ancestors_only = (int) $tree->getPreference('RELATIONSHIP_ANCESTORS', static::DEFAULT_ANCESTORS); 233 … $max_recursion = (int) $tree->getPreference('RELATIONSHIP_RECURSION', static::DEFAULT_RECURSION); 237 Auth::checkComponentAccess($this, ModuleChartInterface::class, $tree, $user); [all …]
|
H A D | FrequentlyAskedQuestionsModule.php | 92 * @param Tree $tree 96 public function getMenu(Tree $tree): Menu|null argument 98 if ($this->faqsExist($tree, I18N::languageTag())) { 102 'tree' => $tree->name(), 119 $tree = Validator::attributes($request)->treeOptional(); 121 if (!$tree instanceof Tree) { 124 $tree = $trees->get(Site::getPreference('DEFAULT_GEDCOM')) ?? $trees->first(); 126 if ($tree instanceof Tree) { 127 …direct(route('module', ['module' => $this->name(), 'action' => 'Admin', 'tree' => $tree->name()])); 133 $faqs = $this->faqsForTree($tree); [all …]
|
H A D | FixDuplicateLinks.php | 69 * @param Tree $tree 74 protected function familiesToFix(Tree $tree, array $params): Collection argument 77 return $this->familiesToFixQuery($tree, $params) 85 * @param Tree $tree 90 protected function individualsToFix(Tree $tree, array $params): Collection|null argument 93 return $this->individualsToFixQuery($tree, $params) 101 * @param Tree $tree 106 protected function mediaToFix(Tree $tree, array $params): Collection argument 109 return $this->mediaToFixQuery($tree, $params) 117 * @param Tree $tree [all …]
|
H A D | FixSearchAndReplace.php | 87 * @param Tree $tree 91 public function fixOptions(Tree $tree): string argument 126 * @param Tree $tree 131 protected function familiesToFix(Tree $tree, array $params): Collection|null argument 137 $query = DB::table('families')->where('f_file', '=', $tree->id()); 147 * @param Tree $tree 152 protected function individualsToFix(Tree $tree, array $params): Collection|null argument 159 ->where('i_file', '=', $tree->id()); 170 * @param Tree $tree 175 protected function locationsToFix(Tree $tree, array $params): Collection|null argument [all …]
|
/webtrees/app/Services/ |
H A D | TreeService.php | 149 $tree = $this->all()->first(static fn (Tree $tree): bool => $tree->id() === $id); 151 if ($tree instanceof Tree) { 152 return $tree; 165 return $this->all()->map(static fn (Tree $tree): string => $tree->title())->all(); 182 $tree = new Tree($tree_id, $name, $title); 184 $tree->setPreference('imported', '1'); 185 $tree->setPreference('title', $title); 209 $tree->setPreference('REQUIRE_AUTHENTICATION', ''); 210 $tree->setPreference('CONTACT_USER_ID', (string) Auth::id()); 211 $tree->setPreference('WEBMASTER_USER_ID', (string) Auth::id()); [all …]
|
H A D | GedcomExportService.php | 93 … * @param Tree $tree Export data from this tree 103 Tree $tree, argument 115 …$resource = $this->export($tree, $sort_by_xref, $encoding, $access_level, $line_endings, $records); 131 $media_path = $tree->getPreference('MEDIA_DIRECTORY'); 139 …$resource = $this->export($tree, $sort_by_xref, $encoding, $access_level, $line_endings, $records,… 162 …* @param Tree $tree Export data from this tree 174 Tree $tree, argument 194 new Collection([$this->createHeader($tree, $encoding, false)]), 201 new Collection([$this->createHeader($tree, $encoding, true)]), 202 $this->individualQuery($tree, $sort_by_xref)->cursor(), [all …]
|
H A D | GedcomImportService.php | 76 * @param Tree $tree 80 private function reformatRecord(string $rec, Tree $tree): string argument 206 $GEDCOM_MEDIA_PATH = $tree->getPreference('GEDCOM_MEDIA_PATH'); 217 $newrec .= ($tree->getPreference('WORD_WRAPPED_NOTES') ? ' ' : '') . $data; 230 * @param Tree $tree import the record into this tree 236 public function importRecord(string $gedrec, Tree $tree, bool $update): void argument 238 $tree_id = $tree->id(); 246 $gedrec = $this->reformatRecord($gedrec, $tree); 255 $tree->setPreference('imported', '1'); 277 if ($tree->getPreference('GENERATE_UIDS') === '1' && !str_contains($gedrec, "\n1 _UID ")) { [all …]
|
/webtrees/app/Factories/ |
H A D | GedcomRecordFactory.php | 49 public function make(string $xref, Tree $tree, string|null $gedcom = null): GedcomRecord|null argument 55 return Registry::familyFactory()->make($xref, $tree, $gedcom); 57 return Registry::headerFactory()->make($xref, $tree, $gedcom); 59 return Registry::individualFactory()->make($xref, $tree, $gedcom); 61 return Registry::locationFactory()->make($xref, $tree, $gedcom); 63 return Registry::mediaFactory()->make($xref, $tree, $gedcom); 65 return Registry::noteFactory()->make($xref, $tree, $gedcom); 67 return Registry::repositoryFactory()->make($xref, $tree, $gedcom); 69 return Registry::sourceFactory()->make($xref, $tree, $gedcom); 71 return Registry::submitterFactory()->make($xref, $tree, $gedcom); [all …]
|
/webtrees/tests/app/ |
H A D | TreeTest.php | 61 $tree = $tree_service->create('name', 'title'); 63 self::assertSame('name', $tree->name()); 64 self::assertSame('title', $tree->title()); 71 $tree = $tree_service->create('name', 'title'); 73 $tree->setPreference('foo', 'bar'); 74 $pref = $tree->getPreference('foo'); 83 $tree = $tree_service->create('name', 'title'); 86 $pref = $tree->getUserPreference($user, 'foo', 'default'); 89 $tree->setUserPreference($user, 'foo', 'bar'); 90 $pref = $tree->getUserPreference($user, 'foo', 'default'); [all …]
|
/webtrees/app/Http/RequestHandlers/ |
H A D | TreePreferencesAction.php | 52 $tree = Validator::attributes($request)->tree(); 97 $tree->setPreference('CALENDAR_FORMAT', $calendar_format); 98 $tree->setPreference('CHART_BOX_TAGS', implode(',', $chart_box_tags)); 99 $tree->setPreference('CONTACT_USER_ID', $contact_user_id); 100 $tree->setPreference('EXPAND_NOTES', (string) $expand_notes); 101 $tree->setPreference('EXPAND_SOURCES', (string) $expand_sources); 102 $tree->setPreference('FAM_FACTS_QUICK', implode(',', $fam_facts_quick)); 103 $tree->setPreference('FORMAT_TEXT', $format_text); 104 $tree->setPreference('GENERATE_UIDS', (string) $generate_uuids); 105 $tree->setPreference('HIDE_GEDCOM_ERRORS', (string) $hide_gedcom_errors); [all …]
|
H A D | CheckTree.php | 102 $tree = Validator::attributes($request)->tree(); 109 ->where('i_file', '=', $tree->id()) 112 ->where('f_file', '=', $tree->id()) 115 ->where('m_file', '=', $tree->id()) 118 ->where('s_file', '=', $tree->id()) 121 ->where('o_file', '=', $tree->id()) 124 ->where('gedcom_id', '=', $tree->id()) 192 …$errors[] = $this->lineError($tree, $record->type, $record->xref, $line_number, $line, I18N::trans… 198 …$errors[] = $this->lineError($tree, $record->type, $record->xref, $line_number, $line, I18N::trans… 216 …$warnings[] = $this->lineError($tree, $record->type, $record->xref, $line_number, $line, $message,… [all …]
|
H A D | RenumberTreeAction.php | 71 $tree = Validator::attributes($request)->tree(); 72 $xrefs = $this->admin_service->duplicateXrefs($tree); 79 ->where('i_file', '=', $tree->id()) 88 ->where('f_file', '=', $tree->id()) 96 ->where('f_file', '=', $tree->id()) 112 ->where('f_file', '=', $tree->id()) 128 ->where('i_file', '=', $tree->id()) 135 ->where('pl_file', '=', $tree->id()) 142 ->where('d_file', '=', $tree->id()) 149 ->where('gedcom_id', '=', $tree->id()) [all …]
|
H A D | GedcomLoad.php | 75 $tree = Validator::attributes($request)->tree(); 80 ->where('gedcom_id', '=', $tree->id()) 85 ->where('gedcom_id', '=', $tree->id()) 90 if ($tree->getPreference('imported') !== '1') { 93 'tree' => $tree, 97 return $this->viewResponse('admin/import-complete', ['tree' => $tree]); 103 'individuals' => DB::table('individuals')->where('i_file', '=', $tree->id()), 104 'families' => DB::table('families')->where('f_file', '=', $tree->id()), 105 'sources' => DB::table('sources')->where('s_file', '=', $tree->id()), 106 'other' => DB::table('other')->where('o_file', '=', $tree->id()), [all …]
|
/webtrees/tests/feature/ |
H A D | Privacy.php | 33 $tree = $this->importTree('demo.ged'); 36 $queen_elizabeth = Registry::individualFactory()->make('X1030', $tree); 40 $prince_charles = Registry::individualFactory()->make('X1052', $tree); 44 $savannah = Registry::individualFactory()->make('X1044', $tree); 48 $beatrice = Registry::individualFactory()->make('X1047', $tree); 58 … $tree->setUserPreference($manager, UserInterface::PREF_TREE_ROLE, UserInterface::ROLE_MANAGER); 61 …$tree->setUserPreference($moderator, UserInterface::PREF_TREE_ROLE, UserInterface::ROLE_MODERATOR); 64 … $tree->setUserPreference($editor, UserInterface::PREF_TREE_ROLE, UserInterface::ROLE_EDITOR); 67 … $tree->setUserPreference($member, UserInterface::PREF_TREE_ROLE, UserInterface::ROLE_MEMBER); 70 … $tree->setUserPreference($visitor, UserInterface::PREF_TREE_ROLE, UserInterface::ROLE_VISITOR); [all …]
|
H A D | IndividualListTest.php | 39 private Tree $tree; variable in Fisharebest\\Webtrees\\IndividualListTest 50 $this->tree = $tree_service->create('name', 'title'); 56 Registry::individualFactory()->make('X1', $this->tree)->deleteRecord(); 63 $this->tree->createIndividual("0 @@ INDI\n1 NAME /Âaa/"); 64 $this->tree->createIndividual("0 @@ INDI\n1 NAME /aaa/"); 65 $this->tree->createIndividual("0 @@ INDI\n1 NAME /Ååå/"); 66 $this->tree->createIndividual("0 @@ INDI\n1 NAME /æææ/"); 67 $this->tree->createIndividual("0 @@ INDI\n1 NAME /Caa/"); 68 $this->tree->createIndividual("0 @@ INDI\n1 NAME /Css/"); 69 $this->tree->createIndividual("0 @@ INDI\n1 NAME /Dza/"); [all …]
|
H A D | RelationshipNamesTest.php | 74 $tree = $this->createMock(Tree::class); 82 … $i1m = new Individual('i1m', "0 @i1m@ INDI\n1 SEX M\n1 FAMS @f1m@\n1 FAMC @f4m@", null, $tree); 83 … Individual('i2f', "0 @i2f@ INDI\n1 SEX F\n1 FAMS @f1m@\n1 FAMS @f2d@\n2 FAMC @f5m@", null, $tree); 84 …dual('i3m', "0 @i3m@ INDI\n1 SEX M\n1 FAMC @f1m@\n1 FAMS @f3e@\n1 BIRT\n2 DATE 2000", null, $tree); 85 … = new Individual('i4f', "0 @i4f@ INDI\n1 SEX F\n1 FAMC @f1m@\n1 BIRT\n2 DATE 2001", null, $tree); 86 … = new Individual('i5u', "0 @i5u@ INDI\n1 SEX U\n1 FAMC @f1m@\n1 BIRT\n2 DATE 2002", null, $tree); 87 $i6m = new Individual('i6m', "0 @i6m@ INDI\n1 SEX M\n1 FAMS @f2d@", null, $tree); 88 …i7ma = new Individual('i7ma', "0 @i7ma@ INDI\n1 SEX M\n1 FAMC @f2d@\n2 PEDI adopted", null, $tree); 89 $i8f = new Individual('i8f', "0 @i8f@ INDI\n1 SEX F\n1 FAMC @f2d@", null, $tree); 90 … $i9u = new Individual('i9u', "0 @i9u@ INDI\n1 SEX U\n1 FAMC @f2d@\n1 FAMS @f6@", null, $tree); [all …]
|
/webtrees/resources/views/admin/ |
H A D | trees-preferences.phtml | 40 …> I18N::translate('Control panel'), route(ManageTrees::class, ['tree' => $tree->name()]) => I18N::… 44 <form method="post" action="<?= e(route(TreePreferencesAction::class, ['tree' => $tree->name()])) ?… 61 value="<?= e($tree->getPreference('title')) ?>" 78 …com" maxlength="255" name="gedcom" required="required" type="text" value="<?= e($tree->name()) ?>"> 98 …ividual', ['name' => 'PEDIGREE_ROOT_ID', 'individual' => $pedigree_individual, 'tree' => $tree]) ?> 143 … => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('GEN… 161 …<option value="<?= $member->id() ?>" <?= (int) $tree->getPreference('CONTACT_USER_ID') === $member… 181 …<option value="<?= $member->id() ?>" <?= (int) $tree->getPreference('WEBMASTER_USER_ID') === $memb… 206 value="<?= e($tree->getPreference('META_TITLE')) ?>" 226 value="<?= e($tree->getPreference('META_DESCRIPTION')) ?>" [all …]
|