Fix use new extrafields array
This commit is contained in:
parent
ee394d6fd5
commit
74454c3766
@ -111,6 +111,9 @@ $actioncomm_fields= array(
|
|||||||
'fk_element' => array('name'=>'fk_element','type'=>'xsd:string'),
|
'fk_element' => array('name'=>'fk_element','type'=>'xsd:string'),
|
||||||
'elementtype' => array('name'=>'elementtype','type'=>'xsd:string'));
|
'elementtype' => array('name'=>'elementtype','type'=>'xsd:string'));
|
||||||
|
|
||||||
|
|
||||||
|
$elementtype = 'actioncomm';
|
||||||
|
|
||||||
//Retreive all extrafield for actioncomm
|
//Retreive all extrafield for actioncomm
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
@ -119,9 +122,9 @@ $extrafield_array=null;
|
|||||||
if (is_array($extrafields) && count($extrafields)>0) {
|
if (is_array($extrafields) && count($extrafields)>0) {
|
||||||
$extrafield_array = array();
|
$extrafield_array = array();
|
||||||
}
|
}
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$type =$extrafields->attribute_type[$key];
|
$type =$extrafields->attributes[$elementtype]['type'][$key];
|
||||||
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
|
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
|
||||||
else {$type='xsd:string';}
|
else {$type='xsd:string';}
|
||||||
|
|
||||||
@ -308,7 +311,7 @@ function getActionComm($authentication, $id)
|
|||||||
//Get extrafield values
|
//Get extrafield values
|
||||||
$actioncomm->fetch_optionals();
|
$actioncomm->fetch_optionals();
|
||||||
|
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$actioncomm_result_fields=array_merge($actioncomm_result_fields, array('options_'.$key => $actioncomm->array_options['options_'.$key]));
|
$actioncomm_result_fields=array_merge($actioncomm_result_fields, array('options_'.$key => $actioncomm->array_options['options_'.$key]));
|
||||||
}
|
}
|
||||||
@ -448,7 +451,7 @@ function createActionComm($authentication, $actioncomm)
|
|||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('actioncomm', true);
|
$extralabels=$extrafields->fetch_name_optionals_label('actioncomm', true);
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$key='options_'.$key;
|
$key='options_'.$key;
|
||||||
$newobject->array_options[$key]=$actioncomm[$key];
|
$newobject->array_options[$key]=$actioncomm[$key];
|
||||||
@ -542,7 +545,7 @@ function updateActionComm($authentication, $actioncomm)
|
|||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('actioncomm', true);
|
$extralabels=$extrafields->fetch_name_optionals_label('actioncomm', true);
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$key='options_'.$key;
|
$key='options_'.$key;
|
||||||
$object->array_options[$key]=$actioncomm[$key];
|
$object->array_options[$key]=$actioncomm[$key];
|
||||||
|
|||||||
@ -115,6 +115,10 @@ $contact_fields = array(
|
|||||||
'poste' => array('name'=>'poste','type'=>'xsd:string')
|
'poste' => array('name'=>'poste','type'=>'xsd:string')
|
||||||
//...
|
//...
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$elementtype = 'socpeople';
|
||||||
|
|
||||||
|
|
||||||
//Retreive all extrafield for contact
|
//Retreive all extrafield for contact
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
@ -123,9 +127,9 @@ $extrafield_array=null;
|
|||||||
if (is_array($extrafields) && count($extrafields)>0) {
|
if (is_array($extrafields) && count($extrafields)>0) {
|
||||||
$extrafield_array = array();
|
$extrafield_array = array();
|
||||||
}
|
}
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$type =$extrafields->attribute_type[$key];
|
$type =$extrafields->attributes[$elementtype]['type'][$key];
|
||||||
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
|
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
|
||||||
else {$type='xsd:string';}
|
else {$type='xsd:string';}
|
||||||
|
|
||||||
@ -311,7 +315,7 @@ function getContact($authentication, $id, $ref_ext)
|
|||||||
//Get extrafield values
|
//Get extrafield values
|
||||||
$contact->fetch_optionals();
|
$contact->fetch_optionals();
|
||||||
|
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$contact_result_fields=array_merge($contact_result_fields, array('options_'.$key => $contact->array_options['options_'.$key]));
|
$contact_result_fields=array_merge($contact_result_fields, array('options_'.$key => $contact->array_options['options_'.$key]));
|
||||||
}
|
}
|
||||||
@ -416,7 +420,7 @@ function createContact($authentication, $contact)
|
|||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('socpeople', true);
|
$extralabels=$extrafields->fetch_name_optionals_label('socpeople', true);
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$key='options_'.$key;
|
$key='options_'.$key;
|
||||||
$newobject->array_options[$key]=$contact[$key];
|
$newobject->array_options[$key]=$contact[$key];
|
||||||
@ -663,7 +667,7 @@ function updateContact($authentication, $contact)
|
|||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('socpeople', true);
|
$extralabels=$extrafields->fetch_name_optionals_label('socpeople', true);
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$key='options_'.$key;
|
$key='options_'.$key;
|
||||||
$object->array_options[$key]=$contact[$key];
|
$object->array_options[$key]=$contact[$key];
|
||||||
|
|||||||
@ -110,6 +110,7 @@ $line_fields = array(
|
|||||||
'product_desc' => array('name'=>'product_desc','type'=>'xsd:string')
|
'product_desc' => array('name'=>'product_desc','type'=>'xsd:string')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$elementtype = 'commandedet';
|
||||||
|
|
||||||
//Retreive all extrafield for thirdsparty
|
//Retreive all extrafield for thirdsparty
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
@ -119,10 +120,10 @@ $extrafield_line_array=null;
|
|||||||
if (is_array($extrafields) && count($extrafields)>0) {
|
if (is_array($extrafields) && count($extrafields)>0) {
|
||||||
$extrafield_line_array = array();
|
$extrafield_line_array = array();
|
||||||
}
|
}
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
//$value=$object->array_options["options_".$key];
|
//$value=$object->array_options["options_".$key];
|
||||||
$type =$extrafields->attribute_type[$key];
|
$type =$extrafields->attributes[$elementtype]['type'][$key];
|
||||||
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
|
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
|
||||||
else {$type='xsd:string';}
|
else {$type='xsd:string';}
|
||||||
$extrafield_line_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type);
|
$extrafield_line_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type);
|
||||||
@ -211,6 +212,8 @@ $order_fields = array(
|
|||||||
'lines' => array('name'=>'lines','type'=>'tns:LinesArray2')
|
'lines' => array('name'=>'lines','type'=>'tns:LinesArray2')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$elementtype = 'commande';
|
||||||
|
|
||||||
//Retreive all extrafield for thirdsparty
|
//Retreive all extrafield for thirdsparty
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
@ -219,10 +222,10 @@ $extrafield_array=null;
|
|||||||
if (is_array($extrafields) && count($extrafields)>0) {
|
if (is_array($extrafields) && count($extrafields)>0) {
|
||||||
$extrafield_array = array();
|
$extrafield_array = array();
|
||||||
}
|
}
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
//$value=$object->array_options["options_".$key];
|
//$value=$object->array_options["options_".$key];
|
||||||
$type =$extrafields->attribute_type[$key];
|
$type =$extrafields->attributes[$elementtype]['type'][$key];
|
||||||
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
|
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
|
||||||
else {$type='xsd:string';}
|
else {$type='xsd:string';}
|
||||||
$extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type);
|
$extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type);
|
||||||
@ -694,11 +697,13 @@ function createOrder($authentication, $order)
|
|||||||
$newobject->demand_reason_id=$order['demand_reason_id'];
|
$newobject->demand_reason_id=$order['demand_reason_id'];
|
||||||
$newobject->date_creation=$now;
|
$newobject->date_creation=$now;
|
||||||
|
|
||||||
|
$elementtype = 'commande';
|
||||||
|
|
||||||
// Retrieve all extrafield for order
|
// Retrieve all extrafield for order
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('commandet', true);
|
$extralabels=$extrafields->fetch_name_optionals_label('commande', true);
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$key='options_'.$key;
|
$key='options_'.$key;
|
||||||
$newobject->array_options[$key]=$order[$key];
|
$newobject->array_options[$key]=$order[$key];
|
||||||
@ -727,11 +732,13 @@ function createOrder($authentication, $order)
|
|||||||
$newline->date_start=$line['date_start'];
|
$newline->date_start=$line['date_start'];
|
||||||
$newline->date_end=$line['date_end'];
|
$newline->date_end=$line['date_end'];
|
||||||
|
|
||||||
|
$elementtype = 'commandedet';
|
||||||
|
|
||||||
// Retrieve all extrafield for lines
|
// Retrieve all extrafield for lines
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('commandedet', true);
|
$extralabels=$extrafields->fetch_name_optionals_label('commandedet', true);
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$key='options_'.$key;
|
$key='options_'.$key;
|
||||||
$newline->array_options[$key]=$line[$key];
|
$newline->array_options[$key]=$line[$key];
|
||||||
@ -933,11 +940,13 @@ function updateOrder($authentication, $order)
|
|||||||
if (! $order['billed']) $result=$object->classifyUnBilled($fuser);
|
if (! $order['billed']) $result=$object->classifyUnBilled($fuser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$elementtype = 'commande';
|
||||||
|
|
||||||
//Retreive all extrafield for object
|
//Retreive all extrafield for object
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('commande', true);
|
$extralabels=$extrafields->fetch_name_optionals_label('commande', true);
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$key='options_'.$key;
|
$key='options_'.$key;
|
||||||
if (isset($order[$key]))
|
if (isset($order[$key]))
|
||||||
|
|||||||
@ -130,6 +130,10 @@ $productorservice_fields = array(
|
|||||||
'images' => array('name'=>'images','type'=>'tns:ImagesArray')
|
'images' => array('name'=>'images','type'=>'tns:ImagesArray')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
$elementtype = 'product';
|
||||||
|
|
||||||
|
|
||||||
//Retreive all extrafield for product
|
//Retreive all extrafield for product
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
@ -138,9 +142,9 @@ $extrafield_array=null;
|
|||||||
if (is_array($extrafields) && count($extrafields) > 0) {
|
if (is_array($extrafields) && count($extrafields) > 0) {
|
||||||
$extrafield_array = array();
|
$extrafield_array = array();
|
||||||
}
|
}
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$type =$extrafields->attribute_type[$key];
|
$type =$extrafields->attributes[$elementtype]['type'][$key];
|
||||||
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
|
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
|
||||||
else {$type='xsd:string';}
|
else {$type='xsd:string';}
|
||||||
|
|
||||||
@ -428,7 +432,7 @@ function getProductOrService($authentication, $id = '', $ref = '', $ref_ext = ''
|
|||||||
//Get extrafield values
|
//Get extrafield values
|
||||||
$product->fetch_optionals();
|
$product->fetch_optionals();
|
||||||
|
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$productorservice_result_fields=array_merge($productorservice_result_fields, array('options_'.$key => $product->array_options['options_'.$key]));
|
$productorservice_result_fields=array_merge($productorservice_result_fields, array('options_'.$key => $product->array_options['options_'.$key]));
|
||||||
}
|
}
|
||||||
@ -552,7 +556,7 @@ function createProductOrService($authentication, $product)
|
|||||||
|
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('product', true);
|
$extralabels=$extrafields->fetch_name_optionals_label('product', true);
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$key='options_'.$key;
|
$key='options_'.$key;
|
||||||
$newobject->array_options[$key]=$product[$key];
|
$newobject->array_options[$key]=$product[$key];
|
||||||
@ -721,7 +725,7 @@ function updateProductOrService($authentication, $product)
|
|||||||
|
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('product', true);
|
$extralabels=$extrafields->fetch_name_optionals_label('product', true);
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$key='options_'.$key;
|
$key='options_'.$key;
|
||||||
$newobject->array_options[$key]=$product[$key];
|
$newobject->array_options[$key]=$product[$key];
|
||||||
@ -1099,7 +1103,7 @@ function getProductsForCategory($authentication, $id, $lang = '')
|
|||||||
//Get extrafield values
|
//Get extrafield values
|
||||||
$tmpproduct->fetch_optionals();
|
$tmpproduct->fetch_optionals();
|
||||||
|
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$products[$iProduct]=array_merge($products[$iProduct], array('options_'.$key => $tmpproduct->array_options['options_'.$key]));
|
$products[$iProduct]=array_merge($products[$iProduct], array('options_'.$key => $tmpproduct->array_options['options_'.$key]));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -159,6 +159,8 @@ $project_fields = array(
|
|||||||
'elements' => array('name'=>'elements','type'=>'tns:elements')
|
'elements' => array('name'=>'elements','type'=>'tns:elements')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$elementtype = 'project';
|
||||||
|
|
||||||
//Retreive all extrafield for thirdsparty
|
//Retreive all extrafield for thirdsparty
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
@ -167,10 +169,10 @@ $extrafield_array=null;
|
|||||||
if (is_array($extrafields) && count($extrafields)>0) {
|
if (is_array($extrafields) && count($extrafields)>0) {
|
||||||
$extrafield_array = array();
|
$extrafield_array = array();
|
||||||
}
|
}
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
//$value=$object->array_options["options_".$key];
|
//$value=$object->array_options["options_".$key];
|
||||||
$type =$extrafields->attribute_type[$key];
|
$type =$extrafields->attributes[$elementtype]['type'][$key];
|
||||||
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
|
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
|
||||||
else {$type='xsd:string';}
|
else {$type='xsd:string';}
|
||||||
$extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type);
|
$extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type);
|
||||||
@ -270,7 +272,7 @@ function createProject($authentication, $project)
|
|||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('project', true);
|
$extralabels=$extrafields->fetch_name_optionals_label('project', true);
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$key='options_'.$key;
|
$key='options_'.$key;
|
||||||
$newobject->array_options[$key]=$project[$key];
|
$newobject->array_options[$key]=$project[$key];
|
||||||
@ -374,11 +376,11 @@ function getProject($authentication, $id = '', $ref = '')
|
|||||||
|
|
||||||
//Retrieve all extrafields for project
|
//Retrieve all extrafields for project
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('societe', true);
|
$extralabels=$extrafields->fetch_name_optionals_label('project', true);
|
||||||
|
|
||||||
//Get extrafield values
|
//Get extrafield values
|
||||||
$project->fetch_optionals();
|
$project->fetch_optionals();
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$project_result_fields=array_merge($project_result_fields, array('options_'.$key => $project->array_options['options_'.$key]));
|
$project_result_fields=array_merge($project_result_fields, array('options_'.$key => $project->array_options['options_'.$key]));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -120,6 +120,8 @@ $thirdparty_fields= array(
|
|||||||
'vat_used' => array('name'=>'vat_used','type'=>'xsd:string'),
|
'vat_used' => array('name'=>'vat_used','type'=>'xsd:string'),
|
||||||
'vat_number' => array('name'=>'vat_number','type'=>'xsd:string'));
|
'vat_number' => array('name'=>'vat_number','type'=>'xsd:string'));
|
||||||
|
|
||||||
|
$elementtype = 'societe';
|
||||||
|
|
||||||
// Retrieve all extrafields for thirdsparty
|
// Retrieve all extrafields for thirdsparty
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
@ -128,10 +130,10 @@ $extrafield_array=null;
|
|||||||
if (is_array($extrafields) && count($extrafields)>0) {
|
if (is_array($extrafields) && count($extrafields)>0) {
|
||||||
$extrafield_array = array();
|
$extrafield_array = array();
|
||||||
}
|
}
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
//$value=$object->array_options["options_".$key];
|
//$value=$object->array_options["options_".$key];
|
||||||
$type =$extrafields->attribute_type[$key];
|
$type =$extrafields->attributes[$elementtype]['type'][$key];
|
||||||
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
|
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
|
||||||
else {$type='xsd:string';}
|
else {$type='xsd:string';}
|
||||||
|
|
||||||
@ -359,7 +361,7 @@ function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '')
|
|||||||
//Get extrafield values
|
//Get extrafield values
|
||||||
$thirdparty->fetch_optionals();
|
$thirdparty->fetch_optionals();
|
||||||
|
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$thirdparty_result_fields=array_merge($thirdparty_result_fields, array('options_'.$key => $thirdparty->array_options['options_'.$key]));
|
$thirdparty_result_fields=array_merge($thirdparty_result_fields, array('options_'.$key => $thirdparty->array_options['options_'.$key]));
|
||||||
}
|
}
|
||||||
@ -472,7 +474,7 @@ function createThirdParty($authentication, $thirdparty)
|
|||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('societe', true);
|
$extralabels=$extrafields->fetch_name_optionals_label('societe', true);
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$key='options_'.$key;
|
$key='options_'.$key;
|
||||||
$newobject->array_options[$key]=$thirdparty[$key];
|
$newobject->array_options[$key]=$thirdparty[$key];
|
||||||
@ -603,7 +605,7 @@ function updateThirdParty($authentication, $thirdparty)
|
|||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('societe', true);
|
$extralabels=$extrafields->fetch_name_optionals_label('societe', true);
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$key='options_'.$key;
|
$key='options_'.$key;
|
||||||
$object->array_options[$key]=$thirdparty[$key];
|
$object->array_options[$key]=$thirdparty[$key];
|
||||||
@ -705,7 +707,7 @@ function getListOfThirdParties($authentication, $filterthirdparty)
|
|||||||
{
|
{
|
||||||
$extrafieldsOptions=array();
|
$extrafieldsOptions=array();
|
||||||
$obj=$db->fetch_object($resql);
|
$obj=$db->fetch_object($resql);
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$extrafieldsOptions['options_'.$key] = $obj->{$key};
|
$extrafieldsOptions['options_'.$key] = $obj->{$key};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -183,6 +183,8 @@ $thirdpartywithuser_fields = array(
|
|||||||
'group_id' => array('name'=>'group_id','type'=>'xsd:string')
|
'group_id' => array('name'=>'group_id','type'=>'xsd:string')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$elementtype = 'socpeople';
|
||||||
|
|
||||||
//Retreive all extrafield for contact
|
//Retreive all extrafield for contact
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
@ -191,9 +193,9 @@ $extrafield_array=null;
|
|||||||
if (is_array($extrafields) && count($extrafields)>0) {
|
if (is_array($extrafields) && count($extrafields)>0) {
|
||||||
$extrafield_array = array();
|
$extrafield_array = array();
|
||||||
}
|
}
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$type =$extrafields->attribute_type[$key];
|
$type =$extrafields->attributes[$elementtype]['type'][$key];
|
||||||
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
|
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
|
||||||
else {$type='xsd:string';}
|
else {$type='xsd:string';}
|
||||||
|
|
||||||
@ -598,7 +600,7 @@ function createUserFromThirdparty($authentication, $thirdpartywithuser)
|
|||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('socpeople', true);
|
$extralabels=$extrafields->fetch_name_optionals_label('socpeople', true);
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$key='contact_options_'.$key;
|
$key='contact_options_'.$key;
|
||||||
$key=substr($key, 8); // Remove 'contact_' prefix
|
$key=substr($key, 8); // Remove 'contact_' prefix
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user