Standardize settings file naming and relocate documentation files Fix code quality violations from rsx:check Reorganize user_management directory into logical subdirectories Move Quill Bundle to core and align with Tom Select pattern Simplify Site Settings page to focus on core site information Complete Phase 5: Multi-tenant authentication with login flow and site selection Add route query parameter rule and synchronize filename validation logic Fix critical bug in UpdateNpmCommand causing missing JavaScript stubs Implement filename convention rule and resolve VS Code auto-rename conflict Implement js-sanitizer RPC server to eliminate 900+ Node.js process spawns Implement RPC server architecture for JavaScript parsing WIP: Add RPC server infrastructure for JS parsing (partial implementation) Update jqhtml terminology from destroy to stop, fix datagrid DOM preservation Add JQHTML-CLASS-01 rule and fix redundant class names Improve code quality rules and resolve violations Remove legacy fatal error format in favor of unified 'fatal' error type Filter internal keys from window.rsxapp output Update button styling and comprehensive form/modal documentation Add conditional fly-in animation for modals Fix non-deterministic bundle compilation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
195 lines
5.5 KiB
JavaScript
Executable File
195 lines
5.5 KiB
JavaScript
Executable File
/**
|
|
* Auto-generated JavaScript stub for Client_Model
|
|
* DO NOT EDIT - This file is automatically regenerated
|
|
*/
|
|
|
|
class Client_Model extends Rsx_Js_Model {
|
|
static get name() {
|
|
return 'Client_Model';
|
|
}
|
|
|
|
static PRIORITY_LOW = 1;
|
|
static PRIORITY_MEDIUM = 2;
|
|
static PRIORITY_HIGH = 3;
|
|
static PRIORITY_URGENT = 4;
|
|
|
|
static priority_enum_val() {
|
|
const data = {};
|
|
const order = [];
|
|
data[1] = {"constant":"PRIORITY_LOW","label":"Low","badge":"bg-secondary"};
|
|
order.push(1);
|
|
data[2] = {"constant":"PRIORITY_MEDIUM","label":"Medium","badge":"bg-primary"};
|
|
order.push(2);
|
|
data[3] = {"constant":"PRIORITY_HIGH","label":"High","badge":"bg-warning"};
|
|
order.push(3);
|
|
data[4] = {"constant":"PRIORITY_URGENT","label":"Urgent","badge":"bg-danger"};
|
|
order.push(4);
|
|
// Return Proxy that maintains sort order for enumeration
|
|
return new Proxy(data, {
|
|
ownKeys() {
|
|
return order.map(String);
|
|
},
|
|
getOwnPropertyDescriptor(target, prop) {
|
|
if (prop in target) {
|
|
return {
|
|
enumerable: true,
|
|
configurable: true,
|
|
value: target[prop]
|
|
};
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
static priority_label_list() {
|
|
const values = {};
|
|
values[1] = 'Low';
|
|
values[2] = 'Medium';
|
|
values[3] = 'High';
|
|
values[4] = 'Urgent';
|
|
return values;
|
|
}
|
|
|
|
static priority_enum_select() {
|
|
const fullData = this.priority_enum_val();
|
|
const data = {};
|
|
const order = [];
|
|
|
|
// Extract labels from full data, respecting selectable flag
|
|
for (const key in fullData) {
|
|
const item = fullData[key];
|
|
if (item.selectable !== false && item.label) {
|
|
data[key] = item.label;
|
|
order.push(parseInt(key));
|
|
}
|
|
}
|
|
|
|
// Return Proxy that maintains sort order for enumeration
|
|
return new Proxy(data, {
|
|
ownKeys() {
|
|
return order.map(String);
|
|
},
|
|
getOwnPropertyDescriptor(target, prop) {
|
|
if (prop in target) {
|
|
return {
|
|
enumerable: true,
|
|
configurable: true,
|
|
value: target[prop]
|
|
};
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Fetch billing_contact relationship
|
|
* @returns {Promise} Related model instance(s) or false
|
|
*/
|
|
async billing_contact() {
|
|
if (!this.id) {
|
|
shouldnt_happen('Cannot fetch relationship without id property');
|
|
}
|
|
|
|
const response = await $.ajax({
|
|
url: `/_fetch_rel/Client_Model/${this.id}/billing_contact`,
|
|
method: 'POST',
|
|
dataType: 'json'
|
|
});
|
|
|
|
if (!response) return false;
|
|
|
|
// Convert response to model instance(s)
|
|
// Framework handles instantiation based on relationship type
|
|
return response;
|
|
}
|
|
|
|
/**
|
|
* Fetch contacts relationship
|
|
* @returns {Promise} Related model instance(s) or false
|
|
*/
|
|
async contacts() {
|
|
if (!this.id) {
|
|
shouldnt_happen('Cannot fetch relationship without id property');
|
|
}
|
|
|
|
const response = await $.ajax({
|
|
url: `/_fetch_rel/Client_Model/${this.id}/contacts`,
|
|
method: 'POST',
|
|
dataType: 'json'
|
|
});
|
|
|
|
if (!response) return false;
|
|
|
|
// Convert response to model instance(s)
|
|
// Framework handles instantiation based on relationship type
|
|
return response;
|
|
}
|
|
|
|
/**
|
|
* Fetch departments relationship
|
|
* @returns {Promise} Related model instance(s) or false
|
|
*/
|
|
async departments() {
|
|
if (!this.id) {
|
|
shouldnt_happen('Cannot fetch relationship without id property');
|
|
}
|
|
|
|
const response = await $.ajax({
|
|
url: `/_fetch_rel/Client_Model/${this.id}/departments`,
|
|
method: 'POST',
|
|
dataType: 'json'
|
|
});
|
|
|
|
if (!response) return false;
|
|
|
|
// Convert response to model instance(s)
|
|
// Framework handles instantiation based on relationship type
|
|
return response;
|
|
}
|
|
|
|
/**
|
|
* Fetch created_by relationship
|
|
* @returns {Promise} Related model instance(s) or false
|
|
*/
|
|
async created_by() {
|
|
if (!this.id) {
|
|
shouldnt_happen('Cannot fetch relationship without id property');
|
|
}
|
|
|
|
const response = await $.ajax({
|
|
url: `/_fetch_rel/Client_Model/${this.id}/created_by`,
|
|
method: 'POST',
|
|
dataType: 'json'
|
|
});
|
|
|
|
if (!response) return false;
|
|
|
|
// Convert response to model instance(s)
|
|
// Framework handles instantiation based on relationship type
|
|
return response;
|
|
}
|
|
|
|
/**
|
|
* Fetch owner relationship
|
|
* @returns {Promise} Related model instance(s) or false
|
|
*/
|
|
async owner() {
|
|
if (!this.id) {
|
|
shouldnt_happen('Cannot fetch relationship without id property');
|
|
}
|
|
|
|
const response = await $.ajax({
|
|
url: `/_fetch_rel/Client_Model/${this.id}/owner`,
|
|
method: 'POST',
|
|
dataType: 'json'
|
|
});
|
|
|
|
if (!response) return false;
|
|
|
|
// Convert response to model instance(s)
|
|
// Framework handles instantiation based on relationship type
|
|
return response;
|
|
}
|
|
|
|
}
|