本文整理汇总了PHP中Tracker_FormElementFactory::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracker_FormElementFactory::instance方法的具体用法?PHP Tracker_FormElementFactory::instance怎么用?PHP Tracker_FormElementFactory::instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracker_FormElementFactory
的用法示例。
在下文中一共展示了Tracker_FormElementFactory::instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFullRESTRepresentation
protected function getFullRESTRepresentation($value)
{
$classname_with_namespace = 'Tuleap\\Tracker\\REST\\Artifact\\ArtifactFieldValueFullRepresentation';
$artifact_field_value_full_representation = new $classname_with_namespace();
$artifact_field_value_full_representation->build($this->field->getId(), Tracker_FormElementFactory::instance()->getType($this->field), $this->field->getLabel(), $value);
return $artifact_field_value_full_representation;
}
示例2: getFullRESTValue
public function getFullRESTValue(PFUser $user, Tracker_Artifact_Changeset $changeset)
{
$classname_with_namespace = 'Tuleap\\Tracker\\REST\\Artifact\\ArtifactFieldValueFullRepresentation';
$artifact_field_value_full_representation = new $classname_with_namespace();
$artifact_field_value_full_representation->build($this->getId(), Tracker_FormElementFactory::instance()->getType($this), $this->getLabel(), (int) $changeset->getArtifact()->getPerTrackerArtifactId());
return $artifact_field_value_full_representation;
}
示例3: buildProperties
/**
* build pie chart properties
*
* @param Pie_Engine $engine object
*/
function buildProperties($engine)
{
parent::buildProperties($engine);
$engine->data = array();
$engine->legend = null;
$result = array();
$ff = Tracker_FormElementFactory::instance();
$af = $ff->getFormElementById($this->chart->getField_base());
if ($af && $af->userCanRead()) {
$select = " SELECT count(a.id) AS nb, " . $af->getQuerySelect();
$from = " FROM tracker_artifact AS a INNER JOIN tracker_changeset AS c ON (c.artifact_id = a.id) " . $af->getQueryFrom();
$where = " WHERE a.id IN (" . $this->artifacts['id'] . ") \n AND c.id IN (" . $this->artifacts['last_changeset_id'] . ") ";
$sql = $select . $from . $where . ' GROUP BY ' . $af->getQueryGroupBy();
$res = db_query($sql);
while ($data = db_fetch_array($res)) {
if ($data[$af->name] !== null) {
$engine->data[] = $data['nb'];
$engine->legend[] = $af->fetchRawValue($data[$af->name]);
} else {
$engine->data[] = $data['nb'];
$engine->legend[] = $GLOBALS['Language']->getText('global', 'none');
}
}
}
return $result;
}
示例4: __construct
public function __construct(AgileDashboard_Kanban $kanban, PFUser $user, $user_is_kanban_admin, $language, $project_id)
{
$user_preferences = new AgileDashboard_KanbanUserPreferences();
$kanban_representation_builder = new Tuleap\AgileDashboard\REST\v1\Kanban\KanbanRepresentationBuilder($user_preferences, new AgileDashboard_KanbanColumnFactory(new AgileDashboard_KanbanColumnDao(), $user_preferences), TrackerFactory::instance(), Tracker_FormElementFactory::instance());
$this->kanban_representation = json_encode($kanban_representation_builder->build($kanban, $user));
$this->user_is_kanban_admin = (int) $user_is_kanban_admin;
$this->language = $language;
$this->project_id = $project_id;
}
示例5: activatePlugins
public function activatePlugins()
{
$this->activatePlugin('tracker');
$this->activatePlugin('agiledashboard');
$this->activatePlugin('cardwall');
PluginManager::instance()->loadPlugins();
$this->tracker_artifact_factory = Tracker_ArtifactFactory::instance();
$this->tracker_formelement_factory = Tracker_FormElementFactory::instance();
$this->tracker_factory = TrackerFactory::instance();
return $this;
}
示例6: getConfigFactory
public function getConfigFactory()
{
if (!$this->config_factory) {
require_once 'OnTop/ConfigFactory.class.php';
require_once TRACKER_BASE_DIR . '/Tracker/TrackerFactory.class.php';
$tracker_factory = TrackerFactory::instance();
$element_factory = Tracker_FormElementFactory::instance();
$this->config_factory = new Cardwall_OnTop_ConfigFactory($tracker_factory, $element_factory);
}
return $this->config_factory;
}
示例7: instance
/**
* The singleton method
*
* @return WorkflowFactory
*/
public static function instance()
{
if (!isset(self::$_instance)) {
$formelement_factory = Tracker_FormElementFactory::instance();
$logger = new WorkflowBackendLogger(new BackendLogger());
$trigger_rules_manager = new Tracker_Workflow_Trigger_RulesManager(new Tracker_Workflow_Trigger_RulesDao(), $formelement_factory, new Tracker_Workflow_Trigger_RulesProcessor(UserManager::instance()->getUserById(Tracker_Workflow_WorkflowUser::ID), $logger), $logger);
$c = __CLASS__;
self::$_instance = new $c(TransitionFactory::instance(), TrackerFactory::instance(), $formelement_factory, $trigger_rules_manager, $logger);
}
return self::$_instance;
}
示例8: __construct
public function __construct($tracker, $label, $name, $value, $with_none = false, $onchange = "", $desc = "")
{
parent::__construct($label, $name, $value, $with_none, $onchange, $desc);
require_once TRACKER_BASE_DIR . '/Tracker/FormElement/Tracker_FormElementFactory.class.php';
$aff = Tracker_FormElementFactory::instance();
foreach ($aff->getUsedDateFields($tracker) as $field) {
if ($field->userCanRead()) {
$selected = $this->value == $field->id;
$this->addOption(new HTML_Element_Option($field->getLabel(), $field->id, $selected));
}
}
}
示例9: __construct
public function __construct(Cardwall_PaneInfo $info, Planning_Milestone $milestone, Cardwall_OnTop_Config $config, PFUser $user, Planning_MilestoneFactory $milestone_factory)
{
$this->info = $info;
$this->milestone = $milestone;
$this->config = $config;
$this->user = $user;
$this->milestone_factory = $milestone_factory;
$this->artifact_factory = Tracker_ArtifactFactory::instance();
$this->tracker_form_element_factory = Tracker_FormElementFactory::instance();
$this->user_manager = UserManager::instance();
$this->planning_factory = PlanningFactory::build();
}
示例10: __construct
public function __construct(AgileDashboard_Kanban $kanban, PFUser $user, $user_is_kanban_admin, $language, $project_id)
{
$user_preferences = new AgileDashboard_KanbanUserPreferences();
$kanban_representation_builder = new Tuleap\AgileDashboard\REST\v1\Kanban\KanbanRepresentationBuilder($user_preferences, new AgileDashboard_KanbanColumnFactory(new AgileDashboard_KanbanColumnDao(), $user_preferences), new AgileDashboard_KanbanActionsChecker(TrackerFactory::instance(), new AgileDashboard_PermissionsManager(), Tracker_FormElementFactory::instance()));
$this->kanban_representation = json_encode($kanban_representation_builder->build($kanban, $user));
$this->user_is_kanban_admin = (int) $user_is_kanban_admin;
$this->language = $language;
$this->project_id = $project_id;
$this->user_id = $user->getId();
$this->view_mode = $user->getPreference('agiledashboard_kanban_item_view_mode_' . $kanban->getId());
$this->nodejs_server = ForgeConfig::get('nodejs_server');
}
示例11: buildProperties
/**
* build pie chart properties
*
* @param Pie_Engine $engine object
*/
function buildProperties($engine)
{
parent::buildProperties($engine);
$engine->data = array();
$engine->xaxis = null;
$engine->labels = null;
$engine->legend = null;
$result = array();
$ff = Tracker_FormElementFactory::instance();
/** @var Tracker_FormElement_Field_List $af */
$af = $ff->getFormElementById($this->chart->getField_base());
if ($af && $af->userCanRead()) {
$select_group = $from_group = $group_group = $order_group = '';
if ($this->chart->getField_group()) {
$gf = $ff->getFormElementById($this->chart->getField_group());
if ($gf && $gf->userCanRead()) {
$select_group = ', ' . $gf->getQuerySelect();
$from_group = ' ' . $gf->getQueryFrom();
$group_group = ', ' . $gf->getQueryGroupBy();
$order_group = ', ' . $gf->getQueryOrderby();
}
}
$select = " SELECT count(a.id) AS nb, " . $af->getQuerySelectWithDecorator() . $select_group;
$from = " FROM tracker_artifact AS a \n INNER JOIN tracker_changeset AS c ON (c.artifact_id = a.id) " . $af->getQueryFromWithDecorator() . $from_group;
$where = " WHERE a.id IN (" . $this->artifacts['id'] . ") \n AND c.id IN (" . $this->artifacts['last_changeset_id'] . ") ";
$sql = $select . $from . $where . ' GROUP BY ' . $af->getQueryGroupBy() . $group_group . ' ORDER BY ' . $af->getQueryOrderby() . $order_group;
//echo($sql);
$none = $GLOBALS['Language']->getText('global', 'none');
$res = db_query($sql);
while ($data = db_fetch_array($res)) {
$color = $this->getColor($data);
if ($select_group) {
$engine->colors[$data[$af->name]] = $color;
$engine->data[$data[$af->name]][$data[$gf->name]] = $data['nb'];
$engine->xaxis[$data[$gf->name]] = $none;
$engine->labels[$data[$gf->name]] = $none;
if ($data[$gf->name] !== null) {
$engine->xaxis[$data[$gf->name]] = $gf->fetchRawValue($data[$gf->name]);
$engine->labels[$data[$gf->name]] = $gf->fetchRawValue($data[$gf->name]);
}
} else {
$engine->colors[] = $color;
$engine->data[] = $data['nb'];
}
$engine->legend[$data[$af->name]] = $none;
if ($data[$af->name] !== null) {
$engine->legend[$data[$af->name]] = $af->fetchRawValue($data[$af->name]);
}
}
}
return $result;
}
示例12: activatePlugins
public function activatePlugins()
{
$this->activatePlugin('tracker');
$this->activatePlugin('agiledashboard');
$this->activatePlugin('cardwall');
PluginManager::instance()->invalidateCache();
PluginManager::instance()->loadPlugins();
$this->tracker_artifact_factory = Tracker_ArtifactFactory::instance();
$this->tracker_formelement_factory = Tracker_FormElementFactory::instance();
$this->tracker_factory = TrackerFactory::instance();
$this->hierarchy_checker = new AgileDashboard_HierarchyChecker(PlanningFactory::build(), new AgileDashboard_KanbanFactory($this->tracker_factory, new AgileDashboard_KanbanDao()), $this->tracker_factory);
return $this;
}
示例13: setUp
public function setUp()
{
parent::setUp();
ForgeConfig::store();
ForgeConfig::set('codendi_log', dirname(__FILE__));
if (!self::$defect_tracker_converted && $this->thisTestIsNotUnderDevelopment()) {
$this->convertTrackers();
}
$this->form_element_factory = Tracker_FormElementFactory::instance();
$this->tracker_factory = TrackerFactory::instance();
$this->defect_tracker = $this->tracker_factory->getTrackerById(self::$defect_tracker_id);
$this->task_tracker = $this->tracker_factory->getTrackerById(self::$task_tracker_id);
}
示例14: build
/**
* @return Tracker_Artifact_XMLImport
*/
public function build(User\XML\Import\IFindUserFromXMLReference $user_finder)
{
$artifact_factory = Tracker_ArtifactFactory::instance();
$formelement_factory = Tracker_FormElementFactory::instance();
$fields_validator = new Tracker_Artifact_Changeset_AtGivenDateFieldsValidator($formelement_factory);
$changeset_dao = new Tracker_Artifact_ChangesetDao();
$changeset_comment_dao = new Tracker_Artifact_Changeset_CommentDao();
$logger = new Log_ConsoleLogger();
$send_notifications = false;
$artifact_creator = new Tracker_ArtifactCreator($artifact_factory, $fields_validator, new Tracker_Artifact_Changeset_InitialChangesetAtGivenDateCreator($fields_validator, $formelement_factory, $changeset_dao, $artifact_factory, EventManager::instance()));
$new_changeset_creator = new Tracker_Artifact_Changeset_NewChangesetAtGivenDateCreator($fields_validator, $formelement_factory, $changeset_dao, $changeset_comment_dao, $artifact_factory, EventManager::instance(), ReferenceManager::instance());
return new Tracker_Artifact_XMLImport(new XML_RNGValidator(), $artifact_creator, $new_changeset_creator, Tracker_FormElementFactory::instance(), $user_finder, new Tracker_FormElement_Field_List_Bind_Static_ValueDao(), $logger, $send_notifications);
}
示例15: buildProperties
/**
* build burndown chart properties
*
* @param Burndown_Engine $engine object
*/
public function buildProperties($engine)
{
parent::buildProperties($engine);
$form_element_factory = Tracker_FormElementFactory::instance();
$effort_field = $form_element_factory->getFormElementById($this->chart->getFieldId());
$type = $form_element_factory->getType($effort_field);
if ($this->isValidEffortField($effort_field, $type) && $this->isValidType($type)) {
$engine->data = $this->getBurnDownData($effort_field->getId(), $type);
}
$engine->legend = null;
$engine->start_date = $this->chart->getStartDate();
$engine->duration = $this->chart->getDuration();
}