/** * Display the actions link * * @param string $id link id attribute, defaults to 'actions_link' * @return string HTML source */ protected function buildActionsLink($id = 'actions_link') { global $app_strings; $closeText = "<img border=0 src=" . SugarThemeRegistry::current()->getImageURL('close_inline.gif') . " />"; $moreDetailImage = SugarThemeRegistry::current()->getImageURL('MoreDetail.png'); $menuItems = ''; // delete if (ACLController::checkAccess($this->seed->module_dir, 'delete', true) && $this->delete) { $menuItems .= $this->buildDeleteLink(); } // compose email if ($this->email) { $menuItems .= $this->buildComposeEmailLink($this->data['pageData']['offsets']['total']); } // mass update $mass = new MassUpdate(); $mass->setSugarBean($this->seed); if (ACLController::checkAccess($this->seed->module_dir, 'edit', true) && $this->showMassupdateFields && $mass->doMassUpdateFieldsExistForFocus()) { $menuItems .= $this->buildMassUpdateLink(); } // merge if ($this->mailMerge) { $menuItems .= $this->buildMergeLink(); } if ($this->mergeduplicates) { $menuItems .= $this->buildMergeDuplicatesLink(); } // add to target list if ($this->targetList && ACLController::checkAccess('ProspectLists', 'edit', true)) { $menuItems .= $this->buildTargetList(); } // export if (ACLController::checkAccess($this->seed->module_dir, 'export', true) && $this->export) { $menuItems .= $this->buildExportLink(); } foreach ($this->actionsMenuExtraItems as $item) { $menuItems .= $item; } $menuItems = str_replace('"', '\\"', $menuItems); $menuItems = str_replace(array("\r", "\n"), '', $menuItems); if (empty($menuItems)) { return ''; } return <<<EOHTML <script type="text/javascript"> <!-- function actions_overlib() { return overlib("{$menuItems}", CENTER, '', STICKY, MOUSEOFF, 3000, CLOSETEXT, "{$closeText}", WIDTH, 150, CLOSETITLE, "{$app_strings['LBL_ADDITIONAL_DETAILS_CLOSE_TITLE']}", CLOSECLICK, FGCLASS, 'olOptionsFgClass', CGCLASS, 'olOptionsCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olOptionsCapFontClass', CLOSEFONTCLASS, 'olOptionsCloseFontClass'); } --> </script> <a id='{$id}' onclick='return actions_overlib();' href="#"> {$app_strings['LBL_LINK_ACTIONS']} <img src='{$moreDetailImage}' border='0' /> </a> EOHTML; }
/** * Display the actions link * * @param string $id link id attribute, defaults to 'actions_link' * @return string HTML source */ protected function buildActionsLink($id = 'actions_link') { global $app_strings; $closeText = SugarThemeRegistry::current()->getImage('close_inline', 'border=0', null, null, ".gif", $app_strings['LBL_CLOSEINLINE']); $moreDetailImage = SugarThemeRegistry::current()->getImageURL('MoreDetail.png'); $menuItems = ''; // delete if (ACLController::checkAccess($this->seed->module_dir, 'delete', true) && $this->delete) { $menuItems .= $this->buildDeleteLink(); } // compose email if ($this->email) { $menuItems .= $this->buildComposeEmailLink($this->data['pageData']['offsets']['total']); } // mass update $mass = new MassUpdate(); $mass->setSugarBean($this->seed); if (ACLController::checkAccess($this->seed->module_dir, 'edit', true) && ACLController::checkAccess($this->seed->module_dir, 'massupdate', true) && $this->showMassupdateFields && $mass->doMassUpdateFieldsExistForFocus()) { $menuItems .= $this->buildMassUpdateLink(); } // merge if ($this->mailMerge) { $menuItems .= $this->buildMergeLink(); } if ($this->mergeduplicates) { $menuItems .= $this->buildMergeDuplicatesLink(); } // add to target list if ($this->targetList && ACLController::checkAccess('ProspectLists', 'edit', true)) { $menuItems .= $this->buildTargetList(); } // export if (ACLController::checkAccess($this->seed->module_dir, 'export', true) && $this->export) { $menuItems .= $this->buildExportLink(); } foreach ($this->actionsMenuExtraItems as $item) { $menuItems .= $item; } $menuItems = str_replace('"', '\\"', $menuItems); $menuItems = str_replace(array("\r", "\n"), '', $menuItems); if (empty($menuItems)) { return ''; } return <<<EOHTML <a id='{$id}' href="javascript:void(0)"> {$app_strings['LBL_LINK_ACTIONS']} <img src='{$moreDetailImage}' border='0' /> </a> <script type="text/javascript"> var actionLinkSelector = "#{$id}"; var userHoveredOverMenu = false; function actions_overlib(e) { overlib("{$menuItems}", CENTER, '', STICKY, MOUSEOFF, 3000, CLOSETEXT, '{$closeText}', WIDTH, 150, CLOSETITLE, "{$app_strings['LBL_ADDITIONAL_DETAILS_CLOSE_TITLE']}", CLOSECLICK, FGCLASS, 'olOptionsFgClass', CGCLASS, 'olOptionsCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olOptionsCapFontClass', CLOSEFONTCLASS, 'olOptionsCloseFontClass'); e.currentTarget.focus(); YUI().use('node', 'event-base', function(Y) { e.currentTarget.on('blur', actions_overlib_close); Y.all('#overDiv').on('mouseover', function(e) { userHoveredOverMenu = true; }); Y.all('#overDiv').on('mouseout', function(e) { userHoveredOverMenu = false; }); }); } function actions_overlib_close(e) { if (userHoveredOverMenu == false) { YUI().use('node', function(Y) { var overDiv = Y.one("#overDiv"); if (overDiv != null) overDiv.remove(); }); } } // event delegations YUI().use('node', 'event-base', function(Y) { if (typeof alClickEventHandler != 'undefined') { alClickEventHandler.detach(); } if (Y.one('div.listViewBody') != null) { var alClickEventHandler = Y.one('div.listViewBody').delegate('click', actions_overlib, actionLinkSelector); } }); </script> EOHTML; }