Clean code of deprecated usage
This commit is contained in:
parent
423918b9ff
commit
b4446764f8
@ -1003,7 +1003,7 @@ else
|
|||||||
if ($res < 0) {
|
if ($res < 0) {
|
||||||
dol_print_error($db,$object->error); exit;
|
dol_print_error($db,$object->error); exit;
|
||||||
}
|
}
|
||||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
$res=$object->fetch_optionals();
|
||||||
if ($res < 0) {
|
if ($res < 0) {
|
||||||
dol_print_error($db); exit;
|
dol_print_error($db); exit;
|
||||||
}
|
}
|
||||||
@ -1272,7 +1272,7 @@ else
|
|||||||
if ($res < 0) {
|
if ($res < 0) {
|
||||||
dol_print_error($db,$object->error); exit;
|
dol_print_error($db,$object->error); exit;
|
||||||
}
|
}
|
||||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
$res=$object->fetch_optionals();
|
||||||
if ($res < 0) {
|
if ($res < 0) {
|
||||||
dol_print_error($db); exit;
|
dol_print_error($db); exit;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -361,7 +361,7 @@ if ($rowid > 0)
|
|||||||
{
|
{
|
||||||
$object = new AdherentType($db);
|
$object = new AdherentType($db);
|
||||||
$object->fetch($rowid);
|
$object->fetch($rowid);
|
||||||
$object->fetch_optionals($object->id,$extralabels);
|
$object->fetch_optionals();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation suppression
|
* Confirmation suppression
|
||||||
@ -692,7 +692,7 @@ if ($rowid > 0)
|
|||||||
{
|
{
|
||||||
$object = new AdherentType($db);
|
$object = new AdherentType($db);
|
||||||
$object->fetch($rowid);
|
$object->fetch($rowid);
|
||||||
$object->fetch_optionals($object->id,$extralabels);
|
$object->fetch_optionals();
|
||||||
|
|
||||||
$head = member_type_prepare_head($object);
|
$head = member_type_prepare_head($object);
|
||||||
|
|
||||||
|
|||||||
@ -53,11 +53,12 @@ $result = restrictedArea($user, 'categorie', $id, '&category');
|
|||||||
|
|
||||||
$object = new Categorie($db);
|
$object = new Categorie($db);
|
||||||
$result=$object->fetch($id, $label);
|
$result=$object->fetch($id, $label);
|
||||||
$object->fetch_optionals($id,$extralabels);
|
if ($result <= 0) {
|
||||||
if ($result <= 0)
|
dol_print_error($db,$object->error); exit;
|
||||||
{
|
}
|
||||||
dol_print_error($db,$object->error);
|
$object->fetch_optionals();
|
||||||
exit;
|
if ($result <= 0) {
|
||||||
|
dol_print_error($db,$object->error); exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$type=$object->type;
|
$type=$object->type;
|
||||||
|
|||||||
@ -934,7 +934,7 @@ if ($id > 0)
|
|||||||
$result2=$object->fetch_projet();
|
$result2=$object->fetch_projet();
|
||||||
$result3=$object->fetch_contact();
|
$result3=$object->fetch_contact();
|
||||||
$result4=$object->fetch_userassigned();
|
$result4=$object->fetch_userassigned();
|
||||||
$result5=$object->fetch_optionals($id,$extralabels);
|
$result5=$object->fetch_optionals();
|
||||||
|
|
||||||
if ($listUserAssignedUpdated || $donotclearsession)
|
if ($listUserAssignedUpdated || $donotclearsession)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -100,7 +100,7 @@ if ($object->id > 0)
|
|||||||
$result2=$object->fetch_thirdparty();
|
$result2=$object->fetch_thirdparty();
|
||||||
$result3=$object->fetch_contact();
|
$result3=$object->fetch_contact();
|
||||||
$result4=$object->fetch_userassigned();
|
$result4=$object->fetch_userassigned();
|
||||||
$result5=$object->fetch_optionals($id,$extralabels);
|
$result5=$object->fetch_optionals();
|
||||||
|
|
||||||
if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0)
|
if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -505,7 +505,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
$lines[$i]->fetch_optionals();
|
||||||
$array_options = $lines[$i]->array_options;
|
$array_options = $lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1210,7 +1210,7 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
// get extrafields so they will be clone
|
// get extrafields so they will be clone
|
||||||
foreach($this->lines as $line)
|
foreach($this->lines as $line)
|
||||||
$line->fetch_optionals($line->rowid);
|
$line->fetch_optionals();
|
||||||
|
|
||||||
// Load dest object
|
// Load dest object
|
||||||
$clonedObj = clone $this;
|
$clonedObj = clone $this;
|
||||||
|
|||||||
@ -1804,7 +1804,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
$author = new User($db);
|
$author = new User($db);
|
||||||
$author->fetch($object->user_author_id);
|
$author->fetch($object->user_author_id);
|
||||||
|
|
||||||
$res = $object->fetch_optionals($object->id, $extralabels);
|
$res = $object->fetch_optionals();
|
||||||
|
|
||||||
$head = commande_prepare_head($object);
|
$head = commande_prepare_head($object);
|
||||||
dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), -1, 'order');
|
dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), -1, 'order');
|
||||||
|
|||||||
@ -1024,7 +1024,7 @@ class Commande extends CommonOrder
|
|||||||
|
|
||||||
// get lines so they will be clone
|
// get lines so they will be clone
|
||||||
foreach($this->lines as $line)
|
foreach($this->lines as $line)
|
||||||
$line->fetch_optionals($line->rowid);
|
$line->fetch_optionals();
|
||||||
|
|
||||||
// Load source object
|
// Load source object
|
||||||
$objFrom = clone $this;
|
$objFrom = clone $this;
|
||||||
@ -1145,7 +1145,7 @@ class Commande extends CommonOrder
|
|||||||
$line->marque_tx = $marginInfos[2];
|
$line->marque_tx = $marginInfos[2];
|
||||||
|
|
||||||
// get extrafields from original line
|
// get extrafields from original line
|
||||||
$object->lines[$i]->fetch_optionals($object->lines[$i]->rowid);
|
$object->lines[$i]->fetch_optionals();
|
||||||
foreach($object->lines[$i]->array_options as $options_key => $value)
|
foreach($object->lines[$i]->array_options as $options_key => $value)
|
||||||
$line->array_options[$options_key] = $value;
|
$line->array_options[$options_key] = $value;
|
||||||
|
|
||||||
|
|||||||
@ -501,7 +501,7 @@ class FactureRec extends CommonInvoice
|
|||||||
$line->price = $objp->price;
|
$line->price = $objp->price;
|
||||||
$line->remise = $objp->remise;
|
$line->remise = $objp->remise;
|
||||||
|
|
||||||
$extralabelsline = $line->fetch_optionals($line->id,$extrafieldsline);
|
$extralabelsline = $line->fetch_optionals($line->id);
|
||||||
|
|
||||||
// Multicurrency
|
// Multicurrency
|
||||||
$line->fk_multicurrency = $objp->fk_multicurrency;
|
$line->fk_multicurrency = $objp->fk_multicurrency;
|
||||||
|
|||||||
@ -1031,7 +1031,7 @@ class Facture extends CommonInvoice
|
|||||||
$line->pa_ht = $marginInfos[0];
|
$line->pa_ht = $marginInfos[0];
|
||||||
|
|
||||||
// get extrafields from original line
|
// get extrafields from original line
|
||||||
$object->lines[$i]->fetch_optionals($object->lines[$i]->rowid);
|
$object->lines[$i]->fetch_optionals();
|
||||||
foreach($object->lines[$i]->array_options as $options_key => $value)
|
foreach($object->lines[$i]->array_options as $options_key => $value)
|
||||||
$line->array_options[$options_key] = $value;
|
$line->array_options[$options_key] = $value;
|
||||||
|
|
||||||
|
|||||||
@ -190,7 +190,8 @@ else
|
|||||||
$object = new Contact($db);
|
$object = new Contact($db);
|
||||||
$res=$object->fetch($id, $user);
|
$res=$object->fetch($id, $user);
|
||||||
if ($res < 0) { dol_print_error($db,$object->error); exit; }
|
if ($res < 0) { dol_print_error($db,$object->error); exit; }
|
||||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
$res=$object->fetch_optionals();
|
||||||
|
if ($res < 0) { dol_print_error($db,$object->error); exit; }
|
||||||
|
|
||||||
// Show tabs
|
// Show tabs
|
||||||
$head = contact_prepare_head($object);
|
$head = contact_prepare_head($object);
|
||||||
|
|||||||
@ -468,7 +468,8 @@ else
|
|||||||
$object = new Contact($db);
|
$object = new Contact($db);
|
||||||
$res=$object->fetch($id, $user);
|
$res=$object->fetch($id, $user);
|
||||||
if ($res < 0) { dol_print_error($db,$object->error); exit; }
|
if ($res < 0) { dol_print_error($db,$object->error); exit; }
|
||||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
$res=$object->fetch_optionals();
|
||||||
|
if ($res < 0) { dol_print_error($db,$object->error); exit; }
|
||||||
|
|
||||||
// Show tabs
|
// Show tabs
|
||||||
$head = contact_prepare_head($object);
|
$head = contact_prepare_head($object);
|
||||||
|
|||||||
@ -1709,7 +1709,7 @@ else
|
|||||||
if (is_array($extralabelslines) && count($extralabelslines)>0) {
|
if (is_array($extralabelslines) && count($extralabelslines)>0) {
|
||||||
print '<tr '.$bcnd[$var].'>';
|
print '<tr '.$bcnd[$var].'>';
|
||||||
$line = new ContratLigne($db);
|
$line = new ContratLigne($db);
|
||||||
$line->fetch_optionals($objp->rowid,$extralabelslines);
|
$line->fetch_optionals($objp->rowid);
|
||||||
print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bcnd[$var], 'colspan'=>$colspan));
|
print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bcnd[$var], 'colspan'=>$colspan));
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@ -1783,7 +1783,7 @@ else
|
|||||||
if (is_array($extralabelslines) && count($extralabelslines)>0) {
|
if (is_array($extralabelslines) && count($extralabelslines)>0) {
|
||||||
print '<tr '.$bcnd[$var].'>';
|
print '<tr '.$bcnd[$var].'>';
|
||||||
$line = new ContratLigne($db);
|
$line = new ContratLigne($db);
|
||||||
$line->fetch_optionals($objp->rowid,$extralabelslines);
|
$line->fetch_optionals($objp->rowid);
|
||||||
print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$colspan));
|
print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$colspan));
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -795,7 +795,7 @@ class Contrat extends CommonObject
|
|||||||
|
|
||||||
// Retreive all extrafield for contract
|
// Retreive all extrafield for contract
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$line->fetch_optionals($line->id,$extralabelsline);
|
$line->fetch_optionals();
|
||||||
|
|
||||||
$this->lines[$pos] = $line;
|
$this->lines[$pos] = $line;
|
||||||
$this->lines_id_index_mapper[$line->id] = $pos;
|
$this->lines_id_index_mapper[$line->id] = $pos;
|
||||||
|
|||||||
@ -203,7 +203,7 @@ abstract class CommonDocGenerator
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label('societe',true);
|
$extralabels = $extrafields->fetch_name_optionals_label('societe',true);
|
||||||
$object->fetch_optionals($object->id,$extralabels);
|
$object->fetch_optionals();
|
||||||
|
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attribute_label as $key=>$label)
|
||||||
{
|
{
|
||||||
@ -274,7 +274,7 @@ abstract class CommonDocGenerator
|
|||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label('socpeople', true);
|
$extralabels = $extrafields->fetch_name_optionals_label('socpeople', true);
|
||||||
$object->fetch_optionals($object->id, $extralabels);
|
$object->fetch_optionals();
|
||||||
|
|
||||||
foreach($extrafields->attribute_label as $key => $label)
|
foreach($extrafields->attribute_label as $key => $label)
|
||||||
{
|
{
|
||||||
@ -457,7 +457,7 @@ abstract class CommonDocGenerator
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
|
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
|
||||||
$object->fetch_optionals($object->id,$extralabels);
|
$object->fetch_optionals();
|
||||||
|
|
||||||
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs);
|
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs);
|
||||||
}
|
}
|
||||||
@ -524,7 +524,7 @@ abstract class CommonDocGenerator
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
|
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
|
||||||
$line->fetch_optionals($line->rowid,$extralabels);
|
$line->fetch_optionals();
|
||||||
|
|
||||||
$resarray = $this->fill_substitutionarray_with_extrafields($line,$resarray,$extrafields,$array_key=$array_key,$outputlangs);
|
$resarray = $this->fill_substitutionarray_with_extrafields($line,$resarray,$extrafields,$array_key=$array_key,$outputlangs);
|
||||||
|
|
||||||
@ -592,7 +592,7 @@ abstract class CommonDocGenerator
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label('shipment',true);
|
$extralabels = $extrafields->fetch_name_optionals_label('shipment',true);
|
||||||
$object->fetch_optionals($object->id,$extralabels);
|
$object->fetch_optionals();
|
||||||
|
|
||||||
$array_shipment = $this->fill_substitutionarray_with_extrafields($object,$array_shipment,$extrafields,$array_key,$outputlangs);
|
$array_shipment = $this->fill_substitutionarray_with_extrafields($object,$array_shipment,$extrafields,$array_key,$outputlangs);
|
||||||
}*/
|
}*/
|
||||||
|
|||||||
@ -3670,8 +3670,7 @@ abstract class CommonObject
|
|||||||
foreach ($this->lines as $line)
|
foreach ($this->lines as $line)
|
||||||
{
|
{
|
||||||
//Line extrafield
|
//Line extrafield
|
||||||
$line->fetch_optionals($line->id,$extralabelslines);
|
$line->fetch_optionals();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line)))
|
//if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line)))
|
||||||
@ -4498,7 +4497,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_syslog("Warning: fetch_optionals was called with param $optionsArray defined when you should pass null now", LOG_WARNING);
|
dol_syslog("Warning: fetch_optionals was called with param optionsArray defined when you should pass null now", LOG_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
$table_element = $this->table_element;
|
$table_element = $this->table_element;
|
||||||
|
|||||||
@ -1185,7 +1185,7 @@ class FormMail extends Form
|
|||||||
$extralabels = $extrafields->fetch_name_optionals_label('product', true);
|
$extralabels = $extrafields->fetch_name_optionals_label('product', true);
|
||||||
$product = new Product($this->db);
|
$product = new Product($this->db);
|
||||||
$product->fetch($line->fk_product, '', '', 1);
|
$product->fetch($line->fk_product, '', '', 1);
|
||||||
$product->fetch_optionals($product->id, $extralabels);
|
$product->fetch_optionals();
|
||||||
foreach ($extrafields->attribute_label as $key => $label) {
|
foreach ($extrafields->attribute_label as $key => $label) {
|
||||||
$substit_line['__PRODUCT_EXTRAFIELD_' . strtoupper($key) . '__'] = $product->array_options['options_' . $key];
|
$substit_line['__PRODUCT_EXTRAFIELD_' . strtoupper($key) . '__'] = $product->array_options['options_' . $key];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5806,7 +5806,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
|
|||||||
{
|
{
|
||||||
$extrafieldstmp = new ExtraFields($db);
|
$extrafieldstmp = new ExtraFields($db);
|
||||||
$extralabels = $extrafieldstmp->fetch_name_optionals_label($object->table_element, true);
|
$extralabels = $extrafieldstmp->fetch_name_optionals_label($object->table_element, true);
|
||||||
$object->fetch_optionals($object->id, $extralabels);
|
$object->fetch_optionals();
|
||||||
foreach ($extrafieldstmp->attribute_label as $key => $label) {
|
foreach ($extrafieldstmp->attribute_label as $key => $label) {
|
||||||
$substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = $object->array_options['options_' . $key];
|
$substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = $object->array_options['options_' . $key];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -136,10 +136,10 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
|
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
|
||||||
$object->fetch_optionals($object->id,$extralabels);
|
$object->fetch_optionals();
|
||||||
|
|
||||||
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs);
|
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs);
|
||||||
|
|
||||||
return $resarray;
|
return $resarray;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,18 +198,18 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
|
|
||||||
if ($contact['source']=='external') {
|
if ($contact['source']=='external') {
|
||||||
$ret[$pc.'isInternal'] = ''; // not internal
|
$ret[$pc.'isInternal'] = ''; // not internal
|
||||||
|
|
||||||
$ct = new Contact($this->db);
|
$ct = new Contact($this->db);
|
||||||
$ct->fetch($contact['id']);
|
$ct->fetch($contact['id']);
|
||||||
$ret[$pc.'phone_pro'] = $ct->phone_pro;
|
$ret[$pc.'phone_pro'] = $ct->phone_pro;
|
||||||
$ret[$pc.'phone_perso'] = $ct->phone_perso;
|
$ret[$pc.'phone_perso'] = $ct->phone_perso;
|
||||||
$ret[$pc.'phone_mobile'] = $ct->phone_mobile;
|
$ret[$pc.'phone_mobile'] = $ct->phone_mobile;
|
||||||
|
|
||||||
// fetch external user extrafields
|
// fetch external user extrafields
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
|
||||||
$extrafields=new ExtraFields($this->db);
|
$extrafields=new ExtraFields($this->db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($ct->table_element, true);
|
$extralabels=$extrafields->fetch_name_optionals_label($ct->table_element, true);
|
||||||
$extrafields_num = $ct->fetch_optionals($ct->id, $extralabels);
|
$extrafields_num = $ct->fetch_optionals();
|
||||||
//dol_syslog(get_class($this)."::get_substitutionarray_project_contacts: ===== Number of Extrafields found: ".$extrafields_num, LOG_DEBUG);
|
//dol_syslog(get_class($this)."::get_substitutionarray_project_contacts: ===== Number of Extrafields found: ".$extrafields_num, LOG_DEBUG);
|
||||||
foreach($ct->array_options as $efkey => $efval) {
|
foreach($ct->array_options as $efkey => $efval) {
|
||||||
dol_syslog(get_class($this)."::get_substitutionarray_project_contacts: +++++ Extrafield ".$efkey." => ".$efval, LOG_DEBUG);
|
dol_syslog(get_class($this)."::get_substitutionarray_project_contacts: +++++ Extrafield ".$efkey." => ".$efval, LOG_DEBUG);
|
||||||
@ -217,7 +217,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
}
|
}
|
||||||
} elseif ($contact['source']=='internal') {
|
} elseif ($contact['source']=='internal') {
|
||||||
$ret[$pc.'isInternal'] = '1'; // this is an internal user
|
$ret[$pc.'isInternal'] = '1'; // this is an internal user
|
||||||
|
|
||||||
$ct = new User($this->db);
|
$ct = new User($this->db);
|
||||||
$ct->fetch($contact['id']);
|
$ct->fetch($contact['id']);
|
||||||
$ret[$pc.'phone_pro'] = $ct->office_phone;
|
$ret[$pc.'phone_pro'] = $ct->office_phone;
|
||||||
@ -1067,7 +1067,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
$odfHandler=null; // Destroy object
|
$odfHandler=null; // Destroy object
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Success
|
return 1; // Success
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -139,7 +139,7 @@ class doc_generic_task_odt extends ModelePDFTask
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
|
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
|
||||||
$object->fetch_optionals($object->id,$extralabels);
|
$object->fetch_optionals();
|
||||||
|
|
||||||
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs);
|
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs);
|
||||||
}
|
}
|
||||||
@ -830,7 +830,7 @@ class doc_generic_task_odt extends ModelePDFTask
|
|||||||
$odfHandler=null; // Destroy object
|
$odfHandler=null; // Destroy object
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Success
|
return 1; // Success
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -411,7 +411,7 @@ if (! empty($id) && $action == 'edit')
|
|||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
dol_print_error($db,$object->error); exit;
|
dol_print_error($db,$object->error); exit;
|
||||||
}
|
}
|
||||||
$result=$object->fetch_optionals($object->id,$extralabels);
|
$result=$object->fetch_optionals();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
dol_print_error($db); exit;
|
dol_print_error($db); exit;
|
||||||
}
|
}
|
||||||
@ -539,7 +539,7 @@ if (! empty($id) && $action != 'edit')
|
|||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
dol_print_error($db,$object->error); exit;
|
dol_print_error($db,$object->error); exit;
|
||||||
}
|
}
|
||||||
$result=$object->fetch_optionals($object->id,$extralabels);
|
$result=$object->fetch_optionals();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
dol_print_error($db); exit;
|
dol_print_error($db); exit;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1068,7 +1068,7 @@ if ($action == 'create')
|
|||||||
// copy from order
|
// copy from order
|
||||||
$orderExtrafields = new Extrafields($db);
|
$orderExtrafields = new Extrafields($db);
|
||||||
$orderExtrafieldLabels = $orderExtrafields->fetch_name_optionals_label($object->table_element);
|
$orderExtrafieldLabels = $orderExtrafields->fetch_name_optionals_label($object->table_element);
|
||||||
if ($object->fetch_optionals($object->id, $orderExtrafieldLabels) > 0) {
|
if ($object->fetch_optionals() > 0) {
|
||||||
$expe->array_options = array_merge($expe->array_options, $object->array_options);
|
$expe->array_options = array_merge($expe->array_options, $object->array_options);
|
||||||
}
|
}
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit');
|
||||||
@ -1605,9 +1605,9 @@ if ($action == 'create')
|
|||||||
$orderLineExtrafields = new Extrafields($db);
|
$orderLineExtrafields = new Extrafields($db);
|
||||||
$orderLineExtrafieldLabels = $orderLineExtrafields->fetch_name_optionals_label($object->table_element_line);
|
$orderLineExtrafieldLabels = $orderLineExtrafields->fetch_name_optionals_label($object->table_element_line);
|
||||||
$srcLine = new OrderLine($db);
|
$srcLine = new OrderLine($db);
|
||||||
$srcLine->fetch_optionals($line->id,$orderLineExtrafieldLabels); // fetch extrafields also available in orderline
|
$srcLine->fetch_optionals($line->id); // fetch extrafields also available in orderline
|
||||||
$line = new ExpeditionLigne($db);
|
$line = new ExpeditionLigne($db);
|
||||||
$line->fetch_optionals($object->id,$extralabelslines);
|
$line->fetch_optionals($line->id);
|
||||||
$line->array_options = array_merge($line->array_options, $srcLine->array_options);
|
$line->array_options = array_merge($line->array_options, $srcLine->array_options);
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>$colspan),$indiceAsked);
|
print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>$colspan),$indiceAsked);
|
||||||
@ -1661,7 +1661,7 @@ else if ($id || $ref)
|
|||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
$soc->fetch($object->socid);
|
$soc->fetch($object->socid);
|
||||||
|
|
||||||
$res = $object->fetch_optionals($object->id, $extralabels);
|
$res = $object->fetch_optionals();
|
||||||
|
|
||||||
$head=shipping_prepare_head($object);
|
$head=shipping_prepare_head($object);
|
||||||
dol_fiche_head($head, 'shipping', $langs->trans("Shipment"), -1, 'sending');
|
dol_fiche_head($head, 'shipping', $langs->trans("Shipment"), -1, 'sending');
|
||||||
@ -2451,7 +2451,7 @@ else if ($id || $ref)
|
|||||||
if (is_array($extralabelslines) && count($extralabelslines)>0) {
|
if (is_array($extralabelslines) && count($extralabelslines)>0) {
|
||||||
$colspan= empty($conf->productbatch->enabled) ? 5 : 6;
|
$colspan= empty($conf->productbatch->enabled) ? 5 : 6;
|
||||||
$line = new ExpeditionLigne($db);
|
$line = new ExpeditionLigne($db);
|
||||||
$line->fetch_optionals($lines[$i]->id,$extralabelslines);
|
$line->fetch_optionals($lines[$i]->id);
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
if ($action == 'editline' && $lines[$i]->id == $line_id)
|
if ($action == 'editline' && $lines[$i]->id == $line_id)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -247,7 +247,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$author = new User($db);
|
$author = new User($db);
|
||||||
$author->fetch($object->user_author_id);
|
$author->fetch($object->user_author_id);
|
||||||
|
|
||||||
$res = $object->fetch_optionals($object->id, $extralabels);
|
$res = $object->fetch_optionals();
|
||||||
|
|
||||||
$head = commande_prepare_head($object);
|
$head = commande_prepare_head($object);
|
||||||
dol_fiche_head($head, 'shipping', $langs->trans("CustomerOrder"), -1, 'order');
|
dol_fiche_head($head, 'shipping', $langs->trans("CustomerOrder"), -1, 'order');
|
||||||
|
|||||||
@ -1434,7 +1434,7 @@ else
|
|||||||
{
|
{
|
||||||
$result = $object->fetch($id, $ref);
|
$result = $object->fetch($id, $ref);
|
||||||
|
|
||||||
$res = $object->fetch_optionals($object->id, $extralabels);
|
$res = $object->fetch_optionals();
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1476,7 +1476,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
$extrafieldsline = new ExtraFields($db);
|
$extrafieldsline = new ExtraFields($db);
|
||||||
$extralabelslines=$extrafieldsline->fetch_name_optionals_label($line->table_element);
|
$extralabelslines=$extrafieldsline->fetch_name_optionals_label($line->table_element);
|
||||||
|
|
||||||
$line->fetch_optionals($line->rowid, $extralabelslines);
|
$line->fetch_optionals();
|
||||||
|
|
||||||
print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bc[$var], 'colspan'=>5));
|
print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bc[$var], 'colspan'=>5));
|
||||||
|
|
||||||
@ -1521,7 +1521,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
$extrafieldsline = new ExtraFields($db);
|
$extrafieldsline = new ExtraFields($db);
|
||||||
$extralabelslines=$extrafieldsline->fetch_name_optionals_label($line->table_element);
|
$extralabelslines=$extrafieldsline->fetch_name_optionals_label($line->table_element);
|
||||||
$line->fetch_optionals($line->rowid, $extralabelslines);
|
$line->fetch_optionals();
|
||||||
|
|
||||||
print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>5));
|
print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>5));
|
||||||
|
|
||||||
|
|||||||
@ -1642,7 +1642,7 @@ elseif (! empty($object->id))
|
|||||||
$author = new User($db);
|
$author = new User($db);
|
||||||
$author->fetch($object->user_author_id);
|
$author->fetch($object->user_author_id);
|
||||||
|
|
||||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
$res=$object->fetch_optionals();
|
||||||
|
|
||||||
|
|
||||||
$head = ordersupplier_prepare_head($object);
|
$head = ordersupplier_prepare_head($object);
|
||||||
|
|||||||
@ -93,7 +93,7 @@ else if ($action == 'add')
|
|||||||
$object->fk_user_author = $user->id;
|
$object->fk_user_author = $user->id;
|
||||||
$object->datec = dol_now();
|
$object->datec = dol_now();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$id = $object->create($user);
|
$id = $object->create($user);
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ else if ($action == 'add')
|
|||||||
else if ($action == 'update')
|
else if ($action == 'update')
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (! $cancel) {
|
if (! $cancel) {
|
||||||
|
|
||||||
$name = GETPOST('name', 'alpha');
|
$name = GETPOST('name', 'alpha');
|
||||||
@ -132,7 +132,7 @@ else if ($action == 'update')
|
|||||||
$error ++;
|
$error ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($error))
|
if (empty($error))
|
||||||
{
|
{
|
||||||
$object->name = GETPOST('name', 'alpha');
|
$object->name = GETPOST('name', 'alpha');
|
||||||
$object->address = GETPOST('address', 'alpha');
|
$object->address = GETPOST('address', 'alpha');
|
||||||
@ -141,7 +141,7 @@ else if ($action == 'update')
|
|||||||
$object->country_id = GETPOST('country_id', 'int');
|
$object->country_id = GETPOST('country_id', 'int');
|
||||||
$object->fk_user_mod = $user->id;
|
$object->fk_user_mod = $user->id;
|
||||||
$object->status = GETPOST('status','int');
|
$object->status = GETPOST('status','int');
|
||||||
|
|
||||||
$result = $object->update($user);
|
$result = $object->update($user);
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
@ -201,18 +201,18 @@ if ($action == 'create')
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
print $formcompany->select_ziptown(GETPOST('zipcode', 'alpha'), 'zipcode', array (
|
print $formcompany->select_ziptown(GETPOST('zipcode', 'alpha'), 'zipcode', array (
|
||||||
'town',
|
'town',
|
||||||
'selectcountry_id'
|
'selectcountry_id'
|
||||||
), 6);
|
), 6);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Town
|
// Town
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.fieldLabel('Town','town',0).'</td>';
|
print '<td>'.fieldLabel('Town','town',0).'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formcompany->select_ziptown(GETPOST('town', 'alpha'), 'town', array (
|
print $formcompany->select_ziptown(GETPOST('town', 'alpha'), 'town', array (
|
||||||
'zipcode',
|
'zipcode',
|
||||||
'selectcountry_id'
|
'selectcountry_id'
|
||||||
));
|
));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -234,7 +234,7 @@ if ($action == 'create')
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
@ -286,12 +286,12 @@ if (($id || $ref) && $action == 'edit')
|
|||||||
print '<tr><td>'.fieldLabel('Zip','zipcode',0).'</td><td>';
|
print '<tr><td>'.fieldLabel('Zip','zipcode',0).'</td><td>';
|
||||||
print $formcompany->select_ziptown($object->zip, 'zipcode', array (
|
print $formcompany->select_ziptown($object->zip, 'zipcode', array (
|
||||||
'town',
|
'town',
|
||||||
'selectcountry_id'
|
'selectcountry_id'
|
||||||
), 6) . '</tr>';
|
), 6) . '</tr>';
|
||||||
print '<tr><td>'.fieldLabel('Town','town',0).'</td><td>';
|
print '<tr><td>'.fieldLabel('Town','town',0).'</td><td>';
|
||||||
print $formcompany->select_ziptown($object->town, 'town', array (
|
print $formcompany->select_ziptown($object->town, 'town', array (
|
||||||
'zipcode',
|
'zipcode',
|
||||||
'selectcountry_id'
|
'selectcountry_id'
|
||||||
)) . '</td></tr>';
|
)) . '</td></tr>';
|
||||||
|
|
||||||
// Country
|
// Country
|
||||||
@ -300,7 +300,7 @@ if (($id || $ref) && $action == 'edit')
|
|||||||
print $form->select_country($object->fk_country,'country_id');
|
print $form->select_country($object->fk_country,'country_id');
|
||||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
print '<tr><td>'.fieldLabel('Status','status',1).'</td><td>';
|
print '<tr><td>'.fieldLabel('Status','status',1).'</td><td>';
|
||||||
@ -325,11 +325,11 @@ if (($id || $ref) && $action == 'edit')
|
|||||||
|
|
||||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
||||||
{
|
{
|
||||||
$res = $object->fetch_optionals($object->id, $extralabels);
|
$res = $object->fetch_optionals();
|
||||||
|
|
||||||
$head = establishment_prepare_head($object);
|
$head = establishment_prepare_head($object);
|
||||||
dol_fiche_head($head, 'card', $langs->trans("Establishment"), -1, 'building');
|
dol_fiche_head($head, 'card', $langs->trans("Establishment"), -1, 'building');
|
||||||
|
|
||||||
// Confirmation to delete
|
// Confirmation to delete
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
@ -337,22 +337,22 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Object card
|
// Object card
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
|
|
||||||
$linkback = '<a href="' . DOL_URL_ROOT . '/hrm/admin/admin_establishment.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
$linkback = '<a href="' . DOL_URL_ROOT . '/hrm/admin/admin_establishment.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||||
|
|
||||||
$morehtmlref='<div class="refidno">';
|
$morehtmlref='<div class="refidno">';
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'id', $morehtmlref);
|
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'id', $morehtmlref);
|
||||||
|
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
//print '<div class="fichehalfleft">';
|
//print '<div class="fichehalfleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border centpercent">'."\n";
|
print '<table class="border centpercent">'."\n";
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
@ -393,9 +393,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<div class="clearboth"></div><br>';
|
print '<div class="clearboth"></div><br>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -407,6 +407,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$id.'">'.$langs->trans('Delete').'</a>';
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$id.'">'.$langs->trans('Delete').'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -571,7 +571,7 @@ else
|
|||||||
// copy from expedition
|
// copy from expedition
|
||||||
$expeditionExtrafields = new Extrafields($db);
|
$expeditionExtrafields = new Extrafields($db);
|
||||||
$expeditionExtrafieldLabels = $expeditionExtrafields->fetch_name_optionals_label($expedition->table_element);
|
$expeditionExtrafieldLabels = $expeditionExtrafields->fetch_name_optionals_label($expedition->table_element);
|
||||||
if ($expedition->fetch_optionals($object->origin_id, $expeditionExtrafieldLabels) > 0) {
|
if ($expedition->fetch_optionals($object->origin_id) > 0) {
|
||||||
$object->array_options = array_merge($object->array_options, $expedition->array_options);
|
$object->array_options = array_merge($object->array_options, $expedition->array_options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -674,12 +674,12 @@ else
|
|||||||
$colspan=2;
|
$colspan=2;
|
||||||
$mode = ($object->statut == 0) ? 'edit' : 'view';
|
$mode = ($object->statut == 0) ? 'edit' : 'view';
|
||||||
$line = new LivraisonLigne($db);
|
$line = new LivraisonLigne($db);
|
||||||
$line->fetch_optionals($object->lines[$i]->id,$extralabelslines);
|
$line->fetch_optionals($object->lines[$i]->id);
|
||||||
if ($action = 'create_delivery') {
|
if ($action = 'create_delivery') {
|
||||||
$srcLine = new ExpeditionLigne($db);
|
$srcLine = new ExpeditionLigne($db);
|
||||||
$expeditionLineExtrafields = new Extrafields($db);
|
$expeditionLineExtrafields = new Extrafields($db);
|
||||||
$expeditionLineExtrafieldLabels = $expeditionLineExtrafields->fetch_name_optionals_label($srcLine->table_element);
|
$expeditionLineExtrafieldLabels = $expeditionLineExtrafields->fetch_name_optionals_label($srcLine->table_element);
|
||||||
$srcLine->fetch_optionals($expedition->lines[$i]->id,$expeditionLineExtrafieldLabels);
|
$srcLine->fetch_optionals($expedition->lines[$i]->id);
|
||||||
$line->array_options = array_merge($line->array_options, $srcLine->array_options);
|
$line->array_options = array_merge($line->array_options, $srcLine->array_options);
|
||||||
}
|
}
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|||||||
@ -228,7 +228,7 @@ if (($id || $ref) && $action == 'edit')
|
|||||||
// Part to show record
|
// Part to show record
|
||||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
||||||
{
|
{
|
||||||
$res = $object->fetch_optionals($object->id, $extralabels);
|
$res = $object->fetch_optionals();
|
||||||
|
|
||||||
$head = myobjectPrepareHead($object);
|
$head = myobjectPrepareHead($object);
|
||||||
dol_fiche_head($head, 'card', $langs->trans("MyObject"), -1, 'myobject@mymodule');
|
dol_fiche_head($head, 'card', $langs->trans("MyObject"), -1, 'myobject@mymodule');
|
||||||
|
|||||||
@ -156,7 +156,7 @@ class PriceParser
|
|||||||
//Retrieve all extrafield for product and add it to values
|
//Retrieve all extrafield for product and add it to values
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label('product', true);
|
$extralabels = $extrafields->fetch_name_optionals_label('product', true);
|
||||||
$product->fetch_optionals($product->id, $extralabels);
|
$product->fetch_optionals();
|
||||||
foreach ($extrafields->attribute_label as $key=>$label)
|
foreach ($extrafields->attribute_label as $key=>$label)
|
||||||
{
|
{
|
||||||
$values["extrafield_".$key] = $product->array_options['options_'.$key];
|
$values["extrafield_".$key] = $product->array_options['options_'.$key];
|
||||||
|
|||||||
@ -194,7 +194,7 @@ if (($id || $ref) && $action == 'edit')
|
|||||||
// Part to show record
|
// Part to show record
|
||||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
||||||
{
|
{
|
||||||
$res = $object->fetch_optionals($object->id, $extralabels);
|
$res = $object->fetch_optionals();
|
||||||
|
|
||||||
$head = inventoryPrepareHead($object);
|
$head = inventoryPrepareHead($object);
|
||||||
dol_fiche_head($head, 'inventory', $langs->trans("Inventory"), -1, 'inventory');
|
dol_fiche_head($head, 'inventory', $langs->trans("Inventory"), -1, 'inventory');
|
||||||
|
|||||||
@ -305,7 +305,7 @@ if ($action == 'create')
|
|||||||
// Part to show record
|
// Part to show record
|
||||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
||||||
{
|
{
|
||||||
$res = $object->fetch_optionals($object->id, $extralabels);
|
$res = $object->fetch_optionals();
|
||||||
|
|
||||||
//print load_fiche_titre($langs->trans("Batch"));
|
//print load_fiche_titre($langs->trans("Batch"));
|
||||||
|
|
||||||
|
|||||||
@ -660,7 +660,7 @@ elseif ($object->id > 0)
|
|||||||
* Show or edit
|
* Show or edit
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
$res=$object->fetch_optionals();
|
||||||
|
|
||||||
// To verify role of users
|
// To verify role of users
|
||||||
$userAccess = $object->restrictedProjectArea($user,'read');
|
$userAccess = $object->restrictedProjectArea($user,'read');
|
||||||
|
|||||||
@ -207,7 +207,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$object->fetch($id, $ref);
|
$object->fetch($id, $ref);
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
$res=$object->fetch_optionals($object->id,$extralabels_projet);
|
$res=$object->fetch_optionals();
|
||||||
|
|
||||||
|
|
||||||
// To verify role of users
|
// To verify role of users
|
||||||
|
|||||||
@ -97,7 +97,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
if ($object->fetch($id,$ref) > 0)
|
if ($object->fetch($id,$ref) > 0)
|
||||||
{
|
{
|
||||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
$res=$object->fetch_optionals();
|
||||||
|
|
||||||
$result=$projectstatic->fetch($object->fk_project);
|
$result=$projectstatic->fetch($object->fk_project);
|
||||||
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
|
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
|
||||||
|
|||||||
@ -207,7 +207,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
if ($object->fetch($id,$ref) > 0)
|
if ($object->fetch($id,$ref) > 0)
|
||||||
{
|
{
|
||||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
$res=$object->fetch_optionals();
|
||||||
|
|
||||||
$result=$projectstatic->fetch($object->fk_project);
|
$result=$projectstatic->fetch($object->fk_project);
|
||||||
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
|
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
|
||||||
|
|||||||
@ -288,13 +288,13 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
|||||||
{
|
{
|
||||||
$result=$projectstatic->fetch($projectidforalltimes);
|
$result=$projectstatic->fetch($projectidforalltimes);
|
||||||
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
|
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
|
||||||
$res=$projectstatic->fetch_optionals($object->id,$extralabels_projet);
|
$res=$projectstatic->fetch_optionals();
|
||||||
}
|
}
|
||||||
elseif ($object->fetch($id, $ref) >= 0)
|
elseif ($object->fetch($id, $ref) >= 0)
|
||||||
{
|
{
|
||||||
$result=$projectstatic->fetch($object->fk_project);
|
$result=$projectstatic->fetch($object->fk_project);
|
||||||
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
|
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
|
||||||
$res=$projectstatic->fetch_optionals($object->id,$extralabels_projet);
|
$res=$projectstatic->fetch_optionals();
|
||||||
|
|
||||||
$object->project = clone $projectstatic;
|
$object->project = clone $projectstatic;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,7 +77,7 @@ if ($id > 0)
|
|||||||
{
|
{
|
||||||
$res=$object->fetch($id);
|
$res=$object->fetch($id);
|
||||||
if ($res < 0) { dol_print_error($db,$object->error); exit; }
|
if ($res < 0) { dol_print_error($db,$object->error); exit; }
|
||||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
$res=$object->fetch_optionals();
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("MemberCard"), '', '');
|
print load_fiche_titre($langs->trans("MemberCard"), '', '');
|
||||||
|
|
||||||
|
|||||||
@ -566,7 +566,7 @@ class Dolresource extends CommonObject
|
|||||||
// Retreive all extrafield for thirdparty
|
// Retreive all extrafield for thirdparty
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
|
|
||||||
$line->fetch_optionals($line->id,$extralabels);
|
$line->fetch_optionals();
|
||||||
|
|
||||||
$this->lines[] = $line;
|
$this->lines[] = $line;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1418,7 +1418,7 @@ else
|
|||||||
|
|
||||||
if ($socid)
|
if ($socid)
|
||||||
{
|
{
|
||||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
$res=$object->fetch_optionals();
|
||||||
//if ($res < 0) { dol_print_error($db); exit; }
|
//if ($res < 0) { dol_print_error($db); exit; }
|
||||||
|
|
||||||
$head = societe_prepare_head($object);
|
$head = societe_prepare_head($object);
|
||||||
@ -2011,7 +2011,7 @@ else
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!empty($object->id)) $res=$object->fetch_optionals($object->id,$extralabels);
|
if (!empty($object->id)) $res=$object->fetch_optionals();
|
||||||
//if ($res < 0) { dol_print_error($db); exit; }
|
//if ($res < 0) { dol_print_error($db); exit; }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -150,7 +150,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!empty($object->id)) $res=$object->fetch_optionals($object->id,$extralabels);
|
if (!empty($object->id)) $res=$object->fetch_optionals();
|
||||||
//if ($res < 0) { dol_print_error($db); exit; }
|
//if ($res < 0) { dol_print_error($db); exit; }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -358,7 +358,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
$lines[$i]->fetch_optionals();
|
||||||
$array_options = $lines[$i]->array_options;
|
$array_options = $lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1042,7 +1042,7 @@ class SupplierProposal extends CommonObject
|
|||||||
|
|
||||||
// get extrafields so they will be clone
|
// get extrafields so they will be clone
|
||||||
foreach($this->lines as $line)
|
foreach($this->lines as $line)
|
||||||
$line->fetch_optionals($line->rowid);
|
$line->fetch_optionals();
|
||||||
|
|
||||||
// Load source object
|
// Load source object
|
||||||
$objFrom = clone $this;
|
$objFrom = clone $this;
|
||||||
|
|||||||
@ -1176,7 +1176,7 @@ else
|
|||||||
{
|
{
|
||||||
$object->fetch($id, '', '', 1);
|
$object->fetch($id, '', '', 1);
|
||||||
if ($res < 0) { dol_print_error($db,$object->error); exit; }
|
if ($res < 0) { dol_print_error($db,$object->error); exit; }
|
||||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
$res=$object->fetch_optionals();
|
||||||
|
|
||||||
// Check if user has rights
|
// Check if user has rights
|
||||||
$object->getrights();
|
$object->getrights();
|
||||||
|
|||||||
@ -306,7 +306,7 @@ function getActionComm($authentication,$id)
|
|||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('actioncomm',true);
|
$extralabels=$extrafields->fetch_name_optionals_label('actioncomm',true);
|
||||||
//Get extrafield values
|
//Get extrafield values
|
||||||
$actioncomm->fetch_optionals($actioncomm->id,$extralabels);
|
$actioncomm->fetch_optionals();
|
||||||
|
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attribute_label as $key=>$label)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -311,7 +311,7 @@ function getContact($authentication,$id,$ref_ext)
|
|||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('socpeople',true);
|
$extralabels=$extrafields->fetch_name_optionals_label('socpeople',true);
|
||||||
//Get extrafield values
|
//Get extrafield values
|
||||||
$contact->fetch_optionals($contact->id,$extralabels);
|
$contact->fetch_optionals();
|
||||||
|
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attribute_label as $key=>$label)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -425,7 +425,7 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang=''
|
|||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('product',true);
|
$extralabels=$extrafields->fetch_name_optionals_label('product',true);
|
||||||
//Get extrafield values
|
//Get extrafield values
|
||||||
$product->fetch_optionals($product->id,$extralabels);
|
$product->fetch_optionals();
|
||||||
|
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attribute_label as $key=>$label)
|
||||||
{
|
{
|
||||||
@ -1096,7 +1096,7 @@ function getProductsForCategory($authentication,$id,$lang='')
|
|||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('product',true);
|
$extralabels=$extrafields->fetch_name_optionals_label('product',true);
|
||||||
//Get extrafield values
|
//Get extrafield values
|
||||||
$obj->fetch_optionals($obj->id,$extralabels);
|
$obj->fetch_optionals();
|
||||||
|
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attribute_label as $key=>$label)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -377,7 +377,7 @@ function getProject($authentication,$id='',$ref='')
|
|||||||
$extralabels=$extrafields->fetch_name_optionals_label('societe',true);
|
$extralabels=$extrafields->fetch_name_optionals_label('societe',true);
|
||||||
|
|
||||||
//Get extrafield values
|
//Get extrafield values
|
||||||
$project->fetch_optionals($project->id,$extralabels);
|
$project->fetch_optionals();
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attribute_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]));
|
||||||
|
|||||||
@ -357,7 +357,7 @@ function getThirdParty($authentication,$id='',$ref='',$ref_ext='')
|
|||||||
$extrafields=new ExtraFields($db);
|
$extrafields=new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('societe',true);
|
$extralabels=$extrafields->fetch_name_optionals_label('societe',true);
|
||||||
//Get extrafield values
|
//Get extrafield values
|
||||||
$thirdparty->fetch_optionals($thirdparty->id,$extralabels);
|
$thirdparty->fetch_optionals();
|
||||||
|
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attribute_label as $key=>$label)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -221,7 +221,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
{
|
{
|
||||||
if ($object->fk_soc >0 && empty($socid)) $socid = $object->fk_soc;
|
if ($object->fk_soc >0 && empty($socid)) $socid = $object->fk_soc;
|
||||||
|
|
||||||
$res = $object->fetch_optionals($object->id, $extralabels);
|
$res = $object->fetch_optionals();
|
||||||
|
|
||||||
$head = websiteaccountPrepareHead($object);
|
$head = websiteaccountPrepareHead($object);
|
||||||
dol_fiche_head($head, 'card', $langs->trans("WebsiteAccount"), -1, 'websiteaccount@website');
|
dol_fiche_head($head, 'card', $langs->trans("WebsiteAccount"), -1, 'websiteaccount@website');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user