seeds.rb 110 KB

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