seeds.rb 119 KB

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