aboutsummaryrefslogtreecommitdiff
path: root/app/views/resources/location/_add_edit_form.php
blob: dc91bd669c02012b7af49963a2fd57d132cc934e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/**
 * @var Resources_LocationController $controller
 * @var bool $show_form
 * @var string $mode
 * @var string $name
 * @var string $category_id
 * @var string $longitude
 * @var string $latitude
 * @var string $altitude
 * @var string $description
 * @var string $parent_id
 * @var string $number
 * @var string $address
 * @var int $sort_position
 * @var Building $location
 * @var array $grouped_defined_properties
 * @var array $property_data
 */
?>
<? if ($show_form): ?>
    <form class="default" method="post" action="<?= $mode === 'add'
        ? $controller->add(['category_id' => $category_id])
        : $controller->edit($location->id) ?>"
          data-dialog="reload-on-close">

        <?= CSRFProtection::tokenTag() ?>
        <fieldset>
            <legend><?= _('Grunddaten') ?></legend>
            <label>
                <?= _('Name des Standortes') ?>
                <input type="text" name="name" value="<?= htmlReady($name ?? '') ?>">
            </label>
            <label>
                <?= _('Beschreibungstext') ?>
                <input type="text" name="description" value="<?= htmlReady($description ?? '') ?>">
            </label>
            <? if ($GLOBALS['perm']->have_perm('root')): ?>
                <label>
                    <?= _('Sortierposition') ?>
                    <input type="text" name="sort_position"
                           value="<?= htmlReady($sort_position ?? '') ?>">
                </label>
            <? endif ?>
            <?= $this->render_partial(
                '../../templates/resources/position_attribute_form_part.php',
                [
                    'property_name' => 'geo_coordinates',
                    'latitude'      => $latitude ?? '',
                    'longitude'     => $longitude ?? '',
                    'altitude'      => $altitude ?? ''
                ]
            ) ?>
        </fieldset>
        <? if (!empty($defined_properties)) : ?>
            <?= $this->render_partial(
                'resources/resource/_standard_properties_form_part.php',
                [
                    'defined_properties' => $defined_properties,
                    'property_data'      => $property_data ?? []
                ]
            ) ?>
        <? endif ?>
        <div data-dialog-button>
            <?= \Studip\Button::create(_('Speichern'), 'save') ?>
        </div>
    </form>
<? endif ?>