Results 1 to 6 of 6

Thread: Display Cases created by me

  1. #1
    runa is offline Junior Member
    Join Date
    Nov 2006
    Posts
    2

    Default Display Cases created by me

    I would like to have a predefined (saved) search for all the Cases created by me. I the "CREATED_BY" field into the Search form (in Studio), saved & published but when I go to the search form it's not there.

    A dashlet with "cases created by me" would be equally useful for me.

    Thanks in advance!

  2. #2
    lowJack01 is offline Sugar Community Member
    Join Date
    Sep 2007
    Location
    Albuquerque, NM
    Posts
    86

    Question Re: Display Cases created by me

    Runa:

    Did you ever get a solution or a work around to the cases - created by questioon?

  3. #3
    lowJack01 is offline Sugar Community Member
    Join Date
    Sep 2007
    Location
    Albuquerque, NM
    Posts
    86

    Default Re: Display Cases created by me

    I'm trying to create a custom dashlet to accomplish this. Currently, I am stuck. The daslet edit screen is displaying "Not Implemented" where I'd like it to display the user name picker. From my investigations, it looks like the new created_by field is getting called a member of the SugarWidgetField class instead of the SugarWidgetFieldUser_name class, which is what I intend for the class of the new created_by field to be. Where is the class assigned - is it in the database or in the code?

    Thank you to anyone who can comment!

    - Jackie


    It's not in vardefs!
    Last edited by lowJack01; 2007-11-09 at 06:44 PM.

  4. #4
    lowJack01 is offline Sugar Community Member
    Join Date
    Sep 2007
    Location
    Albuquerque, NM
    Posts
    86

    Default Re: Display Cases created by me

    At the risk of being helpful to someone else, I am holding a conversation with myself.

    I go it. Here's what I did:

    I created a custom dashlet by:
    Creating custom/modules/Cases/Dashlets/MyCreatedCasesDashlet.php
    Creating custom/modules/Cases/Dashlets/MyCreatedCasesDashlet.data.php
    Creating custom/modules/Cases/Dashlets/MyCreatedCasesDashlet.meta.php
    Creating custom/modules/Cases/Dashlets/MyCreatedCasesDashlet.en_us.langphp

    Everything else is just like the My Cases dashlet, except in MyCreatedCasesDashlet.data.php i added:
    'created_by' => array('type' => 'relate',
    'default' => $current_user->name),

    The dashlet isn't properly configurable, but at least our employees can follow their issues from complaint to resolution!

    Thank you, thank you.

  5. #5
    lowJack01 is offline Sugar Community Member
    Join Date
    Sep 2007
    Location
    Albuquerque, NM
    Posts
    86

    Cool Re: Display Cases created by me

    I changed some things around, because even though the dashlet worked in my test environment, it didn't work reliably in our production environment. Possibly I didn't upload a needed file. I don't know exactly, because I am not adhere to proper control methods.

    The key seems to be in include\Dashlets\DashletGeneric.php, inside buildWhere(), around line 244. I'm still learning, though.

    Code:
    // JAT 1/25/08 - Issues, follow Issues		
    if($name == 'created_by'){
    	$module = get_class($this);
    	if($module == 'mycreatedcasesdashlet'){
    		array_push($returnArray, $this->seedBean->table_name . '.' . "created_by = '" . $current_user->id . "'");
    		continue;
    	}
    }
    // END JAT 12/10/07 - 1/25/08
    There's still testing to do, so I'll keep you posted!

    - Jackie

  6. #6
    quixote1024 is offline Sugar Community Member
    Join Date
    May 2008
    Posts
    28

    Default Re: Display Cases created by me

    Just in case someone is looking for the answer:

    Around line 225 in the include/generic/LayoutManager.php file add the following (code between MODIFICATION BEGINS and ENDS):

    if($use_default) {
    switch($widget_def['name']) {
    case 'assigned_user_id':
    $widget_def['widget_class'] = 'Fielduser_name';
    break;
    //MODIFICATION BEGINS
    case 'created_by':
    $widget_def['widget_class'] = 'Fielduser_name';
    break;

    //MODIFICATIONS ENDS


    Then add "created_by" to your <dashlet>.data.php file:


    - in the searchFields array:
    'created_by' => array('default' => $current_user->id),

    - in the columns array:
    'created_by' => array('width' => '8',
    'default' => true,
    'label' => 'LBL_CREATED'),


    Warmest regards,

    Gareth.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sugar/Mambo - portal cases invisible in Sugar
    By mshallop in forum Web Self Service Portal
    Replies: 5
    Last Post: 2007-02-14, 03:10 PM
  2. Replies: 0
    Last Post: 2006-11-16, 12:33 AM
  3. Disapearing cases
    By Couchman in forum Help
    Replies: 2
    Last Post: 2006-11-01, 07:07 PM
  4. Sorting by a Custom Field in Cases (OS)
    By neonz2005 in forum Help
    Replies: 1
    Last Post: 2005-08-26, 01:41 PM
  5. Display date created in view lists
    By averum in forum Feature Requests
    Replies: 0
    Last Post: 2005-01-26, 03:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •