Advertisement
Guest User

Untitled

a guest
Aug 13th, 2013
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.62 KB | None | 0 0
  1. Warning: require_once(include/logging.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/localhost/htdocs/sugarcrm/modules/Products/Product.php on line 5
  2.  
  3. Fatal error: require_once() [function.require]: Failed opening required 'include/logging.php' (include_path='/var/www/localhost/htdocs/sugarcrm:/var/www/localhost/htdocs/sugarcrm/include/..:.:/usr/share/php5:/usr/share/php') in /var/www/localhost/htdocs/sugarcrm/modules/Products/Product.php on line 5
  4.  
  5. # cat /var/www/localhost/htdocs/sugarcrm/modules/Products/PBundle.php
  6. <?php
  7.  
  8. /* Include all other system or application files that you need to reference here.*/
  9. include_once('config.php'); /*Include this file if you want to access sugar specific settings*/
  10. require_once('include/logging.php'); /*Include this file if you want to write messages to the log file*/
  11. require_once('data/SugarBean.php'); /*Include this file since we are extending SugarBean*/
  12. require_once('include/utils.php'); /* Include this file if you want access to Utility methods such as return_module_language,return_mod_list_strings_language, etc ..*/
  13.  
  14. class PBundle extends SugarBean {
  15. /* Foreach instance of the bean you will need to access the fields in the table.
  16. * So define a variable for each one of them, the varaible name should be same as the field name
  17. * Use this module's vardef file as a reference to create these variables.
  18. */
  19.  
  20. var $id;
  21. var $name;
  22. var $available;
  23.  
  24. /* End field definitions*/
  25.  
  26. /* variable $table_name is used by SugarBean and methods in this file to constructs queries
  27. * set this variables value to the table associated with this bean.
  28. */
  29. var $table_name = 'pbundles';
  30.  
  31. /*This variable overrides the object_name variable in SugarBean, wher it has a value of null.*/
  32. var $object_name = 'PBundle';
  33.  
  34. /**/
  35. var $module_dir = 'Products';
  36.  
  37. /* This is a legacy variable, set its value to true for new modules*/
  38. var $new_schema = true;
  39.  
  40. /* $column_fields holds a list of columns that exist in this bean's table. This list is referenced
  41. * when fetching or saving data for the bean. As you modify a table you need to keep this up to date.
  42. */
  43. var $column_fields = Array(
  44. 'id'
  45. ,'name'
  46. ,'available'
  47. );
  48.  
  49.  
  50. // This is used to retrieve related fields from form posts.
  51. /* List forms usually show less data than the detail forms, this list is used to construct data for list forms.
  52. * Fields in this list need not be database fields only, if you have some computed fields that go in the list add
  53. * them to this list. Also create a variable in the bean.
  54.  
  55. var $list_fields = array('id', 'field1', 'field2', 'field3', 'field4');
  56. todo remove this, since the system uses vardefs to achieve this*/
  57.  
  58. /* This is the list of required fields, It is used by some of the utils methods to build the required fields validation JavaScript */
  59. /* The script is only generated for the Edit View*/
  60. var $required_fields = array();
  61.  
  62. /*This bean's constructor*/
  63. function PBundle () {
  64. /*Call the parent's constructor which will setup a database connection, logger and other settings.*/
  65. parent::SugarBean();
  66. // BEGIN SUGARCRM PRO ONLY
  67. $this->disable_row_level_security=true;
  68. // END SUGARCRM PRO ONLY
  69.  
  70.  
  71. }
  72.  
  73. /* This method should return the summary text which is used to build the bread crumb navigation*/
  74. /* Generally from this method you would return value of a field that is required and is of type string*/
  75. function get_summary_text()
  76. {
  77. return "$this->name";
  78. }
  79.  
  80.  
  81. /* This method is used to generate query for the list form. The base implementation of this method
  82. * uses the table_name and list_field varaible to generate the basic query and then adds the custom field
  83. * join and team filter. If you are implementing this function do not forget to consider the additional conditions.
  84. */
  85. function create_list_query($order_by, $where)
  86. {
  87. //Build the join condition for custom fields, the custom field array was populated
  88. //when you invoked the constructor for the SugarBean.
  89. $custom_join = $this->custom_fields->getJOIN();
  90.  
  91. //Build the select list for the query.
  92. $query = "SELECT ";
  93. $query .= " pbundles.* ";
  94.  
  95. //append the WHERE clause to the $query string.
  96. $query .= " FROM pbundles ";
  97.  
  98. //Append additional filter conditions.
  99. $where_auto = " (deleted = 0) ";
  100.  
  101. //if the function recevied a where clause append it.
  102. if($where != "")
  103. $query .= "where $where AND ".$where_auto;
  104. // $query .= "where $where";
  105. else
  106. $query .= "where ".$where_auto;
  107.  
  108. //append the order by clause.
  109. if($order_by != "")
  110. $query .= " ORDER BY $order_by";
  111. else
  112. $query .= " ORDER BY pbundles.name";
  113. //die($query);
  114. return $query;
  115. }
  116.  
  117. function create_export_query()
  118. {
  119. return $this->create_list_query();
  120. }
  121. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement