bug_tracker::get_user_prefs_internal (public)

 bug_tracker::get_user_prefs_internal package_id user_id

Defined in packages/bug-tracker/tcl/bug-tracker-procs.tcl

Parameters:
package_id (required)
user_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 bug_tracker::get_user_prefs bug_tracker::get_user_prefs (public) bug_tracker::get_user_prefs_internal bug_tracker::get_user_prefs_internal bug_tracker::get_user_prefs->bug_tracker::get_user_prefs_internal _ _ (public) bug_tracker::get_user_prefs_internal->_ db_0or1row db_0or1row (public) bug_tracker::get_user_prefs_internal->db_0or1row db_dml db_dml (public) bug_tracker::get_user_prefs_internal->db_dml db_string db_string (public) bug_tracker::get_user_prefs_internal->db_string

Testcases:
No testcase defined.
Source code:
    set found_p [db_0or1row user_info { } -column_array result]

    if { !$found_p } {
        set count [db_string count_user_prefs {}]
        if { $count == 0 } {
            db_dml create_user_prefs {}
            # we call ourselves again, so we'll get the info this time
            return [get_user_prefs_internal $package_id $user_id]
        } else {
            error "[_ bug-tracker.No_user_in_database]"
        }
    } else {
        return [array get result]
    }
Generic XQL file:
<fullquery name="bug_tracker::get_user_prefs_internal.count_user_prefs">
    <querytext>
       select count(*) from bt_user_prefs where project_id = :package_id and user_id = :user_id 
      </querytext>
</fullquery>

<fullquery name="bug_tracker::get_user_prefs_internal.create_user_prefs">
    <querytext>
      
                insert into bt_user_prefs (user_id, project_id) values (:user_id, :package_id)
            
      </querytext>
</fullquery>

<fullquery name="bug_tracker::get_user_prefs_internal.user_info">
    <querytext>
      
        select u.first_names as user_first_names, 
               u.last_name as user_last_name,
               u.email as user_email,
               ver.version_id as user_version_id,
               coalesce(ver.version_name, 'None') as user_version_name
        from   cc_users u,
               bt_user_prefs up
               left outer join bt_versions ver
               on (ver.version_id = up.user_version)
        where  u.user_id = :user_id
        and    up.user_id = u.user_id
        and    up.project_id = :package_id
    
      </querytext>
</fullquery>
packages/bug-tracker/tcl/bug-tracker-procs.xql

PostgreSQL XQL file:
packages/bug-tracker/tcl/bug-tracker-procs-postgresql.xql

Oracle XQL file:
packages/bug-tracker/tcl/bug-tracker-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: