Beispiel #1
0
/**
 * Add Stylesheet
 */
function add_stylesheet($id, $path, $paths = array(), $instance = false)
{
    add_asset('stylesheet', $id, $path, $paths, $instance);
}
Beispiel #2
0
    if (strlen($_POST['name']) == 0) {
        $input_error = 1;
        display_error(_("The asset name cannot be empty."));
        set_focus('name');
    }
    if (strlen($_POST['purchase_value']) == 0) {
        $input_error = 1;
        display_error(_("The purchase value cannot be empty."));
        set_focus('rate');
    }
    if ($input_error != 1) {
        if ($selected_id != -1) {
            update_asset($selected_id, $_POST['type'], $_POST['name'], $_POST['serial'], $_POST['purchase_date'], input_num('purchase_value'), $_POST['tag'], $_POST['location'], $_POST['condition'], $_POST['acquisition'], input_num('disposal_amount'), $_POST['disposal_date']);
            display_notification(_('Selected asset type has been updated'));
        } else {
            add_asset($_POST['type'], $_POST['name'], $_POST['serial'], $_POST['purchase_date'], input_num('purchase_value'), $_POST['tag'], $_POST['location'], $_POST['condition'], $_POST['acquisition']);
            display_notification(_('New Asset type has been added'));
        }
        $Mode = 'RESET';
    }
}
//-----------------------------------------------------------------------------------
function can_delete($selected_id)
{
    if (asset_in_amortisation($selected_id)) {
        display_error(_("Cannot delete this asset because amortisation transactions have been created referring to it."));
        return false;
    }
    return true;
}
//-----------------------------------------------------------------------------------