Bilansext : Diverses corrections
This commit is contained in:
parent
4efa250eb2
commit
1681173277
@ -53,7 +53,7 @@ $db = Zend_Db::factory($c->profil->db->metier);
|
|||||||
Zend_Db_Table_Abstract::setDefaultAdapter($db);
|
Zend_Db_Table_Abstract::setDefaultAdapter($db);
|
||||||
|
|
||||||
$pathSend = $c->profil->path->storage . '/clients/bilansext/send';
|
$pathSend = $c->profil->path->storage . '/clients/bilansext/send';
|
||||||
$pathBackup = $c->profil->path->storage . '/clients/bilansext/done';
|
$pathBackup = $c->profil->path->storage . '/clients/bilansext/send/done';
|
||||||
|
|
||||||
// Lecture du dossier des dépots de bilans à demander en saisie
|
// Lecture du dossier des dépots de bilans à demander en saisie
|
||||||
if ($opts->source == 'extranet')
|
if ($opts->source == 'extranet')
|
||||||
@ -65,17 +65,16 @@ if ($opts->source == 'extranet')
|
|||||||
{
|
{
|
||||||
if ($filename != '.' && $filename != '..' && substr($filename, -4) == '.pdf')
|
if ($filename != '.' && $filename != '..' && substr($filename, -4) == '.pdf')
|
||||||
{
|
{
|
||||||
if (preg_match('/([0-9]{9})_([0-9]{8})_([0-9]{2})_([0-9]{1})_([0-9]{1,})_([0-9]{1,}).pdf/', $filename, $t))
|
if (preg_match('/([0-9]{9})_([0-9]{8})_([0-9]{2})_([0-9]{1})_([0-9]{1,})_([0-9]{1,}).pdf/', $filename, $t))
|
||||||
{
|
{
|
||||||
$filetime = date('YmdHis', filectime($pathSend.'/'.$filename));
|
$filetime = date('YmdHis', filectime($pathSend.'/'.$filename));
|
||||||
|
|
||||||
|
$siren = $t[1];
|
||||||
$siren = $t[0];
|
$cloture = $t[2];
|
||||||
$cloture = $t[1];
|
$duree = $t[3];
|
||||||
$duree = $t[2];
|
$confidentiel = $t[4];
|
||||||
$confidentiel = $t[2];
|
$userId = $t[5];
|
||||||
$userId = $t[4];
|
$extranetId = $t[6];
|
||||||
$extranetId = $t[5];
|
|
||||||
|
|
||||||
if ( false !== ( $file = file_get_contents($pathSend.'/'.$filename) ) )
|
if ( false !== ( $file = file_get_contents($pathSend.'/'.$filename) ) )
|
||||||
{
|
{
|
||||||
@ -115,8 +114,8 @@ if ($opts->source == 'extranet')
|
|||||||
|
|
||||||
//Copier le fichier
|
//Copier le fichier
|
||||||
if ($insertOk === true) {
|
if ($insertOk === true) {
|
||||||
if (!copy($pathSend.'/'.$filename, $pathBackup.'/'.$filename)) {
|
if (!rename($pathSend.'/'.$filename, $pathBackup.'/'.$filename)) {
|
||||||
echo date('Y-m-d H:i:s') ." - Impossible de copier le fichier $filename.\n";
|
echo date('Y-m-d H:i:s') ." - Impossible de déplacer le fichier $filename.\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user