seeds.rb 73 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452
  1. # encoding: utf-8
  2. # This file should contain all the record creation needed to seed the database with its default values.
  3. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
  4. #
  5. # Examples:
  6. #
  7. # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
  8. # Mayor.create(:name => 'Emanuel', :city => cities.first)
  9. Setting.create_if_not_exists(
  10. title: 'System Init Done',
  11. name: 'system_init_done',
  12. area: 'Core',
  13. description: 'Defines if application is in init mode.',
  14. options: {},
  15. state: false,
  16. preferences: { online_service_disable: true },
  17. frontend: true
  18. )
  19. Setting.create_if_not_exists(
  20. title: 'App Version',
  21. name: 'app_version',
  22. area: 'Core::WebApp',
  23. description: 'Only used for internal, to propagate current web app version to clients.',
  24. options: {},
  25. state: '',
  26. preferences: { online_service_disable: true },
  27. frontend: false
  28. )
  29. Setting.create_if_not_exists(
  30. title: 'Developer System',
  31. name: 'developer_mode',
  32. area: 'Core::Develop',
  33. description: 'Defines if application is in developer mode (useful for developer, all users have the same password, password reset will work without email delivery).',
  34. options: {},
  35. state: false,
  36. preferences: { online_service_disable: true },
  37. frontend: true
  38. )
  39. Setting.create_if_not_exists(
  40. title: 'Online Service',
  41. name: 'system_online_service',
  42. area: 'Core',
  43. description: 'Defines if application is used as online service.',
  44. options: {},
  45. state: false,
  46. preferences: { online_service_disable: true },
  47. frontend: true
  48. )
  49. Setting.create_if_not_exists(
  50. title: 'Product Name',
  51. name: 'product_name',
  52. area: 'System::Branding',
  53. description: 'Defines the name of the application, shown in the web interface, tabs and title bar of the web browser.',
  54. options: {
  55. form: [
  56. {
  57. display: '',
  58. null: false,
  59. name: 'product_name',
  60. tag: 'input',
  61. },
  62. ],
  63. },
  64. preferences: { render: true, session_check: true, prio: 1 },
  65. state: 'Zammad Helpdesk',
  66. frontend: true
  67. )
  68. Setting.create_if_not_exists(
  69. title: 'Logo',
  70. name: 'product_logo',
  71. area: 'System::Branding',
  72. description: 'Defines the logo of the application, shown in the web interface.',
  73. options: {
  74. form: [
  75. {
  76. display: '',
  77. null: false,
  78. name: 'product_logo',
  79. tag: 'input',
  80. },
  81. ],
  82. },
  83. preferences: { prio: 3 },
  84. state: 'logo.svg',
  85. frontend: true
  86. )
  87. Setting.create_if_not_exists(
  88. title: 'Organization',
  89. name: 'organization',
  90. area: 'System::Branding',
  91. description: 'Will be shown in the app and is included in email footers.',
  92. options: {
  93. form: [
  94. {
  95. display: '',
  96. null: false,
  97. name: 'organization',
  98. tag: 'input',
  99. },
  100. ],
  101. },
  102. state: '',
  103. preferences: { prio: 2 },
  104. frontend: true
  105. )
  106. options = {}
  107. (10..99).each {|item|
  108. options[item] = item
  109. }
  110. system_id = rand(10..99)
  111. Setting.create_if_not_exists(
  112. title: 'SystemID',
  113. name: 'system_id',
  114. area: 'System::Base',
  115. description: 'Defines the system identifier. Every ticket number contains this ID. This ensures that only tickets which belong to your system will be processed as follow-ups (useful when communicating between two instances of Zammad).',
  116. options: {
  117. form: [
  118. {
  119. display: '',
  120. null: true,
  121. name: 'system_id',
  122. tag: 'select',
  123. options: options,
  124. },
  125. ],
  126. },
  127. state: system_id,
  128. preferences: { online_service_disable: true },
  129. frontend: true
  130. )
  131. Setting.create_if_not_exists(
  132. title: 'Fully Qualified Domain Name',
  133. name: 'fqdn',
  134. area: 'System::Base',
  135. description: 'Defines the fully qualified domain name of the system. This setting is used as a variable, #{setting.fqdn} which is found in all forms of messaging used by the application, to build links to the tickets within your system.',
  136. options: {
  137. form: [
  138. {
  139. display: '',
  140. null: false,
  141. name: 'fqdn',
  142. tag: 'input',
  143. },
  144. ],
  145. },
  146. state: 'zammad.example.com',
  147. preferences: { online_service_disable: true },
  148. frontend: true
  149. )
  150. Setting.create_if_not_exists(
  151. title: 'websocket port',
  152. name: 'websocket_port',
  153. area: 'System::WebSocket',
  154. description: 'Defines the port of the websocket server.',
  155. options: {
  156. form: [
  157. {
  158. display: '',
  159. null: false,
  160. name: 'websocket_port',
  161. tag: 'input',
  162. },
  163. ],
  164. },
  165. state: '6042',
  166. preferences: { online_service_disable: true },
  167. frontend: true
  168. )
  169. Setting.create_if_not_exists(
  170. title: 'http type',
  171. name: 'http_type',
  172. area: 'System::Base',
  173. description: 'Defines the type of protocol, used by the web server, to serve the application. If https protocol will be used instead of plain http, it must be specified in here. Since this has no affect on the web server\'s settings or behavior, it will not change the method of access to the application and, if it is wrong, it will not prevent you from logging into the application. This setting is used as a variable, #{setting.http_type} which is found in all forms of messaging used by the application, to build links to the tickets within your system.',
  174. options: {
  175. form: [
  176. {
  177. display: '',
  178. null: true,
  179. name: 'http_type',
  180. tag: 'select',
  181. options: {
  182. 'https' => 'https',
  183. 'http' => 'http',
  184. },
  185. },
  186. ],
  187. },
  188. state: 'http',
  189. preferences: { online_service_disable: true },
  190. frontend: true
  191. )
  192. Setting.create_if_not_exists(
  193. title: 'Storage Mechanism',
  194. name: 'storage',
  195. area: 'System::Storage',
  196. description: '"Database" stores all attachments in the database (not recommended for storing large amounts of data). "Filesystem" stores the data on the filesystem. You can switch between the modules even on a system that is already in production without any loss of data.',
  197. options: {
  198. form: [
  199. {
  200. display: '',
  201. null: true,
  202. name: 'storage',
  203. tag: 'select',
  204. options: {
  205. 'DB' => 'Database',
  206. 'FS' => 'Filesystem',
  207. },
  208. },
  209. ],
  210. },
  211. state: 'DB',
  212. preferences: { online_service_disable: true },
  213. frontend: false
  214. )
  215. Setting.create_if_not_exists(
  216. title: 'Image Service',
  217. name: 'image_backend',
  218. area: 'System::Services',
  219. description: 'Defines the backend for user and organization image lookups.',
  220. options: {
  221. form: [
  222. {
  223. display: '',
  224. null: true,
  225. name: 'image_backend',
  226. tag: 'select',
  227. options: {
  228. '' => '-',
  229. 'Service::Image::Zammad' => 'Zammad Image Service',
  230. },
  231. },
  232. ],
  233. },
  234. state: 'Service::Image::Zammad',
  235. preferences: { prio: 1 },
  236. frontend: false
  237. )
  238. Setting.create_if_not_exists(
  239. title: 'Geo IP Service',
  240. name: 'geo_ip_backend',
  241. area: 'System::Services',
  242. description: 'Defines the backend for geo IP lookups. Show also location of an IP address if an IP address is shown.',
  243. options: {
  244. form: [
  245. {
  246. display: '',
  247. null: true,
  248. name: 'geo_ip_backend',
  249. tag: 'select',
  250. options: {
  251. '' => '-',
  252. 'Service::GeoIp::Zammad' => 'Zammad GeoIP Service',
  253. },
  254. },
  255. ],
  256. },
  257. state: 'Service::GeoIp::Zammad',
  258. preferences: { prio: 2 },
  259. frontend: false
  260. )
  261. Setting.create_if_not_exists(
  262. title: 'Geo Location Service',
  263. name: 'geo_location_backend',
  264. area: 'System::Services',
  265. description: 'Defines the backend for geo location lookups to store geo locations for addresses.',
  266. options: {
  267. form: [
  268. {
  269. display: '',
  270. null: true,
  271. name: 'geo_location_backend',
  272. tag: 'select',
  273. options: {
  274. '' => '-',
  275. 'Service::GeoLocation::Gmaps' => 'Google Maps',
  276. },
  277. },
  278. ],
  279. },
  280. state: 'Service::GeoLocation::Gmaps',
  281. preferences: { prio: 3 },
  282. frontend: false
  283. )
  284. Setting.create_if_not_exists(
  285. title: 'Geo Calendar Service',
  286. name: 'geo_calendar_backend',
  287. area: 'System::Services',
  288. description: 'Defines the backend for geo calendar lookups. Used for inital calendar succession.',
  289. options: {
  290. form: [
  291. {
  292. display: '',
  293. null: true,
  294. name: 'geo_calendar_backend',
  295. tag: 'select',
  296. options: {
  297. '' => '-',
  298. 'Service::GeoCalendar::Zammad' => 'Zammad GeoCalendar Service',
  299. },
  300. },
  301. ],
  302. },
  303. state: 'Service::GeoCalendar::Zammad',
  304. preferences: { prio: 2 },
  305. frontend: false
  306. )
  307. Setting.create_if_not_exists(
  308. title: 'Send client stats',
  309. name: 'ui_send_client_stats',
  310. area: 'System::UI',
  311. description: 'Send client stats/error message to central server to improve the usability.',
  312. options: {
  313. form: [
  314. {
  315. display: '',
  316. null: true,
  317. name: 'ui_send_client_stats',
  318. tag: 'boolean',
  319. options: {
  320. true => 'yes',
  321. false => 'no',
  322. },
  323. },
  324. ],
  325. },
  326. state: true,
  327. preferences: { prio: 1 },
  328. frontend: true
  329. )
  330. Setting.create_if_not_exists(
  331. title: 'Client storage',
  332. name: 'ui_client_storage',
  333. area: 'System::UI',
  334. description: 'Use client storage to cache data to perform speed of application.',
  335. options: {
  336. form: [
  337. {
  338. display: '',
  339. null: true,
  340. name: 'ui_client_storage',
  341. tag: 'boolean',
  342. options: {
  343. true => 'yes',
  344. false => 'no',
  345. },
  346. },
  347. ],
  348. },
  349. state: false,
  350. preferences: { prio: 2 },
  351. frontend: true
  352. )
  353. Setting.create_if_not_exists(
  354. title: 'New User Accounts',
  355. name: 'user_create_account',
  356. area: 'Security::Base',
  357. description: 'Enables users to create their own account via web interface.',
  358. options: {
  359. form: [
  360. {
  361. display: '',
  362. null: true,
  363. name: 'user_create_account',
  364. tag: 'boolean',
  365. options: {
  366. true => 'yes',
  367. false => 'no',
  368. },
  369. },
  370. ],
  371. },
  372. state: true,
  373. frontend: true
  374. )
  375. Setting.create_if_not_exists(
  376. title: 'Lost Password',
  377. name: 'user_lost_password',
  378. area: 'Security::Base',
  379. description: 'Activates lost password feature for users.',
  380. options: {
  381. form: [
  382. {
  383. display: '',
  384. null: true,
  385. name: 'user_lost_password',
  386. tag: 'boolean',
  387. options: {
  388. true => 'yes',
  389. false => 'no',
  390. },
  391. },
  392. ],
  393. },
  394. state: true,
  395. frontend: true
  396. )
  397. Setting.create_if_not_exists(
  398. title: 'Authentication via LDAP',
  399. name: 'auth_ldap',
  400. area: 'Security::Authentication',
  401. description: 'Enables user authentication via LDAP.',
  402. state: {
  403. adapter: 'Auth::Ldap',
  404. host: 'localhost',
  405. port: 389,
  406. bind_dn: 'cn=Manager,dc=example,dc=org',
  407. bind_pw: 'example',
  408. uid: 'mail',
  409. base: 'dc=example,dc=org',
  410. always_filter: '',
  411. always_roles: %w(Admin Agent),
  412. always_groups: ['Users'],
  413. sync_params: {
  414. firstname: 'sn',
  415. lastname: 'givenName',
  416. email: 'mail',
  417. login: 'mail',
  418. },
  419. },
  420. frontend: false
  421. )
  422. Setting.create_if_not_exists(
  423. title: 'Authentication via Twitter',
  424. name: 'auth_twitter',
  425. area: 'Security::ThirdPartyAuthentication',
  426. description: "@T('Enables user authentication via twitter. Register your app first at [Twitter Developer Site](https://dev.twitter.com/apps)')",
  427. options: {
  428. form: [
  429. {
  430. display: '',
  431. null: true,
  432. name: 'auth_twitter',
  433. tag: 'boolean',
  434. options: {
  435. true => 'yes',
  436. false => 'no',
  437. },
  438. },
  439. ],
  440. },
  441. state: false,
  442. frontend: true
  443. )
  444. Setting.create_if_not_exists(
  445. title: 'Twitter App Credentials',
  446. name: 'auth_twitter_credentials',
  447. area: 'Security::ThirdPartyAuthentication',
  448. description: 'App credentials for Twitter.',
  449. options: {
  450. form: [
  451. {
  452. display: 'Twitter Key',
  453. null: true,
  454. name: 'key',
  455. tag: 'input',
  456. },
  457. {
  458. display: 'Twitter Secret',
  459. null: true,
  460. name: 'secret',
  461. tag: 'input',
  462. },
  463. ],
  464. },
  465. state: {},
  466. frontend: false
  467. )
  468. Setting.create_if_not_exists(
  469. title: 'Authentication via Facebook',
  470. name: 'auth_facebook',
  471. area: 'Security::ThirdPartyAuthentication',
  472. description: "@T('Enables user authentication via Facebook. Register your app first at [Facebook Developer Site](https://developers.facebook.com/apps/)')",
  473. options: {
  474. form: [
  475. {
  476. display: '',
  477. null: true,
  478. name: 'auth_facebook',
  479. tag: 'boolean',
  480. options: {
  481. true => 'yes',
  482. false => 'no',
  483. },
  484. },
  485. ],
  486. },
  487. state: false,
  488. frontend: true
  489. )
  490. Setting.create_if_not_exists(
  491. title: 'Facebook App Credentials',
  492. name: 'auth_facebook_credentials',
  493. area: 'Security::ThirdPartyAuthentication',
  494. description: 'App credentials for Facebook.',
  495. options: {
  496. form: [
  497. {
  498. display: 'App ID',
  499. null: true,
  500. name: 'app_id',
  501. tag: 'input',
  502. },
  503. {
  504. display: 'App Secret',
  505. null: true,
  506. name: 'app_secret',
  507. tag: 'input',
  508. },
  509. ],
  510. },
  511. state: {},
  512. frontend: false
  513. )
  514. Setting.create_if_not_exists(
  515. title: 'Authentication via Google',
  516. name: 'auth_google_oauth2',
  517. area: 'Security::ThirdPartyAuthentication',
  518. description: 'Enables user authentication via Google.',
  519. options: {
  520. form: [
  521. {
  522. display: '',
  523. null: true,
  524. name: 'auth_google_oauth2',
  525. tag: 'boolean',
  526. options: {
  527. true => 'yes',
  528. false => 'no',
  529. },
  530. },
  531. ],
  532. },
  533. state: false,
  534. frontend: true
  535. )
  536. Setting.create_if_not_exists(
  537. title: 'Google App Credentials',
  538. name: 'auth_google_oauth2_credentials',
  539. area: 'Security::ThirdPartyAuthentication',
  540. description: 'Enables user authentication via Google.',
  541. options: {
  542. form: [
  543. {
  544. display: 'Client ID',
  545. null: true,
  546. name: 'client_id',
  547. tag: 'input',
  548. },
  549. {
  550. display: 'Client Secret',
  551. null: true,
  552. name: 'client_secret',
  553. tag: 'input',
  554. },
  555. ],
  556. },
  557. state: {},
  558. frontend: false
  559. )
  560. Setting.create_if_not_exists(
  561. title: 'Authentication via LinkedIn',
  562. name: 'auth_linkedin',
  563. area: 'Security::ThirdPartyAuthentication',
  564. description: 'Enables user authentication via LinkedIn.',
  565. options: {
  566. form: [
  567. {
  568. display: '',
  569. null: true,
  570. name: 'auth_linkedin',
  571. tag: 'boolean',
  572. options: {
  573. true => 'yes',
  574. false => 'no',
  575. },
  576. },
  577. ],
  578. },
  579. state: false,
  580. frontend: true
  581. )
  582. Setting.create_if_not_exists(
  583. title: 'LinkedIn App Credentials',
  584. name: 'auth_linkedin_credentials',
  585. area: 'Security::ThirdPartyAuthentication',
  586. description: 'Enables user authentication via LinkedIn.',
  587. options: {
  588. form: [
  589. {
  590. display: 'App ID',
  591. null: true,
  592. name: 'app_id',
  593. tag: 'input',
  594. },
  595. {
  596. display: 'App Secret',
  597. null: true,
  598. name: 'app_secret',
  599. tag: 'input',
  600. },
  601. ],
  602. },
  603. state: {},
  604. frontend: false
  605. )
  606. Setting.create_if_not_exists(
  607. title: 'Minimal size',
  608. name: 'password_min_size',
  609. area: 'Security::Password',
  610. description: 'Password need to have at least minimal size of characters.',
  611. options: {
  612. form: [
  613. {
  614. display: '',
  615. null: true,
  616. name: 'password_min_size',
  617. tag: 'select',
  618. options: {
  619. 4 => ' 4',
  620. 5 => ' 5',
  621. 6 => ' 6',
  622. 7 => ' 7',
  623. 8 => ' 8',
  624. 9 => ' 9',
  625. 10 => '10',
  626. 11 => '11',
  627. 12 => '12',
  628. 13 => '13',
  629. 14 => '14',
  630. 15 => '15',
  631. 16 => '16',
  632. 17 => '17',
  633. 18 => '18',
  634. 19 => '19',
  635. 20 => '20',
  636. },
  637. },
  638. ],
  639. },
  640. state: 6,
  641. frontend: true
  642. )
  643. Setting.create_if_not_exists(
  644. title: '2 lower and 2 upper characters',
  645. name: 'password_min_2_lower_2_upper_characters',
  646. area: 'Security::Password',
  647. description: 'Password need to contain 2 lower and 2 upper characters.',
  648. options: {
  649. form: [
  650. {
  651. display: '',
  652. null: true,
  653. name: 'password_min_2_lower_2_upper_characters',
  654. tag: 'select',
  655. options: {
  656. 1 => 'yes',
  657. 0 => 'no',
  658. },
  659. },
  660. ],
  661. },
  662. state: 0,
  663. frontend: true
  664. )
  665. Setting.create_if_not_exists(
  666. title: 'Digit required',
  667. name: 'password_need_digit',
  668. area: 'Security::Password',
  669. description: 'Password need to have at least one digit.',
  670. options: {
  671. form: [
  672. {
  673. display: 'Needed',
  674. null: true,
  675. name: 'password_need_digit',
  676. tag: 'select',
  677. options: {
  678. 1 => 'yes',
  679. 0 => 'no',
  680. },
  681. },
  682. ],
  683. },
  684. state: 1,
  685. frontend: true
  686. )
  687. Setting.create_if_not_exists(
  688. title: 'Maximal failed logins',
  689. name: 'password_max_login_failed',
  690. area: 'Security::Password',
  691. description: 'Maximal failed logins after account is inactive.',
  692. options: {
  693. form: [
  694. {
  695. display: '',
  696. null: true,
  697. name: 'password_max_login_failed',
  698. tag: 'select',
  699. options: {
  700. 4 => ' 4',
  701. 5 => ' 5',
  702. 6 => ' 6',
  703. 7 => ' 7',
  704. 8 => ' 8',
  705. 9 => ' 9',
  706. 10 => '10',
  707. 11 => '11',
  708. 13 => '13',
  709. 14 => '14',
  710. 15 => '15',
  711. 16 => '16',
  712. 17 => '17',
  713. 18 => '18',
  714. 19 => '19',
  715. 20 => '20',
  716. },
  717. },
  718. ],
  719. },
  720. state: 10,
  721. frontend: true
  722. )
  723. Setting.create_if_not_exists(
  724. title: 'Ticket Hook',
  725. name: 'ticket_hook',
  726. area: 'Ticket::Base',
  727. description: 'The identifier for a ticket, e.g. Ticket#, Call#, MyTicket#. The default is Ticket#.',
  728. options: {
  729. form: [
  730. {
  731. display: '',
  732. null: false,
  733. name: 'ticket_hook',
  734. tag: 'input',
  735. },
  736. ],
  737. },
  738. preferences: { render: true },
  739. state: 'Ticket#',
  740. frontend: true
  741. )
  742. Setting.create_if_not_exists(
  743. title: 'Ticket Hook Divider',
  744. name: 'ticket_hook_divider',
  745. area: 'Ticket::Base::Shadow',
  746. description: 'The divider between TicketHook and ticket number. E.g \': \'.',
  747. options: {
  748. form: [
  749. {
  750. display: '',
  751. null: true,
  752. name: 'ticket_hook_divider',
  753. tag: 'input',
  754. },
  755. ],
  756. },
  757. state: '',
  758. frontend: false
  759. )
  760. Setting.create_if_not_exists(
  761. title: 'Ticket Hook Position',
  762. name: 'ticket_hook_position',
  763. area: 'Ticket::Base',
  764. description: "@T('The format of the subject.')
  765. * @T('**Right** means **Some Subject [Ticket#12345]**')
  766. * @T('**Left** means **[Ticket#12345] Some Subject**')
  767. * @T('**None** means **Some Subject** (without ticket number). In the last case you should enable *postmaster_follow_up_search_in* to recognize followups based on email headers and/or body.')",
  768. options: {
  769. form: [
  770. {
  771. display: '',
  772. null: true,
  773. name: 'ticket_hook_position',
  774. tag: 'select',
  775. options: {
  776. 'left' => 'left',
  777. 'right' => 'right',
  778. 'none' => 'none',
  779. },
  780. },
  781. ],
  782. },
  783. state: 'right',
  784. frontend: false
  785. )
  786. Setting.create_if_not_exists(
  787. title: 'Ticket Subject Size',
  788. name: 'ticket_subject_size',
  789. area: 'Ticket::Base',
  790. description: 'Max size of the subjects in an email reply.',
  791. options: {
  792. form: [
  793. {
  794. display: '',
  795. null: false,
  796. name: 'ticket_subject_size',
  797. tag: 'input',
  798. },
  799. ],
  800. },
  801. state: '110',
  802. frontend: false
  803. )
  804. Setting.create_if_not_exists(
  805. title: 'Ticket Subject Reply',
  806. name: 'ticket_subject_re',
  807. area: 'Ticket::Base',
  808. description: 'The text at the beginning of the subject in an email reply, e.g. RE, AW, or AS.',
  809. options: {
  810. form: [
  811. {
  812. display: '',
  813. null: true,
  814. name: 'ticket_subject_re',
  815. tag: 'input',
  816. },
  817. ],
  818. },
  819. state: 'RE',
  820. frontend: false
  821. )
  822. Setting.create_if_not_exists(
  823. title: 'Ticket Number Format',
  824. name: 'ticket_number',
  825. area: 'Ticket::Number',
  826. description: "@T('Selects the ticket number generator module.')
  827. * @T('**Increment** increments the ticket number, the SystemID and the counter are used with SystemID.Counter format (e.g. 1010138, 1010139).')
  828. * @T('With **Date** the ticket numbers will be generated by the current date, the SystemID and the counter. The format looks like Year.Month.Day.SystemID.counter (e.g. 201206231010138, 201206231010139).')
  829. @T('With param 'Checksum => true' the counter will be appended as checksum to the string. The format looks like SystemID.Counter.CheckSum (e. g. 10101384, 10101392) or Year.Month.Day.SystemID.Counter.CheckSum (e.g. 2012070110101520, 2012070110101535).')",
  830. options: {
  831. form: [
  832. {
  833. display: '',
  834. null: true,
  835. name: 'ticket_number',
  836. tag: 'select',
  837. options: {
  838. 'Ticket::Number::Increment' => 'Increment (SystemID.Counter)',
  839. 'Ticket::Number::Date' => 'Date (Year.Month.Day.SystemID.Counter)',
  840. },
  841. },
  842. ],
  843. },
  844. state: 'Ticket::Number::Increment',
  845. frontend: false
  846. )
  847. Setting.create_if_not_exists(
  848. title: 'Ticket Number Increment',
  849. name: 'ticket_number_increment',
  850. area: 'Ticket::Number',
  851. description: '-',
  852. options: {
  853. form: [
  854. {
  855. display: 'Checksum',
  856. null: true,
  857. name: 'checksum',
  858. tag: 'boolean',
  859. options: {
  860. true => 'yes',
  861. false => 'no',
  862. },
  863. },
  864. {
  865. display: 'Min. size of number',
  866. null: true,
  867. name: 'min_size',
  868. tag: 'select',
  869. options: {
  870. 1 => ' 1',
  871. 2 => ' 2',
  872. 3 => ' 3',
  873. 4 => ' 4',
  874. 5 => ' 5',
  875. 6 => ' 6',
  876. 7 => ' 7',
  877. 8 => ' 8',
  878. 9 => ' 9',
  879. 10 => '10',
  880. 11 => '11',
  881. 12 => '12',
  882. 13 => '13',
  883. 14 => '14',
  884. 15 => '15',
  885. 16 => '16',
  886. 17 => '17',
  887. 18 => '18',
  888. 19 => '19',
  889. 20 => '20',
  890. },
  891. },
  892. ],
  893. },
  894. state: {
  895. checksum: false,
  896. min_size: 5,
  897. },
  898. frontend: false
  899. )
  900. Setting.create_if_not_exists(
  901. title: 'Ticket Number Increment Date',
  902. name: 'ticket_number_date',
  903. area: 'Ticket::Number',
  904. description: '-',
  905. options: {
  906. form: [
  907. {
  908. display: 'Checksum',
  909. null: true,
  910. name: 'checksum',
  911. tag: 'boolean',
  912. options: {
  913. true => 'yes',
  914. false => 'no',
  915. },
  916. },
  917. ],
  918. },
  919. state: {
  920. checksum: false,
  921. },
  922. frontend: false
  923. )
  924. Setting.create_if_not_exists(
  925. title: 'Enable Ticket creation',
  926. name: 'customer_ticket_create',
  927. area: 'CustomerWeb::Base',
  928. description: 'Defines if a customer can create tickets via the web interface.',
  929. options: {
  930. form: [
  931. {
  932. display: '',
  933. null: true,
  934. name: 'customer_ticket_create',
  935. tag: 'boolean',
  936. options: {
  937. true => 'yes',
  938. false => 'no',
  939. },
  940. },
  941. ],
  942. },
  943. state: true,
  944. frontend: true
  945. )
  946. Setting.create_if_not_exists(
  947. title: 'Group selection for Ticket creation',
  948. name: 'customer_ticket_create_group_ids',
  949. area: 'CustomerWeb::Base',
  950. description: 'Defines groups where customer can create tickets via web interface. "-" means all groups are available.',
  951. options: {
  952. form: [
  953. {
  954. display: '',
  955. null: true,
  956. name: 'group_ids',
  957. tag: 'select',
  958. multiple: true,
  959. nulloption: true,
  960. relation: 'Group',
  961. },
  962. ],
  963. },
  964. state: '',
  965. frontend: true
  966. )
  967. Setting.create_if_not_exists(
  968. title: 'Enable Ticket View/Update',
  969. name: 'customer_ticket_view',
  970. area: 'CustomerWeb::Base',
  971. description: 'Defines if a customer view and update his own tickets.',
  972. options: {
  973. form: [
  974. {
  975. display: '',
  976. null: true,
  977. name: 'customer_ticket_view',
  978. tag: 'boolean',
  979. options: {
  980. true => 'yes',
  981. false => 'no',
  982. },
  983. },
  984. ],
  985. },
  986. state: true,
  987. frontend: true
  988. )
  989. Setting.create_if_not_exists(
  990. title: 'Enable Ticket creation',
  991. name: 'form_ticket_create',
  992. area: 'Form::Base',
  993. description: 'Defines if ticket can get created via web form.',
  994. options: {
  995. form: [
  996. {
  997. display: '',
  998. null: true,
  999. name: 'form_ticket_create',
  1000. tag: 'boolean',
  1001. options: {
  1002. true => 'yes',
  1003. false => 'no',
  1004. },
  1005. },
  1006. ],
  1007. },
  1008. state: false,
  1009. frontend: false,
  1010. )
  1011. Setting.create_if_not_exists(
  1012. title: 'Sender Format',
  1013. name: 'ticket_define_email_from',
  1014. area: 'Email::Base',
  1015. description: 'Defines how the From field from the emails (sent from answers and email tickets) should look like.',
  1016. options: {
  1017. form: [
  1018. {
  1019. display: '',
  1020. null: true,
  1021. name: 'ticket_define_email_from',
  1022. tag: 'select',
  1023. options: {
  1024. SystemAddressName: 'System Address Display Name',
  1025. AgentNameSystemAddressName: 'Agent Name + FromSeparator + System Address Display Name',
  1026. },
  1027. },
  1028. ],
  1029. },
  1030. state: 'AgentNameSystemAddressName',
  1031. frontend: false
  1032. )
  1033. Setting.create_if_not_exists(
  1034. title: 'Sender Format Seperator',
  1035. name: 'ticket_define_email_from_seperator',
  1036. area: 'Email::Base',
  1037. description: 'Defines the separator between the agents real name and the given group email address.',
  1038. options: {
  1039. form: [
  1040. {
  1041. display: '',
  1042. null: false,
  1043. name: 'ticket_define_email_from_seperator',
  1044. tag: 'input',
  1045. },
  1046. ],
  1047. },
  1048. state: 'via',
  1049. frontend: false
  1050. )
  1051. Setting.create_if_not_exists(
  1052. title: 'Max. Email Size',
  1053. name: 'postmaster_max_size',
  1054. area: 'Email::Base',
  1055. description: 'Maximal size in MB of emails.',
  1056. options: {
  1057. form: [
  1058. {
  1059. display: '',
  1060. null: true,
  1061. name: 'postmaster_max_size',
  1062. tag: 'select',
  1063. options: {
  1064. 1 => ' 1',
  1065. 2 => ' 2',
  1066. 3 => ' 3',
  1067. 4 => ' 4',
  1068. 5 => ' 5',
  1069. 6 => ' 6',
  1070. 7 => ' 7',
  1071. 8 => ' 8',
  1072. 9 => ' 9',
  1073. 10 => ' 10',
  1074. 15 => ' 15',
  1075. 20 => ' 20',
  1076. 25 => ' 25',
  1077. 30 => ' 30',
  1078. 35 => ' 35',
  1079. 40 => ' 40',
  1080. 45 => ' 45',
  1081. 50 => ' 50',
  1082. 60 => ' 60',
  1083. 70 => ' 70',
  1084. 80 => ' 80',
  1085. 90 => ' 90',
  1086. 100 => '100',
  1087. 125 => '125',
  1088. 150 => '150',
  1089. },
  1090. },
  1091. ],
  1092. },
  1093. state: 10,
  1094. preferences: { online_service_disable: true },
  1095. frontend: false
  1096. )
  1097. Setting.create_if_not_exists(
  1098. title: 'Additional follow up detection',
  1099. name: 'postmaster_follow_up_search_in',
  1100. area: 'Email::Base',
  1101. description: 'In default the follow up check is done via the subject of an email. With this setting you can add more fields where the follow up ckeck is executed.',
  1102. options: {
  1103. form: [
  1104. {
  1105. display: '',
  1106. null: true,
  1107. name: 'postmaster_follow_up_search_in',
  1108. tag: 'checkbox',
  1109. options: {
  1110. 'references' => 'References - Search for follow up also in In-Reply-To or References headers.',
  1111. 'body' => 'Body - Search for follow up also in mail body.',
  1112. 'attachment' => 'Attachment - Search for follow up also in attachments.',
  1113. },
  1114. },
  1115. ],
  1116. },
  1117. state: [],
  1118. frontend: false
  1119. )
  1120. Setting.create_if_not_exists(
  1121. title: 'Notification Sender',
  1122. name: 'notification_sender',
  1123. area: 'Email::Base',
  1124. description: 'Defines the sender of email notifications.',
  1125. options: {
  1126. form: [
  1127. {
  1128. display: '',
  1129. null: false,
  1130. name: 'notification_sender',
  1131. tag: 'input',
  1132. },
  1133. ],
  1134. },
  1135. state: 'Notification Master <noreply@#{config.fqdn}>',
  1136. preferences: { online_service_disable: true },
  1137. frontend: false
  1138. )
  1139. Setting.create_if_not_exists(
  1140. title: 'Block Notifications',
  1141. name: 'send_no_auto_response_reg_exp',
  1142. area: 'Email::Base',
  1143. description: 'If this regex matches, no notification will be send by the sender.',
  1144. options: {
  1145. form: [
  1146. {
  1147. display: '',
  1148. null: false,
  1149. name: 'send_no_auto_response_reg_exp',
  1150. tag: 'input',
  1151. },
  1152. ],
  1153. },
  1154. state: '(MAILER-DAEMON|postmaster|abuse)@.+?\..+?',
  1155. preferences: { online_service_disable: true },
  1156. frontend: false
  1157. )
  1158. Setting.create_if_not_exists(
  1159. title: 'Enable Chat',
  1160. name: 'chat',
  1161. area: 'Chat::Base',
  1162. description: 'Enable/Disable online chat.',
  1163. options: {
  1164. form: [
  1165. {
  1166. display: '',
  1167. null: true,
  1168. name: 'chat',
  1169. tag: 'boolean',
  1170. options: {
  1171. true => 'yes',
  1172. false => 'no',
  1173. },
  1174. },
  1175. ],
  1176. },
  1177. preferences: { render: true },
  1178. state: false,
  1179. frontend: true
  1180. )
  1181. Setting.create_if_not_exists(
  1182. title: 'Agent idle timeout',
  1183. name: 'chat_agent_idle_timeout',
  1184. area: 'Chat::Extended',
  1185. description: 'Idle timeout in seconds till agent is set offline automatically.',
  1186. options: {
  1187. form: [
  1188. {
  1189. display: '',
  1190. null: false,
  1191. name: 'chat_agent_idle_timeout',
  1192. tag: 'input',
  1193. },
  1194. ],
  1195. },
  1196. preferences: {},
  1197. state: '120',
  1198. frontend: true
  1199. )
  1200. Setting.create_if_not_exists(
  1201. title: 'Define searchable models.',
  1202. name: 'models_searchable',
  1203. area: 'Models::Base',
  1204. description: 'Define the models which can be searched for.',
  1205. options: {},
  1206. state: [],
  1207. frontend: false,
  1208. )
  1209. Setting.create_if_not_exists(
  1210. title: 'Default Screen',
  1211. name: 'default_controller',
  1212. area: 'Core',
  1213. description: 'Defines the default controller.',
  1214. options: {},
  1215. state: '#dashboard',
  1216. frontend: true
  1217. )
  1218. Setting.create_if_not_exists(
  1219. title: 'Elasticsearch Endpoint URL',
  1220. name: 'es_url',
  1221. area: 'SearchIndex::Elasticsearch',
  1222. description: 'Define endpoint of Elastic Search.',
  1223. state: '',
  1224. preferences: { online_service_disable: true },
  1225. frontend: false
  1226. )
  1227. Setting.create_if_not_exists(
  1228. title: 'Elasticsearch Endpoint User',
  1229. name: 'es_user',
  1230. area: 'SearchIndex::Elasticsearch',
  1231. description: 'Define http basic auth user of Elasticsearch.',
  1232. state: '',
  1233. preferences: { online_service_disable: true },
  1234. frontend: false
  1235. )
  1236. Setting.create_if_not_exists(
  1237. title: 'Elastic Search Endpoint Password',
  1238. name: 'es_password',
  1239. area: 'SearchIndex::Elasticsearch',
  1240. description: 'Define http basic auth password of Elasticsearch.',
  1241. state: '',
  1242. preferences: { online_service_disable: true },
  1243. frontend: false
  1244. )
  1245. Setting.create_if_not_exists(
  1246. title: 'Elastic Search Endpoint Index',
  1247. name: 'es_index',
  1248. area: 'SearchIndex::Elasticsearch',
  1249. description: 'Define Elasticsearch index name.',
  1250. state: 'zammad',
  1251. preferences: { online_service_disable: true },
  1252. frontend: false
  1253. )
  1254. Setting.create_if_not_exists(
  1255. title: 'Elastic Search Attachment Extentions',
  1256. name: 'es_attachment_ignore',
  1257. area: 'SearchIndex::Elasticsearch',
  1258. description: 'Define attachment extentions which are ignored for Elasticsearch.',
  1259. state: [ '.png', '.jpg', '.jpeg', '.mpeg', '.mpg', '.mov', '.bin', '.exe', '.box', '.mbox' ],
  1260. preferences: { online_service_disable: true },
  1261. frontend: false
  1262. )
  1263. Setting.create_if_not_exists(
  1264. title: 'Elastic Search Attachment Size',
  1265. name: 'es_attachment_max_size_in_mb',
  1266. area: 'SearchIndex::Elasticsearch',
  1267. description: 'Define max. attachment size for Elasticsearch.',
  1268. state: 50,
  1269. preferences: { online_service_disable: true },
  1270. frontend: false
  1271. )
  1272. Setting.create_if_not_exists(
  1273. title: 'Import Mode',
  1274. name: 'import_mode',
  1275. area: 'Import::Base',
  1276. description: 'Set system in import mode (disable some triggers).',
  1277. options: {
  1278. form: [
  1279. {
  1280. display: '',
  1281. null: true,
  1282. name: 'import_mode',
  1283. tag: 'boolean',
  1284. options: {
  1285. true => 'yes',
  1286. false => 'no',
  1287. },
  1288. },
  1289. ],
  1290. },
  1291. state: false,
  1292. frontend: true
  1293. )
  1294. Setting.create_if_not_exists(
  1295. title: 'Import Backend',
  1296. name: 'import_backend',
  1297. area: 'Import::Base::Internal',
  1298. description: 'Set backend which is used for import.',
  1299. options: {},
  1300. state: '',
  1301. frontend: true
  1302. )
  1303. Setting.create_if_not_exists(
  1304. title: 'Ignore Escalation/SLA Information',
  1305. name: 'import_ignore_sla',
  1306. area: 'Import::Base',
  1307. description: 'Ignore Escalation/SLA Information form import system.',
  1308. options: {
  1309. form: [
  1310. {
  1311. display: '',
  1312. null: true,
  1313. name: 'import_ignore_sla',
  1314. tag: 'boolean',
  1315. options: {
  1316. true => 'yes',
  1317. false => 'no',
  1318. },
  1319. },
  1320. ],
  1321. },
  1322. state: false,
  1323. frontend: true
  1324. )
  1325. Setting.create_if_not_exists(
  1326. title: 'Import Endpoint',
  1327. name: 'import_otrs_endpoint',
  1328. area: 'Import::OTRS',
  1329. description: 'Defines OTRS endpoint to import users, ticket, states and articles.',
  1330. options: {
  1331. form: [
  1332. {
  1333. display: '',
  1334. null: false,
  1335. name: 'import_otrs_endpoint',
  1336. tag: 'input',
  1337. },
  1338. ],
  1339. },
  1340. state: 'http://otrs_host/otrs',
  1341. frontend: false
  1342. )
  1343. Setting.create_if_not_exists(
  1344. title: 'Import Key',
  1345. name: 'import_otrs_endpoint_key',
  1346. area: 'Import::OTRS',
  1347. description: 'Defines OTRS endpoint auth key.',
  1348. options: {
  1349. form: [
  1350. {
  1351. display: '',
  1352. null: false,
  1353. name: 'import_otrs_endpoint_key',
  1354. tag: 'input',
  1355. },
  1356. ],
  1357. },
  1358. state: '',
  1359. frontend: false
  1360. )
  1361. Setting.create_if_not_exists(
  1362. title: 'Import User for http basic authentication',
  1363. name: 'import_otrs_user',
  1364. area: 'Import::OTRS',
  1365. description: 'Defines http basic authentication user (only if OTRS is protected via http basic auth).',
  1366. options: {
  1367. form: [
  1368. {
  1369. display: '',
  1370. null: true,
  1371. name: 'import_otrs_user',
  1372. tag: 'input',
  1373. },
  1374. ],
  1375. },
  1376. state: '',
  1377. frontend: false
  1378. )
  1379. Setting.create_if_not_exists(
  1380. title: 'Import Password for http basic authentication',
  1381. name: 'import_otrs_password',
  1382. area: 'Import::OTRS',
  1383. description: 'Defines http basic authentication password (only if OTRS is protected via http basic auth).',
  1384. options: {
  1385. form: [
  1386. {
  1387. display: '',
  1388. null: true,
  1389. name: 'import_otrs_password',
  1390. tag: 'input',
  1391. },
  1392. ],
  1393. },
  1394. state: '',
  1395. frontend: false
  1396. )
  1397. Setting.create_if_not_exists(
  1398. title: 'Import Endpoint',
  1399. name: 'import_zendesk_endpoint',
  1400. area: 'Import::Zendesk',
  1401. description: 'Defines Zendesk endpoint to import users, ticket, states and articles.',
  1402. options: {
  1403. form: [
  1404. {
  1405. display: '',
  1406. null: false,
  1407. name: 'import_zendesk_endpoint',
  1408. tag: 'input',
  1409. },
  1410. ],
  1411. },
  1412. state: 'https://yours.zendesk.com/api/v2',
  1413. frontend: false
  1414. )
  1415. Setting.create_if_not_exists(
  1416. title: 'Import Key for requesting the Zendesk API',
  1417. name: 'import_zendesk_endpoint_key',
  1418. area: 'Import::Zendesk',
  1419. description: 'Defines Zendesk endpoint auth key.',
  1420. options: {
  1421. form: [
  1422. {
  1423. display: '',
  1424. null: false,
  1425. name: 'import_zendesk_endpoint_key',
  1426. tag: 'input',
  1427. },
  1428. ],
  1429. },
  1430. state: '',
  1431. frontend: false
  1432. )
  1433. Setting.create_if_not_exists(
  1434. title: 'Import User for requesting the Zendesk API',
  1435. name: 'import_zendesk_endpoint_username',
  1436. area: 'Import::Zendesk',
  1437. description: 'Defines Zendesk endpoint auth key.',
  1438. options: {
  1439. form: [
  1440. {
  1441. display: '',
  1442. null: true,
  1443. name: 'import_zendesk_endpoint_username',
  1444. tag: 'input',
  1445. },
  1446. ],
  1447. },
  1448. state: '',
  1449. frontend: false
  1450. )
  1451. Setting.create_if_not_exists(
  1452. title: 'Default calendar Tickets subscriptions',
  1453. name: 'defaults_calendar_subscriptions_tickets',
  1454. area: 'Defaults::CalendarSubscriptions',
  1455. description: 'Defines the default calendar Tickets subscription settings.',
  1456. options: {},
  1457. state: {
  1458. escalation: {
  1459. own: true,
  1460. not_assigned: false,
  1461. },
  1462. new_open: {
  1463. own: true,
  1464. not_assigned: false,
  1465. },
  1466. pending: {
  1467. own: true,
  1468. not_assigned: false,
  1469. }
  1470. },
  1471. frontend: true
  1472. )
  1473. Setting.create_if_not_exists(
  1474. title: 'Define translator identifier.',
  1475. name: 'translator_key',
  1476. area: 'i18n::translator_key',
  1477. description: 'Defines the translator identifier for contributions.',
  1478. options: {},
  1479. state: '',
  1480. frontend: false
  1481. )
  1482. signature = Signature.create_if_not_exists(
  1483. id: 1,
  1484. name: 'default',
  1485. body: '
  1486. #{user.firstname} #{user.lastname}
  1487. --
  1488. Super Support - Waterford Business Park
  1489. 5201 Blue Lagoon Drive - 8th Floor & 9th Floor - Miami, 33126 USA
  1490. Email: hot@example.com - Web: http://www.example.com/
  1491. --'.text2html,
  1492. updated_by_id: 1,
  1493. created_by_id: 1
  1494. )
  1495. Role.create_if_not_exists(
  1496. id: 1,
  1497. name: 'Admin',
  1498. note: 'To configure your system.',
  1499. updated_by_id: 1,
  1500. created_by_id: 1
  1501. )
  1502. Role.create_if_not_exists(
  1503. id: 2,
  1504. name: 'Agent',
  1505. note: 'To work on Tickets.',
  1506. updated_by_id: 1,
  1507. created_by_id: 1
  1508. )
  1509. Role.create_if_not_exists(
  1510. id: 3,
  1511. name: 'Customer',
  1512. note: 'People who create Tickets ask for help.',
  1513. updated_by_id: 1,
  1514. created_by_id: 1
  1515. )
  1516. Role.create_if_not_exists(
  1517. id: 4,
  1518. name: 'Report',
  1519. note: 'Access the report area.',
  1520. created_by_id: 1,
  1521. updated_by_id: 1,
  1522. )
  1523. Role.create_if_not_exists(
  1524. id: 5,
  1525. name: 'Chat',
  1526. note: 'Access to chat feature.',
  1527. updated_by_id: 1,
  1528. created_by_id: 1
  1529. )
  1530. Group.create_if_not_exists(
  1531. id: 1,
  1532. name: 'Users',
  1533. signature_id: signature.id,
  1534. note: 'Standard Group/Pool for Tickets.',
  1535. updated_by_id: 1,
  1536. created_by_id: 1
  1537. )
  1538. user = User.create_if_not_exists(
  1539. id: 1,
  1540. login: '-',
  1541. firstname: '-',
  1542. lastname: '',
  1543. email: '',
  1544. password: 'root',
  1545. active: false,
  1546. updated_by_id: 1,
  1547. created_by_id: 1
  1548. )
  1549. UserInfo.current_user_id = 1
  1550. roles = Role.find_by(name: 'Customer')
  1551. organizations = Organization.all
  1552. groups = Group.all
  1553. org_community = Organization.create_if_not_exists(
  1554. id: 1,
  1555. name: 'Zammad Foundation',
  1556. )
  1557. user_community = User.create_or_update(
  1558. id: 2,
  1559. login: 'nicole.braun@zammad.org',
  1560. firstname: 'Nicole',
  1561. lastname: 'Braun',
  1562. email: 'nicole.braun@zammad.org',
  1563. password: '',
  1564. active: true,
  1565. roles: [roles],
  1566. organization_id: org_community.id,
  1567. )
  1568. Link::Type.create_if_not_exists(id: 1, name: 'normal')
  1569. Link::Object.create_if_not_exists(id: 1, name: 'Ticket')
  1570. Link::Object.create_if_not_exists(id: 2, name: 'Announcement')
  1571. Link::Object.create_if_not_exists(id: 3, name: 'Question/Answer')
  1572. Link::Object.create_if_not_exists(id: 4, name: 'Idea')
  1573. Link::Object.create_if_not_exists(id: 5, name: 'Bug')
  1574. Ticket::StateType.create_if_not_exists(id: 1, name: 'new')
  1575. Ticket::StateType.create_if_not_exists(id: 2, name: 'open')
  1576. Ticket::StateType.create_if_not_exists(id: 3, name: 'pending reminder')
  1577. Ticket::StateType.create_if_not_exists(id: 4, name: 'pending action')
  1578. Ticket::StateType.create_if_not_exists(id: 5, name: 'closed')
  1579. Ticket::StateType.create_if_not_exists(id: 6, name: 'merged')
  1580. Ticket::StateType.create_if_not_exists(id: 7, name: 'removed')
  1581. Ticket::State.create_if_not_exists(id: 1, name: 'new', state_type_id: Ticket::StateType.find_by(name: 'new').id)
  1582. Ticket::State.create_if_not_exists(id: 2, name: 'open', state_type_id: Ticket::StateType.find_by(name: 'open').id)
  1583. Ticket::State.create_if_not_exists(id: 3, name: 'pending reminder', state_type_id: Ticket::StateType.find_by(name: 'pending reminder').id, ignore_escalation: true)
  1584. Ticket::State.create_if_not_exists(id: 4, name: 'closed', state_type_id: Ticket::StateType.find_by(name: 'closed').id, ignore_escalation: true)
  1585. Ticket::State.create_if_not_exists(id: 5, name: 'merged', state_type_id: Ticket::StateType.find_by(name: 'merged').id, ignore_escalation: true)
  1586. Ticket::State.create_if_not_exists(id: 6, name: 'removed', state_type_id: Ticket::StateType.find_by(name: 'removed').id, active: false, ignore_escalation: true)
  1587. Ticket::State.create_if_not_exists(id: 7, name: 'pending close', state_type_id: Ticket::StateType.find_by(name: 'pending action').id, next_state_id: 4, ignore_escalation: true)
  1588. Ticket::Priority.create_if_not_exists(id: 1, name: '1 low')
  1589. Ticket::Priority.create_if_not_exists(id: 2, name: '2 normal')
  1590. Ticket::Priority.create_if_not_exists(id: 3, name: '3 high')
  1591. Ticket::Article::Type.create_if_not_exists(id: 1, name: 'email', communication: true)
  1592. Ticket::Article::Type.create_if_not_exists(id: 2, name: 'sms', communication: true)
  1593. Ticket::Article::Type.create_if_not_exists(id: 3, name: 'chat', communication: true)
  1594. Ticket::Article::Type.create_if_not_exists(id: 4, name: 'fax', communication: true)
  1595. Ticket::Article::Type.create_if_not_exists(id: 5, name: 'phone', communication: true)
  1596. Ticket::Article::Type.create_if_not_exists(id: 6, name: 'twitter status', communication: true)
  1597. Ticket::Article::Type.create_if_not_exists(id: 7, name: 'twitter direct-message', communication: true)
  1598. Ticket::Article::Type.create_if_not_exists(id: 8, name: 'facebook feed post', communication: true)
  1599. Ticket::Article::Type.create_if_not_exists(id: 9, name: 'facebook feed comment', communication: true)
  1600. Ticket::Article::Type.create_if_not_exists(id: 10, name: 'note', communication: false)
  1601. Ticket::Article::Type.create_if_not_exists(id: 11, name: 'web', communication: true)
  1602. Ticket::Article::Sender.create_if_not_exists(id: 1, name: 'Agent')
  1603. Ticket::Article::Sender.create_if_not_exists(id: 2, name: 'Customer')
  1604. Ticket::Article::Sender.create_if_not_exists(id: 3, name: 'System')
  1605. Macro.create_if_not_exists(
  1606. name: 'Close & Tag as Spam',
  1607. perform: {
  1608. 'ticket.state_id' => {
  1609. value: Ticket::State.find_by(name: 'closed').id,
  1610. },
  1611. 'ticket.tags' => {
  1612. operator: 'add',
  1613. value: 'spam',
  1614. },
  1615. 'ticket.owner_id' => {
  1616. pre_condition: 'current_user.id',
  1617. value: '',
  1618. },
  1619. },
  1620. note: 'example macro',
  1621. active: true,
  1622. )
  1623. UserInfo.current_user_id = user_community.id
  1624. ticket = Ticket.create(
  1625. group_id: Group.find_by(name: 'Users').id,
  1626. customer_id: User.find_by(login: 'nicole.braun@zammad.org').id,
  1627. owner_id: User.find_by(login: '-').id,
  1628. title: 'Welcome to Zammad!',
  1629. state_id: Ticket::State.find_by(name: 'new').id,
  1630. priority_id: Ticket::Priority.find_by(name: '2 normal').id,
  1631. )
  1632. Ticket::Article.create(
  1633. ticket_id: ticket.id,
  1634. type_id: Ticket::Article::Type.find_by(name: 'phone').id,
  1635. sender_id: Ticket::Article::Sender.find_by(name: 'Customer').id,
  1636. from: 'Zammad Feedback <feedback@zammad.org>',
  1637. body: 'Welcome!
  1638. Thank you for choosing Zammad.
  1639. You will find updates and patches at http://zammad.org/. Online
  1640. documentation is available at http://guides.zammad.org/. You can also
  1641. use our forums at http://forums.zammad.org/
  1642. Regards,
  1643. The Zammad Project
  1644. ',
  1645. internal: false,
  1646. )
  1647. UserInfo.current_user_id = 1
  1648. overview_role = Role.find_by(name: 'Agent')
  1649. Overview.create_if_not_exists(
  1650. name: 'My assigned Tickets',
  1651. link: 'my_assigned',
  1652. prio: 1000,
  1653. role_id: overview_role.id,
  1654. condition: {
  1655. 'ticket.state_id' => {
  1656. operator: 'is',
  1657. value: [ 1, 2, 3, 7 ],
  1658. },
  1659. 'ticket.owner_id' => {
  1660. operator: 'is',
  1661. pre_condition: 'current_user.id',
  1662. },
  1663. },
  1664. order: {
  1665. by: 'created_at',
  1666. direction: 'ASC',
  1667. },
  1668. view: {
  1669. d: %w(title customer group created_at),
  1670. s: %w(title customer group created_at),
  1671. m: %w(number title customer group created_at),
  1672. view_mode_default: 's',
  1673. },
  1674. )
  1675. Overview.create_if_not_exists(
  1676. name: 'Unassigned & Open',
  1677. link: 'all_unassigned',
  1678. prio: 1010,
  1679. role_id: overview_role.id,
  1680. condition: {
  1681. 'ticket.state_id' => {
  1682. operator: 'is',
  1683. value: [1, 2, 3],
  1684. },
  1685. 'ticket.owner_id' => {
  1686. operator: 'is',
  1687. value: 1,
  1688. },
  1689. },
  1690. order: {
  1691. by: 'created_at',
  1692. direction: 'ASC',
  1693. },
  1694. view: {
  1695. d: %w(title customer group created_at),
  1696. s: %w(title customer group created_at),
  1697. m: %w(number title customer group created_at),
  1698. view_mode_default: 's',
  1699. },
  1700. )
  1701. Overview.create_if_not_exists(
  1702. name: 'My pending reached Tickets',
  1703. link: 'my_pending_reached',
  1704. prio: 1020,
  1705. role_id: overview_role.id,
  1706. condition: {
  1707. 'ticket.state_id' => {
  1708. operator: 'is',
  1709. value: 3,
  1710. },
  1711. 'ticket.owner_id' => {
  1712. operator: 'is',
  1713. pre_condition: 'current_user.id',
  1714. },
  1715. 'ticket.pending_time' => {
  1716. operator: 'within next (relative)',
  1717. value: 0,
  1718. range: 'minute',
  1719. },
  1720. },
  1721. order: {
  1722. by: 'created_at',
  1723. direction: 'ASC',
  1724. },
  1725. view: {
  1726. d: %w(title customer group created_at),
  1727. s: %w(title customer group created_at),
  1728. m: %w(number title customer group created_at),
  1729. view_mode_default: 's',
  1730. },
  1731. )
  1732. Overview.create_if_not_exists(
  1733. name: 'Open',
  1734. link: 'all_open',
  1735. prio: 1030,
  1736. role_id: overview_role.id,
  1737. condition: {
  1738. 'ticket.state_id' => {
  1739. operator: 'is',
  1740. value: [1, 2, 3],
  1741. },
  1742. },
  1743. order: {
  1744. by: 'created_at',
  1745. direction: 'ASC',
  1746. },
  1747. view: {
  1748. d: %w(title customer group state owner created_at),
  1749. s: %w(title customer group state owner created_at),
  1750. m: %w(number title customer group state owner created_at),
  1751. view_mode_default: 's',
  1752. },
  1753. )
  1754. Overview.create_if_not_exists(
  1755. name: 'Pending reached',
  1756. link: 'all_pending_reached',
  1757. prio: 1040,
  1758. role_id: overview_role.id,
  1759. condition: {
  1760. 'ticket.state_id' => {
  1761. operator: 'is',
  1762. value: [3],
  1763. },
  1764. 'ticket.pending_time' => {
  1765. operator: 'within next (relative)',
  1766. value: 0,
  1767. range: 'minute',
  1768. },
  1769. },
  1770. order: {
  1771. by: 'created_at',
  1772. direction: 'ASC',
  1773. },
  1774. view: {
  1775. d: %w(title customer group owner created_at),
  1776. s: %w(title customer group owner created_at),
  1777. m: %w(number title customer group owner created_at),
  1778. view_mode_default: 's',
  1779. },
  1780. )
  1781. Overview.create_if_not_exists(
  1782. name: 'Escalated',
  1783. link: 'all_escalated',
  1784. prio: 1050,
  1785. role_id: overview_role.id,
  1786. condition: {
  1787. 'ticket.escalation_time' => {
  1788. operator: 'within next (relative)',
  1789. value: '10',
  1790. range: 'minute',
  1791. },
  1792. },
  1793. order: {
  1794. by: 'escalation_time',
  1795. direction: 'ASC',
  1796. },
  1797. view: {
  1798. d: %w(title customer group owner escalation_time),
  1799. s: %w(title customer group owner escalation_time),
  1800. m: %w(number title customer group owner escalation_time),
  1801. view_mode_default: 's',
  1802. },
  1803. )
  1804. overview_role = Role.find_by(name: 'Customer')
  1805. Overview.create_if_not_exists(
  1806. name: 'My Tickets',
  1807. link: 'my_tickets',
  1808. prio: 1100,
  1809. role_id: overview_role.id,
  1810. condition: {
  1811. 'ticket.state_id' => {
  1812. operator: 'is',
  1813. value: [ 1, 2, 3, 4, 6, 7 ],
  1814. },
  1815. 'ticket.customer_id' => {
  1816. operator: 'is',
  1817. pre_condition: 'current_user.id',
  1818. },
  1819. },
  1820. order: {
  1821. by: 'created_at',
  1822. direction: 'DESC',
  1823. },
  1824. view: {
  1825. d: %w(title customer state created_at),
  1826. s: %w(number title state created_at),
  1827. m: %w(number title state created_at),
  1828. view_mode_default: 's',
  1829. },
  1830. )
  1831. Overview.create_if_not_exists(
  1832. name: 'My Organization Tickets',
  1833. link: 'my_organization_tickets',
  1834. prio: 1200,
  1835. role_id: overview_role.id,
  1836. organization_shared: true,
  1837. condition: {
  1838. 'ticket.state_id' => {
  1839. operator: 'is',
  1840. value: [ 1, 2, 3, 4, 6, 7 ],
  1841. },
  1842. 'ticket.organization_id' => {
  1843. operator: 'is',
  1844. pre_condition: 'current_user.organization_id',
  1845. },
  1846. },
  1847. order: {
  1848. by: 'created_at',
  1849. direction: 'DESC',
  1850. },
  1851. view: {
  1852. d: %w(title customer state created_at),
  1853. s: %w(number title customer state created_at),
  1854. m: %w(number title customer state created_at),
  1855. view_mode_default: 's',
  1856. },
  1857. )
  1858. Channel.create_if_not_exists(
  1859. area: 'Email::Notification',
  1860. options: {
  1861. outbound: {
  1862. adapter: 'smtp',
  1863. options: {
  1864. host: 'host.example.com',
  1865. user: '',
  1866. password: '',
  1867. ssl: true,
  1868. },
  1869. },
  1870. },
  1871. group_id: 1,
  1872. preferences: { online_service_disable: true },
  1873. active: false,
  1874. )
  1875. Channel.create_if_not_exists(
  1876. area: 'Email::Notification',
  1877. options: {
  1878. outbound: {
  1879. adapter: 'sendmail',
  1880. },
  1881. },
  1882. preferences: { online_service_disable: true },
  1883. active: true,
  1884. )
  1885. Report::Profile.create_if_not_exists(
  1886. name: '-all-',
  1887. condition: {},
  1888. active: true,
  1889. updated_by_id: 1,
  1890. created_by_id: 1,
  1891. )
  1892. chat = Chat.create_if_not_exists(
  1893. name: 'default',
  1894. max_queue: 5,
  1895. note: '',
  1896. active: true,
  1897. updated_by_id: 1,
  1898. created_by_id: 1,
  1899. )
  1900. network = Network.create_if_not_exists(
  1901. id: 1,
  1902. name: 'base',
  1903. )
  1904. Network::Category::Type.create_if_not_exists(
  1905. id: 1,
  1906. name: 'Announcement',
  1907. )
  1908. Network::Category::Type.create_if_not_exists(
  1909. id: 2,
  1910. name: 'Idea',
  1911. )
  1912. Network::Category::Type.create_if_not_exists(
  1913. id: 3,
  1914. name: 'Question',
  1915. )
  1916. Network::Category::Type.create_if_not_exists(
  1917. id: 4,
  1918. name: 'Bug Report',
  1919. )
  1920. Network::Privacy.create_if_not_exists(
  1921. id: 1,
  1922. name: 'logged in',
  1923. key: 'loggedIn',
  1924. )
  1925. Network::Privacy.create_if_not_exists(
  1926. id: 2,
  1927. name: 'logged in and moderator',
  1928. key: 'loggedInModerator',
  1929. )
  1930. Network::Category.create_if_not_exists(
  1931. id: 1,
  1932. name: 'Announcements',
  1933. network_id: network.id,
  1934. network_category_type_id: Network::Category::Type.find_by(name: 'Announcement').id,
  1935. network_privacy_id: Network::Privacy.find_by(name: 'logged in and moderator').id,
  1936. allow_comments: true,
  1937. )
  1938. Network::Category.create_if_not_exists(
  1939. id: 2,
  1940. name: 'Questions',
  1941. network_id: network.id,
  1942. allow_comments: true,
  1943. network_category_type_id: Network::Category::Type.find_by(name: 'Question').id,
  1944. network_privacy_id: Network::Privacy.find_by(name: 'logged in').id,
  1945. # network_categories_moderator_user_ids: User.find_by(:login => '-').id,
  1946. )
  1947. Network::Category.create_if_not_exists(
  1948. id: 3,
  1949. name: 'Ideas',
  1950. network_id: network.id,
  1951. network_category_type_id: Network::Category::Type.find_by(name: 'Idea').id,
  1952. network_privacy_id: Network::Privacy.find_by(name: 'logged in').id,
  1953. allow_comments: true,
  1954. )
  1955. Network::Category.create_if_not_exists(
  1956. id: 4,
  1957. name: 'Bug Reports',
  1958. network_id: network.id,
  1959. network_category_type_id: Network::Category::Type.find_by(name: 'Bug Report').id,
  1960. network_privacy_id: Network::Privacy.find_by(name: 'logged in').id,
  1961. allow_comments: true,
  1962. )
  1963. item = Network::Item.create(
  1964. title: 'Example Announcement',
  1965. body: 'Some announcement....',
  1966. network_category_id: Network::Category.find_by(name: 'Announcements').id,
  1967. )
  1968. Network::Item::Comment.create(
  1969. network_item_id: item.id,
  1970. body: 'Some comment....',
  1971. )
  1972. item = Network::Item.create(
  1973. title: 'Example Question?',
  1974. body: 'Some questions....',
  1975. network_category_id: Network::Category.find_by(name: 'Questions').id,
  1976. )
  1977. Network::Item::Comment.create(
  1978. network_item_id: item.id,
  1979. body: 'Some comment....',
  1980. )
  1981. item = Network::Item.create(
  1982. title: 'Example Idea',
  1983. body: 'Some idea....',
  1984. network_category_id: Network::Category.find_by(name: 'Ideas').id,
  1985. )
  1986. Network::Item::Comment.create(
  1987. network_item_id: item.id,
  1988. body: 'Some comment....',
  1989. )
  1990. item = Network::Item.create(
  1991. title: 'Example Bug Report',
  1992. body: 'Some bug....',
  1993. network_category_id: Network::Category.find_by(name: 'Bug Reports').id,
  1994. )
  1995. Network::Item::Comment.create(
  1996. network_item_id: item.id,
  1997. body: 'Some comment....',
  1998. )
  1999. ObjectManager::Attribute.add(
  2000. object: 'Ticket',
  2001. name: 'title',
  2002. display: 'Title',
  2003. data_type: 'input',
  2004. data_option: {
  2005. type: 'text',
  2006. maxlength: 200,
  2007. null: false,
  2008. translate: false,
  2009. },
  2010. editable: false,
  2011. active: true,
  2012. screens: {
  2013. create_top: {
  2014. '-all-' => {
  2015. null: false,
  2016. },
  2017. },
  2018. edit: {},
  2019. },
  2020. pending_migration: false,
  2021. position: 15,
  2022. )
  2023. ObjectManager::Attribute.add(
  2024. object: 'Ticket',
  2025. name: 'customer_id',
  2026. display: 'Customer',
  2027. data_type: 'user_autocompletion',
  2028. data_option: {
  2029. relation: 'User',
  2030. autocapitalize: false,
  2031. multiple: false,
  2032. null: false,
  2033. limit: 200,
  2034. placeholder: 'Enter Person or Organization/Company',
  2035. minLengt: 2,
  2036. translate: false,
  2037. },
  2038. editable: false,
  2039. active: true,
  2040. screens: {
  2041. create_top: {
  2042. Agent: {
  2043. null: false,
  2044. },
  2045. },
  2046. edit: {},
  2047. },
  2048. pending_migration: false,
  2049. position: 10,
  2050. )
  2051. ObjectManager::Attribute.add(
  2052. object: 'Ticket',
  2053. name: 'cc',
  2054. display: 'Cc',
  2055. data_type: 'input',
  2056. data_option: {
  2057. type: 'text',
  2058. maxlength: 1000,
  2059. null: true,
  2060. },
  2061. editable: false,
  2062. active: true,
  2063. screens: {
  2064. create_top: {
  2065. Agent: {
  2066. null: true,
  2067. },
  2068. },
  2069. create_middle: {},
  2070. edit: {}
  2071. },
  2072. pending_migration: false,
  2073. position: 11,
  2074. )
  2075. ObjectManager::Attribute.add(
  2076. object: 'Ticket',
  2077. name: 'type',
  2078. display: 'Type',
  2079. data_type: 'select',
  2080. data_option: {
  2081. options: {
  2082. 'Incident' => 'Incident',
  2083. 'Problem' => 'Problem',
  2084. 'Request for Change' => 'Request for Change',
  2085. },
  2086. nulloption: true,
  2087. multiple: false,
  2088. null: true,
  2089. translate: true,
  2090. },
  2091. editable: false,
  2092. active: false,
  2093. screens: {
  2094. create_middle: {
  2095. '-all-' => {
  2096. null: false,
  2097. item_class: 'column',
  2098. },
  2099. },
  2100. edit: {
  2101. Agent: {
  2102. null: false,
  2103. },
  2104. },
  2105. },
  2106. pending_migration: false,
  2107. position: 20,
  2108. )
  2109. ObjectManager::Attribute.add(
  2110. object: 'Ticket',
  2111. name: 'group_id',
  2112. display: 'Group',
  2113. data_type: 'select',
  2114. data_option: {
  2115. relation: 'Group',
  2116. relation_condition: { access: 'rw' },
  2117. nulloption: true,
  2118. multiple: false,
  2119. null: false,
  2120. translate: false,
  2121. only_shown_if_selectable: true,
  2122. },
  2123. editable: false,
  2124. active: true,
  2125. screens: {
  2126. create_middle: {
  2127. '-all-' => {
  2128. null: false,
  2129. item_class: 'column',
  2130. },
  2131. },
  2132. edit: {
  2133. Agent: {
  2134. null: false,
  2135. },
  2136. },
  2137. },
  2138. pending_migration: false,
  2139. position: 25,
  2140. )
  2141. ObjectManager::Attribute.add(
  2142. object: 'Ticket',
  2143. name: 'owner_id',
  2144. display: 'Owner',
  2145. data_type: 'select',
  2146. data_option: {
  2147. relation: 'User',
  2148. relation_condition: { roles: 'Agent' },
  2149. nulloption: true,
  2150. multiple: false,
  2151. null: true,
  2152. translate: false,
  2153. },
  2154. editable: false,
  2155. active: true,
  2156. screens: {
  2157. create_middle: {
  2158. Agent: {
  2159. null: true,
  2160. item_class: 'column',
  2161. },
  2162. },
  2163. edit: {
  2164. Agent: {
  2165. null: true,
  2166. },
  2167. },
  2168. },
  2169. pending_migration: false,
  2170. position: 30,
  2171. )
  2172. ObjectManager::Attribute.add(
  2173. object: 'Ticket',
  2174. name: 'state_id',
  2175. display: 'State',
  2176. data_type: 'select',
  2177. data_option: {
  2178. relation: 'TicketState',
  2179. nulloption: true,
  2180. multiple: false,
  2181. null: false,
  2182. default: 2,
  2183. translate: true,
  2184. filter: [1, 2, 3, 4, 7],
  2185. },
  2186. editable: false,
  2187. active: true,
  2188. screens: {
  2189. create_middle: {
  2190. Agent: {
  2191. null: false,
  2192. item_class: 'column',
  2193. },
  2194. Customer: {
  2195. item_class: 'column',
  2196. nulloption: false,
  2197. null: true,
  2198. filter: [1, 4],
  2199. default: 1,
  2200. },
  2201. },
  2202. edit: {
  2203. Agent: {
  2204. nulloption: false,
  2205. null: false,
  2206. filter: [2, 3, 4, 7],
  2207. },
  2208. Customer: {
  2209. nulloption: false,
  2210. null: true,
  2211. filter: [2, 4],
  2212. default: 2,
  2213. },
  2214. },
  2215. },
  2216. pending_migration: false,
  2217. position: 40,
  2218. )
  2219. ObjectManager::Attribute.add(
  2220. object: 'Ticket',
  2221. name: 'pending_time',
  2222. display: 'Pending till',
  2223. data_type: 'datetime',
  2224. data_option: {
  2225. future: true,
  2226. past: false,
  2227. diff: 24,
  2228. null: true,
  2229. translate: true,
  2230. required_if: {
  2231. state_id: [3, 7]
  2232. },
  2233. shown_if: {
  2234. state_id: [3, 7]
  2235. },
  2236. },
  2237. editable: false,
  2238. active: true,
  2239. screens: {
  2240. create_middle: {
  2241. '-all-' => {
  2242. null: false,
  2243. item_class: 'column',
  2244. },
  2245. },
  2246. edit: {
  2247. Agent: {
  2248. null: false,
  2249. },
  2250. },
  2251. },
  2252. pending_migration: false,
  2253. position: 41,
  2254. )
  2255. ObjectManager::Attribute.add(
  2256. object: 'Ticket',
  2257. name: 'priority_id',
  2258. display: 'Priority',
  2259. data_type: 'select',
  2260. data_option: {
  2261. relation: 'TicketPriority',
  2262. nulloption: true,
  2263. multiple: false,
  2264. null: false,
  2265. default: 2,
  2266. translate: true,
  2267. },
  2268. editable: false,
  2269. active: true,
  2270. screens: {
  2271. create_middle: {
  2272. Agent: {
  2273. null: false,
  2274. item_class: 'column',
  2275. },
  2276. },
  2277. edit: {
  2278. Agent: {
  2279. null: false,
  2280. nulloption: false,
  2281. },
  2282. },
  2283. },
  2284. pending_migration: false,
  2285. position: 80,
  2286. )
  2287. ObjectManager::Attribute.add(
  2288. object: 'Ticket',
  2289. name: 'tags',
  2290. display: 'Tags',
  2291. data_type: 'tag',
  2292. data_option: {
  2293. type: 'text',
  2294. null: true,
  2295. translate: false,
  2296. },
  2297. editable: false,
  2298. active: true,
  2299. screens: {
  2300. create_bottom: {
  2301. Agent: {
  2302. null: true,
  2303. },
  2304. },
  2305. edit: {},
  2306. },
  2307. pending_migration: false,
  2308. position: 900,
  2309. )
  2310. ObjectManager::Attribute.add(
  2311. object: 'TicketArticle',
  2312. name: 'type_id',
  2313. display: 'Type',
  2314. data_type: 'select',
  2315. data_option: {
  2316. relation: 'TicketArticleType',
  2317. nulloption: false,
  2318. multiple: false,
  2319. null: false,
  2320. default: 9,
  2321. translate: true,
  2322. },
  2323. editable: false,
  2324. active: true,
  2325. screens: {
  2326. create_middle: {},
  2327. edit: {
  2328. Agent: {
  2329. null: false,
  2330. },
  2331. },
  2332. },
  2333. pending_migration: false,
  2334. position: 100,
  2335. )
  2336. ObjectManager::Attribute.add(
  2337. object: 'TicketArticle',
  2338. name: 'internal',
  2339. display: 'Visibility',
  2340. data_type: 'select',
  2341. data_option: {
  2342. options: { true: 'internal', false: 'public' },
  2343. nulloption: false,
  2344. multiple: false,
  2345. null: true,
  2346. default: false,
  2347. translate: true,
  2348. },
  2349. editable: false,
  2350. active: true,
  2351. screens: {
  2352. create_middle: {},
  2353. edit: {
  2354. Agent: {
  2355. null: false,
  2356. },
  2357. },
  2358. },
  2359. pending_migration: false,
  2360. position: 200,
  2361. )
  2362. ObjectManager::Attribute.add(
  2363. object: 'TicketArticle',
  2364. name: 'to',
  2365. display: 'To',
  2366. data_type: 'input',
  2367. data_option: {
  2368. type: 'text',
  2369. maxlength: 1000,
  2370. null: true,
  2371. },
  2372. editable: false,
  2373. active: true,
  2374. screens: {
  2375. create_middle: {},
  2376. edit: {
  2377. Agent: {
  2378. null: true,
  2379. },
  2380. },
  2381. },
  2382. pending_migration: false,
  2383. position: 300,
  2384. )
  2385. ObjectManager::Attribute.add(
  2386. object: 'TicketArticle',
  2387. name: 'cc',
  2388. display: 'Cc',
  2389. data_type: 'input',
  2390. data_option: {
  2391. type: 'text',
  2392. maxlength: 1000,
  2393. null: true,
  2394. },
  2395. editable: false,
  2396. active: true,
  2397. screens: {
  2398. create_top: {},
  2399. create_middle: {},
  2400. edit: {
  2401. Agent: {
  2402. null: true,
  2403. },
  2404. },
  2405. },
  2406. pending_migration: false,
  2407. position: 400,
  2408. )
  2409. ObjectManager::Attribute.add(
  2410. object: 'TicketArticle',
  2411. name: 'body',
  2412. display: 'Text',
  2413. data_type: 'richtext',
  2414. data_option: {
  2415. type: 'richtext',
  2416. maxlength: 20_000,
  2417. upload: true,
  2418. rows: 8,
  2419. null: true,
  2420. },
  2421. editable: false,
  2422. active: true,
  2423. screens: {
  2424. create_top: {
  2425. '-all-' => {
  2426. null: false,
  2427. },
  2428. },
  2429. edit: {
  2430. Agent: {
  2431. null: true,
  2432. },
  2433. Customer: {
  2434. null: false,
  2435. },
  2436. },
  2437. },
  2438. pending_migration: false,
  2439. position: 600,
  2440. )
  2441. ObjectManager::Attribute.add(
  2442. object: 'User',
  2443. name: 'login',
  2444. display: 'Login',
  2445. data_type: 'input',
  2446. data_option: {
  2447. type: 'text',
  2448. maxlength: 100,
  2449. null: true,
  2450. autocapitalize: false,
  2451. item_class: 'formGroup--halfSize',
  2452. },
  2453. editable: false,
  2454. active: true,
  2455. screens: {
  2456. signup: {},
  2457. invite_agent: {},
  2458. invite_customer: {},
  2459. edit: {},
  2460. view: {
  2461. '-all-' => {
  2462. shown: false,
  2463. },
  2464. },
  2465. },
  2466. pending_migration: false,
  2467. position: 100,
  2468. )
  2469. ObjectManager::Attribute.add(
  2470. object: 'User',
  2471. name: 'firstname',
  2472. display: 'Firstname',
  2473. data_type: 'input',
  2474. data_option: {
  2475. type: 'text',
  2476. maxlength: 150,
  2477. null: false,
  2478. item_class: 'formGroup--halfSize',
  2479. },
  2480. editable: false,
  2481. active: true,
  2482. screens: {
  2483. signup: {
  2484. '-all-' => {
  2485. null: false,
  2486. },
  2487. },
  2488. invite_agent: {
  2489. '-all-' => {
  2490. null: false,
  2491. },
  2492. },
  2493. invite_customer: {
  2494. '-all-' => {
  2495. null: false,
  2496. },
  2497. },
  2498. edit: {
  2499. '-all-' => {
  2500. null: false,
  2501. },
  2502. },
  2503. view: {
  2504. '-all-' => {
  2505. shown: true,
  2506. },
  2507. },
  2508. },
  2509. pending_migration: false,
  2510. position: 200,
  2511. )
  2512. ObjectManager::Attribute.add(
  2513. object: 'User',
  2514. name: 'lastname',
  2515. display: 'Lastname',
  2516. data_type: 'input',
  2517. data_option: {
  2518. type: 'text',
  2519. maxlength: 150,
  2520. null: false,
  2521. item_class: 'formGroup--halfSize',
  2522. },
  2523. editable: false,
  2524. active: true,
  2525. screens: {
  2526. signup: {
  2527. '-all-' => {
  2528. null: false,
  2529. },
  2530. },
  2531. invite_agent: {
  2532. '-all-' => {
  2533. null: false,
  2534. },
  2535. },
  2536. invite_customer: {
  2537. '-all-' => {
  2538. null: false,
  2539. },
  2540. },
  2541. edit: {
  2542. '-all-' => {
  2543. null: false,
  2544. },
  2545. },
  2546. view: {
  2547. '-all-' => {
  2548. shown: true,
  2549. },
  2550. },
  2551. },
  2552. pending_migration: false,
  2553. position: 300,
  2554. )
  2555. ObjectManager::Attribute.add(
  2556. object: 'User',
  2557. name: 'email',
  2558. display: 'Email',
  2559. data_type: 'input',
  2560. data_option: {
  2561. type: 'email',
  2562. maxlength: 150,
  2563. null: false,
  2564. item_class: 'formGroup--halfSize',
  2565. },
  2566. editable: false,
  2567. active: true,
  2568. screens: {
  2569. signup: {
  2570. '-all-' => {
  2571. null: false,
  2572. },
  2573. },
  2574. invite_agent: {
  2575. '-all-' => {
  2576. null: false,
  2577. },
  2578. },
  2579. invite_customer: {
  2580. '-all-' => {
  2581. null: false,
  2582. },
  2583. },
  2584. edit: {
  2585. '-all-' => {
  2586. null: false,
  2587. },
  2588. },
  2589. view: {
  2590. '-all-' => {
  2591. shown: true,
  2592. },
  2593. },
  2594. },
  2595. pending_migration: false,
  2596. position: 400,
  2597. )
  2598. ObjectManager::Attribute.add(
  2599. object: 'User',
  2600. name: 'web',
  2601. display: 'Web',
  2602. data_type: 'input',
  2603. data_option: {
  2604. type: 'url',
  2605. maxlength: 250,
  2606. null: true,
  2607. item_class: 'formGroup--halfSize',
  2608. },
  2609. editable: false,
  2610. active: true,
  2611. screens: {
  2612. signup: {},
  2613. invite_agent: {},
  2614. invite_customer: {},
  2615. edit: {
  2616. '-all-' => {
  2617. null: true,
  2618. },
  2619. },
  2620. view: {
  2621. '-all-' => {
  2622. shown: true,
  2623. },
  2624. },
  2625. },
  2626. pending_migration: false,
  2627. position: 500,
  2628. )
  2629. ObjectManager::Attribute.add(
  2630. object: 'User',
  2631. name: 'phone',
  2632. display: 'Phone',
  2633. data_type: 'input',
  2634. data_option: {
  2635. type: 'phone',
  2636. maxlength: 100,
  2637. null: true,
  2638. item_class: 'formGroup--halfSize',
  2639. },
  2640. editable: false,
  2641. active: true,
  2642. screens: {
  2643. signup: {},
  2644. invite_agent: {},
  2645. invite_customer: {},
  2646. edit: {
  2647. '-all-' => {
  2648. null: true,
  2649. },
  2650. },
  2651. view: {
  2652. '-all-' => {
  2653. shown: true,
  2654. },
  2655. },
  2656. },
  2657. pending_migration: false,
  2658. position: 600,
  2659. )
  2660. ObjectManager::Attribute.add(
  2661. object: 'User',
  2662. name: 'mobile',
  2663. display: 'Mobile',
  2664. data_type: 'input',
  2665. data_option: {
  2666. type: 'phone',
  2667. maxlength: 100,
  2668. null: true,
  2669. item_class: 'formGroup--halfSize',
  2670. },
  2671. editable: false,
  2672. active: true,
  2673. screens: {
  2674. signup: {},
  2675. invite_agent: {},
  2676. invite_customer: {},
  2677. edit: {
  2678. '-all-' => {
  2679. null: true,
  2680. },
  2681. },
  2682. view: {
  2683. '-all-' => {
  2684. shown: true,
  2685. },
  2686. },
  2687. },
  2688. pending_migration: false,
  2689. position: 700,
  2690. )
  2691. ObjectManager::Attribute.add(
  2692. object: 'User',
  2693. name: 'fax',
  2694. display: 'Fax',
  2695. data_type: 'input',
  2696. data_option: {
  2697. type: 'phone',
  2698. maxlength: 100,
  2699. null: true,
  2700. item_class: 'formGroup--halfSize',
  2701. },
  2702. editable: false,
  2703. active: true,
  2704. screens: {
  2705. signup: {},
  2706. invite_agent: {},
  2707. invite_customer: {},
  2708. edit: {
  2709. '-all-' => {
  2710. null: true,
  2711. },
  2712. },
  2713. view: {
  2714. '-all-' => {
  2715. shown: true,
  2716. },
  2717. },
  2718. },
  2719. pending_migration: false,
  2720. position: 800,
  2721. )
  2722. ObjectManager::Attribute.add(
  2723. object: 'User',
  2724. name: 'organization_id',
  2725. display: 'Organization',
  2726. data_type: 'autocompletion_ajax',
  2727. data_option: {
  2728. multiple: false,
  2729. nulloption: true,
  2730. null: true,
  2731. relation: 'Organization',
  2732. item_class: 'formGroup--halfSize',
  2733. },
  2734. editable: false,
  2735. active: true,
  2736. screens: {
  2737. signup: {},
  2738. invite_agent: {},
  2739. invite_customer: {
  2740. '-all-' => {
  2741. null: true,
  2742. },
  2743. },
  2744. edit: {
  2745. '-all-' => {
  2746. null: true,
  2747. },
  2748. },
  2749. view: {
  2750. '-all-' => {
  2751. shown: true,
  2752. },
  2753. },
  2754. },
  2755. pending_migration: false,
  2756. position: 900,
  2757. )
  2758. ObjectManager::Attribute.add(
  2759. object: 'User',
  2760. name: 'department',
  2761. display: 'Department',
  2762. data_type: 'input',
  2763. data_option: {
  2764. type: 'text',
  2765. maxlength: 200,
  2766. null: true,
  2767. item_class: 'formGroup--halfSize',
  2768. },
  2769. editable: false,
  2770. active: true,
  2771. screens: {
  2772. signup: {},
  2773. invite_agent: {},
  2774. invite_customer: {},
  2775. edit: {
  2776. '-all-' => {
  2777. null: true,
  2778. },
  2779. },
  2780. view: {
  2781. '-all-' => {
  2782. shown: true,
  2783. },
  2784. },
  2785. },
  2786. pending_migration: false,
  2787. position: 1000,
  2788. )
  2789. ObjectManager::Attribute.add(
  2790. object: 'User',
  2791. name: 'street',
  2792. display: 'Street',
  2793. data_type: 'input',
  2794. data_option: {
  2795. type: 'text',
  2796. maxlength: 100,
  2797. null: true,
  2798. },
  2799. editable: true,
  2800. active: false,
  2801. screens: {
  2802. signup: {},
  2803. invite_agent: {},
  2804. invite_customer: {},
  2805. edit: {
  2806. '-all-' => {
  2807. null: true,
  2808. },
  2809. },
  2810. view: {
  2811. '-all-' => {
  2812. shown: true,
  2813. },
  2814. },
  2815. },
  2816. pending_migration: false,
  2817. position: 1100,
  2818. )
  2819. ObjectManager::Attribute.add(
  2820. object: 'User',
  2821. name: 'zip',
  2822. display: 'Zip',
  2823. data_type: 'input',
  2824. data_option: {
  2825. type: 'text',
  2826. maxlength: 100,
  2827. null: true,
  2828. item_class: 'formGroup--halfSize',
  2829. },
  2830. editable: true,
  2831. active: false,
  2832. screens: {
  2833. signup: {},
  2834. invite_agent: {},
  2835. invite_customer: {},
  2836. edit: {
  2837. '-all-' => {
  2838. null: true,
  2839. },
  2840. },
  2841. view: {
  2842. '-all-' => {
  2843. shown: true,
  2844. },
  2845. },
  2846. },
  2847. pending_migration: false,
  2848. position: 1200,
  2849. )
  2850. ObjectManager::Attribute.add(
  2851. object: 'User',
  2852. name: 'city',
  2853. display: 'City',
  2854. data_type: 'input',
  2855. data_option: {
  2856. type: 'text',
  2857. maxlength: 100,
  2858. null: true,
  2859. item_class: 'formGroup--halfSize',
  2860. },
  2861. editable: true,
  2862. active: false,
  2863. screens: {
  2864. signup: {},
  2865. invite_agent: {},
  2866. invite_customer: {},
  2867. edit: {
  2868. '-all-' => {
  2869. null: true,
  2870. },
  2871. },
  2872. view: {
  2873. '-all-' => {
  2874. shown: true,
  2875. },
  2876. },
  2877. },
  2878. pending_migration: false,
  2879. position: 1300,
  2880. )
  2881. ObjectManager::Attribute.add(
  2882. object: 'User',
  2883. name: 'address',
  2884. display: 'Address',
  2885. data_type: 'textarea',
  2886. data_option: {
  2887. type: 'text',
  2888. maxlength: 500,
  2889. null: true,
  2890. item_class: 'formGroup--halfSize',
  2891. },
  2892. editable: true,
  2893. active: true,
  2894. screens: {
  2895. signup: {},
  2896. invite_agent: {},
  2897. invite_customer: {},
  2898. edit: {
  2899. '-all-' => {
  2900. null: true,
  2901. },
  2902. },
  2903. view: {
  2904. '-all-' => {
  2905. shown: true,
  2906. },
  2907. },
  2908. },
  2909. pending_migration: false,
  2910. position: 1350,
  2911. )
  2912. ObjectManager::Attribute.add(
  2913. object: 'User',
  2914. name: 'password',
  2915. display: 'Password',
  2916. data_type: 'input',
  2917. data_option: {
  2918. type: 'password',
  2919. maxlength: 100,
  2920. null: true,
  2921. autocomplete: 'off',
  2922. item_class: 'formGroup--halfSize',
  2923. },
  2924. editable: false,
  2925. active: true,
  2926. screens: {
  2927. signup: {
  2928. '-all-' => {
  2929. null: false,
  2930. },
  2931. },
  2932. invite_agent: {},
  2933. invite_customer: {},
  2934. edit: {
  2935. Admin: {
  2936. null: true,
  2937. },
  2938. },
  2939. view: {}
  2940. },
  2941. pending_migration: false,
  2942. position: 1400,
  2943. )
  2944. ObjectManager::Attribute.add(
  2945. object: 'User',
  2946. name: 'vip',
  2947. display: 'VIP',
  2948. data_type: 'boolean',
  2949. data_option: {
  2950. null: true,
  2951. default: false,
  2952. item_class: 'formGroup--halfSize',
  2953. options: {
  2954. false: 'no',
  2955. true: 'yes',
  2956. },
  2957. translate: true,
  2958. },
  2959. editable: false,
  2960. active: true,
  2961. screens: {
  2962. edit: {
  2963. Admin: {
  2964. null: true,
  2965. },
  2966. Agent: {
  2967. null: true,
  2968. },
  2969. },
  2970. view: {
  2971. '-all-' => {
  2972. shown: false,
  2973. },
  2974. },
  2975. },
  2976. pending_migration: false,
  2977. position: 1490,
  2978. )
  2979. ObjectManager::Attribute.add(
  2980. object: 'User',
  2981. name: 'note',
  2982. display: 'Note',
  2983. data_type: 'richtext',
  2984. data_option: {
  2985. type: 'text',
  2986. maxlength: 250,
  2987. null: true,
  2988. note: 'Notes are visible to agents only, never to customers.',
  2989. },
  2990. editable: false,
  2991. active: true,
  2992. screens: {
  2993. signup: {},
  2994. invite_agent: {},
  2995. invite_customer: {
  2996. '-all-' => {
  2997. null: true,
  2998. },
  2999. },
  3000. edit: {
  3001. '-all-' => {
  3002. null: true,
  3003. },
  3004. },
  3005. view: {
  3006. '-all-' => {
  3007. shown: true,
  3008. },
  3009. },
  3010. },
  3011. pending_migration: false,
  3012. position: 1500,
  3013. )
  3014. ObjectManager::Attribute.add(
  3015. object: 'User',
  3016. name: 'role_ids',
  3017. display: 'Roles',
  3018. data_type: 'checkbox',
  3019. data_option: {
  3020. multiple: true,
  3021. null: false,
  3022. relation: 'Role',
  3023. },
  3024. editable: false,
  3025. active: true,
  3026. screens: {
  3027. signup: {},
  3028. invite_agent: {},
  3029. invite_customer: {},
  3030. edit: {
  3031. Admin: {
  3032. null: false,
  3033. },
  3034. },
  3035. view: {
  3036. '-all-' => {
  3037. shown: false,
  3038. },
  3039. },
  3040. },
  3041. pending_migration: false,
  3042. position: 1600,
  3043. )
  3044. ObjectManager::Attribute.add(
  3045. object: 'User',
  3046. name: 'group_ids',
  3047. display: 'Groups',
  3048. data_type: 'checkbox',
  3049. data_option: {
  3050. multiple: true,
  3051. null: true,
  3052. relation: 'Group',
  3053. },
  3054. editable: false,
  3055. active: true,
  3056. screens: {
  3057. signup: {},
  3058. invite_agent: {
  3059. '-all-' => {
  3060. null: false,
  3061. only_shown_if_selectable: true,
  3062. },
  3063. },
  3064. invite_customer: {},
  3065. edit: {
  3066. Admin: {
  3067. null: true,
  3068. },
  3069. },
  3070. view: {
  3071. '-all-' => {
  3072. shown: false,
  3073. },
  3074. },
  3075. },
  3076. pending_migration: false,
  3077. position: 1700,
  3078. )
  3079. ObjectManager::Attribute.add(
  3080. object: 'User',
  3081. name: 'active',
  3082. display: 'Active',
  3083. data_type: 'active',
  3084. data_option: {
  3085. default: true,
  3086. },
  3087. editable: false,
  3088. active: true,
  3089. screens: {
  3090. signup: {},
  3091. invite_agent: {},
  3092. invite_customer: {},
  3093. edit: {
  3094. Admin: {
  3095. null: false,
  3096. },
  3097. },
  3098. view: {
  3099. '-all-' => {
  3100. shown: false,
  3101. },
  3102. },
  3103. },
  3104. pending_migration: false,
  3105. position: 1800,
  3106. )
  3107. ObjectManager::Attribute.add(
  3108. object: 'Organization',
  3109. name: 'name',
  3110. display: 'Name',
  3111. data_type: 'input',
  3112. data_option: {
  3113. type: 'text',
  3114. maxlength: 150,
  3115. null: false,
  3116. item_class: 'formGroup--halfSize',
  3117. },
  3118. editable: false,
  3119. active: true,
  3120. screens: {
  3121. edit: {
  3122. '-all-' => {
  3123. null: false,
  3124. },
  3125. },
  3126. view: {
  3127. '-all-' => {
  3128. shown: true,
  3129. },
  3130. },
  3131. },
  3132. pending_migration: false,
  3133. position: 200,
  3134. )
  3135. ObjectManager::Attribute.add(
  3136. object: 'Organization',
  3137. name: 'shared',
  3138. display: 'Shared organization',
  3139. data_type: 'boolean',
  3140. data_option: {
  3141. maxlength: 250,
  3142. null: true,
  3143. default: true,
  3144. note: 'Customers in the organization can view each other items.',
  3145. item_class: 'formGroup--halfSize',
  3146. options: {
  3147. true: 'Yes',
  3148. false: 'No',
  3149. }
  3150. },
  3151. editable: false,
  3152. active: true,
  3153. screens: {
  3154. edit: {
  3155. Admin: {
  3156. null: false,
  3157. },
  3158. },
  3159. view: {
  3160. '-all-' => {
  3161. shown: true,
  3162. },
  3163. },
  3164. },
  3165. pending_migration: false,
  3166. position: 1400,
  3167. )
  3168. ObjectManager::Attribute.add(
  3169. object: 'Organization',
  3170. name: 'note',
  3171. display: 'Note',
  3172. data_type: 'richtext',
  3173. data_option: {
  3174. type: 'text',
  3175. maxlength: 250,
  3176. null: true,
  3177. note: 'Notes are visible to agents only, never to customers.',
  3178. },
  3179. editable: false,
  3180. active: true,
  3181. screens: {
  3182. edit: {
  3183. '-all-' => {
  3184. null: true,
  3185. },
  3186. },
  3187. view: {
  3188. '-all-' => {
  3189. shown: true,
  3190. },
  3191. },
  3192. },
  3193. pending_migration: false,
  3194. position: 1500,
  3195. )
  3196. ObjectManager::Attribute.add(
  3197. object: 'Organization',
  3198. name: 'active',
  3199. display: 'Active',
  3200. data_type: 'active',
  3201. data_option: {
  3202. default: true,
  3203. },
  3204. editable: false,
  3205. active: true,
  3206. screens: {
  3207. edit: {
  3208. Admin: {
  3209. null: false,
  3210. },
  3211. },
  3212. view: {
  3213. '-all-' => {
  3214. shown: false,
  3215. },
  3216. },
  3217. },
  3218. pending_migration: false,
  3219. position: 1800,
  3220. )
  3221. Scheduler.create_if_not_exists(
  3222. name: 'Process pending tickets',
  3223. method: 'Ticket.process_pending',
  3224. period: 60 * 15,
  3225. prio: 1,
  3226. active: true,
  3227. )
  3228. Scheduler.create_if_not_exists(
  3229. name: 'Process escalation tickets',
  3230. method: 'Ticket.process_escalation',
  3231. period: 60 * 5,
  3232. prio: 1,
  3233. active: true,
  3234. )
  3235. Scheduler.create_if_not_exists(
  3236. name: 'Import OTRS diff load',
  3237. method: 'Import::OTRS.diff_worker',
  3238. period: 60 * 3,
  3239. prio: 1,
  3240. active: true,
  3241. updated_by_id: 1,
  3242. created_by_id: 1,
  3243. )
  3244. Scheduler.create_if_not_exists(
  3245. name: 'Check Channels',
  3246. method: 'Channel.fetch',
  3247. period: 30,
  3248. prio: 1,
  3249. active: true,
  3250. updated_by_id: 1,
  3251. created_by_id: 1,
  3252. )
  3253. Scheduler.create_if_not_exists(
  3254. name: 'Check streams for Channel',
  3255. method: 'Channel.stream',
  3256. period: 60,
  3257. prio: 1,
  3258. active: true,
  3259. updated_by_id: 1,
  3260. created_by_id: 1,
  3261. )
  3262. Scheduler.create_if_not_exists(
  3263. name: 'Generate Session data',
  3264. method: 'Sessions.jobs',
  3265. period: 60,
  3266. prio: 1,
  3267. active: true,
  3268. updated_by_id: 1,
  3269. created_by_id: 1,
  3270. )
  3271. Scheduler.create_if_not_exists(
  3272. name: 'Cleanup expired sessions',
  3273. method: 'SessionHelper.cleanup_expired',
  3274. period: 60 * 60 * 12,
  3275. prio: 2,
  3276. active: true,
  3277. updated_by_id: 1,
  3278. created_by_id: 1,
  3279. )
  3280. Scheduler.create_if_not_exists(
  3281. name: 'Delete old activity stream entries.',
  3282. method: 'ActivityStream.cleanup',
  3283. period: 1.day,
  3284. prio: 2,
  3285. active: true,
  3286. updated_by_id: 1,
  3287. created_by_id: 1,
  3288. )
  3289. Scheduler.create_if_not_exists(
  3290. name: 'Delete old entries.',
  3291. method: 'RecentView.cleanup',
  3292. period: 1.day,
  3293. prio: 2,
  3294. active: true,
  3295. updated_by_id: 1,
  3296. created_by_id: 1,
  3297. )
  3298. Scheduler.create_or_update(
  3299. name: 'Delete old online notification entries.',
  3300. method: 'OnlineNotification.cleanup',
  3301. period: 2.hours,
  3302. prio: 2,
  3303. active: true,
  3304. updated_by_id: 1,
  3305. created_by_id: 1,
  3306. )
  3307. Scheduler.create_or_update(
  3308. name: 'Delete old token entries.',
  3309. method: 'Token.cleanup',
  3310. period: 30.days,
  3311. prio: 2,
  3312. active: true,
  3313. updated_by_id: 1,
  3314. created_by_id: 1,
  3315. )
  3316. Scheduler.create_or_update(
  3317. name: 'Closed chat sessions where participients are offline.',
  3318. method: 'Chat.cleanup_close',
  3319. period: 60 * 15,
  3320. prio: 2,
  3321. active: true,
  3322. updated_by_id: 1,
  3323. created_by_id: 1,
  3324. )
  3325. Scheduler.create_or_update(
  3326. name: 'Cleanup closed sessions.',
  3327. method: 'Chat.cleanup',
  3328. period: 5.days,
  3329. prio: 2,
  3330. active: true,
  3331. updated_by_id: 1,
  3332. created_by_id: 1,
  3333. )
  3334. # reset primary key sequences
  3335. if ActiveRecord::Base.connection_config[:adapter] == 'postgresql'
  3336. ActiveRecord::Base.connection.tables.each do |t|
  3337. ActiveRecord::Base.connection.reset_pk_sequence!(t)
  3338. end
  3339. end
  3340. # install locales and translations
  3341. Locale.create_if_not_exists(
  3342. locale: 'en-us',
  3343. alias: 'en',
  3344. name: 'English (United States)',
  3345. )
  3346. Locale.load
  3347. Translation.load
  3348. Calendar.init_setup
  3349. # install all packages in auto_install
  3350. Package.auto_install