Jump to content

class function help


ladyslinger

Recommended Posts

Looking for some php help. I have a php class file from an open source ticket db that contains a function that I wish to modify from eventum 2.3.1 Sounds simple enough right? Not for me.

 

I'm looking to modify so that the column I want displays a particular value. Right now I have the code set to:

function getIssuesByUser($prj_id)

    {

        $stmt = "SELECT

                  iss_id,

  iss_summary,

  iss_prj_id,

  usr_full_name,

  sta_title,

  iss_sta_id,

  sta_color,

  fld_title,

 

                FROM

                    (

                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue,

                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user,

                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "user,

" . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "custom_field

)

                    LEFT JOIN

" . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "status

ON

iss_sta_id = sta_id

WHERE

                    iss_prj_id=" . Misc::escapeInteger($prj_id) . " AND

                    iss_id=isu_iss_id AND

                    isu_usr_id=usr_id

HAVING

fld_title = 'Close Date'

 

                ORDER BY

                    usr_full_name";

        $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC);

        if (PEAR::isError($res)) {

            Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);

            return "";

        } else {

          Time_Tracking::getTimeSpentByIssues($res);

            $issues = array();

            for ($i = 0; $i < count($res); $i++) {

                $issues[$res[$i]['usr_full_name']][$res[$i]['iss_id']] = array(

                    'iss_summary'      => $res[$i]['iss_summary'],

                    'sta_title'        => $res[$i]['sta_title'],

'fld_title' => Date_Helper::getFormattedDate($res[$i]['fld_title']),

                    'status_color'    => $res[$i]['sta_color']

                );

            }

            return $issues;

        }

    }

 

Is there anything glaring that I did wrong? I'm still getting familar with PHP and mySQL.

 

the fld_title is the part I changed...it's a column in my custom_field table (not my choice...)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.