Example #1
0
addField('comment', 'textarea', __('Comment'));
addField('infoscreen_txt', 'text', __('Text on infoscreen'), __('This text will be on the infoscreens in the reception if the booking is between 16:00 and 06:00. Please check that the playlist on the infosystem is running.'));
addField('empty', '', '');
addField('submit2', 'submit', __('Save entry'));
addField('empty', '', '');
addField('invoice', 'radio', __('Invoice'), __('Choose yes if invoice should be made from this entry.'));
addField('invoice_ref_your', 'text', __('Your reference'), __('The customers internal reference.'));
addField('invoice_comment', 'textarea', 'Fakturakommentar', __('Comment that is displayed in the top of the invoice.'));
addField('invoice_internal_comment', 'textarea', 'Intern fakturakommentar', __('Internal comment on the invoice (not shown to the customer).'));
addField('invoice_electronic', 'radio', __('E-delivery'), __('Choose yes if the customer want to have the invoice delivery by e-mail.'));
// Address
//addField ('invoice_address_id',			'select',				_('Address'),				_('Choose a address from the customer. This will be the address that the invoice will be sent to.'));
//addID ('invoice_address_id', 'invoice_address_id');
addField('invoice_address', 'textarea', __('Address'), __('Choose a address from the customer. This will be the address that the invoice will be sent to. To change the addresses please press the edit button for the customer.'));
addID('invoice_address', 'invoice_address');
disableField('invoice_address');
addAfterField('invoice_address', '<br>' . '<input size="1" type="text" name="invoice_address_id2" disabled="disabled" id="invoice_address_id2">' . '<input type="button" value="Velg/endre adresse" onclick="chooseAddress(\'invoice_address_id\', \'invoice_address\'); return false;">' . '');
addField('invoice_address_id', 'hidden', '');
addID('invoice_address_id', 'invoice_address_id');
addField('invoice_email', 'text', __('E-mail'), __('E-mail that the customer wants the invoice delivery to.'));
addField('invoice_content', 'invoice_content', __('Content'));
addField('empty', '', '');
addField('submit3', 'submit', __('Save entry'));
function addOnchange($var, $value)
{
    global $entry_fields;
    $entry_fields[$var]['onchange'] = $value;
}
function addValue($var, $value)
{
    global $entry_fields;
Example #2
0
    addValue('program_id', $entry['program_id']);
    addValue('program_description', $entry['program_description']);
    addValue('service_alco', $entry['service_alco']);
    addValue('service_description', $entry['service_description']);
    addValue('comment', $entry['comment']);
    addValue('infoscreen_txt', $entry['infoscreen_txt']);
    // Disabled of invoice_status is 2, 3 or 4
    if (!$entry_add && ($entry['invoice_status'] == 2 || $entry['invoice_status'] == 3 || $entry['invoice_status'] == 4)) {
        disableField('invoice');
        disableField('invoice_electronic');
        disableField('invoice_email');
        disableField('invoice_comment');
        disableField('invoice_internal_comment');
        disableField('invoice_ref_your');
        disableField('invoice_address_id');
        disableField('invoice_content');
        addAfterField('invoice_address', '<br>' . '<input size="1" type="text" name="invoice_address_id2" disabled="disabled" id="invoice_address_id2">' . '<input type="button" value="' . _('Choose address') . '" disabled="disabled" onclick="chooseAddress(\'invoice_address_id\', \'invoice_address\'); return false;">' . '<input type="button" value="' . _('Edit customer/address') . '" disabled="disabled" onclick="new_customer(); return false;">');
    }
    addValue('invoice', $entry['invoice']);
    addValue('invoice_electronic', $entry['invoice_electronic']);
    addValue('invoice_email', $entry['invoice_email']);
    addValue('invoice_comment', $entry['invoice_comment']);
    addValue('invoice_internal_comment', $entry['invoice_internal_comment']);
    addValue('invoice_ref_your', $entry['invoice_ref_your']);
    addValue('invoice_address_id', $entry['invoice_address_id']);
    addValueArray('invoice_content', $entry['invoice_content']);
} else {
    // Some default values
    $time_end_after_start = 60 * 60 * 2;
    addValueArray('invoice', '0');
    // Invoice = no