seeds.rb 113 KB

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