/**
  * Simple test that the list view class will not throw errors when used.
  * (Bug 42036)
  */
 public function testConstructor()
 {
     $_REQUEST = array("to_pdf" => "1", "sugar_body_only" => "1", "module" => "ModuleBuilder", "view_package" => "", "view_module" => "KBDocuments", "view" => "listview");
     $view = new ViewListView();
     $ajax = $view->constructAjax();
     $this->assertNotNull($ajax);
 }
Beispiel #2
0
 function display($preview = false)
 {
     $packageName = isset($_REQUEST['view_package']) ? $_REQUEST['view_package'] : '';
     require_once 'modules/ModuleBuilder/parsers/ParserFactory.php';
     $parser = ParserFactory::getParser($this->editLayout, $this->editModule, $packageName);
     $smarty = parent::constructSmarty($parser);
     $smarty->assign('action', 'searchViewSave');
     $smarty->assign('view', $this->editLayout);
     $smarty->assign('helpName', 'searchViewEditor');
     $smarty->assign('helpDefault', 'modify');
     if ($preview) {
         echo $smarty->fetch("modules/ModuleBuilder/tpls/Preview/listView.tpl");
     } else {
         $ajax = $this->constructAjax();
         $ajax->addSection('center', translate($this->title), $smarty->fetch("modules/ModuleBuilder/tpls/listView.tpl"));
         echo $ajax->getJavascript();
     }
 }
 function display($preview = false)
 {
     $packageName = isset($_REQUEST['view_package']) ? $_REQUEST['view_package'] : '';
     require_once 'modules/ModuleBuilder/parsers/ParserFactory.php';
     $parser = ParserFactory::getParser($this->editLayout, $this->editModule, $packageName);
     $smarty = parent::constructSmarty($parser);
     $smarty->assign('action', 'searchViewSave');
     $smarty->assign('view', $this->editLayout);
     $smarty->assign('helpName', 'searchViewEditor');
     $smarty->assign('helpDefault', 'modify');
     /* BEGIN - SECURITY GROUPS */
     $groupLayout = "";
     if (!empty($_REQUEST['grpLayout'])) {
         $groupLayout = $_REQUEST['grpLayout'];
     }
     global $groupName;
     $groupName = "Default";
     if (!isset($groupLayout) || empty($groupLayout)) {
         $groupLayout = "";
     } else {
         //Get group name for display
         require_once 'modules/SecurityGroups/SecurityGroup.php';
         $groupFocus = new SecurityGroup();
         $groupFocus->retrieve($groupLayout);
         $groupName = $groupFocus->name;
     }
     $smarty->assign('grpLayout', $groupLayout);
     /* END - SECURITY GROUPS */
     if ($preview) {
         echo $smarty->fetch("modules/ModuleBuilder/tpls/Preview/listView.tpl");
     } else {
         $ajax = $this->constructAjax();
         $ajax->addSection('center', translate($this->title), $smarty->fetch("modules/ModuleBuilder/tpls/listView.tpl"));
         echo $ajax->getJavascript();
     }
 }