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


PHP Status::getAssocStatusList方法代码示例

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


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

示例1: array

if ($role_id < User::getRoleID('administrator')) {
    Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
$tpl->assign('project_list', Project::getAll());
if (@$_POST['cat'] == 'new') {
    $res = Status::insertCustomization($_POST['project'], $_POST['status'], $_POST['date_field'], $_POST['label']);
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the customization was added successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to add the new customization.'), Misc::MSG_ERROR), -2 => array(ev_gettext('Please enter the title for this new customization'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'update') {
    $res = Status::updateCustomization($_POST['id'], $_POST['project'], $_POST['status'], $_POST['date_field'], $_POST['label']);
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the customization was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the customization information.'), Misc::MSG_ERROR), -2 => array(ev_gettext('Please enter the title for this customization.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'delete') {
    $res = Status::removeCustomization(@$_POST['items']);
    Misc::mapMessages($res, array(true => array(ev_gettext('Thank you, the customization was deleted successfully.'), Misc::MSG_INFO), false => array(ev_gettext('An error occurred while trying to delete the customization information.'), Misc::MSG_ERROR)));
}
if (@$_GET['cat'] == 'edit') {
    $details = Status::getCustomizationDetails($_GET['id']);
    $tpl->assign(array('info' => $details, 'project_id' => $details['psd_prj_id'], 'status_list' => Status::getAssocStatusList($details['psd_prj_id'], true)));
}
$display_customer_fields = false;
@($prj_id = $_POST['prj_id'] ? $_POST['prj_id'] : $_GET['prj_id']);
if (!empty($prj_id)) {
    $tpl->assign('status_list', Status::getAssocStatusList($prj_id, true));
    $tpl->assign('project_id', $prj_id);
    $display_customer_fields = CRM::hasCustomerIntegration($prj_id);
}
$tpl->assign('date_fields', Issue::getDateFieldsAssocList($display_customer_fields));
$tpl->assign('project_list', Project::getAll());
$tpl->assign('list', Status::getCustomizationList());
$tpl->displayTemplate();
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:customize_listing.php

示例2: getActiveFilters

 /**
  * Returns an array of active filters
  *
  * @param   array $options The options array
  * @return array
  */
 public static function getActiveFilters($options)
 {
     $prj_id = Auth::getCurrentProject();
     $filter_info = self::getFiltersInfo();
     $return = array();
     foreach ($filter_info as $filter_key => $filter) {
         $display = false;
         if (isset($filter['param']) && isset($options[$filter['param']])) {
             $filter_details = $options[$filter['param']];
         }
         if (isset($filter['is_custom'])) {
             // custom fields
             $fld_id = $filter['fld_id'];
             if (!isset($options['custom_field'][$fld_id]) || empty($options['custom_field'][$fld_id])) {
                 continue;
             } elseif ($filter['fld_type'] == 'date' && empty($options['custom_field'][$fld_id]['Year'])) {
                 continue;
             } elseif ($filter['fld_type'] == 'integer') {
                 if (!isset($options['custom_field'][$fld_id]['value']) || empty($options['custom_field'][$fld_id]['value'])) {
                     continue;
                 } else {
                     $filter_details = $options['custom_field'][$fld_id];
                     switch ($filter_details['filter_type']) {
                         case 'ge':
                             $display = ev_gettext('%1$s or greater', $filter_details['value']);
                             break;
                         case 'le':
                             $display = ev_gettext('%1$s or less', $filter_details['value']);
                             break;
                         case 'gt':
                             $display = ev_gettext('Greater than %1$s', $filter_details['value']);
                             break;
                         case 'lt':
                             $display = ev_gettext('Less than %1$s', $filter_details['value']);
                             break;
                         default:
                             $display = $filter_details['value'];
                     }
                 }
             } elseif (in_array($filter['fld_type'], array('multiple', 'combo'))) {
                 $display = implode(', ', Custom_Field::getOptions($fld_id, $options['custom_field'][$fld_id]));
             } else {
                 $display = $options['custom_field'][$fld_id];
             }
         } elseif (!isset($options[$filter['param']]) || empty($options[$filter['param']]) || in_array($filter_key, array('sort_order', 'sort_by', 'rows', 'search_type'))) {
             continue;
         } elseif (isset($filter['is_date']) && $filter['is_date'] == true) {
             if (!empty($filter_details['Year']) || isset($filter_details['time_period'])) {
                 switch ($filter_details['filter_type']) {
                     case 'in_past':
                         $display = ev_gettext('In Past %1$s hours', $filter_details['time_period']);
                         break;
                     case 'null':
                         $display = ev_gettext('Is NULL');
                         break;
                     case 'between':
                         $end = $options[$filter['param'] . '_end'];
                         $display = ev_gettext('Is between %1$s-%2$s-%3$s AND %4$s-%5$s-%6$s', $filter_details['Year'], $filter_details['Month'], $filter_details['Day'], $end['Year'], $end['Month'], $end['Day']);
                         break;
                     case 'greater':
                         $display = ev_gettext('Is greater than %1$s-%2$s-%3$s', $filter_details['Year'], $filter_details['Month'], $filter_details['Day']);
                         break;
                     case 'less':
                         $display = ev_gettext('Is less than %1$s-%2$s-%3$s', $filter_details['Year'], $filter_details['Month'], $filter_details['Day']);
                 }
             }
         } elseif ($filter['param'] == 'status') {
             $statuses = Status::getAssocStatusList($prj_id);
             $display = $statuses[$filter_details];
         } elseif ($filter['param'] == 'category') {
             $categories = Category::getAssocList($prj_id);
             if (is_array($filter_details)) {
                 $active_categories = array();
                 foreach ($filter_details as $category) {
                     $active_categories[] = $categories[$category];
                 }
                 $display = implode(', ', $active_categories);
             } else {
                 $display = $categories[$filter_details];
             }
         } elseif ($filter['param'] == 'priority') {
             $priorities = Priority::getAssocList($prj_id);
             $display = $priorities[$filter_details];
         } elseif ($filter['param'] == 'severity') {
             $severities = Severity::getAssocList($prj_id);
             $display = $severities[$filter_details];
         } elseif ($filter['param'] == 'users') {
             if ($filter_details == -1) {
                 $display = ev_gettext('un-assigned');
             } elseif ($filter_details == -2) {
                 $display = ev_gettext('myself and un-assigned');
             } elseif ($filter_details == -3) {
                 $display = ev_gettext('myself and my group');
             } elseif ($filter_details == -4) {
//.........这里部分代码省略.........
开发者ID:dabielkabuto,项目名称:eventum,代码行数:101,代码来源:class.filter.php

示例3: isset

        $tpl->assign(array('email' => $email, 'parent_email_id' => $_GET['id']));
    }
}
// special handling when someone tries to 'reply' to an issue
if ($cat == 'reply') {
    $details = Issue::getReplyDetails($_GET['issue_id']);
    if ($details != '') {
        $header = Misc::formatReplyPreamble($details['created_date_ts'], $details['reporter']);
        $details['seb_body'] = $header . Misc::formatReply($details['description']);
        $details['sup_from'] = Mail_Helper::getFormattedName($details['reporter'], $details['reporter_email']);
        $tpl->assign(array('email' => $details, 'parent_email_id' => 0, 'extra_title' => 'Issue #' . $_GET['issue_id'] . ': Reply'));
    }
}
if (!empty($issue_id)) {
    // list the available statuses
    $tpl->assign('statuses', Status::getAssocStatusList($prj_id, false));
    $tpl->assign('current_issue_status', Issue::getStatusID($issue_id));
    // set if the current user is allowed to send emails on this issue or not
    $sender_details = User::getDetails($usr_id);
    $tpl->assign('can_send_email', Support::isAllowedToEmail($issue_id, $sender_details['usr_email']));
    $tpl->assign('subscribers', Notification::getSubscribers($issue_id, 'emails'));
}
if (!empty($_GET['ema_id']) || !empty($_POST['ema_id'])) {
    $ema_id = isset($_GET['ema_id']) ? (int) $_GET['ema_id'] : (isset($_POST['ema_id']) ? (int) $_POST['ema_id'] : null);
    $tpl->assign('ema_id', $ema_id);
}
$user_prefs = Prefs::get($usr_id);
// list of users to display in the lookup field in the To: and Cc: fields
$t = Project::getAddressBook($prj_id, $issue_id);
$tpl->assign(array('from' => User::getFromHeader($usr_id), 'assoc_users' => $t, 'assoc_emails' => array_keys($t), 'canned_responses' => Email_Response::getAssocList($prj_id), 'js_canned_responses' => Email_Response::getAssocListBodies($prj_id), 'current_user_prefs' => $user_prefs, 'issue_access' => Access::getIssueAccessArray($issue_id, $usr_id), 'max_attachment_size' => Attachment::getMaxAttachmentSize(), 'max_attachment_bytes' => Attachment::getMaxAttachmentSize(true)));
// don't add signature if it already exists. Note: This won't handle multiple user duplicate sigs.
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:send.php

示例4: getAssocStatus

 /**
  * Method used to get an associative array of the list of statuses and the
  * total number of issues associated with each of them.
  *
  * @param   boolean $hide_closed If closed issues should be hidden.
  * @return  array List of statuses
  */
 public static function getAssocStatus($hide_closed = true)
 {
     $prj_id = Auth::getCurrentProject();
     $list = Status::getAssocStatusList($prj_id);
     $stats = array();
     foreach ($list as $sta_id => $sta_title) {
         $stmt = 'SELECT
                     COUNT(*) AS total_items
                  FROM
                     {{%issue}},
                     {{%status}}
                  WHERE
                     iss_sta_id = sta_id AND
                     iss_prj_id=? AND
                     iss_sta_id=?';
         if ($hide_closed) {
             $stmt .= ' AND
                     sta_is_closed = 0';
         }
         $res = (int) DB_Helper::getInstance()->getOne($stmt, array($prj_id, $sta_id));
         if ($res > 0) {
             $stats[$sta_title] = $res;
         }
     }
     arsort($stats);
     return $stats;
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:34,代码来源:class.stats.php

示例5: Template_Helper

 * For the full copyright and license information,
 * please see the COPYING and AUTHORS files
 * that were distributed with this source code.
 */
require_once __DIR__ . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('reports/category_statuses.tpl.html');
Auth::checkAuthentication();
if (!Access::canAccessReports(Auth::getUserID())) {
    echo 'Invalid role';
    exit;
}
// TODO: move this query to some class
$prj_id = Auth::getCurrentProject();
$categories = Category::getAssocList($prj_id);
$statuses = Status::getAssocStatusList($prj_id, true);
$data = array();
foreach ($categories as $cat_id => $cat_title) {
    $data[$cat_id] = array('title' => $cat_title, 'statuses' => array());
    foreach ($statuses as $sta_id => $sta_title) {
        $sql = 'SELECT
                    count(*)
                FROM
                    {{%issue}}
                WHERE
                    iss_prj_id = ? AND
                    iss_sta_id = ? AND
                    iss_prc_id = ?';
        try {
            $res = DB_Helper::getInstance()->getOne($sql, array($prj_id, $sta_id, $cat_id));
        } catch (DbException $e) {
开发者ID:dabielkabuto,项目名称:eventum,代码行数:31,代码来源:category_statuses.php

示例6: getAllowedStatuses

 /**
  * Method is called to return the list of statuses valid for a specific issue.
  *
  * @param   integer $prj_id The projectID
  * @param   integer $issue_id The ID of the issue.
  * @return  array An associative array of statuses valid for this issue.
  */
 function getAllowedStatuses($prj_id, $issue_id)
 {
     $statuses = Status::getAssocStatusList($prj_id, true);
     // you should perform any logic and remove any statuses you need to here.
     return $statuses;
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:13,代码来源:class.customerservice.php

示例7: Template_API

// | 59 Temple Place - Suite 330                                          |
// | Boston, MA 02111-1307, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <jpm@mysql.com>                             |
// +----------------------------------------------------------------------+
//
// @(#) $Id: s.searchbar.php 1.3 03/09/26 02:06:54-00:00 jpradomaia $
//
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.category.php";
include_once APP_INC_PATH . "class.priority.php";
include_once APP_INC_PATH . "class.misc.php";
include_once APP_INC_PATH . "class.release.php";
include_once APP_INC_PATH . "class.project.php";
include_once APP_INC_PATH . "class.filter.php";
include_once APP_INC_PATH . "class.status.php";
$tpl = new Template_API();
$tpl->setTemplate("searchbar.tpl.html");
Auth::checkAuthentication(APP_COOKIE);
$prj_id = Auth::getCurrentProject();
$tpl->assign("priorities", Priority::getList($prj_id));
$tpl->assign("status", Status::getAssocStatusList($prj_id));
$tpl->assign("users", Project::getUserAssocList($prj_id));
$tpl->assign("categories", Category::getAssocList($prj_id));
$tpl->assign("custom", Filter::getListing($prj_id));
$options = Issue::saveSearchParams();
$tpl->assign("options", $options);
$tpl->displayTemplate();
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:searchbar.php

示例8: getAllowedStatuses

 /**
  * Method is called to return the list of statuses valid for a specific issue.
  *
  * @param   integer $prj_id The projectID
  * @param   integer $issue_id The ID of the issue.
  * @return  array An associative array of statuses valid for this issue.
  */
 public function getAllowedStatuses($prj_id, $issue_id)
 {
     return Status::getAssocStatusList($prj_id, false);
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:11,代码来源:class.abstract_workflow_backend.php

示例9: date

$tpl->setTemplate("reports/stalled_issues.tpl.html");
Auth::checkAuthentication(APP_COOKIE);
if (Auth::getCurrentRole() <= User::getRoleID("Customer")) {
    echo "Invalid role";
    exit;
}
$prj_id = Auth::getCurrentProject();
if (count(@$_REQUEST['before']) < 1) {
    $before = date("Y-m-d", time() - MONTH);
} else {
    $before = join('-', $_REQUEST['before']);
}
if (count(@$_REQUEST['after']) < 1) {
    $after = date("Y-m-d", time() - YEAR);
} else {
    $after = join('-', $_REQUEST['after']);
}
if (empty($_REQUEST['sort_order'])) {
    $_REQUEST['sort_order'] = 'ASC';
}
$data = Report::getStalledIssuesByUser($prj_id, @$_REQUEST['developers'], @$_REQUEST['status'], $before, $after, $_REQUEST['sort_order']);
$groups = Group::getAssocList($prj_id);
$assign_options = array();
if (count($groups) > 0 && Auth::getCurrentRole() > User::getRoleID("Customer")) {
    foreach ($groups as $grp_id => $grp_name) {
        $assign_options["grp:{$grp_id}"] = "Group: " . $grp_name;
    }
}
$assign_options += Project::getUserAssocList($prj_id, 'active', User::getRoleID('Standard User'));
$tpl->assign(array("users" => $assign_options, "before_date" => $before, "after_date" => $after, "data" => $data, "developers" => @$_REQUEST['developers'], "status_list" => Status::getAssocStatusList($prj_id), "status" => @$_REQUEST['status'], "sort_order" => $_REQUEST['sort_order']));
$tpl->displayTemplate();
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:stalled_issues.php

示例10:

                $show_category = 0;
            }
            $cookie = Auth::getCookieInfo(APP_PROJECT_COOKIE);
            if (!empty($auto_switched_from)) {
                $tpl->assign(array("project_auto_switched" => 1, "old_project" => Project::getName($auto_switched_from)));
            }
            $setup = Setup::load();
            $tpl->assign("allow_unassigned_issues", @$setup["allow_unassigned_issues"]);
            $tpl->assign(array('next_issue' => @$sides['next'], 'previous_issue' => @$sides['previous'], 'subscribers' => Notification::getSubscribers($issue_id), 'custom_fields' => Custom_Field::getListByIssue($prj_id, $issue_id), 'files' => Attachment::getList($issue_id), 'emails' => Support::getEmailsByIssue($issue_id), 'zones' => Date_API::getTimezoneList(), 'users' => Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')), 'ema_id' => Email_Account::getEmailAccount(), 'max_attachment_size' => Attachment::getMaxAttachmentSize(), 'show_releases' => $show_releases, 'show_category' => $show_category, 'categories' => Category::getAssocList($prj_id), 'quarantine' => Issue::getQuarantineInfo($issue_id)));
            if ($role_id != User::getRoleID('customer')) {
                if (@$_REQUEST['show_all_drafts'] == 1) {
                    $show_all_drafts = true;
                } else {
                    $show_all_drafts = false;
                }
                if (Workflow::hasWorkflowIntegration($prj_id)) {
                    $statuses = Workflow::getAllowedStatuses($prj_id, $issue_id);
                    // if currently selected release is not on list, go ahead and add it.
                } else {
                    $statuses = Status::getAssocStatusList($prj_id);
                }
                if (!empty($details['iss_sta_id']) && empty($statuses[$details['iss_sta_id']])) {
                    $statuses[$details['iss_sta_id']] = Status::getStatusTitle($details['iss_sta_id']);
                }
                $time_entries = Time_Tracking::getListing($issue_id);
                $tpl->assign(array('notes' => Note::getListing($issue_id), 'is_user_assigned' => Issue::isAssignedToUser($issue_id, $usr_id), 'is_user_authorized' => Authorized_Replier::isUserAuthorizedReplier($issue_id, $usr_id), 'phone_entries' => Phone_Support::getListing($issue_id), 'phone_categories' => Phone_Support::getCategoryAssocList($prj_id), 'checkins' => SCM::getCheckinList($issue_id), 'time_categories' => Time_Tracking::getAssocCategories(), 'time_entries' => $time_entries['list'], 'total_time_spent' => $time_entries['total_time_spent'], 'impacts' => Impact_Analysis::getListing($issue_id), 'statuses' => $statuses, 'drafts' => Draft::getList($issue_id, $show_all_drafts), 'groups' => Group::getAssocList($prj_id)));
            }
        }
    }
}
$tpl->displayTemplate();
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:view.php

示例11: array

// customers should not be able to see this page
$role_id = Auth::getCurrentRole();
if ($role_id < User::getRoleID('Standard User')) {
    Auth::redirect(APP_RELATIVE_URL . "list.php");
}
$prj_id = Auth::getCurrentProject();
// generate options for assign list. If there are groups and user is above a customer, include groups
$groups = Group::getAssocList($prj_id);
$users = Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer'));
$assign_options = array("" => "Any", "-1" => "un-assigned", "-2" => "myself and un-assigned");
if (User::getGroupID(Auth::getUserID()) != '') {
    $assign_options['-3'] = 'myself and my group';
    $assign_options['-4'] = 'myself, un-assigned and my group';
}
if (count($groups) > 0 && $role_id > User::getRoleID("Customer")) {
    foreach ($groups as $grp_id => $grp_name) {
        $assign_options["grp:{$grp_id}"] = "Group: " . $grp_name;
    }
}
$assign_options += $users;
$tpl->assign(array("cats" => Category::getAssocList($prj_id), "priorities" => Priority::getList($prj_id), "status" => Status::getAssocStatusList($prj_id), "users" => $assign_options, "releases" => Release::getAssocList($prj_id, TRUE), "custom" => Filter::getListing($prj_id), "custom_fields" => Custom_Field::getListByProject($prj_id, ''), "reporters" => Project::getReporters($prj_id)));
if (!empty($HTTP_GET_VARS["custom_id"])) {
    $check_perm = true;
    if (Filter::isGlobal($HTTP_GET_VARS["custom_id"])) {
        if ($role_id >= User::getRoleID('Manager')) {
            $check_perm = false;
        }
    }
    $tpl->assign("options", Filter::getDetails($HTTP_GET_VARS["custom_id"], $check_perm));
}
$tpl->displayTemplate();
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:adv_search.php

示例12: getAssocStatus

 /**
  * Method used to get an associative array of the list of statuses and the
  * total number of issues associated with each of them.
  *
  * @access  public
  * @return  array List of statuses
  */
 function getAssocStatus()
 {
     $prj_id = Auth::getCurrentProject();
     $list = Status::getAssocStatusList($prj_id);
     $stats = array();
     foreach ($list as $sta_id => $sta_title) {
         $stmt = "SELECT\n                        COUNT(*) AS total_items\n                     FROM\n                        " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue\n                     WHERE\n                        iss_prj_id={$prj_id} AND\n                        iss_sta_id=" . $sta_id;
         $res = (int) $GLOBALS["db_api"]->dbh->getOne($stmt);
         if ($res > 0) {
             $stats[$sta_title] = $res;
         }
     }
     arsort($stats);
     return $stats;
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:22,代码来源:class.stats.php

示例13: array

        Misc::setMessage($update_tpl->getTemplateContents(false), Misc::MSG_HTML_BOX);
    }
    Auth::redirect(APP_RELATIVE_URL . 'view.php?id=' . $issue_id);
    exit;
}
$prj_id = Auth::getCurrentProject();
// if currently selected release is in the past, manually add it to list
$releases = Release::getAssocList($prj_id);
if ($details['iss_pre_id'] != 0 && empty($releases[$details['iss_pre_id']])) {
    $releases = array($details['iss_pre_id'] => $details['pre_title']) + $releases;
}
if (Workflow::hasWorkflowIntegration($prj_id)) {
    $statuses = Workflow::getAllowedStatuses($prj_id, $issue_id);
    // if currently selected release is not on list, go ahead and add it.
} else {
    $statuses = Status::getAssocStatusList($prj_id, false);
}
if (!empty($details['iss_sta_id']) && empty($statuses[$details['iss_sta_id']])) {
    $statuses[$details['iss_sta_id']] = Status::getStatusTitle($details['iss_sta_id']);
}
$columns = array(0 => array(), 1 => array());
if (CRM::hasCustomerIntegration($prj_id) and !empty($details['iss_customer_id'])) {
    $columns[0][] = array('title' => 'Customer', 'field' => 'customer_0');
    $columns[1][] = array('title' => 'Customer Contract', 'field' => 'customer_1');
}
$categories = Category::getAssocList($prj_id);
if (count($categories) > 0) {
    $columns[0][] = array('title' => ev_gettext('Category'), 'data' => $details['prc_title'], 'field' => 'category');
}
$columns[0][] = array('title' => ev_gettext('Status'), 'data' => $details['sta_title'], 'data_bgcolor' => $details['status_color'], 'field' => 'status');
$severities = Severity::getAssocList($prj_id);
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:update.php

示例14: array

// generate options for assign list. If there are groups and user is above a customer, include groups
$groups = Group::getAssocList($prj_id);
$users = Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer'));
$assign_options = array('' => ev_gettext('Any'), '-1' => ev_gettext('un-assigned'), '-2' => ev_gettext('myself and un-assigned'));
if (Auth::isAnonUser()) {
    unset($assign_options['-2']);
} elseif (User::getGroupID(Auth::getUserID()) != '') {
    $assign_options['-3'] = ev_gettext('myself and my group');
    $assign_options['-4'] = ev_gettext('myself, un-assigned and my group');
}
if (count($groups) > 0 && $role_id > User::getRoleID('Customer')) {
    foreach ($groups as $grp_id => $grp_name) {
        $assign_options["grp:{$grp_id}"] = 'Group: ' . $grp_name;
    }
}
$assign_options += $users;
$tpl->assign(array('cats' => Category::getAssocList($prj_id), 'priorities' => Priority::getList($prj_id), 'severities' => Severity::getList($prj_id), 'status' => Status::getAssocStatusList($prj_id), 'users' => $assign_options, 'releases' => Release::getAssocList($prj_id, true), 'custom' => Filter::getListing($prj_id), 'custom_fields' => Custom_Field::getListByProject($prj_id, ''), 'reporters' => Project::getReporters($prj_id), 'products' => Product::getAssocList(false)));
if (!empty($_GET['custom_id'])) {
    $check_perm = true;
    if (Filter::isGlobal($_GET['custom_id'])) {
        if ($role_id >= User::getRoleID('Manager')) {
            $check_perm = false;
        }
    }
    $options = Filter::getDetails($_GET['custom_id'], $check_perm);
} else {
    $options = array();
    $options['cst_rows'] = APP_DEFAULT_PAGER_SIZE;
}
$tpl->assign('options', $options);
$tpl->displayTemplate();
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:adv_search.php

示例15: update

 /**
  * Method used to update the details of the project information.
  *
  * @access  public
  * @return  integer 1 if the update worked, -1 otherwise
  */
 function update()
 {
     global $HTTP_POST_VARS;
     if (Validation::isWhitespace($HTTP_POST_VARS["title"])) {
         return -2;
     }
     $stmt = "UPDATE\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project\n                 SET\n                    prj_title='" . Misc::escapeString($HTTP_POST_VARS["title"]) . "',\n                    prj_status='" . Misc::escapeString($HTTP_POST_VARS["status"]) . "',\n                    prj_lead_usr_id=" . Misc::escapeInteger($HTTP_POST_VARS["lead_usr_id"]) . ",\n                    prj_initial_sta_id=" . Misc::escapeInteger($HTTP_POST_VARS["initial_status"]) . ",\n                    prj_outgoing_sender_name='" . Misc::escapeString($HTTP_POST_VARS["outgoing_sender_name"]) . "',\n                    prj_outgoing_sender_email='" . Misc::escapeString($HTTP_POST_VARS["outgoing_sender_email"]) . "',\n                    prj_remote_invocation='" . Misc::escapeString($HTTP_POST_VARS["remote_invocation"]) . "',\n                    prj_segregate_reporter='" . Misc::escapeString($HTTP_POST_VARS["segregate_reporter"]) . "',\n                    prj_customer_backend='" . Misc::escapeString($HTTP_POST_VARS["customer_backend"]) . "',\n                    prj_workflow_backend='" . Misc::escapeString($HTTP_POST_VARS["workflow_backend"]) . "'\n                 WHERE\n                    prj_id=" . Misc::escapeInteger($HTTP_POST_VARS["id"]);
     $res = $GLOBALS["db_api"]->dbh->query($stmt);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return -1;
     } else {
         // START ETEL MODIFIED
         /* This is terrible right here:
                     Project::removeUserByProjects(array($HTTP_POST_VARS["id"]), $HTTP_POST_VARS["users"]);
                     for ($i = 0; $i < count($HTTP_POST_VARS["users"]); $i++) {
                         if ($HTTP_POST_VARS["users"][$i] == $HTTP_POST_VARS["lead_usr_id"]) {
                             Project::associateUser($HTTP_POST_VARS["id"], $HTTP_POST_VARS["users"][$i], User::getRoleID("Manager"));
                         } elseif (User::getRoleByUser($HTTP_POST_VARS["users"][$i], $HTTP_POST_VARS["id"]) == '') {
                             // users who are now being associated with this project should be set to 'Standard User'
                             Project::associateUser($HTTP_POST_VARS["id"], $HTTP_POST_VARS["users"][$i], User::getRoleID("Standard User"));
                         }
                     }
         			*/
         // END ETEL MODIFIED
         $statuses = array_keys(Status::getAssocStatusList($HTTP_POST_VARS["id"]));
         if (count($statuses) > 0) {
             Status::removeProjectAssociations($statuses, $HTTP_POST_VARS["id"]);
         }
         foreach ($HTTP_POST_VARS['statuses'] as $sta_id) {
             Status::addProjectAssociation($sta_id, $HTTP_POST_VARS["id"]);
         }
         return 1;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:41,代码来源:class.project.php


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