seeds.rb 121 KB

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