crmFormProcessorSpecification.html 3.33 KB
Newer Older
1
<div ng-if="specification.type == 'specification'">
2
3
4
	<div ng-if="!noLabel" class="label">
  	<label crm-ui-for="specification.name" crm-depth="1" crm-ui-force-required="specification.required">{{specification.title}}</label>
	</div>
5
6
7

  <div ng-attr-class="{{!noLabel ?  'content' : ''}}"  ng-if="specification.options">
    <select
jaapjansma's avatar
jaapjansma committed
8
      class="huge"
9
      crm-form-processor-select2="{allowClear: true, minimumInputLength: 0}"
10
11
12
13
14
15
16
17
18
      crm-ui-id="{{specification.name}}"
      name="{{specification.name}}"
      ng-model="configuration[specification.name]"
      ng-required="specification.required"
    >
      <option ng-repeat="(key,value) in specification.options" value="{{key}}">{{value}}</option>
    </select>
  </div>
  <div ng-attr-class="{{!noLabel ?  'content' : ''}}"  ng-if="specification.fk_entity">
jaapjansma's avatar
jaapjansma committed
19
20
    <input class="huge"
      crm-entityref="{entity: specification.fk_entity, select: {allowClear: true, placeholder: specification.title, minimumInputLength:0}}"
21
22
23
24
25
26
27
28
29
      name="{{specification.name}}"
      crm-ui-id="{{specification.name}}"
      ng-model="configuration[specification.name]"
      ng-required="spec.required"
    />
  </div>


  <div ng-attr-class="{{!noLabel ?  'content' : ''}}"  ng-if="!specification.options && !specification.fk_entity">
30
		<input
31
32
33
      type="text"
      name="{{specification.name}}"
      ng-model="configuration[specification.name]"
jaapjansma's avatar
jaapjansma committed
34
      class="huge crm-form-text"
35
36
      ng-required="specification.required"
    />
37
38
 </div>
 <div ng-if="!noLabel" class="clear"></div>
39
</div>
jaapjansma's avatar
jaapjansma committed
40

41
<div ng-if="specification.type == 'fields'">
42
43
44
	<div ng-if="!noLabel" class="label">
  	<label crm-ui-for="specification.name" crm-depth="1" crm-ui-force-required="specification.required">{{specification.title}}</label>
	</div>
45
	<div ng-attr-class="{{!noLabel ?  'content' : ''}}">
46
47
		<select
    	name="{{specification.name}}"
48
      crm-form-processor-select2="{allowClear: true, minimumInputLength: 0}"
49
50
    	ng-model="configuration[specification.name]"
    	ng-required="specification.required"
jaapjansma's avatar
jaapjansma committed
51
    	ng-options="field.name as field.label for field in fields track by field.name">
52
53
54
55
    	<option value=""> - {{specification.title}} - </option>
  	</select>
 </div>
 <div ng-if="!noLabel" class="clear"></div>
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
</div>
<div ng-if="specification.type == 'collection'">
		<table>
			<thead>
				<th ng-repeat="collection_spec in specification.specification_bag.parameter_specifications">
					{{collection_spec.title}}
				</th>
				<th></th>
			</thead>
			<tbody>
				<tr ng-repeat="collection_config in configuration[specification.name]" ng-class-even="'crm-entity even-row even'" ng-class-odd="'crm-entity odd-row odd'">
					<td ng-repeat="collection_spec in specification.specification_bag.parameter_specifications">
						<crm-form-processor-specification
    					specification="collection_spec"
    					configuration="collection_config"
    					fields="fields"
72
    					no-label="true"
73
74
75
76
77
    				>
    				</crm-form-processor-specification>
					</td>
					<td>
						<a crm-icon="fa-trash" class="crm-hover-button" ng-click="removeItem(collection_config)" title="{{ts('Remove')}}">{{ts('Remove')}}</a>
78
					</td>
79
80
81
82
83
84
				</tr>
			</tbody>
			<button crm-icon="fa-plus" ng-click="addItemToCollection(specification.specification_bag)">{{ts('Add item')}}</button>
</table>
</div>

85
<div class="description" ng-if="specification.description" ng-bind-html="specification.description"></div>