New mode kaban for products list
This commit is contained in:
parent
cdcd54e6fe
commit
1c108f3583
@ -6238,6 +6238,61 @@ class Product extends CommonObject
|
|||||||
|
|
||||||
return $prodDurationHours;
|
return $prodDurationHours;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 = '')
|
||||||
|
{
|
||||||
|
global $langs,$conf;
|
||||||
|
|
||||||
|
$return = '<div class="box-flex-item box-flex-grow-zero">';
|
||||||
|
$return .= '<div class="info-box info-box-sm">';
|
||||||
|
$return .= '<div class="info-box-img">';
|
||||||
|
$label = '';
|
||||||
|
|
||||||
|
if ($this->is_photo_available($conf->product->multidir_output[$this->entity])) {
|
||||||
|
$label .= $this->show_photos('product', $conf->product->multidir_output[$this->entity]);
|
||||||
|
$return .= $label;
|
||||||
|
} else {
|
||||||
|
if ($this->type == Product::TYPE_PRODUCT) {
|
||||||
|
$label .= img_picto('', 'product');
|
||||||
|
} elseif ($this->type == Product::TYPE_SERVICE) {
|
||||||
|
$label .= img_picto('', 'service');
|
||||||
|
}
|
||||||
|
$return .= $label;
|
||||||
|
}
|
||||||
|
|
||||||
|
$return .= '</div>';
|
||||||
|
$return .= '<div class="info-box-content">';
|
||||||
|
$return .= '<span class="info-box-ref">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'</span>';
|
||||||
|
if (property_exists($this, 'label')) {
|
||||||
|
$return .= '<br><span class="info-box-label opacitymedium">'.$this->label.'</span>';
|
||||||
|
}
|
||||||
|
if (property_exists($this, 'price') && property_exists($this, 'price_ttc')) {
|
||||||
|
if ($this->price_base_type == 'TTC') {
|
||||||
|
$return .= '<br><span class="info-box-status amount">'.price($this->price_ttc).' '.$langs->trans("TTC").'</span>';
|
||||||
|
} else {
|
||||||
|
if ($this->status) {
|
||||||
|
$return .= '<br><span class="info-box-status amount">'.price($this->price).' '.$langs->trans("HT").'</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (property_exists($this, 'stock_reel')) {
|
||||||
|
$return .= '<br><span class="info-box-status opacitymedium">'.$langs->trans('PhysicalStock').' : <span class="bold">'.$this->stock_reel.'</span></span>';
|
||||||
|
}
|
||||||
|
if (method_exists($this, 'getLibStatut')) {
|
||||||
|
$return .='<br><span class="info-box-status margintoponly">'.$this->getLibStatut(5, 1).' '.$this->getLibStatut(5, 0).'</span>';
|
||||||
|
}
|
||||||
|
$return .= '</div>';
|
||||||
|
$return .= '</div>';
|
||||||
|
$return .= '</div>';
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -97,6 +97,8 @@ $search_accountancy_code_buy_export = GETPOST("search_accountancy_code_buy_expor
|
|||||||
$search_finished = GETPOST("search_finished", 'int');
|
$search_finished = GETPOST("search_finished", 'int');
|
||||||
$optioncss = GETPOST('optioncss', 'alpha');
|
$optioncss = GETPOST('optioncss', 'alpha');
|
||||||
$type = GETPOST("type", "int");
|
$type = GETPOST("type", "int");
|
||||||
|
$mode = GETPOST('mode', 'alpha');
|
||||||
|
|
||||||
|
|
||||||
//Show/hide child products
|
//Show/hide child products
|
||||||
if (isModEnabled('variants') && !empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
|
if (isModEnabled('variants') && !empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
|
||||||
@ -642,6 +644,9 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
|
if (!empty($mode)) {
|
||||||
|
$param = "&mode=".urlencode($mode);
|
||||||
|
}
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
$param .= '&contextpage='.urlencode($contextpage);
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
}
|
}
|
||||||
@ -751,6 +756,8 @@ if ($resql) {
|
|||||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|
||||||
$newcardbutton = '';
|
$newcardbutton = '';
|
||||||
|
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
|
||||||
|
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
|
||||||
if ($type === "") {
|
if ($type === "") {
|
||||||
$perm = ($user->rights->produit->creer || $user->rights->service->creer);
|
$perm = ($user->rights->produit->creer || $user->rights->service->creer);
|
||||||
} elseif ($type == Product::TYPE_SERVICE) {
|
} elseif ($type == Product::TYPE_SERVICE) {
|
||||||
@ -784,6 +791,7 @@ if ($resql) {
|
|||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||||
//print '<input type="hidden" name="page" value="'.$page.'">';
|
//print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||||
if (empty($arrayfields['p.fk_product_type']['checked'])) {
|
if (empty($arrayfields['p.fk_product_type']['checked'])) {
|
||||||
@ -1297,7 +1305,8 @@ if ($resql) {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
$totalarray = array();
|
$totalarray = array();
|
||||||
$totalarray['nbfield'] = 0;
|
$totalarray['nbfield'] = 0;
|
||||||
while ($i < min($num, $limit)) {
|
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||||
|
while ($i < $imaxinloop) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
// Multilangs
|
// Multilangs
|
||||||
@ -1366,7 +1375,19 @@ if ($resql) {
|
|||||||
if ($product_static->isService()) {
|
if ($product_static->isService()) {
|
||||||
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'lire');
|
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'lire');
|
||||||
}
|
}
|
||||||
|
if ($mode == 'Kanban') {
|
||||||
|
if ($i == 0) {
|
||||||
|
print '<tr><td colspan="12">';
|
||||||
|
print '<div class="box-flex-container">';
|
||||||
|
}
|
||||||
|
$product_static->price = $obj->price;
|
||||||
|
// Output Kanban
|
||||||
|
print $product_static->getKanbanView('');
|
||||||
|
if ($i == ($imaxinloop - 1)) {
|
||||||
|
print '</div>';
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
@ -1952,6 +1973,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -173,6 +173,31 @@ a.info-box-text-a i.fa.fa-exclamation-triangle {
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* customize section img box on list of products */
|
||||||
|
.info-box-img {
|
||||||
|
height: 105px !important;
|
||||||
|
width: 88px;
|
||||||
|
border-top-left-radius: 2px;
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 2px;
|
||||||
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
float: left;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 2.8em;
|
||||||
|
line-height: 90px;
|
||||||
|
margin-right: 5px;
|
||||||
|
background: var(--colorbacktitle1) !important;
|
||||||
|
}
|
||||||
|
.info-box-img > img {
|
||||||
|
width: 90%;
|
||||||
|
position: relative;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
<?php if (empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS) && !empty($conf->global->MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD)) { ?>
|
<?php if (empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS) && !empty($conf->global->MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD)) { ?>
|
||||||
.info-box-icon-text{
|
.info-box-icon-text{
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user