20160217000001_object_manager_update_user.rb 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. class ObjectManagerUpdateUser < ActiveRecord::Migration
  2. def up
  3. UserInfo.current_user_id = 1
  4. ObjectManager::Attribute.add(
  5. object: 'User',
  6. name: 'login',
  7. display: 'Login',
  8. data_type: 'input',
  9. data_option: {
  10. type: 'text',
  11. maxlength: 100,
  12. null: true,
  13. autocapitalize: false,
  14. item_class: 'formGroup--halfSize',
  15. },
  16. editable: false,
  17. active: true,
  18. screens: {
  19. signup: {},
  20. invite_agent: {},
  21. invite_customer: {},
  22. edit: {},
  23. view: {
  24. '-all-' => {
  25. shown: false,
  26. },
  27. },
  28. },
  29. pending_migration: false,
  30. position: 100,
  31. )
  32. ObjectManager::Attribute.add(
  33. object: 'User',
  34. name: 'firstname',
  35. display: 'Firstname',
  36. data_type: 'input',
  37. data_option: {
  38. type: 'text',
  39. maxlength: 150,
  40. null: false,
  41. item_class: 'formGroup--halfSize',
  42. },
  43. editable: false,
  44. active: true,
  45. screens: {
  46. signup: {
  47. '-all-' => {
  48. null: false,
  49. },
  50. },
  51. invite_agent: {
  52. '-all-' => {
  53. null: false,
  54. },
  55. },
  56. invite_customer: {
  57. '-all-' => {
  58. null: false,
  59. },
  60. },
  61. edit: {
  62. '-all-' => {
  63. null: false,
  64. },
  65. },
  66. view: {
  67. '-all-' => {
  68. shown: true,
  69. },
  70. },
  71. },
  72. pending_migration: false,
  73. position: 200,
  74. )
  75. ObjectManager::Attribute.add(
  76. object: 'User',
  77. name: 'lastname',
  78. display: 'Lastname',
  79. data_type: 'input',
  80. data_option: {
  81. type: 'text',
  82. maxlength: 150,
  83. null: false,
  84. item_class: 'formGroup--halfSize',
  85. },
  86. editable: false,
  87. active: true,
  88. screens: {
  89. signup: {
  90. '-all-' => {
  91. null: false,
  92. },
  93. },
  94. invite_agent: {
  95. '-all-' => {
  96. null: false,
  97. },
  98. },
  99. invite_customer: {
  100. '-all-' => {
  101. null: false,
  102. },
  103. },
  104. edit: {
  105. '-all-' => {
  106. null: false,
  107. },
  108. },
  109. view: {
  110. '-all-' => {
  111. shown: true,
  112. },
  113. },
  114. },
  115. pending_migration: false,
  116. position: 300,
  117. )
  118. ObjectManager::Attribute.add(
  119. object: 'User',
  120. name: 'email',
  121. display: 'Email',
  122. data_type: 'input',
  123. data_option: {
  124. type: 'email',
  125. maxlength: 150,
  126. null: false,
  127. item_class: 'formGroup--halfSize',
  128. },
  129. editable: false,
  130. active: true,
  131. screens: {
  132. signup: {
  133. '-all-' => {
  134. null: false,
  135. },
  136. },
  137. invite_agent: {
  138. '-all-' => {
  139. null: false,
  140. },
  141. },
  142. invite_customer: {
  143. '-all-' => {
  144. null: false,
  145. },
  146. },
  147. edit: {
  148. '-all-' => {
  149. null: false,
  150. },
  151. },
  152. view: {
  153. '-all-' => {
  154. shown: true,
  155. },
  156. },
  157. },
  158. pending_migration: false,
  159. position: 400,
  160. )
  161. ObjectManager::Attribute.add(
  162. object: 'User',
  163. name: 'web',
  164. display: 'Web',
  165. data_type: 'input',
  166. data_option: {
  167. type: 'url',
  168. maxlength: 250,
  169. null: true,
  170. item_class: 'formGroup--halfSize',
  171. },
  172. editable: false,
  173. active: true,
  174. screens: {
  175. signup: {},
  176. invite_agent: {},
  177. invite_customer: {},
  178. edit: {
  179. '-all-' => {
  180. null: true,
  181. },
  182. },
  183. view: {
  184. '-all-' => {
  185. shown: true,
  186. },
  187. },
  188. },
  189. pending_migration: false,
  190. position: 500,
  191. )
  192. ObjectManager::Attribute.add(
  193. object: 'User',
  194. name: 'phone',
  195. display: 'Phone',
  196. data_type: 'input',
  197. data_option: {
  198. type: 'phone',
  199. maxlength: 100,
  200. null: true,
  201. item_class: 'formGroup--halfSize',
  202. },
  203. editable: false,
  204. active: true,
  205. screens: {
  206. signup: {},
  207. invite_agent: {},
  208. invite_customer: {},
  209. edit: {
  210. '-all-' => {
  211. null: true,
  212. },
  213. },
  214. view: {
  215. '-all-' => {
  216. shown: true,
  217. },
  218. },
  219. },
  220. pending_migration: false,
  221. position: 600,
  222. )
  223. ObjectManager::Attribute.add(
  224. object: 'User',
  225. name: 'mobile',
  226. display: 'Mobile',
  227. data_type: 'input',
  228. data_option: {
  229. type: 'phone',
  230. maxlength: 100,
  231. null: true,
  232. item_class: 'formGroup--halfSize',
  233. },
  234. editable: false,
  235. active: true,
  236. screens: {
  237. signup: {},
  238. invite_agent: {},
  239. invite_customer: {},
  240. edit: {
  241. '-all-' => {
  242. null: true,
  243. },
  244. },
  245. view: {
  246. '-all-' => {
  247. shown: true,
  248. },
  249. },
  250. },
  251. pending_migration: false,
  252. position: 700,
  253. )
  254. ObjectManager::Attribute.add(
  255. object: 'User',
  256. name: 'fax',
  257. display: 'Fax',
  258. data_type: 'input',
  259. data_option: {
  260. type: 'phone',
  261. maxlength: 100,
  262. null: true,
  263. item_class: 'formGroup--halfSize',
  264. },
  265. editable: false,
  266. active: true,
  267. screens: {
  268. signup: {},
  269. invite_agent: {},
  270. invite_customer: {},
  271. edit: {
  272. '-all-' => {
  273. null: true,
  274. },
  275. },
  276. view: {
  277. '-all-' => {
  278. shown: true,
  279. },
  280. },
  281. },
  282. pending_migration: false,
  283. position: 800,
  284. )
  285. ObjectManager::Attribute.add(
  286. object: 'User',
  287. name: 'organization_id',
  288. display: 'Organization',
  289. data_type: 'autocompletion_ajax',
  290. data_option: {
  291. multiple: false,
  292. nulloption: true,
  293. null: true,
  294. relation: 'Organization',
  295. item_class: 'formGroup--halfSize',
  296. },
  297. editable: false,
  298. active: true,
  299. screens: {
  300. signup: {},
  301. invite_agent: {},
  302. invite_customer: {
  303. '-all-' => {
  304. null: true,
  305. },
  306. },
  307. edit: {
  308. '-all-' => {
  309. null: true,
  310. },
  311. },
  312. view: {
  313. '-all-' => {
  314. shown: true,
  315. },
  316. },
  317. },
  318. pending_migration: false,
  319. position: 900,
  320. )
  321. ObjectManager::Attribute.add(
  322. object: 'User',
  323. name: 'department',
  324. display: 'Department',
  325. data_type: 'input',
  326. data_option: {
  327. type: 'text',
  328. maxlength: 200,
  329. null: true,
  330. item_class: 'formGroup--halfSize',
  331. },
  332. editable: false,
  333. active: true,
  334. screens: {
  335. signup: {},
  336. invite_agent: {},
  337. invite_customer: {},
  338. edit: {
  339. '-all-' => {
  340. null: true,
  341. },
  342. },
  343. view: {
  344. '-all-' => {
  345. shown: true,
  346. },
  347. },
  348. },
  349. pending_migration: false,
  350. position: 1000,
  351. )
  352. ObjectManager::Attribute.add(
  353. object: 'User',
  354. name: 'street',
  355. display: 'Street',
  356. data_type: 'input',
  357. data_option: {
  358. type: 'text',
  359. maxlength: 100,
  360. null: true,
  361. },
  362. editable: false,
  363. active: true,
  364. screens: {
  365. signup: {},
  366. invite_agent: {},
  367. invite_customer: {},
  368. edit: {
  369. '-all-' => {
  370. null: true,
  371. },
  372. },
  373. view: {
  374. '-all-' => {
  375. shown: true,
  376. },
  377. },
  378. },
  379. pending_migration: false,
  380. position: 1100,
  381. )
  382. ObjectManager::Attribute.add(
  383. object: 'User',
  384. name: 'zip',
  385. display: 'Zip',
  386. data_type: 'input',
  387. data_option: {
  388. type: 'text',
  389. maxlength: 100,
  390. null: true,
  391. item_class: 'formGroup--halfSize',
  392. },
  393. editable: false,
  394. active: true,
  395. screens: {
  396. signup: {},
  397. invite_agent: {},
  398. invite_customer: {},
  399. edit: {
  400. '-all-' => {
  401. null: true,
  402. },
  403. },
  404. view: {
  405. '-all-' => {
  406. shown: true,
  407. },
  408. },
  409. },
  410. pending_migration: false,
  411. position: 1200,
  412. )
  413. ObjectManager::Attribute.add(
  414. object: 'User',
  415. name: 'city',
  416. display: 'City',
  417. data_type: 'input',
  418. data_option: {
  419. type: 'text',
  420. maxlength: 100,
  421. null: true,
  422. item_class: 'formGroup--halfSize',
  423. },
  424. editable: false,
  425. active: true,
  426. screens: {
  427. signup: {},
  428. invite_agent: {},
  429. invite_customer: {},
  430. edit: {
  431. '-all-' => {
  432. null: true,
  433. },
  434. },
  435. view: {
  436. '-all-' => {
  437. shown: true,
  438. },
  439. },
  440. },
  441. pending_migration: false,
  442. position: 1300,
  443. )
  444. ObjectManager::Attribute.add(
  445. object: 'User',
  446. name: 'address',
  447. display: 'Address',
  448. data_type: 'textarea',
  449. data_option: {
  450. type: 'text',
  451. maxlength: 500,
  452. null: true,
  453. item_class: 'formGroup--halfSize',
  454. },
  455. editable: false,
  456. active: true,
  457. screens: {
  458. signup: {},
  459. invite_agent: {},
  460. invite_customer: {},
  461. edit: {
  462. '-all-' => {
  463. null: true,
  464. },
  465. },
  466. view: {
  467. '-all-' => {
  468. shown: true,
  469. },
  470. },
  471. },
  472. pending_migration: false,
  473. position: 1350,
  474. )
  475. ObjectManager::Attribute.add(
  476. object: 'User',
  477. name: 'password',
  478. display: 'Password',
  479. data_type: 'input',
  480. data_option: {
  481. type: 'password',
  482. maxlength: 100,
  483. null: true,
  484. autocomplete: 'off',
  485. item_class: 'formGroup--halfSize',
  486. },
  487. editable: false,
  488. active: true,
  489. screens: {
  490. signup: {
  491. '-all-' => {
  492. null: false,
  493. },
  494. },
  495. invite_agent: {},
  496. invite_customer: {},
  497. edit: {
  498. Admin: {
  499. null: true,
  500. },
  501. },
  502. view: {}
  503. },
  504. pending_migration: false,
  505. position: 1400,
  506. )
  507. ObjectManager::Attribute.add(
  508. object: 'User',
  509. name: 'vip',
  510. display: 'VIP',
  511. data_type: 'boolean',
  512. data_option: {
  513. null: true,
  514. default: false,
  515. item_class: 'formGroup--halfSize',
  516. options: {
  517. false: 'no',
  518. true: 'yes',
  519. },
  520. translate: true,
  521. },
  522. editable: false,
  523. active: true,
  524. screens: {
  525. edit: {
  526. Admin: {
  527. null: true,
  528. },
  529. Agent: {
  530. null: true,
  531. },
  532. },
  533. view: {
  534. '-all-' => {
  535. shown: false,
  536. },
  537. },
  538. },
  539. pending_migration: false,
  540. position: 1490,
  541. )
  542. ObjectManager::Attribute.add(
  543. object: 'User',
  544. name: 'note',
  545. display: 'Note',
  546. data_type: 'richtext',
  547. data_option: {
  548. type: 'text',
  549. maxlength: 250,
  550. null: true,
  551. note: 'Notes are visible to agents only, never to customers.',
  552. },
  553. editable: false,
  554. active: true,
  555. screens: {
  556. signup: {},
  557. invite_agent: {},
  558. invite_customer: {
  559. '-all-' => {
  560. null: true,
  561. },
  562. },
  563. edit: {
  564. '-all-' => {
  565. null: true,
  566. },
  567. },
  568. view: {
  569. '-all-' => {
  570. shown: true,
  571. },
  572. },
  573. },
  574. pending_migration: false,
  575. position: 1500,
  576. )
  577. ObjectManager::Attribute.add(
  578. object: 'User',
  579. name: 'role_ids',
  580. display: 'Roles',
  581. data_type: 'checkbox',
  582. data_option: {
  583. multiple: true,
  584. null: false,
  585. relation: 'Role',
  586. },
  587. editable: false,
  588. active: true,
  589. screens: {
  590. signup: {},
  591. invite_agent: {},
  592. invite_customer: {},
  593. edit: {
  594. Admin: {
  595. null: false,
  596. },
  597. },
  598. view: {
  599. '-all-' => {
  600. shown: false,
  601. },
  602. },
  603. },
  604. pending_migration: false,
  605. position: 1600,
  606. )
  607. ObjectManager::Attribute.add(
  608. object: 'User',
  609. name: 'group_ids',
  610. display: 'Groups',
  611. data_type: 'checkbox',
  612. data_option: {
  613. multiple: true,
  614. null: true,
  615. relation: 'Group',
  616. },
  617. editable: false,
  618. active: true,
  619. screens: {
  620. signup: {},
  621. invite_agent: {
  622. '-all-' => {
  623. null: false,
  624. },
  625. },
  626. invite_customer: {},
  627. edit: {
  628. Admin: {
  629. null: true,
  630. },
  631. },
  632. view: {
  633. '-all-' => {
  634. shown: false,
  635. },
  636. },
  637. },
  638. pending_migration: false,
  639. position: 1700,
  640. )
  641. ObjectManager::Attribute.add(
  642. object: 'User',
  643. name: 'active',
  644. display: 'Active',
  645. data_type: 'active',
  646. data_option: {
  647. default: true,
  648. },
  649. editable: false,
  650. active: true,
  651. screens: {
  652. signup: {},
  653. invite_agent: {},
  654. invite_customer: {},
  655. edit: {
  656. Admin: {
  657. null: false,
  658. },
  659. },
  660. view: {
  661. '-all-' => {
  662. shown: false,
  663. },
  664. },
  665. },
  666. pending_migration: false,
  667. position: 1800,
  668. )
  669. end
  670. end