2
0
forked from Wavyzz/dolibarr

Fix: Fix GNU address

Doxygen
This commit is contained in:
Laurent Destailleur
2011-09-03 01:24:09 +00:00
parent f39c932b2e
commit d53b179102
41 changed files with 1049 additions and 979 deletions

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -42,16 +43,27 @@ $action=GETPOST('action');
* Actions
*/
if ($_POST["action"] == 'updateMask')
if ($action == 'updateMask')
{
$maskconstproject=$_POST['maskconstproject'];
$maskproject=$_POST['maskproject'];
if ($maskconstproject) dolibarr_set_const($db,$maskconstproject,$maskproject,'chaine',0,'',$conf->entity);
$maskconstproject=GETPOST("maskconstproject");
$maskproject=GETPOST("maskproject");
if ($maskconstproject) $res = dolibarr_set_const($db,$maskconstproject,$maskproject,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
}
}
if ($_GET["action"] == 'specimen')
if ($action == 'specimen')
{
$modele=$_GET["module"];
$modele=GETPOST("module");
$project = new Project($db);
$project->initAsSpecimen();
@@ -84,13 +96,16 @@ if ($_GET["action"] == 'specimen')
}
}
if ($_GET["action"] == 'set')
if ($action == 'set')
{
$label = GETPOST("label");
$scandir = GETPOST("scandir");
$type='project';
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
$sql.= " VALUES ('".$db->escape($_GET["value"])."','".$type."',".$conf->entity.", ";
$sql.= ($_GET["label"]?"'".$db->escape($_GET["label"])."'":'null').", ";
$sql.= (! empty($_GET["scandir"])?"'".$db->escape($_GET["scandir"])."'":"null");
$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))
{
@@ -98,7 +113,7 @@ if ($_GET["action"] == 'set')
}
}
if ($_GET["action"] == 'del')
if ($action == 'del')
{
$type='project';
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
@@ -111,27 +126,30 @@ if ($_GET["action"] == 'del')
}
}
if ($_GET["action"] == 'setdoc')
if ($action == 'setdoc')
{
$label = GETPOST("label");
$scandir = GETPOST("scandir");
$db->begin();
if (dolibarr_set_const($db, "PROJECT_ADDON_PDF",$_GET["value"],'chaine',0,'',$conf->entity))
if (dolibarr_set_const($db, "PROJECT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
$conf->global->PROJECT_ADDON_PDF = $_GET["value"];
$conf->global->PROJECT_ADDON_PDF = $value;
}
// On active le modele
$type='project';
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
$sql_del.= " WHERE nom = '".$db->escape($_GET["value"])."'";
$sql_del.= " WHERE nom = '".$db->escape($value)."'";
$sql_del.= " AND type = '".$type."'";
$sql_del.= " AND entity = ".$conf->entity;
$result1=$db->query($sql_del);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
$sql.= " VALUES ('".$db->escape($_GET["value"])."', '".$type."', ".$conf->entity.", ";
$sql.= ($_GET["label"]?"'".$db->escape($_GET["label"])."'":'null').", ";
$sql.= (! empty($_GET["scandir"])?"'".$db->escape($_GET["scandir"])."'":"null");
$sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", ";
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
$sql.= ")";
$result2=$db->query($sql);
if ($result1 && $result2)
@@ -144,7 +162,7 @@ if ($_GET["action"] == 'setdoc')
}
}
if ($_GET["action"] == 'setmod')
if ($action == 'setmod')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
@@ -380,5 +398,9 @@ if (is_resource($handle))
print '</table><br/>';
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();
?>