本文整理汇总了PHP中config::get_config_item方法的典型用法代码示例。如果您正苦于以下问题:PHP config::get_config_item方法的具体用法?PHP config::get_config_item怎么用?PHP config::get_config_item使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类config
的用法示例。
在下文中一共展示了config::get_config_item方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
function render()
{
$current_user =& singleton("current_user");
global $TPL;
// Get averages for hours worked over the past fortnight and year
$t = new timeSheetItem();
$day = 60 * 60 * 24;
//mktime(0,0,0,date("m"),date("d")-1, date("Y"))
$today = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 1, date("Y")));
$yestA = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 2, date("Y")));
$yestB = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 1, date("Y")));
$fortn = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 14, date("Y")));
list($hours_sum_today, $dollars_sum_today) = $t->get_averages($today, $current_user->get_id());
list($hours_sum_yesterday, $dollars_sum_yesterday) = $t->get_averages($yestA, $current_user->get_id(), null, $yestB);
list($hours_sum_fortnight, $dollars_sum_fortnight) = $t->get_averages($fortn, $current_user->get_id());
list($hours_avg_fortnight, $dollars_avg_fortnight) = $t->get_fortnightly_average($current_user->get_id());
$TPL["hours_sum_today"] = sprintf("%0.2f", $hours_sum_today[$current_user->get_id()]);
$TPL["dollars_sum_today"] = page::money_print($dollars_sum_today[$current_user->get_id()]);
$TPL["hours_sum_yesterday"] = sprintf("%0.2f", $hours_sum_yesterday[$current_user->get_id()]);
$TPL["dollars_sum_yesterday"] = page::money_print($dollars_sum_yesterday[$current_user->get_id()]);
$TPL["hours_sum_fortnight"] = sprintf("%0.2f", $hours_sum_fortnight[$current_user->get_id()]);
$TPL["dollars_sum_fortnight"] = page::money_print($dollars_sum_fortnight[$current_user->get_id()]);
$TPL["hours_avg_fortnight"] = sprintf("%0.2f", $hours_avg_fortnight[$current_user->get_id()]);
$TPL["dollars_avg_fortnight"] = page::money(config::get_config_item("currency"), $dollars_avg_fortnight[$current_user->get_id()], "%s%m %c");
$TPL["dateFrom"] = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 28, date("Y")));
$TPL["dateTo"] = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y")));
return true;
}
示例2: __construct
function __construct($week_start = 1, $weeks_to_display = 4)
{
$this->db = new db_alloc();
$this->first_day_of_week = config::get_config_item("calendarFirstDay");
$this->set_cal_date_range($week_start, $weeks_to_display);
$this->days_of_week = $this->get_days_of_week_array($this->first_day_of_week);
}
示例3: get
function get()
{
// Check if we're using a VCS
$class = "vcs_" . config::get_config_item("wikiVCS");
if (class_exists($class)) {
$vcs = new $class(wiki_module::get_wiki_path());
}
return $vcs;
}
示例4: visible
function visible()
{
$current_user =& singleton("current_user");
if (isset($current_user) && $current_user->is_employee()) {
$timeSheetAdminPersonIDs = config::get_config_item("defaultTimeSheetAdminList");
if (in_array($current_user->get_id(), $timeSheetAdminPersonIDs) && has_pending_admin_timesheet()) {
return true;
}
}
}
示例5: Start
function Start($row, $nuke_prev_sessions = true)
{
$this->key = md5($row["personID"] . "mix it up#@!" . md5(mktime() . md5(microtime())));
$this->Put("session_started", mktime());
if ($nuke_prev_sessions && config::get_config_item("singleSession")) {
$this->db->query("DELETE FROM sess WHERE personID = %d", $row["personID"]);
}
$this->db->query("INSERT INTO sess (sessID,sessData,personID) VALUES ('%s','%s',%d)", $this->key, $this->Encode($this->session_data), $row["personID"]);
$this->Put("username", strtolower($row["username"]));
$this->Put("perms", $row["perms"]);
$this->Put("personID", $row["personID"]);
}
示例6: apply_patch
function apply_patch($f)
{
global $TPL;
static $files;
// Should never attempt to apply the same patch twice.. in case
// there are function declarations in the .php patches.
if ($files[$f]) {
return;
}
$files[$f] = true;
$db = new db_alloc();
$file = basename($f);
$failed = false;
$comments = array();
// This is an important patch that converts money from 120.34 to 12034.
// We MUST ensure that the user has a currency set before applying this patch.
if ($file == "patch-00188-alla.sql") {
if (!config::get_config_item('currency')) {
alloc_error("No default currency is set! Login to alloc (ignore any errors, you may need to manually change the url to config/config.php after logging in) go to Setup -> Finance and select a Main Currency. And then click the 'Update Transactions That Have No Currency' button. Then return here and apply this patch (patch-188). IT IS REALLY IMPORTANT THAT YOU FOLLOW THESE INSTRUCTIONS as the storage format for monetary amounts has changed.", true);
}
}
// Try for sql file
if (strtolower(substr($file, -4)) == ".sql") {
list($sql, $comments) = parse_sql_file($f);
foreach ($sql as $query) {
if (!$db->query($query)) {
#$TPL["message"][] = "<b style=\"color:red\">Error:</b> ".$f."<br>".$db->get_error();
$failed = true;
alloc_error("<b style=\"color:red\">Error:</b> " . $f . "<br>" . $db->get_error());
}
}
if (!$failed) {
$TPL["message_good"][] = "Successfully Applied: " . $f;
}
// Try for php file
} else {
if (strtolower(substr($file, -4)) == ".php") {
$str = execute_php_file("../patches/" . $file);
if ($str && !defined("FORCE_PATCH_SUCCEED_" . $file)) {
#$TPL["message"][] = "<b style=\"color:red\">Error:</b> ".$f."<br>".$str;
$failed = true;
ob_end_clean();
alloc_error("<b style=\"color:red\">Error:</b> " . $f . "<br>" . $str);
} else {
$TPL["message_good"][] = "Successfully Applied: " . $f;
}
}
}
if (!$failed) {
$q = prepare("INSERT INTO patchLog (patchName, patchDesc, patchDate) \n VALUES ('%s','%s','%s')", $file, implode(" ", $comments), date("Y-m-d H:i:s"));
$db->query($q);
}
}
示例7: show_all_exp
function show_all_exp($template)
{
global $TPL;
global $expenseForm;
global $db;
global $transaction_to_edit;
if ($expenseForm->get_id()) {
if ($_POST["transactionID"] && ($_POST["edit"] || is_object($transaction_to_edit) && $transaction_to_edit->get_id())) {
// if edit is clicked OR if we've rejected changes made to something so are still editing it
$query = prepare("SELECT * FROM transaction WHERE expenseFormID=%d AND transactionID<>%d ORDER BY transactionID DESC", $expenseForm->get_id(), $_POST["transactionID"]);
} else {
$query = prepare("SELECT * FROM transaction WHERE expenseFormID=%d ORDER BY transactionID DESC", $expenseForm->get_id());
}
$db->query($query);
while ($db->next_record()) {
$transaction = new transaction();
$transaction->read_db_record($db);
$transaction->set_values();
$transaction->get_value("quantity") and $TPL["amount"] = $transaction->get_value("amount") / $transaction->get_value("quantity");
$TPL["lineTotal"] = $TPL["amount"] * $transaction->get_value("quantity");
$tf = new tf();
$tf->set_id($transaction->get_value("fromTfID"));
$tf->select();
$TPL["fromTfIDLink"] = $tf->get_link();
$tf = new tf();
$tf->set_id($transaction->get_value("tfID"));
$tf->select();
$TPL["tfIDLink"] = $tf->get_link();
$projectID = $transaction->get_value("projectID");
if ($projectID) {
$project = new project();
$project->set_id($transaction->get_value("projectID"));
$project->select();
$TPL["projectName"] = $project->get_value("projectName");
}
if ($transaction->get_value("fromTfID") == config::get_config_item("expenseFormTfID")) {
$TPL['expense_class'] = "loud";
} else {
$TPL['expense_class'] = "";
}
include_template($template);
}
}
}
示例8: download
public static function download()
{
// Get default currency
$default_currency = config::get_config_item("currency");
// Get list of active currencies
$meta = new meta("currencyType");
$currencies = $meta->get_list();
foreach ((array) $currencies as $code => $currency) {
if ($code == $default_currency) {
continue;
}
if ($ret = exchangeRate::update_rate($code, $default_currency)) {
$rtn[] = $ret;
}
if ($ret = exchangeRate::update_rate($default_currency, $code)) {
$rtn[] = $ret;
}
}
return $rtn;
}
示例9: show_productSale_new
function show_productSale_new($template)
{
global $TPL;
global $productSaleItemsDoExist;
global $productSaleID;
$taxName = config::get_config_item("taxName");
$productSaleItem = new productSaleItem();
$productSaleItem->set_values();
// wipe clean
$product = new product();
$ops = $product->get_assoc_array("productID", "productName");
$TPL["productList_dropdown"] = page::select_options($ops, $productSaleItem->get_value("productID"));
$productSaleItemsDoExist and $TPL["display"] = "display:none";
if ($taxName) {
$TPL["sellPriceTax_check"] = sprintf(" <input type='checkbox' name='sellPriceIncTax[]' value='1'%s> inc %s", $productSaleItem->get_value("sellPriceIncTax") ? ' checked' : '', $taxName);
}
$TPL["psid"] = $productSaleID;
// poorly named template variable to prevent clobbering
include_template($template);
}
示例10: get_file
function get_file($file, $rev = "")
{
global $TPL;
$f = realpath(wiki_module::get_wiki_path() . $file);
if (path_under_path(dirname($f), wiki_module::get_wiki_path())) {
$mt = get_mimetype($f);
if (strtolower($mt) != "text/plain") {
$s = "<h6>Download File</h6>";
$s .= "<a href='" . $TPL["url_alloc_fileDownload"] . "file=" . urlencode($file) . "'>" . $file . "</a>";
$TPL["str_html"] = $s;
include_template("templates/fileGetM.tpl");
exit;
}
// Get the regular revision ...
$disk_file = file_get_contents($f) or $disk_file = "";
$vcs = vcs::get();
//$vcs->debug = true;
// Get a particular revision
if ($vcs) {
$vcs_file = $vcs->cat($f, $rev);
}
if ($vcs && wiki_module::nuke_trailing_spaces_from_all_lines($disk_file) != wiki_module::nuke_trailing_spaces_from_all_lines($vcs_file)) {
if (!$vcs_file) {
$TPL["msg"] = "<div class='message warn noprint' style='margin-top:0px; margin-bottom:10px; padding:10px;'>\n Warning: This file may not be under version control.\n </div>";
} else {
$TPL["msg"] = "<div class='message warn noprint' style='margin-top:0px; margin-bottom:10px; padding:10px;'>\n Warning: This file may not be the latest version.\n </div>";
}
}
if ($rev && $vcs_file) {
$TPL["str"] = $vcs_file;
} else {
$TPL["str"] = $disk_file;
}
$wikiMarkup = config::get_config_item("wikiMarkup");
$TPL["str_html"] = $wikiMarkup($TPL["str"]);
$TPL["rev"] = urlencode($rev);
include_template("templates/fileGetM.tpl");
}
}
示例11:
<?php
$extra = config::get_config_item("defaultInterestedParties");
$db = new db_alloc();
foreach ((array) $extra as $name => $email) {
$db->query("UPDATE interestedParty set external = null WHERE emailAddress = '%s'", $email);
}
示例12: preg_replace
<?php
// Change email default From email addresses from Alex Lance <alla@cyber.com.dsa> to alla@cyber.com.dsa
$email = config::get_config_item("AllocFromEmailAddress");
$email = preg_replace("/^.*</", "", $email);
$email = str_replace(">", "", $email);
$configID = config::get_config_item_id("AllocFromEmailAddress");
$c = new config();
$c->set_id($configID);
$c->select();
$c->set_value("value", $email);
$c->save();
示例13: find_email
function find_email($debug = false, $get_blobs = false, $ignore_date = false)
{
$info = inbox::get_mail_info();
$mailbox = $this->get_value("commentMaster") . $this->get_value("commentMasterID");
$mail = new email_receive($info);
$mail->open_mailbox(config::get_config_item("allocEmailFolder") . "/" . $mailbox, OP_HALFOPEN + OP_READONLY);
$mail->check_mail();
$msg_nums = $mail->get_all_email_msg_uids();
$debug and print "<hr><br><b>find_email(): " . date("Y-m-d H:i:s") . " found " . count($msg_nums) . " emails for mailbox: " . $mailbox . "</b>";
// fetch and parse email
foreach ((array) $msg_nums as $num) {
$debug and print "<hr><br>Examining message number: " . $num;
unset($mimebits);
// this will stream output
$mail->set_msg($num);
$mail->get_msg_header();
$text = $mail->fetch_mail_text();
list($from1, $e1n) = parse_email_address($mail->mail_headers["from"]);
list($from2, $e2n) = parse_email_address($this->get_value("commentCreatedUserText"));
if (!$from2 && $this->get_value("commentCreatedUser")) {
$p = new person();
$p->set_id($this->get_value("commentCreatedUser"));
$p->select();
$from2 = $p->get_value("emailAddress");
}
if (!$from2 && $this->get_value("commentCreatedUserClientContactID")) {
$p = new clientContact();
$p->set_id($this->get_value("commentCreatedUserClientContactID"));
$p->select();
$from2 = $p->get_value("clientContactEmail");
}
$text1 = str_replace(array("\\s", "\n", "\r"), "", trim($text));
$text2 = str_replace(array("\\s", "\n", "\r"), "", trim($this->get_value("comment")));
$date = format_date("U", $this->get_value("commentCreatedTime"));
$date1 = strtotime($mail->mail_headers["date"]) - 300;
$date3 = strtotime($mail->mail_headers["date"]) + 300;
similar_text($text1, $text2, $percent);
if ($percent >= 99 && ($from1 == $from2 || !$from2 || same_email_address($from1, config::get_config_item("AllocFromEmailAddress"))) && ($date > $date1 && $date < $date3 || $ignore_date)) {
$debug and print "<br><b style='color:green'>Found you! Msg no: " . $num . " in mailbox: " . $mailbox . " for commentID: " . $this->get_id() . "</b>";
foreach ((array) $mail->mail_parts as $v) {
$s = $v["part_object"];
// structure
$raw_data = imap_fetchbody($mail->connection, $mail->msg_uid, $v["part_number"], FT_UID | FT_PEEK);
$thing = $mail->decode_part($s->encoding, $raw_data);
$filename = $mail->get_parameter_attribute_value($s->parameters, "name");
$filename or $filename = $mail->get_parameter_attribute_value($s->parameters, "filename");
$filename or $filename = $mail->get_parameter_attribute_value($s->dparameters, "name");
$filename or $filename = $mail->get_parameter_attribute_value($s->dparameters, "filename");
$bits = array();
$bits["part"] = $v["part_number"];
$bits["name"] = $filename;
$bits["size"] = strlen($thing);
$get_blobs and $bits["blob"] = $thing;
$filename and $mimebits[] = $bits;
}
$mail->close();
return array($mail, $text, $mimebits);
} else {
similar_text($text1, $text2, $percent);
$debug and print "<br>TEXT: " . sprintf("%d", $text1 == $text2) . " (" . sprintf("%d", $percent) . "%)";
#$debug and print "<br>Text1:<br>".$text1."<br>* * *<br>";
#$debug and print "Text2:<br>".$text2."<br>+ + +</br>";
$debug and print "<br>FROM: " . sprintf("%d", $from1 == $from2 || !$from2 || same_email_address($from1, config::get_config_item("AllocFromEmailAddress")));
$debug and print " From1: " . page::htmlentities($from1);
$debug and print " From2: " . page::htmlentities($from2);
$debug and print "<br>DATE: " . sprintf("%d", $date > $date1 && $date < $date3) . " (" . date("Y-m-d H:i:s", $date) . " | " . date("Y-m-d H:i:s", $date1) . " | " . date("Y-m-d H:i:s", $date3) . ")";
$debug and print "<br>";
}
}
$mail->close();
return array(false, false, false);
}
示例14: tf
if ($tf->select() && !$tf->get_value("tfActive")) {
$TPL["message_help"][] = "This expense is allocated to an inactive TF. It will not create transactions.";
}
$tf = new tf();
$tf->set_id($transactionRepeat->get_value("fromTfID"));
if ($tf->select() && !$tf->get_value("tfActive")) {
$TPL["message_help"][] = "This expense is sourced from an inactive TF. It will not create transactions.";
}
$m = new meta("currencyType");
$currencyOps = $m->get_assoc_array("currencyTypeID", "currencyTypeID");
$TPL["currencyTypeOptions"] = page::select_options($currencyOps, $transactionRepeat->get_value("currencyTypeID"));
$TPL["tfOptions"] = page::select_options($q, $transactionRepeat->get_value("tfID"));
$TPL["fromTfOptions"] = page::select_options($q, $transactionRepeat->get_value("fromTfID"));
$TPL["basisOptions"] = page::select_options(array("weekly" => "weekly", "fortnightly" => "fortnightly", "monthly" => "monthly", "quarterly" => "quarterly", "yearly" => "yearly"), $transactionRepeat->get_value("paymentBasis"));
$TPL["transactionTypeOptions"] = page::select_options(transaction::get_transactionTypes(), $transactionRepeat->get_value("transactionType"));
if (is_object($transactionRepeat) && $transactionRepeat->get_id() && $current_user->have_role("admin")) {
$TPL["adminButtons"] .= '
<select name="changeTransactionStatus"><option value="">Transaction Status<option value="approved">Approve<option value="rejected">Reject<option value="pending">Pending</select>
';
}
if (is_object($transactionRepeat) && $transactionRepeat->get_id() && $transactionRepeat->get_value("status") == "pending") {
$TPL["message_help"][] = "This Repeating Expense will only create Transactions once its status is Approved.";
} else {
if (!$transactionRepeat->get_id()) {
$TPL["message_help"][] = "Complete all the details and click the Save button to create an automatically Repeating Expense";
}
}
$transactionRepeat->get_value("status") and $TPL["statusLabel"] = " - " . ucwords($transactionRepeat->get_value("status"));
$TPL["taxName"] = config::get_config_item("taxName");
$TPL["main_alloc_title"] = "Create Repeating Expense - " . APPLICATION_NAME;
include_template("templates/transactionRepeatM.tpl");
示例15: get_changes_list
function get_changes_list()
{
// This function returns HTML rows for the changes that have been made to this task
$rows = array();
$people_cache =& get_cached_table("person");
$options = array("taskID" => $this->get_id());
$changes = audit::get_list($options);
foreach ($changes as $audit) {
$changeDescription = "";
$newValue = $audit['value'];
switch ($audit['field']) {
case 'created':
$changeDescription = $newValue;
break;
case 'dip':
$changeDescription = "Default parties set to " . interestedParty::abbreviate($newValue);
break;
case 'taskName':
$changeDescription = "Task name set to '{$newValue}'.";
break;
case 'taskDescription':
$changeDescription = "Task description set to <a class=\"magic\" href=\"#x\" onclick=\"\$('#audit" . $audit["auditID"] . "').slideToggle('fast');\">Show</a> <div class=\"hidden\" id=\"audit" . $audit["auditID"] . "\"><div>" . $newValue . "</div></div>";
break;
case 'priority':
$priorities = config::get_config_item("taskPriorities");
$changeDescription = sprintf('Task priority set to <span style="color: %s;">%s</span>.', $priorities[$newValue]["colour"], $priorities[$newValue]["label"]);
break;
case 'projectID':
task::load_entity("project", $newValue, $newProject);
is_object($newProject) and $newProjectLink = $newProject->get_project_link();
$newProjectLink or $newProjectLink = "<empty>";
$changeDescription = "Project changed set to " . $newProjectLink . ".";
break;
case 'parentTaskID':
task::load_entity("task", $newValue, $newTask);
if ($newValue) {
$changeDescription = sprintf("Task set to a child of %d %s.", $newTask->get_id(), $newTask->get_task_link());
} else {
$changeDescription = "Task no longer a child task.";
}
break;
case 'duplicateTaskID':
task::load_entity("task", $newValue, $newTask);
if ($newValue) {
$changeDescription = "Task set to a duplicate of " . $newTask->get_task_link();
} else {
$changeDescription = "Task is no longer a duplicate.";
}
break;
case 'personID':
$changeDescription = "Task assigned to " . $people_cache[$newValue]["name"] . ".";
break;
case 'managerID':
$changeDescription = "Task manager set to " . $people_cache[$newValue]["name"] . ".";
break;
case 'estimatorID':
$changeDescription = "Task estimator set to " . $people_cache[$newValue]["name"] . ".";
break;
case 'taskTypeID':
$changeDescription = "Task type set to " . $newValue . ".";
break;
case 'taskStatus':
$changeDescription = sprintf('Task status set to <span style="background-color:%s">%s</span>.', task::get_task_status_thing("colour", $newValue), task::get_task_status_thing("label", $newValue));
break;
case 'dateActualCompletion':
case 'dateActualStart':
case 'dateTargetStart':
case 'dateTargetCompletion':
case 'timeLimit':
case 'timeBest':
case 'timeWorst':
case 'timeExpected':
// these cases are more or less identical
switch ($audit['field']) {
case 'dateActualCompletion':
$fieldDesc = "actual completion date";
break;
case 'dateActualStart':
$fieldDesc = "actual start date";
break;
case 'dateTargetStart':
$fieldDesc = "estimate/target start date";
break;
case 'dateTargetCompletion':
$fieldDesc = "estimate/target completion date";
break;
case 'timeLimit':
$fieldDesc = "hours worked limit";
break;
case 'timeBest':
$fieldDesc = "best estimate";
break;
case 'timeWorst':
$fieldDesc = "worst estimate";
break;
case 'timeExpected':
$fieldDesc = "expected estimate";
}
if ($newValue) {
$changeDescription = "The {$fieldDesc} was set to {$newValue}.";
//.........这里部分代码省略.........