1{extends 'layout_view.tpl'}
2
3{block name="title"}
4	{title}{$title|escape}{/title}
5{/block}
6
7{block name="content"}
8<form method="post" action="{service controller=tracker action=add_field}">
9	<div class="form-group row mx-0">
10		<label for="name" class="col-form-label">{tr}Name{/tr}</label>
11		<input type="text" name="name" id="name" value="{$name|escape}" required="required" class="form-control">
12	</div>
13	<div class="form-group row mx-0" style="display: none;">
14		<label for="permName" class="col-form-label">{tr}Permanent name{/tr}</label>
15		<input type="text" name="permName" id="permName" value="{$permName|escape}" pattern="[a-zA-Z0-9_]+" class="form-control">
16		<input type="hidden" id="fieldPrefix" value="{$fieldPrefix|escape}">
17	</div>
18	<div class="form-group row mx-0">
19		<label for="type" class="col-form-label">{tr}Type{/tr}</label>
20		<select name="type" id="type" class="form-control">
21			{foreach from=$types key=k item=info}
22				<option value="{$k|escape}"
23					{if $type eq $k}selected="selected"{/if}>
24					{$info.name|escape}
25					{if $info.deprecated}- Deprecated{/if}
26				</option>
27			{/foreach}
28		</select>
29		{foreach from=$types item=info key=k}
30			<div class="form-text {$k|escape}" style="display: none;">
31				{$info.description|escape}
32				{if $info.help}
33					<a href="{$prefs.helpurl|escape}{$info.help|escape:'url'}" target="tikihelp" class="tikihelp" title="{$info.name|escape}">
34						{icon name='help'}
35					</a>
36				{/if}
37			</div>
38		{/foreach}
39	</div>
40	{remarksbox type=info title="{tr}More types available{/tr}"}
41		{if $tiki_p_admin eq 'y'}
42			<p>{tr _0="tiki-admin.php?page=trackers&cookietab=3"}More field types may be enabled from the <a href="%0" class="alert-link">administration panel</a>.{/tr}</p>
43		{else}
44			<p>{tr _0="https://doc.tiki.org/Tracker+Field+Type"}Contact your administrator to see if they can be enabled. The complete field type list is available in the <a rel="external" class="alert-link external" href="%0">documentation</a>.{/tr}</p>
45		{/if}
46	{/remarksbox}
47	<div class="form-group row mx-0">
48		<label for="description" class="col-form-label">{tr}Description{/tr}</label>
49		<textarea name="description" id="description" class="form-control">{$description|escape}</textarea>
50	</div>
51	<div class="form-check">
52		<label class="form-check-label">
53			<input class="form-check-input" type="checkbox" name="description_parse" value="1"
54				{if $descriptionIsParsed}checked="checked"{/if}
55				>
56			{tr}Description contains wiki syntax{/tr}
57		</label>
58	</div>
59	<div class="form-check">
60		<label class="form-check-label">
61			<input class="form-check-input" type="checkbox" name="adminOnly" value="1">
62			{tr}Restrict visibility to administrators{/tr}
63			<div class="form-text">
64				{tr}Useful if you are working on a live tracker.{/tr}
65			</div>
66		</label>
67	</div>
68	<div class="submit">
69		<input type="submit" class="btn btn-primary" name="submit_and_edit" value="{tr}Add Field &amp; Edit Advanced Options{/tr}">
70		<input type="submit" class="btn btn-primary" name="submit" value="{tr}Add Field{/tr}">
71		<input type="hidden" name="trackerId" value="{$trackerId|escape}">
72		<input type="hidden" name="next" value="close">
73		<input type="hidden" name="modal" value="{$modal|escape}">
74	</div>
75</form>
76{/block}
77