NEW choose lines while creating intervention card from origin
This commit is contained in:
parent
49470ea216
commit
e006876f25
@ -200,6 +200,7 @@ if (empty($reshook))
|
|||||||
$mesg = $object->error;
|
$mesg = $object->error;
|
||||||
}
|
}
|
||||||
} elseif ($action == 'add' && $user->rights->ficheinter->creer) {
|
} elseif ($action == 'add' && $user->rights->ficheinter->creer) {
|
||||||
|
$selectedLines = GETPOST('toselect', 'array');
|
||||||
$object->socid = $socid;
|
$object->socid = $socid;
|
||||||
$object->duration = (int) GETPOST('duration', 'int');
|
$object->duration = (int) GETPOST('duration', 'int');
|
||||||
$object->fk_project = (int) GETPOST('projectid', 'int');
|
$object->fk_project = (int) GETPOST('projectid', 'int');
|
||||||
@ -284,6 +285,8 @@ if (empty($reshook))
|
|||||||
|
|
||||||
for ($i = 0; $i < $num; $i++)
|
for ($i = 0; $i < $num; $i++)
|
||||||
{
|
{
|
||||||
|
if (!in_array($lines[$i]->id, $selectedLines)) continue; // Skip unselected lines
|
||||||
|
|
||||||
$product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : Product::TYPE_PRODUCT);
|
$product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : Product::TYPE_PRODUCT);
|
||||||
|
|
||||||
if ($product_type == Product::TYPE_SERVICE || !empty($conf->global->FICHINTER_PRINT_PRODUCTS)) { //only services except if config includes products
|
if ($product_type == Product::TYPE_SERVICE || !empty($conf->global->FICHINTER_PRINT_PRODUCTS)) { //only services except if config includes products
|
||||||
@ -1023,8 +1026,6 @@ if ($action == 'create')
|
|||||||
print '<input type="button" class="button button-cancel" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
|
print '<input type="button" class="button button-cancel" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
|
||||||
|
|
||||||
// Show origin lines
|
// Show origin lines
|
||||||
if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
|
if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
|
||||||
$title = $langs->trans('Services');
|
$title = $langs->trans('Services');
|
||||||
@ -1036,6 +1037,8 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user