Fix: For contract, only services available by default. Product appears
if option is set only.
This commit is contained in:
parent
8156b1400b
commit
b42a33b203
@ -543,7 +543,7 @@ class Form
|
|||||||
* @param string $selected Preselected type
|
* @param string $selected Preselected type
|
||||||
* @param string $htmlname Name of field in html form
|
* @param string $htmlname Name of field in html form
|
||||||
* @param int $showempty Add an empty field
|
* @param int $showempty Add an empty field
|
||||||
* @param int $hidetext Do not show label before combo box
|
* @param int $hidetext Do not show label 'Type' before combo box (used only if there is at least 2 choices to select)
|
||||||
* @param string $forceall Force to show products and services in combo list, whatever are activated modules
|
* @param string $forceall Force to show products and services in combo list, whatever are activated modules
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -577,10 +577,12 @@ class Form
|
|||||||
}
|
}
|
||||||
if (! $forceall && empty($conf->product->enabled) && ! empty($conf->service->enabled))
|
if (! $forceall && empty($conf->product->enabled) && ! empty($conf->service->enabled))
|
||||||
{
|
{
|
||||||
|
print $langs->trans("Service");
|
||||||
print '<input type="hidden" name="'.$htmlname.'" value="1">';
|
print '<input type="hidden" name="'.$htmlname.'" value="1">';
|
||||||
}
|
}
|
||||||
if (! $forceall && ! empty($conf->product->enabled) && empty($conf->service->enabled))
|
if (! $forceall && ! empty($conf->product->enabled) && empty($conf->service->enabled))
|
||||||
{
|
{
|
||||||
|
print $langs->trans("Product");
|
||||||
print '<input type="hidden" name="'.$htmlname.'" value="0">';
|
print '<input type="hidden" name="'.$htmlname.'" value="0">';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -118,7 +118,12 @@ else {
|
|||||||
else if (empty($conf->product->enabled) && ! empty($conf->service->enabled)) echo $langs->trans("FreeLineOfType").' '.$langs->trans("Service");
|
else if (empty($conf->product->enabled) && ! empty($conf->service->enabled)) echo $langs->trans("FreeLineOfType").' '.$langs->trans("Service");
|
||||||
else if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans("FreeLineOfType").' '.$langs->trans("Product");*/
|
else if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans("FreeLineOfType").' '.$langs->trans("Product");*/
|
||||||
echo ' ';
|
echo ' ';
|
||||||
echo $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1,1,1);
|
$forceall=1; // We always force all type for free lines (module product or service means we use predefined product or service)
|
||||||
|
if ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))
|
||||||
|
{
|
||||||
|
$forceall=0;
|
||||||
|
}
|
||||||
|
echo $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1,1,$forceall);
|
||||||
// }
|
// }
|
||||||
echo '</span>';
|
echo '</span>';
|
||||||
|
|
||||||
|
|||||||
@ -1725,8 +1725,11 @@ elseif (! empty($object->id))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $form->select_type_of_lines($line->product_type,'type',1);
|
$forceall=1; // For suppliers, we always show all types
|
||||||
|
print $form->select_type_of_lines($line->product_type,'type',1,0,$forceall);
|
||||||
if (! empty($conf->product->enabled) && ! empty($conf->service->enabled)) print '<br>';
|
if (! empty($conf->product->enabled) && ! empty($conf->service->enabled)) print '<br>';
|
||||||
|
if ($forceall || (! empty($conf->product->enabled) && ! empty($conf->service->enabled))
|
||||||
|
|| (empty($conf->product->enabled) && empty($conf->service->enabled))) print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_object($hookmanager))
|
if (is_object($hookmanager))
|
||||||
|
|||||||
@ -1970,7 +1970,7 @@ else
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$forceall=1; // For suppliers, we always show all types
|
$forceall=1; // For suppliers, we always show all types
|
||||||
print $form->select_type_of_lines($object->lines[$i]->product_type,'type',1);
|
print $form->select_type_of_lines($object->lines[$i]->product_type,'type',1,0,$forceall);
|
||||||
if ($forceall || (! empty($conf->product->enabled) && ! empty($conf->service->enabled))
|
if ($forceall || (! empty($conf->product->enabled) && ! empty($conf->service->enabled))
|
||||||
|| (empty($conf->product->enabled) && empty($conf->service->enabled))) print '<br>';
|
|| (empty($conf->product->enabled) && empty($conf->service->enabled))) print '<br>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user