20160217000001_object_manager_update_user.rb 14 KB

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