<commit_before><?php

class CRM_Symbioticux_Contribute_Form_Contribution_Main {
  function buildForm(&$form) {
    // Preview & demo sites should encourage to use a test CC number
    // otherwise users do not know what CC to use, and sometimes use their own.
    if (CRM_Utils_Array::value('action', $_REQUEST) == 'preview' || $GLOBALS['symbioticux_demo']) {
      CRM_Core_Region::instance('page-body')->add(array(
        'template' => 'CRM/Symbioticux/Contribute/Form/Contribution/Main.billing-explain.tpl',
      ));
      CRM_Core_Region::instance('page-body')->add(array(
        'template' => 'CRM/Symbioticux/Contribute/Form/Contribution/Main.validate.tpl',
      ));

      $js = "cj('#credit_card_number').click(function(event) {
               if (! cj(this).val()) {<commit_msg>Contribution forms: rename billing labels.<commit_after><?php

class CRM_Symbioticux_Contribute_Form_Contribution_Main {
  function buildForm(&$form) {
    // Change the label on the "name" fields, and make mandatory
    // (they are mandatory for CC transactions, but not shown as such in the form by default
    // because of the 'pay later' option)
    $fields = array('billing_first_name' => ts('First Name'), 'billing_last_name' => ts('Last Name'), 'billing_individual_prefix' => ts('Title'));

    foreach ($fields as $field => $title) {
      if ($form->elementExists($field)) {
        $e =& $form->getElement($field);
        $e->setLabel($title);
        $form->addRule($field, ts('%1 is a required field.', array(1 => $title)), 'required');
      }
    }

    $fields = array('billing_street_address-5', 'billing_city-5', 'billing_country_id-5', 'billing_state_province_id-5', 'billing_postal_code-5');

    foreach ($fields as $field) {
      if ($form->elementExists($field)) {
        $e =& $form->getElement($field);
        $title = $e->getLabel();
        $form->addRule($field, ts('%1 is a required field.', array(1 => $title)), 'required');
      }
    }


    // Preview & demo sites should encourage to use a test CC number
    // otherwise users do not know what CC to use, and sometimes use their own.
    if (CRM_Utils_Array::value('action', $_REQUEST) == 'preview' || $GLOBALS['symbioticux_demo']) {
      CRM_Core_Region::instance('page-body')->add(array(
        'template' => 'CRM/Symbioticux/Contribute/Form/Contribution/Main.billing-explain.tpl',
      ));
      CRM_Core_Region::instance('page-body')->add(array(
        'template' => 'CRM/Symbioticux/Contribute/Form/Contribution/Main.validate.tpl',
      ));

      $js = "cj('#credit_card_number').click(function(event) {
               if (! cj(this).val()) {
{'fraction_non_alphanumeric': 0.16129032258064516, 'fraction_numerical': 0.003415559772296015, 'mean_word_length': 3.600349040139616, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '250784', 'n_tokens_mistral': 846, 'n_tokens_neox': 828, 'n_words': 179}