Example #1
0
    <script type="text/javascript">
        function do_sample(){
            $('#sample_download')[0].submit();
        }
    </script>
    <form action="" method="post" id="sample_download">
        <input type="hidden" name="download" value="true">
        <input type="hidden" name="import_options" value="<?php 
        echo htmlspecialchars($_REQUEST['import_options']);
        ?>
">
    </form>

    <p><?php 
        _e('Please make sure your data is in the below format. The <strong>first line</strong> of your CSV file should be the column headers as below. You can <a href="%s">click here</a> to download a sample CSV template ready for import. Please use UTF8 file format. %s', 'javascript:do_sample();', _hr('Please try to save your import CSV file in UTF8 format for best results (search google for a howto). Once your import CSV file is ready to upload please use the form below. (Please ensure this is a CSV file, not an excel file.)<br> We recommend <a href="http://www.libreoffice.org/download/" target="_blank">LibreOffice</a> for best CSV file generation.'));
        ?>
</p>


    <div style="overflow-x: auto; overflow-y: hidden;">
    <table class="tableclass tableclass_rows">
        <thead>
        <tr>
            <?php 
        foreach ($import_options['fields'] as $key => $val) {
            if (!is_array($val)) {
                $val = array($val);
            }
            $display_name = $val[0];
            ?>
Example #2
0
                                $license_codes[] = '';
                            }
                            hook_handle_callback('layout_column_half', 1);
                            if (class_exists('module_backup', false) && module_config::c('backup_time', 0) < time() - 43300 && module_backup::can_i('create', 'Backups')) {
                                $form_actions = array('class' => 'action_bar action_bar_center action_bar_single', 'elements' => array(array('type' => 'save_button', 'name' => 'butt_create_backup', 'value' => _l('Create a Backup'), 'onclick' => "window.location.href='" . module_backup::link_open(false) . "'; return false;")));
                                $fieldset_data = array('heading' => array('title' => 'Backup', 'type' => 'h3'), 'elements' => array(array('message' => _l('The last backup was made: %s', !module_config::c('backup_time', 0) ? _l('Never') : print_date(module_config::c('backup_time', 0), true))), array('message' => _l('Would you like to create a Backup before Upgrading?'))), 'elements_after' => module_form::generate_form_actions($form_actions));
                                echo module_form::generate_fieldset($fieldset_data);
                                unset($fieldset_data);
                            }
                            ?>

    <form action="" method="post">
        <?php 
                            module_form::print_form_auth();
                            $form_actions = array('class' => 'action_bar action_bar_center action_bar_single', 'elements' => array(array('type' => 'save_button', 'name' => 'check_upgrade', 'value' => _l('Check for Upgrades')), array('type' => 'submit', 'name' => 'run_upgrade', 'value' => _l('Run Manual Upgrades'))));
                            $fieldset_data = array('heading' => array('title' => 'Upgrade', 'type' => 'h3'), 'elements' => array(array('message' => _l('Please insert your license code(s) below to receive upgrades and new features.') . ' ' . _hr('Your license code can be found from your CodeCanyon downloads page. <a href="%s">Click here</a> for help.', 'http://dtbaker.net/admin/includes/plugin_envato/images/envato-license-code.gif')), array('field' => array('type' => 'hidden', 'name' => 'save_license_codes', 'value' => 'yes')), array('title' => _l('License Codes'), 'fields' => array(function () use($license_codes) {
                                ?>
		                    <div id="license_codes_holder">
		                        <?php 
                                foreach ($license_codes as $license_code) {
                                    ?>
		                        <div class="dynamic_block">

		                            <input type="text" name="license_codes[]" value="<?php 
                                    echo htmlspecialchars($license_code);
                                    ?>
" style="width:400px; padding:5px; border:1px solid #CCC;">

		                            <a href="#" class="add_addit" onclick="return seladd(this);">+</a>
		                            <a href="#" class="remove_addit" onclick="return selrem(this);">-</a>
		                            <?php 
        if (is_file($newsletter_template['directory'] . 'render.php')) {
            $description = 'N/A';
            $contents = file_get_contents($newsletter_template['directory'] . 'render.php');
            if (preg_match('#Description:(.*)#i', $contents, $matches)) {
                $description = htmlspecialchars($matches[1]);
            }
            ?>
                                <tr>
                                    <th>
                                        <?php 
            _e('Custom Rendering');
            ?>
                                    </th>
                                    <td>
                                        <?php 
            _e('Controlled by file: <em>%s</em> %s<br/>Description: <em>%s</em> ', $newsletter_template['directory'] . 'render.php', _hr('You can expand on the default functionality of the newsletter rendering system by editing this custom PHP file. You can include custom PHP calls to databases to output your own HTML for sending. Pretty nifty!'), $description);
            ?>
                                    </td>
                                </tr>
                            <?php 
        }
    }
    ?>
                    <?php 
}
?>
                </tbody>
            </table>
        </td>
    </tr>
    </tbody>
Example #4
0
                </div> &nbsp;
	<?php 
    $header_cats = ob_get_clean();
    $header_rows[] = array('sort_date' => array('data' => '<input type="text" name="transaction_date" class="date_field" value="' . print_date(time()) . '"> '), 'sort_name' => array('data' => '<input type="text" name="name" id="new_transaction_name">'), 'finance_description' => array('data' => '<input type="text" name="description">'), 'finance_customer' => array('data' => ''), 'sort_credit' => array('data' => currency('') . '<input type="text" name="credit" class="currency">', 'cell_class' => 'success_text'), 'sort_debit' => array('data' => currency('') . '<input type="text" name="debit" class="currency">', 'cell_class' => 'error_text'), 'sort_account' => array('data' => print_select_box(module_finance::get_accounts(), 'finance_account_id', '', '', true, 'name', true)), 'finance_categories' => array('data' => $header_cats), 'finance_tick' => array('data' => '<input type="submit" name="addnew" value="' . _l('Quick Add') . '" class="small_button">'));
    $table_manager->set_header_rows($header_rows);
}
$table_manager->set_rows($recent_transactions);
if (module_config::c('finance_list_show_totals', 1)) {
    $footer_rows = array();
    foreach ($finance_credit_total + $finance_debit_total as $currency_id => $foo) {
        $currency = get_single('currency', 'currency_id', $currency_id);
        $footer_rows[] = array('sort_date' => array('data' => ' ', 'cell_colspan' => 3), 'finance_customer' => array('data' => '<strong>' . _l('%s Totals:', $currency && isset($currency['code']) ? $currency['code'] : '') . '</strong>', 'cell_class' => 'text-right'), 'sort_credit' => array('data' => '<strong>' . dollar(isset($finance_credit_total[$currency_id]) ? $finance_credit_total[$currency_id] : 0, true, $currency_id) . '</strong>'), 'sort_debit' => array('data' => '<strong>' . dollar(isset($finance_debit_total[$currency_id]) ? $finance_debit_total[$currency_id] : 0, true, $currency_id) . '</strong>'), 'sort_account' => array('data' => ' ', 'cell_colspan' => 4));
    }
    $footer_rows[] = array('sort_date' => array('data' => ' ', 'cell_colspan' => 8), 'finance_tick' => array('data' => '<input type="button" name="link" value="' . _l('Link') . '" class="small_button" onclick="$(\'#link_go\').val(\'go\'); $(\'#quick_add_form\')[0].submit();">
						<input type="hidden" name="link_go" value="0" id="link_go">
                        ' . _hr('Combine transactions together. eg: an invoice payment history with corresponding bank statement transaction. Transactions need to be the same dollar amount to link successfully.'), 'cell_colspan' => 4));
    $table_manager->set_footer_rows($footer_rows);
}
$table_manager->pagination = true;
$table_manager->print_table();
?>

</form>
<?php 
if ($show_excluded_payment_info) {
    ?>

	<p>
		<?php 
    _e('* credits do not count towards totals');
    ?>
        $customer_data = module_customer::get_customer($user[$use_master_key]);
        if ($customer_data['primary_user_id'] == $user_id) {
            $primary = true;
        }
    } else {
        if ($use_master_key == 'vendor_id') {
            $vendor_data = module_vendor::get_vendor($user[$use_master_key]);
            if ($vendor_data['primary_user_id'] == $user_id) {
                $primary = true;
            }
        }
    }
    if ($primary && !isset($hide_more_button)) {
        $fieldset_data['heading']['button'] = array('title' => 'More', 'url' => module_user::link_open_contact($user_id, false));
    }
    $fieldset_data['elements']['primary'] = array('title' => 'Primary', 'fields' => array(array('type' => 'check', 'name' => 'customer_primary', 'value' => '1', 'checked' => $primary), _hr('This users details will be used as a primary point of contact for this customer. These details will display in the main customer listing for this customer. Also if you send an invoice or a newsletter to this "customer" then this email address will be used.')));
} else {
    if (isset($show_more_button) && $show_more_button) {
        $fieldset_data['heading']['button'] = array('title' => 'More', 'url' => module_user::link_open_contact($user_id, false));
    }
}
$fieldset_data['elements']['fname'] = array('title' => 'First Name', 'fields' => array(array('type' => 'text', 'name' => 'name', 'value' => $user['name'])));
$fieldset_data['elements']['last_name'] = array('title' => 'Last Name', 'fields' => array(array('type' => 'text', 'name' => 'last_name', 'value' => $user['last_name'])));
$fieldset_data['elements']['email'] = array('title' => 'Email Address', 'fields' => array(array('type' => 'text', 'name' => 'email', 'value' => $user['email'])));
$fieldset_data['elements']['phone'] = array('title' => 'Phone', 'fields' => array(array('type' => 'text', 'name' => 'phone', 'value' => $user['phone'])));
$fieldset_data['elements']['mobile'] = array('title' => 'Mobile', 'fields' => array(array('type' => 'text', 'name' => 'mobile', 'value' => $user['mobile'])));
$fieldset_data['elements']['fax'] = array('title' => 'Fax', 'fields' => array(array('type' => 'text', 'name' => 'fax', 'value' => $user['fax'])));
if (class_exists('module_language', false) && isset($user['language'])) {
    $attr = array();
    foreach (module_language::get_languages_attributes() as $langauge) {
        $attr[$langauge['language_code']] = $langauge['language_name'];
module_form::set_required(array('fields' => array('subject' => 'Subject', 'start' => 'Start Date', 'end' => 'End Date')));
$customer_list = array();
$customers = module_customer::get_customers();
foreach ($customers as $customer) {
    $customer_list[$customer['customer_id']] = $customer['customer_name'];
}
$staff_members = module_user::get_staff_members();
$staff_member_rel = array();
foreach ($staff_members as $staff_member) {
    $staff_member_rel[$staff_member['user_id']] = $staff_member['name'];
}
if (!isset($calendar['staff_ids']) || !is_array($calendar['staff_ids']) || !count($calendar['staff_ids'])) {
    $calendar['staff_ids'] = array(false);
}
// output our event information using the standard UCM form processor:
$fieldset_data = array('heading' => false, 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array(array('title' => _l('Subject'), 'fields' => array('<div id="calendarcolor" style="float:right"></div><input id="colorvalue" name="color" type="hidden" value="' . (isset($calendar['color']) ? htmlspecialchars($calendar['color']) : '') . '" />', array('type' => 'text', 'name' => "subject", 'value' => isset($calendar['subject']) ? $calendar['subject'] : ''))), array('title' => _l('Start'), 'fields' => array(array('type' => 'date', 'name' => "start", 'value' => isset($calendar['start']) ? print_date($calendar['start']) : ''), '<span class="calendar_time">@</span>', array('type' => 'time', 'name' => "start_time", 'value' => isset($calendar['start']) ? date('g:ia', $calendar['start']) : '', 'class' => 'calendar_time'), array('type' => 'check', 'id' => "is_all_day", 'value' => 1, 'name' => "is_all_day", 'checked' => isset($calendar['is_all_day']) && $calendar['is_all_day'] ? true : false, 'label' => _l('All Day Event')))), array('title' => _l('End'), 'fields' => array(array('type' => 'date', 'name' => "end", 'value' => isset($calendar['end']) ? print_date($calendar['end']) : ''), '<span class="calendar_time">@</span>', array('type' => 'time', 'name' => "end_time", 'value' => isset($calendar['end']) ? date('g:ia', $calendar['end']) : '', 'class' => 'calendar_time'))), array('title' => _l('Customer'), 'fields' => array(array('type' => 'select', 'name' => 'customer_id', 'options' => $customer_list, 'value' => isset($calendar['customer_id']) ? $calendar['customer_id'] : 0), isset($calendar['customer_id']) && $calendar['customer_id'] ? '<a href="' . module_customer::link_open($calendar['customer_id'], false) . '" target="_blank">' . _l('Open') . '</a>' : '')), array('title' => module_config::c('customer_staff_name', 'Staff'), 'fields' => array('<div id="staff_ids_holder" style="float:left;">', array('type' => 'select', 'name' => 'staff_ids[]', 'options' => $staff_member_rel, 'multiple' => 'staff_ids_holder', 'values' => $calendar['staff_ids']), '</div>', _hr('Assign a staff member to this calendar event. Click the plus sign to add more staff members.'))), array('title' => _l('Description'), 'field' => array('type' => 'textarea', 'name' => "description", 'value' => isset($calendar['description']) ? $calendar['description'] : ''))));
echo module_form::generate_fieldset($fieldset_data);
/*
$form_actions = array(
    'class' => 'action_bar action_bar_center',
    'elements' => array(
        array(
            'type' => 'save_button',
            'name' => 'butt_save',
            'value' => _l('Save'),
        ),
        array(
            'ignore' => !(module_calendar::can_i('delete','Calendar') && $calendar_id > 0),
            'type' => 'delete_button',
            'name' => 'butt_del',
            'value' => _l('Delete'),
" <?php 
            echo $enabled ? 'checked' : '';
            ?>
>
	                            <label for="paymethodallowed<?php 
            echo $x;
            ?>
"><?php 
            echo $payment_method->get_payment_method_name();
            ?>
</label> <br/>
	                            <?php 
            $x++;
        }
    }
})), array('title' => _l('Trial Period') . ' (only for PayPal)', 'fields' => array(_l('Adjust price by:'), array('type' => 'currency', 'name' => 'settings[trial_price_adjust]', 'value' => isset($subscription['settings']) && isset($subscription['settings']['trial_price_adjust']) ? $subscription['settings']['trial_price_adjust'] : 0, 'size' => 4), _hr('If you would like to give a $10 discount for the first subscription invoice then enter -10 into here. '))), array('title' => _l('Invoice PDF Template'), 'fields' => array(array('type' => 'select', 'name' => 'settings[invoice_template_print]', 'value' => isset($subscription['settings']) && isset($subscription['settings']['invoice_template_print']) ? $subscription['settings']['invoice_template_print'] : '', 'options' => $invoice_template_print, 'help' => 'Choose the default template for PDF printing and PDF emailing. Name your custom template invoice_print_SOMETHING for them to appear in this listing. Replace SOMETHING with a word of your choice. You can also create a different template to be sent for the first subscription, name it invoice_print_SOMETHING_1 '))), array('title' => _l('Invoice Email Template'), 'fields' => array(array('type' => 'select', 'name' => 'settings[invoice_template_email]', 'value' => isset($subscription['settings']) && isset($subscription['settings']['invoice_template_email']) ? $subscription['settings']['invoice_template_email'] : '', 'options' => $invoice_template_email, 'help' => 'Choose the default template for emailing these subscription invoices to customers. You must create 3 new custom templates. Name your custom templates invoice_email_SOMETHING_due, invoice_email_SOMETHING_overdue and invoice_email_SOMETHING_paid for them to appear in this listing. Replace SOMETHING with a word of your choice. You can also create a different template to be sent for the first subscription, name it invoice_email_SOMETHING_due_1 ')))));
echo module_form::generate_fieldset($fieldset_data);
$form_actions = array('elements' => array(array('type' => 'save_button', 'name' => 'butt_save', 'value' => _l('Save')), array('ignore' => (int) $subscription_id == 0, 'type' => 'delete_button', 'name' => 'butt_del', 'value' => _l('Delete')), array('type' => 'button', 'name' => 'cancel', 'value' => _l('Cancel'), 'class' => 'submit_button', 'onclick' => "window.location.href='" . $module->link_open(false) . "';")));
echo module_form::generate_form_actions($form_actions);
?>


</form>

<?php 
hook_handle_callback('layout_column_half', 2);
?>


<?php 
if ((int) $subscription_id > 0) {
Example #8
0
             if ($job['discount_amount'] > 0) {
                 //if(($discounts_allowed || $job['discount_amount']>0) &&  (!($job_locked && module_security::is_page_editable()) || $job['discount_amount']>0)){
                 $rows[] = array('label' => htmlspecialchars(_l($job['discount_description'])), 'value' => '<span class="currency">' . dollar($job['discount_amount'], true, $job['currency_id']) . '</span>');
             }
         }
     }
     // any fees?
     if (isset($job['fees']) && count($job['fees'])) {
         foreach ($job['fees'] as $fee) {
             $rows[] = array('label' => $fee['description'], 'value' => '<span class="currency">' . dollar($fee['total'], true, $job['currency_id']) . '</span>');
         }
     }
     $rows[] = array('label' => _l('Total:'), 'value' => '<span class="currency" style="text-decoration: underline; font-weight: bold;">' . dollar($job['total_amount'], true, $job['currency_id']) . '</span>');
     if ($job['staff_total_amount'] > 0) {
         $rows[] = array('label' => _l('Staff Expense:'), 'value' => '<span class="currency" style="text-decoration: underline; font-weight: bold;">' . dollar($job['staff_total_amount'], true, $job['currency_id']) . '</span>');
         $rows[] = array('label' => _l('Net Total:'), 'value' => '<span class="currency" style="text-decoration: underline; font-weight: bold;">' . dollar($job['total_net_amount'], true, $job['currency_id']) . '</span>', 'extra' => _hr('This is after any staff expenses are taken away.'));
     }
 }
 /*<tr>
         <td>
 
         </td>
         <td>
             <?php echo ($job['invoice_discount_amount']>0) ? _l('Sub Total:') : _l('Total:');?>
         </td>
         <td>
             <span class="currency" style="text-decoration: underline; font-weight: bold;">
                 <?php echo dollar($job['total_amount'],true,$job['currency_id']);?>
             </span>
         </td>
         <td colspan="2">
Example #9
0
        module_note::display_notes(array('title' => 'Quote Notes', 'owner_table' => 'quote', 'owner_id' => $quote_id, 'view_link' => module_quote::link_open($quote_id)));
    }
    if (class_exists('module_quote', false) && module_quote::is_plugin_enabled()) {
        if (module_quote::can_i('edit', 'Quotes')) {
            module_email::display_emails(array('title' => 'Quote Emails', 'search' => array('quote_id' => $quote_id)));
        }
    }
    if (class_exists('module_group', false) && module_group::is_plugin_enabled()) {
        module_group::display_groups(array('title' => 'Quote Groups', 'owner_table' => 'quote', 'owner_id' => $quote_id, 'view_link' => $module->link_open($quote_id)));
    }
}
if (module_quote::can_i('view', 'Quote Advanced')) {
    /***** QUOTE ADVANCED *****/
    $fieldset_data = array('id' => 'quote_advanced', 'heading' => array('type' => 'h3', 'title' => 'Advanced'), 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array());
    if ((int) $quote_id > 0 && module_quote::can_i('edit', 'Quotes')) {
        $fieldset_data['elements'][] = array('title' => 'Customer Link', 'fields' => array('<a href="' . module_quote::link_public($quote_id) . '" target="_blank">' . _l('Click to view external link') . '</a>', _hr('You can send this link to the customer and they can view progress on their quote. They can also view a list of any invoices attached to this quote. This is VERY useful to stop customers asking you "how far along are you" with a quote because they can see exactly where you have logged up to in the system.')));
        $fieldset_data['elements'][] = array('title' => 'Email Staff', 'fields' => array(function () use(&$quote_tasks, $quote_id) {
            $allocated_staff_members = array();
            foreach ($quote_tasks as $quote_task) {
                if (!isset($allocated_staff_members[$quote_task['user_id']])) {
                    $allocated_staff_members[$quote_task['user_id']] = 0;
                }
                $allocated_staff_members[$quote_task['user_id']]++;
            }
            foreach ($allocated_staff_members as $staff_id => $count) {
                $staff = module_user::get_user($staff_id);
                ?>

						    <a href="<?php 
                echo module_quote::link_generate($quote_id, array('arguments' => array('email_staff' => 1, 'staff_id' => $staff_id)));
                ?>
        ?>
</td>
                <td>
                    <input type="password" name="password_new2" value="" />
                    <?php 
        _h('Please confirm your new password here a second time.');
        ?>
                </td>
            </tr>
        </table>
        <?php 
        $fieldset_data['elements']['password'] = array('title' => _l('Change Password'), 'fields' => array(ob_get_clean()));
    }
}
if ((module_user::can_i('view', 'Users Passwords', 'Config') && $user_id == module_security::get_loggedin_id() || module_user::can_i('edit', 'Users Passwords', 'Config')) && (int) $user_id > 0 && $user_id != "new") {
    $fieldset_data['elements']['auto'] = array('title' => _l('Auto Login Link'), 'fields' => array('<a href="' . module_security::generate_auto_login_link($user_id) . '">' . _l('right click - copy link') . '</a> ', _hr('If you give this link to a user (or bookmark it for yourself) then it will log in automatically. To re-set an auto-login link simply change your password to something new.')));
}
if (!module_security::can_user_login($user_id)) {
    $fieldset_data['elements']['warninglogin'] = array('warning' => _l('(note: this user does not have login permissions yet - login will not work)'));
}
echo module_form::generate_fieldset($fieldset_data);
// todo - hook in here for a user configuration area
// modules can load configuration variables in here.
// hmm, is this the same as user roles. i guess it is, we'll just use user roles for now.
?>

    <?php 
/*if(module_user::can_i('edit','Fine Tune Permissions','Config')){

                $user_permissions = module_security::get_user_permissions($user_id);
                if($user_id && !$current_role){
}
if ($social_facebook_id && !$social_facebook_message_id && module_social::can_i('create', 'Facebook Comments', 'Social', 'social')) {
    $facebook = new ucm_facebook_account($social_facebook_id);
    if ($social_facebook_id && $facebook->get('social_facebook_id') == $social_facebook_id) {
        $module->page_title = $facebook->get('facebook_name');
        /* @var $pages ucm_facebook_page[] */
        $pages = $facebook->get('pages');
        //print_r($pages);
        ?>
	    <form action="" method="post" enctype="multipart/form-data">
		    <input type="hidden" name="_process" value="send_facebook_message">
		    <?php 
        module_form::print_form_auth();
        ?>
		    <?php 
        $fieldset_data = array('heading' => isset($_REQUEST['display_mode']) && $_REQUEST['display_mode'] == 'ajax' ? false : array('type' => 'h3', 'title' => 'Compose Message'), 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array('facebook_page' => array('title' => _l('Facebook Page'), 'fields' => array()), 'message' => array('title' => _l('Message'), 'field' => array('type' => 'textarea', 'name' => 'message', 'id' => 'facebook_compose_message', 'value' => '')), 'type' => array('title' => _l('Type'), 'fields' => array('<input type="radio" name="post_type" id="post_type_wall" value="wall" checked> ', '<label for="post_type_wall">', _l('Wall Post'), '</label>', '<input type="radio" name="post_type" id="post_type_link" value="link"> ', '<label for="post_type_link">', _l('Link Post'), '</label>', '<input type="radio" name="post_type" id="post_type_picture" value="picture"> ', '<label for="post_type_picture">', _l('Picture Post'), '</label>')), 'link' => array('title' => _l('Link'), 'fields' => array(array('type' => 'text', 'name' => 'link', 'id' => 'message_link_url', 'value' => ''), '<div id="facebook_link_loading_message"></div>', '<span class="facebook-type-link facebook-type-option"></span>')), 'link_picture' => array('title' => _l('Link Picture'), 'fields' => array(array('type' => 'text', 'name' => 'link_picture', 'value' => ''), _hr('Full URL (eg: http://) to the picture to use for this link preview'), '<span class="facebook-type-link facebook-type-option"></span>')), 'link_name' => array('title' => _l('Link Title'), 'fields' => array(array('type' => 'text', 'name' => 'link_name', 'value' => ''), _hr('Title to use instead of the automatically generated one from the Link page'), '<span class="facebook-type-link facebook-type-option"></span>')), 'link_caption' => array('title' => _l('Link Caption'), 'fields' => array(array('type' => 'text', 'name' => 'link_caption', 'value' => ''), _hr('Caption to use instead of the automatically generated one from the Link page'), '<span class="facebook-type-link facebook-type-option"></span>')), 'link_description' => array('title' => _l('Link Description'), 'fields' => array(array('type' => 'text', 'name' => 'link_description', 'value' => ''), _hr('Description to use instead of the automatically generated one from the Link page'), '<span class="facebook-type-link facebook-type-option"></span>')), 'picture' => array('title' => _l('Picture'), 'fields' => array('<input type="file" name="picture" value="">', '<span class="facebook-type-picture facebook-type-option"></span>')), 'schedule' => array('title' => _l('Schedule'), 'fields' => array(array('type' => 'date', 'name' => 'schedule_date', 'value' => ''), array('type' => 'time', 'name' => 'schedule_time', 'value' => ''), ' ', _l('Currently: %s', date('c')), _hr('Leave blank to send now. Pick a date in the future to send this message.'))), 'debug' => array('title' => _l('Debug'), 'field' => array('type' => 'check', 'name' => 'debug', 'value' => '1', 'checked' => false, 'help' => 'Show debug output while posting the message'))));
        foreach ($pages as $facebook_page_id => $page) {
            $fieldset_data['elements']['facebook_page']['fields'][] = '<div id="facebook_compose_page_select">' . '<input type="checkbox" name="compose_page_id[' . $facebook_page_id . ']" value="1" checked> ' . '<img src="http://graph.facebook.com/' . $facebook_page_id . '/picture"> ' . htmlspecialchars($page->get('page_name')) . '</div>';
        }
        echo module_form::generate_fieldset($fieldset_data);
        $form_actions = array('class' => 'action_bar action_bar_center', 'elements' => array());
        echo module_form::generate_form_actions($form_actions);
        $form_actions['elements'][] = array('type' => 'save_button', 'name' => 'butt_save', 'value' => _l('Send'));
        // always show a cancel button
        /*$form_actions['elements'][] = array(
        		    'type' => 'button',
        		    'name' => 'cancel',
        		    'value' => _l('Cancel'),
        		    'class' => 'submit_button',
        		    'onclick' => "window.location.href='".$module->link_open_message_view($social_facebook_id)."';",
        		);*/
Example #12
0
<?php

/** 
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
$script = '<script type="text/javascript" language="javascript" src="' . full_link('includes/plugin_change_request/js/public.js') . '"></script>' . "\n";
$script .= '<script type="text/javascript" language="javascript"> dtbaker_public_change_request.init("' . module_change_request::link_script($website_id) . '"); </script>';
$change_history = module_change_request::get_remaining_changes($website_id);
$fieldset_data = array('heading' => array('type' => 'h3', 'title' => _l('Change Request Settings')), 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array('enable' => array('title' => _l('Enable Changes'), 'field' => array('type' => 'select', 'options' => get_yes_no(), 'name' => 'change_request[enabled]', 'value' => isset($change_request_website['enabled']) ? $change_request_website['enabled'] : '0', 'help' => 'Allow change requests. This SUPER COOL feature allows your customer to highlight something on their website and request a change. The "change request" will come through here and you can invoice for that change.'))));
if (isset($change_request_website['enabled']) && $change_request_website['enabled']) {
    $fieldset_data['elements']['code'] = array('title' => _l('Website Code'), 'fields' => array('<small>' . nl2br(htmlspecialchars($script)) . '</small>', _hr('Add this code to EVERY PAGE of your customers website (eg: Same as Google Analytics or in WordPress theme footer.php file). Make sure this is loaded AFTER jQuery is loaded. (Advanced users can copy this public.js file to clients website to improve load times). <br><br> Or paste this code into the browser console for testing: <br><br>%s', htmlspecialchars("var s = document.createElement('script'); s.src='" . full_link('includes/plugin_change_request/js/public.js') . "';  s.onload = function() { dtbaker_public_change_request.inject_js('" . full_link('includes/plugin_change_request/fancybox/jquery.fancybox-1.3.4.js') . "');\n            dtbaker_public_change_request.inject_css('" . full_link('includes/plugin_change_request/fancybox/jquery.fancybox-1.3.4.css') . "',dtbaker_public_change_request.init('" . module_change_request::link_script($website_id) . "')); }; (document.head||document.documentElement).appendChild(s);"))));
    $fieldset_data['elements']['limit'] = array('title' => _l('Customer Limit'), 'fields' => array(array('type' => 'text', 'name' => 'change_request[limit_number]', 'value' => isset($change_request_website['limit_number']) ? $change_request_website['limit_number'] : 5, 'size' => 4), array('type' => 'select', 'name' => 'change_request[limit_per]', 'value' => isset($change_request_website['limit_per']) ? $change_request_website['limit_per'] : 0, 'options' => array('1' => _l('Week'), '2' => _l('Month'), '3' => _l('Year'), '0' => _l('All Time'))), _hr('You can limit your customer to a certain number of change requests (eg: if you are charging them a monthly maintenance fee)'), '<br/> ', _l('<strong>%s</strong> of %s changes remaining', max(0, $change_history[1] - $change_history[0]), $change_history[1])));
    $fieldset_data['elements']['link'] = array('title' => _l('Request Link'), 'fields' => array('<a href="' . module_change_request::link_public($website_id) . '" target="_blank">' . _l('Request Change Link') . '</a> ', _hr('This is the special link you can email to your customer. Using this link the customer can request a change on their website.')));
}
echo module_form::generate_fieldset($fieldset_data);