';
print '
'."\n";
diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php
index 2b482ea81a0..3c04548d7c6 100644
--- a/htdocs/accountancy/bookkeeping/balance.php
+++ b/htdocs/accountancy/bookkeeping/balance.php
@@ -265,7 +265,7 @@ if ($action != 'export_csv')
$description = $object->get_compte_desc($line->numero_compte); // Search description of the account
$root_account_description = $object->get_compte_racine($line->numero_compte);
if (empty($description)) {
- $link = '' . img_edit_add() . '';
+ $link = '' . img_edit_add() . '';
}
print '';
diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php
index d446c7b82eb..5f9ba37d341 100644
--- a/htdocs/accountancy/bookkeeping/card.php
+++ b/htdocs/accountancy/bookkeeping/card.php
@@ -439,7 +439,7 @@ if ($action == 'create')
print $langs->trans('Docdate');
print '';
if ($action != 'editdate')
- print '| piece_num .'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).' | ';
+ print 'piece_num .'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).' | ';
print '
';
print '
';
if ($action == 'editdate') {
@@ -463,7 +463,7 @@ if ($action == 'create')
print $langs->trans('Codejournal');
print ' | ';
if ($action != 'editjournal')
- print '
piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).' | ';
+ print '
piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).' | ';
print '';
print '
';
if ($action == 'editjournal') {
@@ -487,7 +487,7 @@ if ($action == 'create')
print $langs->trans('Piece');
print ' | ';
if ($action != 'editdocref')
- print '
piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).' | ';
+ print '
piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).' | ';
print '';
print '
';
if ($action == 'editdocref') {
diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index 4653ed43714..20da8ffd2f7 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -68,7 +68,7 @@ $object = new Adherent($db);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
-$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
+$extrafields->fetch_name_optionals_label($object->table_element);
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
$object->getCanvas($id);
@@ -320,7 +320,7 @@ if (empty($reshook))
$object->public = GETPOST("public", 'alpha');
// Fill array 'array_options' with data from add form
- $ret = $extrafields->setOptionalsFromPost($extralabels, $object);
+ $ret = $extrafields->setOptionalsFromPost(null, $object);
if ($ret < 0) $error++;
// Check if we need to also synchronize user information
@@ -497,7 +497,7 @@ if (empty($reshook))
$object->public = $public;
// Fill array 'array_options' with data from add form
- $ret = $extrafields->setOptionalsFromPost($extralabels, $object);
+ $ret = $extrafields->setOptionalsFromPost(null, $object);
if ($ret < 0) $error++;
// Check parameters
@@ -1362,15 +1362,8 @@ else
else print $langs->trans("NoDolibarrAccess");
print ' | ';
- // Other attributes
+ // Other attributes. Fields from hook formObjectOptions and Extrafields.
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
- //Hooks here
- $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- if (empty($reshook))
- {
- print $object->showOptionals($extrafields, 'edit');
- }
print '';
dol_fiche_end();
diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php
index d7e0e9215a9..177e2eef18f 100644
--- a/htdocs/adherents/cartes/carte.php
+++ b/htdocs/adherents/cartes/carte.php
@@ -48,7 +48,7 @@ $object=new Adherent($db);
$extrafields = new ExtraFields($db);
// Fetch optionals attributes and labels
-$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
+$extrafields->fetch_name_optionals_label($object->table_element);
/*
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index 57d99a387e2..877dde34af0 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -89,7 +89,7 @@ $hookmanager->initHooks(array('memberlist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
-$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
+$extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php
index 97f259b53de..415efdc8570 100644
--- a/htdocs/adherents/subscription.php
+++ b/htdocs/adherents/subscription.php
@@ -68,7 +68,7 @@ $extrafields = new ExtraFields($db);
$adht = new AdherentType($db);
// fetch optionals attributes and labels
-$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
+$extrafields->fetch_name_optionals_label($object->table_element);
$errmsg='';
$errmsgs=array();
@@ -571,7 +571,7 @@ if ($rowid > 0)
print '
';
print '
';
if ($action == 'editthirdparty')
@@ -614,7 +614,7 @@ if ($rowid > 0)
print ' | ';
if ($user->rights->user->user->creer)
{
- print 'id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'';
+ print 'id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'';
}
print ' | ';
}
diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php
index 5d8bbdad08d..dbc14e2999e 100644
--- a/htdocs/adherents/subscription/list.php
+++ b/htdocs/adherents/subscription/list.php
@@ -68,7 +68,7 @@ $hookmanager->initHooks(array('subscriptionlist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
-$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
+$extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index ac15e8d28ae..b24e3361d16 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -73,7 +73,7 @@ $object = new AdherentType($db);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
-$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
+$extrafields->fetch_name_optionals_label($object->table_element);
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
{
@@ -113,7 +113,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) {
$object->vote = (int) $vote;
// Fill array 'array_options' with data from add form
- $ret = $extrafields->setOptionalsFromPost($extralabels, $object);
+ $ret = $extrafields->setOptionalsFromPost(null, $object);
if ($ret < 0) $error++;
if (empty($object->label)) {
@@ -168,7 +168,7 @@ if ($action == 'update' && $user->rights->adherent->configurer)
$object->vote = (boolean) trim($vote);
// Fill array 'array_options' with data from add form
- $ret = $extrafields->setOptionalsFromPost($extralabels, $object);
+ $ret = $extrafields->setOptionalsFromPost(null, $object);
if ($ret < 0) $error++;
$ret=$object->update($user);
@@ -713,7 +713,7 @@ if ($rowid > 0)
print '
';
if ($user->rights->adherent->creer)
{
- print 'id).'">'.img_edit().'';
+ print 'id).'">'.img_edit().'';
}
print ' ';
if ($user->rights->adherent->supprimer)
diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php
index 24aa836a038..255fdb68a0d 100644
--- a/htdocs/admin/emailcollector_card.php
+++ b/htdocs/admin/emailcollector_card.php
@@ -57,7 +57,7 @@ $diroutputmassaction = $conf->emailcollector->dir_output . '/temp/massgeneration
$hookmanager->initHooks(array('emailcollectorcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
-$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
+$extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
@@ -378,7 +378,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
if ($action != 'classify')
{
- $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.=' | '.($object->remise_percent?''.$object->remise_percent.'%':'').' | ';
@@ -457,7 +456,7 @@ if ($object->id > 0)
print '
| ';
if ($user->rights->societe->creer)
{
- print ''.img_edit($langs->trans("Modify")).'';
+ print ''.img_edit($langs->trans("Modify")).'';
}
print ' | ';
print '
';
@@ -474,7 +473,7 @@ if ($object->id > 0)
print '';
print ' | ';
if ($action == 'editshipping')
@@ -542,7 +541,7 @@ if ($object->id > 0)
print '';
print ' | ';
if ($action == 'editlevel')
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index 9609038ca41..33de68f22a1 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -51,7 +51,7 @@ $result=$object->fetch($id);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
-$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
+$extrafields->fetch_name_optionals_label($object->table_element);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('mailingcard','globalcard'));
diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php
index 006e009c78d..7346bf87543 100644
--- a/htdocs/comm/mailing/class/advtargetemailing.class.php
+++ b/htdocs/comm/mailing/class/advtargetemailing.class.php
@@ -544,7 +544,7 @@ class AdvanceTargetingMailing extends CommonObject
public function query_thirdparty($arrayquery)
{
// phpcs:enable
- global $langs,$conf;
+ global $langs,$conf,$extrafields;
$sql = "SELECT";
$sql.= " t.rowid";
@@ -617,29 +617,29 @@ class AdvanceTargetingMailing extends CommonObject
//Standard Extrafield feature
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
- // fetch optionals attributes and labels
- dol_include_once('/core/class/extrafields.class.php');
- $extrafields = new ExtraFields($this->db);
- $extralabels=$extrafields->fetch_name_optionals_label('societe');
- foreach($extralabels as $key=>$val) {
+ $elementtype = Societe::$table_element;
- if (($extrafields->attribute_type[$key] == 'varchar') ||
- ($extrafields->attribute_type[$key] == 'text')) {
+ $extrafields->fetch_name_optionals_label($elementtype);
+
+ foreach($extrafields->attributes[$elementtype]['label'] as $key=>$val) {
+
+ if (($extrafields->attributes[$elementtype]['type'][$key] == 'varchar') ||
+ ($extrafields->attributes[$elementtype]['type'][$key] == 'text')) {
if (!empty($arrayquery['options_'.$key])) {
$sqlwhere[]= " (te.".$key." LIKE '".$arrayquery['options_'.$key]."')";
}
- } elseif (($extrafields->attribute_type[$key] == 'int') ||
- ($extrafields->attribute_type[$key] == 'double')) {
+ } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') ||
+ ($extrafields->attributes[$elementtype]['type'][$key] == 'double')) {
if (!empty($arrayquery['options_'.$key.'_max'])) {
$sqlwhere[]= " (te.".$key." >= ".$arrayquery['options_'.$key.'_max']." AND te.".$key." <= ".$arrayquery['options_'.$key.'_min'].")";
}
- } elseif (($extrafields->attribute_type[$key] == 'date') ||
- ($extrafields->attribute_type[$key] == 'datetime')) {
+ } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') ||
+ ($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) {
if (!empty($arrayquery['options_'.$key.'_end_dt'])){
$sqlwhere[]= " (te.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'])."' AND te.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'])."')";
}
- } elseif ($extrafields->attribute_type[$key] == 'boolean') {
+ } elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'boolean') {
if ($arrayquery['options_'.$key]!=''){
$sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key].")";
}
@@ -757,29 +757,33 @@ class AdvanceTargetingMailing extends CommonObject
//Standard Extrafield feature
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
+ $elementtype = Contact::$table_element;
+
// fetch optionals attributes and labels
dol_include_once('/core/class/extrafields.class.php');
$extrafields = new ExtraFields($this->db);
- $extralabels=$extrafields->fetch_name_optionals_label('socpeople');
+ $extrafields->fetch_name_optionals_label($elementtype);
- foreach($extralabels as $key=>$val) {
+ $extrafields->fetch_name_optionals_label($elementtype);
- if (($extrafields->attribute_type[$key] == 'varchar') ||
- ($extrafields->attribute_type[$key] == 'text')) {
+ foreach($extrafields->attributes[$elementtype]['label'] as $key=>$val) {
+
+ if (($extrafields->attributes[$elementtype]['type'][$key] == 'varchar') ||
+ ($extrafields->attributes[$elementtype]['type'][$key] == 'text')) {
if (!empty($arrayquery['options_'.$key.'_cnct'])) {
$sqlwhere[]= " (te.".$key." LIKE '".$arrayquery['options_'.$key.'_cnct']."')";
}
- } elseif (($extrafields->attribute_type[$key] == 'int') ||
- ($extrafields->attribute_type[$key] == 'double')) {
+ } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') ||
+ ($extrafields->attributes[$elementtype]['type'][$key] == 'double')) {
if (!empty($arrayquery['options_'.$key.'_max'.'_cnct'])) {
$sqlwhere[]= " (te.".$key." >= ".$arrayquery['options_'.$key.'_max'.'_cnct']." AND te.".$key." <= ".$arrayquery['options_'.$key.'_min'.'_cnct'].")";
}
- } elseif (($extrafields->attribute_type[$key] == 'date') ||
- ($extrafields->attribute_type[$key] == 'datetime')) {
+ } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') ||
+ ($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) {
if (!empty($arrayquery['options_'.$key.'_end_dt'.'_cnct'])){
$sqlwhere[]= " (te.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'.'_cnct'])."' AND te.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'.'_cnct'])."')";
}
- } elseif ($extrafields->attribute_type[$key] == 'boolean') {
+ } elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'boolean') {
if ($arrayquery['options_'.$key.'_cnct']!=''){
if ($arrayquery['options_'.$key.'_cnct']==0) {
$sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key.'_cnct']." OR ((te.".$key." IS NULL) AND (te.fk_object IS NOT NULL)))";
@@ -857,29 +861,32 @@ class AdvanceTargetingMailing extends CommonObject
//Standard Extrafield feature
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
+ $elementtype = Societe::$table_element;
+
// fetch optionals attributes and labels
dol_include_once('/core/class/extrafields.class.php');
$extrafields = new ExtraFields($this->db);
- $extralabels=$extrafields->fetch_name_optionals_label('societe');
- foreach($extralabels as $key=>$val) {
+ $extrafields->fetch_name_optionals_label($elementtype);
- if (($extrafields->attribute_type[$key] == 'varchar') ||
- ($extrafields->attribute_type[$key] == 'text')) {
+ foreach($extrafields->attributes[$elementtype]['label'] as $key=>$val) {
+
+ if (($extrafields->attributes[$elementtype]['type'][$key] == 'varchar') ||
+ ($extrafields->attributes[$elementtype]['type'][$key] == 'text')) {
if (!empty($arrayquery['options_'.$key])) {
$sqlwhere[]= " (tse.".$key." LIKE '".$arrayquery['options_'.$key]."')";
}
- } elseif (($extrafields->attribute_type[$key] == 'int') ||
- ($extrafields->attribute_type[$key] == 'double')) {
+ } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') ||
+ ($extrafields->attributes[$elementtype]['type'][$key] == 'double')) {
if (!empty($arrayquery['options_'.$key.'_max'])) {
$sqlwhere[]= " (tse.".$key." >= ".$arrayquery['options_'.$key.'_max']." AND tse.".$key." <= ".$arrayquery['options_'.$key.'_min'].")";
}
- } elseif (($extrafields->attribute_type[$key] == 'date') ||
- ($extrafields->attribute_type[$key] == 'datetime')) {
+ } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') ||
+ ($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) {
if (!empty($arrayquery['options_'.$key.'_end_dt'])){
$sqlwhere[]= " (tse.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'])."' AND tse.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'])."')";
}
- } elseif ($extrafields->attribute_type[$key] == 'boolean') {
+ } elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'boolean') {
if ($arrayquery['options_'.$key]!=''){
$sqlwhere[]= " (tse.".$key." = ".$arrayquery['options_'.$key].")";
}
diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php
index 6e308100b5a..ff69bd00c0c 100644
--- a/htdocs/comm/mailing/list.php
+++ b/htdocs/comm/mailing/list.php
@@ -53,7 +53,7 @@ $hookmanager->initHooks(array('mailinglist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
-$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
+$extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 39c80269d8f..96aa12062d4 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -93,7 +93,7 @@ $object = new Propal($db);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
-$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
+$extrafields->fetch_name_optionals_label($object->table_element);
// Load object
if ($id > 0 || ! empty($ref)) {
@@ -410,7 +410,7 @@ if (empty($reshook))
}
// Fill array 'array_options' with data from add form
- $ret = $extrafields->setOptionalsFromPost($extralabels, $object);
+ $ret = $extrafields->setOptionalsFromPost(null, $object);
if ($ret < 0) {
$error ++;
$action = 'create';
@@ -841,9 +841,8 @@ if (empty($reshook))
if (empty($remise_percent)) $remise_percent=0;
// Extrafields
- $extrafieldsline = new ExtraFields($db);
- $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
- $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
+ $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
+ $array_options = $extrafields->getOptionalsFromPost($object->table_element_line, $predef);
// Unset extrafield
if (is_array($extralabelsline)) {
// Get extra fields
@@ -1210,9 +1209,8 @@ if (empty($reshook))
$date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
// Extrafields
- $extrafieldsline = new ExtraFields($db);
- $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
- $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
+ $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
+ $array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
// Unset extrafield
if (is_array($extralabelsline)) {
// Get extra fields
@@ -1379,8 +1377,7 @@ if (empty($reshook))
$object->oldcopy = dol_clone($object);
// Fill array 'array_options' with data from update form
- $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
- $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
+ $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'none'));
if ($ret < 0) $error++;
if (! $error)
{
@@ -1903,7 +1900,7 @@ if ($action == 'create')
{
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db);
-$formquestion = array_merge($formquestion, array(
+ $formquestion = array_merge($formquestion, array(
array('type' => 'onecolumn', 'value' => $notify->confirmMessage('PROPAL_CLOSE_SIGNED', $object->socid, $object)),
));
}
@@ -1983,7 +1980,7 @@ $formquestion = array_merge($formquestion, array(
if ($usercancreate)
{
if ($action != 'classify')
- $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.=' | ';
if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
- print '
id . '">' . img_edit($langs->trans('SetDate'), 1) . ' | ';
+ print '
id . '">' . img_edit($langs->trans('SetDate'), 1) . ' | ';
print '';
print '
';
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdate' && $usercancreate) {
@@ -2075,7 +2072,7 @@ $formquestion = array_merge($formquestion, array(
print $langs->trans('DateEndPropal');
print ' | ';
if ($action != 'editecheance' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
- print '
id . '">' . img_edit($langs->trans('SetConditions'), 1) . ' | ';
+ print '
id . '">' . img_edit($langs->trans('SetConditions'), 1) . ' | ';
print '';
print '
';
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editecheance' && $usercancreate) {
@@ -2103,7 +2100,7 @@ $formquestion = array_merge($formquestion, array(
print $langs->trans('PaymentConditionsShort');
print ' | ';
if ($action != 'editconditions' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
- print '
id . '">' . img_edit($langs->transnoentitiesnoconv('SetConditions'), 1) . ' | ';
+ print '
id . '">' . img_edit($langs->transnoentitiesnoconv('SetConditions'), 1) . ' | ';
print '';
print '
';
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editconditions' && $usercancreate) {
@@ -2131,7 +2128,7 @@ $formquestion = array_merge($formquestion, array(
print ' (' . $langs->trans('AfterOrder') . ')';
print ' | ';
if ($action != 'editavailability' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
- print '
id . '">' . img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1) . ' | ';
+ print '
id . '">' . img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1) . ' | ';
print '';
print '
';
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editavailability' && $usercancreate) {
@@ -2150,7 +2147,7 @@ $formquestion = array_merge($formquestion, array(
print $langs->trans('SendingMethod');
print ' | ';
if ($action != 'editshippingmethod' && $usercancreate)
- print '
id.'">'.img_edit($langs->trans('SetShippingMode'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetShippingMode'), 1).' | ';
print '';
print '
';
if ($action == 'editshippingmethod' && $usercancreate) {
@@ -2168,7 +2165,7 @@ $formquestion = array_merge($formquestion, array(
print $langs->trans('Source');
print ' | ';
if ($action != 'editdemandreason' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
- print '
id . '">' . img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1) . ' | ';
+ print '
id . '">' . img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1) . ' | ';
print '';
print '
';
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdemandreason' && $usercancreate) {
@@ -2186,7 +2183,7 @@ $formquestion = array_merge($formquestion, array(
print $langs->trans('PaymentMode');
print ' | ';
if ($action != 'editmode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
- print '
id . '">' . img_edit($langs->transnoentitiesnoconv('SetMode'), 1) . ' | ';
+ print '
id . '">' . img_edit($langs->transnoentitiesnoconv('SetMode'), 1) . ' | ';
print '';
print '
';
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editmode' && $usercancreate) {
@@ -2206,7 +2203,7 @@ $formquestion = array_merge($formquestion, array(
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
print ' | ';
if ($action != 'editmulticurrencycode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
- print '
id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . ' | ';
+ print '
id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . ' | ';
print '';
print '
';
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editmulticurrencycode' && $usercancreate) {
@@ -2223,7 +2220,7 @@ $formquestion = array_merge($formquestion, array(
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
print ' | ';
if ($action != 'editmulticurrencyrate' && $object->statut == Propal::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency && $usercancreate)
- print '
id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . ' | ';
+ print '
id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . ' | ';
print '';
print '
';
if ($object->statut == Propal::STATUS_DRAFT && ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') && $usercancreate) {
@@ -2263,7 +2260,7 @@ $formquestion = array_merge($formquestion, array(
print $langs->trans('BankAccount');
print ' | ';
if ($action != 'editbankaccount' && $usercancreate)
- print '
id.'">'.img_edit($langs->trans('SetBankAccount'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetBankAccount'), 1).' | ';
print '';
print '
';
if ($action == 'editbankaccount') {
@@ -2298,7 +2295,7 @@ $formquestion = array_merge($formquestion, array(
print '| ';
print $langs->trans('IncotermLabel');
print ' | | ';
- if ($usercancreate) print ''.img_edit().'';
+ if ($usercancreate) print ''.img_edit().'';
else print ' ';
print ' | ';
print ' | ';
diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php
index 9fad14fee54..96673084580 100644
--- a/htdocs/comm/propal/contact.php
+++ b/htdocs/comm/propal/contact.php
@@ -171,7 +171,7 @@ if ($object->id > 0)
if ($user->rights->propal->creer)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php
index ffd37b5b3ee..14b845a3e8a 100644
--- a/htdocs/comm/propal/document.php
+++ b/htdocs/comm/propal/document.php
@@ -122,7 +122,7 @@ if ($object->id > 0)
if ($user->rights->propal->creer)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php
index fec6d3bd906..108a09e7d07 100644
--- a/htdocs/comm/propal/info.php
+++ b/htdocs/comm/propal/info.php
@@ -87,7 +87,7 @@ if (! empty($conf->projet->enabled))
if ($user->rights->propal->creer)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 112cc76527d..f81949fb11d 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -129,7 +129,7 @@ $hookmanager->initHooks(array('propallist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
-$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
+$extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php
index d4354cce643..2a3f0438ad0 100644
--- a/htdocs/comm/propal/note.php
+++ b/htdocs/comm/propal/note.php
@@ -102,7 +102,7 @@ if ($id > 0 || ! empty($ref))
if ($user->rights->propal->creer)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index ff4606655a5..ed08c39d869 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -88,7 +88,7 @@ $object = new Commande($db);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
-$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
+$extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
@@ -284,7 +284,7 @@ if (empty($reshook))
// Fill array 'array_options' with data from add form
if (! $error)
{
- $ret = $extrafields->setOptionalsFromPost($extralabels, $object);
+ $ret = $extrafields->setOptionalsFromPost(null, $object);
if ($ret < 0) $error++;
}
@@ -673,9 +673,8 @@ if (empty($reshook))
$remise_percent = (GETPOST('remise_percent'.$predef) != '' ? GETPOST('remise_percent'.$predef) : 0);
// Extrafields
- $extrafieldsline = new ExtraFields($db);
- $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
- $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
+ $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
+ $array_options = $extrafields->getOptionalsFromPost($object->table_element_line, $predef);
// Unset extrafield
if (is_array($extralabelsline)) {
// Get extra fields
@@ -1037,9 +1036,8 @@ if (empty($reshook))
$buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value
// Extrafields Lines
- $extrafieldsline = new ExtraFields($db);
- $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
- $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
+ $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
+ $array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
// Unset extrafield POST Data
if (is_array($extralabelsline)) {
foreach ($extralabelsline as $key => $value) {
@@ -1297,8 +1295,7 @@ if (empty($reshook))
$object->oldcopy = dol_clone($object);
// Fill array 'array_options' with data from update form
- $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
- $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
+ $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'none'));
if ($ret < 0) $error++;
if (! $error)
@@ -2096,7 +2093,7 @@ if ($action == 'create' && $usercancreate)
if ($usercancreate)
{
if ($action != 'classify')
- $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='
';
+
+ //dol_set_focus('input[name="ref"]');
}
// Part to edit record
@@ -316,7 +320,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($user->rights->mymodule->write)
{
if ($action != 'classify')
- $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='