Ajout de la notification

This commit is contained in:
Rodolphe Quiedeville 2003-06-30 17:34:10 +00:00
parent d407f6a65d
commit df41045d9b

View File

@ -1,5 +1,5 @@
<?PHP <?PHP
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* *
* 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
@ -20,7 +20,8 @@
* *
*/ */
class Fichinter { class Fichinter
{
var $id; var $id;
var $db; var $db;
var $socidp; var $socidp;
@ -177,6 +178,7 @@ class Fichinter {
*/ */
Function valid($userid, $outputdir) Function valid($userid, $outputdir)
{ {
$action_notify = 1; // ne pas modifier cette valeur
$this->fetch($this->id); $this->fetch($this->id);
@ -189,8 +191,8 @@ class Fichinter {
* Set generates files readonly * Set generates files readonly
* *
*/ */
umask(0);
$file = $outputdir . "/$this->ref/$this->ref.tex"; $file = $outputdir . "/$this->ref/$this->ref.tex";
print $file;
if (is_writeable($file)) if (is_writeable($file))
{ {
chmod($file, 0444); chmod($file, 0444);
@ -200,10 +202,21 @@ class Fichinter {
{ {
chmod($file, 0444); chmod($file, 0444);
} }
$file = $outputdir . "/$this->ref/$this->ref.pdf"; $filepdf = FICHEINTER_OUTPUTDIR . "/$this->ref/$this->ref.pdf";
if (is_writeable($file)) { if (is_writeable($filepdf))
chmod($file, 0444); {
} chmod($filepdf, 0444);
}
/*
* Notify
*
*/
$mesg = "La fiche d'intervention ".$this->ref." a été validée.\n";
$notify = New Notify($this->db);
$notify->send($action_notify, $mesg, $filepdf);
return 1; return 1;
} }
else else