diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php
index b47430bffc2..6e09a81eb7f 100644
--- a/htdocs/product/stock/class/entrepot.class.php
+++ b/htdocs/product/stock/class/entrepot.class.php
@@ -903,4 +903,35 @@ class Entrepot extends CommonObject
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
return parent::setCategoriesCommon($categories, Categorie::TYPE_WAREHOUSE);
}
+
+ /**
+ * Return clicable link of object (with eventually picto)
+ *
+ * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
+ * @return string HTML Code for Kanban thumb.
+ */
+ public function getKanbanView($option = '')
+ {
+
+ $return = '
';
+
+ // Action column
+ if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
+ print '';
+ 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($obj->rowid, $arrayofselected)) {
+ $selected = 1;
+ }
+ print ' ';
}
- print ' ';
+ print ' ';
}
- print '';
- }
- foreach ($warehouse->fields as $key => $val) {
- if ($key == 'statut') {
- continue;
- }
- $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
- if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
- $cssforfield .= ($cssforfield ? ' ' : '').'center';
- } elseif ($key == 'status') {
- $cssforfield .= ($cssforfield ? ' ' : '').'center';
- }
-
- if (in_array($val['type'], array('timestamp'))) {
- $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
- } elseif ($key == 'ref') {
- $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
- }
-
- if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status' && empty($val['arrayofkeyval'])) {
- $cssforfield .= ($cssforfield ? ' ' : '').'right';
- }
- if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) {
- $cssforfield = 'tdoverflowmax100';
- }
-
- if (!empty($arrayfields['t.'.$key]['checked'])) {
- print '';
+ foreach ($warehouse->fields as $key => $val) {
if ($key == 'statut') {
- print $warehouse->getLibStatut(5);
+ continue;
}
- if ($key == 'phone') {
- print dol_print_phone($obj->phone, '', 0, $obj->rowid, 'AC_TEL');
- } elseif ($key == 'fax') {
- print dol_print_phone($obj->fax, '', 0, $obj->rowid, 'AC_FAX');
+ $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
+ if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
+ $cssforfield .= ($cssforfield ? ' ' : '').'center';
+ } elseif ($key == 'status') {
+ $cssforfield .= ($cssforfield ? ' ' : '').'center';
+ }
+
+ if (in_array($val['type'], array('timestamp'))) {
+ $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
+ } elseif ($key == 'ref') {
+ $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
+ }
+
+ if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status' && empty($val['arrayofkeyval'])) {
+ $cssforfield .= ($cssforfield ? ' ' : '').'right';
+ }
+ if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) {
+ $cssforfield = 'tdoverflowmax100';
+ }
+
+ if (!empty($arrayfields['t.'.$key]['checked'])) {
+ print ' ';
+ if ($key == 'statut') {
+ print $warehouse->getLibStatut(5);
+ }
+ if ($key == 'phone') {
+ print dol_print_phone($obj->phone, '', 0, $obj->rowid, 'AC_TEL');
+ } elseif ($key == 'fax') {
+ print dol_print_phone($obj->fax, '', 0, $obj->rowid, 'AC_FAX');
+ } else {
+ print $warehouse->showOutputField($val, $key, $warehouse->$key, '');
+ }
+ print ' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
+ if (!$i) {
+ $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
+ }
+ if (!isset($totalarray['val'])) {
+ $totalarray['val'] = array();
+ }
+ if (!isset($totalarray['val']['t.'.$key])) {
+ $totalarray['val']['t.'.$key] = 0;
+ }
+ $totalarray['val']['t.'.$key] += $warehouse->$key;
+ }
+ }
+ }
+
+ // Stock qty
+ if (!empty($arrayfields["stockqty"]['checked'])) {
+ print ''.price2num($obj->stockqty, 5).' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ if (!$i) {
+ $totalarray['pos'][$totalarray['nbfield']] = 'stockqty';
+ }
+ }
+
+ // PMP value
+ if (!empty($arrayfields["estimatedvalue"]['checked'])) {
+ print '';
+ if (price2num($obj->estimatedvalue, 'MT')) {
+ print ''.price(price2num($obj->estimatedvalue, 'MT'), 1).' ';
} else {
- print $warehouse->showOutputField($val, $key, $warehouse->$key, '');
+ print '';
}
print ' ';
if (!$i) {
$totalarray['nbfield']++;
}
- if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
- if (!$i) {
- $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
- }
- if (!isset($totalarray['val'])) {
- $totalarray['val'] = array();
- }
- if (!isset($totalarray['val']['t.'.$key])) {
- $totalarray['val']['t.'.$key] = 0;
- }
- $totalarray['val']['t.'.$key] += $warehouse->$key;
+ if (!$i) {
+ $totalarray['pos'][$totalarray['nbfield']] = 'estimatedvalue';
}
}
- }
- // Stock qty
- if (!empty($arrayfields["stockqty"]['checked'])) {
- print ''.price2num($obj->stockqty, 5).' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- if (!$i) {
- $totalarray['pos'][$totalarray['nbfield']] = 'stockqty';
- }
- }
-
- // PMP value
- if (!empty($arrayfields["estimatedvalue"]['checked'])) {
- print '';
- if (price2num($obj->estimatedvalue, 'MT')) {
- print ''.price(price2num($obj->estimatedvalue, 'MT'), 1).' ';
- } else {
- print '';
- }
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- if (!$i) {
- $totalarray['pos'][$totalarray['nbfield']] = 'estimatedvalue';
- }
- }
-
- // Selling value
- if (!empty($arrayfields["estimatedstockvaluesell"]['checked'])) {
- print '';
- if (empty($conf->global->PRODUIT_MULTIPRICES)) {
- if ($obj->sellvalue) {
- print ''.price(price2num($obj->sellvalue, 'MT'), 1).' ';
+ // Selling value
+ if (!empty($arrayfields["estimatedstockvaluesell"]['checked'])) {
+ print ' ';
+ if (empty($conf->global->PRODUIT_MULTIPRICES)) {
+ if ($obj->sellvalue) {
+ print ''.price(price2num($obj->sellvalue, 'MT'), 1).' ';
+ }
+ } else {
+ $htmltext = $langs->trans("OptionMULTIPRICESIsOn");
+ print $form->textwithtooltip(''.$langs->trans("Variable").' ', $htmltext);
}
- } else {
- $htmltext = $langs->trans("OptionMULTIPRICESIsOn");
- print $form->textwithtooltip(''.$langs->trans("Variable").' ', $htmltext);
- }
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- if (!$i) {
- $totalarray['pos'][$totalarray['nbfield']] = 'estimatedstockvaluesell';
- }
- }
-
- // Extra fields
- 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);
- $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
-
- // Status
- if (!empty($arrayfields['t.statut']['checked'])) {
- print ''.$warehouse->LibStatut($obj->statut, 5).' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Action column
- if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
- print '';
- 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($obj->rowid, $arrayofselected)) {
- $selected = 1;
+ print ' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ if (!$i) {
+ $totalarray['pos'][$totalarray['nbfield']] = 'estimatedstockvaluesell';
}
- print ' ';
}
- print '';
- }
- if (!$i) {
- $totalarray['nbfield']++;
- }
- print ' '."\n";
+ // Extra fields
+ 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);
+ $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+ // Status
+ if (!empty($arrayfields['t.statut']['checked'])) {
+ print '