It's possible to add T&C to the contact module/form?
In Italy we need this, it's legally required.

Andrea

Comments

mandreato’s picture

Version: 5.x-1.9 » 7.x-1.x-dev

@tignux, did you ever solved this ?
I'm wondering if is it possible to have T&C on contact page too.
Thanks In Advance !

mandreato’s picture

I finally was able to put T&C on the contact page:

  • setup T&C text on /admin/config/people/legal
  • created a new view which shows "Legal terms and conditions" (use a block display)
    • fields:
      • Legal: Terms & Conditions (Terms & Conditions)
    • sort:
      • Legal: Version (desc)
      • Legal: Revision (desc)
    • pager: Display a specified number of items | 1 item
  • changed the contact page by using a panel variant
  • on the contact page layout added the T&C view block

Now T&C is shown on the contact page, but there are three problems:
1) cannot place T&C after the message box but before the send message button
2) no Accept T&C check box is shown
3) cannot change display style: if I change it on admin/config/people/legal, it is not reflected on view

warmth’s picture

Thanks for the info but I think this should be supported by defaul!

warmth’s picture

Normally I don't like to hack modules so I just opened and copied the alter form part of the user register and created a new module to alter the contact form:

/**
* Implements hook_form_contact_site_form_alter().
* This function will add a phone number field to the site-wide contact form,
* by implementing hook_form_FORM_ID_alter().
*/
function YOURMODULENAME_form_contact_site_form_alter(&$form, &$form_state) {
  global $user;
  global $language;

  $conditions = legal_get_conditions($language->language);

  // Do nothing if there's no Terms and Conditions text set.
  if (empty($conditions['conditions'])) {
    return;
  }

  $form = array_merge($form, legal_display_fields($conditions));

  // Disable checkbox if:
  //  - user is already registered (administer users);
  //  - users with 'administer users' can access registration on admin/user/user/create.
  if (!empty($user->uid)) {
    $form['legal']['legal_accept']['#attributes'] = array('disabled' => 'disabled');
    $form['legal']['legal_accept']['#required'] = FALSE;

    if (is_array($conditions['extras'])) {
      foreach ($conditions['extras'] as $key => $label) {
        if (!empty($label)) {
          $form['legal'][$key]['#attributes'] = array('disabled' => 'disabled');
          $form['legal'][$key]['#required'] = FALSE;
        }
      } 
    }
  }

  return theme('legal_display', array('form' => $form));
}
new123456789’s picture

Any updates on this?
Can the legal module be ingegrated with Webforms?
I'd like the T&C to be displayed ABOVE the webform...