Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
769d1d42
Commit
769d1d42
authored
18 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Ajout gestion des triggers suivants:
ORDER_CREATE ORDER_SUPPLIER_CREATE ORDER_VALIDATE ORDER_SUPPLIER_VALIDATE
parent
ad6494eb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/fourn/fournisseur.commande.class.php
+38
-30
38 additions, 30 deletions
htdocs/fourn/fournisseur.commande.class.php
with
38 additions
and
30 deletions
htdocs/fourn/fournisseur.commande.class.php
+
38
−
30
View file @
769d1d42
...
...
@@ -258,39 +258,47 @@ class CommandeFournisseur extends Commande
}
}
/**
* Annule la commande
* L'annulation se fait aprs la validation
*/
function
Cancel
(
$user
)
{
//dolibarr_syslog("CommandeFournisseur::Cancel");
$result
=
0
;
if
(
$user
->
rights
->
fournisseur
->
commande
->
annuler
)
/**
* \brief Annule la commande
* \param user Utilisateur qui demande annulation
* \remarks L'annulation se fait aprs la validation
*/
function
Cancel
(
$user
)
{
//dolibarr_syslog("CommandeFournisseur::Cancel");
$result
=
0
;
if
(
$user
->
rights
->
fournisseur
->
commande
->
annuler
)
{
$statut
=
6
;
$sql
=
"UPDATE "
.
MAIN_DB_PREFIX
.
"commande_fournisseur SET fk_statut = "
.
$statut
;
$sql
.
=
" WHERE rowid = "
.
$this
->
id
.
" AND fk_statut = 1 ;"
;
if
(
$this
->
db
->
query
(
$sql
)
)
{
$result
=
0
;
$this
->
log
(
$user
,
$statut
,
time
());
// Appel des triggers
include_once
(
DOL_DOCUMENT_ROOT
.
"/interfaces.class.php"
);
$interface
=
new
Interfaces
(
$this
->
db
);
$result
=
$interface
->
run_triggers
(
'ORDER_SUPPLIER_VALIDATE'
,
$this
,
$user
,
$langs
,
$conf
);
// Fin appel triggers
$statut
=
6
;
$sql
=
"UPDATE "
.
MAIN_DB_PREFIX
.
"commande_fournisseur SET fk_statut = "
.
$statut
;
$sql
.
=
" WHERE rowid = "
.
$this
->
id
.
" AND fk_statut = 1 ;"
;
if
(
$this
->
db
->
query
(
$sql
)
)
{
$result
=
0
;
$this
->
log
(
$user
,
$statut
,
time
());
}
else
{
dolibarr_syslog
(
"CommandeFournisseur::Cancel Error -1"
);
$result
=
-
1
;
}
}
else
{
dolibarr_syslog
(
"CommandeFournisseur::Cancel Not Authorized"
);
return
1
;
}
else
{
dolibarr_syslog
(
"CommandeFournisseur::Cancel Error -1"
);
return
-
1
;
}
}
else
{
dolibarr_syslog
(
"CommandeFournisseur::Cancel Not Authorized"
);
return
-
1
;
}
}
return
$result
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment