seeds.rb 121 KB

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