Skip to content
Snippets Groups Projects
Commit cf6f10ce authored by colemanw's avatar colemanw
Browse files

Fix changing case status in dashboard CRM-12202

parent a2449fbb
Branches
Tags
No related merge requests found
......@@ -47,9 +47,19 @@ class CRM_Contact_Page_DashBoard extends CRM_Core_Page {
*/
function run() {
// Add dashboard js and css
CRM_Core_Resources::singleton()
->addScriptFile('civicrm', 'packages/jquery/plugins/jquery.dashboard.js', 0, 'html-header', FALSE)
->addStyleFile('civicrm', 'packages/jquery/css/dashboard.css');
$resources = CRM_Core_Resources::singleton();
$resources->addScriptFile('civicrm', 'packages/jquery/plugins/jquery.dashboard.js', 0, 'html-header', FALSE);
$resources->addStyleFile('civicrm', 'packages/jquery/css/dashboard.css');
$config = CRM_Core_Config::singleton();
// Add dashlet-specific js files
// TODO: Need a much better way of managing on-the-fly js requirements. Require.js perhaps?
// Checking if a specific dashlet is enabled is a pain and including the js here sucks anyway
// So here's a compromise:
if (in_array('CiviCase', $config->enableComponents)) {
$resources->addScriptFile('civicrm', 'templates/CRM/Case/Form/ActivityChangeStatus.js');
}
$resetCache = CRM_Utils_Request::retrieve('resetCache', 'Positive', CRM_Core_DAO::$_nullObject);
......@@ -101,7 +111,6 @@ class CRM_Contact_Page_DashBoard extends CRM_Core_Page {
$ownerOrgOK = FALSE;
}
$config = CRM_Core_Config::singleton();
if (in_array('CiviMail', $config->enableComponents) &&
CRM_Core_BAO_MailSettings::defaultDomain() == "EXAMPLE.ORG"
) {
......
......@@ -285,7 +285,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
$contactID = $session->get('userID');
//we need to get existing dashletes, so we know when to update or insert
$contactDashlets = CRM_Core_BAO_Dashboard::getContactDashlets(true);
$contactDashlets = self::getContactDashlets(TRUE);
$dashletIDs = array();
if (is_array($columns)) {
......
......@@ -3571,18 +3571,18 @@ div.m ul#civicrm-menu,
}
/* in place edit */
#crm-container .crm-editable-enabled {
.crm-container .crm-editable-enabled {
white-space: nowrap;
}
#crm-container .crm-editable-enabled,
#crm-container .crm-editable-textarea-enabled {
.crm-container .crm-editable-enabled,
.crm-container .crm-editable-textarea-enabled {
display: block;
padding-left: 2px;
border: 2px dashed transparent;
}
#crm-container .crm-editable-enabled:hover {
.crm-container .crm-editable-enabled:hover {
display: block;
padding-left: 2px;
border: 2px dashed lightgrey;
......
// http://civicrm.org/licensing
cj(function($) {
$('#crm-container').on('click', 'a.crm-activity-change-status', function() {
// Elements are sometimes in a jQuery dialog box which is outside crm-container,
// So gotta attach this handler to the whole body - sorry.
$('body').on('click', 'a.crm-activity-change-status', function() {
var link = $(this),
activityId = $(this).attr('activity_id'),
current_status_id = $(this).attr('current_status'),
caseId = $(this).attr('case_id'),
data = 'snippet=1&reset=1',
o = $('<div class="crm-container crm-activity_change_status"></div>');
addCiviOverlay(o);
o.block({theme:true});
o.load(CRM.url('civicrm/case/changeactivitystatus'), data, function() {
removeCiviOverlay(o);
o.unblock();
cj("#activity_change_status").val(current_status_id);
});
......
......@@ -1123,4 +1123,3 @@ function printCaseReport( ) {
{/if} {* view related cases if end *}
</div>
{include file="CRM/common/overlay.tpl"}
......@@ -165,4 +165,3 @@ function buildCaseDetails( caseId, contactId )
</script>
{/literal}
{include file="CRM/common/overlay.tpl"}
......@@ -110,4 +110,3 @@
{/if}
{/if}
</div>
{include file="CRM/common/overlay.tpl"}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment