seeds.rb 94 KB

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