예제 #1
0
$roles = array();
foreach (module_security::get_roles() as $r) {
    $roles[$r['security_role_id']] = $r['name'];
}
ob_start();
$invoice_templates = array();
$invoice_templates['customer_signup_thank_you_page'] = 1;
$invoice_templates['customer_signup_email_welcome'] = 1;
$invoice_templates['customer_signup_email_admin'] = 1;
$invoice_templates['customer_signup_form_wrapper'] = 1;
foreach ($invoice_templates as $template_key => $tf) {
    module_template::link_open_popup($template_key);
}
$template_html = ob_get_clean();
module_config::print_settings_form(array(array('key' => 'customer_signup_allowed', 'default' => 0, 'type' => 'select', 'options' => array(0 => _l('Not allowed'), 1 => _l('Allowed')), 'description' => 'Enable customer signup form'), array('key' => 'customer_signup_always_new', 'default' => 0, 'type' => 'select', 'options' => array(0 => _l('Allow Update of Existing Customer Entries'), 1 => _l('Always Create New Customer Entries')), 'description' => 'Matching email address action', 'help' => 'If a customer fills in this form and the email address already exists in the system then it can update the existing entry instead of creating a new customer entry. If updating existing entry then the new customer name will be applied, which could differ from existing company name. Set this option to "Always Create New Customer Entry" if you do not want a customer to be able to update their existing details.'), array('key' => 'customer_signup_password', 'default' => 0, 'type' => 'select', 'options' => array(0 => _l('No Password, Admin creates password for each new account (most secure option)'), 1 => _l('Allow Primary User to pick a Password on Signup')), 'description' => 'User Passwords', 'help' => 'If a user has a password they can login to the system and see all their details.'), array('key' => 'customer_signup_role', 'default' => 0, 'type' => 'select', 'options' => $roles, 'description' => 'User Role', 'help' => 'Assign this User Role to all newly created contacts.'), array('key' => 'captcha_on_signup_form', 'default' => 0, 'type' => 'select', 'options' => array(0 => _l('No'), 1 => _l('Yes')), 'description' => 'Use CAPTCHA on signup form'), array('key' => 'customer_signup_redirect', 'default' => '', 'type' => 'text', 'description' => 'Redirect URL', 'help' => 'If no redirect URL is set then the standard thank you message will be displayed. This can be changed in Settings > Templates > customer_signup_thank_you_page'), array('key' => 'customer_signup_admin_email', 'default' => module_config::c('admin_email_address'), 'type' => 'text', 'description' => 'What email address will signup notifications be sent to'), array('key' => 'customer_signup_contact_count', 'default' => 1, 'type' => 'text', 'description' => 'Number of customer contacts'), array('key' => 'customer_signup_password', 'default' => 0, 'type' => 'select', 'options' => array(0 => _l('No'), 1 => _l('Yes')), 'description' => 'Ask for Password'), array('key' => 'customer_signup_on_login', 'default' => 0, 'type' => 'select', 'options' => array(0 => _l('No'), 1 => _l('Yes')), 'description' => 'Show Signup Link on Login Page'), array('key' => 'customer_signup_on_login_url', 'default' => '', 'type' => 'text', 'description' => 'Signup Page URL', 'help' => 'If you have placed the signup form on a page of your website, put that website URL here (e.g. http://www.yourwebsite.com/signup.html)'), array('key' => 'customer_signup_subscription_start', 'default' => '', 'type' => 'text', 'description' => 'Subscription Start Date Modification', 'help' => 'How much to modify the subscription start date by (if they choose a Subscription during signup). Examples are: +5 days or +2 weeks'), array('type' => 'html', 'description' => 'Templates', 'html' => $template_html)));
$form_html = module_customer::get_customer_signup_form_html();
?>



<table width="100%">
    <tbody>
    <tr>
        <td valign="top" width="50%">
            <?php 
echo $form_html;
?>
        </td>
        <td valign="top">
            <p>
                On the left is an example signup form - your customers can complete this form to input their details directly into your system - handy! <br> You can copy &amp; paste the HTML code onto your website.