| | <?php |
| |
|
| | namespace Kanboard\Model; |
| |
|
| | use Kanboard\Core\Base; |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | class ProjectTaskPriorityModel extends Base |
| | { |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | public function getPriorities(array $project) |
| | { |
| | $range = range($project['priority_start'], $project['priority_end']); |
| | return array_combine($range, $range); |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | public function getPrioritySettings($project_id) |
| | { |
| | return $this->db |
| | ->table(ProjectModel::TABLE) |
| | ->columns('priority_default', 'priority_start', 'priority_end') |
| | ->eq('id', $project_id) |
| | ->findOne(); |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | public function getDefaultPriority($project_id) |
| | { |
| | return $this->db->table(ProjectModel::TABLE)->eq('id', $project_id)->findOneColumn('priority_default') ?: 0; |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | public function getPriorityForProject($dst_project_id, $priority) |
| | { |
| | $settings = $this->getPrioritySettings($dst_project_id); |
| |
|
| | if ($priority >= $settings['priority_start'] && $priority <= $settings['priority_end']) { |
| | return $priority; |
| | } |
| |
|
| | return $settings['priority_default']; |
| | } |
| | } |
| |
|