Skip to content
This repository
Browse code

creation of the General Settings view

  • Loading branch information...
commit 49dc21ef9062bee4805f0b8b11e59601d7738b37 1 parent ca3cfd8
authored July 25, 2010

Showing 31 changed files with 193 additions and 405 deletions. Show diff stats Hide diff stats

  1. 112  apps/fe/modules/sfGuardUser/templates/indexSuccess.php
  2. 7  apps/fe/templates/layout.php
  3. BIN  data/phpcollab_unit_test.db
  4. 5  plugins/fdEventsListenersPlugin/test/unit/EventListenerTest.php
  5. 6  plugins/idProjectManagementPlugin/config/routing.yml
  6. 20  plugins/idProjectManagementPlugin/lib/generator/LogMessageGenerator.php
  7. 6  plugins/idProjectManagementPlugin/lib/model/doctrine/PluginLogTime.class.php
  8. 6  plugins/idProjectManagementPlugin/lib/model/doctrine/PluginPriority.class.php
  9. 6  plugins/idProjectManagementPlugin/lib/model/doctrine/PluginStatus.class.php
  10. 5  plugins/idProjectManagementPlugin/lib/model/doctrine/PluginTracker.class.php
  11. 19  plugins/idProjectManagementPlugin/modules/idIssue/actions/actions.class.php
  12. 8  plugins/idProjectManagementPlugin/modules/idIssue/templates/showSuccess.php
  13. 25  plugins/idProjectManagementPlugin/modules/idLogtime/actions/actions.class.php
  14. 2  plugins/idProjectManagementPlugin/modules/idLogtime/templates/reportAllUsersForProjectSuccess.php
  15. 3  plugins/idProjectManagementPlugin/modules/idLogtime/templates/reportSuccess.php
  16. 8  plugins/idProjectManagementPlugin/modules/idMessage/actions/actions.class.php
  17. 14  plugins/idProjectManagementPlugin/modules/idMilestone/actions/actions.class.php
  18. 44  plugins/idProjectManagementPlugin/modules/idPriority/actions/actions.class.php
  19. 4  plugins/idProjectManagementPlugin/modules/idProfile/actions/actions.class.php
  20. 16  plugins/idProjectManagementPlugin/modules/idProject/actions/actions.class.php
  21. 9  plugins/idProjectManagementPlugin/modules/idProject/templates/_create_project_menu.php
  22. 18  plugins/idProjectManagementPlugin/modules/idStatus/actions/actions.class.php
  23. 7  plugins/idProjectManagementPlugin/modules/idTracker/actions/actions.class.php
  24. 10  plugins/idProjectManagementPlugin/modules/idTracker/templates/indexSuccess.php
  25. 3  test/functional/fe/adminNavigationMenuTest.php
  26. 3  test/functional/fe/idProjectShowAsUserTest.php
  27. 11  test/functional/fe/idProjectUserCreateTest.php
  28. 10  test/functional/fe/idProjectUserDeleteTest.php
  29. 129  test/functional/fe/idProjectUserShowSortingTest.php
  30. 76  test/functional/fe/idProjectUserViewTest.php
  31. 6  test/functional/fe/sfGuardUserSubNavigationMenuTest.php
112  apps/fe/modules/sfGuardUser/templates/indexSuccess.php
@@ -5,72 +5,64 @@
5 5
                                                   'configuration' => $configuration,
6 6
                                                   'module_name' => 'user',
7 7
                                                   'fields' => array('username',
8  
-                                                                    'is_active',
9  
-                                                                    'groups_list',
10  
-                                                                    'permissions_list'),
  8
+                                                                    'groups_list'),
11 9
                                                   )); ?>
12 10
 
13  
-<div class="block" id="block-tables">
14  
-  <?php include_partial('idProject/sf_guard_create_menu', array('module_name' => 'user')); ?>
15  
-  <div class="content">
16  
-  <h2 class="title"><?php echo __('Users list') ?></h2>
17  
-    <div class="inner">
18  
-
19  
-        <?php if ($pager->getNbResults() > 0): ?>
20  
-          
21  
-        <table class="table">
22  
-          <tr>
23  
-            <th class="first">&nbsp;</th>
24  
-            <?php include_partial('sfGuardUser/sf_guard_th_as_ordering_links', array(
25  
-                                                                            'sort' => $sort,
26  
-                                                                            'module_name' => 'user',
27  
-                                                                            'fields' => array(
28  
-                                                                                          $prefix_for_sf_guard_user_field.'.username',
29  
-                                                                                          $prefix_for_profile.'.first_name',
30  
-                                                                                          $prefix_for_profile.'.last_name',
31  
-                                                                                          $prefix_for_profile.'.email',
32  
-                                                                                          $prefix_for_sf_guard_user_field.'.created_at'
33  
-                                                                            )
34  
-              )); ?>
  11
+<div class="span-23" id="content">
  12
+  <div class="span-full last project-navigation">
  13
+    <ul>
  14
+      <li><?php echo link_to('Users', '@sf_guard_user'); ?></li>
  15
+      <li><?php echo link_to('Groups', '@sf_guard_group'); ?></li>
  16
+      <li><?php echo link_to('Permissions', '@sf_guard_permission'); ?></li>
  17
+    </ul>
  18
+  </div>
35 19
 
36  
-            <th class="last"><?php echo __('Actions') ?></th>
37  
-          </tr>
  20
+  <div class="span-full">
  21
+    <div class="title">
  22
+      <span>Users</span>
  23
+      <a id="add-user"class="button block-green medium-round" href="<?php echo url_for('@sf_guard_user_new') ?>">Add</a>
  24
+    </div>
  25
+    <div class="menu">
  26
+      <div class="span-5"><?php echo link_to(__('Username'), 'sfGuardUser/index?sort=s.username&sort_type='.('s.username' == $sort[0] && $sort[1] == 'asc' ? 'desc' : 'asc')) ?></div>
  27
+      <div class="span-5"><?php echo link_to(__('First Name'), 'sfGuardUser/index?sort=p.first_name&sort_type='.('p.first_name' == $sort[0] && $sort[1] == 'asc' ? 'desc' : 'asc')) ?></div>
  28
+      <div class="span-5"><?php echo link_to(__('Last Name'), 'sfGuardUser/index?sort=p.last_name&sort_type='.('p.last_name' == $sort[0] && $sort[1] == 'asc' ? 'desc' : 'asc')) ?></div>
  29
+      <div class="span-6 right last append-1">E-mail</div>
  30
+    </div>
38 31
 
39  
-          <?php foreach ($pager->getResults() as $i => $sf_guard_user): $odd = fmod(++$i, 2) ? 'odd' : 'even' ?>
40  
-            <tr class="<?php echo $odd ?>">
41  
-              <td class="first">&nbsp;</td>
42  
-              <td>
43  
-                <?php echo link_to($sf_guard_user['username'], 'sf_guard_user_edit', $sf_guard_user) ?>
44  
-              </td>
45  
-              <td><?php echo $sf_guard_user->Profile->first_name ?></td>
46  
-              <td><?php echo $sf_guard_user->Profile->last_name ?></td>
47  
-              <td><?php echo $sf_guard_user->Profile->email ?></td>
48  
-              <td>
49  
-                <?php echo $sf_guard_user['created_at'] ? format_date($sf_guard_user['created_at'], "f") : '&nbsp;' ?>
50  
-              </td>
51  
-              
52  
-              <td>
53  
-                <?php include_partial('idProject/sf_guard_actions', array('sf_guard_object' => $sf_guard_user, 'module_name' => 'user')); ?>
54  
-              </td>
55  
-              
56  
-            </tr>
  32
+    <ul class="action">
  33
+      <?php if ($pager->getNbResults() > 0): ?>
  34
+        <?php foreach ($pager->getResults() as $user): ?>
  35
+          <li class="icon-group">
  36
+            <ul>
  37
+              <li class="span-5"><?php echo link_to($user['username'], 'sf_guard_user_edit', $user) ?>&nbsp;</li>
  38
+              <li class="span-5"><?php echo $user->Profile->first_name ?>&nbsp;</li>
  39
+              <li class="span-5"><?php echo $user->Profile->last_name ?>&nbsp;</li>
  40
+              <li class="span-7 right last append-1"><?php echo $user->Profile->email ?>&nbsp;</li>
  41
+              <li class="edit-delete">
  42
+                <?php echo link_to(__('Edit'), '@sf_guard_user_edit?id='.$user->getId()) ?>
  43
+                <?php echo link_to(__('Delete'), '@sf_guard_user_delete?id='.$user->getId(), array('confirm' => __('Do you really want to delete this user?'))) ?>
  44
+              </li>
  45
+            </ul>
  46
+          </li>
57 47
           <?php endforeach; ?>
  48
+        <?php else: ?>
  49
+        <li>
  50
+          <ul>
  51
+            <li class="span-3"></li>
  52
+            <li class="span-15">No users</li>
  53
+            <li class="span-4 right last"></li>
  54
+          </ul>
  55
+        </li>
  56
+        <?php endif; ?>
  57
+    </ul>
58 58
 
59  
-            <?php if ($pager->haveToPaginate()): ?>
60  
-            <tr class="even">
61  
-              <td colspan="7">
62  
-                <?php include_partial('sfGuardUser/pagination', array('pager' => $pager)) ?>
63  
-                <br/>
64  
-                <?php echo __('(page %%page%%/%%nb_pages%%)', array('%%page%%' => $pager->getPage(), '%%nb_pages%%' => $pager->getLastPage()), 'sf_admin') ?>
65  
-              </td>
66  
-            </tr>
67  
-            <?php endif; ?>
68  
-            
69  
-
70  
-        </table>
71  
-        
72  
-      <?php endif; ?>
73  
-
  59
+    <?php if($pager->haveToPaginate()):?>
  60
+    <div class="span-full pagenation">
  61
+      <ul>
  62
+        <?php  echo pager_navigation_log_time($pager, '@collab_settings') ?>
  63
+      </ul>
74 64
     </div>
  65
+    <?php endif; ?>
  66
+    
75 67
   </div>
76 68
 </div>
7  apps/fe/templates/layout.php
@@ -15,7 +15,12 @@
15 15
       <div class="container">
16 16
         <?php if ($sf_user->isAuthenticated()) : ?>
17 17
         <div id="utility" class="showgrid-off">
18  
-          Hello, <?php echo link_to($sf_user->getUsername(), '@edit_profile') ?> <a href="<?php echo url_for('@sf_guard_signout') ?>" class="login">Logout</a> <a href="#" class="settings">Settings</a> <a href="#" class="help">Help</a>
  18
+          Hello, <?php echo link_to($sf_user->getUsername(), '@edit_profile') ?> 
  19
+          <a href="<?php echo url_for('@sf_guard_signout') ?>" class="login">Logout</a>
  20
+          <?php if ($sf_user->isAdmin()):?>
  21
+            <a href="<?php echo url_for('@collab_settings')?>" class="settings">Settings</a>
  22
+          <?php endif; ?>
  23
+          <a href="#" class="help">Help</a>
19 24
           <select>
20 25
           <?php foreach($sf_user->getMyProjects() as $project): ?>
21 26
             <option><?php echo $project->name ?></option>
BIN  data/phpcollab_unit_test.db
Binary file not shown
5  plugins/fdEventsListenersPlugin/test/unit/EventListenerTest.php
@@ -7,9 +7,6 @@
7 7
 new sfDatabaseManager($configuration);
8 8
 Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures/fixtures.yml');
9 9
 
10  
-//1) Generazione evento
11  
-//2) Catch dell'evento da parte dell'EventListener
12  
-//3) Salvataggio dell'evento sul database
13 10
 
14 11
 class stub {}
15 12
 
@@ -21,7 +18,7 @@ class stub {}
21 18
 $t->is('stub_namespace', $namespace, '::extracNamespace() extract the right value');
22 19
 
23 20
 $action = EventListener::extracAction($event);
24  
-$t->is('creation', $action, '::extracNamespace() extract the right value');
  21
+$t->is('creation', $action, '::extracAction() extract the right value');
25 22
 
26 23
 $event = new sfEvent(new stub, 'stub_namespace.creation', array('project_id' => '1000'));
27 24
 $message = EventListener::processParameters($event);
6  plugins/idProjectManagementPlugin/config/routing.yml
... ...
@@ -1,3 +1,9 @@
  1
+collab_settings:
  2
+  url:   /:sf_culture/settings
  3
+  param: { module: sfGuardUser, action: index}
  4
+  requirements:
  5
+    sf_culture: (?:en|it)
  6
+
1 7
 sf_guard_signin:
2 8
   url:   /:sf_culture/login
3 9
   param: { module: sfGuardAuth, action: signin}
20  plugins/idProjectManagementPlugin/lib/generator/LogMessageGenerator.php
@@ -51,6 +51,24 @@ public static function generate($user, $action, $object)
51 51
     return $user_ref.ucfirst($action).$suffix.' '. ucfirst(get_class($object)) .' '.$link_to_object;
52 52
   }
53 53
 
  54
+  private static function getProjectId(Doctrine_Event $event)
  55
+  {
  56
+    $object = $event->getInvoker();
  57
+    switch (get_class($object))
  58
+    {
  59
+      case 'Priority':
  60
+      case 'Status':
  61
+      case 'Tracker':
  62
+        return null;
  63
+      case 'LogTime':
  64
+        return $object->issue->project_id;
  65
+      case 'Project':
  66
+        return $event->getInvoker()->id;
  67
+      default :
  68
+        return $event->getInvoker()->project_id;
  69
+    }
  70
+  }
  71
+
54 72
   public static function storeFromDoctrineEvent($message, $action, Doctrine_Event $event)
55 73
   {
56 74
     $event_log = new self::$log_class;
@@ -58,7 +76,7 @@ public static function storeFromDoctrineEvent($message, $action, Doctrine_Event
58 76
     $event_log->setAction($action);
59 77
     $event_log->setMessage($message);
60 78
     $event_log->setCreatedAt(date('Y-m-d H:i:s'));
61  
-    $project_id = ($event->getInvoker() instanceof Project) ? $event->getInvoker()->id : $event->getInvoker()->project_id;
  79
+    $project_id = self::getProjectId($event);
62 80
     $event_log->setProjectId($project_id);
63 81
 
64 82
     $event_log->save();
6  plugins/idProjectManagementPlugin/lib/model/doctrine/PluginLogTime.class.php
@@ -5,5 +5,9 @@
5 5
  */
6 6
 abstract class PluginLogTime extends BaseLogTime
7 7
 {
8  
-
  8
+  public function setUp()
  9
+  {
  10
+    parent::setUp();
  11
+    $this->addListener(new EventLogDoctrineListener());
  12
+  }
9 13
 }
6  plugins/idProjectManagementPlugin/lib/model/doctrine/PluginPriority.class.php
@@ -21,5 +21,9 @@
21 21
  */
22 22
 abstract class PluginPriority extends BasePriority
23 23
 {
24  
-
  24
+  public function setUp()
  25
+  {
  26
+    parent::setUp();
  27
+    $this->addListener(new EventLogDoctrineListener());
  28
+  }
25 29
 }
6  plugins/idProjectManagementPlugin/lib/model/doctrine/PluginStatus.class.php
@@ -21,5 +21,9 @@
21 21
  */
22 22
 abstract class PluginStatus extends BaseStatus
23 23
 {
24  
-
  24
+  public function setUp()
  25
+  {
  26
+    parent::setUp();
  27
+    $this->addListener(new EventLogDoctrineListener());
  28
+  }
25 29
 }
5  plugins/idProjectManagementPlugin/lib/model/doctrine/PluginTracker.class.php
@@ -5,4 +5,9 @@
5 5
  */
6 6
 abstract class PluginTracker extends BaseTracker
7 7
 {
  8
+  public function setUp()
  9
+  {
  10
+    parent::setUp();
  11
+    $this->addListener(new EventLogDoctrineListener());
  12
+  }
8 13
 }
19  plugins/idProjectManagementPlugin/modules/idIssue/actions/actions.class.php
@@ -28,7 +28,6 @@ class idIssueActions extends sfActions
28 28
    */
29 29
   public function executeIndex(sfWebRequest $request)
30 30
   {
31  
-    $this->forwardUnless($this->getUser()->hasCredential('idIssue-Read'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
32 31
     $this->forward404Unless($this->project = Doctrine::getTable('Project')->findOneBy('id', $request->getParameter('project_id')));
33 32
 
34 33
     $this->pager = new sfDoctrinePager('Issue',10);
@@ -44,8 +43,6 @@ public function executeIndex(sfWebRequest $request)
44 43
    */
45 44
   public function executeShow(sfWebRequest $request)
46 45
   {
47  
-    $this->forwardUnless($this->getUser()->hasCredential('idIssue-Read'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
48  
-    
49 46
     $this->issue = Doctrine::getTable('Issue')->getIssueById($request->getParameter('issue_id'));
50 47
     $this->forward404Unless($this->issue && $this->issue->project_id == $request->getParameter('project_id'));
51 48
 
@@ -72,8 +69,6 @@ public function executeShow(sfWebRequest $request)
72 69
    */
73 70
   public function executeNew(sfWebRequest $request)
74 71
   {
75  
-    $this->forwardUnless($this->getUser()->hasCredential('idIssue-Create'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
76  
-
77 72
     $this->forward404Unless(!is_null($this->project = Doctrine::getTable('Project')->find(array($request->getParameter('project_id')))));
78 73
     $this->form = new idIssueForm($request->getParameter('project_id'));
79 74
     $this->form->setDefault('project_id', $request->getParameter('project_id'));
@@ -88,8 +83,6 @@ public function executeNew(sfWebRequest $request)
88 83
    */
89 84
   public function executeCreate(sfWebRequest $request)
90 85
   {
91  
-    $this->forwardUnless($this->getUser()->hasCredential('idIssue-Create'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
92  
-    
93 86
     $this->forward404Unless($request->isMethod('post'));
94 87
     $this->forward404Unless(!is_null($this->project = Doctrine::getTable('Project')->find(array($request->getParameter('project_id')))));
95 88
 
@@ -107,8 +100,6 @@ public function executeCreate(sfWebRequest $request)
107 100
    */
108 101
   public function executeEdit(sfWebRequest $request)
109 102
   {
110  
-    $this->forwardUnless($this->getUser()->hasCredential('idIssue-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
111  
-
112 103
     $this->forward404Unless(!is_null($this->project = Doctrine::getTable('Project')->find(array($request->getParameter('project_id')))));
113 104
     $this->forward404Unless($issue = Doctrine::getTable('Issue')->find(array($request->getParameter('issue_id'))), sprintf('Object issue does not exist (%s).', array($request->getParameter('issue_id'))));
114 105
 
@@ -124,8 +115,6 @@ public function executeEdit(sfWebRequest $request)
124 115
    */
125 116
   public function executeUpdate(sfWebRequest $request)
126 117
   {
127  
-    $this->forwardUnless($this->getUser()->hasCredential('idIssue-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
128  
-    
129 118
     $this->forward404Unless($request->isMethod('post') || $request->isMethod('put'));
130 119
     $this->forward404Unless(!is_null($this->project = Doctrine::getTable('Project')->find(array($request->getParameter('project_id')))));
131 120
     $this->forward404Unless($issue = Doctrine::getTable('Issue')->find(array($request->getParameter('issue_id'))), sprintf('Object issue does not exist (%s).', array($request->getParameter('issue_id'))));
@@ -144,8 +133,6 @@ public function executeUpdate(sfWebRequest $request)
144 133
    */
145 134
   public function executeDelete(sfWebRequest $request)
146 135
   {
147  
-    $this->forwardUnless($this->getUser()->hasCredential('idIssue-Delete'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
148  
-
149 136
     $this->forward404Unless(!is_null($this->project = Doctrine::getTable('Project')->find(array($request->getParameter('project_id')))));
150 137
     $this->forward404Unless($issue = Doctrine::getTable('Issue')->find(array($request->getParameter('issue_id'))), sprintf('Object issue does not exist (%s).', array($request->getParameter('issue_id'))));
151 138
     $request->checkCSRFProtection();
@@ -158,8 +145,6 @@ public function executeDelete(sfWebRequest $request)
158 145
 
159 146
   public function executeSetEstimatedTime(sfWebRequest $request)
160 147
   {
161  
-    $this->forwardUnless($this->getUser()->hasCredential('idIssue-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
162  
-
163 148
     $this->forward404Unless($request->isMethod('post') || $request->isMethod('put'));
164 149
     $this->forward404Unless($issue = Doctrine::getTable('Issue')->find(array($request->getParameter('issue_id'))), sprintf('Object issue does not exist (%s).', array($request->getParameter('issue_id'))));
165 150
 
@@ -168,10 +153,6 @@ public function executeSetEstimatedTime(sfWebRequest $request)
168 153
     if ($form->isValid())
169 154
     {
170 155
       $issue = $form->save();
171  
-      $this->dispatcher->notify(new sfEvent($issue,
172  
-                                            'issue.set_estimated_time_success',
173  
-                                            array('log_message' => LogMessageGenerator::generate($this->getUser(), 'Set estimated time to '.$issue->estimated_time.' hours', $issue),
174  
-                                                  'project_id'  => $issue->project_id)));
175 156
       $this->redirect('@show_issue?project_id='.$issue->project_id.'&issue_id='.$issue->id);
176 157
     }
177 158
 
8  plugins/idProjectManagementPlugin/modules/idIssue/templates/showSuccess.php
@@ -67,12 +67,8 @@
67 67
     <div class="span-12 last">
68 68
       <div class="span-6 key">
69 69
         Log time: <?php echo $issue->getTotalLogTime(); ?><br/>
70  
-        <?php if ($sf_user->hasCredential('idLogotime-ReadReport')): ?>
71  
-          <?php echo link_to(__('My log time report'), '@log_time_report_issue_actual_user?issue_id='.$issue->getId()) ?><br />
72  
-        <?php endif; ?>
73  
-        <?php if ($sf_user->hasCredential('idLogotime-ReadReport')): ?>
74  
-          <?php echo link_to(__('All users log time report'), '@log_time_report_issue_all_users?issue_id='.$issue->getId()) ?>
75  
-        <?php endif; ?>
  70
+        <?php echo link_to(__('My log time report'), '@log_time_report_issue_actual_user?issue_id='.$issue->getId()) ?><br />
  71
+        <?php echo link_to(__('All users log time report'), '@log_time_report_issue_all_users?issue_id='.$issue->getId()) ?>
76 72
       </div>
77 73
       <div class="span-6 last">
78 74
         <form action="<?php echo url_for('@set_log_time_from_issue?issue_id='.$issue->getId()); ?>" method="post" class="form">
25  plugins/idProjectManagementPlugin/modules/idLogtime/actions/actions.class.php
@@ -17,7 +17,6 @@ public function  preExecute()
17 17
 
18 18
   public function executeIndex(sfWebRequest $request)
19 19
   {
20  
-    $this->forwardUnless($this->getUser()->hasCredential('idLogotime-Read'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
21 20
     $this->pager = new sfDoctrinePager('LogTime',10);
22 21
     $this->pager->setQuery(Doctrine::getTable('LogTime')->createQuery('a')->orderBy('created_at DESC'));
23 22
     $this->pager->setMaxPerPage(sfConfig::get('mod_maxperpage_logtime', 10));
@@ -32,7 +31,6 @@ public function executeIndex(sfWebRequest $request)
32 31
 
33 32
   public function executeAddToIssue(sfWebRequest $request)
34 33
   {
35  
-    $this->forwardUnless($this->getUser()->hasCredential('idLogotime-Create'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
36 34
     $this->forward404Unless($issue = Doctrine::getTable('Issue')->find(array($request->getParameter('issue_id'))), sprintf('Object issue does not exist (%s).', array($request->getParameter('issue_id'))));
37 35
     $this->forward404Unless($request->isMethod('post'));
38 36
 
@@ -48,11 +46,6 @@ public function executeAddToIssue(sfWebRequest $request)
48 46
 
49 47
       $this->getUser()->setFlash('success', 'Log time added');
50 48
 
51  
-      $this->dispatcher->notify(new sfEvent($log_time,
52  
-                                            'log_time.add_to_issue',
53  
-                                            array('log_message' => LogMessageGenerator::generate($this->getUser(), 'add', $log_time),
54  
-                                                  'project_id'  => $issue->project_id)));
55  
-
56 49
       $this->redirect($this->referer);
57 50
     }
58 51
 
@@ -76,7 +69,6 @@ private function checkUserAgainstIssueAndProject(sfWebRequest $request)
76 69
    */
77 70
   public function executeReportForActualUser(sfWebRequest $request)
78 71
   {
79  
-    $this->forwardUnless($this->getUser()->hasCredential('idLogotime-ReadReport'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
80 72
     $this->issue = $this->checkUserAgainstIssueAndProject($request);
81 73
 
82 74
     $this->pager = new sfDoctrinePager('LogTime',10);
@@ -97,7 +89,6 @@ public function executeReportForActualUser(sfWebRequest $request)
97 89
    */
98 90
   public function executeReportForAllUsers(sfWebRequest $request)
99 91
   {
100  
-    $this->forwardUnless($this->getUser()->hasCredential('idLogotime-ReadReportForAllUsers'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
101 92
     $this->issue = $this->checkUserAgainstIssueAndProject($request);
102 93
     
103 94
     $this->pager = new sfDoctrinePager('LogTime',10);
@@ -118,7 +109,6 @@ public function executeReportForAllUsers(sfWebRequest $request)
118 109
    */
119 110
   public function executeReportAllUsersForProject(sfWebRequest $request)
120 111
   {
121  
-    $this->forwardUnless($this->getUser()->hasCredential('idLogotime-ReadReportForAllUsers'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
122 112
     $this->forward404Unless($this->getUser()->isMyProject($request->getParameter('project_id')));
123 113
 
124 114
     $this->project = Doctrine::getTable('Project')->findOneBy('id', $request->getParameter('project_id'));
@@ -136,14 +126,12 @@ public function executeReportAllUsersForProject(sfWebRequest $request)
136 126
 
137 127
   public function executeNew(sfWebRequest $request)
138 128
   {
139  
-    $this->forwardUnless($this->getUser()->hasCredential('idLogotime-Create'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
140 129
     $this->form = new LogTimeForm();
141 130
     $this->form->setDefault('created_at', date('Y-m-d H:i:s', time()));
142 131
   }
143 132
 
144 133
   public function executeCreate(sfWebRequest $request)
145 134
   {
146  
-    $this->forwardUnless($this->getUser()->hasCredential('idLogotime-Create'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
147 135
     $this->forward404Unless($request->isMethod('post'));
148 136
 
149 137
     $form_factory = new LogTimeFormFactory();
@@ -158,7 +146,6 @@ public function executeCreate(sfWebRequest $request)
158 146
 
159 147
   public function executeEdit(sfWebRequest $request)
160 148
   {
161  
-    $this->forwardUnless($this->getUser()->hasCredential('idLogotime-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
162 149
     $this->forward404Unless($log_time = Doctrine::getTable('LogTime')->
163 150
                                         findOneBy('id', $request->getParameter('id')),
164 151
                             sprintf('Object log_time does not exist (%s).', array($request->getParameter('id'))));
@@ -169,7 +156,6 @@ public function executeEdit(sfWebRequest $request)
169 156
 
170 157
   public function executeUpdate(sfWebRequest $request)
171 158
   {
172  
-    $this->forwardUnless($this->getUser()->hasCredential('idLogotime-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
173 159
     $this->forward404Unless($request->isMethod('post') || $request->isMethod('put'));
174 160
     $this->forward404Unless($log_time = Doctrine::getTable('LogTime')->find(array($request->getParameter('id'))), sprintf('Object log_time does not exist (%s).', array($request->getParameter('id'))));
175 161
 
@@ -183,17 +169,11 @@ public function executeUpdate(sfWebRequest $request)
183 169
 
184 170
   public function executeDelete(sfWebRequest $request)
185 171
   {
186  
-    $this->forwardUnless($this->getUser()->hasCredential('idLogotime-Delete'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
187 172
     $request->checkCSRFProtection();
188 173
 
189 174
     $this->forward404Unless($log_time = Doctrine::getTable('LogTime')->find(array($request->getParameter('id'))), sprintf('Object log_time does not exist (%s).', array($request->getParameter('id'))));
190 175
     $log_time->delete();
191 176
 
192  
-    $this->dispatcher->notify(new sfEvent($log_time,
193  
-                                            'log_time.delete',
194  
-                                            array('log_message' => LogMessageGenerator::generate($this->getUser(), 'delete', $log_time),
195  
-                                                  'project_id'  => $log_time->getIssue()->project_id)));
196  
-
197 177
     $this->redirect($this->referer);
198 178
   }
199 179
 
@@ -215,11 +195,6 @@ protected function processForm(sfWebRequest $request, sfForm $form)
215 195
       
216 196
       $this->getUser()->setFlash('success', 'Log time added');
217 197
 
218  
-      $this->dispatcher->notify(new sfEvent($log_time,
219  
-                                            'log_time.'.$operation,
220  
-                                            array('log_message' => LogMessageGenerator::generate($this->getUser(), $operation, $log_time),
221  
-                                                  'project_id'  => $log_time->getIssue()->project_id)));
222  
-
223 198
       $this->redirect($this->referer);
224 199
     }
225 200
   }
2  plugins/idProjectManagementPlugin/modules/idLogtime/templates/reportAllUsersForProjectSuccess.php
@@ -39,10 +39,8 @@
39 39
               (<?php echo $log_time->getIssue()->getProject()->getName(); ?> )
40 40
             </li>
41 41
             <li class="edit-delete">
42  
-              <?php if($sf_user->hasCredential('idLogtime-Edit')): ?>
43 42
                 <?php echo link_to(__('Edit'), '@edit_logtime?id='.$log_time->getId()) ?>&nbsp;&nbsp;
44 43
                 <?php echo link_to(__('Delete'), '@delete_logtime?id='.$log_time->getId(), array('confirm' => __('Do you really want to delete this log?'))) ?>
45  
-              <?php endif; ?>
46 44
             </li>
47 45
           </ul>
48 46
         </li>
3  plugins/idProjectManagementPlugin/modules/idLogtime/templates/reportSuccess.php
@@ -50,10 +50,9 @@
50 50
               (<?php echo $log_time->getIssue()->getProject()->getName(); ?> )
51 51
             </li>
52 52
             <li class="edit-delete">
53  
-              <?php if($sf_user->hasCredential('idLogtime-Edit')): ?>
54 53
                 <?php echo link_to(__('Edit'), '@edit_logtime?id='.$log_time->getId()) ?>&nbsp;&nbsp;
55 54
                 <?php echo link_to(__('Delete'), '@delete_logtime?id='.$log_time->getId(), array('confirm' => __('Do you really want to delete this log?'))) ?>
56  
-              <?php endif; ?>
  55
+              
57 56
             </li>
58 57
           </ul>
59 58
         </li>
8  plugins/idProjectManagementPlugin/modules/idMessage/actions/actions.class.php
@@ -17,8 +17,6 @@ public function  preExecute()
17 17
 
18 18
   public function executeIndex(sfWebRequest $request)
19 19
   {
20  
-    $this->forwardUnless($this->getUser()->hasCredential('idMessage-Read'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
21  
-
22 20
     $this->pager = new sfDoctrinePager('Message',10);
23 21
     $this->pager->setQuery(Doctrine::getTable('Message')->getQueryForProjectMessages($request->getParameter('project_id')));
24 22
     $this->pager->setMaxPerPage(sfConfig::get('mod_maxperpage_logtime', 10));
@@ -33,7 +31,6 @@ public function executeIndex(sfWebRequest $request)
33 31
 
34 32
   public function executeShow(sfWebRequest $request)
35 33
   {
36  
-    $this->forwardUnless($this->getUser()->hasCredential('idMessage-Read'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
37 34
     $this->forward404Unless($this->message = Doctrine::getTable('Message')->find(array($request->getParameter('message_id'))));
38 35
     $this->forward404Unless($this->message->project_id == $request->getParameter('project_id'));
39 36
 
@@ -43,7 +40,6 @@ public function executeShow(sfWebRequest $request)
43 40
 
44 41
   public function executeNew(sfWebRequest $request)
45 42
   {
46  
-    $this->forwardUnless($this->getUser()->hasCredential('idMessage-Create'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
47 43
     $this->form = new MessageForm();
48 44
     
49 45
     $this->setTemplate('edit');
@@ -51,7 +47,6 @@ public function executeNew(sfWebRequest $request)
51 47
 
52 48
   public function executeCreate(sfWebRequest $request)
53 49
   {
54  
-    $this->forwardUnless($this->getUser()->hasCredential('idMessage-Create'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
55 50
     $this->forward404Unless($request->isMethod('post'));
56 51
 
57 52
     $this->form = new MessageForm();
@@ -63,7 +58,6 @@ public function executeCreate(sfWebRequest $request)
63 58
 
64 59
   public function executeEdit(sfWebRequest $request)
65 60
   {
66  
-    $this->forwardUnless($this->getUser()->hasCredential('idMessage-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
67 61
     $this->forward404Unless($message = Doctrine::getTable('Message')->find(array($request->getParameter('message_id'))), sprintf('Object message does not exist (%s).', array($request->getParameter('message_id'))));
68 62
     $this->forward404Unless($message->project_id == $request->getParameter('project_id'));
69 63
     $this->form = new MessageForm($message);
@@ -71,7 +65,6 @@ public function executeEdit(sfWebRequest $request)
71 65
 
72 66
   public function executeUpdate(sfWebRequest $request)
73 67
   {
74  
-    $this->forwardUnless($this->getUser()->hasCredential('idMessage-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
75 68
     $this->forward404Unless($request->isMethod('post') || $request->isMethod('put'));
76 69
     $this->forward404Unless($message = Doctrine::getTable('Message')->find(array($request->getParameter('message_id'))), sprintf('Object message does not exist (%s).', array($request->getParameter('message_id'))));
77 70
     $this->forward404Unless($message->project_id == $request->getParameter('project_id'));
@@ -85,7 +78,6 @@ public function executeUpdate(sfWebRequest $request)
85 78
 
86 79
   public function executeDelete(sfWebRequest $request)
87 80
   {
88  
-    $this->forwardUnless($this->getUser()->hasCredential('idMessage-Delete'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
89 81
     $request->checkCSRFProtection();
90 82
 
91 83
     $this->forward404Unless($message = Doctrine::getTable('Message')->find(array($request->getParameter('message_id'))), sprintf('Object message does not exist (%s).', array($request->getParameter('message_id'))));
14  plugins/idProjectManagementPlugin/modules/idMilestone/actions/actions.class.php
@@ -28,8 +28,6 @@ class idMilestoneActions extends sfActions
28 28
    */
29 29
   public function executeShow(sfWebRequest $request)
30 30
   {
31  
-    $this->forwardUnless($this->getUser()->hasCredential('idMilestone-Read'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
32  
-
33 31
     $this->forward404Unless($this->milestone = Doctrine::getTable('Milestone')->find(array($request->getParameter('milestone_id'))), sprintf('Object milestone does not exist (%s).', array($request->getParameter('milestone_id'))));
34 32
     $this->forward404Unless($this->milestone->getProjectId() == $request->getParameter('project_id'));
35 33
 
@@ -50,8 +48,6 @@ public function executeShow(sfWebRequest $request)
50 48
    */
51 49
   public function executeIndex(sfWebRequest $request)
52 50
   {
53  
-    $this->forwardUnless($this->getUser()->hasCredential('idMilestone-Read'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
54  
-    
55 51
     $this->forward404Unless($this->project = Doctrine::getTable('Project')->find(array($request->getParameter('project_id'))), sprintf('Object milestone does not exist (%s).', array($request->getParameter('project_id'))));
56 52
 
57 53
     $this->pager = new sfDoctrinePager('Milestone',10);
@@ -67,8 +63,6 @@ public function executeIndex(sfWebRequest $request)
67 63
    */
68 64
   public function executeNew(sfWebRequest $request)
69 65
   {
70  
-    $this->forwardUnless($this->getUser()->hasCredential('idMilestone-Create'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
71  
-
72 66
     $this->forward404Unless($this->project = Doctrine::getTable('Project')->find(array($request->getParameter('project_id'))), sprintf('Object project does not exist (%s).', array($request->getParameter('project_id'))));
73 67
 
74 68
     $this->form = new MilestoneForm();
@@ -84,8 +78,6 @@ public function executeNew(sfWebRequest $request)
84 78
    */
85 79
   public function executeCreate(sfWebRequest $request)
86 80
   {
87  
-    $this->forwardUnless($this->getUser()->hasCredential('idMilestone-Create'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
88  
-
89 81
     $this->forward404Unless($request->isMethod('post'));
90 82
     $this->forward404Unless($this->project = Doctrine::getTable('Project')->find(array($request->getParameter('project_id'))), sprintf('Object project does not exist (%s).', array($request->getParameter('project_id'))));
91 83
 
@@ -103,8 +95,6 @@ public function executeCreate(sfWebRequest $request)
103 95
    */
104 96
   public function executeEdit(sfWebRequest $request)
105 97
   {
106  
-    $this->forwardUnless($this->getUser()->hasCredential('idMilestone-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
107  
-
108 98
     $this->forward404Unless($milestone = Doctrine::getTable('Milestone')->find(array($request->getParameter('milestone_id'))), sprintf('Object milestone does not exist (%s).', array($request->getParameter('milestone_id'))));
109 99
 
110 100
     $this->project = $milestone->getProject();
@@ -119,8 +109,6 @@ public function executeEdit(sfWebRequest $request)
119 109
    */
120 110
   public function executeUpdate(sfWebRequest $request)
121 111
   {
122  
-    $this->forwardUnless($this->getUser()->hasCredential('idMilestone-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
123  
-    
124 112
     $this->forward404Unless($request->isMethod('post') || $request->isMethod('put'));
125 113
     $this->forward404Unless($milestone = Doctrine::getTable('Milestone')->find(array($request->getParameter('milestone_id'))), sprintf('Object milestone does not exist (%s).', array($request->getParameter('milestone_id'))));
126 114
 
@@ -140,8 +128,6 @@ public function executeUpdate(sfWebRequest $request)
140 128
    */
141 129
   public function executeDelete(sfWebRequest $request)
142 130
   {
143  
-    $this->forwardUnless($this->getUser()->hasCredential('idMilestone-Delete'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
144  
-
145 131
     $request->checkCSRFProtection();
146 132
 
147 133
     $this->forward404Unless($milestone = Doctrine::getTable('Milestone')->find(array($request->getParameter('milestone_id'))), sprintf('Object milestone does not exist (%s).', array($request->getParameter('milestone_id'))));
44  plugins/idProjectManagementPlugin/modules/idPriority/actions/actions.class.php
@@ -45,7 +45,7 @@ protected function retrievePrioritiesList()
45 45
    */
46 46
   public function executeIndex(sfWebRequest $request)
47 47
   {
48  
-    $this->forwardUnless($this->getUser()->hasCredential('idPriority-Read'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
  48
+    $this->forwardUnless(($this->getUser()->isAdmin() || $this->getUser()->isProjectManager()), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
49 49
     $this->priority_list = $this->retrievePrioritiesList();
50 50
   }
51 51
 
@@ -76,28 +76,25 @@ private function checkPositionParameters($priorities_list, $ordering_list)
76 76
    */
77 77
   public function executeOrder(sfWebRequest $request)
78 78
   {
79  
-    if ($this->getUser()->hasCredential('idPriority-Edit'))
  79
+    $ordering_list = $request->getParameter('priority');
  80
+    if (!is_null($ordering_list) && !empty($ordering_list))
80 81
     {
81  
-      $ordering_list = $request->getParameter('priority');
82  
-      if (!is_null($ordering_list) && !empty($ordering_list))
83  
-      {
84  
-        $priorities_list = $this->retrievePrioritiesList();
85  
-
86  
-        if (!$this->checkPositionParameters($priorities_list, $ordering_list))
87  
-        {
88  
-          return $this->renderPartial('idPriority/order_message', array('response_message' => 'Some error occurred processing your request.', 'class' => 'message error'));
89  
-        }
  82
+      $priorities_list = $this->retrievePrioritiesList();
90 83
 
91  
-        foreach ($priorities_list as $priority)
92  
-        {
93  
-          $priority->setPosition(array_search($priority->id, $ordering_list));
94  
-          $priority->save();
95  
-        }
  84
+      if (!$this->checkPositionParameters($priorities_list, $ordering_list))
  85
+      {
  86
+        return $this->renderPartial('idPriority/order_message', array('response_message' => 'Some error occurred processing your request.', 'class' => 'message error'));
  87
+      }
96 88
 
97  
-        return $this->renderPartial('idPriority/order_message', array('response_message' => 'Order updated', 'class' => 'message notice'));
  89
+      foreach ($priorities_list as $priority)
  90
+      {
  91
+        $priority->setPosition(array_search($priority->id, $ordering_list));
  92
+        $priority->save();
98 93
       }
99  
-    }
100 94
 
  95
+      return $this->renderPartial('idPriority/order_message', array('response_message' => 'Order updated', 'class' => 'message notice'));
  96
+    }
  97
+    
101 98
     return $this->renderPartial('idPriority/order_message', array('response_message' => 'Invalid request', 'class' => 'message warning'));
102 99
   }
103 100
 
@@ -118,8 +115,6 @@ protected function switchFirstAndSecondPositions($priorities)
118 115
    */
119 116
   public function executeOrderPriority(sfWebRequest $request)
120 117
   {
121  
-    $this->forwardUnless($this->getUser()->hasCredential('idPriority-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
122  
-
123 118
     $highest_position = Doctrine::getTable('Priority')->retrieveHighestPosition();
124 119
     if (!is_null($request->getParameter('position'))
125 120
                             && $request->getParameter('position') <= $highest_position
@@ -154,8 +149,6 @@ public function executeOrderPriority(sfWebRequest $request)
154 149
    */
155 150
   public function executeNew(sfWebRequest $request)
156 151
   {
157  
-    $this->forwardUnless($this->getUser()->hasCredential('idPriority-Create'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
158  
-
159 152
     $this->form = new PriorityForm();
160 153
     $this->setTemplate('edit');
161 154
   }
@@ -167,7 +160,6 @@ public function executeNew(sfWebRequest $request)
167 160
    */
168 161
   public function executeCreate(sfWebRequest $request)
169 162
   {
170  
-    $this->forwardUnless($this->getUser()->hasCredential('idPriority-Create'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
171 163
     $this->forward404Unless($request->isMethod('post'));
172 164
     $this->form = new PriorityForm();
173 165
 
@@ -183,8 +175,6 @@ public function executeCreate(sfWebRequest $request)
183 175
    */
184 176
   public function executeEdit(sfWebRequest $request)
185 177
   {
186  
-    $this->forwardUnless($this->getUser()->hasCredential('idPriority-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
187  
-
188 178
     $this->forward404Unless($priority = Doctrine::getTable('Priority')->find(array($request->getParameter('id'))), sprintf('Object priority does not exist (%s).', array($request->getParameter('id'))));
189 179
     $this->form = new PriorityForm($priority);
190 180
   }
@@ -196,8 +186,6 @@ public function executeEdit(sfWebRequest $request)
196 186
    */
197 187
   public function executeUpdate(sfWebRequest $request)
198 188
   {
199  
-    $this->forwardUnless($this->getUser()->hasCredential('idPriority-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
200  
-    
201 189
     $this->forward404Unless($request->isMethod('post') || $request->isMethod('put'));
202 190
     $this->forward404Unless($priority = Doctrine::getTable('Priority')->find(array($request->getParameter('id'))), sprintf('Object priority does not exist (%s).', array($request->getParameter('id'))));
203 191
     $this->form = new PriorityForm($priority);
@@ -231,8 +219,6 @@ protected function checkAndFixPriorityPositions()
231 219
    */
232 220
   public function executeDelete(sfWebRequest $request)
233 221
   {
234  
-    $this->forwardUnless($this->getUser()->hasCredential('idPriority-Delete'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
235  
-
236 222
     $request->checkCSRFProtection();
237 223
 
238 224
     $this->forward404Unless($priority = Doctrine::getTable('Priority')->find(array($request->getParameter('id'))), sprintf('Object priority does not exist (%s).', array($request->getParameter('id'))));
4  plugins/idProjectManagementPlugin/modules/idProfile/actions/actions.class.php
@@ -12,7 +12,6 @@ class idProfileActions extends sfActions
12 12
 {
13 13
   public function executeIndex(sfWebRequest $request)
14 14
   {
15  
-    $this->forwardUnless($this->getUser()->hasCredential('idProfile-Read'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
16 15
     $this->forward404Unless($this->getUser()->isMyProfile($this->getUser()->getGuardUser()->getid()));
17 16
   }
18 17
 
@@ -28,15 +27,12 @@ public function executeCreate(sfWebRequest $request)
28 27
 
29 28
   public function executeEdit(sfWebRequest $request)
30 29
   {
31  
-    $this->forwardUnless($this->getUser()->hasCredential('idProfile-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
32  
-    
33 30
     $this->form = new idProfileForm($this->getUser()->getGuardUser());
34 31
     $this->form->setDefault('username', $this->getUser()->getGuardUser()->getUsername());
35 32
   }
36 33
 
37 34
   public function executeUpdate(sfWebRequest $request)
38 35
   {
39  
-    $this->forwardUnless($this->getUser()->hasCredential('idProfile-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
40 36
     $this->forward404Unless($request->isMethod('post') || $request->isMethod('put'));
41 37
 
42 38
     $this->form = new idProfileForm($this->getUser()->getGuardUser());
16  plugins/idProjectManagementPlugin/modules/idProject/actions/actions.class.php
@@ -43,7 +43,6 @@ private function validateStaffForm(sfWebRequest $request)
43 43
    */
44 44
   public function executeShow(sfWebRequest $request)
45 45
   {
46  
-    $this->forwardUnless($this->getUser()->hasCredential('idProject-Read'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
47 46
     $this->forward404Unless($this->getUser()->isMyProject($request->getParameter('id')));
48 47
     
49 48
     $this->project = Doctrine::getTable('Project')->getProjectMilestonesAndUsers($request->getParameter('id'));
@@ -57,8 +56,6 @@ public function executeShow(sfWebRequest $request)
57 56
    */
58 57
   public function executeRoadmap(sfWebRequest $request)
59 58
   {
60  
-    $this->forwardUnless($this->getUser()->hasCredential('idProject-ViewRoadmap'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
61  
-
62 59
     $this->forward404Unless($this->getUser()->isMyProject($request->getParameter('id')));
63 60
     $this->forward404Unless($this->project = Doctrine::getTable('Project')->getProjectRelatedMilestonesAndIssues($request->getParameter('id')));
64 61
   }
@@ -70,8 +67,6 @@ public function executeRoadmap(sfWebRequest $request)
70 67
    */
71 68
   public function executeIndex(sfWebRequest $request)
72 69
   {
73  
-    $this->forwardUnless($this->getUser()->hasCredential('idProject-Read'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
74  
-
75 70
     $q = null;
76 71
     if ($request->hasParameter('project_filters'))
77 72
     {
@@ -104,7 +99,7 @@ public function executeIndex(sfWebRequest $request)
104 99
    */
105 100
   public function executeNew(sfWebRequest $request)
106 101
   {
107  
-    $this->forwardUnless($this->getUser()->hasCredential('idProject-Create'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
  102
+    $this->forwardUnless(($this->getUser()->isAdmin() || $this->getUser()->isProjectManager()), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
108 103
     $this->form = new idProjectForm();
109 104
     $this->form->setDefault('starting_date', date('Y-m-d H:i:s', time()));
110 105
   }
@@ -116,7 +111,6 @@ public function executeNew(sfWebRequest $request)
116 111
    */
117 112
   public function executeCreate(sfWebRequest $request)
118 113
   {
119  
-    $this->forwardUnless($this->getUser()->hasCredential('idProject-Create'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
120 114
     $this->forward404Unless($request->isMethod('post'));
121 115
 
122 116
     $this->form = new idProjectForm();
@@ -133,8 +127,7 @@ public function executeCreate(sfWebRequest $request)
133 127
    */
134 128
   public function executeEdit(sfWebRequest $request)
135 129
   {
136  
-    $this->forwardUnless($this->getUser()->hasCredential('idProject-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
137  
-
  130
+    $this->forwardUnless(($this->getUser()->isAdmin() || $this->getUser()->isProjectManager()), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
138 131
     $this->forward404Unless($this->project = Doctrine::getTable('Project')->find(array($request->getParameter('id'))), sprintf('Object project does not exist (%s).', array($request->getParameter('id'))));
139 132
 
140 133
     $this->form = new idProjectForm($this->project);
@@ -147,8 +140,6 @@ public function executeEdit(sfWebRequest $request)
147 140
    */
148 141
   public function executeUpdate(sfWebRequest $request)
149 142
   {
150  
-    $this->forwardUnless($this->getUser()->hasCredential('idProject-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
151  
-
152 143
     $this->forward404Unless($request->isMethod('post') || $request->isMethod('put'));
153 144
     $this->forward404Unless($this->project = Doctrine::getTable('Project')->find(array($request->getParameter('id'))), sprintf('Object project does not exist (%s).', array($request->getParameter('id'))));
154 145
     
@@ -166,7 +157,7 @@ public function executeUpdate(sfWebRequest $request)
166 157
    */
167 158
   public function executeDelete(sfWebRequest $request)
168 159
   {
169  
-    $this->forwardUnless($this->getUser()->hasCredential('idProject-Delete'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
  160
+    $this->forwardUnless(($this->getUser()->isAdmin() || $this->getUser()->isProjectManager()), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
170 161
 
171 162
     $request->checkCSRFProtection();
172 163
 
@@ -178,7 +169,6 @@ public function executeDelete(sfWebRequest $request)
178 169
 
179 170
   public function executeStaffList(sfWebRequest $request)
180 171
   {
181  
-    $this->forwardUnless($this->getUser()->hasCredential('idProject-Read'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
182 172
     $this->forward404Unless($this->project = Doctrine::getTable('Project')->find(array($request->getParameter('id'))), sprintf('Object project does not exist (%s).', array($request->getParameter('id'))));
183 173
 
184 174
     $this->form = new ProjectFormOnlyMembers($this->project);
9  plugins/idProjectManagementPlugin/modules/idProject/templates/_create_project_menu.php
... ...
@@ -1,8 +1,8 @@
1 1
 <div class="secondary-navigation">
2 2
   <ul>
3  
-    <?php if($sf_user->hasCredential('idProject-Create')): ?>
  3
+    <?php if($sf_user->isAdmin() || $sf_user->isProjectManager()): ?>
4 4
       <li class="first active"><?php echo link_to( __('Create new project'), '@new_project') ?></li>
5  
-      <?php if($action == 'show' && $sf_user->isAdmin()): ?>
  5
+      <?php if($action == 'show'): ?>
6 6
         <li><?php echo link_to( __('Add user(s)'), '@edit_project?id='.$sf_request->getParameter('id')) ?></li>
7 7
       <?php endif; ?>
8 8
     <?php else: ?>
@@ -19,10 +19,7 @@
19 19
       <li><?php echo link_to(__('Create issue'), '@new_issue?project_id='.$sf_request->getParameter('id')) ?></li>
20 20
       <li><?php echo link_to( __('View all issues'), '@index_issue?project_id='.$sf_request->getParameter('id')) ?></li>
21 21
       <li><?php echo link_to( __('View all milestones'), '@index_milestone?project_id='.$sf_request->getParameter('id')) ?></li>
22  
-
23  
-      <?php if($sf_user->hasCredential('idMessage-Read')): ?>
24  
-        <li><?php echo link_to( __('Messages'), '@index_messages?project_id='.$sf_request->getParameter('id')) ?></li>
25  
-      <?php endif; ?>
  22
+      <li><?php echo link_to( __('Messages'), '@index_messages?project_id='.$sf_request->getParameter('id')) ?></li>
26 23
     <?php endif; ?>
27 24
   </ul>
28 25
   <div class="clear"></div>
18  plugins/idProjectManagementPlugin/modules/idStatus/actions/actions.class.php
@@ -34,8 +34,7 @@ protected function getQueryForStatusesList()
34 34
    */
35 35
   public function executeIndex(sfWebRequest $request)
36 36
   {
37  
-    $this->forwardUnless($this->getUser()->hasCredential('idStatus-Read'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
38  
-
  37
+    $this->forwardUnless(($this->getUser()->isAdmin() || $this->getUser()->isProjectManager()), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
39 38
     $this->status_list = $this->getQueryForStatusesList()->execute();
40 39
   }
41 40
 
@@ -67,8 +66,6 @@ private function checkPositionParameters($status_list, $ordering_list)
67 66
    */
68 67
   public function executeOrder(sfWebRequest $request)
69 68
   {
70  
-    if ($this->getUser()->hasCredential('idStatus-Edit'))
71  
-    {
72 69
       $ordering_list = $request->getParameter('status');
73 70
       if (!is_null($ordering_list) && !empty($ordering_list))
74 71
       {
@@ -87,7 +84,6 @@ public function executeOrder(sfWebRequest $request)
87 84
 
88 85
         return $this->renderPartial('idPriority/order_message', array('response_message' => 'Order updated', 'class' => 'message notice'));
89 86
       }
90  
-    }
91 87
 
92 88
     return $this->renderPartial('idPriority/order_message', array('response_message' => 'Invalid request', 'class' => 'message warning'));
93 89
   }
@@ -109,8 +105,6 @@ protected function switchFirstAndSecondPositions($statuses)
109 105
    */
110 106
   public function executeOrderStatus(sfWebRequest $request)
111 107
   {
112  
-    $this->forwardUnless($this->getUser()->hasCredential('idStatus-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
113  
-
114 108
     $highest_position = Doctrine::getTable('Status')->retrieveHighestPosition();
115 109
     if (!is_null($request->getParameter('position'))
116 110
                             && $request->getParameter('position') <= $highest_position
@@ -145,8 +139,6 @@ public function executeOrderStatus(sfWebRequest $request)
145 139
    */
146 140
   public function executeNew(sfWebRequest $request)
147 141
   {
148  
-    $this->forwardUnless($this->getUser()->hasCredential('idStatus-Create'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
149  
-
150 142
     $this->form = new StatusForm();
151 143
     $this->setTemplate('edit');
152 144
   }
@@ -158,8 +150,6 @@ public function executeNew(sfWebRequest $request)
158 150
    */
159 151
   public function executeCreate(sfWebRequest $request)
160 152
   {
161  
-    $this->forwardUnless($this->getUser()->hasCredential('idStatus-Create'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
162  
-
163 153
     $this->forward404Unless($request->isMethod('post'));
164 154
 
165 155
     $this->form = new StatusForm();
@@ -176,8 +166,6 @@ public function executeCreate(sfWebRequest $request)
176 166
    */
177 167
   public function executeEdit(sfWebRequest $request)
178 168
   {
179  
-    $this->forwardUnless($this->getUser()->hasCredential('idStatus-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
180  
-
181 169
     $this->forward404Unless($status = Doctrine::getTable('Status')->find(array($request->getParameter('id'))), sprintf('Object status does not exist (%s).', array($request->getParameter('id'))));
182 170
     $this->form = new StatusForm($status);
183 171
   }
@@ -189,8 +177,6 @@ public function executeEdit(sfWebRequest $request)
189 177
    */
190 178
   public function executeUpdate(sfWebRequest $request)
191 179
   {
192  
-    $this->forwardUnless($this->getUser()->hasCredential('idStatus-Edit'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
193  
-    
194 180
     $this->forward404Unless($request->isMethod('post') || $request->isMethod('put'));
195 181
     $this->forward404Unless($status = Doctrine::getTable('Status')->find(array($request->getParameter('id'))), sprintf('Object status does not exist (%s).', array($request->getParameter('id'))));
196 182
     $this->form = new StatusForm($status);
@@ -224,8 +210,6 @@ protected function checkAndFixPriorityPositions()
224 210
    */
225 211
   public function executeDelete(sfWebRequest $request)
226 212
   {
227  
-    $this->forwardUnless($this->getUser()->hasCredential('idStatus-Delete'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
228  
-
229 213
     $request->checkCSRFProtection();
230 214
 
231 215
     $this->forward404Unless($status = Doctrine::getTable('Status')->find(array($request->getParameter('id'))), sprintf('Object status does not exist (%s).', array($request->getParameter('id'))));
7  plugins/idProjectManagementPlugin/modules/idTracker/actions/actions.class.php
@@ -12,8 +12,6 @@ class idTrackerActions extends sfActions
12 12
 {
13 13
   public function executeIndex(sfWebRequest $request)
14 14
   {
15  
-    $this->forwardUnless($this->getUser()->hasCredential('idTracker-Read'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
16  
-
17 15
     $this->pager = new sfDoctrinePager('Tracker',10);
18 16
     $this->pager->setQuery(Doctrine::getTable('Tracker')->createQuery('a'));
19 17
     $this->pager->setMaxPerPage(sfConfig::get('mod_maxperpage_trakers', 10));
@@ -24,13 +22,11 @@ public function executeIndex(sfWebRequest $request)
24 22
 
25 23
   public function executeNew(sfWebRequest $request)
26 24
   {
27  
-    $this->forwardUnless($this->getUser()->hasCredential('idTracker-Create'), sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
28 25
     $this->form = new TrackerForm();