<th>
                            <?php 
    echo _l('Preview Image');
    ?>
                        </th>
                        <td>
                            <?php 
    if ($newsletter_template['directory'] && is_dir($newsletter_template['directory']) && is_file($newsletter_template['directory'] . 'preview.jpg')) {
        ?>
                                 <img src="<?php 
        echo full_link($newsletter_template['directory'] . 'preview.jpg');
        ?>
">
                                 <?php 
    } else {
        module_file::display_files(array('owner_table' => 'newsletter_template', 'owner_id' => $newsletter_template_id, 'layout' => 'gallery'));
    }
    ?>
                        </td>
                    </tr>
                    <?php 
    if ($newsletter_template['directory'] && is_dir($newsletter_template['directory'])) {
        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>
Ejemplo n.º 2
0
    }
    //print_heading($heading);
    $company_fields = array();
    $companys = module_company::get_companys();
    foreach ($companys as $company) {
        $company_fields[] = array('type' => 'hidden', 'name' => "available_vendor_company[" . $company['company_id'] . "]", 'value' => 1);
        $company_fields[] = array('type' => 'check', 'name' => "vendor_company[" . $company['company_id'] . "]", 'value' => $company['company_id'], 'checked' => isset($vendor['company_ids'][$company['company_id']]) || !$vendor_id && !module_company::can_i('edit', 'Company'), 'label' => htmlspecialchars($company['name']));
    }
    $fieldset_data = array('heading' => $heading, 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array('company' => array('title' => _l('Company'), 'fields' => $company_fields)));
    echo module_form::generate_fieldset($fieldset_data);
}
/** VENDOR INFORMATION **/
$fieldset_data = array('heading' => array('type' => 'h3', 'title' => $page_type_single . ' Information'), 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array('name' => array('title' => _l('Name'), 'field' => array('type' => 'text', 'name' => 'vendor_name', 'value' => $vendor['vendor_name']))), 'extra_settings' => array('owner_table' => 'vendor', 'owner_key' => 'vendor_id', 'owner_id' => $vendor_id, 'layout' => 'table_row', 'allow_new' => module_vendor::can_i('create', $page_type), 'allow_edit' => module_vendor::can_i('create', $page_type)));
if ($vendor_id && $vendor_id != 'new' && class_exists('module_file') && module_file::is_plugin_enabled()) {
    ob_start();
    module_file::display_files(array('owner_table' => 'vendor', 'owner_id' => $vendor_id, 'layout' => 'gallery', 'editable' => module_security::is_page_editable()));
    $fieldset_data['elements']['logo'] = array('title' => _l('Logo'), 'field' => ob_get_clean());
}
echo module_form::generate_fieldset($fieldset_data);
/** PRIMARY CONTACT DETAILS **/
// we use the "user" module to find the user details
// for the currently selected primary contact id
if ($vendor['primary_user_id']) {
    if (!module_user::can_i('view', 'All ' . $page_type_single . ' Contacts', 'Vendor', 'vendor') && $vendor['primary_user_id'] != module_security::get_loggedin_id()) {
        ob_start();
        echo '<div class="content_box_wheader"><table width="100%" border="0" cellspacing="0" cellpadding="2" class="tableclass tableclass_form"><tbody><tr><td>';
        _e('Details hidden');
        echo '</td></tr></tbody></table></div>';
        $fieldset_data = array('heading' => array('type' => 'h3', 'title' => 'Primary Contact Details'), 'class' => 'tableclass tableclass_form tableclass_full', 'elements_before' => ob_get_clean());
        if ($vendor['primary_user_id']) {
            $fieldset_data['heading']['button'] = array('title' => 'More', 'url' => module_user::link_open_contact($vendor['primary_user_id'], false));
Ejemplo n.º 3
0
                   </td>
               </tr>
           </tbody>
           </table>
       </div> */
    ?>
                                    
                                <?php 
    print_heading(array('type' => 'h3', 'title' => 'Attachments:', 'help' => 'Attachments will be sent out with emails. This will use a LOT of your bandwidth! (eg: a 1MB PDF sent to 1000 people = 1GB)'));
    ?>
                                <table width="100%" border="0" cellspacing="0" cellpadding="2" class="tableclass tableclass_form">
                                <tbody>
                                    <tr>
                                        <td>
                                            <?php 
    module_file::display_files(array('owner_table' => 'newsletter_files', 'owner_id' => $newsletter_id, 'layout' => 'list'));
    ?>
                                        </td>
                                    </tr>
                                </tbody>
                                </table>

                            <?php 
}
?>

                                <?php 
print_heading(array('type' => 'h3', 'title' => 'Dynamic Fields:', 'button' => array('url' => '#', 'onclick' => "\$('#dynamic_more').show(); return false;", 'title' => 'View All')));
?>
                                <table width="100%" border="0" cellspacing="0" cellpadding="2" class="tableclass tableclass_form tbl_fixed">
                                <tbody>
Ejemplo n.º 4
0
    $fieldset_data['elements'][] = array('title' => 'Linked Staff', 'fields' => array(function () use(&$finance, $locked, $linked_staff_members) {
        ?>
 <input type="hidden" name="job_staff_expense" value="<?php 
        echo isset($finance['job_staff_expense']) ? (int) $finance['job_staff_expense'] : '';
        ?>
">
                    <?php 
        echo print_select_box($linked_staff_members, 'user_id', isset($finance['user_id']) ? $finance['user_id'] : 0, '', _l(' - None - '));
        if (isset($finance['user_id']) && $finance['user_id']) {
            echo ' <a href="' . module_user::link_open($finance['user_id'], false) . '">' . _l('Open User') . '</a>';
        }
    }));
}
$fieldset_data['elements'][] = array('title' => 'Attachment', 'fields' => array(function () use(&$finance, $locked, $finance_id) {
    if ((int) $finance_id > 0) {
        module_file::display_files(array('owner_table' => 'finance', 'owner_id' => $finance_id, 'layout' => 'gallery', 'editable' => module_security::is_page_editable() && module_finance::can_i('edit', 'Finance')));
    } else {
        _e('Please press save first');
    }
}));
echo module_form::generate_fieldset($fieldset_data);
unset($fieldset_data);
$form_actions = array('class' => 'action_bar action_bar_left', 'elements' => array(array('type' => 'save_button', 'name' => 'butt_save_return', 'value' => _l('Save and Return')), array('type' => 'save_button', 'name' => 'butt_save', 'value' => _l('Save'))));
if ((int) $finance_recurring_id > 0 && isset($_SESSION['_finance_recurring_ids'])) {
    // find if there is a next recurring id
    $next = 0;
    foreach ($_SESSION['_finance_recurring_ids'] as $next_data) {
        if ($next == -1) {
            $next = 1;
            // done.
            $form_actions['elements'][] = array('type' => 'hidden', 'name' => 'recurring_next', 'id' => 'recurring_next', 'value' => '');