Permalink
Browse files

Done the project issues list view

  • Loading branch information...
1 parent 8948faf commit 363c5ffe57ee739ae22eaaf2a350d210420e7e55 Filippo committed Jun 27, 2010
Showing with 1,620 additions and 1,484 deletions.
  1. BIN data/phpcollab_unit_test.db
  2. +3 −0 nbproject/private/private.xml
  3. +7 −0 plugins/idProjectManagementPlugin/config/doctrine/schema.yml
  4. +13 −0 plugins/idProjectManagementPlugin/lib/form/doctrine/PluginIssueReferenceForm.class.php
  5. +13 −0 plugins/idProjectManagementPlugin/lib/form/doctrine/PluginIssueUserForm.class.php
  6. +13 −0 plugins/idProjectManagementPlugin/lib/form/doctrine/PluginProjectUserForm.class.php
  7. +13 −0 plugins/idProjectManagementPlugin/lib/form/doctrine/PluginProjectsTrackersForm.class.php
  8. +3 −0 plugins/idProjectManagementPlugin/lib/form/idIssueForm.class.php
  9. +6 −1 plugins/idProjectManagementPlugin/lib/model/doctrine/PluginIssue.class.php
  10. +2 −0 plugins/idProjectManagementPlugin/lib/model/doctrine/PluginIssueTable.class.php
  11. +10 −0 plugins/idProjectManagementPlugin/lib/model/doctrine/PluginMilestone.class.php
  12. +22 −16 plugins/idProjectManagementPlugin/modules/idDashboard/templates/_milestone_boxes.php
  13. +1 −0 plugins/idProjectManagementPlugin/modules/idIssue/actions/actions.class.php
  14. +27 −0 plugins/idProjectManagementPlugin/modules/idIssue/actions/components.class.php
  15. +4 −0 plugins/idProjectManagementPlugin/modules/idIssue/config/view.yml
  16. +9 −0 plugins/idProjectManagementPlugin/modules/idIssue/templates/_sidebar.php
  17. +47 −8 plugins/idProjectManagementPlugin/modules/idIssue/templates/indexSuccess.php
  18. +4 −2 plugins/idProjectManagementPlugin/modules/idLogtime/templates/indexSuccess.php
  19. +121 −0 test/fixtures/comment.yml
  20. +19 −1,355 test/fixtures/fixtures.yml
  21. +49 −0 test/fixtures/issue_user.yml
  22. +285 −0 test/fixtures/issues.yml
  23. +76 −0 test/fixtures/logtime.yml
  24. +13 −0 test/fixtures/message.yml
  25. +46 −0 test/fixtures/milestones.yml
  26. +7 −0 test/fixtures/priorities.yml
  27. +37 −0 test/fixtures/profiles.yml
  28. +10 −0 test/fixtures/project_trackers.yml
  29. +44 −0 test/fixtures/project_user.yml
  30. +48 −0 test/fixtures/projects.yml
  31. +58 −0 test/fixtures/related_issues.yml
  32. +13 −0 test/fixtures/sfGuardGroup.yml
  33. +298 −0 test/fixtures/sfGuardGroupPermission.yml
  34. +133 −0 test/fixtures/sfGuardPermission.yml
  35. +76 −0 test/fixtures/sfGuardUser.yml
  36. +22 −0 test/fixtures/sfGuardUserGroup.yml
  37. +17 −0 test/fixtures/statuses.yml
  38. +7 −0 test/fixtures/tracker.yml
  39. +6 −5 test/functional/fe/idProjectIssueCreateAssociateWithMilestoneTest.php
  40. +1 −4 test/functional/fe/idProjectIssueCreateTest.php
  41. +1 −1 test/functional/fe/idProjectIssueCreateValidationTest.php
  42. +10 −8 test/functional/fe/idProjectIssueDeleteTest.php
  43. +1 −2 test/functional/fe/idProjectIssueEditTest.php
  44. +24 −37 test/functional/fe/idProjectIssueViewListPaginatedTest.php
  45. +0 −44 test/functional/fe/idProjectIssueViewListTest.php
  46. +1 −1 test/functional/fe/idProjectIssueWithMilestoneValidationTest.php
View
Binary file not shown.
@@ -6,4 +6,7 @@
<line>13</line>
</file>
</editor-bookmarks>
+ <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/1">
+ <file>file:/var/www/giugno/test/functional/fe/idProjectIssueCreateTest.php</file>
+ </open-files>
</project-private>
@@ -93,6 +93,13 @@ Milestone:
Issue:
actAs:
+ Timestampable:
+ created:
+ name: created_at
+ type: timestamp
+ updated:
+ name: updated_at
+ type: timestamp
EstimateTime:
estimatedtime:
name: estimated_time
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * PluginIssueReference form.
+ *
+ * @package ##PROJECT_NAME##
+ * @subpackage form
+ * @author ##AUTHOR_NAME##
+ * @version SVN: $Id: sfDoctrineFormPluginTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+abstract class PluginIssueReferenceForm extends BaseIssueReferenceForm
+{
+}
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * PluginIssueUser form.
+ *
+ * @package ##PROJECT_NAME##
+ * @subpackage form
+ * @author ##AUTHOR_NAME##
+ * @version SVN: $Id: sfDoctrineFormPluginTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+abstract class PluginIssueUserForm extends BaseIssueUserForm
+{
+}
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * PluginProjectUser form.
+ *
+ * @package ##PROJECT_NAME##
+ * @subpackage form
+ * @author ##AUTHOR_NAME##
+ * @version SVN: $Id: sfDoctrineFormPluginTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+abstract class PluginProjectUserForm extends BaseProjectUserForm
+{
+}
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * PluginProjectsTrackers form.
+ *
+ * @package ##PROJECT_NAME##
+ * @subpackage form
+ * @author ##AUTHOR_NAME##
+ * @version SVN: $Id: sfDoctrineFormPluginTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+abstract class PluginProjectsTrackersForm extends BaseProjectsTrackersForm
+{
+}
@@ -161,6 +161,9 @@ public function configure()
$this->validatorSchema['related_issue_list'] = new sfValidatorDoctrineChoiceMany(array('model' => 'Issue', 'required' => false, 'query' => $this->getQueryForRelatedIssue()));
$this->validatorSchema['estimated_time'] = new sfValidatorNumber(array('min' => '0', 'required' => false), array('min' => 'You cannot set a negative estimated time'));
+ unset($this['created_at']);
+ unset($this['updated_at']);
+
parent::configure();
}
}
@@ -59,12 +59,17 @@ public function getTotalLogTime()
public function isLate()
{
- return (bool)(!is_null($this->ending_date) && $this->ending_date < date('Y-m-d'));
+ return (bool)(!is_null($this->ending_date) && $this->ending_date < date('Y-m-d') && !$this->isClosed());
}
public function isUpcoming($days = 7)
{
return (bool)(!is_null($this->starting_date) && $this->starting_date >= date('Y-m-d') && $this->starting_date <= date('Y-m-d', strtotime('+'.$days.' days')));
}
+ public function isClosed()
+ {
+ return (bool) ($this->status == 'closed');
+ }
+
}
@@ -79,6 +79,8 @@ public function getQueryForProjectIssues($project_id)
$q = Doctrine_Query::create()
->from('Issue i')
->leftJoin('i.tracker t')
+ ->leftJoin('i.milestone m')
+ ->orderBy('i.id ASC')
->andWhere('i.project_id = ? ', $project_id);
return $q;
@@ -37,4 +37,14 @@ public function setUp()
parent::setUp();
$this->addListener(new EventLogDoctrineListener());
}
+
+ public function isClosed()
+ {
+ return (bool) $this->closed;
+ }
+
+ public function isLate()
+ {
+ return (bool)(!is_null($this->ending_date) && $this->ending_date < date('Y-m-d') && !$this->isClosed());
+ }
}
@@ -1,23 +1,29 @@
<?php if(count($milestones) > 0): ?>
<?php foreach($milestones as $milestone): ?>
- <div class="span-full box">
- <div class="span-full">
- <div class="span-5"><h3><?php echo link_to($milestone->title, '@show_milestone?project_id='.$milestone->project_id.'&milestone_id='.$milestone->id) ?></h3></div>
+ <?php if (empty($color)): ?>
+ <?php $color = $milestone->isLate()? 'red' : 'green';?>
+ <?php endif; ?>
+ <?php if (empty($label)): ?>
+ <?php $label = $milestone->isLate()? 'Late' : 'Upcoming';?>
+ <?php endif; ?>
+ <div class="span-full box">
+ <div class="span-full">
+ <div class="span-5"><h3><?php echo link_to($milestone->title, '@show_milestone?project_id='.$milestone->project_id.'&milestone_id='.$milestone->id) ?></h3></div>
+ <div class="span-2 last">
+ <strong class="milestone-<?php echo $color; ?>"><?php echo $label ?></strong>
+ </div>
+ </div>
+ <div class="span-full">
+ <div class="span-5">
+ For <?php echo link_to($milestone->project->name, '@show_project?id='.$milestone->project_id); ?><br/>
+ <?php if (isset($milestone->in_charge) && !is_null($milestone->in_charge)): ?>
+ Assgned to <strong><?php echo $milestone->getInCharge()->getProfile()->getShortName() ?></strong><br/>
+ <?php endif; ?>
+ </div>
<div class="span-2 last">
- <strong class="milestone-<?php echo $color; ?>"><?php echo $label ?></strong>
+ <strong class="milestone-<?php echo $color; ?>"><?php echo sprintf($days_message, get_days_of_difference($milestone->ending_date, date('Y-m-d'))); ?></strong><br/>
+ </div>
</div>
</div>
- <div class="span-full">
- <div class="span-5">
- For <?php echo link_to($milestone->project->name, '@show_project?id='.$milestone->project_id); ?><br/>
- <?php if (isset($milestone->in_charge) && !is_null($milestone->in_charge)): ?>
- Assgned to <strong><?php echo $milestone->getInCharge()->getProfile()->getShortName() ?></strong><br/>
- <?php endif; ?>
- </div>
- <div class="span-2 last">
- <strong class="milestone-<?php echo $color; ?>"><?php echo sprintf($days_message, get_days_of_difference($milestone->ending_date, date('Y-m-d'))); ?></strong><br/>
- </div>
- </div>
- </div>
<?php endforeach;?>
<?php endif; ?>
@@ -29,6 +29,7 @@ class idIssueActions extends sfActions
public function executeIndex(sfWebRequest $request)
{
$this->forwardUnless($this->getUser()->hasCredential('idIssue-Read'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
+ $this->forward404Unless($this->project = Doctrine::getTable('Project')->findOneBy('id', $request->getParameter('project_id')));
$this->pager = new sfDoctrinePager('Issue',10);
$this->pager->setQuery(Doctrine::getTable('Issue')->getQueryForProjectIssues($request->getParameter('project_id')));
@@ -0,0 +1,27 @@
+<?php
+/**
+ * This file is part of the phpCollab3 package.
+ * (c) 2009 Ideato s.r.l. <phpcollab@ideato.it>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * sfGuardUser/components.class.php
+ *
+ * @package phpCollab3
+ */
+
+/**
+ * idDashboardComponents components
+ */
+class idIssueComponents extends sfComponents
+{
+ public function executeSidebar()
+ {
+ $this->project = Doctrine::getTable('Project')->findOneBy('id', $this->getRequestParameter('project_id'));
+ $reports = Doctrine::getTable('Project')->getReportsOnProjectsWithEffortChart(array($this->project));
+
+ $this->project_report = (count($reports) > 0) ? $reports[$this->project->id] : null;
+ }
+}
+?>
@@ -1,3 +1,7 @@
+indexSuccess:
+ components:
+ sidebar: [idIssue, sidebar]
+
default:
components:
sidebar: []
@@ -0,0 +1,9 @@
+<?php use_helper('Dashboard') ?>
+
+<div class="span-8 prepend-1 last" id="sidebar">
+ <div class="title"><span>Projects</span></div>
+ <?php include_partial('idDashboard/project_report', array('project_id' => $project->id, 'project_report' => $project_report)) ?>
+
+ <div class="title"><span>Milestones</span></div>
+ <?php include_partial('idDashboard/milestone_boxes', array('milestones' => $project->Milestones, 'color' => '', 'label' => '', 'days_message' => '%d days'))?>
+</div>
@@ -1,13 +1,52 @@
<?php slot('title', __('Manage project issues')) ?>
-<div class="block" id="block-tables">
- <?php include_partial('create_issue_menu', array('project_id' => $sf_request->getParameter('project_id'))); ?>
- <div class="content">
- <div class="inner">
-
- <?php include_partial('idIssue/issues_list', array('pager' => $pager, 'url' => '@index_issue?project_id='.$sf_request->getParameter('project_id'))) ?>
-
+<div id="content" class="span-23">
+ <?php include_partial('idProject/sub_menu', array('project' => $project))?>
+
+ <?php if($pager->getNbResults() > 0): ?>
+ <div class="span-full">
+ <div class="title">
+ <span><?php echo __('Tickets'); ?></span>
+ <a id="add-log-time"class="button block-green medium-round" href="<?php echo url_for('@new_issue?project_id='.$project->id) ?>">Add</a>
+ </div>
+ <div class="menu">
+ <div class="span-3">Id</div>
+ <div class="span-5">Name</div>
+ <div class="span-3">Tracker</div>
+ <div class="span-3">Status</div>
+ <div class="span-3">Priority</div>
+ <div class="span-5 last">Assigned To</div>
+ </div>
+ <ul class="action time">
+ <?php foreach($pager->getResults() as $issue): ?>
+ <li class="icon-<?php echo $issue->isLate()? 'red' : 'green'; ?>">
+ <ul>
+ <li class="span-3"><?php echo link_to('#'.$issue->id, '@show_issue?project_id='.$issue->project_id.'&issue_id='.$issue->id) ?></li>
+ <li class="span-5"><?php echo $issue->title ?></li>
+ <li class="span-3"><?php echo $issue->tracker ?>&nbsp;</li>
+ <li class="span-3"><?php echo $issue->status ?>&nbsp;</li>
+ <li class="span-3"><?php echo $issue->priority ?>&nbsp;</li>
+ <li class="span-5 last">
+ <?php if (count($issue->users) > 0): ?>
+ <?php foreach ($issue->users as $user): ?>
+ <?php echo $user->getShortName(); ?><br/>
+ <?php endforeach; ?>
+ <?php endif; ?>
+ </li>
+ <li class="edit-delete">
+ <?php echo link_to(__('Edit'), '@edit_issue?project_id='.$issue->project_id.'&issue_id='.$issue->id) ?>&nbsp;&nbsp;
+ <?php echo link_to(__('Delete'), '@delete_issue?project_id='.$issue->project_id.'&issue_id='.$issue->id, array('confirm' => __('Do you really want to delete this issue??'))) ?>
+ </li>
+ </ul>
+ </li>
+ <?php endforeach; ?>
+ </ul>
+ </div>
+ <div class="span-full pagenation">
+ <ul>
+ <?php echo pager_navigation_log_time($pager, '@index_issue?project_id='.$issue->project_id) ?>
+ </ul>
</div>
- </div>
+ <?php endif; ?>
</div>
@@ -12,7 +12,9 @@
</div>
<?php if (count($pager->getResults()) !== false && count($pager->getResults()) == 0): ?>
- //no results//
+ <div class="span-full">
+ <p>No results.</p>
+ </div>
<?php else: ?>
<div class="span-full">
<div class="menu">
@@ -37,7 +39,7 @@
<li class="edit-delete">
<?php if($sf_user->hasCredential('idLogtime-Edit')): ?>
<?php echo link_to(__('Edit'), '@edit_logtime?id='.$log_time->getId()) ?>&nbsp;&nbsp;
- <?php echo link_to(__('Delete'), '@delete_logtime?id='.$log_time->getId(), array('confirm' => __('Do you really want to delete this tracker?'))) ?>
+ <?php echo link_to(__('Delete'), '@delete_logtime?id='.$log_time->getId(), array('confirm' => __('Do you really want to delete this log?'))) ?>
<?php endif; ?>
</li>
</ul>
Oops, something went wrong.

0 comments on commit 363c5ff

Please sign in to comment.