本文整理汇总了PHP中active_project函数的典型用法代码示例。如果您正苦于以下问题:PHP active_project函数的具体用法?PHP active_project怎么用?PHP active_project使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了active_project函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: list_all
function list_all()
{
ajx_current("empty");
// Get all variables from request
$start = array_var($_GET, 'start', 0);
$limit = array_var($_GET, 'limit', config_option('files_per_page'));
$order = array_var($_GET, 'sort');
$order_dir = array_var($_GET, 'dir');
$tag = array_var($_GET, 'tag');
$action = array_var($_GET, 'action');
$attributes = array("ids" => explode(',', array_var($_GET, 'ids')), "types" => explode(',', array_var($_GET, 'types')), "tag" => array_var($_GET, 'tagTag'), "accountId" => array_var($_GET, 'account_id'), "moveTo" => array_var($_GET, 'moveTo'), "mantainWs" => array_var($_GET, 'mantainWs'));
//Resolve actions to perform
$actionMessage = array();
if (isset($action)) {
$actionMessage = $this->resolveAction($action, $attributes);
if ($actionMessage["errorCode"] == 0) {
flash_success($actionMessage["errorMessage"]);
} else {
flash_error($actionMessage["errorMessage"]);
}
}
// Get all emails and messages to display
$project = active_project();
list($messages, $pagination) = ProjectMessages::getMessages($tag, $project, $start, $limit, $order, $order_dir);
$total = $pagination->getTotalItems();
// Prepare response object
$object = $this->prepareObject($messages, $start, $limit, $total);
ajx_extra_data($object);
tpl_assign("listing", $object);
}
示例2: renderControl
/**
* Renders attachment control based on Object type
*
* @param void
* @return string
*/
function renderControl($control_name)
{
switch ($this->getRelObjectManager()) {
case 'Companies':
return select_company($control_name, $this->getRelObjectId(), array('class' => 'combobox'));
break;
case 'Contacts':
return select_contact($control_name, $this->getRelObjectId(), null, array('class' => 'combobox'));
break;
case 'ProjectFiles':
return select_project_file($control_name, active_project(), $this->getRelObjectId(), null, array('class' => 'combobox'));
break;
case 'ProjectMessages':
return select_message($control_name, active_project(), $this->getRelObjectId(), array('class' => 'combobox'));
break;
case 'ProjectMilestones':
return select_milestone($control_name, active_project(), $this->getRelObjectId(), array('class' => 'combobox'));
break;
case 'ProjectTasks':
break;
case 'ProjectTaskLists':
return select_task_list($control_name, active_project(), $this->getRelObjectId(), array('class' => 'combobox'));
break;
case 'ProjectTickets':
return select_ticket($control_name, active_project(), $this->getRelObjectId(), array('class' => 'combobox'));
break;
default:
return '';
break;
}
// switch
}
示例3: view_milestones
function view_milestones()
{
ajx_current("empty");
$project = active_project();
$tag = active_tag();
$assigned_by = array_var($_GET, 'assigned_by', '');
$assigned_to = array_var($_GET, 'assigned_to', '');
$status = array_var($_GET, 'status', "pending");
// $assigned_to = explode(':', $assigned_to);
$to_company = array_var($assigned_to, 0, null);
$to_user = array_var($assigned_to, 1, null);
$assigned_by = explode(':', $assigned_by);
$by_company = array_var($assigned_by, 0, null);
$by_user = array_var($assigned_by, 1, null);
$milestones = ProjectMilestones::getProjectMilestones($project, null, 'ASC', $tag, $to_company, $to_user, $by_user, $status == 'pending');
$milestones_bottom_complete = array();
$ms = array();
foreach ($milestones as $milestone) {
if (!$milestone->isCompleted()) {
$milestones_bottom_complete[] = $milestone;
$ms[] = $this->milestone_item($milestone);
}
}
foreach ($milestones as $milestone) {
if ($milestone->isCompleted()) {
$milestones_bottom_complete[] = $milestone;
$ms[] = $this->milestone_item($milestone);
}
}
ajx_extra_data(array("milestones" => $ms));
tpl_assign('milestones', $milestones_bottom_complete);
tpl_assign('project', $project);
}
示例4: select_project_folder
/**
* Render select folder box
*
* @param string $name Control name
* @param Project $project
* @param integer $selected ID of selected folder
* @param array $attributes Select box attributes
* @return string
*/
function select_project_folder($name, $project = null, $selected = null, $attributes = null)
{
if (is_null($project)) {
$project = active_project();
}
// if
if (!$project instanceof Project) {
throw new InvalidInstanceError('$project', $project, 'Project');
}
// if
if (is_array($attributes)) {
if (!isset($attributes['class'])) {
$attributes['class'] = 'select_folder';
}
} else {
$attributes = array('class' => 'select_folder');
}
// if
$options = array(option_tag(lang('none'), 0));
$folders = $project->getFolders();
if (is_array($folders)) {
foreach ($folders as $folder) {
$option_attributes = $folder->getId() == $selected ? array('selected' => true) : null;
$options[] = option_tag($folder->getName(), $folder->getId(), $option_attributes);
}
// foreach
}
// if
return select_box($name, $options, $attributes);
}
示例5: wiki_replace_link_callback
function wiki_replace_link_callback($matches)
{
if (count($matches) < 2) {
return null;
}
if ($matches[1] == 'wiki') {
$rev = Revisions::instance()->getTableName(true);
$page = Wiki::instance()->getTableName(true);
$where1 = 'WHERE page_id = ' . $matches[2] . ' AND project_id = ' . active_project()->getId();
$where2 = 'WHERE id = ' . $matches[2] . ' AND project_id = ' . active_project()->getId();
$sql = "SELECT page_id, name FROM {$rev} {$where1} ";
$sql .= "AND revision = ( select revision from {$page} {$where2} )";
//echo $sql;
$row = DB::executeOne($sql);
if (!count($row)) {
return null;
}
$url = get_url($matches[1], 'view', array('id' => $matches[2]));
$url = str_replace('&', '&', $url);
return '"' . $row['name'] . '(' . $row['page_id'] . ')":' . $url;
}
$user = Users::instance()->getTableName(true);
$where1 = 'WHERE id = ' . $matches[2];
$sql = "SELECT id, display_name FROM {$user} {$where1} ";
echo $sql;
$row = DB::executeOne($sql);
if (!count($row)) {
return null;
}
$url = get_url($matches[1], 'card', array('id' => $matches[2]));
$url = str_replace('&', '&', $url);
return '"' . $row['display_name'] . '(' . $row['id'] . ')":' . $url;
}
示例6: ExecuteQuery
function ExecuteQuery()
{
$this->data = array();
$queries = ObjectController::getDashboardObjectQueries(active_project(), null, true);
$query = '';
foreach ($queries as $k => $q) {
if (substr($k, -8) == 'Comments') {
continue;
}
if ($query == '') {
$query = $q;
} else {
$query .= " \n union \n" . $q;
}
}
$ret = 0;
$res = DB::execute($query);
if (!$res) {
return $ret;
}
$rows = $res->fetchAll();
if (!$rows) {
return $ret;
}
foreach ($rows as $row) {
$value = 0;
if (isset($row['quantity'])) {
$value = $row['quantity'];
}
$this->data['values'][0]['labels'][] = $row['objectName'];
$this->data['values'][0]['values'][] = $value;
}
//foreach
}
示例7: times_my_tasks_dropdown
function times_my_tasks_dropdown()
{
echo '<li class="header"><a href="' . get_url('time', 'index') . '">' . lang('time') . '</a></li>';
if (ProjectTime::canAdd(logged_user(), active_project())) {
echo '<li><a href="' . get_url('time', 'add') . '">' . lang('add time') . '</a></li>';
}
// if
}
示例8: wiki_my_tasks_dropdown
function wiki_my_tasks_dropdown()
{
echo '<li class="header"><a href="' . get_url('wiki', 'index') . '">' . lang('wiki') . '</a></li>';
if (WikiPage::canAdd(logged_user(), active_project())) {
echo '<li><a href="' . get_url('wiki', 'add') . '">' . lang('add wiki page') . '</a></li>';
}
// if
}
示例9: links_my_tasks_dropdown
function links_my_tasks_dropdown()
{
echo '<li class="header"><a href="' . get_url('links', 'index') . '">' . lang('links') . '</a></li>';
if (ProjectLink::canAdd(logged_user(), active_project())) {
echo '<li><a href="' . get_url('links', 'add_link') . '">' . lang('add link') . '</a></li>';
}
// if
}
示例10: form_my_tasks_dropdown
function form_my_tasks_dropdown()
{
echo '<li class="header"><a href="' . get_url('form', 'index') . '">' . lang('forms') . '</a></li>';
if (ProjectForm::canAdd(logged_user(), active_project())) {
echo '<li><a href="' . get_url('form', 'add') . '">' . lang('add form') . '</a></li>';
}
// if
}
示例11: task_list_move_link
function task_list_move_link()
{
global $the_task_list;
// This check is probably insufficient, since it "deletes" the task listfrom this project, and adds it to another project, so those checks might be better.
if (ProjectTaskList::canAdd(logged_user(), active_project())) {
action_link($the_task_list->getMoveUrl(), '/icons/move.png', 'move');
}
}
示例12: canGoOn
/**
* Determine if a user canGoOn to deny access to files in projects
* to which the user has not been assigned.
*
* @access public
* @return null
*/
function canGoOn()
{
if (active_project() == null || !logged_user()->isProjectUser(active_project())) {
flash_error(lang('no access permissions'));
$this->redirectTo('dashboard');
}
// if
}
示例13: tickets_my_tasks_dropdown
function tickets_my_tasks_dropdown()
{
if (use_permitted(logged_user(), active_project(), 'tickets')) {
echo '<li class="header"><a href="' . get_url('tickets', 'index') . '">' . lang('tickets') . '</a></li>';
if (ProjectTicket::canAdd(logged_user(), active_project())) {
echo '<li><a href="' . get_url('tickets', 'add_ticket') . '">' . lang('add ticket') . '</a></li>';
}
// if
}
// if
}
示例14: project_crumbs
/**
* Set array of dashboard crumbs
*
* @param void
* @return null
*/
function project_crumbs() {
add_bread_crumb(lang('dashboard'), get_url('dashboard'));
if(active_project())
add_bread_crumb(active_project()->getName(), active_project()->getOverviewUrl());
$args = func_get_args();
if(!count($args)) return;
BreadCrumbs::instance()->addByFunctionArguments($args);
} // dashboard_crumbs
示例15: index
/**
* Show account index page
*
* @access public
* @param void
* @return null
*/
function index()
{
$this->setHelp("account");
$this->setTemplate("card");
$this->setControllerName("user");
tpl_assign('user', logged_user());
ajx_set_no_toolbar(true);
$pids = null;
if (active_project() instanceof Project) {
$pids = active_project()->getAllSubWorkspacesQuery();
}
$logs = ApplicationLogs::getOverallLogs(false, false, $pids, 15, 0, get_id());
tpl_assign('logs', $logs);
}