Minor esthetical change and fix
This commit is contained in:
parent
2e2b3b4be4
commit
ab2b56be13
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -17,11 +17,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/admin/agenda.php
|
* \file htdocs/admin/agenda.php
|
||||||
\ingroup agenda
|
* \ingroup agenda
|
||||||
\brief Page de configuration du module agenda
|
* \brief Page de configuration du module agenda
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
||||||
@ -46,8 +46,9 @@ if ($actionsave)
|
|||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$i+=dolibarr_set_const($db,'MAIN_AGENDA_XCAL_EXPORTKEY',trim($_POST["MAIN_AGENDA_XCAL_EXPORTKEY"]),'chaine',0,'',$conf->entity);
|
$i+=dolibarr_set_const($db,'MAIN_AGENDA_XCAL_EXPORTKEY',trim($_POST["MAIN_AGENDA_XCAL_EXPORTKEY"]),'chaine',0,'',$conf->entity);
|
||||||
|
$i+=dolibarr_set_const($db,'MAIN_AGENDA_EXPORT_CACHE',trim($_POST["MAIN_AGENDA_EXPORT_CACHE"]),'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
if ($i > 0)
|
if ($i >= 2)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||||
@ -83,7 +84,7 @@ print '<form name="agendasetupform" action="'.$_SERVER["PHP_SELF"].'" method="po
|
|||||||
print "<table class=\"noborder\" width=\"100%\">";
|
print "<table class=\"noborder\" width=\"100%\">";
|
||||||
|
|
||||||
print "<tr class=\"liste_titre\">";
|
print "<tr class=\"liste_titre\">";
|
||||||
print "<td width=\"30%\">".$langs->trans("Parameter")."</td>";
|
print "<td>".$langs->trans("Parameter")."</td>";
|
||||||
print "<td>".$langs->trans("Value")."</td>";
|
print "<td>".$langs->trans("Value")."</td>";
|
||||||
//print "<td>".$langs->trans("Examples")."</td>";
|
//print "<td>".$langs->trans("Examples")."</td>";
|
||||||
print "<td> </td>";
|
print "<td> </td>";
|
||||||
@ -95,6 +96,12 @@ print "<td><input type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_XCAL_EXPORTKEY
|
|||||||
print "<td> </td>";
|
print "<td> </td>";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
|
print "<tr class=\"pair\">";
|
||||||
|
print "<td>".$langs->trans("UseACacheDelay")."</td>";
|
||||||
|
print "<td><input type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_EXPORT_CACHE\" value=\"". ($_POST["MAIN_AGENDA_EXPORT_CACHE"]?$_POST["MAIN_AGENDA_EXPORT_CACHE"]:$conf->global->MAIN_AGENDA_EXPORT_CACHE) . "\" size=\"10\"></td>";
|
||||||
|
print "<td> </td>";
|
||||||
|
print "</tr>";
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br><center>';
|
print '<br><center>';
|
||||||
|
|||||||
@ -97,10 +97,13 @@ if (! $filename)
|
|||||||
|
|
||||||
$agenda=new ActionComm($db);
|
$agenda=new ActionComm($db);
|
||||||
|
|
||||||
|
$cachedelay=0;
|
||||||
|
if (! empty($conf->global->MAIN_AGENDA_EXPORT_CACHE)) $cachedelay=$conf->global->MAIN_AGENDA_EXPORT_CACHE;
|
||||||
|
|
||||||
// Build file
|
// Build file
|
||||||
if ($format == 'ical' || $format == 'vcal')
|
if ($format == 'ical' || $format == 'vcal')
|
||||||
{
|
{
|
||||||
$result=$agenda->build_exportfile($format,$type,0,$filename,$filters);
|
$result=$agenda->build_exportfile($format,$type,$cachedelay,$filename,$filters);
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
$attachment = true;
|
$attachment = true;
|
||||||
@ -131,7 +134,7 @@ if ($format == 'ical' || $format == 'vcal')
|
|||||||
|
|
||||||
if ($format == 'rss')
|
if ($format == 'rss')
|
||||||
{
|
{
|
||||||
$result=$agenda->build_exportfile($format,$type,0,$filename,$filters);
|
$result=$agenda->build_exportfile($format,$type,$cachedelay,$filename,$filters);
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
$attachment = false;
|
$attachment = false;
|
||||||
|
|||||||
@ -233,6 +233,7 @@ ErrorCantUseRazInStartedYearIfNoYearMonthInMask=Error, can't user option @ if se
|
|||||||
UMask=UMask parameter for new files on Unix/Linux/BSD file system.
|
UMask=UMask parameter for new files on Unix/Linux/BSD file system.
|
||||||
UMaskExplanation=This parameter allow you to define permissions set by default on files created by Dolibarr on server (during upload for example).<br>It must be the octal value (for example, 0666 means read and write for everyone).<br>Ce paramètre ne sert pas sous un serveur Windows.
|
UMaskExplanation=This parameter allow you to define permissions set by default on files created by Dolibarr on server (during upload for example).<br>It must be the octal value (for example, 0666 means read and write for everyone).<br>Ce paramètre ne sert pas sous un serveur Windows.
|
||||||
SeeWikiForAllTeam=Take a look at the wiki page for full list of all actors and their organisation
|
SeeWikiForAllTeam=Take a look at the wiki page for full list of all actors and their organisation
|
||||||
|
UseACacheDelay = Delay for caching export response in seconds (0 or empty for no cache)
|
||||||
|
|
||||||
# Modules
|
# Modules
|
||||||
Module0Name=Users & groups
|
Module0Name=Users & groups
|
||||||
|
|||||||
@ -233,6 +233,7 @@ ErrorCantUseRazInStartedYearIfNoYearMonthInMask = Erreur, ne peut utiliser l'opt
|
|||||||
UMask = Paramètre UMask des nouveaux fichiers sous Unix/Linux/BSD.
|
UMask = Paramètre UMask des nouveaux fichiers sous Unix/Linux/BSD.
|
||||||
UMaskExplanation = Ce paramètre permet de définir les droits des fichiers créés sur le serveur par Dolibarr (lors d'upload par exemple).<br>Ce doit être la valeur octal (par exemple 0666 signifie lecture/ecriture pour tous).<br>Ce paramètre n'a aucun effet sur un serveur Windows.
|
UMaskExplanation = Ce paramètre permet de définir les droits des fichiers créés sur le serveur par Dolibarr (lors d'upload par exemple).<br>Ce doit être la valeur octal (par exemple 0666 signifie lecture/ecriture pour tous).<br>Ce paramètre n'a aucun effet sur un serveur Windows.
|
||||||
SeeWikiForAllTeam = Voir le wiki pour le détail de tous les acteurs et leur organisation
|
SeeWikiForAllTeam = Voir le wiki pour le détail de tous les acteurs et leur organisation
|
||||||
|
UseACacheDelay = Delay de mise en cache de l'export en secondes (0 ou vide pour aucun cache)
|
||||||
# Modules = undefined
|
# Modules = undefined
|
||||||
Module0Name = Utilisateurs & groupes
|
Module0Name = Utilisateurs & groupes
|
||||||
Module0Desc = Gestion des utilisateurs et groupes
|
Module0Desc = Gestion des utilisateurs et groupes
|
||||||
|
|||||||
@ -32,59 +32,59 @@
|
|||||||
*/
|
*/
|
||||||
function versiontostring($versionarray)
|
function versiontostring($versionarray)
|
||||||
{
|
{
|
||||||
$string='?';
|
$string='?';
|
||||||
if (isset($versionarray[0])) $string=$versionarray[0];
|
if (isset($versionarray[0])) $string=$versionarray[0];
|
||||||
if (isset($versionarray[1])) $string.='.'.$versionarray[1];
|
if (isset($versionarray[1])) $string.='.'.$versionarray[1];
|
||||||
if (isset($versionarray[2])) $string.='.'.$versionarray[2];
|
if (isset($versionarray[2])) $string.='.'.$versionarray[2];
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Compare 2 versions
|
\brief Compare 2 versions
|
||||||
\param versionarray1 Tableau de version (vermajeur,vermineur,autre)
|
\param versionarray1 Tableau de version (vermajeur,vermineur,autre)
|
||||||
\param versionarray2 Tableau de version (vermajeur,vermineur,autre)
|
\param versionarray2 Tableau de version (vermajeur,vermineur,autre)
|
||||||
\return int <0 si versionarray1<versionarray2, 0 si =, >0 si versionarray1>versionarray2
|
\return int <0 si versionarray1<versionarray2, 0 si =, >0 si versionarray1>versionarray2
|
||||||
*/
|
*/
|
||||||
function versioncompare($versionarray1,$versionarray2)
|
function versioncompare($versionarray1,$versionarray2)
|
||||||
{
|
{
|
||||||
$ret=0;
|
$ret=0;
|
||||||
$i=0;
|
$i=0;
|
||||||
while ($i < max(sizeof($versionarray1),sizeof($versionarray1)))
|
while ($i < max(sizeof($versionarray1),sizeof($versionarray1)))
|
||||||
{
|
{
|
||||||
$operande1=isset($versionarray1[$i])?$versionarray1[$i]:0;
|
$operande1=isset($versionarray1[$i])?$versionarray1[$i]:0;
|
||||||
$operande2=isset($versionarray2[$i])?$versionarray2[$i]:0;
|
$operande2=isset($versionarray2[$i])?$versionarray2[$i]:0;
|
||||||
if ($operande1 < $operande2) { $ret = -1; break; }
|
if ($operande1 < $operande2) { $ret = -1; break; }
|
||||||
if ($operande1 > $operande2) { $ret = 1; break; }
|
if ($operande1 > $operande2) { $ret = 1; break; }
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Return version PHP
|
\brief Return version PHP
|
||||||
\return array Tableau de version (vermajeur,vermineur,autre)
|
\return array Tableau de version (vermajeur,vermineur,autre)
|
||||||
*/
|
*/
|
||||||
function versionphparray()
|
function versionphparray()
|
||||||
{
|
{
|
||||||
return split('\.',PHP_VERSION);
|
return split('\.',PHP_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Return version Dolibarr
|
\brief Return version Dolibarr
|
||||||
\return array Tableau de version (vermajeur,vermineur,autre)
|
\return array Tableau de version (vermajeur,vermineur,autre)
|
||||||
*/
|
*/
|
||||||
function versiondolibarrarray()
|
function versiondolibarrarray()
|
||||||
{
|
{
|
||||||
return split('\.',DOL_VERSION);
|
return split('\.',DOL_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Launch a sql file
|
* \brief Launch a sql file
|
||||||
* \param sqlfile Full path to sql file
|
* \param sqlfile Full path to sql file
|
||||||
* \return int <=0 if KO, >0 if OK
|
* \return int <=0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function run_sql($sqlfile,$silent=1)
|
function run_sql($sqlfile,$silent=1)
|
||||||
{
|
{
|
||||||
global $db, $conf, $langs, $user;
|
global $db, $conf, $langs, $user;
|
||||||
@ -114,7 +114,7 @@ function run_sql($sqlfile,$silent=1)
|
|||||||
//print var_dump($versioncommande);
|
//print var_dump($versioncommande);
|
||||||
//print var_dump($versionarray);
|
//print var_dump($versionarray);
|
||||||
if (sizeof($versioncommande) && sizeof($versionarray)
|
if (sizeof($versioncommande) && sizeof($versionarray)
|
||||||
&& versioncompare($versioncommande,$versionarray) <= 0)
|
&& versioncompare($versioncommande,$versionarray) <= 0)
|
||||||
{
|
{
|
||||||
// Version qualified, delete SQL comments
|
// Version qualified, delete SQL comments
|
||||||
$buf=eregi_replace('^-- V([0-9\.]+)','',$buf);
|
$buf=eregi_replace('^-- V([0-9\.]+)','',$buf);
|
||||||
@ -282,13 +282,13 @@ function run_sql($sqlfile,$silent=1)
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Effacement d'une constante dans la base de donnees
|
\brief Effacement d'une constante dans la base de donnees
|
||||||
\sa dolibarr_get_const, dolibarr_sel_const
|
\sa dolibarr_get_const, dolibarr_sel_const
|
||||||
\param db Handler d'acces base
|
\param db Handler d'acces base
|
||||||
\param name Nom ou rowid de la constante
|
\param name Nom ou rowid de la constante
|
||||||
\param entity Multi company id
|
\param entity Multi company id
|
||||||
\return int <0 si ko, >0 si ok
|
\return int <0 si ko, >0 si ok
|
||||||
*/
|
*/
|
||||||
function dolibarr_del_const($db, $name, $entity=1)
|
function dolibarr_del_const($db, $name, $entity=1)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
@ -297,7 +297,7 @@ function dolibarr_del_const($db, $name, $entity=1)
|
|||||||
$sql.=" WHERE (name='".addslashes($name)."' OR rowid='".addslashes($name)."')";
|
$sql.=" WHERE (name='".addslashes($name)."' OR rowid='".addslashes($name)."')";
|
||||||
$sql.= " AND entity = ".$entity;
|
$sql.= " AND entity = ".$entity;
|
||||||
|
|
||||||
dol_syslog("admin.lib::dolibarr_del_const sql=".$sql);
|
dol_syslog("admin.lib::dolibarr_del_const sql=".$sql);
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -311,86 +311,86 @@ function dolibarr_del_const($db, $name, $entity=1)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Recupere une constante depuis la base de donnees.
|
\brief Recupere une constante depuis la base de donnees.
|
||||||
\sa dolibarr_del_const, dolibarr_set_const
|
\sa dolibarr_del_const, dolibarr_set_const
|
||||||
\param db Handler d'acces base
|
\param db Handler d'acces base
|
||||||
\param name Nom de la constante
|
\param name Nom de la constante
|
||||||
\param entity Multi company id
|
\param entity Multi company id
|
||||||
\return string Valeur de la constante
|
\return string Valeur de la constante
|
||||||
*/
|
*/
|
||||||
function dolibarr_get_const($db, $name, $entity=1)
|
function dolibarr_get_const($db, $name, $entity=1)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$value='';
|
$value='';
|
||||||
|
|
||||||
$sql = "SELECT value";
|
$sql = "SELECT value";
|
||||||
$sql.= " FROM llx_const";
|
$sql.= " FROM llx_const";
|
||||||
$sql.= " WHERE name = '".addslashes($name)."'";
|
$sql.= " WHERE name = '".addslashes($name)."'";
|
||||||
$sql.= " AND entity = ".$entity;
|
$sql.= " AND entity = ".$entity;
|
||||||
|
|
||||||
dol_syslog("admin.lib::dolibarr_get_const sql=".$sql);
|
dol_syslog("admin.lib::dolibarr_get_const sql=".$sql);
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$obj=$db->fetch_object($resql);
|
$obj=$db->fetch_object($resql);
|
||||||
if ($obj) $value=$obj->value;
|
if ($obj) $value=$obj->value;
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Insertion d'une constante dans la base de donnees.
|
* \brief Insertion d'une constante dans la base de donnees.
|
||||||
\sa dolibarr_del_const, dolibarr_get_const
|
* \sa dolibarr_del_const, dolibarr_get_const
|
||||||
\param db Handler d'acces base
|
* \param db Handler d'acces base
|
||||||
\param name Nom de la constante
|
* \param name Nom de la constante
|
||||||
\param value Valeur de la constante
|
* \param value Valeur de la constante
|
||||||
\param type Type de constante (chaine par defaut)
|
* \param type Type de constante (chaine par defaut)
|
||||||
\param visible La constante est elle visible (0 par defaut)
|
* \param visible La constante est elle visible (0 par defaut)
|
||||||
\param note Explication de la constante
|
* \param note Note on parameter
|
||||||
\param entity Multi company id
|
* \param entity Multi company id
|
||||||
\return int -1 if KO, 1 if OK
|
* \return int -1 if KO, 1 if OK
|
||||||
*/
|
*/
|
||||||
function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
|
function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
if (empty($name))
|
if (empty($name))
|
||||||
{
|
{
|
||||||
dol_print_error("Error: Call to function dolibarr_set_const with wrong parameters", LOG_ERR);
|
dol_print_error("Error: Call to function dolibarr_set_const with wrong parameters", LOG_ERR);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
//dol_syslog("dolibarr_set_const name=$name, value=$value");
|
//dol_syslog("dolibarr_set_const name=$name, value=$value");
|
||||||
$sql = "DELETE FROM llx_const WHERE name = '".addslashes($name)."'";
|
$sql = "DELETE FROM llx_const WHERE name = '".addslashes($name)."'";
|
||||||
$sql.= " AND entity = ".$entity;
|
$sql.= " AND entity = ".$entity;
|
||||||
dol_syslog("admin.lib::dolibarr_set_const sql=".$sql, LOG_DEBUG);
|
dol_syslog("admin.lib::dolibarr_set_const sql=".$sql, LOG_DEBUG);
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
|
|
||||||
if (strcmp($value,'')) // true if different. Must work for $value='0' or $value=0
|
if (strcmp($value,'')) // true if different. Must work for $value='0' or $value=0
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO llx_const(name,value,type,visible,note,entity)";
|
$sql = "INSERT INTO llx_const(name,value,type,visible,note,entity)";
|
||||||
$sql.= " VALUES ('".$name."','".addslashes($value)."','".$type."',".$visible.",'".addslashes($note)."',".$entity.")";
|
$sql.= " VALUES ('".$name."','".addslashes($value)."','".$type."',".$visible.",'".addslashes($note)."',".$entity.")";
|
||||||
|
|
||||||
dol_syslog("admin.lib::dolibarr_set_const sql=".$sql, LOG_DEBUG);
|
dol_syslog("admin.lib::dolibarr_set_const sql=".$sql, LOG_DEBUG);
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
$conf->global->$name=$value;
|
$conf->global->$name=$value;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$error=$db->lasterror();
|
$error=$db->lasterror();
|
||||||
dol_syslog("admin.lib::dolibarr_set_const ".$error, LOG_ERR);
|
dol_syslog("admin.lib::dolibarr_set_const ".$error, LOG_ERR);
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -890,7 +890,7 @@ else
|
|||||||
// Administrateur
|
// Administrateur
|
||||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Administrator").'</td>';
|
print '<tr><td width="25%" valign="top">'.$langs->trans("Administrator").'</td>';
|
||||||
print '<td>'.yn($fuser->admin);
|
print '<td>'.yn($fuser->admin);
|
||||||
if ($conf->global->MAIN_MODULE_MULTICOMPANY && $fuser->admin && ! $fuser->entity)
|
if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY) && $fuser->admin && ! $fuser->entity)
|
||||||
{
|
{
|
||||||
print ' '.img_redstar($langs->trans("SuperAdministrator"));
|
print ' '.img_redstar($langs->trans("SuperAdministrator"));
|
||||||
}
|
}
|
||||||
@ -912,7 +912,7 @@ else
|
|||||||
{
|
{
|
||||||
print $langs->trans("DomainUser",$ldap->domainFQDN);
|
print $langs->trans("DomainUser",$ldap->domainFQDN);
|
||||||
}
|
}
|
||||||
else if ($fuser->entity!=0)
|
else if (empty($conf->global->MAIN_MODULE_MULTICOMPANY) || ! empty($fuser->entity))
|
||||||
{
|
{
|
||||||
print $html->textwithpicto($langs->trans("Internal"),$langs->trans("InternalExternalDesc"));
|
print $html->textwithpicto($langs->trans("Internal"),$langs->trans("InternalExternalDesc"));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user