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
9c1545bc
Commit
9c1545bc
authored
9 years ago
by
Maxime Kohlhaas
Browse files
Options
Downloads
Patches
Plain Diff
NEW add info page on product card
parent
826592c4
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/core/lib/product.lib.php
+6
-0
6 additions, 0 deletions
htdocs/core/lib/product.lib.php
htdocs/product/info.php
+108
-0
108 additions, 0 deletions
htdocs/product/info.php
with
114 additions
and
0 deletions
htdocs/core/lib/product.lib.php
+
6
−
0
View file @
9c1545bc
...
@@ -135,6 +135,12 @@ function product_prepare_head($object)
...
@@ -135,6 +135,12 @@ function product_prepare_head($object)
complete_head_from_modules
(
$conf
,
$langs
,
$object
,
$head
,
$h
,
'product'
,
'remove'
);
complete_head_from_modules
(
$conf
,
$langs
,
$object
,
$head
,
$h
,
'product'
,
'remove'
);
// Log
$head
[
$h
][
0
]
=
DOL_URL_ROOT
.
'/product/info.php?id='
.
$object
->
id
;
$head
[
$h
][
1
]
=
$langs
->
trans
(
"Info"
);
$head
[
$h
][
2
]
=
'info'
;
$h
++
;
return
$head
;
return
$head
;
}
}
...
...
This diff is collapsed.
Click to expand it.
htdocs/product/info.php
0 → 100644
+
108
−
0
View file @
9c1545bc
<?php
/* Copyright (C) 2015 Maxime Kohlhaas <maxime@atm-consulting.fr>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/product/info.php
* \ingroup product
* \brief Information page for product
*/
require
'../main.inc.php'
;
require_once
DOL_DOCUMENT_ROOT
.
'/core/lib/functions2.lib.php'
;
require_once
DOL_DOCUMENT_ROOT
.
'/core/lib/product.lib.php'
;
require_once
DOL_DOCUMENT_ROOT
.
'/product/class/product.class.php'
;
$langs
->
load
(
"product"
);
$langs
->
load
(
"other"
);
if
(
!
empty
(
$conf
->
notification
->
enabled
))
$langs
->
load
(
"mails"
);
// Security check
$id
=
GETPOST
(
'id'
,
'int'
);
$ref
=
GETPOST
(
'ref'
,
'alpha'
);
$result
=
restrictedArea
(
$user
,
'produit|service'
,
$id
,
'product&product'
);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager
->
initHooks
(
array
(
'infoproduct'
));
$object
=
new
Product
(
$db
);
/*
* Actions
*/
$parameters
=
array
(
'id'
=>
$id
);
$reshook
=
$hookmanager
->
executeHooks
(
'doActions'
,
$parameters
,
$object
,
$action
);
// Note that $action and $object may have been modified by some hooks
if
(
$reshook
<
0
)
setEventMessages
(
$hookmanager
->
error
,
$hookmanager
->
errors
,
'errors'
);
/*
* View
*/
$form
=
new
Form
(
$b
);
$title
=
$langs
->
trans
(
"Product"
);
$helpurl
=
''
;
if
(
GETPOST
(
"type"
)
==
'0'
||
(
$object
->
type
==
Product
::
TYPE_PRODUCT
))
$helpurl
=
'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'
;
if
(
GETPOST
(
"type"
)
==
'1'
||
(
$object
->
type
==
Product
::
TYPE_SERVICE
))
$helpurl
=
'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'
;
llxHeader
(
''
,
$title
,
$help_url
);
if
(
$id
>
0
||
$ref
)
{
$result
=
$object
->
fetch
(
$id
,
$ref
);
if
(
!
$result
)
{
$langs
->
load
(
"errors"
);
print
$langs
->
trans
(
"ErrorRecordNotFound"
);
llxFooter
();
$db
->
close
();
exit
;
}
$head
=
product_prepare_head
(
$object
);
$titre
=
$langs
->
trans
(
"CardProduct"
.
$object
->
type
);
$picto
=
(
$object
->
type
==
Product
::
TYPE_SERVICE
?
'service'
:
'product'
);
dol_fiche_head
(
$head
,
'info'
,
$titre
,
0
,
$picto
);
$linkback
=
'<a href="'
.
DOL_URL_ROOT
.
'/product/list.php">'
.
$langs
->
trans
(
"BackToList"
)
.
'</a>'
;
dol_banner_tab
(
$object
,
'ref'
,
''
,
(
$user
->
societe_id
?
0
:
1
),
'ref'
);
$object
->
info
(
$object
->
id
);
print
'<div class="fichecenter">'
;
print
'<div class="underbanner clearboth"></div>'
;
print
'<br>'
;
dol_print_object_info
(
$object
);
print
'</div>'
;
dol_fiche_end
();
}
llxFooter
();
$db
->
close
();
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