seeds.rb 116 KB

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