CRM-14480 - crmCaseType - Make cells editable (per mockup)
authorTim Otten <totten@civicrm.org>
Thu, 8 May 2014 01:07:48 +0000 (18:07 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 20 May 2014 03:15:26 +0000 (20:15 -0700)
CRM/Case/Info.php
css/civicrm.css
js/angular-crmCaseType.js
partials/crmCaseType/activityTypesTable.html
partials/crmCaseType/timelineTable.html

index 61ec823c25ece834d5c10fdeca87e5a60ca3ea6c..3f191b04f1b551f88fd280e3e9c147e807f458f2 100644 (file)
@@ -62,6 +62,16 @@ class CRM_Case_Info extends CRM_Core_Component_Info {
       'js' => array('js/angular-crmCaseType.js'),
       'css' => array('css/angular-crmCaseType.css'),
     );
+    // Need full OptionValue records
+    $actStatuses = civicrm_api3('OptionValue', 'get', array('option_group_id' => 'activity_status'));
+    $actTypes = civicrm_api3('OptionValue', 'get', array('option_group_id' => 'activity_type'));
+    CRM_Core_Resources::singleton()->addSetting(array(
+      'crmCaseType' => array(
+        'actStatuses' => array_values($actStatuses['values']),
+        'actTypes' => array_values($actTypes['values']),
+        //CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'name'),
+      ),
+    ));
     return $result;
   }
 
index 6f4b08dcf90f8295e94f30c126971172581640fa..ecb79db720df8cbb583d22b294d46090172d313e 100644 (file)
@@ -4673,3 +4673,10 @@ span.crm-status-icon {
 .crm-container .survey-completed {
   text-decoration: line-through;
 }
+
+.crm-container .ng-invalid {
+    border: 1px solid red;
+}
+.crm-container .ng-valid {
+    border: 1px solid #666;
+}
\ No newline at end of file
index ecaa871968b9b713184e8bc8520101d618c68085..fd0447ff2c57d45b60902b6d7115e56e51b9a610 100644 (file)
@@ -18,6 +18,9 @@
   crmCaseType.controller('CaseTypeCtrl', function($scope) {
     $scope.partialUrl = partialUrl;
 
+    $scope.activityStatuses = CRM.crmCaseType.actStatuses;
+    $scope.activityTypes = CRM.crmCaseType.actTypes;
+
     $scope.workflows = {
       'timeline': 'Timeline',
       'pipeline': 'Sequence'
@@ -63,6 +66,7 @@
         ]
       }
     };
+    window.ct = $scope.caseType;
 
     $scope.addActivitySet = function(workflow) {
       var activitySet = {};
index 1327078ad0e6fe6629c0cc6c3ca3fb4592d2bd0f..38b10fe6fb6b7c58ea981765b6813debb0faad27 100644 (file)
@@ -17,7 +17,7 @@ Required vars: caseType
       {{ activityType.name }}
     </td>
     <td>
-      {{ activityType.max_instances }}
+      <input type="number" ng-model="activityType.max_instances" />
     </td>
     <td>
       <a class="crm-hover-button" ng-click="removeItem(caseType.definition.activityTypes, activityType)">
index ec8ea5b1c459d37067bd37f3c50698d7f69bd0cf..c44e41253cd4adc8d5f99e4db5a7f8e9a6b9e6c8 100644 (file)
@@ -20,16 +20,23 @@ Required vars: activitySet
       {{ activity.name }}
     </td>
     <td>
-      {{ activity.status }}
+      <!-- <select ng-model="activity.status" ng-options="value for (key,value) in activityStatuses|orderBy:'value'"> -->
+      <select ng-model="activity.status" ng-options="actStatus.name as actStatus.name for actStatus in activityStatuses|orderBy:'name'">
+        <option value=""></option>
+      </select>
     </td>
     <td>
-      {{ activity.reference_activity }}
+      <select ng-model="activity.reference_activity" ng-options="actType.name as actType.name for actType in activityTypes|orderBy:'name'">
+        <option value=""></option>
+      </select>
     </td>
     <td>
-      {{ activity.reference_offset }}
+      <input type="number" ng-model="activity.reference_offset" />
     </td>
     <td>
-      {{ activity.reference_select }}
+      <select ng-model="activity.reference_select" ng-options="key as value for (key,value) in {newest: 'Newest', oldest: 'Oldest'}">
+        <option value=""></option>
+      </select>
     </td>
     <td>
       <a class="crm-hover-button" ng-click="removeItem(activitySet.activityTypes, activity)">