/**
  * 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, $image_path, $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;
     foreach ($this->displayColumns as $name => $params) {
         $this->displayColumns[$name]['width'] = round($this->displayColumns[$name]['width'] / $adjustment, 2);
     }
     $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('imagePath', $image_path);
     if ($this->overlib) {
         $this->ss->assign('overlib', 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());
     }
     // handle save checks and stuff
     if ($this->multiSelect) {
         $this->ss->assign('selectedObjectsSpan', $this->buildSelectedObjectsSpan());
         $this->ss->assign('multiSelectData', $this->getMultiSelectData());
     }
     $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));
 }
Example #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, $html_var)
 {
     global $odd_bg, $even_bg, $hilite_bg, $click_bg;
     parent::process($file, $data, $html_var);
     $this->data = $data;
     $html_var = strtoupper($html_var);
     $this->xtpl = new XTemplate($file);
     $this->xtpl->assign('MOD', $GLOBALS['mod_strings']);
     $this->xtpl->assign('APP', $GLOBALS['app_strings']);
     $this->xtpl->assign('BG_HILITE', $hilite_bg);
     $this->xtpl->assign('ORDER_BY', $data['pageData']['urls']['orderBy']);
     $this->processPagination();
     $this->xtpl->parse($this->nav_block);
     $this->processArrows($data['pageData']['ordering']);
     $oddRow = false;
     if ($this->xtpl->exists($this->pro_nav_block)) {
         $this->xtpl->parse($this->pro_nav_block);
     }
     $this->xtpl->assign('CHECKALL', "<input type='checkbox' title='" . $GLOBALS['app_strings']['LBL_SELECT_ALL_TITLE'] . "' class='checkbox' id='massall' name='massall' value='' onclick='sListView.check_all(document.MassUpdate, \"mass[]\", this.checked);' />");
     foreach ($data['data'] as $id => $row) {
         $this->xtpl->assign($html_var, $row);
         if (!empty($data['pageData']['tag'][$id])) {
             $this->xtpl->assign('TAG', $data['pageData']['tag'][$id]);
         }
         $this->xtpl->assign('ROW_COLOR', $oddRow ? 'oddListRow' : 'evenListRow');
         $this->xtpl->assign('BG_COLOR', $oddRow ? $odd_bg : $even_bg);
         $oddRow = !$oddRow;
         if ($this->xtpl->exists($this->pro_block)) {
             $this->xtpl->parse($this->pro_block);
         }
         //			if($this->xtpl->exists($this->os_block)) $this->xtpl->parse($this->os_block);
         $prerow = "&nbsp;<input onclick='sListView.check_item(this, document.MassUpdate)' type='checkbox' class='checkbox' name='mass[]' value='" . $id . "'>";
         $this->xtpl->assign('PREROW', $prerow);
         $this->xtpl->parse($this->row_block);
     }
 }
Example #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)
 {
     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);
     }
 }
Example #4
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);
     }
 }
Example #5
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('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);
     }
 }