PageRenderTime 46ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/app/protected/modules/products/views/ProductModalDetailsView.php

https://bitbucket.org/zurmo/zurmo/
PHP | 211 lines | 161 code | 5 blank | 45 comment | 0 complexity | c099eb29d5ceac68db0e7de42db5b2e5 MD5 | raw file
Possible License(s): AGPL-3.0, BSD-3-Clause, GPL-2.0, LGPL-3.0, LGPL-2.1, BSD-2-Clause
  1. <?php
  2. /*********************************************************************************
  3. * Zurmo is a customer relationship management program developed by
  4. * Zurmo, Inc. Copyright (C) 2015 Zurmo Inc.
  5. *
  6. * Zurmo is free software; you can redistribute it and/or modify it under
  7. * the terms of the GNU Affero General Public License version 3 as published by the
  8. * Free Software Foundation with the addition of the following permission added
  9. * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
  10. * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
  11. * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
  12. *
  13. * Zurmo is distributed in the hope that it will be useful, but WITHOUT
  14. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  15. * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License along with
  19. * this program; if not, see http://www.gnu.org/licenses or write to the Free
  20. * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  21. * 02110-1301 USA.
  22. *
  23. * You can contact Zurmo, Inc. with a mailing address at 27 North Wacker Drive
  24. * Suite 370 Chicago, IL 60606. or at email address contact@zurmo.com.
  25. *
  26. * The interactive user interfaces in original and modified versions
  27. * of this program must display Appropriate Legal Notices, as required under
  28. * Section 5 of the GNU Affero General Public License version 3.
  29. *
  30. * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
  31. * these Appropriate Legal Notices must retain the display of the Zurmo
  32. * logo and Zurmo copyright notice. If the display of the logo is not reasonably
  33. * feasible for technical reasons, the Appropriate Legal Notices must display the words
  34. * "Copyright Zurmo Inc. 2015. All rights reserved".
  35. ********************************************************************************/
  36. /**
  37. * Modal window for viewing a product
  38. */
  39. class ProductModalDetailsView extends SecuredDetailsView
  40. {
  41. public static function getDefaultMetadata()
  42. {
  43. $metadata = array(
  44. 'global' => array(
  45. 'toolbar' => array(
  46. 'elements' => array(
  47. array('type' => 'ProductModalEditFromModalDetailsLink'),
  48. ),
  49. ),
  50. 'derivedAttributeTypes' => array(
  51. 'DerivedExplicitReadWriteModelPermissions',
  52. 'MultipleProductCategoriesForProduct',
  53. ),
  54. 'nonPlaceableAttributeNames' => array(
  55. 'owner',
  56. ),
  57. 'panelsDisplayType' => FormLayout::PANELS_DISPLAY_TYPE_ALL,
  58. 'panels' => array(
  59. array(
  60. 'rows' => array(
  61. array('cells' =>
  62. array(
  63. array(
  64. 'elements' => array(
  65. array('attributeName' => 'productTemplate', 'type' => 'ProductTemplate'),
  66. ),
  67. ),
  68. )
  69. ),
  70. array('cells' =>
  71. array(
  72. array(
  73. 'elements' => array(
  74. array('attributeName' => 'name', 'type' => 'Text'),
  75. ),
  76. ),
  77. )
  78. ),
  79. ),
  80. ),
  81. array(
  82. 'rows' => array(
  83. array('cells' =>
  84. array(
  85. array(
  86. 'elements' => array(
  87. array('attributeName' => 'quantity', 'type' => 'Integer'),
  88. ),
  89. ),
  90. )
  91. ),
  92. array('cells' =>
  93. array(
  94. array(
  95. 'elements' => array(
  96. array('attributeName' => 'account', 'type' => 'Account'),
  97. ),
  98. ),
  99. )
  100. ),
  101. array('cells' =>
  102. array(
  103. array(
  104. 'elements' => array(
  105. array('attributeName' => 'contact', 'type' => 'Contact'),
  106. ),
  107. ),
  108. )
  109. ),
  110. array('cells' =>
  111. array(
  112. array(
  113. 'elements' => array(
  114. array('attributeName' => 'opportunity', 'type' => 'Opportunity'),
  115. ),
  116. ),
  117. )
  118. ),
  119. array('cells' =>
  120. array(
  121. array(
  122. 'elements' => array(
  123. array('attributeName' => 'null', 'type' => 'MultipleProductCategoriesForProduct'),
  124. ),
  125. ),
  126. )
  127. ),
  128. array('cells' =>
  129. array(
  130. array(
  131. 'elements' => array(
  132. array('attributeName' => 'type', 'type' => 'ProductTemplateTypeDropDown'),
  133. ),
  134. ),
  135. )
  136. ),
  137. array('cells' =>
  138. array(
  139. array(
  140. 'elements' => array(
  141. array('attributeName' => 'priceFrequency', 'type' => 'ProductTemplatePriceFrequencyDropDown'),
  142. ),
  143. ),
  144. )
  145. ),
  146. array('cells' =>
  147. array(
  148. array(
  149. 'elements' => array(
  150. array('attributeName' => 'sellPrice', 'type' => 'CurrencyValue'),
  151. ),
  152. ),
  153. )
  154. ),
  155. array('cells' =>
  156. array(
  157. array(
  158. 'elements' => array(
  159. array('attributeName' => 'stage', 'type' => 'DropDown'),
  160. ),
  161. ),
  162. )
  163. ),
  164. array('cells' =>
  165. array(
  166. array(
  167. 'elements' => array(
  168. array('attributeName' => 'null',
  169. 'type' => 'DerivedExplicitReadWriteModelPermissions'),
  170. ),
  171. ),
  172. )
  173. ),
  174. ),
  175. ),
  176. ),
  177. ),
  178. );
  179. return $metadata;
  180. }
  181. /**
  182. * Gets title
  183. * @return string
  184. */
  185. public function getTitle()
  186. {
  187. return null;
  188. }
  189. public static function getDesignerRulesType()
  190. {
  191. return 'ProductModalDetailsView';
  192. }
  193. protected function getFormLayoutUniqueId()
  194. {
  195. return 'product-modal-details-view-form';
  196. }
  197. /**
  198. * Gets the options menu class
  199. * @return string
  200. */
  201. protected static function getOptionsMenuCssClass()
  202. {
  203. return 'product-modal-details-options-menu';
  204. }
  205. }
  206. ?>