OpenNIT

Quelltext des aktuellen Standes

Fassung 1.1.1

_company_quick_create.php

3 KB
<?php
/**
 * Anlege-Fenster der Firmensuche (siehe company-search.js).
 *
 * Einmal je Seite einbinden, die ein Feld mit `data-cs-create="1"` führt – alle
 * Felder der Seite nutzen dasselbe Fenster. Gespeichert wird über denselben
 * Weg wie im Adressbuch, das Recht `manage_contacts` prüft der Server erneut.
 *
 * Einbinden:
 *   <?= $view->render('partials/_company_quick_create') ?>
 */
?>
<div id="csxCreateModal" class="modal-overlay" role="dialog" aria-modal="true"
     aria-labelledby="csxCreateTitle" style="display:none;">
    <div class="modal-card">
        <div class="modal-header">
            <h2 id="csxCreateTitle"><?= $this->te('Firma im Adressbuch anlegen') ?></h2>
            <button type="button" class="modal-close" data-csx-close
                    aria-label="<?= $this->te('Dialog schließen') ?>">&times;</button>
        </div>
        <form method="POST" action="/contacts/companies" novalidate>
            <input type="hidden" name="_csrf" value="<?= $this->csrf() ?>">
            <div class="modal-body">
                <p class="csx-create-error" style="display:none;" role="alert"></p>
                <div class="form-group">
                    <label for="csx-name"><?= $this->te('Name') ?> <span class="text-danger">*</span></label>
                    <input type="text" id="csx-name" name="name" class="form-control form-control-sm"
                           autocomplete="off" required>
                </div>
                <div class="form-group">
                    <label for="csx-customer-number"><?= $this->te('Kundennummer') ?></label>
                    <input type="text" id="csx-customer-number" name="customer_number"
                           class="form-control form-control-sm" autocomplete="off">
                </div>
                <div class="form-group">
                    <label for="csx-address"><?= $this->te('Adresse') ?></label>
                    <textarea id="csx-address" name="address" rows="2"
                              class="form-control form-control-sm"
                              placeholder="<?= $this->te('Straße, PLZ Ort') ?>"></textarea>
                </div>
                <div class="form-group">
                    <label for="csx-phone"><?= $this->te('Telefon') ?></label>
                    <input type="text" id="csx-phone" name="phone" class="form-control form-control-sm"
                           autocomplete="off">
                </div>
                <div class="form-group">
                    <label for="csx-email"><?= $this->t('E-Mail') ?></label>
                    <input type="email" id="csx-email" name="email" class="form-control form-control-sm"
                           autocomplete="off">
                </div>
                <div class="form-group">
                    <label for="csx-website"><?= $this->te('Website') ?></label>
                    <input type="url" id="csx-website" name="website" class="form-control form-control-sm"
                           placeholder="https://" autocomplete="off">
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-csx-close><?= $this->te('Abbrechen') ?></button>
                <button type="submit" class="btn btn-primary"><?= $this->te('Firma anlegen') ?></button>
            </div>
        </form>
    </div>
</div>