Fix: the rename function is bugged with some windows. I add a
workaround. Fix: Add also a workaround for [ bug 1064 ] Date/Time in ICS incorrect.
This commit is contained in:
parent
74d6698f7d
commit
88ae0a7945
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
@ -48,8 +48,9 @@ if ($actionsave)
|
|||||||
$i+=dolibarr_set_const($db,'MAIN_AGENDA_XCAL_EXPORTKEY',trim(GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha')),'chaine',0,'',$conf->entity);
|
$i+=dolibarr_set_const($db,'MAIN_AGENDA_XCAL_EXPORTKEY',trim(GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha')),'chaine',0,'',$conf->entity);
|
||||||
$i+=dolibarr_set_const($db,'MAIN_AGENDA_EXPORT_PAST_DELAY',trim(GETPOST('MAIN_AGENDA_EXPORT_PAST_DELAY','alpha')),'chaine',0,'',$conf->entity);
|
$i+=dolibarr_set_const($db,'MAIN_AGENDA_EXPORT_PAST_DELAY',trim(GETPOST('MAIN_AGENDA_EXPORT_PAST_DELAY','alpha')),'chaine',0,'',$conf->entity);
|
||||||
$i+=dolibarr_set_const($db,'MAIN_AGENDA_EXPORT_CACHE',trim(GETPOST('MAIN_AGENDA_EXPORT_CACHE','alpha')),'chaine',0,'',$conf->entity);
|
$i+=dolibarr_set_const($db,'MAIN_AGENDA_EXPORT_CACHE',trim(GETPOST('MAIN_AGENDA_EXPORT_CACHE','alpha')),'chaine',0,'',$conf->entity);
|
||||||
|
$i+=dolibarr_set_const($db,'AGENDA_EXPORT_FIX_TZ',trim(GETPOST('AGENDA_EXPORT_FIX_TZ','alpha')),'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
if ($i >= 3)
|
if ($i >= 4)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessage($langs->trans("SetupSaved"));
|
||||||
@ -117,6 +118,24 @@ print "</tr>";
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
print "<table class=\"noborder\" width=\"100%\">";
|
||||||
|
|
||||||
|
print "<tr class=\"liste_titre\">";
|
||||||
|
print '<td width="25%">'.$langs->trans("Parameter")."</td>";
|
||||||
|
print "<td>".$langs->trans("Value")."</td>";
|
||||||
|
print "</tr>";
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print '<td class="fieldrequired">'.$langs->trans("FixTZ")."</td>";
|
||||||
|
print "<td>";
|
||||||
|
print '<input class="flat" type="text" size="4" name="AGENDA_EXPORT_FIX_TZ" value="'.$conf->global->AGENDA_EXPORT_FIX_TZ.'">';
|
||||||
|
print ' '.$langs->trans("FillThisOnlyIfRequired");
|
||||||
|
print "</td>";
|
||||||
|
print "</tr>";
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
print '<br><center>';
|
print '<br><center>';
|
||||||
print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">";
|
print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">";
|
||||||
print "</center>";
|
print "</center>";
|
||||||
|
|||||||
@ -824,6 +824,7 @@ class ActionComm extends CommonObject
|
|||||||
|
|
||||||
require_once (DOL_DOCUMENT_ROOT ."/core/lib/xcal.lib.php");
|
require_once (DOL_DOCUMENT_ROOT ."/core/lib/xcal.lib.php");
|
||||||
require_once (DOL_DOCUMENT_ROOT ."/core/lib/date.lib.php");
|
require_once (DOL_DOCUMENT_ROOT ."/core/lib/date.lib.php");
|
||||||
|
require_once (DOL_DOCUMENT_ROOT ."/core/lib/files.lib.php");
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::build_exportfile Build export file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".count($filters), LOG_DEBUG);
|
dol_syslog(get_class($this)."::build_exportfile Build export file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".count($filters), LOG_DEBUG);
|
||||||
|
|
||||||
@ -943,8 +944,8 @@ class ActionComm extends CommonObject
|
|||||||
$event=array();
|
$event=array();
|
||||||
$event['uid']='dolibarragenda-'.$this->db->database_name.'-'.$obj->id."@".$_SERVER["SERVER_NAME"];
|
$event['uid']='dolibarragenda-'.$this->db->database_name.'-'.$obj->id."@".$_SERVER["SERVER_NAME"];
|
||||||
$event['type']=$type;
|
$event['type']=$type;
|
||||||
$datestart=$this->db->jdate($obj->datep);
|
$datestart=$this->db->jdate($obj->datep)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600));
|
||||||
$dateend=$this->db->jdate($obj->datep2);
|
$dateend=$this->db->jdate($obj->datep2)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600));
|
||||||
$duration=$obj->durationp;
|
$duration=$obj->durationp;
|
||||||
$event['summary']=$obj->label.($obj->socname?" (".$obj->socname.")":"");
|
$event['summary']=$obj->label.($obj->socname?" (".$obj->socname.")":"");
|
||||||
$event['desc']=$obj->note;
|
$event['desc']=$obj->note;
|
||||||
@ -963,8 +964,8 @@ class ActionComm extends CommonObject
|
|||||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||||
$url=$urlwithroot.'/comm/action/fiche.php?id='.$obj->id;
|
$url=$urlwithroot.'/comm/action/fiche.php?id='.$obj->id;
|
||||||
$event['url']=$url;
|
$event['url']=$url;
|
||||||
$event['created']=$this->db->jdate($obj->datec);
|
$event['created']=$this->db->jdate($obj->datec)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600));
|
||||||
$event['modified']=$this->db->jdate($obj->datem);
|
$event['modified']=$this->db->jdate($obj->datem)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600));
|
||||||
|
|
||||||
if ($qualified && $datestart)
|
if ($qualified && $datestart)
|
||||||
{
|
{
|
||||||
@ -1011,10 +1012,11 @@ class ActionComm extends CommonObject
|
|||||||
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
if (rename($outputfiletmp,$outputfile)) $result=1;
|
if (dol_move($outputfiletmp,$outputfile,0,1)) $result=1;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::build_exportfile failed to rename ".$outputfiletmp." to ".$outputfile, LOG_ERR);
|
$this->error='Failed to rename '.$outputfiletmp.' into '.$outputfile;
|
||||||
|
dol_syslog(get_class($this)."::build_exportfile ".$this->error, LOG_ERR);
|
||||||
dol_delete_file($outputfiletmp,0,1);
|
dol_delete_file($outputfiletmp,0,1);
|
||||||
$result=-1;
|
$result=-1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -531,13 +531,24 @@ function dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
|
|||||||
$result=false;
|
$result=false;
|
||||||
|
|
||||||
dol_syslog("files.lib.php::dol_move srcfile=".$srcfile." destfile=".$destfile." newmask=".$newmask." overwritifexists=".$overwriteifexists);
|
dol_syslog("files.lib.php::dol_move srcfile=".$srcfile." destfile=".$destfile." newmask=".$newmask." overwritifexists=".$overwriteifexists);
|
||||||
if ($overwriteifexists || ! dol_is_file($destfile))
|
$destexists=dol_is_file($destfile);
|
||||||
|
if ($overwriteifexists || ! $destexists)
|
||||||
{
|
{
|
||||||
$newpathofsrcfile=dol_osencode($srcfile);
|
$newpathofsrcfile=dol_osencode($srcfile);
|
||||||
$newpathofdestfile=dol_osencode($destfile);
|
$newpathofdestfile=dol_osencode($destfile);
|
||||||
|
|
||||||
$result=@rename($newpathofsrcfile, $newpathofdestfile); // To see errors, remove @
|
$result=@rename($newpathofsrcfile, $newpathofdestfile); // To see errors, remove @
|
||||||
if (! $result) dol_syslog("files.lib.php::dol_move failed", LOG_WARNING);
|
if (! $result)
|
||||||
|
{
|
||||||
|
if ($destexists)
|
||||||
|
{
|
||||||
|
dol_syslog("files.lib.php::dol_move failed. We try to delete first and move after.", LOG_WARNING);
|
||||||
|
// We force delete and try again. Rename function sometimes fails to replace dest file with some windows NTFS partitions.
|
||||||
|
dol_delete_file($destfile);
|
||||||
|
$result=@rename($newpathofsrcfile, $newpathofdestfile); // To see errors, remove @
|
||||||
|
}
|
||||||
|
else dol_syslog("files.lib.php::dol_move failed", LOG_WARNING);
|
||||||
|
}
|
||||||
if (empty($newmask) && ! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;
|
if (empty($newmask) && ! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;
|
||||||
@chmod($newpathofsrcfile, octdec($newmask));
|
@chmod($newpathofsrcfile, octdec($newmask));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1008,6 +1008,8 @@ XDebugInstalled=XDebug est chargé.
|
|||||||
XCacheInstalled=XCache is loaded.
|
XCacheInstalled=XCache is loaded.
|
||||||
AddRefInList=Display customer/supplier ref into list (select list or combobox) and most of hyperlink
|
AddRefInList=Display customer/supplier ref into list (select list or combobox) and most of hyperlink
|
||||||
FieldEdition=Edition of field %s
|
FieldEdition=Edition of field %s
|
||||||
|
FixTZ=TimeZone fix
|
||||||
|
FillThisOnlyIfRequired=Example: +2 (fill only if timezone offset problems are experienced)
|
||||||
##### Module password generation
|
##### Module password generation
|
||||||
PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: 8 characters containing shared numbers and characters in lowercase.
|
PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: 8 characters containing shared numbers and characters in lowercase.
|
||||||
PasswordGenerationNone=Do not suggest any generated password. Password must be type in manually.
|
PasswordGenerationNone=Do not suggest any generated password. Password must be type in manually.
|
||||||
|
|||||||
@ -1050,6 +1050,8 @@ XDebugInstalled=XDebug est chargé.
|
|||||||
XCacheInstalled=XCache est chargé.
|
XCacheInstalled=XCache est chargé.
|
||||||
AddRefInList=Afficher le code client/fournisseur dans les liste (déroulante ou autocomplétion) et dans la pluspart des hyperliens
|
AddRefInList=Afficher le code client/fournisseur dans les liste (déroulante ou autocomplétion) et dans la pluspart des hyperliens
|
||||||
FieldEdition=Édition du champ %s
|
FieldEdition=Édition du champ %s
|
||||||
|
FixTZ=Correction du Timezone
|
||||||
|
FillThisOnlyIfRequired=Exemple: +2 (ne remplir que si un décalage d'heure est constaté dans l'export)
|
||||||
##### Module password generation
|
##### Module password generation
|
||||||
PasswordGenerationStandard=Renvoie un mot de passe généré selon l'algorithme interne de Dolibarr : 8 caractères, chiffres et caractères en minuscules mélangés.
|
PasswordGenerationStandard=Renvoie un mot de passe généré selon l'algorithme interne de Dolibarr : 8 caractères, chiffres et caractères en minuscules mélangés.
|
||||||
PasswordGenerationNone=Ne propose pas de mots de passe générés. Le mot de passe est à saisir manuellement.
|
PasswordGenerationNone=Ne propose pas de mots de passe générés. Le mot de passe est à saisir manuellement.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user