예제 #1
0
 function process($file, $data, $htmlVar)
 {
     parent::process($file, $data, $htmlVar);
     if (!ACLController::checkAccess($this->seed->module_dir, 'export', true) || !$this->export) {
         $this->ss->assign('exportLink', $this->buildExportLink());
     }
 }
예제 #2
0
 public function testListViewDisplayMultiSelect()
 {
     $lv = new ListViewSmarty();
     $lv->multiSelect = false;
     $lv->should_process = true;
     $account = new Account();
     $lv->seed = $account;
     $lv->displayColumns = array();
     $mockData = array();
     $mockData['data'] = array();
     $mockData['pageData'] = array('ordering' => 'ASC', 'offsets' => array('current' => 0, 'next' => 0, 'total' => 0), 'bean' => array('moduleDir' => $account->module_dir));
     $lv->process('include/ListView/ListViewGeneric.tpl', $mockData, $account->module_dir);
     $this->assertEquals('<textarea style="display: none" name="uid"></textarea>', $lv->ss->_tpl_vars['multiSelectData'], 'Assert that multiSelectData Smarty variable was still assigned');
 }
예제 #3
0
 /**
  * Processes the request. Calls ListViewData process. Also assigns all lang strings, export links,
  * This is called from ListViewDisplay
  *
  * @param file file Template file to use
  * @param data array from ListViewData
  * @param html_var string the corresponding html var in xtpl per row
  *
  */
 function process($file, $data, $htmlVar)
 {
     global $odd_bg, $even_bg, $hilite_bg, $click_bg, $app_strings;
     parent::process($file, $data, $htmlVar);
     $this->tpl = $file;
     $this->data = $data;
     $totalWidth = 0;
     foreach ($this->displayColumns as $name => $params) {
         $totalWidth += $params['width'];
     }
     $adjustment = $totalWidth / 100;
     $contextMenuObjectsTypes = array();
     foreach ($this->displayColumns as $name => $params) {
         $this->displayColumns[$name]['width'] = round($this->displayColumns[$name]['width'] / $adjustment, 2);
         // figure out which contextMenu objectsTypes are required
         if (!empty($params['contextMenu']['objectType'])) {
             $contextMenuObjectsTypes[$params['contextMenu']['objectType']] = true;
         }
     }
     $this->th->ss->assign('displayColumns', $this->displayColumns);
     $this->th->ss->assign('bgHilite', $hilite_bg);
     $this->th->ss->assign('colCount', count($this->displayColumns) + 1);
     $this->th->ss->assign('htmlVar', strtoupper($htmlVar));
     $this->th->ss->assign('moduleString', $this->moduleString);
     $this->th->ss->assign('editLinkString', $GLOBALS['app_strings']['LBL_EDIT_BUTTON']);
     $this->th->ss->assign('viewLinkString', $GLOBALS['app_strings']['LBL_VIEW_BUTTON']);
     //rrs
     $this->searchForm->parsedView = 'popup_query_form';
     $this->searchForm->displayType = 'popupView';
     $this->th->ss->assign('searchForm', $this->searchForm->display(false));
     //rrs
     if ($this->export) {
         $this->th->ss->assign('exportLink', $this->buildExportLink());
     }
     $this->th->ss->assign('quickViewLinks', $this->quickViewLinks);
     if ($this->mailMerge) {
         $this->th->ss->assign('mergeLink', $this->buildMergeLink());
     }
     // still check for mailmerge access
     if ($this->mergeduplicates) {
         $this->th->ss->assign('mergedupLink', $this->buildMergeDuplicatesLink());
     }
     if (!empty($_REQUEST['mode']) && strtoupper($_REQUEST['mode']) == 'MULTISELECT') {
         $this->multiSelect = true;
     }
     // handle save checks and stuff
     if ($this->multiSelect) {
         $this->th->ss->assign('selectedObjectsSpan', $this->buildSelectedObjectsSpan());
         $this->th->ss->assign('multiSelectData', $this->getMultiSelectData());
         $this->th->ss->assign('MODE', "<input type='hidden' name='mode' value='MultiSelect'>");
         $pageTotal = $this->data['pageData']['offsets']['next'] - $this->data['pageData']['offsets']['current'];
         if ($this->data['pageData']['offsets']['next'] < 0) {
             // If we are on the last page, 'next' is -1, which means we have to have a custom calculation
             $pageTotal = $this->data['pageData']['offsets']['total'] - $this->data['pageData']['offsets']['current'];
         }
         $this->th->ss->assign('selectLink', $this->buildSelectLink('select_link', $this->data['pageData']['offsets']['total'], $pageTotal));
     }
     $this->processArrows($data['pageData']['ordering']);
     $this->th->ss->assign('prerow', $this->multiSelect);
     $this->th->ss->assign('rowColor', array('oddListRow', 'evenListRow'));
     $this->th->ss->assign('bgColor', array($odd_bg, $even_bg));
     $this->th->ss->assign('contextMenus', $this->contextMenus);
     if ($this->contextMenus && !empty($contextMenuObjectsTypes)) {
         $script = '';
         $cm = new contextMenu();
         foreach ($contextMenuObjectsTypes as $type => $value) {
             $cm->loadFromFile($type);
             $script .= $cm->getScript();
             $cm->menuItems = array();
             // clear menuItems out
         }
         $this->th->ss->assign('contextMenuScript', $script);
     }
     //rrs
     $this->_build_field_defs();
     // arrow image attributes
     $this->processArrowVars();
 }
 function process($file, $data, $htmlVar)
 {
     $this->actionsMenuExtraItems[] = $this->buildAddAccountContactsToTargetList();
     parent::process($file, $data, $htmlVar);
     if (!ACLController::checkAccess($this->seed->module_dir, 'export', true) || !$this->export) {
         $this->ss->assign('exportLink', $this->buildExportLink());
     }
 }