Add phone group support

This commit is contained in:
osaajani 2023-02-20 03:17:53 +01:00
parent 22e5149193
commit 7c3bb65f8b
19 changed files with 1123 additions and 47 deletions

View file

@ -131,14 +131,21 @@
</div>
</div>
<?php } ?>
<?php if (count($phones)) { ?>
<?php if (count($phones) || count($phone_groups)) { ?>
<div class="form-group">
<label>Numéro à employer : </label>
<select name="id_phone" class="form-control">
<option value="">N'importe lequel</option>
<?php foreach ($phones as $phone) { ?>
<option value="<?php $this->s($phone['id']); ?>" <?= ($_SESSION['previous_http_post']['id_phone'] ?? '') == $phone['id'] ? 'selected' : '' ?>><?php $this->s($phone['name']); ?></option>
<?php } ?>
<optgroup label="Téléphones">
<?php foreach ($phones as $phone) { ?>
<option value="phone_<?php $this->s($phone['id']); ?>" <?= ($_SESSION['previous_http_post']['id_phone'] ?? '') == ('phone_' . $phone['id']) ? 'selected' : '' ?>><?php $this->s($phone['name']); ?></option>
<?php } ?>
</optgroup>
<optgroup label="Groupes de téléphones">
<?php foreach ($phone_groups as $phone_group) { ?>
<option value="phonegroup_<?php $this->s($phone_group['id']); ?>" <?= ($_SESSION['previous_http_post']['id_phone'] ?? '') == ('phonegroup_' . $phone_group['id']) ? 'selected' : '' ?>><?php $this->s($phone_group['name']); ?></option>
<?php } ?>
</optgroup>
</select>
</div>
<?php } ?>