当前位置: 首页>>代码示例>>PHP>>正文


PHP Issue::markAsUpdated方法代码示例

本文整理汇总了PHP中Issue::markAsUpdated方法的典型用法代码示例。如果您正苦于以下问题:PHP Issue::markAsUpdated方法的具体用法?PHP Issue::markAsUpdated怎么用?PHP Issue::markAsUpdated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Issue的用法示例。


在下文中一共展示了Issue::markAsUpdated方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: remove

 /**
  * Method used to remove an existing set of requirements.
  *
  * @return  integer -1 if an error occurred or 1 otherwise
  */
 public static function remove()
 {
     $items = $_POST['item'];
     $itemlist = DB_Helper::buildList($items);
     $stmt = "SELECT\n                    isr_iss_id\n                 FROM\n                    {{%issue_requirement}}\n                 WHERE\n                    isr_id IN ({$itemlist})";
     $issue_id = DB_Helper::getInstance()->getOne($stmt, $items);
     $stmt = "DELETE FROM\n                    {{%issue_requirement}}\n                 WHERE\n                    isr_id IN ({$itemlist})";
     try {
         DB_Helper::getInstance()->query($stmt, $items);
     } catch (DbException $e) {
         return -1;
     }
     Issue::markAsUpdated($issue_id);
     // need to save a history entry for this
     $usr_id = Auth::getUserID();
     History::add($issue_id, $usr_id, 'impact_analysis_removed', 'Impact analysis removed by {user}', array('user' => User::getFullName($usr_id)));
     return 1;
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:23,代码来源:class.impact_analysis.php

示例2: sendEmail


//.........这里部分代码省略.........
             $HTTP_POST_VARS['title'] = $HTTP_POST_VARS["subject"];
             $HTTP_POST_VARS['note'] = Mail_API::getCannedBlockedMsgExplanation() . $HTTP_POST_VARS["message"];
             Note::insert(Auth::getUserID(), $HTTP_POST_VARS["issue_id"]);
             Workflow::handleBlockedEmail(Issue::getProjectID($HTTP_POST_VARS['issue_id']), $HTTP_POST_VARS['issue_id'], $HTTP_POST_VARS, 'web');
             return 1;
         }
     }
     // only send a direct email if the user doesn't want to add the Cc'ed people to the notification list
     if (@$HTTP_POST_VARS['add_unknown'] == 'yes') {
         if (!empty($HTTP_POST_VARS['issue_id'])) {
             // add the recipients to the notification list of the associated issue
             $recipients = array($HTTP_POST_VARS['to']);
             $recipients = array_merge($recipients, Support::getRecipientsCC($HTTP_POST_VARS['cc']));
             for ($i = 0; $i < count($recipients); $i++) {
                 if (!empty($recipients[$i]) && !Notification::isIssueRoutingSender($HTTP_POST_VARS["issue_id"], $recipients[$i])) {
                     Notification::subscribeEmail(Auth::getUserID(), $HTTP_POST_VARS["issue_id"], Mail_API::getEmailAddress($recipients[$i]), array('emails'));
                 }
             }
         }
     } else {
         // Usually when sending out emails associated to an issue, we would
         // simply insert the email in the table and call the Notification::notifyNewEmail() method,
         // but on this case we need to actually send the email to the recipients that are not
         // already in the notification list for the associated issue, if any.
         // In the case of replying to an email that is not yet associated with an issue, then
         // we are always directly sending the email, without using any notification list
         // functionality.
         if (!empty($HTTP_POST_VARS['issue_id'])) {
             // send direct emails only to the unknown addresses, and leave the rest to be
             // catched by the notification list
             $from = Notification::getFixedFromHeader($HTTP_POST_VARS['issue_id'], $HTTP_POST_VARS['from'], 'issue');
             // build the list of unknown recipients
             if (!empty($HTTP_POST_VARS['to'])) {
                 $recipients = array($HTTP_POST_VARS['to']);
                 $recipients = array_merge($recipients, Support::getRecipientsCC($HTTP_POST_VARS['cc']));
             } else {
                 $recipients = Support::getRecipientsCC($HTTP_POST_VARS['cc']);
             }
             $unknowns = array();
             for ($i = 0; $i < count($recipients); $i++) {
                 if (!Notification::isSubscribedToEmails($HTTP_POST_VARS['issue_id'], $recipients[$i])) {
                     $unknowns[] = $recipients[$i];
                 }
             }
             if (count($unknowns) > 0) {
                 $to = array_shift($unknowns);
                 $cc = implode('; ', $unknowns);
                 // send direct emails
                 Support::sendDirectEmail($HTTP_POST_VARS['issue_id'], $from, $to, $cc, $HTTP_POST_VARS['subject'], $HTTP_POST_VARS['message'], $message_id, $sender_usr_id);
             }
         } else {
             // send direct emails to all recipients, since we don't have an associated issue
             $project_info = Project::getOutgoingSenderAddress(Auth::getCurrentProject());
             // use the project-related outgoing email address, if there is one
             if (!empty($project_info['email'])) {
                 $from = Mail_API::getFormattedName(User::getFullName(Auth::getUserID()), $project_info['email']);
             } else {
                 // otherwise, use the real email address for the current user
                 $from = User::getFromHeader(Auth::getUserID());
             }
             // send direct emails
             Support::sendDirectEmail($HTTP_POST_VARS['issue_id'], $from, $HTTP_POST_VARS['to'], $HTTP_POST_VARS['cc'], $HTTP_POST_VARS['subject'], $HTTP_POST_VARS['message'], $message_id);
         }
     }
     $t = array('customer_id' => 'NULL', 'issue_id' => $HTTP_POST_VARS["issue_id"] ? $HTTP_POST_VARS["issue_id"] : 0, 'ema_id' => $HTTP_POST_VARS['ema_id'], 'message_id' => $message_id, 'date' => Date_API::getCurrentDateGMT(), 'from' => $HTTP_POST_VARS['from'], 'to' => $HTTP_POST_VARS['to'], 'cc' => @$HTTP_POST_VARS['cc'], 'subject' => @$HTTP_POST_VARS['subject'], 'body' => $HTTP_POST_VARS['message'], 'full_email' => $full_email, 'has_attachment' => 0);
     // associate this new email with a customer, if appropriate
     if (Auth::getCurrentRole() == User::getRoleID('Customer')) {
         $customer_id = User::getCustomerID(Auth::getUserID());
         if (!empty($customer_id) && $customer_id != -1) {
             $t['customer_id'] = $customer_id;
         }
     }
     $structure = Mime_Helper::decode($full_email, true, false);
     $t['headers'] = $structure->headers;
     $res = Support::insertEmail($t, $structure, $sup_id);
     if (!empty($HTTP_POST_VARS["issue_id"])) {
         // need to send a notification
         Notification::notifyNewEmail(Auth::getUserID(), $HTTP_POST_VARS["issue_id"], $t, $internal_only, false, $type, $sup_id);
         // mark this issue as updated
         if (!empty($t['customer_id']) && $t['customer_id'] != 'NULL') {
             Issue::markAsUpdated($HTTP_POST_VARS["issue_id"], 'customer action');
         } else {
             if (!empty($sender_usr_id) && User::getRoleByUser($sender_usr_id, Issue::getProjectID($HTTP_POST_VARS['issue_id'])) > User::getRoleID('Customer')) {
                 Issue::markAsUpdated($HTTP_POST_VARS["issue_id"], 'staff response');
             } else {
                 Issue::markAsUpdated($HTTP_POST_VARS["issue_id"], 'user response');
             }
         }
         // save a history entry for this
         History::add($HTTP_POST_VARS["issue_id"], Auth::getUserID(), History::getTypeID('email_sent'), 'Outgoing email sent by ' . User::getFullName(Auth::getUserID()));
         // also update the last_response_date field for the associated issue
         if (Auth::getCurrentRole() > User::getRoleID('Customer')) {
             $stmt = "UPDATE\n                            " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue\n                         SET\n                            iss_last_response_date='" . Date_API::getCurrentDateGMT() . "'\n                         WHERE\n                            iss_id=" . Misc::escapeInteger($HTTP_POST_VARS["issue_id"]);
             $GLOBALS["db_api"]->dbh->query($stmt);
             $stmt = "UPDATE\n                            " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue\n                         SET\n                            iss_first_response_date='" . Date_API::getCurrentDateGMT() . "'\n                         WHERE\n                            iss_first_response_date IS NULL AND\n                            iss_id=" . Misc::escapeInteger($HTTP_POST_VARS["issue_id"]);
             $GLOBALS["db_api"]->dbh->query($stmt);
         }
     }
     return 1;
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:101,代码来源:class.support.php

示例3: update

 /**
  * Method used to update an existing draft response.
  *
  * @access  public
  * @param   integer $issue_id The issue ID
  * @param   integer $emd_id The email draft ID
  * @param   string $to The primary recipient of the draft
  * @param   string $cc The secondary recipients of the draft
  * @param   string $subject The subject of the draft
  * @param   string $message The draft body
  * @param   integer $parent_id The ID of the email that this draft is replying to, if any
  * @return  integer 1 if the update worked, -1 otherwise
  */
 function update($issue_id, $emd_id, $to, $cc, $subject, $message, $parent_id = FALSE)
 {
     $issue_id = Misc::escapeInteger($issue_id);
     $emd_id = Misc::escapeInteger($emd_id);
     $parent_id = Misc::escapeInteger($issue_id);
     if (empty($parent_id)) {
         $parent_id = 'NULL';
     }
     $usr_id = Auth::getUserID();
     // update previous draft and insert new record
     $stmt = "UPDATE\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "email_draft\n                 SET\n                    emd_updated_date='" . Date_API::getCurrentDateGMT() . "',\n                    emd_status = 'edited'\n                 WHERE\n                    emd_id={$emd_id}";
     $res = $GLOBALS["db_api"]->dbh->query($stmt);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return -1;
     } else {
         Issue::markAsUpdated($issue_id, "draft saved");
         History::add($issue_id, $usr_id, History::getTypeID('draft_updated'), 'Email message draft updated by ' . User::getFullName($usr_id));
         Draft::saveEmail($issue_id, $to, $cc, $subject, $message, $parent_id, false, false);
         return 1;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:35,代码来源:class.draft.php

示例4: updateValues

 /**
  * Method used to update the values stored in the database.
  *
  * @access  public
  * @return  integer 1 if the update worked properly, any other value otherwise
  */
 function updateValues()
 {
     global $HTTP_POST_VARS;
     $prj_id = Auth::getCurrentProject();
     $issue_id = Misc::escapeInteger($HTTP_POST_VARS["issue_id"]);
     $old_values = Custom_Field::getValuesByIssue($prj_id, $issue_id);
     // get the types for all of the custom fields being submitted
     $stmt = "SELECT\n                    fld_id,\n                    fld_type\n                 FROM\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "custom_field\n                 WHERE\n                    fld_id IN (" . implode(", ", Misc::escapeInteger(@array_keys($HTTP_POST_VARS['custom_fields']))) . ")";
     $field_types = $GLOBALS["db_api"]->dbh->getAssoc($stmt);
     // get the titles for all of the custom fields being submitted
     $stmt = "SELECT\n                    fld_id,\n                    fld_title\n                 FROM\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "custom_field\n                 WHERE\n                    fld_id IN (" . implode(", ", Misc::escapeInteger(@array_keys($HTTP_POST_VARS['custom_fields']))) . ")";
     $field_titles = $GLOBALS["db_api"]->dbh->getAssoc($stmt);
     $updated_fields = array();
     foreach ($HTTP_POST_VARS["custom_fields"] as $fld_id => $value) {
         $fld_id = Misc::escapeInteger($fld_id);
         // security check
         $sql = "SELECT\n                        fld_min_role\n                    FROM\n                        " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "custom_field\n                    WHERE\n                        fld_id = {$fld_id}";
         $min_role = $GLOBALS["db_api"]->dbh->getOne($sql);
         if ($min_role > Auth::getCurrentRole()) {
             continue;
         }
         $option_types = array('multiple', 'combo');
         if (!in_array($field_types[$fld_id], $option_types)) {
             // check if this is a date field
             if ($field_types[$fld_id] == 'date') {
                 $value = $value['Year'] . "-" . $value['Month'] . "-" . $value['Day'];
                 if ($value == '--') {
                     $value = '';
                 }
             }
             // first check if there is actually a record for this field for the issue
             $stmt = "SELECT\n                            icf_id,\n                            icf_value\n                         FROM\n                            " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_custom_field\n                         WHERE\n                            icf_iss_id=" . $issue_id . " AND\n                            icf_fld_id={$fld_id}";
             $res = $GLOBALS["db_api"]->dbh->getRow($stmt, DB_FETCHMODE_ASSOC);
             if (PEAR::isError($res)) {
                 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
                 return -1;
             }
             $icf_id = $res['icf_id'];
             $icf_value = $res['icf_value'];
             if ($icf_value == $value) {
                 continue;
             }
             if (empty($icf_id)) {
                 // record doesn't exist, insert new record
                 $stmt = "INSERT IGNORE INTO\n                                " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_custom_field\n                             (\n                                icf_iss_id,\n                                icf_fld_id,\n                                icf_value\n                             ) VALUES (\n                                " . $issue_id . ",\n                                {$fld_id},\n                                '" . Misc::escapeString($value) . "'\n                             )";
                 $res = $GLOBALS["db_api"]->dbh->query($stmt);
                 if (PEAR::isError($res)) {
                     Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
                     return -1;
                 }
             } else {
                 // record exists, update it
                 $stmt = "UPDATE\n                                " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_custom_field\n                             SET\n                                icf_value='" . Misc::escapeString($value) . "'\n                             WHERE\n                                icf_id={$icf_id}";
                 $res = $GLOBALS["db_api"]->dbh->query($stmt);
                 if (PEAR::isError($res)) {
                     Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
                     return -1;
                 }
             }
             if ($field_types[$fld_id] == 'textarea') {
                 $updated_fields[$field_titles[$fld_id]] = '';
             } else {
                 $updated_fields[$field_titles[$fld_id]] = History::formatChanges($icf_value, $value);
             }
         } else {
             $old_value = Custom_Field::getDisplayValue($HTTP_POST_VARS['issue_id'], $fld_id, true);
             if (!is_array($old_value)) {
                 $old_value = array($old_value);
             }
             if (!is_array($value)) {
                 $value = array($value);
             }
             if (count(array_diff($old_value, $value)) > 0 || count(array_diff($value, $old_value)) > 0) {
                 $old_display_value = Custom_Field::getDisplayValue($HTTP_POST_VARS['issue_id'], $fld_id);
                 // need to remove all associated options from issue_custom_field and then
                 // add the selected options coming from the form
                 Custom_Field::removeIssueAssociation($fld_id, $HTTP_POST_VARS["issue_id"]);
                 if (@count($value) > 0) {
                     Custom_Field::associateIssue($HTTP_POST_VARS["issue_id"], $fld_id, $value);
                 }
                 $new_display_value = Custom_Field::getDisplayValue($HTTP_POST_VARS['issue_id'], $fld_id);
                 $updated_fields[$field_titles[$fld_id]] = History::formatChanges($old_display_value, $new_display_value);
             }
         }
     }
     Workflow::handleCustomFieldsUpdated($prj_id, $issue_id, $old_values, Custom_Field::getValuesByIssue($prj_id, $issue_id));
     Issue::markAsUpdated($HTTP_POST_VARS["issue_id"]);
     // need to save a history entry for this
     if (count($updated_fields) > 0) {
         // log the changes
         $changes = '';
         $i = 0;
         foreach ($updated_fields as $key => $value) {
             if ($i > 0) {
//.........这里部分代码省略.........
开发者ID:juliogallardo1326,项目名称:proc,代码行数:101,代码来源:class.custom_field.php

示例5: updateValues

 /**
  * Method used to update the values stored in the database.
  *
  * @return  integer 1 if the update worked properly, any other value otherwise
  */
 public static function updateValues()
 {
     $prj_id = Auth::getCurrentProject();
     $issue_id = $_POST['issue_id'];
     $old_values = self::getValuesByIssue($prj_id, $issue_id);
     if (isset($_POST['custom_fields']) && count($_POST['custom_fields']) > 0) {
         $custom_fields = $_POST['custom_fields'];
         // get the types for all of the custom fields being submitted
         $cf = array_keys($custom_fields);
         $cf_list = DB_Helper::buildList($cf);
         $stmt = "SELECT\n                        fld_id,\n                        fld_type\n                     FROM\n                        {{%custom_field}}\n                     WHERE\n                        fld_id IN ({$cf_list})";
         $field_types = DB_Helper::getInstance()->getPair($stmt, $cf);
         // get the titles for all of the custom fields being submitted
         $stmt = "SELECT\n                        fld_id,\n                        fld_title\n                     FROM\n                        {{%custom_field}}\n                     WHERE\n                        fld_id IN ({$cf_list})";
         $field_titles = DB_Helper::getInstance()->getPair($stmt, $cf);
         $updated_fields = array();
         foreach ($custom_fields as $fld_id => $value) {
             // security check
             $sql = 'SELECT
                         fld_min_role
                     FROM
                         {{%custom_field}}
                     WHERE
                         fld_id = ?';
             $min_role = DB_Helper::getInstance()->getOne($sql, array($fld_id));
             if ($min_role > Auth::getCurrentRole()) {
                 continue;
             }
             $option_types = array('multiple', 'combo', 'checkbox');
             if (!in_array($field_types[$fld_id], $option_types)) {
                 // check if this is a date field
                 $fld_db_name = self::getDBValueFieldNameByType($field_types[$fld_id]);
                 // first check if there is actually a record for this field for the issue
                 $stmt = "SELECT\n                                icf_id,\n                                {$fld_db_name} as value\n                             FROM\n                                {{%issue_custom_field}}\n                             WHERE\n                                icf_iss_id=? AND\n                                icf_fld_id=?";
                 try {
                     $res = DB_Helper::getInstance()->getRow($stmt, array($issue_id, $fld_id));
                 } catch (DbException $e) {
                     return -1;
                 }
                 $icf_id = $res['icf_id'];
                 $old_value = $res['value'];
                 if ($old_value == $value) {
                     continue;
                 }
                 if (empty($icf_id)) {
                     // record doesn't exist, insert new record
                     $stmt = "INSERT INTO\n                                    {{%issue_custom_field}}\n                                 (\n                                    icf_iss_id,\n                                    icf_fld_id,\n                                    {$fld_db_name}\n                                 ) VALUES (\n                                    ?, ?, ?\n                                 )";
                     $params = array($issue_id, $fld_id, $value);
                     try {
                         DB_Helper::getInstance()->query($stmt, $params);
                     } catch (DbException $e) {
                         return -1;
                     }
                 } else {
                     // record exists, update it
                     $stmt = "UPDATE\n                                    {{%issue_custom_field}}\n                                 SET\n                                    {$fld_db_name}=?\n                                 WHERE\n                                    icf_id=?";
                     $params = array($value, $icf_id);
                     try {
                         DB_Helper::getInstance()->query($stmt, $params);
                     } catch (DbException $e) {
                         return -1;
                     }
                 }
                 if ($field_types[$fld_id] == 'textarea') {
                     $updated_fields[$field_titles[$fld_id]] = '';
                 } else {
                     $updated_fields[$field_titles[$fld_id]] = History::formatChanges($old_value, $value);
                 }
             } else {
                 $old_value = self::getDisplayValue($issue_id, $fld_id, true);
                 if (!is_array($old_value)) {
                     $old_value = array($old_value);
                 }
                 if (!is_array($value)) {
                     $value = array($value);
                 }
                 if (count(array_diff($old_value, $value)) > 0 || count(array_diff($value, $old_value)) > 0) {
                     $old_display_value = self::getDisplayValue($issue_id, $fld_id);
                     // need to remove all associated options from issue_custom_field and then
                     // add the selected options coming from the form
                     self::removeIssueAssociation($fld_id, $issue_id);
                     if (@count($value) > 0) {
                         self::associateIssue($issue_id, $fld_id, $value);
                     }
                     $new_display_value = self::getDisplayValue($issue_id, $fld_id);
                     $updated_fields[$field_titles[$fld_id]] = History::formatChanges($old_display_value, $new_display_value);
                 }
             }
         }
         Workflow::handleCustomFieldsUpdated($prj_id, $issue_id, $old_values, self::getValuesByIssue($prj_id, $issue_id));
         Issue::markAsUpdated($issue_id);
         // need to save a history entry for this
         if (count($updated_fields) > 0) {
             // log the changes
             $changes = '';
//.........这里部分代码省略.........
开发者ID:korusdipl,项目名称:eventum,代码行数:101,代码来源:class.custom_field.php

示例6: remove

 /**
  * Method used to remove a specific phone support entry from the 
  * application.
  *
  * @access  public
  * @param   integer $phone_id The phone support entry ID
  * @return  integer 1 if the removal worked, -1 or -2 otherwise
  */
 function remove($phone_id)
 {
     $phone_id = Misc::escapeInteger($phone_id);
     $stmt = "SELECT\n                    phs_iss_id,\n                    phs_ttr_id,\n                    phs_usr_id\n                 FROM\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "phone_support\n                 WHERE\n                    phs_id={$phone_id}";
     $details = $GLOBALS["db_api"]->dbh->getRow($stmt, DB_FETCHMODE_ASSOC);
     if ($details['phs_usr_id'] != Auth::getUserID()) {
         return -2;
     }
     $stmt = "DELETE FROM\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "phone_support\n                 WHERE\n                    phs_id={$phone_id}";
     $res = $GLOBALS["db_api"]->dbh->query($stmt);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return -1;
     } else {
         Issue::markAsUpdated($details["phs_iss_id"]);
         // need to save a history entry for this
         History::add($details["phs_iss_id"], Auth::getUserID(), History::getTypeID('phone_entry_removed'), 'Phone Support entry removed by ' . User::getFullName(Auth::getUserID()));
         if (!empty($details["phs_ttr_id"])) {
             $time_result = Time_Tracking::removeEntry($details["phs_ttr_id"], $details['phs_usr_id']);
             if ($time_result == 1) {
                 return 2;
             } else {
                 return $time_result;
             }
         } else {
             return 1;
         }
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:37,代码来源:class.phone_support.php

示例7: recordRemoteEntry

 /**
  * Method used to remotely record a time tracking entry.
  *
  * @access  public
  * @param   integer $issue_id The issue ID
  * @param   integer $usr_id The user ID
  * @param   integer $cat_id The time tracking category ID
  * @param   string $summary The summary of the work entry
  * @param   integer $time_spent The time spent in minutes
  * @return  integer 1 if the insert worked, -1 otherwise
  */
 function recordRemoteEntry($issue_id, $usr_id, $cat_id, $summary, $time_spent)
 {
     $stmt = "INSERT INTO\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "time_tracking\n                 (\n                    ttr_ttc_id,\n                    ttr_iss_id,\n                    ttr_usr_id,\n                    ttr_created_date,\n                    ttr_time_spent,\n                    ttr_summary\n                 ) VALUES (\n                    " . Misc::escapeInteger($cat_id) . ",\n                    " . Misc::escapeInteger($issue_id) . ",\n                    " . Misc::escapeInteger($usr_id) . ",\n                    '" . Date_API::getCurrentDateGMT() . "',\n                    " . Misc::escapeInteger($time_spent) . ",\n                    '" . Misc::escapeString($summary) . "'\n                 )";
     $res = $GLOBALS["db_api"]->dbh->query($stmt);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return -1;
     } else {
         Issue::markAsUpdated($issue_id);
         // need to save a history entry for this
         History::add($issue_id, $usr_id, History::getTypeID('remote_time_added'), 'Time tracking entry submitted remotely by ' . User::getFullName($usr_id));
         return 1;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:25,代码来源:class.time_tracking.php

示例8: recordRemoteTimeEntry

 /**
  * Method used to remotely record a time tracking entry.
  *
  * @param   integer $issue_id The issue ID
  * @param   integer $usr_id The user ID
  * @param   integer $cat_id The time tracking category ID
  * @param   string $summary The summary of the work entry
  * @param   integer $time_spent The time spent in minutes
  * @return  integer 1 if the insert worked, -1 otherwise
  */
 public static function recordRemoteTimeEntry($issue_id, $usr_id, $cat_id, $summary, $time_spent)
 {
     $stmt = 'INSERT INTO
                 {{%time_tracking}}
              (
                 ttr_ttc_id,
                 ttr_iss_id,
                 ttr_usr_id,
                 ttr_created_date,
                 ttr_time_spent,
                 ttr_summary
              ) VALUES (
                 ?, ?, ?, ?, ?, ?
              )';
     $params = array($cat_id, $issue_id, $usr_id, Date_Helper::getCurrentDateGMT(), $time_spent, $summary);
     try {
         DB_Helper::getInstance()->query($stmt, $params);
     } catch (DbException $e) {
         return -1;
     }
     Issue::markAsUpdated($issue_id);
     History::add($issue_id, $usr_id, 'remote_time_added', 'Time tracking entry submitted remotely by {user}', array('user' => User::getFullName($usr_id)));
     return 1;
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:34,代码来源:class.time_tracking.php

示例9: update

 /**
  * Method used to update the details of a given subscription.
  *
  * @param   $issue_id
  * @param   integer $sub_id The subscription ID
  * @param   $email
  * @return  integer 1 if the update worked, -1 otherwise
  */
 public static function update($issue_id, $sub_id, $email)
 {
     $usr_id = User::getUserIDByEmail(strtolower(Mail_Helper::getEmailAddress($email)), true);
     if (!empty($usr_id)) {
         $email = '';
     } else {
         $usr_id = 0;
     }
     $prj_id = Issue::getProjectID($issue_id);
     // call workflow to modify actions or cancel adding this user.
     $actions = array();
     $subscriber_usr_id = false;
     $workflow = Workflow::handleSubscription($prj_id, $issue_id, $subscriber_usr_id, $email, $actions);
     if ($workflow === false) {
         // cancel subscribing the user
         return -2;
     }
     // always set the type of notification to issue-level
     $stmt = "UPDATE\n                    {{%subscription}}\n                 SET\n                    sub_level='issue',\n                    sub_email=?,\n                    sub_usr_id=?\n                 WHERE\n                    sub_id=?";
     try {
         DB_Helper::getInstance()->query($stmt, array($email, $usr_id, $sub_id));
     } catch (DbException $e) {
         return -1;
     }
     $stmt = 'DELETE FROM
                 {{%subscription_type}}
              WHERE
                 sbt_sub_id=?';
     DB_Helper::getInstance()->query($stmt, array($sub_id));
     // now add them all again
     foreach ($_POST['actions'] as $sbt_type) {
         // FIXME: $sbt_type not validated for sane values
         self::addType($sub_id, $sbt_type);
     }
     // need to mark the issue as updated
     Issue::markAsUpdated($issue_id);
     $current_usr_id = Auth::getUserID();
     History::add($issue_id, $current_usr_id, 'notification_updated', "Notification list entry ('{subscriber}') updated by {user}", array('subscriber' => self::getSubscriber($sub_id), 'user' => User::getFullName($current_usr_id)));
     return 1;
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:48,代码来源:class.notification.php

示例10: remove

 /**
  * Method used to remove an existing set of requirements.
  *
  * @access  public
  * @return  integer -1 if an error occurred or 1 otherwise
  */
 function remove()
 {
     global $HTTP_POST_VARS;
     $items = implode(", ", Misc::escapeInteger($HTTP_POST_VARS["item"]));
     $stmt = "SELECT\n                    isr_iss_id\n                 FROM\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_requirement\n                 WHERE\n                    isr_id IN ({$items})";
     $issue_id = $GLOBALS["db_api"]->dbh->getOne($stmt);
     $stmt = "DELETE FROM\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_requirement\n                 WHERE\n                    isr_id IN ({$items})";
     $res = $GLOBALS["db_api"]->dbh->query($stmt);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return -1;
     } else {
         Issue::markAsUpdated($issue_id);
         // need to save a history entry for this
         History::add($issue_id, Auth::getUserID(), History::getTypeID('impact_analysis_removed'), 'Impact analysis removed by ' . User::getFullName(Auth::getUserID()));
         return 1;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:24,代码来源:class.impact_analysis.php

示例11: logCheckin

 /**
  * Method used to associate a new checkin with an existing issue
  *
  * @access  public
  * @param   integer $issue_id The issue ID
  * @param   integer $i The offset of the file that was changed
  * @return  integer 1 if the update worked, -1 otherwise
  */
 function logCheckin($issue_id, $i)
 {
     global $HTTP_GET_VARS;
     $stmt = "INSERT INTO\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_checkin\n                 (\n                    isc_iss_id,\n                    isc_module,\n                    isc_filename,\n                    isc_old_version,\n                    isc_new_version,\n                    isc_created_date,\n                    isc_username,\n                    isc_commit_msg\n                 ) VALUES (\n                    {$issue_id},\n                    '" . Misc::escapeString($HTTP_GET_VARS["module"]) . "',\n                    '" . Misc::escapeString($HTTP_GET_VARS["files"][$i]) . "',\n                    '" . Misc::escapeString($HTTP_GET_VARS["old_versions"][$i]) . "',\n                    '" . Misc::escapeString($HTTP_GET_VARS["new_versions"][$i]) . "',\n                    '" . Date_API::getCurrentDateGMT() . "',\n                    '" . Misc::escapeString($HTTP_GET_VARS["username"]) . "',\n                    '" . Misc::escapeString($HTTP_GET_VARS["commit_msg"]) . "'\n                 )";
     $res = $GLOBALS["db_api"]->dbh->query($stmt);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return -1;
     } else {
         // need to mark this issue as updated
         Issue::markAsUpdated($issue_id, 'scm checkin');
         // need to save a history entry for this
         History::add($issue_id, APP_SYSTEM_USER_ID, History::getTypeID('scm_checkin_associated'), 'SCM Checkins associated by SCM user \'' . $HTTP_GET_VARS["username"] . '\'.');
         return 1;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:24,代码来源:class.scm.php

示例12: route_emails


//.........这里部分代码省略.........
     }
     $issue_prj_id = Issue::getProjectID($issue_id);
     if (empty($issue_prj_id)) {
         return array(self::EX_DATAERR, ev_gettext('Error: The routed email had no associated Eventum issue ID or had an invalid recipient address.') . "\n");
     }
     $email_account_id = Email_Account::getEmailAccount($issue_prj_id);
     if (empty($email_account_id)) {
         return array(self::EX_CONFIG, ev_gettext('Error: Please provide the email account ID.') . "\n");
     }
     $body = $structure->body;
     // hack for clients that set more then one from header
     if (is_array($structure->headers['from'])) {
         $structure->headers['from'] = $structure->headers['from'][0];
     }
     // associate the email to the issue
     $parts = array();
     Mime_Helper::parse_output($structure, $parts);
     // get the sender's email address
     $sender_email = strtolower(Mail_Helper::getEmailAddress($structure->headers['from']));
     // strip out the warning message sent to staff users
     if ($setup['email_routing']['status'] == 'enabled' && $setup['email_routing']['warning']['status'] == 'enabled') {
         $full_message = Mail_Helper::stripWarningMessage($full_message);
         $body = Mail_Helper::stripWarningMessage($body);
     }
     $prj_id = Issue::getProjectID($issue_id);
     AuthCookie::setAuthCookie(APP_SYSTEM_USER_ID);
     AuthCookie::setProjectCookie($prj_id);
     if (Mime_Helper::hasAttachments($structure)) {
         $has_attachments = 1;
     } else {
         $has_attachments = 0;
     }
     // remove certain CC addresses
     if (!empty($structure->headers['cc']) && $setup['smtp']['save_outgoing_email'] == 'yes') {
         $ccs = explode(',', @$structure->headers['cc']);
         foreach ($ccs as $i => $address) {
             if (Mail_Helper::getEmailAddress($address) == $setup['smtp']['save_address']) {
                 unset($ccs[$i]);
             }
         }
         $structure->headers['cc'] = implode(', ', $ccs);
     }
     // Remove excess Re's
     $structure->headers['subject'] = Mail_Helper::removeExcessRe(@$structure->headers['subject'], true);
     $t = array('issue_id' => $issue_id, 'ema_id' => $email_account_id, 'message_id' => @$structure->headers['message-id'], 'date' => Date_Helper::getCurrentDateGMT(), 'from' => @$structure->headers['from'], 'to' => @$structure->headers['to'], 'cc' => @$structure->headers['cc'], 'subject' => @$structure->headers['subject'], 'body' => @$body, 'full_email' => @$full_message, 'has_attachment' => $has_attachments, 'headers' => @$structure->headers);
     // automatically associate this incoming email with a customer
     if (CRM::hasCustomerIntegration($prj_id)) {
         $crm = CRM::getInstance($prj_id);
         if (!empty($structure->headers['from'])) {
             try {
                 $contact = $crm->getContactByEmail($sender_email);
                 $issue_contract = $crm->getContract(Issue::getContractID($issue_id));
                 if ($contact->canAccessContract($issue_contract)) {
                     $t['customer_id'] = $issue_contract->getCustomerID();
                 }
             } catch (CRMException $e) {
             }
         }
     }
     if (empty($t['customer_id'])) {
         $t['customer_id'] = null;
     }
     if (Support::blockEmailIfNeeded($t)) {
         return true;
     }
     // re-write Threading headers if needed
     list($t['full_email'], $t['headers']) = Mail_Helper::rewriteThreadingHeaders($t['issue_id'], $t['full_email'], $t['headers'], 'email');
     $res = Support::insertEmail($t, $structure, $sup_id);
     if ($res != -1) {
         Support::extractAttachments($issue_id, $structure);
         // notifications about new emails are always external
         $internal_only = false;
         $assignee_only = false;
         // special case when emails are bounced back, so we don't want a notification to customers about those
         if (Notification::isBounceMessage($sender_email)) {
             // broadcast this email only to the assignees for this issue
             $internal_only = true;
             $assignee_only = true;
         }
         Notification::notifyNewEmail(Auth::getUserID(), $issue_id, $t, $internal_only, $assignee_only, '', $sup_id);
         // try to get usr_id of sender, if not, use system account
         $usr_id = User::getUserIDByEmail(Mail_Helper::getEmailAddress($structure->headers['from']));
         if (!$usr_id) {
             $usr_id = APP_SYSTEM_USER_ID;
         }
         // mark this issue as updated
         if (!empty($t['customer_id']) && $t['customer_id'] != null) {
             Issue::markAsUpdated($issue_id, 'customer action');
         } else {
             if (!empty($usr_id) && $usr_id != APP_SYSTEM_USER_ID && User::getRoleByUser($usr_id, $prj_id) > User::ROLE_CUSTOMER) {
                 Issue::markAsUpdated($issue_id, 'staff response');
             } else {
                 Issue::markAsUpdated($issue_id, 'user response');
             }
         }
         // log routed email
         History::add($issue_id, $usr_id, 'email_routed', 'Email routed from {from}', array('from' => $structure->headers['from']));
     }
     return true;
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:101,代码来源:class.routing.php

示例13: update

 /**
  * Method used to update the details of a given subscription.
  *
  * @access  public
  * @param   integer $sub_id The subscription ID
  * @return  integer 1 if the update worked, -1 otherwise
  */
 function update($sub_id)
 {
     global $HTTP_POST_VARS;
     $sub_id = Misc::escapeInteger($sub_id);
     $stmt = "SELECT\r\n                    sub_iss_id,\r\n                    sub_usr_id\r\n                 FROM\r\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "subscription\r\n                 WHERE\r\n                    sub_id={$sub_id}";
     list($issue_id, $usr_id) = $GLOBALS["db_api"]->dbh->getRow($stmt);
     $email = strtolower(Mail_API::getEmailAddress($HTTP_POST_VARS["email"]));
     $usr_id = User::getUserIDByEmail($email);
     if (!empty($usr_id)) {
         $email = '';
     } else {
         $usr_id = 0;
         $email = Misc::escapeString($HTTP_POST_VARS["email"]);
     }
     $prj_id = Issue::getProjectID($issue_id);
     // call workflow to modify actions or cancel adding this user.
     $actions = array();
     $subscriber_usr_id = false;
     $workflow = Workflow::handleSubscription($prj_id, $issue_id, $subscriber_usr_id, $email, $actions);
     if ($workflow === false) {
         // cancel subscribing the user
         return -2;
     }
     // always set the type of notification to issue-level
     $stmt = "UPDATE\r\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "subscription\r\n                 SET\r\n                    sub_level='issue',\r\n                    sub_email='" . Misc::escapeString($email) . "',\r\n                    sub_usr_id={$usr_id}\r\n                 WHERE\r\n                    sub_id={$sub_id}";
     $res = $GLOBALS["db_api"]->dbh->query($stmt);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return -1;
     } else {
         $stmt = "DELETE FROM\r\n                        " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "subscription_type\r\n                     WHERE\r\n                        sbt_sub_id={$sub_id}";
         $GLOBALS["db_api"]->dbh->query($stmt);
         // now add them all again
         for ($i = 0; $i < count($HTTP_POST_VARS["actions"]); $i++) {
             Notification::addType($sub_id, $HTTP_POST_VARS["actions"][$i]);
         }
         // need to mark the issue as updated
         Issue::markAsUpdated($issue_id);
         // need to save a history entry for this
         History::add($issue_id, Auth::getUserID(), History::getTypeID('notification_updated'), "Notification list entry ('" . Notification::getSubscriber($sub_id) . "') updated by " . User::getFullName(Auth::getUserID()));
         return 1;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:50,代码来源:class.notification.php

示例14: update

 /**
  * Method used to update an existing draft response.
  *
  * @param   integer $issue_id The issue ID
  * @param   integer $emd_id The email draft ID
  * @param   string $to The primary recipient of the draft
  * @param   string $cc The secondary recipients of the draft
  * @param   string $subject The subject of the draft
  * @param   string $message The draft body
  * @param   integer $parent_id The ID of the email that this draft is replying to, if any
  * @return  integer 1 if the update worked, -1 otherwise
  */
 public static function update($issue_id, $emd_id, $to, $cc, $subject, $message, $parent_id = null)
 {
     if (!$parent_id) {
         $parent_id = null;
     }
     $usr_id = Auth::getUserID();
     // update previous draft and insert new record
     $stmt = "UPDATE\n                    {{%email_draft}}\n                 SET\n                    emd_updated_date=?,\n                    emd_status = 'edited'\n                 WHERE\n                    emd_id=?";
     $params = array(Date_Helper::getCurrentDateGMT(), $emd_id);
     try {
         DB_Helper::getInstance()->query($stmt, $params);
     } catch (DbException $e) {
         return -1;
     }
     Issue::markAsUpdated($issue_id, 'draft saved');
     History::add($issue_id, $usr_id, 'draft_updated', 'Email message draft updated by {user}', array('user' => User::getFullName($usr_id)));
     self::saveEmail($issue_id, $to, $cc, $subject, $message, $parent_id, false, false);
     return 1;
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:class.draft.php

示例15: addCheckins

 /**
  * Method used to associate checkins to an existing issue
  *
  * @param   integer $issue_id The ID of the issue.
  * @param   string $commit_time Time when commit occurred (in UTC)
  * @param   string $scm_name SCM definition name in Eventum
  * @param   string $username SCM user doing the checkin.
  * @param   string $commit_msg Message associated with the SCM commit.
  * @param   array $files Files info with their version numbers changes made on.
  * @return  integer 1 if the update worked, -1 otherwise
  */
 public static function addCheckins($issue_id, $commit_time, $scm_name, $username, $commit_msg, $files)
 {
     // validate that $scm_name is valid
     // this will throw if invalid
     self::getScmCheckinByName($scm_name);
     // TODO: add workflow pre method first, so it may setup username, etc
     $usr_id = APP_SYSTEM_USER_ID;
     // workflow needs to know project_id to find out which workflow class to use.
     $prj_id = Issue::getProjectID($issue_id);
     foreach ($files as $file) {
         self::insertCheckin($issue_id, $commit_time, $scm_name, $file, $username, $commit_msg);
     }
     // need to mark this issue as updated
     Issue::markAsUpdated($issue_id, 'scm checkin');
     // need to save a history entry for this
     // TRANSLATORS: %1: scm username
     History::add($issue_id, $usr_id, 'scm_checkin_associated', "SCM Checkins associated by SCM user '{user}'", array('user' => $username));
     Workflow::handleSCMCheckins($prj_id, $issue_id, $files, $username, $commit_msg);
     return 1;
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:31,代码来源:class.scm.php


注:本文中的Issue::markAsUpdated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。