summaryrefslogtreecommitdiff
path: root/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/timelineTable.html
blob: 4d044f1b9d32b88568c82e23b13fbf4c06e1f518 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!--
Controller: CaseTypeCtrl
Required vars: activitySet
-->
<table>
  <thead>
  <tr>
    <th></th>
    <th>{{ts('Activity')}}</th>
    <th>{{ts('Status')}}</th>
    <th>{{ts('Reference')}}</th>
    <th>{{ts('Offset')}}</th>
    <th>{{ts('Select')}}</th>
    <th>{{ts('Default assignee')}}</th>
    <th></th>
  </tr>
  </thead>

  <tbody ui-sortable ng-model="activitySet.activityTypes">
  <tr ng-repeat="activity in activitySet.activityTypes">
    <td>
      <i class="crm-i fa-arrows grip-n-drag"></i>
    </td>
    <td>
      <i class="crm-i {{activityTypes[activity.name].icon}}"></i>
      {{activity.label}}
    </td>
    <td>
      <select
        ui-jq="select2"
        ui-options="{dropdownAutoWidth: true}"
        ng-model="activity.status"
        ng-options="actStatus.name as actStatus.label for actStatus in activityStatuses|orderBy:'label'"
        >
        <option value=""></option>
      </select>
    </td>
    <td>
      <select
        ui-jq="select2"
        ui-options="{dropdownAutoWidth: true}"
        ng-model="activity.reference_activity"
        ng-options="activityType.name as activityType.label for activityType in caseType.definition.timelineActivityTypes"
        >
        <option value="">-- Case Start --</option>
      </select>
    </td>
    <td>
      <input
        class="number crm-form-text"
        type="text"
        ng-pattern="/^-?[0-9]*$/"
        ng-model="activity.reference_offset"
        >
    </td>
    <td>
      <select
        ui-jq="select2"
        ui-options="{dropdownAutoWidth: true}"
        ng-model="activity.reference_select"
        ng-options="key as value for (key,value) in {newest: ts('Newest'), oldest: ts('Oldest')}"
        >
      </select>
    </td>
    <td>
      <select
        ui-jq="select2"
        ui-options="{dropdownAutoWidth: true}"
        ng-model="activity.default_assignee_type"
        ng-options="option.value as option.label for option in defaultAssigneeTypes"
        ng-change="clearActivityDefaultAssigneeValues(activity)"
      ></select>

      <p ng-if="activity.default_assignee_type === defaultAssigneeTypeValues.BY_RELATIONSHIP">
        <select
          ui-jq="select2"
          ui-options="{dropdownAutoWidth: true}"
          ng-model="activity.default_assignee_relationship"
          ng-options="option.value as option.label for option in defaultRelationshipTypeOptions"
          required
        ></select>
      </p>

      <p ng-if="activity.default_assignee_type === defaultAssigneeTypeValues.SPECIFIC_CONTACT">
        <input
          type="text"
          ng-model="activity.default_assignee_contact"
          placeholder="- Select contact -"
          crm-entityref="{ entity: 'Contact' }"
          data-create-links="true"
          required />
      </p>
    </td>
    <td>
      <a class="crm-hover-button"
         crm-icon="fa-trash"
         ng-show="isActivityRemovable(activitySet, activity)"
         ng-click="removeItem(activitySet.activityTypes, activity)"
         title="{{ts('Remove')}}">
      </a>
    </td>
  </tr>
  </tbody>

  <tfoot>
  <tr class="addRow">
    <td colspan="8">
      <span crm-add-name=""
           crm-options="activityTypeOptions"
           crm-var="newActivity"
           crm-on-add="addActivity(activitySet, newActivity)"
           placeholder="{{ts('Add activity')}}"
      ></span>
    </td>
  </tr>
  </tfoot>
</table>