?>
</th>
    </tr>
    </thead>
    <tbody>
    <?php 
$c = 0;
foreach ($data_types as $data) {
    $data_type = $module->get_data_type($data['data_type_id']);
    ?>
        <tr class="<?php 
    echo $c++ % 2 ? "odd" : "even";
    ?>
">
            <td class="row_action"><a href="<?php 
    echo module_data::link_open_data_type($data_type['data_type_id']);
    ?>
"><?php 
    echo htmlspecialchars($data_type['data_type_name']);
    ?>
</a></td>
            <td><?php 
    echo isset($menu_locations[$data['data_type_menu']]) ? htmlspecialchars($menu_locations[$data['data_type_menu']]) : _l('N/A');
    ?>
</td>
            <td><a href="<?php 
    echo $module->link('admin_data', array('data_type_id' => $data_type['data_type_id'], 'view_all' => 1));
    ?>
"><?php 
    echo $data_type['count'];
    ?>
    $header_buttons = array();
    if (module_data::can_i('edit', _MODULE_DATA_NAME)) {
        $header_buttons[] = array('url' => $module->link_open_data_type($data_type['data_type_id']), 'title' => 'Settings');
    }
    if ($module->can_i('create', $data_type['data_type_name'])) {
        // todo: perms for each data type
        $header_buttons[] = array('url' => $module->link('', array('data_type_id' => $data_type['data_type_id'], 'data_record_id' => 'new', 'mode' => 'edit', 'parent_data_record_id' => isset($parent_data_record_id) ? $parent_data_record_id : false)), 'title' => "Create New " . htmlspecialchars($data_type['data_type_name']));
    }
    if ($allow_search) {
        $header_buttons[] = array('url' => $module->link("", array('search_form' => 1, 'data_type_id' => $data_type_id, 'view_all' => isset($_REQUEST['view_all']) ? 1 : false)), 'title' => "Search");
    }
    if (_DEMO_MODE) {
        ?>
        <div style="padding:20px; text-align: center">This is a demo of the new Custom Data Forms
            feature. <?php 
        if (module_data::can_i('edit', _MODULE_DATA_NAME)) {
            ?>
 Please feel free to change the <a
                    href="<?php 
            echo $module->link_open_data_type($data_type['data_type_id']);
            ?>
">Settings</a> for this Custom Data Form. <?php 
        }
        ?>
More details are <a
                href="http://ultimateclientmanager.com/support/documentation-wiki/custom-data-forms/" target="_blank">located
                here in the Documentation</a>.
        </div> <?php 
    }
    print_heading(array('main' => isset($parent_data_record_id) && $parent_data_record_id ? false : true, 'type' => 'h2', 'title' => get_display_mode() == 'iframe' ? '' : htmlspecialchars($data_type['data_type_name']), 'button' => $header_buttons));
    include 'admin_data_list_output.php';
Example #3
0
            echo _l('Email');
            ?>
</a>
            </li>
			<?php 
        }
        ?>
            <?php 
        if ($module->can_i('edit', _MODULE_DATA_NAME)) {
            ?>
            <li class="<?php 
            echo $mode == 'admin' ? 'link_current' : '';
            ?>
">
                <a href="<?php 
            echo module_data::link_open_data_type($data_type_id);
            ?>
"><?php 
            echo _l('Settings');
            ?>
</a>
            </li>
            <?php 
        }
        ?>
		<?php 
    } else {
        /*?>
                    <li class="<?php echo ($mode=='edit')?'link_current':'';?>">
                        <a href="<?php echo $module->link('',array(
                            'data_type_id' => $data_type_id,
<input type="hidden" name="_redirect" value="<?php 
echo $module->link("", array("saved" => true, "data_type_id" => (int) $data_type_id ? $data_type_id : ''));
?>
" />
<input type="hidden" name="data_type_id" value="<?php 
echo $data_type_id;
?>
" />

    <?php 
$templates = array();
foreach (module_template::get_templates() as $template) {
    $templates[$template['template_key']] = $template['template_key'] . ' (' . $template['description'] . ')';
}
$header_buttons = array();
$fieldset_data = array('heading' => array('main' => true, 'type' => 'h2', 'title' => 'Data Settings', 'button' => $header_buttons), 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array('name' => array('title' => _l('Name'), 'field' => array('type' => 'text', 'name' => 'data_type_name', 'value' => isset($data_type['data_type_name']) ? htmlspecialchars($data_type['data_type_name']) : '')), 'hook' => array('title' => _l('Display Location'), 'field' => array('type' => 'select', 'name' => 'data_type_menu', 'options' => module_data::get_menu_locations(), 'blank' => false, 'value' => isset($data_type['data_type_menu']) ? htmlspecialchars($data_type['data_type_menu']) : '', 'help' => 'This is where your custom data type will display within the system. Main will put it in the main menu. Customer will put it underneath a customer menu. None will hide this from the menu system all together')), 'icon' => array('title' => _l('Icon'), 'field' => array('type' => 'text', 'name' => 'data_type_icon', 'value' => isset($data_type['data_type_icon']) ? htmlspecialchars($data_type['data_type_icon']) : '', 'help' => 'Type the icon name from http://fontawesome.io/icons/ (eg: bell). Compatible with the Metis theme.')), 'max_entries' => array('title' => _l('Single or Multiple'), 'field' => array('type' => 'select', 'name' => 'max_entries', 'value' => isset($data_type['max_entries']) ? (int) $data_type['max_entries'] : 0, 'blank' => false, 'options' => array(0 => _l('Multiple Entries (default)'), 1 => _l('Single Entry Only')), 'help' => 'Here you can allow a single form entry or multiple entries. A single form entry can be used to record some information against a customer, the single entry will be displayed straight away instead of the list of multiple entries.')), 'print_pdf_template' => array('title' => _l('Allow PDF'), 'field' => array('type' => 'select', 'name' => 'print_pdf_template', 'value' => isset($data_type['print_pdf_template']) ? $data_type['print_pdf_template'] : '', 'options' => $templates, 'blank' => _l(' - disable Print to PDF - '), 'help' => 'These are all the available templates in the system. Create your own ( Settings > Templates ) and select it here. A Print PDF button will be available for each data record.')), 'email_template' => array('title' => _l('Allow Email'), 'field' => array('type' => 'select', 'name' => 'email_template', 'value' => isset($data_type['email_template']) ? $data_type['email_template'] : '', 'options' => $templates, 'blank' => _l(' - disable Email - '), 'help' => 'These are all the available templates in the system. Create your own ( Settings > Templates ) and select it here. An email button will be available for each data record.'))));
echo module_form::generate_fieldset($fieldset_data);
unset($fieldset_data);
$form_actions = array('class' => 'action_bar action_bar_center action_bar_single', 'elements' => array(array('type' => 'save_button', 'name' => 'butt_save', 'value' => _l('Save Settings')), array('type' => 'delete_button', 'name' => 'butt_del', 'value' => _l('Delete'), 'onclick' => "return confirm('Really delete?');"), array('type' => 'button', 'name' => 'cancel', 'value' => _l('Cancel'), 'class' => 'submit_button', 'onclick' => "window.location.href='" . $module->link() . "';")));
echo module_form::generate_form_actions($form_actions);
?>


<p>&nbsp;</p>
<?php 
if ($data_type_id && $data_type_id != 'new') {
    $data_field_groups = $module->get_data_field_groups($data_type_id);
    ob_start();
    ?>
	
	<table width="100%" border="0" cellspacing="0" cellpadding="2" class="tableclass tableclass_rows">