seeds.rb 124 KB

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