Merge pull request #6336 from atm-florian/5.0_fix
fix : wrong $formproject->select_projects call on model invoice
This commit is contained in:
commit
9281cb9f8a
@ -983,7 +983,7 @@ if ($action == 'create')
|
|||||||
$projectid = GETPOST('projectid')?GETPOST('projectid'):$object->fk_project;
|
$projectid = GETPOST('projectid')?GETPOST('projectid'):$object->fk_project;
|
||||||
$langs->load('projects');
|
$langs->load('projects');
|
||||||
print '<tr><td>' . $langs->trans('Project') . '</td><td>';
|
print '<tr><td>' . $langs->trans('Project') . '</td><td>';
|
||||||
$numprojet = $formproject->select_projects($socid, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, $forceaddid=0, $morecss='');
|
$numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, '');
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid=' . $object->thirdparty->id . '&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$object->thirdparty->id.(!empty($id)?'&id='.$id:'')).'">' . $langs->trans("AddProject") . '</a>';
|
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid=' . $object->thirdparty->id . '&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$object->thirdparty->id.(!empty($id)?'&id='.$id:'')).'">' . $langs->trans("AddProject") . '</a>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -272,7 +272,7 @@ $sql.= " state.code_departement, state.nom";
|
|||||||
// Add where from extra fields
|
// Add where from extra fields
|
||||||
foreach ($extrafields->attribute_label as $key => $val)
|
foreach ($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$sql .= ', ef.'.$val;
|
$sql .= ', ef.'.$key;
|
||||||
}
|
}
|
||||||
// Add where from hooks
|
// Add where from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
|
|||||||
@ -460,7 +460,7 @@ class Dolresource extends CommonObject
|
|||||||
$extrafields=new ExtraFields($this->db);
|
$extrafields=new ExtraFields($this->db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
|
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
|
||||||
if (is_array($extralabels) && count($extralabels)>0) {
|
if (is_array($extralabels) && count($extralabels)>0) {
|
||||||
foreach($extralabels as $label=>$code) {
|
foreach($extralabels as $code=>$label) {
|
||||||
$sql.= " ef.".$code." as extra_".$code.",";
|
$sql.= " ef.".$code." as extra_".$code.",";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -119,6 +119,8 @@ $arrayfields = array(
|
|||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) {
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) {
|
||||||
foreach ( $extrafields->attribute_label as $key => $val ) {
|
foreach ( $extrafields->attribute_label as $key => $val ) {
|
||||||
|
$typeofextrafield=$extrafields->attribute_type[$key];
|
||||||
|
if ($typeofextrafield!='separate') {
|
||||||
$arrayfields["ef." . $key] = array(
|
$arrayfields["ef." . $key] = array(
|
||||||
'label' => $extrafields->attribute_label[$key],
|
'label' => $extrafields->attribute_label[$key],
|
||||||
'checked' => $extrafields->attribute_list[$key],
|
'checked' => $extrafields->attribute_list[$key],
|
||||||
@ -127,6 +129,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user