Changeset 17849
- Timestamp:
- 08/07/08 12:21:40 (3 weeks ago)
- Files:
-
- trunk/core/src/net/project/hibernate/dao/IPnTaskDAO.java (modified) (1 diff)
- trunk/core/src/net/project/hibernate/dao/impl/PnTaskDAOImpl.java (modified) (1 diff)
- trunk/core/src/net/project/hibernate/service/IPnTaskService.java (modified) (1 diff)
- trunk/core/src/net/project/hibernate/service/impl/PnTaskServiceImpl.java (modified) (1 diff)
- trunk/core/src/net/project/view/components/ActionBox.java (added)
- trunk/core/src/net/project/view/components/PersonalMenu.java (modified) (6 diffs)
- trunk/core/src/net/project/view/components/ProjectMenu.java (modified) (6 diffs)
- trunk/core/src/net/project/view/pages/blog/AddWebLogEntry.java (modified) (2 diffs)
- trunk/core/web/html/blog/ViewBlog.html (modified) (8 diffs)
- trunk/core/web/html/resource/management/components/ActionBox.html (added)
- trunk/core/web/html/resource/management/components/BlogLayout.html (modified) (1 diff)
- trunk/core/web/html/resource/management/components/PersonalMenu.html (modified) (5 diffs)
- trunk/core/web/html/resource/management/components/ProjectMenu.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/core/src/net/project/hibernate/dao/IPnTaskDAO.java
r17252 r17849 31 31 */ 32 32 public List<PnTask> getProjectMilestones(Integer projectId, boolean onlyWithoutPhases); 33 34 /** 35 * Method to get project id of the task which resides in that project 36 * @param taskId task identifier 37 * @return project identifier 38 */ 39 public Integer getProjectByTaskId(Integer taskId); 33 40 } trunk/core/src/net/project/hibernate/dao/impl/PnTaskDAOImpl.java
r17252 r17849 92 92 93 93 94 /* (non-Javadoc) 95 * @see net.project.hibernate.dao.IPnTaskDAO#getProjectByTaskId(java.lang.Integer) 96 */ 97 public Integer getProjectByTaskId(Integer taskId) { 98 Integer projectId = null; 99 100 String sql = " SELECT ps.projectId FROM PnPlan pp, PnPlanHasTask pht, PnProjectSpace ps, PnSpaceHasPlan shp "+ 101 " WHERE pp.planId = pht.comp_id.planId AND shp.comp_id.planId = pht.comp_id.planId "+ 102 " AND shp.comp_id.spaceId = ps.projectId AND pht.comp_id.taskId = :taskId "; 103 104 try { 105 Query query = getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery(sql); 106 query.setInteger("taskId", taskId); 107 projectId = (Integer) query.uniqueResult(); 108 } catch (Exception e) { 109 log.error("Error occurred while getting project id by task id : " + e.getMessage()); 110 e.printStackTrace(); 111 } 112 return projectId; 113 } 94 114 95 115 } trunk/core/src/net/project/hibernate/service/IPnTaskService.java
r17252 r17849 30 30 public List<PnTask> getProjectMilestones(Integer projectId, boolean onlyWithoutPhases); 31 31 32 public Integer getProjectByTaskId(Integer taskId); 32 33 } trunk/core/src/net/project/hibernate/service/impl/PnTaskServiceImpl.java
r17252 r17849 47 47 } 48 48 49 /* (non-Javadoc) 50 * @see net.project.hibernate.service.IPnTaskService#getProjectByTaskId(java.lang.Integer) 51 */ 52 public Integer getProjectByTaskId(Integer taskId) { 53 return pnTaskDAO.getProjectByTaskId(taskId); 54 } 49 55 50 56 } trunk/core/src/net/project/view/components/PersonalMenu.java
r17829 r17849 57 57 private boolean displayConfigurationSpace; 58 58 59 private boolean isBlogPage; 60 59 61 private String dashboard; 60 62 … … 96 98 97 99 private String toolbar; 100 101 private Integer moduleId; 98 102 99 103 @InjectPage 100 104 private ViewBlog blog; 101 105 102 106 @SetupRender 103 107 void setValues() { … … 108 112 log = Logger.getLogger(ProjectMenu.class); 109 113 JSPRootURL = SessionManager.getJSPRootURL(); 114 if(blog != null){ 115 isBlogPage = true; 116 moduleId = blog.getModuleId(); 117 } 110 118 user = SessionManager.getUser(); 119 // conditions for showing links on menu 111 120 dashboardIsenabled = getBooleanValue(PropertyProvider.get("prm.personal.dashboard.isenabled")); 112 121 calendarIsenabled = getBooleanValue(PropertyProvider.get("prm.personal.calendar.isenabled")); … … 117 126 methodologyIsenabled = getBooleanValue(PropertyProvider.get("prm.personal.methodology.isenabled")); 118 127 setupIsenabled = getBooleanValue(PropertyProvider.get("prm.personal.setup.isenabled")); 119 masterPropertiesExist = MasterProperties.masterPropertiesExist(); 120 isLicenseRequiredAtLogin = LicenseProperties.getInstance().isLicenseRequiredAtLogin(); 121 128 122 129 // Determine whether or not the application space will be displayed. 123 130 displayApplicationSpace = ApplicationSpace.DEFAULT_APPLICATION_SPACE.isUserSpaceMember(user); … … 146 153 applicationSpaceModule = Module.APPLICATION_SPACE; 147 154 configurationSpaceModule = Module.CONFIGURATION_SPACE; 148 userCurrentSpaceId = SessionManager.getUser().getCurrentSpace().getID(); 149 userId = SessionManager.getUser().getID(); 150 setToolbar("standard"); 155 userCurrentSpaceId = user.getCurrentSpace().getID(); 156 userId = user.getID(); 157 158 masterPropertiesExist = MasterProperties.masterPropertiesExist(); 159 isLicenseRequiredAtLogin = LicenseProperties.getInstance().isLicenseRequiredAtLogin(); 151 160 } catch (Exception e) { 152 161 log.error("Error occured while getting property tokens for project menu : " + e.getMessage()); 153 162 } 154 } 155 156 /** 157 * @param toolbar the toolbar to set 158 */ 159 public void setToolbar(String name) { 160 Toolbar toolbar = new Toolbar(); 161 try { 162 toolbar.setStyle("tooltitle"); 163 toolbar.setShowAll(false); 164 toolbar.setGroupTitle("Blog: "+blog.getUserWeblog().getName()); 165 Band toolBand = toolbar.addBand(name); 166 toolBand.addButton("help"); 167 toolBand.addButton("blogit"); 168 toolBand.addButton("refresh"); 169 this.toolbar = toolbar.getPresentation(); 170 } catch (ToolbarException pnetEx) { 171 pnetEx.printStackTrace(); 172 } 173 } 163 } 174 164 175 165 boolean getBooleanValue(String stringValue){ … … 399 389 public String getAssignment() { 400 390 return assignment; 391 } 392 393 /** 394 * @return the moduleId 395 */ 396 public Integer getModuleId() { 397 return moduleId; 398 } 399 400 /** 401 * @return the isBlogPage 402 */ 403 public boolean getIsBlogPage() { 404 return isBlogPage; 401 405 } 402 406 trunk/core/src/net/project/view/components/ProjectMenu.java
r17829 r17849 54 54 private boolean setupIsenabled; 55 55 56 private boolean isBlogPage; 57 56 58 private String directory; 57 59 … … 109 111 110 112 private String toolbar; 113 114 private Integer moduleId; 111 115 112 116 @InjectPage … … 121 125 log = Logger.getLogger(ProjectMenu.class); 122 126 JSPRootURL = SessionManager.getJSPRootURL(); 127 if(blog != null){ 128 isBlogPage = true; 129 moduleId = blog.getModuleId(); 130 } 123 131 // conditions for showing links on menu 124 132 contactIsenabled = getBooleanValue(PropertyProvider.get("prm.project.contact.isenabled")); … … 165 173 userCurrentSpaceId = SessionManager.getUser().getCurrentSpace().getID(); 166 174 userId = SessionManager.getUser().getID(); 167 setToolbar("standard");168 175 } catch (Exception e) { 169 176 log.error("Error occured while getting property tokens for project menu : " + e.getMessage()); … … 171 178 } 172 179 173 /**174 * @param toolbar the toolbar to set175 */176 public void setToolbar(String name) {177 Toolbar toolbar = new Toolbar();178 try {179 toolbar.setStyle("tooltitle");180 toolbar.setShowAll(false);181 toolbar.setGroupTitle("Blog: "+blog.getUserWeblog().getName());182 Band toolBand = toolbar.addBand(name);183 toolBand.addButton("help");184 toolBand.addButton("blogit");185 toolBand.addButton("refresh");186 this.toolbar = toolbar.getPresentation();187 } catch (ToolbarException pnetEx) {188 pnetEx.printStackTrace();189 }190 }191 192 180 boolean getBooleanValue(String stringValue){ 193 181 return stringValue.equals("1") || stringValue.equals("true") ? true : false; … … 487 475 return directoryIsenabled; 488 476 } 477 478 /** 479 * @return the moduleId 480 */ 481 public Integer getModuleId() { 482 return moduleId; 483 } 484 485 /** 486 * @return the isBlogPage 487 */ 488 public boolean getIsBlogPage() { 489 return isBlogPage; 490 } 489 491 490 492 } trunk/core/src/net/project/view/pages/blog/AddWebLogEntry.java
r17767 r17849 362 362 Integer blogEntryId = null; 363 363 try { 364 if(objectId != null && objectId != 0){ 364 if(objectId != null && objectId != 0){ 365 365 getObjectDetails(objectId); 366 366 } … … 368 368 setWeblog(blogProvider.getWeblogBySpaceId(objectId)); 369 369 } else { 370 if(getObjectDetails()[0].equalsIgnoreCase("taskId")){ 371 try { 372 IPnTaskService taskService = ServiceFactory.getInstance().getPnTaskService(); 373 spaceId = taskService.getProjectByTaskId(objectId); 374 } catch (Exception e) { 375 log.error("Error occurred while getting project id by task id " + e.getMessage()); 376 } 377 } 370 378 setWeblog(blogProvider.getWeblogBySpaceId(spaceId)); 371 379 } trunk/core/web/html/blog/ViewBlog.html
r17806 r17849 8 8 </t:parameter> 9 9 </t:if> 10 <div id="filtersDiv" style="position: absolute; left: 300px; top: 100px; z-index: 1;" /> 10 11 <t:ActionBox groupTitle="Blog: ${userWeblog.name}" buttons="blogit,help,refresh" /> 12 13 <div style="position: absolute; top: 90px; left: 245px; color: #FF9900; font-family: Arial; font-weight: bold; font-size: 3;">${date}</div> 14 15 <div id="filtersDiv" style="position: absolute; left: 235px; top: 110px; z-index: 1;" /> 16 11 17 <!-- Left Side Div Starts --> 12 <div style="left: 5px; top: 86px; position: absolute; width: 25%; height: 100%;"> 13 <div style="left: 8px; position: absolute; color: #FF9900; font-family: Arial; font-weight: bold; font-size: 3;">${date}</div> 14 <br /> 18 <div style="left: 5px; top: 86px; position: absolute; width: 25%; height: 100%; display: none;"> 15 19 <table width="100%" height="100%"> 16 20 <tr height="100%"> 17 21 <td width="99%" valign="top"> 18 22 <table width="100%"> 19 <!-- Blog Details -->23 <!-- Blog Details 20 24 <tr valign="top"><td> 21 25 <div id="blogDetails" style="height: 80px; width: 240px; overflow-Y: auto; overflow-X: hidden; background: #CCCCCC;"> … … 35 39 </t:parameter> 36 40 </t:if> 37 </tr> 41 </tr> --> 38 42 <!-- tr><td height="5"></td></tr> 39 43 <tr valign="top"> 40 44 <td align="left" width="60%" style="font-family:Arial;font-size:3;font-weight:bold;">Description: ${userWeblog.description}</td> 41 45 </tr--> 42 < /table>46 <!-- /table> 43 47 </div> 44 48 </td></tr> … … 49 53 </tr> 50 54 51 <tr><td height="20"></td></tr >55 <tr><td height="20"></td></tr --> 52 56 53 57 <!-- tr valign="top"><td align="left"><h2>Search Project Blog </h2></td></tr> … … 69 73 <tr><td height="10"></td></tr --> 70 74 71 < t:if test="fullView">75 <!-- t:if test="fullView"> 72 76 <tr valign="top"> 73 77 <td align="left"> … … 86 90 </tr> 87 91 </t:parameter> 88 </t:if >92 </t:if --> 89 93 90 94 … … 158 162 </table> 159 163 </td> 160 < t:if test="linkToPersonSpace">164 <!-- t:if test="linkToPersonSpace"> 161 165 <td width="1%" bgcolor="#FFCC33" /> 162 166 <t:parameter name="else"> 163 167 <td width="1%" bgcolor="#CCCCFF" /> 164 168 </t:parameter> 165 </t:if >169 </t:if --> 166 170 </tr> 167 171 </table> … … 169 173 170 174 <!-- Blog content starts here --> 171 <div id="blog-content" style="height: 75%; width: 758px; position: absolute; left: 265px; top: 115px; overflow-Y: scroll; overflow-X: hidden;">175 <div id="blog-content" style="height: auto; width: 72%; position: absolute; left: 180px; top: 125px;"> <!-- left: 265px; overflow-Y: scroll; overflow-X: hidden; --> 172 176 173 177 <!-- Middle content Div Starts --> 174 <div id="middleDiv" style="height: 100%; position: absolute; left: 80px; top: 15px; bottom: 10px;">178 <div id="middleDiv" style="height: 100%; width: 100%; position: absolute; left: 80px; top: 15px;"> 175 179 <div style="font-family: Arial; font-weight: bold; color: red;"> ${message}</div> 176 <table width=" 600px" height="100%" align="left">180 <table width="100%" height="100%" align="left"> 177 181 <tr height="100%"> 178 182 <td width="0%"><!-- Space for photos --></td> 179 183 <td valign="top"> 180 <table width=" 550px">184 <table width="100%"> 181 185 <tr> 182 186 <td> … … 310 314 </td> 311 315 </tr> 312 < tr><td colspan="2"><t:Footer /></td></tr>316 <!-- tr><td colspan="2"><t:Footer /></td></tr --> 313 317 </table> 314 318 </td> trunk/core/web/html/resource/management/components/BlogLayout.html
r17829 r17849 109 109 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 110 110 </head> 111 <body onload="main_toolbar_setup();" class="main" id=" tBodyWithFixedAreasSupport">111 <body onload="main_toolbar_setup();" class="main" id="bodyWithFixedAreasSupport"> 112 112 <t:body /> 113 113 </body> trunk/core/web/html/resource/management/components/PersonalMenu.html
r17829 r17849 12 12 var methodologyIsenabled = '${methodologyIsenabled}'; 13 13 var setupIsenabled = '${setupIsenabled}'; 14 var masterPropertiesExist = ${masterPropertiesExist}; 15 var isLicenseRequiredAtLogin = ${isLicenseRequiredAtLogin}; 14 16 15 var displayApplicationSpace = '${displayApplicationSpace}' 17 16 var displayConfigurationSpace = '${displayConfigurationSpace}'; … … 42 41 var index = 0; 43 42 var personalMenu = new Array(); 43 44 var masterPropertiesExist = ${masterPropertiesExist}; 45 var isLicenseRequiredAtLogin = ${isLicenseRequiredAtLogin}; 44 46 </script> 45 47 … … 59 61 <t:if test="assignmentsIsenabled"> 60 62 <span><a href="${jSPRootURL}/servlet/AssignmentController/PersonalAssignments?module=${personalModule}">${assignment}</a></span> 63 <span><a href="${jSPRootURL}/assignments/My?module=${personalModule}">Assignments (Beta)</a></span> 61 64 </t:if> 62 65 … … 100 103 101 104 <div class="menu-subpersonal-end"> </div> 105 </div> 102 106 107 <!-- div style='clear: both'></div> 103 108 <t:OutputRaw value="toolbar" /> 109 110 <t:if test="isBlogPage"> 111 <div style='clear: both'></div> 112 <div class="left_column_bottom"> 113 <div class="left_column_top" style="margin-top: 25px;"> 114 <div id="actionbox-item" class="actionbox-item"> 115 <span><a href="${jSPRootURL}/blog/view/get_titles_only?module=${moduleId}"> Titles only </a></span> <br /> 116 <span><a href="${jSPRootURL}/blog/view/get_full_entries?module=${moduleId}"> Full entries </a></span> <br /> 117 </div> 118 </div> 119 </div> 120 </t:if --> 104 121 105 122 <!-- table border="0" width="100%" cellpadding="0" cellspacing="0"> … … 110 127 </tr> 111 128 </table --> 112 </div>113 114 129 <!-- script type="text/javascript" src="${JSPRootURL}/src/PersonalMenu.js" /> 115 130 <div style="left: 0px; top: 60px; position: absolute; width: 100%;"> trunk/core/web/html/resource/management/components/ProjectMenu.html
r17829 r17849 124 124 <div class="menu-subprojects-end"> </div> 125 125 126 </div> 127 128 <!--div style='clear: both'></div> 129 126 130 <t:OutputRaw value="toolbar" /> 131 132 <t:if test="isBlogPage"> 133 <div style='clear: both'></div> 134 <div class="left_column_bottom"> 135 <div class="left_column_top" style="margin-top: 25px;"> 136 <div id="actionbox-item" class="actionbox-item"> 137 <span><a href="${jSPRootURL}/blog/view/get_titles_only?module=${moduleId}"> Titles only </a></span> <br /> 138 <span><a href="${jSPRootURL}/blog/view/get_full_entries?module=${moduleId}"> Full entries </a></span> <br /> 139 </div> 140 </div> 141 </div> 142 </t:if --> 127 143 128 144 <!-- table border="0" width="100%" cellpadding="0" cellspacing="0"> … … 133 149 </tr> 134 150 </table --> 135 </div>136 151 137 152 <!-- script type="text/javascript" src="${JSPRootURL}/src/ProjectMenu.js" />
