Ejemplo n.º 1
0
function get_inventory_generic_labels()
{
    global $config;
    $labels = array();
    $labels['generic_1'] = isset($config['inventory_label_1']) ? $config['inventory_label_1'] : lang_string('Field #') . '1';
    $labels['generic_2'] = isset($config['inventory_label_2']) ? $config['inventory_label_2'] : lang_string('Field #') . '2';
    $labels['generic_3'] = isset($config['inventory_label_3']) ? $config['inventory_label_3'] : lang_string('Field #') . '3';
    $labels['generic_4'] = isset($config['inventory_label_4']) ? $config['inventory_label_4'] : lang_string('Field #') . '4';
    $labels['generic_5'] = isset($config['inventory_label_5']) ? $config['inventory_label_5'] : lang_string('Field #') . '5';
    $labels['generic_6'] = isset($config['inventory_label_6']) ? $config['inventory_label_6'] : lang_string('Field #') . '6';
    $labels['generic_7'] = isset($config['inventory_label_7']) ? $config['inventory_label_7'] : lang_string('Field #') . '7';
    $labels['generic_8'] = isset($config['inventory_label_8']) ? $config['inventory_label_8'] : lang_string('Field #') . '8';
    return $labels;
}
Ejemplo n.º 2
0
 function __call($function_name, $arg)
 {
     $function_name = strtolower($function_name);
     if (strpos($function_name, 'find_by_') == 0) {
         $fieldname = str_replace('find_by_', '', $function_name);
         if (array_key_exists($fieldname, $this->fields)) {
             if (count($arg) >= 2) {
                 if (array_key_exists('conditions', $arg[1])) {
                     $arg[1]["conditions"] .= " and " . $fieldname . "='" . $arg[0] . "'";
                 } else {
                     $arg[1]["conditions"] = $fieldname . "='" . $arg[0] . "'";
                 }
             } else {
                 $arg[1]["conditions"] = $fieldname . "='" . $arg[0] . "'";
             }
             return $this->find('all', $arg[1]);
         }
     } else {
         debug_info(lang_string('I_FUNCTION', 'function') . $function_name . lang_string('E_NOT_EISTS', 'not exists!'));
     }
 }
Ejemplo n.º 3
0
$template = get_parameter("template", "");
$data = "";
// Load template from disk to textarea
if ($refresh != "none") {
    $full_filename = "include/mailtemplates/" . get_parameter("template");
    $data = safe_input(file_get_contents($full_filename));
}
// Update configuration
if ($update != "none") {
    $data = unsafe_string(str_replace("\r\n", "\n", $_POST["template_content"]));
    $file = "include/mailtemplates/" . $template;
    $fileh = fopen($file, "wb");
    if (fwrite($fileh, $data)) {
        echo "<h3 class='suc'>" . lang_string(__('File successfully updated')) . "</h3>";
    } else {
        echo "<h3 class='error'>" . lang_string(__('Problem updating file')) . " ({$file}) </h3>";
    }
    fclose($file);
}
$table->width = '99%';
$table->class = 'search-table-button';
$table->colspan = array();
$table->colspan[2][0] = 2;
$table->data = array();
$templatelist = get_template_files();
$table->data[1][0] = print_select($templatelist, 'template', $template, '', '', '', true, 0, true, __('Template'), false, "width:250px;margin-top:5px;");
$table->data[1][0] .= "&nbsp;&nbsp";
$table->data[1][0] .= print_submit_button(__('Edit'), 'edit_button', false, 'class="sub upd"', true);
$table->data[1][0] .= integria_help("macros", true);
$table->data[2][0] = print_textarea("template_content", 30, 44, $data, '', true, __('Template contents'));
$table->data[3][0] = print_submit_button(__('Update'), 'upd_button', false, 'class="sub upd"', true);