/** * Return the icon for the given node. * @param PROJECT $node Draw the title for this project. * @return string */ public function get_icon_url($node) { if ($node->defines_options()) { return '{icons}buttons/edit'; } return parent::get_icon_url($node); }
/** * Shows trunk/branch/etc. for a project in HTML. * @param PROJECT $obj */ protected function _echo_details_as_html($obj) { ?> <table class="basic columns left-labels"> <?php if (!$obj->is_organizational()) { if ($obj->exists()) { $trunk = $obj->trunk(); $latest_release = $trunk->latest_release(); if ($latest_release) { $latest_text = $latest_release->title_as_link(); } else { $latest_text = 'Not released'; } $pending_release_query = $obj->release_query(); $pending_release_query->set_up_pending(); $next_release = $pending_release_query->first_object(); if ($next_release) { $next_text = $next_release->title_as_link(); } else { $next_text = 'None planned'; } ?> <tr> <th>Trunk</th> <td><?php echo $trunk->title_as_link(); ?> </td> </tr> <tr> <th>Latest</th> <td><?php echo $latest_text; ?> </td> </tr> <tr> <th>Next</th> <td><?php echo $next_text; ?> </td> </tr> <?php } } if (!!$this->_options->show_as_summary) { $options = $obj->options(); ?> <tr> <th>Assignees</th> <td> <?php switch ($options->assignee_group_type) { case Project_user_registered_only: echo 'Registered users'; break; case Project_user_all: echo 'All users'; break; case Project_user_group: $group = $options->assignee_group(); echo $group->title_as_link(); break; } ?> </td> </tr> <tr> <th>Reporters</th> <td> <?php switch ($options->reporter_group_type) { case Project_user_registered_only: echo 'Registered users'; break; case Project_user_all: echo 'All users'; break; case Project_user_group: $group = $options->reporter_group(); echo $group->title_as_link(); break; } ?> </td> </tr> <tr> <th>Deadlines</th> <td> <?php if (!$options->seconds_until_deadline) { echo 'Do not warn'; } else { echo 'Warn <span class="field">' . $options->release_warning_description() . '</span> before.'; } ?> </td> </tr> <?php if (!$obj->defines_options()) { ?> <tr> <th>Options</th> <td class="notes"> <?php $definer = $options->definer(); echo 'Defined in ' . $definer->title_as_link(); } ?> </td> </tr> <?php } ?> </table> <?php }
/** * Commit the changed to the database. * @param PROJECT $obj * @access private */ public function commit($obj) { $obj_exists = $obj->exists(); parent::commit($obj); if (!$obj_exists) { $trunk = $obj->new_object('branch'); $trunk->title = $this->value_for('branch_title'); $history_item = $trunk->new_history_item(); $trunk->store_if_different($history_item); $obj->trunk_id = $trunk->id; $obj->store(); } $options = $obj->options(); $options->apply_changes(); }
/** * Return the icon for the given node. * @param PROJECT $node Draw the title for this project. * @return string */ public function get_icon_url($node) { if ($node->defines_security()) { return '{icons}buttons/security'; } return parent::get_icon_url($node); }