Files
breadcrumb-the-shire/pages/admin/tenants/_form.phtml

188 lines
7.8 KiB
PHTML
Raw Normal View History

2026-02-04 23:31:53 +01:00
<?php
/**
* @var array $values
* @var string|null $formId
* @var bool $detailsOpenAll
* @var bool $isReadOnly
*/
use MintyPHP\Session;
$values = $values ?? [];
$formId = $formId ?? 'tenant-form';
$detailsOpenAll = $detailsOpenAll ?? false;
$isReadOnly = $isReadOnly ?? false;
$readonlyAttr = $isReadOnly ? 'readonly' : '';
$disabledAttr = $isReadOnly ? 'disabled' : '';
$primaryColor = (string) ($values['primary_color'] ?? '');
$defaultPrimaryColor = appSetting('app_primary_color') ?? '#2fa4a4';
$useDefaultPrimaryColor = $primaryColor === '';
?>
<form id="<?php e($formId); ?>" method="post">
<div class="app-tabs" data-tabs data-tabs-param="tab" data-tabs-storage-key="admin-tenant-form">
<div class="app-tabs-nav">
<button type="button" data-tab="basic" data-tab-default><?php e(t('Master data')); ?></button>
<button type="button" data-tab="accounting"><?php e(t('Accounting info')); ?></button>
<button type="button" data-tab="communication"><?php e(t('Communication')); ?></button>
<button type="button" data-tab="support"><?php e(t('Support')); ?></button>
<button type="button" data-tab="legal"><?php e(t('Legal')); ?></button>
<button type="button" data-tab="appearance"><?php e(t('Appearance')); ?></button>
</div>
<div data-tab-panel="basic">
<label for="description">
<span><?php e(t('Description')); ?></span>
<input required type="text" name="description" id="description" value="<?php e($values['description'] ?? ''); ?>"
<?php e($readonlyAttr); ?> />
</label>
<label for="status">
<span><?php e(t('Status')); ?></span>
<?php $statusValue = $values['status'] ?? 'active'; ?>
<select name="status" id="status" <?php e($disabledAttr); ?>>
<option value="active" <?php if ($statusValue === 'active') { ?>selected<?php } ?>>
<?php e(t('Active')); ?>
</option>
<option value="inactive" <?php if ($statusValue === 'inactive') { ?>selected<?php } ?>>
<?php e(t('Inactive')); ?>
</option>
</select>
</label>
<label for="address">
<span><?php e(t('Address')); ?></span>
<input type="text" name="address" id="address" value="<?php e($values['address'] ?? ''); ?>" <?php e($readonlyAttr); ?> />
</label>
<div class="grid">
<label for="postal_code">
<span><?php e(t('Postal code')); ?></span>
<input type="text" name="postal_code" id="postal_code" value="<?php e($values['postal_code'] ?? ''); ?>" <?php e($readonlyAttr); ?> />
</label>
<label for="city">
<span><?php e(t('City')); ?></span>
<input type="text" name="city" id="city" value="<?php e($values['city'] ?? ''); ?>" <?php e($readonlyAttr); ?> />
</label>
</div>
<div class="grid">
<label for="country">
<span><?php e(t('Country')); ?></span>
<input type="text" name="country" id="country" value="<?php e($values['country'] ?? ''); ?>" <?php e($readonlyAttr); ?> />
</label>
<label for="region">
<span><?php e(t('Region')); ?></span>
<input type="text" name="region" id="region" value="<?php e($values['region'] ?? ''); ?>" <?php e($readonlyAttr); ?> />
</label>
</div>
</div>
<div data-tab-panel="accounting">
<div class="grid">
<label for="vat_id">
<span><?php e(t('VAT ID')); ?></span>
<input type="text" name="vat_id" id="vat_id" value="<?php e($values['vat_id'] ?? ''); ?>" <?php e($readonlyAttr); ?> />
</label>
<label for="tax_number">
<span><?php e(t('Tax number')); ?></span>
<input type="text" name="tax_number" id="tax_number" value="<?php e($values['tax_number'] ?? ''); ?>" <?php e($readonlyAttr); ?> />
</label>
</div>
<label for="billing_email">
<span><?php e(t('Billing email')); ?></span>
<input type="email" name="billing_email" id="billing_email" value="<?php e($values['billing_email'] ?? ''); ?>"
<?php e($readonlyAttr); ?> />
</label>
</div>
<div data-tab-panel="communication">
<div class="grid">
<label for="phone">
<span><?php e(t('Phone')); ?></span>
<input type="tel" name="phone" id="phone" value="<?php e($values['phone'] ?? ''); ?>" <?php e($readonlyAttr); ?> />
</label>
<label for="fax">
<span><?php e(t('Fax')); ?></span>
<input type="tel" name="fax" id="fax" value="<?php e($values['fax'] ?? ''); ?>" <?php e($readonlyAttr); ?> />
</label>
</div>
<div class="grid">
<label for="email">
<span><?php e(t('Email')); ?></span>
<input type="email" name="email" id="email" value="<?php e($values['email'] ?? ''); ?>" <?php e($readonlyAttr); ?> />
</label>
<label for="website">
<span><?php e(t('Website')); ?></span>
<input type="url" name="website" id="website" value="<?php e($values['website'] ?? ''); ?>" <?php e($readonlyAttr); ?> />
</label>
</div>
</div>
<div data-tab-panel="support">
<div class="grid">
<label for="support_email">
<span><?php e(t('Support email')); ?></span>
<input type="email" name="support_email" id="support_email" value="<?php e($values['support_email'] ?? ''); ?>"
<?php e($readonlyAttr); ?> />
</label>
<label for="support_phone">
<span><?php e(t('Support phone')); ?></span>
<input type="tel" name="support_phone" id="support_phone" value="<?php e($values['support_phone'] ?? ''); ?>"
<?php e($readonlyAttr); ?> />
</label>
</div>
</div>
<div data-tab-panel="legal">
<div class="grid">
<label for="privacy_url">
<span><?php e(t('Privacy URL')); ?></span>
<input type="url" name="privacy_url" id="privacy_url" value="<?php e($values['privacy_url'] ?? ''); ?>"
<?php e($readonlyAttr); ?> />
</label>
<label for="imprint_url">
<span><?php e(t('Imprint URL')); ?></span>
<input type="url" name="imprint_url" id="imprint_url" value="<?php e($values['imprint_url'] ?? ''); ?>"
<?php e($readonlyAttr); ?> />
</label>
</div>
</div>
<div data-tab-panel="appearance">
<blockquote data-variant="info">
<?php e(t('Using the default color applies the global system appearance.')); ?>
</blockquote>
<div class="grid">
<fieldset>
<legend><small><?php e(t('Primary color')); ?></small></legend>
<label for="primary_color">
<input type="color" name="primary_color" id="primary_color"
value="<?php e($primaryColor !== '' ? $primaryColor : $defaultPrimaryColor); ?>"
<?php e($readonlyAttr); ?> />
<div>
<?php e(t('Choose color')); ?>
</div>
</label>
</fieldset>
<fieldset>
<legend>
<small>
<?php e(t('Use default color')); ?>
</small>
</legend>
<label class="app-field">
<input type="hidden" name="primary_color_use_default" value="0">
<input type="checkbox" name="primary_color_use_default" value="1"
data-color-default-toggle
data-color-target="#primary_color"
data-color-default="<?php e($defaultPrimaryColor); ?>"
<?php e($useDefaultPrimaryColor ? 'checked' : ''); ?>
<?php e($readonlyAttr); ?>>
<span><?php e(t('Use default color')); ?></span>
</label>
<small class="muted"><?php e(t('Be careful - this resets the tenants color')); ?></small>
</fieldset>
</div>
</div>
</div>
<?php Session::getCsrfInput(); ?>
</form>