switch to cityssm/utils-datetime
show am/pm for printed timesdeepsource-autofix-76c6eb20
parent
de7176b643
commit
967da6c03b
2
app.js
2
app.js
|
|
@ -21,7 +21,7 @@ import routerReports from './routes/reports.js';
|
|||
import routerAdmin from './routes/admin.js';
|
||||
import * as configFunctions from './helpers/functions.config.js';
|
||||
import * as printFunctions from './helpers/functions.print.js';
|
||||
import * as dateTimeFns from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import * as dateTimeFns from '@cityssm/utils-datetime';
|
||||
import * as stringFns from '@cityssm/expressjs-server-js/stringFns.js';
|
||||
import * as htmlFns from '@cityssm/expressjs-server-js/htmlFns.js';
|
||||
import { version } from './version.js';
|
||||
|
|
|
|||
2
app.ts
2
app.ts
|
|
@ -26,7 +26,7 @@ import routerAdmin from './routes/admin.js'
|
|||
|
||||
import * as configFunctions from './helpers/functions.config.js'
|
||||
import * as printFunctions from './helpers/functions.print.js'
|
||||
import * as dateTimeFns from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import * as dateTimeFns from '@cityssm/utils-datetime'
|
||||
import * as stringFns from '@cityssm/expressjs-server-js/stringFns.js'
|
||||
import * as htmlFns from '@cityssm/expressjs-server-js/htmlFns.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { dateToString } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateToString } from '@cityssm/utils-datetime';
|
||||
import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js';
|
||||
import { getWorkOrders } from '../../helpers/lotOccupancyDB/getWorkOrders.js';
|
||||
import { getLotOccupancies } from '../../helpers/lotOccupancyDB/getLotOccupancies.js';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { Request, Response } from 'express'
|
||||
|
||||
import { dateToString } from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import { dateToString } from '@cityssm/utils-datetime'
|
||||
|
||||
import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js'
|
||||
import { getWorkOrders } from '../../helpers/lotOccupancyDB/getWorkOrders.js'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { dateToInteger, dateToString } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateToInteger, dateToString } from '@cityssm/utils-datetime';
|
||||
import { getLotOccupantTypes, getLotStatuses, getLotTypes, getOccupancyTypes } from '../../helpers/functions.cache.js';
|
||||
import { getLot } from '../../helpers/lotOccupancyDB/getLot.js';
|
||||
import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { Request, Response } from 'express'
|
|||
import {
|
||||
dateToInteger,
|
||||
dateToString
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import {
|
||||
getLotOccupantTypes,
|
||||
|
|
|
|||
|
|
@ -13,7 +13,9 @@ export async function handler(
|
|||
request.session
|
||||
)
|
||||
|
||||
const lotOccupancyFees = await getLotOccupancyFees(request.body.lotOccupancyId)
|
||||
const lotOccupancyFees = await getLotOccupancyFees(
|
||||
request.body.lotOccupancyId
|
||||
)
|
||||
|
||||
response.json({
|
||||
success,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import path from 'node:path';
|
||||
import * as ejs from 'ejs';
|
||||
import * as configFunctions from '../../helpers/functions.config.js';
|
||||
import * as dateTimeFunctions from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import * as dateTimeFunctions from '@cityssm/utils-datetime';
|
||||
import * as lotOccupancyFunctions from '../../helpers/functions.lotOccupancy.js';
|
||||
import { getReportData, getPdfPrintConfig } from '../../helpers/functions.print.js';
|
||||
import { convertHTMLToPDF } from '@cityssm/pdf-puppeteer';
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import path from 'node:path'
|
|||
import * as ejs from 'ejs'
|
||||
|
||||
import * as configFunctions from '../../helpers/functions.config.js'
|
||||
import * as dateTimeFunctions from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import * as dateTimeFunctions from '@cityssm/utils-datetime'
|
||||
import * as lotOccupancyFunctions from '../../helpers/functions.lotOccupancy.js'
|
||||
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import * as dateTimeFunctions from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import * as dateTimeFunctions from '@cityssm/utils-datetime';
|
||||
import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js';
|
||||
import { getLotStatuses, getLotTypes } from '../../helpers/functions.cache.js';
|
||||
export async function handler(_request, response) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { Request, Response } from 'express'
|
||||
|
||||
import * as dateTimeFunctions from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import * as dateTimeFunctions from '@cityssm/utils-datetime'
|
||||
|
||||
import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js'
|
||||
import { getLotStatuses, getLotTypes } from '../../helpers/functions.cache.js'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { dateToInteger, dateToString } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateToInteger, dateToString } from '@cityssm/utils-datetime';
|
||||
import { getWorkOrderTypes } from '../../helpers/functions.cache.js';
|
||||
export async function handler(request, response) {
|
||||
const currentDate = new Date();
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import {
|
||||
dateToInteger,
|
||||
dateToString
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
import type { Request, Response } from 'express'
|
||||
|
||||
import { getWorkOrderTypes } from '../../helpers/functions.cache.js'
|
||||
|
||||
import * as recordTypes from '../../types/recordTypes'
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
export async function handler(
|
||||
request: Request,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { addWorkOrderComment } from '../../helpers/lotOccupancyDB/addWorkOrderCo
|
|||
import { getWorkOrderComments } from '../../helpers/lotOccupancyDB/getWorkOrderComments.js';
|
||||
export async function handler(request, response) {
|
||||
await addWorkOrderComment(request.body, request.session);
|
||||
const workOrderComments = getWorkOrderComments(request.body.workOrderId);
|
||||
const workOrderComments = await getWorkOrderComments(request.body.workOrderId);
|
||||
response.json({
|
||||
success: true,
|
||||
workOrderComments
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export async function handler(
|
|||
): Promise<void> {
|
||||
await addWorkOrderComment(request.body, request.session)
|
||||
|
||||
const workOrderComments = getWorkOrderComments(request.body.workOrderId)
|
||||
const workOrderComments = await getWorkOrderComments(request.body.workOrderId)
|
||||
|
||||
response.json({
|
||||
success: true,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { dateToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateToInteger } from '@cityssm/utils-datetime';
|
||||
export function getLotNameWhereClause(lotName = '', lotNameSearchType, lotsTableAlias = 'l') {
|
||||
let sqlWhereClause = '';
|
||||
const sqlParameters = [];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { dateToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import { dateToInteger } from '@cityssm/utils-datetime'
|
||||
|
||||
type LotNameSearchType = 'startsWith' | 'endsWith' | ''
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import * as dateTimeFunctions from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import * as dateTimeFunctions from '@cityssm/utils-datetime';
|
||||
export async function addLotComment(lotCommentForm, requestSession) {
|
||||
const database = await acquireConnection();
|
||||
const rightNow = new Date();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { acquireConnection } from './pool.js'
|
||||
|
||||
import * as dateTimeFunctions from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import * as dateTimeFunctions from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import * as dateTimeFunctions from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import * as dateTimeFunctions from '@cityssm/utils-datetime';
|
||||
import { addOrUpdateLotOccupancyField } from './addOrUpdateLotOccupancyField.js';
|
||||
import { addLotOccupancyOccupant } from './addLotOccupancyOccupant.js';
|
||||
export async function addLotOccupancy(lotOccupancyForm, requestSession, connectedDatabase) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { acquireConnection } from './pool.js'
|
||||
import type { PoolConnection } from 'better-sqlite-pool'
|
||||
|
||||
import * as dateTimeFunctions from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import * as dateTimeFunctions from '@cityssm/utils-datetime'
|
||||
|
||||
import { addOrUpdateLotOccupancyField } from './addOrUpdateLotOccupancyField.js'
|
||||
import { addLotOccupancyOccupant } from './addLotOccupancyOccupant.js'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateStringToInteger, dateToInteger, dateToTimeInteger, timeStringToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateStringToInteger, dateToInteger, dateToTimeInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
||||
export async function addLotOccupancyComment(commentForm, requestSession) {
|
||||
const rightNow = new Date();
|
||||
let lotOccupancyCommentDate;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import {
|
|||
dateToInteger,
|
||||
dateToTimeInteger,
|
||||
timeStringToInteger
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateStringToInteger, dateToInteger, dateToTimeInteger, timeStringToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateStringToInteger, dateToInteger, dateToTimeInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
||||
export async function addLotOccupancyTransaction(lotOccupancyTransactionForm, requestSession) {
|
||||
const database = await acquireConnection();
|
||||
let transactionIndex = 0;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import {
|
|||
dateToInteger,
|
||||
dateToTimeInteger,
|
||||
timeStringToInteger
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { getNextWorkOrderNumber } from './getNextWorkOrderNumber.js';
|
||||
import { addWorkOrderLotOccupancy } from './addWorkOrderLotOccupancy.js';
|
||||
import { dateStringToInteger, dateToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateStringToInteger, dateToInteger } from '@cityssm/utils-datetime';
|
||||
export async function addWorkOrder(workOrderForm, requestSession) {
|
||||
const database = await acquireConnection();
|
||||
const rightNow = new Date();
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { addWorkOrderLotOccupancy } from './addWorkOrderLotOccupancy.js'
|
|||
import {
|
||||
dateStringToInteger,
|
||||
dateToInteger
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import * as dateTimeFunctions from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import * as dateTimeFunctions from '@cityssm/utils-datetime';
|
||||
export async function addWorkOrderComment(workOrderCommentForm, requestSession) {
|
||||
const database = await acquireConnection();
|
||||
const rightNow = new Date();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { acquireConnection } from './pool.js'
|
||||
|
||||
import * as dateTimeFunctions from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import * as dateTimeFunctions from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateStringToInteger, timeStringToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateStringToInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
||||
export async function addWorkOrderMilestone(milestoneForm, requestSession) {
|
||||
const rightNow = new Date();
|
||||
const database = await acquireConnection();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { acquireConnection } from './pool.js'
|
|||
import {
|
||||
dateStringToInteger,
|
||||
timeStringToInteger
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateStringToInteger, dateToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateStringToInteger, dateToInteger } from '@cityssm/utils-datetime';
|
||||
export async function closeWorkOrder(workOrderForm, requestSession) {
|
||||
const database = await acquireConnection();
|
||||
const rightNow = new Date();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { acquireConnection } from './pool.js'
|
|||
import {
|
||||
dateStringToInteger,
|
||||
dateToInteger
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateStringToInteger, dateToInteger, dateToTimeInteger, timeStringToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateStringToInteger, dateToInteger, dateToTimeInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
||||
export async function completeWorkOrderMilestone(milestoneForm, requestSession) {
|
||||
const rightNow = new Date();
|
||||
const database = await acquireConnection();
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
dateToInteger,
|
||||
dateToTimeInteger,
|
||||
timeStringToInteger
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { acquireConnection } from './pool.js';
|
|||
import { getLotOccupancy } from './getLotOccupancy.js';
|
||||
import { addLotOccupancy } from './addLotOccupancy.js';
|
||||
import { addLotOccupancyOccupant } from './addLotOccupancyOccupant.js';
|
||||
import { dateToString } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateToString } from '@cityssm/utils-datetime';
|
||||
export async function copyLotOccupancy(oldLotOccupancyId, requestSession) {
|
||||
const database = await acquireConnection();
|
||||
const oldLotOccupancy = (await getLotOccupancy(oldLotOccupancyId, database));
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { getLotOccupancy } from './getLotOccupancy.js'
|
|||
import { addLotOccupancy } from './addLotOccupancy.js'
|
||||
import { addLotOccupancyOccupant } from './addLotOccupancyOccupant.js'
|
||||
|
||||
import { dateToString } from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import { dateToString } from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateIntegerToString, timeIntegerToString } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateIntegerToString, timeIntegerToString, timeIntegerToPeriodString } from '@cityssm/utils-datetime';
|
||||
export async function getLotComments(lotId, connectedDatabase) {
|
||||
const database = connectedDatabase ?? (await acquireConnection());
|
||||
database.function('userFn_dateIntegerToString', dateIntegerToString);
|
||||
database.function('userFn_timeIntegerToString', timeIntegerToString);
|
||||
database.function('userFn_timeIntegerToPeriodString', timeIntegerToPeriodString);
|
||||
const lotComments = database
|
||||
.prepare(`select lotCommentId,
|
||||
lotCommentDate, userFn_dateIntegerToString(lotCommentDate) as lotCommentDateString,
|
||||
lotCommentTime, userFn_timeIntegerToString(lotCommentTime) as lotCommentTimeString,
|
||||
lotCommentTime,
|
||||
userFn_timeIntegerToString(lotCommentTime) as lotCommentTimeString,
|
||||
userFn_timeIntegerToPeriodString(lotCommentTime) as lotCommentTimePeriodString,
|
||||
lotComment,
|
||||
recordCreate_userName, recordUpdate_userName
|
||||
from LotComments
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@ import type { PoolConnection } from 'better-sqlite-pool'
|
|||
|
||||
import {
|
||||
dateIntegerToString,
|
||||
timeIntegerToString
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
timeIntegerToString,
|
||||
timeIntegerToPeriodString
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
@ -16,12 +17,15 @@ export async function getLotComments(
|
|||
|
||||
database.function('userFn_dateIntegerToString', dateIntegerToString)
|
||||
database.function('userFn_timeIntegerToString', timeIntegerToString)
|
||||
database.function('userFn_timeIntegerToPeriodString', timeIntegerToPeriodString)
|
||||
|
||||
const lotComments = database
|
||||
.prepare(
|
||||
`select lotCommentId,
|
||||
lotCommentDate, userFn_dateIntegerToString(lotCommentDate) as lotCommentDateString,
|
||||
lotCommentTime, userFn_timeIntegerToString(lotCommentTime) as lotCommentTimeString,
|
||||
lotCommentTime,
|
||||
userFn_timeIntegerToString(lotCommentTime) as lotCommentTimeString,
|
||||
userFn_timeIntegerToPeriodString(lotCommentTime) as lotCommentTimePeriodString,
|
||||
lotComment,
|
||||
recordCreate_userName, recordUpdate_userName
|
||||
from LotComments
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateIntegerToString, dateStringToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateIntegerToString, dateStringToInteger } from '@cityssm/utils-datetime';
|
||||
import * as configFunctions from '../functions.config.js';
|
||||
import { getOccupancyTypeById } from '../functions.cache.js';
|
||||
import { getLotOccupancyOccupants } from './getLotOccupancyOccupants.js';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import type { PoolConnection } from 'better-sqlite-pool'
|
|||
import {
|
||||
dateIntegerToString,
|
||||
dateStringToInteger
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import * as configFunctions from '../functions.config.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateIntegerToString } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateIntegerToString } from '@cityssm/utils-datetime';
|
||||
import { getLotOccupancyOccupants } from './getLotOccupancyOccupants.js';
|
||||
import { getLotOccupancyComments } from './getLotOccupancyComments.js';
|
||||
import { getLotOccupancyFields } from './getLotOccupancyFields.js';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { acquireConnection } from './pool.js'
|
||||
import type { PoolConnection } from 'better-sqlite-pool'
|
||||
|
||||
import { dateIntegerToString } from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import { dateIntegerToString } from '@cityssm/utils-datetime'
|
||||
|
||||
import { getLotOccupancyOccupants } from './getLotOccupancyOccupants.js'
|
||||
import { getLotOccupancyComments } from './getLotOccupancyComments.js'
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateIntegerToString, timeIntegerToString } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateIntegerToString, timeIntegerToString, timeIntegerToPeriodString } from '@cityssm/utils-datetime';
|
||||
export async function getLotOccupancyComments(lotOccupancyId, connectedDatabase) {
|
||||
const database = connectedDatabase ?? (await acquireConnection());
|
||||
database.function('userFn_dateIntegerToString', dateIntegerToString);
|
||||
database.function('userFn_timeIntegerToString', timeIntegerToString);
|
||||
database.function('userFn_timeIntegerToPeriodString', timeIntegerToPeriodString);
|
||||
const lotComments = database
|
||||
.prepare(`select lotOccupancyCommentId,
|
||||
lotOccupancyCommentDate, userFn_dateIntegerToString(lotOccupancyCommentDate) as lotOccupancyCommentDateString,
|
||||
lotOccupancyCommentTime, userFn_timeIntegerToString(lotOccupancyCommentTime) as lotOccupancyCommentTimeString,
|
||||
lotOccupancyCommentTime,
|
||||
userFn_timeIntegerToString(lotOccupancyCommentTime) as lotOccupancyCommentTimeString,
|
||||
userFn_timeIntegerToPeriodString(lotOccupancyCommentTime) as lotOccupancyCommentTimePeriodString,
|
||||
lotOccupancyComment,
|
||||
recordCreate_userName, recordUpdate_userName
|
||||
from LotOccupancyComments
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@ import type { PoolConnection } from 'better-sqlite-pool'
|
|||
|
||||
import {
|
||||
dateIntegerToString,
|
||||
timeIntegerToString
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
timeIntegerToString,
|
||||
timeIntegerToPeriodString
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
@ -16,12 +17,15 @@ export async function getLotOccupancyComments(
|
|||
|
||||
database.function('userFn_dateIntegerToString', dateIntegerToString)
|
||||
database.function('userFn_timeIntegerToString', timeIntegerToString)
|
||||
database.function('userFn_timeIntegerToPeriodString', timeIntegerToPeriodString)
|
||||
|
||||
const lotComments = database
|
||||
.prepare(
|
||||
`select lotOccupancyCommentId,
|
||||
lotOccupancyCommentDate, userFn_dateIntegerToString(lotOccupancyCommentDate) as lotOccupancyCommentDateString,
|
||||
lotOccupancyCommentTime, userFn_timeIntegerToString(lotOccupancyCommentTime) as lotOccupancyCommentTimeString,
|
||||
lotOccupancyCommentTime,
|
||||
userFn_timeIntegerToString(lotOccupancyCommentTime) as lotOccupancyCommentTimeString,
|
||||
userFn_timeIntegerToPeriodString(lotOccupancyCommentTime) as lotOccupancyCommentTimePeriodString,
|
||||
lotOccupancyComment,
|
||||
recordCreate_userName, recordUpdate_userName
|
||||
from LotOccupancyComments
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateIntegerToString, timeIntegerToString } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateIntegerToString, timeIntegerToString } from '@cityssm/utils-datetime';
|
||||
import * as configFunctions from '../functions.config.js';
|
||||
import * as gpFunctions from '../functions.dynamicsGP.js';
|
||||
export async function getLotOccupancyTransactions(lotOccupancyId, connectedDatabase) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import type { PoolConnection } from 'better-sqlite-pool'
|
|||
import {
|
||||
dateIntegerToString,
|
||||
timeIntegerToString
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import * as configFunctions from '../functions.config.js'
|
||||
import * as gpFunctions from '../functions.dynamicsGP.js'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateToInteger } from '@cityssm/utils-datetime';
|
||||
import * as configFunctions from '../functions.config.js';
|
||||
import { getLotNameWhereClause } from '../functions.sqlFilters.js';
|
||||
function buildWhereClause(filters) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
import { acquireConnection } from './pool.js'
|
||||
import type { PoolConnection } from 'better-sqlite-pool'
|
||||
|
||||
import { dateToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import { dateToInteger } from '@cityssm/utils-datetime'
|
||||
|
||||
import * as configFunctions from '../functions.config.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import * as configFunctions from '../functions.config.js';
|
||||
import * as dateTimeFunctions from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import * as dateTimeFunctions from '@cityssm/utils-datetime';
|
||||
import camelCase from 'camelcase';
|
||||
const mapCamelCase = camelCase(configFunctions.getProperty('aliases.map'));
|
||||
const mapNameAlias = mapCamelCase + 'Name';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
import { acquireConnection } from './pool.js'
|
||||
|
||||
import * as configFunctions from '../functions.config.js'
|
||||
import * as dateTimeFunctions from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import * as dateTimeFunctions from '@cityssm/utils-datetime'
|
||||
|
||||
import camelCase from 'camelcase'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateIntegerToString } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateIntegerToString } from '@cityssm/utils-datetime';
|
||||
import { getLots } from './getLots.js';
|
||||
import { getLotOccupancies } from './getLotOccupancies.js';
|
||||
import { getWorkOrderComments } from './getWorkOrderComments.js';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { acquireConnection } from './pool.js'
|
||||
import type { PoolConnection } from 'better-sqlite-pool'
|
||||
|
||||
import { dateIntegerToString } from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import { dateIntegerToString } from '@cityssm/utils-datetime'
|
||||
|
||||
import { getLots } from './getLots.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateIntegerToString, timeIntegerToString } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateIntegerToString, timeIntegerToString, timeIntegerToPeriodString } from '@cityssm/utils-datetime';
|
||||
export async function getWorkOrderComments(workOrderId, connectedDatabase) {
|
||||
const database = connectedDatabase ?? (await acquireConnection());
|
||||
database.function('userFn_dateIntegerToString', dateIntegerToString);
|
||||
database.function('userFn_timeIntegerToString', timeIntegerToString);
|
||||
database.function('userFn_timeIntegerToPeriodString', timeIntegerToPeriodString);
|
||||
const workOrderComments = database
|
||||
.prepare(`select workOrderCommentId,
|
||||
workOrderCommentDate, userFn_dateIntegerToString(workOrderCommentDate) as workOrderCommentDateString,
|
||||
workOrderCommentTime, userFn_timeIntegerToString(workOrderCommentTime) as workOrderCommentTimeString,
|
||||
workOrderCommentTime,
|
||||
userFn_timeIntegerToString(workOrderCommentTime) as workOrderCommentTimeString,
|
||||
userFn_timeIntegerToPeriodString(workOrderCommentTime) as workOrderCommentTimePeriodString,
|
||||
workOrderComment,
|
||||
recordCreate_userName, recordUpdate_userName
|
||||
from WorkOrderComments
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@ import type { PoolConnection } from 'better-sqlite-pool'
|
|||
|
||||
import {
|
||||
dateIntegerToString,
|
||||
timeIntegerToString
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
timeIntegerToString,
|
||||
timeIntegerToPeriodString
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
@ -16,12 +17,15 @@ export async function getWorkOrderComments(
|
|||
|
||||
database.function('userFn_dateIntegerToString', dateIntegerToString)
|
||||
database.function('userFn_timeIntegerToString', timeIntegerToString)
|
||||
database.function('userFn_timeIntegerToPeriodString', timeIntegerToPeriodString)
|
||||
|
||||
const workOrderComments = database
|
||||
.prepare(
|
||||
`select workOrderCommentId,
|
||||
workOrderCommentDate, userFn_dateIntegerToString(workOrderCommentDate) as workOrderCommentDateString,
|
||||
workOrderCommentTime, userFn_timeIntegerToString(workOrderCommentTime) as workOrderCommentTimeString,
|
||||
workOrderCommentTime,
|
||||
userFn_timeIntegerToString(workOrderCommentTime) as workOrderCommentTimeString,
|
||||
userFn_timeIntegerToPeriodString(workOrderCommentTime) as workOrderCommentTimePeriodString,
|
||||
workOrderComment,
|
||||
recordCreate_userName, recordUpdate_userName
|
||||
from WorkOrderComments
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateIntegerToString, dateStringToInteger, dateToInteger, timeIntegerToString } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateIntegerToString, dateStringToInteger, dateToInteger, timeIntegerToString } from '@cityssm/utils-datetime';
|
||||
import * as configFunctions from '../functions.config.js';
|
||||
import { getLots } from './getLots.js';
|
||||
import { getLotOccupancies } from './getLotOccupancies.js';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import {
|
|||
dateStringToInteger,
|
||||
dateToInteger,
|
||||
timeIntegerToString
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import * as configFunctions from '../functions.config.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateIntegerToString, dateStringToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateIntegerToString, dateStringToInteger } from '@cityssm/utils-datetime';
|
||||
import { getWorkOrderComments } from './getWorkOrderComments.js';
|
||||
import { getLots } from './getLots.js';
|
||||
import { getLotOccupancies } from './getLotOccupancies.js';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import type { PoolConnection } from 'better-sqlite-pool'
|
|||
import {
|
||||
dateIntegerToString,
|
||||
dateStringToInteger
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import { getWorkOrderComments } from './getWorkOrderComments.js'
|
||||
import { getLots } from './getLots.js'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateStringToInteger, timeStringToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateStringToInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
||||
export async function updateLotComment(commentForm, requestSession) {
|
||||
const rightNowMillis = Date.now();
|
||||
const database = await acquireConnection();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { acquireConnection } from './pool.js'
|
|||
import {
|
||||
dateStringToInteger,
|
||||
timeStringToInteger
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateStringToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateStringToInteger } from '@cityssm/utils-datetime';
|
||||
import { addOrUpdateLotOccupancyField } from './addOrUpdateLotOccupancyField.js';
|
||||
import { deleteLotOccupancyField } from './deleteLotOccupancyField.js';
|
||||
export async function updateLotOccupancy(lotOccupancyForm, requestSession) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import { acquireConnection } from './pool.js'
|
||||
|
||||
import { dateStringToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import { dateStringToInteger } from '@cityssm/utils-datetime'
|
||||
|
||||
import { addOrUpdateLotOccupancyField } from './addOrUpdateLotOccupancyField.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateStringToInteger, timeStringToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateStringToInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
||||
export async function updateLotOccupancyComment(commentForm, requestSession) {
|
||||
const rightNowMillis = Date.now();
|
||||
const database = await acquireConnection();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { acquireConnection } from './pool.js'
|
|||
import {
|
||||
dateStringToInteger,
|
||||
timeStringToInteger
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateStringToInteger, timeStringToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateStringToInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
||||
export async function updateLotOccupancyTransaction(lotOccupancyTransactionForm, requestSession) {
|
||||
const database = await acquireConnection();
|
||||
const result = database
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { acquireConnection } from './pool.js'
|
|||
import {
|
||||
dateStringToInteger,
|
||||
timeStringToInteger
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateStringToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateStringToInteger } from '@cityssm/utils-datetime';
|
||||
export async function updateWorkOrder(workOrderForm, requestSession) {
|
||||
const database = await acquireConnection();
|
||||
const rightNowMillis = Date.now();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { acquireConnection } from './pool.js'
|
||||
|
||||
import { dateStringToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import { dateStringToInteger } from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateStringToInteger, timeStringToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateStringToInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
||||
export async function updateWorkOrderComment(commentForm, requestSession) {
|
||||
const rightNowMillis = Date.now();
|
||||
const database = await acquireConnection();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { acquireConnection } from './pool.js'
|
|||
import {
|
||||
dateStringToInteger,
|
||||
timeStringToInteger
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { acquireConnection } from './pool.js';
|
||||
import { dateStringToInteger, timeStringToInteger } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateStringToInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
||||
export async function updateWorkOrderMilestone(milestoneForm, requestSession) {
|
||||
const rightNow = new Date();
|
||||
const database = await acquireConnection();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { acquireConnection } from './pool.js'
|
|||
import {
|
||||
dateStringToInteger,
|
||||
timeStringToInteger
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
lotComment.lotCommentDateString +
|
||||
(lotComment.lotCommentTime === 0
|
||||
? ''
|
||||
: ' ' + lotComment.lotCommentTimeString) +
|
||||
: ' ' + lotComment.lotCommentTimePeriodString) +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
cityssm.escapeHTML((_b = lotComment.lotComment) !== null && _b !== void 0 ? _b : '') +
|
||||
|
|
|
|||
|
|
@ -450,7 +450,7 @@ declare const bulmaJS: BulmaJS
|
|||
lotComment.lotCommentDateString! +
|
||||
(lotComment.lotCommentTime === 0
|
||||
? ''
|
||||
: ' ' + lotComment.lotCommentTimeString!) +
|
||||
: ' ' + lotComment.lotCommentTimePeriodString!) +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
cityssm.escapeHTML(lotComment.lotComment ?? '') +
|
||||
|
|
|
|||
|
|
@ -1020,7 +1020,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
((_b = lotOccupancyComment.lotOccupancyCommentDateString) !== null && _b !== void 0 ? _b : '') +
|
||||
(lotOccupancyComment.lotOccupancyCommentTime === 0
|
||||
? ''
|
||||
: ' ' + lotOccupancyComment.lotOccupancyCommentTimeString) +
|
||||
: ' ' + lotOccupancyComment.lotOccupancyCommentTimePeriodString) +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
cityssm.escapeHTML((_c = lotOccupancyComment.lotOccupancyComment) !== null && _c !== void 0 ? _c : '') +
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ function renderLotOccupancyComments() {
|
|||
((_b = lotOccupancyComment.lotOccupancyCommentDateString) !== null && _b !== void 0 ? _b : '') +
|
||||
(lotOccupancyComment.lotOccupancyCommentTime === 0
|
||||
? ''
|
||||
: ' ' + lotOccupancyComment.lotOccupancyCommentTimeString) +
|
||||
: ' ' + lotOccupancyComment.lotOccupancyCommentTimePeriodString) +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
cityssm.escapeHTML((_c = lotOccupancyComment.lotOccupancyComment) !== null && _c !== void 0 ? _c : '') +
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ function renderLotOccupancyComments(): void {
|
|||
(lotOccupancyComment.lotOccupancyCommentDateString ?? '') +
|
||||
(lotOccupancyComment.lotOccupancyCommentTime === 0
|
||||
? ''
|
||||
: ' ' + lotOccupancyComment.lotOccupancyCommentTimeString!) +
|
||||
: ' ' + lotOccupancyComment.lotOccupancyCommentTimePeriodString!) +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
cityssm.escapeHTML(lotOccupancyComment.lotOccupancyComment ?? '') +
|
||||
|
|
|
|||
|
|
@ -854,7 +854,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
workOrderComment.workOrderCommentDateString +
|
||||
(workOrderComment.workOrderCommentTime === 0
|
||||
? ''
|
||||
: ' ' + workOrderComment.workOrderCommentTimeString) +
|
||||
: ' ' + workOrderComment.workOrderCommentTimePeriodString) +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
cityssm.escapeHTML((_b = workOrderComment.workOrderComment) !== null && _b !== void 0 ? _b : '') +
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ function renderWorkOrderComments() {
|
|||
workOrderComment.workOrderCommentDateString +
|
||||
(workOrderComment.workOrderCommentTime === 0
|
||||
? ''
|
||||
: ' ' + workOrderComment.workOrderCommentTimeString) +
|
||||
: ' ' + workOrderComment.workOrderCommentTimePeriodString) +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
cityssm.escapeHTML((_b = workOrderComment.workOrderComment) !== null && _b !== void 0 ? _b : '') +
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ function renderWorkOrderComments(): void {
|
|||
workOrderComment.workOrderCommentDateString +
|
||||
(workOrderComment.workOrderCommentTime === 0
|
||||
? ''
|
||||
: ' ' + workOrderComment.workOrderCommentTimeString) +
|
||||
: ' ' + workOrderComment.workOrderCommentTimePeriodString!) +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
cityssm.escapeHTML(workOrderComment.workOrderComment ?? '') +
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -23,7 +23,7 @@ import { getWorkOrder, getWorkOrderByWorkOrderNumber } from '../helpers/lotOccup
|
|||
import { reopenWorkOrder } from '../helpers/lotOccupancyDB/reopenWorkOrder.js';
|
||||
import { addWorkOrderMilestone } from '../helpers/lotOccupancyDB/addWorkOrderMilestone.js';
|
||||
import { closeWorkOrder } from '../helpers/lotOccupancyDB/closeWorkOrder.js';
|
||||
import { dateIntegerToString, dateToString } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { dateIntegerToString, dateToString } from '@cityssm/utils-datetime';
|
||||
const user = {
|
||||
user: {
|
||||
userName: 'import.unix',
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ import { closeWorkOrder } from '../helpers/lotOccupancyDB/closeWorkOrder.js'
|
|||
import {
|
||||
dateIntegerToString,
|
||||
dateToString
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
} from '@cityssm/utils-datetime'
|
||||
|
||||
import type * as recordTypes from '../types/recordTypes'
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ export interface LotComment extends Record {
|
|||
lotCommentDateString?: string;
|
||||
lotCommentTime?: number;
|
||||
lotCommentTimeString?: string;
|
||||
lotCommentTimePeriodString?: string;
|
||||
lotComment?: string;
|
||||
}
|
||||
export interface LotField extends LotTypeField, Record {
|
||||
|
|
@ -181,6 +182,7 @@ export interface LotOccupancyComment extends Record {
|
|||
lotOccupancyCommentDateString?: string;
|
||||
lotOccupancyCommentTime?: number;
|
||||
lotOccupancyCommentTimeString?: string;
|
||||
lotOccupancyCommentTimePeriodString?: string;
|
||||
lotOccupancyComment?: string;
|
||||
}
|
||||
export interface LotOccupancyField extends OccupancyTypeField, Record {
|
||||
|
|
@ -227,6 +229,7 @@ export interface WorkOrderComment extends Record {
|
|||
workOrderCommentDateString?: string;
|
||||
workOrderCommentTime?: number;
|
||||
workOrderCommentTimeString?: string;
|
||||
workOrderCommentTimePeriodString?: string;
|
||||
workOrderComment?: string;
|
||||
}
|
||||
export interface WorkOrderMilestone extends Record, WorkOrder {
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ export interface LotComment extends Record {
|
|||
|
||||
lotCommentTime?: number
|
||||
lotCommentTimeString?: string
|
||||
lotCommentTimePeriodString?: string
|
||||
|
||||
lotComment?: string
|
||||
}
|
||||
|
|
@ -237,6 +238,7 @@ export interface LotOccupancyComment extends Record {
|
|||
|
||||
lotOccupancyCommentTime?: number
|
||||
lotOccupancyCommentTimeString?: string
|
||||
lotOccupancyCommentTimePeriodString?: string
|
||||
|
||||
lotOccupancyComment?: string
|
||||
}
|
||||
|
|
@ -301,6 +303,7 @@ export interface WorkOrderComment extends Record {
|
|||
|
||||
workOrderCommentTime?: number
|
||||
workOrderCommentTimeString?: string
|
||||
workOrderCommentTimePeriodString?: string
|
||||
|
||||
workOrderComment?: string
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,16 +127,16 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% for (const lotComment of lot.lotComments) { %>
|
||||
<tr>
|
||||
<td><%= lotComment.recordCreate_userName %></td>
|
||||
<td>
|
||||
<%= lotComment.lotCommentDateString %>
|
||||
<%= (lotComment.lotCommentTime === 0 ? "" : lotComment.lotCommentTimeString) %>
|
||||
</td>
|
||||
<td><%= lotComment.lotComment %></td>
|
||||
</tr>
|
||||
<% } %>
|
||||
<% for (const lotComment of lot.lotComments) { %>
|
||||
<tr>
|
||||
<td><%= lotComment.recordCreate_userName %></td>
|
||||
<td>
|
||||
<%= lotComment.lotCommentDateString %>
|
||||
<%= (lotComment.lotCommentTime === 0 ? "" : lotComment.lotCommentTimePeriodString) %>
|
||||
</td>
|
||||
<td><%= lotComment.lotComment %></td>
|
||||
</tr>
|
||||
<% } %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -226,25 +226,25 @@
|
|||
<h2 class="panel-heading">Comments</h2>
|
||||
<div class="panel-block is-block">
|
||||
<table class="table is-fullwidth is-striped is-hoverable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Commentor</th>
|
||||
<th>Comment Date</th>
|
||||
<th>Comment</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% for (const lotOccupancyComment of lotOccupancy.lotOccupancyComments) { %>
|
||||
<tr>
|
||||
<td><%= lotOccupancyComment.recordCreate_userName %></td>
|
||||
<td>
|
||||
<%= lotOccupancyComment.lotOccupancyCommentDateString %>
|
||||
<%= (lotOccupancyComment.lotOccupancyCommentTime === 0 ? "" : lotOccupancyComment.lotOccupancyCommentTimeString) %>
|
||||
</td>
|
||||
<td><%= lotOccupancyComment.lotOccupancyComment %></td>
|
||||
</tr>
|
||||
<% } %>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Commentor</th>
|
||||
<th>Comment Date</th>
|
||||
<th>Comment</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% for (const lotOccupancyComment of lotOccupancy.lotOccupancyComments) { %>
|
||||
<tr>
|
||||
<td><%= lotOccupancyComment.recordCreate_userName %></td>
|
||||
<td>
|
||||
<%= lotOccupancyComment.lotOccupancyCommentDateString %>
|
||||
<%= (lotOccupancyComment.lotOccupancyCommentTime === 0 ? "" : lotOccupancyComment.lotOccupancyCommentTimePeriodString) %>
|
||||
</td>
|
||||
<td><%= lotOccupancyComment.lotOccupancyComment %></td>
|
||||
</tr>
|
||||
<% } %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -252,8 +252,8 @@
|
|||
|
||||
<% if (lotOccupancy.workOrders.length > 0) { %>
|
||||
<%
|
||||
const workOrderOpenDateAlias = configFunctions.getProperty("aliases.workOrderOpenDate");
|
||||
const workOrderCloseDateAlias = configFunctions.getProperty("aliases.workOrderCloseDate");
|
||||
const workOrderOpenDateAlias = configFunctions.getProperty("aliases.workOrderOpenDate");
|
||||
const workOrderCloseDateAlias = configFunctions.getProperty("aliases.workOrderCloseDate");
|
||||
%>
|
||||
<div class="panel">
|
||||
<h2 class="panel-heading">Work Orders</h2>
|
||||
|
|
@ -267,33 +267,33 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% for (const workOrder of lotOccupancy.workOrders) { %>
|
||||
<tr>
|
||||
<td>
|
||||
<a class="has-text-weight-bold" href="<%= urlPrefix %>/workOrders/<%= workOrder.workOrderId %>">
|
||||
<%= workOrder.workOrderNumber %>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<%= workOrder.workOrderType %><br />
|
||||
<span class="is-size-7"><%= workOrder.workOrderDescription %></span>
|
||||
</td>
|
||||
<td class="is-nowrap">
|
||||
<span class="has-tooltip-left" data-tooltip="<%= workOrderOpenDateAlias %>">
|
||||
<i class="fas fa-fw fa-play" aria-label="<%= workOrderOpenDateAlias %>"></i>
|
||||
<%= workOrder.workOrderOpenDateString %>
|
||||
</span><br />
|
||||
<span class="has-tooltip-left" data-tooltip="<%= workOrderCloseDateAlias %>">
|
||||
<i class="fas fa-fw fa-stop" aria-label="<%= workOrderCloseDateAlias %>"></i>
|
||||
<% if (workOrder.workOrderCloseDate) { %>
|
||||
<%= workOrder.workOrderCloseDateString %>
|
||||
<% } else { %>
|
||||
<span class="has-text-grey">(No <%= workOrderCloseDateAlias %>)</span>
|
||||
<% } %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<% } %>
|
||||
<% for (const workOrder of lotOccupancy.workOrders) { %>
|
||||
<tr>
|
||||
<td>
|
||||
<a class="has-text-weight-bold" href="<%= urlPrefix %>/workOrders/<%= workOrder.workOrderId %>">
|
||||
<%= workOrder.workOrderNumber %>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<%= workOrder.workOrderType %><br />
|
||||
<span class="is-size-7"><%= workOrder.workOrderDescription %></span>
|
||||
</td>
|
||||
<td class="is-nowrap">
|
||||
<span class="has-tooltip-left" data-tooltip="<%= workOrderOpenDateAlias %>">
|
||||
<i class="fas fa-fw fa-play" aria-label="<%= workOrderOpenDateAlias %>"></i>
|
||||
<%= workOrder.workOrderOpenDateString %>
|
||||
</span><br />
|
||||
<span class="has-tooltip-left" data-tooltip="<%= workOrderCloseDateAlias %>">
|
||||
<i class="fas fa-fw fa-stop" aria-label="<%= workOrderCloseDateAlias %>"></i>
|
||||
<% if (workOrder.workOrderCloseDate) { %>
|
||||
<%= workOrder.workOrderCloseDateString %>
|
||||
<% } else { %>
|
||||
<span class="has-text-grey">(No <%= workOrderCloseDateAlias %>)</span>
|
||||
<% } %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<% } %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -20,13 +20,13 @@
|
|||
<th>Comment</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% for (const comment of workOrder.workOrderComments) { %>
|
||||
<tr>
|
||||
<td><%= comment.recordUpdate_userName %></td>
|
||||
<td><%= comment.workOrderCommentDateString %> <%= comment.workOrderCommentTimeString %></td>
|
||||
<td><%= comment.workOrderComment %></td>
|
||||
</tr>
|
||||
<tbody>
|
||||
<% for (const comment of workOrder.workOrderComments) { %>
|
||||
<tr>
|
||||
<td><%= comment.recordUpdate_userName %></td>
|
||||
<td><%= comment.workOrderCommentDateString %> <%= comment.workOrderCommentTimePeriodString %></td>
|
||||
<td><%= comment.workOrderComment %></td>
|
||||
</tr>
|
||||
<% } %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@
|
|||
<td><%= workOrderComment.recordCreate_userName %></td>
|
||||
<td>
|
||||
<%= workOrderComment.workOrderCommentDateString %>
|
||||
<%= (workOrderComment.workOrderCommentTime === 0 ? "" : workOrderComment.workOrderCommentTimeString) %>
|
||||
<%= (workOrderComment.workOrderCommentTime === 0 ? "" : workOrderComment.workOrderCommentTimePeriodString) %>
|
||||
</td>
|
||||
<td><%= workOrderComment.workOrderComment %></td>
|
||||
</tr>
|
||||
|
|
|
|||
Loading…
Reference in New Issue