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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
0d0fda8f
Commit
0d0fda8f
authored
Jan 27, 2014
by
Laurent Destailleur
Browse files
Options
Downloads
Plain Diff
Merge pull request #1382 from atm-geoffrey/develop
Add new doActions and formObjectOptions hook on supplier prices page
parents
9cf745b1
7f59def9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/fourn/class/fournisseur.product.class.php
+20
-3
20 additions, 3 deletions
htdocs/fourn/class/fournisseur.product.class.php
htdocs/product/fournisseurs.php
+10
-0
10 additions, 0 deletions
htdocs/product/fournisseurs.php
with
30 additions
and
3 deletions
htdocs/fourn/class/fournisseur.product.class.php
+
20
−
3
View file @
0d0fda8f
...
...
@@ -199,11 +199,28 @@ class ProductFournisseur extends Product
dol_syslog
(
get_class
(
$this
)
.
'::update_buyprice sql='
.
$sql
);
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
$resql
)
{
// Appel des triggers
include_once
(
DOL_DOCUMENT_ROOT
.
"/core/class/interfaces.class.php"
);
$interface
=
new
Interfaces
(
$this
->
db
);
$result
=
$interface
->
run_triggers
(
'UPDATE_BUYPRICE'
,
$this
,
$user
,
$langs
,
$conf
);
if
(
$result
<
0
)
{
$error
++
;
$this
->
errors
=
$interface
->
errors
;
}
if
(
empty
(
$error
))
{
$this
->
db
->
commit
();
return
0
;
}
else
{
$this
->
db
->
rollback
();
return
1
;
}
}
else
{
$this
->
error
=
$this
->
db
->
error
()
.
" sql="
.
$sql
;
$this
->
db
->
rollback
();
...
...
This diff is collapsed.
Click to expand it.
htdocs/product/fournisseurs.php
+
10
−
0
View file @
0d0fda8f
...
...
@@ -73,6 +73,10 @@ if (! $sortorder) $sortorder="ASC";
* Actions
*/
$parameters
=
array
(
'socid'
=>
$socid
,
'id_prod'
=>
$id
);
$reshook
=
$hookmanager
->
executeHooks
(
'doActions'
,
$parameters
,
$object
,
$action
);
// Note that $action and $object may have been modified by some hooks
$error
=
$hookmanager
->
error
;
$errors
=
array_merge
(
$errors
,
(
array
)
$hookmanager
->
errors
);
if
(
$action
==
'remove_pf'
)
{
$product
=
new
ProductFournisseur
(
$db
);
...
...
@@ -386,6 +390,12 @@ if ($id || $ref)
print
'</tr>'
;
}
if
(
is_object
(
$hookmanager
))
{
$parameters
=
array
(
'id_fourn'
=>
$id_fourn
,
'prod_id'
=>
$product
->
id
);
$reshook
=
$hookmanager
->
executeHooks
(
'formObjectOptions'
,
$parameters
,
$object
,
$action
);
}
print
'</table>'
;
print
'<br><center><input class="button" type="submit" value="'
.
$langs
->
trans
(
"Save"
)
.
'">'
;
...
...
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