20140831000001_create_object_manager.rb 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019
  1. class CreateObjectManager < ActiveRecord::Migration
  2. def up
  3. add_column :tickets, :pending_time, :timestamp, :null => true
  4. add_index :tickets, [:pending_time]
  5. add_column :tickets, :type, :string, :limit => 100, :null => true
  6. add_index :tickets, [:type]
  7. create_table :object_manager_attributes do |t|
  8. t.references :object_lookup, :null => false
  9. t.column :name, :string, :limit => 200, :null => false
  10. t.column :display, :string, :limit => 200, :null => false
  11. t.column :data_type, :string, :limit => 100, :null => false
  12. t.column :data_option, :string, :limit => 8000, :null => true
  13. t.column :editable, :boolean, :null => false, :default => true
  14. t.column :active, :boolean, :null => false, :default => true
  15. t.column :screens, :string, :limit => 2000, :null => true
  16. t.column :pending_migration, :boolean, :null => false, :default => true
  17. t.column :position, :integer, :null => false
  18. t.column :created_by_id, :integer, :null => false
  19. t.column :updated_by_id, :integer, :null => false
  20. t.timestamps
  21. end
  22. add_index :object_manager_attributes, [:name], :unique => true
  23. add_index :object_manager_attributes, [:object_lookup_id]
  24. ObjectManager::Attribute.add(
  25. :object => 'Ticket',
  26. :name => 'customer_id',
  27. :display => 'Customer',
  28. :data_type => 'autocompletion',
  29. :data_option => {
  30. :relation => 'User',
  31. :autocapitalize => false,
  32. :multiple => false,
  33. :null => false,
  34. :limit => 200,
  35. :placeholder => 'Enter Person or Organisation/Company',
  36. :help => 'Select the customer of the Ticket or create one.',
  37. :helpLink => '<a href="" class="customer_new">&raquo;</a>',
  38. :minLengt => 2,
  39. :translate => false,
  40. :source => '#{@apiPath}/users/search',
  41. },
  42. :editable => false,
  43. :active => true,
  44. :screens => {
  45. :create_top => {
  46. :Agent => {
  47. :null => false,
  48. },
  49. },
  50. :edit => {},
  51. },
  52. :pending_migration => false,
  53. :position => 10,
  54. :created_by_id => 1,
  55. :updated_by_id => 1,
  56. )
  57. ObjectManager::Attribute.add(
  58. :object => 'Ticket',
  59. :name => 'type',
  60. :display => 'Type',
  61. :data_type => 'select',
  62. :data_option => {
  63. :options => {
  64. 'Incident' => 'Incident',
  65. 'Problem' => 'Problem',
  66. 'Request for Change' => 'Request for Change',
  67. },
  68. :nulloption => true,
  69. :multiple => false,
  70. :null => true,
  71. :translate => true,
  72. },
  73. :editable => false,
  74. :active => false,
  75. :screens => {
  76. :create_middle => {
  77. '-all-' => {
  78. :null => false,
  79. :item_class => 'column',
  80. },
  81. },
  82. :edit => {
  83. :Agent => {
  84. :null => false,
  85. },
  86. },
  87. },
  88. :pending_migration => false,
  89. :position => 20,
  90. :created_by_id => 1,
  91. :updated_by_id => 1,
  92. )
  93. ObjectManager::Attribute.add(
  94. :object => 'Ticket',
  95. :name => 'group_id',
  96. :display => 'Group',
  97. :data_type => 'select',
  98. :data_option => {
  99. :relation => 'Group',
  100. :relation_condition => { :access => 'rw' },
  101. :nulloption => true,
  102. :multiple => false,
  103. :null => false,
  104. :translate => false,
  105. },
  106. :editable => false,
  107. :active => true,
  108. :screens => {
  109. :create_middle => {
  110. '-all-' => {
  111. :null => false,
  112. :item_class => 'column',
  113. },
  114. },
  115. :edit => {
  116. :Agent => {
  117. :null => false,
  118. },
  119. },
  120. },
  121. :pending_migration => false,
  122. :position => 20,
  123. :created_by_id => 1,
  124. :updated_by_id => 1,
  125. )
  126. ObjectManager::Attribute.add(
  127. :object => 'Ticket',
  128. :name => 'owner_id',
  129. :display => 'Owner',
  130. :data_type => 'select',
  131. :data_option => {
  132. :relation => 'User',
  133. :relation_condition => { :roles => 'Agent' },
  134. :nulloption => true,
  135. :multiple => false,
  136. :null => true,
  137. :translate => false,
  138. },
  139. :editable => false,
  140. :active => true,
  141. :screens => {
  142. :create_middle => {
  143. :Agent => {
  144. :null => true,
  145. :item_class => 'column',
  146. },
  147. },
  148. :edit => {
  149. :Agent => {
  150. :null => true,
  151. },
  152. },
  153. },
  154. :pending_migration => false,
  155. :position => 30,
  156. :created_by_id => 1,
  157. :updated_by_id => 1,
  158. )
  159. ObjectManager::Attribute.add(
  160. :object => 'Ticket',
  161. :name => 'state_id',
  162. :display => 'State',
  163. :data_type => 'select',
  164. :data_option => {
  165. :relation => 'TicketState',
  166. :nulloption => true,
  167. :multiple => false,
  168. :null => false,
  169. :default => 2,
  170. :translate => true,
  171. :filter => [1,2,3,4],
  172. },
  173. :editable => false,
  174. :active => true,
  175. :screens => {
  176. :create_middle => {
  177. :Agent => {
  178. :null => false,
  179. :item_class => 'column',
  180. },
  181. :Customer => {
  182. :item_class => 'column',
  183. :nulloption => false,
  184. :null => true,
  185. :filter => [1,4],
  186. :default => 1,
  187. },
  188. },
  189. :edit => {
  190. :Agent => {
  191. :nulloption => false,
  192. :null => false,
  193. :filter => [2,3,4],
  194. },
  195. :Customer => {
  196. :nulloption => false,
  197. :null => true,
  198. :filter => [2,4],
  199. :default => 2,
  200. },
  201. },
  202. },
  203. :pending_migration => false,
  204. :position => 40,
  205. :created_by_id => 1,
  206. :updated_by_id => 1,
  207. )
  208. ObjectManager::Attribute.add(
  209. :object => 'Ticket',
  210. :name => 'pending_time',
  211. :display => 'Pending till',
  212. :data_type => 'datetime',
  213. :data_option => {
  214. :future => true,
  215. :past => false,
  216. :diff => 24,
  217. :null => true,
  218. :translate => true,
  219. :required_if => {
  220. :state_id => [3]
  221. },
  222. :shown_if => {
  223. :state_id => [3]
  224. },
  225. },
  226. :editable => false,
  227. :active => true,
  228. :screens => {
  229. :create_middle => {
  230. '-all-' => {
  231. :null => false,
  232. :item_class => 'column',
  233. },
  234. },
  235. :edit => {
  236. :Agent => {
  237. :null => false,
  238. },
  239. },
  240. },
  241. :pending_migration => false,
  242. :position => 41,
  243. :created_by_id => 1,
  244. :updated_by_id => 1,
  245. )
  246. ObjectManager::Attribute.add(
  247. :object => 'Ticket',
  248. :name => 'priority_id',
  249. :display => 'Priority',
  250. :data_type => 'select',
  251. :data_option => {
  252. :relation => 'TicketPriority',
  253. :nulloption => true,
  254. :multiple => false,
  255. :null => false,
  256. :default => 2,
  257. :translate => true,
  258. },
  259. :editable => false,
  260. :active => true,
  261. :screens => {
  262. :create_middle => {
  263. :Agent => {
  264. :null => false,
  265. :item_class => 'column',
  266. },
  267. },
  268. :create_web => {},
  269. :edit => {
  270. :Agent => {
  271. :null => false,
  272. :nulloption => false,
  273. },
  274. },
  275. },
  276. :pending_migration => false,
  277. :position => 80,
  278. :created_by_id => 1,
  279. :updated_by_id => 1,
  280. )
  281. ObjectManager::Attribute.add(
  282. :object => 'Ticket',
  283. :name => 'tags',
  284. :display => 'Tags',
  285. :data_type => 'tag',
  286. :data_option => {
  287. :type => 'text',
  288. :null => true,
  289. :translate => false,
  290. },
  291. :editable => false,
  292. :active => true,
  293. :screens => {
  294. :create_bottom => {
  295. :Agent => {
  296. :null => true,
  297. },
  298. },
  299. :create_web => {},
  300. :edit => {},
  301. },
  302. :pending_migration => false,
  303. :position => 900,
  304. :created_by_id => 1,
  305. :updated_by_id => 1,
  306. )
  307. ObjectManager::Attribute.add(
  308. :object => 'Ticket',
  309. :name => 'title',
  310. :display => 'Title',
  311. :data_type => 'input',
  312. :data_option => {
  313. :type => 'text',
  314. :maxlength => 200,
  315. :null => false,
  316. :translate => false,
  317. },
  318. :editable => false,
  319. :active => true,
  320. :screens => {
  321. :create_top => {
  322. '-all-' => {
  323. :null => false,
  324. },
  325. },
  326. :create_web => {
  327. '-all-' => {
  328. :null => false,
  329. },
  330. },
  331. :edit => {},
  332. },
  333. :pending_migration => false,
  334. :position => 15,
  335. :created_by_id => 1,
  336. :updated_by_id => 1,
  337. )
  338. ObjectManager::Attribute.add(
  339. :object => 'TicketArticle',
  340. :name => 'type_id',
  341. :display => 'Type',
  342. :data_type => 'select',
  343. :data_option => {
  344. :relation => 'TicketArticleType',
  345. :nulloption => false,
  346. :multiple => false,
  347. :null => false,
  348. :default => 9,
  349. :translate => true,
  350. },
  351. :editable => false,
  352. :active => true,
  353. :screens => {
  354. :create_top => {},
  355. :edit => {
  356. :Agent => {
  357. :null => false,
  358. },
  359. },
  360. },
  361. :pending_migration => false,
  362. :position => 100,
  363. :created_by_id => 1,
  364. :updated_by_id => 1,
  365. )
  366. ObjectManager::Attribute.add(
  367. :object => 'TicketArticle',
  368. :name => 'internal',
  369. :display => 'Visibility',
  370. :data_type => 'select',
  371. :data_option => {
  372. :options => { :true => 'internal', :false => 'public' },
  373. :nulloption => false,
  374. :multiple => false,
  375. :null => true,
  376. :default => false,
  377. :translate => true,
  378. },
  379. :editable => false,
  380. :active => true,
  381. :screens => {
  382. :create_top => {},
  383. :edit => {
  384. :Agent => {
  385. :null => false,
  386. },
  387. },
  388. },
  389. :pending_migration => false,
  390. :position => 200,
  391. :created_by_id => 1,
  392. :updated_by_id => 1,
  393. )
  394. ObjectManager::Attribute.add(
  395. :object => 'TicketArticle',
  396. :name => 'to',
  397. :display => 'To',
  398. :data_type => 'input',
  399. :data_option => {
  400. :type => 'text',
  401. :maxlength => 1000,
  402. :null => true,
  403. },
  404. :editable => false,
  405. :active => true,
  406. :screens => {
  407. :create_top => {},
  408. :edit => {
  409. :Agent => {
  410. :null => true,
  411. },
  412. }, },
  413. :pending_migration => false,
  414. :position => 300,
  415. :created_by_id => 1,
  416. :updated_by_id => 1,
  417. )
  418. ObjectManager::Attribute.add(
  419. :object => 'TicketArticle',
  420. :name => 'cc',
  421. :display => 'Cc',
  422. :data_type => 'input',
  423. :data_option => {
  424. :type => 'text',
  425. :maxlength => 1000,
  426. :null => true,
  427. },
  428. :editable => false,
  429. :active => true,
  430. :screens => {
  431. :create_phone_in => {},
  432. :create_phone_out => {},
  433. :create_email_out => {
  434. '-all-' => {
  435. :null => true,
  436. }
  437. },
  438. :create_web => {},
  439. :edit => {
  440. :Agent => {
  441. :null => true,
  442. },
  443. }, },
  444. :pending_migration => false,
  445. :position => 400,
  446. :created_by_id => 1,
  447. :updated_by_id => 1,
  448. )
  449. ObjectManager::Attribute.add(
  450. :object => 'TicketArticle',
  451. :name => 'body',
  452. :display => 'Text',
  453. :data_type => 'textarea',
  454. :data_option => {
  455. :type => 'text',
  456. :maxlength => 20000,
  457. :upload => true,
  458. :rows => 8,
  459. :null => true,
  460. },
  461. :editable => false,
  462. :active => true,
  463. :screens => {
  464. :create_top => {
  465. '-all-' => {
  466. :null => false,
  467. },
  468. },
  469. :edit => {
  470. :Agent => {
  471. :null => true,
  472. },
  473. :Customer => {
  474. :null => false,
  475. },
  476. },
  477. },
  478. :pending_migration => false,
  479. :position => 600,
  480. :created_by_id => 1,
  481. :updated_by_id => 1,
  482. )
  483. ObjectManager::Attribute.add(
  484. :object => 'User',
  485. :name => 'login',
  486. :display => 'Login',
  487. :data_type => 'input',
  488. :data_option => {
  489. :type => 'text',
  490. :maxlength => 100,
  491. :null => true,
  492. :autocapitalize => false,
  493. },
  494. :editable => false,
  495. :active => true,
  496. :screens => {
  497. :signup => {},
  498. :invite_agent => {},
  499. :edit => {},
  500. },
  501. :pending_migration => false,
  502. :position => 100,
  503. :created_by_id => 1,
  504. :updated_by_id => 1,
  505. )
  506. ObjectManager::Attribute.add(
  507. :object => 'User',
  508. :name => 'firstname',
  509. :display => 'Firstname',
  510. :data_type => 'input',
  511. :data_option => {
  512. :type => 'text',
  513. :maxlength => 150,
  514. :null => false,
  515. },
  516. :editable => false,
  517. :active => true,
  518. :screens => {
  519. :signup => {
  520. '-all-' => {
  521. :null => false,
  522. },
  523. },
  524. :invite_agent => {
  525. '-all-' => {
  526. :null => false,
  527. },
  528. },
  529. :edit => {
  530. '-all-' => {
  531. :null => false,
  532. },
  533. },
  534. },
  535. :pending_migration => false,
  536. :position => 200,
  537. :created_by_id => 1,
  538. :updated_by_id => 1,
  539. )
  540. ObjectManager::Attribute.add(
  541. :object => 'User',
  542. :name => 'lastname',
  543. :display => 'Lastname',
  544. :data_type => 'input',
  545. :data_option => {
  546. :type => 'text',
  547. :maxlength => 150,
  548. :null => false,
  549. },
  550. :editable => false,
  551. :active => true,
  552. :screens => {
  553. :signup => {
  554. '-all-' => {
  555. :null => false,
  556. },
  557. },
  558. :invite_agent => {
  559. '-all-' => {
  560. :null => false,
  561. },
  562. },
  563. :edit => {
  564. '-all-' => {
  565. :null => false,
  566. },
  567. },
  568. },
  569. :pending_migration => false,
  570. :position => 300,
  571. :created_by_id => 1,
  572. :updated_by_id => 1,
  573. )
  574. ObjectManager::Attribute.add(
  575. :object => 'User',
  576. :name => 'email',
  577. :display => 'Email',
  578. :data_type => 'input',
  579. :data_option => {
  580. :type => 'email',
  581. :maxlength => 150,
  582. :null => false,
  583. },
  584. :editable => false,
  585. :active => true,
  586. :screens => {
  587. :signup => {
  588. '-all-' => {
  589. :null => false,
  590. },
  591. },
  592. :invite_agent => {
  593. '-all-' => {
  594. :null => false,
  595. },
  596. },
  597. :edit => {
  598. '-all-' => {
  599. :null => false,
  600. },
  601. },
  602. },
  603. :pending_migration => false,
  604. :position => 400,
  605. :created_by_id => 1,
  606. :updated_by_id => 1,
  607. )
  608. ObjectManager::Attribute.add(
  609. :object => 'User',
  610. :name => 'web',
  611. :display => 'Web',
  612. :data_type => 'input',
  613. :data_option => {
  614. :type => 'url',
  615. :maxlength => 250,
  616. :null => true,
  617. },
  618. :editable => false,
  619. :active => true,
  620. :screens => {
  621. :signup => {},
  622. :invite_agent => {},
  623. :edit => {
  624. '-all-' => {
  625. :null => true,
  626. },
  627. },
  628. },
  629. :pending_migration => false,
  630. :position => 500,
  631. :created_by_id => 1,
  632. :updated_by_id => 1,
  633. )
  634. ObjectManager::Attribute.add(
  635. :object => 'User',
  636. :name => 'phone',
  637. :display => 'Phone',
  638. :data_type => 'input',
  639. :data_option => {
  640. :type => 'phone',
  641. :maxlength => 100,
  642. :null => true,
  643. },
  644. :editable => false,
  645. :active => true,
  646. :screens => {
  647. :signup => {},
  648. :invite_agent => {},
  649. :edit => {
  650. '-all-' => {
  651. :null => true,
  652. },
  653. },
  654. },
  655. :pending_migration => false,
  656. :position => 600,
  657. :created_by_id => 1,
  658. :updated_by_id => 1,
  659. )
  660. ObjectManager::Attribute.add(
  661. :object => 'User',
  662. :name => 'mobile',
  663. :display => 'Mobile',
  664. :data_type => 'input',
  665. :data_option => {
  666. :type => 'phone',
  667. :maxlength => 100,
  668. :null => true,
  669. },
  670. :editable => false,
  671. :active => true,
  672. :screens => {
  673. :signup => {},
  674. :invite_agent => {},
  675. :edit => {
  676. '-all-' => {
  677. :null => true,
  678. },
  679. },
  680. },
  681. :pending_migration => false,
  682. :position => 700,
  683. :created_by_id => 1,
  684. :updated_by_id => 1,
  685. )
  686. ObjectManager::Attribute.add(
  687. :object => 'User',
  688. :name => 'fax',
  689. :display => 'Fax',
  690. :data_type => 'input',
  691. :data_option => {
  692. :type => 'phone',
  693. :maxlength => 100,
  694. :null => true,
  695. },
  696. :editable => false,
  697. :active => true,
  698. :screens => {
  699. :signup => {},
  700. :invite_agent => {},
  701. :edit => {
  702. '-all-' => {
  703. :null => true,
  704. },
  705. },
  706. },
  707. :pending_migration => false,
  708. :position => 800,
  709. :created_by_id => 1,
  710. :updated_by_id => 1,
  711. )
  712. ObjectManager::Attribute.add(
  713. :object => 'User',
  714. :name => 'organization_id',
  715. :display => 'Organization',
  716. :data_type => 'select',
  717. :data_option => {
  718. :multiple => false,
  719. :nulloption => true,
  720. :null => true,
  721. :relation => 'Organization',
  722. },
  723. :editable => false,
  724. :active => true,
  725. :screens => {
  726. :signup => {},
  727. :invite_agent => {},
  728. :edit => {
  729. '-all-' => {
  730. :null => true,
  731. },
  732. },
  733. },
  734. :pending_migration => false,
  735. :position => 900,
  736. :created_by_id => 1,
  737. :updated_by_id => 1,
  738. )
  739. ObjectManager::Attribute.add(
  740. :object => 'User',
  741. :name => 'department',
  742. :display => 'Department',
  743. :data_type => 'input',
  744. :data_option => {
  745. :type => 'text',
  746. :maxlength => 200,
  747. :null => true,
  748. },
  749. :editable => false,
  750. :active => true,
  751. :screens => {
  752. :signup => {},
  753. :invite_agent => {},
  754. :edit => {
  755. '-all-' => {
  756. :null => true,
  757. },
  758. },
  759. },
  760. :pending_migration => false,
  761. :position => 1000,
  762. :created_by_id => 1,
  763. :updated_by_id => 1,
  764. )
  765. ObjectManager::Attribute.add(
  766. :object => 'User',
  767. :name => 'street',
  768. :display => 'Street',
  769. :data_type => 'input',
  770. :data_option => {
  771. :type => 'text',
  772. :maxlength => 100,
  773. :null => true,
  774. },
  775. :editable => false,
  776. :active => true,
  777. :screens => {
  778. :signup => {},
  779. :invite_agent => {},
  780. :edit => {
  781. '-all-' => {
  782. :null => true,
  783. },
  784. },
  785. },
  786. :pending_migration => false,
  787. :position => 1100,
  788. :created_by_id => 1,
  789. :updated_by_id => 1,
  790. )
  791. ObjectManager::Attribute.add(
  792. :object => 'User',
  793. :name => 'zip',
  794. :display => 'Zip',
  795. :data_type => 'input',
  796. :data_option => {
  797. :type => 'text',
  798. :maxlength => 100,
  799. :null => true,
  800. },
  801. :editable => false,
  802. :active => true,
  803. :screens => {
  804. :signup => {},
  805. :invite_agent => {},
  806. :edit => {
  807. '-all-' => {
  808. :null => true,
  809. },
  810. },
  811. },
  812. :pending_migration => false,
  813. :position => 1200,
  814. :created_by_id => 1,
  815. :updated_by_id => 1,
  816. )
  817. ObjectManager::Attribute.add(
  818. :object => 'User',
  819. :name => 'city',
  820. :display => 'City',
  821. :data_type => 'input',
  822. :data_option => {
  823. :type => 'text',
  824. :maxlength => 100,
  825. :null => true,
  826. },
  827. :editable => false,
  828. :active => true,
  829. :screens => {
  830. :signup => {},
  831. :invite_agent => {},
  832. :edit => {
  833. '-all-' => {
  834. :null => true,
  835. },
  836. },
  837. },
  838. :pending_migration => false,
  839. :position => 1300,
  840. :created_by_id => 1,
  841. :updated_by_id => 1,
  842. )
  843. ObjectManager::Attribute.add(
  844. :object => 'User',
  845. :name => 'password',
  846. :display => 'Password',
  847. :data_type => 'input',
  848. :data_option => {
  849. :type => 'password',
  850. :maxlength => 100,
  851. :null => true,
  852. :autocomplete => 'off',
  853. },
  854. :editable => false,
  855. :active => true,
  856. :screens => {
  857. :signup => {
  858. '-all-' => {
  859. :null => true,
  860. },
  861. },
  862. :invite_agent => {},
  863. :edit => {
  864. :Admin => {
  865. :null => true,
  866. },
  867. },
  868. },
  869. :pending_migration => false,
  870. :position => 1400,
  871. :created_by_id => 1,
  872. :updated_by_id => 1,
  873. )
  874. ObjectManager::Attribute.add(
  875. :object => 'User',
  876. :name => 'note',
  877. :display => 'Note',
  878. :data_type => 'textarea',
  879. :data_option => {
  880. :type => 'text',
  881. :maxlength => 250,
  882. :null => true,
  883. :note => 'Notes are visible to agents only, never to customers.',
  884. },
  885. :editable => false,
  886. :active => true,
  887. :screens => {
  888. :signup => {},
  889. :invite_agent => {},
  890. :edit => {
  891. '-all-' => {
  892. :null => true,
  893. },
  894. },
  895. },
  896. :pending_migration => false,
  897. :position => 1500,
  898. :created_by_id => 1,
  899. :updated_by_id => 1,
  900. )
  901. ObjectManager::Attribute.add(
  902. :object => 'User',
  903. :name => 'role_ids',
  904. :display => 'Roles',
  905. :data_type => 'checkbox',
  906. :data_option => {
  907. :multiple => true,
  908. :null => false,
  909. :relation => 'Role',
  910. },
  911. :editable => false,
  912. :active => true,
  913. :screens => {
  914. :signup => {},
  915. :invite_agent => {},
  916. :edit => {
  917. :Admin => {
  918. :null => false,
  919. },
  920. },
  921. },
  922. :pending_migration => false,
  923. :position => 1600,
  924. :created_by_id => 1,
  925. :updated_by_id => 1,
  926. )
  927. ObjectManager::Attribute.add(
  928. :object => 'User',
  929. :name => 'group_ids',
  930. :display => 'Groups',
  931. :data_type => 'checkbox',
  932. :data_option => {
  933. :multiple => true,
  934. :null => true,
  935. :relation => 'Group',
  936. },
  937. :editable => false,
  938. :active => true,
  939. :screens => {
  940. :signup => {},
  941. :invite_agent => {
  942. '-all-' => {
  943. :null => false,
  944. },
  945. },
  946. :edit => {
  947. :Admin => {
  948. :null => true,
  949. },
  950. },
  951. },
  952. :pending_migration => false,
  953. :position => 1700,
  954. :created_by_id => 1,
  955. :updated_by_id => 1,
  956. )
  957. ObjectManager::Attribute.add(
  958. :object => 'User',
  959. :name => 'active',
  960. :display => 'Active',
  961. :data_type => 'boolean',
  962. :data_option => {
  963. :maxlength => 250,
  964. :null => true,
  965. :default => true,
  966. },
  967. :editable => false,
  968. :active => true,
  969. :screens => {
  970. :signup => {},
  971. :invite_agent => {},
  972. :edit => {
  973. :Admin => {
  974. :null => false,
  975. },
  976. },
  977. },
  978. :pending_migration => false,
  979. :position => 1800,
  980. :created_by_id => 1,
  981. :updated_by_id => 1,
  982. )
  983. end
  984. def down
  985. drop_table :object_manager_attributes
  986. end
  987. end