1b6c326d8SGreg Roach<?php 2b6c326d8SGreg Roach 3b6c326d8SGreg Roachuse Fisharebest\Webtrees\Auth; 41fe542e9SGreg Roachuse Fisharebest\Webtrees\Contracts\UserInterface; 5*7c2c99faSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel; 64c3563c0SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\UserEditAction; 74c3563c0SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\UserListPage; 8510d3f2fSGreg Roachuse Fisharebest\Webtrees\I18N; 9*7c2c99faSGreg Roachuse Fisharebest\Webtrees\Registry; 10*7c2c99faSGreg Roachuse Fisharebest\Webtrees\Tree; 11b6c326d8SGreg Roachuse Fisharebest\Webtrees\View; 12*7c2c99faSGreg Roachuse Illuminate\Support\Collection; 13*7c2c99faSGreg Roach 14*7c2c99faSGreg Roach/** 15*7c2c99faSGreg Roach * @var array<string,string> $contact_methods 16*7c2c99faSGreg Roach * @var string $default_language 17*7c2c99faSGreg Roach * @var array<string,string> $languages 18*7c2c99faSGreg Roach * @var array<string,string> $roles 19*7c2c99faSGreg Roach * @var array<string,string> $theme_options 20*7c2c99faSGreg Roach * @var string $title 21*7c2c99faSGreg Roach * @var Collection<Tree> $trees 22*7c2c99faSGreg Roach * @var UserInterface $user 23*7c2c99faSGreg Roach */ 24b6c326d8SGreg Roach 25b6c326d8SGreg Roach?> 26dd6b2bfcSGreg Roach 274c3563c0SGreg Roach<?= view('components/breadcrumbs', ['links' => [ 284c3563c0SGreg Roach route(ControlPanel::class) => I18N::translate('Control panel'), 294c3563c0SGreg Roach route(UserListPage::class) => I18N::translate('User administration'), 304c3563c0SGreg Roach $title, 314c3563c0SGreg Roach]]) ?> 32dd6b2bfcSGreg Roach 33dd6b2bfcSGreg Roach<h1><?= $title ?></h1> 34dd6b2bfcSGreg Roach 354c3563c0SGreg Roach<form method="post" action="<?= e(route(UserEditAction::class)) ?>" class="form-horizontal" autocomplete="off"> 36dd6b2bfcSGreg Roach <?= csrf_field() ?> 37895230eeSGreg Roach <input type="hidden" name="user_id" value="<?= $user->id() ?>"> 38dd6b2bfcSGreg Roach 39dd6b2bfcSGreg Roach <!-- REAL NAME --> 40dd6b2bfcSGreg Roach <div class="row form-group"> 41dd6b2bfcSGreg Roach <label class="col-sm-3 col-form-label" for="real_name"> 42dd6b2bfcSGreg Roach <?= I18N::translate('Real name') ?> 43dd6b2bfcSGreg Roach </label> 44dd6b2bfcSGreg Roach <div class="col-sm-9"> 45e5a6b4d4SGreg Roach <input class="form-control" type="text" id="real_name" name="real_name" required maxlength="64" value="<?= e($user->realName()) ?>" dir="auto"> 46dd6b2bfcSGreg Roach <p class="small text-muted"> 47dd6b2bfcSGreg Roach <?= I18N::translate('This is your real name, as you would like it displayed on screen.') ?> 48dd6b2bfcSGreg Roach </p> 49dd6b2bfcSGreg Roach </div> 50dd6b2bfcSGreg Roach </div> 51dd6b2bfcSGreg Roach 52dd6b2bfcSGreg Roach <!-- USER NAME --> 53dd6b2bfcSGreg Roach <div class="row form-group"> 54dd6b2bfcSGreg Roach <label class="col-sm-3 col-form-label" for="username"> 55dd6b2bfcSGreg Roach <?= I18N::translate('Username') ?> 56dd6b2bfcSGreg Roach </label> 57dd6b2bfcSGreg Roach <div class="col-sm-9"> 58c65e00b4SGreg Roach <input class="form-control" type="text" id="username" name="username" required maxlength="32" value="<?= e($user->userName()) ?>" dir="auto"> 59dd6b2bfcSGreg Roach <p class="small text-muted"> 60dd6b2bfcSGreg Roach <?= I18N::translate('Usernames are case-insensitive and ignore accented letters, so that “chloe”, “chloë”, and “Chloe” are considered to be the same.') ?> 61dd6b2bfcSGreg Roach </p> 62dd6b2bfcSGreg Roach </div> 63dd6b2bfcSGreg Roach </div> 64dd6b2bfcSGreg Roach 65dd6b2bfcSGreg Roach <!-- PASSWORD --> 66dd6b2bfcSGreg Roach <div class="row form-group"> 67510d3f2fSGreg Roach <label class="col-sm-3 col-form-label" for="password"> 68dd6b2bfcSGreg Roach <?= I18N::translate('Password') ?> 69dd6b2bfcSGreg Roach </label> 70dd6b2bfcSGreg Roach <div class="col-sm-9"> 71510d3f2fSGreg Roach <input class="form-control" type="password" id="password" name="password" pattern = ".{8,}" placeholder="<?= I18N::plural('Use at least %s character.', 'Use at least %s characters.', 8, I18N::number(8)) ?>" <?= $user->id() ? '' : 'required' ?> autocomplete="new-password"> 72dd6b2bfcSGreg Roach <p class="small text-muted"> 7354bcf2f0SRico Sonntag <?= I18N::translate('Passwords must be at least 8 characters long and are case-sensitive, so that “secret” is different from “SECRET”.') ?> 74dd6b2bfcSGreg Roach </p> 75dd6b2bfcSGreg Roach </div> 76dd6b2bfcSGreg Roach </div> 77dd6b2bfcSGreg Roach 78dd6b2bfcSGreg Roach <!-- EMAIL ADDRESS --> 79dd6b2bfcSGreg Roach <div class="row form-group"> 80dd6b2bfcSGreg Roach <label class="col-sm-3 col-form-label" for="email"> 81dd6b2bfcSGreg Roach <?= I18N::translate('Email address') ?> 82dd6b2bfcSGreg Roach </label> 83dd6b2bfcSGreg Roach <div class="col-sm-9"> 84e5a6b4d4SGreg Roach <input class="form-control" type="email" id="email" name="email" required maxlength="64" value="<?= e($user->email()) ?>"> 85dd6b2bfcSGreg Roach <p class="small text-muted"> 86dd6b2bfcSGreg Roach <?= I18N::translate('This email address will be used to send password reminders, website notifications, and messages from other family members who are registered on the website.') ?> 87dd6b2bfcSGreg Roach </p> 88dd6b2bfcSGreg Roach </div> 89dd6b2bfcSGreg Roach </div> 90dd6b2bfcSGreg Roach 91dd6b2bfcSGreg Roach <!-- EMAIL VERIFIED --> 92dd6b2bfcSGreg Roach <!-- ACCOUNT APPROVED --> 93dd6b2bfcSGreg Roach <div class="row form-group"> 94dd6b2bfcSGreg Roach <label class="col-sm-3 col-form-label" for="verified"> 95dd6b2bfcSGreg Roach <?= I18N::translate('Account approval and email verification') ?> 96dd6b2bfcSGreg Roach </label> 97dd6b2bfcSGreg Roach <div class="col-sm-9"> 98dd6b2bfcSGreg Roach <div class="form-check"> 99dd6b2bfcSGreg Roach <label> 1001fe542e9SGreg Roach <input type="checkbox" name="verified" value="1" <?= $user->getPreference(UserInterface::PREF_IS_EMAIL_VERIFIED) === '1' ? 'checked' : '' ?>> 101dd6b2bfcSGreg Roach <?= I18N::translate('Email verified') ?> 102dd6b2bfcSGreg Roach </label> 103dd6b2bfcSGreg Roach <label> 1041fe542e9SGreg Roach <input type="checkbox" name="approved" value="1" <?= $user->getPreference(UserInterface::PREF_IS_ACCOUNT_APPROVED) === '1' ? 'checked' : '' ?>> 105dd6b2bfcSGreg Roach <?= I18N::translate('Approved by administrator') ?> 106dd6b2bfcSGreg Roach </label> 107dd6b2bfcSGreg Roach <p class="small text-muted"> 108dd6b2bfcSGreg Roach <?= I18N::translate('When a user registers for an account, an email is sent to their email address with a verification link. When they follow this link, we know the email address is correct, and the “email verified” option is selected automatically.') ?> 109dd6b2bfcSGreg Roach </p> 110dd6b2bfcSGreg Roach <p class="small text-muted"> 111dd6b2bfcSGreg Roach <?= I18N::translate('If an administrator creates a user account, the verification email is not sent, and the email must be verified manually.') ?> 112dd6b2bfcSGreg Roach </p> 113dd6b2bfcSGreg Roach <p class="small text-muted"> 114dd6b2bfcSGreg Roach <?= I18N::translate('You should not approve an account unless you know that the email address is correct.') ?> 115dd6b2bfcSGreg Roach </p> 116dd6b2bfcSGreg Roach <p class="small text-muted"> 117dd6b2bfcSGreg Roach <?= I18N::translate('A user will not be able to sign in until both “email verified” and “approved by administrator” are selected.') ?> 118dd6b2bfcSGreg Roach </p> 119dd6b2bfcSGreg Roach </div> 120dd6b2bfcSGreg Roach </div> 121dd6b2bfcSGreg Roach </div> 122dd6b2bfcSGreg Roach 123dd6b2bfcSGreg Roach <!-- LANGUAGE --> 124dd6b2bfcSGreg Roach <div class="row form-group"> 125dd6b2bfcSGreg Roach <label class="col-sm-3 col-form-label" for="language"> 126dd6b2bfcSGreg Roach <?= /* I18N: A configuration setting */ I18N::translate('Language') ?> 127dd6b2bfcSGreg Roach </label> 128dd6b2bfcSGreg Roach <div class="col-sm-9"> 1291fe542e9SGreg Roach <?= view('components/select', ['name' => 'language', 'selected' => $user->getPreference(UserInterface::PREF_LANGUAGE, $default_language), 'options' => $languages]) ?> 130dd6b2bfcSGreg Roach </div> 131dd6b2bfcSGreg Roach </div> 132dd6b2bfcSGreg Roach 133dd6b2bfcSGreg Roach <!-- TIMEZONE --> 134dd6b2bfcSGreg Roach <div class="row form-group"> 135dd6b2bfcSGreg Roach <label class="col-sm-3 col-form-label" for="timezone"> 136dd6b2bfcSGreg Roach <?= /* I18N: A configuration setting */ I18N::translate('Time zone') ?> 137dd6b2bfcSGreg Roach </label> 138dd6b2bfcSGreg Roach <div class="col-sm-9"> 1391fe542e9SGreg Roach <?= view('components/select', ['name' => 'timezone', 'selected' => $user->getPreference(UserInterface::PREF_TIME_ZONE, 'UTC'), 'options' => array_combine(DateTimeZone::listIdentifiers(), DateTimeZone::listIdentifiers())]) ?> 140dd6b2bfcSGreg Roach <p class="small text-muted"> 141dd6b2bfcSGreg Roach <?= I18N::translate('The time zone is required for date calculations, such as knowing today’s date.') ?> 142dd6b2bfcSGreg Roach </p> 143dd6b2bfcSGreg Roach </div> 144dd6b2bfcSGreg Roach </div> 145dd6b2bfcSGreg Roach 146dd6b2bfcSGreg Roach <!-- AUTO ACCEPT --> 147dd6b2bfcSGreg Roach <div class="row form-group"> 148dd6b2bfcSGreg Roach <label class="col-sm-3 col-form-label" for="auto_accept"> 149dd6b2bfcSGreg Roach <?= I18N::translate('Changes') ?> 150dd6b2bfcSGreg Roach </label> 151dd6b2bfcSGreg Roach <div class="col-sm-9"> 152dd6b2bfcSGreg Roach <div class="form-check"> 153dd6b2bfcSGreg Roach <label> 1541fe542e9SGreg Roach <input type="checkbox" name="auto_accept" value="1" <?= $user->getPreference(UserInterface::PREF_AUTO_ACCEPT_EDITS) === '1' ? 'checked' : '' ?>> 155dd6b2bfcSGreg Roach <?= I18N::translate('Automatically accept changes made by this user') ?> 156dd6b2bfcSGreg Roach </label> 157dd6b2bfcSGreg Roach <p class="small text-muted"> 158dd6b2bfcSGreg Roach <?= I18N::translate('Normally, any changes made to a family tree need to be reviewed by a moderator. This option allows a user to make changes without needing a moderator.') ?> 159dd6b2bfcSGreg Roach </p> 160dd6b2bfcSGreg Roach </div> 161dd6b2bfcSGreg Roach </div> 162dd6b2bfcSGreg Roach </div> 163dd6b2bfcSGreg Roach 164dd6b2bfcSGreg Roach <!-- VISIBLE ONLINE --> 165dd6b2bfcSGreg Roach <div class="row form-group"> 1667c4add84SGreg Roach <label class="col-sm-3 col-form-label" for="visible-online"> 167dd6b2bfcSGreg Roach <?= /* I18N: A configuration setting */ I18N::translate('Visible online') ?> 168dd6b2bfcSGreg Roach </label> 169dd6b2bfcSGreg Roach <div class="col-sm-9"> 170dd6b2bfcSGreg Roach <div class="form-check"> 171dd6b2bfcSGreg Roach <label> 1721fe542e9SGreg Roach <input type="checkbox" id="visible-online" name="visible-online" value="1" <?= $user->getPreference(UserInterface::PREF_IS_VISIBLE_ONLINE) === '1' ? 'checked' : '' ?>> 173dd6b2bfcSGreg Roach <?= /* I18N: A configuration setting */ I18N::translate('Visible to other users when online') ?> 174dd6b2bfcSGreg Roach </label> 175dd6b2bfcSGreg Roach <p class="small text-muted"> 176dd6b2bfcSGreg Roach <?= I18N::translate('You can choose whether to appear in the list of users who are currently signed-in.') ?> 177dd6b2bfcSGreg Roach </p> 178dd6b2bfcSGreg Roach </div> 179dd6b2bfcSGreg Roach </div> 180dd6b2bfcSGreg Roach </div> 181dd6b2bfcSGreg Roach 182dd6b2bfcSGreg Roach <!-- CONTACT METHOD --> 183dd6b2bfcSGreg Roach <div class="row form-group"> 1847c4add84SGreg Roach <label class="col-sm-3 col-form-label" for="contact-method"> 185dd6b2bfcSGreg Roach <?= /* I18N: A configuration setting */ I18N::translate('Preferred contact method') ?> 186dd6b2bfcSGreg Roach </label> 187dd6b2bfcSGreg Roach <div class="col-sm-9"> 1881fe542e9SGreg Roach <?= view('components/select', ['id' => 'contact-method', 'name' => 'contact-method', 'selected' => $user->getPreference(UserInterface::PREF_CONTACT_METHOD), 'options' => $contact_methods]) ?> 189dd6b2bfcSGreg Roach <p class="small text-muted"> 190dd6b2bfcSGreg Roach <?= /* I18N: Help text for the “Preferred contact method” configuration setting */ 191dd6b2bfcSGreg Roach I18N::translate('Site members can send each other messages. You can choose to how these messages are sent to you, or choose not receive them at all.') ?> 192dd6b2bfcSGreg Roach </p> 193dd6b2bfcSGreg Roach </div> 194dd6b2bfcSGreg Roach </div> 195dd6b2bfcSGreg Roach 196dd6b2bfcSGreg Roach <!-- THEME --> 197dd6b2bfcSGreg Roach <div class="row form-group"> 198dd6b2bfcSGreg Roach <label class="col-sm-3 col-form-label" for="theme"> 199dd6b2bfcSGreg Roach <?= I18N::translate('Theme') ?> 200dd6b2bfcSGreg Roach </label> 201dd6b2bfcSGreg Roach <div class="col-sm-9"> 2021fe542e9SGreg Roach <?= view('components/select', ['name' => 'theme', 'selected' => $user->getPreference(UserInterface::PREF_THEME), 'options' => $theme_options]) ?> 203dd6b2bfcSGreg Roach </div> 204dd6b2bfcSGreg Roach </div> 205dd6b2bfcSGreg Roach 206dd6b2bfcSGreg Roach <!-- COMMENTS --> 207dd6b2bfcSGreg Roach <div class="row form-group"> 208e4f0f6f0SGreg Roach <label class="col-sm-3 col-form-label" for="comment"> 209dd6b2bfcSGreg Roach <?= I18N::translate('Administrator comments on user') ?> 210dd6b2bfcSGreg Roach </label> 211dd6b2bfcSGreg Roach <div class="col-sm-9"> 2121fe542e9SGreg Roach <textarea class="form-control" id="comment" name="comment" rows="4" dir="auto" maxlength="255"><?= e($user->getPreference(UserInterface::PREF_NEW_ACCOUNT_COMMENT)) ?></textarea> 213dd6b2bfcSGreg Roach </div> 214dd6b2bfcSGreg Roach </div> 215dd6b2bfcSGreg Roach 216dd6b2bfcSGreg Roach <!-- ADMINISTRATOR --> 217dd6b2bfcSGreg Roach <div class="row form-group"> 218dd6b2bfcSGreg Roach <label class="col-sm-3 col-form-label" for="admin"> 219dd6b2bfcSGreg Roach </label> 220dd6b2bfcSGreg Roach <div class="col-sm-9"> 221dd6b2bfcSGreg Roach <div class="form-check"> 222dd6b2bfcSGreg Roach <label> 2231fe542e9SGreg Roach <input type="checkbox" id="admin" name="canadmin" value="1" <?= $user->getPreference(UserInterface::PREF_IS_ADMINISTRATOR) === '1' ? 'checked' : '' ?> <?= $user->id() === Auth::id() ? 'disabled' : '' ?>> 224dd6b2bfcSGreg Roach <?= I18N::translate('Administrator') ?> 225dd6b2bfcSGreg Roach </label> 226dd6b2bfcSGreg Roach </div> 227dd6b2bfcSGreg Roach </div> 228dd6b2bfcSGreg Roach </div> 229dd6b2bfcSGreg Roach 230dd6b2bfcSGreg Roach <h3><?= I18N::translate('Access to family trees') ?></h3> 231dd6b2bfcSGreg Roach 232dd6b2bfcSGreg Roach <p> 233dd6b2bfcSGreg Roach <?= I18N::translate('A role is a set of access rights, which give permission to view data, change preferences, etc. Access rights are assigned to roles, and roles are granted to users. Each family tree can assign different access to each role, and users can have a different role in each family tree.') ?> 234dd6b2bfcSGreg Roach </p> 235dd6b2bfcSGreg Roach 236dd6b2bfcSGreg Roach <div class="row"> 2375197b5a1SGreg Roach <div class="col-sm-4"> 238dd6b2bfcSGreg Roach <h4> 239dd6b2bfcSGreg Roach <?= I18N::translate('Visitor') ?> 240dd6b2bfcSGreg Roach </h4> 241dd6b2bfcSGreg Roach <p class="small text-muted"> 242dd6b2bfcSGreg Roach <?= I18N::translate('Everybody has this role, including visitors to the website and search engines.') ?> 243dd6b2bfcSGreg Roach </p> 244dd6b2bfcSGreg Roach <h4> 245dd6b2bfcSGreg Roach <?= I18N::translate('Member') ?> 246dd6b2bfcSGreg Roach </h4> 247dd6b2bfcSGreg Roach <p class="small text-muted"> 248dd6b2bfcSGreg Roach <?= I18N::translate('This role has all the permissions of the visitor role, plus any additional access granted by the family tree configuration.') ?> 249dd6b2bfcSGreg Roach </p> 250dd6b2bfcSGreg Roach </div> 2515197b5a1SGreg Roach <div class="col-sm-4"> 252dd6b2bfcSGreg Roach <h4> 253dd6b2bfcSGreg Roach <?= I18N::translate('Editor') ?> 254dd6b2bfcSGreg Roach </h4> 255dd6b2bfcSGreg Roach <p class="small text-muted"> 256dd6b2bfcSGreg Roach <?= I18N::translate('This role has all the permissions of the member role, plus permission to add/change/delete data. Any changes will need to be reviewed by a moderator, unless the user has the “automatically accept changes” option enabled.') ?> 257dd6b2bfcSGreg Roach </p> 258dd6b2bfcSGreg Roach <h4> 259dd6b2bfcSGreg Roach <?= I18N::translate('Moderator') ?> 260dd6b2bfcSGreg Roach </h4> 261dd6b2bfcSGreg Roach <p class="small text-muted"> 262dd6b2bfcSGreg Roach <?= I18N::translate('This role has all the permissions of the editor role, plus permission to accept/reject changes made by other users.') ?> 263dd6b2bfcSGreg Roach </p> 264dd6b2bfcSGreg Roach </div> 2655197b5a1SGreg Roach <div class="col-sm-4"> 266dd6b2bfcSGreg Roach <h4> 267dd6b2bfcSGreg Roach <?= I18N::translate('Manager') ?> 268dd6b2bfcSGreg Roach </h4> 269dd6b2bfcSGreg Roach <p class="small text-muted"> 270dd6b2bfcSGreg Roach <?= I18N::translate('This role has all the permissions of the moderator role, plus any additional access granted by the family tree configuration, plus permission to change the settings/configuration of a family tree.') ?> 271dd6b2bfcSGreg Roach </p> 272dd6b2bfcSGreg Roach <h4> 273dd6b2bfcSGreg Roach <?= I18N::translate('Administrator') ?> 274dd6b2bfcSGreg Roach </h4> 275dd6b2bfcSGreg Roach <p class="small text-muted"> 276dd6b2bfcSGreg Roach <?= I18N::translate('This role has all the permissions of the manager role in all family trees, plus permission to change the settings/configuration of the website, users, and modules.') ?> 277dd6b2bfcSGreg Roach </p> 278dd6b2bfcSGreg Roach </div> 279dd6b2bfcSGreg Roach </div> 280dd6b2bfcSGreg Roach 281dd6b2bfcSGreg Roach <table class="table table-bordered table-sm"> 282dd6b2bfcSGreg Roach <thead> 283dd6b2bfcSGreg Roach <tr> 284dd6b2bfcSGreg Roach <th> 285dd6b2bfcSGreg Roach <?= I18N::translate('Family tree') ?> 286dd6b2bfcSGreg Roach </th> 287dd6b2bfcSGreg Roach <th> 288dd6b2bfcSGreg Roach <?= I18N::translate('Role') ?> 289dd6b2bfcSGreg Roach </th> 290dd6b2bfcSGreg Roach <th> 291dd6b2bfcSGreg Roach <?= I18N::translate('Individual record') ?> 292dd6b2bfcSGreg Roach </th> 293dd6b2bfcSGreg Roach <th> 294dd6b2bfcSGreg Roach <?= I18N::translate('Restrict to immediate family') ?> 2950973b4d2SGreg Roach <?= view('help/link', ['topic' => 'relationship-privacy']) ?> 296dd6b2bfcSGreg Roach </th> 297dd6b2bfcSGreg Roach </tr> 298dd6b2bfcSGreg Roach <tr> 299dd6b2bfcSGreg Roach <td> 300dd6b2bfcSGreg Roach </td> 301dd6b2bfcSGreg Roach <td> 302dd6b2bfcSGreg Roach </td> 303dd6b2bfcSGreg Roach <td> 304dd6b2bfcSGreg Roach <p class="small text-muted"> 305dd6b2bfcSGreg Roach <?= I18N::translate('Link this user to an individual in the family tree.') ?> 306dd6b2bfcSGreg Roach </p> 307dd6b2bfcSGreg Roach </td> 308dd6b2bfcSGreg Roach <td> 309dd6b2bfcSGreg Roach </td> 310dd6b2bfcSGreg Roach </tr> 311dd6b2bfcSGreg Roach </thead> 312dd6b2bfcSGreg Roach <tbody> 313dd6b2bfcSGreg Roach <?php foreach ($trees as $tree) : ?> 314dd6b2bfcSGreg Roach <tr> 315dd6b2bfcSGreg Roach <td> 3165c7ad034SGreg Roach <?= e($tree->title()) ?> 317dd6b2bfcSGreg Roach </td> 318dd6b2bfcSGreg Roach <td> 31972cf66d4SGreg Roach <select class="form-control" name="canedit<?= $tree->id() ?>"> 320dd6b2bfcSGreg Roach <?php foreach ($roles as $role => $description) : ?> 321dd6b2bfcSGreg Roach <option value="<?= $role ?>" 3221fe542e9SGreg Roach <?= $role === $tree->getUserPreference($user, UserInterface::PREF_TREE_ROLE) ? 'selected' : '' ?>> 323dd6b2bfcSGreg Roach <?= $description ?> 324dd6b2bfcSGreg Roach </option> 325dd6b2bfcSGreg Roach <?php endforeach ?> 326dd6b2bfcSGreg Roach </select> 327dd6b2bfcSGreg Roach </td> 328dd6b2bfcSGreg Roach <td> 3296b9cb339SGreg Roach <?= view('components/select-individual', ['name' => 'gedcomid' . $tree->id(), 'individual' => Registry::individualFactory()->make($tree->getUserPreference($user, 'gedcomid'), $tree), 'tree' => $tree]) ?> 330dd6b2bfcSGreg Roach </td> 331dd6b2bfcSGreg Roach <td> 33272cf66d4SGreg Roach <select class="form-control" name="RELATIONSHIP_PATH_LENGTH<?= $tree->id() ?>" id="RELATIONSHIP_PATH_LENGTH<?= $tree->id() ?>" class="relpath"> 333dd6b2bfcSGreg Roach <?php for ($n = 0; $n <= 10; ++$n) : ?> 3341fe542e9SGreg Roach <option value="<?= $n ?>" <?= $tree->getUserPreference($user, UserInterface::PREF_TREE_PATH_LENGTH) == $n ? 'selected' : '' ?>> 335dd6b2bfcSGreg Roach <?= $n ?: I18N::translate('No') ?> 336dd6b2bfcSGreg Roach </option> 337dd6b2bfcSGreg Roach <?php endfor ?> 338dd6b2bfcSGreg Roach </select> 339dd6b2bfcSGreg Roach </td> 340dd6b2bfcSGreg Roach </tr> 341dd6b2bfcSGreg Roach <?php endforeach ?> 342dd6b2bfcSGreg Roach </tbody> 343dd6b2bfcSGreg Roach </table> 344dd6b2bfcSGreg Roach 345dd6b2bfcSGreg Roach <div class="row form-group"> 346dd6b2bfcSGreg Roach <div class="offset-sm-3 col-sm-9"> 347dd6b2bfcSGreg Roach <button type="submit" class="btn btn-primary"> 348dd6b2bfcSGreg Roach <?= I18N::translate('save') ?> 349dd6b2bfcSGreg Roach </button> 350dd6b2bfcSGreg Roach </div> 351dd6b2bfcSGreg Roach </div> 352dd6b2bfcSGreg Roach</form> 353dd6b2bfcSGreg Roach 354c16be598SGreg Roach<?= view('modals/ajax') ?> 355c16be598SGreg Roach 356dd6b2bfcSGreg Roach<?php View::push('javascript') ?> 357dd6b2bfcSGreg Roach<script> 358dd6b2bfcSGreg Roach $(".relpath").change(function () { 359dd6b2bfcSGreg Roach var fieldIDx = $(this).attr("id"); 360dd6b2bfcSGreg Roach var idNum = fieldIDx.replace("RELATIONSHIP_PATH_LENGTH", ""); 361dd6b2bfcSGreg Roach var newIDx = "gedcomid" + idNum; 362dd6b2bfcSGreg Roach if ($("#" + newIDx).val() === "" && $("#".fieldIDx).val() !== "0") { 363dd6b2bfcSGreg Roach alert("<?= I18N::translate('You must specify an individual record before you can restrict the user to their immediate family.') ?>"); 364dd6b2bfcSGreg Roach $(this).val("0"); 365dd6b2bfcSGreg Roach } 366dd6b2bfcSGreg Roach }); 367510d3f2fSGreg Roach 368510d3f2fSGreg Roach $("#password").hideShowPassword('infer', true); 369dd6b2bfcSGreg Roach</script> 370dd6b2bfcSGreg Roach<?php View::endpush() ?> 371510d3f2fSGreg Roach 372