CRM-14647 - Add maxlength to profile titles
authorColeman Watts <coleman@civicrm.org>
Sat, 1 Aug 2015 16:46:44 +0000 (12:46 -0400)
committerColeman Watts <coleman@civicrm.org>
Sat, 1 Aug 2015 16:46:44 +0000 (12:46 -0400)
js/model/crm.uf.js

index 78f87c2d18a8943d8e94b59d7dd3cb357165fc93..095acddc0dc8e6ed20d9e443f0ac84bb010db05c 100644 (file)
       },
       'label': {
         title: ts('Field Label'),
-        type: 'Text'
+        type: 'Text',
+        editorAttrs: {maxlength: 255}
       },
       'location_type_id': {
         title: ts('Location Type'),
         title: ts('Profile Name'),
         help: ts(''),
         type: 'Text',
+        editorAttrs: {maxlength: 64},
         validators: ['required']
       },
       'group_type': {
           return _.omit(ufFieldModel.toStrictJSON(), ['id', 'uf_group_id']);
         })
       );
-      copy.set('title', ts('%1 (Copy)', {
-        1: copy.get('title')
-      }));
+      var copyLabel = ' ' + ts('(Copy)');
+      copy.set('title', copy.get('title').slice(0, 64 - copyLabel.length) + copyLabel);
       return copy;
     },
     getModelClass: function(entity_name) {