dev/core#107 Automatically add default assignees when creating new cases
[civicrm-core.git] / ang / crmCaseType / timelineTable.html
1 <!--
2 Controller: CaseTypeCtrl
3 Required vars: activitySet
4 -->
5 <table>
6 <thead>
7 <tr>
8 <th></th>
9 <th>{{ts('Activity')}}</th>
10 <th>{{ts('Status')}}</th>
11 <th>{{ts('Reference')}}</th>
12 <th>{{ts('Offset')}}</th>
13 <th>{{ts('Select')}}</th>
14 <th>{{ts('Default assignee')}}</th>
15 <th></th>
16 </tr>
17 </thead>
18
19 <tbody ui-sortable ng-model="activitySet.activityTypes">
20 <tr ng-repeat="activity in activitySet.activityTypes">
21 <td>
22 <i class="crm-i fa-arrows grip-n-drag"></i>
23 </td>
24 <td>
25 <i class="crm-i {{activityTypes[activity.name].icon}}"></i>
26 {{activity.label}}
27 </td>
28 <td>
29 <select
30 ui-jq="select2"
31 ui-options="{dropdownAutoWidth: true}"
32 ng-model="activity.status"
33 ng-options="actStatus.name as actStatus.label for actStatus in activityStatuses|orderBy:'label'"
34 >
35 <option value=""></option>
36 </select>
37 </td>
38 <td>
39 <select
40 ui-jq="select2"
41 ui-options="{dropdownAutoWidth: true}"
42 ng-model="activity.reference_activity"
43 ng-options="activityType.name as activityType.label for activityType in caseType.definition.timelineActivityTypes"
44 >
45 <option value="">-- Case Start --</option>
46 </select>
47 </td>
48 <td>
49 <input
50 class="number crm-form-text"
51 type="text"
52 ng-pattern="/^-?[0-9]*$/"
53 ng-model="activity.reference_offset"
54 >
55 </td>
56 <td>
57 <select
58 ui-jq="select2"
59 ui-options="{dropdownAutoWidth: true}"
60 ng-model="activity.reference_select"
61 ng-options="key as value for (key,value) in {newest: ts('Newest'), oldest: ts('Oldest')}"
62 >
63 </select>
64 </td>
65 <td>
66 <select
67 ui-jq="select2"
68 ui-options="{dropdownAutoWidth: true}"
69 ng-model="activity.default_assignee_type"
70 ng-options="option.value as option.label for option in defaultAssigneeTypes"
71 ng-change="clearActivityDefaultAssigneeValues(activity)"
72 ></select>
73
74 <p ng-if="activity.default_assignee_type === defaultAssigneeTypeValues.BY_RELATIONSHIP">
75 <select
76 ui-jq="select2"
77 ui-options="{dropdownAutoWidth: true}"
78 ng-model="activity.default_assignee_relationship"
79 ng-options="option.id as option.text for option in relationshipTypeOptions"
80 required
81 ></select>
82 </p>
83
84 <p ng-if="activity.default_assignee_type === defaultAssigneeTypeValues.SPECIFIC_CONTACT">
85 <input
86 type="text"
87 ng-model="activity.default_assignee_contact"
88 placeholder="- Select contact -"
89 crm-entityref="{ entity: 'Contact' }"
90 data-create-links="true"
91 required />
92 </p>
93 </td>
94 <td>
95 <a class="crm-hover-button"
96 crm-icon="fa-trash"
97 ng-show="isActivityRemovable(activitySet, activity)"
98 ng-click="removeItem(activitySet.activityTypes, activity)"
99 title="{{ts('Remove')}}">
100 </a>
101 </td>
102 </tr>
103 </tbody>
104
105 <tfoot>
106 <tr class="addRow">
107 <td colspan="8">
108 <span crm-add-name=""
109 crm-options="activityTypeOptions"
110 crm-var="newActivity"
111 crm-on-add="addActivity(activitySet, newActivity)"
112 placeholder="{{ts('Add activity')}}"
113 ></span>
114 </td>
115 </tr>
116 </tfoot>
117 </table>