smalos / nubuilder_dev

Found the usage of undeclared variables JS-0125
Bug risk
Critical
97 occurrences in this check
'nuFORM' is not defined
976}
977
978function nuGetProperty (f) {
979  const v = nuFORM.getProperty(f)980  return v
981}
'nuRunPHPHidden' is not defined
971    // set the hash cookie to persist / global scope
972    nuSetProperty('hcname', f)
973    nuSetProperty('hcvalue', v)
974    nuRunPHPHidden('NUSETHASHCOOKIE', 0)975  }
976}
977
'nuFORM' is not defined
966}
967
968function nuSetProperty (f, v, p) {
969  nuFORM.setProperty(f, v)970  if (p === true) {
971    // set the hash cookie to persist / global scope
972    nuSetProperty('hcname', f)
'nuFORM' is not defined
962}
963
964function nuCurrentProperties () {
965  return nuFORM.getCurrent()966}
967
968function nuSetProperty (f, v, p) {
'nuSERVERRESPONSE' is not defined
950
951function nuGetNumberFormat (f) {
952  const a = ['', '', '', '']
953  const n = nuSERVERRESPONSE.number_formats954
955  for (let i = 0; i < n.length; i++) {
956    if (n[i][0] == f) {
'nuPad2' is not defined
910      const a = nuPad2(o.getDate()) + ' '
911      const h = nuPad2(o.getHours()) + ':'
912      const n = nuPad2(o.getMinutes()) + ':'
913      const s = nuPad2(o.getSeconds())914
915      if (hasTime) {
916        return String(y + m + a + h + n + s)
'nuPad2' is not defined
909      const m = nuPad2(o.getMonth() + 1) + '-'
910      const a = nuPad2(o.getDate()) + ' '
911      const h = nuPad2(o.getHours()) + ':'
912      const n = nuPad2(o.getMinutes()) + ':'913      const s = nuPad2(o.getSeconds())
914
915      if (hasTime) {
'nuPad2' is not defined
908      const y = String(o.getFullYear()) + '-'
909      const m = nuPad2(o.getMonth() + 1) + '-'
910      const a = nuPad2(o.getDate()) + ' '
911      const h = nuPad2(o.getHours()) + ':'912      const n = nuPad2(o.getMinutes()) + ':'
913      const s = nuPad2(o.getSeconds())
914
'nuPad2' is not defined
907      var o = new Date(d.y, Number(d.m) - 1, d.d, Number(d.h), Number(d.n), Number(d.s), 0)
908      const y = String(o.getFullYear()) + '-'
909      const m = nuPad2(o.getMonth() + 1) + '-'
910      const a = nuPad2(o.getDate()) + ' '911      const h = nuPad2(o.getHours()) + ':'
912      const n = nuPad2(o.getMinutes()) + ':'
913      const s = nuPad2(o.getSeconds())
'nuPad2' is not defined
906
907      var o = new Date(d.y, Number(d.m) - 1, d.d, Number(d.h), Number(d.n), Number(d.s), 0)
908      const y = String(o.getFullYear()) + '-'
909      const m = nuPad2(o.getMonth() + 1) + '-'910      const a = nuPad2(o.getDate()) + ' '
911      const h = nuPad2(o.getHours()) + ':'
912      const n = nuPad2(o.getMinutes()) + ':'
'nuTranslateToEnglish' is not defined
888        const l = fmt[0]
889
890        if (l == 'm' && FMT[nuTranslateToEnglish(v[i])] !== undefined) {
891          d.m = FMT[nuTranslateToEnglish(v[i])].mm					// -- javascript month892        }
893
894        if (fmt == 'dd') {
'nuTranslateToEnglish' is not defined
887        const fmt = String(f[i])
888        const l = fmt[0]
889
890        if (l == 'm' && FMT[nuTranslateToEnglish(v[i])] !== undefined) {891          d.m = FMT[nuTranslateToEnglish(v[i])].mm					// -- javascript month
892        }
893
'nuTranslateToEnglish' is not defined
882      var o = Date().toString().split(' ', 6)								// -- Tue Sep 07 2004 11:11:12 GMT+0930 (Cen. Australia Standard Time)
883      const time = String(o[4]).split(':')
884
885      const d = { y: o[3], m: FMT[nuTranslateToEnglish(o[1])].jsmonth, d: o[2], h: time[0], n: time[1], s: time[2] }	// -- today's date time[2]};	//-- today's date886      for (let i = 0; i < f.length; i++) {
887        const fmt = String(f[i])
888        const l = fmt[0]
'nuTranslate' is not defined
819      s = s.replaceAll('yyyy', yea)
820      s = s.replaceAll('yy', String(yea).substr(2))
821      s = s.replaceAll('mmmm', nuTranslate(FMT[mth].mmmm))
822      s = s.replaceAll('mmm', nuTranslate(FMT[mth].mmm))823      s = s.replaceAll('mm', FMT[mth].mm)
824      s = s.replaceAll('dddd', FMT[wee].dddd)
825      s = s.replaceAll('ddd', FMT[wee].ddd)
'nuTranslate' is not defined
818
819      s = s.replaceAll('yyyy', yea)
820      s = s.replaceAll('yy', String(yea).substr(2))
821      s = s.replaceAll('mmmm', nuTranslate(FMT[mth].mmmm))822      s = s.replaceAll('mmm', nuTranslate(FMT[mth].mmm))
823      s = s.replaceAll('mm', FMT[mth].mm)
824      s = s.replaceAll('dddd', FMT[wee].dddd)
'nuDateIsValid' is not defined
794
795      const o = new Date(d[0], d[1] - 1, d[2], t[0], t[1], t[2], 0)			// -- (year, month, day, hours, minutes, seconds, milliseconds)
796
797      if (!nuDateIsValid(o)) { return '' }798
799      const splitDate = o.toString().split(' ')
800      const wee = splitDate[0]													// -- Tue Jul 07 2022 11:11:12 GMT+0930 (Cen. Australia Standard Time)
'nuAddThousandSpaces' is not defined
771      if (isNaN(Number(v))) { return '' }
772      const splitNumber = v.split('.')
773      const decimals = splitNumber.length == 1 ? '' : splitNumber[1]
774      return String(CF[0] + ' ' + nuAddThousandSpaces(splitNumber[0], CF[1]) + CF[2] + decimals).trim()775    }
776
777    if (f[0] == 'D') {	// -- date
'$' is not defined To fix this, add jquery in environment array of .deepsource.toml. Read more in our documentation https://deepsource.io/docs/analyzer/javascript
640    for (let f = 0; f < o.fields.length - 1; f++) {
641      const c = []
642
643      titles.push($('#title_' + sf + o.fields[f]).html())644
645      for (let r = 0; r < o.rows.length; r++) {
646        if (o.rows[r][o.fields.length - 1] == 0) {
'$' is not defined To fix this, add jquery in environment array of .deepsource.toml. Read more in our documentation https://deepsource.io/docs/analyzer/javascript
606      let V = [dnpk]
607      let E = [0]
608      let C = 1
609      let chk = $('#' + this.id).prop('checked')610
611      THIS.children('[data-nu-data]').each(function () {
612        const children = cThis.subformCollectRecordChildren(this, sf, chk, deleteAll, V, E, F, C)
'$' is not defined To fix this, add jquery in environment array of .deepsource.toml. Read more in our documentation https://deepsource.io/docs/analyzer/javascript
602
603    $(sel).each(function (index) {
604      const THIS = $(this)
605      const dnpk = $(this).attr('data-nu-primary-key')606      let V = [dnpk]
607      let E = [0]
608      let C = 1
'$' is not defined To fix this, add jquery in environment array of .deepsource.toml. Read more in our documentation https://deepsource.io/docs/analyzer/javascript
601    o.deleted = []
602
603    $(sel).each(function (index) {
604      const THIS = $(this)605      const dnpk = $(this).attr('data-nu-primary-key')
606      let V = [dnpk]
607      let E = [0]
'$' is not defined To fix this, add jquery in environment array of .deepsource.toml. Read more in our documentation https://deepsource.io/docs/analyzer/javascript
600    o.edited = []
601    o.deleted = []
602
603    $(sel).each(function (index) {604      const THIS = $(this)
605      const dnpk = $(this).attr('data-nu-primary-key')
606      let V = [dnpk]
'$' is not defined To fix this, add jquery in environment array of .deepsource.toml. Read more in our documentation https://deepsource.io/docs/analyzer/javascript
583      sel = "[id*='" + sf + "'][id*='nuRECORD']"
584      table = $(sel).attr('data-nu-table')
585
586      const $sf = $('#' + sf)587      oi = $sf.attr('data-nu-object-id')
588      fk = $sf.attr('data-nu-foreign-key-name')
589      pk = $sf.attr('data-nu-primary-key-name')
'$' is not defined To fix this, add jquery in environment array of .deepsource.toml. Read more in our documentation https://deepsource.io/docs/analyzer/javascript
581      }
582    } else {
583      sel = "[id*='" + sf + "'][id*='nuRECORD']"
584      table = $(sel).attr('data-nu-table')585
586      const $sf = $('#' + sf)
587      oi = $sf.attr('data-nu-object-id')
'nuFORM' is not defined
577      if (table === undefined) {
578        oi = parent.nuFORM === undefined ? undefined : parent.nuFORM.getCurrent().form_id
579      } else {
580        oi = nuFORM.getCurrent().form_id581      }
582    } else {
583      sel = "[id*='" + sf + "'][id*='nuRECORD']"