Beispiel #1
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)
 {
     if (!$this->should_process) {
         return;
     }
     global $odd_bg, $even_bg, $hilite_bg, $click_bg, $app_strings, $sugar_config;
     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'] = floor($this->displayColumns[$name]['width'] / $adjustment);
         // figure out which contextMenu objectsTypes are required
         if (!empty($params['contextMenu']['objectType'])) {
             $contextMenuObjectsTypes[$params['contextMenu']['objectType']] = true;
         }
     }
     //Check if inline editing is enabled for list view.
     if (!isset($sugar_config['enable_line_editing_list']) || $sugar_config['enable_line_editing_list']) {
         $this->ss->assign('inline_edit', true);
     }
     $this->ss->assign('sugarconfig', $this->displayColumns);
     $this->ss->assign('displayColumns', $this->displayColumns);
     $this->ss->assign('APP', $app_strings);
     $this->ss->assign('bgHilite', $hilite_bg);
     $this->ss->assign('colCount', count($this->displayColumns) + 10);
     $this->ss->assign('htmlVar', strtoupper($htmlVar));
     $this->ss->assign('moduleString', $this->moduleString);
     $this->ss->assign('editLinkString', $app_strings['LBL_EDIT_BUTTON']);
     $this->ss->assign('viewLinkString', $app_strings['LBL_VIEW_BUTTON']);
     $this->ss->assign('allLinkString', $app_strings['LBL_LINK_ALL']);
     $this->ss->assign('noneLinkString', $app_strings['LBL_LINK_NONE']);
     $this->ss->assign('recordsLinkString', $app_strings['LBL_LINK_RECORDS']);
     $this->ss->assign('selectLinkString', $app_strings['LBL_LINK_SELECT']);
     // Bug 24677 - Correct the page total amount on the last page of listviews
     $pageTotal = $this->data['pageData']['offsets']['next'] - $this->data['pageData']['offsets']['current'];
     if ($this->data['pageData']['offsets']['next'] < 0) {
         $pageTotal = $this->data['pageData']['offsets']['total'] - $this->data['pageData']['offsets']['current'];
     }
     if ($this->select) {
         $this->ss->assign('selectLinkTop', $this->buildSelectLink('select_link', $this->data['pageData']['offsets']['total'], $pageTotal));
     }
     if ($this->select) {
         $this->ss->assign('selectLinkBottom', $this->buildSelectLink('select_link', $this->data['pageData']['offsets']['total'], $pageTotal, "bottom"));
     }
     if ($this->show_action_dropdown) {
         $action_menu = $this->buildActionsLink();
         $this->ss->assign('actionsLinkTop', $action_menu);
         if (count($action_menu['buttons']) > 0) {
             $this->ss->assign('actionDisabledLink', preg_replace("/id\\s*\\=(\"\\w+\"|w+)/i", "", $action_menu['buttons'][0]));
         }
         $menu_location = 'bottom';
         $this->ss->assign('actionsLinkBottom', $this->buildActionsLink('actions_link', $menu_location));
     }
     $this->ss->assign('quickViewLinks', $this->quickViewLinks);
     // handle save checks and stuff
     if ($this->multiSelect) {
         $this->ss->assign('selectedObjectsSpan', $this->buildSelectedObjectsSpan(true, isset($_POST['mass']) ? count($_POST['mass']) : 0));
         $this->ss->assign('multiSelectData', $this->getMultiSelectData());
     } else {
         $this->ss->assign('multiSelectData', '<textarea style="display: none" name="uid"></textarea>');
     }
     // include button for Adding to Target List if in one of four applicable modules
     if (isset($_REQUEST['module']) && in_array($_REQUEST['module'], array('Contacts', 'Prospects', 'Leads', 'Accounts')) && ACLController::checkAccess('ProspectLists', 'edit', true)) {
         $this->ss->assign('targetLink', $this->buildTargetList());
     }
     $this->processArrows($data['pageData']['ordering']);
     $this->ss->assign('prerow', $this->multiSelect);
     $this->ss->assign('clearAll', $app_strings['LBL_CLEARALL']);
     $this->ss->assign('rowColor', array('oddListRow', 'evenListRow'));
     $this->ss->assign('bgColor', array($odd_bg, $even_bg));
     $this->ss->assign('contextMenus', $this->contextMenus);
     $this->ss->assign('is_admin_for_user', $GLOBALS['current_user']->isAdminForModule('Users'));
     $this->ss->assign('is_admin', $GLOBALS['current_user']->isAdmin());
     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->ss->assign('contextMenuScript', $script);
     }
 }
Beispiel #2
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)
 {
     if (!$this->should_process) {
         return;
     }
     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'] = floor($this->displayColumns[$name]['width'] / $adjustment);
         // figure out which contextMenu objectsTypes are required
         if (!empty($params['contextMenu']['objectType'])) {
             $contextMenuObjectsTypes[$params['contextMenu']['objectType']] = true;
         }
     }
     $this->ss->assign('displayColumns', $this->displayColumns);
     $this->ss->assign('bgHilite', $hilite_bg);
     $this->ss->assign('colCount', count($this->displayColumns) + 1);
     $this->ss->assign('htmlVar', strtoupper($htmlVar));
     $this->ss->assign('moduleString', $this->moduleString);
     $this->ss->assign('editLinkString', $app_strings['LBL_EDIT_BUTTON']);
     $this->ss->assign('viewLinkString', $app_strings['LBL_VIEW_BUTTON']);
     $this->ss->assign('allLinkString', $app_strings['LBL_LINK_ALL']);
     $this->ss->assign('noneLinkString', $app_strings['LBL_LINK_NONE']);
     $this->ss->assign('recordsLinkString', $app_strings['LBL_LINK_RECORDS']);
     $this->ss->assign('selectLinkString', $app_strings['LBL_LINK_SELECT']);
     if ($this->overlib) {
         $this->ss->assign('overlib', true);
     }
     if ($this->select) {
         $this->ss->assign('selectLink', $this->buildSelectLink('select_link', $this->data['pageData']['offsets']['total'], $this->data['pageData']['offsets']['next'] - $this->data['pageData']['offsets']['current']));
     }
     //jchi 09/02/2008 17918
     if (ACLController::checkAccess($this->seed->module_dir, 'delete', true)) {
         if ($this->delete) {
             $this->ss->assign('deleteLink', $this->buildDeleteLink());
         }
     }
     if (ACLController::checkAccess($this->seed->module_dir, 'export', true)) {
         if ($this->export) {
             $this->ss->assign('exportLink', $this->buildExportLink());
         }
     }
     $this->ss->assign('quickViewLinks', $this->quickViewLinks);
     if ($this->mailMerge) {
         $this->ss->assign('mergeLink', $this->buildMergeLink());
     }
     // still check for mailmerge access
     if ($this->mergeduplicates) {
         $this->ss->assign('mergedupLink', $this->buildMergeDuplicatesLink());
     }
     if (isset($_REQUEST['module']) && $_REQUEST['module'] == 'Reports' && (isset($_REQUEST['favorite']) && $_REQUEST['favorite'] == 1)) {
         $this->ss->assign('favoritesLink', $this->buildRemoveFavoritesLink());
     } else {
         if (isset($_REQUEST['module']) && $_REQUEST['module'] == 'Reports') {
             $this->ss->assign('favoritesLink', $this->buildFavoritesLink());
         }
     }
     if (isset($_REQUEST['module']) && ($_REQUEST['module'] == 'Contacts' || $_REQUEST['module'] == 'Accounts' || $_REQUEST['module'] == 'Leads')) {
         $this->ss->assign('composeEmailLink', $this->buildComposeEmailLink($this->data['pageData']['offsets']['total']));
     }
     // if
     // handle save checks and stuff
     if ($this->multiSelect) {
         if ($this->data['pageData']['bean']['moduleDir'] == 'KBDocuments') {
             $this->ss->assign('selectedObjectsSpan', $this->buildSelectedObjectsSpan(true, $this->data['pageData']['offsets']['current']));
         } else {
             $this->ss->assign('selectedObjectsSpan', $this->buildSelectedObjectsSpan(true, $this->data['pageData']['offsets']['total']));
         }
         $this->ss->assign('multiSelectData', $this->getMultiSelectData());
     }
     // include button for Adding to Target List if in one of four applicable modules
     if (isset($_REQUEST['module']) && in_array($_REQUEST['module'], array('Contacts', 'Prospects', 'Leads', 'Accounts'))) {
         $this->ss->assign('targetLink', $this->buildTargetList());
     }
     $this->processArrows($data['pageData']['ordering']);
     $this->ss->assign('prerow', $this->multiSelect);
     $this->ss->assign('clearAll', $app_strings['LBL_CLEARALL']);
     $this->ss->assign('rowColor', array('oddListRow', 'evenListRow'));
     $this->ss->assign('bgColor', array($odd_bg, $even_bg));
     $this->ss->assign('contextMenus', $this->contextMenus);
     $this->ss->assign('is_admin_for_user', is_admin_for_module($GLOBALS['current_user'], 'Users'));
     $this->ss->assign('is_admin', is_admin($GLOBALS['current_user']));
     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->ss->assign('contextMenuScript', $script);
     }
 }
Beispiel #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();
 }
 /**
  * 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)
 {
     if (!$this->should_process) {
         return;
     }
     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'] = floor($this->displayColumns[$name]['width'] / $adjustment);
         // figure out which contextMenu objectsTypes are required
         if (!empty($params['contextMenu']['objectType'])) {
             $contextMenuObjectsTypes[$params['contextMenu']['objectType']] = true;
         }
     }
     $this->ss->assign('displayColumns', $this->displayColumns);
     $this->ss->assign('APP', $app_strings);
     $this->ss->assign('bgHilite', $hilite_bg);
     $this->ss->assign('colCount', count($this->displayColumns) + 10);
     $this->ss->assign('htmlVar', strtoupper($htmlVar));
     $this->ss->assign('moduleString', $this->moduleString);
     $this->ss->assign('editLinkString', $app_strings['LBL_EDIT_BUTTON']);
     $this->ss->assign('viewLinkString', $app_strings['LBL_VIEW_BUTTON']);
     $this->ss->assign('allLinkString', $app_strings['LBL_LINK_ALL']);
     $this->ss->assign('noneLinkString', $app_strings['LBL_LINK_NONE']);
     $this->ss->assign('recordsLinkString', $app_strings['LBL_LINK_RECORDS']);
     $this->ss->assign('selectLinkString', $app_strings['LBL_LINK_SELECT']);
     if ($this->overlib) {
         $this->ss->assign('overlib', true);
     }
     // Bug 24677 - Correct the page total amount on the last page of listviews
     $pageTotal = $this->data['pageData']['offsets']['next'] - $this->data['pageData']['offsets']['current'];
     if ($this->data['pageData']['offsets']['next'] < 0) {
         $pageTotal = $this->data['pageData']['offsets']['total'] - $this->data['pageData']['offsets']['current'];
     }
     if ($this->select) {
         $this->ss->assign('selectLink', $this->buildSelectLink('select_link', $this->data['pageData']['offsets']['total'], $pageTotal));
     }
     if ($this->show_action_dropdown) {
         $this->ss->assign('actionsLink', $this->buildActionsLink());
     }
     $this->ss->assign('quickViewLinks', $this->quickViewLinks);
     // handle save checks and stuff
     if ($this->multiSelect) {
         //if($this->data['pageData']['bean']['moduleDir']== 'KBDocuments')
         //{
         //	$this->ss->assign('selectedObjectsSpan', $this->buildSelectedObjectsSpan(true, $this->data['pageData']['offsets']['current']));
         //} else {
         $this->ss->assign('selectedObjectsSpan', $this->buildSelectedObjectsSpan(true, $this->data['pageData']['offsets']['total']));
         //}
         $this->ss->assign('multiSelectData', $this->getMultiSelectData());
     }
     // include button for Adding to Target List if in one of four applicable modules
     if (isset($_REQUEST['module']) && in_array($_REQUEST['module'], array('Contacts', 'Prospects', 'Leads', 'Accounts')) && ACLController::checkAccess('ProspectLists', 'edit', true)) {
         $this->ss->assign('targetLink', $this->buildTargetList());
     }
     $this->processArrows($data['pageData']['ordering']);
     $this->ss->assign('prerow', $this->multiSelect);
     $this->ss->assign('clearAll', $app_strings['LBL_CLEARALL']);
     $this->ss->assign('rowColor', array('oddListRow', 'evenListRow'));
     $this->ss->assign('bgColor', array($odd_bg, $even_bg));
     $this->ss->assign('contextMenus', $this->contextMenus);
     $this->ss->assign('is_admin_for_user', is_admin_for_module($GLOBALS['current_user'], 'Users'));
     $this->ss->assign('is_admin', is_admin($GLOBALS['current_user']));
     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->ss->assign('contextMenuScript', $script);
     }
 }