コード例 #1
0
 public function testdisplay()
 {
     $SugarView = new SugarView();
     //execute the method and check if it works and doesn't throws an exception
     try {
         $SugarView->display();
     } catch (Exception $e) {
         $this->fail();
     }
     $this->assertTrue(true);
 }
コード例 #2
0
ファイル: view.indexdata.php プロジェクト: MexinaD/SuiteCRM
 /**
  * display the form
  */
 public function display()
 {
     global $db, $timedate, $current_language;
     parent::display();
     $index = BeanFactory::getBean("AOD_Index");
     $index = $index->getIndex();
     $beanList = $index->getIndexableModules();
     $moduleCounts = array();
     foreach ($beanList as $beanModule => $beanName) {
         $bean = BeanFactory::getBean($beanModule);
         if (!$bean || !method_exists($bean, "getTableName") || !$bean->getTableName()) {
             continue;
         }
         $query = "SELECT COUNT(DISTINCT b.id) FROM " . $bean->getTableName() . " b WHERE b.deleted = 0";
         $moduleCounts[$beanModule] = $db->getOne($query);
     }
     $revisionCount = array_sum($moduleCounts);
     $indexedCount = $db->getOne("SELECT COUNT(*) FROM aod_indexevent WHERE deleted = 0 AND success = 1");
     $failedCount = $db->getOne("SELECT COUNT(*) FROM aod_indexevent WHERE deleted = 0 AND success = 0");
     $indexFiles = count(glob($index->location . "/*.cfs"));
     $this->ss->assign("revisionCount", $revisionCount);
     $this->ss->assign("indexedCount", $indexedCount);
     $this->ss->assign("failedCount", $failedCount);
     $this->ss->assign("index", $index);
     $this->ss->assign("indexFiles", $indexFiles);
     echo $this->ss->fetch('modules/AOD_Index/tpls/indexdata.tpl');
     if ($failedCount) {
         $seed = BeanFactory::newBean("AOD_IndexEvent");
         $lv = new ListViewSmarty();
         $lv->lvd->additionalDetails = false;
         $mod_strings = return_module_language($current_language, $seed->module_dir);
         require 'modules/' . $seed->module_dir . '/metadata/listviewdefs.php';
         if (file_exists('custom/modules/' . $seed->module_dir . '/metadata/listviewdefs.php')) {
             require 'custom/modules/' . $seed->module_dir . '/metadata/listviewdefs.php';
         }
         $lv->displayColumns = $listViewDefs[$seed->module_dir];
         $lv->quickViewLinks = false;
         $lv->export = false;
         $lv->mergeduplicates = false;
         $lv->multiSelect = false;
         $lv->delete = false;
         $lv->select = false;
         $lv->showMassupdateFields = false;
         $lv->email = false;
         $lv->setup($seed, 'include/ListView/ListViewNoMassUpdate.tpl', 'success = 0', '', 0, 10);
         echo '<br /><br />' . get_form_header($GLOBALS['mod_strings']['LBL_FAILED_RECORDS'] . ' (' . $lv->data['pageData']['offsets']['total'] . ')', '', false);
         if ($lv->data['pageData']['offsets']['total'] == 0) {
             echo "No data";
         } else {
             echo $lv->display();
         }
     }
 }
コード例 #3
0
 function ViewSynthesis_Report()
 {
     parent::display();
 }