$user_temp = module_user::get_user($invoice['user_id'], false);
        $c[$invoice['user_id']] = $user_temp['name'] . ' ' . $user_temp['last_name'] . ' ' . _l('(under different customer)');
    }
    echo print_select_box($c, 'user_id', $invoice['user_id']);
    ?>

                                </td>
                            </tr>
                            <?php 
}
?>


						</tbody>
                        <?php 
module_extra::display_extras(array('owner_table' => 'invoice', 'owner_key' => 'invoice_id', 'owner_id' => $invoice['invoice_id'], 'layout' => 'table_row', 'allow_new' => module_job::can_i('create', 'Invoices'), 'allow_edit' => module_job::can_i('create', 'Invoices')));
?>

					</table>

                    
                    <?php 
if ((int) $invoice_id > 0) {
    ?>


                        <?php 
    hook_handle_callback('invoice_sidebar', $invoice_id);
    ?>

Esempio n. 2
0
function metris_generate_fieldset($callback, $options)
{
    $defaults = array('id' => false, 'type' => 'table', 'title' => false, 'title_type' => 'h5', 'heading' => false, 'row_title_class' => 'width1', 'row_data_class' => '', 'elements' => array(), 'class' => 'tableclass tableclass_form', 'extra_settings' => array(), 'elements_before' => '', 'elements_after' => '');
    $options = array_merge($defaults, $options);
    if (function_exists('hook_filter_var')) {
        $options = hook_filter_var('generate_fieldset_options', $options);
    }
    ob_start();
    ?>

    <div class="box <?php 
    echo isset($options['heading']['responsive']) ? ' box-responsive' : '';
    ?>
">
        <header>
            <?php 
    if ($options['heading']) {
        if (!isset($options['heading']['type']) || $options['heading']['type'] != 'h5') {
            $options['heading']['type'] = 'h5';
        }
        print_heading($options['heading']);
    } else {
        if ($options['title']) {
            ?>
                <<?php 
            echo $options['title_type'];
            ?>
><?php 
            _e($options['title']);
            ?>
</<?php 
            echo $options['title_type'];
            ?>
>
            <?php 
        }
    }
    ?>
        </header>
        <!-- .block -->
        <div class="body">
            <?php 
    echo $options['elements_before'];
    ?>
            <?php 
    if ($options['elements']) {
        ?>
            <table class="<?php 
        echo $options['class'];
        ?>
">
                <tbody>
                <?php 
        foreach ($options['elements'] as $element) {
            if (isset($element['ignore']) && $element['ignore']) {
                continue;
            }
            if (isset($element['field']) && !isset($element['fields'])) {
                $element['fields'] = array($element['field']);
                unset($element['field']);
            }
            ?>
                    <tr>
                        <?php 
            if (isset($element['message']) && $element['message'] || isset($element['warning']) && isset($element['warning'])) {
                ?>
                            <th colspan="2" style="text-align:center">
                                <?php 
                if (isset($element['message'])) {
                    ?>
                                    <?php 
                    echo $element['message'];
                    ?>
                                <?php 
                } else {
                    if (isset($element['warning'])) {
                        ?>
                                    <span class="error_text"><?php 
                        echo $element['warning'];
                        ?>
</span>
                                <?php 
                    }
                }
                ?>

                            </th>
                        <?php 
            } else {
                ?>
                        <?php 
                if (isset($element['title'])) {
                    ?>
                            <th class="<?php 
                    echo isset($element['row_title_class']) ? $element['row_title_class'] : $options['row_title_class'];
                    ?>
">
                                <?php 
                    echo htmlspecialchars(_l($element['title']));
                    ?>
                            </th>
                            <?php 
                }
                if (isset($element['fields'])) {
                    ?>
                            <td class="<?php 
                    echo isset($element['row_data_class']) ? $element['row_data_class'] : $options['row_data_class'];
                    ?>
">
                                <?php 
                    if (is_array($element['fields'])) {
                        foreach ($element['fields'] as $dataid => $field) {
                            if (is_array($field)) {
                                // treat this as a call to the form generate option
                                module_form::generate_form_element($field);
                                echo ' ';
                            } else {
                                if (is_closure($field)) {
                                    $field();
                                } else {
                                    echo $field . ' ';
                                }
                            }
                        }
                    } else {
                        echo $element['fields'];
                    }
                    ?>
                            </td>
                        <?php 
                }
                ?>
                    </tr>
                    <?php 
            }
        }
        if (class_exists('module_extra') && module_extra::is_plugin_enabled() && $options['extra_settings']) {
            module_extra::display_extras($options['extra_settings']);
        }
        ?>
                </tbody>
            </table>
            <?php 
    }
    echo $options['elements_after'];
    ?>
        </div>
        <!-- /.block -->
    </div>


    <?php 
    return ob_get_clean();
}
Esempio n. 3
0
    public static function generate_fieldset($options)
    {
        // let the themes override this search bar function.
        $result = hook_handle_callback('generate_fieldset', $options);
        if (is_array($result)) {
            // has been handed by a theme.
            return current($result);
        }
        $defaults = array('id' => false, 'type' => 'table', 'title' => false, 'title_type' => 'h3', 'heading' => false, 'row_title_class' => 'width1', 'row_data_class' => '', 'elements' => array(), 'class' => 'tableclass tableclass_form', 'extra_settings' => array(), 'elements_before' => '', 'elements_after' => '');
        $options = array_merge($defaults, $options);
        if (function_exists('hook_filter_var')) {
            $options = hook_filter_var('generate_fieldset_options', $options);
        }
        //todo - hook in here for themes.
        ob_start();
        if ($options['heading']) {
            print_heading($options['heading']);
        } else {
            if ($options['title']) {
                ?>

            <<?php 
                echo $options['title_type'];
                ?>
><?php 
                _e($options['title']);
                ?>
</<?php 
                echo $options['title_type'];
                ?>
>
        <?php 
            }
        }
        ?>

        <?php 
        echo $options['elements_before'];
        ?>

        <?php 
        if ($options['elements']) {
            ?>

        <table class="<?php 
            echo $options['class'];
            ?>
">
            <tbody>
            <?php 
            foreach ($options['elements'] as $element) {
                if (isset($element['ignore']) && $element['ignore']) {
                    continue;
                }
                if (isset($element['field']) && !isset($element['fields'])) {
                    $element['fields'] = array($element['field']);
                    unset($element['field']);
                }
                ?>

                <tr>
                    <?php 
                if (isset($element['message']) && $element['message'] || isset($element['warning']) && isset($element['warning'])) {
                    ?>

                        <td colspan="2" align="center">
                            <?php 
                    if (isset($element['message'])) {
                        ?>

                                <?php 
                        echo $element['message'];
                        ?>

                            <?php 
                    } else {
                        if (isset($element['warning'])) {
                            ?>

                                <span class="error_text"><?php 
                            echo $element['warning'];
                            ?>
</span>
                            <?php 
                        }
                    }
                    ?>


                        </td>
                    <?php 
                } else {
                    ?>

                        <?php 
                    if (isset($element['title'])) {
                        ?>

                        <th class="<?php 
                        echo isset($element['row_title_class']) ? $element['row_title_class'] : $options['row_title_class'];
                        ?>
">
                            <?php 
                        echo htmlspecialchars(_l($element['title']));
                        ?>

                        </th>
                        <?php 
                    }
                    if (isset($element['fields'])) {
                        ?>

                        <td class="<?php 
                        echo isset($element['row_data_class']) ? $element['row_data_class'] : $options['row_data_class'];
                        ?>
">
                            <?php 
                        if (is_array($element['fields'])) {
                            foreach ($element['fields'] as $dataid => $field) {
                                if (is_array($field)) {
                                    // treat this as a call to the form generate option
                                    self::generate_form_element($field);
                                    echo ' ';
                                } else {
                                    if (is_closure($field)) {
                                        $field();
                                    } else {
                                        echo $field . ' ';
                                    }
                                }
                            }
                        } else {
                            echo $element['fields'];
                        }
                        ?>

                        </td>
                    <?php 
                    }
                    ?>

                </tr>
                <?php 
                }
            }
            if (class_exists('module_extra') && module_extra::is_plugin_enabled() && $options['extra_settings']) {
                module_extra::display_extras($options['extra_settings']);
            }
            ?>

            </tbody>
        </table>
        <?php 
        }
        echo $options['elements_after'];
        ?>

        <?php 
        return ob_get_clean();
    }
Esempio n. 4
0
function adminlte_generate_fieldset($callback, $options)
{
    $defaults = array('id' => false, 'type' => 'table', 'title' => false, 'title_type' => 'h3', 'heading' => false, 'row_title_class' => 'width1', 'row_data_class' => '', 'elements' => array(), 'class' => 'tableclass tableclass_form', 'extra_settings' => array(), 'elements_before' => '', 'elements_after' => '');
    $options = array_merge($defaults, $options);
    if (function_exists('hook_filter_var')) {
        $options = hook_filter_var('generate_fieldset_options', $options);
    }
    ob_start();
    ?>

    <div class="box <?php 
    echo module_theme::get_config('adminlte_boxstyle', 'box-solid');
    echo isset($options['heading']['responsive']) ? ' box-responsive' : '';
    ?>
">
        <div class="box-header">
            <?php 
    if ($options['heading']) {
        if (!isset($options['heading']['type']) || $options['heading']['type'] != 'h3') {
            $options['heading']['type'] = 'h3';
        }
        $options['heading']['class'] = 'box-title';
        print_heading($options['heading']);
    } else {
        if ($options['title']) {
            ?>
                <<?php 
            echo $options['title_type'];
            ?>
 class="box-title"><?php 
            _e($options['title']);
            ?>
</<?php 
            echo $options['title_type'];
            ?>
>
            <?php 
        }
    }
    ?>
        </div>
        <!-- .block -->
        <div class="box-body">
            <?php 
    echo $options['elements_before'];
    ?>
            <?php 
    if ($options['elements']) {
        if (module_theme::get_config('adminlte_formstyle', 'table') == 'table') {
            ?>
                    <table class="<?php 
            echo $options['class'];
            ?>
">
                        <tbody>
                        <?php 
            foreach ($options['elements'] as $element) {
                if (isset($element['ignore']) && $element['ignore']) {
                    continue;
                }
                if (isset($element['field']) && !isset($element['fields'])) {
                    $element['fields'] = array($element['field']);
                    unset($element['field']);
                }
                ?>
                            <tr>
                                <?php 
                if (isset($element['message']) && $element['message'] || isset($element['warning']) && isset($element['warning'])) {
                    ?>
                                    <th colspan="2" class="text-center">
                                        <?php 
                    if (isset($element['message'])) {
                        ?>
                                            <?php 
                        echo $element['message'];
                        ?>
                                        <?php 
                    } else {
                        if (isset($element['warning'])) {
                            ?>
                                            <span class="error_text"><?php 
                            echo $element['warning'];
                            ?>
</span>
                                        <?php 
                        }
                    }
                    ?>
                                    </th>
                                <?php 
                } else {
                    ?>
                                    <th class="<?php 
                    echo isset($element['row_title_class']) ? $element['row_title_class'] : $options['row_title_class'];
                    ?>
">
                                        <?php 
                    if (isset($element['title'])) {
                        ?>
                                            <?php 
                        echo htmlspecialchars(_l($element['title']));
                        ?>
                                        <?php 
                    }
                    ?>
                                    </th>
                                    <td class="<?php 
                    echo isset($element['row_data_class']) ? $element['row_data_class'] : $options['row_data_class'];
                    ?>
">
                                    <?php 
                    if (isset($element['fields'])) {
                        ?>
                                        <?php 
                        if (is_array($element['fields'])) {
                            foreach ($element['fields'] as $dataid => $field) {
                                if (is_array($field)) {
                                    // treat this as a call to the form generate option
                                    module_form::generate_form_element($field);
                                    echo ' ';
                                } else {
                                    if (is_closure($field)) {
                                        $field();
                                    } else {
                                        echo $field . ' ';
                                    }
                                }
                            }
                        } else {
                            echo $element['fields'];
                        }
                        ?>
                                    <?php 
                    }
                    // fields
                    ?>
                                    </td> <!-- /.input-group -->
                                <?php 
                }
                //else
                ?>
                            </tr> <!-- /.form-group -->
                        <?php 
            }
            if (class_exists('module_extra') && module_extra::is_plugin_enabled() && $options['extra_settings']) {
                module_extra::display_extras($options['extra_settings']);
            }
            ?>
                        </tbody>
                        </table> <!-- /.elements -->
                    <?php 
            // end table layout
        } else {
            if (module_theme::get_config('adminlte_formstyle', 'table') == 'div') {
                ?>
                    <div class="<?php 
                echo $options['class'];
                ?>
">
                        <?php 
                foreach ($options['elements'] as $element) {
                    if (isset($element['ignore']) && $element['ignore']) {
                        continue;
                    }
                    if (isset($element['field']) && !isset($element['fields'])) {
                        $element['fields'] = array($element['field']);
                        unset($element['field']);
                    }
                    ?>
                            <div class="form-group">
                                <?php 
                    if (isset($element['message']) && $element['message'] || isset($element['warning']) && isset($element['warning'])) {
                        ?>
                                    <div class="text-center">
                                        <?php 
                        if (isset($element['message'])) {
                            ?>
                                            <?php 
                            echo $element['message'];
                            ?>
                                        <?php 
                        } else {
                            if (isset($element['warning'])) {
                                ?>
                                            <span class="error_text"><?php 
                                echo $element['warning'];
                                ?>
</span>
                                        <?php 
                            }
                        }
                        ?>
                                    </div>
                                <?php 
                    } else {
                        ?>
                                    <div class="input-group<?php 
                        echo !isset($element['title']) ? '-notitle' : '';
                        ?>
">
                                    <?php 
                        if (isset($element['title'])) {
                            ?>
                                        <span class="input-group-addon table-row-title"><span class="<?php 
                            echo isset($element['row_title_class']) ? $element['row_title_class'] : $options['row_title_class'];
                            ?>
"><?php 
                            echo htmlspecialchars(_l($element['title']));
                            ?>
</span></span>
                                    <?php 
                        }
                        if (isset($element['fields'])) {
                            ?>

                                        <?php 
                            if (is_array($element['fields'])) {
                                // if there is only one element we put it up in the form-control so that it displays nicely.
                                // if there are more than one elements we wrap them in a div form-control.
                                $do_wrap = true;
                                if (count($element['fields']) == 1) {
                                    $field = current($element['fields']);
                                    if (is_array($field) && $field['type'] != 'wysiwyg' && $field['type'] != 'check' && $field['type'] != 'checkbox') {
                                        $do_wrap = false;
                                        $currency = false;
                                        if ($field['type'] == 'currency') {
                                            $field['type'] = 'text';
                                            $currency = true;
                                            //$field['class'] = (isset($field['class']) ? $field['class'] : '') .' currency ';
                                        }
                                        $field['class'] = (isset($field['class']) ? $field['class'] : '') . ' form-control ' . (isset($element['row_data_class']) ? $element['row_data_class'] : $options['row_data_class']);
                                        $help_text = false;
                                        if (isset($field['help'])) {
                                            // we put the help element outside in its own <span class="input-group-addon"></span>
                                            // don't let the generatE_form_element produce it.
                                            $help_text = $field['help'];
                                            unset($field['help']);
                                        }
                                        module_form::generate_form_element($field);
                                        if ($currency) {
                                            ?>
		                                                <span class="input-group-addon"><?php 
                                            echo currency('', true, isset($field['currency_id']) ? $field['currency_id'] : false);
                                            ?>
</span>
		                                                <?php 
                                        }
                                        if ($help_text) {
                                            ?>
		                                                <span class="input-group-addon"><?php 
                                            _h($help_text);
                                            ?>
</span>
		                                                <?php 
                                        }
                                    }
                                }
                                if ($do_wrap) {
                                    ?>
 <div class="form-control<?php 
                                    echo !isset($element['title']) ? '-notitle' : '';
                                    ?>
 <?php 
                                    echo isset($element['row_data_class']) ? $element['row_data_class'] : $options['row_data_class'];
                                    ?>
"> <?php 
                                    $help_text = false;
                                    foreach ($element['fields'] as $dataid => $field) {
                                        if (is_array($field) && isset($field['help'])) {
                                            // this element has a help text.
                                            if ($help_text) {
                                                // already a help text (shouldn't happen, ditch it.. and display multiple as normal)
                                                $help_text = false;
                                                break;
                                            } else {
                                                $help_text = $field['help'];
                                            }
                                        }
                                    }
                                    foreach ($element['fields'] as $dataid => $field) {
                                        if (is_array($field)) {
                                            if (isset($field['help']) && $help_text) {
                                                unset($field['help']);
                                            }
                                            // treat this as a call to the form generate option
                                            module_form::generate_form_element($field);
                                            echo ' ';
                                        } else {
                                            if (is_closure($field)) {
                                                $field();
                                            } else {
                                                echo $field . ' ';
                                            }
                                        }
                                    }
                                    ?>
 </div> <?php 
                                    if ($help_text) {
                                        ?>
	                                                <span class="input-group-addon"><?php 
                                        _h($help_text);
                                        ?>
</span>
	                                                <?php 
                                    }
                                }
                            } else {
                                ?>
 <div class="form-control <?php 
                                echo isset($element['row_data_class']) ? $element['row_data_class'] : $options['row_data_class'];
                                ?>
"> <?php 
                                echo $element['fields'];
                                ?>
 </div> <?php 
                            }
                            ?>
                                    <?php 
                        }
                        // fields
                        ?>
                                    </div> <!-- /.input-group -->
                                <?php 
                    }
                    //else
                    ?>
                            </div> <!-- /.form-group -->
                        <?php 
                }
                if (class_exists('module_extra') && module_extra::is_plugin_enabled() && $options['extra_settings']) {
                    module_extra::display_extras($options['extra_settings']);
                }
                ?>
                        </div> <!-- /.elements -->
                    <?php 
            } else {
                if (module_theme::get_config('adminlte_formstyle', 'table') == 'long') {
                    ?>
                    <div class="<?php 
                    echo $options['class'];
                    ?>
">
                        <?php 
                    foreach ($options['elements'] as $element) {
                        if (isset($element['ignore']) && $element['ignore']) {
                            continue;
                        }
                        if (isset($element['field']) && !isset($element['fields'])) {
                            $element['fields'] = array($element['field']);
                            unset($element['field']);
                        }
                        ?>
                            <div class="form-group form-group-long">
                                <?php 
                        if (isset($element['message']) && $element['message'] || isset($element['warning']) && isset($element['warning'])) {
                            ?>
                                    <div class="text-center">
                                        <?php 
                            if (isset($element['message'])) {
                                ?>
                                            <?php 
                                echo $element['message'];
                                ?>
                                        <?php 
                            } else {
                                if (isset($element['warning'])) {
                                    ?>
                                            <span class="error_text"><?php 
                                    echo $element['warning'];
                                    ?>
</span>
                                        <?php 
                                }
                            }
                            ?>
                                    </div>
                                <?php 
                        } else {
                            ?>

                                    <?php 
                            if (isset($element['title'])) {
                                ?>
                                        <label class="<?php 
                                echo isset($element['row_title_class']) ? $element['row_title_class'] : $options['row_title_class'];
                                ?>
"><?php 
                                echo htmlspecialchars(_l($element['title']));
                                ?>
</label>
                                    <?php 
                            }
                            if (isset($element['fields'])) {
                                ?>

                                        <?php 
                                if (is_array($element['fields'])) {
                                    foreach ($element['fields'] as $dataid => $field) {
                                        if (is_array($field)) {
                                            // treat this as a call to the form generate option
                                            $field['class'] = (isset($field['class']) ? $field['class'] : '') . ' ' . (isset($element['row_data_class']) ? $element['row_data_class'] : $options['row_data_class']);
                                            switch ($field['type']) {
                                                case 'check':
                                                case 'checkbox':
                                                case 'wysiwyg':
                                                    break;
                                                default:
                                                    $field['class'] .= ' form-control ';
                                            }
                                            module_form::generate_form_element($field);
                                            echo ' ';
                                        } else {
                                            if (is_closure($field)) {
                                                $field();
                                            } else {
                                                echo $field . ' ';
                                            }
                                        }
                                    }
                                } else {
                                    ?>
 <div class="form-control <?php 
                                    echo isset($element['row_data_class']) ? $element['row_data_class'] : $options['row_data_class'];
                                    ?>
"> <?php 
                                    echo $element['fields'];
                                    ?>
 </div> <?php 
                                }
                                ?>
                                    <?php 
                            }
                            // fields
                            ?>
                                <?php 
                        }
                        //else
                        ?>
                            </div> <!-- /.form-group -->
                        <?php 
                    }
                    if (class_exists('module_extra') && module_extra::is_plugin_enabled() && $options['extra_settings']) {
                        module_extra::display_extras($options['extra_settings']);
                    }
                    ?>
                        </div> <!-- /.elements -->
                    <?php 
                }
            }
        }
        // end div layout
    }
    echo $options['elements_after'];
    ?>
        <!-- /.block -->
        </div>
    </div>


    <?php 
    return ob_get_clean();
}
Esempio n. 5
0
                                    </th>
                                    <td>
                                        <?php 
    echo print_select_box($priorities, 'priority', $ticket['priority'], '', false);
    ?>

                                    </td>
                                </tr>
                            <?php 
}
?>

						</tbody>
                        <?php 
if (isset($ticket['ticket_id']) && $ticket['ticket_id'] && module_ticket::can_edit_tickets()) {
    module_extra::display_extras(array('owner_table' => 'ticket', 'owner_key' => 'ticket_id', 'owner_id' => $ticket['ticket_id'], 'layout' => 'table_row'));
}
?>

					</table>


                    <?php 
if ($ticket['user_id']) {
    $other_tickets = module_ticket::get_tickets(array('user_id' => $ticket['user_id']));
    if (mysql_num_rows($other_tickets) > 1) {
        ?>

                        <h3><?php 
        _e('%s Other Support Tickets', mysql_num_rows($other_tickets));
        ?>
Esempio n. 6
0
                                    <a href="<?php 
    echo module_file::link_generate('new', array('arguments' => array('job_id' => $job['job_id'])));
    ?>
"><?php 
    _e('Add New File');
    ?>
</a>
								</td>
							</tr>
                            <?php 
}
?>

						</tbody>
                        <?php 
module_extra::display_extras(array('owner_table' => 'job', 'owner_key' => 'job_id', 'owner_id' => $job['job_id'], 'layout' => 'table_row', 'allow_new' => module_job::can_i('create', 'Jobs'), 'allow_edit' => module_job::can_i('create', 'Jobs')));
?>

					</table>


                    <?php 
if ($job_id && $job_id != 'new') {
    $note_summary_owners = array();
    // generate a list of all possible notes we can display for this job.
    // display all the notes which are owned by all the sites we have access to
    module_note::display_notes(array('title' => 'Job Notes', 'owner_table' => 'job', 'owner_id' => $job_id, 'view_link' => module_job::link_open($job_id)));
    if (module_job::can_i('edit', 'Jobs')) {
        module_email::display_emails(array('title' => 'Job Emails', 'search' => array('job_id' => $job_id)));
    }
    if (class_exists('module_group', false)) {