projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit 'origin/master' into hruid.
[platal.git]
/
include
/
validations.inc.php
diff --git
a/include/validations.inc.php
b/include/validations.inc.php
index
10bfc82
..
12ec281
100644
(file)
--- a/
include/validations.inc.php
+++ b/
include/validations.inc.php
@@
-21,7
+21,8
@@
define('SIZE_MAX', 32768);
define('SIZE_MAX', 32768);
-require_once dirname(__FILE__) . '/../classes/xdb.php';
+global $globals;
+require_once $globals->spoolroot . '/core/classes/xdb.php';
/**
* Iterator class, that lists objects through the database
/**
* Iterator class, that lists objects through the database
@@
-116,7
+117,7
@@
abstract class Validate
$this->uid, $this->type, $this, $this->stamp);
global $globals;
$this->uid, $this->type, $this, $this->stamp);
global $globals;
-
update_
NbValid();
+
$globals->update
NbValid();
return true;
}
return true;
}
@@
-146,7
+147,7
@@
abstract class Validate
$success = XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?} AND stamp={?}',
$this->uid, $this->type, $this->stamp);
}
$success = XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?} AND stamp={?}',
$this->uid, $this->type, $this->stamp);
}
-
update_
NbValid();
+
$globals->update
NbValid();
return $success;
}
return $success;
}
@@
-159,7
+160,7
@@
abstract class Validate
{
if (Env::has('delete')) {
$this->clean();
{
if (Env::has('delete')) {
$this->clean();
- $this->trig
('reque
te supprimée');
+ $this->trig
Success('Requê
te supprimée');
return true;
}
return true;
}
@@
-167,7
+168,7
@@
abstract class Validate
if (Env::has('edit')) {
if ($this->handle_editor()) {
$this->update();
if (Env::has('edit')) {
if ($this->handle_editor()) {
$this->update();
- $this->trig
('r
equête mise à jour');
+ $this->trig
Success('R
equête mise à jour');
return true;
}
return false;
return true;
}
return false;
@@
-202,7
+203,7
@@
abstract class Validate
$mailer->send();
$this->update();
$mailer->send();
$this->update();
- $this->trig
('c
ommentaire ajouté');
+ $this->trig
Success('C
ommentaire ajouté');
return true;
}
return true;
}
@@
-210,10
+211,10
@@
abstract class Validate
if ($this->commit()) {
$this->sendmail(true);
$this->clean();
if ($this->commit()) {
$this->sendmail(true);
$this->clean();
- $this->trig
('mail
envoyé');
+ $this->trig
Success('Mail de validation
envoyé');
return true;
} else {
return true;
} else {
- $this->trig
('e
rreur lors de la validation');
+ $this->trig
Error('E
rreur lors de la validation');
return false;
}
}
return false;
}
}
@@
-222,10
+223,10
@@
abstract class Validate
if (Env::v('comm')) {
$this->sendmail(false);
$this->clean();
if (Env::v('comm')) {
$this->sendmail(false);
$this->clean();
- $this->trig
('mail
envoyé');
+ $this->trig
Success('Mail de refus
envoyé');
return true;
} else {
return true;
} else {
- $this->trig('pas de motivation pour le refus !!!');
+ $this->trig
Error
('pas de motivation pour le refus !!!');
}
}
}
}
@@
-256,10
+257,19
@@
abstract class Validate
// }}}
// {{{ function trig()
// }}}
// {{{ function trig()
- protected function trig($msg)
+ protected function trig
Error
($msg)
{
{
- global $page;
- $page->trig($msg);
+ Platal::page()->trigError($msg);
+ }
+
+ protected function trigWarning($msg)
+ {
+ Platal::page()->trigWarning($msg);
+ }
+
+ protected function trigSuccess($msg)
+ {
+ Platal::page()->trigSuccess($msg);
}
// }}}
}
// }}}