seeds.rb 121 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682
  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. # clear old caches to start from scratch
  10. Cache.clear
  11. Setting.create_if_not_exists(
  12. title: 'Application secret',
  13. name: 'application_secret',
  14. area: 'Core',
  15. description: 'Defines the random application secret.',
  16. options: {},
  17. state: SecureRandom.hex(128),
  18. preferences: {
  19. permission: ['admin'],
  20. },
  21. frontend: false
  22. )
  23. Setting.create_if_not_exists(
  24. title: 'System Init Done',
  25. name: 'system_init_done',
  26. area: 'Core',
  27. description: 'Defines if application is in init mode.',
  28. options: {},
  29. state: false,
  30. preferences: { online_service_disable: true },
  31. frontend: true
  32. )
  33. Setting.create_if_not_exists(
  34. title: 'App Version',
  35. name: 'app_version',
  36. area: 'Core::WebApp',
  37. description: 'Only used internally to propagate current web app version to clients.',
  38. options: {},
  39. state: '',
  40. preferences: { online_service_disable: true },
  41. frontend: false
  42. )
  43. Setting.create_if_not_exists(
  44. title: 'Maintenance Mode',
  45. name: 'maintenance_mode',
  46. area: 'Core::WebApp',
  47. description: 'Enable or disable the maintenance mode of Zammad. If enabled, all non-administrators get logged out and only administrators can start a new session.',
  48. options: {},
  49. state: false,
  50. preferences: {
  51. permission: ['admin.maintenance'],
  52. },
  53. frontend: true
  54. )
  55. Setting.create_if_not_exists(
  56. title: 'Maintenance Login',
  57. name: 'maintenance_login',
  58. area: 'Core::WebApp',
  59. description: 'Put a message on the login page. To change it, click on the text area below and change it inline.',
  60. options: {},
  61. state: false,
  62. preferences: {
  63. permission: ['admin.maintenance'],
  64. },
  65. frontend: true
  66. )
  67. Setting.create_if_not_exists(
  68. title: 'Maintenance Login',
  69. name: 'maintenance_login_message',
  70. area: 'Core::WebApp',
  71. description: 'Message for login page.',
  72. options: {},
  73. state: 'Something about to share. Click here to change.',
  74. preferences: {
  75. permission: ['admin.maintenance'],
  76. },
  77. frontend: true
  78. )
  79. Setting.create_if_not_exists(
  80. title: 'Developer System',
  81. name: 'developer_mode',
  82. area: 'Core::Develop',
  83. description: 'Defines if application is in developer mode (useful for developer, all users have the same password, password reset will work without email delivery).',
  84. options: {},
  85. state: false,
  86. preferences: { online_service_disable: true },
  87. frontend: true
  88. )
  89. Setting.create_if_not_exists(
  90. title: 'Online Service',
  91. name: 'system_online_service',
  92. area: 'Core',
  93. description: 'Defines if application is used as online service.',
  94. options: {},
  95. state: false,
  96. preferences: { online_service_disable: true },
  97. frontend: true
  98. )
  99. Setting.create_if_not_exists(
  100. title: 'Product Name',
  101. name: 'product_name',
  102. area: 'System::Branding',
  103. description: 'Defines the name of the application, shown in the web interface, tabs and title bar of the web browser.',
  104. options: {
  105. form: [
  106. {
  107. display: '',
  108. null: false,
  109. name: 'product_name',
  110. tag: 'input',
  111. },
  112. ],
  113. },
  114. preferences: {
  115. render: true,
  116. session_check: true,
  117. prio: 1,
  118. placeholder: true,
  119. permission: ['admin.branding'],
  120. },
  121. state: 'Zammad Helpdesk',
  122. frontend: true
  123. )
  124. Setting.create_if_not_exists(
  125. title: 'Logo',
  126. name: 'product_logo',
  127. area: 'System::Branding',
  128. description: 'Defines the logo of the application, shown in the web interface.',
  129. options: {
  130. form: [
  131. {
  132. display: '',
  133. null: false,
  134. name: 'product_logo',
  135. tag: 'input',
  136. },
  137. ],
  138. },
  139. preferences: {
  140. prio: 3,
  141. controller: 'SettingsAreaLogo',
  142. permission: ['admin.branding'],
  143. },
  144. state: 'logo.svg',
  145. frontend: true
  146. )
  147. Setting.create_if_not_exists(
  148. title: 'Organization',
  149. name: 'organization',
  150. area: 'System::Branding',
  151. description: 'Will be shown in the app and is included in email footers.',
  152. options: {
  153. form: [
  154. {
  155. display: '',
  156. null: false,
  157. name: 'organization',
  158. tag: 'input',
  159. },
  160. ],
  161. },
  162. state: '',
  163. preferences: {
  164. prio: 2,
  165. placeholder: true,
  166. permission: ['admin.branding'],
  167. },
  168. frontend: true
  169. )
  170. options = {}
  171. (10..99).each { |item|
  172. options[item] = item
  173. }
  174. system_id = rand(10..99)
  175. Setting.create_if_not_exists(
  176. title: 'SystemID',
  177. name: 'system_id',
  178. area: 'System::Base',
  179. 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).',
  180. options: {
  181. form: [
  182. {
  183. display: '',
  184. null: true,
  185. name: 'system_id',
  186. tag: 'select',
  187. options: options,
  188. },
  189. ],
  190. },
  191. state: system_id,
  192. preferences: {
  193. online_service_disable: true,
  194. placeholder: true,
  195. authentication: true,
  196. permission: ['admin.system'],
  197. },
  198. frontend: true
  199. )
  200. Setting.create_if_not_exists(
  201. title: 'Fully Qualified Domain Name',
  202. name: 'fqdn',
  203. area: 'System::Base',
  204. 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.',
  205. options: {
  206. form: [
  207. {
  208. display: '',
  209. null: false,
  210. name: 'fqdn',
  211. tag: 'input',
  212. },
  213. ],
  214. },
  215. state: 'zammad.example.com',
  216. preferences: {
  217. online_service_disable: true,
  218. placeholder: true,
  219. permission: ['admin.system'],
  220. },
  221. frontend: true
  222. )
  223. Setting.create_if_not_exists(
  224. title: 'Websocket port',
  225. name: 'websocket_port',
  226. area: 'System::WebSocket',
  227. description: 'Defines the port of the websocket server.',
  228. options: {
  229. form: [
  230. {
  231. display: '',
  232. null: false,
  233. name: 'websocket_port',
  234. tag: 'input',
  235. },
  236. ],
  237. },
  238. state: '6042',
  239. preferences: { online_service_disable: true },
  240. frontend: true
  241. )
  242. Setting.create_if_not_exists(
  243. title: 'HTTP type',
  244. name: 'http_type',
  245. area: 'System::Base',
  246. 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 effect 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.',
  247. options: {
  248. form: [
  249. {
  250. display: '',
  251. null: true,
  252. name: 'http_type',
  253. tag: 'select',
  254. options: {
  255. 'https' => 'https',
  256. 'http' => 'http',
  257. },
  258. },
  259. ],
  260. },
  261. state: 'http',
  262. preferences: {
  263. online_service_disable: true,
  264. placeholder: true,
  265. permission: ['admin.system'],
  266. },
  267. frontend: true
  268. )
  269. Setting.create_if_not_exists(
  270. title: 'Storage Mechanism',
  271. name: 'storage_provider',
  272. area: 'System::Storage',
  273. description: '"Database" stores all attachments in the database (not recommended for storing large amounts of data). "Filesystem" stores the data in the filesystem. You can switch between the modules even on a system that is already in production without any loss of data.',
  274. options: {
  275. form: [
  276. {
  277. display: '',
  278. null: true,
  279. name: 'storage_provider',
  280. tag: 'select',
  281. tranlate: true,
  282. options: {
  283. 'DB' => 'Database',
  284. 'File' => 'Filesystem',
  285. },
  286. },
  287. ],
  288. },
  289. state: 'DB',
  290. preferences: {
  291. controller: 'SettingsAreaStorageProvider',
  292. online_service_disable: true,
  293. permission: ['admin.system'],
  294. },
  295. frontend: false
  296. )
  297. Setting.create_if_not_exists(
  298. title: 'Image Service',
  299. name: 'image_backend',
  300. area: 'System::Services',
  301. description: 'Defines the backend for user and organization image lookups.',
  302. options: {
  303. form: [
  304. {
  305. display: '',
  306. null: true,
  307. name: 'image_backend',
  308. tag: 'select',
  309. options: {
  310. '' => '-',
  311. 'Service::Image::Zammad' => 'Zammad Image Service',
  312. },
  313. },
  314. ],
  315. },
  316. state: 'Service::Image::Zammad',
  317. preferences: {
  318. prio: 1,
  319. permission: ['admin.system'],
  320. },
  321. frontend: false
  322. )
  323. Setting.create_if_not_exists(
  324. title: 'Geo IP Service',
  325. name: 'geo_ip_backend',
  326. area: 'System::Services',
  327. description: 'Defines the backend for geo IP lookups. Shows also location of an IP address if an IP address is shown.',
  328. options: {
  329. form: [
  330. {
  331. display: '',
  332. null: true,
  333. name: 'geo_ip_backend',
  334. tag: 'select',
  335. options: {
  336. '' => '-',
  337. 'Service::GeoIp::Zammad' => 'Zammad GeoIP Service',
  338. },
  339. },
  340. ],
  341. },
  342. state: 'Service::GeoIp::Zammad',
  343. preferences: {
  344. prio: 2,
  345. permission: ['admin.system'],
  346. },
  347. frontend: false
  348. )
  349. Setting.create_if_not_exists(
  350. title: 'Geo Location Service',
  351. name: 'geo_location_backend',
  352. area: 'System::Services',
  353. description: 'Defines the backend for geo location lookups to store geo locations for addresses.',
  354. options: {
  355. form: [
  356. {
  357. display: '',
  358. null: true,
  359. name: 'geo_location_backend',
  360. tag: 'select',
  361. options: {
  362. '' => '-',
  363. 'Service::GeoLocation::Gmaps' => 'Google Maps',
  364. },
  365. },
  366. ],
  367. },
  368. state: 'Service::GeoLocation::Gmaps',
  369. preferences: {
  370. prio: 3,
  371. permission: ['admin.system'],
  372. },
  373. frontend: false
  374. )
  375. Setting.create_if_not_exists(
  376. title: 'Geo Calendar Service',
  377. name: 'geo_calendar_backend',
  378. area: 'System::Services',
  379. description: 'Defines the backend for geo calendar lookups. Used for initial calendar succession.',
  380. options: {
  381. form: [
  382. {
  383. display: '',
  384. null: true,
  385. name: 'geo_calendar_backend',
  386. tag: 'select',
  387. options: {
  388. '' => '-',
  389. 'Service::GeoCalendar::Zammad' => 'Zammad GeoCalendar Service',
  390. },
  391. },
  392. ],
  393. },
  394. state: 'Service::GeoCalendar::Zammad',
  395. preferences: {
  396. prio: 2,
  397. permission: ['admin.system'],
  398. },
  399. frontend: false
  400. )
  401. Setting.create_if_not_exists(
  402. title: 'Proxy Settings',
  403. name: 'proxy',
  404. area: 'System::Network',
  405. description: 'Address of the proxy server for http and https resources.',
  406. options: {
  407. form: [
  408. {
  409. display: '',
  410. null: false,
  411. name: 'proxy',
  412. tag: 'input',
  413. placeholder: 'proxy.example.com:3128',
  414. },
  415. ],
  416. },
  417. state: '',
  418. preferences: {
  419. online_service_disable: true,
  420. controller: 'SettingsAreaProxy',
  421. prio: 1,
  422. permission: ['admin.system'],
  423. },
  424. frontend: false
  425. )
  426. Setting.create_if_not_exists(
  427. title: 'Proxy User',
  428. name: 'proxy_username',
  429. area: 'System::Network',
  430. description: 'Username for proxy connection.',
  431. options: {
  432. form: [
  433. {
  434. display: '',
  435. null: false,
  436. name: 'proxy_username',
  437. tag: 'input',
  438. },
  439. ],
  440. },
  441. state: '',
  442. preferences: {
  443. disabled: true,
  444. online_service_disable: true,
  445. prio: 2,
  446. permission: ['admin.system'],
  447. },
  448. frontend: false
  449. )
  450. Setting.create_if_not_exists(
  451. title: 'Proxy Password',
  452. name: 'proxy_password',
  453. area: 'System::Network',
  454. description: 'Password for proxy connection.',
  455. options: {
  456. form: [
  457. {
  458. display: '',
  459. null: false,
  460. name: 'proxy_passowrd',
  461. tag: 'input',
  462. },
  463. ],
  464. },
  465. state: '',
  466. preferences: {
  467. disabled: true,
  468. online_service_disable: true,
  469. prio: 3,
  470. permission: ['admin.system'],
  471. },
  472. frontend: false
  473. )
  474. Setting.create_if_not_exists(
  475. title: 'Send client stats',
  476. name: 'ui_send_client_stats',
  477. area: 'System::UI',
  478. description: 'Send client stats/error message to central server to improve the usability.',
  479. options: {
  480. form: [
  481. {
  482. display: '',
  483. null: true,
  484. name: 'ui_send_client_stats',
  485. tag: 'boolean',
  486. options: {
  487. true => 'yes',
  488. false => 'no',
  489. },
  490. },
  491. ],
  492. },
  493. state: false,
  494. preferences: {
  495. prio: 1,
  496. permission: ['admin.system'],
  497. },
  498. frontend: true
  499. )
  500. Setting.create_if_not_exists(
  501. title: 'Client storage',
  502. name: 'ui_client_storage',
  503. area: 'System::UI',
  504. description: 'Use client storage to cache data to enhance performance of application.',
  505. options: {
  506. form: [
  507. {
  508. display: '',
  509. null: true,
  510. name: 'ui_client_storage',
  511. tag: 'boolean',
  512. options: {
  513. true => 'yes',
  514. false => 'no',
  515. },
  516. },
  517. ],
  518. },
  519. state: false,
  520. preferences: {
  521. prio: 2,
  522. permission: ['admin.system'],
  523. },
  524. frontend: true
  525. )
  526. Setting.create_if_not_exists(
  527. title: 'Define default visibility of new a new article',
  528. name: 'ui_ticket_zoom_article_new_internal',
  529. area: 'UI::TicketZoom',
  530. description: 'Set default visibility of new a new article.',
  531. options: {
  532. form: [
  533. {
  534. display: '',
  535. null: true,
  536. name: 'ui_ticket_zoom_article_new_internal',
  537. tag: 'boolean',
  538. translate: true,
  539. options: {
  540. true => 'internal',
  541. false => 'public',
  542. },
  543. },
  544. ],
  545. },
  546. state: true,
  547. preferences: {
  548. prio: 1,
  549. permission: ['admin.ui'],
  550. },
  551. frontend: true
  552. )
  553. Setting.create_if_not_exists(
  554. title: 'New User Accounts',
  555. name: 'user_create_account',
  556. area: 'Security::Base',
  557. description: 'Enables users to create their own account via web interface.',
  558. options: {
  559. form: [
  560. {
  561. display: '',
  562. null: true,
  563. name: 'user_create_account',
  564. tag: 'boolean',
  565. options: {
  566. true => 'yes',
  567. false => 'no',
  568. },
  569. },
  570. ],
  571. },
  572. state: true,
  573. preferences: {
  574. permission: ['admin.security'],
  575. },
  576. frontend: true
  577. )
  578. Setting.create_if_not_exists(
  579. title: 'Lost Password',
  580. name: 'user_lost_password',
  581. area: 'Security::Base',
  582. description: 'Activates lost password feature for users.',
  583. options: {
  584. form: [
  585. {
  586. display: '',
  587. null: true,
  588. name: 'user_lost_password',
  589. tag: 'boolean',
  590. options: {
  591. true => 'yes',
  592. false => 'no',
  593. },
  594. },
  595. ],
  596. },
  597. state: true,
  598. preferences: {
  599. permission: ['admin.security'],
  600. },
  601. frontend: true
  602. )
  603. Setting.create_if_not_exists(
  604. title: 'Authentication via %s',
  605. name: 'auth_ldap',
  606. area: 'Security::Authentication',
  607. description: 'Enables user authentication via %s.',
  608. preferences: {
  609. title_i18n: ['LDAP'],
  610. description_i18n: ['LDAP'],
  611. permission: ['admin.security'],
  612. },
  613. state: {
  614. adapter: 'Auth::Ldap',
  615. host: 'localhost',
  616. port: 389,
  617. bind_dn: 'cn=Manager,dc=example,dc=org',
  618. bind_pw: 'example',
  619. uid: 'mail',
  620. base: 'dc=example,dc=org',
  621. always_filter: '',
  622. always_roles: %w(Admin Agent),
  623. always_groups: ['Users'],
  624. sync_params: {
  625. firstname: 'sn',
  626. lastname: 'givenName',
  627. email: 'mail',
  628. login: 'mail',
  629. },
  630. },
  631. frontend: false
  632. )
  633. Setting.create_if_not_exists(
  634. title: 'Authentication via %s',
  635. name: 'auth_twitter',
  636. area: 'Security::ThirdPartyAuthentication',
  637. description: 'Enables user authentication via %s. Register your app first at [%s](%s).',
  638. options: {
  639. form: [
  640. {
  641. display: '',
  642. null: true,
  643. name: 'auth_twitter',
  644. tag: 'boolean',
  645. options: {
  646. true => 'yes',
  647. false => 'no',
  648. },
  649. },
  650. ],
  651. },
  652. preferences: {
  653. controller: 'SettingsAreaSwitch',
  654. sub: ['auth_twitter_credentials'],
  655. title_i18n: ['Twitter'],
  656. description_i18n: ['Twitter', 'Twitter Developer Site', 'https://dev.twitter.com/apps'],
  657. permission: ['admin.security'],
  658. },
  659. state: false,
  660. frontend: true
  661. )
  662. Setting.create_if_not_exists(
  663. title: 'Twitter App Credentials',
  664. name: 'auth_twitter_credentials',
  665. area: 'Security::ThirdPartyAuthentication::Twitter',
  666. description: 'App credentials for Twitter.',
  667. options: {
  668. form: [
  669. {
  670. display: 'Twitter Key',
  671. null: true,
  672. name: 'key',
  673. tag: 'input',
  674. },
  675. {
  676. display: 'Twitter Secret',
  677. null: true,
  678. name: 'secret',
  679. tag: 'input',
  680. },
  681. ],
  682. },
  683. state: {},
  684. preferences: {
  685. permission: ['admin.security'],
  686. },
  687. frontend: false
  688. )
  689. Setting.create_if_not_exists(
  690. title: 'Authentication via %s',
  691. name: 'auth_facebook',
  692. area: 'Security::ThirdPartyAuthentication',
  693. description: 'Enables user authentication via %s. Register your app first at [%s](%s).',
  694. options: {
  695. form: [
  696. {
  697. display: '',
  698. null: true,
  699. name: 'auth_facebook',
  700. tag: 'boolean',
  701. options: {
  702. true => 'yes',
  703. false => 'no',
  704. },
  705. },
  706. ],
  707. },
  708. preferences: {
  709. controller: 'SettingsAreaSwitch',
  710. sub: ['auth_facebook_credentials'],
  711. title_i18n: ['Facebook'],
  712. description_i18n: ['Facebook', 'Facebook Developer Site', 'https://developers.facebook.com/apps/'],
  713. permission: ['admin.security'],
  714. },
  715. state: false,
  716. frontend: true
  717. )
  718. Setting.create_if_not_exists(
  719. title: 'Facebook App Credentials',
  720. name: 'auth_facebook_credentials',
  721. area: 'Security::ThirdPartyAuthentication::Facebook',
  722. description: 'App credentials for Facebook.',
  723. options: {
  724. form: [
  725. {
  726. display: 'App ID',
  727. null: true,
  728. name: 'app_id',
  729. tag: 'input',
  730. },
  731. {
  732. display: 'App Secret',
  733. null: true,
  734. name: 'app_secret',
  735. tag: 'input',
  736. },
  737. ],
  738. },
  739. state: {},
  740. preferences: {
  741. permission: ['admin.security'],
  742. },
  743. frontend: false
  744. )
  745. Setting.create_if_not_exists(
  746. title: 'Authentication via %s',
  747. name: 'auth_google_oauth2',
  748. area: 'Security::ThirdPartyAuthentication',
  749. description: 'Enables user authentication via %s. Register your app first at [%s](%s).',
  750. options: {
  751. form: [
  752. {
  753. display: '',
  754. null: true,
  755. name: 'auth_google_oauth2',
  756. tag: 'boolean',
  757. options: {
  758. true => 'yes',
  759. false => 'no',
  760. },
  761. },
  762. ],
  763. },
  764. preferences: {
  765. controller: 'SettingsAreaSwitch',
  766. sub: ['auth_google_oauth2_credentials'],
  767. title_i18n: ['Google'],
  768. description_i18n: ['Google', 'Google API Console Site', 'https://console.developers.google.com/apis/credentials'],
  769. permission: ['admin.security'],
  770. },
  771. state: false,
  772. frontend: true
  773. )
  774. Setting.create_if_not_exists(
  775. title: 'Google App Credentials',
  776. name: 'auth_google_oauth2_credentials',
  777. area: 'Security::ThirdPartyAuthentication::Google',
  778. description: 'Enables user authentication via Google.',
  779. options: {
  780. form: [
  781. {
  782. display: 'Client ID',
  783. null: true,
  784. name: 'client_id',
  785. tag: 'input',
  786. },
  787. {
  788. display: 'Client Secret',
  789. null: true,
  790. name: 'client_secret',
  791. tag: 'input',
  792. },
  793. ],
  794. },
  795. state: {},
  796. preferences: {
  797. permission: ['admin.security'],
  798. },
  799. frontend: false
  800. )
  801. Setting.create_if_not_exists(
  802. title: 'Authentication via %s',
  803. name: 'auth_linkedin',
  804. area: 'Security::ThirdPartyAuthentication',
  805. description: 'Enables user authentication via %s. Register your app first at [%s](%s).',
  806. options: {
  807. form: [
  808. {
  809. display: '',
  810. null: true,
  811. name: 'auth_linkedin',
  812. tag: 'boolean',
  813. options: {
  814. true => 'yes',
  815. false => 'no',
  816. },
  817. },
  818. ],
  819. },
  820. preferences: {
  821. controller: 'SettingsAreaSwitch',
  822. sub: ['auth_linkedin_credentials'],
  823. title_i18n: ['LinkedIn'],
  824. description_i18n: ['LinkedIn', 'Linkedin Developer Site', 'https://www.linkedin.com/developer/apps'],
  825. permission: ['admin.security'],
  826. },
  827. state: false,
  828. frontend: true
  829. )
  830. Setting.create_if_not_exists(
  831. title: 'LinkedIn App Credentials',
  832. name: 'auth_linkedin_credentials',
  833. area: 'Security::ThirdPartyAuthentication::Linkedin',
  834. description: 'Enables user authentication via LinkedIn.',
  835. options: {
  836. form: [
  837. {
  838. display: 'App ID',
  839. null: true,
  840. name: 'app_id',
  841. tag: 'input',
  842. },
  843. {
  844. display: 'App Secret',
  845. null: true,
  846. name: 'app_secret',
  847. tag: 'input',
  848. },
  849. ],
  850. },
  851. state: {},
  852. preferences: {
  853. permission: ['admin.security'],
  854. },
  855. frontend: false
  856. )
  857. Setting.create_if_not_exists(
  858. title: 'Authentication via %s',
  859. name: 'auth_github',
  860. area: 'Security::ThirdPartyAuthentication',
  861. description: 'Enables user authentication via %s. Register your app first at [%s](%s).',
  862. options: {
  863. form: [
  864. {
  865. display: '',
  866. null: true,
  867. name: 'auth_github',
  868. tag: 'boolean',
  869. options: {
  870. true => 'yes',
  871. false => 'no',
  872. },
  873. },
  874. ],
  875. },
  876. preferences: {
  877. controller: 'SettingsAreaSwitch',
  878. sub: ['auth_github_credentials'],
  879. title_i18n: ['Github'],
  880. description_i18n: ['Github', 'Github OAuth Applications', 'https://github.com/settings/applications'],
  881. permission: ['admin.security'],
  882. },
  883. state: false,
  884. frontend: true
  885. )
  886. Setting.create_if_not_exists(
  887. title: 'Github App Credentials',
  888. name: 'auth_github_credentials',
  889. area: 'Security::ThirdPartyAuthentication::Github',
  890. description: 'Enables user authentication via Github.',
  891. options: {
  892. form: [
  893. {
  894. display: 'App ID',
  895. null: true,
  896. name: 'app_id',
  897. tag: 'input',
  898. },
  899. {
  900. display: 'App Secret',
  901. null: true,
  902. name: 'app_secret',
  903. tag: 'input',
  904. },
  905. ],
  906. },
  907. state: {},
  908. preferences: {
  909. permission: ['admin.security'],
  910. },
  911. frontend: false
  912. )
  913. Setting.create_if_not_exists(
  914. title: 'Authentication via %s',
  915. name: 'auth_gitlab',
  916. area: 'Security::ThirdPartyAuthentication',
  917. description: 'Enables user authentication via %s. Register your app first at [%s](%s).',
  918. options: {
  919. form: [
  920. {
  921. display: '',
  922. null: true,
  923. name: 'auth_gitlab',
  924. tag: 'boolean',
  925. options: {
  926. true => 'yes',
  927. false => 'no',
  928. },
  929. },
  930. ],
  931. },
  932. preferences: {
  933. controller: 'SettingsAreaSwitch',
  934. sub: ['auth_gitlab_credentials'],
  935. title_i18n: ['Gitlab'],
  936. description_i18n: ['Gitlab', 'Gitlab Applications', 'https://your-gitlab-host/admin/applications'],
  937. permission: ['admin.security'],
  938. },
  939. state: false,
  940. frontend: true
  941. )
  942. Setting.create_if_not_exists(
  943. title: 'Gitlab App Credentials',
  944. name: 'auth_gitlab_credentials',
  945. area: 'Security::ThirdPartyAuthentication::Gitlab',
  946. description: 'Enables user authentication via Gitlab.',
  947. options: {
  948. form: [
  949. {
  950. display: 'App ID',
  951. null: true,
  952. name: 'app_id',
  953. tag: 'input',
  954. },
  955. {
  956. display: 'App Secret',
  957. null: true,
  958. name: 'app_secret',
  959. tag: 'input',
  960. },
  961. {
  962. display: 'Site',
  963. null: true,
  964. name: 'site',
  965. tag: 'input',
  966. placeholder: 'https://gitlab.YOURDOMAIN.com',
  967. },
  968. ],
  969. },
  970. state: {},
  971. preferences: {
  972. permission: ['admin.security'],
  973. },
  974. frontend: false
  975. )
  976. Setting.create_if_not_exists(
  977. title: 'Authentication via %s',
  978. name: 'auth_oauth2',
  979. area: 'Security::ThirdPartyAuthentication',
  980. description: 'Enables user authentication via generic OAuth2. Register your app first.',
  981. options: {
  982. form: [
  983. {
  984. display: '',
  985. null: true,
  986. name: 'auth_oauth2',
  987. tag: 'boolean',
  988. options: {
  989. true => 'yes',
  990. false => 'no',
  991. },
  992. },
  993. ],
  994. },
  995. preferences: {
  996. controller: 'SettingsAreaSwitch',
  997. sub: ['auth_oauth2_credentials'],
  998. title_i18n: ['Generic OAuth2'],
  999. permission: ['admin.security'],
  1000. },
  1001. state: false,
  1002. frontend: true
  1003. )
  1004. Setting.create_if_not_exists(
  1005. title: 'Generic OAuth2 App Credentials',
  1006. name: 'auth_oauth2_credentials',
  1007. area: 'Security::ThirdPartyAuthentication::GenericOAuth',
  1008. description: 'Enables user authentication via generic OAuth2.',
  1009. options: {
  1010. form: [
  1011. {
  1012. display: 'Name',
  1013. null: true,
  1014. name: 'name',
  1015. tag: 'input',
  1016. placeholder: 'Some Provider Name',
  1017. },
  1018. {
  1019. display: 'App ID',
  1020. null: true,
  1021. name: 'app_id',
  1022. tag: 'input',
  1023. },
  1024. {
  1025. display: 'App Secret',
  1026. null: true,
  1027. name: 'app_secret',
  1028. tag: 'input',
  1029. },
  1030. {
  1031. display: 'Site',
  1032. null: true,
  1033. name: 'site',
  1034. tag: 'input',
  1035. placeholder: 'https://gitlab.YOURDOMAIN.com',
  1036. },
  1037. {
  1038. display: 'authorize_url',
  1039. null: true,
  1040. name: 'authorize_url',
  1041. tag: 'input',
  1042. placeholder: '/oauth/authorize',
  1043. },
  1044. {
  1045. display: 'token_url',
  1046. null: true,
  1047. name: 'token_url',
  1048. tag: 'input',
  1049. placeholder: '/oauth/token',
  1050. },
  1051. ],
  1052. },
  1053. state: {},
  1054. preferences: {
  1055. permission: ['admin.security'],
  1056. },
  1057. frontend: false
  1058. )
  1059. Setting.create_if_not_exists(
  1060. title: 'Minimum length',
  1061. name: 'password_min_size',
  1062. area: 'Security::Password',
  1063. description: 'Password needs to have at least a minimal number of characters.',
  1064. options: {
  1065. form: [
  1066. {
  1067. display: '',
  1068. null: true,
  1069. name: 'password_min_size',
  1070. tag: 'select',
  1071. options: {
  1072. 4 => ' 4',
  1073. 5 => ' 5',
  1074. 6 => ' 6',
  1075. 7 => ' 7',
  1076. 8 => ' 8',
  1077. 9 => ' 9',
  1078. 10 => '10',
  1079. 11 => '11',
  1080. 12 => '12',
  1081. 13 => '13',
  1082. 14 => '14',
  1083. 15 => '15',
  1084. 16 => '16',
  1085. 17 => '17',
  1086. 18 => '18',
  1087. 19 => '19',
  1088. 20 => '20',
  1089. },
  1090. },
  1091. ],
  1092. },
  1093. state: 6,
  1094. preferences: {
  1095. permission: ['admin.security'],
  1096. },
  1097. frontend: false
  1098. )
  1099. Setting.create_if_not_exists(
  1100. title: '2 lower and 2 upper characters',
  1101. name: 'password_min_2_lower_2_upper_characters',
  1102. area: 'Security::Password',
  1103. description: 'Password needs to contain 2 lower and 2 upper characters.',
  1104. options: {
  1105. form: [
  1106. {
  1107. display: '',
  1108. null: true,
  1109. name: 'password_min_2_lower_2_upper_characters',
  1110. tag: 'select',
  1111. options: {
  1112. 1 => 'yes',
  1113. 0 => 'no',
  1114. },
  1115. },
  1116. ],
  1117. },
  1118. state: 0,
  1119. preferences: {
  1120. permission: ['admin.security'],
  1121. },
  1122. frontend: false
  1123. )
  1124. Setting.create_if_not_exists(
  1125. title: 'Digit required',
  1126. name: 'password_need_digit',
  1127. area: 'Security::Password',
  1128. description: 'Password needs to contain at least one digit.',
  1129. options: {
  1130. form: [
  1131. {
  1132. display: 'Needed',
  1133. null: true,
  1134. name: 'password_need_digit',
  1135. tag: 'select',
  1136. options: {
  1137. 1 => 'yes',
  1138. 0 => 'no',
  1139. },
  1140. },
  1141. ],
  1142. },
  1143. state: 1,
  1144. preferences: {
  1145. permission: ['admin.security'],
  1146. },
  1147. frontend: false
  1148. )
  1149. Setting.create_if_not_exists(
  1150. title: 'Maximum failed logins',
  1151. name: 'password_max_login_failed',
  1152. area: 'Security::Password',
  1153. description: 'Number of failed logins after account will be deactivated.',
  1154. options: {
  1155. form: [
  1156. {
  1157. display: '',
  1158. null: true,
  1159. name: 'password_max_login_failed',
  1160. tag: 'select',
  1161. options: {
  1162. 4 => ' 4',
  1163. 5 => ' 5',
  1164. 6 => ' 6',
  1165. 7 => ' 7',
  1166. 8 => ' 8',
  1167. 9 => ' 9',
  1168. 10 => '10',
  1169. 11 => '11',
  1170. 13 => '13',
  1171. 14 => '14',
  1172. 15 => '15',
  1173. 16 => '16',
  1174. 17 => '17',
  1175. 18 => '18',
  1176. 19 => '19',
  1177. 20 => '20',
  1178. },
  1179. },
  1180. ],
  1181. },
  1182. state: 10,
  1183. preferences: {
  1184. permission: ['admin.security'],
  1185. },
  1186. frontend: false
  1187. )
  1188. Setting.create_if_not_exists(
  1189. title: 'Ticket Hook',
  1190. name: 'ticket_hook',
  1191. area: 'Ticket::Base',
  1192. description: 'The identifier for a ticket, e. g. Ticket#, Call#, MyTicket#. The default is Ticket#.',
  1193. options: {
  1194. form: [
  1195. {
  1196. display: '',
  1197. null: false,
  1198. name: 'ticket_hook',
  1199. tag: 'input',
  1200. },
  1201. ],
  1202. },
  1203. preferences: {
  1204. render: true,
  1205. placeholder: true,
  1206. authentication: true,
  1207. permission: ['admin.ticket'],
  1208. },
  1209. state: 'Ticket#',
  1210. frontend: true
  1211. )
  1212. Setting.create_if_not_exists(
  1213. title: 'Ticket Hook Divider',
  1214. name: 'ticket_hook_divider',
  1215. area: 'Ticket::Base::Shadow',
  1216. description: 'The divider between TicketHook and ticket number. E. g. \': \'.',
  1217. options: {
  1218. form: [
  1219. {
  1220. display: '',
  1221. null: true,
  1222. name: 'ticket_hook_divider',
  1223. tag: 'input',
  1224. },
  1225. ],
  1226. },
  1227. state: '',
  1228. preferences: {
  1229. permission: ['admin.ticket'],
  1230. },
  1231. frontend: false
  1232. )
  1233. Setting.create_if_not_exists(
  1234. title: 'Ticket Hook Position',
  1235. name: 'ticket_hook_position',
  1236. area: 'Ticket::Base',
  1237. description: "The format of the subject.
  1238. * **Right** means **Some Subject [Ticket#12345]**
  1239. * **Left** means **[Ticket#12345] Some Subject**
  1240. * **None** means **Some Subject** (without ticket number). In the last case you should enable *postmaster_follow_up_search_in* to recognize follow-ups based on email headers and/or body.",
  1241. options: {
  1242. form: [
  1243. {
  1244. display: '',
  1245. null: true,
  1246. name: 'ticket_hook_position',
  1247. tag: 'select',
  1248. translate: true,
  1249. options: {
  1250. 'left' => 'left',
  1251. 'right' => 'right',
  1252. 'none' => 'none',
  1253. },
  1254. },
  1255. ],
  1256. },
  1257. state: 'right',
  1258. preferences: {
  1259. controller: 'SettingsAreaTicketHookPosition',
  1260. permission: ['admin.ticket'],
  1261. },
  1262. frontend: false
  1263. )
  1264. Setting.create_if_not_exists(
  1265. title: 'Ticket Number Format',
  1266. name: 'ticket_number',
  1267. area: 'Ticket::Number',
  1268. description: "Selects the ticket number generator module.
  1269. * **Increment** increments the ticket number, the SystemID and the counter are used with SystemID.Counter format (e.g. 1010138, 1010139).
  1270. * 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).",
  1271. options: {
  1272. form: [
  1273. {
  1274. display: '',
  1275. null: true,
  1276. name: 'ticket_number',
  1277. tag: 'select',
  1278. translate: true,
  1279. options: {
  1280. 'Ticket::Number::Increment' => 'Increment (SystemID.Counter)',
  1281. 'Ticket::Number::Date' => 'Date (Year.Month.Day.SystemID.Counter)',
  1282. },
  1283. },
  1284. ],
  1285. },
  1286. state: 'Ticket::Number::Increment',
  1287. preferences: {
  1288. settings_included: %w(ticket_number_increment ticket_number_date),
  1289. controller: 'SettingsAreaTicketNumber',
  1290. permission: ['admin.ticket'],
  1291. },
  1292. frontend: false
  1293. )
  1294. Setting.create_if_not_exists(
  1295. title: 'Ticket Number Increment',
  1296. name: 'ticket_number_increment',
  1297. area: 'Ticket::Number',
  1298. description: '-',
  1299. options: {
  1300. form: [
  1301. {
  1302. display: 'Checksum',
  1303. null: true,
  1304. name: 'checksum',
  1305. tag: 'boolean',
  1306. options: {
  1307. true => 'yes',
  1308. false => 'no',
  1309. },
  1310. },
  1311. {
  1312. display: 'Min. size of number',
  1313. null: true,
  1314. name: 'min_size',
  1315. tag: 'select',
  1316. options: {
  1317. 1 => ' 1',
  1318. 2 => ' 2',
  1319. 3 => ' 3',
  1320. 4 => ' 4',
  1321. 5 => ' 5',
  1322. 6 => ' 6',
  1323. 7 => ' 7',
  1324. 8 => ' 8',
  1325. 9 => ' 9',
  1326. 10 => '10',
  1327. 11 => '11',
  1328. 12 => '12',
  1329. 13 => '13',
  1330. 14 => '14',
  1331. 15 => '15',
  1332. 16 => '16',
  1333. 17 => '17',
  1334. 18 => '18',
  1335. 19 => '19',
  1336. 20 => '20',
  1337. },
  1338. },
  1339. ],
  1340. },
  1341. state: {
  1342. checksum: false,
  1343. min_size: 5,
  1344. },
  1345. preferences: {
  1346. permission: ['admin.ticket'],
  1347. hidden: true,
  1348. },
  1349. frontend: false
  1350. )
  1351. Setting.create_if_not_exists(
  1352. title: 'Ticket Number Increment Date',
  1353. name: 'ticket_number_date',
  1354. area: 'Ticket::Number',
  1355. description: '-',
  1356. options: {
  1357. form: [
  1358. {
  1359. display: 'Checksum',
  1360. null: true,
  1361. name: 'checksum',
  1362. tag: 'boolean',
  1363. options: {
  1364. true => 'yes',
  1365. false => 'no',
  1366. },
  1367. },
  1368. ],
  1369. },
  1370. state: {
  1371. checksum: false
  1372. },
  1373. preferences: {
  1374. permission: ['admin.ticket'],
  1375. hidden: true,
  1376. },
  1377. frontend: false
  1378. )
  1379. Setting.create_if_not_exists(
  1380. title: 'Enable Ticket creation',
  1381. name: 'customer_ticket_create',
  1382. area: 'CustomerWeb::Base',
  1383. description: 'Defines if a customer can create tickets via the web interface.',
  1384. options: {
  1385. form: [
  1386. {
  1387. display: '',
  1388. null: true,
  1389. name: 'customer_ticket_create',
  1390. tag: 'boolean',
  1391. options: {
  1392. true => 'yes',
  1393. false => 'no',
  1394. },
  1395. },
  1396. ],
  1397. },
  1398. state: true,
  1399. preferences: {
  1400. authentication: true,
  1401. permission: ['admin.channel_web'],
  1402. },
  1403. frontend: true
  1404. )
  1405. Setting.create_if_not_exists(
  1406. title: 'Group selection for Ticket creation',
  1407. name: 'customer_ticket_create_group_ids',
  1408. area: 'CustomerWeb::Base',
  1409. description: 'Defines groups for which a customer can create tickets via web interface. "-" means all groups are available.',
  1410. options: {
  1411. form: [
  1412. {
  1413. display: '',
  1414. null: true,
  1415. name: 'group_ids',
  1416. tag: 'select',
  1417. multiple: true,
  1418. nulloption: true,
  1419. relation: 'Group',
  1420. },
  1421. ],
  1422. },
  1423. state: '',
  1424. preferences: {
  1425. authentication: true,
  1426. permission: ['admin.channel_web'],
  1427. },
  1428. frontend: true
  1429. )
  1430. Setting.create_if_not_exists(
  1431. title: 'Enable Ticket creation',
  1432. name: 'form_ticket_create',
  1433. area: 'Form::Base',
  1434. description: 'Defines if tickets can be created via web form.',
  1435. options: {
  1436. form: [
  1437. {
  1438. display: '',
  1439. null: true,
  1440. name: 'form_ticket_create',
  1441. tag: 'boolean',
  1442. options: {
  1443. true => 'yes',
  1444. false => 'no',
  1445. },
  1446. },
  1447. ],
  1448. },
  1449. state: false,
  1450. preferences: {
  1451. permission: ['admin.channel_formular'],
  1452. },
  1453. frontend: false,
  1454. )
  1455. Setting.create_if_not_exists(
  1456. title: 'Ticket Subject Size',
  1457. name: 'ticket_subject_size',
  1458. area: 'Email::Base',
  1459. description: 'Max. length of the subject in an email reply.',
  1460. options: {
  1461. form: [
  1462. {
  1463. display: '',
  1464. null: false,
  1465. name: 'ticket_subject_size',
  1466. tag: 'input',
  1467. },
  1468. ],
  1469. },
  1470. state: '110',
  1471. preferences: {
  1472. permission: ['admin.channel_email'],
  1473. },
  1474. frontend: false
  1475. )
  1476. Setting.create_if_not_exists(
  1477. title: 'Ticket Subject Reply',
  1478. name: 'ticket_subject_re',
  1479. area: 'Email::Base',
  1480. description: 'The text at the beginning of the subject in an email reply, e. g. RE, AW, or AS.',
  1481. options: {
  1482. form: [
  1483. {
  1484. display: '',
  1485. null: true,
  1486. name: 'ticket_subject_re',
  1487. tag: 'input',
  1488. },
  1489. ],
  1490. },
  1491. state: 'RE',
  1492. preferences: {
  1493. permission: ['admin.channel_email'],
  1494. },
  1495. frontend: false
  1496. )
  1497. Setting.create_if_not_exists(
  1498. title: 'Sender Format',
  1499. name: 'ticket_define_email_from',
  1500. area: 'Email::Base',
  1501. description: 'Defines how the From field of emails (sent from answers and email tickets) should look like.',
  1502. options: {
  1503. form: [
  1504. {
  1505. display: '',
  1506. null: true,
  1507. name: 'ticket_define_email_from',
  1508. tag: 'select',
  1509. options: {
  1510. SystemAddressName: 'System Address Display Name',
  1511. AgentNameSystemAddressName: 'Agent Name + FromSeparator + System Address Display Name',
  1512. },
  1513. },
  1514. ],
  1515. },
  1516. state: 'AgentNameSystemAddressName',
  1517. preferences: {
  1518. permission: ['admin.channel_email'],
  1519. },
  1520. frontend: false
  1521. )
  1522. Setting.create_if_not_exists(
  1523. title: 'Sender Format Separator',
  1524. name: 'ticket_define_email_from_separator',
  1525. area: 'Email::Base',
  1526. description: 'Defines the separator between the agent\'s real name and the given group email address.',
  1527. options: {
  1528. form: [
  1529. {
  1530. display: '',
  1531. null: false,
  1532. name: 'ticket_define_email_from_separator',
  1533. tag: 'input',
  1534. },
  1535. ],
  1536. },
  1537. state: 'via',
  1538. preferences: {
  1539. permission: ['admin.channel_email'],
  1540. },
  1541. frontend: false
  1542. )
  1543. Setting.create_if_not_exists(
  1544. title: 'Maximum Email Size',
  1545. name: 'postmaster_max_size',
  1546. area: 'Email::Base',
  1547. description: 'Maximum size in MB of emails.',
  1548. options: {
  1549. form: [
  1550. {
  1551. display: '',
  1552. null: true,
  1553. name: 'postmaster_max_size',
  1554. tag: 'select',
  1555. options: {
  1556. 1 => ' 1',
  1557. 2 => ' 2',
  1558. 3 => ' 3',
  1559. 4 => ' 4',
  1560. 5 => ' 5',
  1561. 6 => ' 6',
  1562. 7 => ' 7',
  1563. 8 => ' 8',
  1564. 9 => ' 9',
  1565. 10 => ' 10',
  1566. 15 => ' 15',
  1567. 20 => ' 20',
  1568. 25 => ' 25',
  1569. 30 => ' 30',
  1570. 35 => ' 35',
  1571. 40 => ' 40',
  1572. 45 => ' 45',
  1573. 50 => ' 50',
  1574. 60 => ' 60',
  1575. 70 => ' 70',
  1576. 80 => ' 80',
  1577. 90 => ' 90',
  1578. 100 => '100',
  1579. 125 => '125',
  1580. 150 => '150',
  1581. },
  1582. },
  1583. ],
  1584. },
  1585. state: 10,
  1586. preferences: {
  1587. online_service_disable: true,
  1588. permission: ['admin.channel_email'],
  1589. },
  1590. frontend: false
  1591. )
  1592. Setting.create_if_not_exists(
  1593. title: 'Additional follow-up detection',
  1594. name: 'postmaster_follow_up_search_in',
  1595. area: 'Email::Base',
  1596. description: 'By default the follow-up check is done via the subject of an email. With this setting you can add more fields for which the follow-up check will be executed.',
  1597. options: {
  1598. form: [
  1599. {
  1600. display: '',
  1601. null: true,
  1602. name: 'postmaster_follow_up_search_in',
  1603. tag: 'checkbox',
  1604. options: {
  1605. 'references' => 'References - Search for follow up also in In-Reply-To or References headers.',
  1606. 'body' => 'Body - Search for follow up also in mail body.',
  1607. 'attachment' => 'Attachment - Search for follow up also in attachments.',
  1608. },
  1609. },
  1610. ],
  1611. },
  1612. state: [],
  1613. preferences: {
  1614. permission: ['admin.channel_email'],
  1615. },
  1616. frontend: false
  1617. )
  1618. Setting.create_if_not_exists(
  1619. title: 'Notification Sender',
  1620. name: 'notification_sender',
  1621. area: 'Email::Base',
  1622. description: 'Defines the sender of email notifications.',
  1623. options: {
  1624. form: [
  1625. {
  1626. display: '',
  1627. null: false,
  1628. name: 'notification_sender',
  1629. tag: 'input',
  1630. },
  1631. ],
  1632. },
  1633. state: 'Notification Master <noreply@#{config.fqdn}>',
  1634. preferences: {
  1635. online_service_disable: true,
  1636. permission: ['admin.channel_email'],
  1637. },
  1638. frontend: false
  1639. )
  1640. Setting.create_if_not_exists(
  1641. title: 'Block Notifications',
  1642. name: 'send_no_auto_response_reg_exp',
  1643. area: 'Email::Base',
  1644. description: 'If this regex matches, no notification will be sent by the sender.',
  1645. options: {
  1646. form: [
  1647. {
  1648. display: '',
  1649. null: false,
  1650. name: 'send_no_auto_response_reg_exp',
  1651. tag: 'input',
  1652. },
  1653. ],
  1654. },
  1655. state: '(mailer-daemon|postmaster|abuse|root|noreply|noreply.+?|no-reply|no-reply.+?)@.+?\..+?',
  1656. preferences: {
  1657. online_service_disable: true,
  1658. permission: ['admin.channel_email'],
  1659. },
  1660. frontend: false
  1661. )
  1662. Setting.create_if_not_exists(
  1663. title: 'API Token Access',
  1664. name: 'api_token_access',
  1665. area: 'API::Base',
  1666. description: 'Enable REST API using tokens (not username/email address and password). Each user needs to create its own access tokens in user profile.',
  1667. options: {
  1668. form: [
  1669. {
  1670. display: '',
  1671. null: true,
  1672. name: 'api_token_access',
  1673. tag: 'boolean',
  1674. options: {
  1675. true => 'yes',
  1676. false => 'no',
  1677. },
  1678. },
  1679. ],
  1680. },
  1681. state: true,
  1682. preferences: {
  1683. permission: ['admin.api'],
  1684. },
  1685. frontend: false
  1686. )
  1687. Setting.create_if_not_exists(
  1688. title: 'API Password Access',
  1689. name: 'api_password_access',
  1690. area: 'API::Base',
  1691. description: 'Enable REST API access using the username/email address and password for the authentication user.',
  1692. options: {
  1693. form: [
  1694. {
  1695. display: '',
  1696. null: true,
  1697. name: 'api_password_access',
  1698. tag: 'boolean',
  1699. options: {
  1700. true => 'yes',
  1701. false => 'no',
  1702. },
  1703. },
  1704. ],
  1705. },
  1706. state: true,
  1707. preferences: {
  1708. permission: ['admin.api'],
  1709. },
  1710. frontend: false
  1711. )
  1712. Setting.create_if_not_exists(
  1713. title: 'Monitoring Token',
  1714. name: 'monitoring_token',
  1715. area: 'HealthCheck::Base',
  1716. description: 'Token for monitoring.',
  1717. options: {
  1718. form: [
  1719. {
  1720. display: '',
  1721. null: false,
  1722. name: 'monitoring_token',
  1723. tag: 'input',
  1724. },
  1725. ],
  1726. },
  1727. state: SecureRandom.urlsafe_base64(40),
  1728. preferences: {
  1729. permission: ['admin.monitoring'],
  1730. },
  1731. frontend: false
  1732. )
  1733. Setting.create_if_not_exists(
  1734. title: 'Enable Chat',
  1735. name: 'chat',
  1736. area: 'Chat::Base',
  1737. description: 'Enable/disable online chat.',
  1738. options: {
  1739. form: [
  1740. {
  1741. display: '',
  1742. null: true,
  1743. name: 'chat',
  1744. tag: 'boolean',
  1745. options: {
  1746. true => 'yes',
  1747. false => 'no',
  1748. },
  1749. },
  1750. ],
  1751. },
  1752. preferences: {
  1753. trigger: ['menu:render', 'chat:rerender'],
  1754. permission: ['admin.channel_chat'],
  1755. },
  1756. state: false,
  1757. frontend: true
  1758. )
  1759. Setting.create_if_not_exists(
  1760. title: 'Agent idle timeout',
  1761. name: 'chat_agent_idle_timeout',
  1762. area: 'Chat::Extended',
  1763. description: 'Idle timeout in seconds until agent is set offline automatically.',
  1764. options: {
  1765. form: [
  1766. {
  1767. display: '',
  1768. null: false,
  1769. name: 'chat_agent_idle_timeout',
  1770. tag: 'input',
  1771. },
  1772. ],
  1773. },
  1774. state: '120',
  1775. preferences: {
  1776. permission: ['admin.channel_chat'],
  1777. },
  1778. frontend: true
  1779. )
  1780. Setting.create_if_not_exists(
  1781. title: 'Defines searchable models.',
  1782. name: 'models_searchable',
  1783. area: 'Models::Base',
  1784. description: 'Defines the searchable models.',
  1785. options: {},
  1786. state: [],
  1787. preferences: {
  1788. authentication: true,
  1789. },
  1790. frontend: true,
  1791. )
  1792. Setting.create_if_not_exists(
  1793. title: 'Default Screen',
  1794. name: 'default_controller',
  1795. area: 'Core',
  1796. description: 'Defines the default screen.',
  1797. options: {},
  1798. state: '#dashboard',
  1799. frontend: true
  1800. )
  1801. Setting.create_if_not_exists(
  1802. title: 'Elasticsearch Endpoint URL',
  1803. name: 'es_url',
  1804. area: 'SearchIndex::Elasticsearch',
  1805. description: 'Defines endpoint of Elasticsearch.',
  1806. state: '',
  1807. preferences: { online_service_disable: true },
  1808. frontend: false
  1809. )
  1810. Setting.create_if_not_exists(
  1811. title: 'Elasticsearch Endpoint User',
  1812. name: 'es_user',
  1813. area: 'SearchIndex::Elasticsearch',
  1814. description: 'Defines HTTP basic auth user of Elasticsearch.',
  1815. state: '',
  1816. preferences: { online_service_disable: true },
  1817. frontend: false
  1818. )
  1819. Setting.create_if_not_exists(
  1820. title: 'Elasticsearch Endpoint Password',
  1821. name: 'es_password',
  1822. area: 'SearchIndex::Elasticsearch',
  1823. description: 'Defines HTTP basic auth password of Elasticsearch.',
  1824. state: '',
  1825. preferences: { online_service_disable: true },
  1826. frontend: false
  1827. )
  1828. Setting.create_if_not_exists(
  1829. title: 'Elasticsearch Endpoint Index',
  1830. name: 'es_index',
  1831. area: 'SearchIndex::Elasticsearch',
  1832. description: 'Defines Elasticsearch index name.',
  1833. state: 'zammad',
  1834. preferences: { online_service_disable: true },
  1835. frontend: false
  1836. )
  1837. Setting.create_if_not_exists(
  1838. title: 'Elasticsearch Attachment Extensions',
  1839. name: 'es_attachment_ignore',
  1840. area: 'SearchIndex::Elasticsearch',
  1841. description: 'Defines attachment extensions which will be ignored by Elasticsearch.',
  1842. state: [ '.png', '.jpg', '.jpeg', '.mpeg', '.mpg', '.mov', '.bin', '.exe', '.box', '.mbox' ],
  1843. preferences: { online_service_disable: true },
  1844. frontend: false
  1845. )
  1846. Setting.create_if_not_exists(
  1847. title: 'Elasticsearch Attachment Size',
  1848. name: 'es_attachment_max_size_in_mb',
  1849. area: 'SearchIndex::Elasticsearch',
  1850. description: 'Define max. attachment size for Elasticsearch.',
  1851. state: 50,
  1852. preferences: { online_service_disable: true },
  1853. frontend: false
  1854. )
  1855. Setting.create_if_not_exists(
  1856. title: 'Import Mode',
  1857. name: 'import_mode',
  1858. area: 'Import::Base',
  1859. description: 'Puts Zammad into import mode (disables some triggers).',
  1860. options: {
  1861. form: [
  1862. {
  1863. display: '',
  1864. null: true,
  1865. name: 'import_mode',
  1866. tag: 'boolean',
  1867. options: {
  1868. true => 'yes',
  1869. false => 'no',
  1870. },
  1871. },
  1872. ],
  1873. },
  1874. state: false,
  1875. frontend: true
  1876. )
  1877. Setting.create_if_not_exists(
  1878. title: 'Import Backend',
  1879. name: 'import_backend',
  1880. area: 'Import::Base::Internal',
  1881. description: 'Set backend which is being used for import.',
  1882. options: {},
  1883. state: '',
  1884. frontend: true
  1885. )
  1886. Setting.create_if_not_exists(
  1887. title: 'Ignore Escalation/SLA Information',
  1888. name: 'import_ignore_sla',
  1889. area: 'Import::Base',
  1890. description: 'Ignore escalation/SLA information for import.',
  1891. options: {
  1892. form: [
  1893. {
  1894. display: '',
  1895. null: true,
  1896. name: 'import_ignore_sla',
  1897. tag: 'boolean',
  1898. options: {
  1899. true => 'yes',
  1900. false => 'no',
  1901. },
  1902. },
  1903. ],
  1904. },
  1905. state: false,
  1906. frontend: false
  1907. )
  1908. Setting.create_if_not_exists(
  1909. title: 'Import Endpoint',
  1910. name: 'import_otrs_endpoint',
  1911. area: 'Import::OTRS',
  1912. description: 'Defines OTRS endpoint to import users, tickets, states and articles.',
  1913. options: {
  1914. form: [
  1915. {
  1916. display: '',
  1917. null: false,
  1918. name: 'import_otrs_endpoint',
  1919. tag: 'input',
  1920. },
  1921. ],
  1922. },
  1923. state: 'http://otrs_host/otrs',
  1924. frontend: false
  1925. )
  1926. Setting.create_if_not_exists(
  1927. title: 'Import Key',
  1928. name: 'import_otrs_endpoint_key',
  1929. area: 'Import::OTRS',
  1930. description: 'Defines OTRS endpoint authentication key.',
  1931. options: {
  1932. form: [
  1933. {
  1934. display: '',
  1935. null: false,
  1936. name: 'import_otrs_endpoint_key',
  1937. tag: 'input',
  1938. },
  1939. ],
  1940. },
  1941. state: '',
  1942. frontend: false
  1943. )
  1944. Setting.create_if_not_exists(
  1945. title: 'Import User for HTTP basic authentication',
  1946. name: 'import_otrs_user',
  1947. area: 'Import::OTRS',
  1948. description: 'Defines HTTP basic authentication user (only if OTRS is protected via HTTP basic auth).',
  1949. options: {
  1950. form: [
  1951. {
  1952. display: '',
  1953. null: true,
  1954. name: 'import_otrs_user',
  1955. tag: 'input',
  1956. },
  1957. ],
  1958. },
  1959. state: '',
  1960. frontend: false
  1961. )
  1962. Setting.create_if_not_exists(
  1963. title: 'Import Password for http basic authentication',
  1964. name: 'import_otrs_password',
  1965. area: 'Import::OTRS',
  1966. description: 'Defines http basic authentication password (only if OTRS is protected via http basic auth).',
  1967. options: {
  1968. form: [
  1969. {
  1970. display: '',
  1971. null: true,
  1972. name: 'import_otrs_password',
  1973. tag: 'input',
  1974. },
  1975. ],
  1976. },
  1977. state: '',
  1978. frontend: false
  1979. )
  1980. Setting.create_if_not_exists(
  1981. title: 'Import Endpoint',
  1982. name: 'import_zendesk_endpoint',
  1983. area: 'Import::Zendesk',
  1984. description: 'Defines Zendesk endpoint to import users, ticket, states and articles.',
  1985. options: {
  1986. form: [
  1987. {
  1988. display: '',
  1989. null: false,
  1990. name: 'import_zendesk_endpoint',
  1991. tag: 'input',
  1992. },
  1993. ],
  1994. },
  1995. state: 'https://yours.zendesk.com/api/v2',
  1996. frontend: false
  1997. )
  1998. Setting.create_if_not_exists(
  1999. title: 'Import Key for requesting the Zendesk API',
  2000. name: 'import_zendesk_endpoint_key',
  2001. area: 'Import::Zendesk',
  2002. description: 'Defines Zendesk endpoint authentication key.',
  2003. options: {
  2004. form: [
  2005. {
  2006. display: '',
  2007. null: false,
  2008. name: 'import_zendesk_endpoint_key',
  2009. tag: 'input',
  2010. },
  2011. ],
  2012. },
  2013. state: '',
  2014. frontend: false
  2015. )
  2016. Setting.create_if_not_exists(
  2017. title: 'Import User for requesting the Zendesk API',
  2018. name: 'import_zendesk_endpoint_username',
  2019. area: 'Import::Zendesk',
  2020. description: 'Defines Zendesk endpoint authentication user.',
  2021. options: {
  2022. form: [
  2023. {
  2024. display: '',
  2025. null: true,
  2026. name: 'import_zendesk_endpoint_username',
  2027. tag: 'input',
  2028. },
  2029. ],
  2030. },
  2031. state: '',
  2032. frontend: false
  2033. )
  2034. Setting.create_if_not_exists(
  2035. title: 'Time Accounting',
  2036. name: 'time_accounting',
  2037. area: 'Web::Base',
  2038. description: 'Enable time accounting.',
  2039. options: {
  2040. form: [
  2041. {
  2042. display: '',
  2043. null: true,
  2044. name: 'time_accounting',
  2045. tag: 'boolean',
  2046. options: {
  2047. true => 'yes',
  2048. false => 'no',
  2049. },
  2050. },
  2051. ],
  2052. },
  2053. preferences: {
  2054. authentication: true,
  2055. permission: ['admin.time_accounting'],
  2056. },
  2057. state: false,
  2058. frontend: true
  2059. )
  2060. Setting.create_if_not_exists(
  2061. title: 'Time Accounting Selector',
  2062. name: 'time_accounting_selector',
  2063. area: 'Web::Base',
  2064. description: 'Enable time accounting for these tickets.',
  2065. options: {
  2066. form: [
  2067. {},
  2068. ],
  2069. },
  2070. preferences: {
  2071. authentication: true,
  2072. permission: ['admin.time_accounting'],
  2073. },
  2074. state: {},
  2075. frontend: true
  2076. )
  2077. Setting.create_if_not_exists(
  2078. title: 'New Tags',
  2079. name: 'tag_new',
  2080. area: 'Web::Base',
  2081. description: 'Allow users to create new tags.',
  2082. options: {
  2083. form: [
  2084. {
  2085. display: '',
  2086. null: true,
  2087. name: 'tag_new',
  2088. tag: 'boolean',
  2089. options: {
  2090. true => 'yes',
  2091. false => 'no',
  2092. },
  2093. },
  2094. ],
  2095. },
  2096. preferences: {
  2097. authentication: true,
  2098. permission: ['admin.tag'],
  2099. },
  2100. state: true,
  2101. frontend: true
  2102. )
  2103. Setting.create_if_not_exists(
  2104. title: 'Default calendar tickets subscriptions',
  2105. name: 'defaults_calendar_subscriptions_tickets',
  2106. area: 'Defaults::CalendarSubscriptions',
  2107. description: 'Defines the default calendar tickets subscription settings.',
  2108. options: {},
  2109. state: {
  2110. escalation: {
  2111. own: true,
  2112. not_assigned: false,
  2113. },
  2114. new_open: {
  2115. own: true,
  2116. not_assigned: false,
  2117. },
  2118. pending: {
  2119. own: true,
  2120. not_assigned: false,
  2121. }
  2122. },
  2123. preferences: {
  2124. authentication: true,
  2125. },
  2126. frontend: true
  2127. )
  2128. Setting.create_if_not_exists(
  2129. title: 'Defines translator identifier.',
  2130. name: 'translator_key',
  2131. area: 'i18n::translator_key',
  2132. description: 'Defines the translator identifier for contributions.',
  2133. options: {},
  2134. state: '',
  2135. frontend: false
  2136. )
  2137. Setting.create_if_not_exists(
  2138. title: 'Defines postmaster filter.',
  2139. name: '0010_postmaster_filter_trusted',
  2140. area: 'Postmaster::PreFilter',
  2141. description: 'Defines postmaster filter to remove X-Zammad headers from not trusted sources.',
  2142. options: {},
  2143. state: 'Channel::Filter::Trusted',
  2144. frontend: false
  2145. )
  2146. Setting.create_if_not_exists(
  2147. title: 'Defines postmaster filter.',
  2148. name: '0012_postmaster_filter_sender_is_system_address',
  2149. area: 'Postmaster::PreFilter',
  2150. description: 'Defines postmaster filter to check if email has been created by Zammad itself and will set the article sender.',
  2151. options: {},
  2152. state: 'Channel::Filter::SenderIsSystemAddress',
  2153. frontend: false
  2154. )
  2155. Setting.create_if_not_exists(
  2156. title: 'Defines postmaster filter.',
  2157. name: '0014_postmaster_filter_own_notification_loop_detection',
  2158. area: 'Postmaster::PreFilter',
  2159. description: 'Define postmaster filter to check if email is a own created notification email, then ignore it to prevent email loops.',
  2160. options: {},
  2161. state: 'Channel::Filter::OwnNotificationLoopDetection',
  2162. frontend: false
  2163. )
  2164. Setting.create_if_not_exists(
  2165. title: 'Defines postmaster filter.',
  2166. name: '0015_postmaster_filter_identify_sender',
  2167. area: 'Postmaster::PreFilter',
  2168. description: 'Defines postmaster filter to identify sender user.',
  2169. options: {},
  2170. state: 'Channel::Filter::IdentifySender',
  2171. frontend: false
  2172. )
  2173. Setting.create_if_not_exists(
  2174. title: 'Defines postmaster filter.',
  2175. name: '0020_postmaster_filter_auto_response_check',
  2176. area: 'Postmaster::PreFilter',
  2177. description: 'Defines postmaster filter to identify auto responses to prevent auto replies from Zammad.',
  2178. options: {},
  2179. state: 'Channel::Filter::AutoResponseCheck',
  2180. frontend: false
  2181. )
  2182. Setting.create_if_not_exists(
  2183. title: 'Defines postmaster filter.',
  2184. name: '0030_postmaster_filter_out_of_office_check',
  2185. area: 'Postmaster::PreFilter',
  2186. description: 'Defines postmaster filter to identify out-of-office emails for follow-up detection and keeping current ticket state.',
  2187. options: {},
  2188. state: 'Channel::Filter::OutOfOfficeCheck',
  2189. frontend: false
  2190. )
  2191. Setting.create_if_not_exists(
  2192. title: 'Defines postmaster filter.',
  2193. name: '0100_postmaster_filter_follow_up_check',
  2194. area: 'Postmaster::PreFilter',
  2195. description: 'Defines postmaster filter to identify follow-ups (based on admin settings).',
  2196. options: {},
  2197. state: 'Channel::Filter::FollowUpCheck',
  2198. frontend: false
  2199. )
  2200. Setting.create_if_not_exists(
  2201. title: 'Defines postmaster filter.',
  2202. name: '0200_postmaster_filter_follow_up_possible_check',
  2203. area: 'Postmaster::PreFilter',
  2204. description: 'Define postmaster filter to check if follow ups get created (based on admin settings).',
  2205. options: {},
  2206. state: 'Channel::Filter::FollowUpPossibleCheck',
  2207. frontend: false
  2208. )
  2209. Setting.create_if_not_exists(
  2210. title: 'Defines postmaster filter.',
  2211. name: '0900_postmaster_filter_bounce_check',
  2212. area: 'Postmaster::PreFilter',
  2213. description: 'Defines postmaster filter to identify postmaster bounced - to handle it as follow-up of the original ticket.',
  2214. options: {},
  2215. state: 'Channel::Filter::BounceCheck',
  2216. frontend: false
  2217. )
  2218. Setting.create_if_not_exists(
  2219. title: 'Defines postmaster filter.',
  2220. name: '1000_postmaster_filter_database_check',
  2221. area: 'Postmaster::PreFilter',
  2222. description: 'Defines postmaster filter for filters managed via admin interface.',
  2223. options: {},
  2224. state: 'Channel::Filter::Database',
  2225. frontend: false
  2226. )
  2227. Setting.create_if_not_exists(
  2228. title: 'Defines postmaster filter.',
  2229. name: '5000_postmaster_filter_icinga',
  2230. area: 'Postmaster::PreFilter',
  2231. description: 'Defines postmaster filter to manage Icinga (http://www.icinga.org) emails.',
  2232. options: {},
  2233. state: 'Channel::Filter::Icinga',
  2234. frontend: false
  2235. )
  2236. Setting.create_if_not_exists(
  2237. title: 'Defines postmaster filter.',
  2238. name: '5100_postmaster_filter_nagios',
  2239. area: 'Postmaster::PreFilter',
  2240. description: 'Defines postmaster filter to manage Nagios (http://www.nagios.org) emails.',
  2241. options: {},
  2242. state: 'Channel::Filter::Nagios',
  2243. frontend: false
  2244. )
  2245. Setting.create_if_not_exists(
  2246. title: 'Icinga integration',
  2247. name: 'icinga_integration',
  2248. area: 'Integration::Switch',
  2249. description: 'Defines if Icinga (http://www.icinga.org) is enabled or not.',
  2250. options: {
  2251. form: [
  2252. {
  2253. display: '',
  2254. null: true,
  2255. name: 'icinga_integration',
  2256. tag: 'boolean',
  2257. options: {
  2258. true => 'yes',
  2259. false => 'no',
  2260. },
  2261. },
  2262. ],
  2263. },
  2264. state: false,
  2265. preferences: {
  2266. prio: 1,
  2267. permission: ['admin.integration'],
  2268. },
  2269. frontend: false
  2270. )
  2271. Setting.create_if_not_exists(
  2272. title: 'Sender',
  2273. name: 'icinga_sender',
  2274. area: 'Integration::Icinga',
  2275. description: 'Defines the sender email address of Icinga emails.',
  2276. options: {
  2277. form: [
  2278. {
  2279. display: '',
  2280. null: false,
  2281. name: 'icinga_sender',
  2282. tag: 'input',
  2283. placeholder: 'icinga@monitoring.example.com',
  2284. },
  2285. ],
  2286. },
  2287. state: 'icinga@monitoring.example.com',
  2288. preferences: {
  2289. prio: 2,
  2290. permission: ['admin.integration'],
  2291. },
  2292. frontend: false,
  2293. )
  2294. Setting.create_if_not_exists(
  2295. title: 'Auto close',
  2296. name: 'icinga_auto_close',
  2297. area: 'Integration::Icinga',
  2298. description: 'Defines if tickets should be closed if service is recovered.',
  2299. options: {
  2300. form: [
  2301. {
  2302. display: '',
  2303. null: true,
  2304. name: 'icinga_auto_close',
  2305. tag: 'boolean',
  2306. options: {
  2307. true => 'yes',
  2308. false => 'no',
  2309. },
  2310. },
  2311. ],
  2312. },
  2313. state: true,
  2314. preferences: {
  2315. prio: 3,
  2316. permission: ['admin.integration'],
  2317. },
  2318. frontend: false
  2319. )
  2320. Setting.create_if_not_exists(
  2321. title: 'Auto close state',
  2322. name: 'icinga_auto_close_state_id',
  2323. area: 'Integration::Icinga',
  2324. description: 'Defines the state of auto closed tickets.',
  2325. options: {
  2326. form: [
  2327. {
  2328. display: '',
  2329. null: false,
  2330. name: 'icinga_auto_close_state_id',
  2331. tag: 'select',
  2332. relation: 'TicketState',
  2333. },
  2334. ],
  2335. },
  2336. state: 4,
  2337. preferences: {
  2338. prio: 4,
  2339. permission: ['admin.integration'],
  2340. },
  2341. frontend: false
  2342. )
  2343. Setting.create_if_not_exists(
  2344. title: 'Nagios integration',
  2345. name: 'nagios_integration',
  2346. area: 'Integration::Switch',
  2347. description: 'Defines if Nagios (http://www.nagios.org) is enabled or not.',
  2348. options: {
  2349. form: [
  2350. {
  2351. display: '',
  2352. null: true,
  2353. name: 'nagios_integration',
  2354. tag: 'boolean',
  2355. options: {
  2356. true => 'yes',
  2357. false => 'no',
  2358. },
  2359. },
  2360. ],
  2361. },
  2362. state: false,
  2363. preferences: {
  2364. prio: 1,
  2365. permission: ['admin.integration'],
  2366. },
  2367. frontend: false
  2368. )
  2369. Setting.create_if_not_exists(
  2370. title: 'Sender',
  2371. name: 'nagios_sender',
  2372. area: 'Integration::Nagios',
  2373. description: 'Defines the sender email address of Nagios emails.',
  2374. options: {
  2375. form: [
  2376. {
  2377. display: '',
  2378. null: false,
  2379. name: 'nagios_sender',
  2380. tag: 'input',
  2381. placeholder: 'nagios@monitoring.example.com',
  2382. },
  2383. ],
  2384. },
  2385. state: 'nagios@monitoring.example.com',
  2386. preferences: {
  2387. prio: 2,
  2388. permission: ['admin.integration'],
  2389. },
  2390. frontend: false,
  2391. )
  2392. Setting.create_if_not_exists(
  2393. title: 'Auto close',
  2394. name: 'nagios_auto_close',
  2395. area: 'Integration::Nagios',
  2396. description: 'Defines if tickets should be closed if service is recovered.',
  2397. options: {
  2398. form: [
  2399. {
  2400. display: '',
  2401. null: true,
  2402. name: 'nagios_auto_close',
  2403. tag: 'boolean',
  2404. options: {
  2405. true => 'yes',
  2406. false => 'no',
  2407. },
  2408. },
  2409. ],
  2410. },
  2411. state: true,
  2412. preferences: {
  2413. prio: 3,
  2414. permission: ['admin.integration'],
  2415. },
  2416. frontend: false
  2417. )
  2418. Setting.create_if_not_exists(
  2419. title: 'Auto close state',
  2420. name: 'nagios_auto_close_state_id',
  2421. area: 'Integration::Nagios',
  2422. description: 'Defines the state of auto closed tickets.',
  2423. options: {
  2424. form: [
  2425. {
  2426. display: '',
  2427. null: false,
  2428. name: 'nagios_auto_close_state_id',
  2429. tag: 'select',
  2430. relation: 'TicketState',
  2431. },
  2432. ],
  2433. },
  2434. state: 4,
  2435. preferences: {
  2436. prio: 4,
  2437. permission: ['admin.integration'],
  2438. },
  2439. frontend: false
  2440. )
  2441. Setting.create_if_not_exists(
  2442. title: 'Defines sync transaction backend.',
  2443. name: '0100_trigger',
  2444. area: 'Transaction::Backend::Sync',
  2445. description: 'Defines the transaction backend to execute triggers.',
  2446. options: {},
  2447. state: 'Transaction::Trigger',
  2448. frontend: false
  2449. )
  2450. Setting.create_if_not_exists(
  2451. title: 'Defines transaction backend.',
  2452. name: '0100_notification',
  2453. area: 'Transaction::Backend::Async',
  2454. description: 'Defines the transaction backend to send agent notifications.',
  2455. options: {},
  2456. state: 'Transaction::Notification',
  2457. frontend: false
  2458. )
  2459. Setting.create_if_not_exists(
  2460. title: 'Defines transaction backend.',
  2461. name: '1000_signature_detection',
  2462. area: 'Transaction::Backend::Async',
  2463. description: 'Defines the transaction backend to detect customer signatures in emails.',
  2464. options: {},
  2465. state: 'Transaction::SignatureDetection',
  2466. frontend: false
  2467. )
  2468. Setting.create_if_not_exists(
  2469. title: 'Defines transaction backend.',
  2470. name: '6000_slack_webhook',
  2471. area: 'Transaction::Backend::Async',
  2472. description: 'Defines the transaction backend which posts messages to Slack (http://www.slack.com).',
  2473. options: {},
  2474. state: 'Transaction::Slack',
  2475. frontend: false
  2476. )
  2477. Setting.create_if_not_exists(
  2478. title: 'Slack integration',
  2479. name: 'slack_integration',
  2480. area: 'Integration::Switch',
  2481. description: 'Defines if Slack (http://www.slack.org) is enabled or not.',
  2482. options: {
  2483. form: [
  2484. {
  2485. display: '',
  2486. null: true,
  2487. name: 'slack_integration',
  2488. tag: 'boolean',
  2489. options: {
  2490. true => 'yes',
  2491. false => 'no',
  2492. },
  2493. },
  2494. ],
  2495. },
  2496. state: false,
  2497. preferences: {
  2498. prio: 1,
  2499. permission: ['admin.integration'],
  2500. },
  2501. frontend: false
  2502. )
  2503. Setting.create_if_not_exists(
  2504. title: 'Slack config',
  2505. name: 'slack_config',
  2506. area: 'Integration::Slack',
  2507. description: 'Defines the slack config.',
  2508. options: {},
  2509. state: {
  2510. items: []
  2511. },
  2512. preferences: {
  2513. prio: 2,
  2514. permission: ['admin.integration'],
  2515. },
  2516. frontend: false,
  2517. )
  2518. Setting.create_if_not_exists(
  2519. title: 'sipgate.io integration',
  2520. name: 'sipgate_integration',
  2521. area: 'Integration::Switch',
  2522. description: 'Defines if sipgate.io (http://www.sipgate.io) is enabled or not.',
  2523. options: {
  2524. form: [
  2525. {
  2526. display: '',
  2527. null: true,
  2528. name: 'sipgate_integration',
  2529. tag: 'boolean',
  2530. options: {
  2531. true => 'yes',
  2532. false => 'no',
  2533. },
  2534. },
  2535. ],
  2536. },
  2537. state: false,
  2538. preferences: {
  2539. prio: 1,
  2540. trigger: ['menu:render', 'cti:reload'],
  2541. authentication: true,
  2542. permission: ['admin.integration'],
  2543. },
  2544. frontend: true
  2545. )
  2546. Setting.create_if_not_exists(
  2547. title: 'sipgate.io config',
  2548. name: 'sipgate_config',
  2549. area: 'Integration::Sipgate',
  2550. description: 'Defines the sipgate.io config.',
  2551. options: {},
  2552. state: {},
  2553. preferences: {
  2554. prio: 2,
  2555. permission: ['admin.integration'],
  2556. },
  2557. frontend: false,
  2558. )
  2559. Setting.create_if_not_exists(
  2560. title: 'Clearbit integration',
  2561. name: 'clearbit_integration',
  2562. area: 'Integration::Switch',
  2563. description: 'Defines if Clearbit (http://www.clearbit.com) is enabled or not.',
  2564. options: {
  2565. form: [
  2566. {
  2567. display: '',
  2568. null: true,
  2569. name: 'clearbit_integration',
  2570. tag: 'boolean',
  2571. options: {
  2572. true => 'yes',
  2573. false => 'no',
  2574. },
  2575. },
  2576. ],
  2577. },
  2578. state: false,
  2579. preferences: {
  2580. prio: 1,
  2581. permission: ['admin.integration'],
  2582. },
  2583. frontend: false
  2584. )
  2585. Setting.create_if_not_exists(
  2586. title: 'Clearbit config',
  2587. name: 'clearbit_config',
  2588. area: 'Integration::Clearbit',
  2589. description: 'Defines the Clearbit config.',
  2590. options: {},
  2591. state: {},
  2592. frontend: false,
  2593. preferences: {
  2594. prio: 2,
  2595. permission: ['admin.integration'],
  2596. },
  2597. )
  2598. Setting.create_if_not_exists(
  2599. title: 'Defines transaction backend.',
  2600. name: '9000_clearbit_enrichment',
  2601. area: 'Transaction::Backend::Async',
  2602. description: 'Defines the transaction backend which will enrich customer and organization information from Clearbit (http://www.clearbit.com).',
  2603. options: {},
  2604. state: 'Transaction::ClearbitEnrichment',
  2605. frontend: false
  2606. )
  2607. Setting.create_if_not_exists(
  2608. title: 'Defines transaction backend.',
  2609. name: '9100_cti_caller_id_detection',
  2610. area: 'Transaction::Backend::Async',
  2611. description: 'Defines the transaction backend which detects caller IDs in objects and store them for CTI lookups.',
  2612. options: {},
  2613. state: 'Transaction::CtiCallerIdDetection',
  2614. frontend: false
  2615. )
  2616. Setting.create_if_not_exists(
  2617. title: 'Defines transaction backend.',
  2618. name: '9200_karma',
  2619. area: 'Transaction::Backend::Async',
  2620. description: 'Defines the transaction backend which creates the karma score.',
  2621. options: {},
  2622. state: 'Transaction::Karma',
  2623. frontend: false
  2624. )
  2625. Setting.create_if_not_exists(
  2626. title: 'Defines karma levels.',
  2627. name: 'karma_levels',
  2628. area: 'Core::Karma',
  2629. description: 'Defines the karma levels.',
  2630. options: {},
  2631. state: [
  2632. {
  2633. name: 'Beginner',
  2634. start: 0,
  2635. end: 499,
  2636. },
  2637. {
  2638. name: 'Newbie',
  2639. start: 500,
  2640. end: 1999,
  2641. },
  2642. {
  2643. name: 'Intermediate',
  2644. start: 2000,
  2645. end: 4999,
  2646. },
  2647. {
  2648. name: 'Professional',
  2649. start: 5000,
  2650. end: 6999,
  2651. },
  2652. {
  2653. name: 'Expert',
  2654. start: 7000,
  2655. end: 8999,
  2656. },
  2657. {
  2658. name: 'Master',
  2659. start: 9000,
  2660. end: 18_999,
  2661. },
  2662. {
  2663. name: 'Evangelist',
  2664. start: 19_000,
  2665. end: 45_999,
  2666. },
  2667. {
  2668. name: 'Hero',
  2669. start: 50_000,
  2670. end: nil,
  2671. },
  2672. ],
  2673. frontend: false
  2674. )
  2675. signature = Signature.create_if_not_exists(
  2676. id: 1,
  2677. name: 'default',
  2678. body: '
  2679. #{user.firstname} #{user.lastname}
  2680. --
  2681. Super Support - Waterford Business Park
  2682. 5201 Blue Lagoon Drive - 8th Floor & 9th Floor - Miami, 33126 USA
  2683. Email: hot@example.com - Web: http://www.example.com/
  2684. --'.text2html,
  2685. updated_by_id: 1,
  2686. created_by_id: 1
  2687. )
  2688. Role.create_if_not_exists(
  2689. id: 1,
  2690. name: 'Admin',
  2691. note: 'To configure your system.',
  2692. preferences: {
  2693. not: ['Customer'],
  2694. },
  2695. default_at_signup: false,
  2696. updated_by_id: 1,
  2697. created_by_id: 1
  2698. )
  2699. Role.create_if_not_exists(
  2700. id: 2,
  2701. name: 'Agent',
  2702. note: 'To work on Tickets.',
  2703. default_at_signup: false,
  2704. preferences: {
  2705. not: ['Customer'],
  2706. },
  2707. updated_by_id: 1,
  2708. created_by_id: 1
  2709. )
  2710. Role.create_if_not_exists(
  2711. id: 3,
  2712. name: 'Customer',
  2713. note: 'People who create Tickets ask for help.',
  2714. preferences: {
  2715. not: %w(Agent Admin),
  2716. },
  2717. default_at_signup: true,
  2718. updated_by_id: 1,
  2719. created_by_id: 1
  2720. )
  2721. Permission.create_if_not_exists(
  2722. name: 'admin',
  2723. note: 'Admin Interface',
  2724. preferences: {},
  2725. )
  2726. Permission.create_if_not_exists(
  2727. name: 'admin.user',
  2728. note: 'Manage %s',
  2729. preferences: {
  2730. translations: ['Users']
  2731. },
  2732. )
  2733. Permission.create_if_not_exists(
  2734. name: 'admin.group',
  2735. note: 'Manage %s',
  2736. preferences: {
  2737. translations: ['Groups']
  2738. },
  2739. )
  2740. Permission.create_if_not_exists(
  2741. name: 'admin.role',
  2742. note: 'Manage %s',
  2743. preferences: {
  2744. translations: ['Roles']
  2745. },
  2746. )
  2747. Permission.create_if_not_exists(
  2748. name: 'admin.organization',
  2749. note: 'Manage %s',
  2750. preferences: {
  2751. translations: ['Organizations']
  2752. },
  2753. )
  2754. Permission.create_if_not_exists(
  2755. name: 'admin.overview',
  2756. note: 'Manage %s',
  2757. preferences: {
  2758. translations: ['Overviews']
  2759. },
  2760. )
  2761. Permission.create_if_not_exists(
  2762. name: 'admin.text_module',
  2763. note: 'Manage %s',
  2764. preferences: {
  2765. translations: ['Text Modules']
  2766. },
  2767. )
  2768. Permission.create_if_not_exists(
  2769. name: 'admin.macro',
  2770. note: 'Manage %s',
  2771. preferences: {
  2772. translations: ['Macros']
  2773. },
  2774. )
  2775. Permission.create_if_not_exists(
  2776. name: 'admin.tag',
  2777. note: 'Manage %s',
  2778. preferences: {
  2779. translations: ['Tags']
  2780. },
  2781. )
  2782. Permission.create_if_not_exists(
  2783. name: 'admin.calendar',
  2784. note: 'Manage %s',
  2785. preferences: {
  2786. translations: ['Calendar']
  2787. },
  2788. )
  2789. Permission.create_if_not_exists(
  2790. name: 'admin.sla',
  2791. note: 'Manage %s',
  2792. preferences: {
  2793. translations: ['SLA']
  2794. },
  2795. )
  2796. Permission.create_if_not_exists(
  2797. name: 'admin.scheduler',
  2798. note: 'Manage %s',
  2799. preferences: {
  2800. translations: ['Scheduler']
  2801. },
  2802. )
  2803. Permission.create_if_not_exists(
  2804. name: 'admin.report_profile',
  2805. note: 'Manage %s',
  2806. preferences: {
  2807. translations: ['Report Profiles']
  2808. },
  2809. )
  2810. Permission.create_if_not_exists(
  2811. name: 'admin.channel_web',
  2812. note: 'Manage %s',
  2813. preferences: {
  2814. translations: ['Channel - Web']
  2815. },
  2816. )
  2817. Permission.create_if_not_exists(
  2818. name: 'admin.channel_formular',
  2819. note: 'Manage %s',
  2820. preferences: {
  2821. translations: ['Channel - Formular']
  2822. },
  2823. )
  2824. Permission.create_if_not_exists(
  2825. name: 'admin.channel_email',
  2826. note: 'Manage %s',
  2827. preferences: {
  2828. translations: ['Channel - Email']
  2829. },
  2830. )
  2831. Permission.create_if_not_exists(
  2832. name: 'admin.channel_twitter',
  2833. note: 'Manage %s',
  2834. preferences: {
  2835. translations: ['Channel - Twitter']
  2836. },
  2837. )
  2838. Permission.create_if_not_exists(
  2839. name: 'admin.channel_facebook',
  2840. note: 'Manage %s',
  2841. preferences: {
  2842. translations: ['Channel - Facebook']
  2843. },
  2844. )
  2845. Permission.create_if_not_exists(
  2846. name: 'admin.channel_telegram',
  2847. note: 'Manage %s',
  2848. preferences: {
  2849. translations: ['Channel - Telegram']
  2850. },
  2851. )
  2852. Permission.create_if_not_exists(
  2853. name: 'admin.channel_chat',
  2854. note: 'Manage %s',
  2855. preferences: {
  2856. translations: ['Channel - Chat']
  2857. },
  2858. )
  2859. Permission.create_if_not_exists(
  2860. name: 'admin.branding',
  2861. note: 'Manage %s',
  2862. preferences: {
  2863. translations: ['Branding']
  2864. },
  2865. )
  2866. Permission.create_if_not_exists(
  2867. name: 'admin.setting_system',
  2868. note: 'Manage %s Settings',
  2869. preferences: {
  2870. translations: ['System']
  2871. },
  2872. )
  2873. Permission.create_if_not_exists(
  2874. name: 'admin.security',
  2875. note: 'Manage %s Settings',
  2876. preferences: {
  2877. translations: ['Security']
  2878. },
  2879. )
  2880. Permission.create_if_not_exists(
  2881. name: 'admin.ticket',
  2882. note: 'Manage %s Settings',
  2883. preferences: {
  2884. translations: ['Ticket']
  2885. },
  2886. )
  2887. Permission.create_if_not_exists(
  2888. name: 'admin.package',
  2889. note: 'Manage %s',
  2890. preferences: {
  2891. translations: ['Packages']
  2892. },
  2893. )
  2894. Permission.create_if_not_exists(
  2895. name: 'admin.integration',
  2896. note: 'Manage %s',
  2897. preferences: {
  2898. translations: ['Integrations']
  2899. },
  2900. )
  2901. Permission.create_if_not_exists(
  2902. name: 'admin.api',
  2903. note: 'Manage %s',
  2904. preferences: {
  2905. translations: ['API']
  2906. },
  2907. )
  2908. Permission.create_if_not_exists(
  2909. name: 'admin.object',
  2910. note: 'Manage %s',
  2911. preferences: {
  2912. translations: ['Objects']
  2913. },
  2914. )
  2915. Permission.create_if_not_exists(
  2916. name: 'admin.translation',
  2917. note: 'Manage %s',
  2918. preferences: {
  2919. translations: ['Translations']
  2920. },
  2921. )
  2922. Permission.create_if_not_exists(
  2923. name: 'admin.monitoring',
  2924. note: 'Manage %s',
  2925. preferences: {
  2926. translations: ['Monitoring']
  2927. },
  2928. )
  2929. Permission.create_if_not_exists(
  2930. name: 'admin.maintenance',
  2931. note: 'Manage %s',
  2932. preferences: {
  2933. translations: ['Maintenance']
  2934. },
  2935. )
  2936. Permission.create_if_not_exists(
  2937. name: 'admin.session',
  2938. note: 'Manage %s',
  2939. preferences: {
  2940. translations: ['Sessions']
  2941. },
  2942. )
  2943. Permission.create_if_not_exists(
  2944. name: 'user_preferences',
  2945. note: 'User Preferences',
  2946. preferences: {},
  2947. )
  2948. Permission.create_if_not_exists(
  2949. name: 'user_preferences.password',
  2950. note: 'Change %s',
  2951. preferences: {
  2952. translations: ['Password']
  2953. },
  2954. )
  2955. Permission.create_if_not_exists(
  2956. name: 'user_preferences.notifications',
  2957. note: 'Manage %s',
  2958. preferences: {
  2959. translations: ['Notifications'],
  2960. required: ['ticket.agent'],
  2961. },
  2962. )
  2963. Permission.create_if_not_exists(
  2964. name: 'user_preferences.access_token',
  2965. note: 'Manage %s',
  2966. preferences: {
  2967. translations: ['Token Access']
  2968. },
  2969. )
  2970. Permission.create_if_not_exists(
  2971. name: 'user_preferences.language',
  2972. note: 'Change %s',
  2973. preferences: {
  2974. translations: ['Language']
  2975. },
  2976. )
  2977. Permission.create_if_not_exists(
  2978. name: 'user_preferences.linked_accounts',
  2979. note: 'Manage %s',
  2980. preferences: {
  2981. translations: ['Linked Accounts']
  2982. },
  2983. )
  2984. Permission.create_if_not_exists(
  2985. name: 'user_preferences.device',
  2986. note: 'Manage %s',
  2987. preferences: {
  2988. translations: ['Devices']
  2989. },
  2990. )
  2991. Permission.create_if_not_exists(
  2992. name: 'user_preferences.avatar',
  2993. note: 'Manage %s',
  2994. preferences: {
  2995. translations: ['Avatar']
  2996. },
  2997. )
  2998. Permission.create_if_not_exists(
  2999. name: 'user_preferences.calendar',
  3000. note: 'Access to %s',
  3001. preferences: {
  3002. translations: ['Calendars'],
  3003. required: ['ticket.agent'],
  3004. },
  3005. )
  3006. Permission.create_if_not_exists(
  3007. name: 'report',
  3008. note: 'Report Interface',
  3009. preferences: {},
  3010. )
  3011. Permission.create_if_not_exists(
  3012. name: 'ticket',
  3013. note: 'Ticket Interface',
  3014. preferences: {
  3015. disabled: true
  3016. },
  3017. )
  3018. Permission.create_if_not_exists(
  3019. name: 'ticket.agent',
  3020. note: 'Access to Agent Tickets based on Group Access',
  3021. preferences: {
  3022. not: ['ticket.customer'],
  3023. plugin: ['groups']
  3024. },
  3025. )
  3026. Permission.create_if_not_exists(
  3027. name: 'ticket.customer',
  3028. note: 'Access to Customer Tickets based on current_user.id and current_user.organization_id',
  3029. preferences: {
  3030. not: ['ticket.agent'],
  3031. },
  3032. )
  3033. Permission.create_if_not_exists(
  3034. name: 'chat',
  3035. note: 'Access to %s',
  3036. preferences: {
  3037. translations: ['Chat']
  3038. },
  3039. )
  3040. Permission.create_if_not_exists(
  3041. name: 'chat.agent',
  3042. note: 'Access to %s',
  3043. preferences: {
  3044. translations: ['Chat'],
  3045. not: ['chat.customer'],
  3046. },
  3047. )
  3048. Permission.create_if_not_exists(
  3049. name: 'cti',
  3050. note: 'CTI',
  3051. preferences: {
  3052. disabled: true
  3053. },
  3054. )
  3055. Permission.create_if_not_exists(
  3056. name: 'cti.agent',
  3057. note: 'Access to %s',
  3058. preferences: {
  3059. translations: ['CTI'],
  3060. not: ['cti.customer'],
  3061. },
  3062. )
  3063. admin = Role.find_by(name: 'Admin')
  3064. admin.permission_grant('user_preferences')
  3065. admin.permission_grant('admin')
  3066. admin.permission_grant('report')
  3067. agent = Role.find_by(name: 'Agent')
  3068. agent.permission_grant('user_preferences')
  3069. agent.permission_grant('ticket.agent')
  3070. agent.permission_grant('chat.agent')
  3071. agent.permission_grant('cti.agent')
  3072. customer = Role.find_by(name: 'Customer')
  3073. customer.permission_grant('user_preferences.password')
  3074. customer.permission_grant('user_preferences.language')
  3075. customer.permission_grant('user_preferences.linked_accounts')
  3076. customer.permission_grant('user_preferences.avatar')
  3077. customer.permission_grant('ticket.customer')
  3078. Group.create_if_not_exists(
  3079. id: 1,
  3080. name: 'Users',
  3081. signature_id: signature.id,
  3082. note: 'Standard Group/Pool for Tickets.',
  3083. updated_by_id: 1,
  3084. created_by_id: 1
  3085. )
  3086. user = User.create_if_not_exists(
  3087. id: 1,
  3088. login: '-',
  3089. firstname: '-',
  3090. lastname: '',
  3091. email: '',
  3092. password: 'root',
  3093. active: false,
  3094. updated_by_id: 1,
  3095. created_by_id: 1
  3096. )
  3097. UserInfo.current_user_id = 1
  3098. roles = Role.find_by(name: 'Customer')
  3099. organizations = Organization.all
  3100. groups = Group.all
  3101. org_community = Organization.create_if_not_exists(
  3102. id: 1,
  3103. name: 'Zammad Foundation',
  3104. )
  3105. user_community = User.create_or_update(
  3106. id: 2,
  3107. login: 'nicole.braun@zammad.org',
  3108. firstname: 'Nicole',
  3109. lastname: 'Braun',
  3110. email: 'nicole.braun@zammad.org',
  3111. password: '',
  3112. active: true,
  3113. roles: [roles],
  3114. organization_id: org_community.id,
  3115. )
  3116. Link::Type.create_if_not_exists(id: 1, name: 'normal')
  3117. Link::Object.create_if_not_exists(id: 1, name: 'Ticket')
  3118. Link::Object.create_if_not_exists(id: 2, name: 'Announcement')
  3119. Link::Object.create_if_not_exists(id: 3, name: 'Question/Answer')
  3120. Link::Object.create_if_not_exists(id: 4, name: 'Idea')
  3121. Link::Object.create_if_not_exists(id: 5, name: 'Bug')
  3122. Ticket::StateType.create_if_not_exists(id: 1, name: 'new')
  3123. Ticket::StateType.create_if_not_exists(id: 2, name: 'open')
  3124. Ticket::StateType.create_if_not_exists(id: 3, name: 'pending reminder')
  3125. Ticket::StateType.create_if_not_exists(id: 4, name: 'pending action')
  3126. Ticket::StateType.create_if_not_exists(id: 5, name: 'closed')
  3127. Ticket::StateType.create_if_not_exists(id: 6, name: 'merged')
  3128. Ticket::StateType.create_if_not_exists(id: 7, name: 'removed')
  3129. Ticket::State.create_if_not_exists(
  3130. id: 1,
  3131. name: 'new',
  3132. state_type_id: Ticket::StateType.find_by(name: 'new').id,
  3133. default_create: true,
  3134. )
  3135. Ticket::State.create_if_not_exists(
  3136. id: 2,
  3137. name: 'open',
  3138. state_type_id: Ticket::StateType.find_by(name: 'open').id,
  3139. default_follow_up: true,
  3140. )
  3141. Ticket::State.create_if_not_exists(
  3142. id: 3,
  3143. name: 'pending reminder',
  3144. state_type_id: Ticket::StateType.find_by(name: 'pending reminder').id,
  3145. ignore_escalation: true,
  3146. )
  3147. Ticket::State.create_if_not_exists(
  3148. id: 4,
  3149. name: 'closed',
  3150. state_type_id: Ticket::StateType.find_by(name: 'closed').id,
  3151. ignore_escalation: true,
  3152. )
  3153. Ticket::State.create_if_not_exists(
  3154. id: 5,
  3155. name: 'merged',
  3156. state_type_id: Ticket::StateType.find_by(name: 'merged').id,
  3157. ignore_escalation: true,
  3158. )
  3159. Ticket::State.create_if_not_exists(
  3160. id: 6,
  3161. name: 'removed',
  3162. state_type_id: Ticket::StateType.find_by(name: 'removed').id,
  3163. active: false,
  3164. ignore_escalation: true,
  3165. )
  3166. Ticket::State.create_if_not_exists(
  3167. id: 7,
  3168. name: 'pending close',
  3169. state_type_id: Ticket::StateType.find_by(name: 'pending action').id,
  3170. next_state_id: Ticket::State.find_by(name: 'closed').id,
  3171. ignore_escalation: true,
  3172. )
  3173. Ticket::Priority.create_if_not_exists(id: 1, name: '1 low')
  3174. Ticket::Priority.create_if_not_exists(id: 2, name: '2 normal', default_create: true)
  3175. Ticket::Priority.create_if_not_exists(id: 3, name: '3 high')
  3176. Ticket::Article::Type.create_if_not_exists(id: 1, name: 'email', communication: true)
  3177. Ticket::Article::Type.create_if_not_exists(id: 2, name: 'sms', communication: true)
  3178. Ticket::Article::Type.create_if_not_exists(id: 3, name: 'chat', communication: true)
  3179. Ticket::Article::Type.create_if_not_exists(id: 4, name: 'fax', communication: true)
  3180. Ticket::Article::Type.create_if_not_exists(id: 5, name: 'phone', communication: true)
  3181. Ticket::Article::Type.create_if_not_exists(id: 6, name: 'twitter status', communication: true)
  3182. Ticket::Article::Type.create_if_not_exists(id: 7, name: 'twitter direct-message', communication: true)
  3183. Ticket::Article::Type.create_if_not_exists(id: 8, name: 'facebook feed post', communication: true)
  3184. Ticket::Article::Type.create_if_not_exists(id: 9, name: 'facebook feed comment', communication: true)
  3185. Ticket::Article::Type.create_if_not_exists(id: 10, name: 'note', communication: false)
  3186. Ticket::Article::Type.create_if_not_exists(id: 11, name: 'web', communication: true)
  3187. Ticket::Article::Type.create_if_not_exists(id: 12, name: 'telegram personal-message', communication: true)
  3188. Ticket::Article::Sender.create_if_not_exists(id: 1, name: 'Agent')
  3189. Ticket::Article::Sender.create_if_not_exists(id: 2, name: 'Customer')
  3190. Ticket::Article::Sender.create_if_not_exists(id: 3, name: 'System')
  3191. Macro.create_if_not_exists(
  3192. name: 'Close & Tag as Spam',
  3193. perform: {
  3194. 'ticket.state_id' => {
  3195. value: Ticket::State.find_by(name: 'closed').id,
  3196. },
  3197. 'ticket.tags' => {
  3198. operator: 'add',
  3199. value: 'spam',
  3200. },
  3201. 'ticket.owner_id' => {
  3202. pre_condition: 'current_user.id',
  3203. value: '',
  3204. },
  3205. },
  3206. note: 'example macro',
  3207. active: true,
  3208. )
  3209. UserInfo.current_user_id = user_community.id
  3210. ticket = Ticket.create(
  3211. group_id: Group.find_by(name: 'Users').id,
  3212. customer_id: User.find_by(login: 'nicole.braun@zammad.org').id,
  3213. title: 'Welcome to Zammad!',
  3214. state_id: Ticket::State.find_by(name: 'new').id,
  3215. priority_id: Ticket::Priority.find_by(name: '2 normal').id,
  3216. )
  3217. Ticket::Article.create(
  3218. ticket_id: ticket.id,
  3219. type_id: Ticket::Article::Type.find_by(name: 'phone').id,
  3220. sender_id: Ticket::Article::Sender.find_by(name: 'Customer').id,
  3221. from: 'Zammad Feedback <feedback@zammad.org>',
  3222. body: 'Welcome!
  3223. Thank you for choosing Zammad.
  3224. You will find updates and patches at https://zammad.org/. Online
  3225. documentation is available at https://zammad.org/documentation. Get
  3226. involved (discussions, contributing, ...) at https://zammad.org/participate.
  3227. Regards,
  3228. Your Zammad Team
  3229. ',
  3230. internal: false,
  3231. )
  3232. UserInfo.current_user_id = 1
  3233. overview_role = Role.find_by(name: 'Agent')
  3234. Overview.create_if_not_exists(
  3235. name: 'My assigned Tickets',
  3236. link: 'my_assigned',
  3237. prio: 1000,
  3238. role_id: overview_role.id,
  3239. condition: {
  3240. 'ticket.state_id' => {
  3241. operator: 'is',
  3242. value: [ 1, 2, 3, 7 ],
  3243. },
  3244. 'ticket.owner_id' => {
  3245. operator: 'is',
  3246. pre_condition: 'current_user.id',
  3247. },
  3248. },
  3249. order: {
  3250. by: 'created_at',
  3251. direction: 'ASC',
  3252. },
  3253. view: {
  3254. d: %w(title customer group created_at),
  3255. s: %w(title customer group created_at),
  3256. m: %w(number title customer group created_at),
  3257. view_mode_default: 's',
  3258. },
  3259. )
  3260. Overview.create_if_not_exists(
  3261. name: 'Unassigned & Open',
  3262. link: 'all_unassigned',
  3263. prio: 1010,
  3264. role_id: overview_role.id,
  3265. condition: {
  3266. 'ticket.state_id' => {
  3267. operator: 'is',
  3268. value: [1, 2, 3],
  3269. },
  3270. 'ticket.owner_id' => {
  3271. operator: 'is',
  3272. pre_condition: 'not_set',
  3273. },
  3274. },
  3275. order: {
  3276. by: 'created_at',
  3277. direction: 'ASC',
  3278. },
  3279. view: {
  3280. d: %w(title customer group created_at),
  3281. s: %w(title customer group created_at),
  3282. m: %w(number title customer group created_at),
  3283. view_mode_default: 's',
  3284. },
  3285. )
  3286. Overview.create_if_not_exists(
  3287. name: 'My pending reached Tickets',
  3288. link: 'my_pending_reached',
  3289. prio: 1020,
  3290. role_id: overview_role.id,
  3291. condition: {
  3292. 'ticket.state_id' => {
  3293. operator: 'is',
  3294. value: 3,
  3295. },
  3296. 'ticket.owner_id' => {
  3297. operator: 'is',
  3298. pre_condition: 'current_user.id',
  3299. },
  3300. 'ticket.pending_time' => {
  3301. operator: 'within next (relative)',
  3302. value: 0,
  3303. range: 'minute',
  3304. },
  3305. },
  3306. order: {
  3307. by: 'created_at',
  3308. direction: 'ASC',
  3309. },
  3310. view: {
  3311. d: %w(title customer group created_at),
  3312. s: %w(title customer group created_at),
  3313. m: %w(number title customer group created_at),
  3314. view_mode_default: 's',
  3315. },
  3316. )
  3317. Overview.create_if_not_exists(
  3318. name: 'Open',
  3319. link: 'all_open',
  3320. prio: 1030,
  3321. role_id: overview_role.id,
  3322. condition: {
  3323. 'ticket.state_id' => {
  3324. operator: 'is',
  3325. value: [1, 2, 3],
  3326. },
  3327. },
  3328. order: {
  3329. by: 'created_at',
  3330. direction: 'ASC',
  3331. },
  3332. view: {
  3333. d: %w(title customer group state owner created_at),
  3334. s: %w(title customer group state owner created_at),
  3335. m: %w(number title customer group state owner created_at),
  3336. view_mode_default: 's',
  3337. },
  3338. )
  3339. Overview.create_if_not_exists(
  3340. name: 'Pending reached',
  3341. link: 'all_pending_reached',
  3342. prio: 1040,
  3343. role_id: overview_role.id,
  3344. condition: {
  3345. 'ticket.state_id' => {
  3346. operator: 'is',
  3347. value: [3],
  3348. },
  3349. 'ticket.pending_time' => {
  3350. operator: 'within next (relative)',
  3351. value: 0,
  3352. range: 'minute',
  3353. },
  3354. },
  3355. order: {
  3356. by: 'created_at',
  3357. direction: 'ASC',
  3358. },
  3359. view: {
  3360. d: %w(title customer group owner created_at),
  3361. s: %w(title customer group owner created_at),
  3362. m: %w(number title customer group owner created_at),
  3363. view_mode_default: 's',
  3364. },
  3365. )
  3366. Overview.create_if_not_exists(
  3367. name: 'Escalated',
  3368. link: 'all_escalated',
  3369. prio: 1050,
  3370. role_id: overview_role.id,
  3371. condition: {
  3372. 'ticket.escalation_at' => {
  3373. operator: 'within next (relative)',
  3374. value: '10',
  3375. range: 'minute',
  3376. },
  3377. },
  3378. order: {
  3379. by: 'escalation_at',
  3380. direction: 'ASC',
  3381. },
  3382. view: {
  3383. d: %w(title customer group owner escalation_at),
  3384. s: %w(title customer group owner escalation_at),
  3385. m: %w(number title customer group owner escalation_at),
  3386. view_mode_default: 's',
  3387. },
  3388. )
  3389. overview_role = Role.find_by(name: 'Customer')
  3390. Overview.create_if_not_exists(
  3391. name: 'My Tickets',
  3392. link: 'my_tickets',
  3393. prio: 1100,
  3394. role_id: overview_role.id,
  3395. condition: {
  3396. 'ticket.state_id' => {
  3397. operator: 'is',
  3398. value: [ 1, 2, 3, 4, 6, 7 ],
  3399. },
  3400. 'ticket.customer_id' => {
  3401. operator: 'is',
  3402. pre_condition: 'current_user.id',
  3403. },
  3404. },
  3405. order: {
  3406. by: 'created_at',
  3407. direction: 'DESC',
  3408. },
  3409. view: {
  3410. d: %w(title customer state created_at),
  3411. s: %w(number title state created_at),
  3412. m: %w(number title state created_at),
  3413. view_mode_default: 's',
  3414. },
  3415. )
  3416. Overview.create_if_not_exists(
  3417. name: 'My Organization Tickets',
  3418. link: 'my_organization_tickets',
  3419. prio: 1200,
  3420. role_id: overview_role.id,
  3421. organization_shared: true,
  3422. condition: {
  3423. 'ticket.state_id' => {
  3424. operator: 'is',
  3425. value: [ 1, 2, 3, 4, 6, 7 ],
  3426. },
  3427. 'ticket.organization_id' => {
  3428. operator: 'is',
  3429. pre_condition: 'current_user.organization_id',
  3430. },
  3431. },
  3432. order: {
  3433. by: 'created_at',
  3434. direction: 'DESC',
  3435. },
  3436. view: {
  3437. d: %w(title customer state created_at),
  3438. s: %w(number title customer state created_at),
  3439. m: %w(number title customer state created_at),
  3440. view_mode_default: 's',
  3441. },
  3442. )
  3443. Channel.create_if_not_exists(
  3444. area: 'Email::Notification',
  3445. options: {
  3446. outbound: {
  3447. adapter: 'smtp',
  3448. options: {
  3449. host: 'host.example.com',
  3450. user: '',
  3451. password: '',
  3452. ssl: true,
  3453. },
  3454. },
  3455. },
  3456. group_id: 1,
  3457. preferences: { online_service_disable: true },
  3458. active: false,
  3459. )
  3460. Channel.create_if_not_exists(
  3461. area: 'Email::Notification',
  3462. options: {
  3463. outbound: {
  3464. adapter: 'sendmail',
  3465. },
  3466. },
  3467. preferences: { online_service_disable: true },
  3468. active: true,
  3469. )
  3470. Report::Profile.create_if_not_exists(
  3471. name: '-all-',
  3472. condition: {},
  3473. active: true,
  3474. updated_by_id: 1,
  3475. created_by_id: 1,
  3476. )
  3477. chat = Chat.create_if_not_exists(
  3478. name: 'default',
  3479. max_queue: 5,
  3480. note: '',
  3481. active: true,
  3482. updated_by_id: 1,
  3483. created_by_id: 1,
  3484. )
  3485. network = Network.create_if_not_exists(
  3486. id: 1,
  3487. name: 'base',
  3488. )
  3489. Network::Category::Type.create_if_not_exists(
  3490. id: 1,
  3491. name: 'Announcement',
  3492. )
  3493. Network::Category::Type.create_if_not_exists(
  3494. id: 2,
  3495. name: 'Idea',
  3496. )
  3497. Network::Category::Type.create_if_not_exists(
  3498. id: 3,
  3499. name: 'Question',
  3500. )
  3501. Network::Category::Type.create_if_not_exists(
  3502. id: 4,
  3503. name: 'Bug Report',
  3504. )
  3505. Network::Privacy.create_if_not_exists(
  3506. id: 1,
  3507. name: 'logged in',
  3508. key: 'loggedIn',
  3509. )
  3510. Network::Privacy.create_if_not_exists(
  3511. id: 2,
  3512. name: 'logged in and moderator',
  3513. key: 'loggedInModerator',
  3514. )
  3515. Network::Category.create_if_not_exists(
  3516. id: 1,
  3517. name: 'Announcements',
  3518. network_id: network.id,
  3519. network_category_type_id: Network::Category::Type.find_by(name: 'Announcement').id,
  3520. network_privacy_id: Network::Privacy.find_by(name: 'logged in and moderator').id,
  3521. allow_comments: true,
  3522. )
  3523. Network::Category.create_if_not_exists(
  3524. id: 2,
  3525. name: 'Questions',
  3526. network_id: network.id,
  3527. allow_comments: true,
  3528. network_category_type_id: Network::Category::Type.find_by(name: 'Question').id,
  3529. network_privacy_id: Network::Privacy.find_by(name: 'logged in').id,
  3530. )
  3531. Network::Category.create_if_not_exists(
  3532. id: 3,
  3533. name: 'Ideas',
  3534. network_id: network.id,
  3535. network_category_type_id: Network::Category::Type.find_by(name: 'Idea').id,
  3536. network_privacy_id: Network::Privacy.find_by(name: 'logged in').id,
  3537. allow_comments: true,
  3538. )
  3539. Network::Category.create_if_not_exists(
  3540. id: 4,
  3541. name: 'Bug Reports',
  3542. network_id: network.id,
  3543. network_category_type_id: Network::Category::Type.find_by(name: 'Bug Report').id,
  3544. network_privacy_id: Network::Privacy.find_by(name: 'logged in').id,
  3545. allow_comments: true,
  3546. )
  3547. item = Network::Item.create(
  3548. title: 'Example Announcement',
  3549. body: 'Some announcement....',
  3550. network_category_id: Network::Category.find_by(name: 'Announcements').id,
  3551. )
  3552. Network::Item::Comment.create(
  3553. network_item_id: item.id,
  3554. body: 'Some comment....',
  3555. )
  3556. item = Network::Item.create(
  3557. title: 'Example Question?',
  3558. body: 'Some questions....',
  3559. network_category_id: Network::Category.find_by(name: 'Questions').id,
  3560. )
  3561. Network::Item::Comment.create(
  3562. network_item_id: item.id,
  3563. body: 'Some comment....',
  3564. )
  3565. item = Network::Item.create(
  3566. title: 'Example Idea',
  3567. body: 'Some idea....',
  3568. network_category_id: Network::Category.find_by(name: 'Ideas').id,
  3569. )
  3570. Network::Item::Comment.create(
  3571. network_item_id: item.id,
  3572. body: 'Some comment....',
  3573. )
  3574. item = Network::Item.create(
  3575. title: 'Example Bug Report',
  3576. body: 'Some bug....',
  3577. network_category_id: Network::Category.find_by(name: 'Bug Reports').id,
  3578. )
  3579. Network::Item::Comment.create(
  3580. network_item_id: item.id,
  3581. body: 'Some comment....',
  3582. )
  3583. ObjectManager::Attribute.add(
  3584. force: true,
  3585. object: 'Ticket',
  3586. name: 'title',
  3587. display: 'Title',
  3588. data_type: 'input',
  3589. data_option: {
  3590. type: 'text',
  3591. maxlength: 200,
  3592. null: false,
  3593. translate: false,
  3594. },
  3595. editable: false,
  3596. active: true,
  3597. screens: {
  3598. create_top: {
  3599. '-all-' => {
  3600. null: false,
  3601. },
  3602. },
  3603. edit: {},
  3604. },
  3605. to_create: false,
  3606. to_migrate: false,
  3607. to_delete: false,
  3608. position: 15,
  3609. )
  3610. ObjectManager::Attribute.add(
  3611. force: true,
  3612. object: 'Ticket',
  3613. name: 'customer_id',
  3614. display: 'Customer',
  3615. data_type: 'user_autocompletion',
  3616. data_option: {
  3617. relation: 'User',
  3618. autocapitalize: false,
  3619. multiple: false,
  3620. guess: true,
  3621. null: false,
  3622. limit: 200,
  3623. placeholder: 'Enter Person or Organization/Company',
  3624. minLengt: 2,
  3625. translate: false,
  3626. },
  3627. editable: false,
  3628. active: true,
  3629. screens: {
  3630. create_top: {
  3631. Agent: {
  3632. null: false,
  3633. },
  3634. },
  3635. edit: {},
  3636. },
  3637. to_create: false,
  3638. to_migrate: false,
  3639. to_delete: false,
  3640. position: 10,
  3641. )
  3642. ObjectManager::Attribute.add(
  3643. force: true,
  3644. object: 'Ticket',
  3645. name: 'type',
  3646. display: 'Type',
  3647. data_type: 'select',
  3648. data_option: {
  3649. default: '',
  3650. options: {
  3651. 'Incident' => 'Incident',
  3652. 'Problem' => 'Problem',
  3653. 'Request for Change' => 'Request for Change',
  3654. },
  3655. nulloption: true,
  3656. multiple: false,
  3657. null: true,
  3658. translate: true,
  3659. },
  3660. editable: true,
  3661. active: false,
  3662. screens: {
  3663. create_middle: {
  3664. '-all-' => {
  3665. null: false,
  3666. item_class: 'column',
  3667. },
  3668. },
  3669. edit: {
  3670. Agent: {
  3671. null: false,
  3672. },
  3673. },
  3674. },
  3675. to_create: false,
  3676. to_migrate: false,
  3677. to_delete: false,
  3678. position: 20,
  3679. )
  3680. ObjectManager::Attribute.add(
  3681. force: true,
  3682. object: 'Ticket',
  3683. name: 'group_id',
  3684. display: 'Group',
  3685. data_type: 'select',
  3686. data_option: {
  3687. default: '',
  3688. relation: 'Group',
  3689. relation_condition: { access: 'rw' },
  3690. nulloption: true,
  3691. multiple: false,
  3692. null: false,
  3693. translate: false,
  3694. only_shown_if_selectable: true,
  3695. },
  3696. editable: false,
  3697. active: true,
  3698. screens: {
  3699. create_middle: {
  3700. '-all-' => {
  3701. null: false,
  3702. item_class: 'column',
  3703. },
  3704. },
  3705. edit: {
  3706. Agent: {
  3707. null: false,
  3708. },
  3709. },
  3710. },
  3711. to_create: false,
  3712. to_migrate: false,
  3713. to_delete: false,
  3714. position: 25,
  3715. )
  3716. ObjectManager::Attribute.add(
  3717. force: true,
  3718. object: 'Ticket',
  3719. name: 'owner_id',
  3720. display: 'Owner',
  3721. data_type: 'select',
  3722. data_option: {
  3723. default: '',
  3724. relation: 'User',
  3725. relation_condition: { roles: 'Agent' },
  3726. nulloption: true,
  3727. multiple: false,
  3728. null: true,
  3729. translate: false,
  3730. },
  3731. editable: false,
  3732. active: true,
  3733. screens: {
  3734. create_middle: {
  3735. Agent: {
  3736. null: true,
  3737. item_class: 'column',
  3738. },
  3739. },
  3740. edit: {
  3741. Agent: {
  3742. null: true,
  3743. },
  3744. },
  3745. },
  3746. to_create: false,
  3747. to_migrate: false,
  3748. to_delete: false,
  3749. position: 30,
  3750. )
  3751. ObjectManager::Attribute.add(
  3752. force: true,
  3753. object: 'Ticket',
  3754. name: 'state_id',
  3755. display: 'State',
  3756. data_type: 'select',
  3757. data_option: {
  3758. relation: 'TicketState',
  3759. nulloption: true,
  3760. multiple: false,
  3761. null: false,
  3762. default: 2,
  3763. translate: true,
  3764. filter: [1, 2, 3, 4, 7],
  3765. },
  3766. editable: false,
  3767. active: true,
  3768. screens: {
  3769. create_middle: {
  3770. Agent: {
  3771. null: false,
  3772. item_class: 'column',
  3773. },
  3774. Customer: {
  3775. item_class: 'column',
  3776. nulloption: false,
  3777. null: true,
  3778. filter: [1, 4],
  3779. default: 1,
  3780. },
  3781. },
  3782. edit: {
  3783. Agent: {
  3784. nulloption: false,
  3785. null: false,
  3786. filter: [2, 3, 4, 7],
  3787. },
  3788. Customer: {
  3789. nulloption: false,
  3790. null: true,
  3791. filter: [2, 4],
  3792. default: 2,
  3793. },
  3794. },
  3795. },
  3796. to_create: false,
  3797. to_migrate: false,
  3798. to_delete: false,
  3799. position: 40,
  3800. )
  3801. ObjectManager::Attribute.add(
  3802. force: true,
  3803. object: 'Ticket',
  3804. name: 'pending_time',
  3805. display: 'Pending till',
  3806. data_type: 'datetime',
  3807. data_option: {
  3808. future: true,
  3809. past: false,
  3810. diff: 24,
  3811. null: true,
  3812. translate: true,
  3813. required_if: {
  3814. state_id: [3, 7]
  3815. },
  3816. shown_if: {
  3817. state_id: [3, 7]
  3818. },
  3819. },
  3820. editable: false,
  3821. active: true,
  3822. screens: {
  3823. create_middle: {
  3824. '-all-' => {
  3825. null: false,
  3826. item_class: 'column',
  3827. },
  3828. },
  3829. edit: {
  3830. Agent: {
  3831. null: false,
  3832. },
  3833. },
  3834. },
  3835. to_create: false,
  3836. to_migrate: false,
  3837. to_delete: false,
  3838. position: 41,
  3839. )
  3840. ObjectManager::Attribute.add(
  3841. force: true,
  3842. object: 'Ticket',
  3843. name: 'priority_id',
  3844. display: 'Priority',
  3845. data_type: 'select',
  3846. data_option: {
  3847. relation: 'TicketPriority',
  3848. nulloption: false,
  3849. multiple: false,
  3850. null: false,
  3851. default: 2,
  3852. translate: true,
  3853. },
  3854. editable: false,
  3855. active: true,
  3856. screens: {
  3857. create_middle: {
  3858. Agent: {
  3859. null: false,
  3860. item_class: 'column',
  3861. },
  3862. },
  3863. edit: {
  3864. Agent: {
  3865. null: false,
  3866. },
  3867. },
  3868. },
  3869. to_create: false,
  3870. to_migrate: false,
  3871. to_delete: false,
  3872. position: 80,
  3873. )
  3874. ObjectManager::Attribute.add(
  3875. force: true,
  3876. object: 'Ticket',
  3877. name: 'tags',
  3878. display: 'Tags',
  3879. data_type: 'tag',
  3880. data_option: {
  3881. type: 'text',
  3882. null: true,
  3883. translate: false,
  3884. },
  3885. editable: false,
  3886. active: true,
  3887. screens: {
  3888. create_bottom: {
  3889. Agent: {
  3890. null: true,
  3891. },
  3892. },
  3893. edit: {},
  3894. },
  3895. to_create: false,
  3896. to_migrate: false,
  3897. to_delete: false,
  3898. position: 900,
  3899. )
  3900. ObjectManager::Attribute.add(
  3901. force: true,
  3902. object: 'TicketArticle',
  3903. name: 'type_id',
  3904. display: 'Type',
  3905. data_type: 'select',
  3906. data_option: {
  3907. relation: 'TicketArticleType',
  3908. nulloption: false,
  3909. multiple: false,
  3910. null: false,
  3911. default: 9,
  3912. translate: true,
  3913. },
  3914. editable: false,
  3915. active: true,
  3916. screens: {
  3917. create_middle: {},
  3918. edit: {
  3919. Agent: {
  3920. null: false,
  3921. },
  3922. },
  3923. },
  3924. to_create: false,
  3925. to_migrate: false,
  3926. to_delete: false,
  3927. position: 100,
  3928. )
  3929. ObjectManager::Attribute.add(
  3930. force: true,
  3931. object: 'TicketArticle',
  3932. name: 'internal',
  3933. display: 'Visibility',
  3934. data_type: 'select',
  3935. data_option: {
  3936. options: { true: 'internal', false: 'public' },
  3937. nulloption: false,
  3938. multiple: false,
  3939. null: true,
  3940. default: false,
  3941. translate: true,
  3942. },
  3943. editable: false,
  3944. active: true,
  3945. screens: {
  3946. create_middle: {},
  3947. edit: {
  3948. Agent: {
  3949. null: false,
  3950. },
  3951. },
  3952. },
  3953. to_create: false,
  3954. to_migrate: false,
  3955. to_delete: false,
  3956. position: 200,
  3957. )
  3958. ObjectManager::Attribute.add(
  3959. force: true,
  3960. object: 'TicketArticle',
  3961. name: 'to',
  3962. display: 'To',
  3963. data_type: 'input',
  3964. data_option: {
  3965. type: 'text',
  3966. maxlength: 1000,
  3967. null: true,
  3968. },
  3969. editable: false,
  3970. active: true,
  3971. screens: {
  3972. create_middle: {},
  3973. edit: {
  3974. Agent: {
  3975. null: true,
  3976. },
  3977. },
  3978. },
  3979. to_create: false,
  3980. to_migrate: false,
  3981. to_delete: false,
  3982. position: 300,
  3983. )
  3984. ObjectManager::Attribute.add(
  3985. force: true,
  3986. object: 'TicketArticle',
  3987. name: 'cc',
  3988. display: 'Cc',
  3989. data_type: 'input',
  3990. data_option: {
  3991. type: 'text',
  3992. maxlength: 1000,
  3993. null: true,
  3994. },
  3995. editable: false,
  3996. active: true,
  3997. screens: {
  3998. create_top: {},
  3999. create_middle: {},
  4000. edit: {
  4001. Agent: {
  4002. null: true,
  4003. },
  4004. },
  4005. },
  4006. to_create: false,
  4007. to_migrate: false,
  4008. to_delete: false,
  4009. position: 400,
  4010. )
  4011. ObjectManager::Attribute.add(
  4012. force: true,
  4013. object: 'TicketArticle',
  4014. name: 'body',
  4015. display: 'Text',
  4016. data_type: 'richtext',
  4017. data_option: {
  4018. type: 'richtext',
  4019. maxlength: 20_000,
  4020. upload: true,
  4021. rows: 8,
  4022. null: true,
  4023. },
  4024. editable: false,
  4025. active: true,
  4026. screens: {
  4027. create_top: {
  4028. '-all-' => {
  4029. null: false,
  4030. },
  4031. },
  4032. edit: {
  4033. Agent: {
  4034. null: true,
  4035. },
  4036. Customer: {
  4037. null: false,
  4038. },
  4039. },
  4040. },
  4041. to_create: false,
  4042. to_migrate: false,
  4043. to_delete: false,
  4044. position: 600,
  4045. )
  4046. ObjectManager::Attribute.add(
  4047. force: true,
  4048. object: 'User',
  4049. name: 'login',
  4050. display: 'Login',
  4051. data_type: 'input',
  4052. data_option: {
  4053. type: 'text',
  4054. maxlength: 100,
  4055. null: true,
  4056. autocapitalize: false,
  4057. item_class: 'formGroup--halfSize',
  4058. },
  4059. editable: false,
  4060. active: true,
  4061. screens: {
  4062. signup: {},
  4063. invite_agent: {},
  4064. invite_customer: {},
  4065. edit: {},
  4066. view: {
  4067. '-all-' => {
  4068. shown: false,
  4069. },
  4070. },
  4071. },
  4072. to_create: false,
  4073. to_migrate: false,
  4074. to_delete: false,
  4075. position: 100,
  4076. )
  4077. ObjectManager::Attribute.add(
  4078. force: true,
  4079. object: 'User',
  4080. name: 'firstname',
  4081. display: 'Firstname',
  4082. data_type: 'input',
  4083. data_option: {
  4084. type: 'text',
  4085. maxlength: 150,
  4086. null: false,
  4087. item_class: 'formGroup--halfSize',
  4088. },
  4089. editable: false,
  4090. active: true,
  4091. screens: {
  4092. signup: {
  4093. '-all-' => {
  4094. null: false,
  4095. },
  4096. },
  4097. invite_agent: {
  4098. '-all-' => {
  4099. null: false,
  4100. },
  4101. },
  4102. invite_customer: {
  4103. '-all-' => {
  4104. null: false,
  4105. },
  4106. },
  4107. edit: {
  4108. '-all-' => {
  4109. null: false,
  4110. },
  4111. },
  4112. view: {
  4113. '-all-' => {
  4114. shown: true,
  4115. },
  4116. },
  4117. },
  4118. to_create: false,
  4119. to_migrate: false,
  4120. to_delete: false,
  4121. position: 200,
  4122. )
  4123. ObjectManager::Attribute.add(
  4124. force: true,
  4125. object: 'User',
  4126. name: 'lastname',
  4127. display: 'Lastname',
  4128. data_type: 'input',
  4129. data_option: {
  4130. type: 'text',
  4131. maxlength: 150,
  4132. null: false,
  4133. item_class: 'formGroup--halfSize',
  4134. },
  4135. editable: false,
  4136. active: true,
  4137. screens: {
  4138. signup: {
  4139. '-all-' => {
  4140. null: false,
  4141. },
  4142. },
  4143. invite_agent: {
  4144. '-all-' => {
  4145. null: false,
  4146. },
  4147. },
  4148. invite_customer: {
  4149. '-all-' => {
  4150. null: false,
  4151. },
  4152. },
  4153. edit: {
  4154. '-all-' => {
  4155. null: false,
  4156. },
  4157. },
  4158. view: {
  4159. '-all-' => {
  4160. shown: true,
  4161. },
  4162. },
  4163. },
  4164. to_create: false,
  4165. to_migrate: false,
  4166. to_delete: false,
  4167. position: 300,
  4168. )
  4169. ObjectManager::Attribute.add(
  4170. force: true,
  4171. object: 'User',
  4172. name: 'email',
  4173. display: 'Email',
  4174. data_type: 'input',
  4175. data_option: {
  4176. type: 'email',
  4177. maxlength: 150,
  4178. null: false,
  4179. item_class: 'formGroup--halfSize',
  4180. },
  4181. editable: false,
  4182. active: true,
  4183. screens: {
  4184. signup: {
  4185. '-all-' => {
  4186. null: false,
  4187. },
  4188. },
  4189. invite_agent: {
  4190. '-all-' => {
  4191. null: false,
  4192. },
  4193. },
  4194. invite_customer: {
  4195. '-all-' => {
  4196. null: false,
  4197. },
  4198. },
  4199. edit: {
  4200. '-all-' => {
  4201. null: false,
  4202. },
  4203. },
  4204. view: {
  4205. '-all-' => {
  4206. shown: true,
  4207. },
  4208. },
  4209. },
  4210. to_create: false,
  4211. to_migrate: false,
  4212. to_delete: false,
  4213. position: 400,
  4214. )
  4215. ObjectManager::Attribute.add(
  4216. force: true,
  4217. object: 'User',
  4218. name: 'web',
  4219. display: 'Web',
  4220. data_type: 'input',
  4221. data_option: {
  4222. type: 'url',
  4223. maxlength: 250,
  4224. null: true,
  4225. item_class: 'formGroup--halfSize',
  4226. },
  4227. editable: false,
  4228. active: true,
  4229. screens: {
  4230. signup: {},
  4231. invite_agent: {},
  4232. invite_customer: {},
  4233. edit: {
  4234. '-all-' => {
  4235. null: true,
  4236. },
  4237. },
  4238. view: {
  4239. '-all-' => {
  4240. shown: true,
  4241. },
  4242. },
  4243. },
  4244. to_create: false,
  4245. to_migrate: false,
  4246. to_delete: false,
  4247. position: 500,
  4248. )
  4249. ObjectManager::Attribute.add(
  4250. force: true,
  4251. object: 'User',
  4252. name: 'phone',
  4253. display: 'Phone',
  4254. data_type: 'input',
  4255. data_option: {
  4256. type: 'tel',
  4257. maxlength: 100,
  4258. null: true,
  4259. item_class: 'formGroup--halfSize',
  4260. },
  4261. editable: false,
  4262. active: true,
  4263. screens: {
  4264. signup: {},
  4265. invite_agent: {},
  4266. invite_customer: {},
  4267. edit: {
  4268. '-all-' => {
  4269. null: true,
  4270. },
  4271. },
  4272. view: {
  4273. '-all-' => {
  4274. shown: true,
  4275. },
  4276. },
  4277. },
  4278. to_create: false,
  4279. to_migrate: false,
  4280. to_delete: false,
  4281. position: 600,
  4282. )
  4283. ObjectManager::Attribute.add(
  4284. force: true,
  4285. object: 'User',
  4286. name: 'mobile',
  4287. display: 'Mobile',
  4288. data_type: 'input',
  4289. data_option: {
  4290. type: 'tel',
  4291. maxlength: 100,
  4292. null: true,
  4293. item_class: 'formGroup--halfSize',
  4294. },
  4295. editable: false,
  4296. active: true,
  4297. screens: {
  4298. signup: {},
  4299. invite_agent: {},
  4300. invite_customer: {},
  4301. edit: {
  4302. '-all-' => {
  4303. null: true,
  4304. },
  4305. },
  4306. view: {
  4307. '-all-' => {
  4308. shown: true,
  4309. },
  4310. },
  4311. },
  4312. to_create: false,
  4313. to_migrate: false,
  4314. to_delete: false,
  4315. position: 700,
  4316. )
  4317. ObjectManager::Attribute.add(
  4318. force: true,
  4319. object: 'User',
  4320. name: 'fax',
  4321. display: 'Fax',
  4322. data_type: 'input',
  4323. data_option: {
  4324. type: 'tel',
  4325. maxlength: 100,
  4326. null: true,
  4327. item_class: 'formGroup--halfSize',
  4328. },
  4329. editable: false,
  4330. active: true,
  4331. screens: {
  4332. signup: {},
  4333. invite_agent: {},
  4334. invite_customer: {},
  4335. edit: {
  4336. '-all-' => {
  4337. null: true,
  4338. },
  4339. },
  4340. view: {
  4341. '-all-' => {
  4342. shown: true,
  4343. },
  4344. },
  4345. },
  4346. to_create: false,
  4347. to_migrate: false,
  4348. to_delete: false,
  4349. position: 800,
  4350. )
  4351. ObjectManager::Attribute.add(
  4352. force: true,
  4353. object: 'User',
  4354. name: 'organization_id',
  4355. display: 'Organization',
  4356. data_type: 'autocompletion_ajax',
  4357. data_option: {
  4358. multiple: false,
  4359. nulloption: true,
  4360. null: true,
  4361. relation: 'Organization',
  4362. item_class: 'formGroup--halfSize',
  4363. },
  4364. editable: false,
  4365. active: true,
  4366. screens: {
  4367. signup: {},
  4368. invite_agent: {},
  4369. invite_customer: {
  4370. '-all-' => {
  4371. null: true,
  4372. },
  4373. },
  4374. edit: {
  4375. '-all-' => {
  4376. null: true,
  4377. },
  4378. },
  4379. view: {
  4380. '-all-' => {
  4381. shown: true,
  4382. },
  4383. },
  4384. },
  4385. to_create: false,
  4386. to_migrate: false,
  4387. to_delete: false,
  4388. position: 900,
  4389. )
  4390. ObjectManager::Attribute.add(
  4391. force: true,
  4392. object: 'User',
  4393. name: 'department',
  4394. display: 'Department',
  4395. data_type: 'input',
  4396. data_option: {
  4397. type: 'text',
  4398. maxlength: 200,
  4399. null: true,
  4400. item_class: 'formGroup--halfSize',
  4401. },
  4402. editable: true,
  4403. active: true,
  4404. screens: {
  4405. signup: {},
  4406. invite_agent: {},
  4407. invite_customer: {},
  4408. edit: {
  4409. '-all-' => {
  4410. null: true,
  4411. },
  4412. },
  4413. view: {
  4414. '-all-' => {
  4415. shown: true,
  4416. },
  4417. },
  4418. },
  4419. to_create: false,
  4420. to_migrate: false,
  4421. to_delete: false,
  4422. position: 1000,
  4423. )
  4424. ObjectManager::Attribute.add(
  4425. force: true,
  4426. object: 'User',
  4427. name: 'street',
  4428. display: 'Street',
  4429. data_type: 'input',
  4430. data_option: {
  4431. type: 'text',
  4432. maxlength: 100,
  4433. null: true,
  4434. },
  4435. editable: true,
  4436. active: false,
  4437. screens: {
  4438. signup: {},
  4439. invite_agent: {},
  4440. invite_customer: {},
  4441. edit: {
  4442. '-all-' => {
  4443. null: true,
  4444. },
  4445. },
  4446. view: {
  4447. '-all-' => {
  4448. shown: true,
  4449. },
  4450. },
  4451. },
  4452. to_create: false,
  4453. to_migrate: false,
  4454. to_delete: false,
  4455. position: 1100,
  4456. )
  4457. ObjectManager::Attribute.add(
  4458. force: true,
  4459. object: 'User',
  4460. name: 'zip',
  4461. display: 'Zip',
  4462. data_type: 'input',
  4463. data_option: {
  4464. type: 'text',
  4465. maxlength: 100,
  4466. null: true,
  4467. item_class: 'formGroup--halfSize',
  4468. },
  4469. editable: true,
  4470. active: false,
  4471. screens: {
  4472. signup: {},
  4473. invite_agent: {},
  4474. invite_customer: {},
  4475. edit: {
  4476. '-all-' => {
  4477. null: true,
  4478. },
  4479. },
  4480. view: {
  4481. '-all-' => {
  4482. shown: true,
  4483. },
  4484. },
  4485. },
  4486. to_create: false,
  4487. to_migrate: false,
  4488. to_delete: false,
  4489. position: 1200,
  4490. )
  4491. ObjectManager::Attribute.add(
  4492. force: true,
  4493. object: 'User',
  4494. name: 'city',
  4495. display: 'City',
  4496. data_type: 'input',
  4497. data_option: {
  4498. type: 'text',
  4499. maxlength: 100,
  4500. null: true,
  4501. item_class: 'formGroup--halfSize',
  4502. },
  4503. editable: true,
  4504. active: false,
  4505. screens: {
  4506. signup: {},
  4507. invite_agent: {},
  4508. invite_customer: {},
  4509. edit: {
  4510. '-all-' => {
  4511. null: true,
  4512. },
  4513. },
  4514. view: {
  4515. '-all-' => {
  4516. shown: true,
  4517. },
  4518. },
  4519. },
  4520. to_create: false,
  4521. to_migrate: false,
  4522. to_delete: false,
  4523. position: 1300,
  4524. )
  4525. ObjectManager::Attribute.add(
  4526. force: true,
  4527. object: 'User',
  4528. name: 'address',
  4529. display: 'Address',
  4530. data_type: 'textarea',
  4531. data_option: {
  4532. type: 'text',
  4533. maxlength: 500,
  4534. null: true,
  4535. item_class: 'formGroup--halfSize',
  4536. },
  4537. editable: true,
  4538. active: true,
  4539. screens: {
  4540. signup: {},
  4541. invite_agent: {},
  4542. invite_customer: {},
  4543. edit: {
  4544. '-all-' => {
  4545. null: true,
  4546. },
  4547. },
  4548. view: {
  4549. '-all-' => {
  4550. shown: true,
  4551. },
  4552. },
  4553. },
  4554. to_create: false,
  4555. to_migrate: false,
  4556. to_delete: false,
  4557. position: 1350,
  4558. )
  4559. ObjectManager::Attribute.add(
  4560. force: true,
  4561. object: 'User',
  4562. name: 'password',
  4563. display: 'Password',
  4564. data_type: 'input',
  4565. data_option: {
  4566. type: 'password',
  4567. maxlength: 100,
  4568. null: true,
  4569. autocomplete: 'off',
  4570. item_class: 'formGroup--halfSize',
  4571. },
  4572. editable: false,
  4573. active: true,
  4574. screens: {
  4575. signup: {
  4576. '-all-' => {
  4577. null: false,
  4578. },
  4579. },
  4580. invite_agent: {},
  4581. invite_customer: {},
  4582. edit: {
  4583. Admin: {
  4584. null: true,
  4585. },
  4586. },
  4587. view: {}
  4588. },
  4589. to_create: false,
  4590. to_migrate: false,
  4591. to_delete: false,
  4592. position: 1400,
  4593. )
  4594. ObjectManager::Attribute.add(
  4595. force: true,
  4596. object: 'User',
  4597. name: 'vip',
  4598. display: 'VIP',
  4599. data_type: 'boolean',
  4600. data_option: {
  4601. null: true,
  4602. default: false,
  4603. item_class: 'formGroup--halfSize',
  4604. options: {
  4605. false: 'no',
  4606. true: 'yes',
  4607. },
  4608. translate: true,
  4609. },
  4610. editable: false,
  4611. active: true,
  4612. screens: {
  4613. edit: {
  4614. Admin: {
  4615. null: true,
  4616. },
  4617. Agent: {
  4618. null: true,
  4619. },
  4620. },
  4621. view: {
  4622. '-all-' => {
  4623. shown: false,
  4624. },
  4625. },
  4626. },
  4627. to_create: false,
  4628. to_migrate: false,
  4629. to_delete: false,
  4630. position: 1490,
  4631. )
  4632. ObjectManager::Attribute.add(
  4633. force: true,
  4634. object: 'User',
  4635. name: 'note',
  4636. display: 'Note',
  4637. data_type: 'richtext',
  4638. data_option: {
  4639. type: 'text',
  4640. maxlength: 250,
  4641. null: true,
  4642. note: 'Notes are visible to agents only, never to customers.',
  4643. },
  4644. editable: false,
  4645. active: true,
  4646. screens: {
  4647. signup: {},
  4648. invite_agent: {},
  4649. invite_customer: {
  4650. '-all-' => {
  4651. null: true,
  4652. },
  4653. },
  4654. edit: {
  4655. '-all-' => {
  4656. null: true,
  4657. },
  4658. },
  4659. view: {
  4660. '-all-' => {
  4661. shown: true,
  4662. },
  4663. },
  4664. },
  4665. to_create: false,
  4666. to_migrate: false,
  4667. to_delete: false,
  4668. position: 1500,
  4669. )
  4670. ObjectManager::Attribute.add(
  4671. force: true,
  4672. object: 'User',
  4673. name: 'role_ids',
  4674. display: 'Permissions',
  4675. data_type: 'user_permission',
  4676. data_option: {
  4677. null: false,
  4678. item_class: 'checkbox',
  4679. },
  4680. editable: false,
  4681. active: true,
  4682. screens: {
  4683. signup: {},
  4684. invite_agent: {
  4685. '-all-' => {
  4686. null: false,
  4687. default: [Role.lookup(name: 'Agent').id],
  4688. },
  4689. },
  4690. invite_customer: {},
  4691. edit: {
  4692. Admin: {
  4693. null: true,
  4694. },
  4695. },
  4696. view: {
  4697. '-all-' => {
  4698. shown: false,
  4699. },
  4700. },
  4701. },
  4702. to_create: false,
  4703. to_migrate: false,
  4704. to_delete: false,
  4705. position: 1600,
  4706. )
  4707. ObjectManager::Attribute.add(
  4708. force: true,
  4709. object: 'User',
  4710. name: 'active',
  4711. display: 'Active',
  4712. data_type: 'active',
  4713. data_option: {
  4714. null: true,
  4715. default: true,
  4716. },
  4717. editable: false,
  4718. active: true,
  4719. screens: {
  4720. signup: {},
  4721. invite_agent: {},
  4722. invite_customer: {},
  4723. edit: {
  4724. Admin: {
  4725. null: false,
  4726. },
  4727. },
  4728. view: {
  4729. '-all-' => {
  4730. shown: false,
  4731. },
  4732. },
  4733. },
  4734. to_create: false,
  4735. to_migrate: false,
  4736. to_delete: false,
  4737. position: 1800,
  4738. )
  4739. ObjectManager::Attribute.add(
  4740. force: true,
  4741. object: 'Organization',
  4742. name: 'name',
  4743. display: 'Name',
  4744. data_type: 'input',
  4745. data_option: {
  4746. type: 'text',
  4747. maxlength: 150,
  4748. null: false,
  4749. item_class: 'formGroup--halfSize',
  4750. },
  4751. editable: false,
  4752. active: true,
  4753. screens: {
  4754. edit: {
  4755. '-all-' => {
  4756. null: false,
  4757. },
  4758. },
  4759. view: {
  4760. '-all-' => {
  4761. shown: true,
  4762. },
  4763. },
  4764. },
  4765. to_create: false,
  4766. to_migrate: false,
  4767. to_delete: false,
  4768. position: 200,
  4769. )
  4770. ObjectManager::Attribute.add(
  4771. force: true,
  4772. object: 'Organization',
  4773. name: 'shared',
  4774. display: 'Shared organization',
  4775. data_type: 'boolean',
  4776. data_option: {
  4777. null: true,
  4778. default: true,
  4779. note: 'Customers in the organization can view each other items.',
  4780. item_class: 'formGroup--halfSize',
  4781. options: {
  4782. true: 'yes',
  4783. false: 'no',
  4784. },
  4785. translate: true,
  4786. },
  4787. editable: false,
  4788. active: true,
  4789. screens: {
  4790. edit: {
  4791. Admin: {
  4792. null: false,
  4793. },
  4794. },
  4795. view: {
  4796. '-all-' => {
  4797. shown: true,
  4798. },
  4799. },
  4800. },
  4801. to_create: false,
  4802. to_migrate: false,
  4803. to_delete: false,
  4804. position: 1400,
  4805. )
  4806. ObjectManager::Attribute.add(
  4807. force: true,
  4808. object: 'Organization',
  4809. name: 'domain_assignment',
  4810. display: 'Domain based assignment',
  4811. data_type: 'boolean',
  4812. data_option: {
  4813. null: true,
  4814. default: false,
  4815. note: 'Assign Users based on users domain.',
  4816. item_class: 'formGroup--halfSize',
  4817. options: {
  4818. true: 'yes',
  4819. false: 'no',
  4820. },
  4821. translate: true,
  4822. },
  4823. editable: false,
  4824. active: true,
  4825. screens: {
  4826. edit: {
  4827. Admin: {
  4828. null: false,
  4829. },
  4830. },
  4831. view: {
  4832. '-all-' => {
  4833. shown: true,
  4834. },
  4835. },
  4836. },
  4837. to_create: false,
  4838. to_migrate: false,
  4839. to_delete: false,
  4840. position: 1410,
  4841. )
  4842. ObjectManager::Attribute.add(
  4843. force: true,
  4844. object: 'Organization',
  4845. name: 'domain',
  4846. display: 'Domain',
  4847. data_type: 'input',
  4848. data_option: {
  4849. type: 'text',
  4850. maxlength: 150,
  4851. null: true,
  4852. item_class: 'formGroup--halfSize',
  4853. },
  4854. editable: false,
  4855. active: true,
  4856. screens: {
  4857. edit: {
  4858. '-all-' => {
  4859. null: true,
  4860. },
  4861. },
  4862. view: {
  4863. '-all-' => {
  4864. shown: true,
  4865. },
  4866. },
  4867. },
  4868. to_create: false,
  4869. to_migrate: false,
  4870. to_delete: false,
  4871. position: 1420,
  4872. )
  4873. ObjectManager::Attribute.add(
  4874. force: true,
  4875. object: 'Organization',
  4876. name: 'note',
  4877. display: 'Note',
  4878. data_type: 'richtext',
  4879. data_option: {
  4880. type: 'text',
  4881. maxlength: 250,
  4882. null: true,
  4883. note: 'Notes are visible to agents only, never to customers.',
  4884. },
  4885. editable: false,
  4886. active: true,
  4887. screens: {
  4888. edit: {
  4889. '-all-' => {
  4890. null: true,
  4891. },
  4892. },
  4893. view: {
  4894. '-all-' => {
  4895. shown: true,
  4896. },
  4897. },
  4898. },
  4899. to_create: false,
  4900. to_migrate: false,
  4901. to_delete: false,
  4902. position: 1500,
  4903. )
  4904. ObjectManager::Attribute.add(
  4905. force: true,
  4906. object: 'Organization',
  4907. name: 'active',
  4908. display: 'Active',
  4909. data_type: 'active',
  4910. data_option: {
  4911. null: true,
  4912. default: true,
  4913. },
  4914. editable: false,
  4915. active: true,
  4916. screens: {
  4917. edit: {
  4918. Admin: {
  4919. null: false,
  4920. },
  4921. },
  4922. view: {
  4923. '-all-' => {
  4924. shown: false,
  4925. },
  4926. },
  4927. },
  4928. to_create: false,
  4929. to_migrate: false,
  4930. to_delete: false,
  4931. position: 1800,
  4932. )
  4933. ObjectManager::Attribute.add(
  4934. force: true,
  4935. object: 'Group',
  4936. name: 'name',
  4937. display: 'Name',
  4938. data_type: 'input',
  4939. data_option: {
  4940. type: 'text',
  4941. maxlength: 150,
  4942. null: false,
  4943. },
  4944. editable: false,
  4945. active: true,
  4946. screens: {
  4947. create: {
  4948. '-all-' => {
  4949. null: false,
  4950. },
  4951. },
  4952. edit: {
  4953. '-all-' => {
  4954. null: false,
  4955. },
  4956. },
  4957. view: {
  4958. '-all-' => {
  4959. shown: true,
  4960. },
  4961. },
  4962. },
  4963. to_create: false,
  4964. to_migrate: false,
  4965. to_delete: false,
  4966. position: 200,
  4967. )
  4968. ObjectManager::Attribute.add(
  4969. force: true,
  4970. object: 'Group',
  4971. name: 'assignment_timeout',
  4972. display: 'Assignment Timeout',
  4973. data_type: 'integer',
  4974. data_option: {
  4975. maxlength: 150,
  4976. null: true,
  4977. note: 'Assignment timeout in minutes if assigned agent is not working on it. Ticket will be shown as unassigend.',
  4978. min: 0,
  4979. max: 999_999,
  4980. },
  4981. editable: false,
  4982. active: true,
  4983. screens: {
  4984. create: {
  4985. '-all-' => {
  4986. null: true,
  4987. },
  4988. },
  4989. edit: {
  4990. '-all-' => {
  4991. null: true,
  4992. },
  4993. },
  4994. },
  4995. to_create: false,
  4996. to_migrate: false,
  4997. to_delete: false,
  4998. position: 300,
  4999. )
  5000. ObjectManager::Attribute.add(
  5001. force: true,
  5002. object: 'Group',
  5003. name: 'follow_up_possible',
  5004. display: 'Follow up possible',
  5005. data_type: 'select',
  5006. data_option: {
  5007. default: 'yes',
  5008. options: {
  5009. yes: 'yes',
  5010. new_ticket: 'do not reopen Ticket but create new Ticket'
  5011. },
  5012. null: false,
  5013. note: 'Follow up for closed ticket possible or not.',
  5014. translate: true
  5015. },
  5016. editable: false,
  5017. active: true,
  5018. screens: {
  5019. create: {
  5020. '-all-' => {
  5021. null: true,
  5022. },
  5023. },
  5024. edit: {
  5025. '-all-' => {
  5026. null: true,
  5027. },
  5028. },
  5029. },
  5030. to_create: false,
  5031. to_migrate: false,
  5032. to_delete: false,
  5033. position: 400,
  5034. )
  5035. ObjectManager::Attribute.add(
  5036. force: true,
  5037. object: 'Group',
  5038. name: 'follow_up_assignment',
  5039. display: 'Assign Follow Ups',
  5040. data_type: 'select',
  5041. data_option: {
  5042. default: 'yes',
  5043. options: {
  5044. true: 'yes',
  5045. false: 'no',
  5046. },
  5047. null: false,
  5048. note: 'Assign follow up to latest agent again.',
  5049. translate: true
  5050. },
  5051. editable: false,
  5052. active: true,
  5053. screens: {
  5054. create: {
  5055. '-all-' => {
  5056. null: true,
  5057. },
  5058. },
  5059. edit: {
  5060. '-all-' => {
  5061. null: true,
  5062. },
  5063. },
  5064. },
  5065. to_create: false,
  5066. to_migrate: false,
  5067. to_delete: false,
  5068. position: 500,
  5069. )
  5070. ObjectManager::Attribute.add(
  5071. force: true,
  5072. object: 'Group',
  5073. name: 'email_address_id',
  5074. display: 'Email',
  5075. data_type: 'select',
  5076. data_option: {
  5077. default: '',
  5078. multiple: false,
  5079. null: true,
  5080. relation: 'EmailAddress',
  5081. nulloption: true,
  5082. do_not_log: true,
  5083. },
  5084. editable: false,
  5085. active: true,
  5086. screens: {
  5087. create: {
  5088. '-all-' => {
  5089. null: true,
  5090. },
  5091. },
  5092. edit: {
  5093. '-all-' => {
  5094. null: true,
  5095. },
  5096. },
  5097. },
  5098. to_create: false,
  5099. to_migrate: false,
  5100. to_delete: false,
  5101. position: 600,
  5102. )
  5103. ObjectManager::Attribute.add(
  5104. force: true,
  5105. object: 'Group',
  5106. name: 'signature_id',
  5107. display: 'Signature',
  5108. data_type: 'select',
  5109. data_option: {
  5110. default: '',
  5111. multiple: false,
  5112. null: true,
  5113. relation: 'Signature',
  5114. nulloption: true,
  5115. do_not_log: true,
  5116. },
  5117. editable: false,
  5118. active: true,
  5119. screens: {
  5120. create: {
  5121. '-all-' => {
  5122. null: true,
  5123. },
  5124. },
  5125. edit: {
  5126. '-all-' => {
  5127. null: true,
  5128. },
  5129. },
  5130. },
  5131. to_create: false,
  5132. to_migrate: false,
  5133. to_delete: false,
  5134. position: 600,
  5135. )
  5136. ObjectManager::Attribute.add(
  5137. force: true,
  5138. object: 'Group',
  5139. name: 'note',
  5140. display: 'Note',
  5141. data_type: 'richtext',
  5142. data_option: {
  5143. type: 'text',
  5144. maxlength: 250,
  5145. null: true,
  5146. note: 'Notes are visible to agents only, never to customers.',
  5147. },
  5148. editable: false,
  5149. active: true,
  5150. screens: {
  5151. create: {
  5152. '-all-' => {
  5153. null: true,
  5154. },
  5155. },
  5156. edit: {
  5157. '-all-' => {
  5158. null: true,
  5159. },
  5160. },
  5161. view: {
  5162. '-all-' => {
  5163. shown: true,
  5164. },
  5165. },
  5166. },
  5167. to_create: false,
  5168. to_migrate: false,
  5169. to_delete: false,
  5170. position: 1500,
  5171. )
  5172. ObjectManager::Attribute.add(
  5173. force: true,
  5174. object: 'Group',
  5175. name: 'active',
  5176. display: 'Active',
  5177. data_type: 'active',
  5178. data_option: {
  5179. null: true,
  5180. default: true,
  5181. },
  5182. editable: false,
  5183. active: true,
  5184. screens: {
  5185. create: {
  5186. '-all-' => {
  5187. null: true,
  5188. },
  5189. },
  5190. edit: {
  5191. Admin: {
  5192. null: false,
  5193. },
  5194. },
  5195. view: {
  5196. '-all-' => {
  5197. shown: false,
  5198. },
  5199. },
  5200. },
  5201. to_create: false,
  5202. to_migrate: false,
  5203. to_delete: false,
  5204. position: 1800,
  5205. )
  5206. Scheduler.create_if_not_exists(
  5207. name: 'Process pending tickets',
  5208. method: 'Ticket.process_pending',
  5209. period: 60 * 15,
  5210. prio: 1,
  5211. active: true,
  5212. )
  5213. Scheduler.create_if_not_exists(
  5214. name: 'Process escalation tickets',
  5215. method: 'Ticket.process_escalation',
  5216. period: 60 * 5,
  5217. prio: 1,
  5218. active: true,
  5219. )
  5220. Scheduler.create_if_not_exists(
  5221. name: 'Import OTRS diff load',
  5222. method: 'Import::OTRS.diff_worker',
  5223. period: 60 * 3,
  5224. prio: 1,
  5225. active: true,
  5226. updated_by_id: 1,
  5227. created_by_id: 1,
  5228. )
  5229. Scheduler.create_if_not_exists(
  5230. name: 'Check Channels',
  5231. method: 'Channel.fetch',
  5232. period: 30,
  5233. prio: 1,
  5234. active: true,
  5235. updated_by_id: 1,
  5236. created_by_id: 1,
  5237. )
  5238. Scheduler.create_if_not_exists(
  5239. name: 'Check streams for Channel',
  5240. method: 'Channel.stream',
  5241. period: 60,
  5242. prio: 1,
  5243. active: true,
  5244. updated_by_id: 1,
  5245. created_by_id: 1,
  5246. )
  5247. Scheduler.create_if_not_exists(
  5248. name: 'Generate Session data',
  5249. method: 'Sessions.jobs',
  5250. period: 60,
  5251. prio: 1,
  5252. active: true,
  5253. updated_by_id: 1,
  5254. created_by_id: 1,
  5255. )
  5256. Scheduler.create_if_not_exists(
  5257. name: 'Execute jobs',
  5258. method: 'Job.run',
  5259. period: 5 * 60,
  5260. prio: 2,
  5261. active: true,
  5262. updated_by_id: 1,
  5263. created_by_id: 1,
  5264. )
  5265. Scheduler.create_if_not_exists(
  5266. name: 'Cleanup expired sessions',
  5267. method: 'SessionHelper.cleanup_expired',
  5268. period: 60 * 60 * 12,
  5269. prio: 2,
  5270. active: true,
  5271. updated_by_id: 1,
  5272. created_by_id: 1,
  5273. )
  5274. Scheduler.create_if_not_exists(
  5275. name: 'Delete old activity stream entries.',
  5276. method: 'ActivityStream.cleanup',
  5277. period: 1.day,
  5278. prio: 2,
  5279. active: true,
  5280. updated_by_id: 1,
  5281. created_by_id: 1,
  5282. )
  5283. Scheduler.create_if_not_exists(
  5284. name: 'Delete old entries.',
  5285. method: 'RecentView.cleanup',
  5286. period: 1.day,
  5287. prio: 2,
  5288. active: true,
  5289. updated_by_id: 1,
  5290. created_by_id: 1,
  5291. )
  5292. Scheduler.create_or_update(
  5293. name: 'Delete old online notification entries.',
  5294. method: 'OnlineNotification.cleanup',
  5295. period: 2.hours,
  5296. prio: 2,
  5297. active: true,
  5298. updated_by_id: 1,
  5299. created_by_id: 1,
  5300. )
  5301. Scheduler.create_or_update(
  5302. name: 'Delete old token entries.',
  5303. method: 'Token.cleanup',
  5304. period: 30.days,
  5305. prio: 2,
  5306. active: true,
  5307. updated_by_id: 1,
  5308. created_by_id: 1,
  5309. )
  5310. Scheduler.create_or_update(
  5311. name: 'Closed chat sessions where participients are offline.',
  5312. method: 'Chat.cleanup_close',
  5313. period: 60 * 15,
  5314. prio: 2,
  5315. active: true,
  5316. updated_by_id: 1,
  5317. created_by_id: 1,
  5318. )
  5319. Scheduler.create_or_update(
  5320. name: 'Cleanup closed sessions.',
  5321. method: 'Chat.cleanup',
  5322. period: 5.days,
  5323. prio: 2,
  5324. active: true,
  5325. updated_by_id: 1,
  5326. created_by_id: 1,
  5327. )
  5328. Scheduler.create_or_update(
  5329. name: 'Sync calendars with ical feeds.',
  5330. method: 'Calendar.sync',
  5331. period: 1.day,
  5332. prio: 2,
  5333. active: true,
  5334. updated_by_id: 1,
  5335. created_by_id: 1,
  5336. )
  5337. Scheduler.create_or_update(
  5338. name: 'Generate user based stats.',
  5339. method: 'Stats.generate',
  5340. period: 11.minutes,
  5341. prio: 2,
  5342. active: true,
  5343. updated_by_id: 1,
  5344. created_by_id: 1,
  5345. )
  5346. Scheduler.create_or_update(
  5347. name: 'Delete old stats store entries.',
  5348. method: 'StatsStore.cleanup',
  5349. period: 31.days,
  5350. prio: 2,
  5351. active: true,
  5352. updated_by_id: 1,
  5353. created_by_id: 1,
  5354. )
  5355. Scheduler.create_if_not_exists(
  5356. name: 'Cleanup HttpLog',
  5357. method: 'HttpLog.cleanup',
  5358. period: 24 * 60 * 60,
  5359. prio: 2,
  5360. active: true,
  5361. updated_by_id: 1,
  5362. created_by_id: 1,
  5363. )
  5364. Trigger.create_or_update(
  5365. name: 'auto reply (on new tickets)',
  5366. condition: {
  5367. 'ticket.action' => {
  5368. 'operator' => 'is',
  5369. 'value' => 'create',
  5370. },
  5371. 'ticket.state_id' => {
  5372. 'operator' => 'is not',
  5373. 'value' => Ticket::State.lookup(name: 'closed').id,
  5374. },
  5375. 'article.type_id' => {
  5376. 'operator' => 'is',
  5377. 'value' => [
  5378. Ticket::Article::Type.lookup(name: 'email').id,
  5379. Ticket::Article::Type.lookup(name: 'phone').id,
  5380. Ticket::Article::Type.lookup(name: 'web').id,
  5381. ],
  5382. },
  5383. 'article.sender_id' => {
  5384. 'operator' => 'is',
  5385. 'value' => Ticket::Article::Sender.lookup(name: 'Customer').id,
  5386. },
  5387. },
  5388. perform: {
  5389. 'notification.email' => {
  5390. 'body' => '<div>Your request <b>(#{config.ticket_hook}#{ticket.number})</b> has been received and will be reviewed by our support staff.</div>
  5391. <br/>
  5392. <div>To provide additional information, please reply to this email or click on the following link (for initial login, please request a new password):
  5393. <a href="#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}">#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}</a>
  5394. </div>
  5395. <br/>
  5396. <div>Your #{config.product_name} Team</div>
  5397. <br/>
  5398. <div><i><a href="https://zammad.com">Zammad</a>, your customer support system</i></div>',
  5399. 'recipient' => 'ticket_customer',
  5400. 'subject' => 'Thanks for your inquiry (#{ticket.title})',
  5401. },
  5402. },
  5403. active: true,
  5404. created_by_id: 1,
  5405. updated_by_id: 1,
  5406. )
  5407. Trigger.create_or_update(
  5408. name: 'auto reply (on follow up of tickets)',
  5409. condition: {
  5410. 'ticket.action' => {
  5411. 'operator' => 'is',
  5412. 'value' => 'update',
  5413. },
  5414. 'article.sender_id' => {
  5415. 'operator' => 'is',
  5416. 'value' => Ticket::Article::Sender.lookup(name: 'Customer').id,
  5417. },
  5418. 'article.type_id' => {
  5419. 'operator' => 'is',
  5420. 'value' => [
  5421. Ticket::Article::Type.lookup(name: 'email').id,
  5422. Ticket::Article::Type.lookup(name: 'phone').id,
  5423. Ticket::Article::Type.lookup(name: 'web').id,
  5424. ],
  5425. },
  5426. },
  5427. perform: {
  5428. 'notification.email' => {
  5429. 'body' => '<div>Your follow up for <b>(#{config.ticket_hook}#{ticket.number})</b> has been received and will be reviewed by our support staff.</div>
  5430. <br/>
  5431. <div>To provide additional information, please reply to this email or click on the following link:
  5432. <a href="#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}">#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}</a>
  5433. </div>
  5434. <br/>
  5435. <div>Your #{config.product_name} Team</div>
  5436. <br/>
  5437. <div><i><a href="https://zammad.com">Zammad</a>, your customer support system</i></div>',
  5438. 'recipient' => 'ticket_customer',
  5439. 'subject' => 'Thanks for your follow up (#{ticket.title})',
  5440. },
  5441. },
  5442. active: false,
  5443. created_by_id: 1,
  5444. updated_by_id: 1,
  5445. )
  5446. Trigger.create_or_update(
  5447. name: 'customer notification (on owner change)',
  5448. condition: {
  5449. 'ticket.owner_id' => {
  5450. 'operator' => 'has changed',
  5451. 'pre_condition' => 'current_user.id',
  5452. 'value' => '',
  5453. 'value_completion' => '',
  5454. }
  5455. },
  5456. perform: {
  5457. 'notification.email' => {
  5458. 'body' => '<p>The owner of ticket (Ticket##{ticket.number}) has changed and is now "#{ticket.owner.firstname} #{ticket.owner.lastname}".<p>
  5459. <br/>
  5460. <p>To provide additional information, please reply to this email or click on the following link:
  5461. <a href="#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}">#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}</a>
  5462. </p>
  5463. <br/>
  5464. <p><i><a href="https://zammad.com">Zammad</a>, your customer support system</i></p>',
  5465. 'recipient' => 'ticket_customer',
  5466. 'subject' => 'Owner has changed (#{ticket.title})',
  5467. },
  5468. },
  5469. active: false,
  5470. created_by_id: 1,
  5471. updated_by_id: 1,
  5472. )
  5473. Karma::Activity.create_or_update(
  5474. name: 'ticket create',
  5475. description: 'You have created a ticket',
  5476. score: 10,
  5477. once_ttl: 60,
  5478. )
  5479. Karma::Activity.create_or_update(
  5480. name: 'ticket close',
  5481. description: 'You have closed a ticket',
  5482. score: 5,
  5483. once_ttl: 60,
  5484. )
  5485. Karma::Activity.create_or_update(
  5486. name: 'ticket answer 1h',
  5487. description: 'You have answered a ticket within 1h',
  5488. score: 25,
  5489. once_ttl: 60,
  5490. )
  5491. Karma::Activity.create_or_update(
  5492. name: 'ticket answer 2h',
  5493. description: 'You have answered a ticket within 2h',
  5494. score: 20,
  5495. once_ttl: 60,
  5496. )
  5497. Karma::Activity.create_or_update(
  5498. name: 'ticket answer 12h',
  5499. description: 'You have answered a ticket within 12h',
  5500. score: 10,
  5501. once_ttl: 60,
  5502. )
  5503. Karma::Activity.create_or_update(
  5504. name: 'ticket answer 24h',
  5505. description: 'You have answered a ticket within 24h',
  5506. score: 5,
  5507. once_ttl: 60,
  5508. )
  5509. Karma::Activity.create_or_update(
  5510. name: 'ticket pending state',
  5511. description: 'Usage of advanced features',
  5512. score: 2,
  5513. once_ttl: 60,
  5514. )
  5515. Karma::Activity.create_or_update(
  5516. name: 'ticket escalated',
  5517. description: 'You have escalated tickets',
  5518. score: -5,
  5519. once_ttl: 60 * 60 * 24,
  5520. )
  5521. Karma::Activity.create_or_update(
  5522. name: 'ticket reminder overdue (+2 days)',
  5523. description: 'You have tickets that are over 2 days overdue',
  5524. score: -5,
  5525. once_ttl: 60 * 60 * 24,
  5526. )
  5527. Karma::Activity.create_or_update(
  5528. name: 'text module',
  5529. description: 'Usage of advanced features',
  5530. score: 4,
  5531. once_ttl: 60 * 30,
  5532. )
  5533. Karma::Activity.create_or_update(
  5534. name: 'tagging',
  5535. description: 'Usage of advanced features',
  5536. score: 4,
  5537. once_ttl: 60 * 60 * 4,
  5538. )
  5539. # reset primary key sequences
  5540. DbHelper.import_post
  5541. # install locales and translations
  5542. Locale.create_if_not_exists(
  5543. locale: 'en-us',
  5544. alias: 'en',
  5545. name: 'English (United States)',
  5546. )
  5547. Locale.sync
  5548. Translation.sync
  5549. Calendar.init_setup
  5550. # install all packages in auto_install
  5551. Package.auto_install