object_manager_attributes.rb 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395
  1. # Copyright (C) 2012-2025 Zammad Foundation, https://zammad-foundation.org/
  2. ObjectManager::Attribute.add(
  3. force: true,
  4. object: 'Ticket',
  5. name: 'number',
  6. display: '#',
  7. data_type: 'input',
  8. data_option: {
  9. type: 'text',
  10. readonly: 1,
  11. null: true,
  12. maxlength: 60,
  13. width: '68px',
  14. },
  15. editable: false,
  16. active: true,
  17. screens: {
  18. create_top: {},
  19. edit: {},
  20. },
  21. to_create: false,
  22. to_migrate: false,
  23. to_delete: false,
  24. position: 5,
  25. )
  26. ObjectManager::Attribute.add(
  27. force: true,
  28. object: 'Ticket',
  29. name: 'title',
  30. display: __('Title'),
  31. data_type: 'input',
  32. data_option: {
  33. type: 'text',
  34. maxlength: 200,
  35. null: false,
  36. translate: false,
  37. },
  38. editable: false,
  39. active: true,
  40. screens: {
  41. create_top: {
  42. '-all-' => {
  43. null: false,
  44. },
  45. },
  46. edit: {},
  47. },
  48. to_create: false,
  49. to_migrate: false,
  50. to_delete: false,
  51. position: 8,
  52. )
  53. ObjectManager::Attribute.add(
  54. force: true,
  55. object: 'Ticket',
  56. name: 'customer_id',
  57. display: __('Customer'),
  58. data_type: 'user_autocompletion',
  59. data_option: {
  60. relation: 'User',
  61. autocapitalize: false,
  62. multiple: false,
  63. guess: true,
  64. null: false,
  65. limit: 200,
  66. placeholder: __('Enter Person or Organization/Company'),
  67. minLengt: 2,
  68. translate: false,
  69. permission: ['ticket.agent'],
  70. },
  71. editable: false,
  72. active: true,
  73. screens: {
  74. create_top: {
  75. '-all-' => {
  76. null: false,
  77. },
  78. },
  79. edit: {},
  80. },
  81. to_create: false,
  82. to_migrate: false,
  83. to_delete: false,
  84. position: 10,
  85. )
  86. ObjectManager::Attribute.add(
  87. force: true,
  88. object: 'Ticket',
  89. name: 'organization_id',
  90. display: 'Organization',
  91. data_type: 'autocompletion_ajax_customer_organization',
  92. data_option: {
  93. relation: 'Organization',
  94. autocapitalize: false,
  95. multiple: false,
  96. null: true,
  97. translate: false,
  98. permission: ['ticket.agent', 'ticket.customer'],
  99. },
  100. editable: false,
  101. active: true,
  102. screens: {
  103. create_top: {
  104. '-all-' => {
  105. null: false,
  106. },
  107. },
  108. edit: {},
  109. },
  110. to_create: false,
  111. to_migrate: false,
  112. to_delete: false,
  113. position: 12,
  114. )
  115. ObjectManager::Attribute.add(
  116. force: true,
  117. object: 'Ticket',
  118. name: 'type',
  119. display: __('Type'),
  120. data_type: 'select',
  121. data_option: {
  122. default: '',
  123. options: {
  124. 'Incident' => __('Incident'),
  125. 'Problem' => __('Problem'),
  126. 'Request for Change' => __('Request for Change'),
  127. },
  128. nulloption: true,
  129. multiple: false,
  130. null: true,
  131. translate: true,
  132. },
  133. editable: true,
  134. active: false,
  135. screens: {
  136. create_middle: {
  137. '-all-' => {
  138. null: false,
  139. item_class: 'column',
  140. },
  141. },
  142. edit: {
  143. 'ticket.agent' => {
  144. null: false,
  145. },
  146. },
  147. },
  148. to_create: false,
  149. to_migrate: false,
  150. to_delete: false,
  151. position: 20,
  152. )
  153. ObjectManager::Attribute.add(
  154. force: true,
  155. object: 'Ticket',
  156. name: 'group_id',
  157. display: __('Group'),
  158. data_type: 'tree_select',
  159. data_option: {
  160. default: '',
  161. relation: 'Group',
  162. relation_condition: { access: 'full' },
  163. nulloption: true,
  164. multiple: false,
  165. null: false,
  166. translate: false,
  167. only_shown_if_selectable: true,
  168. permission: ['ticket.agent', 'ticket.customer'],
  169. },
  170. editable: false,
  171. active: true,
  172. screens: {
  173. create_middle: {
  174. '-all-' => {
  175. null: false,
  176. item_class: 'column',
  177. },
  178. },
  179. edit: {
  180. 'ticket.agent' => {
  181. null: false,
  182. },
  183. },
  184. overview_bulk: {
  185. 'ticket.agent' => {
  186. nulloption: true,
  187. null: true,
  188. default: '',
  189. direction: 'up',
  190. },
  191. },
  192. },
  193. to_create: false,
  194. to_migrate: false,
  195. to_delete: false,
  196. position: 25,
  197. )
  198. ObjectManager::Attribute.add(
  199. force: true,
  200. object: 'Ticket',
  201. name: 'owner_id',
  202. display: __('Owner'),
  203. data_type: 'select',
  204. data_option: {
  205. default: '',
  206. relation: 'User',
  207. relation_condition: { roles: 'Agent' },
  208. nulloption: true,
  209. multiple: false,
  210. null: true,
  211. translate: false,
  212. permission: ['ticket.agent'],
  213. },
  214. editable: false,
  215. active: true,
  216. screens: {
  217. create_middle: {
  218. '-all-' => {
  219. null: true,
  220. item_class: 'column',
  221. },
  222. },
  223. edit: {
  224. '-all-' => {
  225. null: true,
  226. },
  227. },
  228. overview_bulk: {
  229. 'ticket.agent' => {
  230. null: true,
  231. },
  232. },
  233. },
  234. to_create: false,
  235. to_migrate: false,
  236. to_delete: false,
  237. position: 30,
  238. )
  239. ObjectManager::Attribute.add(
  240. force: true,
  241. object: 'Ticket',
  242. name: 'state_id',
  243. display: __('State'),
  244. data_type: 'select',
  245. data_option: {
  246. relation: 'TicketState',
  247. nulloption: true,
  248. multiple: false,
  249. null: false,
  250. default: Ticket::State.find_by(default_follow_up: true).id,
  251. translate: true,
  252. filter: Ticket::State.where(active: true).by_category_ids(:viewable),
  253. },
  254. editable: false,
  255. active: true,
  256. screens: {
  257. create_middle: {
  258. 'ticket.agent' => {
  259. null: false,
  260. item_class: 'column',
  261. filter: Ticket::State.where(active: true).by_category_ids(:viewable_agent_new),
  262. },
  263. 'ticket.customer' => {
  264. item_class: 'column',
  265. nulloption: false,
  266. null: true,
  267. filter: Ticket::State.where(active: true).by_category_ids(:viewable_customer_new),
  268. default: Ticket::State.find_by(default_create: true).id,
  269. },
  270. },
  271. edit: {
  272. 'ticket.agent' => {
  273. nulloption: false,
  274. null: false,
  275. filter: Ticket::State.where(active: true).by_category_ids(:viewable_agent_edit),
  276. },
  277. 'ticket.customer' => {
  278. nulloption: false,
  279. null: true,
  280. filter: Ticket::State.where(active: true).by_category_ids(:viewable_customer_edit),
  281. default: Ticket::State.find_by(default_follow_up: true).id,
  282. },
  283. },
  284. overview_bulk: {
  285. 'ticket.agent' => {
  286. nulloption: true,
  287. null: true,
  288. default: '',
  289. filter: Ticket::State.where(active: true).by_category_ids(:viewable_agent_edit),
  290. },
  291. }
  292. },
  293. to_create: false,
  294. to_migrate: false,
  295. to_delete: false,
  296. position: 40,
  297. )
  298. ObjectManager::Attribute.add(
  299. force: true,
  300. object: 'Ticket',
  301. name: 'pending_time',
  302. display: __('Pending till'),
  303. data_type: 'datetime',
  304. data_option: {
  305. future: true,
  306. past: false,
  307. diff: nil,
  308. null: true,
  309. translate: true,
  310. permission: %w[ticket.agent],
  311. },
  312. editable: false,
  313. active: true,
  314. screens: {
  315. create_middle: {
  316. '-all-' => {
  317. null: false,
  318. item_class: 'column',
  319. },
  320. },
  321. edit: {
  322. '-all-' => {
  323. null: false,
  324. },
  325. },
  326. overview_bulk: {
  327. 'ticket.agent' => {
  328. nulloption: true,
  329. null: true,
  330. default: '',
  331. orientation: 'top',
  332. disableScroll: true,
  333. },
  334. },
  335. },
  336. to_create: false,
  337. to_migrate: false,
  338. to_delete: false,
  339. position: 41,
  340. )
  341. ObjectManager::Attribute.add(
  342. force: true,
  343. object: 'Ticket',
  344. name: 'priority_id',
  345. display: __('Priority'),
  346. data_type: 'select',
  347. data_option: {
  348. relation: 'TicketPriority',
  349. nulloption: false,
  350. multiple: false,
  351. null: false,
  352. default: Ticket::Priority.find_by(default_create: true).id,
  353. translate: true,
  354. },
  355. editable: false,
  356. active: true,
  357. screens: {
  358. create_middle: {
  359. 'ticket.agent' => {
  360. null: false,
  361. item_class: 'column',
  362. },
  363. },
  364. edit: {
  365. 'ticket.agent' => {
  366. null: false,
  367. },
  368. },
  369. overview_bulk: {
  370. 'ticket.agent' => {
  371. nulloption: true,
  372. null: true,
  373. default: '',
  374. },
  375. },
  376. },
  377. to_create: false,
  378. to_migrate: false,
  379. to_delete: false,
  380. position: 80,
  381. )
  382. ObjectManager::Attribute.add(
  383. force: true,
  384. object: 'Ticket',
  385. name: 'tags',
  386. display: __('Tags'),
  387. data_type: 'tag',
  388. data_option: {
  389. type: 'text',
  390. null: true,
  391. translate: false,
  392. },
  393. editable: false,
  394. active: true,
  395. screens: {
  396. create_bottom: {
  397. 'ticket.agent' => {
  398. null: true,
  399. },
  400. },
  401. edit: {},
  402. },
  403. to_create: false,
  404. to_migrate: false,
  405. to_delete: false,
  406. position: 900,
  407. )
  408. ObjectManager::Attribute.add(
  409. force: true,
  410. object: 'TicketArticle',
  411. name: 'type_id',
  412. display: __('Type'),
  413. data_type: 'select',
  414. data_option: {
  415. relation: 'TicketArticleType',
  416. nulloption: false,
  417. multiple: false,
  418. null: false,
  419. default: Ticket::Article::Type.lookup(name: 'note').id,
  420. translate: true,
  421. },
  422. editable: false,
  423. active: true,
  424. screens: {
  425. create_middle: {},
  426. edit: {
  427. 'ticket.agent' => {
  428. null: false,
  429. },
  430. },
  431. },
  432. to_create: false,
  433. to_migrate: false,
  434. to_delete: false,
  435. position: 100,
  436. )
  437. ObjectManager::Attribute.add(
  438. force: true,
  439. object: 'TicketArticle',
  440. name: 'internal',
  441. display: __('Visibility'),
  442. data_type: 'select',
  443. data_option: {
  444. options: {
  445. true: 'internal',
  446. false: 'public'
  447. },
  448. nulloption: false,
  449. multiple: false,
  450. null: true,
  451. default: false,
  452. translate: true,
  453. },
  454. editable: false,
  455. active: true,
  456. screens: {
  457. create_middle: {},
  458. edit: {
  459. 'ticket.agent' => {
  460. null: false,
  461. },
  462. },
  463. },
  464. to_create: false,
  465. to_migrate: false,
  466. to_delete: false,
  467. position: 200,
  468. )
  469. ObjectManager::Attribute.add(
  470. force: true,
  471. object: 'TicketArticle',
  472. name: 'to',
  473. display: __('To'),
  474. data_type: 'input',
  475. data_option: {
  476. type: 'text',
  477. maxlength: 1000,
  478. null: true,
  479. },
  480. editable: false,
  481. active: true,
  482. screens: {
  483. create_middle: {},
  484. edit: {
  485. 'ticket.agent' => {
  486. null: true,
  487. },
  488. },
  489. },
  490. to_create: false,
  491. to_migrate: false,
  492. to_delete: false,
  493. position: 300,
  494. )
  495. ObjectManager::Attribute.add(
  496. force: true,
  497. object: 'TicketArticle',
  498. name: 'cc',
  499. display: __('CC'),
  500. data_type: 'input',
  501. data_option: {
  502. type: 'text',
  503. maxlength: 1000,
  504. null: true,
  505. },
  506. editable: false,
  507. active: true,
  508. screens: {
  509. create_top: {},
  510. create_middle: {},
  511. edit: {
  512. 'ticket.agent' => {
  513. null: true,
  514. },
  515. },
  516. },
  517. to_create: false,
  518. to_migrate: false,
  519. to_delete: false,
  520. position: 400,
  521. )
  522. ObjectManager::Attribute.add(
  523. force: true,
  524. object: 'TicketArticle',
  525. name: 'body',
  526. display: __('Text'),
  527. data_type: 'richtext',
  528. data_option: {
  529. type: 'richtext',
  530. maxlength: 150_000,
  531. upload: true,
  532. rows: 8,
  533. null: true,
  534. },
  535. editable: false,
  536. active: true,
  537. screens: {
  538. create_top: {
  539. '-all-' => {
  540. null: false,
  541. },
  542. },
  543. edit: {
  544. '-all-' => {
  545. null: true,
  546. },
  547. },
  548. },
  549. to_create: false,
  550. to_migrate: false,
  551. to_delete: false,
  552. position: 600,
  553. )
  554. # NB: Untranslated list of languages for now, supported by CLD library.
  555. # https://github.com/mzsanford/cld/blob/master/languages/internal/languages.cc
  556. # rubocop:disable Zammad/DetectTranslatableString
  557. detected_language_options = {
  558. 'ab' => 'Abkhazian',
  559. 'aa' => 'Afar',
  560. 'af' => 'Afrikaans',
  561. 'sq' => 'Albanian',
  562. 'am' => 'Amharic',
  563. 'ar' => 'Arabic',
  564. 'hy' => 'Armenian',
  565. 'as' => 'Assamese',
  566. 'ay' => 'Aymara',
  567. 'az' => 'Azerbaijani',
  568. 'ba' => 'Bashkir',
  569. 'eu' => 'Basque',
  570. 'be' => 'Belarusian',
  571. 'bn' => 'Bengali',
  572. 'bh' => 'Bihari',
  573. 'bi' => 'Bislama',
  574. 'bs' => 'Bosnian',
  575. 'br' => 'Breton',
  576. 'bg' => 'Bulgarian',
  577. 'my' => 'Burmese',
  578. 'ca' => 'Catalan',
  579. 'chr' => 'Cherokee',
  580. 'zh-TW' => 'Chinese (Taiwan)',
  581. 'zh' => 'Chinese',
  582. 'co' => 'Corsican',
  583. 'cpe' => 'Creoles and Pidgins (English based)',
  584. 'cpf' => 'Creoles and Pidgins (French based)',
  585. 'crp' => 'Creoles and Pidgins (Other)',
  586. 'cpp' => 'Creoles and Pidgins (Portuguese based)',
  587. 'hr' => 'Croatian',
  588. 'cs' => 'Czech',
  589. 'da' => 'Danish',
  590. 'dv' => 'Dhivehi',
  591. 'nl' => 'Dutch',
  592. 'dz' => 'Dzongkha',
  593. 'en' => 'English',
  594. 'eo' => 'Esperanto',
  595. 'et' => 'Estonian',
  596. 'fo' => 'Faroese',
  597. 'fj' => 'Fijian',
  598. 'fi' => 'Finnish',
  599. 'fr' => 'French',
  600. 'fy' => 'Frisian',
  601. 'gl' => 'Galician',
  602. 'lg' => 'Ganda',
  603. 'ka' => 'Georgian',
  604. 'de' => 'German',
  605. 'el' => 'Greek',
  606. 'kl' => 'Greenlandic',
  607. 'gn' => 'Guarani',
  608. 'gu' => 'Gujarati',
  609. 'ht' => 'Haitian Creole',
  610. 'ha' => 'Hausa',
  611. 'he' => 'Hebrew',
  612. 'hi' => 'Hindi',
  613. 'hu' => 'Hungarian',
  614. 'is' => 'Icelandic',
  615. 'id' => 'Indonesian',
  616. 'ia' => 'Interlingua',
  617. 'ie' => 'Interlingue',
  618. 'iu' => 'Inuktitut',
  619. 'ik' => 'Inupiak',
  620. 'ga' => 'Irish',
  621. 'it' => 'Italian',
  622. 'ja' => 'Japanese',
  623. 'jw' => 'Javanese',
  624. 'kn' => 'Kannada',
  625. 'ks' => 'Kashmiri',
  626. 'kk' => 'Kazakh',
  627. 'kha' => 'Khasi',
  628. 'km' => 'Khmer',
  629. 'rw' => 'Kinyarwanda',
  630. 'ko' => 'Korean',
  631. 'ku' => 'Kurdish',
  632. 'ky' => 'Kyrgyz',
  633. 'lo' => 'Laothian',
  634. 'la' => 'Latin',
  635. 'lv' => 'Latvian',
  636. 'sit-NP' => 'Limbu',
  637. 'ln' => 'Lingala',
  638. 'lt' => 'Lithuanian',
  639. 'lb' => 'Luxembourgish',
  640. 'mk' => 'Macedonian',
  641. 'mg' => 'Malagasy',
  642. 'ms' => 'Malay',
  643. 'ml' => 'Malayalam',
  644. 'mt' => 'Maltese',
  645. 'gv' => 'Manx',
  646. 'mi' => 'Maori',
  647. 'mr' => 'Marathi',
  648. 'mo' => 'Moldavian',
  649. 'mn' => 'Mongolian',
  650. 'sr-ME' => 'Montenegrin',
  651. 'na' => 'Nauru',
  652. 'ne' => 'Nepali',
  653. 'nn' => 'Norwegian (Nynorsk)',
  654. 'nb' => 'Norwegian',
  655. 'oc' => 'Occitan',
  656. 'or' => 'Oriya',
  657. 'om' => 'Oromo',
  658. 'ps' => 'Pashto',
  659. 'fa' => 'Persian',
  660. 'pl' => 'Polish',
  661. 'pt-BR' => 'Portuguese (Brazil)',
  662. 'pt-PT' => 'Portuguese (Portugal)',
  663. 'pt' => 'Portuguese',
  664. 'pa' => 'Punjabi',
  665. 'qu' => 'Quechua',
  666. 'rm' => 'Rhaeto Romance',
  667. 'ro' => 'Romanian',
  668. 'rn' => 'Rundi',
  669. 'ru' => 'Russian',
  670. 'sm' => 'Samoan',
  671. 'sg' => 'Sango',
  672. 'sa' => 'Sanskrit',
  673. 'gd' => 'Scots Gaelic',
  674. 'sco' => 'Scots',
  675. 'sr' => 'Serbian',
  676. 'sh' => 'Serbo Croatian',
  677. 'st' => 'Sesotho',
  678. 'sn' => 'Shona',
  679. 'sd' => 'Sindhi',
  680. 'si' => 'Sinhalese',
  681. 'ss' => 'Siswant',
  682. 'sk' => 'Slovak',
  683. 'sl' => 'Slovenian',
  684. 'so' => 'Somali',
  685. 'es' => 'Spanish',
  686. 'su' => 'Sundanese',
  687. 'sw' => 'Swahili',
  688. 'sv' => 'Swedish',
  689. 'syr' => 'Syriac',
  690. 'fil' => 'Tagalog',
  691. 'tg' => 'Tajik',
  692. 'ta' => 'Tamil',
  693. 'tt' => 'Tatar',
  694. 'te' => 'Telugu',
  695. 'th' => 'Thai',
  696. 'bo' => 'Tibetan',
  697. 'ti' => 'Tigrinya',
  698. 'to' => 'Tonga',
  699. 'ts' => 'Tsonga',
  700. 'tn' => 'Tswana',
  701. 'tr' => 'Turkish',
  702. 'tk' => 'Turkmen',
  703. 'tw' => 'Twi',
  704. 'ug' => 'Uighur',
  705. 'uk' => 'Ukrainian',
  706. 'ur' => 'Urdu',
  707. 'uz' => 'Uzbek',
  708. 'vi' => 'Vietnamese',
  709. 'vo' => 'Volapuk',
  710. 'cy' => 'Welsh',
  711. 'wo' => 'Wolof',
  712. 'xh' => 'Xhosa',
  713. 'yi' => 'Yiddish',
  714. 'yo' => 'Yoruba',
  715. 'za' => 'Zhuang',
  716. 'zu' => 'Zulu',
  717. }.freeze
  718. # rubocop:enable Zammad/DetectTranslatableString
  719. ObjectManager::Attribute.add(
  720. force: true,
  721. object: 'TicketArticle',
  722. name: 'detected_language',
  723. display: __('Detected Language'),
  724. data_type: 'select',
  725. data_option: {
  726. nulloption: true,
  727. multiple: false,
  728. null: true,
  729. default: '',
  730. translate: false,
  731. options: detected_language_options,
  732. # FIXME: Remove this after the automatic population of historical options for seeded attributes is in place.
  733. historical_options: detected_language_options,
  734. },
  735. editable: false,
  736. active: true,
  737. screens: {
  738. create_middle: {},
  739. edit: {
  740. 'ticket.agent' => {
  741. null: false,
  742. },
  743. },
  744. },
  745. to_create: false,
  746. to_migrate: false,
  747. to_delete: false,
  748. position: 100,
  749. )
  750. ObjectManager::Attribute.add(
  751. force: true,
  752. object: 'User',
  753. name: 'login',
  754. display: __('Login'),
  755. data_type: 'input',
  756. data_option: {
  757. type: 'text',
  758. maxlength: 100,
  759. null: true,
  760. autocapitalize: false,
  761. item_class: 'formGroup--halfSize',
  762. },
  763. editable: false,
  764. active: true,
  765. screens: {
  766. signup: {},
  767. invite_agent: {},
  768. invite_customer: {},
  769. edit: {},
  770. view: {
  771. '-all-' => {
  772. shown: false,
  773. },
  774. },
  775. },
  776. to_create: false,
  777. to_migrate: false,
  778. to_delete: false,
  779. position: 100,
  780. )
  781. ObjectManager::Attribute.add(
  782. force: true,
  783. object: 'User',
  784. name: 'firstname',
  785. display: __('First name'),
  786. data_type: 'input',
  787. data_option: {
  788. type: 'text',
  789. maxlength: 150,
  790. null: true,
  791. item_class: 'formGroup--halfSize',
  792. },
  793. editable: false,
  794. active: true,
  795. screens: {
  796. signup: {
  797. '-all-' => {
  798. null: true,
  799. },
  800. },
  801. invite_agent: {
  802. '-all-' => {
  803. null: true,
  804. },
  805. },
  806. invite_customer: {
  807. '-all-' => {
  808. null: true,
  809. },
  810. },
  811. edit: {
  812. '-all-' => {
  813. null: true,
  814. },
  815. },
  816. create: {
  817. '-all-' => {
  818. null: true,
  819. },
  820. },
  821. view: {
  822. '-all-' => {
  823. shown: true,
  824. },
  825. },
  826. },
  827. to_create: false,
  828. to_migrate: false,
  829. to_delete: false,
  830. position: 200,
  831. )
  832. ObjectManager::Attribute.add(
  833. force: true,
  834. object: 'User',
  835. name: 'lastname',
  836. display: __('Last name'),
  837. data_type: 'input',
  838. data_option: {
  839. type: 'text',
  840. maxlength: 150,
  841. null: true,
  842. item_class: 'formGroup--halfSize',
  843. },
  844. editable: false,
  845. active: true,
  846. screens: {
  847. signup: {
  848. '-all-' => {
  849. null: true,
  850. },
  851. },
  852. invite_agent: {
  853. '-all-' => {
  854. null: true,
  855. },
  856. },
  857. invite_customer: {
  858. '-all-' => {
  859. null: true,
  860. },
  861. },
  862. edit: {
  863. '-all-' => {
  864. null: true,
  865. },
  866. },
  867. create: {
  868. '-all-' => {
  869. null: true,
  870. },
  871. },
  872. view: {
  873. '-all-' => {
  874. shown: true,
  875. },
  876. },
  877. },
  878. to_create: false,
  879. to_migrate: false,
  880. to_delete: false,
  881. position: 300,
  882. )
  883. ObjectManager::Attribute.add(
  884. force: true,
  885. object: 'User',
  886. name: 'email',
  887. display: __('Email'),
  888. data_type: 'input',
  889. data_option: {
  890. type: 'email',
  891. maxlength: 150,
  892. null: true,
  893. item_class: 'formGroup--halfSize',
  894. },
  895. editable: false,
  896. active: true,
  897. screens: {
  898. signup: {
  899. '-all-' => {
  900. null: false,
  901. },
  902. },
  903. invite_agent: {
  904. '-all-' => {
  905. null: false,
  906. },
  907. },
  908. invite_customer: {
  909. '-all-' => {
  910. null: false,
  911. },
  912. },
  913. edit: {
  914. '-all-' => {
  915. null: true,
  916. },
  917. },
  918. create: {
  919. '-all-' => {
  920. null: true,
  921. },
  922. },
  923. view: {
  924. '-all-' => {
  925. shown: true,
  926. },
  927. },
  928. },
  929. to_create: false,
  930. to_migrate: false,
  931. to_delete: false,
  932. position: 400,
  933. )
  934. ObjectManager::Attribute.add(
  935. force: true,
  936. object: 'User',
  937. name: 'web',
  938. display: __('Web'),
  939. data_type: 'input',
  940. data_option: {
  941. type: 'url',
  942. maxlength: 250,
  943. null: true,
  944. item_class: 'formGroup--halfSize',
  945. },
  946. editable: false,
  947. active: true,
  948. screens: {
  949. signup: {},
  950. invite_agent: {},
  951. invite_customer: {},
  952. edit: {
  953. '-all-' => {
  954. null: true,
  955. },
  956. },
  957. create: {
  958. '-all-' => {
  959. null: true,
  960. },
  961. },
  962. view: {
  963. '-all-' => {
  964. shown: true,
  965. },
  966. },
  967. },
  968. to_create: false,
  969. to_migrate: false,
  970. to_delete: false,
  971. position: 500,
  972. )
  973. ObjectManager::Attribute.add(
  974. force: true,
  975. object: 'User',
  976. name: 'phone',
  977. display: __('Phone'),
  978. data_type: 'input',
  979. data_option: {
  980. type: 'tel',
  981. maxlength: 100,
  982. null: true,
  983. item_class: 'formGroup--halfSize',
  984. },
  985. editable: false,
  986. active: true,
  987. screens: {
  988. signup: {},
  989. invite_agent: {},
  990. invite_customer: {},
  991. edit: {
  992. '-all-' => {
  993. null: true,
  994. },
  995. },
  996. create: {
  997. '-all-' => {
  998. null: true,
  999. },
  1000. },
  1001. view: {
  1002. '-all-' => {
  1003. shown: true,
  1004. },
  1005. },
  1006. },
  1007. to_create: false,
  1008. to_migrate: false,
  1009. to_delete: false,
  1010. position: 600,
  1011. )
  1012. ObjectManager::Attribute.add(
  1013. force: true,
  1014. object: 'User',
  1015. name: 'mobile',
  1016. display: __('Mobile'),
  1017. data_type: 'input',
  1018. data_option: {
  1019. type: 'tel',
  1020. maxlength: 100,
  1021. null: true,
  1022. item_class: 'formGroup--halfSize',
  1023. },
  1024. editable: false,
  1025. active: true,
  1026. screens: {
  1027. signup: {},
  1028. invite_agent: {},
  1029. invite_customer: {},
  1030. edit: {
  1031. '-all-' => {
  1032. null: true,
  1033. },
  1034. },
  1035. create: {
  1036. '-all-' => {
  1037. null: true,
  1038. },
  1039. },
  1040. view: {
  1041. '-all-' => {
  1042. shown: true,
  1043. },
  1044. },
  1045. },
  1046. to_create: false,
  1047. to_migrate: false,
  1048. to_delete: false,
  1049. position: 700,
  1050. )
  1051. ObjectManager::Attribute.add(
  1052. force: true,
  1053. object: 'User',
  1054. name: 'fax',
  1055. display: __('Fax'),
  1056. data_type: 'input',
  1057. data_option: {
  1058. type: 'tel',
  1059. maxlength: 100,
  1060. null: true,
  1061. item_class: 'formGroup--halfSize',
  1062. },
  1063. editable: false,
  1064. active: true,
  1065. screens: {
  1066. signup: {},
  1067. invite_agent: {},
  1068. invite_customer: {},
  1069. edit: {
  1070. '-all-' => {
  1071. null: true,
  1072. },
  1073. },
  1074. create: {
  1075. '-all-' => {
  1076. null: true,
  1077. },
  1078. },
  1079. view: {
  1080. '-all-' => {
  1081. shown: true,
  1082. },
  1083. },
  1084. },
  1085. to_create: false,
  1086. to_migrate: false,
  1087. to_delete: false,
  1088. position: 800,
  1089. )
  1090. ObjectManager::Attribute.add(
  1091. force: true,
  1092. object: 'User',
  1093. name: 'organization_id',
  1094. display: __('Organization'),
  1095. data_type: 'autocompletion_ajax',
  1096. data_option: {
  1097. multiple: false,
  1098. nulloption: true,
  1099. null: true,
  1100. relation: 'Organization',
  1101. item_class: 'formGroup--halfSize',
  1102. },
  1103. editable: false,
  1104. active: true,
  1105. screens: {
  1106. signup: {},
  1107. invite_agent: {},
  1108. invite_customer: {
  1109. '-all-' => {
  1110. null: true,
  1111. },
  1112. },
  1113. edit: {
  1114. '-all-' => {
  1115. null: true,
  1116. },
  1117. },
  1118. create: {
  1119. '-all-' => {
  1120. null: true,
  1121. },
  1122. },
  1123. view: {
  1124. '-all-' => {
  1125. shown: true,
  1126. },
  1127. },
  1128. },
  1129. to_create: false,
  1130. to_migrate: false,
  1131. to_delete: false,
  1132. position: 900,
  1133. )
  1134. ObjectManager::Attribute.add(
  1135. force: true,
  1136. object: 'User',
  1137. name: 'organization_ids',
  1138. display: __('Secondary organizations'),
  1139. data_type: 'autocompletion_ajax',
  1140. data_option: {
  1141. multiple: true,
  1142. nulloption: true,
  1143. null: true,
  1144. relation: 'Organization',
  1145. item_class: 'formGroup--halfSize',
  1146. display_limit: 3,
  1147. belongs_to: 'secondary_organizations',
  1148. },
  1149. editable: false,
  1150. active: true,
  1151. screens: {
  1152. signup: {},
  1153. invite_agent: {},
  1154. invite_customer: {
  1155. '-all-' => {
  1156. null: true,
  1157. },
  1158. },
  1159. edit: {
  1160. '-all-' => {
  1161. null: true,
  1162. },
  1163. },
  1164. create: {
  1165. '-all-' => {
  1166. null: true,
  1167. },
  1168. },
  1169. view: {
  1170. '-all-' => {
  1171. shown: true,
  1172. },
  1173. },
  1174. },
  1175. to_create: false,
  1176. to_migrate: false,
  1177. to_delete: false,
  1178. position: 901,
  1179. )
  1180. ObjectManager::Attribute.add(
  1181. force: true,
  1182. object: 'User',
  1183. name: 'department',
  1184. display: __('Department'),
  1185. data_type: 'input',
  1186. data_option: {
  1187. type: 'text',
  1188. maxlength: 200,
  1189. null: true,
  1190. item_class: 'formGroup--halfSize',
  1191. },
  1192. editable: true,
  1193. active: true,
  1194. screens: {
  1195. signup: {},
  1196. invite_agent: {},
  1197. invite_customer: {},
  1198. edit: {
  1199. '-all-' => {
  1200. null: true,
  1201. },
  1202. },
  1203. create: {
  1204. '-all-' => {
  1205. null: true,
  1206. },
  1207. },
  1208. view: {
  1209. '-all-' => {
  1210. shown: true,
  1211. },
  1212. },
  1213. },
  1214. to_create: false,
  1215. to_migrate: false,
  1216. to_delete: false,
  1217. position: 1000,
  1218. )
  1219. ObjectManager::Attribute.add(
  1220. force: true,
  1221. object: 'User',
  1222. name: 'street',
  1223. display: __('Street'),
  1224. data_type: 'input',
  1225. data_option: {
  1226. type: 'text',
  1227. maxlength: 100,
  1228. null: true,
  1229. },
  1230. editable: true,
  1231. active: false,
  1232. screens: {
  1233. signup: {},
  1234. invite_agent: {},
  1235. invite_customer: {},
  1236. edit: {
  1237. '-all-' => {
  1238. null: true,
  1239. },
  1240. },
  1241. create: {
  1242. '-all-' => {
  1243. null: true,
  1244. },
  1245. },
  1246. view: {
  1247. '-all-' => {
  1248. shown: true,
  1249. },
  1250. },
  1251. },
  1252. to_create: false,
  1253. to_migrate: false,
  1254. to_delete: false,
  1255. position: 1100,
  1256. )
  1257. ObjectManager::Attribute.add(
  1258. force: true,
  1259. object: 'User',
  1260. name: 'zip',
  1261. display: __('Zip'),
  1262. data_type: 'input',
  1263. data_option: {
  1264. type: 'text',
  1265. maxlength: 100,
  1266. null: true,
  1267. item_class: 'formGroup--halfSize',
  1268. },
  1269. editable: true,
  1270. active: false,
  1271. screens: {
  1272. signup: {},
  1273. invite_agent: {},
  1274. invite_customer: {},
  1275. edit: {
  1276. '-all-' => {
  1277. null: true,
  1278. },
  1279. },
  1280. create: {
  1281. '-all-' => {
  1282. null: true,
  1283. },
  1284. },
  1285. view: {
  1286. '-all-' => {
  1287. shown: true,
  1288. },
  1289. },
  1290. },
  1291. to_create: false,
  1292. to_migrate: false,
  1293. to_delete: false,
  1294. position: 1200,
  1295. )
  1296. ObjectManager::Attribute.add(
  1297. force: true,
  1298. object: 'User',
  1299. name: 'city',
  1300. display: __('City'),
  1301. data_type: 'input',
  1302. data_option: {
  1303. type: 'text',
  1304. maxlength: 100,
  1305. null: true,
  1306. item_class: 'formGroup--halfSize',
  1307. },
  1308. editable: true,
  1309. active: false,
  1310. screens: {
  1311. signup: {},
  1312. invite_agent: {},
  1313. invite_customer: {},
  1314. edit: {
  1315. '-all-' => {
  1316. null: true,
  1317. },
  1318. },
  1319. create: {
  1320. '-all-' => {
  1321. null: true,
  1322. },
  1323. },
  1324. view: {
  1325. '-all-' => {
  1326. shown: true,
  1327. },
  1328. },
  1329. },
  1330. to_create: false,
  1331. to_migrate: false,
  1332. to_delete: false,
  1333. position: 1300,
  1334. )
  1335. ObjectManager::Attribute.add(
  1336. force: true,
  1337. object: 'User',
  1338. name: 'country',
  1339. display: __('Country'),
  1340. data_type: 'input',
  1341. data_option: {
  1342. type: 'text',
  1343. maxlength: 100,
  1344. null: true,
  1345. item_class: 'formGroup--halfSize',
  1346. },
  1347. editable: true,
  1348. active: false,
  1349. screens: {
  1350. signup: {},
  1351. invite_agent: {},
  1352. invite_customer: {},
  1353. edit: {
  1354. '-all-' => {
  1355. null: true,
  1356. },
  1357. },
  1358. create: {
  1359. '-all-' => {
  1360. null: true,
  1361. },
  1362. },
  1363. view: {
  1364. '-all-' => {
  1365. shown: true,
  1366. },
  1367. },
  1368. },
  1369. to_create: false,
  1370. to_migrate: false,
  1371. to_delete: false,
  1372. position: 1325,
  1373. )
  1374. ObjectManager::Attribute.add(
  1375. force: true,
  1376. object: 'User',
  1377. name: 'address',
  1378. display: __('Address'),
  1379. data_type: 'textarea',
  1380. data_option: {
  1381. type: 'text',
  1382. maxlength: 500,
  1383. rows: 4,
  1384. null: true,
  1385. item_class: 'formGroup--halfSize',
  1386. },
  1387. editable: true,
  1388. active: true,
  1389. screens: {
  1390. signup: {},
  1391. invite_agent: {},
  1392. invite_customer: {},
  1393. edit: {
  1394. '-all-' => {
  1395. null: true,
  1396. },
  1397. },
  1398. create: {
  1399. '-all-' => {
  1400. null: true,
  1401. },
  1402. },
  1403. view: {
  1404. '-all-' => {
  1405. shown: true,
  1406. },
  1407. },
  1408. },
  1409. to_create: false,
  1410. to_migrate: false,
  1411. to_delete: false,
  1412. position: 1350,
  1413. )
  1414. ObjectManager::Attribute.add(
  1415. force: true,
  1416. object: 'User',
  1417. name: 'password',
  1418. display: __('Password'),
  1419. data_type: 'input',
  1420. data_option: {
  1421. type: 'password',
  1422. # password length is capped at 1000 in PasswordPolicy::MaxLength::MAX_LENGTH
  1423. # if user copy-pastes a very long string
  1424. # this ensures that max length check is triggered preventing saving of truncated password
  1425. maxlength: 1001,
  1426. null: true,
  1427. autocomplete: 'new-password',
  1428. item_class: 'formGroup--halfSize',
  1429. },
  1430. editable: false,
  1431. active: true,
  1432. screens: {
  1433. signup: {
  1434. '-all-' => {
  1435. null: false,
  1436. },
  1437. },
  1438. invite_agent: {},
  1439. invite_customer: {},
  1440. edit: {
  1441. 'admin.user' => {
  1442. null: true,
  1443. },
  1444. },
  1445. create: {
  1446. '-all-' => {
  1447. null: true,
  1448. },
  1449. },
  1450. view: {}
  1451. },
  1452. to_create: false,
  1453. to_migrate: false,
  1454. to_delete: false,
  1455. position: 1400,
  1456. )
  1457. ObjectManager::Attribute.add(
  1458. force: true,
  1459. object: 'User',
  1460. name: 'vip',
  1461. display: __('VIP'),
  1462. data_type: 'boolean',
  1463. data_option: {
  1464. null: true,
  1465. default: false,
  1466. item_class: 'formGroup--halfSize',
  1467. options: {
  1468. false: 'no',
  1469. true: 'yes',
  1470. },
  1471. translate: true,
  1472. permission: ['admin.user', 'ticket.agent'],
  1473. },
  1474. editable: false,
  1475. active: true,
  1476. screens: {
  1477. edit: {
  1478. '-all-' => {
  1479. null: true,
  1480. },
  1481. },
  1482. create: {
  1483. '-all-' => {
  1484. null: true,
  1485. },
  1486. },
  1487. view: {
  1488. '-all-' => {
  1489. shown: false,
  1490. },
  1491. },
  1492. },
  1493. to_create: false,
  1494. to_migrate: false,
  1495. to_delete: false,
  1496. position: 1490,
  1497. )
  1498. ObjectManager::Attribute.add(
  1499. force: true,
  1500. object: 'User',
  1501. name: 'note',
  1502. display: __('Note'),
  1503. data_type: 'richtext',
  1504. data_option: {
  1505. type: 'text',
  1506. maxlength: 5000,
  1507. no_images: true,
  1508. null: true,
  1509. note: __('Notes are visible to agents only, never to customers.'),
  1510. },
  1511. editable: false,
  1512. active: true,
  1513. screens: {
  1514. signup: {},
  1515. invite_agent: {},
  1516. invite_customer: {
  1517. '-all-' => {
  1518. null: true,
  1519. },
  1520. },
  1521. edit: {
  1522. '-all-' => {
  1523. null: true,
  1524. },
  1525. },
  1526. create: {
  1527. '-all-' => {
  1528. null: true,
  1529. },
  1530. },
  1531. view: {
  1532. '-all-' => {
  1533. shown: true,
  1534. },
  1535. },
  1536. },
  1537. to_create: false,
  1538. to_migrate: false,
  1539. to_delete: false,
  1540. position: 1500,
  1541. )
  1542. ObjectManager::Attribute.add(
  1543. force: true,
  1544. object: 'User',
  1545. name: 'role_ids',
  1546. display: __('Roles'),
  1547. data_type: 'user_permission',
  1548. data_option: {
  1549. relation: 'Role',
  1550. null: false,
  1551. item_class: 'checkbox',
  1552. permission: ['admin.user'],
  1553. },
  1554. editable: false,
  1555. active: true,
  1556. screens: {
  1557. signup: {},
  1558. invite_agent: {
  1559. '-all-' => {
  1560. null: false,
  1561. default: [Role.lookup(name: 'Agent').id],
  1562. },
  1563. },
  1564. invite_customer: {},
  1565. edit: {
  1566. '-all-' => {
  1567. null: true,
  1568. },
  1569. },
  1570. create: {
  1571. '-all-' => {
  1572. null: true,
  1573. },
  1574. },
  1575. view: {
  1576. '-all-' => {
  1577. shown: false,
  1578. },
  1579. },
  1580. },
  1581. to_create: false,
  1582. to_migrate: false,
  1583. to_delete: false,
  1584. position: 1600,
  1585. )
  1586. ObjectManager::Attribute.add(
  1587. force: true,
  1588. object: 'User',
  1589. name: 'group_ids',
  1590. display: __('Group permissions'),
  1591. data_type: 'group_permissions',
  1592. data_option: {
  1593. null: false,
  1594. item_class: 'checkbox',
  1595. permission: ['admin.user'],
  1596. },
  1597. editable: false,
  1598. active: true,
  1599. screens: {
  1600. signup: {},
  1601. invite_agent: {
  1602. '-all-' => {
  1603. null: true,
  1604. },
  1605. },
  1606. invite_customer: {},
  1607. edit: {
  1608. '-all-' => {
  1609. null: true,
  1610. },
  1611. },
  1612. create: {
  1613. '-all-' => {
  1614. null: true,
  1615. },
  1616. },
  1617. view: {
  1618. '-all-' => {
  1619. shown: false,
  1620. },
  1621. },
  1622. },
  1623. to_create: false,
  1624. to_migrate: false,
  1625. to_delete: false,
  1626. position: 1700,
  1627. )
  1628. ObjectManager::Attribute.add(
  1629. force: true,
  1630. object: 'User',
  1631. name: 'active',
  1632. display: __('Active'),
  1633. data_type: 'active',
  1634. data_option: {
  1635. null: true,
  1636. default: true,
  1637. permission: ['admin.user', 'ticket.agent'],
  1638. },
  1639. editable: false,
  1640. active: true,
  1641. screens: {
  1642. signup: {},
  1643. invite_agent: {},
  1644. invite_customer: {},
  1645. edit: {
  1646. '-all-' => {
  1647. null: false,
  1648. },
  1649. },
  1650. create: {
  1651. '-all-' => {
  1652. null: false,
  1653. },
  1654. },
  1655. view: {
  1656. '-all-' => {
  1657. shown: false,
  1658. },
  1659. },
  1660. },
  1661. to_create: false,
  1662. to_migrate: false,
  1663. to_delete: false,
  1664. position: 1800,
  1665. )
  1666. ObjectManager::Attribute.add(
  1667. force: true,
  1668. object: 'Organization',
  1669. name: 'name',
  1670. display: __('Name'),
  1671. data_type: 'input',
  1672. data_option: {
  1673. type: 'text',
  1674. maxlength: 150,
  1675. null: false,
  1676. item_class: 'formGroup--halfSize',
  1677. },
  1678. editable: false,
  1679. active: true,
  1680. screens: {
  1681. edit: {
  1682. '-all-' => {
  1683. null: false,
  1684. },
  1685. },
  1686. create: {
  1687. '-all-' => {
  1688. null: false,
  1689. },
  1690. },
  1691. view: {
  1692. 'ticket.agent' => {
  1693. shown: true,
  1694. },
  1695. 'ticket.customer' => {
  1696. shown: true,
  1697. },
  1698. },
  1699. },
  1700. to_create: false,
  1701. to_migrate: false,
  1702. to_delete: false,
  1703. position: 200,
  1704. )
  1705. ObjectManager::Attribute.add(
  1706. force: true,
  1707. object: 'Organization',
  1708. name: 'shared',
  1709. display: __('Shared organization'),
  1710. data_type: 'boolean',
  1711. data_option: {
  1712. null: true,
  1713. default: true,
  1714. note: __("Customers in the organization can view each other's items."),
  1715. item_class: 'formGroup--halfSize',
  1716. options: {
  1717. true: 'yes',
  1718. false: 'no',
  1719. },
  1720. translate: true,
  1721. permission: ['admin.organization'],
  1722. },
  1723. editable: false,
  1724. active: true,
  1725. screens: {
  1726. edit: {
  1727. '-all-' => {
  1728. null: false,
  1729. },
  1730. },
  1731. create: {
  1732. '-all-' => {
  1733. null: false,
  1734. },
  1735. },
  1736. view: {
  1737. 'ticket.agent' => {
  1738. shown: true,
  1739. },
  1740. 'ticket.customer' => {
  1741. shown: false,
  1742. },
  1743. },
  1744. },
  1745. to_create: false,
  1746. to_migrate: false,
  1747. to_delete: false,
  1748. position: 1400,
  1749. )
  1750. ObjectManager::Attribute.add(
  1751. force: true,
  1752. object: 'Organization',
  1753. name: 'domain_assignment',
  1754. display: __('Domain based assignment'),
  1755. data_type: 'boolean',
  1756. data_option: {
  1757. null: true,
  1758. default: false,
  1759. note: __('Assign users based on user domain.'),
  1760. item_class: 'formGroup--halfSize',
  1761. options: {
  1762. true: 'yes',
  1763. false: 'no',
  1764. },
  1765. translate: true,
  1766. permission: ['admin.organization'],
  1767. },
  1768. editable: false,
  1769. active: true,
  1770. screens: {
  1771. edit: {
  1772. '-all-' => {
  1773. null: false,
  1774. },
  1775. },
  1776. create: {
  1777. '-all-' => {
  1778. null: false,
  1779. },
  1780. },
  1781. view: {
  1782. 'ticket.agent' => {
  1783. shown: true,
  1784. },
  1785. 'ticket.customer' => {
  1786. shown: false,
  1787. },
  1788. },
  1789. },
  1790. to_create: false,
  1791. to_migrate: false,
  1792. to_delete: false,
  1793. position: 1410,
  1794. )
  1795. ObjectManager::Attribute.add(
  1796. force: true,
  1797. object: 'Organization',
  1798. name: 'domain',
  1799. display: __('Domain'),
  1800. data_type: 'input',
  1801. data_option: {
  1802. type: 'text',
  1803. maxlength: 150,
  1804. null: true,
  1805. item_class: 'formGroup--halfSize',
  1806. },
  1807. editable: false,
  1808. active: true,
  1809. screens: {
  1810. edit: {
  1811. '-all-' => {
  1812. null: true,
  1813. },
  1814. },
  1815. create: {
  1816. '-all-' => {
  1817. null: true,
  1818. },
  1819. },
  1820. view: {
  1821. 'ticket.agent' => {
  1822. shown: true,
  1823. },
  1824. 'ticket.customer' => {
  1825. shown: false,
  1826. },
  1827. },
  1828. },
  1829. to_create: false,
  1830. to_migrate: false,
  1831. to_delete: false,
  1832. position: 1420,
  1833. )
  1834. ObjectManager::Attribute.add(
  1835. force: true,
  1836. object: 'Organization',
  1837. name: 'vip',
  1838. display: __('VIP'),
  1839. data_type: 'boolean',
  1840. data_option: {
  1841. null: true,
  1842. default: false,
  1843. item_class: 'formGroup--halfSize',
  1844. options: {
  1845. false: 'no',
  1846. true: 'yes',
  1847. },
  1848. translate: true,
  1849. permission: ['admin.organization'],
  1850. },
  1851. editable: false,
  1852. active: true,
  1853. screens: {
  1854. edit: {
  1855. '-all-' => {
  1856. null: true,
  1857. },
  1858. },
  1859. create: {
  1860. '-all-' => {
  1861. null: true,
  1862. },
  1863. },
  1864. view: {
  1865. '-all-' => {
  1866. shown: false,
  1867. },
  1868. },
  1869. },
  1870. to_create: false,
  1871. to_migrate: false,
  1872. to_delete: false,
  1873. position: 1450,
  1874. )
  1875. ObjectManager::Attribute.add(
  1876. force: true,
  1877. object: 'Organization',
  1878. name: 'note',
  1879. display: __('Note'),
  1880. data_type: 'richtext',
  1881. data_option: {
  1882. type: 'text',
  1883. maxlength: 5000,
  1884. no_images: true,
  1885. null: true,
  1886. note: __('Notes are visible to agents only, never to customers.'),
  1887. },
  1888. editable: false,
  1889. active: true,
  1890. screens: {
  1891. edit: {
  1892. '-all-' => {
  1893. null: true,
  1894. },
  1895. },
  1896. create: {
  1897. '-all-' => {
  1898. null: true,
  1899. },
  1900. },
  1901. view: {
  1902. 'ticket.agent' => {
  1903. shown: true,
  1904. },
  1905. 'ticket.customer' => {
  1906. shown: false,
  1907. },
  1908. },
  1909. },
  1910. to_create: false,
  1911. to_migrate: false,
  1912. to_delete: false,
  1913. position: 1500,
  1914. )
  1915. ObjectManager::Attribute.add(
  1916. force: true,
  1917. object: 'Organization',
  1918. name: 'active',
  1919. display: __('Active'),
  1920. data_type: 'active',
  1921. data_option: {
  1922. null: true,
  1923. default: true,
  1924. permission: ['admin.organization'],
  1925. },
  1926. editable: false,
  1927. active: true,
  1928. screens: {
  1929. edit: {
  1930. '-all-' => {
  1931. null: false,
  1932. },
  1933. },
  1934. create: {
  1935. '-all-' => {
  1936. null: false,
  1937. },
  1938. },
  1939. view: {
  1940. 'ticket.agent' => {
  1941. shown: false,
  1942. },
  1943. 'ticket.customer' => {
  1944. shown: false,
  1945. },
  1946. },
  1947. },
  1948. to_create: false,
  1949. to_migrate: false,
  1950. to_delete: false,
  1951. position: 1800,
  1952. )
  1953. ObjectManager::Attribute.add(
  1954. force: true,
  1955. object: 'Group',
  1956. name: 'name',
  1957. display: __('Name'),
  1958. data_type: 'input',
  1959. data_option: {
  1960. type: 'text',
  1961. maxlength: 255,
  1962. readonly: 1,
  1963. },
  1964. editable: false,
  1965. active: true,
  1966. screens: {},
  1967. to_create: false,
  1968. to_migrate: false,
  1969. to_delete: false,
  1970. position: 200,
  1971. )
  1972. ObjectManager::Attribute.add(
  1973. force: true,
  1974. object: 'Group',
  1975. name: 'name_last',
  1976. display: __('Name'),
  1977. data_type: 'input',
  1978. data_option: {
  1979. type: 'text',
  1980. maxlength: 160,
  1981. null: false,
  1982. },
  1983. editable: false,
  1984. active: true,
  1985. screens: {
  1986. create: {
  1987. '-all-' => {
  1988. null: false,
  1989. },
  1990. },
  1991. edit: {
  1992. '-all-' => {
  1993. null: false,
  1994. },
  1995. },
  1996. view: {
  1997. '-all-' => {
  1998. shown: true,
  1999. },
  2000. },
  2001. },
  2002. to_create: false,
  2003. to_migrate: false,
  2004. to_delete: false,
  2005. position: 210,
  2006. )
  2007. ObjectManager::Attribute.add(
  2008. force: true,
  2009. object: 'Group',
  2010. name: 'parent_id',
  2011. display: __('Parent group'),
  2012. data_type: 'tree_select',
  2013. data_option: {
  2014. default: '',
  2015. null: true,
  2016. relation: 'Group',
  2017. nulloption: true,
  2018. do_not_log: true,
  2019. },
  2020. editable: false,
  2021. active: true,
  2022. screens: {
  2023. create: {
  2024. '-all-' => {
  2025. null: true,
  2026. },
  2027. },
  2028. edit: {
  2029. '-all-' => {
  2030. null: true,
  2031. },
  2032. },
  2033. },
  2034. to_create: false,
  2035. to_migrate: false,
  2036. to_delete: false,
  2037. position: 250,
  2038. )
  2039. ObjectManager::Attribute.add(
  2040. force: true,
  2041. object: 'Group',
  2042. name: 'assignment_timeout',
  2043. display: __('Assignment Timeout'),
  2044. data_type: 'integer',
  2045. data_option: {
  2046. maxlength: 150,
  2047. null: true,
  2048. note: __('Assignment timeout in minutes if assigned agent is not working on it. Ticket will be shown as unassigend.'),
  2049. min: 0,
  2050. max: 999_999,
  2051. },
  2052. editable: false,
  2053. active: true,
  2054. screens: {
  2055. create: {
  2056. '-all-' => {
  2057. null: true,
  2058. },
  2059. },
  2060. edit: {
  2061. '-all-' => {
  2062. null: true,
  2063. },
  2064. },
  2065. },
  2066. to_create: false,
  2067. to_migrate: false,
  2068. to_delete: false,
  2069. position: 300,
  2070. )
  2071. ObjectManager::Attribute.add(
  2072. force: true,
  2073. object: 'Group',
  2074. name: 'follow_up_possible',
  2075. display: __('Follow-up possible'),
  2076. data_type: 'select',
  2077. data_option: {
  2078. default: 'yes',
  2079. options: {
  2080. yes: __('yes'),
  2081. new_ticket: __('do not reopen ticket but create new ticket'),
  2082. new_ticket_after_certain_time: __('do not reopen ticket after certain time but create new ticket'),
  2083. },
  2084. null: false,
  2085. note: __('Follow-up for closed ticket possible or not.'),
  2086. translate: true
  2087. },
  2088. editable: false,
  2089. active: true,
  2090. screens: {
  2091. create: {
  2092. '-all-' => {
  2093. null: false,
  2094. },
  2095. },
  2096. edit: {
  2097. '-all-' => {
  2098. null: false,
  2099. },
  2100. },
  2101. },
  2102. to_create: false,
  2103. to_migrate: false,
  2104. to_delete: false,
  2105. position: 400,
  2106. )
  2107. ObjectManager::Attribute.add(
  2108. force: true,
  2109. object: 'Group',
  2110. name: 'reopen_time_in_days',
  2111. display: __('Reopening time in days'),
  2112. data_type: 'integer',
  2113. data_option: {
  2114. default: '',
  2115. min: 1,
  2116. max: 3650,
  2117. null: true,
  2118. note: __('Allow reopening of tickets within a certain time.'),
  2119. translate: true
  2120. },
  2121. editable: false,
  2122. active: true,
  2123. screens: {
  2124. create: { 'admin.group': { shown: false, required: false } },
  2125. edit: { 'admin.group': { shown: false, required: false } },
  2126. view: { 'admin.group': { shown: false } }
  2127. },
  2128. to_create: false,
  2129. to_migrate: false,
  2130. to_delete: false,
  2131. position: 410,
  2132. created_by_id: 1,
  2133. updated_by_id: 1,
  2134. )
  2135. ObjectManager::Attribute.add(
  2136. force: true,
  2137. object: 'Group',
  2138. name: 'follow_up_assignment',
  2139. display: __('Assign Follow-Ups'),
  2140. data_type: 'select',
  2141. data_option: {
  2142. default: 'true',
  2143. options: {
  2144. true: 'yes',
  2145. false: 'no',
  2146. },
  2147. null: false,
  2148. note: __('Assign follow-up to latest agent again.'),
  2149. translate: true
  2150. },
  2151. editable: false,
  2152. active: true,
  2153. screens: {
  2154. create: {
  2155. '-all-' => {
  2156. null: false,
  2157. },
  2158. },
  2159. edit: {
  2160. '-all-' => {
  2161. null: false,
  2162. },
  2163. },
  2164. },
  2165. to_create: false,
  2166. to_migrate: false,
  2167. to_delete: false,
  2168. position: 500,
  2169. )
  2170. ObjectManager::Attribute.add(
  2171. force: true,
  2172. object: 'Group',
  2173. name: 'email_address_id',
  2174. display: __('Email'),
  2175. data_type: 'select',
  2176. data_option: {
  2177. default: '',
  2178. multiple: false,
  2179. null: true,
  2180. relation: 'EmailAddress',
  2181. nulloption: true,
  2182. do_not_log: true,
  2183. },
  2184. editable: false,
  2185. active: true,
  2186. screens: {
  2187. create: {
  2188. '-all-' => {
  2189. null: true,
  2190. },
  2191. },
  2192. edit: {
  2193. '-all-' => {
  2194. null: true,
  2195. },
  2196. },
  2197. },
  2198. to_create: false,
  2199. to_migrate: false,
  2200. to_delete: false,
  2201. position: 600,
  2202. )
  2203. ObjectManager::Attribute.add(
  2204. force: true,
  2205. object: 'Group',
  2206. name: 'signature_id',
  2207. display: __('Signature'),
  2208. data_type: 'select',
  2209. data_option: {
  2210. default: '',
  2211. multiple: false,
  2212. null: true,
  2213. relation: 'Signature',
  2214. nulloption: true,
  2215. do_not_log: true,
  2216. },
  2217. editable: false,
  2218. active: true,
  2219. screens: {
  2220. create: {
  2221. '-all-' => {
  2222. null: true,
  2223. },
  2224. },
  2225. edit: {
  2226. '-all-' => {
  2227. null: true,
  2228. },
  2229. },
  2230. },
  2231. to_create: false,
  2232. to_migrate: false,
  2233. to_delete: false,
  2234. position: 600,
  2235. )
  2236. ObjectManager::Attribute.add(
  2237. force: true,
  2238. object: 'Group',
  2239. name: 'shared_drafts',
  2240. display: __('Shared Drafts'),
  2241. data_type: 'active',
  2242. data_option: {
  2243. null: false,
  2244. default: true,
  2245. permission: ['admin.group'],
  2246. },
  2247. editable: false,
  2248. active: true,
  2249. screens: {
  2250. create: {
  2251. '-all-' => {
  2252. null: true,
  2253. },
  2254. },
  2255. edit: {
  2256. '-all-': {
  2257. null: false,
  2258. },
  2259. },
  2260. view: {
  2261. '-all-' => {
  2262. shown: false,
  2263. },
  2264. },
  2265. },
  2266. to_create: false,
  2267. to_migrate: false,
  2268. to_delete: false,
  2269. position: 1400,
  2270. )
  2271. ObjectManager::Attribute.add(
  2272. force: true,
  2273. object: 'Group',
  2274. name: 'note',
  2275. display: __('Note'),
  2276. data_type: 'richtext',
  2277. data_option: {
  2278. type: 'text',
  2279. maxlength: 250,
  2280. no_images: true,
  2281. null: true,
  2282. note: __('Notes are visible to agents only, never to customers.'),
  2283. },
  2284. editable: false,
  2285. active: true,
  2286. screens: {
  2287. create: {
  2288. '-all-' => {
  2289. null: true,
  2290. },
  2291. },
  2292. edit: {
  2293. '-all-' => {
  2294. null: true,
  2295. },
  2296. },
  2297. view: {
  2298. '-all-' => {
  2299. shown: true,
  2300. },
  2301. },
  2302. },
  2303. to_create: false,
  2304. to_migrate: false,
  2305. to_delete: false,
  2306. position: 1500,
  2307. )
  2308. ObjectManager::Attribute.add(
  2309. force: true,
  2310. object: 'Group',
  2311. name: 'active',
  2312. display: __('Active'),
  2313. data_type: 'active',
  2314. data_option: {
  2315. null: true,
  2316. default: true,
  2317. permission: ['admin.group'],
  2318. },
  2319. editable: false,
  2320. active: true,
  2321. screens: {
  2322. create: {
  2323. '-all-' => {
  2324. null: true,
  2325. },
  2326. },
  2327. edit: {
  2328. '-all-': {
  2329. null: false,
  2330. },
  2331. },
  2332. view: {
  2333. '-all-' => {
  2334. shown: false,
  2335. },
  2336. },
  2337. },
  2338. to_create: false,
  2339. to_migrate: false,
  2340. to_delete: false,
  2341. position: 1800,
  2342. )