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


PHP Customer::doesBackendUseSupportLevels方法代码示例

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


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

示例1: getList

 /**
  * Method used to get the list of FAQ entries available in the system.
  *
  * @access  public
  * @return  array The list of news entries
  */
 function getList()
 {
     $stmt = "SELECT\n                    faq_id,\n                    faq_prj_id,\n                    faq_title,\n                    faq_rank\n                 FROM\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "faq\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 {
         // get the list of associated support levels
         for ($i = 0; $i < count($res); $i++) {
             if (Customer::doesBackendUseSupportLevels($res[$i]['faq_prj_id'])) {
                 $res[$i]['support_levels'] = implode(", ", array_values(FAQ::getAssociatedSupportLevels($res[$i]['faq_prj_id'], $res[$i]['faq_id'])));
             }
         }
         return $res;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:23,代码来源:class.faq.php

示例2: elseif

        $tpl->assign("result", FAQ::update());
    } elseif (@$HTTP_POST_VARS["cat"] == "delete") {
        FAQ::remove();
    } elseif (!empty($HTTP_GET_VARS['prj_id'])) {
        $tpl->assign("info", array('faq_prj_id' => $HTTP_GET_VARS['prj_id']));
        $backend_uses_support_levels = Customer::doesBackendUseSupportLevels($HTTP_GET_VARS['prj_id']);
        $tpl->assign("backend_uses_support_levels", $backend_uses_support_levels);
        if ($backend_uses_support_levels) {
            $tpl->assign("support_levels", Customer::getSupportLevelAssocList($HTTP_GET_VARS['prj_id']));
        }
    }
    if (@$HTTP_GET_VARS["cat"] == "edit") {
        $info = FAQ::getDetails($HTTP_GET_VARS["id"]);
        if (!empty($HTTP_GET_VARS['prj_id'])) {
            $info['faq_prj_id'] = $HTTP_GET_VARS['prj_id'];
        }
        $backend_uses_support_levels = Customer::doesBackendUseSupportLevels($info['faq_prj_id']);
        $tpl->assign("backend_uses_support_levels", $backend_uses_support_levels);
        if ($backend_uses_support_levels) {
            $tpl->assign("support_levels", Customer::getSupportLevelAssocList($info['faq_prj_id']));
        }
        $tpl->assign("info", $info);
    } elseif (@$HTTP_GET_VARS["cat"] == "change_rank") {
        FAQ::changeRank($HTTP_GET_VARS['id'], $HTTP_GET_VARS['rank']);
    }
    $tpl->assign("list", FAQ::getList());
    $tpl->assign("project_list", Project::getAll());
} else {
    $tpl->assign("show_not_allowed_msg", true);
}
$tpl->displayTemplate();
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:faq.php

示例3: Template_API

include_once "config.inc.php";
include_once APP_INC_PATH . "db_access.php";
include_once APP_INC_PATH . "class.template.php";
include_once APP_INC_PATH . "class.auth.php";
include_once APP_INC_PATH . "class.faq.php";
include_once APP_INC_PATH . "class.customer.php";
$tpl = new Template_API();
$tpl->setTemplate("faq.tpl.html");
Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true);
$usr_id = Auth::getUserID();
$prj_id = Auth::getCurrentProject();
if (!Customer::hasCustomerIntegration($prj_id)) {
    // show all FAQ entries
    $support_level_id = -1;
} else {
    if (!Customer::doesBackendUseSupportLevels($prj_id)) {
        // show all FAQ entries
        $support_level_id = -1;
    } else {
        if (Auth::getCurrentRole() != User::getRoleID('Customer')) {
            // show all FAQ entries
            $support_level_id = -1;
        } else {
            $customer_id = User::getCustomerID(Auth::getUserID());
            $support_level_id = Customer::getSupportLevelID($prj_id, $customer_id);
        }
    }
}
$tpl->assign("faqs", FAQ::getListBySupportLevel($support_level_id));
if (!empty($HTTP_GET_VARS["id"])) {
    $t = FAQ::getDetails($HTTP_GET_VARS['id']);
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:faq.php

示例4: array_flip

        $priorities = array_flip(Priority::getAssocList($info['rem_prj_id']));
        unset($priorities['Not Prioritized']);
        $tpl->assign("priorities", array_flip($priorities));
    } elseif (@$HTTP_GET_VARS["cat"] == "change_rank") {
        Reminder::changeRank($HTTP_GET_VARS['id'], $HTTP_GET_VARS['rank']);
    } elseif (!empty($HTTP_GET_VARS['prj_id'])) {
        $tpl->assign("info", array('rem_prj_id' => $HTTP_GET_VARS['prj_id']));
        $tpl->assign('issues', Reminder::getIssueAssocListByProject($HTTP_GET_VARS['prj_id']));
        // wouldn't make much sense to create a reminder for a 'Not Prioritized'
        // issue, so let's remove that as an option
        $priorities = array_flip(Priority::getAssocList($HTTP_GET_VARS['prj_id']));
        unset($priorities['Not Prioritized']);
        $tpl->assign("priorities", array_flip($priorities));
        // only show customers and support levels if the selected project really needs it
        $project_has_customer_integration = Customer::hasCustomerIntegration($HTTP_GET_VARS['prj_id']);
        $tpl->assign("project_has_customer_integration", $project_has_customer_integration);
        if ($project_has_customer_integration) {
            $tpl->assign("customers", Customer::getAssocList($HTTP_GET_VARS['prj_id']));
            $backend_uses_support_levels = Customer::doesBackendUseSupportLevels($HTTP_GET_VARS['prj_id']);
            if ($backend_uses_support_levels) {
                $tpl->assign("support_levels", Customer::getSupportLevelAssocList($HTTP_GET_VARS['prj_id']));
            }
            $tpl->assign("backend_uses_support_levels", $backend_uses_support_levels);
        }
    }
    $tpl->assign("project_list", Project::getAll());
    $tpl->assign("list", Reminder::getAdminList());
} else {
    $tpl->assign("show_not_allowed_msg", true);
}
$tpl->displayTemplate();
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:reminders.php

示例5: getWhereClause

 /**
  * Method used to generate a where clause from the given list of conditions.
  *
  * @access  public
  * @param   array $reminder An array of reminder info.
  * @param   array $conditions The list of conditions
  * @return  string The where clause
  */
 function getWhereClause($reminder, $conditions)
 {
     $stmt = '
               WHERE
                 iss_prj_id=' . $reminder['rem_prj_id'] . "\n";
     $requirement = Reminder::getRequirements($reminder['rem_id']);
     if ($requirement['type'] == 'issue') {
         $stmt .= ' AND iss_id IN (' . implode(', ', $requirement['values']) . ")\n";
     } else {
         if (Customer::hasCustomerIntegration($reminder['rem_prj_id'])) {
             if ($requirement['type'] == 'customer') {
                 $stmt .= ' AND iss_customer_id IN (' . implode(', ', $requirement['values']) . ")\n";
             } elseif ($requirement['type'] == 'support_level') {
                 if (Customer::doesBackendUseSupportLevels($reminder['rem_prj_id'])) {
                     $customer_ids = Customer::getListBySupportLevel($reminder['rem_prj_id'], $requirement['values'], CUSTOMER_EXCLUDE_EXPIRED);
                     // break the query on purpose if no customers could be found
                     if (count($customer_ids) == 0) {
                         $customer_ids = array(-1);
                     }
                     $stmt .= ' AND iss_customer_id IN (' . implode(', ', $customer_ids) . ")\n";
                 }
             }
         }
     }
     $priorities = Reminder::getAssociatedPriorities($reminder['rem_id']);
     if (count($priorities) > 0) {
         $stmt .= ' AND iss_pri_id IN (' . implode(', ', $priorities) . ")\n";
     }
     // now for the interesting stuff
     for ($i = 0; $i < count($conditions); $i++) {
         // check for fields that compare to other fields
         if (!empty($conditions[$i]['rlc_comparison_rmf_id'])) {
             $sql_field = Reminder_Condition::getSQLField($conditions[$i]['rlc_comparison_rmf_id']);
             $stmt .= sprintf(" AND %s %s %s\n", $conditions[$i]['rmf_sql_field'], $conditions[$i]['rmo_sql_representation'], $sql_field);
         } else {
             // date field values are always saved as number of hours, so let's calculate them now as seconds
             if (stristr($conditions[$i]['rmf_title'], 'date')) {
                 // support NULL as values for a date field
                 if (strtoupper($conditions[$i]['rlc_value']) == 'NULL') {
                     $conditions[$i]['rmf_sql_representation'] = $conditions[$i]['rmf_sql_field'];
                 } else {
                     $conditions[$i]['rlc_value'] = $conditions[$i]['rlc_value'] * 60 * 60;
                     if (@$reminder["rem_skip_weekend"] == 1) {
                         $sql_field = Reminder_Condition::getSQLField($conditions[$i]['rlc_rmf_id']);
                         $conditions[$i]['rmf_sql_representation'] = DB_API::getNoWeekendDateDiffSQL($sql_field);
                     }
                 }
             }
             $stmt .= sprintf(" AND %s %s %s\n", $conditions[$i]['rmf_sql_representation'], $conditions[$i]['rmo_sql_representation'], $conditions[$i]['rlc_value']);
         }
     }
     return $stmt;
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:61,代码来源:class.reminder.php

示例6: array_keys

}
if (count(@$HTTP_POST_VARS["display_sections"]) < 1) {
    $HTTP_POST_VARS["display_sections"] = array_keys(Customer_Stats_Report::getDisplaySections());
    unset($HTTP_POST_VARS["display_sections"][4]);
}
$support_levels = array('Aggregate' => 'Aggregate');
$grouped_levels = Customer::getGroupedSupportLevels($prj_id);
foreach ($grouped_levels as $level_name => $level_ids) {
    $support_levels[$level_name] = $level_name;
}
if (count(@$HTTP_POST_VARS["support_level"]) < 1) {
    $HTTP_POST_VARS["support_level"] = array('Aggregate');
}
// XXX: internal only - Remove all mentions of InnoDB
$prj_id = Auth::getCurrentProject();
$tpl->assign(array("has_support_levels" => Customer::doesBackendUseSupportLevels($prj_id), "project_name" => Auth::getCurrentProjectName(), "support_levels" => $support_levels, "support_level" => @$HTTP_POST_VARS["support_level"], "start_date" => $start_date, "end_date" => $end_date, "sections" => Customer_Stats_Report::getDisplaySections(), "display_sections" => $HTTP_POST_VARS["display_sections"], "split_innoDB" => @$HTTP_POST_VARS["split_innoDB"], "include_expired" => @$HTTP_POST_VARS["include_expired"], "graphs" => Customer_Stats_Report::getGraphTypes()));
// only set customers if user has role of manager or above
if (Auth::getCurrentRole() >= User::getRoleID('manager')) {
    $tpl->assign(array("customers" => Customer::getAssocList($prj_id), "customer" => @$HTTP_POST_VARS["customer"]));
}
// loop through display sections
$display = array();
foreach ($HTTP_POST_VARS["display_sections"] as $section) {
    $display[$section] = 1;
}
$tpl->assign("display", $display);
if (@$HTTP_POST_VARS["cat"] == "Generate") {
    if ($start_date == "0000-00-00") {
        $start_date = '';
    }
    if ($end_date == "0000-00-00") {
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:customer_stats.php


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