Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: where is Assigned To User File

  1. #1
    chetanvalueone is offline Senior Member
    Join Date
    Dec 2008
    Posts
    27

    Default where is Assigned To User File

    Hi All, I wanted to do some code in the Assigned To user pop-up window, but i am unable to find that page, also please tell me how can i change the query of assigned to user list.

    regards,
    chetan

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: where is Assigned To User File

    The files are modules/Users/metadata/popupdefs.php and modules/Users/PopupUsers.php

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    chetanvalueone is offline Senior Member
    Join Date
    Dec 2008
    Posts
    27

    Default Re: where is Assigned To User File

    Thanks for your answer, but how can i customized the query.

    The query written in that format in modules/Users/metadata/popupdefs.php
    $popupMeta = array(
    'moduleMain' => 'User',
    'varName' => 'USER',
    'orderBy' => 'user_name',
    'whereClauses' => array(
    'first_name' => 'users.first_name',
    'last_name' => 'users.last_name',
    'user_name' => 'users.user_name',
    'is_group' => 'users.is_group',
    ),
    'whereStatement'=> " users.status = 'Active' ",
    'searchInputs' => array(
    'first_name',
    'last_name',
    'user_name',
    'is_group'
    ),
    );

    but i want in this way;
    select user_name from users

    actually i wants to put some hierarchy on this page please help me out

  4. #4
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: where is Assigned To User File

    Quote Originally Posted by chetanvalueone View Post

    but i want in this way;
    select user_name from users

    actually i wants to put some hierarchy on this page please help me out
    Can you clarify?
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  5. #5
    chetanvalueone is offline Senior Member
    Join Date
    Dec 2008
    Posts
    27

    Default Re: where is Assigned To User File

    also please one more thing, how can join table.
    $popupMeta = array(
    'moduleMain' => 'User',
    'varName' => 'USER',
    'orderBy' => 'user_name',
    'whereClauses' => array(
    'first_name' => 'users.first_name',
    'last_name' => 'users.last_name',
    'user_name' => 'users.user_name',
    'is_group' => 'users.is_group',
    ),
    'whereStatement'=> " users.status = 'Active' ",
    'searchInputs' => array(
    'first_name',
    'last_name',
    'user_name',
    'is_group'
    ),
    );

    i want to join user table with the accounts table, actually i have added a column account_id in users table so now i want to join account table with the users table

    please tell how can i join table

  6. #6
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: where is Assigned To User File

    The account_id field is not enough to make SugarCRM automatically join both tables and the 'whereStatement' only deal with 'where clauses'.
    Also it is not a good idea to add a new field into users table. This is not an upgrade safe customization.
    You should create a custom field instead.
    You need to modify the modules/Users/PopupUsers.php to implement the join.

    Kind regards
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  7. #7
    chetanvalueone is offline Senior Member
    Join Date
    Dec 2008
    Posts
    27

    Default Re: where is Assigned To User File

    Is it possible to put my query to get user listing except modules/Users/metadata/popupdefs.php this

    actually i want my customized query and i want some conditions
    actually my bussiness logic is the following

    Karepartners,Secretariat, Agency are Accounts
    I have added a Account Name to the User Management, wherever any new user will be created that user must be belong to any Account. That means every user associated with the Accounts.
    Here is the scenario

    1. No one outside Karepartners should be able to assign tasks to Adi
    2. Agency should only be able to assign tasks to the Secretariat.
    3. Secretariat can assign to Agency or Karepartners.
    4. Karepartners should be able to assign tasks to anyone.

    now i want to code like this;

    if(loggedinuser == karepartner(account))
    {
    query 1
    }
    else if(loggedinuser == Secretariat (account))
    {
    query 2
    }
    else if(loggedinuser == Agency(account))
    {
    query 3
    }

    please tell how can do this thing to get my Filtered Users

  8. #8
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: where is Assigned To User File

    You may create the file custom/modules/Users/controller.php and define the method action_popup.

    The code could be:
    PHP Code:
    function action_popup() {
        require_once(
    'custom/modules/Users/UserForPopup.php');

        
    $this->view 'popup';
        
    $this->bean = new UserForPopup();

    Inside the script UserForPopup.php you may define the class UserForPopup which extends the user and define the method create_new_list_query.
    Take a look at this function into data/SugarBean.php
    Actually what you need to do is override the $ret_array elements according to your needs.

    Kind regards
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  9. #9
    hermawan is offline Member
    Join Date
    Oct 2008
    Posts
    5

    Default Re: where is Assigned To User File

    sir, I have made this file UserForPopup.php, the content of the file is:
    Code:
    <?php
        class UserForPopup extends User
        {
            function UserForPopup () {
            }
            
            function create_new_list_query()
            {
                print '<pre>';
                print_r ($_REQUEST);
                print '</pre>';
            }
        }
    ?>
    What you mean by
    Inside the script UserForPopup.php you may define the class UserForPopup which extends the user and define the method create_new_list_query.
    is create a new method on that class right? It seems the method never executed coz I never see the result of that print statement.

    Care for giving more advice for newbie?

    Thank you sir

  10. #10
    hermawan is offline Member
    Join Date
    Oct 2008
    Posts
    5

    Default Re: where is Assigned To User File

    I have tried the following files:
    /custom/modules/Users/controller.php
    Code:
    <?php
    class UsersController extends SugarController {
        function action_popup() {
            require_once('custom/modules/Users/UserForPopup.php');
            $this->view = 'popup';
            $this->bean = new UserForPopup();
        }
    }
    ?>
    /custom/modules/Users/UserForPopup.php
    Code:
    <?php
        class UserForPopup extends SugarBean // I have tried to extends User
        {
            function UserForPopup () {
            }
            
            function create_new_list_query()
            {
                $ret_array = array (
                    'select' => 'SELECT *',
                    'from' => ' FROM users',
                    'where' => '',
                    'order_by' => ' user_name',
                );
                return $ret_array;
            }
        }
    ?>
    Help

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Automatic email to assigned user
    By visucr in forum General Discussion
    Replies: 0
    Last Post: 2008-07-16, 02:30 PM
  2. Replies: 4
    Last Post: 2006-08-21, 06:30 PM
  3. How to see the Assigned user on the Scheduling table
    By ElChef in forum Developer Help
    Replies: 0
    Last Post: 2006-06-16, 09:42 AM
  4. All Email Search by Assigned User
    By diegofliess in forum Developer Help
    Replies: 1
    Last Post: 2006-03-29, 03:56 PM
  5. Search/Update for Assigned User
    By andreasw in forum Help
    Replies: 0
    Last Post: 2006-02-27, 06:06 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
  •