Changeset 5964
- Timestamp:
- Feb 15, 2012, 2:59:24 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/test/roles/index.html
r5886 r5964 593 593 594 594 <li> 595 Create protocols :595 Create protocols (keep the 'Set as project default' option checked): 596 596 <table class="listing" cellspacing="0" cellpadding="2" border="0"> 597 597 <tr> … … 654 654 655 655 <li> 656 Create hardware :656 Create hardware (keep the 'Set as project default' option checked): 657 657 <table class="listing" cellspacing="0" cellpadding="2" border="0"> 658 658 <tr> … … 685 685 686 686 <li> 687 Create software :687 Create software (keep the 'Set as project default' option checked): 688 688 <table class="listing" cellspacing="0" cellpadding="2" border="0"> 689 689 <tr> … … 1256 1256 1257 1257 <li> 1258 Create array designs and upload data files to them: 1258 Create array designs and upload data files to them. Keep the 'Set as project default' option checked 1259 if doing this manually. 1259 1260 <table class="listing" cellspacing="0" cellpadding="2" border="0"> 1260 1261 <tr> … … 1327 1328 Set project defaults. Go to the projects page and edit the 1328 1329 <code>Project A</code> project. On the <code>Defaults</code> 1329 tab, set the following defaults: 1330 tab, set the following defaults. NOTE! Most of the items in this 1331 list should already be registered as default items if the 1332 'Set as project default' option was used when creating the new items. 1330 1333 1331 1334 <table class="listing" cellspacing="0" cellpadding="2" border="0"> -
trunk/src/core/net/sf/basedb/core/Keyring.java
r5934 r5964 748 748 749 749 /** 750 Get the max project permission within the currently active project. 751 */ 752 int getMaxProjectPermission() 753 { 754 return maxProjectPermission; 755 } 756 757 /** 750 758 Set the active project. 751 759 @param projectData The project to make active, or null to -
trunk/src/core/net/sf/basedb/core/SessionControl.java
r5829 r5964 894 894 895 895 /** 896 Get the permissions that the logged in user has in the currently active project. 897 @return A Set with the permissions 898 @since 3.1 899 */ 900 public Set<Permission> getActiveProjectPermissions() 901 { 902 return Permission.fromInt(loginInfo == null ? 0 : loginInfo.keyring.getMaxProjectPermission()); 903 } 904 905 906 907 /** 896 908 Create a new session control for executing a plugin. 897 909 @param plugin The plugin to execute -
trunk/www/admin/hardware/edit_hardware.jsp
r5946 r5964 217 217 </td> 218 218 </tr> 219 <% 220 if (sc.getActiveProjectId() != 0 && hardware == null && sc.getActiveProjectPermissions().contains(Permission.WRITE)) 221 { 222 %> 223 <tr> 224 <th></th> 225 <td> 226 <input type="checkbox" id="setAsProjectDefault" name="setAsProjectDefault" value="1" 227 checked><label for="setAsProjectDefault">Set as project default</label> 228 </td> 229 <td></td> 230 </tr> 231 <% 232 } 233 %> 219 234 </table> 220 235 </t:tab> -
trunk/www/admin/hardware/index.jsp
r5643 r5964 30 30 import="net.sf.basedb.core.Include" 31 31 import="net.sf.basedb.core.Hardware" 32 import="net.sf.basedb.core.Project" 32 33 import="net.sf.basedb.core.ItemSubtype" 33 34 import="net.sf.basedb.core.ItemQuery" … … 140 141 message = "Hardware created"; 141 142 dc.saveItem(hardware); 143 if (Values.getBoolean("setAsProjectDefault")) 144 { 145 Project.getById(dc, sc.getActiveProjectId()).addDefaultItem(hardware); 146 } 142 147 } 143 148 else -
trunk/www/admin/protocols/edit_protocol.jsp
r5949 r5964 341 341 </td> 342 342 </tr> 343 <% 344 if (sc.getActiveProjectId() != 0 && protocol == null && sc.getActiveProjectPermissions().contains(Permission.WRITE)) 345 { 346 %> 347 <tr> 348 <th></th> 349 <td> 350 <input type="checkbox" id="setAsProjectDefault" name="setAsProjectDefault" value="1" 351 checked><label for="setAsProjectDefault">Set as project default</label> 352 </td> 353 <td></td> 354 </tr> 355 <% 356 } 357 %> 343 358 </table> 344 359 </t:tab> -
trunk/www/admin/protocols/index.jsp
r5643 r5964 30 30 import="net.sf.basedb.core.Include" 31 31 import="net.sf.basedb.core.Protocol" 32 import="net.sf.basedb.core.Project" 32 33 import="net.sf.basedb.core.ItemSubtype" 33 34 import="net.sf.basedb.core.AnnotationType" … … 142 143 message = "Protocol created"; 143 144 dc.saveItem(protocol); 145 if (Values.getBoolean("setAsProjectDefault")) 146 { 147 Project.getById(dc, sc.getActiveProjectId()).addDefaultItem(protocol); 148 } 144 149 } 145 150 else -
trunk/www/admin/software/edit_software.jsp
r5946 r5964 218 218 </td> 219 219 </tr> 220 <% 221 if (sc.getActiveProjectId() != 0 && software == null && sc.getActiveProjectPermissions().contains(Permission.WRITE)) 222 { 223 %> 224 <tr> 225 <th></th> 226 <td> 227 <input type="checkbox" id="setAsProjectDefault" name="setAsProjectDefault" value="1" 228 checked><label for="setAsProjectDefault">Set as project default</label> 229 </td> 230 <td></td> 231 </tr> 232 <% 233 } 234 %> 220 235 </table> 221 236 </t:tab> -
trunk/www/admin/software/index.jsp
r5643 r5964 30 30 import="net.sf.basedb.core.Include" 31 31 import="net.sf.basedb.core.Software" 32 import="net.sf.basedb.core.Project" 32 33 import="net.sf.basedb.core.ItemSubtype" 33 34 import="net.sf.basedb.core.ItemQuery" … … 139 140 software = Software.getNew(dc); 140 141 message = "Software created"; 142 if (Values.getBoolean("setAsProjectDefault")) 143 { 144 Project.getById(dc, sc.getActiveProjectId()).addDefaultItem(software); 145 } 141 146 dc.saveItem(software); 142 147 } -
trunk/www/lims/arraydesigns/edit_design.jsp
r5946 r5964 348 348 </td> 349 349 </tr> 350 <% 351 if (sc.getActiveProjectId() != 0 && design == null && sc.getActiveProjectPermissions().contains(Permission.WRITE)) 352 { 353 %> 354 <tr> 355 <th></th> 356 <td> 357 <input type="checkbox" id="setAsProjectDefault" name="setAsProjectDefault" value="1" 358 checked><label for="setAsProjectDefault">Set as project default</label> 359 </td> 360 <td></td> 361 </tr> 362 <% 363 } 364 %> 350 365 </table> 351 366 </t:tab> -
trunk/www/lims/arraydesigns/index.jsp
r5630 r5964 32 32 import="net.sf.basedb.core.ArrayBatch" 33 33 import="net.sf.basedb.core.ArrayDesign" 34 import="net.sf.basedb.core.Project" 34 35 import="net.sf.basedb.core.Platform" 35 36 import="net.sf.basedb.core.PlatformVariant" … … 184 185 message = "Array design created"; 185 186 dc.saveItem(design); 187 if (Values.getBoolean("setAsProjectDefault")) 188 { 189 Project.getById(dc, sc.getActiveProjectId()).addDefaultItem(design); 190 } 186 191 } 187 192 else
Note: See TracChangeset
for help on using the changeset viewer.