seeds.rb 119 KB

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