Forked from jmertic/gist:3684156
Last active
October 8, 2017 18:02
HOWTO: Adding your own ListView action items - Part 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('include/MVC/View/views/view.list.php'); | |
class CustomAccountsViewList extends ViewList | |
{ | |
/** | |
* @see ViewList::preDisplay() | |
*/ | |
public function preDisplay() | |
{ | |
parent::preDisplay(); | |
$this->lv->actionsMenuExtraItems[] = $this->buildMyMenuItem(); | |
} | |
/** | |
* @return string HTML | |
*/ | |
protected function buildMyMenuItem() | |
{ | |
global $app_strings; | |
return <<<EOHTML | |
<a class="menuItem" style="width: 150px;" href="#" onmouseover='hiliteItem(this,"yes");' | |
onmouseout='unhiliteItem(this);' | |
onclick="sugarListView.get_checks(); | |
if(sugarListView.get_checks_count() < 1) { | |
alert('{$app_strings['LBL_LISTVIEW_NO_SELECTED']}'); | |
return false; | |
} | |
document.MassUpdate.action.value='displaypassedids'; | |
document.MassUpdate.submit();">Send records to a new view!</a> | |
EOHTML; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From https://web.archive.org/web/20150727073955/http://developer.sugarcrm.com/2010/11/22/howto-adding-your-own-listview-action-items/
To be saved as
custom/modules/Accounts/views/view.list.php