Ignore:
Timestamp:
Jan 19, 2013, 12:38:40 AM (12 years ago)
Author:
julien1311
Message:

[piwecard] 2.4.a.b4 version

Location:
extensions/Piwecard/admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/Piwecard/admin/admin_configuration.php

    r20229 r20254  
    1010        $configuration = array();
    1111
     12        $configuration['nb_max_recipients'] = $_POST['ecard_nb_max_recipients'];
     13       
     14        if (intval($configuration['nb_max_recipients']) == 0) {
     15                $configuration['nb_max_recipients'] = 1;
     16                $piwecard->config['nb_max_recipients'] = $configuration['nb_max_recipients'];
     17        } else {
     18                $piwecard->config['nb_max_recipients'] = intval($configuration['nb_max_recipients']);
     19        }
     20       
    1221        $configuration['validity'] = $_POST['ecard_validity_list'];
    1322        $configuration['validity'] = explode(',', $configuration['validity']);
     
    103112}
    104113
     114$template->assign('ecard_nb_max_recipients',((isset($configuration['nb_max_recipients'])) ? $configuration['nb_max_recipients'] : $piwecard->config['nb_max_recipients']));
     115
    105116if (isset($errors['validity'])) {
    106117        $piwecard->config['validity'] = null;
  • extensions/Piwecard/admin/template/admin_configuration.tpl

    r20229 r20254  
    7979
    8080function piwecard_checkForm(form) {
    81         var guestEmailOK = piwecard_checkField(form.ecard_default_guest_email, 1, true);
    82         var subjectOK = piwecard_checkField(form.ecard_email_subject, 0);
    83         var messageTextOK = piwecard_checkField(form.ecard_email_message_text, 0);
    84         var messageHTMLOK = piwecard_checkField(form.ecard_email_message_html, 0);
    85        
    86         if(guestEmailOK && subjectOK && messageTextOK && messageHTMLOK)
     81        var nbMaxRecipientsOK = piwecard_checkField(form.ecard_nb_max_recipients, 2, 'inline');
     82        var guestEmailOK = piwecard_checkField(form.ecard_default_guest_email, 1, 'block', true);
     83        var subjectOK = piwecard_checkField(form.ecard_email_subject, 0, 'block');
     84        var messageTextOK = piwecard_checkField(form.ecard_email_message_text, 0, 'block');
     85        var messageHTMLOK = piwecard_checkField(form.ecard_email_message_html, 0, 'block');
     86       
     87        if(nbMaxRecipientsOK && guestEmailOK && subjectOK && messageTextOK && messageHTMLOK)
    8788                return true;
    8889        else
     
    120121                        <legend>{'piwecard_configuration'|@translate}</legend>
    121122                        <div class="ecard_form_line">
     123                                <label for="ecard_nb_max_recipients">{'piwecard_nb_max_recipients'|@translate} </label>
     124                                <input type="text" maxlength="3" size="3" name="ecard_nb_max_recipients" id="ecard_nb_max_recipients" value="{$ecard_nb_max_recipients}" />
     125                                <span class="ecard_error" id="ecard_nb_max_recipients_error">{'piwecard_error'|@translate} {'piwecard_error_integer'|@translate}</span>
     126                        </div>
     127                        <div class="ecard_form_line">
    122128                                {'piwecard_validity_list'|@translate}
    123129                                <span class="ecard_error" id="ecard_validity_list_error" style="{$ecard_errors.validity.style_error_text}">{'piwecard_error'|@translate} {'piwecard_error_validity_list'|@translate}</span>
     
    179185                        </div>
    180186                </fieldset>
    181 
    182187                <fieldset>
    183188                        <legend>{'piwecard_email_configuration'|@translate}</legend>
     
    208213                        </div>
    209214                        <div class="ecard_form_line ecard_email_config">
    210                                 <label for="ecard_default_guest_email">{'piwecard_default_guest_email'|@translate}</label><span class="ecard_error" id="ecard_default_guest_email_error" style="{$ecard_errors.default_guest_email.style_error_text}">{'piwecard_error'|@translate} {'piwecard_error_email'|@translate}</span>
     215                                <label for="ecard_default_guest_email">{'piwecard_default_guest_email'|@translate}</label><span class="ecard_error" id="ecard_default_guest_email_error" style="{$ecard_errors.default_guest_email.style_error_text}"> {'piwecard_error'|@translate} {'piwecard_error_email'|@translate}</span>
    211216                                <input type="text" maxlength="50" name="ecard_default_guest_email" id="ecard_default_guest_email" {$ecard_errors.default_guest_email.style_error_input} value="{$ecard_default_guest_email}" onblur="piwecard_checkField(this, 1, true);" />
    212217                        </div>
    213218                        <div class="ecard_form_line ecard_email_config">
    214                                 <label for="ecard_email_subject">{'piwecard_email_subject'|@translate}*</label><span class="ecard_error" id="ecard_email_subject_error" style="{$ecard_errors.email_subject.style_error_text}">{'piwecard_error'|@translate} {'piwecard_error_text'|@translate}</span>
     219                                <label for="ecard_email_subject">{'piwecard_email_subject'|@translate}*</label><span class="ecard_error" id="ecard_email_subject_error" style="{$ecard_errors.email_subject.style_error_text}"> {'piwecard_error'|@translate} {'piwecard_error_text'|@translate}</span>
    215220                                <input type="text" maxlength="255" name="ecard_email_subject" id="ecard_email_subject" {$ecard_errors.email_subject.style_error_input} value="{$ecard_email_subject}" />
    216221                        </div>
    217222                        <div class="ecard_form_line ecard_email_config">
    218                                 <label for="ecard_email_message_text">{'piwecard_email_message_text'|@translate}*</label><span class="ecard_error" id="ecard_email_message_text_error" style="{$ecard_errors.email_message.text.style_error_text}">{'piwecard_error'|@translate} {'piwecard_error_text'|@translate}</span>
     223                                <label for="ecard_email_message_text">{'piwecard_email_message_text'|@translate}*</label><span class="ecard_error" id="ecard_email_message_text_error" style="{$ecard_errors.email_message.text.style_error_text}"> {'piwecard_error'|@translate} {'piwecard_error_text'|@translate}</span>
    219224                                <textarea name="ecard_email_message_text" id="ecard_email_message_text" {$ecard_errors.email_message.text.style_error_input}>{$ecard_email_message_text}</textarea>
    220225                        </div>
    221226                        <div class="ecard_form_line ecard_email_config">
    222                                 <label for="ecard_email_message_html">{'piwecard_email_message_html'|@translate}*</label><span class="ecard_error" id="ecard_email_message_html_error" style="{$ecard_errors.email_message.html.style_error_text}">{'piwecard_error'|@translate} {'piwecard_error_text'|@translate}</span>
     227                                <label for="ecard_email_message_html">{'piwecard_email_message_html'|@translate}*</label><span class="ecard_error" id="ecard_email_message_html_error" style="{$ecard_errors.email_message.html.style_error_text}"> {'piwecard_error'|@translate} {'piwecard_error_text'|@translate}</span>
    223228                                <textarea name="ecard_email_message_html" id="ecard_email_message_html" {$ecard_errors.email_message.html.style_error_input}>{$ecard_email_message_html}</textarea>
    224229                        </div>
  • extensions/Piwecard/admin/template/admin_management.tpl

    r20229 r20254  
    44{literal}
    55function piwecard_checkForm(form) {
    6         var nbPageOK = piwecard_checkField(form.ecard_nb_ecard_page, 2);
     6        var nbPageOK = piwecard_checkField(form.ecard_nb_ecard_page, 2, 'inline');
    77       
    88        if(nbPageOK)
Note: See TracChangeset for help on using the changeset viewer.