$sources * @var Tree $tree */ ?> join('link', static function (JoinClause $join): void { $join->on('l_from', '=', 'i_id'); $join->on('l_file', '=', 'i_file'); }) ->where('l_type', '=', 'SOUR') ->where('l_file', '=', $tree->id()) ->groupBy(['l_to']) ->select(['l_to', new Expression('COUNT(*) AS total')]) ->pluck('total', 'l_to') ->all(); $count_families = DB::table('families') ->join('link', static function (JoinClause $join): void { $join->on('l_from', '=', 'f_id'); $join->on('l_file', '=', 'f_file'); }) ->where('l_type', '=', 'SOUR') ->where('l_file', '=', $tree->id()) ->groupBy(['l_to']) ->select(['l_to', new Expression('COUNT(*) AS total')]) ->pluck('total', 'l_to') ->all(); $count_media = DB::table('media') ->join('link', static function (JoinClause $join): void { $join->on('l_from', '=', 'm_id'); $join->on('l_file', '=', 'm_file'); }) ->where('l_type', '=', 'SOUR') ->where('l_file', '=', $tree->id()) ->groupBy(['l_to']) ->select(['l_to', new Expression('COUNT(*) AS total')]) ->pluck('total', 'l_to') ->all(); $count_notes = DB::table('other') ->join('link', static function (JoinClause $join): void { $join->on('l_from', '=', 'o_id'); $join->on('l_file', '=', 'o_file'); }) ->where('o_type', '=', 'NOTE') ->where('l_type', '=', 'SOUR') ->where('l_file', '=', $tree->id()) ->groupBy(['l_to']) ->select(['l_to', new Expression('COUNT(*) AS total')]) ->pluck('total', 'l_to') ->all(); ?>
= I18N::translate('Title') ?> | = I18N::translate('Abbreviation') ?> | = I18N::translate('Author') ?> | = I18N::translate('Publication') ?> | = I18N::translate('Individuals') ?> | = I18N::translate('Families') ?> | = I18N::translate('Media objects') ?> | = I18N::translate('Shared notes') ?> | = I18N::translate('Last change') ?> |
---|---|---|---|---|---|---|---|---|
= $source->fullName() ?> | = e($source->facts(['ABBR'])->isNotEmpty() ? $source->facts(['ABBR'])->first()->value() : '') ?> | = e($source->facts(['AUTH'])->isNotEmpty() ? $source->facts(['AUTH'])->first()->value() : '') ?> | = Registry::elementFactory()->make('SOUR:PUBL')->value($source->facts(['PUBL'])->isNotEmpty() ? $source->facts(['PUBL'])->first()->value() : '', $tree) ?> | = I18N::number($count_individuals[$source->xref()] ?? 0) ?> | = I18N::number($count_families[$source->xref()] ?? 0) ?> | = I18N::number($count_media[$source->xref()] ?? 0) ?> | = I18N::number($count_notes[$source->xref()] ?? 0) ?> | = view('components/datetime', ['timestamp' => $source->lastChangeTimestamp()]) ?> |