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;
|
||||
$langs->load('projects');
|
||||
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 '</td></tr>';
|
||||
}
|
||||
|
||||
@ -272,7 +272,7 @@ $sql.= " state.code_departement, state.nom";
|
||||
// Add where from extra fields
|
||||
foreach ($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
$sql .= ', ef.'.$val;
|
||||
$sql .= ', ef.'.$key;
|
||||
}
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
|
||||
@ -460,7 +460,7 @@ class Dolresource extends CommonObject
|
||||
$extrafields=new ExtraFields($this->db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
|
||||
if (is_array($extralabels) && count($extralabels)>0) {
|
||||
foreach($extralabels as $label=>$code) {
|
||||
foreach($extralabels as $code=>$label) {
|
||||
$sql.= " ef.".$code." as extra_".$code.",";
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,12 +119,15 @@ $arrayfields = array(
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) {
|
||||
foreach ( $extrafields->attribute_label as $key => $val ) {
|
||||
$arrayfields["ef." . $key] = array(
|
||||
'label' => $extrafields->attribute_label[$key],
|
||||
'checked' => $extrafields->attribute_list[$key],
|
||||
'position' => $extrafields->attribute_pos[$key],
|
||||
'enabled' => $extrafields->attribute_perms[$key]
|
||||
);
|
||||
$typeofextrafield=$extrafields->attribute_type[$key];
|
||||
if ($typeofextrafield!='separate') {
|
||||
$arrayfields["ef." . $key] = array(
|
||||
'label' => $extrafields->attribute_label[$key],
|
||||
'checked' => $extrafields->attribute_list[$key],
|
||||
'position' => $extrafields->attribute_pos[$key],
|
||||
'enabled' => $extrafields->attribute_perms[$key]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user