Example #1
0
$form = new Form($db);
$typeconst=array('yesno','texte','chaine');


if ($_POST['action'] == 'update' || $_POST['action'] == 'add')
{
	if (! dolibarr_set_const($db, $_POST['constname'], $_POST['constvalue'], $typeconst[$_POST['consttype']], 0, isset($_POST['constnote']) ? $_POST['constnote'] : '',$conf->entity));
	{
	  	print $db->error();
	}
}


if ($_GET['action'] == 'delete')
{
	if (! dolibarr_del_const($db, $_GET['constname'],$conf->entity));
	{
	  	print $db->error();
	}
}


/*
 * View
 */

llxHeader();

$html=new Form($db);

$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
Example #2
0
}
/*
 * Action
 */
if (preg_match('/set_(.*)/', $action, $reg)) {
    $code = $reg[1];
    if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) {
        header("Location: " . $_SERVER["PHP_SELF"]);
        exit;
    } else {
        dol_print_error($db);
    }
}
if (preg_match('/del_(.*)/', $action, $reg)) {
    $code = $reg[1];
    if (dolibarr_del_const($db, $code, $conf->entity) > 0) {
        header("Location: " . $_SERVER["PHP_SELF"]);
        exit;
    } else {
        dol_print_error($db);
    }
}
/*
 * View
 */
$help_url = '';
llxHeader('', $langs->trans("ECMSetup"), $help_url);
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans("ECMSetup"), $linkback, 'title_setup');
print '<br>';
print '<table class="noborder" width="100%">';
/*
 * Actions
 */
// Purge sessions
if ($action == 'confirm_purge' && $confirm == 'yes' && $user->admin) {
    $res = purgeSessions(session_id());
}
// Lock new sessions
if ($action == 'confirm_lock' && $confirm == 'yes' && $user->admin) {
    if (dolibarr_set_const($db, 'MAIN_ONLY_LOGIN_ALLOWED', $user->login, 'text', 1, 'Logon is restricted to a particular user', 0) < 0) {
        dol_print_error($db);
    }
}
// Unlock new sessions
if ($action == 'confirm_unlock' && $user->admin) {
    if (dolibarr_del_const($db, 'MAIN_ONLY_LOGIN_ALLOWED', -1) < 0) {
        dol_print_error($db);
    }
}
/*
*	View
*/
llxHeader();
$form = new Form($db);
$userstatic = new User($db);
$usefilter = 0;
$listofsessions = listOfSessions();
$num = count($listofsessions);
print_barre_liste($langs->trans("Sessions"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num, 0, 'setup');
$savehandler = ini_get("session.save_handler");
$savepath = ini_get("session.save_path");
Example #4
0
            dol_print_error($db);
        }
    }
}

if ($_POST["delete"])
{
    if(isset($_POST["numero_entry"]))
    {
        $db->begin();

		$result1=dolibarr_del_const($db,"ftp_port_" . $_POST["numero_entry"],$conf->entity);
		if ($result1) $result2=dolibarr_del_const($db,"ftp_server_" . $_POST["numero_entry"],$conf->entity);
		if ($result2) $result3=dolibarr_del_const($db,"ftp_user_" . $_POST["numero_entry"],$conf->entity);
		if ($result3) $result4=dolibarr_del_const($db,"ftp_password_" . $_POST["numero_entry"],$conf->entity);
		if ($result4) $result5=dolibarr_del_const($db,"ftp_name_" . $_POST["numero_entry"],$conf->entity);

        if ($result1 && $result2 && $result3 && $result4 && $result5)
        {
            $db->commit();
	  		//$mesg='<div class="ok">'.$langs->trans("Success").'</div>';
            header("Location: ftpclient.php");
            exit;
        }
        else
        {
            $db->rollback();
            dol_print_error($db);
        }
    }
}
 private function deleteTab()
 {
     global $db, $conf, $user;
     dol_include_once('/core/lib/admin.lib.php');
     dolibarr_del_const($db, 'MAIN_MODULE_QUERY_TABS_' . $this->getId());
 }
Example #6
0
    if (!$error) {
        $db->commit();
        setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
    } else {
        $db->rollback();
        setEventMessages($langs->trans("Error"), null, 'errors');
    }
} else {
    if ($action == 'set') {
        $ret = addDocumentModel($value, $type, $label, $scandir);
    } else {
        if ($action == 'del') {
            $ret = delDocumentModel($value, $type);
            if ($ret > 0) {
                if ($conf->global->FICHEINTER_ADDON_PDF == "{$value}") {
                    dolibarr_del_const($db, 'FICHEINTER_ADDON_PDF', $conf->entity);
                }
            }
        } else {
            if ($action == 'setdoc') {
                if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
                    // La constante qui a ete lue en avant du nouveau set
                    // on passe donc par une variable pour avoir un affichage coherent
                    $conf->global->FICHEINTER_ADDON_PDF = $value;
                }
                // On active le modele
                $ret = delDocumentModel($value, $type);
                if ($ret > 0) {
                    $ret = addDocumentModel($value, $type, $label, $scandir);
                }
            } else {
Example #7
0
    header("Location: " . $_SERVER["PHP_SELF"]);
    exit;
} else {
    if ($action == 'disable_hidemenu') {
        dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", $conf->entity);
        header("Location: " . $_SERVER["PHP_SELF"]);
        exit;
    }
}
if ($action == 'activate_layoutmenu') {
    dolibarr_set_const($db, "MAIN_MENU_USE_JQUERY_LAYOUT", '1', 'chaine', 0, '', $conf->entity);
    header("Location: " . $_SERVER["PHP_SELF"]);
    exit;
} else {
    if ($action == 'disable_layoutmenu') {
        dolibarr_del_const($db, "MAIN_MENU_USE_JQUERY_LAYOUT", $conf->entity);
        header("Location: " . $_SERVER["PHP_SELF"]);
        exit;
    }
}
/*
 * View
 */
llxHeader('', $langs->trans("Setup"));
print_fiche_titre($langs->trans("Menus"), '', 'setup');
$h = 0;
$head[$h][0] = DOL_URL_ROOT . "/admin/menus.php";
$head[$h][1] = $langs->trans("MenuHandlers");
$head[$h][2] = 'handler';
$h++;
$head[$h][0] = DOL_URL_ROOT . "/admin/menus/index.php";
Example #8
0
}
if (!defined('NOREQUIREHOOK')) {
    define('NOREQUIREHOOK', '1');
}
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
$action = GETPOST('action', 'alpha');
$name = GETPOST('name', 'alpha');
/*
 * View
 */
// Ajout directives pour resoudre bug IE
//header('Cache-Control: Public, must-revalidate');
//header('Pragma: public');
//top_htmlhead("", "", 1);  // Replaced with top_httphead. An ajax page does not need html header.
top_httphead();
print '<!-- Ajax page called with url ' . $_SERVER["PHP_SELF"] . '?' . $_SERVER["QUERY_STRING"] . ' -->' . "\n";
// Registering the location of boxes
if (!empty($action) && !empty($name)) {
    $entity = GETPOST('entity', 'int');
    $value = GETPOST('value') ? GETPOST('value') : 1;
    if ($user->admin) {
        if ($action == 'set') {
            dolibarr_set_const($db, $name, $value, 'chaine', 0, '', $entity);
        } else {
            if ($action == 'del') {
                dolibarr_del_const($db, $name, $entity);
            }
        }
    }
}
Example #9
0
            $mesg = '<font class="error">' . $module->error . '</font>';
            dol_syslog($module->error, LOG_ERR);
        }
    } else {
        $mesg = '<font class="error">' . $langs->trans("ErrorModuleNotFound") . '</font>';
        dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
    }
}
if ($action == 'set') {
    $ret = addDocumentModel($value, $type, $label, $scandir);
}
if ($action == 'del') {
    $ret = delDocumentModel($value, $type);
    if ($ret > 0) {
        if ($conf->global->LIVRAISON_ADDON_PDF == "{$value}") {
            dolibarr_del_const($db, 'LIVRAISON_ADDON_PDF', $conf->entity);
        }
    }
}
if ($action == 'setdoc') {
    if (dolibarr_set_const($db, "LIVRAISON_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
        // La constante qui a ete lue en avant du nouveau set
        // on passe donc par une variable pour avoir un affichage coherent
        $conf->global->LIVRAISON_ADDON_PDF = $value;
    }
    // On active le modele
    $ret = delDocumentModel($value, $type);
    if ($ret > 0) {
        $ret = addDocumentModel($value, $type, $label, $scandir);
    }
}
Example #10
0
/*
*	Actions
*/
if ($_POST["action"] == "save" && empty($_POST["cancel"]))
{
    $i=0;

    $db->begin();

	foreach ($triggers as $trigger)
	{
		$param='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code'];
		//print "param=".$param." - ".$_POST[$param];
		if (! empty($_POST[$param])) dolibarr_set_const($db,$param,$_POST[$param],'chaine',0,'',$conf->entity);
		else dolibarr_del_const($db,$param,$conf->entity);
	}

    $db->commit();
    $mesg = '<font class="ok">'.$langs->trans("SetupSaved").'</font>';
}



/**
 * Affichage du formulaire de saisie
 */

llxHeader();

$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
Example #11
0
    exit;
} else {
    if ($_GET["action"] == 'disable_sending') {
        dolibarr_del_const($db, "MAIN_SUBMODULE_EXPEDITION", $conf->entity);
        Header("Location: confexped.php");
        exit;
    } else {
        if ($_GET["action"] == 'activate_delivery') {
            dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity);
            // We must also enable this
            dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1", 'chaine', 0, '', $conf->entity);
            Header("Location: confexped.php");
            exit;
        } else {
            if ($_GET["action"] == 'disable_delivery') {
                dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON", $conf->entity);
                Header("Location: confexped.php");
                exit;
            }
        }
    }
}
/*
 * Affiche page
 */
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/expedition/";
$html = new Form($db);
llxHeader("", "");
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'setup');
print '<br>';
Example #12
0
        $error++;
    }
    if (!$error) {
        setEventMessage($langs->trans("SetupSaved"));
    } else {
        setEventMessage($langs->trans("Error"), 'errors');
    }
} else {
    if ($action == 'set') {
        $ret = addDocumentModel($value, $type, $label, $scandir);
    } else {
        if ($action == 'del') {
            $ret = delDocumentModel($value, $type);
            if ($ret > 0) {
                if ($conf->global->FACTURE_ADDON_PDF == "{$value}") {
                    dolibarr_del_const($db, 'FACTURE_ADDON_PDF', $conf->entity);
                }
            }
        } else {
            if ($action == 'setdoc') {
                if (dolibarr_set_const($db, "FACTURE_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
                    // La constante qui a ete lue en avant du nouveau set
                    // on passe donc par une variable pour avoir un affichage coherent
                    $conf->global->FACTURE_ADDON_PDF = $value;
                }
                // On active le modele
                $ret = delDocumentModel($value, $type);
                if ($ret > 0) {
                    $ret = addDocumentModel($value, $type, $label, $scandir);
                }
            } else {
Example #13
0
$langs->load("admin");
$langs->load("workflow");
if (!$user->admin) {
    accessforbidden();
}
$action = GETPOST('action', 'alpha');
/*
 * Actions
 */
if (preg_match('/set(.*)/', $action, $reg)) {
    if (!dolibarr_set_const($db, $reg[1], 1, 'chaine', 0, '', $conf->entity) > 0) {
        dol_print_error($db);
    }
}
if (preg_match('/del(.*)/', $action, $reg)) {
    if (!dolibarr_del_const($db, $reg[1], $conf->entity) > 0) {
        dol_print_error($db);
    }
}
/*
 * 	View
 */
llxHeader('', $langs->trans("WorkflowSetup"), '');
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans("WorkflowSetup"), $linkback, 'title_setup');
print $langs->trans("WorkflowDesc") . '<br>';
print "<br>";
// List of workflow we can enable
print '<table class="noborder" width="100%">' . "\n";
print '<tr class="liste_titre">' . "\n";
print '  <td>' . $langs->trans("Description") . '</td>';
Example #14
0
 */
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formbarcode.class.php';
$langs->load("admin");
if (!$user->admin) {
    accessforbidden();
}
$action = GETPOST('action', 'alpha');
/*
 * Actions
 */
if ($action == 'setbarcodeproducton') {
    $res = dolibarr_set_const($db, "BARCODE_PRODUCT_ADDON_NUM", GETPOST('value'), 'chaine', 0, '', $conf->entity);
} elseif ($action == 'setbarcodeproductoff') {
    $res = dolibarr_del_const($db, "BARCODE_PRODUCT_ADDON_NUM", $conf->entity);
}
if ($action == 'setcoder') {
    $coder = GETPOST('coder', 'alpha');
    $code_id = GETPOST('code_id', 'alpha');
    $sqlp = "UPDATE " . MAIN_DB_PREFIX . "c_barcode_type";
    $sqlp .= " SET coder = '" . $coder . "'";
    $sqlp .= " WHERE rowid = " . $code_id;
    $sqlp .= " AND entity = " . $conf->entity;
    $resql = $db->query($sqlp);
    if (!$resql) {
        dol_print_error($db);
    }
} else {
    if ($action == 'update') {
        if (GETPOST('submit_GENBARCODE_LOCATION')) {
Example #15
0
            $conf->global->DON_ADDON_MODEL = $value;
        }
        // On active le modele
        $ret = delDocumentModel($value, $type);
        if ($ret > 0) {
            $ret = addDocumentModel($value, $type, $label, $scandir);
        }
    } else {
        if ($action == 'set') {
            $ret = addDocumentModel($value, $type, $label, $scandir);
        } else {
            if ($action == 'del') {
                $ret = delDocumentModel($value, $type);
                if ($ret > 0) {
                    if ($conf->global->DON_ADDON_MODEL == "{$value}") {
                        dolibarr_del_const($db, 'DON_ADDON_MODEL', $conf->entity);
                    }
                }
            }
        }
    }
}
// Options
if ($action == 'set_DONATION_ACCOUNTINGACCOUNT') {
    $account = GETPOST('DONATION_ACCOUNTINGACCOUNT');
    // No alpha here, we want exact string
    $res = dolibarr_set_const($db, "DONATION_ACCOUNTINGACCOUNT", $account, 'chaine', 0, '', $conf->entity);
    if (!$res > 0) {
        $error++;
    }
    if (!$error) {
Example #16
0
    } else {
        $mesg = "<font class=\"error\">" . $langs->trans("Error") . "</font>";
    }
}
/*if ($action == 'setusecustomercontactasrecipient')
{
	dolibarr_set_const($db, "PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT",$_POST["value"],'chaine',0,'',$conf->entity);
}*/
if ($action == 'set') {
    $ret = addDocumentModel($value, $type, $label, $scandir);
} else {
    if ($action == 'del') {
        $ret = delDocumentModel($value, $type);
        if ($ret > 0) {
            if ($conf->global->PROPALE_ADDON_PDF == "{$value}") {
                dolibarr_del_const($db, 'PROPALE_ADDON_PDF', $conf->entity);
            }
        }
    } else {
        if ($action == 'setdoc') {
            if (dolibarr_set_const($db, "PROPALE_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
                $conf->global->PROPALE_ADDON_PDF = $value;
            }
            // On active le modele
            $ret = delDocumentModel($value, $type);
            if ($ret > 0) {
                $ret = addDocumentModel($value, $type, $label, $scandir);
            }
        } else {
            if ($action == 'setmod') {
                // TODO Verifier si module numerotation choisi peut etre active
Example #17
0
				$i++;
			}

			$db->commit();
		}
		else
		{
			$db->rollback();
			dol_print_error($db,"sql=$sql");
			exit;
        }


		$result1=dolibarr_del_const($db,"EXTERNAL_RSS_TITLE_" . $_POST["norss"],$conf->entity);
		if ($result1) $result2=dolibarr_del_const($db,"EXTERNAL_RSS_URLRSS_" . $_POST["norss"],$conf->entity);

        if ($result1 && $result2)
        {
            $db->commit();
	  		//$mesg='<div class="ok">'.$langs->trans("Success").'</div>';
            header("Location: external_rss.php");
            exit;
        }
        else
        {
            $db->rollback();
            dol_print_error($db);
        }
    }
}
Example #18
0
$picto = array('SOCIETE' => 'generic', 'PRODUCTDESC' => 'product', 'MAILING' => 'email', 'DETAILS' => 'generic', 'USERSIGN' => 'user', 'MAIL' => 'email');
/*
 *  Actions
 */
foreach ($modules as $const => $desc) {
    if ($action == 'activate_' . strtolower($const)) {
        dolibarr_set_const($db, "FCKEDITOR_ENABLE_" . $const, "1", 'chaine', 0, '', $conf->entity);
        // Si fckeditor est active dans la description produit/service, on l'active dans les formulaires
        if ($const == 'PRODUCTDESC' && !empty($conf->global->PRODUIT_DESC_IN_FORM)) {
            dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1", 'chaine', 0, '', $conf->entity);
        }
        header("Location: " . $_SERVER["PHP_SELF"]);
        exit;
    }
    if ($action == 'disable_' . strtolower($const)) {
        dolibarr_del_const($db, "FCKEDITOR_ENABLE_" . $const, $conf->entity);
        header("Location: " . $_SERVER["PHP_SELF"]);
        exit;
    }
}
if (GETPOST('save', 'alpha')) {
    $res = dolibarr_set_const($db, "FCKEDITOR_TEST", GETPOST('formtestfield'), 'chaine', 0, '', $conf->entity);
    if ($res > 0) {
        setEventMessage($langs->trans("RecordModifiedSuccessfully"));
    }
}
/*
 * View
 */
llxHeader();
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
Example #19
0
    if (!$error) {
        setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
    } else {
        setEventMessages($langs->trans("Error"), null, 'errors');
    }
}
// Action activation d'un sous module du module adherent
if ($action == 'set') {
    $result = dolibarr_set_const($db, $_GET["name"], $_GET["value"], '', 0, '', $conf->entity);
    if ($result < 0) {
        dol_print_error($db);
    }
}
// Action desactivation d'un sous module du module adherent
if ($action == 'unset') {
    $result = dolibarr_del_const($db, $_GET["name"], $conf->entity);
    if ($result < 0) {
        dol_print_error($db);
    }
}
if (($action == 'testsubscribe' || $action == 'testunsubscribe') && !empty($conf->global->ADHERENT_USE_MAILMAN)) {
    $email = GETPOST($action . 'email');
    if (!isValidEmail($email)) {
        $langs->load("errors");
        setEventMessages($langs->trans("ErrorBadEMail", $email), null, 'errors');
    } else {
        include_once DOL_DOCUMENT_ROOT . '/mailmanspip/class/mailmanspip.class.php';
        $mailmanspip = new MailmanSpip($db);
        $object = new stdClass();
        $object->email = $email;
        $object->pass = $email;
Example #20
0
        if (!empty($const["check"])) {
            if (dolibarr_del_const($db, $const["rowid"], -1) >= 0) {
                $nbdeleted++;
            } else {
                dol_print_error($db);
            }
        }
    }
    if ($nbdeleted > 0) {
        setEventMessage($langs->trans("RecordDeleted"));
    }
    $action = '';
}
// Delete line from delete picto
if ($action == 'delete') {
    if (dolibarr_del_const($db, $rowid, $entity) >= 0) {
        setEventMessage($langs->trans("RecordDeleted"));
    } else {
        dol_print_error($db);
    }
}
/*
 * View
 */
$form = new Form($db);
llxHeader('', $langs->trans("OtherSetup"));
// Add logic to show/hide buttons
if ($conf->use_javascript_ajax) {
    ?>
<script type="text/javascript">
jQuery(document).ready(function() {
Example #21
0
// Set modes
if ($action == 'set') {
    $db->begin();
    $newActiveModules = array();
    $selectedModules = isset($_POST['SYSLOG_HANDLERS']) ? $_POST['SYSLOG_HANDLERS'] : array();
    //var_dump($selectedModules);
    foreach ($syslogModules as $syslogHandler) {
        if (in_array($syslogHandler, $syslogModules)) {
            $module = new $syslogHandler();
            if (in_array($syslogHandler, $selectedModules)) {
                $newActiveModules[] = $syslogHandler;
            }
            foreach ($module->configure() as $option) {
                if (isset($_POST[$option['constant']])) {
                    $_POST[$option['constant']] = trim($_POST[$option['constant']]);
                    dolibarr_del_const($db, $option['constant'], 0);
                    dolibarr_set_const($db, $option['constant'], $_POST[$option['constant']], 'chaine', 0, '', 0);
                }
            }
        }
    }
    $activeModules = $newActiveModules;
    dolibarr_set_const($db, 'SYSLOG_HANDLERS', json_encode($activeModules), 'chaine', 0, '', 0);
    if (!$error) {
        $db->commit();
        setEventMessage($langs->trans("SetupSaved"));
    } else {
        $db->rollback();
        setEventMessage($langs->trans("Error"), 'errors');
    }
}
        switch ($value) {
            case 0:
                dolibarr_del_const($db, "MAIN_MODULE_LABELPRINT_LABELS_1");
                break;
            case 1:
                dolibarr_del_const($db, "MAIN_MODULE_LABELPRINT_LABELS_0");
                break;
        }
        if (dolibarr_set_const($db, $labelid, 1, 'chaine', 0, '', $conf->entity) > 0) {
            Header("Location: " . $_SERVER["PHP_SELF"]);
            exit;
        } else {
            dol_print_error($db);
        }
    } else {
        if (dolibarr_del_const($db, $labelid)) {
            Header("Location: " . $_SERVER["PHP_SELF"]);
            exit;
        } else {
            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);
$lit = new LostInTranslation($langtosearch);
/*
 * Actions
 */
if (preg_match('/set_(.*)/', $action, $reg)) {
    $code = $reg[1];
    if (dolibarr_set_const($db, $code, GETPOST($code), 'chaine', 0, '', $conf->entity) > 0) {
        header("Location: " . $_SERVER["PHP_SELF"]);
        exit;
    } else {
        dol_print_error($db);
    }
}
if (preg_match('/del_(.*)/', $action, $reg)) {
    $code = $reg[1];
    if (dolibarr_del_const($db, $code, 0) > 0) {
        Header("Location: " . $_SERVER["PHP_SELF"]);
        exit;
    } else {
        dol_print_error($db);
    }
}
if ($action == 'save_translation') {
    $langfile = GETPOST('langfile', 'alpha');
    $key = GETPOST('key', 'alpha');
    $newTranslation = GETPOST('newtranslation', 'alpha');
    $lit->saveNewTranslation($langfile, $key, $newTranslation);
}
if (!empty($word)) {
    $lit->searchWordInLangFiles($word, $search_option, $other_options);
}
Example #24
0
    if (!$error) {
        $db->commit();
        setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
    } else {
        $db->rollback();
        setEventMessages($langs->trans("Error"), null, 'errors');
    }
} else {
    if ($action == 'set') {
        $ret = addDocumentModel($value, $type, $label, $scandir);
    } else {
        if ($action == 'del') {
            $ret = delDocumentModel($value, $type);
            if ($ret > 0) {
                if ($conf->global->CONTRACT_ADDON_PDF == "{$value}") {
                    dolibarr_del_const($db, 'CONTRACT_ADDON_PDF', $conf->entity);
                }
            }
        } else {
            if ($action == 'setdoc') {
                if (dolibarr_set_const($db, "CONTRACT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
                    // La constante qui a ete lue en avant du nouveau set
                    // on passe donc par une variable pour avoir un affichage coherent
                    $conf->global->CONTRACT_ADDON_PDF = $value;
                }
                // On active le modele
                $ret = delDocumentModel($value, $type);
                if ($ret > 0) {
                    $ret = addDocumentModel($value, $type, $label, $scandir);
                }
            } else {
Example #25
0
     dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', join(',', colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'), array())), 'chaine', 0, '', $conf->entity);
 }
 $val = join(',', colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'), array()));
 if ($val == '') {
     dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity);
 } else {
     dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', join(',', colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'), array())), 'chaine', 0, '', $conf->entity);
 }
 if (GETPOST('THEME_ELDY_USE_HOVER') == '') {
     dolibarr_del_const($db, "THEME_ELDY_USE_HOVER", $conf->entity);
 } else {
     dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity);
 }
 $val = join(',', colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'), array()));
 if ($val == '') {
     dolibarr_del_const($db, 'THEME_ELDY_TEXTLINK', $conf->entity);
 } else {
     dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', join(',', colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'), array())), 'chaine', 0, '', $conf->entity);
 }
 /*
 dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT",			$_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity);
 	dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE",			$_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity);
 	dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE",	$_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity);
 	dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER"],'chaine',0,'',$conf->entity);
 	dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT",			$_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity);
 	dolibarr_set_const($db, "MAIN_SEARCHFORM_PROJECT",			$_POST["MAIN_SEARCHFORM_PROJECT"],'chaine',0,'',$conf->entity);
 	dolibarr_set_const($db, "MAIN_SEARCHFORM_EMPLOYEE",			$_POST["MAIN_SEARCHFORM_EMPLOYEE"],'chaine',0,'',$conf->entity);
 */
 dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"], 'chaine', 0, '', $conf->entity);
 dolibarr_set_const($db, "MAIN_SIZE_SHORTLISTE_LIMIT", $_POST["main_size_shortliste_limit"], 'chaine', 0, '', $conf->entity);
 dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"], 'chaine', 0, '', $conf->entity);
Example #26
0
                if (!$resql) {
                    $db->rollback();
                    dol_print_error($db, "sql=" . $sql);
                    exit;
                }
                $i++;
            }
            $db->commit();
        } else {
            $db->rollback();
            dol_print_error($db, "sql=" . $sql);
            exit;
        }
        $result1 = dolibarr_del_const($db, "EXTERNAL_RSS_TITLE_" . GETPOST("norss"), $conf->entity);
        if ($result1) {
            $result2 = dolibarr_del_const($db, "EXTERNAL_RSS_URLRSS_" . GETPOST("norss"), $conf->entity);
        }
        if ($result1 && $result2) {
            $db->commit();
            header("Location: external_rss.php");
            exit;
        } else {
            $db->rollback();
            dol_print_error($db);
        }
    }
}
/*
 * View
 */
llxHeader('', $langs->trans("ExternalRSSSetup"));
Example #27
0
    if (!$error) {
        setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
    } else {
        setEventMessages($langs->trans("Error"), null, 'errors');
    }
}
// Action activation d'un sous module du module adherent
if ($action == 'set') {
    $result = dolibarr_set_const($db, GETPOST('name', 'alpha'), GETPOST('value'), '', 0, '', $conf->entity);
    if ($result < 0) {
        print $db->error();
    }
}
// Action desactivation d'un sous module du module adherent
if ($action == 'unset') {
    $result = dolibarr_del_const($db, GETPOST('name', 'alpha'), $conf->entity);
    if ($result < 0) {
        print $db->error();
    }
}
/*
 * View
 */
$form = new Form($db);
$help_url = 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros';
llxHeader('', $langs->trans("MembersSetup"), $help_url);
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup');
$head = member_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("Members"), 0, 'user');
print load_fiche_titre($langs->trans("MemberMainOptions"), '', '');
Example #28
0
 $result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", $_POST["email_from"], 'chaine', 0, '', $conf->entity);
 if ($result < 0) {
     $error++;
 }
 if (!$error) {
     //var_dump($_POST);
     foreach ($_POST as $key => $val) {
         if (!preg_match('/^NOTIF_(.*)_key$/', $key, $reg)) {
             continue;
         }
         $newval = '';
         $newkey = '';
         $shortkey = preg_replace('/_key$/', '', $key);
         //print $shortkey.'<br>';
         if (preg_match('/^NOTIF_(.*)_old_(.*)_key/', $key, $reg)) {
             dolibarr_del_const($db, 'NOTIFICATION_FIXEDEMAIL_' . $reg[1] . '_THRESHOLD_HIGHER_' . $reg[2], $conf->entity);
             $newkey = 'NOTIFICATION_FIXEDEMAIL_' . $reg[1] . '_THRESHOLD_HIGHER_' . (int) GETPOST($shortkey . '_amount');
             $newval = GETPOST($shortkey . '_key');
             //print $newkey.' - '.$newval.'<br>';
         } else {
             if (preg_match('/^NOTIF_(.*)_new_key/', $key, $reg)) {
                 // Add a new entry
                 $newkey = 'NOTIFICATION_FIXEDEMAIL_' . $reg[1] . '_THRESHOLD_HIGHER_' . (int) GETPOST($shortkey . '_amount');
                 $newval = GETPOST($shortkey . '_key');
             }
         }
         if ($newkey && $newval) {
             $result = dolibarr_set_const($db, $newkey, $newval, 'chaine', 0, '', $conf->entity);
         }
     }
 }
            }
        } else {
            setEventMessage($langs->trans("ErrorModuleNotFound"), 'errors');
            dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
        }
    }
}
// Activate a model
if ($action == 'set') {
    $ret = addDocumentModel($value, $type, $label, $scandir);
} else {
    if ($action == 'del') {
        $ret = delDocumentModel($value, $type);
        if ($ret > 0) {
            if ($conf->global->COMMANDE_ADDON_PDF == "{$value}") {
                dolibarr_del_const($db, 'COMMANDE_ADDON_PDF', $conf->entity);
            }
        }
    } else {
        if ($action == 'setdoc') {
            if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
                // La constante qui a ete lue en avant du nouveau set
                // on passe donc par une variable pour avoir un affichage coherent
                $conf->global->COMMANDE_ADDON_PDF = $value;
            }
            // On active le modele
            $ret = delDocumentModel($value, $type);
            if ($ret > 0) {
                $ret = addDocumentModel($value, $type, $label, $scandir);
            }
        } else {
Example #30
0
    $sql .= " VALUES ('" . $db->escape($value) . "','" . $type . "'," . $conf->entity . ", ";
    $sql .= ($label ? "'" . $db->escape($label) . "'" : 'null') . ", ";
    $sql .= !empty($scandir) ? "'" . $db->escape($scandir) . "'" : "null";
    $sql .= ")";
    if ($db->query($sql)) {
    }
}
if ($action == 'del') {
    $type = 'shipping';
    $sql = "DELETE FROM " . MAIN_DB_PREFIX . "document_model";
    $sql .= " WHERE nom = '" . $db->escape($value) . "'";
    $sql .= " AND type = '" . $type . "'";
    $sql .= " AND entity = " . $conf->entity;
    if ($db->query($sql)) {
        if ($conf->global->EXPEDITION_ADDON_PDF == "{$value}") {
            dolibarr_del_const($db, 'EXPEDITION_ADDON_PDF', $conf->entity);
        }
    }
}
// Set default model
if ($action == 'setdoc') {
    $label = GETPOST('label', 'alpha');
    $scandir = GETPOST('scandir', 'alpha');
    $db->begin();
    if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
        $conf->global->EXPEDITION_ADDON_PDF = $value;
    }
    // On active le modele
    $type = 'shipping';
    $sql_del = "DELETE FROM " . MAIN_DB_PREFIX . "document_model";
    $sql_del .= " WHERE nom = '" . $db->escape($value) . "'";