21if (!defined(
'NOTOKENRENEWAL')) {
22 define(
'NOTOKENRENEWAL',
'1');
24if (!defined(
'NOREQUIREMENU')) {
25 define(
'NOREQUIREMENU',
'1');
27if (!defined(
'NOREQUIREHTML')) {
28 define(
'NOREQUIREHTML',
'1');
30if (!defined(
'NOREQUIREAJAX')) {
31 define(
'NOREQUIREAJAX',
'1');
33if (!defined(
'NOREQUIRESOC')) {
34 define(
'NOREQUIRESOC',
'1');
38require
'../../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/variants/class/ProductAttribute.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/variants/class/ProductAttributeValue.class.php';
55if ($user->socid > 0) {
70 print json_encode(array(
71 'error' =>
'ID not set'
78if ($prodattr->fetch($id) < 0) {
79 print json_encode(array(
80 'error' =>
'Attribute not found'
87$res = $prodattrval->fetchAllByProductAttribute($id,
false, 1);
89print json_encode($res, JSON_PARTIAL_OUTPUT_ON_ERROR);
$id
Support class for third parties, contacts, members, users or resources.
Class ProductAttribute Used to represent a Product attribute Examples:
Class ProductAttributeValue Used to represent a product attribute value.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
isModEnabled($module)
Is Dolibarr module enabled.
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.