Exemple #1
0
        setEventMessage($langs->trans("SetupSaved"));
    } else {
        setEventMessage($langs->trans("Error"), 'errors');
    }
}
/*
 * View
 */
llxHeader();
$form = new Form($db);
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print_fiche_titre($langs->trans("SyslogSetup"), $linkback, 'title_setup');
print '<br>';
$def = array();
$syslogfacility = $defaultsyslogfacility = dolibarr_get_const($db, "SYSLOG_FACILITY", 0);
$syslogfile = $defaultsyslogfile = dolibarr_get_const($db, "SYSLOG_FILE", 0);
if (!$defaultsyslogfacility) {
    $defaultsyslogfacility = 'LOG_USER';
}
if (!$defaultsyslogfile) {
    $defaultsyslogfile = 'dolibarr.log';
}
if ($conf->global->MAIN_MODULE_MULTICOMPANY && $user->entity) {
    print '<div class="error">' . $langs->trans("ContactSuperAdminForChange") . '</div>';
    $option = 'disabled';
}
//print "conf->global->MAIN_FEATURES_LEVEL = ".$conf->global->MAIN_FEATURES_LEVEL."<br><br>\n";
// Output mode
print_titre($langs->trans("SyslogOutput"));
// Mode
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
            dol_print_error($db);
        }
    }
}
/*
 * 	View
 */
clearstatcache();
// read const
$labcomp = dolibarr_get_const($db, "LAB_COMP", 1);
$labprodlabel = dolibarr_get_const($db, "LAB_PROD_LABEL", 1);
$labweight = dolibarr_get_const($db, "LAB_WEIGHT", 1);
$lablength = dolibarr_get_const($db, "LAB_LENGTH", 1);
$labarea = dolibarr_get_const($db, "LAB_AREA", 1);
$labvolume = dolibarr_get_const($db, "LAB_VOLUME", 1);
$labcountry = dolibarr_get_const($db, "LAB_COUNTRY", 1);
$form = new Form($db);
$helpurl = 'EN:Module_Labels|FR:Module_Labels_FR|ES:M&oacute;dulo_Labels';
llxHeader('', $langs->trans("LabelPrintSetup"), $helpurl);
dol_include_once('/labelprint/class/utils.class.php');
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print_fiche_titre($langs->trans("LabelPrintSetup"), $linkback, 'setup');
$head = labels_admin_prepare_head(null);
dol_fiche_head($head, 'general', $langs->trans("Labels"), 0, 'barcode');
dol_htmloutput_mesg($mesg);
//Show in
print_titre($langs->trans("ShowLabelsIn"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("Name") . '</td>';
print '<td>' . $langs->trans("Description") . '</td>';
<?php

require "../config.php";
include_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
global $db;
if (isset($_POST['modele'])) {
    $modele = $_POST['modele'];
} else {
    return 0;
}
echo json_encode(array('margeleft' => dolibarr_get_const($db, 'ETIQUETTE_MARGE_LEFT_' . $modele), 'margetop' => dolibarr_get_const($db, 'ETIQUETTE_MARGE_TOP_' . $modele)));
        $db->rollback();
        setEventMessage($langs->trans("Error"), "errors");
        header("Location: " . $_SERVER["PHP_SELF"]);
        exit;
    }
}
/*
 * View
 */
llxHeader("", $langs->trans("ImportSetup"));
$html = new Form($db);
$head = importatoradmin_prepare_head();
dol_fiche_head($head, 'configuration', $langs->trans("Import"), 0, 'generic');
// read const
$impstock = dolibarr_get_const($db, "IMPORT_TOTAL_STOCK", 1);
$impbarcode = dolibarr_get_const($db, "IMPORT_BARCODE", 1);
//Page
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print_fiche_titre($langs->trans("ImportSetup"), $linkback, 'setup');
print '<br>';
print '<form name="catalogconfig" action="' . $_SERVER["PHP_SELF"] . '" method="post">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
/*
 *  General Optiones
 */
print_titre($langs->trans("GeneralOptions"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("Parameter") . '</td>';
print '<td align="center" width="60">' . $langs->trans("Value") . '</td>';
print "</tr>\n";
 /**
  * Function called when module is disabled.
  * Remove from database constants, boxes and permissions from Dolibarr database.
  * Data directories are not deleted
  *
  * @param        string $options Options when enabling module ('', 'noboxes')
  * @return        int                    1 if OK, 0 if KO
  */
 public function remove($options = '')
 {
     // Properly disable Sentry handler
     $const = 'SYSLOG_HANDLERS';
     $entity = 0;
     // Main
     $syslog_handlers = dolibarr_get_const($this->db, $const, $entity);
     $syslog_handlers = json_decode($syslog_handlers);
     $index = array_search('mod_syslog_sentry', $syslog_handlers, true);
     if (false !== $index) {
         unset($syslog_handlers[$index]);
     }
     $syslog_handlers = json_encode($syslog_handlers);
     dolibarr_set_const($this->db, $const, $syslog_handlers, 'chaine', 0, '', $entity);
     $sql = array();
     return $this->_remove($sql, $options);
 }
Exemple #6
0
 * Client side logging support
 */
// Load Dolibarr environment
if (false === @(include '../../main.inc.php')) {
    // From htdocs directory
    require '../../../main.inc.php';
    // From "custom" directory
}
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
global $conf, $db, $user;
if (array_key_exists('mod_syslog_sentry', $conf->loghandlers) && !empty($conf->global->SYSLOG_SENTRY_DSN)) {
    /**
     * Convert Dolibarr levels to JavaScript levels
     * @see https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/console#Logging_Levels
     */
    $log_level = dolibarr_get_const($db, "SYSLOG_LEVEL", 0);
    switch (intval($log_level)) {
        case LOG_EMERG:
        case LOG_ALERT:
        case LOG_CRIT:
        case LOG_ERR:
            $log_level = array('error');
            break;
        case LOG_WARNING:
        case LOG_NOTICE:
            $log_level = array('error', 'warn');
            break;
        case LOG_INFO:
        default:
            $log_level = array('error', 'warn', 'info');
            break;