Index: CRM/Contact/BAO/Contact.php
===================================================================
--- CRM/Contact/BAO/Contact.php	(revision 630)
+++ CRM/Contact/BAO/Contact.php	(working copy)
@@ -63,7 +63,7 @@
      *
      * @var array
      */
-    static $_commPrefs = array( 'do_not_phone', 'do_not_email', 'do_not_mail', 'do_not_trade' );
+    static $_commPrefs = array( 'do_not_phone', 'do_not_email', 'do_not_mail', 'do_not_trade', 'do_not_sms' );
 
     /**
      * static field for all the contact information that we can potentially import
@@ -1320,7 +1320,7 @@
             }
         }
        
-        //set the values for checkboxes (do_not_email, do_not_mail, do_not_trade, do_not_phone)
+        //set the values for checkboxes (do_not_email, do_not_mail, do_not_trade, do_not_phone, do_not_sms)
         $privacy = CRM_Core_SelectValues::privacy( );
         foreach ($privacy as $key => $value) {
             if (array_key_exists($key, $fields)) {
Index: CRM/Contact/BAO/Query.php
===================================================================
--- CRM/Contact/BAO/Query.php	(revision 630)
+++ CRM/Contact/BAO/Query.php	(working copy)
@@ -1138,6 +1138,7 @@
         case 'do_not_email':
         case 'do_not_mail':
         case 'do_not_trade':
+        case 'do_not_sms':
         case 'is_opt_out':
             $this->privacy( $values );
             return;
@@ -2821,6 +2822,7 @@
                                                                'do_not_mail'            => 1,
                                                                'do_not_phone'           => 1,
                                                                'do_not_trade'           => 1,
+                                                               'do_not_sms'             => 1,
                                                                'is_opt_out'             => 1,
                                                                ); 
             }
@@ -3227,7 +3229,8 @@
                                                         'do_not_phone'                   => 1, 
                                                         'do_not_email'                   => 1, 
                                                         'do_not_mail'                    => 1, 
-                                                        'do_not_trade'                   => 1, 
+                                                        'do_not_trade'                   => 1,
+                                                        'do_not_sms'                     => 1,  
                                                         'location'                       => 
                                                         array( '1' => array ( 'location_type'      => 1,
                                                                               'street_address'     => 1,
Index: CRM/Contact/DAO/Contact.php
===================================================================
--- CRM/Contact/DAO/Contact.php	(revision 630)
+++ CRM/Contact/DAO/Contact.php	(working copy)
@@ -118,6 +118,11 @@
      */
     public $do_not_trade;
     /**
+     *
+     * @var boolean
+     */
+    public $do_not_sms;
+    /**
      * Has the contact opted out from receiving all bulk email from the organization or site domain?
      *
      * @var boolean
@@ -422,6 +427,16 @@
                     'dataPattern' => '/^\d{1,}$/',
                     'export' => true,
                 ) ,
+                'do_not_sms' => array(
+                    'name' => 'do_not_sms',
+                    'type' => CRM_Utils_Type::T_BOOLEAN,
+                    'title' => ts('Do Not SMS') ,
+                    'import' => true,
+                    'where' => 'civicrm_contact.do_not_sms',
+                    'headerPattern' => '/d(o )?(not )?(sms)/i',
+                    'dataPattern' => '/^\d{1,}$/',
+                    'export' => true,
+                ) ,
                 'is_opt_out' => array(
                     'name' => 'is_opt_out',
                     'type' => CRM_Utils_Type::T_BOOLEAN,
Index: CRM/Contact/Form/Search/Criteria.php
===================================================================
--- CRM/Contact/Form/Search/Criteria.php	(revision 630)
+++ CRM/Contact/Form/Search/Criteria.php	(working copy)
@@ -103,7 +103,7 @@
         
         $form->addElement('select', 'uf_group_id', ts('Search Views'),  array('' => ts('- default view -')) + $searchProfiles);
 
-        // checkboxes for DO NOT phone, email, mail
+        // checkboxes for DO NOT phone, email, mail, trade, sms
         // we take labels from SelectValues
         $t = CRM_Core_SelectValues::privacy();
         $t['do_not_toggle'] = ts( 'Include contacts who have these privacy option(s).' );
@@ -111,6 +111,7 @@
         $privacy[] = HTML_QuickForm::createElement('advcheckbox', 'do_not_email', null, $t['do_not_email']);
         $privacy[] = HTML_QuickForm::createElement('advcheckbox', 'do_not_mail' , null, $t['do_not_mail']);
         $privacy[] = HTML_QuickForm::createElement('advcheckbox', 'do_not_trade', null, $t['do_not_trade']);
+        $privacy[] = HTML_QuickForm::createElement('advcheckbox', 'do_not_sms',   null, $t['do_not_sms']);
         $privacy[] = HTML_QuickForm::createElement('advcheckbox', 'do_not_toggle', null, $t['do_not_toggle']);
         
         $form->addGroup($privacy, 'privacy', ts('Privacy'), array( '&nbsp;', '&nbsp;', '&nbsp;', '<br/>' ) );
Index: CRM/Contact/Form/Edit.php
===================================================================
--- CRM/Contact/Form/Edit.php	(revision 630)
+++ CRM/Contact/Form/Edit.php	(working copy)
@@ -728,13 +728,14 @@
 
         $privacy = array();
        
-        // checkboxes for DO NOT phone, email, mail
+        // checkboxes for DO NOT phone, email, mail, trade, sms
         // we take labels from SelectValues
         $t = CRM_Core_SelectValues::privacy();
         $privacy[] = HTML_QuickForm::createElement('advcheckbox', 'do_not_phone', null, $t['do_not_phone']);
         $privacy[] = HTML_QuickForm::createElement('advcheckbox', 'do_not_email', null, $t['do_not_email']);
         $privacy[] = HTML_QuickForm::createElement('advcheckbox', 'do_not_mail' , null, $t['do_not_mail']);
         $privacy[] = HTML_QuickForm::createElement('advcheckbox', 'do_not_trade', null, $t['do_not_trade']);
+        $privacy[] = HTML_QuickForm::createElement('advcheckbox', 'do_not_sms',   null, $t['do_not_sms']);
 
         $form->addGroup($privacy, 'privacy', ts('Privacy'), '&nbsp;');
 
Index: CRM/Utils/Address.php
===================================================================
--- CRM/Utils/Address.php	(revision 630)
+++ CRM/Utils/Address.php	(working copy)
@@ -133,6 +133,7 @@
                       'do_not_phone'           => CRM_Utils_Array::value( 'do_not_phone', $fields ),
                       'do_not_mail'            => CRM_Utils_Array::value( 'do_not_mail', $fields ),
                       'do_not_trade'           => CRM_Utils_Array::value( 'do_not_trade', $fields ),
+                      'do_not_sms'             => CRM_Utils_Array::value( 'do_not_sms', $fields ),
                       'job_title'              => CRM_Utils_Array::value( 'job_title', $fields ),
                       'birth_date'             => CRM_Utils_Array::value( 'birth_date', $fields ),
                       'gender'                 => CRM_Utils_Array::value( 'gender', $fields ),
Index: CRM/Profile/Page/Listings.php
===================================================================
--- CRM/Profile/Page/Listings.php	(revision 630)
+++ CRM/Profile/Page/Listings.php	(working copy)
@@ -120,7 +120,7 @@
         $this->_params   = array( );
 
         $resetArray = array( 'group', 'tag', 'preferred_communication_method', 'do_not_phone',
-                             'do_not_email', 'do_not_mail', 'do_not_trade', 'gender' );
+                             'do_not_email', 'do_not_mail', 'do_not_trade', 'do_not_sms', 'gender' );
 
         if (  CRM_Core_Permission::access( 'Kabissa', false ) ) {
             $resetArray[] = 'kabissa_focus_id';
Index: CRM/Dedupe/Merger.php
===================================================================
--- CRM/Dedupe/Merger.php	(revision 630)
+++ CRM/Dedupe/Merger.php	(working copy)
@@ -38,8 +38,8 @@
     static $validFields = array(
         'birth_date', 'contact_source', 'contact_type', 'custom_greeting', 
         'deceased_date', 'do_not_email', 'do_not_mail', 'do_not_phone', 
-        'do_not_trade', 'external_identifier', 'first_name', 'gender', 
-        'greeting_type', 'home_URL', 'household_name', 'image_URL', 
+        'do_not_trade', 'do_not_sms', 'external_identifier', 'first_name',
+        'gender', 'greeting_type', 'home_URL', 'household_name', 'image_URL', 
         'individual_prefix', 'individual_suffix', 'is_deceased', 'is_opt_out', 
         'job_title', 'last_name', 'legal_identifier', 'legal_name', 
         'middle_name', 'nick_name', 'organization_name', 
Index: CRM/Core/SelectValues.php
===================================================================
--- CRM/Core/SelectValues.php	(revision 630)
+++ CRM/Core/SelectValues.php	(working copy)
@@ -87,7 +87,8 @@
                 'do_not_phone' => ts('Do not phone'),
                 'do_not_email' => ts('Do not email'),
                 'do_not_mail'  => ts('Do not mail'),
-                'do_not_trade' => ts('Do not trade')
+                'do_not_trade' => ts('Do not trade'),
+                'do_not_sms'   => ts('Do not sms')
             );
         }
         return $privacy;
Index: CRM/Case/xml/physicianhealthbc/physicianhealthbc.mysql
===================================================================
--- CRM/Case/xml/physicianhealthbc/physicianhealthbc.mysql	(revision 630)
+++ CRM/Case/xml/physicianhealthbc/physicianhealthbc.mysql	(working copy)
@@ -869,8 +869,8 @@
 DELETE FROM civicrm_email;
 DELETE FROM civicrm_phone;
 DELETE FROM civicrm_contact;
-INSERT INTO `civicrm_contact` (`id`, `contact_type`, `contact_sub_type`, `do_not_email`, `do_not_phone`, `do_not_mail`, `do_not_trade`, `is_opt_out`, `legal_identifier`, `external_identifier`, `sort_name`, `display_name`, `nick_name`, `legal_name`, `home_URL`, `image_URL`, `preferred_communication_method`, `preferred_mail_format`, `hash`, `api_key`, `source`, `first_name`, `middle_name`, `last_name`, `prefix_id`, `suffix_id`, `greeting_type_id`, `custom_greeting`, `job_title`, `gender_id`, `birth_date`, `is_deceased`, `deceased_date`, `mail_to_household_id`, `household_name`, `primary_contact_id`, `organization_name`, `sic_code`, `user_unique_id`, `employer_id`)
- VALUES (1, 'Organization',NULL,0,0,0,0,0,NULL,NULL,'Physician Health Program of BC','Physician Health Program of BC','PHP / PHPBC','Physician Health Program of British Columbia','http://www.physicianhealth.com',NULL,'','Both','09ff520e64dea7b4ce184471af4a0037',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,'Physician Health Program of BC',NULL,NULL,NULL);
+INSERT INTO `civicrm_contact` (`id`, `contact_type`, `contact_sub_type`, `do_not_email`, `do_not_phone`, `do_not_mail`, `do_not_trade`, `do_not_sms`, `is_opt_out`, `legal_identifier`, `external_identifier`, `sort_name`, `display_name`, `nick_name`, `legal_name`, `home_URL`, `image_URL`, `preferred_communication_method`, `preferred_mail_format`, `hash`, `api_key`, `source`, `first_name`, `middle_name`, `last_name`, `prefix_id`, `suffix_id`, `greeting_type_id`, `custom_greeting`, `job_title`, `gender_id`, `birth_date`, `is_deceased`, `deceased_date`, `mail_to_household_id`, `household_name`, `primary_contact_id`, `organization_name`, `sic_code`, `user_unique_id`, `employer_id`)
+ VALUES (1, 'Organization',NULL,0,0,0,0,0,0,NULL,NULL,'Physician Health Program of BC','Physician Health Program of BC','PHP / PHPBC','Physician Health Program of British Columbia','http://www.physicianhealth.com',NULL,'','Both','09ff520e64dea7b4ce184471af4a0037',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,'Physician Health Program of BC',NULL,NULL,NULL);
 INSERT INTO `civicrm_address` (`contact_id`, `location_type_id`, `is_primary`, `is_billing`, `street_address`, `street_number`, `street_number_suffix`, `street_number_predirectional`, `street_name`, `street_type`, `street_number_postdirectional`, `street_unit`, `supplemental_address_1`, `supplemental_address_2`, `supplemental_address_3`, `city`, `county_id`, `state_province_id`, `postal_code_suffix`, `postal_code`, `usps_adc`, `country_id`, `geo_code_1`, `geo_code_2`, `timezone`, `name`)
  VALUES (1,2,1,0,'980 - 1125 Howe St.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Vancouver',NULL,1101,NULL,'V6Z 2K8',NULL,1039,NULL,NULL,NULL,NULL);
 INSERT INTO `civicrm_email` (`contact_id`, `location_type_id`, `email`, `is_primary`, `is_billing`, `on_hold`, `is_bulkmail`, `hold_date`, `reset_date`)
Index: drupal/modules/views/civicrm.views.inc
===================================================================
--- drupal/modules/views/civicrm.views.inc	(revision 630)
+++ drupal/modules/views/civicrm.views.inc	(working copy)
@@ -411,7 +411,28 @@
                                                                      'handler' => 'views_handler_sort',
                                                                      ),
                                                      );
-  
+    //BOOLEAN : DO NOT SMS
+    $data['civicrm_contact']['do_not_sms'] = array(
+                                                     'title' => t('Do Not SMS'),
+                                                     'help' => t('Does this contact not want to receive SMS messages?'),
+                                                     'field' => array(
+                                                                      'handler' => 'views_handler_field_boolean',
+                                                                      'click sortable' => TRUE,
+                                                                      ),
+
+                                                     'argument' => array(
+                                                                         'handler' => 'views_handler_argument',
+                                                                         ),
+
+                                                     'filter' => array(
+                                                                       'handler' => 'views_handler_filter_boolean_operator',
+                                                                       ),
+
+                                                     'sort' => array(
+                                                                     'handler' => 'views_handler_sort',
+                                                                     ),
+                                                     );
+                                                     
     //BOOLEAN : Opted out of Bulk Mailing
     $data['civicrm_contact']['is_opt_out'] = array(
                                                    'title' => t('Opted Out of Bulk Mail'),
Index: sql/civicrm.mysql
===================================================================
--- sql/civicrm.mysql	(revision 630)
+++ sql/civicrm.mysql	(working copy)
@@ -740,6 +740,7 @@
      do_not_phone tinyint   DEFAULT 0 ,
      do_not_mail tinyint   DEFAULT 0 ,
      do_not_trade tinyint   DEFAULT 0 ,
+     do_not_sms tinyint   DEFAULT 0 ,
      is_opt_out tinyint NOT NULL  DEFAULT 0 COMMENT 'Has the contact opted out from receiving all bulk email from the organization or site domain?',
      legal_identifier varchar(32)    COMMENT 'May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID.',
      external_identifier varchar(32)    COMMENT 'Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.',
Index: sql/civicrm_sample.mysql
===================================================================
--- sql/civicrm_sample.mysql	(revision 630)
+++ sql/civicrm_sample.mysql	(working copy)
@@ -35,9 +35,9 @@
     (1, 'civicrm_contribution_page', 1, 2, 1, 1, 5, 'Create your own Personal Campaign Page!', 1);
 
 INSERT INTO civicrm_contact
-    (contact_type, contact_sub_type, legal_identifier, external_identifier, sort_name, display_name, nick_name, home_URL, image_URL, source, preferred_communication_method, preferred_mail_format, do_not_phone, do_not_email, do_not_mail, do_not_trade, hash, is_opt_out,organization_name)
+    (contact_type, contact_sub_type, legal_identifier, external_identifier, sort_name, display_name, nick_name, home_URL, image_URL, source, preferred_communication_method, preferred_mail_format, do_not_phone, do_not_email, do_not_mail, do_not_trade, do_not_sms, hash, is_opt_out,organization_name)
 VALUES
-    ('Organization',NULL,NULL,NULL,'Inner City Arts','Inner City Arts',NULL,NULL,NULL,NULL,'4','Both',0,0,0,0,'1902067651',0,'Inner City Arts');
+    ('Organization',NULL,NULL,NULL,'Inner City Arts','Inner City Arts',NULL,NULL,NULL,NULL,'4','Both',0,0,0,0,0,'1902067651',0,'Inner City Arts');
 
 INSERT INTO civicrm_membership_type
     (name, description, member_of_contact_id, contribution_type_id, minimum_fee, duration_unit, duration_interval, period_type, fixed_period_start_day, fixed_period_rollover_day, relationship_type_id, relationship_direction, visibility, weight, is_active)

