CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Dashboard full screen mode and auto-refresh
Pages: [1]

Author Topic: Dashboard full screen mode and auto-refresh  (Read 4673 times)

kmitz

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 2
Dashboard full screen mode and auto-refresh
March 04, 2010, 06:08:30 am
Hi,

Re: CiviCRM "Home" page

I was wondering if there was something I could change to make the activities dashboard block full-screen by default.

Also, is it possible to have it auto-refresh when returning to the dashboard page?

I can tweak code if necessary.

kmitz

Civi 3.1

kmitz

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 2
Re: Dashboard full screen mode and auto-refresh
March 04, 2010, 06:11:03 am
I changed the dashboard.css settings as follows:

Code: [Select]
#crm-container .column-0 {
  /* width: 40%; */
  width: 90%;
}

#crm-container .column-1 {
  /* width: 60% */
  width: 10%;
}

That took care of the full screen part of the question.

NOTE: we're only using the Activities dashlet, so the other column was not being used.  If you have dashlets in both columns, this isn't going to work that well for you.

kmitz

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 2
Re: Dashboard full screen mode and auto-refresh
March 06, 2010, 02:47:39 pm
As for the auto refresh, I see that the URL being called by the Refresh button is "/civicrm/ajax/dashboard?op=get_widget&id=1".

Maybe I could call this in a js file inserted via a Drupal module so I don't have to hack code???

kmitz

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 2
Re: Dashboard full screen mode and auto-refresh
March 23, 2010, 02:28:31 pm
The difference between the URL that is currently used and what would probably force a reload is "&resetCache=1".

http://example.com/civicrm/dashboard?reset=1&resetCache=1

I've tried a text search of the entire download, but I can't find where this is set (it would be after you would create or edit a new activity).

kmitz

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 2
Re: Dashboard full screen mode and auto-refresh
March 23, 2010, 02:43:53 pm
Moving to the database civicrm_menu table...am I getting closer?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Dashboard full screen mode and auto-refresh
March 23, 2010, 04:11:43 pm
Unfortunately this is pretty much the only item in the navigation menu which is hard-coded (and can't be modified in the DB or simply by changing the Navigation configuration.

The code which defines the 'Home' navigation element URL is in CRM/Core/BAO/Navigation.php

$homeURL       = CRM_Utils_System::url( 'civicrm/dashboard', 'reset=1');

... but we don't recommend changing core code files :-( (If you do, you'll need to access the civicrm/menu/rebuild?reset=1 URL to get the new value inserted in your navigation menu.

One approach might be to implement a postProcess hook on the Activity form which invokes CRM_Core_BAO_Dashboard::resetDashletCache( ); whenever an Activity is added or updated.
Protect your investment in CiviCRM by  becoming a Member!

kmitz

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 2
Re: Dashboard full screen mode and auto-refresh
March 23, 2010, 04:58:41 pm
Dave,

Thanks for the tip.  I'd rather not modify core either, but I'm going to do it temporarily while I look into your other suggestion.

If I figure it out, I'll post back here.

Thanks

kmitz

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 2
Re: Dashboard full screen mode and auto-refresh
March 29, 2010, 12:20:14 pm
Dave's suggestion seems to work (why would I be surprised at that?)! 

Please refer to the wiki page below for info on how to create your custom hook.

http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmpostProcess

I have 2 items in the example that are commented out below; the first allows you to see the Civi formName after you perform the operation in question (in my case 'CRM_Activity_Form_Activity').  The second allows you to see your include_path in order to get the correct path to the file you need to perform the required operation.

Note that this change causes the dashlet to load more slowly than otherwise, but a refresh is not required.

Code: [Select]
function example_civicrm_postProcess( $formName, &$form ) {
 
  //drupal_set_message($formName);
 
  if ($formName == 'CRM_Activity_Form_Activity') {
   
    //drupal_set_message (ini_get('include_path'));
   
    require 'CRM/Core/BAO/Dashboard.php';
    CRM_Core_BAO_Dashboard::resetDashletCache( );
  }
}

Conte01

  • I post occasionally
  • **
  • Posts: 79
  • Karma: -1
  • www.aidboard.com
    • Aidboard
  • CiviCRM version: latest
  • CMS version: Drupal
Re: Dashboard full screen mode and auto-refresh
February 08, 2011, 02:46:44 am
hey,

i also would like to have only one colum but over the whole width. i tried the changes suggested by kmitz, but they dont seem to have any effect.

any ideas?

thanks
conte
http://www.aidboard.com

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Dashboard full screen mode and auto-refresh
February 08, 2011, 02:50:03 pm
See this post: http://forum.civicrm.org/index.php/topic,18461.msg76801.html#msg76801
Protect your investment in CiviCRM by  becoming a Member!

Conte01

  • I post occasionally
  • **
  • Posts: 79
  • Karma: -1
  • www.aidboard.com
    • Aidboard
  • CiviCRM version: latest
  • CMS version: Drupal
Re: Dashboard full screen mode and auto-refresh
February 09, 2011, 01:32:32 am
hi dave,

i checked this one too, but it does not really describe what to change.

when i check the code with firebug it shows a strange css file in the following directory: http://www.wienertafel.at/crm/sites/default/files/css/css_18e7260895235996084c1ee833c85acb.css

in this file the setting are original. what is this file?

thanks
conte
« Last Edit: February 09, 2011, 02:00:39 am by Conte01 »
http://www.aidboard.com

Conte01

  • I post occasionally
  • **
  • Posts: 79
  • Karma: -1
  • www.aidboard.com
    • Aidboard
  • CiviCRM version: latest
  • CMS version: Drupal
Re: Dashboard full screen mode and auto-refresh
February 14, 2011, 12:06:41 am
any ideas?

thx
conte
http://www.aidboard.com

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Dashboard full screen mode and auto-refresh
February 14, 2011, 12:14:41 am
Hi,

that's the drupal cache. You need to rebuild the theme caches when you change css (or disable the compress css& js during your testing)

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Conte01

  • I post occasionally
  • **
  • Posts: 79
  • Karma: -1
  • www.aidboard.com
    • Aidboard
  • CiviCRM version: latest
  • CMS version: Drupal
Re: Dashboard full screen mode and auto-refresh
February 14, 2011, 04:15:37 am
thx, works now

conte
« Last Edit: February 14, 2011, 04:20:25 am by Conte01 »
http://www.aidboard.com

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Dashboard full screen mode and auto-refresh

This forum was archived on 2017-11-26.