use number wiget for weight fields in all forms
authoryashodha <yashodha@cividesk.com>
Fri, 1 Feb 2019 10:01:28 +0000 (15:31 +0530)
committeryashodha <yashodha@cividesk.com>
Fri, 1 Feb 2019 10:01:28 +0000 (15:31 +0530)
14 files changed:
CRM/Admin/Form/LabelFormats.php
CRM/Admin/Form/ParticipantStatusType.php
CRM/Admin/Form/PdfFormats.php
CRM/Campaign/Form/Survey/Results.php
CRM/Campaign/Form/SurveyType.php
CRM/Custom/Form/Field.php
CRM/Custom/Form/Group.php
CRM/Custom/Form/Option.php
CRM/Member/Form/MembershipStatus.php
CRM/Price/Form/Field.php
CRM/Price/Form/Option.php
CRM/Report/Form/Register.php
CRM/UF/Form/Field.php
CRM/UF/Form/Group.php

index ab56ef40aaac5d7f873688fbddbd288c82004854..70e767395d3f3e4136daf220edcaae75f97a58f8 100644 (file)
@@ -128,7 +128,7 @@ class CRM_Admin_Form_LabelFormats extends CRM_Admin_Form {
     $this->add('text', 'SpaceY', ts('Vertical Spacing'), array('size' => 8, 'maxlength' => 8) + $disabled, $required);
     $this->add('text', 'lPadding', ts('Left Padding'), array('size' => 8, 'maxlength' => 8), $required);
     $this->add('text', 'tPadding', ts('Top Padding'), array('size' => 8, 'maxlength' => 8), $required);
-    $this->add('text', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Core_BAO_LabelFormat', 'weight'), TRUE);
+    $this->add('number', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Core_BAO_LabelFormat', 'weight'), TRUE);
 
     $this->addRule('label', ts('Name already exists in Database.'), 'objectExists', array(
       'CRM_Core_BAO_LabelFormat',
index af8a2072ff1c16c77b8d238317ad1cd7d6c7e13a..5fc9c7e5bad84ab5415cbb38340791f94b32250e 100644 (file)
@@ -64,7 +64,7 @@ class CRM_Admin_Form_ParticipantStatusType extends CRM_Admin_Form {
     $this->add('checkbox', 'is_active', ts('Active?'));
     $this->add('checkbox', 'is_counted', ts('Counted?'));
 
-    $this->add('text', 'weight', ts('Order'), $attributes['weight'], TRUE);
+    $this->add('number', 'weight', ts('Order'), $attributes['weight'], TRUE);
 
     $this->addSelect('visibility_id', array('label' => ts('Visibility'), 'required' => TRUE));
 
index 018793c966ba6ddfab998d4e3cc2e65b749f57c4..f8710643300c2901e405e655d3d9ed7f4b19f765 100644 (file)
@@ -77,7 +77,7 @@ class CRM_Admin_Form_PdfFormats extends CRM_Admin_Form {
     $this->add('text', 'margin_right', ts('Right Margin'), array('size' => 8, 'maxlength' => 8), TRUE);
     $this->add('text', 'margin_top', ts('Top Margin'), array('size' => 8, 'maxlength' => 8), TRUE);
     $this->add('text', 'margin_bottom', ts('Bottom Margin'), array('size' => 8, 'maxlength' => 8), TRUE);
-    $this->add('text', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Core_BAO_PdfFormat', 'weight'), TRUE);
+    $this->add('number', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Core_BAO_PdfFormat', 'weight'), TRUE);
 
     $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array(
         'CRM_Core_BAO_PdfFormat',
index ffe95eb00d1bd0a678ccbe98287ff77f30be7acb..4dd86299f718666e30ae84a7f7d07ae95f63cc0c 100644 (file)
@@ -165,7 +165,7 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey {
       );
 
       // weight
-      $this->add('text', "option_weight[$i]", ts('Order'),
+      $this->add('number', "option_weight[$i]", ts('Order'),
         $optionAttributes['weight']
       );
 
index 5420bad6107fff7c61a68f8288d2c878e49b2b24..4e5b91fe164190178a1d8f5a7835b21d36cb8021 100644 (file)
@@ -129,7 +129,7 @@ class CRM_Campaign_Form_SurveyType extends CRM_Admin_Form {
     ) {
       $this->freeze(array('label', 'is_active'));
     }
-    $this->add('text', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'weight'), TRUE);
+    $this->add('number', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'weight'), TRUE);
 
     $this->assign('id', $this->_id);
   }
index b0f6f11732c5fac29dee5c4018164a3ba798c552..1d64aadc8a0ace9dc107c25721e915c09293d25e 100644 (file)
@@ -416,7 +416,7 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
       );
 
       // weight
-      $this->add('text', "option_weight[$i]", ts('Order'),
+      $this->add('number', "option_weight[$i]", ts('Order'),
         $optionAttributes['weight']
       );
 
index 8d15bd9004452b0ec04858f18dc00477f7bf0121..57135f0c5c4cb5fc63899068580531b5fb8fd62e 100644 (file)
@@ -307,7 +307,7 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
     $this->add('wysiwyg', 'help_post', ts('Post-form Help'), $attributes['help_post']);
 
     // weight
-    $this->add('text', 'weight', ts('Order'), $attributes['weight'], TRUE);
+    $this->add('number', 'weight', ts('Order'), $attributes['weight'], TRUE);
     $this->addRule('weight', ts('is a numeric field'), 'numeric');
 
     // display style
index 7228dfbd2cfffc3fef320540c3e2e5c9f343fc39..dffed8944eb1b4cf83401b7fa60026372737e025 100644 (file)
@@ -182,7 +182,7 @@ class CRM_Custom_Form_Option extends CRM_Core_Form {
 
       $this->add('textarea', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'description'));
       // weight
-      $this->add('text', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'weight'), TRUE);
+      $this->add('number', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'weight'), TRUE);
       $this->addRule('weight', ts('is a numeric field'), 'numeric');
 
       // is active ?
index 4f4552f54dd92298c2fc596afa444b7fe8a71535..ef768a07822528a2941168ca8cdcc9f438a93227 100644 (file)
@@ -153,7 +153,7 @@ class CRM_Member_Form_MembershipStatus extends CRM_Core_Form {
     );
     $this->add('checkbox', 'is_current_member', ts('Current Membership?'));
 
-    $this->add('text', 'weight', ts('Order'),
+    $this->add('number', 'weight', ts('Order'),
       CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipStatus', 'weight')
     );
     $this->add('checkbox', 'is_default', ts('Default?'));
index f7a75cb84a5a866fc43aa1f56afd948cac83db22..2dbc229fe71144cf1db361456a8709834c0cbfdf 100644 (file)
@@ -292,7 +292,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
       }
 
       // weight
-      $this->add('text', 'option_weight[' . $i . ']', ts('Order'), $attributes['weight']);
+      $this->add('number', 'option_weight[' . $i . ']', ts('Order'), $attributes['weight']);
 
       // is active ?
       $this->add('checkbox', 'option_status[' . $i . ']', ts('Active?'));
@@ -311,7 +311,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
     $this->add('checkbox', 'is_display_amounts', ts('Display Amount?'));
 
     // weight
-    $this->add('text', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceField', 'weight'), TRUE);
+    $this->add('number', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceField', 'weight'), TRUE);
     $this->addRule('weight', ts('is a numeric field'), 'numeric');
 
     // checkbox / radio options per line
index da4f2a3de602d1a4fbe318f91c383c9cb89178f2..7970ac0e9e9741f83e5d82f3a36e398c50ba9a9c 100644 (file)
@@ -232,7 +232,7 @@ class CRM_Price_Form_Option extends CRM_Core_Form {
       $this->add('textarea', 'help_post', ts('Post Option Help'));
 
       // weight
-      $this->add('text', 'weight', ts('Order'), NULL, TRUE);
+      $this->add('number', 'weight', ts('Order'), NULL, TRUE);
       $this->addRule('weight', ts('is a numeric field'), 'numeric');
 
       // is active ?
index b0d1fadbc656e992ff9de1fae342ffe28d4d70ab..b926f290e292d20c008465a7edf8df2d965846e2 100644 (file)
@@ -101,7 +101,7 @@ class CRM_Report_Form_Register extends CRM_Core_Form {
     $this->add('text', 'label', ts('Title'), array('size' => 40), TRUE);
     $this->add('text', 'value', ts('URL'), array('size' => 40), TRUE);
     $this->add('text', 'name', ts('Class'), array('size' => 40), TRUE);
-    $element = $this->add('text', 'weight', ts('Order'), array('size' => 4), TRUE);
+    $element = $this->add('number', 'weight', ts('Order'), array('size' => 4), TRUE);
     // $element->freeze( );
     $this->add('text', 'description', ts('Description'), array('size' => 40), TRUE);
 
index 0036a9bd7cf4030ffd9b67df9f6e328bc041c04e..5b0c433a781ccc1bab69f472baba9d2c76a22b3d 100644 (file)
@@ -439,7 +439,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
     $attributes = CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFField');
 
     // weight
-    $this->add('text', 'weight', ts('Order'), $attributes['weight'], TRUE);
+    $this->add('number', 'weight', ts('Order'), $attributes['weight'], TRUE);
     $this->addRule('weight', ts('is a numeric field'), 'numeric');
 
     $this->add('textarea', 'help_pre', ts('Field Pre Help'), $attributes['help_pre']);
index a1c2d80f47352f3a9482c3f1c52a174446635d63..7c4735b712a7b5aef8236e812e10c61f6f55c897 100644 (file)
@@ -184,7 +184,7 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
     $this->add('wysiwyg', 'help_post', ts('Post-form Help'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFGroup', 'help_post'));
 
     // weight
-    $this->add('text', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFJoin', 'weight'), TRUE);
+    $this->add('number', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFJoin', 'weight'), TRUE);
     $this->addRule('weight', ts('is a numeric field'), 'numeric');
 
     // is this group active ?