sintonia/legacy/application/views/scripts/playouthistorytemplate/template-contents.phtml

78 lines
2.7 KiB
PHTML
Raw Permalink Normal View History

2022-08-10 13:38:19 +02:00
<?php if ($this->template_type == Application_Service_HistoryService::TEMPLATE_TYPE_FILE) : ?>
<h4><?php echo _("Creating File Summary Template") ?></h4>
<?php else : ?>
<h4><?php echo _("Creating Log Sheet Template") ?></h4>
<?php endif; ?>
<div class="template_name_wrap">
2022-08-10 13:38:19 +02:00
<label>
<?php echo _("Name") ?>
<input id="template_name" type="text" value="<?php echo $this->template_name; ?>">
</label>
<?php $i = 0;
2022-08-10 13:38:19 +02:00
$usedFileMD = array();
?>
<ul class="template_item_list">
2022-08-10 13:38:19 +02:00
<?php foreach ($this->template_fields as $field) : ?>
2022-08-10 13:38:19 +02:00
<?php if ($field["isFileMd"]) {
$usedFileMD[] = $field["name"];
} ?>
2022-08-10 13:38:19 +02:00
<li id="<?php echo "field_" . $i ?>" data-id="<?php echo isset($field["id"]) ? $field["id"] : ""; ?>" data-name="<?php echo $field["name"] ?>" data-label="<?php echo $field["label"] ?>" data-type="<?php echo $field["type"] ?>" data-filemd="<?php echo var_export($field["isFileMd"], true) ?>" class="<?php echo ($field["isFileMd"]) ? 'field_filemd' : 'field_other' ?>">
<span><?php echo $field["label"] ?></span>
<span><?php echo $field["type"] ?></span>
<?php if (!in_array($field["name"], $this->required_fields)) : ?>
<span class="template_item_remove">
<i class="icon icon-trash"></i>
</span>
<?php endif; ?>
</li>
<?php $i++; ?>
2022-08-10 13:38:19 +02:00
<?php endforeach; ?>
</ul>
</div>
<div class="add_more">
<p><?php echo _("Add more elements") ?>:</p>
<ul class="template_file_md">
2022-08-10 13:38:19 +02:00
<?php foreach ($this->fileMD as $md) : ?>
2022-08-10 13:38:19 +02:00
<?php if (in_array($md["name"], $usedFileMD)) {
continue;
} ?>
2022-08-10 13:38:19 +02:00
<li id="<?php echo "md_" . $md["name"] ?>" data-name="<?php echo $md["name"] ?>" data-type="<?php echo $md["type"] ?>" data-label="<?php echo $md["label"] ?>">
<?php echo $md["label"] ?>
<a class="field_add" href="#"><i class="icon icon-plus"></i></a>
</li>
<?php endforeach; ?>
</ul>
2022-08-10 13:38:19 +02:00
<?php if ($this->template_type !== Application_Service_HistoryService::TEMPLATE_TYPE_FILE) : ?>
<div class="template_item_add">
<input type="text" placeholder="<?php echo _("Add New Field") ?>">
<select>
<?php foreach ($this->fields as $field) : ?>
<option value="<?php echo $field; ?>"><?php echo _($field); ?></option>
<?php endforeach; ?>
</select>
<button class="btn">
<i class="icon-white icon-plus"></i>
<?php echo _("Add") ?>
</button>
</div>
<?php endif; ?>
</div>
<div>
2022-08-10 13:38:19 +02:00
<?php if (!in_array($this->template_id, $this->configured)) : ?>
<button id="template_set_default" data-template="<?php echo $this->template_id; ?>" class="btn"><?php echo _("Set Default Template") ?></button>
<?php endif; ?>
<button id="template_item_save" data-template="<?php echo $this->template_id; ?>" class="btn"><?php echo _("Save") ?></button>
2021-10-12 11:17:57 +02:00
</div>