object_manager_attributes.rb 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396
  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: __('Sending Email Address'),
  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. note: __("A group's email address determines which address should be used for outgoing mails, e.g. when an agent is composing an email or a trigger is sending an auto-reply"),
  2184. },
  2185. editable: false,
  2186. active: true,
  2187. screens: {
  2188. create: {
  2189. '-all-' => {
  2190. null: true,
  2191. },
  2192. },
  2193. edit: {
  2194. '-all-' => {
  2195. null: true,
  2196. },
  2197. },
  2198. },
  2199. to_create: false,
  2200. to_migrate: false,
  2201. to_delete: false,
  2202. position: 600,
  2203. )
  2204. ObjectManager::Attribute.add(
  2205. force: true,
  2206. object: 'Group',
  2207. name: 'signature_id',
  2208. display: __('Signature'),
  2209. data_type: 'select',
  2210. data_option: {
  2211. default: '',
  2212. multiple: false,
  2213. null: true,
  2214. relation: 'Signature',
  2215. nulloption: true,
  2216. do_not_log: true,
  2217. },
  2218. editable: false,
  2219. active: true,
  2220. screens: {
  2221. create: {
  2222. '-all-' => {
  2223. null: true,
  2224. },
  2225. },
  2226. edit: {
  2227. '-all-' => {
  2228. null: true,
  2229. },
  2230. },
  2231. },
  2232. to_create: false,
  2233. to_migrate: false,
  2234. to_delete: false,
  2235. position: 600,
  2236. )
  2237. ObjectManager::Attribute.add(
  2238. force: true,
  2239. object: 'Group',
  2240. name: 'shared_drafts',
  2241. display: __('Shared Drafts'),
  2242. data_type: 'active',
  2243. data_option: {
  2244. null: false,
  2245. default: true,
  2246. permission: ['admin.group'],
  2247. },
  2248. editable: false,
  2249. active: true,
  2250. screens: {
  2251. create: {
  2252. '-all-' => {
  2253. null: true,
  2254. },
  2255. },
  2256. edit: {
  2257. '-all-': {
  2258. null: false,
  2259. },
  2260. },
  2261. view: {
  2262. '-all-' => {
  2263. shown: false,
  2264. },
  2265. },
  2266. },
  2267. to_create: false,
  2268. to_migrate: false,
  2269. to_delete: false,
  2270. position: 1400,
  2271. )
  2272. ObjectManager::Attribute.add(
  2273. force: true,
  2274. object: 'Group',
  2275. name: 'note',
  2276. display: __('Note'),
  2277. data_type: 'richtext',
  2278. data_option: {
  2279. type: 'text',
  2280. maxlength: 250,
  2281. no_images: true,
  2282. null: true,
  2283. note: __('Notes are visible to agents only, never to customers.'),
  2284. },
  2285. editable: false,
  2286. active: true,
  2287. screens: {
  2288. create: {
  2289. '-all-' => {
  2290. null: true,
  2291. },
  2292. },
  2293. edit: {
  2294. '-all-' => {
  2295. null: true,
  2296. },
  2297. },
  2298. view: {
  2299. '-all-' => {
  2300. shown: true,
  2301. },
  2302. },
  2303. },
  2304. to_create: false,
  2305. to_migrate: false,
  2306. to_delete: false,
  2307. position: 1500,
  2308. )
  2309. ObjectManager::Attribute.add(
  2310. force: true,
  2311. object: 'Group',
  2312. name: 'active',
  2313. display: __('Active'),
  2314. data_type: 'active',
  2315. data_option: {
  2316. null: true,
  2317. default: true,
  2318. permission: ['admin.group'],
  2319. },
  2320. editable: false,
  2321. active: true,
  2322. screens: {
  2323. create: {
  2324. '-all-' => {
  2325. null: true,
  2326. },
  2327. },
  2328. edit: {
  2329. '-all-': {
  2330. null: false,
  2331. },
  2332. },
  2333. view: {
  2334. '-all-' => {
  2335. shown: false,
  2336. },
  2337. },
  2338. },
  2339. to_create: false,
  2340. to_migrate: false,
  2341. to_delete: false,
  2342. position: 1800,
  2343. )