allow to order tables by more fields (#1902)
This commit is contained in:
@@ -16,7 +16,7 @@ use App\Entity\Project;
|
|||||||
*/
|
*/
|
||||||
class ActivityQuery extends ProjectQuery
|
class ActivityQuery extends ProjectQuery
|
||||||
{
|
{
|
||||||
public const ACTIVITY_ORDER_ALLOWED = ['id', 'name', 'comment', 'customer', 'project'];
|
public const ACTIVITY_ORDER_ALLOWED = ['id', 'name', 'comment', 'customer', 'project', 'visible'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Project[]|int[]
|
* @var Project[]|int[]
|
||||||
|
|||||||
@@ -16,7 +16,10 @@ class CustomerQuery extends BaseQuery implements VisibilityInterface
|
|||||||
{
|
{
|
||||||
use VisibilityTrait;
|
use VisibilityTrait;
|
||||||
|
|
||||||
public const CUSTOMER_ORDER_ALLOWED = ['id', 'name', 'comment', 'country', 'number'];
|
public const CUSTOMER_ORDER_ALLOWED = [
|
||||||
|
'id', 'name', 'comment', 'country', 'number', 'homepage', 'email', 'mobile', 'fax',
|
||||||
|
'phone', 'currency', 'address', 'contact', 'company', 'vatId', 'visible'
|
||||||
|
];
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,7 +18,10 @@ class ProjectQuery extends BaseQuery implements VisibilityInterface
|
|||||||
{
|
{
|
||||||
use VisibilityTrait;
|
use VisibilityTrait;
|
||||||
|
|
||||||
public const PROJECT_ORDER_ALLOWED = ['id', 'name', 'comment', 'customer', 'orderNumber', 'projectStart', 'projectEnd'];
|
public const PROJECT_ORDER_ALLOWED = [
|
||||||
|
'id', 'name', 'comment', 'customer', 'orderNumber', 'projectStart',
|
||||||
|
'projectEnd', 'orderNumber', 'orderDate', 'start', 'end', 'visible'
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% set columns = columns|merge({
|
{% set columns = columns|merge({
|
||||||
'team': {'class': 'text-center w-min', 'orderBy': false},
|
'team': {'class': 'text-center w-min', 'orderBy': false},
|
||||||
'visible': {'class': 'text-center hidden w-min', 'orderBy': false},
|
'visible': {'class': 'text-center hidden w-min'},
|
||||||
'actions': {'class': 'actions alwaysVisible'},
|
'actions': {'class': 'actions alwaysVisible'},
|
||||||
}) %}
|
}) %}
|
||||||
|
|
||||||
|
|||||||
@@ -7,18 +7,18 @@
|
|||||||
{% set columns = {
|
{% set columns = {
|
||||||
'name': {'class': 'alwaysVisible'},
|
'name': {'class': 'alwaysVisible'},
|
||||||
'comment': {'class': 'hidden-xs hidden-sm', 'title': 'label.description'|trans},
|
'comment': {'class': 'hidden-xs hidden-sm', 'title': 'label.description'|trans},
|
||||||
'number': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
'number': {'class': 'hidden-xs hidden-sm hidden'},
|
||||||
'company': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
'company': {'class': 'hidden-xs hidden-sm hidden'},
|
||||||
'vat_id': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
'vat_id': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': 'vatId'},
|
||||||
'contact': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
'contact': {'class': 'hidden-xs hidden-sm hidden'},
|
||||||
'address': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
'address': {'class': 'hidden-xs hidden-sm hidden'},
|
||||||
'country': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
'country': {'class': 'hidden-xs hidden-sm hidden'},
|
||||||
'currency': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
'currency': {'class': 'hidden-xs hidden-sm hidden'},
|
||||||
'phone': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
'phone': {'class': 'hidden-xs hidden-sm hidden'},
|
||||||
'fax': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
'fax': {'class': 'hidden-xs hidden-sm hidden'},
|
||||||
'mobile': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
'mobile': {'class': 'hidden-xs hidden-sm hidden'},
|
||||||
'email': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
'email': {'class': 'hidden-xs hidden-sm hidden'},
|
||||||
'homepage': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
'homepage': {'class': 'hidden-xs hidden-sm hidden'},
|
||||||
} %}
|
} %}
|
||||||
{% for field in metaColumns %}
|
{% for field in metaColumns %}
|
||||||
{% set columns = columns|merge({
|
{% set columns = columns|merge({
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% set columns = columns|merge({
|
{% set columns = columns|merge({
|
||||||
'team': {'class': 'text-center w-min', 'orderBy': false},
|
'team': {'class': 'text-center w-min', 'orderBy': false},
|
||||||
'visible': {'class': 'text-center hidden w-min', 'orderBy': false},
|
'visible': {'class': 'text-center hidden w-min'},
|
||||||
'actions': {'class': 'actions alwaysVisible'},
|
'actions': {'class': 'actions alwaysVisible'},
|
||||||
}) %}
|
}) %}
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,10 @@
|
|||||||
'name': {'class': 'alwaysVisible'},
|
'name': {'class': 'alwaysVisible'},
|
||||||
'customer': {'class': 'hidden-xs'},
|
'customer': {'class': 'hidden-xs'},
|
||||||
'comment': {'class': 'hidden-xs hidden-sm', 'title': 'label.description'|trans},
|
'comment': {'class': 'hidden-xs hidden-sm', 'title': 'label.description'|trans},
|
||||||
'orderNumber': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
'orderNumber': {'class': 'hidden-xs hidden-sm hidden'},
|
||||||
'orderDate': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
'orderDate': {'class': 'hidden-xs hidden-sm hidden'},
|
||||||
'start': {'class': 'hidden-xs hidden-sm hidden', 'title': 'label.project_start'|trans, 'orderBy': false},
|
'start': {'class': 'hidden-xs hidden-sm hidden', 'title': 'label.project_start'|trans},
|
||||||
'end': {'class': 'hidden-xs hidden-sm hidden', 'title': 'label.project_end'|trans, 'orderBy': false},
|
'end': {'class': 'hidden-xs hidden-sm hidden', 'title': 'label.project_end'|trans},
|
||||||
} %}
|
} %}
|
||||||
{% for field in metaColumns %}
|
{% for field in metaColumns %}
|
||||||
{% set columns = columns|merge({
|
{% set columns = columns|merge({
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% set columns = columns|merge({
|
{% set columns = columns|merge({
|
||||||
'team': {'class': 'text-center w-min', 'orderBy': false},
|
'team': {'class': 'text-center w-min', 'orderBy': false},
|
||||||
'visible': {'class': 'text-center hidden w-min', 'orderBy': false},
|
'visible': {'class': 'text-center hidden w-min'},
|
||||||
'actions': {'class': 'actions alwaysVisible'},
|
'actions': {'class': 'actions alwaysVisible'},
|
||||||
}) %}
|
}) %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user