Пример #1
0
function display_extensions()
{
    global $installed_extensions;
    div_start('ext_tbl');
    start_table(TABLESTYLE);
    $th = array(_("Extension"), _("Modules provided"), _("Options provided"), _("Installed"), _("Available"), "", "");
    table_header($th);
    $k = 0;
    $mods = get_extensions_list('extension');
    foreach ($mods as $pkg_name => $ext) {
        $available = @$ext['available'];
        $installed = @$ext['version'];
        $id = @$ext['local_id'];
        $entries = fmt_titles(@$ext['entries']);
        $tabs = fmt_titles(@$ext['tabs']);
        alt_table_row_color($k);
        label_cell($available ? get_package_view_str($pkg_name, $ext['name']) : $ext['name']);
        label_cell($tabs);
        label_cell($entries);
        label_cell($id === null ? _("None") : ($available && $installed ? $installed : _("Unknown")));
        label_cell($available ? $available : _("Unknown"));
        if (!$available && $ext['type'] == 'extension') {
            // third-party plugin
            if (!$installed) {
                button_cell('Local' . $ext['package'], _("Install"), _('Install third-party extension.'), ICON_DOWN);
            } else {
                label_cell('');
            }
        } elseif (check_pkg_upgrade($installed, $available)) {
            // outdated or not installed extension in repo
            button_cell('Update' . $pkg_name, $installed ? _("Update") : _("Install"), _('Upload and install latest extension package'), ICON_DOWN);
        } else {
            label_cell('');
        }
        if ($id !== null) {
            delete_button_cell('Delete' . $id, _('Delete'));
            submit_js_confirm('Delete' . $id, sprintf(_("You are about to remove package \\'%s\\'.\nDo you want to continue ?"), $ext['name']));
        } else {
            label_cell('');
        }
        end_row();
    }
    end_table(1);
    submit_center_first('Refresh', _("Update"), '', null);
    div_end();
}
Пример #2
0
$mods = get_charts_list();
foreach ($mods as $pkg_name => $ext) {
    $available = @$ext['available'];
    $installed = @$ext['version'];
    $id = @$ext['local_id'];
    $encoding = @$ext['encoding'];
    alt_table_row_color($k);
    //		label_cell(is_array($ext['Descr']) ? $ext['Descr'][0] : $ext['Descr']);
    label_cell($available ? get_package_view_str($pkg_name, $ext['name']) : $ext['name']);
    label_cell($id === null ? _("None") : ($available && $installed ? $installed : _("Unknown")));
    label_cell($available ? $available : _("None"));
    label_cell($encoding ? $encoding : _("Unknown"));
    if ($available && check_pkg_upgrade($installed, $available)) {
        // outdated or not installed theme in repo
        button_cell('Update' . $pkg_name, $installed ? _("Update") : _("Install"), _('Upload and install latest extension package'), ICON_DOWN);
    } else {
        label_cell('');
    }
    if ($id !== null) {
        delete_button_cell('Delete' . $id, _('Delete'));
        submit_js_confirm('Delete' . $id, sprintf(_("You are about to remove package \\'%s\\'.\nDo you want to continue ?"), $ext['name']));
    } else {
        label_cell('');
    }
    end_row();
}
end_table(1);
div_end();
//---------------------------------------------------------------------------------------------
end_form();
end_page();
Пример #3
0
start_form(true, true);
start_outer_table(TABLESTYLE2);
table_section(1);
table_section_title(_("Create backup"));
textarea_row(_("Comments:"), 'comments', null, 30, 8);
compress_list_row(_("Compression:"), 'comp');
vertical_space("height='20px'");
submit_row('creat', _("Create Backup"), false, "colspan=2 align='center'", '', 'process');
table_section(2);
table_section_title(_("Backup scripts maintenance"));
start_row();
echo "<td style='padding-left:20px' align='left'>" . get_backup_file_combo() . "</td>";
echo "<td style='padding-left:20px' valign='top'>";
start_table();
submit_row('view', _("View Backup"), false, '', '', false);
submit_row('download', _("Download Backup"), false, '', '', false);
submit_row('restore', _("Restore Backup"), false, '', '', 'process');
submit_js_confirm('restore', _("You are about to restore database from backup file.\nDo you want to continue?"));
submit_row('deldump', _("Delete Backup"), false, '', '', true);
// don't use 'delete' name or IE js errors appear
submit_js_confirm('deldump', sprintf(_("You are about to remove selected backup file.\nDo you want to continue ?")));
end_table();
echo "</td>";
end_row();
start_row();
echo "<td style='padding-left:20px' align='left'><input name='uploadfile' type='file'></td>";
submit_cells('upload', _("Upload file"), "style='padding-left:20px'", '', true);
end_row();
end_outer_table();
end_form();
end_page();
Пример #4
0
}
start_form();
hidden('cart_id');
$customer_error = display_order_header($_SESSION['Items'], $_SESSION['Items']->any_already_delivered() == 0, $idate);
if ($customer_error == "") {
    start_table(TABLESTYLE, "width='80%'", 10);
    echo "<tr><td>";
    display_order_summary($orderitems, $_SESSION['Items'], true);
    echo "</td></tr>";
    echo "<tr><td>";
    display_delivery_details($_SESSION['Items']);
    echo "</td></tr>";
    end_table(1);
    if ($_SESSION['Items']->trans_no == 0) {
        submit_center_first('ProcessOrder', $porder, _('Check entered data and save document'), 'default');
        submit_center_last('CancelOrder', $cancelorder, _('Cancels document entry or removes sales order when editing an old document'));
        submit_js_confirm('CancelOrder', _('You are about to void this Document.\\nDo you want to continue?'));
    } else {
        submit_center_first('ProcessOrder', $corder, _('Validate changes and update document'), 'default');
        submit_center_last('CancelOrder', $cancelorder, _('Cancels document entry or removes sales order when editing an old document'));
        if ($_SESSION['Items']->trans_type == ST_SALESORDER) {
            submit_js_confirm('CancelOrder', _('You are about to cancel undelivered part of this order.\\nDo you want to continue?'));
        } else {
            submit_js_confirm('CancelOrder', _('You are about to void this Document.\\nDo you want to continue?'));
        }
    }
} else {
    display_error($customer_error);
}
end_form();
end_page();
Пример #5
0
    $cancelorder = _("Cancel Order");
    $porder = _("Place Order");
    $corder = _("Commit Order Changes");
}
start_form();
hidden('cart_id');
$customer_error = display_order_header($_SESSION['Items'], $_SESSION['Items']->any_already_delivered() == 0, $idate);
if ($customer_error == "") {
    start_table(TABLESTYLE, "width=80%", 10);
    echo "<tr><td>";
    display_order_summary($orderitems, $_SESSION['Items'], true);
    echo "</td></tr>";
    echo "<tr><td>";
    display_delivery_details($_SESSION['Items']);
    echo "</td></tr>";
    end_table(1);
    if ($_SESSION['Items']->trans_no == 0) {
        submit_center_first('ProcessOrder', $porder, _('Check entered data and save document'), 'default');
        submit_js_confirm('CancelOrder', _('You are about to void this Document.\\nDo you want to continue?'));
    } else {
        if ($_SESSION['Items']->trans_type == ST_SALESORDER) {
            submit_js_confirm('CancelOrder', _('You are about to cancel undelivered part of this order.\\nDo you want to continue?'));
        }
        submit_center_first('ProcessOrder', $corder, _('Validate changes and update document'), 'default');
    }
    submit_center_last('CancelOrder', $cancelorder, _('Cancels document entry or removes sales order when editing an old document'));
} else {
    display_error($customer_error);
}
end_form();
end_page();
Пример #6
0
function display_fiscalyears()
{
    $company_year = get_company_pref('f_year');
    $result = get_all_fiscalyears();
    start_form();
    display_note(_("Warning: Deleting a fiscal year all transactions \n\t\tare removed and converted into relevant balances. This process is irreversible!"), 0, 1, "class='currentfg'");
    start_table(TABLESTYLE);
    $th = array(_("Fiscal Year Begin"), _("Fiscal Year End"), _("Closed"), "", "");
    table_header($th);
    $k = 0;
    $row_cnt = 0;
    $can_close = true;
    while ($myrow = db_fetch($result)) {
        $row_cnt++;
        if ($myrow['id'] == $company_year) {
            start_row("class='stockmankobg'");
        } else {
            alt_table_row_color($k);
        }
        $from = sql2date($myrow["begin"]);
        $to = sql2date($myrow["end"]);
        $closed_text = yesno_value($myrow["closed"]);
        label_cell($from);
        label_cell($to);
        label_cell($closed_text);
        // can only close year if there are no earlier open years; can reopen year that is closed
        if ($can_close || $myrow["closed"] != 0) {
            edit_button_cell("Edit" . $myrow['id'], _("Closed?"));
        } else {
            label_cell('');
        }
        // can only delete first year if it is closed and not current year
        if ($myrow["id"] != $company_year && $row_cnt == 1 && $myrow["closed"] != 0) {
            delete_button_cell("Delete" . $myrow['id'], _("Delete"));
            submit_js_confirm("Delete" . $myrow['id'], sprintf(_("Are you sure you want to delete fiscal year %s - %s? All transactions are deleted and converted into relevant balances. Do you want to continue ?"), $from, $to));
        } else {
            label_cell('');
        }
        end_row();
        if ($myrow["closed"] == 0) {
            $can_close = false;
        }
    }
    end_table();
    end_form();
    display_note(_("The marked fiscal year is the current fiscal year which cannot be deleted."), 0, 0, "class='currentfg'");
}
Пример #7
0
    echo "</td>\n";
    echo "</tr\n";
}
$dim = get_company_pref('use_dimension');
start_form(false, false, "", "accrual");
start_table(TABLESTYLE2);
date_row(_("Date"), 'date_', _('First date of Accruals'), true, 0, 0, 0, null, true);
start_row();
label_cell(_("Accrued Balance Account"), "class='label'");
gl_all_accounts_list_cells(null, 'acc_act', null, true, false, false, true);
end_row();
gl_all_accounts_list_row(_("Revenue / Cost Account"), 'res_act', null, true);
if ($dim >= 1) {
    dimensions_list_row(_("Dimension"), 'dimension_id', null, true, " ", false, 1);
}
if ($dim > 1) {
    dimensions_list_row(_("Dimension") . " 2", 'dimension2_id', null, true, " ", false, 2);
}
$url = "gl/view/accrual_trans.php?act=" . get_post('acc_act') . "&date=" . get_post('date_');
amount_row(_("Amount"), 'amount', null, null, viewer_link(_("Search Amount"), $url, "", "", ICON_VIEW));
frequency_list_row(_("Frequency"), 'freq', null);
text_row(_("Periods"), 'periods', null, 3, 3);
textarea_row(_("Memo"), 'memo_', null, 35, 3);
end_table(1);
submit_center_first('show', _("Show GL Rows"));
//,true,false,'process',ICON_SUBMIT);
submit_center_last('go', _("Process Accruals"));
//,true,false,'process',ICON_SUBMIT);
submit_js_confirm('go', _("Are you sure you want to post accruals?"));
end_form();
end_page();
Пример #8
0
function display_languages()
{
    global $table_style, $installed_languages, $dflt_lang, $GetText;
    $th = array(_("Language"), _("Name"), _("Encoding"), _("Right To Left"), _("Installed"), _("Available"), _("Default"), "", "");
    $currlang = $_SESSION["language"]->code;
    div_start('lang_tbl');
    start_form();
    //
    // select/display system locales support for sites using native gettext
    //
    if (function_exists('gettext')) {
        if (check_value('DisplayAll')) {
            array_insert($th, 7, _("Supported"));
        }
        start_table();
        check_row(_('Display also languages not supported by server locales'), 'DisplayAll', null, true);
        end_table();
    }
    start_table(TABLESTYLE);
    table_header($th);
    $k = 0;
    // get list of all (available and installed) langauges
    $langs = get_languages_list();
    foreach ($langs as $pkg_name => $lng) {
        if ($lng == 'C') {
            // skip default locale (aka no translation)
            continue;
        }
        $lang = $lng['code'];
        $lang_name = $lng['name'];
        $charset = $lng['encoding'];
        $rtl = @$lng['rtl'] == 'yes' || @$lng['rtl'] === true;
        $available = @$lng['available'];
        $installed = @$lng['version'];
        $id = @$lng['local_id'];
        if ($lang == $currlang) {
            start_row("class='stockmankobg'");
        } else {
            alt_table_row_color($k);
        }
        $support = $GetText->check_support($lang, $charset);
        if (function_exists('gettext') && !$support && !get_post('DisplayAll')) {
            continue;
        }
        label_cell($lang);
        label_cell($available ? get_package_view_str($lang, $lang_name) : $lang_name);
        label_cell($charset);
        label_cell($rtl ? _("Yes") : _("No"));
        label_cell($id === null ? _("None") : ($available && $installed ? $installed : _("Unknown")));
        label_cell($available ? $available : _("None"));
        label_cell($id === null ? '' : radio(null, 'CurDflt', $id, $dflt_lang == $lang, true), "align='center'");
        if (function_exists('gettext') && check_value('DisplayAll')) {
            label_cell($support ? _("Yes") : _("No"));
        }
        if (!$available && $lang != 'C') {
            // manually installed language
            button_cell('Edit' . $id, _("Edit"), _('Edit non standard language configuration'), ICON_EDIT);
        } elseif (check_pkg_upgrade($installed, $available)) {
            // outdated or not installed language in repo
            button_cell('Update' . $pkg_name, $installed ? _("Update") : _("Install"), _('Upload and install latest language package'), ICON_DOWN);
        } else {
            label_cell('');
        }
        if ($id !== null && $lang != $currlang && $lang != 'C') {
            delete_button_cell('Delete' . $id, _('Delete'));
            submit_js_confirm('Delete' . $id, sprintf(_("You are about to remove language \\'%s\\'.\nDo you want to continue ?"), $lang_name));
        } else {
            label_cell('');
        }
        end_row();
    }
    end_table();
    display_note(_("The marked language is the current language which cannot be deleted."), 0, 0, "class='currentfg'");
    br();
    submit_center_first('Refresh', _("Update default"), '', null);
    submit_center_last('Add', _("Add new language manually"), '', false);
    end_form();
    div_end();
}
vertical_space("height='20px'");
submit_row('creat', _("Create Backup"), false, "colspan=2 align='center'", '', 'process');
table_section(2);
table_section_title(_("Backup scripts maintenance"));
start_row();
echo "<td style='padding-left:20px' align='left'>" . get_backup_file_combo() . "</td>";
echo "<td style='padding-left:20px' valign='top'>";
start_table();
submit_row('view', _("View Backup"), false, '', '', false);
submit_row('download', _("Download Backup"), false, '', '', false);
submit_row('rendump', _("Rename Backup"), false, '', '', 'process');
submit_js_confirm('rendump', _("You are about to rename database backup file.\nDo you want to continue?"));
submit_row('restore', _("Restore Backup"), false, '', '', 'process');
submit_js_confirm('restore', _("You are about to restore database from backup file.\nDo you want to continue?"));
submit_row('deldump', _("Delete Backup"), false, '', '', true);
// don't use 'delete' name or IE js errors appear
submit_js_confirm('deldump', sprintf(_("You are about to remove selected backup file.\nDo you want to continue ?")));
if ($enable_shell_button) {
    submit_row('shcmds', _("Shell Commands"), false, '', '', 'process');
    submit_js_confirm('shcmds', _("You are about to execute shell commands on the server.\nDo you want to continue?"));
}
end_table();
echo "</td>";
end_row();
start_row();
echo "<td style='padding-left:20px' align='left'><input name='uploadfile' type='file'></td>";
submit_cells('upload', _("Upload file"), "style='padding-left:20px'", '', true);
end_row();
end_outer_table();
end_form();
end_page();