Merge pull request #23482 from lamrani002/kanbanpropal
NEW kanban mode for list of proposal commande
This commit is contained in:
commit
5a4611732d
@ -3914,6 +3914,41 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
return CommonObject::commonReplaceProduct($db, $origin_id, $dest_id, $tables);
|
return CommonObject::commonReplaceProduct($db, $origin_id, $dest_id, $tables);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
$return = '<div class="box-flex-item box-flex-grow-zero">';
|
||||||
|
$return .= '<div class="info-box info-box-sm">';
|
||||||
|
$return .= '<span class="info-box-icon bg-infobox-action">';
|
||||||
|
$return .= img_picto('', $this->picto);
|
||||||
|
//$return .= '<i class="fa fa-dol-action"></i>'; // Can be image
|
||||||
|
$return .= '</span>';
|
||||||
|
$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, 'fk_project')) {
|
||||||
|
$return .= '<span class="info-box-ref"> | '.$this->fk_project.'</span>';
|
||||||
|
}
|
||||||
|
if (property_exists($this, 'author')) {
|
||||||
|
$return .= '<br><span class="info-box-label">'.$this->author.'</span>';
|
||||||
|
}
|
||||||
|
if (property_exists($this, 'total_ht')) {
|
||||||
|
$return .='<br><span class="" >'.$langs->trans("AmountHT").' : </span><span class="info-box-label amount">'.price($this->total_ht).'</span>';
|
||||||
|
}
|
||||||
|
if (method_exists($this, 'getLibStatut')) {
|
||||||
|
$return .= '<br><div class="info-box-status margintoponly">'.$this->getLibStatut(5).'</div>';
|
||||||
|
}
|
||||||
|
$return .= '</div>';
|
||||||
|
$return .= '</div>';
|
||||||
|
$return .= '</div>';
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -70,6 +70,7 @@ $show_files = GETPOST('show_files', 'int');
|
|||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'proposallist';
|
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'proposallist';
|
||||||
|
$mode = GETPOST('mode', 'alpha');
|
||||||
|
|
||||||
$search_user = GETPOST('search_user', 'int');
|
$search_user = GETPOST('search_user', 'int');
|
||||||
$search_sale = GETPOST('search_sale', 'int');
|
$search_sale = GETPOST('search_sale', 'int');
|
||||||
@ -864,6 +865,9 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$param = '&search_status='.urlencode($search_status);
|
$param = '&search_status='.urlencode($search_status);
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
@ -1072,6 +1076,9 @@ if ($resql) {
|
|||||||
if (!empty($socid)) {
|
if (!empty($socid)) {
|
||||||
$url .= '&socid='.$socid;
|
$url .= '&socid='.$socid;
|
||||||
}
|
}
|
||||||
|
$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'));
|
||||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewPropal'), '', 'fa fa-plus-circle', $url, '', $user->rights->propal->creer);
|
$newcardbutton = dolGetButtonTitle($langs->trans('NewPropal'), '', 'fa fa-plus-circle', $url, '', $user->rights->propal->creer);
|
||||||
|
|
||||||
// Fields title search
|
// Fields title search
|
||||||
@ -1085,6 +1092,7 @@ if ($resql) {
|
|||||||
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="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
print '<input type="hidden" name="mode"value="'.$mode.'">';
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'propal', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'propal', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||||
|
|
||||||
@ -1702,6 +1710,21 @@ if ($resql) {
|
|||||||
$total_margin += $marginInfo['total_margin'];
|
$total_margin += $marginInfo['total_margin'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($mode == 'kanban') {
|
||||||
|
if ($i == 0) {
|
||||||
|
print '<tr><td colspan="12">';
|
||||||
|
print '<div class="box-flex-container">';
|
||||||
|
}
|
||||||
|
// Output Kanban
|
||||||
|
$userstatic->fetch($obj->fk_user_author);
|
||||||
|
$objectstatic->author = $userstatic->getNomUrl(1);
|
||||||
|
$objectstatic->fk_project = $projectstatic->getNomUrl(1);
|
||||||
|
print $objectstatic->getKanbanView('');
|
||||||
|
if ($i == (min($num, $limit) - 1)) {
|
||||||
|
print '</div>';
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
@ -2269,6 +2292,7 @@ if ($resql) {
|
|||||||
|
|
||||||
|
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user