xref: /webtrees/resources/views/admin/users-edit.phtml (revision b6c326d8b8798b83b744c4d4a669df5aa9f3e0c2)
1*b6c326d8SGreg Roach<?php
2*b6c326d8SGreg Roach
3*b6c326d8SGreg Roachuse Fisharebest\Webtrees\Auth;
4510d3f2fSGreg Roachuse Fisharebest\Webtrees\Functions\FunctionsPrint;
5510d3f2fSGreg Roachuse Fisharebest\Webtrees\I18N;
6510d3f2fSGreg Roachuse Fisharebest\Webtrees\Individual;
7*b6c326d8SGreg Roachuse Fisharebest\Webtrees\View;
8*b6c326d8SGreg Roach
9*b6c326d8SGreg Roach?>
10dd6b2bfcSGreg Roach
11dd6b2bfcSGreg Roach<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-users') => I18N::translate('User administration'), $title]]) ?>
12dd6b2bfcSGreg Roach
13dd6b2bfcSGreg Roach<h1><?= $title ?></h1>
14dd6b2bfcSGreg Roach
15dd6b2bfcSGreg Roach<form class="form-horizontal" name="newform" method="post" autocomplete="off" action="<?= e(route('admin-users-edit')) ?>">
16dd6b2bfcSGreg Roach    <?= csrf_field() ?>
17895230eeSGreg Roach    <input type="hidden" name="user_id" value="<?= $user->id() ?>">
18dd6b2bfcSGreg Roach
19dd6b2bfcSGreg Roach    <!-- REAL NAME -->
20dd6b2bfcSGreg Roach    <div class="row form-group">
21dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="real_name">
22dd6b2bfcSGreg Roach            <?= I18N::translate('Real name') ?>
23dd6b2bfcSGreg Roach        </label>
24dd6b2bfcSGreg Roach        <div class="col-sm-9">
25e5a6b4d4SGreg Roach            <input class="form-control" type="text" id="real_name" name="real_name" required maxlength="64" value="<?= e($user->realName()) ?>" dir="auto">
26dd6b2bfcSGreg Roach            <p class="small text-muted">
27dd6b2bfcSGreg Roach                <?= I18N::translate('This is your real name, as you would like it displayed on screen.') ?>
28dd6b2bfcSGreg Roach            </p>
29dd6b2bfcSGreg Roach        </div>
30dd6b2bfcSGreg Roach    </div>
31dd6b2bfcSGreg Roach
32dd6b2bfcSGreg Roach    <!-- USER NAME -->
33dd6b2bfcSGreg Roach    <div class="row form-group">
34dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="username">
35dd6b2bfcSGreg Roach            <?= I18N::translate('Username') ?>
36dd6b2bfcSGreg Roach        </label>
37dd6b2bfcSGreg Roach        <div class="col-sm-9">
38c65e00b4SGreg Roach            <input class="form-control" type="text" id="username" name="username" required maxlength="32" value="<?= e($user->userName()) ?>" dir="auto">
39dd6b2bfcSGreg Roach            <p class="small text-muted">
40dd6b2bfcSGreg Roach                <?= I18N::translate('Usernames are case-insensitive and ignore accented letters, so that “chloe”, “chloë”, and “Chloe” are considered to be the same.') ?>
41dd6b2bfcSGreg Roach            </p>
42dd6b2bfcSGreg Roach        </div>
43dd6b2bfcSGreg Roach    </div>
44dd6b2bfcSGreg Roach
45dd6b2bfcSGreg Roach    <!-- PASSWORD -->
46dd6b2bfcSGreg Roach    <div class="row form-group">
47510d3f2fSGreg Roach        <label class="col-sm-3 col-form-label" for="password">
48dd6b2bfcSGreg Roach            <?= I18N::translate('Password') ?>
49dd6b2bfcSGreg Roach        </label>
50dd6b2bfcSGreg Roach        <div class="col-sm-9">
51510d3f2fSGreg 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">
52dd6b2bfcSGreg Roach            <p class="small text-muted">
53dd6b2bfcSGreg Roach                <?= I18N::translate('Passwords must be at least 6 characters long and are case-sensitive, so that “secret” is different from “SECRET”.') ?>
54dd6b2bfcSGreg Roach            </p>
55dd6b2bfcSGreg Roach        </div>
56dd6b2bfcSGreg Roach    </div>
57dd6b2bfcSGreg Roach
58dd6b2bfcSGreg Roach    <!-- EMAIL ADDRESS -->
59dd6b2bfcSGreg Roach    <div class="row form-group">
60dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="email">
61dd6b2bfcSGreg Roach            <?= I18N::translate('Email address') ?>
62dd6b2bfcSGreg Roach        </label>
63dd6b2bfcSGreg Roach        <div class="col-sm-9">
64e5a6b4d4SGreg Roach            <input class="form-control" type="email" id="email" name="email" required maxlength="64" value="<?= e($user->email()) ?>">
65dd6b2bfcSGreg Roach            <p class="small text-muted">
66dd6b2bfcSGreg 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.') ?>
67dd6b2bfcSGreg Roach            </p>
68dd6b2bfcSGreg Roach        </div>
69dd6b2bfcSGreg Roach    </div>
70dd6b2bfcSGreg Roach
71dd6b2bfcSGreg Roach    <!-- EMAIL VERIFIED -->
72dd6b2bfcSGreg Roach    <!-- ACCOUNT APPROVED -->
73dd6b2bfcSGreg Roach    <div class="row form-group">
74dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="verified">
75dd6b2bfcSGreg Roach            <?= I18N::translate('Account approval and email verification') ?>
76dd6b2bfcSGreg Roach        </label>
77dd6b2bfcSGreg Roach        <div class="col-sm-9">
78dd6b2bfcSGreg Roach            <div class="form-check">
79dd6b2bfcSGreg Roach                <label>
80dd6b2bfcSGreg Roach                    <input type="checkbox" name="verified" value="1" <?= $user->getPreference('verified') ? 'checked' : '' ?>>
81dd6b2bfcSGreg Roach                    <?= I18N::translate('Email verified') ?>
82dd6b2bfcSGreg Roach                </label>
83dd6b2bfcSGreg Roach                <label>
84dd6b2bfcSGreg Roach                    <input type="checkbox" name="approved" value="1" <?= $user->getPreference('verified_by_admin') ? 'checked' : '' ?>>
85dd6b2bfcSGreg Roach                    <?= I18N::translate('Approved by administrator') ?>
86dd6b2bfcSGreg Roach                </label>
87dd6b2bfcSGreg Roach                <p class="small text-muted">
88dd6b2bfcSGreg 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.') ?>
89dd6b2bfcSGreg Roach                </p>
90dd6b2bfcSGreg Roach                <p class="small text-muted">
91dd6b2bfcSGreg Roach                    <?= I18N::translate('If an administrator creates a user account, the verification email is not sent, and the email must be verified manually.') ?>
92dd6b2bfcSGreg Roach                </p>
93dd6b2bfcSGreg Roach                <p class="small text-muted">
94dd6b2bfcSGreg Roach                    <?= I18N::translate('You should not approve an account unless you know that the email address is correct.') ?>
95dd6b2bfcSGreg Roach                </p>
96dd6b2bfcSGreg Roach                <p class="small text-muted">
97dd6b2bfcSGreg Roach                    <?= I18N::translate('A user will not be able to sign in until both “email verified” and “approved by administrator” are selected.') ?>
98dd6b2bfcSGreg Roach                </p>
99dd6b2bfcSGreg Roach            </div>
100dd6b2bfcSGreg Roach        </div>
101dd6b2bfcSGreg Roach    </div>
102dd6b2bfcSGreg Roach
103dd6b2bfcSGreg Roach    <!-- LANGUAGE -->
104dd6b2bfcSGreg Roach    <div class="row form-group">
105dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="language">
106dd6b2bfcSGreg Roach            <?= /* I18N: A configuration setting */ I18N::translate('Language') ?>
107dd6b2bfcSGreg Roach        </label>
108dd6b2bfcSGreg Roach        <div class="col-sm-9">
109dd6b2bfcSGreg Roach            <select id="language" name="language" class="form-control">
110dd6b2bfcSGreg Roach                <?php foreach ($locales as $locale) : ?>
111dd6b2bfcSGreg Roach                    <option value="<?= $locale->languageTag() ?>" <?= $user->getPreference('language', $default_locale) === $locale->languageTag() ? 'selected' : '' ?>>
112dd6b2bfcSGreg Roach                        <?= $locale->endonym() ?>
113dd6b2bfcSGreg Roach                    </option>
114dd6b2bfcSGreg Roach                <?php endforeach ?>
115dd6b2bfcSGreg Roach            </select>
116dd6b2bfcSGreg Roach        </div>
117dd6b2bfcSGreg Roach    </div>
118dd6b2bfcSGreg Roach
119dd6b2bfcSGreg Roach    <!-- TIMEZONE -->
120dd6b2bfcSGreg Roach    <div class="row form-group">
121dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="timezone">
122dd6b2bfcSGreg Roach            <?= /* I18N: A configuration setting */ I18N::translate('Time zone') ?>
123dd6b2bfcSGreg Roach        </label>
124dd6b2bfcSGreg Roach        <div class="col-sm-9">
125*b6c326d8SGreg Roach            <?= view('components/select', ['name' => 'timezone', 'selected' => $user->getPreference('TIMEZONE', 'UTC'), 'values' => array_combine(\DateTimeZone::listIdentifiers(), \DateTimeZone::listIdentifiers())]) ?>
126dd6b2bfcSGreg Roach            <p class="small text-muted">
127dd6b2bfcSGreg Roach                <?= I18N::translate('The time zone is required for date calculations, such as knowing today’s date.') ?>
128dd6b2bfcSGreg Roach            </p>
129dd6b2bfcSGreg Roach        </div>
130dd6b2bfcSGreg Roach    </div>
131dd6b2bfcSGreg Roach
132dd6b2bfcSGreg Roach    <!-- AUTO ACCEPT -->
133dd6b2bfcSGreg Roach    <div class="row form-group">
134dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="auto_accept">
135dd6b2bfcSGreg Roach            <?= I18N::translate('Changes') ?>
136dd6b2bfcSGreg Roach        </label>
137dd6b2bfcSGreg Roach        <div class="col-sm-9">
138dd6b2bfcSGreg Roach            <div class="form-check">
139dd6b2bfcSGreg Roach                <label>
140dd6b2bfcSGreg Roach                    <input type="checkbox" name="auto_accept" value="1" <?= $user->getPreference('auto_accept') ? 'checked' : '' ?>>
141dd6b2bfcSGreg Roach                    <?= I18N::translate('Automatically accept changes made by this user') ?>
142dd6b2bfcSGreg Roach                </label>
143dd6b2bfcSGreg Roach                <p class="small text-muted">
144dd6b2bfcSGreg 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.') ?>
145dd6b2bfcSGreg Roach                </p>
146dd6b2bfcSGreg Roach            </div>
147dd6b2bfcSGreg Roach        </div>
148dd6b2bfcSGreg Roach    </div>
149dd6b2bfcSGreg Roach
150dd6b2bfcSGreg Roach    <!-- VISIBLE ONLINE -->
151dd6b2bfcSGreg Roach    <div class="row form-group">
152dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="visible_online">
153dd6b2bfcSGreg Roach            <?= /* I18N: A configuration setting */ I18N::translate('Visible online') ?>
154dd6b2bfcSGreg Roach        </label>
155dd6b2bfcSGreg Roach        <div class="col-sm-9">
156dd6b2bfcSGreg Roach            <div class="form-check">
157dd6b2bfcSGreg Roach                <label>
158dd6b2bfcSGreg Roach                    <input type="checkbox" id="visible_online" name="visible_online" value="1" <?= $user->getPreference('visibleonline') ? 'checked' : '' ?>>
159dd6b2bfcSGreg Roach                    <?= /* I18N: A configuration setting */ I18N::translate('Visible to other users when online') ?>
160dd6b2bfcSGreg Roach                </label>
161dd6b2bfcSGreg Roach                <p class="small text-muted">
162dd6b2bfcSGreg Roach                    <?= I18N::translate('You can choose whether to appear in the list of users who are currently signed-in.') ?>
163dd6b2bfcSGreg Roach                </p>
164dd6b2bfcSGreg Roach            </div>
165dd6b2bfcSGreg Roach        </div>
166dd6b2bfcSGreg Roach    </div>
167dd6b2bfcSGreg Roach
168dd6b2bfcSGreg Roach    <!-- CONTACT METHOD -->
169dd6b2bfcSGreg Roach    <div class="row form-group">
170dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="contactmethod">
171dd6b2bfcSGreg Roach            <?= /* I18N: A configuration setting */ I18N::translate('Preferred contact method') ?>
172dd6b2bfcSGreg Roach        </label>
173dd6b2bfcSGreg Roach        <div class="col-sm-9">
174*b6c326d8SGreg Roach            <?= view('components/select', ['name' => 'contact_method', 'selected' => $user->getPreference('contactmethod'), 'values' => $contact_methods]) ?>
175dd6b2bfcSGreg Roach            <p class="small text-muted">
176dd6b2bfcSGreg Roach                <?= /* I18N: Help text for the “Preferred contact method” configuration setting */
177dd6b2bfcSGreg 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.') ?>
178dd6b2bfcSGreg Roach            </p>
179dd6b2bfcSGreg Roach        </div>
180dd6b2bfcSGreg Roach    </div>
181dd6b2bfcSGreg Roach
182dd6b2bfcSGreg Roach    <!-- THEME -->
183dd6b2bfcSGreg Roach    <div class="row form-group">
184dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="theme">
185dd6b2bfcSGreg Roach            <?= I18N::translate('Theme') ?>
186dd6b2bfcSGreg Roach        </label>
187dd6b2bfcSGreg Roach        <div class="col-sm-9">
188*b6c326d8SGreg Roach            <?= view('components/select', ['name' => 'theme', 'selected' => $user->getPreference('theme'), 'values' => $theme_options]) ?>
189dd6b2bfcSGreg Roach        </div>
190dd6b2bfcSGreg Roach    </div>
191dd6b2bfcSGreg Roach
192dd6b2bfcSGreg Roach    <!-- COMMENTS -->
193dd6b2bfcSGreg Roach    <div class="row form-group">
194dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="comment">
195dd6b2bfcSGreg Roach            <?= I18N::translate('Administrator comments on user') ?>
196dd6b2bfcSGreg Roach        </label>
197dd6b2bfcSGreg Roach        <div class="col-sm-9">
198dd6b2bfcSGreg Roach            <textarea class="form-control" id="comment" name="comment" rows="5" maxlength="255"><?= e($user->getPreference('comment')) ?></textarea>
199dd6b2bfcSGreg Roach        </div>
200dd6b2bfcSGreg Roach    </div>
201dd6b2bfcSGreg Roach
202dd6b2bfcSGreg Roach    <!-- ADMINISTRATOR -->
203dd6b2bfcSGreg Roach    <div class="row form-group">
204dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="admin">
205dd6b2bfcSGreg Roach        </label>
206dd6b2bfcSGreg Roach        <div class="col-sm-9">
207dd6b2bfcSGreg Roach            <div class="form-check">
208dd6b2bfcSGreg Roach                <label>
209895230eeSGreg Roach                    <input type="checkbox" id="admin" name="canadmin" value="1" <?= $user->getPreference('canadmin') ? 'checked' : '' ?>  <?= $user->id() === Auth::id() ? 'disabled' : '' ?>>
210dd6b2bfcSGreg Roach                    <?= I18N::translate('Administrator') ?>
211dd6b2bfcSGreg Roach                </label>
212dd6b2bfcSGreg Roach            </div>
213dd6b2bfcSGreg Roach        </div>
214dd6b2bfcSGreg Roach    </div>
215dd6b2bfcSGreg Roach
216dd6b2bfcSGreg Roach    <h3><?= I18N::translate('Access to family trees') ?></h3>
217dd6b2bfcSGreg Roach
218dd6b2bfcSGreg Roach    <p>
219dd6b2bfcSGreg 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.') ?>
220dd6b2bfcSGreg Roach    </p>
221dd6b2bfcSGreg Roach
222dd6b2bfcSGreg Roach    <div class="row">
223dd6b2bfcSGreg Roach        <div class="col-xs-4">
224dd6b2bfcSGreg Roach            <h4>
225dd6b2bfcSGreg Roach                <?= I18N::translate('Visitor') ?>
226dd6b2bfcSGreg Roach            </h4>
227dd6b2bfcSGreg Roach            <p class="small text-muted">
228dd6b2bfcSGreg Roach                <?= I18N::translate('Everybody has this role, including visitors to the website and search engines.') ?>
229dd6b2bfcSGreg Roach            </p>
230dd6b2bfcSGreg Roach            <h4>
231dd6b2bfcSGreg Roach                <?= I18N::translate('Member') ?>
232dd6b2bfcSGreg Roach            </h4>
233dd6b2bfcSGreg Roach            <p class="small text-muted">
234dd6b2bfcSGreg Roach                <?= I18N::translate('This role has all the permissions of the visitor role, plus any additional access granted by the family tree configuration.') ?>
235dd6b2bfcSGreg Roach            </p>
236dd6b2bfcSGreg Roach        </div>
237dd6b2bfcSGreg Roach        <div class="col-xs-4">
238dd6b2bfcSGreg Roach            <h4>
239dd6b2bfcSGreg Roach                <?= I18N::translate('Editor') ?>
240dd6b2bfcSGreg Roach            </h4>
241dd6b2bfcSGreg Roach            <p class="small text-muted">
242dd6b2bfcSGreg 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.') ?>
243dd6b2bfcSGreg Roach            </p>
244dd6b2bfcSGreg Roach            <h4>
245dd6b2bfcSGreg Roach                <?= I18N::translate('Moderator') ?>
246dd6b2bfcSGreg Roach            </h4>
247dd6b2bfcSGreg Roach            <p class="small text-muted">
248dd6b2bfcSGreg Roach                <?= I18N::translate('This role has all the permissions of the editor role, plus permission to accept/reject changes made by other users.') ?>
249dd6b2bfcSGreg Roach            </p>
250dd6b2bfcSGreg Roach        </div>
251dd6b2bfcSGreg Roach        <div class="col-xs-4">
252dd6b2bfcSGreg Roach            <h4>
253dd6b2bfcSGreg Roach                <?= I18N::translate('Manager') ?>
254dd6b2bfcSGreg Roach            </h4>
255dd6b2bfcSGreg Roach            <p class="small text-muted">
256dd6b2bfcSGreg 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.') ?>
257dd6b2bfcSGreg Roach            </p>
258dd6b2bfcSGreg Roach            <h4>
259dd6b2bfcSGreg Roach                <?= I18N::translate('Administrator') ?>
260dd6b2bfcSGreg Roach            </h4>
261dd6b2bfcSGreg Roach            <p class="small text-muted">
262dd6b2bfcSGreg 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.') ?>
263dd6b2bfcSGreg Roach            </p>
264dd6b2bfcSGreg Roach        </div>
265dd6b2bfcSGreg Roach    </div>
266dd6b2bfcSGreg Roach
267dd6b2bfcSGreg Roach    <table class="table table-bordered table-sm">
268dd6b2bfcSGreg Roach        <thead>
269dd6b2bfcSGreg Roach            <tr>
270dd6b2bfcSGreg Roach                <th>
271dd6b2bfcSGreg Roach                    <?= I18N::translate('Family tree') ?>
272dd6b2bfcSGreg Roach                </th>
273dd6b2bfcSGreg Roach                <th>
274dd6b2bfcSGreg Roach                    <?= I18N::translate('Role') ?>
275dd6b2bfcSGreg Roach                </th>
276dd6b2bfcSGreg Roach                <th>
277dd6b2bfcSGreg Roach                    <?= I18N::translate('Individual record') ?>
278dd6b2bfcSGreg Roach                </th>
279dd6b2bfcSGreg Roach                <th>
280dd6b2bfcSGreg Roach                    <?= I18N::translate('Restrict to immediate family') ?>
281c16be598SGreg Roach                    <?= FunctionsPrint::helpLink('relationship-privacy') ?>
282dd6b2bfcSGreg Roach                </th>
283dd6b2bfcSGreg Roach            </tr>
284dd6b2bfcSGreg Roach            <tr>
285dd6b2bfcSGreg Roach                <td>
286dd6b2bfcSGreg Roach                </td>
287dd6b2bfcSGreg Roach                <td>
288dd6b2bfcSGreg Roach                </td>
289dd6b2bfcSGreg Roach                <td>
290dd6b2bfcSGreg Roach                    <p class="small text-muted">
291dd6b2bfcSGreg Roach                        <?= I18N::translate('Link this user to an individual in the family tree.') ?>
292dd6b2bfcSGreg Roach                    </p>
293dd6b2bfcSGreg Roach                </td>
294dd6b2bfcSGreg Roach                <td>
295dd6b2bfcSGreg Roach                </td>
296dd6b2bfcSGreg Roach            </tr>
297dd6b2bfcSGreg Roach        </thead>
298dd6b2bfcSGreg Roach        <tbody>
299dd6b2bfcSGreg Roach            <?php foreach ($trees as $tree) : ?>
300dd6b2bfcSGreg Roach                <tr>
301dd6b2bfcSGreg Roach                    <td>
3025c7ad034SGreg Roach                        <?= e($tree->title()) ?>
303dd6b2bfcSGreg Roach                    </td>
304dd6b2bfcSGreg Roach                    <td>
30572cf66d4SGreg Roach                        <select class="form-control" name="canedit<?= $tree->id() ?>">
306dd6b2bfcSGreg Roach                            <?php foreach ($roles as $role => $description) : ?>
307dd6b2bfcSGreg Roach                                <option value="<?= $role ?>"
308dd6b2bfcSGreg Roach                                    <?= $role === $tree->getUserPreference($user, 'canedit') ? 'selected' : '' ?>>
309dd6b2bfcSGreg Roach                                    <?= $description ?>
310dd6b2bfcSGreg Roach                                </option>
311dd6b2bfcSGreg Roach                            <?php endforeach ?>
312dd6b2bfcSGreg Roach                        </select>
313dd6b2bfcSGreg Roach                    </td>
314dd6b2bfcSGreg Roach                    <td>
315*b6c326d8SGreg Roach                        <?= view('components/select-individual', ['name' => 'gedcomid' . $tree->id(), 'individual' => Individual::getInstance($tree->getUserPreference($user, 'gedcomid'), $tree), 'tree' => $tree]) ?>
316dd6b2bfcSGreg Roach                    </td>
317dd6b2bfcSGreg Roach                    <td>
31872cf66d4SGreg Roach                        <select class="form-control" name="RELATIONSHIP_PATH_LENGTH<?= $tree->id() ?>" id="RELATIONSHIP_PATH_LENGTH<?= $tree->id() ?>" class="relpath">
319dd6b2bfcSGreg Roach                            <?php for ($n = 0; $n <= 10; ++$n) : ?>
320dd6b2bfcSGreg Roach                                <option value="<?= $n ?>" <?= $tree->getUserPreference($user, 'RELATIONSHIP_PATH_LENGTH') == $n ? 'selected' : '' ?>>
321dd6b2bfcSGreg Roach                                    <?= $n ?: I18N::translate('No') ?>
322dd6b2bfcSGreg Roach                                </option>
323dd6b2bfcSGreg Roach                            <?php endfor ?>
324dd6b2bfcSGreg Roach                        </select>
325dd6b2bfcSGreg Roach                    </td>
326dd6b2bfcSGreg Roach                </tr>
327dd6b2bfcSGreg Roach            <?php endforeach ?>
328dd6b2bfcSGreg Roach        </tbody>
329dd6b2bfcSGreg Roach    </table>
330dd6b2bfcSGreg Roach
331dd6b2bfcSGreg Roach    <div class="row form-group">
332dd6b2bfcSGreg Roach        <div class="offset-sm-3 col-sm-9">
333dd6b2bfcSGreg Roach            <button type="submit" class="btn btn-primary">
334dd6b2bfcSGreg Roach                <?= I18N::translate('save') ?>
335dd6b2bfcSGreg Roach            </button>
336dd6b2bfcSGreg Roach        </div>
337dd6b2bfcSGreg Roach    </div>
338dd6b2bfcSGreg Roach</form>
339dd6b2bfcSGreg Roach
340c16be598SGreg Roach<?= view('modals/ajax') ?>
341c16be598SGreg Roach
342dd6b2bfcSGreg Roach<?php View::push('javascript') ?>
343dd6b2bfcSGreg Roach<script>
344dd6b2bfcSGreg Roach    $(".relpath").change(function () {
345dd6b2bfcSGreg Roach        var fieldIDx = $(this).attr("id");
346dd6b2bfcSGreg Roach        var idNum    = fieldIDx.replace("RELATIONSHIP_PATH_LENGTH", "");
347dd6b2bfcSGreg Roach        var newIDx   = "gedcomid" + idNum;
348dd6b2bfcSGreg Roach        if ($("#" + newIDx).val() === "" && $("#".fieldIDx).val() !== "0") {
349dd6b2bfcSGreg Roach            alert("<?= I18N::translate('You must specify an individual record before you can restrict the user to their immediate family.') ?>");
350dd6b2bfcSGreg Roach            $(this).val("0");
351dd6b2bfcSGreg Roach        }
352dd6b2bfcSGreg Roach    });
353510d3f2fSGreg Roach
354510d3f2fSGreg Roach    $("#password").hideShowPassword('infer', true);
355dd6b2bfcSGreg Roach</script>
356dd6b2bfcSGreg Roach<?php View::endpush() ?>
357510d3f2fSGreg Roach
358