Ejemplo n.º 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>";
     }
 }
Ejemplo n.º 2
0
 function process_interlock($list_array)
 {
     global $mod_strings;
     $sub_data_set = BeanFactory::getBean('DataSets', $this->sub_id);
     $sub_data_set->sub_query = true;
     //OUTPUT THE SUB-DATASET
     $data_set = BeanFactory::getBean('CustomQueries', $sub_data_set->query_id);
     $data_set->sub_query_array = $list_array;
     $SubView = new ReportListView();
     $SubView->initNewXTemplate('modules/CustomQueries/QueryView.html', $mod_strings);
     $SubView->setDisplayHeaderAndFooter(false);
     $SubView->setup($data_set, $sub_data_set, "main", "CUSTOMQUERY", true);
     return $SubView->processDataSet();
     //end function process_interlock
 }
Ejemplo n.º 3
0
 //first check to see if the data format actually has a query_id for it
 if (!empty($data_object->query_id) && $data_object->query_id != "") {
     //OUTPUT THE DATASET
     $data_set = BeanFactory::getBean('CustomQueries', $data_object->query_id);
     $QueryView = new ReportListView();
     //pass the previous width array if available
     if (isset($prev_width_array) && $prev_width_array != '') {
         $QueryView->prev_width_array = $prev_width_array;
     }
     $QueryView->initNewXTemplate('modules/CustomQueries/QueryView.html', $mod_strings);
     $QueryView->setDisplayHeaderAndFooter(false);
     $QueryView->setHeaderTitle($data_object->name);
     //below: make sure to aquire the custom layout headers if available
     $QueryView->export_type = "Ent";
     $QueryView->final_report_view = true;
     $QueryView->setup($data_set, $data_object, "main", "CUSTOMQUERY");
     $query_results = $QueryView->processDataSet();
     //capture previous width array if necessary
     $prev_width_array = $QueryView->prev_width_array;
     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>";
 }
 echo "</td></tr> \n";
Ejemplo n.º 4
0
$ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE'] . $header_text);
$ListView->setHeaderText($button);
//Temporary until we upgrade the export feature to multi
$ListView->show_export_button = false;
if (!is_admin($current_user)) {
    $ListView->show_select_menu = false;
    $ListView->show_delete_button = false;
}
$ListView->setQuery("", "", "name", "CUSTOMQUERY");
$ListView->processListView($focus, "main", "CUSTOMQUERY");
echo "<p>";
echo "<BR>";
$QueryView = new ReportListView();
$QueryView->initNewXTemplate('modules/CustomQueries/QueryView.html', $mod_strings);
$QueryView->setHeaderTitle($mod_strings['LBL_QUERYRESULT']);
$QueryView->setup($focus, "", "main", "CUSTOMQUERY");
$query_results = $QueryView->processDataSet();
if ($query_results['result'] == "Error") {
    echo "<font color=\"red\"><b>" . $query_results['result_msg'] . "" . $app_strings['ERROR_EXAMINE_MSG'] . "</font><BR>" . $query_results['msg'] . "</b>";
}
if ($is_edit) {
    $edit_button = "<form name='EditView' method='POST' action='index.php'>\n";
    $edit_button .= "<input type='hidden' name='module' value='CustomQueries'>\n";
    $edit_button .= "<input type='hidden' name='record' value='{$focus->id}'>\n";
    $edit_button .= "<input type='hidden' name='action'>\n";
    $edit_button .= "<input type='hidden' name='edit'>\n";
    $edit_button .= "<input type='hidden' name='isDuplicate'>\n";
    $edit_button .= "<input type='hidden' name='return_module' value='CustomQueries'>\n";
    $edit_button .= "<input type='hidden' name='return_action' value='index'>\n";
    $edit_button .= "<input type='hidden' name='return_id' value=''>\n";
    $edit_button .= '<input title="' . $app_strings['LBL_SAVE_BUTTON_TITLE'] . '" accessKey="' . $app_strings['LBL_SAVE_BUTTON_KEY'] . '" class="button" onclick="this.form.action.value=\'Save\'; return check_form(\'EditView\');" type="submit" name="button" value="  ' . $app_strings['LBL_SAVE_BUTTON_LABEL'] . '  " >';