mirror of
https://codeberg.org/artfulrobot/contactcats.git
synced 2025-06-25 21:18:04 +02:00
SK/FB work
This commit is contained in:
parent
16f2b6235d
commit
a4c9251f5e
10 changed files with 163 additions and 233 deletions
|
@ -26,7 +26,21 @@
|
|||
ctrl.moveIdx = null;
|
||||
ctrl.categoryToEdit = null;
|
||||
ctrl.categoryDefinitions = null;
|
||||
ctrl.categoryDefinitions = await crmApi4("ContactCategoryDefinition", 'get', { orderBy: { label: 'ASC' }, withLabels: true });
|
||||
ctrl.categoryDefinitions = await crmApi4("ContactCategoryDefinition", 'get', { orderBy: { execution_order: 'ASC' }, withLabels: true });
|
||||
// Ensure we have the minimum of what we need.
|
||||
if (!ctrl.categoryDefinitions.find(c => c.search_type === 'default')) {
|
||||
// There's no default one.
|
||||
ctrl.categoryDefinitions.push({
|
||||
id: 0,
|
||||
execution_order: ctrl.categoryDefinitions.length,
|
||||
label: '9999 ' + ts('Other'),
|
||||
search_type: 'default',
|
||||
search_data: {},
|
||||
color: '#666666',
|
||||
icon: 'fa-person-circle-question',
|
||||
description: ts('Any contact not matching any of the categories is assigned this category.'),
|
||||
})
|
||||
}
|
||||
updateOrders();
|
||||
console.log("Got", ctrl.categoryDefinitions);
|
||||
|
||||
|
@ -89,7 +103,7 @@
|
|||
ctrl.categoryDefinitions.splice(idx, 0, item);
|
||||
ctrl.moveIdx = null;
|
||||
updateOrders();
|
||||
$ctrl.dirty = 'dirty';
|
||||
ctrl.dirty = 'dirty';
|
||||
};
|
||||
|
||||
ctrl.deleteCategory = idx => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue