20140831000001_create_object_manager.rb 29 KB

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