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


PHP Auth::getCurrentProject方法代码示例

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


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

示例1: add

 /**
  * Adds an email to the outgoing mail queue.
  *
  * @param   string $recipient The recipient of this email
  * @param   array $headers The list of headers that should be sent with this email
  * @param   string $body The body of the message
  * @param   integer $save_email_copy Whether to send a copy of this email to a configurable address or not (eventum_sent@)
  * @param   integer $issue_id The ID of the issue. If false, email will not be associated with issue.
  * @param   string $type The type of message this is.
  * @param   integer $sender_usr_id The id of the user sending this email.
  * @param   integer $type_id The ID of the event that triggered this notification (issue_id, sup_id, not_id, etc)
  * @return  true, or a PEAR_Error object
  */
 public static function add($recipient, $headers, $body, $save_email_copy = 0, $issue_id = false, $type = '', $sender_usr_id = false, $type_id = false)
 {
     Workflow::modifyMailQueue(Auth::getCurrentProject(false), $recipient, $headers, $body, $issue_id, $type, $sender_usr_id, $type_id);
     // avoid sending emails out to users with inactive status
     $recipient_email = Mail_Helper::getEmailAddress($recipient);
     $usr_id = User::getUserIDByEmail($recipient_email);
     if (!empty($usr_id)) {
         $user_status = User::getStatusByEmail($recipient_email);
         // if user is not set to an active status, then silently ignore
         if (!User::isActiveStatus($user_status) && !User::isPendingStatus($user_status)) {
             return false;
         }
     }
     $to_usr_id = User::getUserIDByEmail($recipient_email);
     $recipient = Mail_Helper::fixAddressQuoting($recipient);
     $reminder_addresses = Reminder::_getReminderAlertAddresses();
     // add specialized headers
     if (!empty($issue_id) && (!empty($to_usr_id) && User::getRoleByUser($to_usr_id, Issue::getProjectID($issue_id)) != User::getRoleID('Customer')) || @in_array(Mail_Helper::getEmailAddress($recipient), $reminder_addresses)) {
         $headers += Mail_Helper::getSpecializedHeaders($issue_id, $type, $headers, $sender_usr_id);
     }
     // try to prevent triggering absence auto responders
     $headers['precedence'] = 'bulk';
     // the 'classic' way, works with e.g. the unix 'vacation' tool
     $headers['Auto-submitted'] = 'auto-generated';
     // the RFC 3834 way
     if (empty($issue_id)) {
         $issue_id = 'null';
     }
     // if the Date: header is missing, add it.
     if (empty($headers['Date'])) {
         $headers['Date'] = Mime_Helper::encode(date('D, j M Y H:i:s O'));
     }
     if (!empty($headers['To'])) {
         $headers['To'] = Mail_Helper::fixAddressQuoting($headers['To']);
     }
     // encode headers and add special mime headers
     $headers = Mime_Helper::encodeHeaders($headers);
     $res = Mail_Helper::prepareHeaders($headers);
     if (Misc::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return $res;
     }
     // convert array of headers into text headers
     list(, $text_headers) = $res;
     $params = array('maq_save_copy' => $save_email_copy, 'maq_queued_date' => Date_Helper::getCurrentDateGMT(), 'maq_sender_ip_address' => !empty($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '', 'maq_recipient' => $recipient, 'maq_headers' => $text_headers, 'maq_body' => $body, 'maq_iss_id' => $issue_id, 'maq_subject' => $headers['Subject'], 'maq_type' => $type);
     if ($sender_usr_id) {
         $params['maq_usr_id'] = $sender_usr_id;
     }
     if ($type_id) {
         $params['maq_type_id'] = $type_id;
     }
     $stmt = 'INSERT INTO {{%mail_queue}} SET ' . DB_Helper::buildSet($params);
     try {
         DB_Helper::getInstance()->query($stmt, $params);
     } catch (DbException $e) {
         return $res;
     }
     return true;
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:72,代码来源:class.mail_queue.php

示例2: getIssueIDs

 public function getIssueIDs($options)
 {
     // Build the Sphinx client
     $this->sphinx->SetSortMode(SPH_SORT_RELEVANCE);
     //        $this->sphinx->SetWeights(array(1, 1));
     $this->sphinx->SetLimits(0, 500, 100000);
     $this->sphinx->SetArrayResult(true);
     if (empty($options['match_mode'])) {
         $options['match_mode'] = SPH_MATCH_ALL;
     }
     $this->sphinx->SetMatchMode($options['match_mode']);
     $this->sphinx->SetFilter('prj_id', array(Auth::getCurrentProject()));
     // TODO: Add support for selecting indexes to search
     $indexes = implode('; ', $this->getIndexes(Auth::getCurrentRole() > User::ROLE_CUSTOMER));
     if (isset($options['customer_id']) && !empty($options['customer_id'])) {
         $this->sphinx->SetFilter('customer_id', array($options['customer_id']));
     }
     $this->keywords = $options['keywords'];
     $this->match_mode = $options['match_mode'];
     $res = $this->sphinx->Query($options['keywords'], $indexes);
     // TODO: report these somehow back to the UI
     // probably easy to do with Logger framework (add new handler?)
     if (method_exists($this->sphinx, 'IsConnectError') && $this->sphinx->IsConnectError()) {
         Logger::app()->error('sphinx_fulltext_search: Network Error');
     }
     if ($this->sphinx->GetLastWarning()) {
         Logger::app()->warning('sphinx_fulltext_search: ' . $this->sphinx->GetLastWarning());
     }
     if ($this->sphinx->GetLastError()) {
         Logger::app()->error('sphinx_fulltext_search: ' . $this->sphinx->GetLastError());
     }
     $issue_ids = array();
     if (isset($res['matches'])) {
         foreach ($res['matches'] as $match_details) {
             // Variable translation
             $match_id = $match_details['id'];
             $issue_id = $match_details['attrs']['issue_id'];
             $weight = $match_details['weight'];
             $index_id = $match_details['attrs']['index_id'];
             // if sphinx returns 0 as a weight, make it one because it
             // did find a match in the result set
             if ($weight <= 0) {
                 $weight = 1;
             }
             $index_name = $this->getIndexNameByID($index_id);
             $this->matches[$issue_id][] = array('weight' => $weight, 'index' => $index_name, 'match_id' => $match_id);
             $issue_ids[] = $issue_id;
         }
     }
     return $issue_ids;
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:51,代码来源:class.sphinx_fulltext_search.php

示例3: getListBySupportLevel

 /**
  * Returns the list of FAQ entries associated to a given support level.
  *
  * @param   array $support_level_ids The support level IDs
  * @return  array The list of FAQ entries
  */
 public static function getListBySupportLevel($support_level_ids)
 {
     if (!is_array($support_level_ids)) {
         $support_level_ids = array($support_level_ids);
     }
     $prj_id = Auth::getCurrentProject();
     if (count($support_level_ids) == 0) {
         $stmt = 'SELECT
                     *
                  FROM
                     {{%faq}}
                  WHERE
                     faq_prj_id = ?
                  ORDER BY
                     faq_rank ASC';
         $params = array($prj_id);
     } else {
         $stmt = 'SELECT
                     *
                  FROM
                     {{%faq}},
                     {{%faq_support_level}}
                  WHERE
                     faq_id=fsl_faq_id AND
                     fsl_support_level_id IN (' . DB_Helper::buildList($support_level_ids) . ') AND
                     faq_prj_id = ?
                  GROUP BY
                     faq_id
                  ORDER BY
                     faq_rank ASC';
         $params = $support_level_ids;
         $params[] = $prj_id;
     }
     try {
         $res = DB_Helper::getInstance()->getAll($stmt, $params);
     } catch (DbException $e) {
         return '';
     }
     foreach ($res as &$row) {
         if (empty($row['faq_updated_date'])) {
             $row['faq_updated_date'] = $row['faq_created_date'];
         }
         $row['faq_updated_date'] = Date_Helper::getSimpleDate($row['faq_updated_date']);
     }
     return $res;
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:52,代码来源:class.faq.php

示例4: __construct

 public function __construct()
 {
     $this->usr_id = Auth::getUserID();
     if (!Access::canAccessReports($this->usr_id)) {
         throw new LogicException('Invalid role');
     }
     $this->prj_id = Auth::getCurrentProject();
     $this->activity_types = !empty($_REQUEST['activity_types']) ? (array) $_REQUEST['activity_types'] : array();
     $this->report_type = isset($_REQUEST['report_type']) ? (string) $_REQUEST['report_type'] : null;
     $this->unit = $this->getParam('unit', array('hour', 'day'));
     $this->amount = isset($_REQUEST['amount']) ? $_REQUEST['amount'] : null;
     $this->developer = isset($_REQUEST['developer']) ? $_REQUEST['developer'] : null;
     $this->start_date = $this->parseDate(isset($_POST['start']) ? $_POST['start'] : null);
     $this->end_date = $this->parseDate(isset($_POST['end']) ? $_POST['end'] : null);
     $this->sort_order = $this->getParam('sort_order', array('ASC', 'DESC'));
     if (CRM::hasCustomerIntegration($this->prj_id)) {
         $this->crm = CRM::getInstance($this->prj_id);
     }
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:19,代码来源:RecentActivity.php

示例5: getListBySupportLevel

 /**
  * Returns the list of FAQ entries associated to a given support level.
  *
  * @access  public
  * @param   integer $support_level_id The support level ID
  * @return  array The list of FAQ entries
  */
 function getListBySupportLevel($support_level_id)
 {
     $support_level_id = Misc::escapeInteger($support_level_id);
     $prj_id = Auth::getCurrentProject();
     if ($support_level_id == -1) {
         $stmt = "SELECT\n                        *\n                     FROM\n                        " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "faq\n                     WHERE\n                        faq_prj_id = {$prj_id}\n                     ORDER BY\n                        faq_rank ASC";
     } else {
         $stmt = "SELECT\n                        *\n                     FROM\n                        " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "faq,\n                        " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "faq_support_level\n                     WHERE\n                        faq_id=fsl_faq_id AND\n                        fsl_support_level_id={$support_level_id} AND\n                        faq_prj_id = {$prj_id}\n                     ORDER BY\n                        faq_rank ASC";
     }
     $res = $GLOBALS["db_api"]->dbh->getAll($stmt, DB_FETCHMODE_ASSOC);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return "";
     } else {
         for ($i = 0; $i < count($res); $i++) {
             if (empty($res[$i]['faq_updated_date'])) {
                 $res[$i]['faq_updated_date'] = $res[$i]['faq_created_date'];
             }
             $res[$i]['faq_updated_date'] = Date_API::getSimpleDate($res[$i]["faq_updated_date"]);
         }
         return $res;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:30,代码来源:class.faq.php

示例6: getWorkloadByDateRange

 /**
  * Returns workload information for the specified date range and interval.
  *
  * @param   string $interval The interval to use in this report.
  * @param   string $type If this report is aggregate or individual
  * @param   string $start The start date of this report.
  * @param   string $end The end date of this report.
  * @param   integer $category_id The category to restrict this report to
  * @return  array An array containing workload data.
  */
 public static function getWorkloadByDateRange($interval, $type, $start, $end, $category_id)
 {
     $data = array();
     $category_id = (int) $category_id;
     // figure out the correct format code
     switch ($interval) {
         case 'day':
             $format = '%m/%d/%y';
             $order_by = "%1\$s";
             break;
         case 'dow':
             $format = '%W';
             $order_by = "CASE WHEN DATE_FORMAT(%1\$s, '%%w') = 0 THEN 7 ELSE DATE_FORMAT(%1\$s, '%%w') END";
             break;
         case 'week':
             if ($type == 'aggregate') {
                 $format = '%v';
             } else {
                 $format = '%v/%y';
             }
             $order_by = "%1\$s";
             break;
         case 'dom':
             $format = '%d';
             break;
         case 'month':
             if ($type == 'aggregate') {
                 $format = '%b';
                 $order_by = "DATE_FORMAT(%1\$s, '%%m')";
             } else {
                 $format = '%b/%y';
                 $order_by = "%1\$s";
             }
             break;
         default:
             throw new LogicException('Invalid interval');
     }
     // get issue counts
     $stmt = 'SELECT
                 DATE_FORMAT(iss_created_date, ?),
                 count(*)
              FROM
                 {{%issue}}
              WHERE
                 iss_prj_id=? AND
                 iss_created_date BETWEEN ? AND ?';
     $params = array($format, Auth::getCurrentProject(), $start, $end);
     if (!empty($category_id)) {
         $stmt .= ' AND
                 iss_prc_id = ?';
         $params[] = $category_id;
     }
     $stmt .= '
              GROUP BY
                 DATE_FORMAT(iss_created_date, ?)';
     $params[] = $format;
     if (!empty($order_by)) {
         $stmt .= "\nORDER BY " . sprintf($order_by, 'iss_created_date');
     }
     try {
         $res = DB_Helper::getInstance()->fetchAssoc($stmt, $params);
     } catch (DbException $e) {
         return array();
     }
     $data['issues']['points'] = $res;
     $data['issues']['stats'] = array('total' => 0, 'avg' => 0, 'median' => 0, 'max' => 0);
     if ($res) {
         $stats = new Math_Stats();
         $stats->setData($res);
         $data['issues']['stats'] = array('total' => $stats->sum(), 'avg' => $stats->mean(), 'median' => $stats->median(), 'max' => $stats->max());
     }
     // get email counts
     $params = array();
     $stmt = 'SELECT
                 DATE_FORMAT(sup_date, ?),
                 count(*)
              FROM
                 {{%support_email}},
                 {{%email_account}}';
     $params[] = $format;
     if (!empty($category_id)) {
         $stmt .= ',
                  {{%issue}}';
     }
     $stmt .= '
              WHERE
                 sup_ema_id=ema_id AND
                 ema_prj_id=? AND
                 sup_date BETWEEN ? AND ?';
     $params[] = Auth::getCurrentProject();
//.........这里部分代码省略.........
开发者ID:korusdipl,项目名称:eventum,代码行数:101,代码来源:class.report.php

示例7: getCountByUser

 /**
  * Returns the number of notes by a user in a time range.
  *
  * @param   string $usr_id The ID of the user
  * @param   integer $start The timestamp of the start date
  * @param   integer $end The timestanp of the end date
  * @return  integer The number of notes by the user
  */
 public static function getCountByUser($usr_id, $start, $end)
 {
     $stmt = 'SELECT
                 COUNT(not_id)
              FROM
                 {{%note}},
                 {{%issue}}
              WHERE
                 not_iss_id = iss_id AND
                 iss_prj_id = ? AND
                 not_created_date BETWEEN ? AND ? AND
                 not_usr_id = ? AND
                 not_removed = 0';
     $params = array(Auth::getCurrentProject(), $start, $end, $usr_id);
     try {
         $res = DB_Helper::getInstance()->getOne($stmt, $params);
     } catch (DbException $e) {
         return '';
     }
     return $res;
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:29,代码来源:class.note.php

示例8: formatValue

 /**
  * Formats the return value
  *
  * @param   mixed   $value The value to format
  * @param   integer $fld_id The ID of the field
  * @param   integer $issue_id The ID of the issue
  * @return  mixed   the formatted value.
  */
 public function formatValue($value, $fld_id, $issue_id)
 {
     $backend = self::getBackend($fld_id);
     if (is_object($backend) && method_exists($backend, 'formatValue')) {
         return $backend->formatValue($value, $fld_id, $issue_id);
     } else {
         return Link_Filter::processText(Auth::getCurrentProject(), Misc::htmlentities($value));
     }
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:17,代码来源:class.custom_field.php

示例9: Template_Helper

 * that were distributed with this source code.
 */
require_once __DIR__ . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('manage/products.tpl.html');
Auth::checkAuthentication();
$role_id = Auth::getCurrentRole();
if ($role_id < User::ROLE_MANAGER) {
    Misc::setMessage('Sorry, you are not allowed to access this page.', Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
if (@$_POST['cat'] == 'new') {
    $res = Product::insert($_POST['title'], $_POST['version_howto'], $_POST['rank'], @$_POST['removed'], @$_POST['email']);
    Misc::mapMessages($res, array(1 => array('Thank you, the product was added successfully.', Misc::MSG_INFO), -1 => array('An error occurred while trying to add the product.', Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'update') {
    $res = Product::update($_POST['id'], $_POST['title'], $_POST['version_howto'], $_POST['rank'], @$_POST['removed'], @$_POST['email']);
    Misc::mapMessages($res, array(1 => array('Thank you, the product was updated successfully.', Misc::MSG_INFO), -1 => array('An error occurred while trying to update the product.', Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'delete') {
    Product::remove($_POST['items']);
}
if (@$_GET['cat'] == 'edit') {
    $info = Product::getDetails($_GET['id']);
    $tpl->assign('info', $info);
    $user_options = User::getActiveAssocList(Auth::getCurrentProject(), User::ROLE_CUSTOMER, false, $_GET['id']);
} else {
    $user_options = User::getActiveAssocList(Auth::getCurrentProject(), User::ROLE_CUSTOMER, true);
}
$tpl->assign('list', Product::getList());
$tpl->assign('project_list', Project::getAll());
$tpl->displayTemplate();
开发者ID:dabielkabuto,项目名称:eventum,代码行数:31,代码来源:products.php

示例10: buildWhereClause

 /**
  * Method used to get the list of issues to be displayed in the grid layout.
  *
  * @param   array $options The search parameters
  * @return  string The where clause
  */
 public static function buildWhereClause($options)
 {
     $usr_id = Auth::getUserID();
     $prj_id = Auth::getCurrentProject();
     $role_id = User::getRoleByUser($usr_id, $prj_id);
     $usr_details = User::getDetails($usr_id);
     $stmt = ' AND iss_usr_id = usr_id';
     if ($role_id == User::getRoleID('Customer')) {
         $crm = CRM::getInstance($prj_id);
         $contact = $crm->getContact($usr_details['usr_customer_contact_id']);
         $stmt .= " AND iss_customer_contract_id IN('" . implode("','", $contact->getContractIDS()) . "')";
         $stmt .= " AND iss_customer_id ='" . Auth::getCurrentCustomerID() . "'";
     } elseif ($role_id == User::getRoleID('Reporter') && Project::getSegregateReporters($prj_id)) {
         $stmt .= " AND (\n                        iss_usr_id = {$usr_id} OR\n                        iur_usr_id = {$usr_id}\n                        )";
     }
     if (!empty($usr_details['usr_par_code'])) {
         // restrict partners
         $stmt .= " AND ipa_par_code = '" . Misc::escapeString($usr_details['usr_par_code']) . "'";
     }
     if (!empty($options['users'])) {
         $stmt .= " AND (\n";
         if (stristr($options['users'], 'grp') !== false) {
             $chunks = explode(':', $options['users']);
             $stmt .= 'iss_grp_id = ' . Misc::escapeInteger($chunks[1]);
         } else {
             if ($options['users'] == '-1') {
                 $stmt .= 'isu_usr_id IS NULL';
             } elseif ($options['users'] == '-2') {
                 $stmt .= 'isu_usr_id IS NULL OR isu_usr_id=' . $usr_id;
             } elseif ($options['users'] == '-3') {
                 $stmt .= 'isu_usr_id = ' . $usr_id . ' OR iss_grp_id = ' . User::getGroupID($usr_id);
             } elseif ($options['users'] == '-4') {
                 $stmt .= 'isu_usr_id IS NULL OR isu_usr_id = ' . $usr_id . ' OR iss_grp_id = ' . User::getGroupID($usr_id);
             } else {
                 $stmt .= 'isu_usr_id =' . Misc::escapeInteger($options['users']);
             }
         }
         $stmt .= ')';
     }
     if (!empty($options['reporter'])) {
         $stmt .= ' AND iss_usr_id = ' . Misc::escapeInteger($options['reporter']);
     }
     if (!empty($options['show_authorized_issues'])) {
         $stmt .= " AND (iur_usr_id={$usr_id})";
     }
     if (!empty($options['show_notification_list_issues'])) {
         $stmt .= " AND (sub_usr_id={$usr_id})";
     }
     if (!empty($options['keywords'])) {
         $stmt .= " AND (\n";
         if ($options['search_type'] == 'all_text' && APP_ENABLE_FULLTEXT) {
             $stmt .= 'iss_id IN(' . implode(', ', self::getFullTextIssues($options)) . ')';
         } elseif ($options['search_type'] == 'customer' && CRM::hasCustomerIntegration($prj_id)) {
             // check if the user is trying to search by customer name / email
             $crm = CRM::getInstance($prj_id);
             $customer_ids = $crm->getCustomerIDsByString($options['keywords'], true);
             if (count($customer_ids) > 0) {
                 $stmt .= ' iss_customer_id IN (' . implode(', ', $customer_ids) . ')';
             } else {
                 // no results, kill query
                 $stmt .= ' iss_customer_id = -1';
             }
         } else {
             $stmt .= '(' . Misc::prepareBooleanSearch('iss_summary', $options['keywords']);
             $stmt .= ' OR ' . Misc::prepareBooleanSearch('iss_description', $options['keywords']) . ')';
         }
         $stmt .= "\n) ";
     }
     if (!empty($options['customer_id'])) {
         $stmt .= " AND iss_customer_id='" . Misc::escapeString($options['customer_id']) . "'";
     }
     if (!empty($options['priority'])) {
         $stmt .= ' AND iss_pri_id=' . Misc::escapeInteger($options['priority']);
     }
     if (!empty($options['status'])) {
         $stmt .= ' AND iss_sta_id=' . Misc::escapeInteger($options['status']);
     }
     if (!empty($options['category'])) {
         if (!is_array($options['category'])) {
             $options['category'] = array($options['category']);
         }
         $stmt .= ' AND iss_prc_id IN(' . implode(', ', Misc::escapeInteger($options['category'])) . ')';
     }
     if (!empty($options['hide_closed'])) {
         $stmt .= ' AND sta_is_closed=0';
     }
     if (!empty($options['release'])) {
         $stmt .= ' AND iss_pre_id = ' . Misc::escapeInteger($options['release']);
     }
     if (!empty($options['product'])) {
         $stmt .= ' AND ipv_pro_id = ' . Misc::escapeInteger($options['product']);
     }
     // now for the date fields
     $date_fields = array('created_date', 'updated_date', 'last_response_date', 'first_response_date', 'closed_date');
//.........这里部分代码省略.........
开发者ID:korusdipl,项目名称:eventum,代码行数:101,代码来源:class.search.php

示例11: dirname

// | Authors: João Prado Maia <jpm@mysql.com>                             |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('emails.tpl.html');
Auth::checkAuthentication(APP_COOKIE);
if (!Access::canAccessAssociateEmails(Auth::getUserID())) {
    $tpl->assign('no_access', 1);
    $tpl->displayTemplate();
    exit;
}
$pagerRow = Support::getParam('pagerRow');
if (empty($pagerRow)) {
    $pagerRow = 0;
}
$rows = Support::getParam('rows');
if (empty($rows)) {
    $rows = APP_DEFAULT_PAGER_SIZE;
}
$options = Support::saveSearchParams();
$tpl->assign('options', $options);
$tpl->assign('sorting', Support::getSortingInfo($options));
$list = Support::getEmailListing($options, $pagerRow, $rows);
$tpl->assign('list', $list['list']);
$tpl->assign('list_info', $list['info']);
$tpl->assign('issues', Issue::getColList());
$tpl->assign('accounts', Email_Account::getAssocList(Auth::getCurrentProject()));
$prefs = Prefs::get(Auth::getUserID());
$tpl->assign('refresh_rate', $prefs['email_refresh_rate'] * 60);
$tpl->assign('refresh_page', 'emails.php');
$tpl->displayTemplate();
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:emails.php

示例12: getCurrentRole

 /**
  * Gets the current role in the current project.
  *
  * @access  public
  * @return  integer The current role ID
  */
 function getCurrentRole()
 {
     $usr_id = Auth::getUserID();
     if (!$usr_id) {
         return 1;
     }
     $prj_id = Auth::getCurrentProject();
     if (!empty($prj_id) && !empty($usr_id)) {
         return User::getRoleByUser($usr_id, $prj_id);
     } else {
         return 1;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:19,代码来源:class.auth.php

示例13: getFiltersInfo

 /**
  * Returns an array of information about all the different filter fields.
  *
  * @return  array an array of information.
  */
 public static function getFiltersInfo()
 {
     // format is "name_of_db_field" => array(
     //      "title" => human readable title,
     //      "param" => name that appears in get, post or cookie
     $fields = array('iss_pri_id' => array('title' => ev_gettext('Priority'), 'param' => 'priority', 'quickfilter' => true), 'iss_sev_id' => array('title' => ev_gettext('Severity'), 'param' => 'severity', 'quickfilter' => true), 'keywords' => array('title' => ev_gettext('Keyword(s)'), 'param' => 'keywords', 'quickfilter' => true), 'users' => array('title' => ev_gettext('Assigned'), 'param' => 'users', 'quickfilter' => true), 'iss_prc_id' => array('title' => ev_gettext('Category'), 'param' => 'category', 'quickfilter' => true), 'iss_sta_id' => array('title' => ev_gettext('Status'), 'param' => 'status', 'quickfilter' => true), 'iss_pre_id' => array('title' => ev_gettext('Release'), 'param' => 'release'), 'created_date' => array('title' => ev_gettext('Created Date'), 'param' => 'created_date', 'is_date' => true), 'updated_date' => array('title' => ev_gettext('Updated Date'), 'param' => 'updated_date', 'is_date' => true), 'last_response_date' => array('title' => ev_gettext('Last Response Date'), 'param' => 'last_response_date', 'is_date' => true), 'first_response_date' => array('title' => ev_gettext('First Response Date'), 'param' => 'first_response_date', 'is_date' => true), 'closed_date' => array('title' => ev_gettext('Closed Date'), 'param' => 'closed_date', 'is_date' => true), 'rows' => array('title' => ev_gettext('Rows Per Page'), 'param' => 'rows'), 'sort_by' => array('title' => ev_gettext('Sort By'), 'param' => 'sort_by'), 'sort_order' => array('title' => ev_gettext('Sort Order'), 'param' => 'sort_order'), 'hide_closed' => array('title' => ev_gettext('Hide Closed Issues'), 'param' => 'hide_closed'), 'show_authorized' => array('title' => ev_gettext('Authorized to Send Emails'), 'param' => 'show_authorized_issues'), 'show_notification_list' => array('title' => ev_gettext('In Notification List'), 'param' => 'show_notification_list_issues'), 'search_type' => array('title' => ev_gettext('Search Type'), 'param' => 'search_type'), 'reporter' => array('title' => ev_gettext('Reporter'), 'param' => 'reporter'), 'customer_id' => array('title' => ev_gettext('Customer'), 'param' => 'customer_id'), 'pro_id' => array('title' => ev_gettext('Product'), 'param' => 'product'));
     // add custom fields
     $custom_fields = Custom_Field::getFieldsByProject(Auth::getCurrentProject());
     if (count($custom_fields) > 0) {
         foreach ($custom_fields as $fld_id) {
             $field = Custom_Field::getDetails($fld_id);
             $fields['custom_field_' . $fld_id] = array('title' => $field['fld_title'], 'is_custom' => 1, 'fld_id' => $fld_id, 'fld_type' => $field['fld_type']);
         }
     }
     return $fields;
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:21,代码来源:class.filter.php

示例14: processTemplate

 /**
  * Processes the template and assigns common variables automatically.
  * 
  * @access	private
  */
 function processTemplate()
 {
     global $HTTP_SERVER_VARS;
     // determine the correct CSS file to use
     if (ereg('MSIE ([0-9].[0-9]{1,2})', @$HTTP_SERVER_VARS["HTTP_USER_AGENT"], $log_version)) {
         $user_agent = 'ie';
     } else {
         $user_agent = 'other';
     }
     $this->assign("user_agent", $user_agent);
     // create the list of projects
     $usr_id = Auth::getUserID();
     if ($usr_id != '') {
         $prj_id = Auth::getCurrentProject();
         if (!empty($prj_id)) {
             $role_id = User::getRoleByUser($usr_id, $prj_id);
             $this->assign("current_project", $prj_id);
             $this->assign("current_project_name", Auth::getCurrentProjectName());
             $has_customer_integration = Customer::hasCustomerIntegration($prj_id);
             $this->assign("has_customer_integration", $has_customer_integration);
             if ($has_customer_integration) {
                 $this->assign("customer_backend_name", Customer::getBackendImplementationName($prj_id));
             }
             if ($role_id == User::getRoleID('administrator') || $role_id == User::getRoleID('manager')) {
                 $this->assign("show_admin_link", true);
             }
             if ($role_id > 0) {
                 $this->assign("current_role", (int) $role_id);
                 $this->assign("current_role_name", User::getRole($role_id));
             }
         }
         $info = User::getNameEmail($usr_id);
         $this->assign("active_projects", Project::getAssocList($usr_id));
         $this->assign("current_full_name", $info["usr_full_name"]);
         $this->assign("current_email", $info["usr_email"]);
         $this->assign("current_user_id", $usr_id);
         $this->assign("is_current_user_clocked_in", User::isClockedIn($usr_id));
         $this->assign("roles", User::getAssocRoleIDs());
     }
     $this->assign("app_setup", Setup::load());
     $this->assign("app_setup_path", APP_SETUP_PATH);
     $this->assign("app_setup_file", APP_SETUP_FILE);
     $this->assign("application_version", APP_VERSION);
     $this->assign("application_title", APP_NAME);
     $this->assign("app_base_url", APP_BASE_URL);
     $this->assign("rel_url", APP_RELATIVE_URL);
     $this->assign("lang", APP_CURRENT_LANG);
     $this->assign("SID", SID);
     // now for the browser detection stuff
     Net_UserAgent_Detect::detect();
     $this->assign("browser", Net_UserAgent_Detect::_getStaticProperty('browser'));
     $this->assign("os", Net_UserAgent_Detect::_getStaticProperty('os'));
     // this is only used by the textarea resize script
     $js_script_name = str_replace('/', '_', str_replace('.php', '', $HTTP_SERVER_VARS['PHP_SELF']));
     $this->assign("js_script_name", $js_script_name);
     $this->assign("total_queries", $GLOBALS['TOTAL_QUERIES']);
     $this->assign(array("cell_color" => APP_CELL_COLOR, "light_color" => APP_LIGHT_COLOR, "middle_color" => APP_MIDDLE_COLOR, "dark_color" => APP_DARK_COLOR, "cycle" => APP_CYCLE_COLORS, "internal_color" => APP_INTERNAL_COLOR));
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:63,代码来源:class.template.php

示例15: sendEmail

 /**
  * Method used to send an email from the user interface.
  *
  * @access  public
  * @return  integer 1 if it worked, -1 otherwise
  */
 function sendEmail($parent_sup_id = FALSE)
 {
     global $HTTP_POST_VARS, $HTTP_SERVER_VARS;
     // if we are replying to an existing email, set the In-Reply-To: header accordingly
     if ($parent_sup_id) {
         $in_reply_to = Support::getMessageIDByID($parent_sup_id);
     } else {
         $in_reply_to = false;
     }
     // get ID of whoever is sending this.
     $sender_usr_id = User::getUserIDByEmail(Mail_API::getEmailAddress($HTTP_POST_VARS["from"]));
     if (empty($sender_usr_id)) {
         $sender_usr_id = false;
     }
     // get type of email this is
     if (!empty($HTTP_POST_VARS['type'])) {
         $type = $HTTP_POST_VARS['type'];
     } else {
         $type = '';
     }
     // remove extra 'Re: ' from subject
     $HTTP_POST_VARS['subject'] = Mail_API::removeExcessRe($HTTP_POST_VARS['subject'], true);
     $internal_only = false;
     $message_id = Mail_API::generateMessageID();
     // hack needed to get the full headers of this web-based email
     $full_email = Support::buildFullHeaders($HTTP_POST_VARS["issue_id"], $message_id, $HTTP_POST_VARS["from"], $HTTP_POST_VARS["to"], $HTTP_POST_VARS["cc"], $HTTP_POST_VARS["subject"], $HTTP_POST_VARS["message"], $in_reply_to);
     // email blocking should only be done if this is an email about an associated issue
     if (!empty($HTTP_POST_VARS['issue_id'])) {
         $user_info = User::getNameEmail(Auth::getUserID());
         // check whether the current user is allowed to send this email to customers or not
         if (!Support::isAllowedToEmail($HTTP_POST_VARS["issue_id"], $user_info['usr_email'])) {
             // add the message body as a note
             $HTTP_POST_VARS['blocked_msg'] = $full_email;
             $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
//.........这里部分代码省略.........
开发者ID:juliogallardo1326,项目名称:proc,代码行数:101,代码来源:class.support.php


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