Exemple #1
0
 /**
  * display
  *
  */
 function display()
 {
     parent::display();
     global $current_user, $app_strings, $mod_strings;
     if (isset($this->bean->query_id) && !empty($this->bean->query_id)) {
         //CHECK FOR SUB-QUERIES
         $this->bean->check_interlock();
         //OUTPUT THE DATASET
         $data_set = BeanFactory::getBean('CustomQueries', $this->bean->query_id);
         $QueryView = new ReportListView();
         $QueryView->initNewXTemplate('modules/CustomQueries/QueryView.html', $mod_strings);
         $QueryView->setHeaderTitle($this->bean->name);
         //below: make sure to aquire the custom layout headers if available
         $QueryView->export_type = "Ent";
         $QueryView->xTemplateAssign('EDIT_INLINE', SugarThemeRegistry::current()->getImage('edit_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_EDIT']));
         $QueryView->xTemplateAssign('LEFTARROW_INLINE', SugarThemeRegistry::current()->getImage('calendar_previous', 'align="absmiddle" border="0"', null, null, '.gif', $mod_strings['LBL_LEFT']));
         $QueryView->xTemplateAssign('RIGHTARROW_INLINE', SugarThemeRegistry::current()->getImage('calendar_next', 'align="absmiddle" border="0"', null, null, '.gif', $mod_strings['LBL_RIGHT']));
         $QueryView->setup($data_set, $this->bean, "main", "CUSTOMQUERY");
         $query_results = $QueryView->processDataSet();
         if ($query_results['result'] == "Error") {
             if (is_admin($current_user)) {
                 echo "<font color=\"red\"><b>" . $query_results['result_msg'] . "" . $app_strings['ERROR_EXAMINE_MSG'] . "</font><BR>" . $query_results['msg'] . "</b>";
             } else {
                 echo "<font color=\"red\"><b>" . $query_results['result_msg'] . "</font></b><BR>";
             }
         }
         //end if there is even a query for the data set
     } else {
         echo "<font color=\"red\"><b>" . $app_strings['NO_QUERY_SELECTED'] . "</font></b><BR>";
     }
 }