Merge branch 'NEW_OF_Child' of github.com:atm-lena/dolibarr into NEW_OF_Child
This commit is contained in:
commit
1931ad3bab
@ -139,7 +139,7 @@ if ($action == 'add' && !empty($permissiontoadd)) {
|
||||
$urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist;
|
||||
$urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation
|
||||
|
||||
if(!empty($noback)) {
|
||||
if (!empty($noback)) {
|
||||
header("Location: " . $urltogo);
|
||||
exit;
|
||||
}
|
||||
@ -309,7 +309,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) {
|
||||
// Delete OK
|
||||
setEventMessages("RecordDeleted", null, 'mesgs');
|
||||
|
||||
if(!empty($noback)) {
|
||||
if (!empty($noback)) {
|
||||
header("Location: " . $backurlforlist);
|
||||
exit;
|
||||
}
|
||||
@ -355,7 +355,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto
|
||||
|
||||
setEventMessages($langs->trans('RecordDeleted'), null, 'mesgs');
|
||||
|
||||
if(!empty($noback)) {
|
||||
if (!empty($noback)) {
|
||||
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
|
||||
exit;
|
||||
}
|
||||
@ -496,7 +496,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && !empty($permissiontoadd))
|
||||
$newid = $result;
|
||||
}
|
||||
|
||||
if(!empty($noback)) {
|
||||
if (!empty($noback)) {
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $newid); // Open record of new object
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -1216,7 +1216,7 @@ class Mo extends CommonObject
|
||||
$objectline = new MoLine($this->db);
|
||||
|
||||
$TFilters = array('customsql'=>'fk_mo = '.((int) $this->id));
|
||||
if(!empty($rolefilter)) $TFilters['role'] = $rolefilter;
|
||||
if (!empty($rolefilter)) $TFilters['role'] = $rolefilter;
|
||||
$result = $objectline->fetchAll('ASC', 'position', 0, 0, $TFilters);
|
||||
|
||||
if (is_numeric($result)) {
|
||||
@ -1343,7 +1343,7 @@ class Mo extends CommonObject
|
||||
print '<td class="center">'.$langs->trans('DisableStockChange').'</td>';
|
||||
print '<td class="center">'.$langs->trans('MoChildGenerate').'</td>';
|
||||
//print '<td class="center">'.$form->showCheckAddButtons('checkforselect', 1).'</td>';
|
||||
// print '<td class="center"></td>';
|
||||
// print '<td class="center"></td>';
|
||||
print '</tr>';
|
||||
$i = 0;
|
||||
|
||||
|
||||
@ -122,7 +122,7 @@ if (empty($reshook)) {
|
||||
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
|
||||
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
|
||||
$backtopage = $backurlforlist;
|
||||
} else {
|
||||
} else {
|
||||
$backtopage = DOL_URL_ROOT.'/mrp/mo_card.php?id='.($id > 0 ? $id : '__ID__');
|
||||
}
|
||||
}
|
||||
@ -131,12 +131,13 @@ if (empty($reshook)) {
|
||||
$backtopage = $backtopageforcancel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$triggermodname = 'MRP_MO_MODIFY'; // Name of trigger action code to execute when we modify record
|
||||
|
||||
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
|
||||
|
||||
if($action == 'add' && empty($id)){
|
||||
|
||||
if ($action == 'add' && empty($id)) {
|
||||
$noback = "";
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||
|
||||
@ -145,15 +146,14 @@ if (empty($reshook)) {
|
||||
$moline = new MoLine($db);
|
||||
$objectbomchildline = new BOMLine($db);
|
||||
|
||||
foreach($TBomLineId as $id_bom_line){
|
||||
|
||||
foreach ($TBomLineId as $id_bom_line) {
|
||||
$object = new Mo($db);
|
||||
|
||||
$objectbomchildline->fetch($id_bom_line);
|
||||
|
||||
$TMoLines = $moline->fetchAll('', '', '1', '', array('origin_id' => $id_bom_line));
|
||||
|
||||
foreach ($TMoLines as $moline){
|
||||
foreach ($TMoLines as $moline) {
|
||||
$_POST['fk_bom'] = $objectbomchildline->fk_bom_child;
|
||||
$_POST['fk_parent_line'] = $moline->id;
|
||||
$_POST['qty'] = $moline->qty;
|
||||
@ -169,11 +169,12 @@ if (empty($reshook)) {
|
||||
|
||||
header("Location: ".$urltogo);
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||
|
||||
|
||||
|
||||
// Actions when linking object each other
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
|
||||
|
||||
@ -461,7 +462,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if ($ref == 'PROV') {
|
||||
$object->fetch_product();
|
||||
$numref = $object->getNextNumRef($object->fk_product);
|
||||
|
||||
} else {
|
||||
$numref = $object->ref;
|
||||
}
|
||||
@ -773,7 +773,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print $formfile->showdocuments('mrp:mo', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $mysoc->default_lang);
|
||||
|
||||
// Show links to link elements
|
||||
$linktoelem = $form->showLinkToObjectBlock($object,'', array('mo'));
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('mo'));
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
|
||||
|
||||
|
||||
@ -43,15 +43,14 @@ $res = $tmpbom->fetch($line->fk_bom_child);
|
||||
<?php
|
||||
print '<tr class="oddeven'.(empty($this->tpl['strike']) ? '' : ' strikefordisabled').'">';
|
||||
print '<td>';
|
||||
if($res){
|
||||
if ($res) {
|
||||
print $tmpproduct->getNomUrl(1);
|
||||
print ' '.$langs->trans("or").' ';
|
||||
print $tmpbom->getNomUrl(1);
|
||||
print ' <a class="collapse_bom" id="collapse-'.$line->id.'" href="#">';
|
||||
print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open'));
|
||||
print '</a>';
|
||||
|
||||
} else{
|
||||
} else {
|
||||
print $this->tpl['label'];
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user