本文整理汇总了PHP中getProject函数的典型用法代码示例。如果您正苦于以下问题:PHP getProject函数的具体用法?PHP getProject怎么用?PHP getProject使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getProject函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doAction
public function doAction()
{
$this->generateAuthURL();
//pay a little query to avoid to fetch 5000 rows
$this->data = $jobData = getJobData($this->jid, $this->password);
$wStruct = new WordCount_Struct();
$wStruct->setIdJob($this->jid);
$wStruct->setJobPassword($this->password);
$wStruct->setNewWords($jobData['new_words']);
$wStruct->setDraftWords($jobData['draft_words']);
$wStruct->setTranslatedWords($jobData['translated_words']);
$wStruct->setApprovedWords($jobData['approved_words']);
$wStruct->setRejectedWords($jobData['rejected_words']);
if ($jobData['status'] == Constants_JobStatus::STATUS_ARCHIVED || $jobData['status'] == Constants_JobStatus::STATUS_CANCELLED) {
//this job has been archived
$this->job_archived = true;
$this->job_owner_email = $jobData['job_owner'];
}
$this->job_stats = CatUtils::getFastStatsForJob($wStruct);
$proj = getProject($jobData['id_project']);
$this->project_status = $proj[0];
/**
* Retrieve information about job errors
* ( Note: these information are fed by the revision process )
* @see setRevisionController
*/
$jobQA = new Revise_JobQA($this->jid, $this->password, $wStruct->getTotal());
$jobQA->retrieveJobErrorTotals();
$jobVote = $jobQA->evalJobVote();
$this->totalJobWords = $wStruct->getTotal();
$this->qa_data = $jobQA->getQaData();
$this->qa_overall_text = $jobVote['minText'];
$this->qa_overall_avg = $jobVote['avg'];
$this->qa_equivalent_class = $jobVote['equivalent_class'];
}
示例2: forceProject
function forceProject()
{
if (!getProject() instanceof Project) {
redirect("/pg/");
}
return getProject();
}
示例3: doAction
public function doAction()
{
$this->generateAuthURL();
//pay a little query to avoid to fetch 5000 rows
$this->jobData = $jobData = getJobData($this->jid, $this->password);
$wStruct = new WordCount_Struct();
$wStruct->setIdJob($this->jid);
$wStruct->setJobPassword($this->password);
$wStruct->setNewWords($jobData['new_words']);
$wStruct->setDraftWords($jobData['draft_words']);
$wStruct->setTranslatedWords($jobData['translated_words']);
$wStruct->setApprovedWords($jobData['approved_words']);
$wStruct->setRejectedWords($jobData['rejected_words']);
if ($jobData['status'] == Constants_JobStatus::STATUS_ARCHIVED || $jobData['status'] == Constants_JobStatus::STATUS_CANCELLED) {
//this job has been archived
$this->job_archived = true;
$this->job_owner_email = $jobData['job_owner'];
}
$tmp = CatUtils::getEditingLogData($this->jid, $this->password);
$this->data = $tmp[0];
$this->stats = $tmp[1];
$this->job_stats = CatUtils::getFastStatsForJob($wStruct);
$proj = getProject($jobData['id_project']);
$this->project_status = $proj[0];
}
示例4: doAction
/**
* When Called it perform the controller action to retrieve/manipulate data
*
* @return mixed
*/
function doAction()
{
if (count($this->errors) > 0) {
return null;
}
//get job language and data
//Fixed Bug: need a specific job, because we need The target Language
//Removed from within the foreach cycle, the job is always the same...
$jobData = $this->jobInfo = getJobData($this->jobID, $this->jobPass);
$pCheck = new AjaxPasswordCheck();
//check for Password correctness
if (empty($jobData) || !$pCheck->grantJobAccessByJobData($jobData, $this->jobPass)) {
$msg = "Error : wrong password provided for download \n\n " . var_export($_POST, true) . "\n";
Log::doLog($msg);
Utils::sendErrMailReport($msg);
return null;
}
$projectData = getProject($jobData['id_project']);
$source = $jobData['source'];
$target = $jobData['target'];
$tmsService = new TMSService();
/**
* @var $tmx SplTempFileObject
*/
$this->tmx = $tmsService->exportJobAsTMX($this->jobID, $this->jobPass, $source, $target);
$this->fileName = $projectData[0]['name'] . "-" . $this->jobID . ".tmx";
}
示例5: __construct
public function __construct($name, $desc, $usage)
{
$this->project = getProject();
$this->name = $name;
$this->desc = $desc;
$this->usage = $usage;
$this->executor = new CommandExecutor($this);
}
示例6: forceProject
/**
* @return Project
*/
function forceProject()
{
$project = getProject();
if (!$project instanceof Project) {
redirect("/pg/");
}
return $project;
}
示例7: printProjectPage
function printProjectPage($projectID)
{
$project = getProject($projectID);
echo '<h1 class="page_title_withside">' . $project['project_name'] . '</h1>';
echo '<div class="page_content">';
echo '<div class="img_right"><img src="' . getProjectImage($project['project_id']) . '"></img></div>';
echo $project['project_page'];
echo '</div>';
echo '<div class="page_content">';
echo '<h1>Blog Posts About this Project</h1>';
echo '<p>Blog posts tagged as "' . getTagName($project['project_tag']) . '" refer to this project. Click below to see all of the blog posts about ' . $project['project_name'] . '.</p>';
echo '<h3>Blog Posts Tagged in <a class="dark_red" href="/blog/tag/' . $project['project_tag'] . '">' . getTagName($project['project_tag']) . ' (' . $project['project_tag'] . ')</a></h3>';
echo '</div>';
}
示例8: controllerDoAction
public function controllerDoAction()
{
//pay a little query to avoid to fetch 5000 rows
$this->jobData = getJobData($this->jid, $this->password);
$this->job_stats = $this->getFastStatsForJob();
if ($this->jobData['status'] == Constants_JobStatus::STATUS_ARCHIVED || $this->jobData == Constants_JobStatus::STATUS_CANCELLED) {
//this job has been archived
$this->job_archived = true;
$this->job_owner_email = $this->jobData['job_owner'];
}
if (self::$start_id == -1) {
self::$start_id = $this->jobData['job_first_segment'];
}
//TODO: portare dentro il codice
try {
$tmp = $this->getEditLogData();
$this->data = $tmp[0];
$this->pagination = $tmp[2];
foreach ($this->data as $i => $dataRow) {
/**
* @var $dataRow EditLog_EditLogSegmentClientStruct
*/
$this->data[$i] = $dataRow->toArray();
}
$this->stats = $tmp[1];
$proj = getProject($this->jobData['id_project']);
$this->project_status = $proj[0];
$__langStatsDao = new LanguageStats_LanguageStatsDAO(Database::obtain());
$maxDate = $__langStatsDao->getLastDate();
$languageSearchObj = new LanguageStats_LanguageStatsStruct();
$languageSearchObj->date = $maxDate;
$languageSearchObj->source = $this->data[0]['job_source'];
$languageSearchObj->target = $this->data[0]['job_target'];
$this->languageStatsData = $__langStatsDao->read($languageSearchObj);
$this->languageStatsData = $this->languageStatsData[0];
} catch (Exception $exn) {
if ($exn->getCode() == -1) {
$this->jobEmpty = true;
}
}
}
示例9: getProjectsContent
function getProjectsContent($path)
{
global $title;
include 'blog.php';
$action = array_shift($path);
if ($action == "") {
$title = "Projects" . $title;
$content = '<h1>Projects</h1><p>Below is a list of personal (and maybe some group) projects that I thought deserved their own page. Feel free to contact me (see the footer) if you\'de like to know more about a certain project or endeavor.</p>';
$content .= '<p class="subtitle">The following projects are listed in order of their most recent blog post activity.</p>';
foreach (fetchProjects() as $project) {
$content .= getProjectSummary($project);
}
return $content;
} else {
$project = fetchProject($action);
if ($project == null) {
return get404();
} else {
$title = $project['name'] . " (Project)" . $title;
return getProject($project);
}
}
return "<h1>Projects</h1>";
}
示例10: getStories
require 'lib.php';
require_once 'database.ini';
//If project id is a number
if (is_numeric($project_id_input)) {
//Get all of the stories, epics and attachments from pivotal API
$raw_data = getStories(PT_TOKEN, $project_id_input);
$epics_raw_data = getEpics(PT_TOKEN, $project_id_input);
$attachments_raw_data = getAttachments(PT_TOKEN, $project_id_input);
//if the pivotal story contains a field named 'error' (leads to error message)
if (!isset($raw_data["error"]) || !isset($epics_raw_data["error"]) || !isset($attachments_raw_data["error"])) {
$connection = connectToDb();
$history_id_check = getHistoryId($connection, $project_id_input);
//If the project already exists, perform update
if ($history_id_check == NULL) {
//Get project name
$project_data = getProject(PT_TOKEN, $project_id_input);
if ($connection == true) {
try {
//Make an entry in the history table
insertIntoHistory($connection, $project_data["id"], $project_data["name"]);
$latest_history_sql = 'SELECT MAX(history.id) FROM history;';
//Send the sql command
$latest_history_id = $connection->query($latest_history_sql);
//Get the data from the PDO object
$latest_history_id = $latest_history_id->fetch(PDO::FETCH_ASSOC);
//Insert data into the database
$history_id = $latest_history_id["MAX(history.id)"];
insertDataIntoDb($raw_data, $connection, $project_data["name"], $latest_history_id["MAX(history.id)"]);
echo '<div class="row text-center h2 alert alert-success" role="alert">' . htmlspecialchars($project_data["name"]) . ' added to the database!</div>';
//Inserting into the epics table
insertEpicDataIntoDb($epics_raw_data, $connection, $latest_history_id["MAX(history.id)"]);
示例11: common_projektneStrane
function common_projektneStrane()
{
//debug mod aktivan
global $userid, $user_nastavnik, $user_student, $conf_files_path, $user_siteadmin;
$predmet = intval($_REQUEST['predmet']);
$ag = intval($_REQUEST['ag']);
$projekat = intval($_REQUEST['projekat']);
$action = $_REQUEST['action'];
//for project page only:
$section = $_REQUEST['section'];
$subaction = $_REQUEST['subaction'];
$id = intval($_REQUEST['id']);
//editing links, rss....
if ($user_student && !$user_siteadmin) {
$actualProject = getActualProjectForUserInPredmet($userid, $predmet, $ag);
if ($actualProject[id] != $projekat) {
//user is not in this project in this predmet...hijack attempt?
zamgerlog("projektne strane: korisnik nije na projektu {$projekat} (pp{$predmet}, ag{$ag})", 3);
zamgerlog2("nije na projektu", $projekat);
return;
}
}
$params = getPredmetParams($predmet, $ag);
$project = getProject($projekat);
$members = fetchProjectMembers($project[id]);
if ($params[zakljucani_projekti] == 0) {
zamgerlog("projektne strane: jos nisu otvorene! (pp{$predmet}, ag{$ag})", 3);
zamgerlog2("svi projekti su jos otkljucani", $predmet, $ag);
return;
}
if ($user_student && !$user_siteadmin) {
$linkPrefix = "?sta=student/projekti&akcija=projektnastranica&projekat={$projekat}&predmet={$predmet}&ag={$ag}";
} elseif ($user_nastavnik) {
$linkPrefix = "?sta=nastavnik/projekti&akcija=projektna_stranica&projekat={$projekat}&predmet={$predmet}&ag={$ag}";
} else {
return;
}
?>
<h2><?php
echo filtered_output_string($project[naziv]);
?>
</h2>
<div class="links">
<ul class="clearfix">
<li><a href="<?php
echo $linkPrefix;
?>
">Početna strana</a></li>
<li><a href="<?php
echo $linkPrefix . "§ion=info";
?>
">Informacije o projektu</a></li>
<li><a href="<?php
echo $linkPrefix . "§ion=links";
?>
">Korisni linkovi</a></li>
<li><a href="<?php
echo $linkPrefix . "§ion=rss";
?>
">RSS feedovi</a></li>
<li><a href="<?php
echo $linkPrefix . "§ion=bl";
?>
">Članci</a></li>
<li><a href="<?php
echo $linkPrefix . "§ion=file";
?>
">Fajlovi</a></li>
<li class="last"><a href="<?php
echo $linkPrefix . "§ion=bb";
?>
">Grupa za diskusiju</a></li>
</ul>
</div>
<?php
if (!isset($section)) {
//display project start page
?>
<div id="mainWrapper" class="clearfix">
<div id="leftBlocks">
<div class="blockRow clearfix">
<div class="block" id="latestPosts">
<a class="blockTitle" href="<?php
echo $linkPrefix . "§ion=bb";
?>
" title="Grupa za diskusiju">Najnoviji postovi</a>
<div class="items">
<?php
$latestPosts = fetchLatestPostsForProject($project[id], 4);
foreach ($latestPosts as $post) {
?>
<div class="item">
<span class="date"><?php
echo date('d.m H:i ', mysql2time($post[vrijeme]));
?>
</span>
<a href="<?php
echo $linkPrefix . "§ion=bb&subaction=view&tid={$post['tema']}#p{$post['id']}";
?>
//.........这里部分代码省略.........
示例12: getWeeksTime
function getWeeksTime($time, $user_id)
{
$colname_rsTimesheet = "-1";
if (isset($user_id)) {
$colname_rsTimesheet = get_magic_quotes_gpc() ? $user_id : addslashes($user_id);
}
$query_rsTimesheet = sprintf("SELECT * FROM procentris_timesheet WHERE user_id = %s", $colname_rsTimesheet);
$rsTimesheet = mysql_query($query_rsTimesheet) or die(mysql_error());
$row_rsTimesheet = mysql_fetch_assoc($rsTimesheet);
$totalRows_rsTimesheet = mysql_num_rows($rsTimesheet);
$today = getdate($time);
$chkdate = $today['weekday'];
$chkdate2 = strtolower($chkdate);
$arr = getDays($time);
$fromdate = $arr['monday']['year'] . "-" . $arr['monday']['mon'] . "-" . $arr['monday']['mday'];
$todate = $arr['sunday']['year'] . "-" . $arr['sunday']['mon'] . "-" . $arr['sunday']['mday'];
//$fromdate = $arr[$chkdate2]['year']."-".$arr[$chkdate2]['mon']."-".$arr[$chkdate2]['mday'];
//$todate = $arr[$chkdate2]['year']."-".$arr[$chkdate2]['mon']."-".$arr[$chkdate2]['mday'];
$category = getCategory($user_id, $fromdate, $todate);
if ($category) {
$result = '<table border=1 cellspacing=0 cellpadding=2>';
$result .= '<tr><td colspan=10 align=center>' . $today['mday'] . ' ' . $today['month'] . ', ' . $today['year'] . '</td></tr>';
$result .= '<tr><td align=left><b>Client</b></td><td align=left><b>Project</b></td><td align=left><b>Task</b></td>';
foreach ($arr as $key => $value) {
$result .= '<td align=left><b>' . substr(ucfirst($key), 0, 3) . '</b></td>';
}
$result .= '</tr>';
foreach ($category as $categoryKey => $categoryValue) {
$categorycnt[$categoryValue] = 1;
$project = getProject($user_id, $categoryKey, $fromdate, $todate);
if ($project) {
foreach ($project as $projectKey => $projectValue) {
$projectcnt[$projectValue] = 1;
$task = getTask($user_id, $categoryKey, $projectKey, $fromdate, $todate);
if ($task) {
$j = 0;
foreach ($task as $taskKey => $taskValue) {
if ($categorycnt[$categoryValue] == 1) {
$result .= '<tr>
<td align=left>' . $categoryValue . '</td>';
} else {
$result .= '<td align=left> </td>';
}
$categorycnt[$categoryValue]++;
if ($projectcnt[$projectValue] == 1) {
$result .= '<td align=left>' . $projectValue . '</td>';
} else {
$result .= '<td align=left> </td>';
}
$projectcnt[$projectValue]++;
$result .= '<td align=left>' . $taskValue . '</td>';
$i = 0;
$totalh[$j] = 0;
foreach ($arr as $key => $value) {
$timetaken[$i] = getTime($user_id, $categoryKey, $projectKey, $taskKey, $arr[$key]['year'] . "-" . $arr[$key]['mon'] . "-" . $arr[$key]['mday']);
if (number_format($timetaken[$i], 2) == "0.00") {
$taketime = " ";
} else {
$taketime = number_format($timetaken[$i], 2);
}
$result .= '<td align=right>' . $taketime . '</td>';
$totalv[$key] += $timetaken[$i];
$totalh[$j] += $timetaken[$i];
$i++;
}
$j++;
$result .= '</tr>';
}
}
}
}
}
$result .= '<tr><td align=left> </td><td align=left> </td><td align=right><b>Total:</b></td>';
foreach ($arr as $key => $value) {
$grandtotal += $totalv[$key];
$result .= '<td align=right>' . number_format($totalv[$key], 2) . '</td>';
}
$result .= '</tr>';
$result .= '<tr><td colspan=10 align=center>TOTAL HOURS WORKED THIS WEEK: <b>' . number_format($grandtotal, 2) . '</b></td></tr>';
$result .= '</table>';
return $result;
}
}
示例13: getFollowers
}
if (!$users) {
$users = getFollowers($nick, $connfb);
}
// keys
try {
$keys = getKeys($nick, null, $client);
} catch (Exception $e) {
$throttled = true;
error_log($e->getMessage());
$keys = getKeys($nick, $conn);
}
// turtle
$rank = getRank($users);
$ledger = getLedger($webid, $conn);
$project = getProject($ledger);
$main = 'http://gitpay.org/' . $user['login'] . '#this';
$githubaccount = 'http://github.com/' . $user['login'];
if ($webid && $webid['bitcoin']) {
$bitcoin = $webid['bitcoin'];
}
if ($webid && $webid['preferredURI']) {
$preferredURI = $webid['preferredURI'];
}
$turtle = getTurtle($user, $webid, $users, $keys);
insertKeys($keys, $nick, $conn);
writeTurtle($turtle);
if (!empty($_SESSION['login'])) {
activateUser('https://gitpay.org/' . $_SESSION['login'] . '#this', $conn);
}
$active = getActive('https://gitpay.org/' . $nick . '#this', $conn);
示例14: json_encode
<?php
require_once 'settings.php';
if ($_SERVER['REQUEST_METHOD'] == "GET") {
if (!empty($_GET['id'])) {
echo json_encode(getProject($_GET['id']));
} else {
echo json_encode(getProjects());
}
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {
// $json = file_get_contents('php://input');
// if($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] == 'PUT') {
// //This is an UPDATE call
// if(!empty($json))
// return json_encode(updatePrice());
// }
// elseif($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] == 'DELETE') {
// //This is a DELETE call
// // die($json);
// if(!empty($_GET['id'] && !empty($_GET['quantity'])))
// return json_encode(deletePriceFromQuantity($_GET['id'], $_GET['quantity']));
// }
// else {
// //This is an ADD call
// if(!empty($json))
// return json_encode(addPrice());
// }
}
function getProject($id)
{
示例15: getProject
function getProject()
{
$pc = new projectController();
$api = new apiController();
if (isset($_GET)) {
if (!isset($_GET["api_key"])) {
return json_encode(["err" => "Specify API_KEY"]);
} else {
if (!isset($_GET["project"])) {
return json_encode(["err" => "Specify PROJECT"]);
} else {
$project = $_GET["project"];
$apikey = $_GET["api_key"];
if ($api->checkKey($apikey)) {
$pr = $pc->getProjectDataFull($project);
if (!is_bool($pr)) {
return json_encode($pr);
} else {
return json_encode(["err" => "Project not found!"]);
}
} else {
return json_encode(["err" => "Incorrect key."]);
}
}
}
} else {
return json_encode(["err" => "No arguments found."]);
}
}
echo getProject();