';
- $morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu;
+ $morehtmlref .= $langs->trans("LocationSummary").' : '.$warehouse->lieu;
// Project
if (isModEnabled('project')) {
@@ -839,23 +841,23 @@ if ($object->id > 0) {
$morehtmlref .= '
'.img_picto('', 'project').' '.$langs->trans('Project').' ';
if ($usercancreate && 1 == 2) {
if ($action != 'classify') {
- $morehtmlref .= '
: ';
}
if ($action == 'classify') {
- $projectid = $object->fk_project;
- $morehtmlref .= '
';
} else {
- $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
+ $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$warehouse->id, $warehouse->socid, $warehouse->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
}
} else {
- if (!empty($object->fk_project)) {
+ if (!empty($warehouse->fk_project)) {
$proj = new Project($db);
- $proj->fetch($object->fk_project);
+ $proj->fetch($warehouse->fk_project);
$morehtmlref .= ' : '.$proj->getNomUrl(1);
if ($proj->title) {
$morehtmlref .= ' - '.$proj->title;
@@ -872,7 +874,7 @@ if ($object->id > 0) {
$shownav = 0;
}
- dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref', 'ref', $morehtmlref);
+ dol_banner_tab($warehouse, 'ref', $linkback, $shownav, 'ref', 'ref', $morehtmlref);
print '
';
@@ -884,10 +886,10 @@ if ($object->id > 0) {
print '
';
// Description
- print '| '.$langs->trans("Description").' | '.dol_htmlentitiesbr($object->description).' |
';
+ print '
'.$langs->trans("Description").' | '.dol_htmlentitiesbr($warehouse->description).' | ';
- $calcproductsunique = $object->nb_different_products();
- $calcproducts = $object->nb_products();
+ $calcproductsunique = $warehouse->nb_different_products();
+ $calcproducts = $warehouse->nb_products();
// Total nb of different products
print '
| '.$langs->trans("NumberOfDifferentProducts").' | ';
@@ -916,7 +918,7 @@ if ($object->id > 0) {
// Last movement
$sql = "SELECT MAX(m.datem) as datem";
$sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m";
- $sql .= " WHERE m.fk_entrepot = ".((int) $object->id);
+ $sql .= " WHERE m.fk_entrepot = ".((int) $warehouse->id);
$resqlbis = $db->query($sql);
if ($resqlbis) {
$objbis = $db->fetch_object($resqlbis);
@@ -939,7 +941,7 @@ if ($object->id > 0) {
// Categories
if (isModEnabled('categorie')) {
print ' |
| '.$langs->trans("Categories").' | ';
- print $form->showCategories($object->id, Categorie::TYPE_WAREHOUSE, 1);
+ print $form->showCategories($warehouse->id, Categorie::TYPE_WAREHOUSE, 1);
print " |
";
}
@@ -972,7 +974,7 @@ if ((empty($action) || $action == 'list') && $id > 0) {
print "
\n";
$parameters = array();
- $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
+ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $warehouse, $action); // Note that $action and $warehouse may have been
// modified by hook
if (empty($reshook)) {
if ($user->hasRight('stock', 'mouvement', 'creer')) {
@@ -1002,6 +1004,9 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
if ($id > 0) {
$param .= '&id='.urlencode($id);
}
+if ($show_files) {
+ $param .= '&show_files='.urlencode($show_files);
+}
if ($search_date_startday) {
$param .= '&search_date_startday='.urlencode($search_date_startday);
}
@@ -1054,7 +1059,7 @@ if ($search_fk_project != '' && $search_fk_project != '-1') {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// Add $param from hooks
$parameters = array();
-$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $warehouse, $action); // Note that $action and $warehouse may have been modified by hook
$param .= $hookmanager->resPrint;
// List of mass actions available
@@ -1106,7 +1111,7 @@ if ($id > 0) {
$topicmail = "SendStockMovement";
$modelmail = "movementstock";
$objecttmp = new MouvementStock($db);
-$trackid = 'mov'.$object->id;
+$trackid = 'mov'.$warehouse->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($massaction == 'prereverse') {
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassReverse"), $langs->trans("ConfirmMassReverseQuestion", count($toselect)), "confirm_reverse", null, '', 0, 200, 500, 1, 'Yes');
@@ -1126,7 +1131,7 @@ if ($search_all) {
$moreforfilter = '';
$parameters = array('arrayfields'=>&$arrayfields);
-$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $warehouse, $action); // Note that $action and $warehouse may have been modified by hook
if (empty($reshook)) {
$moreforfilter .= $hookmanager->resPrint;
} else {
@@ -1231,7 +1236,7 @@ if (!empty($arrayfields['origin']['checked'])) {
if (!empty($arrayfields['m.fk_projet']['checked'])) {
// fk_project
print '
';
- print $object->showInputField($object->fields['fk_project'], 'fk_project', $search_fk_project, '', '', 'search_', 'maxwidth125', 1);
+ print $warehouse->showInputField($warehouse->fields['fk_project'], 'fk_project', $search_fk_project, '', '', 'search_', 'maxwidth125', 1);
print ' | ';
}
if (!empty($arrayfields['m.type_mouvement']['checked'])) {
@@ -1268,7 +1273,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields);
-$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $warehouse, $action); // Note that $action and $warehouse may have been modified by hook
print $hookmanager->resPrint;
// Date creation
if (!empty($arrayfields['m.datec']['checked'])) {
@@ -1355,7 +1360,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray);
-$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $warehouse, $action); // Note that $action and $warehouse may have been modified by hook
print $hookmanager->resPrint;
if (!empty($arrayfields['m.datec']['checked'])) {
print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
@@ -1393,7 +1398,7 @@ while ($i < $imaxinloop) {
$userstatic->firstname = $obj->firstname;
$userstatic->photo = $obj->photo;
$userstatic->email = $obj->user_email;
- $userstatic->statut = $obj->user_status;
+ $userstatic->status = $obj->user_status;
// Multilangs
if (getDolGlobalInt('MAIN_MULTILANGS')) { // If multilang is enabled
@@ -1434,11 +1439,16 @@ while ($i < $imaxinloop) {
$warehousestatic->fk_parent = $obj->fk_parent;
$warehousestatic->statut = $obj->statut;
- $movement->type = $obj->type_mouvement;
+ $object->id = $obj->mid;
+ $object->qty = $obj->qty;
+ $object->label = $obj->label;
+ $object->batch = $obj->batch;
+ $object->warehouse_id = $obj->entrepot_id;
+ $object->type = $obj->type_mouvement;
$arrayofuniqueproduct[$obj->rowid] = $obj->produit;
if (!empty($obj->fk_origin)) {
- $origin = $movement->get_origin($obj->fk_origin, $obj->origintype);
+ $origin = $object->get_origin($obj->fk_origin, $obj->origintype);
} else {
$origin = '';
}
@@ -1452,11 +1462,11 @@ while ($i < $imaxinloop) {
$selected = -1;
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
- if (in_array($object->id, $arrayofselected)) {
+ if (in_array($warehouse->id, $arrayofselected)) {
$selected = 1;
}
}
- print $object->getKanbanView('', array('selected' => $selected));
+ print $warehouse->getKanbanView('', array('selected' => $selected));
if ($i == ($imaxinloop - 1)) {
print '';
print '';
@@ -1464,7 +1474,7 @@ while ($i < $imaxinloop) {
} else {
// Show here line of result
$j = 0;
- print '
';
+ print '
';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '| ';
@@ -1483,8 +1493,8 @@ while ($i < $imaxinloop) {
// Id movement
if (!empty($arrayfields['m.rowid']['checked'])) {
print ' | ';
- print img_picto($langs->trans("StockMovement"), 'movement', 'class="pictofixedwidth"');
- print $obj->mid;
+ //print img_picto($langs->trans("StockMovement"), 'movement', 'class="pictofixedwidth"');
+ print $object->getNomUrl(1);;
print ' | '; // This is primary not movement id
}
if (!empty($arrayfields['m.datem']['checked'])) {
@@ -1546,14 +1556,14 @@ while ($i < $imaxinloop) {
// fk_project
print '';
if ($obj->fk_project != 0) {
- print $movement->get_origin($obj->fk_project, 'project');
+ print $object->get_origin($obj->fk_project, 'project');
}
print ' | ';
}
if (!empty($arrayfields['m.type_mouvement']['checked'])) {
// Type of movement
print '';
- print $movement->getTypeMovement();
+ print $object->getTypeMovement();
print ' | ';
}
if (!empty($arrayfields['m.value']['checked'])) {
@@ -1581,7 +1591,6 @@ while ($i < $imaxinloop) {
}
// Extra fields
- $object = $movement;
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
@@ -1643,8 +1652,8 @@ if (count($arrayofuniqueproduct) == 1 && !empty($year) && is_numeric($year)) {
}
$datebefore = dol_get_first_day($year ? $year : dol_print_date(time(), "%Y"), $month ? $month : 1, true);
$dateafter = dol_get_last_day($year ? $year : dol_print_date(time(), "%Y"), $month ? $month : 12, true);
- $balancebefore = $movement->calculateBalanceForProductBefore($productidselected, $datebefore);
- $balanceafter = $movement->calculateBalanceForProductBefore($productidselected, $dateafter);
+ $balancebefore = $object->calculateBalanceForProductBefore($productidselected, $datebefore);
+ $balanceafter = $object->calculateBalanceForProductBefore($productidselected, $dateafter);
//print '
| ';
print $langs->trans("NbOfProductBeforePeriod", $productlabelselected, dol_print_date($datebefore, 'day', 'gmt'));
@@ -1679,7 +1688,7 @@ if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords
$genallowed = $permissiontoread;
$delallowed = $permissiontoadd;
- print $formfile->showdocuments('massfilesarea_'.$object->module, '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
+ print $formfile->showdocuments('massfilesarea_stock', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
}
// End of page
|