public function testGetListViewQueryCreatedBy()
 {
     require_once "include/ListView/ListViewDisplay.php";
     include "modules/Notes/metadata/listviewdefs.php";
     $displayColumns = array('NAME' => array('width' => '40%', 'label' => 'LBL_LIST_SUBJECT', 'link' => true, 'default' => true), 'CREATED_BY_NAME' => array('type' => 'relate', 'label' => 'LBL_CREATED_BY', 'width' => '10%', 'default' => true));
     $lvd = new ListViewDisplay();
     $lvd->displayColumns = $displayColumns;
     $fields = $lvd->setupFilterFields();
     $query = $this->note->create_new_list_query('', 'id="' . $this->note->id . '"', $fields);
     $regex = '/select.* created_by_name.*LEFT JOIN\\s*users jt\\d ON\\s*notes.created_by\\s*=\\s*jt\\d\\.id.*/si';
     return $this->assertRegExp($regex, $query, "Unable to find the created user in the notes list view query: {$query}");
 }
示例#2
0
 /**
  * Displays the xtpl, either echo or returning the contents
  *
  * @param end bool display the ending of the listview data (ie MassUpdate)
  *
  */
 function display($end = true)
 {
     if (!$this->should_process) {
         return $GLOBALS['app_strings']['LBL_SEARCH_POPULATE_ONLY'];
     }
     global $app_strings, $sugar_version, $sugar_flavor, $server_unique_key, $currentModule, $app_list_strings;
     $this->ss->assign('moduleListSingular', $app_list_strings["moduleListSingular"]);
     $this->ss->assign('moduleList', $app_list_strings['moduleList']);
     $this->ss->assign('data', $this->data['data']);
     $this->ss->assign('query', $this->data['query']);
     $this->ss->assign('sugar_info', array("sugar_version" => $sugar_version, "sugar_flavor" => $sugar_flavor));
     $this->data['pageData']['offsets']['lastOffsetOnPage'] = $this->data['pageData']['offsets']['current'] + count($this->data['data']);
     $this->ss->assign('pageData', $this->data['pageData']);
     $navStrings = array('next' => $app_strings['LNK_LIST_NEXT'], 'previous' => $app_strings['LNK_LIST_PREVIOUS'], 'end' => $app_strings['LNK_LIST_END'], 'start' => $app_strings['LNK_LIST_START'], 'of' => $app_strings['LBL_LIST_OF']);
     $this->ss->assign('navStrings', $navStrings);
     $displayEmptyDataMessages = TRUE;
     //TODO: Cleanup, better logic for which modules are exempt from the new messaging.
     $modulesExemptFromEmptyDataMessages = array('WorkFlow', 'ContractTypes', 'OAuthKeys', 'TimePeriods');
     if (isset($GLOBALS['moduleTabMap'][$currentModule]) && $GLOBALS['moduleTabMap'][$currentModule] == 'Administration' || isset($GLOBALS['adminOnlyList'][$currentModule]) || in_array($currentModule, $modulesExemptFromEmptyDataMessages)) {
         $displayEmptyDataMessages = FALSE;
     }
     $this->ss->assign('displayEmptyDataMesssages', $displayEmptyDataMessages);
     $str = parent::display();
     $strend = $this->displayEnd();
     return $str . $this->ss->fetch($this->tpl) . ($end ? $strend : '');
 }
示例#3
0
 /**
  * Displays the xtpl, either echo or returning the contents
  *    
  * @param echo bool echo or return contents
  *
  */
 function display($echo = true)
 {
     $str = parent::display();
     $strend = parent::displayEnd();
     $this->xtpl->parse($this->main_block);
     if ($echo) {
         echo $str;
         $this->xtpl->out($this->main_block);
         echo $strend;
     } else {
         return $str . $this->xtpl->text() . $strend;
     }
 }
 public function buildTargetList()
 {
     return parent::buildTargetList();
 }
 /**
  * Displays the xtpl, either echo or returning the contents
  *    
  * @param end bool display the ending of the listview data (ie MassUpdate)
  *
  */
 function display($end = true)
 {
     if (!$this->should_process) {
         return $GLOBALS['app_strings']['LBL_SEARCH_POPULATE_ONLY'];
     }
     global $app_strings;
     $this->ss->assign('data', $this->data['data']);
     $this->data['pageData']['offsets']['lastOffsetOnPage'] = $this->data['pageData']['offsets']['current'] + count($this->data['data']);
     $this->ss->assign('pageData', $this->data['pageData']);
     $navStrings = array('next' => $app_strings['LNK_LIST_NEXT'], 'previous' => $app_strings['LNK_LIST_PREVIOUS'], 'end' => $app_strings['LNK_LIST_END'], 'start' => $app_strings['LNK_LIST_START'], 'of' => $app_strings['LBL_LIST_OF']);
     $this->ss->assign('navStrings', $navStrings);
     $str = parent::display();
     $strend = parent::displayEnd();
     return $str . $this->ss->fetch($this->tpl) . ($end ? '<br><br>' . $strend : '');
 }